HurleyShanabarger Posted January 10, 2022 Share Posted January 10, 2022 (edited) Hi there, I changedthe status output in one of my script from Edit to RichEdit control and this is really benefical (font formatting, colors, clickable links, etc). One thing that bugs me, is the fact that I can't figure out how create a hanging indentation like in word. If I preformat the stuff in word I am able to copy it into an RichEdit control and the format stays the same: Can someone point me in the right direction to achieve that using and UDF? Edited January 10, 2022 by HurleyShanabarger Link to comment Share on other sites More sharing options...
junkew Posted January 10, 2022 Share Posted January 10, 2022 I wouldn't now directly as I dont use it frequently but I would take this approach Copy it from word to your control Save it as rtf and look at the hanging indent rtf part Then you can use that rtf part to create your hanging indent Read the UDF to see how that handles the different rtf constructs Maybe interesting not directly related but there are different versions around of that dll http://masm32.com/board/index.php?topic=5383.0 FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Link to comment Share on other sites More sharing options...
Solution HurleyShanabarger Posted January 10, 2022 Author Solution Share Posted January 10, 2022 (edited) Found the solution, _GUICtrlRichEdit_SetParaIndents does the job expandcollapse popup#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #Tidy_Parameters=/reel /sf /ri #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #Region Includes #include <GUIConstantsEx.au3> #include <GuiRichEdit.au3> #include <String.au3> #include <WindowsConstants.au3> #EndRegion Includes #Region Main Main() Func Main() ; Create GUI Local $hGui = GUICreate("RichEdit with hanging first line", 400, 400, -1, -1) Local $hEdt = _GUICtrlRichEdit_Create($hGui, "", 10, 10, 380, 380, BitOR($ES_MULTILINE, $WS_VSCROLL, $ES_AUTOVSCROLL)) ; Font and color _GUICtrlRichEdit_SetSel($hEdt, 0, -1) _GUICtrlRichEdit_SetFont($hEdt, Default, "Courier New") _GUICtrlRichEdit_SetBkColor($hEdt, 0xF0F0F0) _GUICtrlRichEdit_SetSpaceUnit("mm") Local $iIndent = 20 _GUICtrlRichEdit_SetParaIndents($hEdt, $iIndent, 0, -1 * $iIndent) ; Append text and reset selection Local $sgText = "long line, which will be broken into the next." & _StringRepeat(" The text will be aligned!", 15) _GUICtrlRichEdit_AppendText($hEdt, "[13:14:54]" & @TAB & "First " & $sgText) _GUICtrlRichEdit_AppendText($hEdt, @CRLF & "[13:14:54]" & @TAB & "Second " & $sgText) _GUICtrlRichEdit_AppendText($hEdt, @CRLF & "[13:14:54]" & @TAB & "Third " & $sgText) _GUICtrlRichEdit_AppendText($hEdt, @CRLF & "[13:14:54]" & @TAB & "Fourth " & $sgText) _GUICtrlRichEdit_SetSel($hEdt, 0, 0, False) ; Show GUI GUISetState(@SW_SHOW) ; Main loop Local $iMsg While True $iMsg = GUIGetMsg() Select Case $iMsg = $GUI_EVENT_CLOSE _GUICtrlRichEdit_Destroy($hEdt) GUIDelete() Exit EndSelect WEnd EndFunc ;==>Main #EndRegion Main Edited January 10, 2022 by HurleyShanabarger BigDaddyO 1 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