How to invoke ACTION button in a GET with keyboard ?

How to invoke ACTION button in a GET with keyboard ?

Postby RAMESHBABU » Fri Dec 19, 2008 1: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?

Code: Select all  Expand view
::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]
User avatar
RAMESHBABU
 
Posts: 624
Joined: Fri Oct 21, 2005 5:54 am
Location: Secunderabad (T.S), India

Postby James Bott » Fri Dec 19, 2008 8: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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby Antonio Linares » 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
User avatar
Antonio Linares
Site Admin
 
Posts: 42080
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Antonio Linares » 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
User avatar
Antonio Linares
Site Admin
 
Posts: 42080
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby RAMESHBABU » Sat Dec 20, 2008 7: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
User avatar
RAMESHBABU
 
Posts: 624
Joined: Fri Oct 21, 2005 5:54 am
Location: Secunderabad (T.S), India

Postby Detlef Hoefner » 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
User avatar
Detlef Hoefner
 
Posts: 312
Joined: Sat Oct 08, 2005 9:12 am
Location: Germany

Postby Antonio Linares » 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
User avatar
Antonio Linares
Site Admin
 
Posts: 42080
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Adolfo » Sat Dec 20, 2008 2: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
User avatar
Adolfo
 
Posts: 860
Joined: Tue Oct 11, 2005 11:57 am
Location: Chile

Postby James Bott » Sat Dec 20, 2008 6: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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: How to invoke ACTION button in a GET with keyboard ?

Postby betoncu » Mon Jan 05, 2009 5: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.

Code: Select all  Expand view
   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
User avatar
betoncu
 
Posts: 126
Joined: Sat Oct 08, 2005 9:38 pm
Location: Cyprus (North)


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 99 guests