uiTabs

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #30679
    zeoka
    Participant
      • Topics: 73
      • Replies: 466
      • Total: 539
      • ★★★

      Hi
      I attempt to add graphic to tab
      I’m lost

      --
      -- Called when the current tab in an uiTabs component is changed
      --
      moduletabchanged = function(mod, tabIndex)
         if panel:getModulatorByName("ModulesGraphiques") ~=  nil then
            panel:getModulatorByName("ModulesGraphiques"):setModulatorValue(tabIndex,false,false,false)
        end  -- actually my background tabs , a custom mod on another layer
      I would replace it 
         -- 3 child components 0,1,2 (getNumChildComponents)
      
      cmp = mod:getComponent()--:getChildComponent (1):getTabContentComponent ( tabIndex)  -- component generic ??
      mdl = Graphics(Image(ARGB,616,4,960,232,true)) -- something wrong  
      
            if tabIndex == 0 then 
               mdl:setFont(24.0)
               mdl:setColour(Colour(0xCDFFFFFF))
               mdl:fillRect(16,16,928,2) 
               mdl:drawText("OSC1",16,24,88,24,Justification(Justification.left),false)
               mdl:drawText("Shape",49,192,112,24,Justification(Justification.left),false)
               cmp:paint(mdl)
        elseif tabIndex == 1 then
      
           end
      console(string.format("%s", mod:getComponent():getCurrentTabName () )) 

      tried a lot of things ,the only thing I get for now is the nb of childs

      Also tried to adapt the script of the custom and add the property “paint Callback” to my tabs but nthe script does nothing…..
      Is it possible currently to simply add graphic to uiTabs ?

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

        Are you trying to draw on the tab background ?

        #30717
        zeoka
        Participant
          • Topics: 73
          • Replies: 466
          • Total: 539
          • ★★★

          Hi Atom
          yes I tried

          I replaced also my 3 links “uitabsCurrentTab”/component on my panel by
          “modulatorValue”/modulator because at startup tab values are not synced with their tabIndex. Startup takes tab values not tab indexes

          if background tab painting is not possible
          I will add “luaValueChange” to my tab comp to control my background custom mod value
          i tried it , that’s working .

        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 80 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