HISE Logo Forum
    • Categories
    • Register
    • Login

    Give/Set focus

    Scheduled Pinned Locked Moved Feature Requests
    focuslabelsetgive
    9 Posts 5 Posters 546 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

      We have loseFocus but is there a way to set a control as having focus? For example I have an editable label and a button to clear the label, it would be nice to give focus to the label when the clear button is clicked.

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

      ulrikU DanHD 2 Replies Last reply Reply Quote 1
      • ulrikU
        ulrik @d.healey
        last edited by

        @d-healey I agree, it would be handy!

        Hise Develop branch
        MacOs 15.3.1, Xcode 16.2
        http://musikboden.se

        1 Reply Last reply Reply Quote 0
        • DanHD
          DanH @d.healey
          last edited by

          @d-healey how does losefocus work? I’m always trying to control the transport in a daw while my plugin is open and end up controlling the plugin instead

          DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
          https://dhplugins.com/ | https://dcbreaks.com/
          London, UK

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

            @DanH

            how does losefocus work?

            I don't know, I've had no use for it yet :)

            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

              @d-healey trying to implement the functions but I'm stuck trying to get the component;

              void ScriptingApi::Content::ScriptLabel::showEditor()
              {
              	if (auto l = dynamic_cast<ScriptLabel*>(get()how?????))
              	{
              		l->showEditor();
              	}
              )
              
              void ScriptingApi::Content::ScriptLabel::hideEditor(bool discardContent)
              {
              	if (auto l = dynamic_cast<ScriptLabel*>(get()how?????))
              	{
              		l-> hideEditor(discardContent);
              	}
              )
              

              Should I dynamic_cast at least? @Christoph-Hart

              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

                Depending on where you're putting this code it might be:

                ScriptingApi::Content::ScriptLabel* thisObject = GET_OBJECT(Content::ScriptLabel)

                or

                MultilineLabel *l = dynamic_cast<MultilineLabel*>(component.get());

                or

                ScriptingApi::Content::ScriptLabel *sl = dynamic_cast<ScriptingApi::Content::ScriptLabel*>(getScriptComponent());

                or

                Something else...

                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 ustk

                  @d-healey I tried 1, 3, and many of the 4... Trying 2 ;)
                  also trying (this)

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

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

                    @d-healey Also I'm not sure the hideEditor will work, because clicking outside the label might be caught before anyway...

                    EDIT: if we really need a discardContent bool, maybe it is possible to add it in the properties then...

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

                    1 Reply Last reply Reply Quote 1
                    • Matt_SFM
                      Matt_SF
                      last edited by

                      It would be nice to have this. Giving focus to a user-input label when clicking on a button for example, as David suggested.

                      @Christoph-Hart would that be possible to implement please ? :)

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

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

                      54

                      Online

                      1.7k

                      Users

                      11.7k

                      Topics

                      101.8k

                      Posts