MoI discussion forum
MoI discussion forum

Full Version: shortcut menu

Show messages:  1-5  6-25  26-45  46-49

From: Frenchy Pilou (PILOU)
8 Apr 2020   [#26]
Thanks for the additional infos! I will see if that works better :)

@ Beam :it's Menus in French ;)
Menue is existing too but it adjective for woman (Menu for man, Menues for women, Menus for men) like slim, thin, mince
From: Frenchy Pilou (PILOU)
9 Apr 2020   [#27]
Much better! All is quasi perfect
except for the last four Arc, Ellipse Plane "Boxes" who stay in English like the French "Boîtes" ???





From: Phiro
9 Apr 2020   [#28]
I think, you don't have to add names.
The id give wich label have to be seen, function of the langage.

 

En french...
Il ne faut pas mettre le titre de l'icone "en dur" dans le fichier, c'est l'ID qui indique au logiciel quelle titre il faut écrire et qui met le bon titre dans la bonne langue en fonction du paramètre de langue.

Comme c'est écrit dans l'exemple...
<moi:CommandButton icon="moi://ui/icons/LineIcon.png" command="line"><moi:Text textid="Line"></moi:CommandButton>

Le texte du textid=Line sera Line en anglais et Ligne en français et c'est le logiciel qui le placera automatiquement en fonction du paramètre de langage.
From: Michael Gibson
9 Apr 2020   [#29] In reply to [#27]
Hi Pilou, the bold text you show above there should be removed, it will be extra in addition to the <moi:Text> that is right next to it.

For those <moi:Text> that are not working, look in EnglishStrings.txt and do a search for the textid value that you are using.

For textid="Ellipses", if you search in EnglishStrings.txt you won't find any line for Ellipses=, but there is one for Ellipse without ending "s".

Same for Planes (should be "Plane") and Boxes (use "Box").

- Michael
From: Frenchy Pilou (PILOU)
9 Apr 2020   [#30] In reply to [#29]
Or that must say that i can also add some words in the English txt ?
Not too orthodox but...
Seem that works :)

Now I must make the rest! :)


That was a nightmare for me! :)



PS Remark that the French UI is smaller than the English one : that is a task :)
From: bemfarmer
9 Apr 2020   [#31]
Two of the Box entry methods are missing. Likewise Conic, Helix ...

Do users like this floating menu?

- Brian
From: Frenchy Pilou (PILOU)
9 Apr 2020   [#32] In reply to [#31]
Yes it's very useful when you have many monitors
and when you have only one screen
that reduce the Mouse's way for click a function!
From: feirui445
15 Apr 2020   [#33] In reply to [#29]
Hi Michael

Can you help me design a script:? I can press the shortcut key to open shortcut menu and press it again to close shortcut menu.Thanks!


script: /* Opens SidePane1 */ moi.ui.createDialog( 'moi://ui/SidePane1.htm' );
From: Michael Gibson
15 Apr 2020   [#34] In reply to [#33]
Hi hl,

re:
> Can you help me design a script:? I can press the shortcut key to open shortcut menu and
> press it again to close shortcut menu.Thanks!

In MoI v4 it is possible to implement OnKeyDownEvent() and OnKeyUpEvent() script functions on a dialog and when the dialog has focus MoI will look for those and call them. Those can override regular shortcut key handling.

It's used also by the new shortcut key definition dialog "ShortcutKeyDialog.htm" and there are comments in that file about how it works.

- Michael
From: Michael Gibson
15 Apr 2020   [#35] In reply to [#33]
Hi hl,

re:
> Can you help me design a script:? I can press the shortcut key to open shortcut menu and press it again to close shortcut menu.Thanks!


Or another method that could work would be to store the dialog object that is returned from moi.ui.createDialog() in a centralized place so it can check if it has been set on a previous script run. When the dialog closes some additional script in the dialog box page can clear that value.

So to do that, inside SidePane1.htm modify the <body> tag to have an onunload="" handler like this:

code:
<body class="SidePaneBody" onunload="moi.command.setOption( 'SidePane1_dlg', null );">


That will handle clearing out the value when the dialog box has been closed.

Then the shortcut could be set up like this:


script: var dlg = null; try { dlg = moi.command.getOption( 'SidePane1_dlg' ); } catch(e){} if ( dlg != null ) { dlg.window.close(); } else { dlg = moi.ui.createDialog( 'SidePane1.htm' ); moi.command.setOption( 'SidePane1_dlg', dlg ); }

- Michael
From: Michael Gibson
15 Apr 2020   [#36] In reply to [#33]
Hi hl,

re:
> Can you help me design a script:? I can press the shortcut key to open shortcut menu and
> press it again to close shortcut menu.Thanks!

Actually here's a simpler way that doesn't need any variables to be stored and doesn't need any onunload="" handler in the dialog either:

script: var panel = null; try { panel = moi.ui.getUIPanel( 'moi://ui/SidePane1.htm' ); } catch(e){} if ( panel ) { panel.moiWindow.close(); } else { moi.ui.createDialog( 'SidePane1.htm' ); }

- Michael

EDIT: updated to work on both v3 and v4.
From: bemfarmer
16 Apr 2020   [#37] In reply to [#36]
New shortcut key works well in MoI4beta. (I used Ctrl+Alt+S for the shortcut key.)

Now just need someone to make a super deluxe SidePane1.htm.

Did not work in MoI3. (?)

- Brian
From: Michael Gibson
16 Apr 2020   [#38] In reply to [#37]
Hi Brian, yeah it looks like the behavior of v3 is slightly different than v4 when the UI panel is not found, v3 throws an exception. I've updated the script above to account for that and so it should now work on both v3 and v4.

- Michael
From: feirui445
17 Apr 2020   [#39] In reply to [#36]
hi Michael:

script: var panel = null; try { panel = moi.ui.getUIPanel( 'moi://ui/SidePane1.htm' ); } catch(e){} if ( panel ) { panel.moiWindow.close(); } else { moi.ui.createDialog( 'SidePane1.htm' ); }

The result is right

Thank you for your hard work.
From: Franz
18 Apr 2020   [#40]
Hello hl and Michael!

Thanks for the idea with Side.Pane1, I find it very interesting.
But I misused it a little bit for personalization.
I didn't repeat the commands already included in Side.Pane, except for those that need to be unfolded, but not for command.set commands, where there are several options in Side.Pane.
I have, however, added some scripts I need more often, such as dimensioning etc. with self-created icons.
Now it would be a nice addition to the help to be able to insert a short self-designed description of the function by pressing the "F1" key.
I have already succeeded in doing this in part, but unfortunately I do not know how to get the required html command extension for some script commands,
such as #line or my experiment #Test, so that it is automatically inserted when I press the "F1" key.
I hope to have expressed myself clearly (translator).
Maybe my pictures can explain this better afterwards.

Can anyone please help me?

It's always a pleasure to work with moi.

Health for all
best wishes from Austria
Franz





Image Attachments:
Test_1.jpg  Test_2.jpg 


From: Michael Gibson
18 Apr 2020   [#41] In reply to [#40]
Hi Franz, well when you push F1 MoI opens up the MoI help file in your web browser.

The help file is made up of HTML files that are inside the "docs" subfolder inside of MoI's install.

To have your custom content show up like that you would need to edit the help files and insert your new content in it. But things are not really set up with that use in mind so it will probably not be very easy to do that.

- Michael
From: Franz
18 Apr 2020   [#42]
Hi Michael!

Thanks for the feedback.
My problem is not the insertion of the icons, screenshots or text in "moi_command_reference.html", but that when I press the key the file extension #xxxx necessary for the search is not given, as it is the case when searching for
"file:///C:/Program%20Files%20(x86)/MoI%203.0/docs/moi_command_reference.htm#constructionline".

For example, when searching for help (F1) "Cplane" I only get the url
"file:///C:/Program%20Files%20(x86)/MoI%203.0/docs/moi_help.htm",
and so I have to scroll to "Command Reference" after that myself.

For me it would be interesting for instance, how it comes that:
"file:///C:/Program%20Files%20(x86)/MoI%203.0/docs/moi_command_reference.htm#constructionline"
.... or how it can be produced.
The most scripts from Max Smirnov the url is output correctly, for example, and than the search is possible.

For better understanding again a few pictures:
Thanks for a reply.

Franz










Image Attachments:
Test_30.jpg  Test_31.jpg  Test_32.jpg 


From: bemfarmer
19 Apr 2020   [#43] In reply to [#42]
Hi Franz,

Are you using German lookup?

-Brian
From: Franz
19 Apr 2020   [#44]
Hi bemfarmer!

Yes, but I only did the example in English language.
The search is not the problem, i just don't know where the url for the search comes from (F1 when pressing a command button).

The search will be done with the last term of the url, for example:
"file:///C:/Program%20Files%20(x86)/MoI%203.0/docs/moi_command_reference_German.htm#constructionline"

"#constructionline" in the html-document look please the images.

What I can't figure out is where the url, but especially the search word comes from and .....#constructline is inserted.

2 images again...


Thank you.
Franz

Maybe you can understand my question better if you try the direct F1 search at "CPlane". English or German.






Image Attachments:
Test_33.jpg  Test_34.jpg 


From: Michael Gibson
19 Apr 2020   [#45] In reply to [#44]
Hi Franz, so the German help file translation is for MoI version 2, I think it will be missing things that were new in v3.

So for the anchor added (the #text at the end of the URL), that is generated by the launchHelp() function inside MoI. The process it uses is:

If the Mesh dialog or Options dialog is open and has keyboard focus it will use #MeshDialog or #Options

Otherwise, if a command is currently running it will use the name of the command. So for example if the Line command is currently running it will add #line.

If it was able to find a context value then the URL that is opened will be the command reference page with that anchor specified so it can jump directly to that entry.

If there was no context value found then it will open the front page of the help file instead of the reference section.

So the name that you are asking about comes from the command's file name.

- Michael

Show messages:  1-5  6-25  26-45  46-49