Valuater Posted November 15, 2005 Share Posted November 15, 2005 (edited) ok...i would like the guictrlsetdata() to append the data to the END of the editbox. if the user places the curser anywhere on the editbox the data is set to that location and not appended to the end of the editboxi also noted that guictrlsetdata( control id, data, default)the default seems to have minimal purpose as noted in this example#include <GUIConstants.au3> GUICreate("my GUI", 400, 375, -1, -1) ; create send text $send_box = GUICtrlCreateEdit("Type your text here", 10, 260, 300, 60, BitOR($WS_VSCROLL,$ES_AUTOVSCROLL)) $send_button = GUICtrlCreateButton("S&end", 320, 270, 70, 30) $_simple = GUICtrlCreateEdit("Your last text" & @CRLF, 15, 40, 370, 215, BitOR($ES_WANTRETURN, $WS_VSCROLL, $WS_HSCROLL, $ES_AUTOVSCROLL, $ES_AUTOHSCROLL, $ES_MULTILINE, $ES_READONLY)) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $send_button $send_info = GUICtrlRead($send_box) $x = random(1,10,1) GUICtrlSetData($_simple, @CRLF & $send_info & " " & $x, $x) EndSelect Wend exitany ideas????thx8) Edited November 15, 2005 by Valuater Link to comment Share on other sites More sharing options...
JSThePatriot Posted November 15, 2005 Share Posted November 15, 2005 Below is what I would do to get everything set up how you want it. $oldData = GUICtrlRead($eBox) GUICtrlSetData($eBox, "") $Data = $oldData & @CRLF & $newData GUICtrlSetData($eBox, $Data) Something along those lines. I am not sure this will be a good idea after the text gets to be too long. This is just a work around. Not a very good one, but atleast clean. I will check the Auto ITS project page to see if I can offer a different solution there. I have seen a similar problem in C++ and VB games I have played. JS AutoIt Links File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more) Link to comment Share on other sites More sharing options...
Valuater Posted November 15, 2005 Author Share Posted November 15, 2005 good idea.... that might work thanks 8) Link to comment Share on other sites More sharing options...
JSThePatriot Posted November 15, 2005 Share Posted November 15, 2005 good idea.... that might workthanks8)Also set the one edit to disabled to not allow users to select text might be an option. Then you could allow them to select text only when they goto a certain menu. This I would consider a bad work-around.JS AutoIt Links File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more) Link to comment Share on other sites More sharing options...
Valuater Posted November 15, 2005 Author Share Posted November 15, 2005 Also set the one edit to disabled to not allow users to select text might be an option. Then you could allow them to select text only when they goto a certain menu. This I would consider a bad work-around.JSi tried that... it disables the scroll alsoguess thats not going to workthx8) Link to comment Share on other sites More sharing options...
JSThePatriot Posted November 16, 2005 Share Posted November 16, 2005 i tried that... it disables the scroll alsoguess thats not going to workthx8)Hrm, I will look into a couple other ways of accomplishing this. I am assuming this is for the Auto ITS project. How bad is the first solution I offered for speed when there are large amounts of text?JS AutoIt Links File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more) Link to comment Share on other sites More sharing options...
JSThePatriot Posted November 16, 2005 Share Posted November 16, 2005 Hrm... I just checked out the $ES_READONLY, and it seems that should cover your bases, but I notice you have already thought of this by adding that into your box. JS AutoIt Links File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more) Link to comment Share on other sites More sharing options...
Valuater Posted November 16, 2005 Author Share Posted November 16, 2005 (edited) Hrm, I will look into a couple other ways of accomplishing this. I am assuming this is for the Auto ITS project. How bad is the first solution I offered for speed when there are large amounts of text?JSYes.. its for the ITS programthe difficulty with the original idea is that there are two "chat windows" and two send buttons ( one is for PM )thus, i am not sure how to approach testing...$send_info = GUICtrlRead($send_box) If $send_info <> "" And $connected = 1 Then $Text = "~pm-" & $select_name & "-" & $send_info SendMessage($Text) If GUICtrlGetState($_simple) = $GUI_ACTIVE then $old = GUICtrlRead($_simple) Else $old = GUICtrlRead($child2_view) EndIf GUICtrlSetData($_simple, $old & @CRLF & $Text) GUICtrlSetData($child2_view, $old & @CRLF & $Text) GUICtrlSetData($send_box, "") EndIfthats the best i can come up with8) Edited November 16, 2005 by Valuater Link to comment Share on other sites More sharing options...
JSThePatriot Posted November 16, 2005 Share Posted November 16, 2005 Hrm... I would say the PM and Chat should be the same box. I know in command driven games you just type something along the lines of /tell name something about what you want to say. Then press enter. Having multiple boxes and buttons to me is a little redundant. You could even have an option box on the side that would allow you to decide which way its supposed to be. JS AutoIt Links File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more) Link to comment Share on other sites More sharing options...
Valuater Posted November 16, 2005 Author Share Posted November 16, 2005 Hrm... I would say the PM and Chat should be the same box. I know in command driven games you just type something along the lines of /tell name something about what you want to say. Then press enter.Having multiple boxes and buttons to me is a little redundant. You could even have an option box on the side that would allow you to decide which way its supposed to be.JSone is on the gui the other is on a taband there is a button that you can choose which view you want..trying to see which button was pressed would be more confusing8) Link to comment Share on other sites More sharing options...
JSThePatriot Posted November 16, 2005 Share Posted November 16, 2005 one is on the gui the other is on a taband there is a button that you can choose which view you want..trying to see which button was pressed would be more confusing8)Gotcha hrm...JS AutoIt Links File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more) Link to comment Share on other sites More sharing options...
Valuater Posted November 16, 2005 Author Share Posted November 16, 2005 how about setting the curser at the end of the editbox... then updating the sent data " at the end" is that possible??? 8) 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