Szhlopp Posted July 17, 2008 Share Posted July 17, 2008 (edited) Okay Here it is... Two simple commands for adding menu's and menu Items: _GUICtrlInitializeCMenu _GUICtrlCreateMenuCItem Menu looks real! Has the mouse over effect. Pushed effect. Supports menu's AND sub menu's! Create custom menu backgrounds. Easily add a menu in your skinned GUI! I need some feedback on this. Tell me how it works. Show me the bugs/glitches! I created this specifically for skinning GUI's. Give it a try and show me how it worked! ;_GUICtrlCreateMenuCItem(34, 20, "Test" [, $PixelWidth = 20]) ;X location of the (First/Second) Item ;Y location of the (First/Second) Item ;Name of the Item ;Length in pixels of the Highlight and Pressed images ; You do NOT need the showMenu function to show this... Sorry I didn't edit this out! Download latest version here: MenuUDF.zip (Change the location of the #include <MenuUdf.au3>) Edited July 19, 2008 by Szhlopp RegEx/RegExRep Tester!Nerd Olympics - Community App!Login UDFMemory UDF - "Game.exe+753EC" - CE pointer to AU3Password Manager W/ SourceDataFiler - Include files in your au3!--- Was I helpful? Click the little green '+' Link to comment Share on other sites More sharing options...
rasim Posted July 17, 2008 Share Posted July 17, 2008 When checking syntax i got 6 warnings. D:\MenuUDF_example\MenuUDF_example.au3(59,27) : WARNING: $MenuItem1: possibly used before declaration. if $CI[4] = $MenuItem1 Then ~~~~~~~~~~~~~~~~~~~~~~~^ D:\MenuUDF_example\MenuUDF_example.au3(62,45) : WARNING: $MenuContext: possibly used before declaration. ShowMenu($GUI1, $MenuItem1, $MenuContext) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ D:\MenuUDF_example\MenuUDF_example.au3(71,22) : WARNING: $OptionsCommon: possibly used before declaration. Case $OptionsCommon ~~~~~~~~~~~~~~~~~~~^ D:\MenuUDF_example\MenuUDF_example.au3(75,20) : WARNING: $OptionsFile: possibly used before declaration. Case $OptionsFile ~~~~~~~~~~~~~~~~~^ D:\MenuUDF_example\MenuUDF_example.au3(79,20) : WARNING: $OptionsExit: possibly used before declaration. Case $OptionsExit ~~~~~~~~~~~~~~~~~^ D:\MenuUDF_example\MenuUDF_example.au3(14,73) : WARNING: $MenuItem1: declared global in function only. Prefer top of file. Global $menubar, $picpressed_1, $picpressed_2, $picpressed_3, $MenuItem1, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ D:\MenuUDF_example\MenuUDF_example.au3 - 0 error(s), 6 warning(s) Link to comment Share on other sites More sharing options...
gseller Posted July 17, 2008 Share Posted July 17, 2008 Yeah, still needs some polishing but I like the look! Keep up the great work.. Link to comment Share on other sites More sharing options...
Szhlopp Posted July 17, 2008 Author Share Posted July 17, 2008 When checking syntax i got 6 warnings. D:\MenuUDF_example\MenuUDF_example.au3(59,27) : WARNING: $MenuItem1: possibly used before declaration. if $CI[4] = $MenuItem1 Then ~~~~~~~~~~~~~~~~~~~~~~~^ D:\MenuUDF_example\MenuUDF_example.au3(62,45) : WARNING: $MenuContext: possibly used before declaration. ShowMenu($GUI1, $MenuItem1, $MenuContext) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ D:\MenuUDF_example\MenuUDF_example.au3(71,22) : WARNING: $OptionsCommon: possibly used before declaration. Case $OptionsCommon ~~~~~~~~~~~~~~~~~~~^ D:\MenuUDF_example\MenuUDF_example.au3(75,20) : WARNING: $OptionsFile: possibly used before declaration. Case $OptionsFile ~~~~~~~~~~~~~~~~~^ D:\MenuUDF_example\MenuUDF_example.au3(79,20) : WARNING: $OptionsExit: possibly used before declaration. Case $OptionsExit ~~~~~~~~~~~~~~~~~^ D:\MenuUDF_example\MenuUDF_example.au3(14,73) : WARNING: $MenuItem1: declared global in function only. Prefer top of file. Global $menubar, $picpressed_1, $picpressed_2, $picpressed_3, $MenuItem1, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ D:\MenuUDF_example\MenuUDF_example.au3 - 0 error(s), 6 warning(s) Move the Global $ XXXXXXXXXX outside the first function. Yes this still needs work. But can someone point me to a post where they have a working menu? It was my understanding that no one has been able to make one work like the real menu does. Excuse my ignorance. I couldn't find one=) Anyone else have some feedback on this? I'm hoping to get this working very soon as a stand-alone UDF. RegEx/RegExRep Tester!Nerd Olympics - Community App!Login UDFMemory UDF - "Game.exe+753EC" - CE pointer to AU3Password Manager W/ SourceDataFiler - Include files in your au3!--- Was I helpful? Click the little green '+' Link to comment Share on other sites More sharing options...
James Posted July 17, 2008 Share Posted July 17, 2008 Holger made a nice one! Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
Szhlopp Posted July 18, 2008 Author Share Posted July 18, 2008 Holger made a nice one!I couldn't get his to work. I was getting tons of errors when I tried to run it. Any advice?I updated it. Re-download it and give it a shot. Please let me know how it looks! RegEx/RegExRep Tester!Nerd Olympics - Community App!Login UDFMemory UDF - "Game.exe+753EC" - CE pointer to AU3Password Manager W/ SourceDataFiler - Include files in your au3!--- Was I helpful? Click the little green '+' Link to comment Share on other sites More sharing options...
James Posted July 18, 2008 Share Posted July 18, 2008 That's because some of the constants have already been declared in latest AutoIt. Search for an "fixed" version and you get this. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
Szhlopp Posted July 18, 2008 Author Share Posted July 18, 2008 (edited) That's because some of the constants have already been declared in latest AutoIt. Search for an "fixed" version and you get this. Thanks it worked. And it's awesome for a regular menu!! Here's the deal though, put in "0x80000000" as the style in the GUI. $hMainGUI = GUICreate("Sample Menu", -1, -1, -1, -1 , 0x80000000) Correct me again if I'm wrong, but to me it seems I can't make this menu move off the top of my screen. The whole point in me re-making the menu was for skinning. If you have an image header (a clickable one to move the GUI around) it makes the GUI look stupidly hilarious with the menu above the header image=) Edit: I could use some help with trying to make the context menus change when I have click/opened one, and then move my mouse over another menu item. Once I click one of my items, it stays open until you click someplace else=) Edited July 18, 2008 by Szhlopp RegEx/RegExRep Tester!Nerd Olympics - Community App!Login UDFMemory UDF - "Game.exe+753EC" - CE pointer to AU3Password Manager W/ SourceDataFiler - Include files in your au3!--- Was I helpful? Click the little green '+' 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