• Login
sketchucation logo sketchucation
  • Login
โš ๏ธ Libfredo 15.4b | Minor release with bugfixes and improvements Update

Context menu Submenu

Scheduled Pinned Locked Moved Developers' Forum
12 Posts 5 Posters 1.6k Views 5 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    CadFather
    last edited by 24 Jul 2008, 13:45

    Hi, i'm trying to organise my right click menu (mine started to go under the table) - i'm now dealing with multiple submenus

    • anyone with a quick snippet on multiple submenus code?

    this is what i'm trying to achieve

    context menu.png

    oh, and another question please - is there a way to 'specify' the position of the menu? (eg not at bottom)

    1 Reply Last reply Reply Quote 0
    • M Offline
      Matt666
      last edited by 24 Jul 2008, 14:36

      Hi !
      Like your example :

      UI.add_context_menu_handler do |menu|
        rbm = menu.add_submenu("Ruby Tools ;;")
        sbm = rbm.add_submenu("Rotation")
          sbm.add_item("Around red") { function }
          sbm.add_item("Around green") {function }
          sbm.add_item("Around blue") {function }
        menu.add_item("Erase coplanar Edges") { function }
      end
      

      sbm is a submenu of rbm, a submenu of menu...

      Frenglish at its best !
      My scripts

      1 Reply Last reply Reply Quote 0
      • C Offline
        CadFather
        last edited by 24 Jul 2008, 14:45

        Thanks Matt - will give it a try! ๐Ÿ˜„

        1 Reply Last reply Reply Quote 0
        • C Offline
          CadFather
          last edited by 24 Jul 2008, 21:25

          one remaining bug - the menu always shows up at the bottom. i tried changing the loading order of the scripts but it doesn't work. it is not even sorted alphabetically.. ๐Ÿ˜•

          1 Reply Last reply Reply Quote 0
          • H Offline
            haynesc
            last edited by 11 Aug 2008, 14:40

            hey guys once youve figured out how this could work ... would it be available as a ruby so that us mer-mortals can chose where we place our ruby scripts ?

            1 Reply Last reply Reply Quote 0
            • C Offline
              CadFather
              last edited by 11 Aug 2008, 18:13

              unfortunately per user options are the most difficult ones because there is no standard we can all rely on.

              you can look at the menu items, usually at the bottom of most scripts and try to figure out what they do. then tweak them to suit - but it is a slow process and does not always work. some scripts are scrambled and the menu part of the code is not accessible.

              i am working on a new rubyset which will display the scripts in a cleaner fashion both in the plugins menu and in the context one.. hope to finish it sometime in september

              1 Reply Last reply Reply Quote 0
              • R Offline
                RickW
                last edited by 15 Aug 2008, 02:53

                Organizer will allow Plugins menu organization by system folders - make a subfolder in your Plugins folder, then drop the desired .rb files into that subfolder. Organizer will create submenu items having the same name as the folder, and the submenus will contain the ruby scripts you placed there (I skipped a step or two in that description, but that's the basics).

                RickW
                [www.smustard.com](http://www.smustard.com)

                1 Reply Last reply Reply Quote 0
                • T Offline
                  tony bombata
                  last edited by 1 Dec 2008, 07:35

                  my plugins menu was getting unweildy, so one weekend, i went through my downloaded scripts, did a little tweaking - and came up with this - if its unwieldy, well i don't know how to program ๐Ÿ˜ž .

                  i copied and pasted scripts with similar functions, relocated their UI functions and tweaked them

                  question - does organizer work with encrypted scripts?


                  grouped pipe/tube tools


                  Grouped Line To Wall Tools


                  grouped external tools


                  grouped internal furnishing tool

                  1 Reply Last reply Reply Quote 0
                  • C Offline
                    CadFather
                    last edited by 1 Dec 2008, 07:42

                    i don't use organiser so not sure of the answer - thanks for sharing, it will be interesting to see your solution

                    1 Reply Last reply Reply Quote 0
                    • T Offline
                      tony bombata
                      last edited by 1 Dec 2008, 14:18

                      true - that was why i named the scripts building tool 1, 2, 3 etc . .so scripts related to what i refered to as 'building operations' woul reside close to each other.

                      1 Reply Last reply Reply Quote 0
                      • M Offline
                        Matt666
                        last edited by 1 Dec 2008, 14:33

                        Just one thing I read somewhere on this forum : you can organize manually your plugins menu by renaming all scripts.
                        Example :
                        001_SCF toolbars.rb
                        002_JointPushPull.rb
                        003_Greyscale.rb
                        etc etc etc... Bla bla bla

                        But naturally you have to change name inside the code (in file_loaded), and impossible to change an ecrypted script !

                        Frenglish at its best !
                        My scripts

                        1 Reply Last reply Reply Quote 0
                        • R Offline
                          RickW
                          last edited by 1 Dec 2008, 18:47

                          @tony bombata said:

                          question - does organizer work with encrypted scripts?

                          Yes and no. It will load encrypted scripts, but the script's menu location won't change unless the author has adopted the Organizer menu code (it's very easy, but no one seems to want to do it).

                          RickW
                          [www.smustard.com](http://www.smustard.com)

                          1 Reply Last reply Reply Quote 0
                          • 1 / 1
                          • First post
                            Last post
                          Buy SketchPlus
                          Buy SUbD
                          Buy WrapR
                          Buy eBook
                          Buy Modelur
                          Buy Vertex Tools
                          Buy SketchCuisine
                          Buy FormFonts

                          Advertisement