Author Topic: Radial Menu  (Read 27458 times)

0 Members and 1 Guest are viewing this topic.

reltro

  • Guest
Radial Menu
« on: May 31, 2014, 05:45:16 AM »
Hey People...

I first posted the Radial-Menu in this Thread: http://www.theswamp.org/index.php?topic=12813.msg521952#msg521952

Since then I improved the functionality to add following stuff:

* last command will be stored in the function itself
   - can be called
      - by pressing ENTER or SPACE
      - LEFT-Click in the Center or the free Space below

* different shortcuts for "right-action" and "left-action"
* as ShortCuts strings can be used
   - first the UpperCase Chars are searched
         (wcmatch "shortcut" (strcase "*typed*"))
   - then the whole sting is searched
         (eq (strcase "shortcut") (strcase "typed"))
   
   Note:
      To find a proper shortcut, the entries are searched counterclockwise.
      If there is a SubMenu then this one will be searched right after the parentMenu.

* If there is a SubMenu and no proper command for the current action (Ex. RIGHTCLICK) the SubMenu will be display at it own.
* To open a SubMenu at his own, u can also press TAB while pointing the ParentMenu-Entry
* To switch back to the last shown ParentMenu point at the center or the free Space below and Press TAB or RIGHTCLICK.

--------------------------------------------------------

At the moment there are 2 Versions:
   - RadialMenu-allVectors.lsp
         - the displayed Menu is made from vectors and drawn with grvecs
         
   - RadialMenu-titleMtext.lsp
         - the displayed Menu is made from vectors and drawn with grvecs
         - the title (name of the current pointed Menu-Entry) is drawn using MText
            NOTE: if the View is rotated with 3D-Orbit the Mtext isn't shown in the right direction
            

            
To modify the Menu at ur own look at the 2 examples and the Tree-Map in the attachment.

To draw symbols at ur own:
   * draw a line graphic near the origin of the WCS.
   * the origin (0 0 0) will be the Center of the symbol/graphic shown in the Menu.
   * the maximal Extension of the graphic should be near 1
   * to add colors use the object color (GC 62)
   * then run CreateSymbol.lsp and select the lines
   * copy the result and add it to ur menu
   
Usage: (prepared)
   - load RadialMenu-***.lsp
   - load ModifyDraw.lsp
   - type: Interface
   - hit ENTER


EDIT
LAST VERSION:
http://www.theswamp.org/index.php?topic=47177.msg522549#msg522549

reltro
« Last Edit: June 11, 2014, 08:11:00 AM by reltro »

WILL HATCH

  • Bull Frog
  • Posts: 450
Re: Radial Menu
« Reply #1 on: June 01, 2014, 01:33:29 AM »
This is awesome, I like the direction you've taken with this.  The only thing I would like to see is the ability to put into a 'continuous' mode where the menu automagically opens up after the command saving an additional right click.

I'm waiting for my pair of Myo armbands to come in, thinking they could save a huge amount of time in the drafting department with some toying, and this kind of idea is a great start.

Thanks for sharing

ROBBO

  • Bull Frog
  • Posts: 217
Re: Radial Menu
« Reply #2 on: June 02, 2014, 01:19:44 PM »
reltro,

A snappy and well thought out routine. May add this to a right click menu.
It would be even better as WILL HATCH suggested:
...I would like to see is the ability to put into a 'continuous' mode...
Also for people like me who redefine commands  - is to add a period to the commands to allow original command to be called. Example: _.LINE instead of _LINE. Nevertheless thank you for sharing.

Kindest regards,  Robbo
The only thing to do with good advice is to pass it on.
It is never of any use to oneself.

Oscar Wilde
(1854-1900, Irish playwright, poet and writer)

reltro

  • Guest
Re: Radial Menu
« Reply #3 on: June 03, 2014, 02:14:03 PM »
Hey people...

I cleaned up the mess a lil bit, and rewrote most of the routine to add other functionallity...

I skipped the version with the MText, I don't like it... it only makes problems....

added:

- Menu is now scaleable with the +/- keys
     * the last setting will be saved in the function
     * shift++ and shift+- will recreate the initial scale

- Markers if a button has a LEFT-click-action or/and RIGHT-click-action [EDIT]
     * can be toggled OFF by pressing Shift+#

- The whole menu (the drawn vectors) is precalulated

- The whole Menu  can be written to a File wih contains all needed

- by pressing # it toggles between graphics and text

- pointing on a button and pressing ? gives some tips for it
     *changed the Input a lil bit to add a 'Description-Tag

- pointed button is highlighted


improved

- ShortCuts:
    *  If a button is pointed and a Shortcut is given, the menu will be searched only in this "Category" with all SubMenus
    *  If no button is pointed it searches like as in the previous version



******************
As there are a lot of downloads, but no comments, I will post a prepared Menu, but not the function wich one creates it...
Anybody is welcome to make some suggestions, and ask for the Create-function

reltro
« Last Edit: June 04, 2014, 05:13:16 AM by reltro »

reltro

  • Guest
Re: Radial Menu
« Reply #4 on: June 03, 2014, 02:24:12 PM »
This is awesome, I like the direction you've taken with this.  The only thing I would like to see is the ability to put into a 'continuous' mode where the menu automagically opens up after the command saving an additional right click.

I'm waiting for my pair of Myo armbands to come in, thinking they could save a huge amount of time in the drafting department with some toying, and this kind of idea is a great start.

Thanks for sharing

Hey WILL HATCH,
thanks for the feedback

Would also like the 'continuous' way, but it isn't that easy... the action is evaluated at the very end outside of the menu-routine (to avoid namespace-collisions).
The only way to chatch the end of a an action, I think, would be a reactor (Ex. commandended); I don't like them ;)

But u can try it ;)

.........
Myo armbands :  :-o this is so nice! ;) please give some feedback if they arrive!


reltro,

A snappy and well thought out routine. May add this to a right click menu.
It would be even better as WILL HATCH suggested:

...I would like to see is the ability to put into a 'continuous' mode...
Also for people like me who redefine commands  - is to add a period to the commands to allow original command to be called. Example: _.LINE instead of _LINE. Nevertheless thank you for sharing.

Kindest regards,  Robbo


Hey robbo
thanks for the feedback

I don't know how to add a function to a right-click-menu (not via lisp), so give me a hint ;)

The DOTS... u are right, I modified them in the last post


reltro

WILL HATCH

  • Bull Frog
  • Posts: 450
Re: Radial Menu
« Reply #5 on: June 03, 2014, 02:28:50 PM »
- Markers if a button has a LEFT-click-action or/and LEFT-click-action
     * can be toggled OFF by pressing Shift+#
Not sure what you mean here

reltro

  • Guest
Re: Radial Menu
« Reply #6 on: June 03, 2014, 02:53:16 PM »
There is a small red line if the button have a left-click-action, and a green one if there is one for right click...

Ex:
- draw has no action, no line
- move has right and left
  Left: (command "_.line")
  Right: (command "_.line" "_prevoius")

With shift+# the can be hidden/shown

[EDIT: oh I don't not reconized the mistake in the previous post... thanks and corrected]

Reltro
« Last Edit: June 04, 2014, 05:12:16 AM by reltro »

ROBBO

  • Bull Frog
  • Posts: 217
Re: Radial Menu
« Reply #7 on: June 04, 2014, 02:36:41 AM »
reltro,

Great improvements. The only thing I could not get to work is the toggle (Shift+#) for the markers.

One thing I think that could improve this, is to perhaps have a Help button, perhaps near the centre of the graphic (similar to your ? function) to explain how to operate the tool as described in your updated post.

Keep up the good work. Kind regards, Robbo.

BTW - I load this lisp in on start-up and created a shortcut key Shift+Z to call the tool.
 
The only thing to do with good advice is to pass it on.
It is never of any use to oneself.

Oscar Wilde
(1854-1900, Irish playwright, poet and writer)

reltro

  • Guest
Re: Radial Menu
« Reply #8 on: June 04, 2014, 09:58:52 AM »
reltro,

Great improvements. The only thing I could not get to work is the toggle (Shift+#) for the markers.

One thing I think that could improve this, is to perhaps have a Help button, perhaps near the centre of the graphic (similar to your ? function) to explain how to operate the tool as described in your updated post.

Keep up the good work. Kind regards, Robbo.

BTW - I load this lisp in on start-up and created a shortcut key Shift+Z to call the tool.

Hm, the shift+# key has on my keyboard here, the code returned from (grread) is (2 39)... and (chr 39) is "'" (the quote-symbol)...
I think its because I have a german keyboard... I will build in some option to modify the keys, so everyone can adjust them at his own... idea?

I already began to implement such a option-command to modify the displayed colors...

------
The thing with the help on the center is a good idea... The center has allready a help(?)-action... it displays the header with contact and all the stuff, so it wouldn't be hard to add some other things...
At the moment I use the (alert ...) function to display it, but it would be nice to build a simple dcl, but I don't know a lot of dcl... maybe you/someone can help?

reltro

ROBBO

  • Bull Frog
  • Posts: 217
Re: Radial Menu
« Reply #9 on: June 04, 2014, 10:16:21 AM »
reltro,

I  know very little about dcl too!. Have used the alert command frequently though.

I have also used the browser command to open up a help file - for example:
^C^C_BROWSER "C:/folder/in/file/search/path/MY_help.mht"

Can even be a pdf.

Cheers, Robbo.
The only thing to do with good advice is to pass it on.
It is never of any use to oneself.

Oscar Wilde
(1854-1900, Irish playwright, poet and writer)

Bhull1985

  • Guest
Re: Radial Menu
« Reply #10 on: June 04, 2014, 11:20:15 AM »
DCL is simple as pie.
Here's an example to show exactly how easy it is.
Code: [Select]
img : image_button
{
height = 5.5;
width = 18.00;
fixed_width = true;
fixed_height = true;
alignment = centered;
color = -2;
}
txt : text {fixed_width = true; alignment = centered; }
col : column {fixed_width = true; width = 28; }

  //---------------------------------------------------------------------------------------------------------


  controlvalves : dialog {
   label = "EPCO Control Valves"; spacer;
: row
{
   : col
   {
: img { key = "Slide1"; } : txt { label = "Hand Op. Butterfly Control Valve"; } spacer_1;
: img { key = "Slide2"; } : txt { label = "Hand Op. 3-Way Control Valve"; } spacer_1;
: img { key = "Slide3"; } : txt { label = "Diaph. Act. w Ind. Valve Action"; } spacer_1;
: img { key = "Slide4"; } : txt { label = "Butterfly CV (Shut-Down Valve)"; } spacer_1;
: img { key = "Slide5"; } : txt { label = "Globe Control Valve"; } spacer_1;
: img { key = "Slide6"; } : txt { label = "Ball Type Control Valve"; }
   }
   : col
   {
: img { key = "Slide7"; } : txt { label = "Control Valve w Hand Actuator"; } spacer_1;
: img { key = "Slide8"; } : txt { label = "Angle Control Valve"; } spacer_1;
: img { key = "Slide9"; } : txt { label = "Pilot Valve w Manual Reset"; } spacer_1;
: img { key = "Slide10"; } : txt { label = "Backpressure Reg.- Int. Sensing"; } spacer_1;   
: img { key = "Slide11"; } : txt { label = "Backpressure Reg.- Ext. Sensing"; } spacer_1;
: img { key = "Slide12"; } : txt { label = "Pres. Red. Reg.- Int. Sensing"; }
   }
}
spacer; cancel_button;     
}///manualvalves
obviously this DCL is meant to display image slides but it shows how simple it is to modify ,
you'd simply set your controls for what you are going to be using at the top of the routine,
and then "call" them throughout your dcl, using the
: col/ : row
commands in order to organize them where you'd like them to appear.
There are more commands and controls that could be defined, such as text PARAGRAPHS, which would allow for multiline text formatting a bit better than the text controls shown in this example.
Wish I could do it for you, don't have the time quite yet!

reltro

  • Guest
Re: Radial Menu
« Reply #11 on: June 04, 2014, 05:50:18 PM »
Hey People...

There is a new Version of RadialMenu... :)

Version 2.1a

- Added a Keyword-Menu to modify look and behaviour, wich can be opened by pressing ? in the center or the free space below.
      * there the option-keyword ? gives a feedback and redirect u to this URL

- Added a Snappy-Mode so the Menu follows the cursor

- Added a option to show the whole Menu at the same time

- Added the possiblity to switch between "singleChar"- and "String"- Shortcuts
      *SingleChar will save a Keypress (ENTER or SPACE)

- Added an option wich controlls if a click on a button without an appropriate action opens the submenu or not (NOACTION>GOSUB ...


In the Attachment a prepared Example with the following setting:

Code: [Select]
( ;-------------------------------------------------
(MENU,SCALE 150)
(MENU,SCALE,INI 150)
(MENU,SCALE,INCREMENTER 9)
;-------------------------------------------------
(COLOR,MARKER,LEFT 1)
(COLOR,MARKER,RIGHT 3)

(COLOR,TEXT,SYM,GRAPHICMODE 9)
(COLOR,TEXT,SYM,TEXTMODE 2)

(COLOR,TEXT,TITLE 2)

(COLOR,TEXT,LASTCOMMAND 1)

(COLOR,BOUNDARY 8)
(COLOR,GUIDE 3)
;-------------------------------------------------
(MARKER,SHOW:HIDE T)
(GRAPHIC:TEXT T)
(NOACTION>GOSUB NIL)
(DISPLAYALL NIL)
(SNAPPY 'T)
(ONECHARSHORTCUT NIL)
;-------------------------------------------------
(KEY,OPENSUB 9) ;TAB
(KEY,TOGGLEMARKER 151);F11
(KEY,TOGGLEDISPLAYMODE 31) ;F12
(KEY,RESTORESCALE 35) ;#
(KEY,SCALEUP 43) ;+
(KEY,SCALEDOWN 45) ;-
(KEY,SNAPPY 6) ;F3
(KEY,SHOWALL 25) ;F4
)

The setting can also modified from outside... it is an assoc-list wich can be found at (cadr C:Draw-Modify)
**NOTE: take care by changing "COMMAND,LAST":
                  structure: ("title" (command "_close"))


To create a Menu at ur own, u need an other Script than that... Just write my a PM ;)


[EDIT: found a lil bug with the display of the last command: fixed and reattached]


Greets
reltro

« Last Edit: June 04, 2014, 06:05:00 PM by reltro »

reltro

  • Guest
Re: Radial Menu
« Reply #12 on: June 04, 2014, 05:54:14 PM »
DCL is simple as pie.
Here's an example to show exactly how easy it is.
Code: [Select]
img : image_button
{
height = 5.5;
width = 18.00;
fixed_width = true;
fixed_height = true;
alignment = centered;
color = -2;
}
txt : text {fixed_width = true; alignment = centered; }
col : column {fixed_width = true; width = 28; }

  //---------------------------------------------------------------------------------------------------------


  controlvalves : dialog {
   label = "EPCO Control Valves"; spacer;
: row
{
   : col
   {
: img { key = "Slide1"; } : txt { label = "Hand Op. Butterfly Control Valve"; } spacer_1;
: img { key = "Slide2"; } : txt { label = "Hand Op. 3-Way Control Valve"; } spacer_1;
: img { key = "Slide3"; } : txt { label = "Diaph. Act. w Ind. Valve Action"; } spacer_1;
: img { key = "Slide4"; } : txt { label = "Butterfly CV (Shut-Down Valve)"; } spacer_1;
: img { key = "Slide5"; } : txt { label = "Globe Control Valve"; } spacer_1;
: img { key = "Slide6"; } : txt { label = "Ball Type Control Valve"; }
   }
   : col
   {
: img { key = "Slide7"; } : txt { label = "Control Valve w Hand Actuator"; } spacer_1;
: img { key = "Slide8"; } : txt { label = "Angle Control Valve"; } spacer_1;
: img { key = "Slide9"; } : txt { label = "Pilot Valve w Manual Reset"; } spacer_1;
: img { key = "Slide10"; } : txt { label = "Backpressure Reg.- Int. Sensing"; } spacer_1;   
: img { key = "Slide11"; } : txt { label = "Backpressure Reg.- Ext. Sensing"; } spacer_1;
: img { key = "Slide12"; } : txt { label = "Pres. Red. Reg.- Int. Sensing"; }
   }
}
spacer; cancel_button;     
}///manualvalves
obviously this DCL is meant to display image slides but it shows how simple it is to modify ,
you'd simply set your controls for what you are going to be using at the top of the routine,
and then "call" them throughout your dcl, using the
: col/ : row
commands in order to organize them where you'd like them to appear.
There are more commands and controls that could be defined, such as text PARAGRAPHS, which would allow for multiline text formatting a bit better than the text controls shown in this example.
Wish I could do it for you, don't have the time quite yet!


Thanks Bhull1985 for this

it is a nice example... It should'nt be so hard ;) wanna try it...
If u are faster it would be great ;)


Check out the new version an tell me what u think ;)

reltro

andy_lee

  • Newt
  • Posts: 147
Re: Radial Menu
« Reply #13 on: June 04, 2014, 08:22:02 PM »
Hey People...

There is a new Version of RadialMenu... :)

Version 2.1a

- Added a Keyword-Menu to modify look and behaviour, wich can be opened by pressing ? in the center or the free space below.
      * there the option-keyword ? gives a feedback and redirect u to this URL

- Added a Snappy-Mode so the Menu follows the cursor

- Added a option to show the whole Menu at the same time

- Added the possiblity to switch between "singleChar"- and "String"- Shortcuts
      *SingleChar will save a Keypress (ENTER or SPACE)

- Added an option wich controlls if a click on a button without an appropriate action opens the submenu or not (NOACTION>GOSUB ...


In the Attachment a prepared Example with the following setting:

Code: [Select]
( ;-------------------------------------------------
(MENU,SCALE 150)
(MENU,SCALE,INI 150)
(MENU,SCALE,INCREMENTER 9)
;-------------------------------------------------
(COLOR,MARKER,LEFT 1)
(COLOR,MARKER,RIGHT 3)

(COLOR,TEXT,SYM,GRAPHICMODE 9)
(COLOR,TEXT,SYM,TEXTMODE 2)

(COLOR,TEXT,TITLE 2)

(COLOR,TEXT,LASTCOMMAND 1)

(COLOR,BOUNDARY 8)
(COLOR,GUIDE 3)
;-------------------------------------------------
(MARKER,SHOW:HIDE T)
(GRAPHIC:TEXT T)
(NOACTION>GOSUB NIL)
(DISPLAYALL NIL)
(SNAPPY 'T)
(ONECHARSHORTCUT NIL)
;-------------------------------------------------
(KEY,OPENSUB 9) ;TAB
(KEY,TOGGLEMARKER 151);F11
(KEY,TOGGLEDISPLAYMODE 31) ;F12
(KEY,RESTORESCALE 35) ;#
(KEY,SCALEUP 43) ;+
(KEY,SCALEDOWN 45) ;-
(KEY,SNAPPY 6) ;F3
(KEY,SHOWALL 25) ;F4
)

The setting can also modified from outside... it is an assoc-list wich can be found at (cadr C:Draw-Modify)
**NOTE: take care by changing "COMMAND,LAST":
                  structure: ("title" (command "_close"))


To create a Menu at ur own, u need an other Script than that... Just write my a PM ;)


[EDIT: found a lil bug with the display of the last command: fixed and reattached]


Greets
reltro

Good job! reltro, Thanks for sharing.
andy.
Best regards.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Radial Menu
« Reply #14 on: June 04, 2014, 11:58:28 PM »
reltro,
Very creative programing.  :)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.