c.haslam Posted January 2, 2009 Share Posted January 2, 2009 Thanks Spoiler CDebug Dumps values of variables including arrays and DLL structs, to a GUI, to the Console, and to the Clipboard Link to comment Share on other sites More sharing options...
c.haslam Posted January 2, 2009 Share Posted January 2, 2009 I propose the following code for _GUICtrlRichEdit_SetFontName(): Func _GUICtrlRichEdit_SetFontName($hWnd, $hFontName, $iSelec = True) Local $tcharformat = DllStructCreate($tagCHARFORMAT2) DllStructSetData($tcharformat, 1, DllStructGetSize($tcharformat)) ; cbSize DllStructSetData($tcharformat, 2, $CFM_FACE) ; dwMask DllStructSetData($tcharformat, 9, $hFontName) ; szFaceName Local $wParam If $iSelec Then $wParam = $SCF_SELECTION Else $wParam = $SCF_ALL EndIf Return _SendMessage($hWnd, $EM_SETCHARFORMAT, $wParam, DllStructGetPtr($tcharformat)) EndFunc This is per my reading of MSDN. The $iSelec change would affect other functions where $iSelec is a parameter. Spoiler CDebug Dumps values of variables including arrays and DLL structs, to a GUI, to the Console, and to the Clipboard Link to comment Share on other sites More sharing options...
ProgAndy Posted January 3, 2009 Author Share Posted January 3, 2009 OK, i will do that. I could also change documentation of this param, that it will only work with the SCF_ constants *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes Link to comment Share on other sites More sharing options...
c.haslam Posted January 3, 2009 Share Posted January 3, 2009 Agreed. See my PM for a better way. Spoiler CDebug Dumps values of variables including arrays and DLL structs, to a GUI, to the Console, and to the Clipboard Link to comment Share on other sites More sharing options...
sssthe1 Posted August 30, 2009 Share Posted August 30, 2009 Prog, you have done a great job. Link to comment Share on other sites More sharing options...
nooby Posted April 21, 2010 Share Posted April 21, 2010 (edited) The download link is broken I think. Anyone have GuiRichEdit.au3 ? Oh, and are active forms (checkbox or radio) possible in a RichEdit object? Can this be done by using OLE objects? Edited April 21, 2010 by nooby Link to comment Share on other sites More sharing options...
Zedna Posted April 21, 2010 Share Posted April 21, 2010 The download link is broken I think.Anyone have GuiRichEdit.au3 ?Now it's part of standard includes:"C:\Program Files\AutoIt3\Include\GuiRichEdit.au3" Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
whenBye Posted June 10, 2010 Share Posted June 10, 2010 (edited) I don't know how to add JPG,PNG... images to RichEdit as the function 'ReadBmpToRtf' in the example script of '_GUICtrlRichEdit_CanPaste'. So i use GDIPlus to help me. $lImage -> path of imagefile $hRichEdit -> handle of RichEdit _GUICtrlRichEdit_AppendImage($lImage, $hRichEdit) _GUICtrlRichEdit_AppendImageEx($lImage, $hRichEdit) expandcollapse popup#Include <GDIPlus.au3> _GDIPlus_Startup() Func _GUICtrlRichEdit_AppendImage($lImage, $hRichEdit) Local $hImage If IsPtr($lImage) Or IsInt($lImage) Then $hImage = $lImage Else $hImage = _GDIPlus_ImageLoadFromFile($lImage) EndIf Local $hBmp = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage), _ $iWidth = _GDIPlus_ImageGetWidth($hImage), _ $iHeight = _GDIPlus_ImageGetHeight($hImage), _ $iBitCount = _GDIPlus_ImageGetBitCount($hImage), _ $DIB_RGB_COLORS = 0, _ $tBMI = DllStructCreate($tagBITMAPINFO) If $iBitCount = 0 Then $iBitCount = 1 DllStructSetData($tBMI, "Size", DllStructGetSize($tBMI) - 4) DllStructSetData($tBMI, "Width", $iWidth) DllStructSetData($tBMI, "Height", $iHeight) DllStructSetData($tBMI, "Planes", 1) DllStructSetData($tBMI, "BitCount", $iBitCount) Local $hDC = _WinAPI_GetDC(0), _ $hCDC = _WinAPI_CreateCompatibleDC($hDC), _ $aDIB = DllCall('gdi32.dll', 'ptr', 'CreateDIBSection', 'ptr', 0, 'ptr', DllStructGetPtr($tBMI), 'uint', $DIB_RGB_COLORS, 'ptr*', 0, 'ptr', 0, 'uint', 0) _WinAPI_SelectObject($hCDC, $aDIB[0]) _WinAPI_GetDIBits($hDC, $hBmp, 0, $iHeight, $aDIB[4], DllStructGetPtr($tBMI), $DIB_RGB_COLORS) Local $tBits = DllStructCreate('byte[' & $iWidth * $iHeight * $iBitCount / 8 & ']', $aDIB[4]), _ $lBuffer = DllStructGetData($tBits, 1) $tBits = 0 _WinAPI_DeleteObject($aDIB[0]) _WinAPI_DeleteDC($hCDC) _WinAPI_ReleaseDC(0, $hDC) _WinAPI_DeleteObject($hBmp) _GDIPlus_ImageDispose($hImage) _GUICtrlRichEdit_AppendText($hRichEdit, _ '{\rtf1{\pict\wbitmap0\picw' & $iWidth & '\pich' & $iHeight & '\wbmbitspixel' & $iBitCount & '\wbmplanes1\wbmwidthbytes' & $iWidth * 2 & ' ' & _ StringTrimLeft($lBuffer, 2) & '}}') EndFunc Func _GUICtrlRichEdit_AppendImageEx($lImage, $hRichEdit) Local $hBitmap If IsPtr($lImage) Or IsInt($lImage) Then $hBitmap = $lImage Else $hBitmap = _GDIPlus_BitmapCreateFromFile($lImage) EndIf Local $iWidth = _GDIPlus_ImageGetWidth($hBitmap), _ $iHeight = _GDIPlus_ImageGetHeight($hBitmap) Local $tBitmapData = _GDIPlus_BitmapLockBits($hBitmap, 0, 0, $iWidth, $iHeight, $GDIP_ILMREAD, $GDIP_PXF32ARGB), _ $pScan0 = DllStructGetData($tBitmapData, 'Scan0'), _ $iStride = DllStructGetData($tBitmapData, 'Stride') Local $tBitsData = DllStructCreate('BYTE [' & $iStride * $iHeight & ']', $pScan0) $lBitsData = DllStructGetData($tBitsData, 1) $tBitsData = 0 _GDIPlus_BitmapUnlockBits($hBitmap, $tBitmapData) If IsString($lImage) Then _GDIPlus_BitmapDispose($hBitmap) _GUICtrlRichEdit_AppendText($hRichEdit, _ '{\rtf1{\pict\wbitmap0\picw' & $iWidth & '\pich' & $iHeight & '\wbmbitspixel32\wbmplanes1\wbmwidthbytes' & $iWidth * 2 & ' ' & _ StringTrimLeft($lBitsData, 2) & '}}') EndFunc Edited June 10, 2010 by whenBye Link to comment Share on other sites More sharing options...
ProgAndy Posted June 10, 2010 Author Share Posted June 10, 2010 (edited) I do not have a better solution since PNG/JPG-images require some quite difficult COM-objects and an activex-control if my memories are correct. Edited June 10, 2010 by ProgAndy *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes Link to comment Share on other sites More sharing options...
Suppir Posted June 27, 2010 Share Posted June 27, 2010 (edited) Hello! You UDF is awesome, but I have one trouble with it.I'm copying some text with MS Word' tables in RichEdit. Then I need to do search-replace with regular expressions in every text of RichEdit. But tables are crushing into plain text. Is it possible to do regex-search-replaces in text that includes word tables using your UDF? Thanks. Edited June 27, 2010 by Suppir Link to comment Share on other sites More sharing options...
ProgAndy Posted June 27, 2010 Author Share Posted June 27, 2010 I don't think RichEdit includes a RegEx-engine. You have to create something just the same way as you would do it for a normal edit. *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes Link to comment Share on other sites More sharing options...
Suppir Posted June 28, 2010 Share Posted June 28, 2010 (edited) ProgAndy I think, maybe there is the possibility to pass through each RichEdit element and do some replaces with it. Edited June 28, 2010 by Suppir Link to comment Share on other sites More sharing options...
Suppir Posted June 28, 2010 Share Posted June 28, 2010 Some text processors (OpenOffice.Org Write, etc) supports both: word tables and PCRE regexes. And this is really cool feature. Link to comment Share on other sites More sharing options...
playlet Posted December 10, 2010 Share Posted December 10, 2010 (edited) --- Edited August 18, 2016 by playlet Link to comment Share on other sites More sharing options...
mesale0077 Posted February 15, 2014 Share Posted February 15, 2014 http://progandy.co.cc/downloads/view.download/3/5 link broken ,new link please Link to comment Share on other sites More sharing options...
nyke0 Posted September 11, 2014 Share Posted September 11, 2014 outdated for newuest autoit version Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 11, 2014 Moderators Share Posted September 11, 2014 nyke0,For some time this RichEdit UDF has been incorporated into the standard AutoIt UDFs - look for the _GUICtrlRichEdit_* functions in the Help file. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
nyke0 Posted September 11, 2014 Share Posted September 11, 2014 Can you send me your RIchedit.au3? I replaced my with that old one. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 11, 2014 Moderators Share Posted September 11, 2014 nyke0,Download the current AutoIt Self Extracting Archive and you will find it inside. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area 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