Sign in to follow this  
Followers 0
Pieter

Button is not clickable

4 posts in this topic

; ------------------------------------------------------------------------------
;
; Program name: MediaSync
; Version: 0.3 (UNFINISHED)
;
; Component name: MediaSync Tray
; Function: tray user interface for MediaSync Watcher
;
; ------------------------------------------------------------------------------

#include <GuiConstants.au3>
$version = "0.3 (UNFINISHED)"

; Create right-click menu
Opt("TrayMenuMode",1)
$menu_plugged       = TrayCreateItem("Device status")
$menu_sep1          = TrayCreateItem("")
$menu_syncnow       = TrayCreateItem("Synchronize now")
$menu_hotkeys       = TrayCreateItem("View hotkeys")
$menu_sep2          = TrayCreateItem("")
$menu_about         = TrayCreateItem("About")
$menu_exit          = TrayCreateItem("Exit")
TraySetState()

While 1
    ; Right-click menu changes checker
    $msg = TrayGetMsg()
    Select
        Case $msg = 0
            ContinueLoop
        Case $msg = $menu_about
            ; TrayItemSetState($checkeditem,$TRAY_CHECKED)
            Call("about")
        Case $msg = $menu_exit
            ExitLoop
    EndSelect
WEnd

Func about()    
    $aboutwindow = GuiCreate("About MediaSync", 313, 191,-1, -1 , $WS_MINIMIZEBOX+$WS_CAPTION+$WS_POPUP+$WS_SYSMENU)
    
    $Pic_1 = GuiCtrlCreatePic("images/logo.gif", 10, 10, 48, 48)
    $Label_1 = GuiCtrlCreateLabel("MediaSync v" & $version, 70, 10, 200, 20)
    $Label_2 = GuiCtrlCreateLabel("MediaSync is © 2005-2006 Pieter De Decker. Based on the AutoIt scripting language. Icons were provided for free by FastIcon.com." & @CRLF & @CRLF & "Website: http://mediasync.6te.net/" & @CRLF & "Email: pdedecker@gmail.com", 20, 90, 280, 90)
    $Group_3 = GuiCtrlCreateGroup("About", 10, 70, 290, 110)
    $Button_4 = GuiCtrlCreateButton("Close", 70, 30, 80, 30)
    GuiCtrlSetOnEvent( $Button_4, "about_close")

    GuiSetState()
    While 1
        $msg = GuiGetMsg()
        Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case Else
            ; Nothing
        EndSelect
    WEnd
    GUIDelete("About MediaSync")
EndFunc

Func about_close()
    GUIDelete("About MediaSync")
EndFunc
Why is my button ($Button_4) not working?


iPod + Online calendars = iPodCALsync

Share this post


Link to post
Share on other sites



Check the sizes of all you labels, if you make them overlap the button (Very common) the button won't get clicked because you will have click the label instead

Share this post


Link to post
Share on other sites

maybe

; ------------------------------------------------------------------------------
;
; Program name: MediaSync
; Version: 0.3 (UNFINISHED)
;
; Component name: MediaSync Tray
; Function: tray user interface for MediaSync Watcher
;
; ------------------------------------------------------------------------------

#include <GuiConstants.au3>
$version = "0.3 (UNFINISHED)"

; Create right-click menu
Opt("TrayMenuMode",1)
$menu_plugged      = TrayCreateItem("Device status")
$menu_sep1    = TrayCreateItem("")
$menu_syncnow     = TrayCreateItem("Synchronize now")
$menu_hotkeys     = TrayCreateItem("View hotkeys")
$menu_sep2      = TrayCreateItem("")
$menu_about         = TrayCreateItem("About")
$menu_exit    = TrayCreateItem("Exit")
TraySetState()

While 1
    ; Right-click menu changes checker
    $msg = TrayGetMsg()
    Select
        Case $msg = 0
            ContinueLoop
        Case $msg = $menu_about
            ; TrayItemSetState($checkeditem,$TRAY_CHECKED)
            Call("about")
        Case $msg = $menu_exit
            ExitLoop
    EndSelect
WEnd

Func about()   
    $aboutwindow = GuiCreate("About MediaSync", 313, 191,-1, -1 , $WS_MINIMIZEBOX+$WS_CAPTION+$WS_POPUP+$WS_SYSMENU)
   
    $Pic_1 = GuiCtrlCreatePic("images/logo.gif", 10, 10, 48, 48)
    $Label_1 = GuiCtrlCreateLabel("MediaSync v" & $version, 70, 10, 200, 20)
    $Label_2 = GuiCtrlCreateLabel("MediaSync is © 2005-2006 Pieter De Decker. Based on the AutoIt scripting language. Icons were provided for free by FastIcon.com." & @CRLF & @CRLF & "Website: http://mediasync.6te.net/" & @CRLF & "Email: pdedecker@gmail.com", 20, 90, 280, 90)
    $Group_3 = GuiCtrlCreateGroup("About", 10, 70, 290, 110)
    $Button_4 = GuiCtrlCreateButton("Close", 70, 30, 80, 30)
    GuiCtrlSetOnEvent( $Button_4, "about_close")

    GuiSetState()
    While 1
        $msg = GuiGetMsg()
        Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $Button_4
            ExitLoop
        EndSelect
    WEnd
    GUIDelete("About MediaSync")
EndFunc

Func about_close()
    GUIDelete("About MediaSync")
EndFunc

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

Thanks Valuater, that totally worked! :P


iPod + Online calendars = iPodCALsync

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