Sign in to follow this  
Followers 0
jkotecki

GUICtrl problem with input and buttons

5 posts in this topic

#1 ·  Posted (edited)

I have a strange problem that I can't seem to figure out. I have a gui with two buttons and a few input fields. I am using the GUIOnEventMode and have three functions. One for each button and one for the input controls. When I press the buttons, they process their respective functions as well as the input fields when I change the value and press enter. What's weird is if I change a value in an input control after I have pressed one of the buttons, the function for the inpute field runs and then immediately afterwards the function for the button runs. It's related to pressing enter because if I change an input control and then tab to the next control it works as expected and only runs the input controls function. Does anybody have any ideas? I would greatly appreciate it.

-Jason

#include <GUIConstantsEx.au3>
#include <GuiButton.au3>
#include <WindowsConstants.au3>
#include <ButtonConstants.au3>
#include <GuiSlider.au3>
#include <StaticConstants.au3>
#include <EditConstants.au3>
#include <Array.au3>
#include <CommMG.au3>

Opt("GUIOnEventMode",1)

#Region ### Declare global variables ###
Dim $comport,$error,$selcom ;for com select
Dim $sliderVal,$hSlider_Handle,$slider
Dim $btn1, $btn2
Dim $srvoOnOff[17],$srvONorm[17],$srvoSlew[17],$srvoScale[17],$srvoHi[17],$srvoCtr[17],$srvoLo[17],$HiLimit[17],$LoLimit[17]
#EndRegion ### Declare global variables ###

#Region ### START Main GUI section ###
Func _createMainGui()
$form1 = GUICreate("System Expander Servo Explorer", 1024, 768)
GUISetONEvent($GUI_EVENT_CLOSE, '_Exit')
$tab = GUICtrlCreateTab(0, 0, 1024, 768)
GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
; *** Display CONtroller Tab ***
$tab0 = GUICtrlCreateTabItem("Servo Explorer")

; *** Create test channel slider
GUICtrlCreateGroup("Test Channel", 10, 30, 400, 150)
;~ GUICtrlCreateLabel("Test Channel",155,30,100)
GUICtrlSetFont (-1,10, 800); bold
GUICtrlCreateLabel("Panel:   |"&@CR&"Motor:   Backward"&@CR&"Servo:   CounterClockwise"&@CR&"Linear:   Retract",20,115,145,60)
GUICtrlCreateLabel("Close"&@CR&"Stop"&@CR&"Center"&@CR&"Stop",195,115,85,60)
GUICtrlCreateLabel("Open"&@CR&"Forward"&@CR&"Clockwise"&@CR&"Extend",310,115,85,60)

$slider = GUICtrlCreateSlider(60,90,300,20,BitOR($TBS_FIXEDLENGTH,$TBS_NOTICKS))

   GUICtrlSetBkColor(-1,0xFFC400) ; Set color to yellowish
   _GUICtrlSlider_SetRange($slider, 1000, 2000) ; Set Range
   _GUICtrlSlider_SetPos($slider, 1500) ; Set Pos
   _GUICtrlSlider_SetThumbLength($slider, 20) ; Set Thumb Length
   $hSlider_Handle = GUICtrlGetHandle(-1)
   GUIRegisterMsg($WM_HSCROLL, "_updateSlider")
 
$sliderVal = GUICtrlCreateLabel("1500",195,70,50,20)
GUICtrlSetFont (-1,9, 800); bold

; *** Create expander start button
$btn1=GUICtrlCreateButton("Start Expander",710,50,120,50)
GUICtrlSetOnEvent(-1, "_powerUp")
GUICtrlSetBkColor(-1,0x00ff00)

; *** Create config button
$btn2=GUICtrlCreateButton("Create Configuration",850,50,120,50)
GUICtrlSetOnEvent(-1, "_createConfig")
GUICtrlSetBkColor(-1,0x0090ff)

GUICtrlCreateGroup("Servos", 10, 200, 1000, 530)
GUICtrlSetFont (-1,10, 800); bold

For $x =1 to 8
   ;Create the top servos
      GUICtrlCreateLabel("Servo #" & $x, ($x*120)-70, 240)
      GUICtrlSetFont (-1,9, 800); bold
      $srvoOnOff[$x]=GUICtrlCreateButton("ON",($x*120)-70, 260,20,20,$BS_BITMAP)
      GUICtrlSetImage(-1, "led_green.bmp")
      GUICtrlSetOnEvent(-1, "_btnToggle" )
      GUICtrlCreateLabel(_GUICtrlButton_GetText(-1),($x*120)-45,263,40)
      $srvONorm[$x]=GUICtrlCreateButton("Reverse Off",($x*120)-70, 282,20,20,$BS_BITMAP)
      GUICtrlSetImage(-1, "led_green.bmp")
      GUICtrlSetOnEvent(-1, "_btnToggle" )
      GUICtrlCreateLabel(_GUICtrlButton_GetText(-1),($x*120)-45,284,60)
      $srvoSlew[$x]=GUICtrlCreateInput("360",($x*120)-70, 305,50,20,BitOR($ES_NUMBER,$ES_CENTER))
      GUICtrlSetOnEvent(-1,"_Update")
      GUICtrlSetLimit(-1, 3, 1)
      GUICtrlCreateLabel("Slew",($x*120)-15, 307,30,20)
      GUICtrlSetFont (-1,9, 800); bold
      $srvoscale[$x]=GUICtrlCreateInput("100",($x*120)-70, 325,50,20,BitOR($ES_NUMBER,$ES_CENTER))
      GUICtrlSetOnEvent(-1,"_Update")
      GUICtrlSetLimit(-1, 3, 1)
      GUICtrlCreateLabel("% Scale",($x*120)-15, 327,50,20)
      GUICtrlSetFont (-1,9, 800); bold
      $HiLimit[$x]=GUICtrlCreateCombo("0", ($x*120)-70, 345,35) ; create first item
      GUICtrlSetData(-1, "1|2|3|4|5|6") ; add other item snd set a new default
      GUICtrlSetOnEvent(-1,"_Update")
      GUICtrlCreateLabel("Hi Limit",($x*120)-30, 347,50,20)
      GUICtrlSetFont (-1,9, 800); bold
      $srvoHi[$x]=GUICtrlCreateInput("2000",($x*120)-70, 365,50,20,BitOR($ES_NUMBER,$ES_CENTER))
      GUICtrlSetOnEvent(-1,"_Update")
      GUICtrlSetLimit(-1, 4, 1)
      GUICtrlCreateLabel("Hi",($x*120)-15, 367,40,20)
      GUICtrlSetFont (-1,9, 800); bold
      $srvoCtr[$x]=GUICtrlCreateInput("1500",($x*120)-70, 385,50,20,BitOR($ES_NUMBER,$ES_CENTER))
      GUICtrlSetOnEvent(-1,"_Update")
      GUICtrlSetLimit(-1, 4, 1)
      GUICtrlCreateLabel("Center",($x*120)-15, 387,40,20)
      GUICtrlSetFont (-1,9, 800); bold
      $srvoLo[$x]=GUICtrlCreateInput("1000",($x*120)-70, 405,50,20,BitOR($ES_NUMBER,$ES_CENTER))
      GUICtrlSetOnEvent(-1,"_Update")
      GUICtrlSetLimit(-1, 4, 1)
      GUICtrlCreateLabel("Low",($x*120)-15, 407,40,20)
      GUICtrlSetFont (-1,9, 800); bold
      $LoLimit[$x]=GUICtrlCreateCombo("0", ($x*120)-70, 425,35) ; create first item
      GUICtrlSetData(-1, "1|2|3|4|5|6") ; add other item snd set a new default
      GUICtrlSetOnEvent(-1,"_Update")
      GUICtrlCreateLabel("Low Limit",($x*120)-30, 427,55,20)
      GUICtrlSetFont (-1,9, 800); bold
   
   ;Create the bottom servos
      GUICtrlCreateLabel("Servo #" & $x+8, ($x*120)-70, 480)
      GUICtrlSetFont (-1,9, 800); bold
      $srvoOnOff[$x+8]=GUICtrlCreateButton("ON",($x*120)-70, 500,20,20,$BS_BITMAP)
      GUICtrlSetImage(-1, "led_green.bmp")
      GUICtrlSetOnEvent(-1, "_btnToggle" )
      GUICtrlCreateLabel(_GUICtrlButton_GetText(-1),($x*120)-45,503,40)
      $srvONorm[$x+8]=GUICtrlCreateButton("Reverse Off",($x*120)-70, 522,20,20,$BS_BITMAP)
      GUICtrlSetImage(-1, "led_green.bmp")
      GUICtrlSetOnEvent(-1, "_btnToggle" )
      GUICtrlCreateLabel(_GUICtrlButton_GetText(-1),($x*120)-45,524,60)
      $srvoSlew[$x+8]=GUICtrlCreateInput("360",($x*120)-70, 545,50,20,BitOR($ES_NUMBER,$ES_CENTER))
      GUICtrlSetOnEvent(-1,"_Update")
      GUICtrlSetLimit(-1, 3, 1)
      GUICtrlCreateLabel("Slew",($x*120)-15, 547,30,20)
      GUICtrlSetFont (-1,9, 800); bold
      $srvoscale[$x+8]=GUICtrlCreateInput("100",($x*120)-70, 565,50,20,BitOR($ES_NUMBER,$ES_CENTER))
      GUICtrlSetOnEvent(-1,"_Update")
      GUICtrlSetLimit(-1, 3, 1)
      GUICtrlCreateLabel("% Scale",($x*120)-15, 567,50,20)
      GUICtrlSetFont (-1,9, 800); bold
      $HiLimit[$x+8]=GUICtrlCreateCombo("0", ($x*120)-70, 585,35) ; create first item
      GUICtrlSetData(-1, "1|2|3|4|5|6") ; add other item snd set a new default
      GUICtrlSetOnEvent(-1,"_Update")
      GUICtrlCreateLabel("Hi Limit",($x*120)-30, 587,50,20)
      GUICtrlSetFont (-1,9, 800); bold
      $srvoHi[$x+8]=GUICtrlCreateInput("2000",($x*120)-70, 605,50,20,BitOR($ES_NUMBER,$ES_CENTER))
      GUICtrlSetOnEvent(-1,"_Update")
      GUICtrlSetLimit(-1, 4, 1)
      GUICtrlCreateLabel("Hi",($x*120)-15, 607,40,20)
      GUICtrlSetFont (-1,9, 800); bold
      $srvoCtr[$x+8]=GUICtrlCreateInput("1500",($x*120)-70, 625,50,20,BitOR($ES_NUMBER,$ES_CENTER))
      GUICtrlSetOnEvent(-1,"_Update")
      GUICtrlSetLimit(-1, 4, 1)
      GUICtrlCreateLabel("Center",($x*120)-15, 627,40,20)
      GUICtrlSetFont (-1,9, 800); bold
      $srvoLo[$x+8]=GUICtrlCreateInput("1000",($x*120)-70, 645,50,20,BitOR($ES_NUMBER,$ES_CENTER))
      GUICtrlSetOnEvent(-1,"_Update")
      GUICtrlSetLimit(-1, 4, 1)
      GUICtrlCreateLabel("Low",($x*120)-15, 647,40,20)
      GUICtrlSetFont (-1,9, 800); bold
      $LoLimit[$x+8]=GUICtrlCreateCombo("0", ($x*120)-70, 665,35) ; create first item
      GUICtrlSetData(-1, "1|2|3|4|5|6") ; add other item snd set a new default
      GUICtrlSetOnEvent(-1,"_Update")
      GUICtrlCreateLabel("Low Limit",($x*120)-30, 667,55,20)
      GUICtrlSetFont (-1,9, 800); bold
Next    

GUISetState(@SW_SHOW)
EndFunc ;_Create Main GUI
#EndRegion ### END Main GUI section ###

#Region ### START Select COM GUI section ###
Func _selectCom()
    $selcom = GUICreate("Select Com Port",200, 100, (@DesktopWidth-200)/2, (@DesktopHeight-100)/2)
    GUISetONEvent($GUI_EVENT_CLOSE, '_Quit')
    GUICtrlCreateLabel("Select Com Port:",15,18,100,20)
    $comport = GUICtrlCreateCombo("",110,15,70,20)
    GUICtrlSetData($comport,_CommListPorts());$ports
    $btnPort = GUICtrlCreateButton("Open Port",50,60,100,30,$BS_DEFPUSHButton)
    GUICtrlSetOnEvent(-1,"_openCom")
    ;GUICtrlSetState($btnPort, $GUI_FOCUS + $GUI_DEFButton)
    GuiSetState()
    While 1
      Sleep(100)
    WEnd
EndFunc
#EndRegion ### END Select COM GUI section ###

#Region ### START Servo Explorer functions section ###
Func _updateSlider()
   GUICtrlSetData($sliderVal, GUICtrlRead($slider))
   $val = _DecimalToHex(GUICtrlRead($slider),3)
   _CommSendString("0I01"&$val&@CR)
;~    MsgBox(0,"Slider","Slider Changed" & @CRLF & "0I01"&$val)
EndFunc

Func _btnToggle()
   Switch _GUICtrlButton_GetText(@GUI_CtrlId)
   Case "ON"
      _GUICtrlButton_SetText(@GUI_CtrlId, "OFF")
      GUICtrlSetImage(@GUI_CtrlId, "led_red.bmp")
      GUICtrlSetData(@GUI_CtrlId+1,"OFF")
      $servo=StringTrimLeft(GUICtrlRead(@GUI_CtrlId-1),7)
      If StringLen($servo) < 2 Then $servo = "0"&$servo
         $cmd="50PK"&$servo&"1"
      _CommSendString($cmd&@CR)
      MsgBox(0,"Servo " & $servo & " Off", $cmd)
   Case "OFF"
      _GUICtrlButton_SetText(@GUI_CtrlId, "ON")
      GUICtrlSetImage(@GUI_CtrlId, "led_green.bmp")
      GUICtrlSetData(@GUI_CtrlId+1,"ON")
      $servo=StringTrimLeft(GUICtrlRead(@GUI_CtrlId-1),7)
      If StringLen($servo) < 2 Then $servo = "0"&$servo
         $cmd="50PK"&$servo&"0"
      _CommSendString($cmd&@CR)
      MsgBox(0,"Servo " & $servo & " On", $cmd)
   Case "Reverse Off"
      _GUICtrlButton_SetText(@GUI_CtrlId, "Reverse On")
      GUICtrlSetImage(@GUI_CtrlId, "led_red.bmp")
      GUICtrlSetData(@GUI_CtrlId+1,"Reverse On")
      $servo=StringTrimLeft(GUICtrlRead(@GUI_CtrlId-3),7)
      If StringLen($servo) < 2 Then $servo = "0"&$servo
         $cmd="50P4"&$servo&"1"
      _CommSendString($cmd&@CR)
      MsgBox(0,"Servo " & $servo & " Reversed", $cmd)
   Case "Reverse On"
      _GUICtrlButton_SetText(@GUI_CtrlId, "Reverse Off")
      GUICtrlSetImage(@GUI_CtrlId, "led_green.bmp")
      GUICtrlSetData(@GUI_CtrlId+1,"Reverse Off")
      $servo=StringTrimLeft(GUICtrlRead(@GUI_CtrlId-3),7)
      If StringLen($servo) < 2 Then $servo = "0"&$servo
         $cmd="50P4"&$servo&"0"
      _CommSendString($cmd&@CR)
      MsgBox(0,"Servo " & $servo & " Normal", $cmd)
   EndSwitch
EndFunc

Func _Update()
   Switch GUICtrlRead(@GUI_CtrlId+1)
   Case "Slew"
      $servo=StringTrimLeft(GUICtrlRead(@GUI_CtrlId-5),7)
      If StringLen($servo) < 2 Then $servo = "0"&$servo
         $cmd="50P3"&$servo&GUICtrlRead(@GUI_CtrlId)
      _CommSendString($cmd&@CR)
      MsgBox(0,"Servo " & $servo & " Slew Changed", $cmd)
   Case "% Scale"
      $servo=StringTrimLeft(GUICtrlRead(@GUI_CtrlId-7),7)
      If StringLen($servo) < 2 Then $servo = "0"&$servo
      $slew = ((GUICtrlRead(@GUI_CtrlId)*16)/100)
      $cmd="50P5" & $servo & $slew
      _CommSendString($cmd & @CR)
      MsgBox(0,"Servo " & $servo & " Scale Changed", $cmd)
   Case "Hi Limit"
      $servo=StringTrimLeft(GUICtrlRead(@GUI_CtrlId-9),7)
      If StringLen($servo) < 2 Then $servo = "0"&$servo
         $cmd="50P9"&$servo&GUICtrlRead(@GUI_CtrlId)
      _CommSendString($cmd&@CR)
      MsgBox(0,"Servo " & $servo & " Hi Limit Changed", $cmd)
   Case "Hi"
      $servo=StringTrimLeft(GUICtrlRead(@GUI_CtrlId-11),7)
      If StringLen($servo) < 2 Then $servo = "0"&$servo
         $cmd="50P7"&$servo&GUICtrlRead(@GUI_CtrlId)
      _CommSendString($cmd&@CR)
      MsgBox(0,"Servo " & $servo & " High Value Changed", $cmd)
   Case "Center"
      $servo=StringTrimLeft(GUICtrlRead(@GUI_CtrlId-13),7)
      If StringLen($servo) < 2 Then $servo = "0"&$servo
         $cmd="50P2"&$servo&GUICtrlRead(@GUI_CtrlId)
      _CommSendString($cmd&@CR)
      MsgBox(0,"Servo " & $servo & " Center Value Changed", $cmd)
   Case "Low"
      $servo=StringTrimLeft(GUICtrlRead(@GUI_CtrlId-15),7)
      If StringLen($servo) < 2 Then $servo = "0"&$servo
         $cmd="50P6"&$servo&GUICtrlRead(@GUI_CtrlId)
         _CommSendString($cmd&@CR)
      MsgBox(0,"Servo " & $servo & " Low Value Changed", $cmd)
   Case "Low Limit"
      $servo=StringTrimLeft(GUICtrlRead(@GUI_CtrlId-17),7)
      If StringLen($servo) < 2 Then $servo = "0"&$servo
         $cmd="50P8"&$servo&GUICtrlRead(@GUI_CtrlId)
      _CommSendString($cmd&@CR)
      MsgBox(0,"Servo " & $servo & " Low Limit Changed", $cmd)
   EndSwitch
EndFunc

Func _createConfig()
   $newfile = FileSaveDialog("Destination File", @ScriptDir, "Text files (*.txt)", 16, "servo.txt")
   $newfile = FileOpen($newfile, 2)
   ; Check if file opened for reading OK
;~    If $newfile = -1 Then
;~     MsgBox(0, "Error", "Unable to open file.")
;~    EndIf
    
   For $x = 1 to 16
      FileWriteLine($newfile,"SET SERVO " & $x & " " & _GUICtrlButton_GetText($srvoOnOff[$x]))
   
   Switch _GUICtrlButton_GetText($srvONorm[$x])
      Case "Reverse Off"
         $reverse = "OFF"
      Case "Reverse On"
         $reverse = "ON"
   EndSwitch
      FileWriteLine($newfile,"SET SERVO " & $x & " REVERSE " & $reverse)
      FileWriteLine($newfile,"SET SERVO " & $x & " SLEW " & GUICtrlRead($srvoSlew[$x]))
      FileWriteLine($newfile,"SET SERVO " & $x & " SCALE " & GUICtrlRead($srvoscale[$x]))
      FileWriteLine($newfile,"SET SERVO " & $x & " CENTER " & GUICtrlRead($srvoCtr[$x]))
      FileWriteLine($newfile,"SET SERVO " & $x & " RANGE " & GUICtrlRead($srvoLo[$x]) & "," & GUICtrlRead($srvoHi[$x]))
      FileWriteLine($newfile,"SET SERVO " & $x & " LIMITS " & GUICtrlRead($HiLimit[$x]) & "," & GUICtrlRead($LoLimit[$x]))
   Next
EndFunc

Func _powerUp()
   $cmd="50PK001"&@CR
   $cmd=$cmd&"50PK001"&@CR
   $cmd=$cmd&"50PD010"&@CR
   $cmd=$cmd&"50P10101"&@CR
   $cmd=$cmd&"50P10201"&@CR
   $cmd=$cmd&"50P10301"&@CR
   $cmd=$cmd&"50P10401"&@CR
   $cmd=$cmd&"50P10501"&@CR
   $cmd=$cmd&"50P10601"&@CR
   $cmd=$cmd&"50P10701"&@CR
   $cmd=$cmd&"50P10801"&@CR
   $cmd=$cmd&"50P10901"&@CR
   $cmd=$cmd&"50P11001"&@CR
   $cmd=$cmd&"50P11101"&@CR
   $cmd=$cmd&"50P11201"&@CR
   $cmd=$cmd&"50P11301"&@CR
   $cmd=$cmd&"50P11401"&@CR
   $cmd=$cmd&"50P11501"&@CR
   $cmd=$cmd&"50P11601"&@CR
   $cmd=$cmd&"50D0"&@CR
   _CommSendString($cmd)
   MsgBox(0,"Start Expander", $cmd)
EndFunc
#EndRegion ### START Servo Explorer functions section ###

#Region ### START Operational functions ###
Func _openCom()
    $port = StringTrimLeft(GUICtrlRead($comport),3)
    _CommSetPort($port, $error, 9600, 8, 0, 1, 0);($iPort,ByRef $sErr,$iBaud=2400,$iBits=8,$vDllAnsar=0,$iStop=1,$iFlow=0)
    GUISetState(@SW_HIDE,$selcom)
    GUIDelete ($selcom)
    _createMainGUI()
EndFunc

; #FUNCTION# ==============================================================
; Function Name..: _DecToHex ( expression [, length] )
; Description ...: Returns a string representation of an integer converted to hexadecimal.
; Parameters ....: expression - The integer to be converted to hexadecimal.
; - [optional] Number of characters to be returned (no limit).
; If no length specified, leading zeros will be stripped from result.
; Return values .: Success - Returns a string of length characters representing a hexadecimal expression, zero-padded if necessary.
; Failure - Returns "" (blank string) and sets @error to 1 if expression is not an integer.
; Author ........: jennico (jennicoattminusonlinedotde)
; Remarks .......: Output format "FFFF".
; The function will also set @error to 1 if requested length is not sufficient - the returned string will be left truncated.
; Be free to modify the function to be working with binary type input - I did not try it though.
; current AutoIt Hex() limitation: 0xFFFFFFFF (4294967295).
; Related .......: Hex(), Dec(), _HexToDec()
; =======================================================================
Func _DecimalToHex($hx_dec, $hx_length = 21)

If IsInt($hx_dec) = 0 Then
SetError(1)
        MsgBox(0,"Error","Wrong input, try again ...")
Return ""
EndIf
Local $ret = "", $Ii, $hx_tmp, $hx_max
If $hx_dec < 4294967296 Then
If $hx_length < 9 Then Return Hex($hx_dec, $hx_length)
If $hx_length = 21 Then
$ret = Hex($hx_dec)
While StringLeft($ret, 1) = "0"
$ret = StringMid($ret, 2)
WEnd
Return $ret
EndIf
EndIf
For $Ii = $hx_length - 1 To 0 Step -1
$hx_max = 16 ^ $Ii - 1
If $ret = "" And $hx_length = 21 And $hx_max > $hx_dec Then ContinueLoop
$hx_tmp = Int($hx_dec/($hx_max+1))
If $ret = "" And $hx_length = 21 And $Ii > 0 And $hx_tmp = 0 Then ContinueLoop
$ret &= StringMid($HX_REF, $hx_tmp+1, 1)
$hx_dec -= $hx_tmp * ($hx_max + 1)
Next
$ret=String($ret)
If $hx_length < 21 And StringLen($ret) < $hx_length Then SetError(1)
Return $ret
EndFunc ;==>_DecToHex()

Func _Quit()
;~    Exit
    GUISetState(@SW_HIDE,$selcom)
    _createMainGUI()
EndFunc

Func _Exit()
    _CommClosePort()
    Exit
EndFunc
#EndRegion ### END Operational functions ###

#Region ### START Main Program ###
_selectCom()
#EndRegion ### END Main Program ###
Edited by jkotecki

Share this post


Link to post
Share on other sites



A workaround is to check if the buttons have focus before you execute the code.

Function to get the control with focus:

Func GuiCtrlGetFocus( $hWnd )
    Local $hCtrl = ControlGetHandle( $hWnd, "", ControlGetFocus( $hWnd ) )
    Local $aRet = DllCall( "user32.dll", "int", "GetDlgCtrlID", "hwnd", $hCtrl )
    Return $aRet[0]
EndFunc

Then add this line as the first line in the button functions:

If GuiCtrlGetFocus( $form1 ) <> $btnX Then Return

You have to declare $form1 as a global.

Share this post


Link to post
Share on other sites

jkotecki,

I assume we are talking of the "Start Expander" and "Create Configuration" buttons. The reason for the behaviour is simple - you have coloured the buttons! ;)

There is a bug #376 deep in the AutoIt core code which means that colouring buttons means that the button fires on {ENTER} - so when you change an input and press that key, the last of those 2 buttons actioned will fire. Remove the colouring and all behaves as you would expect. :)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

M23, that was it. Thank you! I never would have guessed that it was because of the button color.

-Jason

Share this post


Link to post
Share on other sites

jkotecki,

Glad I could help. :)

M23

1 person likes this

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0