aurm Posted May 6, 2012 Share Posted May 6, 2012 Hi Melba I tried the script below and it worked well , the weird thing is that It didn't work for the labels , and to confuse me more : when I changed the last parameter (label size) to "400" instead of "200" it worked fine ! so I guess I will work with the 400 till I know where I made things wrong Link to comment Share on other sites More sharing options...
Skitty Posted October 4, 2012 Share Posted October 4, 2012 I'm curious. Has anyone really been far even as decided to use even go want to do look more like? I mean, has anyone ever tried making a customized tool tip script from this? I'd imagine that this would be great for making an awesome little tooltip UDF with GDIPlus allowing a user to create custom colored tooltips with fade in and fade out abilities. I'd try doing it but GDI and math isn't my strong side Link to comment Share on other sites More sharing options...
mistersquirrle Posted March 2, 2013 Share Posted March 2, 2013 Ok, first, Melba, I <3 you and your knowledge of Autoit, and your UDFs. I use several and they're great, so is this one.Onto my problem.I'm trying to create a chat, (and using your GUIFrame UDF ) and I want the edit box you type into, to grow to two lines if you write longer than the width.So, if your you text is longer than say 100px, change the input from 20px height, to 40px. Then back down to 20px when you're at less than 100px length message.The problem I'm having, is that my GUI is re-sizable so it's possible to have the input box very small, and not long enough to fit a full word (or random non-sense), which makes _StringSize return error 3.I guess what I'm trying to ask, is if there's a way, when it reaches the max width you set, to insert a line break, or space there, instead of returning an error? Or maybe just a work around for my script. Anyway, here's some code that shows what I'm taking about.expandcollapse popup#include-once #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <GuiConstants.au3> #include <WinAPI.au3> #include "StringSize.au3" Global $GUIMINWID = 300, $GUIMINHT = 100 Global $GUIMAXWID = @DesktopWidth, $GUIMAXHT = @DesktopHeight Global $Lines = 1 GUIRegisterMsg($WM_GETMINMAXINFO, "WM_GETMINMAXINFO") $hGUI = GUICreate("Test", 500, 300, -1, -1, BitOR($GUI_SS_DEFAULT_GUI, $WS_MAXIMIZEBOX, $WS_SIZEBOX)) GUISetState() $History = GUICtrlCreateEdit('RAWRAWRAWRAWR' & @CRLF & 'asdfasdfasdf', 2, 2, 293, 255, 2103360 + $ES_MULTILINE) GUICtrlSetResizing(-1, 103) $Input = GUICtrlCreateEdit('', 2, 270, 270, 20, BitOR($ES_AUTOVSCROLL, $ES_WANTRETURN, $WS_BORDER), 0) GUICtrlSetFont(-1, 10, 400, 0, "Courier New") GUICtrlSetResizing(-1, 582) While 1 Sleep(10) If ControlGetFocus($hGUI, 'Edit2') And GUICtrlRead($Input) <> '' Then $ciPos = ControlGetPos($hGUI, '', 'Edit2') $chPos = ControlGetPos($hGUI, '', 'Edit1') $iText = GUICtrlRead($Input) $iLen = _StringSize($iText, 10, Default, Default, "Courier New", $ciPos[2]) If @error Then MsgBox(0, '', 'Error: ' & @error) Exit EndIf If $iLen[3] > 20 And $Lines = 1 Then GUICtrlSetPos($History, $chPos[0], $chPos[1], $chPos[2], $chPos[3] - 20) GUICtrlSetPos($Input, $ciPos[0], $ciPos[1] - 20, $ciPos[2], $ciPos[3] + 20) $Lines += 1 ElseIf $iLen[3] = 20 And $Lines > 1 Or $iText = '' Then $Lines = 1 GUICtrlSetPos($History, $chPos[0], $chPos[1], $chPos[2], $chPos[3] + 20) GUICtrlSetPos($Input, $ciPos[0], $ciPos[1] + 20, $ciPos[2], 20) EndIf EndIf Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func WM_GETMINMAXINFO($hwnd, $Msg, $wParam, $lParam) $tagMaxinfo = DllStructCreate("int;int;int;int;int;int;int;int;int;int", $lParam) DllStructSetData($tagMaxinfo, 7, $GUIMINWID) ; min X DllStructSetData($tagMaxinfo, 8, $GUIMINHT) ; min Y DllStructSetData($tagMaxinfo, 9, $GUIMAXWID); max X DllStructSetData($tagMaxinfo, 10, $GUIMAXHT) ; max Y Return 0 EndFunc ;==>WM_GETMINMAXINFO ExitAlso, why no tabs? We ought not to misbehave, but we should look as though we could. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 2, 2013 Author Moderators Share Posted March 2, 2013 (edited) mistersquirrle,Thanks for the compliments. I am thinking about the problem. But I am not confident of finding a solution as the behaviour for which you are asking is fundamentally flawed in my opinion - how do you determine later which spaces/line breaks are intentional and which were merely inserted to get the text to fit in an arbitrarily sized control? As to "why no tabs", I do not understand the question. If you are asking why does the UDF not take account of tabs, then post #34 in this thread explains and shows how the UDF has been modifed to do so. If you are asking why you cannot insert a tab into an edit/input control, then that is a Windows (not AutoIt) limitation and can be overcome by using "Ctrl-TAB". M23Edit: Perhaps something like this might be a better way to approach the problem - let Windows do the line breaks and we will just adjust the size of the controls to match. A rough idea of what I mean: expandcollapse popup#include-once #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <GuiConstants.au3> #include <WinAPI.au3> #include <GuiEdit.au3> Global $GUIMINWID = 300, $GUIMINHT = 100 Global $GUIMAXWID = @DesktopWidth, $GUIMAXHT = @DesktopHeight Global $Lines = 1 GUIRegisterMsg($WM_GETMINMAXINFO, "WM_GETMINMAXINFO") $hGUI = GUICreate("Test", 500, 300, -1, -1, BitOR($GUI_SS_DEFAULT_GUI, $WS_MAXIMIZEBOX, $WS_SIZEBOX)) GUISetState() $History = GUICtrlCreateEdit('RAWRAWRAWRAWR' & @CRLF & 'asdfasdfasdf', 2, 2, 293, 225, 2103360 + $ES_MULTILINE) GUICtrlSetResizing(-1, 103) $Input = GUICtrlCreateEdit('', 2, 260, 270, 20, BitOR($ES_AUTOVSCROLL, $ES_WANTRETURN, $WS_BORDER, $ES_MULTILINE), 0) GUICtrlSetFont(-1, 10, 400, 0, "Courier New") GUICtrlSetResizing(-1, 582) $iLines = 1 While 1 $iLine_Count = _GUICtrlEdit_GetLineCount($Input) If $iLine_Count <> $iLines Then $iLines = $iLine_Count ConsoleWrite($iLines & @CRLF) $aHistoryPos = ControlGetPos($hGUI, "", $History) GUICtrlSetPos($History, $aHistoryPos[0], $aHistoryPos[1], $aHistoryPos[2], $aHistoryPos[3] - 20) $aInputPos = ControlGetPos($hGUI, "", $Input) GUICtrlSetPos($Input, $aInputPos[0], $aInputPos[1] - 20, $aInputPos[2], $iLines * 20) EndIf Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func WM_GETMINMAXINFO($hwnd, $Msg, $wParam, $lParam) $tagMaxinfo = DllStructCreate("int;int;int;int;int;int;int;int;int;int", $lParam) DllStructSetData($tagMaxinfo, 7, $GUIMINWID) ; min X DllStructSetData($tagMaxinfo, 8, $GUIMINHT) ; min Y DllStructSetData($tagMaxinfo, 9, $GUIMAXWID); max X DllStructSetData($tagMaxinfo, 10, $GUIMAXHT) ; max Y Return 0 EndFunc ;==>WM_GETMINMAXINFO ExitIf you want to follow this line than let me know and I will split these posts into a new thread as we have drifted away from the UDF. Edited March 2, 2013 by Melba23 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...
mistersquirrle Posted March 2, 2013 Share Posted March 2, 2013 Huh, yeah, that is probably a much better way to do it... I haven't really looked into the GUI UDFs, since there are so many. That certainly worked, and I was actually thinking of something very similar to that, which made me remember my post and come back to check. Right now, I'm trying to get the TCP to work for my chat, and I want to focus on that before I go and dink around with putting your solution in, but it does seem much more elegant. I also wasn't thinking too clearly when I asked my question about just putting in a space, because yeah, obviously, how would you tell the difference between the inserted ones, and normal ones? That's why I come here, to ask greater minds to think about my stupid questions My 'no tabs' part was to the code that I posted in my post, they all got eaten We ought not to misbehave, but we should look as though we could. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 2, 2013 Author Moderators Share Posted March 2, 2013 mistersquirrle, So do I take it you would like to explore my idea further? Just let me know and I will split this into a new thread and remove any posts like this one. As to the forum editor eating the tabs, you need to be in basic mode to keep them. Nothing we can do - other than hope IPB improve the editor in the next version. 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...
mistersquirrle Posted March 2, 2013 Share Posted March 2, 2013 Yeah, looking at what you did, I should be able to do what I want with it. If you want to, you can split this into another topic. If I need help manipulating your code to my ends, I can also always just make a new thread myself. So no worries. Delete this or whatever post you want. Thank you We ought not to misbehave, but we should look as though we could. Link to comment Share on other sites More sharing options...
Terenz Posted November 27, 2013 Share Posted November 27, 2013 (edited) Hi Melba, i need your help This is my script: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <StaticConstants.au3> #include <StringSize.au3> HotKeySet("{Esc}", "_EXIT") $iFontName = "Arial" $iFontSize = 25 $aSize = _StringSize("MYTEXT", $iFontSize, Default, Default, $iFontName, 0) $hGUI = GUICreate("Test", $aSize[2], $aSize[3], -1, -1, $WS_POPUP) $fLabel = GUICtrlCreateLabel($aSize[0], 0, 0, $aSize[2], $aSize[3], BitOR($SS_CENTER, $SS_CENTERIMAGE)) GUICtrlSetFont(-1, $iFontSize, 400, 0, $iFontName) GUICtrlSetColor(-1, "0xFFFFFF") GUICtrlSetBkColor(-1, "0x000000") GUISetState(@SW_SHOW) While 1 Sleep(100) WEnd Func _EXIT() Exit EndFunc And this is the result: Now i what to add another label like this image ( is a painted version, not perfect but give the idea ) So pratically i want to add a label with this feature: 1) Don't change the GUI width size but fit the text inside in 2) Use the same font of the first label but different size always based on the first label 3) Make the gui more bigger in height based on the new label Any idea how to accomplish this? Thanks Edited November 27, 2013 by Terenz Nothing is so strong as gentleness. Nothing is so gentle as real strength Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 27, 2013 Author Moderators Share Posted November 27, 2013 Terenz,I would do it like this:expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <StaticConstants.au3> #include <StringSize.au3> HotKeySet("{ESC}", "On_Exit") $iFontName = "Arial" $iFontSize = 25 $aSize_1 = _StringSize("MYTEXT", $iFontSize, Default, Default, $iFontName) ; Keep reducing the text size until the longer piece is only at least as wide the the short one For $iSmallerFontSize = $iFontSize To 0 Step -0.5 $aSize_2 = _StringSize("LONGER TEXT BUT FIT IN", $iSmallerFontSize, Default, Default, $iFontName) If $aSize_2[2] <= $aSize_1[2] Then ExitLoop Next ; So now we have the font size required - but we check we did not hit 0 and failed entirely If $iSmallerFontSize Then ; Now create GUI $hGUI = GUICreate("Test", $aSize_1[2], $aSize_1[3] + + $aSize_2[3], -1, -1, $WS_POPUP) ; Set default colours for all controls GUICtrlSetDefColor(0xFFFFFF) GUICtrlSetDefBkColor(0x000000) ; We need 2 labels because of the different font sizes $cLabel_1 = GUICtrlCreateLabel($aSize_1[0], 0, 0, $aSize_1[2], $aSize_1[3], BitOR($SS_CENTER, $SS_CENTERIMAGE)) GUICtrlSetFont(-1, $iFontSize, 400, 0, $iFontName) ; Use the same width for this label just in case the second result was a bit shorter $cLabel_2 = GUICtrlCreateLabel($aSize_2[0], 0, $aSize_1[3], $aSize_1[2], $aSize_2[3], BitOR($SS_CENTER, $SS_CENTERIMAGE)) GUICtrlSetFont(-1, $iSmallerFontSize, 400, 0, $iFontName) GUISetState(@SW_SHOW) While 1 Sleep(100) WEnd EndIf Func On_Exit() Exit EndFunc ;==>On_ExitPlease ask if you have any questions. 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...
Terenz Posted November 27, 2013 Share Posted November 27, 2013 Thanks Melba for the commented script, is what i need Nothing is so strong as gentleness. Nothing is so gentle as real strength Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 27, 2013 Author Moderators Share Posted November 27, 2013 Terenz,Glad I could help. 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...
CyberMax Posted April 17, 2014 Share Posted April 17, 2014 Hi Melba23, Using your first example below #include <GUIConstantsEx.au3> #include "StringSize.au3" $sText = " I am a very long line and I am not formatted in any way so that I will not fit within the width of the GUI that surrounds me!" $hGUI = GUICreate("Test", 500, 500) ; A label with no width or height set GUICtrlCreateLabel($sText, 10, 10) GUICtrlSetBkColor(-1, 0xFF8080) ; A label with no height set GUICtrlCreateLabel($sText, 10, 50, 200) GUICtrlSetBkColor(-1, 0xC0C0FF) ; A label sized by StringSize $aSize = _StringSize($sText, Default, Default, Default, Default, 200) GUICtrlCreateLabel($aSize[0], 10, 90, $aSize[2], $aSize[3]) GUICtrlSetBkColor(-1, 0x80FF80) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Could you show me how to centre the gui title "test" pls? Thank you. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 17, 2014 Author Moderators Share Posted April 17, 2014 Cybermax,I have used this method with some success:#include <GUIConstantsEx.au3> #include <WinAPI.au3> #include "StringSize.au3" ; Find half title width $sTitle = "Test of centring" $aSize = _StringSize($sTitle) $iHalf = Int($aSize[2] / 2) $hGUI = GUICreate("", 500, 500) GUISetState() ; Find width of GUI buttons $iWidth = _WinAPI_GetSystemMetrics(30) ; SM_CXSIZE ; Calculate mid point of available title bar (3 buttons + icon) $iMiddle = (500 - (4 * $iWidth)) / 2 ; Add spaces until midpoint is reached $sAdd = "" Do $sAdd &= " " $aSize = _StringSize($sAdd) Until $aSize[2] + $iHalf > $iMiddle ; Set GUI title WinSetTitle($hGUI, "", $sAdd & $sTitle) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEndIt is not perfect, but it is not a bad approximation. please ask if you have any questions. 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...
Mat Posted April 17, 2014 Share Posted April 17, 2014 Could you show me how to centre the gui title "test" pls? This (or at least, this approach) is a bad idea, for a number of reasons: Firstly the title bar is not the only place the user sees the title. In tooltips or alt+tab etc. the title will probably be shortened to look blank to the user. For versions of windows where the title is already centered (which is near enough all of them now), this approach will make it off center (fixed by putting the same padding after the title as well, or a simple os check). Also, when the window resizes you'll have to change the window title. The correct method is not simple though (probably involves drawing the title yourself). Which raises the question, why is centering the title important to you? AutoIt Project Listing Link to comment Share on other sites More sharing options...
CyberMax Posted April 17, 2014 Share Posted April 17, 2014 (edited) Thanks Melba23. After countless trial and error, this code below works , and I can't figure why, any explaination for this? #include <GUIConstantsEx.au3> #include <WinAPI.au3> #include "StringSize.au3" ; Find half title width $sTitle = "Test of centring" $aSize = _StringSize($sTitle) $iHalf = Int($aSize[2] / 2) $hGUI = GUICreate("", 500, 500,-1,-1,0x00C00000) GUISetState() ; Find width of GUI buttons $iWidth = _WinAPI_GetSystemMetrics(29) ; SM_CXSIZE ; Calculate mid point of available title bar (3 buttons + icon) $iMiddle = (500 - (4 * $iWidth)) / 2 ; Add spaces until midpoint is reached $sAdd = "" Do $sAdd &= " " $aSize = _StringSize($sAdd) Until $aSize[2] + $iHalf > $iMiddle ; Set GUI title WinSetTitle($hGUI, "", $sAdd & $sTitle) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd I'm not sure what you mean by self centered, check os etc,Mat? I thought everyone likes perfect alignment including me, unless I'm wrong. Usually I would use alot of spacing(type in manually) before the title text to made perfect alignment but sometimes it just didnt work out for some windows titles and I'm tired of doing it over and over again(manually spacing the title) everytime. Edited April 17, 2014 by CyberMax Link to comment Share on other sites More sharing options...
Mat Posted April 17, 2014 Share Posted April 17, 2014 For example, on windows 8, which already centers titles, the added padding has the following effect (running your snippet above): AutoIt Project Listing Link to comment Share on other sites More sharing options...
CyberMax Posted April 18, 2014 Share Posted April 18, 2014 Thanks I understand now, I only need the centre title for specific windows OS for now. It'll do for now. Link to comment Share on other sites More sharing options...
PartyPooper Posted April 18, 2014 Share Posted April 18, 2014 (edited) Melba23, I have a resizable gui with an edit control inserted into a tab (it's for displaying chat which may go over several lines depending on how wide the GUI is at the time). I was wondering if your stringsize UDF could be used to help me format the chat into columns. Essentially, this is what I am looking for (picture tabs in place of spaces): Time Username Line of chat Time Longer Username Line of chat that user types continuation of line of chat even more chat. Time Username Another line of chat Currently, I have the above working in my edit but the chat is formatted for one particular width of edit box. Unfortunately, if a user resizes the gui, the chat width doesn't change and it begins to look stupid. I was hoping your stringsize UDF would give me an idea as to how many words I could fit on the rest of the line. P.S. forgot to mention, edit box has a vertical scroll bar so I need to account for that as well P.P.S. thought about using _GUICtrlRichEdit which allows coloring and formatting but it doesn't resize in a tab properly using GUICtrlSetResizing Nevermind, going to use RichEdit as I found an easy way to resize the richedit without a lot of maths (it's surrounded by a group control so I will base resize off that). Edited April 18, 2014 by PartyPooper Link to comment Share on other sites More sharing options...
ILLBeBack Posted July 27, 2015 Share Posted July 27, 2015 M23, I finally found time to try your StringSize UDF, after your referral a few days ago on a post I made about “Automatic Height issue with GUI Labels and word wrap”. I'm writing to say the function is working perfectly, is incredibly well documented, and was very easy to implement. The only stuff I don’t understand are the DLL Calls (the heart of the function), but that’s my problem, and something I really should learn. Thanks M23 for sharing your work! Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted July 27, 2015 Author Moderators Share Posted July 27, 2015 ILLBeBack,Glad you like it. The DLL calls are actually not that complicated once you look into them - the first set determine the font to be used and then the GetTextExtentPoint32W calls do the actual sizing.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