Brandan Posted November 9, 2012 Share Posted November 9, 2012 (edited) I have a GUI that works with a database. Once in a while I need to look up a rowid and have been dedacating part of the window to do that. My pages are getting too full and I want to move that to a floating toolbar or child window of somesort. I have set up such a window and it works as expected, except the toolbar window is not very responsive to mouse clicks.I have several input boxs on the child window, sometimes it works smoothly, but most of the time I need to click 5+ times before the input that I want becomes active and I can type in what I want. I have been finding it faster to just use the tab button to move the select where I want it, which in this case is not as handy as I would like. While the child window is giving me problems the main window is as responcive as I normally expect from an AutoIT GUI. Any ideas what I am doing wrong or how I can make the child more responsive to my wishes? Below is a sample script riped from my project to display the problem. Just try clicking on the various inputs and you should see what I am talking about.expandcollapse popup#include <WindowsConstants.au3> #include <ButtonConstants.au3> #include <Misc.au3> #include <GUIConstantsEx.au3> Opt("GUIOnEventMode", 1) ; Change to OnEvent mode $mainwindow = GUICreate ( "BTCattle---Intro" , IniRead ( "pref.ini", "GUI", "SizeX", "1280" ),IniRead ( "pref.ini", "GUI", "SizeY", "800" )) ;Creat the page GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked") Opt("GUICoordMode", 1) ;1=absolute, 0=relative, 2=cell $UIDBtag=GUICtrlCreateInput("",115,1,150,IniRead ( "pref.ini", "GUI", "Fontsize", "10" )+10) Opt("GUICoordMode", 2) ;1=absolute, 0=relative, 2=cell $UIDCalfN=GUICtrlCreateInput("",-1,0) $UIDDOByear=GUICtrlCreateInput("",-1,0) $UIDDOB=GUICtrlCreateInput("",-1,0) $UIDSortDOB=GUICtrlCreateInput("",-1,0) $UIDDamtag=GUICtrlCreateInput("",-1,0) $UIDDamUID=GUICtrlCreateInput("",-1,0) GUICtrlSetOnEvent(GUICtrlCreateButton("Find Animal", -1, 0,200,$GUI_SS_DEFAULT_BUTTON),"UIDfind") $selectwindow=GUICreate ( "Select Cow" , 300, 400, 1100, 300, -1, $WS_EX_TOOLWINDOW, $mainwindow ) ;create toolwindow ;First Colum Opt("GUICoordMode", 1) ;1=absolute, 0=relative, 2=cell GUICtrlCreateLabel ('Select Btag like %a%',1,5,150,IniRead ( "pref.ini", "GUI", "Fontsize", "10" )+10) Opt("GUICoordMode", 2) ;1=absolute, 0=relative, 2=cell GUICtrlCreateLabel ('CalfN like %a%',-1,0) GUICtrlCreateLabel ('Year of birth "2012"',-1,0) GUICtrlCreateLabel ('DOB "1/5/2012"',-1,0) GUICtrlCreateLabel ('SortDOB ',-1,0) GUICtrlCreateLabel ('Dam',-1,0) GUICtrlCreateLabel ('DamUID',-1,0) GUICtrlSetOnEvent(GUICtrlCreateButton("Find Animal", -1, 0,200,$GUI_SS_DEFAULT_BUTTON),"UIDfind") GUICtrlCreateLabel ('UID',-1,0) $UIDUIDlist = GUICtrlCreateList("UID", -1, 0,75,200) GUICtrlSetOnEvent($UIDUIDlist,'UIDUIDlist') ;Second Colum Opt("GUICoordMode", 1) ;1=absolute, 0=relative, 2=cell $UIDBtag=GUICtrlCreateInput("",115,1,150,IniRead ( "pref.ini", "GUI", "Fontsize", "10" )+10) Opt("GUICoordMode", 2) ;1=absolute, 0=relative, 2=cell $UIDCalfN=GUICtrlCreateInput("",-1,0) $UIDDOByear=GUICtrlCreateInput("",-1,0) $UIDDOB=GUICtrlCreateInput("",-1,0) $UIDSortDOB=GUICtrlCreateInput("",-1,0) $UIDDamtag=GUICtrlCreateInput("",-1,0) $UIDDamUID=GUICtrlCreateInput("",-1,0) GUISetState(@SW_SHOW) GUISwitch($mainwindow) GUISetState(@SW_SHOW) Func CLOSEClicked() Exit EndFunc While 1 Sleep(10000) ; Idle around WEnd Edited November 10, 2012 by Brandan Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 9, 2012 Moderators Share Posted November 9, 2012 Brandan, The problem is that the labels in the child GUI are overlapping the inputs - in that case when you click on the overlapping part AutoIt does not know which control you are trying to action and so it actions neither. You can show this by clicking on the centre or extreme right of the child GUI inputs - this selects them immediately - where as clicking on the extreme left does not. Just change the width of the first child GUI label to 110 and the inputs then work across their whole width. M23 P.S. You do realise you have the same names for the inputs in the main and child GUIs? That could pose problems when you try to read them. Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Brandan Posted November 10, 2012 Author Share Posted November 10, 2012 Thanks Melba, I figured I was likely over looking something easy 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