forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Change in the format of menu definitions?

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Miscellaneous
View previous topic :: View next topic  
Author Message
jules
Professional Member
Professional Member


Joined: 14 Sep 2001
Posts: 1043
Location: Cumbria, UK

PostPosted: Tue Mar 22, 2005 1:39 pm    Post subject: Change in the format of menu definitions? Reply with quote

In VDS at the moment, main menus are defined using the command:

DIALOG ADD,MENU,Menuname,item1,item2,...

in which each menu item is a separate parameter.

Popup menus are defined using the command:

DIALOG POPUP,item1|item2|...,x,y

where the items are defined within a single parameter.

The POPUP method allows popup menus to be created with a variable number of items, generated at runtime, because the item definitions are a single parameter and all or part of the items can be created previously in a variable. For main menus, the items are fixed, and only the name of an individual item can be changed at runtime, if desired, using a variable. It is not possible for a single variable to contain the data for two or more parameters.

Other than the need to convert existing code to the new format, can anyone see any disadvantage to changing the format of DIALOG ADD,MENU so that the items are specified using the same syntax as popups? I can see that it would be beneficial to allow greater flexibility in specifying the contents of menus, especially as VDS 6 will have enhanced menu capabilities, such as submenus.

_________________
The Tech Pro
www.tech-pro.net
Back to top
View user's profile Send private message Visit poster's website
Boo
Valued Contributor
Valued Contributor


Joined: 31 Oct 2003
Posts: 599
Location: Gulf Breeze, Florida USA

PostPosted: Tue Mar 22, 2005 3:40 pm    Post subject: Reply with quote

Hi Jules,

I don't see any disadvantages. I think changing the syntax is good as it promotes consistency. Also, updating prior scripts to the new syntax should not be a problem.

I can't wait for VDS 6.0! Really looking forward to it... Very Happy

Keep up the GREAT work...

- Boo
Back to top
View user's profile Send private message
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Tue Mar 22, 2005 4:06 pm    Post subject: Reply with quote

Julian, I think using a "|" for seperating the menu items is a good solution. Maybe you can also add submenus? Prakash' vdspopup DLL handles submenus something like this, which I think is a good solution Smile:

Code:
DIALOG ADD,MENU,File,New|Open|Save|Save As|-|Preferences|>|Settings|Editor|Colors|<|Close|-|Exit


|>| means a new submenu begins, while |<| notes the end of a submenu... Smile

_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
jules
Professional Member
Professional Member


Joined: 14 Sep 2001
Posts: 1043
Location: Cumbria, UK

PostPosted: Tue Mar 22, 2005 6:02 pm    Post subject: Reply with quote

Okay, that seems encouraging.

Yes, VDS 6 will support submenus, though the syntax is slightly different from VDSPOPUP's as the '>' must be the last character of caption of the submenu item, instead of being a line on its own. There will also be support for images in menu items and Office XP style menus.

You will all have to be patient, though, as it's coming along a lot slower than expected. Delphi 2005 is a slow, unstable, flaky piece of **** and the VCL is full of bugs. A lot of stuff has obviously never been tested in the context where the main program is a DLL. Finding workarounds for these problems is time-consuming, stressful and frustrating, and it is a welcome relief to get back to the sanity of developing in VDS 5. But I'm sure it will all be worth it in the end...

_________________
The Tech Pro
www.tech-pro.net
Back to top
View user's profile Send private message Visit poster's website
Boo
Valued Contributor
Valued Contributor


Joined: 31 Oct 2003
Posts: 599
Location: Gulf Breeze, Florida USA

PostPosted: Tue Mar 22, 2005 7:35 pm    Post subject: Reply with quote

Keep up the good work Jules! I for one am very patient and feel that it is better to do it right--or not at all. Wink
Back to top
View user's profile Send private message
ShinobiSoft
Professional Member
Professional Member


Joined: 06 Nov 2002
Posts: 790
Location: Knoxville, Tn

PostPosted: Tue Mar 22, 2005 10:51 pm    Post subject: Reply with quote

From what I see of this new syntax, what will come of the hot-keys for the
menu command items? Will it be possible to add a menu definition(s) to the
executable? What about an accelerator table?

A compiler, or function for that matter, for menu resources is very simple to
write. You already have a resource linker, so the compiled menu could be
included in the executable as a resource and loaded with the LoadMenu()
API.

I would be more than willing to donate the parser that I use in SSMenu.Dll
for parsing .rc menu definitions and accelerator tables if they would help or
are needed. I can go, and am willing, as far as writing the function that
can compile either an Accelerator table or menu definition into a binary
resource that can be linked to an executable.

My two cents, for what it's worth. Wink

_________________
Bill Weckel
ShinobiSoft Software

"The way is known to all, but not all know it."
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
jules
Professional Member
Professional Member


Joined: 14 Sep 2001
Posts: 1043
Location: Cumbria, UK

PostPosted: Wed Mar 23, 2005 8:43 am    Post subject: Reply with quote

The hotkeys will work as before. The main menu will still be created when the window/dialog is created. It will not be possible to add menu items at run-time, but because it will be possible for a menu to have a name, it will be possible to change its text at run-time.

Sorry, I don't know what you mean by accelerator table.

Menus (and everything else in VDS) are created using Delphi VCL objects. Although I know that in the early days of Windows programs, windows were created using special resources, I don't know how to do that kind of programming, and I have even less of an idea how you would integrate menus or other elements created from resources into a Delphi VCL application, which is what the VDS runtime is.

_________________
The Tech Pro
www.tech-pro.net
Back to top
View user's profile Send private message Visit poster's website
ShinobiSoft
Professional Member
Professional Member


Joined: 06 Nov 2002
Posts: 790
Location: Knoxville, Tn

PostPosted: Wed Mar 23, 2005 1:01 pm    Post subject: Reply with quote

jules wrote:
Sorry, I don't know what you mean by accelerator table.


In traditional Win32 applications an ACCELERATORS resource is how,
hot-keys as we call them here, are defined. It has the resource type ->
RT_ACCELERATOR and is generally loaded in an applications startup code
with the API LoadAccelerators().

This is something that I've ben wanting to work on for some time. I can add
these features to SSMenu.Dll, as was my plan anyway.

_________________
Bill Weckel
ShinobiSoft Software

"The way is known to all, but not all know it."
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
jules
Professional Member
Professional Member


Joined: 14 Sep 2001
Posts: 1043
Location: Cumbria, UK

PostPosted: Wed Mar 23, 2005 1:24 pm    Post subject: Reply with quote

In VDS you can define a hotkey using a menu e.g. Copy|Ctrl+C. You can also put an ampersand in the name of a menu item or a button caption and use Alt+x as a hotkey. Plus you can define global hotkeys using the HOTKEY command. That's probably enough options for most people.
_________________
The Tech Pro
www.tech-pro.net
Back to top
View user's profile Send private message Visit poster's website
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Wed Mar 23, 2005 4:26 pm    Post subject: Reply with quote

Yes, but if hotkeys are defined like Open|Ctrl+O and menu items are seperated with |-characters, how would these two be combined?
_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
jules
Professional Member
Professional Member


Joined: 14 Sep 2001
Posts: 1043
Location: Cumbria, UK

PostPosted: Wed Mar 23, 2005 5:43 pm    Post subject: Reply with quote

The same way VDSPOPUP does it now. The separator for the different parts within each menu item (the text, hotkey and bitmap filename) is changed to a semicolon.
_________________
The Tech Pro
www.tech-pro.net
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Miscellaneous All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group