FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour ToolBar y TABSTOP
Posts: 298
Joined: Fri Oct 07, 2005 05:20 AM
ToolBar y TABSTOP
Posted: Fri Aug 03, 2007 05:12 AM

Saludos a todos :

Antonio :

Hay forma alguna de accesar a una toolbar y su contenido usando el Tabulador.?

Vikthor
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
ToolBar y TABSTOP
Posted: Fri Aug 03, 2007 06:55 AM

Viktor,

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

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 298
Joined: Fri Oct 07, 2005 05:20 AM
ToolBar y TABSTOP
Posted: Fri Aug 03, 2007 07: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
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.


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

#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 :

   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
Posts: 298
Joined: Fri Oct 07, 2005 05:20 AM
ToolBar y TABSTOP
Posted: Mon Aug 06, 2007 03:41 PM

Algún tip o sugerencia

:)

Vikthor
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
ToolBar y TABSTOP
Posted: Mon Aug 06, 2007 05: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

Continue the discussion