FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Behavior of dialog elements and the ENTER key with FWH 11.12
Posts: 392
Joined: Tue Mar 10, 2009 11:54 AM
Behavior of dialog elements and the ENTER key with FWH 11.12
Posted: Thu Jan 12, 2012 10:05 AM
Hi to all,

I'm still not clear with the behavior of some dialog elements and what FWH users want.
Understanding that there is a standard Clipper and a standard windows behavior and they are different in some points:

Clipper shall function as follows:
- ENTER key: focus changes to next dialog element
- Entering an element with TAB or ENTER key: the text isn't selected automatically
- Hot key of a BUTTON: the action of the button has to be executed, not only setting the focus

Windows shall function as follows:
- ENTER key: executes the action of the standard button
- Entering an element with TAB or ENTER key: the text is selected automatically
- Hot key of a BUTTON: the action of the button has to be executed, not only setting the focus

Of course, it's quite possible that there are some other differences, I don't notice until now.

Also understanding, that now the Clipper behavior is active, but it don't funcion as expected in some points:
- Entering a combo box: all text is selected automatically
- Hot key of a BUTTON: sets only focus

In older versions of FWH, the behavior was more windows like, but also not in all points, e. g. see viewtopic.php?f=3&t=19181&p=107044.

Sample code for testing:
Code (fw): Select all Collapse
    #include "FiveWin.ch"

    function Main()

       local oDlg, nValue := 1, cTest := "Test", cTest2 := "Test2", cCombo := "combo"

       DEFINE DIALOG oDlg
       
       @ 1, 1 RADIO nValue ;
          ITEMS "&One", "&Two", "T&hree"

       @  1,  10 COMBOBOX cCombo ITEMS { "1", "2", "3" } SIZE 40, 120 STYLE CBS_DROPDOWN

       @ 2, 10 GET cTest SIZE 70, 10
       
       @ 3, 10 GET cTest2 SIZE 70, 10
       
       @ 3, 10 BUTTON "O&k" ACTION oDlg:End()

       ACTIVATE DIALOG oDlg CENTERED

    return NIL

Conclusions:
- Please adjust the Clipper behavior.
- Maybe it's possible to implement a switch to change from Clipper to Windows behavior, so the end user can choose :-)
- Make both behaviors as standard as possible.
Windows 11 Pro 22H2 22621.1848

Microsoft (R) Windows (R) Resource Compiler Version 10.0.10011.16384

Harbour 3.2.0dev (r2008190002)

FWH 23.10 x86
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Behavior of dialog elements and the ENTER key with FWH 11.12
Posted: Thu Jan 12, 2012 10:30 AM
frose wrote:- ENTER key: focus changes to next dialog element


Only if no button is defined as standard button.

frose wrote:- Entering an element with TAB or ENTER key: the text isn't selected automatically


It's a good choice for me. Anyway, it should be very simple to add a switch to select the desider behavior. We have to keep the backwards compatibility.

frose wrote:- Hot key of a BUTTON: the action of the button has to be executed, not only setting the focus


I don't understand. The current (and expected) behavior is setting the focus and execute the action of the button.

frose wrote:- Entering a combo box: all text is selected automatically


Yes, this incongruence should be fixed for me.

frose wrote:- Hot key of a BUTTON: sets only focus


No, it only executes the action, as it is expected.

EMG
Posts: 663
Joined: Mon Dec 05, 2005 11:22 PM
Re: Behavior of dialog elements and the ENTER key with FWH 11.12
Posted: Thu Jan 12, 2012 02:11 PM
frose wrote:- Entering an element with TAB or ENTER key: the text isn't selected automatically

In clipper the picture "@K" makes the first key erase the contents.
Shouldn't the windows version also do the same thing?
And if it is going to erase the contents shouldn't it be selected so the user will know that the next key will erase it?
Posts: 392
Joined: Tue Mar 10, 2009 11:54 AM
Re: Behavior of dialog elements and the ENTER key with FWH 11.12
Posted: Thu Jan 12, 2012 02:39 PM
frose wrote:- ENTER key: focus changes to next dialog element

Enrico wrote: Only if no button is defined as standard button.

It works with the 'DEFAULT' clause, but not when the focus is in the combo box!

frose wrote:- Entering an element with TAB or ENTER key: the text isn't selected automatically

Enrico wrote: It's a good choice for me. Anyway, it should be very simple to add a switch to select the desider behavior. We have to keep the backwards compatibility.

Ok, understanding the need for backwards compatibility, so please, implement this switch for the users who don't need Clipper compatibility.

frose wrote:- Hot key of a BUTTON: the action of the button has to be executed, not only setting the focus

Enrico wrote: I don't understand. The current (and expected) behavior is setting the focus and execute the action of the button.

frose wrote:- Hot key of a BUTTON: sets only focus
Enrico wrote: No, it only executes the action, as it is expected.

The behavior of the hot key changed, see here: viewtopic.php?f=3&t=23271#p124892
Windows 11 Pro 22H2 22621.1848

Microsoft (R) Windows (R) Resource Compiler Version 10.0.10011.16384

Harbour 3.2.0dev (r2008190002)

FWH 23.10 x86
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Behavior of dialog elements and the ENTER key with FWH 11.12
Posted: Thu Jan 12, 2012 02:47 PM
frose wrote:It works with the 'DEFAULT' clause, but not when the focus is in the combo box!


Ok, the combobox behavior definitely needs to be fixed.

frose wrote:Ok, understanding the need for backwards compatibility, so please, implement this switch for the users who don't need Clipper compatibility.


Ok. Let's wait for what Antonio has to say about this subject.

frose wrote:The behavior of the hot key changed, see here: viewtopic.php?f=3&t=23271#p124892


Ok, I'm still using FWH 11.11 because of the gradient problem.

EMG
Posts: 392
Joined: Tue Mar 10, 2009 11:54 AM
Re: Behavior of dialog elements and the ENTER key with FWH 11.12
Posted: Thu Jan 12, 2012 02:48 PM
frose wrote:- Entering an element with TAB or ENTER key: the text isn't selected automatically
Gale FORd wrote: In clipper the picture "@K" makes the first key erase the contents.
Shouldn't the windows version also do the same thing?

Yes!
Gale FORd wrote: And if it is going to erase the contents shouldn't it be selected so the user will know that the next key will erase it?

Yes!

So the switch exist already, the name is "@K", only the content have to be selected when entering :-)
Windows 11 Pro 22H2 22621.1848

Microsoft (R) Windows (R) Resource Compiler Version 10.0.10011.16384

Harbour 3.2.0dev (r2008190002)

FWH 23.10 x86
Posts: 663
Joined: Mon Dec 05, 2005 11:22 PM
Re: Behavior of dialog elements and the ENTER key with FWH 11.12
Posted: Thu Jan 12, 2012 03:22 PM

The first key does erase the text if picture "@K" is used but it does not select all text so the user can know.
I had to modify my tget so that selectall() is used when it has picture "@K".

Posts: 392
Joined: Tue Mar 10, 2009 11:54 AM
Re: Behavior of dialog elements and the ENTER key with FWH 11.12
Posted: Thu Jan 12, 2012 04:10 PM

Gale,

thank you for the "@K".
I think the best way is, if Antonio changes the TGet class for FWH 12.01, calling the SelectAll() method when entering the get field.

Windows 11 Pro 22H2 22621.1848

Microsoft (R) Windows (R) Resource Compiler Version 10.0.10011.16384

Harbour 3.2.0dev (r2008190002)

FWH 23.10 x86
Posts: 392
Joined: Tue Mar 10, 2009 11:54 AM
Re: Behavior of dialog elements and the ENTER key with FWH 11.12
Posted: Mon Jan 30, 2012 11:59 AM

Antonio,

please change the behavior of the COMBOBOX, when the ENTER key is clicked: executes the action of the standard button!

IMHO the text of the GET shall be selected automatically when entering (like the COMBOBOX already do), maybe depending of the PICTURE clause!?

In any case, make both, COMBOBOX and GET acting consistently :)

Windows 11 Pro 22H2 22621.1848

Microsoft (R) Windows (R) Resource Compiler Version 10.0.10011.16384

Harbour 3.2.0dev (r2008190002)

FWH 23.10 x86
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Behavior of dialog elements and the ENTER key with FWH 11.12
Posted: Mon Jan 30, 2012 12:25 PM

Frank,

Is it an editable combobox ?

Windows behavior is to fire the default pushbutton action. What we are doing is MsDos backwards compatibility... :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 392
Joined: Tue Mar 10, 2009 11:54 AM
Re: Behavior of dialog elements and the ENTER key with FWH 11.12
Posted: Mon Jan 30, 2012 01:00 PM
Antonio,

yes!

Please test the COMBOBOX and the GET within this sample:
Code (fw): Select all Collapse
FUNCTION main()

   LOCAL oWnd
   LOCAL oDlg
   LOCAL oCombo
   LOCAL cCombo := "test"
   LOCAL oGet
   LOCAL cGet := "test"
   LOCAL nValue := 1

   DEFINE DIALOG oDlg TITLE "TCombobox DROPDOWN style and VK_RETURN" FROM 10, 10 TO 25, 75

   @  1,  1 COMBOBOX oCombo VAR cCombo ITEMS { "1", "2", "3" } SIZE 40, 120 STYLE CBS_DROPDOWN PICTURE "@K"

   @  2,  1 GET oGet VAR cGet PICTURE "@K"
   
   @  1, 10 RADIO nValue ITEMS "&One", "&Two", "T&hree"
   
   @  5,  1 BUTTON oBtn PROMPT "&Ok" Default ACTION( oDlg:End() )
   
   @  5, 10 BUTTON oBtn PROMPT "&Cancel" ACTION( oDlg:End() )

   ACTIVATE DIALOG oDlg CENTERED

RETURN NIL

The default pushbutton action doesn't execute, if you click ENTER in the COMBOBOX, but it has to!
When entering the COMBOBOX, the text 'test' is selected automatically, IMHO this behavior should be standard also for GET's, especially if the PICTURE clause '@K' is set.
Windows 11 Pro 22H2 22621.1848

Microsoft (R) Windows (R) Resource Compiler Version 10.0.10011.16384

Harbour 3.2.0dev (r2008190002)

FWH 23.10 x86

Continue the discussion