Sign in to follow this  
Followers 0
jtrout

Mouse and GUI Button issues

7 posts in this topic

Help I am trying to stay sane here but I have a GUI with a GUI tabs on it and on each tab there is a button. When I move the mouse over the button the text on the button changes. Is there any reason for this? Any clues?

Share this post


Link to post
Share on other sites



Probally Every tab has the button on the same place ..

and you've made a mistake in de code..

so if you post your code..

maybe we can help


Best regards,Emiel Wieldraaijer

Share this post


Link to post
Share on other sites

Probally Every tab has the button on the same place ..

and you've made a mistake in de code..

so if you post your code..

maybe we can help

Here is code:

CODE

include <guitab.au3>

#include <GuiConstants.au3>

#include <array.au3>

#include <file.au3>

Opt("MustDeclareVars", 1) ; Variables must be pre-declared

Global $fileitemExit, $fileitemLogComplete, $filemenuFile, $filemenuLog, $tab, $iCurrentTab

Global $UpdateServerbutton, $serversInINI, $file, $newdrives

Local $Server, $x, $val, $logmsg, $driveletter, $pathtomap, $user, $passwd, $log, $timestamp

Local $month, $day, $year, $hour, $min, $sec, $time, $counter, $logonfrm, $UserIDField, $PasswordField, $UserID, $Password

Local $button1, $button2, $msg

Local $AlogentversionNumberServer, $AlogentversionNumberFieldCurrent, $AlogentversionNumberFieldFuture, $AlogentversionNumberMaster

Local $ArgoServer, $ArgoFieldCurrent, $ArgoFieldFuture, $ArgoMaster

Local $CodeversionServer, $CodeversionFieldCurrent, $CodeversionFieldFuture, $CodeversionMaster

Local $ServerDateDateServer, $ServerDateDateFieldCurrent, $ServerDateDateFieldFuture, $ServerDateDateMaster

Local $SortPatternDateServer, $SortPatternDateFieldCurrent, $SortPatternDateFieldFuture, $SortPatternDateMaster

Local $SortPatternTimeServer, $SortPatternTimeFieldCurrent, $SortPatternTimeFieldFuture, $SortPatternTimeMaster

Local $SortPatternversionNumberServer, $SortPatternversionNumberFieldCurrent, $SortPatternversionNumberFieldFuture, $SortPatternversionNumberMaster

Local $TDEFNDateServer, $TDEFNDateFieldCurrent, $TDEFNDateFieldFuture, $TDEFNDateMaster

Local $TDEFNTimeServer, $TDEFNTimeFieldCurrent, $TDEFNTimeFieldFuture, $TDEFNTimeMaster

Local $TDEFNversionNumberServer, $TDEFNversionNumberFieldCurrent, $TDEFNversionNumberFieldFuture, $TDEFNversionNumberMaster

;~ Local $ArgoMaster, $ArgoServer, $TDEFNDateMaster, $TDEFNDateServer, $TDEFNDateMaster, $TDEFNDateServer, $TDEFNTimeMaster, $TDEFNTimeServer

;~ Local $TDEFNversionNumberMaster, $TDEFNversionNumberServer, $AlogentversionNumberMaster, $AlogentversionNumberServer

;~ Local $SortPatternDateMaster, $SortPatternDateServer, $SortPatternTimeMaster, $SortPatternTimeServer, $SortPatternversionNumberMaster, $SortPatternversionNumberServer

;~ Local $ServerDateDateMaster, $ServerDateDateServer, $CodeversionMaster, $CodeversionServer

; Open Log file

$logmsg = "Start of GUICodeLoader.exe"

logger($logmsg)

; Login for Script access

Opt("GUIOnEventMode", 0) ; Change to OnEvent mode

;logon()

GUIMapping()

Opt("GUIOnEventMode", 1) ; Change to OnEvent mode

displayGUI()

Exit

Func displayGUI()

; GUI

GUICreate("Code Loader GUI", 600, 830)

;GuiSetIcon(@SystemDir & "\mspaint.exe", 0)

GUISetOnEvent($GUI_EVENT_CLOSE, "SpecialEvents")

GUISetOnEvent($GUI_EVENT_MINIMIZE, "SpecialEvents")

GUISetOnEvent($GUI_EVENT_RESTORE, "SpecialEvents")

; MENU

$filemenuFile = GUICtrlCreateMenu("&File")

$fileitemExit = GUICtrlCreateMenuItem("E&xit", $filemenuFile)

GUICtrlSetOnEvent(-1, "ExitGUI")

;$filemenuMap = GuiCtrlCreateMenu("&Map Drives")

;$fileitemMapIST1 = GUICtrlCreateMenuItem("Re-map IST1 Server", $filemenuMap)

;GUICtrlSetOnEvent(-1, "RemapIST1")

;$fileitemMapIST2 = GUICtrlCreateMenuItem("Re-map IST2 Server", $filemenuMap)

;GUICtrlSetOnEvent(-1, "RemapIST2")

;$fileitemMapTST1 = GUICtrlCreateMenuItem("Re-map TST1 Server", $filemenuMap)

;GUICtrlSetOnEvent(-1, "RemapTST1")

;$fileitemMapTST2 = GUICtrlCreateMenuItem("Re-map TST2 Server", $filemenuMap)

;GUICtrlSetOnEvent(-1, "RemapTST2")

;$fileitemMapUAT = GUICtrlCreateMenuItem("Re-map UAT Server", $filemenuMap)

;GUICtrlSetOnEvent(-1, "RemapUAT")

;$filemenuRefresh = GUICtrlCreateMenu("&Refresh Tab")

;$fileitemRefreshIST1 = GUICtrlCreateMenuItem("Refresh IST1 Tab", $filemenuRefresh)

;GUICtrlSetOnEvent(-1, "RefreshIST1Tab")

;$fileitemRefreshIST2 = GUICtrlCreateMenuItem("Refresh IST2 Tab", $filemenuRefresh)

;GUICtrlSetOnEvent(-1, "RefreshIST2Tab")

;$fileitemRefreshTST1 = GUICtrlCreateMenuItem("Refresh TST1 Tab", $filemenuRefresh)

;GUICtrlSetOnEvent(-1, "RefreshTST1Tab")

;$fileitemRefreshTST2 = GUICtrlCreateMenuItem("Refresh TST2 Tab", $filemenuRefresh)

;GUICtrlSetOnEvent(-1, "RefreshTST2Tab")

;$fileitemRefreshUAT = GUICtrlCreateMenuItem("Refresh UAT Tab", $filemenuRefresh)

;GUICtrlSetOnEvent(-1, "RefreshUATTab")

$filemenuLog = GUICtrlCreateMenu("&Log")

$fileitemLogComplete = GUICtrlCreateMenuItem("View Complete Log", $filemenuLog)

GUICtrlSetOnEvent(-1, "CompleteLog")

; TABS

Tabs()

TabClick()

GUISetState(@SW_SHOW)

GUICtrlSetOnEvent($tab, "TabClick")

GUICtrlSetOnEvent($UpdateServerbutton, "UpdateServer")

While 1

Sleep(10)

WEnd

GUIDelete()

EndFunc ;==>displayGUI

Func ExitGUI()

Exit

EndFunc ;==>ExitGUI

Func SpecialEvents()

Select

Case @GUI_CtrlId = $GUI_EVENT_CLOSE

Exit

Case @GUI_CtrlId = $GUI_EVENT_MINIMIZE

Case @GUI_CtrlId = $GUI_EVENT_RESTORE

EndSelect

EndFunc ;==>SpecialEvents

Func Tabs()

$tab = GUICtrlCreateTab(5, 5, 590, 800)

For $x = 1 To $serversInINI[0]

GUITab($serversInINI[$x])

Next

GUICtrlCreateTabItem("")

EndFunc ;==>Tabs

Func TabClick()

$iCurrentTab = _GUICtrlTabGetCurFocus($tab)

$x = $iCurrentTab + 1

getINIInfo($serversInINI[$x])

LoadFields($serversInINI[$x])

RefreshFields()

GUICtrlSetData($UpdateServerbutton, "&Update " & $serversInINI[$x])

EndFunc ;==>TabClick

Func GUITab($val)

GUICtrlCreateTabItem($val)

GUICtrlCreateLabel("Current INI on " & $val, 10, 40)

GUICtrlCreateLabel("ARGO - versionNumber", 10, 70)

GUICtrlCreateLabel("TDEFN - versionNumber", 10, 100)

GUICtrlCreateLabel("TDEFN - Date", 10, 130)

GUICtrlCreateLabel("TDEFN - Time", 10, 160)

GUICtrlCreateLabel("Alogent - versionNumber", 10, 190)

GUICtrlCreateLabel("Sort Pattern - versionNumber", 10, 220)

GUICtrlCreateLabel("Sort Pattern - Date", 10, 250)

GUICtrlCreateLabel("Sort Pattern - Time", 10, 280)

GUICtrlCreateLabel("Server Date - Date", 10, 310)

GUICtrlCreateLabel("Code Delivery Folder - version", 10, 340)

GUICtrlCreateLabel("Future INI on " & $val, 10, 400)

GUICtrlCreateLabel("ARGO - versionNumber", 10, 430)

GUICtrlCreateLabel("TDEFN - versionNumber", 10, 460)

GUICtrlCreateLabel("TDEFN - Date", 10, 490)

GUICtrlCreateLabel("TDEFN - Time", 10, 520)

GUICtrlCreateLabel("Alogent - versionNumber", 10, 550)

GUICtrlCreateLabel("Sort Pattern - versionNumber", 10, 580)

GUICtrlCreateLabel("Sort Pattern - Date", 10, 610)

GUICtrlCreateLabel("Sort Pattern - Time", 10, 640)

GUICtrlCreateLabel("Server Date - Date", 10, 670)

GUICtrlCreateLabel("Code Delivery Folder - version", 10, 700)

GUICtrlSetData($UpdateServerbutton, "&Update " & $val)

EndFunc ;==>GUITab

Func LoadFields($val)

$ArgoFieldCurrent = GUICtrlCreateInput("", 180, 70, 200, 20)

$TDEFNversionNumberFieldCurrent = GUICtrlCreateInput("", 180, 100, 200, 20)

$TDEFNDateFieldCurrent = GUICtrlCreateInput("", 180, 130, 200, 20)

$TDEFNTimeFieldCurrent = GUICtrlCreateInput("", 180, 160, 200, 20)

$AlogentversionNumberFieldCurrent = GUICtrlCreateInput("", 180, 190, 200, 20)

$SortPatternversionNumberFieldCurrent = GUICtrlCreateInput("", 180, 220, 200, 20)

$SortPatternDateFieldCurrent = GUICtrlCreateInput("", 180, 250, 200, 20)

$SortPatternTimeFieldCurrent = GUICtrlCreateInput("", 180, 280, 200, 20)

$ServerDateDateFieldCurrent = GUICtrlCreateInput("", 180, 310, 200, 20)

$CodeversionFieldCurrent = GUICtrlCreateInput("", 180, 340, 200, 20)

$ArgoFieldFuture = GUICtrlCreateInput("", 180, 430, 200, 20)

$TDEFNversionNumberFieldFuture = GUICtrlCreateInput("", 180, 460, 200, 20)

$TDEFNDateFieldFuture = GUICtrlCreateInput("", 180, 490, 200, 20)

$TDEFNTimeFieldFuture = GUICtrlCreateInput("", 180, 520, 200, 20)

$AlogentversionNumberFieldFuture = GUICtrlCreateInput("", 180, 550, 200, 20)

$SortPatternversionNumberFieldFuture = GUICtrlCreateInput("", 180, 580, 200, 20)

$SortPatternDateFieldFuture = GUICtrlCreateInput("", 180, 610, 200, 20)

$SortPatternTimeFieldFuture = GUICtrlCreateInput("", 180, 640, 200, 20)

$ServerDateDateFieldFuture = GUICtrlCreateInput("", 180, 670, 200, 20)

$CodeversionFieldFuture = GUICtrlCreateInput("", 180, 700, 200, 20)

$UpdateServerbutton = GUICtrlCreateButton("&Update " & $val, 100, 750, 200, 30)

;GUICtrlSetData($UpdateServerbutton, "&Update " & $val)

GUICtrlSetData($UpdateServerbutton, "")

EndFunc ;==>LoadFields

Func RefreshFields()

GUICtrlSetData($ArgoFieldCurrent, $ArgoServer)

GUICtrlSetData($TDEFNversionNumberFieldCurrent, $TDEFNversionNumberServer)

GUICtrlSetData($TDEFNDateFieldCurrent, $TDEFNDateServer)

GUICtrlSetData($TDEFNTimeFieldCurrent, $TDEFNTimeServer)

GUICtrlSetData($AlogentversionNumberFieldCurrent, $AlogentversionNumberServer)

GUICtrlSetData($SortPatternversionNumberFieldCurrent, $SortPatternversionNumberServer)

GUICtrlSetData($SortPatternDateFieldCurrent, $SortPatternDateServer)

GUICtrlSetData($SortPatternTimeFieldCurrent, $SortPatternTimeServer)

GUICtrlSetData($ServerDateDateFieldCurrent, $ServerDateDateServer)

GUICtrlSetData($CodeversionFieldCurrent, $CodeversionServer)

GUICtrlSetData($ArgoFieldFuture, $ArgoMaster)

GUICtrlSetData($TDEFNversionNumberFieldFuture, $TDEFNversionNumberMaster)

GUICtrlSetData($TDEFNDateFieldFuture, $TDEFNDateMaster)

GUICtrlSetData($TDEFNTimeFieldFuture, $TDEFNTimeMaster)

GUICtrlSetData($AlogentversionNumberFieldFuture, $AlogentversionNumberMaster)

GUICtrlSetData($SortPatternversionNumberFieldFuture, $SortPatternversionNumberMaster)

GUICtrlSetData($SortPatternDateFieldFuture, $SortPatternDateMaster)

GUICtrlSetData($SortPatternTimeFieldFuture, $SortPatternTimeMaster)

GUICtrlSetData($ServerDateDateFieldFuture, $ServerDateDateMaster)

GUICtrlSetData($CodeversionFieldFuture, $CodeversionMaster)

EndFunc ;==>RefreshFields

Func getINIInfo($val)

;~ getArgoVersion($val) ;Gets ARGO system Code Version #'s

;~ getTDEFNVersion($val) ;Gets TE TDEFN File Version #'s

;~ getTDEFNDate($val) ;Gets TE TDEFN File Dates

;~ getTDEFNTime($val) ;Gets TE TDEFN File Times

;~ getAlogentVersion($val) ;Gets Alogent System Code Version #'s

;~ getSortPatternVersion($val) ;Gets Sort Pattern Version #'s

;~ getSortPatternDate($val) ;Gets Sort Pattern Dates

;~ getSortPatternTime($val) ;Gets Sort Pattern Times

;~ getServerDate($val) ;Gets Server Date

;~ getCodeversion($val) ;Gets Code Version

If $val = "IST1" Then

$ArgoServer = "1.1"

ElseIf $val = "IST2" Then

$ArgoServer = "1.2"

ElseIf $val = "TST1" Then

$ArgoServer = "1.3"

ElseIf $val = "TST2" Then

$ArgoServer = "1.4"

ElseIf $val = "UAT" Then

$ArgoServer = "1.5"

ElseIf $val = "NDS" Then

$ArgoServer = "1.6"

EndIf

;GUICtrlSetData($UpdateServerbutton, "&Update " & $val)

EndFunc ;==>getINIInfo

Func getArgoVersion($val)

$ArgoServer = IniRead ( $driveletter & '\Sierra Xpedite\Bankone\Update\TellerExpressUpdate.ini', 'ARGO', 'versionNumber', "ERROR" )

$ArgoMaster = IniRead ( 'Z:\CodeDelivery\GUICodeLoader\' & $val & '\TellerExpressUpdate.ini', 'ARGO', 'versionNumber', "ERROR" )

EndFunc

Func getTDEFNVersion($val)

$TDEFNversionNumberServer = IniRead ( 'H:\Sierra Xpedite\Bankone\Update\TellerExpressUpdate.ini', 'TDEFN', 'versionNumber', "ERROR" )

$TDEFNversionNumberMaster = IniRead ( 'Z:\CodeDelivery\GUICodeLoader\IST1\TellerExpressUpdate.ini', 'TDEFN', 'versionNumber', "ERROR" )

EndFunc

Func getTDEFNDate($val)

$TDEFNDateServer = IniRead ( 'H:\Sierra Xpedite\Bankone\Update\TellerExpressUpdate.ini', 'TDEFN', 'Date', "ERROR" )

$TDEFNDateMaster = IniRead ( 'Z:\CodeDelivery\GUICodeLoader\IST1\TellerExpressUpdate.ini', 'TDEFN', 'Date', "ERROR" )

EndFunc

Func getTDEFNTime($val)

$TDEFNTimeServer = IniRead ( 'H:\Sierra Xpedite\Bankone\Update\TellerExpressUpdate.ini', 'TDEFN', 'Time', "ERROR" )

$TDEFNTimeMaster = IniRead ( 'Z:\CodeDelivery\GUICodeLoader\IST1\TellerExpressUpdate.ini', 'TDEFN', 'Time', "ERROR" )

EndFunc

Func getAlogentVersion($val)

$AlogentversionNumberServer = IniRead ( 'H:\Sierra Xpedite\Bankone\Update\TellerExpressUpdate.ini', 'Alogent', 'versionNumber', "ERROR" )

$AlogentversionNumberMaster = IniRead ( 'Z:\CodeDelivery\GUICodeLoader\IST1\TellerExpressUpdate.ini', 'Alogent', 'versionNumber', "ERROR" )

EndFunc

Func getSortPatternVersion($val)

$SortPatternversionNumberServer = IniRead ( 'H:\Sierra Xpedite\Bankone\Update\TellerExpressUpdate.ini', 'Sort Pattern', 'versionNumber', "ERROR" )

$SortPatternversionNumberMaster = IniRead ( 'Z:\CodeDelivery\GUICodeLoader\IST1\TellerExpressUpdate.ini', 'Sort Pattern', 'versionNumber', "ERROR" )

EndFunc

Func getSortPatternDate($val)

$SortPatternDateServer = IniRead ( 'H:\Sierra Xpedite\Bankone\Update\TellerExpressUpdate.ini', 'Sort Pattern', 'Date', "ERROR" )

$SortPatternDateMaster = IniRead ( 'Z:\CodeDelivery\GUICodeLoader\IST1\TellerExpressUpdate.ini', 'Sort Pattern', 'Date', "ERROR" )

EndFunc

Func getSortPatternTime($val)

$SortPatternTimeServer = IniRead ( 'H:\Sierra Xpedite\Bankone\Update\TellerExpressUpdate.ini', 'sort Pattern', 'Time', "ERROR" )

$SortPatternTimeMaster = IniRead ( 'Z:\CodeDelivery\GUICodeLoader\IST1\TellerExpressUpdate.ini', 'sort Pattern', 'Time', "ERROR" )

EndFunc

Func getServerDate($val)

$ServerDateDateServer = IniRead ( 'H:\Sierra Xpedite\Bankone\Update\TellerExpressUpdate.ini', 'Server Date', 'Date', "ERROR" )

$ServerDateDateMaster = IniRead ( 'Z:\CodeDelivery\GUICodeLoader\IST1\TellerExpressUpdate.ini', 'Server Date', 'Date', "ERROR" )

EndFunc

Func getCodeversion($val)

$CodeversionServer = IniRead ( 'H:\ServerConfig\ServerConfig.ini', '', 'Version', "ERROR" )

$CodeversionMaster = IniRead ( 'Z:\CodeDelivery\GUICodeLoader\IST1\ServerConfig.ini', '', 'Version', "ERROR" )

EndFunc

Func UpdateServer()

$iCurrentTab = _GUICtrlTabGetCurFocus($tab)

$x = $iCurrentTab + 1

$Server = $serversInINI[$x]

MsgBox(0, "TEST", "Server is: " & $Server)

MsgBox(0, "TEST", "I WAS CALLED FROM " & $Server & " TAB")

MsgBox(0, "TEST", $Server & " has Argo Field of " & $ArgoServer)

GUICtrlSetData($UpdateServerbutton, "&Update " & $Server)

EndFunc ;==>UpdateServer

Func logger($logmsg)

$log = FileOpen("Z:\CodeDelivery\GUICodeLoader\Logs\GuiCodeLoader.log", 1)

getTimeStamp()

FileWriteLine($log, $timestamp & " " & $logmsg)

FileClose($log)

EndFunc ;==>logger

Func CompleteLog()

RunWait("Notepad.exe Z:\CodeDelivery\GUICodeLoader\Logs\GuiCodeLoader.log", "", @SW_MAXIMIZE)

Sleep(3000)

WinWaitClose("GuiCodeLoader.log - Notepad")

EndFunc ;==>CompleteLog

Func getTimeStamp()

$month = @MON

$day = @MDAY

$year = @YEAR

$hour = @HOUR

$min = @MIN

$sec = @SEC

$timestamp = $year & $month & $day & " " & $hour & ":" & $min & ":" & $sec

$time = $hour & $min

EndFunc ;==>getTimeStamp

Share this post


Link to post
Share on other sites

Don't know if this is the issue but your first include is missing the #

include <guitab.au3>


Support bacteria; it's the only culture most people have.LxP's Learning to Script with AutoIt 3 - Excellent starting placeVolly's Links Page - Links to cool and useful scriptsAutoIt Wrappers - Valuater's AutoIt Wrappers post. Lots of good stuff.Support AutoIt - Make a donation here; I did.[size="2"]#include <Guinness.pint>[/size]

Share this post


Link to post
Share on other sites

Don't know if this is the issue but your first include is missing the #

include <guitab.au3>

Um that was a copy/paste error not code related. Sorry about that.

Share this post


Link to post
Share on other sites

HI Jtrout,

could not find any mistake.. only an odd way to add tabs to a gui


Best regards,Emiel Wieldraaijer

Share this post


Link to post
Share on other sites

HI Jtrout,

could not find any mistake.. only an odd way to add tabs to a gui

what would a better way be? how do you mean? I am pulling the names from a ini file so i can change them on the fly...

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