Mirage Source http://www.miragesource.net/forums/ |
|
Creating a pop-Up Menu http://www.miragesource.net/forums/viewtopic.php?f=210&t=2183 |
Page 1 of 2 |
Author: | James [ Fri Jun 29, 2007 8:26 pm ] |
Post subject: | Creating a pop-Up Menu |
Difficulty: 2/5 This is just copy and paste, and it's only basics. it's up to you how to use it. Firstly, we must have a menu on our screen, so right click the form and go into the menu editor and create your menu. This Menu will be the menu that appears as the pop-up menu, so add in the code and etc for all the different menu buttons there are. Good, no, set the main menu thing, IE the menu title, such as File, Edit, etc, as Invisible or uncheck the visible box. Now this menu will not be seen as a normal menu, so it's like you'r form doesn't even have one. Now, go into the code where you want to call this menu, whether it be a right click, or a double click, or a key press, whatever, and add: Code: Me.popupmenu mnuName mnuName should be the name of the Heading menu you created that we set to Invisible. PopupMenu basically ignores visibility settings, and will only popup the sub-menus you added to the menu, so the Header won't be visible, but you should still set it to a nice name you can remember. And tada! A nifty popup menu for whatever you wish to use it for. Expansions: There are otehr things you can do with popUpMenu. The full call can go as such: Code: Me.PopupMenu Menu as Object, [Flags], [X], [Y], [Defaultmenu] X and Y are obviously the positions you want to use, and DefaultMenu will be in BOLD. You can only have one bold menu object. the Flags are as follows: vbpopupmenuLeftAlign vbpopupmenuCenterAlign vbpopupmenuRightAlign These are self explanatory And here are the behavior flags: vbpopupmenuLeftButton - Default. This means everything will react when you use the left mouse button. vbpopupmenuRightButton - Samea s above, only uses Right mouse Button. (Not Default) So jsut in case you wanted to use them, here they are! Hope this helps some people. |
Author: | Robin [ Fri Jun 29, 2007 8:46 pm ] |
Post subject: | Re: Creating a pop-Up Menu |
Note that this will freeze the entire game, so it is highly recommended not to use it. It's not too hard to make your own popup menu. |
Author: | Lea [ Fri Jun 29, 2007 9:03 pm ] |
Post subject: | Re: Creating a pop-Up Menu |
I use a pop-up menu on my server. I have a window that lets me see every person online, and if I right click on them, I can kick/disconnect/ban then from the menu. Pretty handy. |
Author: | Robin [ Fri Jun 29, 2007 9:04 pm ] |
Post subject: | Re: Creating a pop-Up Menu |
It's fine on the server, but the client will freeze. |
Author: | William [ Fri Jun 29, 2007 9:06 pm ] |
Post subject: | Re: Creating a pop-Up Menu |
Addon onto the tutorial If you say it freezes your game you could always make a picture box and set it with visible = false. Then in the form_keypress and such add the code to make it visible and set the x and y for the picture box to show up were you pressed. Very easy, and also remember to add a code when you press on another place on the screen to make it visible = false. |
Author: | James [ Fri Jun 29, 2007 9:23 pm ] |
Post subject: | Re: Creating a pop-Up Menu |
Why will it freeze client side Maybe that is just an issue you have? |
Author: | William [ Fri Jun 29, 2007 9:24 pm ] |
Post subject: | Re: Creating a pop-Up Menu |
Magnus wrote: Why will it freeze client side Maybe that is just an issue you have? Never tried so I dunno, but I guess it will freeze the blitting as .show does. |
Author: | Robin [ Fri Jun 29, 2007 10:07 pm ] |
Post subject: | Re: Creating a pop-Up Menu |
Magnus, there is no way in hell that having the game screen freeze when a command like that is called is simply "and issue I have". It's the same if you use just a normal menu and if you call a form using .show or use the arrow buttons to scroll a textbox. It's just something that happens. |
Author: | Lea [ Fri Jun 29, 2007 10:47 pm ] |
Post subject: | Re: Creating a pop-Up Menu |
You could multithread it. |
Author: | Robin [ Fri Jun 29, 2007 10:55 pm ] |
Post subject: | Re: Creating a pop-Up Menu |
I'm sure there's another way to stop the game screen from freezing when you use a menu. |
Author: | Verrigan [ Sat Jun 30, 2007 12:35 am ] |
Post subject: | Re: Creating a pop-Up Menu |
Robin wrote: I'm sure there's another way to stop the game screen from freezing when you use a menu. I'm sure there is a way too.. I think you need to do some SetWindowLong()s on either the menu itself, or the form that the menu is child to.. I'd have to research it. |
Author: | Zalos [ Thu Sep 13, 2007 10:47 am ] |
Post subject: | Re: Creating a pop-Up Menu |
Dont mean to necro post not quite sure where u mean to use this menu... but if your talking about a pop-up menu in game why not make a picture box visibility = false and vbkey that tells the game to check if the menu is already up if not then to bring it up if it is to close it? it wouldnt freeze the game while your playing and wala you can have a menu for options and to exit the game with. |
Author: | Matt [ Thu Sep 13, 2007 12:35 pm ] |
Post subject: | Re: Creating a pop-Up Menu |
Zalos wrote: Dont mean to necro post not quite sure where u mean to use this menu... but if your talking about a pop-up menu in game why not make a picture box visibility = false and vbkey that tells the game to check if the menu is already up if not then to bring it up if it is to close it? it wouldnt freeze the game while your playing and wala you can have a menu for options and to exit the game with. First off, Welcome. Second off, William already said that. Third off, Voila* |
Author: | Zalos [ Thu Sep 13, 2007 1:28 pm ] |
Post subject: | Re: Creating a pop-Up Menu |
Perfekt wrote: Zalos wrote: Dont mean to necro post not quite sure where u mean to use this menu... but if your talking about a pop-up menu in game why not make a picture box visibility = false and vbkey that tells the game to check if the menu is already up if not then to bring it up if it is to close it? it wouldnt freeze the game while your playing and wala you can have a menu for options and to exit the game with. First off, Welcome. Second off, William already said that. Third off, Voila* o lol XD i must of skipped over that post |
Page 1 of 2 | All times are UTC |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |