thetwistedpanda Posted May 4, 2007 Share Posted May 4, 2007 expandcollapse popup#include <GUIConstants.au3> Opt("GUIOnEventMode", 1) $CtrlTrigger = -1; $AltTrigger = -1; $GUI = GUICreate("Panda's 'Toggle Program'", 354, 500, "") $B1 = GUICtrlCreateButton("Start", 260, 110, 65, 25); $B2 = GUICtrlCreateButton("Stop", 260, 140, 65, 25); $B3 = GUICtrlCreateButton("Close", 260, 170, 65, 25); GUICtrlCreatePic("00001475-n.jpg", 0, 0, 354, 500) GUISetState() GUISetOnEvent($GUI_EVENT_CLOSE, "QuitProgram") GUISetOnEvent($GUI_EVENT_MINIMIZE, "") GUISetOnEvent($B1, "StartProgram") GUISetOnEvent($B2, "StopProgram") GUISetOnEvent($B3, "QuitProgram") While 1 Sleep(1000) WEnd Func StartProgram() if(WinExists("Guild Wars")) Then $CtrlTrigger = 1; $AltTrigger = 1; DoBind() TrayTip("Guild Wars : Toggle", "Program Enabled", 5); Else MsgBox(4096, "Error", "Guild Wars must be open for this program to run") EndIf EndFunc Func StopProgram() if(WinExists("Guild Wars")) Then $CtrlTrigger = -1; $AltTrigger = -1; StopBind() TrayTip("Guild Wars : Toggle", "Program Disabled", 5); Else MsgBox(4096, "Error", "Guild Wars must be open for this program to run") EndIf EndFunc Func QuitProgram() $CtrlTrigger = ""; $AltTrigger = ""; Exit EndFunc Func DoBind() HotKeySet(",", "BindControl") HotKeySet(".", "BindAlt") EndFunc Func StopBind() HotKeySet(",", "") HotKeySet(".", "") EndFunc Func BindControl() If WinActive("Guild Wars") Then If $CtrlTrigger = 1 Then Send("{CTRLDOWN}") Else Send("{CTRLUP}") EndIf EndIf EndFunc Func BindAlt() If WinActive("Guild Wars") Then If $AltTrigger = 1 Then Send("{ALTDOWN}") Else Send("{ALTUP}") EndIf EndIf EndFunc Func BindBreak() $CtrlTrigger = -1; $AltTrigger = -1; EndFunc I just started working on a key toggling program for a game I play and it seemed to work relatively okay until I decided to convert it into a GUI. I've done several things such as the above code for various games without problems, but for some reason this GUI is being a pain, but I'm pretty sure I know why. The program works fine without the use of "GUICtrlCreatePic("00001475-n.jpg", 0, 0, 354, 500)". The picture seems to take priority over my GUI buttons and I can find no way to take that priority away. Are there any easy methods for allowing me to click my buttons (other than removing the GUI, as well as tab / space combo)? Thanks, Panda. Link to comment Share on other sites More sharing options...
gsb Posted May 4, 2007 Share Posted May 4, 2007 I really have no clue, but did you try moving the image: GUICtrlCreatePic("00001475-n.jpg", 0, 0, 354, 500) ...above (in the code) the buttons? $GUI = GUICreate("Panda's 'Toggle Program'", 354, 500, "") GUICtrlCreatePic("00001475-n.jpg", 0, 0, 354, 500) $B1 = GUICtrlCreateButton("Start", 260, 110, 65, 25) $B2 = GUICtrlCreateButton("Stop", 260, 140, 65, 25) $B3 = GUICtrlCreateButton("Close", 260, 170, 65, 25) GUISetState() gsb "Did you ever stop to think? ...and forget to restart!" Link to comment Share on other sites More sharing options...
thetwistedpanda Posted May 4, 2007 Author Share Posted May 4, 2007 (edited) Yeah, that's how I had it originally and it didn't work. The only thing with having the picture after the buttons seems to do is hide them until a mouse hover. Edited May 4, 2007 by thetwistedpanda Link to comment Share on other sites More sharing options...
gsb Posted May 4, 2007 Share Posted May 4, 2007 It is GUICtrlSetOnEvent() as in: GUICtrlSetOnEvent($B1, "StartProgram") GUICtrlSetOnEvent($B2, "StopProgram") GUICtrlSetOnEvent($B3, "QuitProgram") ...not GUISetOnEvent($B1, "StartProgram") GUISetOnEvent($B2, "StopProgram") GUISetOnEvent($B3, "QuitProgram") gsb "Did you ever stop to think? ...and forget to restart!" Link to comment Share on other sites More sharing options...
thetwistedpanda Posted May 4, 2007 Author Share Posted May 4, 2007 Nope still doesn't work. GUISetOnEvent / GUICtrlSetOnEvent both work on the buttons though, just doesn't help my GUI problem T_T. Thanks for trying though. Link to comment Share on other sites More sharing options...
daslick Posted May 5, 2007 Share Posted May 5, 2007 Disable the background picture so it doesn't cover your controls. Link to comment Share on other sites More sharing options...
thetwistedpanda Posted May 5, 2007 Author Share Posted May 5, 2007 That's the obvious answer that I'm trying to get around from having to do. I want to have a picture on my GUI and I've done it before on several other programs. For some reason this one seems to be covering my buttons though. Link to comment Share on other sites More sharing options...
Valuater Posted May 5, 2007 Share Posted May 5, 2007 Disable the background picture so it doesn't cover your controls.Like he said!!!it will work8) Link to comment Share on other sites More sharing options...
thetwistedpanda Posted May 5, 2007 Author Share Posted May 5, 2007 (edited) I know it works without a background - I came here looking for a way to make it work WITH a background. Edited May 5, 2007 by thetwistedpanda Link to comment Share on other sites More sharing options...
Valuater Posted May 5, 2007 Share Posted May 5, 2007 I know it works without a background - I came here looking for a way to make it work WITH a background.I Know That!!!OK.... It will work WITH the background8) Link to comment Share on other sites More sharing options...
daslick Posted May 6, 2007 Share Posted May 6, 2007 Disabling the picture will only disable the control... so that it doesn't cover the other controls. You will still see it. Try it. Link to comment Share on other sites More sharing options...
Vindicator209 Posted May 7, 2007 Share Posted May 7, 2007 GUICtrlSetState("control",@SW_DISABLE) =D [center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center] Link to comment Share on other sites More sharing options...
Gyzmok Posted May 8, 2007 Share Posted May 8, 2007 In your code, it should look like this : ... GUICtrlCreatePic("00001475-n.jpg", 0, 0, 354, 500) GuiCtrlSetState(-1,$GUI_DISABLE) ; <----------------------------- Just add this ;and move the create button code AFTER the create picture code $B1 = GUICtrlCreateButton("Start", 260, 110, 65, 25); $B2 = GUICtrlCreateButton("Stop", 260, 140, 65, 25); $B3 = GUICtrlCreateButton("Close", 260, 170, 65, 25); ... D2charkeeper = No more 'expired characters' in D2.File Date Changer = Change the file date(s), attributes and the filename case of multiple files @ once.Updater_full = Copy/Update your autoitscripts, pictures, .mp3, .avi etc ... subdirs from your PC to your memory stick or to your external harddisk. Now with scheduling and logging.Questmapper Link to comment Share on other sites More sharing options...
Horadrim Posted June 20, 2007 Share Posted June 20, 2007 The image still covers the controls. I have another, simple idea, which I`m sure t`would work. Why dont you just slice the image on smaller images and not positionate them on the gui and just leaving space for the controls? 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