Menu submenu searchtool - Forum

Forum Navigation
You need to log in to create posts and topics.

Menu submenu searchtool

Hi,

I'm rebuilding and extending my MC Musiceditor (mcmusiceditor.com). About one extension I like to discuss with you. MCM has x menuitems. Each menuitem has y submenu-items. These items contain useful information for a user.  I want to make a searchbox so a user can search on a topic (e.g. Beams) and becomes as answer the (sub)menu place where to find the requested info (e.g. Rhythm > Beams; maybe a deep link is possible but I do not know yet). I try not to reinvent the wheel, so my question: has anyone made such Menu searchtool that can be shared?
If not, I'll make a hash/key-value/associative array in newLisp (with the excellent plugin from Hans-Peter Wickern) and that should do the job: searching on a  key and returning its associated value. And in that case, I'll let you know how I did this. Thanks.
Best regards,
Reinier

@reinier I think you can mimic associative arrays in VisualNEO Win this way:

.Set pairs key / value
Loop "1" "10" "[X]"
  SetVar "[VarKey[X]]" "Key name [X]"
  SetVar "[VarValue[X]]" "Key value [X]"
EndLoop

.Search for specific value
Loop "1" "10" "[X]"
  If "[VarValue[X]]" "=" "Key value 2"
     AlertBox "Results" "Key value found in Key name [X]"
  EndIf
EndLoop

Not sure if this is what you are looking for.

Regards.

Thanks Luis. Much appreciated!

Yes, you could mimic associative arrays in that way. Maybe that the search-speed in the newLisp solution is much better when the number of items is big (I don't know yet how many items are involved). As far as I can see, it seems to me that invoking Menuitems and Submenitems (and possibly some content behind the (sub)menuitems) by some command (aka GetMenuItem, GetSubmenuitem and GetContentsSubmenuitem)  is not possible within VisualNeoWin. So my search engine will be based on an array, which has to be created manually. If I've made it, I'll inform you about both solutions (VisualNeoWin and newLisp) and their performance.

Best regards,
Reinier

luishp has reacted to this post.
luishp

@reinier

I have not deployed the VNWin menu component before.

However, I played around with it last night, and might be able to suggest a solution (tip: menuHeading, menuItem and MenuSubitem labels can be specified as [variables])

Before I post something, can you advise if you require your menu structure to consist of just one MenuHeading (with all your MenuItems and MenuSubItems under this single Heading) ... or have you considered having a structure with multiple MenuHeadings ?

@gaev

Thanks Gaev! Now I'm working on a little demo application with all functionality. I'll post it here if it is ready and I'm then curious if things can be done better.

@reinier

I'll post it here if it is ready and I'm then curious if things can be done better.

OK.

After my last post, I did some more thinking and wondered ...

- do you have a guesstimate of the values for x and y ? ... 5 ? or 50 ? ... or 500 ? ... keep in mind that there might be (undocumented) limits on the number of such items.

- is there a specific purpose for deploying the Menu object for what you need ? ... or could a database (using neoDBPro plugin) be a better choice ?

@gaev

Thanks again. My demo will make all clear, I hope. Let's talk then further about the what, the how and the why.

@gaev

My (sub)menu-search-tool solution till now: https://reiniermaliepaard.nl/app/

Best regards,
Reinier

DaviddeArgentina and danito have reacted to this post.
DaviddeArgentinadanito