mr-es335 Posted July 30, 2024 Posted July 30, 2024 (edited) Good day, Nine had sent me this: #include "ExtMsgBox.au3" Local $sResult = "Very very long long test text that should be cut somewhere into the line, so need to be extended" & @CRLF & _ "Yet, another Very very long long test text that should be cut somewhere into the line, so need to be extended" & @CRLF & _ "Not so long test text that should be cut somewhere into the line, so need to be extended" & @CRLF & _ "Quite short test text that should NOT be cut somewhere into the line" _ExtMsgBoxSet(1, 0, Default, Default, Default, Default, 800) _ExtMsgBox(64, "Ok", "Test", $sResult) However, as I am unable to locate a simplified explanation for the above - and with the information in the UDF being "way-beyond-my-pay-grade", can someone please explain to me what is going in each of the above parameters? May someone explain precisely what "_ExtMsgBoxSet(1, 0, Default, Default, Default, Default, 800)" is referring to here? I am attempting to extend the width of the box to accept a single line with 140 textual characters. • See attached... Any assistance in this matter would be greatly appreciated! PS: I cannot employ "& @CRLF & _" as the entire text is to be validated. I do hope that I am explaining this properly. Edited July 30, 2024 by mr-es335 mr-es335 Sentinel Music Studios
mr-es335 Posted July 30, 2024 Author Posted July 30, 2024 Good day, Would the attached be a rather simplified outline of the overall syntax? • PS: I do tend to find the information as provided in the UDF rather difficult to comprehend...and therefore, to glean from! mr-es335 Sentinel Music Studios
Moderators Melba23 Posted July 31, 2024 Moderators Posted July 31, 2024 mr-es335, I rather pride myself on the clarity of my UDF function headers, so I am somewhat disappointed to hear that you are having difficulties in understanding the various parameter values. If you would explain just which of the explanations are causing you probems I will attempt to explain. As to your requirement to display 140 characters in an ExtMsgBox, I suggest you choose a font and then use my StringSize UDF (which is included in the ExtMsgBox download) to measure just how wide this string would be. You can then use this value as the $iWidth_Abs parameter - althugh I would suggest adding a decent margin on either side! 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
Nine Posted July 31, 2024 Posted July 31, 2024 (edited) @Melba23 I have a question about $iWidth_Abs parameter. I tried to figure out the usage you got in mind with this parameter. Looking at the code, there is nothing obvious that helped me understand. Running this code, produces the following result : #include "ExtMsgBox.au3" #include <String.au3> Local $sResult = _StringRepeat("1234567890", 14) _ExtMsgBoxSet(1, 0, Default, Default, Default, Default, 1000) _ExtMsgBox(64, "Ok", "Test", $sResult) And this code gives the exact same result : #include "ExtMsgBox.au3" #include <String.au3> Local $sResult = _StringRepeat("1234567890", 14) _ExtMsgBoxSet(1, 0, Default, Default, Default, Default, 1000, 1400) _ExtMsgBox(64, "Ok", "Test2", $sResult) Edited July 31, 2024 by Nine “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
Moderators Melba23 Posted July 31, 2024 Moderators Posted July 31, 2024 Nine, There is no difference because in both cases the EMB is sufficently large to fit the unbroken string. Try running this and you will see a difference: #include "ExtMsgBox.au3" #include <String.au3> ; Create long string Local $sResult = _StringRepeat("1234567890", 14) ; Check of string length $aRet = _StringSize($sResult) ConsoleWrite($aRet[2] & @CRLF) ; I get 840 pixels as the width of the string ; Try EMB with $iWidth_Abs too small _ExtMsgBoxSet(1, 0, Default, Default, Default, Default, 500) $iRet = _ExtMsgBox(64, "Ok", "Test", $sResult) ConsoleWrite($iRet & " - " & @error & @CRLF) ; Should fail with "-1 - 6" return ; Now try with increased max width _ExtMsgBoxSet(1, 0, Default, Default, Default, Default, 1000) ; And it works! $iRet = _ExtMsgBox(64, "Ok", "Test", $sResult) ConsoleWrite($iRet & " - " & @error & @CRLF) The width parameters work like this: - There is a minimum width of 370 pixels (hard coded) to make sure there is always room for at least a bit of text and a reasonably sized button. - The normal maximum width is also set to 370 as it is expected that messages are not normally hugely long and can easily be broken (using StringSize) to fit, although this can be increased using the $iWidth parameter in _ExtMsgBoxSet to cater for longer messages where you need to avoid a tall, thin EMB. - Finally, if you think there might be a long section of characters which cannot be broken by StringSize (as in this case) then you need to set an absolute width which will allow the EMB to expand so it can display the unbroken string - this is limited to @DesktopWidth - 20 to make sure that the EMB actually fits on the display. Clearer now? 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
Nine Posted July 31, 2024 Posted July 31, 2024 18 minutes ago, Melba23 said: Clearer now? Yes, thank you. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
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