JollyFace Posted December 29, 2011 Share Posted December 29, 2011 (edited) Building a small app for a touchscreen where keyboard might not be available. This is a portion of the entire code that basically forces the user to set the current time and timezone at first startup. If the user presses "OK" before a choice is made, I want to highlight the field that needs attention. I've created two rectangles to "frame" the field, one red and one black. I want to show the red one when a choice has not been made, then hide it (returning to the black one) when a choice has been made. Seems to work except that only the top three-fourths of the red graphic shows up. I've tried hiding the normal black frame as part of the process with no luck. Am I missing something simple here? Thanks in advance! expandcollapse popup#include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <EditConstants.au3> Global $TimeZoneChosen = False Global $MainForm = GUICreate("System Setup", @DesktopWidth, @DesktopHeight) ; -------- Time Zone Section ------------------- Global $TZinput = GUICtrlCreateInput("",175,160,70, 20, BitOR($ES_READONLY,$ES_CENTER)) GUICtrlSetFont($TZinput, 11, 500) GUICtrlSetBkColor ($TZinput, 0x000000) GUICtrlSetColor ($TZinput, 0xffffff) Global $TZE = GUICtrlCreateButton("Eastern", 175, 192, 73, 25) Global $TZC = GUICtrlCreateButton("Central", 175, 228, 73, 25) Global $TZM = GUICtrlCreateButton("Mountain", 175, 264, 73, 25) Global $TZZ = GUICtrlCreateButton("Arizona", 175, 299, 73, 25) Global $TZP = GUICtrlCreateButton("Pacific", 175, 335, 73, 25) Global $TZA = GUICtrlCreateButton("Alaskan", 175, 371, 73, 25) Global $TimeOK = GUICtrlCreateButton("OK", 758, 286, 61, 118) GUICtrlSetFont($TimeOK, 11, 500) ; Graphic Frames Global $FrameTZ = GUICtrlCreateGraphic(170, 170) GUICtrlSetGraphic($FrameTZ, $GUI_GR_RECT, 0, 0, 83, 235) Global $FrameTZRed = GUICtrlCreateGraphic(170, 170) GUICtrlSetGraphic($FrameTZRed,$GUI_GR_COLOR, 0xF80606) GUICtrlSetGraphic($FrameTZRed, $GUI_GR_RECT, 0, 0, 83, 235) GUICtrlSetState($FrameTZRed, $GUI_HIDE) Main() Func Main() GUISetState(@SW_SHOW, $MainForm) While 1 Local $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE GUIDelete($MainForm) ExitLoop Case $TZE NewTimezone($TZE) Case $TZC NewTimezone($TZC) Case $TZM NewTimezone($TZM) Case $TZZ NewTimezone($TZZ) Case $TZP NewTimezone($TZP) Case $TZA NewTimezone($TZA) Case $TimeOK VerifyTimeDateChange() EndSwitch WEnd EndFunc ;==> Main Func NewTimezone($SelectedButton) $TimeZoneChosen = True GUICtrlSetStyle($TZA, $GUI_SS_DEFAULT_BUTTON) GUICtrlSetStyle($TZC, $GUI_SS_DEFAULT_BUTTON) GUICtrlSetStyle($TZE, $GUI_SS_DEFAULT_BUTTON) GUICtrlSetStyle($TZM, $GUI_SS_DEFAULT_BUTTON) GUICtrlSetStyle($TZP, $GUI_SS_DEFAULT_BUTTON) GUICtrlSetStyle($TZZ, $GUI_SS_DEFAULT_BUTTON) GUICtrlSetStyle($SelectedButton, $BS_FLAT) GUICtrlSetBkColor($SelectedButton, 0x00008B) GuiCtrlSetColor($SelectedButton, 0xffffff) GUICtrlSetData($TZinput,GUICtrlRead($SelectedButton)) EndFunc ; ===> NewTimezone Func VerifyTimeDateChange() GUICtrlSetState($FrameTZRed, $GUI_HIDE) If $TimeZoneChosen = False Then GUICtrlSetState($FrameTZRed, $GUI_SHOW) EndFunc ; ==> VerifyTimeDateChange() Edited December 29, 2011 by JollyFace Link to comment Share on other sites More sharing options...
LarsJ Posted January 4, 2012 Share Posted January 4, 2012 Just set the size of the graphic controls f.ex. GUICtrlCreateGraphic(170, 170, 100, 250). Controls, File Explorer, ROT objects, UI Automation, Windows Message MonitorCompiled code: Accessing AutoIt variables, DotNet.au3 UDF, Using C# and VB codeShell menus: The Context menu, The Favorites menu. Shell related: Control Panel, System Image ListsGraphics related: Rubik's Cube, OpenGL without external libraries, Navigating in an image, Non-rectangular selectionsListView controls: Colors and fonts, Multi-line header, Multi-line items, Checkboxes and icons, Incremental searchListView controls: Virtual ListViews, Editing cells, Data display functions Link to comment Share on other sites More sharing options...
JollyFace Posted January 4, 2012 Author Share Posted January 4, 2012 Thank you, LarsJ! Link to comment Share on other sites More sharing options...
asrin2 Posted January 7, 2012 Share Posted January 7, 2012 (edited) thank you for solving my problem. Edited January 7, 2012 by asrin2 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