jpm Posted April 15, 2004 Author Share Posted April 15, 2004 The white background come from a problem I cannot solve for the time being of the default color of a tab . Almost white in XP but gray under Win9x perhaps Win2K.For the refresh color of a label I need to have a look to what happen.Stay tune@Josbethe color label is solved 102.17B Link to comment Share on other sites More sharing options...
steve8tch Posted April 15, 2004 Share Posted April 15, 2004 (edited) I think an edit control will be more appropriate to show the code. You can manage to add lines very easily. What you cannot do easily is delete a line. I originally did use an edit box - (which then also allowed the users to edit - funny that !!) but as you pointed out - it isn't so easy to cleanly delete the entry so I went down the list box route. cheers Edited April 15, 2004 by steve8tch Link to comment Share on other sites More sharing options...
Josbe Posted April 16, 2004 Share Posted April 16, 2004 @Josbethe color label is solved 102.17B Excellent, fast solve! Merci! AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta Link to comment Share on other sites More sharing options...
CyberSlug Posted April 16, 2004 Share Posted April 16, 2004 (edited) GUISendMsg/GUIRecvMsg Question:In my newest version of AutoPad, I am using EM_GETSEL which has pointers for both wParam and lParam.How am I supposed to get the resulting values of wParram and lParam? I tried using each param type in GUIRecvMsg, but nothing worked. I finally used GUISendMsg to get someing close.....This code should help show my problem:Global $EM_GETSEL = 0xb0 GUICreate("GUI Message Problem", 400, 200) $edit = GUISetControl("edit","Select some of this text..." & _ @CRLF & "Click and drag BOTH left and right!", 0, 0) $first= GUISetControl("label","First Index:", 300,20) $last = GUISetControl("label","Last Index: ", 300,60) GUIShow() WinActivate("GUI Message Problem") While 1 Sleep(100) $msg = GUIMsg(0) If $msg = -3 Then ExitLoop ;I divide by 65537 because it works... $var = Int(GUISendMsg($edit, $EM_GETSEL, 0, 0) / 65537) GUIWrite($last, 0, "Last: " & $var) ; Play with this line: $foo = GUIRecvMsg($edit, $EM_GETSEL) GUIWrite($first,0, "First: " & $foo) WEnd GUIDelete() Edited April 16, 2004 by CyberSlug Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
jpm Posted April 16, 2004 Author Share Posted April 16, 2004 @CyberSlug You get the GUIRecvMsg.au3 example which do what you need. what is wrong with the doc? the return is done by an array Opt("GuiNotifyMode",1) ; to get control when action occurs on any control GUICreate("My GUI") ; will create a dialog box that when displayed is centered $nEdit = GUISetControl("edit", "line 0", 10,10) GUISetControl("Button", "Ok", 20,200,50) GuiShow() for $n=1 to 5 GuiWrite($nEdit,0, @CRLF & "line "& $n) next $EM_GETSEL = 0x00B0 While GUIMsg() $a=GuiRecvMsg($nEdit, $EM_GETSEL) GuiSetControlEx($nEdit,256) ; set focus back on edit control ; will display the wParam and lParam values return by the control MsgBox(0,"Current selection",StringFormat("start=%d end=%d", $a[0], $a[1])) Wend Link to comment Share on other sites More sharing options...
CyberSlug Posted April 16, 2004 Share Posted April 16, 2004 @CyberSlugYou get the GUIRecvMsg.au3 example which do what you need.what is wrong with the doc? the return is done by an array I really could have *sworn* I tried that and got the "subscript used with non-Array variable" error....But everything works now--exactly as documented and exactly as you said THANK YOU Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
jpm Posted April 16, 2004 Author Share Posted April 16, 2004 Heh, you right, maybe it's really time to start squishing remain bugs Today I found two issues (bugs?): 1. Why controls (labels, checkboxes, radios), placed onto tab page have white background by default? 2. I have a problem with WS_EX_ACCEPTFILES. In example shown below, when I drag file onto control, I see that cursor changed to arrow with "+" - that's ok. But after I've drop file - nothing appear. Filename not show in the control, and GUIRead give me emptyness. How I can get filename from control? Or maybe this bug? Don't have 101.8 version, where this feature first appear, but it won't work in any other releases. Opt("GUINotifyMode", 1) GUICreate("GUI", 320,120, @DesktopWidth/2-160, @DesktopHeight/2-45, -1, 0x00000008) $file = GUISetControl ("input", "", 10, 5, 300, 20, -1, 0x00000010); WS_EX_ACCEPTFILES $btn = GUISetControl ("button", "Button", 40, 55, 60, 20) GUISetControl ("input", "", 10, 35, 300, 20); WS_EX_ACCEPTFILES GUISetControl ("input", "", 10, 55, 300, 20); WS_EX_ACCEPTFILES While GUIMsg() > 0 $res = GUIRead() Select Case $res = $btn MsgBox (4096, "title", GUIRead($file), 2) EndSelect WendI was hard to find that it was a doc error. the WS_EX_ACCEPTFILES extended file has to be set at GuiCreate level. GUICreate("GUI", 320,120, @DesktopWidth/2-160, @DesktopHeight/2-45, -1, 0x00000018); WS_EX_ACCEPTFILES $file = GUISetControl ("input", "", 10, 5, 300, 20) I am still looking for a good solution for the default background color on tab Link to comment Share on other sites More sharing options...
Lazycat Posted April 16, 2004 Share Posted April 16, 2004 Ups... Thanks jpm, seems it works, but... why if I have more than one input control on the form, they all accept files? It's possibly to have only certain controls will accept files? Or block this on unneeded? BTW Code I posted yesterday was really stupid... sorry if this was unclear. Copy'n'paste... not the best day Koda homepage ([s]Outdated Koda homepage[/s]) (Bug Tracker)My Autoit script page ([s]Outdated mirror[/s]) Link to comment Share on other sites More sharing options...
steve8tch Posted April 16, 2004 Share Posted April 16, 2004 I am not sure why you use combo/listbox for this purpose but it is not a big deal to put the AUT_MAX_LINESIZE which is 4096 Just to let you know that long lines in the edit box are working well. Thanks for the quick upgrade. Link to comment Share on other sites More sharing options...
CyberSlug Posted April 17, 2004 Share Posted April 17, 2004 (edited) Two questions:1) Am I doing something stupid again? I am trying to send the EM_SETTABSTOPS message, but I get a crash! The parameters look okay.2) Is re-drawing the GUI possible? According to Microsoft: "The EM_SETTABSTOPS message does not automatically redraw the edit control window. If the application is changing the tab stops for text already in the edit control, it should call the InvalidateRect function to redraw the edit control window."Global $EM_SETTABSTOPS = 0xCB HotKeySet("{Pause}", "setTabs") GUICreate("Press Pause to Crash...") Global $Edit = GUISetControl("edit", "Blah" & @TAB & "Okay" & @TAB & "done", 10,10) GuiShow() While GUIMsg(0) <> -3 sleep(100) Wend Exit Func setTabs() GUISendMsg( $Edit, $EM_SETTABSTOPS, 1, 5) EndFuncHey, if I use GuiRevcMsg, then I can set a tab size of zero! Most other varitions crash, still: GUIRecvMsg( $Edit, $EM_SETTABSTOPS, 1, 2) Edited April 17, 2004 by CyberSlug Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
Josbe Posted April 17, 2004 Share Posted April 17, 2004 hey, I want know:-Is there any way to initialize the Form with another TAB? (not the first)e.g.: "TAB#2" AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta Link to comment Share on other sites More sharing options...
CyberSlug Posted April 17, 2004 Share Posted April 17, 2004 hey, I want know: -Is there any way to initialize the Form with another TAB? (not the first) e.g.: "TAB#2" A different tab question josbe, try adding the following code to the GuiTAB.au3 example file (provided with autoit-gui.102.17): ; The previous line was a GUISetControlEx GUIShow() ControlCommand("","", "SysTabControl321", "TabRight", "" ) ; The very next line contains the While GuiMsg The GUI Should display with Tab #2 open. Is that what you want? Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
CyberSlug Posted April 17, 2004 Share Posted April 17, 2004 @jpm: In addition to my crash problem on the previous page, I have this question: GuiRead seems to be limited to 32766 bytes. Could it be increased to 65535 bytes? Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
jpm Posted April 17, 2004 Author Share Posted April 17, 2004 Ups... Thanks jpm, seems it works, but... why if I have more than one input control on the form, they all accept files? It's possibly to have only certain controls will accept files? Or block this on unneeded?BTW Code I posted yesterday was really stupid... sorry if this was unclear. Copy'n'paste... not the best day I know it is not so good but it is better than nothing. I need to think a way to restrict/ allow Link to comment Share on other sites More sharing options...
jpm Posted April 17, 2004 Author Share Posted April 17, 2004 Two questions: 1) Am I doing something stupid again? I am trying to send the EM_SETTABSTOPS message, but I get a crash! The parameters look okay. 2) Is re-drawing the GUI possible? According to Microsoft: "The EM_SETTABSTOPS message does not automatically redraw the edit control window. If the application is changing the tab stops for text already in the edit control, it should call the InvalidateRect function to redraw the edit control window." Global $EM_SETTABSTOPS = 0xCB HotKeySet("{Pause}", "setTabs") GUICreate("Press Pause to Crash...") Global $Edit = GUISetControl("edit", "Blah" & @TAB & "Okay" & @TAB & "done", 10,10) GuiShow() While GUIMsg(0) <> -3 sleep(100) Wend Exit Func setTabs() GUISendMsg( $Edit, $EM_SETTABSTOPS, 1, 5) EndFunc Hey, if I use GuiRevcMsg, then I can set a tab size of zero! Most other varitions crash, still: GUIRecvMsg( $Edit, $EM_SETTABSTOPS, 1, 2)The implementation support integer or string as param not array of tabs so you cannot use the EM_SETTABSTOPS Link to comment Share on other sites More sharing options...
jpm Posted April 17, 2004 Author Share Posted April 17, 2004 hey, I want know:-Is there any way to initialize the Form with another TAB? (not the first)e.g.: "TAB#2" 102.17C (not yet uploaded) has implementation for selecting first tabGuiSetControl("tabitem",...GuiSetControlEx(-1,$GUI_SHOW) Link to comment Share on other sites More sharing options...
jpm Posted April 17, 2004 Author Share Posted April 17, 2004 @jpm: In addition to my crash problem on the previous page, I have this question:GuiRead seems to be limited to 32766 bytes. Could it be increased to 65535 bytes?Is it read too small? I hate to increase for increasing Link to comment Share on other sites More sharing options...
CyberSlug Posted April 17, 2004 Share Posted April 17, 2004 (edited) @jpm: I know an array can't be used. BUTAm I not understanding Microsof't docs?"If the wParam parameter is 1, this (lParam) parameter is a pointer to an unsigned integer containing the distance between all tab stops" EDIT: About increasing GuiRead:$EM_LIMITTEXT lets me increase the size to 65535, and this is supported by all versions of windows, so it would be nice. Currently, AutoPad could contain a buffer of 65535, but I'm unable to save a file that big using GuiRead and FileWrite.... Edited April 17, 2004 by CyberSlug Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
jpm Posted April 17, 2004 Author Share Posted April 17, 2004 @jpm: I know an array can't be used. BUTAm I not understanding Microsof't docs?"If the wParam parameter is 1, this (lParam) parameter is a pointer to an unsigned integer containing the distance between all tab stops" EDIT: About increasing GuiRead:$EM_LIMITTEXT lets me increase the size to 65535, and this is supported by all versions of windows, so it would be nice. Currently, AutoPad could contain a buffer of 65535, but I'm unable to save a file that big using GuiRead and FileWrite....no problem for limitsI have a look at Ms doc on the tabs stuff Link to comment Share on other sites More sharing options...
Josbe Posted April 17, 2004 Share Posted April 17, 2004 josbe, try adding the following code to the GuiTAB.au3 example file (provided with autoit-gui.102.17): ; The previous line was a GUISetControlEx GUIShow() ControlCommand("","", "SysTabControl321", "TabRight", "" ) ; The very next line contains the While GuiMsg The GUI Should display with Tab #2 open. Is that what you want?Thxs, I try this, but I actually use in my form, TAB with flat buttons, and not work. 102.17C (not yet uploaded) has implementation for selecting first tab GuiSetControl("tabitem",... GuiSetControlEx(-1,$GUI_SHOW)@jpm: Thxs for the update. AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta 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