HISE Logo Forum
    • Categories
    • Register
    • Login

    How to change ComboBox row height?

    Scheduled Pinned Locked Moved Scripting
    32 Posts 4 Posters 1.5k 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.
    • ustkU
      ustk @d.healey
      last edited by ustk

      @d-healey It's easy to trick if you want them bigger because you just have to paint the main CB to a smaller size. But if you need the rows to be smaller, then you can place the CB inside a bigger panel. Not ideal but...

      I needed to adjust the row height myself, because I have some stuff to paint along with a long string.
      It would be cool to have a rowHeight property factor that multiplies the component height.

      I added a property to a component a while ago but I don't remember how I did it. I'll try to dig into this...

      Can't help pressing F5 in the forum...

      d.healeyD 1 Reply Last reply Reply Quote 1
      • ustkU
        ustk
        last edited by ustk

        Well... After adding the property I can't seem to find a way to override the Juce popup.
        It seems to be a fixed size apparently, where it always uses the height of the CB label...

        Can't help pressing F5 in the forum...

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

          @ustk Yeah I had a look in the source as well and couldn't figure it out.

          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 @ustk
            last edited by d.healey

            @ustk said in How to change ComboBox row height?:

            @d-healey It's easy to trick if you want them bigger because you just have to paint the main CB to a smaller size.

            If you use drawComboBox then the combo box height no longer affects the row height.

            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
              last edited by

              @ustk Ok I think I understand what you're suggesting. I put the combo box in a panel and paint the panel instead of the combo box. That way the combo box can be any size and I can control the height of the rows.

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

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

                Ah but now I can't paint a hover action because the combo box blocks the panel :(

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

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

                  I've thought of a solution. If I can programmatically make the popup menu open and close I can style everything the way I want.

                  @ustk @Christoph-Hart I'd like to add some functions from JUCE, showPopup(), hidePopup(), isPopupActive(). I'm either too tired or missing something obvious but within the ScriptingApiContent.cpp I add the wrapper function but how do I get a reference to the current combo box so that I can call the JUCE function on it?

                  I tried this->showPopup() but of course this doesn't work, is it a case of using getComponent() or is there some more straightforward method?

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

                  1 Reply Last reply Reply Quote 0
                  • ustkU
                    ustk @d.healey
                    last edited by ustk

                    @d-healey

                    Ah but now I can't paint a hover action because the combo box blocks the panel 😞

                    But apparently you want a thin CB with bigger rows. If the CB is inside a panel, you can always paint what you want in the CB with a custom LAF
                    You can also miss the panel and paint a smaller area in the CB (but then it'll react when the mouse is close)

                    You could also go full child panels to create your drop down? Because of the current "ghost" issue?

                    I'd like to add some functions from JUCE, showPopup()...

                    If we can override those functions then it should be possible to simply add a property.

                    Can't help pressing F5 in the forum...

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

                      @ustk

                      But apparently you want a thin CB with bigger rows.

                      I want the opposite. I want to increase the height.

                      You could also go full child panels to create your drop down? Because of the current "ghost" issue?

                      I don't even need child panels for this. I just don't want to do it :)

                      If we can override those functions then it should be possible to simply add a property.

                      I was thinking of adding scripting wrappers for the functions. How would they work as properties?

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

                      ustkU 1 Reply Last reply Reply Quote 0
                      • ustkU
                        ustk @d.healey
                        last edited by ustk

                        @d-healey

                        I was thinking of adding scripting wrappers for the functions. How would they work as properties?

                        Once you create a property for the height, you might be able to pass it to the function when the property changes.

                        I was trying to fake a smaller CB with bigger rows, and realised that once you set a custom LAF, the row height get back to a default value no matter the height of the CB...
                        There might be a way to access this in the local LAF function

                        Can't help pressing F5 in the forum...

                        d.healeyD 2 Replies Last reply Reply Quote 0
                        • d.healeyD
                          d.healey @ustk
                          last edited by

                          @ustk

                          There might be a way to access this in the local LAF function

                          I couldn't find a way. But with programatic showPopup/hidePopup we can do whatever we want.

                          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 @ustk
                            last edited by

                            @ustk said in How to change ComboBox row height?:

                            Once you create a property for the height, you might be able to pass it to the function when the property changes.

                            Let me know if you solve it because having a row height property would be the best solution.

                            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
                              last edited by

                              @ustk I think I'm getting somewhere.

                              @Christoph-Hart Can you explain this? https://github.com/christophhart/HISE/blob/develop/hi_core/hi_core/MacroControlledComponents.h#L375

                              Setting it to 1 will allow the overridden showPopup() function to work and in there we have access to the row height property on line 408: withStandardItemHeight()

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

                              ustkU 1 Reply Last reply Reply Quote 1
                              • ustkU
                                ustk @d.healey
                                last edited by

                                @d-healey Nice one, there's the showPopup override here I was looking for! I'm sure my eyes slipped over it hundreds of times...

                                Can't help pressing F5 in the forum...

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

                                  @ustk I've added the property, the last thing to do is get the property into the showPopup function. I'd also like to know why Christoph is using the #if...

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

                                  ustkU 1 Reply Last reply Reply Quote 0
                                  • ustkU
                                    ustk @d.healey
                                    last edited by ustk

                                    @d-healey Nice!
                                    If you struggle with the property I'll be back tomorrow to help...

                                    Can't help pressing F5 in the forum...

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

                                      @ustk Yeah I'm giving up on it for today. I'll wait for you :) Just need to figure out how to pass the property from the ScriptComboBox to HiComboBox

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

                                      ustkU 2 Replies Last reply Reply Quote 0
                                      • ustkU
                                        ustk @d.healey
                                        last edited by

                                        @d-healey that is the hard part I'm not sure how to do…

                                        Can't help pressing F5 in the forum...

                                        1 Reply Last reply Reply Quote 0
                                        • ustkU
                                          ustk @d.healey
                                          last edited by

                                          @d-healey please share the branch with me so I can have a look tomorrow git -> ustk

                                          Can't help pressing F5 in the forum...

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

                                            @ustk https://github.com/davidhealey/HISE/tree/comboBoxHeight

                                            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

                                            22

                                            Online

                                            1.8k

                                            Users

                                            11.9k

                                            Topics

                                            104.0k

                                            Posts