Help with helpdlg

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Help with helpdlg

Rik-4
As a matter of UI design, I think the GUI dialogs should make one of their
buttons the default button.  Could someone test whether that is the case
with Matlab?

--- Code ---
h = helpdlg ('foobar')
--- End Code ---

Is the single 'OK' button selected by default?  If so, one should be able
to just press <RETURN> and have the dialog box go away.

--Rik

Reply | Threaded
Open this post in threaded view
|

Re: Help with helpdlg

Ian McCallion
On 1 Nov 2018, at 20:05, Rik <[hidden email]> wrote:

As a matter of UI design, I think the GUI dialogs should make one of their

buttons the default button.  Could someone test whether that is the case

with Matlab?

--- Code ---

h = helpdlg ('foobar')

--- End Code ---

Is the single 'OK' button selected by default?  If so, one should be able

to just press <RETURN> and have the dialog box go away.

--Rik


I can't help with matlab, but ok is selected by default in octave on windows.

Cheers... Ian
Reply | Threaded
Open this post in threaded view
|

Re: Help with helpdlg

Rik-4
On 11/01/2018 12:24 PM, Ian McCallion wrote:

> On 1 Nov 2018, at 20:05, Rik <[hidden email]> wrote:
>
> As a matter of UI design, I think the GUI dialogs should make one of their
>
> buttons the default button.  Could someone test whether that is the case
>
> with Matlab?
>
> --- Code ---
>
> h = helpdlg ('foobar')
>
> --- End Code ---
>
> Is the single 'OK' button selected by default?  If so, one should be able
>
> to just press <RETURN> and have the dialog box go away.
>
> --Rik
>
>
> I can't help with matlab, but ok is selected by default in octave on windows.
>
> Cheers... Ian

Interesting, I'm running Linux with KDE as my window manager and it is not
selected by default.  Maybe there is something different about my machine,
although listdlg correctly sets "OK" as the default button.

--Rik

Reply | Threaded
Open this post in threaded view
|

Re: Help with helpdlg

Mike Miller-4
On Thu, Nov 01, 2018 at 12:28:07 -0700, Rik wrote:
> Interesting, I'm running Linux with KDE as my window manager and it is not
> selected by default.  Maybe there is something different about my machine,
> although listdlg correctly sets "OK" as the default button.

This is probably a side effect of helpdlg now being a graphics figure
object on the default branch instead of just a Qt dialog. I suspect
Ian's result was with Octave 4.4. I see the same difference on Debian
between 4.4 and 5.0.

--
mike

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Help with helpdlg

Rik-4
In reply to this post by Rik-4
On 11/02/2018 09:00 AM, [hidden email] wrote:
Subject:
Re: Help with helpdlg
From:
Mike Miller [hidden email]
Date:
11/01/2018 12:36 PM
To:
[hidden email]
List-Post:
[hidden email]
Precedence:
list
MIME-Version:
1.0
References:
<MTAwMDAzMS5ub21hZA.1541099104@quikprotect> [hidden email] <MTAwMDA0My5ub21hZA.1541100494@quikprotect>
In-Reply-To:
<MTAwMDA0My5ub21hZA.1541100494@quikprotect>
Message-ID:
[hidden email]
Content-Type:
multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="5vNYLRcllDrimb99"
Message:
2

On Thu, Nov 01, 2018 at 12:28:07 -0700, Rik wrote:
Interesting, I'm running Linux with KDE as my window manager and it is not
selected by default.  Maybe there is something different about my machine,
although listdlg correctly sets "OK" as the default button.
This is probably a side effect of helpdlg now being a graphics figure
object on the default branch instead of just a Qt dialog. I suspect
Ian's result was with Octave 4.4. I see the same difference on Debian
between 4.4 and 5.0.
That makes sense.  Most of the *dlg functions now re-route to msgbox.m and msgbox creates the "OK" button as a uicontrol object.  I tried Matlab syntax to set the focus on the newly created ui object, but ran in to this:

uicontrol (hu)
warning: uicontrol: focusing not implemented yet
warning: called from
    uicontrol at line 110 column 5

Just briefly looking at the Qt docs shows that there is a setFocus member function for QWidgets.  The path to implementing this is probably straightforward, but also long.  One would need to create an interface in octave_link, call the new function from uicontrol.m, and implement the actual behavior in libgui/src/octave-link.cc.  I'll file a bug report.

--Rik