![]() | ![]() Products ![]() ![]() ![]() ![]() |
Home » Technical Support » Elevate Web Builder Technical Support » Support Forums » Elevate Web Builder General » View Thread |
Messages 1 to 9 of 9 total |
![]() |
Wed, Feb 3 2016 2:41 PM | Permanent Link |
Huseyin Aliz myBiss ApS | Hi All,
Is it possible to create menuitems in runtime (eg. from a dataset)? Tried with following, but it would not let me ![]() MenuType.items.clear; Dataset.first; while not Dataset.EOF do begin MenuType.items.add(Dataset.columns['Type'].asString); Dataset.next; end; Thanks in advance, Regards, Hüseyin A. |
Wed, Feb 3 2016 2:44 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. ![]() | Huseyin,
<< Is it possible to create menuitems in runtime (eg. from a dataset)? Tried with following, but it would not let me ![]() Please elaborate: did you get an error message, did you get nothing, etc. ? Also, what type of control is the "MenuType" instance. Tim Young Elevate Software www.elevatesoft.com |
Wed, Feb 3 2016 2:50 PM | Permanent Link |
Huseyin Aliz myBiss ApS | Sorry Tim,
I get following errors: [Error] Menuform.wbs (373,13): The referenced variable, parameter, or function items does not exist MenuType => TMenu Regards, Hüseyin On 03-02-2016 20:44, Tim Young [Elevate Software] wrote: > Huseyin, > > << Is it possible to create menuitems in runtime (eg. from a dataset)? Tried with following, but it would not let me ![]() > > Please elaborate: did you get an error message, did you get nothing, etc. ? Also, what type of control is the "MenuType" instance. > > Tim Young > Elevate Software > www.elevatesoft.com > |
Thu, Feb 4 2016 5:29 AM | Permanent Link |
Uli Becker | There is no property "items".
This should work: With TMenuItem.create(MenuType) do caption := 'test'; Uli |
Thu, Feb 4 2016 6:27 AM | Permanent Link |
Huseyin Aliz myBiss ApS | Hi Uli,
Thanks, it works ![]() How can I in runtime find out which of the items (created in runtime) was clicked? Thanks, Regards, Hüseyin Den 04-02-2016 kl. 11:29 skrev Uli Becker: > There is no property "items". > > This should work: > > With TMenuItem.create(MenuType) do > caption := 'test'; > > Uli > > |
Thu, Feb 4 2016 8:04 AM | Permanent Link |
Uli Becker | > How can I in runtime find out which of the items (created in runtime)
> was clicked? You can assign a value to the TMenuItem's tag and thus identify the clicked item. Uli |
Thu, Feb 4 2016 8:18 AM | Permanent Link |
Huseyin Aliz myBiss ApS | Uli,
Yes, i did that now. Thanks. Regards, Hüseyin Den 04-02-2016 kl. 14:04 skrev Uli Becker: >> How can I in runtime find out which of the items (created in runtime) >> was clicked? > > You can assign a value to the TMenuItem's tag and thus identify the > clicked item. > > Uli > |
Thu, Mar 3 2016 10:33 AM | Permanent Link |
Paul Waegemans IMS bvba | if webteksten.rowcount>0 then
begin with webteksten do begin first; while not eof do begin with Menu1.newitem do begin caption:=columns['omschrijving'].asstring; tag:=columns['nummer'].asinteger; onclick:=tooninfo; end; next; end; end; Menu1.visible:=true; end; =?UTF-8?Q?H=c3=bcseyin_Aliz?= wrote: Hi All, Is it possible to create menuitems in runtime (eg. from a dataset)? Tried with following, but it would not let me ![]() MenuType.items.clear; Dataset.first; while not Dataset.EOF do begin MenuType.items.add(Dataset.columns['Type'].asString); Dataset.next; end; Thanks in advance, Regards, Hüseyin A. |
Fri, Mar 4 2016 9:07 AM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. ![]() | Paul,
<< Tried with following, but it would not let me ![]() What you want is something like this: while (MenuType.ItemCount > 0) do MenuType.Items[0].Free; Dataset.first; while not Dataset.EOF do begin with MenuType.NewItem do Caption:=Dataset.columns['Type'].asString; Dataset.next; end; Simply freeing menu items will remove them from the menu. Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Wednesday, August 14, 2024 at 07:31 PM | Privacy Policy![]() © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? ![]() |