ToolBar y TABSTOP

ToolBar y TABSTOP

Postby Vikthor » Fri Aug 03, 2007 5:12 am

Saludos a todos :

Antonio :

Hay forma alguna de accesar a una toolbar y su contenido usando el Tabulador.?
Vikthor
User avatar
Vikthor
 
Posts: 271
Joined: Fri Oct 07, 2005 5:20 am
Location: México

Postby Antonio Linares » Fri Aug 03, 2007 6:55 am

Viktor,

Prueba a usar el estilo WS_TABSTOP al crearla. Modifica la clase.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41948
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Vikthor » Fri Aug 03, 2007 7:33 am

Antonio Linares wrote:Viktor,

Prueba a usar el estilo WS_TABSTOP al crearla. Modifica la clase.


Antonio :

Gracias por responder, lo que me indicas ya lo había hecho y no resultó.

Revisando el msdn , creo que es mejor tener el acceso usando los acceleradores del control.

TB_MAPACCELERATOR
Code: Select all  Expand view
TB_MAPACCELERATOR
    wParam = (WPARAM)(TCHAR) chAccel;
    lParam = (LPARAM)(LPUINT) pIDBtn;

Maps an accelerator character to a toolbar button.

Returns nonzero if successful, or zero otherwise.
chAccel
Accelerator character to be mapped. This character is the same character that is underlined in the button's text.
pIDBtn
Address of a UINT that receives the command identifier of the button that corresponds to the accelerator specified in cchAccel.


Code: Select all  Expand view
lResult = SendMessage(      // returns LRESULT in lResult
    (HWND) hWndControl,      // handle to destination control
     (UINT) TB_MAPACCELERATOR,      // message ID
     (WPARAM) wParam,      // = (WPARAM) (TCHAR) chAccel;
    (LPARAM) lParam      // = (LPARAM) (LPUINT) pIDBtn;
);





Agregue este método a la clase

Code: Select all  Expand view

#define TB_MAPACCELERATOR         1102

METHOD AccButton( nVirtKey , nButton ) CLASS TToolBar    // Vikthor

   SendMessage( ::hWnd , TB_MAPACCELERATOR , nVirtKey , nButton - 1 )

return nil


y lo llamo de la siguiente forma en mi programa :

Code: Select all  Expand view
   oToolBar:AccButton(  Asc( "N" ) , 1 )


Pero al correr las modificaciones se me cuelga el exe.

Este es el link de referencia
http://msdn2.microsoft.com/en-us/library/ms650875.aspx

Alguna sugerencia ?
Vikthor
User avatar
Vikthor
 
Posts: 271
Joined: Fri Oct 07, 2005 5:20 am
Location: México

Postby Vikthor » Mon Aug 06, 2007 3:41 pm

:) Algún tip o sugerencia
Vikthor
User avatar
Vikthor
 
Posts: 271
Joined: Fri Oct 07, 2005 5:20 am
Location: México

Postby Antonio Linares » Mon Aug 06, 2007 5:14 pm

Vikthor,

El ultimo parámetro parece distinto a como lo has declarado:

>
pIDBtn
[out] Pointer to a UINT. On return, if successful, this parameter will hold the id of the button that has chAccel as its accelerator character.
>

Ha de ser el puntero a un número, y contendrá el valor del botón, no el número en si.

El mensaje es para preguntar un valor, no para asignarlo
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41948
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 22 guests