HISE Logo Forum
    • Categories
    • Register
    • Login

    How to disable viewport table row selection?

    Scheduled Pinned Locked Moved Solved Scripting
    tableviewportrowcolumn
    9 Posts 4 Posters 193 Views
    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.
    • d.healeyD
      d.healey
      last edited by d.healey

      I have a viewport setup as a table, one column contains buttons, the other a label showing what the button is for. I have no need for the user to be able to select a row, how can I disable this?

      Peek 2025-02-23 18-24.gif

      Libre Wave - Freedom respecting instruments and effects
      My Patreon - HISE tutorials
      YouTube Channel - Public HISE tutorials

      Matt_SFM 1 Reply Last reply Reply Quote 0
      • Matt_SFM
        Matt_SF @d.healey
        last edited by

        @d-healey I've tinkered with the viewport recently. I don't it's possible to disable row selection, but maybe you could cheat using laf? i.e. So each row has the same 'design' no matter if it's clicked or not, so the user has no clue the rows are selectable?

        Develop branch
        Win10 & VS17 / Ventura & Xcode 14. 3

        d.healeyD 1 Reply Last reply Reply Quote 1
        • d.healeyD
          d.healey @Matt_SF
          last edited by

          @Matt_SF said in How to disable viewport table row selection?:

          but maybe you could cheat using laf?

          Good idea. I'll do that.

          Libre Wave - Freedom respecting instruments and effects
          My Patreon - HISE tutorials
          YouTube Channel - Public HISE tutorials

          1 Reply Last reply Reply Quote 0
          • d.healeyD d.healey marked this topic as a question on
          • d.healeyD d.healey has marked this topic as solved on
          • d.healeyD
            d.healey
            last edited by

            @Christoph-Hart Slightly related question. For buttons the row index in the laf obj is spelt RowIndex but for text columns it is rowIndex is that intentional?

            Libre Wave - Freedom respecting instruments and effects
            My Patreon - HISE tutorials
            YouTube Channel - Public HISE tutorials

            1 Reply Last reply Reply Quote 0
            • dannytaurusD
              dannytaurus
              last edited by

              Can you do this with CSS?

              for styling the items in the list, use the HTML tag selector for table rows tr . It supports :hover , :active and :checked pseudo states with the same concept as the Buttons

              Link Preview Image
              HISE | Docs

              favicon

              (docs.hise.dev)

              Meat Beats: https://meatbeats.com
              Klippr Video: https://klippr.video

              d.healeyD 1 Reply Last reply Reply Quote 0
              • d.healeyD
                d.healey @dannytaurus
                last edited by

                @dannytaurus said in How to disable viewport table row selection?:

                Can you do this with CSS?

                I'm avoiding CSS until it can be used in combination with laf. But laf was able to do the job here.

                Libre Wave - Freedom respecting instruments and effects
                My Patreon - HISE tutorials
                YouTube Channel - Public HISE tutorials

                Christoph HartC 1 Reply Last reply Reply Quote 1
                • Christoph HartC
                  Christoph Hart @d.healey
                  last edited by Christoph Hart

                  Link Preview Image
                  - allow CSS & scripted LAF within same component · christophhart/HISE@e459f0b

                  The open source framework for sample based instruments - - allow CSS & scripted LAF within same component · christophhart/HISE@e459f0b

                  favicon

                  GitHub (github.com)

                  Long overdue, but it seems that this was really holding people back from CSS...

                  These are the rules:

                  • you can now use local LAF objects with mixed CSS & script functions
                  • global look and feels can still be only script or CSS but that should be fine as you can always use a local LAF if you need both
                  • script functions have the precedence, so if a draw function was registered it will always supercede the CSS definition
                  • the exception is popup menu styling - as soon as you combine script functions & CSS, the popup menu will always be styled with the CSS.

                  Combobox with scripted draw function & CSS styled popupmenu:

                  const var laf = Content.createLocalLookAndFeel();
                  
                  // Combobox is styled by a function
                  laf.registerFunction("drawComboBox", function(g, obj)
                  {
                  	g.setColour(obj.bgColour);
                  	g.fillRect(obj.area);
                  	g.setFont("Comic Sans MS", 21);
                  	g.setColour(Colours.blue);
                  	g.drawAlignedText(obj.text, obj.area, "centred");
                  });
                  
                  // Popup menu is styled by CSS
                  laf.setInlineStyleSheet("
                  .popup
                  {
                  	background: #333;
                  }
                  
                  .popup-item
                  {
                  	background: transparent;
                  	color: #999;
                  	padding: 10px;
                  }
                  
                  .popup-item:hover
                  {
                  	background: rgba(255,255,255, 0.2);
                  }
                  
                  .popup-item:active
                  {
                  	color: white;
                  	font-weight: bold;
                  }
                  ");
                  
                  Content.getComponent("ComboBox1").setLocalLookAndFeel(laf);
                  
                  d.healeyD 2 Replies Last reply Reply Quote 5
                  • d.healeyD
                    d.healey @Christoph Hart
                    last edited by d.healey

                    @Christoph-Hart Oh nice! I have no excuse now :)

                    Libre Wave - Freedom respecting instruments and effects
                    My Patreon - HISE tutorials
                    YouTube Channel - Public HISE tutorials

                    1 Reply Last reply Reply Quote 0
                    • d.healeyD
                      d.healey @Christoph Hart
                      last edited by

                      @Christoph-Hart Here's another use case that doesn't seem possible, combining CSS with paint routines.

                      I want to use CSS to draw a rounded image on a panel. I want to use a paint routine to draw some text. Is this achievable? Or can text be drawn with CSS?

                      Libre Wave - Freedom respecting instruments and effects
                      My Patreon - HISE tutorials
                      YouTube Channel - Public HISE tutorials

                      1 Reply Last reply Reply Quote 0
                      • First post
                        Last post

                      51

                      Online

                      1.7k

                      Users

                      11.7k

                      Topics

                      102.1k

                      Posts