Jump to content

GUICtrlSetOnEvent problem


Damein
 Share

Recommended Posts

I've used this function in many of my scripts, but for some reason I can't seem to figure out why it won't go in this one.

Global $NewItemLabel, $NewCost, $TotalWeeklyCost, $VarianceFromLastWeek, $SaveBudgetButton, $IniFile, $IniFileInfo, $LastWeeksBudgetTab, $CurrentWeeksBudgetTab
 
Opt("GUIOnEventMode", 1)
 
_CreateGui()
 
Func _CreateGui()
     GuiCreate("Budgeting System", 800, 700, Default, Default)
     GuiCtrlCreateTab(10,5,780,680)
     $LastWeeksBudgetTab = GuiCtrlCreateTabItem("Previous Week")
     GUICtrlSetOnEvent($LastWeeksBudgetTab, "_PreviousWeeksBudgetDisplay")
     $CurrentWeeksBudgetTab = GuiCtrlCreateTabItem("Current Week")
     GUICtrlSetOnEvent($CurrentWeeksBudgetTab, "_CurrentWeeksBudgetDisplay")
     GuiSetState()
EndFunc
 
Func _PreviousWeeksBudgetDisplay()
     Msgbox(0, "Test", "Previous")
EndFunc
 
Func _CurrentWeeksBudgetDisplay()
     Msgbox(0, "test", "Current")
EndFunc
 
While 1
    Sleep(10)
WEnd
Edited by Damein

MCR.jpg?t=1286371579

Most recent sig. I made

Quick Launcher W/ Profiles Topic Movie Database Topic & Website | LiveStreamer Pro Website | YouTube Stand-Alone Playlist Manager: Topic | Weather Desktop Widget: Topic | Flash Memory Game: Topic | Volume Control With Mouse / iTunes Hotkeys: Topic | Weather program: Topic | Paws & Tales radio drama podcast mini-player: Topic | Quick Math Calculations: Topic

Link to comment
Share on other sites

#include <GuiConstantsEx.au3>

Global $NewItemLabel, $NewCost, $TotalWeeklyCost, $VarianceFromLastWeek, $SaveBudgetButton, $IniFile, $IniFileInfo, $LastWeeksBudgetTab, $CurrentWeeksBudgetTab
Global $Tab1
Opt("GUIOnEventMode", 1)

_CreateGui()

Func _CreateGui()
    Local $G1 = GUICreate("Budgeting System", 800, 700, Default, Default)
    $Tab1 = GUICtrlCreateTab(10, 5, 780, 680)
    $LastWeeksBudgetTab = GUICtrlCreateTabItem("Previous Week")
    GUICtrlSetOnEvent($LastWeeksBudgetTab, "_PreviousWeeksBudgetDisplay")
    $CurrentWeeksBudgetTab = GUICtrlCreateTabItem("Current Week")
    ;GUICtrlSetOnEvent($CurrentWeeksBudgetTab, "_CurrentWeeksBudgetDisplay")
    GUICtrlSetOnEvent($Tab1, "_CurrentWeeksBudgetDisplay")
    GUICtrlCreateTabItem("")
    GUISetState()
    GUISetOnEvent($GUI_EVENT_CLOSE, "AllDone", $G1)
EndFunc   ;==>_CreateGui

Func _PreviousWeeksBudgetDisplay()
    MsgBox(0, "Test", "Previous")
EndFunc   ;==>_PreviousWeeksBudgetDisplay

Func _CurrentWeeksBudgetDisplay()
    Switch GUICtrlRead($Tab1)
        Case 0
            MsgBox(0, "test", "Previous")
        Case 1
            MsgBox(0, "test", "Current")
    EndSwitch
EndFunc   ;==>_CurrentWeeksBudgetDisplay

While 1
    Sleep(10)
WEnd

Func AllDone()
    Exit
EndFunc   ;==>AllDone

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
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...