component visibility

Home Forums General Panels, Components, Macros component visibility

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #7213
    SWB
    Participant
      • Topics: 35
      • Replies: 157
      • Total: 192
      • ★★

      In edit mode I uncheck the visibility of a component (i.c. LCD). CTRLR shows a semi transparent component. That’s OK and very handy. I ‘execute’ the panel and as expected no visible component. Using Lua I set the visibility of this component to visible and then it shows the component, but it is still semi transparent. When (in edit mode) I check the visibility of a component, CTRLR shows the component normal and when I ‘execute’ the panel the component is visible or not visible under Lua control. This is fine, BUT my component is linked to a timer and after a few seconds it becomes invisible. When I return to edit mode this component is still invisible, which is rather inconvenient. I can make the component visible again using the Panel>Modulator list, select the component and then uncheck and check again the visibility. A bit tiresome work around. Is this a minor bug? (I using rev 1315 on Mac 10.7.5, sorry ;-))

      #7222
      atom
      Keymaster
        • Topics: 159
        • Replies: 2945
        • Total: 3104
        • ★★★★★

        *ANY* component in Ctrlr has an alpha setting, that property is only for people who don’t use Lua to control their components it’s a “handy” way of taking something off the screen, but these properties have their own lifetime and you need to respect that lifetime when you use Lua.

        BUT, you can always do (a panel two sliders modulator-1 and modualator-2, this method linked to modulator-2):

        --
        -- Called when a modulator value changes
        -- @mod   http://ctrlr.org/api/class_ctrlr_modulator.html
        -- @value    new numeric value of the modulator
        --
        myMethod = function(mod, value)
        	panel:getComponent("modulator-1"):setAlpha(value/127)
        end
        

        I call the UI parts components cause they are exactly that, have a look at the JUCE docs: http://www.rawmaterialsoftware.com/juce/api/classComponent.html and you can look at what Ctrlr has from that implementation by reading the source file for that class in Ctrlr, in this case: http://sourceforge.net/p/ctrlrv4/code/1325/tree/nightly/Source/Lua/JuceClasses/ the file is LComponent.cpp

        So you can do setVisible, toFront, toBack, setBounds, setEnabled etc.

        #7306
        SWB
        Participant
          • Topics: 35
          • Replies: 157
          • Total: 192
          • ★★

          Thanks for the example. I tried also toBack() and toFront(true) and it works! ( Sorry for the late reply, was away for the weekend.)

        Viewing 3 posts - 1 through 3 (of 3 total)
        • The forum ‘Panels, Components, Macros’ is closed to new topics and replies.
        There is currently 0 users and 69 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