by armando.lagunas » Thu Oct 08, 2015 1:56 pm
mira la clase MSGBAR, hay un metodo que hace lo que buscas, quizas des con el clavo.
ej:
- Code: Select all Expand view
METHOD KeybOn() CLASS TMsgBar
if ::oKeyNum == nil
// keep the ':=' below for XBase++ compatibility
::oKeyNum := TMsgItem():New( Self, "Num", ::GetWidth( "Num" ) + 12,,,, .t.,;
{ || KeyToggle( VK_NUMLOCK ), ::oKeyNum:Refresh() } )
::oKeyNum:lTimer = .t.
::oKeyNum:nClrDisabled = GetSysColor( COLOR_BTNSHADOW )
::oKeyNum:lActive = GetKeyToggle( VK_NUMLOCK )
::oKeyNum:bMsg = { || ::oKeyNum:lActive := GetKeyToggle( VK_NUMLOCK ), "Num" }
endif
if ::oKeyCaps == nil
// keep the ':=' below for XBase++ compatibility
::oKeyCaps := TMsgItem():New( Self, "Caps", ::GetWidth( "Caps" ) + 12,,,, .t.,;
{ || KeyToggle( VK_CAPITAL ), ::oKeyCaps:Refresh() } )
::oKeyCaps:lTimer = .t.
::oKeyCaps:nClrDisabled = GetSysColor( COLOR_BTNSHADOW )
::oKeyCaps:lActive = GetKeyToggle( VK_CAPITAL )
::oKeyCaps:bMsg = { || ::oKeyCaps:lActive := GetKeyToggle( VK_CAPITAL ), "Caps" }
endif
if ::oKeyIns == nil
// keep the ':=' below for XBase++ compatibility
::oKeyIns := TMsgItem():New( Self, "Ins", ::GetWidth( "Ins" ) + 12,,,, .t.,;
{ || KeyToggle( VK_INSERT ), ::oKeyIns:Refresh() } )
::oKeyIns:lTimer = .t.
::oKeyIns:nClrDisabled = GetSysColor( COLOR_BTNSHADOW )
::oKeyIns:lActive = GetKeyToggle( VK_INSERT )
::oKeyIns:bMsg = { || ::oKeyIns:lActive := GetKeyToggle( VK_INSERT ), "Ins" }
endif
::CheckTimer()
return nil
Saludos
SkyPe: armando.lagunas@hotmail.com
Mail: armando.lagunas@gmail.com