GaryFrost Posted February 10, 2006 Share Posted February 10, 2006 (edited) Thought I would see if it could be done, and yes it canJust started it last night, don't have time right now to finish it, only made 2 functions for it so far.Started playing around with this a bit more, had a few minutes.Supports urlsAdded:_GUICtrlRichEditAppendText_GUICtrlRichEditInsertText_GUICtrlRichEditGetText_GUICtrlRichEditGetSel_GUICtrlRichEditSetSel_GUICtrlRichEditGetLineCount_GUICtrlRichEditLineIndex_GUICtrlRichEditLineLength;=============================================================================== ; ; Description: _GUICtrlRichEditCreate ; Parameter(s): $h_Gui - Handle to parent window ; $x - The left side of the control ; $y - The top of the control ; $width - The width of the control ; $height - The height of the control ; $v_styles - styles to apply to the control (Optional) for multiple styles bitor them. ; $v_exstyles - extended styles to apply to the control (Optional) for multiple styles bitor them. ; Requirement: ; Return Value(s): Returns hWhnd if successful, or 0 with error set to 1 otherwise. ; User CallTip: _GUICtrlRichEditCreate($h_Gui, $x, $y, $width, $height, [, $v_styles = -1[, $v_exstyles = -1]]) Creates RichEdit Control. ; Author(s): Gary Frost (gafrost (custompcs@charter.net)) ; Note(s): ;=============================================================================== _GUICtrlRichEditCreate(ByRef $h_Gui, $x, $y, $width, $height, $v_styles = -1, $v_exstyles = -1);=============================================================================== ; ; Description: _GUICtrlRichEditSetText ; Parameter(s): $h_RichEdit - Handle to the control ; $s_Text - Text to put into the control ; Requirement: ; Return Value(s): If the operation is setting all of the text and succeeds. ; he return value is 1 ; If the operation is setting the selection and succeeds, ; the return value is the number of bytes or characters copied. ; If the operation fails, the return value is zero. ; User CallTip: _GUICtrlRichEditSetText($h_Gui, $s_Text) Put text into the RichEdit Control. ; Author(s): Gary Frost (gafrost (custompcs@charter.net)) ; Note(s): ;=============================================================================== _GUICtrlRichEditSetText(ByRef $h_RichEdit, $s_Text)Gary http://www.autoitscript.com/fileman/users/gafrost/projects/GUIRichEdit/RichEdit_Example.au3http://www.autoitscript.com/fileman/users/gafrost/projects/GUIRichEdit/GuiRichEdit.au3 Edited June 2, 2007 by gafrost SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
Gene Posted February 10, 2006 Share Posted February 10, 2006 Thanks, I'm sure a number of other people will appreciate this too! Gene Thought I would see if it could be done, and yes it can Just started it last night, don't have time right now to finish it, only made 2 functions for it so far. ;=============================================================================== ; ; Description: _GuiCtrlRichEditCreate ; Parameter(s): $h_Gui - Handle to parent window ; $x - The left side of the control ; $y - The top of the control ; $width - The width of the control ; $height - The height of the control ; $v_styles - styles to apply to the control (Optional) for multiple styles bitor them. ; $v_exstyles - extended styles to apply to the control (Optional) for multiple styles bitor them. ; Requirement: ; Return Value(s): Returns hWhnd if successful, or 0 with error set to 1 otherwise. ; User CallTip: _GuiCtrlRichEditCreate($h_Gui, $x, $y, $width, $height, [, $v_styles = -1[, $v_exstyles = -1]]) Creates RichEdit Control. ; Author(s): Gary Frost (gafrost (custompcs@charter.net)) ; Note(s): ;=============================================================================== _GuiCtrlRichEditCreate(ByRef $h_Gui, $x, $y, $width, $height, $v_styles = -1, $v_exstyles = -1) ;=============================================================================== ; ; Description: _GuiCtrlRichEditSetText ; Parameter(s): $h_RichEdit - Handle to the control ; $s_Text - Text to put into the control ; Requirement: ; Return Value(s): If the operation is setting all of the text and succeeds. ; he return value is 1 ; If the operation is setting the selection and succeeds, ; the return value is the number of bytes or characters copied. ; If the operation fails, the return value is zero. ; User CallTip: _GuiCtrlRichEditSetText($h_Gui, $s_Text) Put text into the RichEdit Control. ; Author(s): Gary Frost (gafrost (custompcs@charter.net)) ; Note(s): ;=============================================================================== _GuiCtrlRichEditSetText(ByRef $h_RichEdit, $s_Text) Gary [font="Verdana"]Thanks for the response.Gene[/font]Yes, I know the punctuation is not right... Link to comment Share on other sites More sharing options...
randallc Posted February 11, 2006 Share Posted February 11, 2006 Hi, Looks fantastic. Will I be able to get text out of rtf with this? Starnge that the Obj control I can't get (permission prob?), but your dll works...?! thanks, Randall ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
GaryFrost Posted February 11, 2006 Author Share Posted February 11, 2006 Hi,Looks fantastic.Will I be able to get text out of rtf with this?Starnge that the Obj control I can't get (permission prob?), but your dll works...?!thanks, Randall Currently, not that I know of, need to be able to do a EditStreamCallback callback with EM_STREAMIN, EM_STREAMOUT using a Pointer to an EditStreamCallback function SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
Sokko Posted February 11, 2006 Share Posted February 11, 2006 Awesome! A richtext box that doesn't require an external DLL or an arbitrary license in the registry! Gafrost, you are the man. I can't wait to see what other functions can be done with this. If the method is truly independent of any non-standard Windows files, I wouldn't be surprised if we got a whole RichEdit UDF collection included in a beta version somewhere down the line. Nice work! Link to comment Share on other sites More sharing options...
Zedna Posted April 22, 2006 Share Posted April 22, 2006 Gary really VERY nice!! I think this is the best way for implement RichEdit control into AutoIt, using standard Windows DLL RichEd20.dll and your GuiRichEdit.au3 as standard include file in AutoIt include directory.I'm looking forward to new versions/functionality ... Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Lemon.fr Posted September 2, 2006 Share Posted September 2, 2006 (edited) Is there way to have the richedit control into a tab ? i think i found a way to send formated text (fonts + colors). Edited September 2, 2006 by Lemon.fr Link to comment Share on other sites More sharing options...
theguy0000 Posted September 2, 2006 Share Posted September 2, 2006 so you can create this jkust like a normal edit, and use more than one style/color/font in the same box? awsome! The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN Link to comment Share on other sites More sharing options...
Ontosy Posted September 2, 2006 Share Posted September 2, 2006 in Win98 a receive a error in linea 7: Global Const $WM_USER = 0x400 "Can not redeclare a constant" and if i comment this line the RichText not show in the form. Link to comment Share on other sites More sharing options...
GtaSpider Posted September 2, 2006 Share Posted September 2, 2006 Hello! @ontosy: yes! on the new beta is $WM_USER already declard in "GuiConstants"! Delete this line simply! @gafrost: looks nice! i think its better then the extra dlls/ocx files! spider www.AutoIt.de - Moderator of the German AutoIt Forum Link to comment Share on other sites More sharing options...
Lemon.fr Posted September 2, 2006 Share Posted September 2, 2006 (edited) @lemon: that's what you get by reviving an old thread. Edited September 2, 2006 by Lemon.fr Link to comment Share on other sites More sharing options...
jaenster Posted October 21, 2006 Share Posted October 21, 2006 Pictures dont work in it -jaenster Link to comment Share on other sites More sharing options...
GaryFrost Posted October 21, 2006 Author Share Posted October 21, 2006 Pictures dont work in it Correct, and other things dont' work either, I haven't worked on it since Feb, not sure when I'll get back to it. SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
Valuater Posted October 21, 2006 Share Posted October 21, 2006 (edited) A.A.M. Was UDF Maniac ???? By the way, I can't get movies to work in your Rich Edit control lol 8) Edited October 21, 2006 by Valuater Link to comment Share on other sites More sharing options...
GaryFrost Posted October 21, 2006 Author Share Posted October 21, 2006 A.A.M.Was UDF Maniac????By the way, I can't get movies to work in your Rich Edit controllol8)AutoIt Anonymous Member SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
dragonlord Posted November 9, 2006 Share Posted November 9, 2006 can someone provide a sample on how 2 set different colors or font in the above rich text control ? Link to comment Share on other sites More sharing options...
RazerM Posted November 9, 2006 Share Posted November 9, 2006 I don't think gafrost can get that to work yet. I may be wrong My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop. Link to comment Share on other sites More sharing options...
Schlumpf Posted November 11, 2006 Share Posted November 11, 2006 so you can create this jkust like a normal edit, and use more than one style/color/font in the same box?awsome!possible? how? [CENTER]Sorry for my bad English... ;)[/CENTER] Link to comment Share on other sites More sharing options...
kjactive Posted November 11, 2006 Share Posted November 11, 2006 I don't know if this is what you'r looking for but this example ativate an embedded Rich component with coloured text displayed, there is a lot of Rich componets around and all with different behave and options, some can even display graphis while other has interactive programable areas to interface with so... expandcollapse popup; Author: Kåre Johansson ; AutoIt Version: 3.1.1.55 ; Description: Very Simple example: Embedding RICHTEXT object ; Needs: MSCOMCT2.OCX in system32 but it's probably already there ; Date: 3 jul 2005 #include <GUIConstants.au3> #include <Word.au3> $oRP = ObjCreate("RICHTEXT.RichtextCtrl") GUICreate("Embedded RICHTEXT control Test", 320, 200, -1, -1,BitOr($WS_OVERLAPPEDWINDOW,$WS_VISIBLE,$WS_CLIPSIBLINGS)) $TagsPageC = GuiCtrlCreateLabel('Visit Tags Page', 5, 180, 100, 15, $SS_CENTER) GuiCtrlSetFont($TagsPageC,9,400,4) GuiCtrlSetColor($TagsPageC,0x0000ff) GuiCtrlSetCursor($TagsPageC,0) $AboutC = GUICtrlCreateButton('About',105,177,70,20) $PrefsC = GUICtrlCreateButton('FontSize',175,177,70,20) $StatC = GUICtrlCreateButton('Plain Style',245,177,70,20) $GUIActiveX = GUICtrlCreateObj( $oRP, 10, 10 , 400 , 260 ) GUICtrlSetPos($GUIActiveX,10,10,300,160) With $oRP; Object tag pool .Backcolor = 2020255 .Font = 'Garamond kursiv' .text = "Hello - Au3 supports ActiveX components like the RICHTEXT thanks to SvenP" & @CRLF & 'Try write some text and quit to reload' .SelStart = 0 .SelLength = StringLen(.Text) .SelFontSize = 14 ;If FileExists("C:\RichText.rtf") Then .LoadFile("C:\RichText.rtf", 0) ;.SaveFile("C:\RichText.rtf", 0) .Enabled = True .HideSelection = False .SelStart = 49 .SelLength = 8; from start .SelColor = 1010 .SelFontSize = 18 .SelBold = True .SelItalic = True .SelUnderline = True .MousePointer = 14 .SelBullet = True EndWith GUISetState ();Show GUI While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE $oRP.SaveFile("C:\RichText.rtf", 0 ) ExitLoop Case $msg = $TagsPageC Run(@ComSpec & ' /c start http://www.myplugins.info/guids/typeinfo/typeinfo.php?clsid={3B7C8860-D78F-101B-B9B5-04021C009402}','', @SW_HIDE) Case $msg = $AboutC $oRP.AboutBox() Case $msg = $PrefsC $oRP.SelFontSize = 12 Case $msg = $StatC $oRP.SelBold = False $oRP.SelItalic = False $oRP.SelUnderline = False EndSelect WEnd $oRP = 0 GUIDelete () Exit kjactive Au3PP 4.1 - Autoit3 preprocessor, optimize speed, performance to scripts and do executes....[/url]Au3Calibur - Create libraries of commonly used code excerptsWords manipulate UDF, functions that is lent from the rexx language, topics and index file includedCustomDialog UDF to include custom made dialogs like a extended colorpick requester to scripts...[url="ftp://fritidshjemmet.com/Autoit3/SysColor.zip"]SysColor UDF a low level color library to manipulate RGB and Hex values...Shell32 UDF to Automate Windows® operating tasks from native dialog and Wizards browsers... Optimized the CodeWicard with options to generate browser code etc... Link to comment Share on other sites More sharing options...
Schlumpf Posted November 11, 2006 Share Posted November 11, 2006 I'm looking for something like this: [CENTER]Sorry for my bad English... ;)[/CENTER] Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now