Sobiech Posted August 14, 2009 Share Posted August 14, 2009 (edited) Hi again >_<i rlly dont understand why i cant use buttons just if i click on button i dont see any move, any action :|Here is my codethis DOESNT work#include <ButtonConstants.au3>#include <ComboConstants.au3>#include <GUIConstantsEx.au3>#include <StaticConstants.au3>#include <WindowsConstants.au3>#Region ### START Koda GUI section ### Form=$Form2 = GUICreate("Form2", 496, 382, 191, 120)$Pic1 = GUICtrlCreatePic("C:\Documents and Settings\Admin\Moje dokumenty\Moje obrazy\Satan\BotScreen.jpg", 0, 0, 495, 381, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))$Button1 = GUICtrlCreateButton("Here is your mp3", 320, 184, 145, 25, $WS_GROUP)$Button2 = GUICtrlCreateButton("Start", 32, 312, 147, 41, $WS_GROUP)$Button3 = GUICtrlCreateButton("Exit", 312, 312, 147, 41, $WS_GROUP)$Combo1 = GUICtrlCreateCombo("Set numnber of bws", 320, 216, 145, 25)Opt("GUIOnEventMode", 1) ; Change to OnEvent mode GUICtrlSetOnEvent($button1, "ExitButton") ; You must have thisGUISetOnEvent($GUI_EVENT_CLOSE, "ExitButton")GUISetState(@SW_SHOW)#EndRegion ### END Koda GUI section ###While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitchWEndFunc ExitButton() MsgBox (0, "Exit", "You clicked EXIT! Exiting...") ExitEndFuncThis WORK#include <ButtonConstants.au3>#include <EditConstants.au3>#include <GUIConstantsEx.au3>#include <WindowsConstants.au3>#Region ### START Koda GUI section ### Form=C:\Documents and Settings\Admin\Pulpit\GUI\Forms\First GUI.kxf$Form1 = GUICreate("Form1", 524, 347, 198, 129)$Button1 = GUICtrlCreateButton("Exit", 320, 296, 161, 33, $WS_GROUP)$Button2 = GUICtrlCreateButton("Start", 40, 296, 161, 33, $WS_GROUP)$Edit1 = GUICtrlCreateEdit("", 48, 96, 185, 89)GUISetState(@SW_SHOW)Opt("GUIOnEventMode", 1) ; Change to OnEvent mode GUISetOnEvent($GUI_EVENT_CLOSE, "ExitButton")GUICtrlSetOnEvent($button1, "ExitButton") ; You must have this#EndRegion ### END Koda GUI section ###While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitchWEndFunc ExitButton() MsgBox (0, "Exit", "You clicked EXIT! Exiting...") ExitEndFuncI have this problem in many projects Few days ago i dont have this problem.Ofcourse i reinstall AutoIT and again download Koda GUI (non beta) so only you can help me :| Edited August 14, 2009 by Sobiech This world is crazy Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted August 14, 2009 Moderators Share Posted August 14, 2009 Sobiech,How about if you changed this:GUICtrlSetOnEvent($button1, "ExitButton")to this:GUICtrlSetOnEvent($button3, "ExitButton")M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Sobiech Posted August 14, 2009 Author Share Posted August 14, 2009 (edited) Sobiech,How about if you changed this:GUICtrlSetOnEvent($button1, "ExitButton")to this:GUICtrlSetOnEvent($button3, "ExitButton")M23Doesnt work >_<my all buttons doesnt work but i changed this If any button dont have any code then when we click on him we can see "push animation". I dont have animations of buttons Edited August 14, 2009 by Sobiech This world is crazy Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted August 14, 2009 Moderators Share Posted August 14, 2009 Sobiech,This is from your code:$Button1 = GUICtrlCreateButton("Here is your mp3", 320, 184, 145, 25, $WS_GROUP) $Button2 = GUICtrlCreateButton("Start", 32, 312, 147, 41, $WS_GROUP) $Button3 = GUICtrlCreateButton("Exit", 312, 312, 147, 41, $WS_GROUP) $Combo1 = GUICtrlCreateCombo("Set numnber of bws", 320, 216, 145, 25) Opt("GUIOnEventMode", 1) ; Change to OnEvent mode GUICtrlSetOnEvent($button1, "ExitButton") ; You must have thisIf you are in OnEvent mode, you need to define an action for each event/control. All you have at the moment is an action for button1 which is your "Here is your mp3" button. You have no events defined for the other buttons, so how do you expect them to react when pressed? Look at this:expandcollapse popup#include <ButtonConstants.au3> #include <ComboConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> Opt("GUIOnEventMode", 1) ; Change to OnEvent mode #Region ### START Koda GUI section ### Form= $Form2 = GUICreate("Form2", 496, 382, 191, 120) GUISetOnEvent($GUI_EVENT_CLOSE, "ExitButton") $Pic1 = GUICtrlCreatePic("C:\Documents and Settings\Admin\Moje dokumenty\Moje obrazy\Satan\BotScreen.jpg", 0, 0, 495, 381, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)) $Button1 = GUICtrlCreateButton("Here is your mp3", 320, 184, 145, 25, $WS_GROUP) GUICtrlSetOnEvent($Button1, "mp3") $Button2 = GUICtrlCreateButton("Start", 32, 312, 147, 41, $WS_GROUP) GUICtrlSetOnEvent($Button2, "Start") $Button3 = GUICtrlCreateButton("Exit", 312, 312, 147, 41, $WS_GROUP) GUICtrlSetOnEvent($Button3, "ExitButton") ; You must have this $Combo1 = GUICtrlCreateCombo("Set numnber of bws", 320, 216, 145, 25) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 Sleep(100) WEnd Func ExitButton() MsgBox (0, "Exit", "You clicked EXIT! Exiting...") Exit EndFunc Func Start() MsgBox(0, "Start", "You pressed Start") EndFunc Func mp3() MsgBox(0, "mp3", "You pressed mp3") EndFuncM23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Yashied Posted August 14, 2009 Share Posted August 14, 2009 If any button dont have any code then when we click on him we can see "push animation". I dont have animations of buttons >_<I think that you are confused in your code, or showed us it does not fully. My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
Sobiech Posted August 14, 2009 Author Share Posted August 14, 2009 (edited) I think that you are confused in your code, or showed us it does not fully.It is Fully >_<i had working projects with GUI, but now any projects doesnt work This is impossible to block buttons? maybe program settings have errors :|To melba23: If any button dont have any code then when we click on him we can see "push animation". I dont have animations of buttons And your code dont activate my buttons Edited August 14, 2009 by Sobiech This world is crazy Link to comment Share on other sites More sharing options...
Yashied Posted August 14, 2009 Share Posted August 14, 2009 (edited) In such a case - this is poltergeist. >_<EDIT:Try to work with Opt("GUIOnEventMode", 0). Edited August 14, 2009 by Yashied My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
Sobiech Posted August 14, 2009 Author Share Posted August 14, 2009 In such a case - this is poltergeist. >_< EDIT: Try to work with Opt("GUIOnEventMode", 0). Doesnt work With 0 i closed program with ctrl+alt+del because i cant with click on [X] This world is crazy Link to comment Share on other sites More sharing options...
Yashied Posted August 14, 2009 Share Posted August 14, 2009 Doesnt work >_< With 0 i closed program with ctrl+alt+del because i cant with click on [X] Insert GUICtrlSetState($Pic1, $GUI_DISABLE) after $Pic1 = GUICtrlCreatePic(...) My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
Sobiech Posted August 15, 2009 Author Share Posted August 15, 2009 InsertGUICtrlSetState($Pic1, $GUI_DISABLE)after$Pic1 = GUICtrlCreatePic(...)THX THX THX Now its work!Master >_< This world is crazy Link to comment Share on other sites More sharing options...
Hawkwing Posted August 15, 2009 Share Posted August 15, 2009 In the first code you posted you had guigetmsg inside the while loop, but you had opt("guisetonevent", 1). Thought those didn't work together >_ The Wheel of Time turns, and Ages come and pass, leaving memories that become legend. Legend fades to myth, and even myth is long forgotten when the Age that gave it birth comes again. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted August 15, 2009 Moderators Share Posted August 15, 2009 Hawkwing,If you set Opt("GUISetOnEvent", 1) then (from the Help file) "the return from GUIGetMsg is always 0 and the @error is set to 1". So the function will not give you an error, but will not give you anything useful either! >_< You can use the 2 modes in the same script without problem as long you are very careful in setting the Opt("GUISetOnEvent", ?) code as you move from one state to another. Here is a script I wrote a long time ago to illustrate how you might do it (not a very interesting script in itself, but it was to make the point about the mode changes):expandcollapse popup#include <GUIConstantsEx.au3> Global $running = False; Opt("GUIOnEventMode", 1) ; Set OnEvent mode $GUI = GUICreate("Test", 150, 80) GUISetOnEvent($GUI_EVENT_CLOSE, "close") $label = GUICtrlCreateLabel("OnEvent", 10, 15, 100, 20) $counter = GUICtrlCreateLabel("", 120, 15, 25, 20) $start = GUICtrlCreateButton("Start", 20, 44, 60) GUICtrlSetOnEvent($start, "start") $stop = GUICtrlCreateButton("Stop", 80, 44, 60) GUICtrlSetState($stop, $GUI_DISABLE) GUISetState(@SW_SHOW) While (1) Sleep(100) WEnd ;------------------------- Func close() Exit EndFunc ;==>close Func start() $running = True $ms = 500 GUICtrlSetState($start, $GUI_DISABLE) GUICtrlSetState($stop, $GUI_ENABLE) Opt("GUIOnEventMode", 0) ; Switch to MessageLoop mode GUICtrlSetData($label, "MessageLoop") $begin = TimerInit() $count = 1 While ($running) GUICtrlSetData($counter, $count) While TimerDiff($begin) < $ms If GUIGetMsg() = $stop Then stop() GUICtrlSetState($start, $GUI_ENABLE) GUICtrlSetData($counter, "") ExitLoop 2 EndIf WEnd $begin = TimerInit() $count += 1 WEnd Opt("GUIOnEventMode", 1) ; Switch to OnEvent mode GUICtrlSetData($label, "OnEvent") GUICtrlSetState($start, $GUI_ENABLE) EndFunc ;==>start Func stop() GUICtrlSetState($stop, $GUI_DISABLE) $running = False EndFunc ;==>stopI hope that make it all clear!M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Leonick Posted August 15, 2009 Share Posted August 15, 2009 THX THX THX Now its work!Master >_<Why did it solve the problem?something wrong with the pic? Link to comment Share on other sites More sharing options...
BrettF Posted August 15, 2009 Share Posted August 15, 2009 Because it disables it, stopping it from receiving any input so to speak. Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted August 15, 2009 Moderators Share Posted August 15, 2009 Leonick,This problem comes up every day or so - because people do not use Search or read the Help file. From the Help file remarks for GUICtrlCreatePic:"If a picture is set as a background picture, as the other controls will overlap, it's important to disable the pic control and create it after the others controls: GuiCtrlSetState(-1,$GUI_DISABLE)".M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area 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