change tabs without mouse 0_O

Home Forums General Panels, Components, Macros change tabs without mouse 0_O

Tagged: ,

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #10389
    KALYWAY
    Participant
      • Topics: 9
      • Replies: 23
      • Total: 32

      hello i want to change tab number of a uitab component with lua only (without mouse click on tab number ) :

      if combo_val == 0 then

      panel:getModulatorByName(“uitab”):getComponent():setPropertyInt(“uiTabsCurrentTab”,0)

      end

      if combo_val == 1 then

      panel:getModulatorByName(“uitab”):getComponent():setPropertyInt(“uiTabsCurrentTab”,1)

      end

      etc etc ….)

      when i change my combo box value , the tab is not switched automatically , i have to click anywhere in the tabs elements on the top off the uitabcomponent and finally the tab number is selected

      is there anyway ? or i have to recode some elements in ctrlrtabcomponents.cpp ……. 0_O

      • This topic was modified 10 years, 10 months ago by KALYWAY.
      • This topic was modified 10 years, 10 months ago by KALYWAY.
      • This topic was modified 10 years, 10 months ago by KALYWAY.
      #10400
      zeoka
      Participant
        • Topics: 73
        • Replies: 466
        • Total: 539
        • ★★★

        I do not have this issue with rev1460 on pc

        maybe this :`
        combo_val = panel:getModulatorbyName():getModulatorValue()
        TAB = panel:getComponent(“uitab”)
        TAB:setProperty(“uiTabsCurrentTab”,(combo_val) ,false)`

        ..only if your combo value 0 equal tab0 , value1 equal tab1 etc….

        • This reply was modified 10 years, 10 months ago by zeoka.
        • This reply was modified 10 years, 10 months ago by zeoka.
        #10401
        atom
        Keymaster
          • Topics: 159
          • Replies: 2945
          • Total: 3104
          • ★★★★★

          If you go to the latest DEMO panels, i added an example on how to switch tabs with lua, the file name is:
          DEMO – Switching tabs with Lua.panel

          and is available at:
          http://svn.code.sf.net/p/ctrlrv4/code/nightly/Panels/

          and will be included in the latest nightly build.

          #10404
          KALYWAY
          Participant
            • Topics: 9
            • Replies: 23
            • Total: 32

            hello thank you , i have downloaded the demo , but it not work in my ctrlr rev 1444 , i have loaded this panel in a ctrlr executable i have specially compiled
            with no lua calls :

            if (isLuaDisabled())
            return (true);

            try
            {
            if (o->isValid())

            {

            //////kalyway lua remove this if crashed methods on panel //////////
            luabind::call_function(o->getObject().getObject(), param1, param2);
            /////********************************************************//////
            }

            this executable help me if i make bad stuff with lua ….or incompatibility etc ….

            i have looked to your lua methods and now my problem is resolved BIG THANK !!
            ( i have forgot to link my combo-box to the changing tab method really really stupid ! ! ! !)

            KALYWAY!

            • This reply was modified 10 years, 10 months ago by KALYWAY.
            #10415
            atom
            Keymaster
              • Topics: 159
              • Replies: 2945
              • Total: 3104
              • ★★★★★

              There is a global option to disable Lua, you need to set it and restart Ctrlr, all Lua is disabled then, no need to do special binaries “Edit->Preferences”)

              #10416
              KALYWAY
              Participant
                • Topics: 9
                • Replies: 23
                • Total: 32

                i have seen this option , but sometimes the ctrlr crashes with lua enabled , and not want to restart due to the save statement , ( he want to restore the last panel …the panel where the crash happen ) i have finally found a good way without editing binaries :

                i delete or move the users prefs relative to the bad panel in my ctrlr folder : on mac there is on /Users/username/Library/Preferences

                and the ctrlr restart blank without panel , and finally i can go to pref/disabling lua .

              Viewing 6 posts - 1 through 6 (of 6 total)
              • The forum ‘Panels, Components, Macros’ is closed to new topics and replies.
              There is currently 0 users and 120 guests online
              No users are currently active
              Forum Statistics
              Threads: 2,495, Posts: 17,374, Members: 77,605
              Most users ever online was 12 on January 22, 2019 3:47 pm
              Ctrlr