Jump to content

Search the Community

Showing results for tags 'RichEdit Set Font SetFont UDF'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 1 result

  1. I've got an issue and I'm not sure if it's a bug or if I'm doing something incorrectly. I'm making a richedit tool for my script. When I choose to change the font and I have text selected it'll change the selected text but then the selected text highlight is gone and cannot be seen until changing something like the font size. It's weird, it is still selecting the text but you cannot see what you have selected. To recreate follow these steps: 1. Run the code 2. Type some text 3. Highlight the text 4. Change the font. 5. click back on the edit to see the highlighted text 6. Attempt to highlight anything in the edit field (should see the issue now) 7. Change the font size 8. Now you'll see your selection again and what was selected will have changed. #include <Color.au3> #include <GuiRichEdit.au3> #include <ButtonConstants.au3> #include <ComboConstants.au3> #include <EditConstants.au3> #include <RichEditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> AutoItSetOption("GUIOnEventMode",1) #region Main Global $iLeft = 5 Global $iTop = 20 Global $iWidth = 780 Global $iHeight = 575 Global $iFieldWidthLong = 100 Global $iFieldWidthMid = 50 Global $iFieldWidthShort = 25 Global $iDefaultHeight = 25 Global $iDefaultGap = 5 Global $guiTest = GUICreate("Test",800,600) Global $cboFont = GUICtrlCreateCombo("", $iLeft, $iTop, $iFieldWidthLong, $iDefaultHeight,BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL)) GUICtrlSetData($cboFont,"Arial|Arial Black|Comic Sans MS|Courier|Courier New|Estrangelo Edessa|Franklin Gothic Medium|Gautami|Impact|Latha|Lucida Console|Lucida Sans Console|Lucida Sans Unicode|Marlett|Modern|MS Sans Serif|MS Serif|MV Boli|Palatino Linotype|Roman|Script|Small Fonts|Symbol|Tahoma|Times New Roman|Trebuchet|Tunga|Verdana|Wingdings","Times New Roman") GUICtrlSetOnEvent($cboFont,"_fontChange") Global $cboFontSize = GUICtrlCreateCombo("", _getPositionLeftOfCtrl($guiTest, $cboFont, $iDefaultGap), $iTop, $iFieldWidthMid, $iDefaultHeight,BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL)) GUICtrlSetData($cboFontSize,"8|9|10|11|12|14|16|20|24|32|48|64|72","12") GUICtrlSetOnEvent($cboFontSize,"_fontSizeChange") Global $rhcBody = _GUICtrlRichEdit_Create($guiTest, "", $iLeft, $iTop + $iDefaultHeight + $iDefaultGap, $iWidth, $iHeight - $iDefaultHeight - $iDefaultGap, BitOR($WS_HSCROLL, $WS_VSCROLL, $ES_MULTILINE, $ES_WANTRETURN)) Global $bUndo = _GUICtrlRichEdit_SetUndoLimit($rhcBody, 1000) _GUICtrlRichEdit_SetFont($rhcBody,_getcboFontSize(),_getcboFont()) GUISetOnEvent($GUI_EVENT_CLOSE, "guiClose",$guiTest) GUISetState(@SW_SHOW,$guiTest) While 1 WEnd #endregion Main Func _fontChange() Local $avFontInfo = _GUICtrlRichEdit_GetFont($rhcBody) _GUICtrlRichEdit_SetFont($rhcBody,$avFontInfo[0],_getcboFont()) EndFunc Func _fontSizeChange() _GUICtrlRichEdit_SetFont($rhcBody,_getcboFontSize()) EndFunc Func guiClose() _GUICtrlRichEdit_Destroy($rhcBody) Exit EndFunc Func _getPositionLeftOfCtrl($hWin,$hCtrl,$iGap) Local $aiCoord = ControlGetPos($hWin,"",$hCtrl) Return $aiCoord[0] + $aiCoord[2] + $iGap EndFunc Func _getcboFont() Return GUICtrlRead($cboFont) EndFunc Func _getcboFontSize() Return GUICtrlRead($cboFontSize) EndFunc
×
×
  • Create New...