Accelerator keys for buttons ? (SOLVED)

Accelerator keys for buttons ? (SOLVED)

Postby HunterEC » Wed Nov 26, 2008 8:21 am

Can a button be activated via a keyboard shortcut instead via mouse ? For example: Alt-N (next). Thank you.
Last edited by HunterEC on Mon Dec 01, 2008 4:48 pm, edited 1 time in total.
HunterEC
 
Posts: 723
Joined: Tue Sep 04, 2007 8:45 am

Postby RAMESHBABU » Wed Nov 26, 2008 8:51 am

Hi,

If you are not talking about the buttons used in the Dialogs, Yes you can
use '&' before the character which you want to use with Alt combination
as under.

Code: Select all  Expand view

Through Code :

@ 15,15  BUTTON "&Next" SIZE 35, 12 ;
              ACTION MsgInfo( "Any action here!" ) DEFAULT

or

Through Resources :

REDEFINE BUTTON PROMPT "&Next" ID 120 OF oDlg
               ACTION oPags:GoPrev()



But you can't use keyboard for the buttons used in the toolbar. You have
to use mouse to select them.

Regards,

- Ramesh Babu P


[/code]
User avatar
RAMESHBABU
 
Posts: 624
Joined: Fri Oct 21, 2005 5:54 am
Location: Secunderabad (T.S), India

Postby HunterEC » Wed Nov 26, 2008 4:00 pm

Rameshbabu:

Thank you for the tip, but I need it for a dialog button.
HunterEC
 
Posts: 723
Joined: Tue Sep 04, 2007 8:45 am

Postby RAMESHBABU » Sun Nov 30, 2008 3:56 am

Hi,

Code: Select all  Expand view
>>but I need it for a dialog button.


I did not understand what you mean. Can you pelease show me the
code.

Regards,

- Ramesh Babu P
User avatar
RAMESHBABU
 
Posts: 624
Joined: Fri Oct 21, 2005 5:54 am
Location: Secunderabad (T.S), India

Postby driessen » Sun Nov 30, 2008 10:12 am

Hi,

To my opinion you can only use keyboard shortcuts in button if you are using plain text in the button (e.g. "&Next").

If you are using bitmaps into your buttons, you can only use specials keys (function keys, insert, delete, etc.) to be connected to your button.

You can do this by using :
Code: Select all  Expand view
SET KEY VK_NEXT TO Your_Function".

Good luck.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
User avatar
driessen
 
Posts: 1422
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Postby HunterEC » Mon Dec 01, 2008 5:15 am

Thank you guys, problem solved with the &. 8)
HunterEC
 
Posts: 723
Joined: Tue Sep 04, 2007 8:45 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 98 guests