Transfer Menu Bar?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • AXXESS
    Forum Member
    • Nov 2001
    • 498

    Transfer Menu Bar?

    Is there any way to move the menu bar data from project to project?
  • Desmond
    Indigo Rose Staff Member
    • Jul 2003
    • 710

    #2
    In what way?

    You could use Application.GetMenu and Application.SetMenu . . .

    Or do you mean from within the DE?

    Comment

    • AXXESS
      Forum Member
      • Nov 2001
      • 498

      #3
      In the design environment.... for example, if the same menu will be used across multiple projects. It would be nice to be able to apply the menu data from "project 1" to the menu bar in the existing "project 2"....

      Comment

      • rhosk
        Indigo Rose Customer
        • Aug 2003
        • 1698

        #4
        Make the script an external text (lua) file and use Application.LoadScript....or am I misunderstanding you?
        Regards,

        -Ron

        Music | Video | Pictures

        Comment

        • Brett
          Indigo Rose Staff Member
          • Jan 2000
          • 2001

          #5
          You can copy and paste menu structures between projects. Right-click on a node and select Copy.

          Comment

          • rhosk
            Indigo Rose Customer
            • Aug 2003
            • 1698

            #6
            This depends on how you create the menus. I was fixated at creating the menus at runtime, but, either way
            Regards,

            -Ron

            Music | Video | Pictures

            Comment

            • AXXESS
              Forum Member
              • Nov 2001
              • 498

              #7
              Ah. Nodes are fine... but no entire menu copy option at this time?

              Maybe one for the suggestion box...

              Comment

              • Roboblue
                Forum Member
                • Dec 2003
                • 892

                #8
                I created a Menu Bar template that set the bar up for using a minimize and exit menus on the far right. Then, when I know I am going to start a project with a menu bar, I open the bar template project, save as the NEW project name I want. Then just +/- menus as I need to keep the formating correct with the # of menus and size of window. You have to do a Preview to see the format correctly.
                If anyone wants it, here is the apz. it took about 30 minutes to set it up the first time.
                Attached Files
                Last edited by Roboblue; 09-30-2005, 02:02 PM.

                Comment

                • Roboblue
                  Forum Member
                  • Dec 2003
                  • 892

                  #9
                  Script?

                  rhosk
                  Could you give an example of the script for a menu bar for creating at runtime?
                  Is there a way to export just the menubar script once the project has been created?

                  Comment

                  • AXXESS
                    Forum Member
                    • Nov 2001
                    • 498

                    #10
                    I open the bar template project, save as the NEW project name I want
                    I would do that too, except I wanted to transfer a newly created menu to an existing project.

                    Comment

                    • Desmond
                      Indigo Rose Staff Member
                      • Jul 2003
                      • 710

                      #11
                      AXXESS,

                      Use an Application.GetMenu action (in your new project with the menu you want) to save your menu to a text file (Use a TextFile.WriteFromTable action).

                      Then, use an Application.SetMenu action (in your existing project you want to add the menu to) to set the menu to the structure you created in your new app (use a TextFile.ReadToTable action to get the data from the text file to a table).

                      Would that work for you?

                      Desmond.

                      Comment

                      • AXXESS
                        Forum Member
                        • Nov 2001
                        • 498

                        #12
                        That'll work...

                        I'm just coming from the ctrl-c and ctrl-v school....

                        Comment

                        • rhosk
                          Indigo Rose Customer
                          • Aug 2003
                          • 1698

                          #13
                          Runtime Menu Example

                          Originally posted by Roboblue
                          rhosk
                          Could you give an example of the script for a menu bar for creating at runtime?
                          Is there a way to export just the menubar script once the project has been created?
                          This is just another way to do it. Thanks to "Dermot" for a technical issue I had There's an example in the Help Guide, but I expanded on it a bit. I just like the idea of editing one script (or use it across projects, as requested in the first post). Doesn't require that the "Menu Bar" be activated under settings. The code could probably be cleaned up, but it works
                          Attached Files
                          Regards,

                          -Ron

                          Music | Video | Pictures

                          Comment

                          • Roboblue
                            Forum Member
                            • Dec 2003
                            • 892

                            #14
                            Good deal Rhosk
                            Thanx

                            Comment

                            • Lorne
                              Indigo Rose Staff Member
                              • Feb 2001
                              • 2729

                              #15
                              Since copying and pasting a node works, create a temporary root node, make everything in the menu subordinate to that, and then copy and paste the root node.

                              Tip: if you want to preserve the clipboard data for use in another project, paste it into a text file. Then you can just copy that text into the menu editor.

                              Once you've copied the menu, move the original menu items out of the root menu (back to their original positions) and then delete the root node.
                              Attached Files
                              --[[ Indigo Rose Software Developer ]]

                              Comment

                              Working...
                              X