Forum

    • Register
    • Login
    • Search
    • Categories

    Give/Set focus

    Feature Requests
    focus label set give
    4
    8
    37
    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.healey
      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

      ulrik DanH 2 Replies Last reply Reply Quote 2
      • ulrik
        ulrik @d.healey last edited by

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

        Hise Develop branch
        MacOs 12.4, Xcode 13.0
        http://musikboden.se

        1 Reply Last reply Reply Quote 0
        • DanH
          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

          d.healey 1 Reply Last reply Reply Quote 0
          • d.healey
            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

            ustk 1 Reply Last reply Reply Quote 0
            • ustk
              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

              Tired to press F5 in the forum...
              Studio427 Audio - Audio Instruments & FX Plugins for music production. Website - Facebook

              d.healey 1 Reply Last reply Reply Quote 0
              • d.healey
                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

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

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

                  Tired to press F5 in the forum...
                  Studio427 Audio - Audio Instruments & FX Plugins for music production. Website - Facebook

                  1 Reply Last reply Reply Quote 0
                  • ustk
                    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...

                    Tired to press F5 in the forum...
                    Studio427 Audio - Audio Instruments & FX Plugins for music production. Website - Facebook

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

                    5
                    Online

                    740
                    Users

                    5.4k
                    Topics

                    50.4k
                    Posts