Skip to main content
K.Daube
Community Expert
Community Expert
October 17, 2022
Answered

ScriptUI problem - only one item can be active

  • October 17, 2022
  • 1 reply
  • 119 views

Dear experts

The standard Find/Change panel provides immeate reaction: both the edit field for the search term and the Find button are active. Hence I can work like this:

  • Invoke the panel with CRTL+F
  • Type what I want to look for
  • Press Enter

In ScriptUI i can not mimic this behaviour. The following does not work:

  wPalF.g02.eFindWhat.text   = KLD_F.GetTextOfSelection();
  wPalF.g02.eFindWhat.active = true;
  wPalF.g08.btnFind.active   = true;
  wPalF.show();

Only the button is active when this snipped has been executed.

In ScriptUI  obviously only one element can be active in a dialogue/panel.at a time.

→ Any ideas how to overcome this limitation?

This topic has been closed for replies.
Correct answer K.Daube

At least for this case I have found the solution: change call back event from onChanging to onChange:

  wPalF.g02.eFindWhat.onChange = function () {
    wPalF.g08.btnFind.active  = true;
    KLD_F.bFirstFind = true; // Find cycle starts
    KLD_F.ClearInfoArea ();
  };

Now I can also work like this:

  • Invoke the panel with ESC, q, f
  • Type what I want to look for
  • Press Enter
  • Press Enter for the next find...

Hopefully there are no obstacles towards the activation of short-cut keys for other elements...

1 reply

K.Daube
Community Expert
K.DaubeCommunity ExpertAuthorCorrect answer
Community Expert
October 17, 2022

At least for this case I have found the solution: change call back event from onChanging to onChange:

  wPalF.g02.eFindWhat.onChange = function () {
    wPalF.g08.btnFind.active  = true;
    KLD_F.bFirstFind = true; // Find cycle starts
    KLD_F.ClearInfoArea ();
  };

Now I can also work like this:

  • Invoke the panel with ESC, q, f
  • Type what I want to look for
  • Press Enter
  • Press Enter for the next find...

Hopefully there are no obstacles towards the activation of short-cut keys for other elements...