Jump to content

ComboBox Not Responsive


Recommended Posts

Any idea why the drop down on these combo boxes, only works occasionally, sometimes it's really slow to respond, other times it doesn't respond at all.

 

#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <ComboConstants.au3>  ;Needed for ComboBox
#include <StaticConstants.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
#include <GuiTab.au3>   ;_GUICtrlTab_GetCurFocus

#Region ### START Koda GUI section ### Form=

Global $iCurrentTab

; Main Window Parameters
$StartXSize = 720
$StartYSize = 437
$StartXPos  = 192
$StartYPos  = 124
$Form1 = GUICreate("Form1", $StartXSize, $StartYSize, $StartXPos, $StartYPos)
$Tabs = GUICtrlCreateTab(16, 16, $StartXSize-40, $StartYSize-40)
$TabItemADC = GUICtrlCreateTabItem("TAB1")

;**** TAB 1  ****
; TODO

;**** TAB 2 - DAC1 ****
Local $xstart   = 40
Local $ystart   = 64
Local $xspace   = 50
$TabItemDAC = GUICtrlCreateTabItem("DAC")

;Label
$lDac1 = GUICtrlCreateLabel("DAC1",  $xstart, $ystart + 4 , 120, 20)

;ComboBox Command
$cbCmdDac1 = GUICtrlCreateCombo("VAL", $xstart + $xspace, 64, 45, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
GUICtrlSetData($cbCmdDac1,"SPAN" & "|" & "RANGE")

;ComboBox Channel
$cbChDac1 = GUICtrlCreateCombo("Ch0",  $xstart + 2*$xspace, 64, 45, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
GUICtrlSetData($cbChDac1,"Ch1" & "|" & "Ch2"& "|" & "Ch3"& "|" & "Ch4"& "|" & "Ch5"& "|" & "Ch6"& "|" & "Ch7"& "|" & "Ch8"& "|" & "Ch9"& "|" & "Ch10"& "|" & "Ch11" & "|" & "Ch12"& "|" & "Ch13"& "|" & "Ch14"& "|" & "Ch15")

;Line Edit
$leValDac1 = GUICtrlCreateInput("0x0000", $xstart + 3*$xspace, 64, 50, 21)

;Button
$btDac1 = GUICtrlCreateButton("Apply", $xstart + 5*$xspace, 64, 50, 21)


;**** TAB 2 - DAC2 ****
$xstart   = 40
$ystart   = $ystart + 40
$xspace   = 50
Local $yspace = 30

;Label
$lDac2 = GUICtrlCreateLabel("DAC2",  $xstart, ($ystart + 4)+2*$yspace , 120, 20)

;ComboBox Command
$cbCmdDac2 = GUICtrlCreateCombo("VAL", $xstart + $xspace, $ystart +2*$yspace, 45, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
GUICtrlSetData($cbCmdDac2,"SPAN" & "|" & "RANGE")

;ComboBox Channel
$cbChDac2 = GUICtrlCreateCombo("Ch0",  $xstart + 2*$xspace, $ystart +2*$yspace, 45, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
GUICtrlSetData($cbChDac2,"Ch1" & "|" & "Ch2"& "|" & "Ch3"& "|" & "Ch4"& "|" & "Ch5"& "|" & "Ch6"& "|" & "Ch7"& "|" & "Ch8"& "|" & "Ch9"& "|" & "Ch10"& "|" & "Ch11" & "|" & "Ch12"& "|" & "Ch13"& "|" & "Ch14"& "|" & "Ch15")

;Line Edit
$leValDac2 = GUICtrlCreateInput("0x0000", $xstart + 3*$xspace, $ystart +2*$yspace, 50, 21)

;Button
$btDac2 = GUICtrlCreateButton("Apply", $xstart + 5*$xspace, $ystart +2*$yspace, 50, 21)

;GUICtrlCreateTabItem("")
GUISetState(@SW_SHOW)
$iCurrentTab = _GUICtrlTab_GetCurFocus($Tabs)

#EndRegion ### END Koda GUI section ###

;**********************************************
;**********************************************
;**********************************************
; *************** MAIN LOOP *******************
;**********************************************
;**********************************************
;**********************************************

While 1
    $nMsg = GUIGetMsg()

        Switch $nMsg
            Case $GUI_EVENT_CLOSE
                Exit
            EndSwitch
WEnd

 

Test.au3

Link to comment
Share on other sites

Your labels are over the top of your first combobox, use Koda or what I normally do, is use GUICtrlSetBkColor(-1, 0xFF3344) for a control to help determine its relative positions to other controls and cutting and pasting for each new control created.

Edited by Subz
Link to comment
Share on other sites

3 hours ago, Subz said:

Your labels are over the top of your first combobox, use Koda or what I normally do, is use GUICtrlSetBkColor(-1, 0xFF3344) for a control to help determine each controls relative positions relative to each other and cutting and pasting for each new control created.

Thanks!!   

I would have used Koda, except I'm going to need to programmatically loop thru the controls.. although it would be nice to add gui elements via Kodi and code.    Thanks for the back color tip, definitely will save me next time!

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...