FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour How to invoke ACTION button in a GET with keyboard ?
Posts: 654
Joined: Fri Oct 21, 2005 05:54 AM
How to invoke ACTION button in a GET with keyboard ?
Posted: Fri Dec 19, 2008 01:03 PM
Hi Mr.Antonio,

Can you please suggest me a way out for this.

One more thing..

When I have used READONLY and ACTION clauses together in a GET
and if I press TAB the GET is not focused

Do you feel the following change is required in TGET Class New() Method?

::nStyle    = nOR( WS_CHILD, WS_VISIBLE,;
                      ES_AUTOHSCROLL,;
                      If( !lReadOnly .OR. bAction # nil, WS_TABSTOP, 0 ),; // CHANGED
                      If( lDesign, WS_CLIPSIBLINGS, 0 ),;
                      If( lSpinner, WS_VSCROLL, 0 ),;
                      If( lReadOnly, ES_READONLY, 0 ),;
                      If( lCenter, ES_CENTER, If( lRight, ES_RIGHT, ES_LEFT ) ) )
                   // If( lCenter .OR. lRight, ES_MULTILINE, 0 ),; Only needed for Win31


Thanks

- Ramesh Babu P

[/code]
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
How to invoke ACTION button in a GET with keyboard ?
Posted: Fri Dec 19, 2008 08:18 PM

Ramesh,

It would seem to me that if the GET is readonly, that any bAction should be ignored, so the current behavior is correct.

Why would you want to have the GET get focus when it is readonly?

Regards,
James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
How to invoke ACTION button in a GET with keyboard ?
Posted: Fri Dec 19, 2008 11:32 PM

Ramesh,

> Can you please suggest me a way out for this

What key should we use to fire the action ?

Enter is used to go to the next control. or should we change this behavior if an ACTION is defined ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
How to invoke ACTION button in a GET with keyboard ?
Posted: Fri Dec 19, 2008 11:32 PM

Ramesh,

> Can you please suggest me a way out for this

What key should we use to fire the action ?

Enter is used to go to the next control, or should we change this behavior if an ACTION is defined ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 654
Joined: Fri Oct 21, 2005 05:54 AM
How to invoke ACTION button in a GET with keyboard ?
Posted: Sat Dec 20, 2008 07:40 AM

Hello Mr.James and Mr.Antonio

Thank you very much for your attention.

My requirement is that I have a get attached with a ACTION button.

When the user click on the ACTION Button I am providing a browser to
the user to select multiple records and when he quits the browser I am updating the get with a string of numbers from the selected records. And my requirement is that the user should not enter anything other than selecting the data from the browser. I want the user to navigate between other controls with TAB key also.

More over I want to to invoke the ACTION clause with keyboard also.

I think I could explain my requirement.

Regards

  • Ramesh Babu P
Posts: 312
Joined: Sat Oct 08, 2005 09:12 AM
How to invoke ACTION button in a GET with keyboard ?
Posted: Sat Dec 20, 2008 10:04 AM

Ramesh,

why don't you use say objects instead of gets?
You can update the say objects according to the selected browser line.

Or did i misunderstand your question?

Regards,
Detlef

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
How to invoke ACTION button in a GET with keyboard ?
Posted: Sat Dec 20, 2008 10:19 AM

Ramesh,

> I want to to invoke the ACTION clause with keyboard also.

We need to decide what keystroke should we use for it.

Or maybe create a global setting for it, so it can be configured as desired.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 883
Joined: Tue Oct 11, 2005 11:57 AM
How to invoke ACTION button in a GET with keyboard ?
Posted: Sat Dec 20, 2008 02:51 PM

Ramesh
In Tget CLass add this lines, in this case F2 is the key to call the action.

METHOD KeyDown( nKey, nFlags ) CLASS TGet
local oThis:= self

...
...
case nKey == VK_F2 .and. ValType( ::bAction ) == "B"
Eval( oThis:bAction, oThis )
oThis:SetFocus()

Now... VK_F2 could be replaced with a GLOBAL parameter so it affects the whole program

Hope it helps.

From Chile
Adolfo

;-) Ji,ji,ji... buena la cosa... "all you need is code"

http://www.xdata.cl - Desarrollo Inteligente
----------
Asus TUF F15, 32GB Ram, 2 * 1 TB NVME M.2, GTX 1650
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
How to invoke ACTION button in a GET with keyboard ?
Posted: Sat Dec 20, 2008 06:46 PM

Ramesh,

>When the user click on the ACTION Button I am providing a browser to
the user to select multiple records and when he quits the browser I am updating the get with a string of numbers from the selected records.

I would not do it this way; I don't think this is a good interface design. Showing a string of numbers to the user is not very helpful--they are not able to see any meaningful information from the GET.

I would use two browses and provide Add and Remove buttons. One browse holds the selected records and the other shows all records that have not been selected. This way the user can see which records have been selected rather than just a string of numbers.

Also the way you are doing it with a user selecting multiple records from a browse, it is difficult to see which records are being selected, because right after you select one, you have to scroll it off the screen. With two browses the record gets moved to the "selected" browse, and remains visible.

Regards,
James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 130
Joined: Sat Oct 08, 2005 09:38 PM
Re: How to invoke ACTION button in a GET with keyboard ?
Posted: Mon Jan 05, 2009 05:03 PM
There is no need to a key to invoke the action.
If the user enters a wrong value which is not found in the databases, then the action automatically invoked.

   REDEFINE GET oKyadi VAR cKyadi ID 127 OF oDlg PICTURE '@!' BITMAP "BTN_FIND" UPDATE ;
       ACTION ( ChkShrKoy(@cKyadi), ;
                IF( (cAlias)->(DbSeek(cKyadi,.f.)), oNext:PostMsg(WM_RBUTTONDOWN), NIL), ;
                oDlg:UpDATE() ) ;
       VALID  ( IF( (cAlias)->(DbSeek(cKyadi,.f.)), oNext:PostMsg(WM_RBUTTONDOWN), Eval(oKyadi:bAction,oKyadi) ), ;
                oDlg:UpDATE(), ;
                .T.) ;

Regards,
Birol BETONCU
Birol Betoncu
birol.betoncu@gmail.com
Using Harbour, FWH 19.05, BCC7

Continue the discussion