steph10 Posted September 22, 2010 Posted September 22, 2010 Hello, I am quite new to autoIt and have problems with control Edit: it seems like lines are wrapped automatically to 1024 characters, and I couldn't find how to increase this limit. My goal is to display very long lines (up to 5,000 chars) without wrapping them on the screen, i.e. only with Hscrollbar to view the end of line. Here is a sample code that features the problem: #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> Opt('MustDeclareVars', 1) _Main() Func _Main() Local $Form, $Text, $string, $i $Form = GUICreate("Pb", 632, 592, 189, 112) $Text = GUICtrlCreateEdit("", 8, 32, 617, 145, $GUI_SS_DEFAULT_EDIT) $string = "Just a test....." For $i = 1 to 8 $string = $string & $string Next ; $string is now a string made of 4096 characters GUICtrlSetData(-1, $string) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd EndFunc Thanks a lot for your pointers! Steph.
Moderators Melba23 Posted September 22, 2010 Moderators Posted September 22, 2010 steph10,Welcome to the AutoIt forum. A Google search found this on a MS help page:In the Microsoft Windows graphical environment [...] A multiline edit control is [...] subject to the following limitations: [...]The maximum number of characters in a single line is 1024. The maximum width of a line is 30,000 pixels. The maximum number of lines is approximately 16,350.Looks like it is a Windows limitation, not an AutoIt one, which means you are stuck with it. However, I have found some evidence that RichEdit controls are not limited in the same manner - perhaps you might like to look at the GUIRichEdit UDF to see if that can help you. 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
steph10 Posted September 23, 2010 Author Posted September 23, 2010 Thank you for your reply, I feel dummy not to have check the Windows limitation... I will try to use RichEdit, thank you for the tip! Regards, Steph.
steph10 Posted September 29, 2010 Author Posted September 29, 2010 Hello, I confirm that RichEdit does the job! Just a last question: why are there UDF's? I mean why are these extra controls not just integrated as others (combo, button, ...)? Regards, Stéphane.
Moderators Melba23 Posted September 29, 2010 Moderators Posted September 29, 2010 steph10,The "built-in" controls are all contained within the AutoIt interpreter which is attached to any compiled script. This means that the more "built-in" functions you have, the bigger the compiled files. At present a compiled file is usually about 600k (or about 350k if you compress it with upx) - no-one really wants it to get too much bigger. By using UDFs, we can greatly expand the scope of AutoIt without adding to the size of the interpreter - and the compiled file size. Another good reason to have UDFs is that it allows people other than the Devs to help improve AutoIt. Anyone can propose UDFs to enable AutoIt to do additional things which may be useful to other coders. These UDFs are available in the Examples section - or you can find them in the sigs of various members (you can see mine below). Some of these UDFs have been included in the main package - although their number is limited in order to keep the installation download to reasonable size and to reduce the burden of keeping the UDFs up to date - much easier to get the original authors to do the work for you. I hope that explains clearly enough why we have UDFs. I look forward to seeing some of your code in the Examples section some day soon. 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
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