CreateMenu with Form Designer

You need some new stunning features ? Tell us here.
SniffTheGlove
Enthusiast
Enthusiast
Posts: 122
Joined: Sat Nov 19, 2011 6:51 pm

CreateMenu with Form Designer

Post by SniffTheGlove »

Hello,

If I create a new form and add a menu to it via the Form Designer the following menu code is auto generated and it always uses the following command.

Code: Select all

  CreateMenu(0, WindowID(Window_0))
You have no way to alter the createmenu properties from within the forms designer as clicking on the menu in the form does not show any properties, only when you click an actual menu item.

Is there any way to avoid using 0 as the ID and use #PB_Any or a Enumeration variable?

I am only thinking out loud and wondering if using 0 will cause any ID issues later on with other gadgets (that might be auto assigned 0 ID) or other menus in other forms that will also be auto generated with 0 as the ID by the Forms Designer.
User avatar
skywalk
Addict
Addict
Posts: 4218
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: CreateMenu with Form Designer

Post by skywalk »

The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
SniffTheGlove
Enthusiast
Enthusiast
Posts: 122
Joined: Sat Nov 19, 2011 6:51 pm

Re: CreateMenu with Form Designer

Post by SniffTheGlove »

Thanks, upon reading it was that PB_Any was not avavilae for menus back in 2010, but now they are, at least to the help file for CreatMenu
CreateImageMenu()

Syntax

Result = CreateImageMenu(#Menu, WindowID [, Flags])
Description

Creates a new empty menu on the given window with support for images in the menu items.
Parameters

#Menu A number to identify the new menu. #PB_Any can be used to auto-generate this number.

WindowID The window for the new menu. It can be obtained using the WindowID() function.

Flags (optional) This can be a combination of the following values:
#PB_Menu_ModernLook: Enable gradient and modern look (only has an effect on Windows)



Return value

User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: CreateMenu with Form Designer

Post by ts-soft »

#PB_Any is for Menu available, but there is no #PB_Any for MenuItem, so the Featurewish is legal!
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
Post Reply