Jump to content

maikelmeyers

Members
  • Posts

    6
  • Joined

  • Last visited

maikelmeyers's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. This does not happen when GUICtrlSetBkColor is not used
  2. thanks, first question solved but I think I found a bug. Please have a look at the following example code. First click on the combobox and press ENTER. A message box will be displayed telling you the current focus. It is "Edit1". That is ok. Now press on the button. A message box informs you that the button was pressed. Then the button turns green. NOW, click the combobox and press ENTER again. Now both Items seems to be pressed, although the combobox has the focus. Why? CODE #Include <Misc.au3> #include <GUIConstants.au3> #include <WindowsConstants.au3> #Include <GuiButton.au3> $gui_window_main = GUICreate ("Test",500,500,100,100,$WS_SYSMENU) $gui_button = GUICtrlCreateButton ("test button",0,0,200,200) $gui_combo = GUICtrlCreateCombo ( "test combo",0,250,200,200) GUISetState (@SW_SHOW) while 1 if(_IsPressed("0D")) then MsgBox(1,"",ControlGetFocus ($gui_window_main)) endif $msg = GUIGetMsg(1) if($msg[0] = 0) then ContinueLoop endif if ($msg[1] = $gui_window_main) then if ($msg[0] = $gui_button) then MsgBox(1,"","button pressed") GUICtrlSetBkColor ( $gui_button, 0x88ff88 ) elseif $msg[0] = $GUI_EVENT_CLOSE then guidelete() endif endif wend
  3. Hi, can anyone tell me how to control keys in a gui? For example: if I press ESC the gui closes. How can I avoid this? Second example: If a combobox is in focus, how is it possible to do some action when ENTER is pressed. Is it possible to get a message? In the moment if I press ENTER it activates another checkbox which has not the focus. I don't find any functions related to keyboard except hotkeyset, but this is not usable because then you can not run multiple instances of that script.
  4. OK, thank you all. This is a workaround I can live with. But I think it would be better if the GuiCreate size would always be the window client size in future AutoIt versions, because this is very confusing
  5. Yes, that is the point. Look at the example. I created a gui with width 500 and height 500(GuiCreate). You say this is the client size. But directly after creating it I call WinGetClientSize to get the size and it should be 500x500 right? But it is not 500x500 it is 498x477 or 494x473 depending on the window style. And also WinGetPos has different values than 500x500. Why are the sizes of the window and the window client different to the desired size (500x500)? So it is impossible for me to save and restore the actual window size. Thanks
  6. Hi, I try to program a gui for some simple things and I want to save the window size (it is a resizeable gui), when the program is closed. After a restart the gui should have the same size as before closing. The problem is, that WinGetPos and WinGetClientSize give me weird values. Have a look at this example. CODE#include <GUIConstants.au3> #include <WindowsConstants.au3> $gui = GUICreate ("",500,500,100,100,$WS_MAXIMIZEBOX+$WS_MINIMIZEBOX+$WS_CAPTION+$WS_SIZEBOX) $size1 = WinGetPos($gui) $size2= WinGetClientSize($gui) MsgBox(1,"created a gui with 500x500","Style: $WS_MAXIMIZEBOX+$WS_MINIMIZEBOX+$WS_CAPTION+$WS_SIZEBOX" & @crlf & @crlf & "WinGetPos: " & $size1[2] & " " & $size1[3] & " WinGetClientSize: " & $size2[0] & " " & $size2[1]) $gui = GUICreate ("",500,500,100,100,$WS_SIZEBOX) $size1 = WinGetPos($gui) $size2= WinGetClientSize($gui) MsgBox(1,"created a gui with 500x500","Style: $WS_SIZEBOX" & @crlf & @crlf & "WinGetPos: " & $size1[2] & " " & $size1[3] & " WinGetClientSize: " & $size2[0] & " " & $size2[1]) $gui = GUICreate ("",500,500,100,100,$WS_SYSMENU) $size1 = WinGetPos($gui) $size2= WinGetClientSize($gui) MsgBox(1,"created a gui with 500x500","Style: $WS_SYSMENU" & @crlf & @crlf & "WinGetPos: " & $size1[2] & " " & $size1[3] & " WinGetClientSize: " & $size2[0] & " " & $size2[1]) on my computer the first gui is: WinGetPos 508 529, WinGetClientSize 500 500 the second gui: WinGetPos 506 506, WinGetClientSize 498 477 the third gui: WinGetPos 500 500, WinGetClientSize 494 473 ??? This means WinGetPos and WinGetClientSize show different gui sizes than created. How should I handle this?
×
×
  • Create New...