Ranmaru Posted June 6, 2007 Share Posted June 6, 2007 How do you... 1. Scroll down a List object by script. 2. Make new lines into a Input component. (Tried @LF, @CR, @CRLF and all they do are squares, also tried \n and that has no effect.) Thanks in advance. Link to comment Share on other sites More sharing options...
poisonkiller Posted June 6, 2007 Share Posted June 6, 2007 (edited) 1. I didn't really understand your question, but I think you are looking for $WS_VSCROLL 2. GuiCtrlCreateInput("Line1" & @CRLF & "Line2", 10, 10, 100, 50, $ES_MULTILINE) Edited June 6, 2007 by poisonkiller Link to comment Share on other sites More sharing options...
Ranmaru Posted June 6, 2007 Author Share Posted June 6, 2007 1. I didn't really understand your question, but I think you are looking for $WS_VSCROLL2. GuiCtrlCreateInput("Line1" & @CRLF & "Line2", 10, 10, 100, 50, $ES_MULTILINE)Tried the 2. and it works, thank you. What I meant in the first question was that if you could make it either automatically scroll the list down if more entries are added or do it by code with a certain message to the control or if such a way is possible. But I'm not sure if I will need to know that now with the inputfield working, going to test it in my program now and report back here about the results. Thank you. Link to comment Share on other sites More sharing options...
Ranmaru Posted June 6, 2007 Author Share Posted June 6, 2007 (edited) Ok.. So the problem I have now is to give the control both multiline and readonly. These are the ways I've tried: Global $chatField = GUICtrlCreateInput("", 10, 10, @DesktopWidth-200, @DesktopHeight-50-100) GUICtrlSetStyle(-1, $ES_MULTILINE) GUICtrlSetStyle(-1, $ES_READONLY) oÝ÷ Ù«¢+Ø)±½°ÀÌØí¡Ñ¥±ôU% Ñɱ ÉÑ%¹ÁÕÐ ÅÕ½ÐìÅÕ½Ðì°ÄÀ°ÄÀ°ÍѽÁ]¥Ñ ´ÈÀÀ°ÍѽÁ!¥¡Ð´ÔÀ´ÄÀÀ°ÀÌØíM}I=91d¬ÀÌØíM}5U1Q%1%9¤(oÝ÷ Ù«¢+Ø)±½°ÀÌØí¡Ñ¥±ôU% Ñɱ ÉÑ%¹ÁÕÐ ÅÕ½ÐìÅÕ½Ðì°ÄÀ°ÄÀ°ÍѽÁ]¥Ñ ´ÈÀÀ°ÍѽÁ!¥¡Ð´ÔÀ´ÄÀÀ°ÀÌØíM}I=91dµÀìÀÌØíM}5U1Q%1%9¤ Edited June 6, 2007 by Ranmaru Link to comment Share on other sites More sharing options...
martin Posted June 6, 2007 Share Posted June 6, 2007 Ok.. So the problem I have now is to give the control both multiline and readonly. These are the ways I've tried: Global $chatField = GUICtrlCreateInput("", 10, 10, @DesktopWidth-200, @DesktopHeight-50-100) GUICtrlSetStyle(-1, $ES_MULTILINE) GUICtrlSetStyle(-1, $ES_READONLY) oÝ÷ Ù«¢+Ø)±½°ÀÌØí¡Ñ¥±ôU% Ñɱ ÉÑ%¹ÁÕÐ ÅÕ½ÐìÅÕ½Ðì°ÄÀ°ÄÀ°ÍѽÁ]¥Ñ ´ÈÀÀ°ÍѽÁ!¥¡Ð´ÔÀ´ÄÀÀ°ÀÌØíM}I=91d¬ÀÌØíM}5U1Q%1%9¤(oÝ÷ Ù«¢+Ø)±½°ÀÌØí¡Ñ¥±ôU% Ñɱ ÉÑ%¹ÁÕÐ ÅÕ½ÐìÅÕ½Ðì°ÄÀ°ÄÀ°ÍѽÁ]¥Ñ ´ÈÀÀ°ÍѽÁ!¥¡Ð´ÔÀ´ÄÀÀ°ÀÌØíM}I=91dµÀìÀÌØíM}5U1Q%1%9¤ GUICtrlCreateInput("", 10, 10, @DesktopWidth-200, @DesktopHeight-50-100, Bitor($ES_READONLY,$ES_MULTILINE)) Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
poisonkiller Posted June 6, 2007 Share Posted June 6, 2007 (edited) I tried that too, doesn't work on my comp. But this worked: $chatField = GUICtrlCreateInput("Line1" & @CRLF & "Line2", 10, 10, @DesktopWidth-200, @DesktopHeight-50-100, $ES_MULTILINE) GuiCtrlSetStyle($chatField, $ES_READONLY) EDIT: Does anyone know, how to make a list autoscroll? Help file says, that $ES_AUTOVSCROLL only works when user presses Enter key. Edited June 6, 2007 by poisonkiller Link to comment Share on other sites More sharing options...
Ranmaru Posted June 6, 2007 Author Share Posted June 6, 2007 (edited) I tried that too, doesn't work on my comp. But this worked: $chatField = GUICtrlCreateInput("Line1" & @CRLF & "Line2", 10, 10, @DesktopWidth-200, @DesktopHeight-50-100, $ES_MULTILINE) GuiCtrlSetStyle($chatField, $ES_READONLY)Tried the other thing with the bitor function, but it didn't work. This way it worked. However now there rises another problem.. The text input is used as a field where the chatmessages from the server are placed, however it doesn't give a scroll for it when the lines go past the field (don't even know if they are there..) so my problem is to get a scroll to it and having it to keep it scrolled down all the time like how MSN and other IM and chat applications work. Edited June 6, 2007 by Ranmaru Link to comment Share on other sites More sharing options...
martin Posted June 6, 2007 Share Posted June 6, 2007 I tried that too, doesn't work on my comp. But this worked: $chatField = GUICtrlCreateInput("Line1" & @CRLF & "Line2", 10, 10, @DesktopWidth-200, @DesktopHeight-50-100, $ES_MULTILINE) GuiCtrlSetStyle($chatField, $ES_READONLY) EDIT: Does anyone know, how to make a list autoscroll? Help file says, that $ES_AUTOVSCROLL only works when user presses Enter key.Yes poisonkiller, I looked up how I've done it before and I've done what you suggested. I should have tested what I posted Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
martin Posted June 6, 2007 Share Posted June 6, 2007 Tried the other thing with the bitor function, but it didn't work. This way it worked. However now there rises another problem.. The text input is used as a field where the chatmessages from the server are placed, however it doesn't give a scroll for it when the lines go past the field (don't even know if they are there..) so my problem is to get a scroll to it and having it to keep it scrolled down all the time like how MSN and other IM and chat applications work.Maybe it would be easier to use an edit rather than an input. The GuiEdit.au3 in the includes gives functions for scrolling to a line or caret position etc. Apologies if I wasted your time with my duff BitOr suggestion. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
Helge Posted June 6, 2007 Share Posted June 6, 2007 I guess I'm boring, but why not just use GUICtrlCreateEdit ? Link to comment Share on other sites More sharing options...
Ranmaru Posted June 6, 2007 Author Share Posted June 6, 2007 (edited) Using it now. :$ Ermm.. But I still get no scrollbar, how do I add that? EDIT: Scroll added and it's scrolling now when new messages are added! Thank you all! Edited June 6, 2007 by Ranmaru Link to comment Share on other sites More sharing options...
poisonkiller Posted June 6, 2007 Share Posted June 6, 2007 I'm using AutoIt v3.1.4.9 and I can see disabled vertical and horizontal scrollbars when I use GuiCtrlCreateEdit... Link to comment Share on other sites More sharing options...
Helge Posted June 6, 2007 Share Posted June 6, 2007 I'm using AutoIt v3.1.4.9 and I can see disabled vertical and horizontal scrollbars when I use GuiCtrlCreateEdit...Fill the control with data and they'll be enabled. GUICreate("", 100, 100) GUICtrlCreateEdit("", 10, 10, 80, 80) GUISetState() Sleep(2000) For $i = 1 To 200 GUICtrlSetData(-1, @ScriptFullPath, True) Next Do Until GUIGetMsg() = -3 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