PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio â†’ WINDEV 2024 â†’ [WD20] Dynamic menu
[WD20] Dynamic menu
Iniciado por guest, 18,may. 2016 00:47 - 20 respuestas
Publicado el 18,mayo 2016 - 00:47
Good afternoon,

Is there a way to create a menu from information stored in an analysis that doesn't involve using the menu control? Or is there a way to customize the menu control so it looks better?
Publicado el 18,mayo 2016 - 03:16
Hi Luis,

of course there is....

Treeview control, Looper, controlClone... Just from the top of my head, that's already 3 different methods
it all depends on the look and feel you are going for (FYI, I'm using the looper control for the menu on my web site)

Best regards
Publicado el 18,mayo 2016 - 06:45
Hi, I solved a few of the menue-"problems" simply by putting buttons on the window, no menu control.

- the anchoring distributes the buttons evenly over the width of the main window
- the MDI-buttons don't appear anymore since they are connected to menue-control, which isn't there
- a click on each of the buttons triggers a popup menue beneath the button

downside: for insiders this "menue" isn't working exactly like a "regular" main menue, but no users did detect the difference until now.
[attachment 1995 MainMenue001_.png]
Publicado el 19,mayo 2016 - 17:04
Quote
Fabrice Harari

Hi Luis,



of course there is....



Treeview control, Looper, controlClone... Just from the top of my head, that's already 3 different methods

it all depends on the look and feel you are going for (FYI, I'm using the looper control for the menu on my web site)



Best regards
Thanks for the reply, I already use a treeview control and works well, but we are trying to do a horizontal menu, we were thinking of a looper but since the menus can have an indefinite number of submenus, we aren't sure how to control this, the same with control clone, we were able to create de main menus, but not able to manage the submenus of these ones. The users will be the ones to create the menus and order the options in any way they'd like, I did this in webdev with an HTML control, but in windev is different. Any ideas in how to achieve this would be greatly appreciated.
Publicado el 19,mayo 2016 - 17:06
Quote
GuenterP

Hi, I solved a few of the menue-"problems" simply by putting buttons on the window, no menu control.



- the anchoring distributes the buttons evenly over the width of the main window

- the MDI-buttons don't appear anymore since they are connected to menue-control, which isn't there

- a click on each of the buttons triggers a popup menue beneath the button



downside: for insiders this "menue" isn't working exactly like a "regular" main menue, but no users did detect the difference until now.

[attachment 1995 MainMenue001_.png]

How did you create the "menu" with the buttons? did you use control clone? and do the "menus" have submenus?
Publicado el 19,mayo 2016 - 18:00
Hi Luis,

this is very simple. No ControlClone used here. The items of the "main menue" are in fact simple buttons without outside borders, they just look like text, but they're buttons. Each of the buttons - if clicked - opens a popup menue by

OpenPopupMenu(PopupMenu_7_Rechnungen, MySelf..X, MySelf..Y + MySelf..Height)

and that's it. I used this trick because I wanted to get rid of the three small MDI buttons in the main menue which can be really nasty together with the icons of the MDI windows if several windows are on top of each other. Sometimes this gives a duplicate main menue line.

And yes, popup menues can have any number of submenues!
Publicado el 19,mayo 2016 - 18:21
Quote
GuenterP

Hi Luis,



this is very simple. No ControlClone used here. The items of the "main menue" are in fact simple buttons without outside borders, they just look like text, but they're buttons. Each of the buttons - if clicked - opens a popup menue by



OpenPopupMenu(PopupMenu_7_Rechnungen, MySelf..X, MySelf..Y + MySelf..Height)



and that's it. I used this trick because I wanted to get rid of the three small MDI buttons in the main menue which can be really nasty together with the icons of the MDI windows if several windows are on top of each other. Sometimes this gives a duplicate main menue line.



And yes, popup menues can have any number of submenues!
Thanks for the reply. So you have created beforehand this buttons in the editor?
Publicado el 19,mayo 2016 - 18:58
Hi, yes, of course ..
Publicado el 19,mayo 2016 - 19:30
That's the problem :/ We need to create everything at runtime, nothing should be there, because each user can have a different menu, and the administrator user will create the menu as he wants, so we don't know how many options this menu will have. Thanks for answering :)
Publicado el 20,mayo 2016 - 10:37
Hi

Can you tell us a bit more on theapp you want.

You need a way to make a menu that canhave submenu's . The admin can make the menu . So he can ad actions to it ?

There is nothing in the screen.? With this you mean the window that is going to contain the menu?

Where is the menu need to be. On top of the screen in the screen at any by user defined position ?

If all this applies may be look at the new features of windev. One of the features you can give the user the power to create complete schema's etc with buttons etc.

I have made dashboard functionality that is competely generated . when user starts there is not even a dashboard. Then he can create dashboards and put charts on it form almoast everythingthat is in the db. Unlimited number of charts.
Made that with version 20. Was not so easy. easpecially getting the speed that I needed. But it worked out great. and over all onley a view weeks of work to get it into production.

So what you want should be possible Please discribe in more detail what you need

regards

Allard
Publicado el 20,mayo 2016 - 15:07
Hi Luis,

you have an example of what you are trying to achieve using a looper in my WXEDM project. It's not used for a menu, but to keep the list of all open document (it's the looper at the bottom of the first window).

Basically, it's an horizontal looper with 2 arrow buttons on the side. If there are less entries than the window width, the arrows are not used, but if there are more, they allow to display AS MANY documents (or in your case, menu entries) as you want.

As for submenus, you just need to add one vertical looper that you fill and position dynamically when the user click in (or hover on) the main menu.

In my WXEDM, you already have the code to fill and manage the horizontal one.

Best regards
Publicado el 20,mayo 2016 - 16:07
Quote
Fabrice Harari

Hi Luis,



you have an example of what you are trying to achieve using a looper in my WXEDM project. It's not used for a menu, but to keep the list of all open document (it's the looper at the bottom of the first window).



Basically, it's an horizontal looper with 2 arrow buttons on the side. If there are less entries than the window width, the arrows are not used, but if there are more, they allow to display AS MANY documents (or in your case, menu entries) as you want.



As for submenus, you just need to add one vertical looper that you fill and position dynamically when the user click in (or hover on) the main menu.



In my WXEDM, you already have the code to fill and manage the horizontal one.



Best regards

Hi, thanks again for answering, I think using 2 loopers as the way you are explaining maybe a solution, I'll check it out :)
Publicado el 20,mayo 2016 - 17:00
Quote
Allard

Hi



Can you tell us a bit more on theapp you want.



You need a way to make a menu that canhave submenu's . The admin can make the menu . So he can ad actions to it ?



There is nothing in the screen.? With this you mean the window that is going to contain the menu?



Where is the menu need to be. On top of the screen in the screen at any by user defined position ?



If all this applies may be look at the new features of windev. One of the features you can give the user the power to create complete schema's etc with buttons etc.



I have made dashboard functionality that is competely generated . when user starts there is not even a dashboard. Then he can create dashboards and put charts on it form almoast everythingthat is in the db. Unlimited number of charts.

Made that with version 20. Was not so easy. easpecially getting the speed that I needed. But it worked out great. and over all onley a view weeks of work to get it into production.



So what you want should be possible Please discribe in more detail what you need



regards



Allard
This is an example of how I may like the menu, I did this in Webdev, the Treeview table down is the structure of how the menu should be and the menu above it is how it looks after it is constructed, I would want something similar in Windev
[attachment 2004 Menu.png]
Publicado el 20,mayo 2016 - 17:13
Hmm I see. I donnot have a quick answe for that.

I think you should go for Fabrice Idea.

Regards

Allard
Publicado el 20,mayo 2016 - 18:25
Hi, imho this is too complicated. For a future program we've made a looper. Each cell shows an icon and a caption, the looper has a complement in an array which contains everything, especially the names of the windows / programs to open. This is to administrate 25 "favourite programs" for each user. It's an addition to the main menue in order to give users fast access to their mostly used windows / programs.

For one, this too complex for an administrator to really administrate. Icons, texts. And it needs quite a few windows for administration.

However, if you have such a program, there are additional concepts in Wx which collide with that.

As it is, any program has a finite number of windows (= menue items), it's never an infinite number!

So, why not make a main menue with all of the available items and let the administrator switch those items off which are not meant for a certain user. This is already there - its called "Groupware" and can be used out of the box!

Next, e.g. by licensing, you could switch off / on a group of menue items. It's easy because PC Soft has included the concept of control-groups! Using a single command, a whole group of menue items can be switched off or on.
Publicado el 20,mayo 2016 - 18:43
Quote
GuenterP

Hi, imho this is too complicated. For a future program we've made a looper. Each cell shows an icon and a caption, the looper has a complement in an array which contains everything, especially the names of the windows / programs to open. This is to administrate 25 "favourite programs" for each user. It's an addition to the main menue in order to give users fast access to their mostly used windows / programs.



For one, this too complex for an administrator to really administrate. Icons, texts. And it needs quite a few windows for administration.



However, if you have such a program, there are additional concepts in Wx which collide with that.



As it is, any program has a finite number of windows (= menue items), it's never an infinite number!



So, why not make a main menue with all of the available items and let the administrator switch those items off which are not meant for a certain user. This is already there - its called "Groupware" and can be used out of the box!



Next, e.g. by licensing, you could switch off / on a group of menue items. It's easy because PC Soft has included the concept of control-groups! Using a single command, a whole group of menue items can be switched off or on.
We've come to discover this is very complicated, and what I'm referring to indefinite number would be the submenus, these aren't windows, these would be just titles and a user can create as much as they want as an example the administrator can make a menu like this:

Main Menu > sub-menu > sub-menu_1 > sub-menu_2 > sub-menu_3 > sub-menu_4 > users window

I know this is nowehere useful and may never be done this way, but our project managers wants this to be possible if the user wants it. And since this project would be implemented as a component inside another windev project, we don't know how many windows will contain the other project, we have a window were we add names of the other windows to make them available to add them to menus.

And about the groupware we also considered the option of using it, but again, our project managers didn't like the fact that we couldn't customize it the way they want it :/

Maybe what we want to achieve is not even possible with windev, but we really don't know. thanks for replying :)
Publicado el 20,mayo 2016 - 18:44
Quote
Allard

Hmm I see. I donnot have a quick answe for that.



I think you should go for Fabrice Idea.



Regards



Allard

Thanks allard, we'll try it that way. Thanks, have a good day :)
Publicado el 21,mayo 2016 - 14:31
Hi everybody

Quote
GuenterP



As it is, any program has a finite number of windows (= menue items), it's never an infinite number!



I disagree with that statement and I'll give my web site as an example.
YES, the number of PAGES/WINDOWS as defined in the editor is finite. However, you an open them with a parameter and use them for something else, and that is INfinite. On my web site, I have pages that are used xx times in the menu, each time to display another article, or to sell another product. And each one is a new entry in the menu.

So you may not have needed something like that for your developments, but the need is reel, and you are mistakingly associating menu items and windows. A menu item may be a window, but it can very easily be a window+parameter, especially if the program itself is customizable.

An example of that is a CRM I worked on 10-15 years ago where the super users could define as many "desktops' as they wanted, each with as many windows as they wanted in it, and each window with different data and design in them.
Of course, they would give a name to that configuration, and have that available in their INfinite customizable menu.

Best regards
Publicado el 22,mayo 2016 - 16:37
I Agree with Fabrice,

And adding to that . it becomes more and more a customers demand. They want a flexible solution they can customize not a static application. especuialy regarding reports and presenting information in like dashboards

My dashboard feature is like that . Client can make as many dashboards as he wants and can put as many charts on a dashboard as they want . They even can customize the charts with information they want to see.
I donnot know what they want, what specific information is important so I made a solution that is completely adjustable.

As I said I donnot have a quick answer on Luis his question. I would take quite some time thinking about how to do it. I like answering small questions or ask them myself . This is where the forum comes in handy . This is one that would take to mutch time. Sorry for that:(

But If it is a customars demand and you are in need you could ask Fabrice to really look into the issue. I believe he offers this kind of support. A little help from a person with more then 20 years experiance can help a lot. It is problebly cheaper then figgering it out yourself.

But that is just my opinion.

Regards
Allard
Publicado el 22,mayo 2016 - 18:28
Hello Luis

Allard has raised an interesting point in regard to the dashboard in that it could be used as a configurable menu. I am looking into running a dashboard via a separate thread in a sister window off the main menu - I haven't got the hang of it yet - but the dashboard would be worth a look.

Regards
Al
Publicado el 23,mayo 2016 - 15:34
Thanks for the answers to everyone, and I'll take everything in consideration, and yes the way fabrice describes the CRM is similar to what we want to achieve in this case. We'll continue investigating the way to accomplish this, maybe dashboards can be the solution. Thanks again!