[prev in list] [next in list] [prev in thread] [next in thread] 

List:       scilab-users
Subject:    Re: [Scilab-users] Messagebox - button pre-selection
From:       Samuel Gougeon <sgougeon () free ! fr>
Date:       2023-01-07 22:26:42
Message-ID: 953a089f-a9ad-a22e-ca4c-214dab57b22f () free ! fr
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Le 22/10/2021 à 12:56, P M a écrit :
> Dear,
>
> in a messagebox:
>
> Is it possible to have a button other than the first one pre-selected?
>
> e.g.: I'd like to have "No" pre-selected in the example below?
>
> In my application the buttons must stay in their order as they 
> are...so simply changing the order (button label) is no option.
>
> Thank you,
> Philipp
>
> grafik.png


> Is it possible to have a button other than the first one pre-selected?

Almost :-/  So, AFAIK, unfortunately no.
There is a CallScilabBridge.setMessageBoxDefaultSelectedButtons(id, k) 
java method (*)
that should set it, where k is the index of the preselected button.
But in the code it is apparently implemented only for x_choices()

As well,

messagebox("Have you seen this beautiful message", "info", ["Yes" "No"]);
jimport org.scilab.modules.gui.utils.UIElementMapper ;
m = UIElementMapper.getCorrespondingUIElement(1);
m.setDefaultSelectedButtons(1); // First is #0

does nothing

Samuel

(*)
jimport org.scilab.modules.gui.bridge.CallScilabBridge
jgetmethods(CallScilabBridge)

[Attachment #5 (multipart/related)]

[Attachment #7 (text/html)]

<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <div class="moz-cite-prefix">Le 22/10/2021 à 12:56, P M a écrit :<br>
    </div>
    <blockquote type="cite"
cite="mid:CACf7ODvGckLAdtKuKbUEPFWW-kRfQDqctbBxi9RQnymjW+-iTA@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">
        <div>Dear,</div>
        <div><br>
        </div>
        <div>in a messagebox:<br>
        </div>
        <div><br>
        </div>
        <div>Is it possible to have a button other than the first one
          pre-selected?</div>
        <div><br>
        </div>
        <div>e.g.: I'd like to have "No" pre-selected in the example
          below?</div>
        <div><br>
        </div>
        <div>In my application the buttons must stay in their order as
          they are...so simply changing the order (button label) is no
          option.<br>
        </div>
        <div><br>
        </div>
        <div>Thank you,</div>
        <div>Philipp<br>
        </div>
        <div><br>
        </div>
        <div><img src="cid:part1.QfhQIJ54.ZRUJVVd1@free.fr"
            alt="grafik.png" class="" width="275" height="136"></div>
      </div>
    </blockquote>
    <p><br>
    </p>
    <p>
    </p>
    <div class="moz-text-html" lang="x-unicode">
      <blockquote type="cite"
cite="mid:CACf7ODvGckLAdtKuKbUEPFWW-kRfQDqctbBxi9RQnymjW+-iTA@mail.gmail.com">
        <div dir="ltr">
          <div>Is it possible to have a button other than the first one
            pre-selected?</div>
        </div>
      </blockquote>
      <p>Almost :-/  So, AFAIK, unfortunately no.<br>
        There is a
        CallScilabBridge.setMessageBoxDefaultSelectedButtons(id, k) java
        method (*)<br>
        that should set it, where k is the index of the preselected
        button.<br>
        But in the code it is apparently implemented only for
        x_choices()</p>
      <p>As well,<br>
        <br>
        <font face="monospace">messagebox("Have you seen this beautiful
          message", "info", ["Yes" "No"]);<br>
          jimport org.scilab.modules.gui.utils.UIElementMapper ;<br>
          m = UIElementMapper.getCorrespondingUIElement(1);<br>
          m.setDefaultSelectedButtons(1); // First is #0</font></p>
      <p>does nothing<br>
        <br>
        Samuel<br>
      </p>
      <p>(*)<br>
        jimport org.scilab.modules.gui.bridge.CallScilabBridge<br>
        jgetmethods(CallScilabBridge)<br>
        <br>
      </p>
    </div>
  </body>
</html>
["grafik.png" (image/png)]

_______________________________________________
users mailing list - users@lists.scilab.org
Click here to unsubscribe: <mailto:users-unsubscribe@lists.scilab.org>
http://lists.scilab.org/mailman/listinfo/users


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic