vikingnor Posted April 26, 2006 Share Posted April 26, 2006 here is the source uiCreate("Chronos Tool", 287, 256,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) $Button_1 = GuiCtrlCreateButton("Server 1", 10, 180, 130, 30) $Button_2 = GuiCtrlCreateButton("Server 2", 150, 180, 130, 30) $Input_3 = GuiCtrlCreateInput("text", 20, 100, 250, 70) $Button_4 = GuiCtrlCreateButton("Update Addons", 10, 60, 120, 30) $Button_5 = GuiCtrlCreateButton("Go to Forum", 160, 60, 120, 30) $Button_6 = GuiCtrlCreateButton("Irc Chat", 10, 20, 120, 30) $Button_7 = GuiCtrlCreateButton("About", 160, 20, 120, 30) $Button_8 = GuiCtrlCreateButton("Exit", 80, 220, 130, 30) GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case Else ;;; EndSelect WEnd Exit #endregion --- GuiBuilder generated code End --- While 1 $msg = GUIGetMsg() Select Case $msg = $Button_1 Case $msg = $Button_2 Case $msg = $Button_8 ExitLoop EndSelect is it any way to make things do actions when i click on the buttons? Link to comment Share on other sites More sharing options...
Evil_Has_Survived Posted April 26, 2006 Share Posted April 26, 2006 GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked") Func CLOSEClicked() ;Note: at this point @GUI_CTRLID would equal $GUI_EVENT_CLOSE, ;@GUI_WINHANDLE will be either $mainwindow or $dummywindow If @GUI_WINHANDLE = $mainwindow Then MsgBox(0, "GUI Event", "You clicked CLOSE in the main window! Exiting...") Exit EndIf EndFunc Thanks in advance Link to comment Share on other sites More sharing options...
badboy2k Posted April 26, 2006 Share Posted April 26, 2006 this works for me Opt("GUIOnEventMode", 1) $start=GUICtrlCreateButton("start", 100, 270, 60) GUICtrlSetOnEvent($start, "StartPressed") func StartPressed() Endfunc Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted April 26, 2006 Moderators Share Posted April 26, 2006 (edited) Here an example: expandcollapse popup#include <GuiConstants.au3> Opt("GuiOnEventMode", 1) GUICreate("Chronos Tool", 287, 256,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) GUISetOnEvent($GUI_EVENT_CLOSE, "GUI_Close") $Button_1 = GuiCtrlCreateButton("Server 1", 10, 180, 130, 30) GUICtrlSetOnEvent(-1, "Do_Something1") $Button_2 = GuiCtrlCreateButton("Server 2", 150, 180, 130, 30) GUICtrlSetOnEvent(-1, "Do_Something2") $Input_3 = GuiCtrlCreateInput("text", 20, 100, 250, 70) $Button_4 = GuiCtrlCreateButton("Update Addons", 10, 60, 120, 30) GUICtrlSetOnEvent(-1, "Do_Something3") $Button_5 = GuiCtrlCreateButton("Go to Forum", 160, 60, 120, 30) $Button_6 = GuiCtrlCreateButton("Irc Chat", 10, 20, 120, 30) $Button_7 = GuiCtrlCreateButton("About", 160, 20, 120, 30) $Button_8 = GuiCtrlCreateButton("Exit", 80, 220, 130, 30) GUICtrlSetOnEvent(-1, "GUI_Close") GuiSetState() While 1 Sleep(100) WEnd Func Do_Something1() MsgBox(0, "", "You clicked button_1") EndFunc Func Do_Something2() MsgBox(0, "", "You clicked button_2") EndFunc Func Do_Something3() MsgBox(0, "", "You clicked button_4") EndFunc Func GUI_Close() Exit EndFunc Edited April 26, 2006 by big_daddy Link to comment Share on other sites More sharing options...
badboy2k Posted April 26, 2006 Share Posted April 26, 2006 i have an other problem with the button thing, everything works fine for me but if i use the Opt("GUIOnEventMode", 1) thing i can not close the gui like other programms with (x) close does anyone know? thanks Link to comment Share on other sites More sharing options...
vikingnor Posted April 26, 2006 Author Share Posted April 26, 2006 anyone know how to make links on the buttons? to etc browsers. btw ty for help Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted April 26, 2006 Moderators Share Posted April 26, 2006 i have an other problem with the button thing,everything works fine for me but if i usethe Opt("GUIOnEventMode", 1) thing i can not close the gui like other programms with (x) closedoes anyone know?thanksYou have to tell it what to do when you use GUIOnEventMode.Opt("GuiOnEventMode", 1) GUICreate("Test GUI") GUISetOnEvent($GUI_EVENT_CLOSE, "GUI_Close") Func GUI_Close() Exit EndFunc ;==>GUI_Close Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted April 26, 2006 Moderators Share Posted April 26, 2006 anyone know how to make links on the buttons? to etc browsers.btw ty for help First you need to get the IE.au3 UDF. Then look at the examples in post 3 of the same page. Link to comment Share on other sites More sharing options...
badboy2k Posted April 26, 2006 Share Posted April 26, 2006 You have to tell it what to do when you use GUIOnEventMode.Opt("GuiOnEventMode", 1) GUICreate("Test GUI") GUISetOnEvent($GUI_EVENT_CLOSE, "GUI_Close") Func GUI_Close() Exit EndFunc ;==>GUI_Closegreat it works, thanks a lot 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