|
From: Itamar M. L. J. L. <ita...@gm...> - 2014-12-29 03:26:01
|
Hi!
Report from Alexandre Simões (asimoes)
> * include/guilib.ch
> * source/winapi/hrichedit.prg
> * ON OTHER MESSAGES clause added to richedit for 2.17 compatibility
This example demonstrate the problem, on other messages not capture key.
Another thing is the hwg_WriteStatus, not working, does not change any value in
the status bar. Not in this situation because Msg is not responding, but in
others.
#include "hwgui.ch"
Function main
LOCAL oDlg,cText:=""
INIT DIALOG oDlg AT 100,100 SIZE 400,200
@ 10,010 RichEdit oEdit TEXT cText SIZE 200,100 OF oDlg ;
STYLE WS_HSCROLL+WS_VSCROLL+ES_LEFT+ES_MULTILINE+ES_READONLY ;
ON OTHERMESSAGES {|This,m,wp,lp| richeditProc( this, m,wp, lp )
}
//oEdit:bOther:={|This,m,wp,lp| richeditProc( this, m,wp, lp )
}
oDlg:Activate()
STATIC FUNCTION RichEditProc( oEdit, Msg, wParam, lParam )
LOCAL nPos, nPos1, nPos2, nVirtCode
//nVirtCode := wParam
//IF Msg == WM_KEYUP
//ENDIF
IF Msg == WM_KEYDOWN
hwg_msginfo("")
nVirtCode := wParam
IF nVirtCode == VK_F3
//Texto_Encontrado(oEdit)
ENDIF
nPos :=hwg_SendMessage( oEdit:Handle, EM_GETSEL, 0, 0 )
nPos1 :=hwg_Loword( nPos ) + 1
nPos2 :=hwg_Hiword( nPos ) + 1
nLinha :=hwg_SendMessage(oEdit:Handle, EM_LINEFROMCHAR, -1, 0) + 1
nColuna:=nPos1 - hwg_SendMessage( oEdit:Handle, EM_LINEINDEX, -1, 0 )
//
hwg_WriteStatus( oDlg,2,'Lin: '+LTrim(Str(nLinha,5)))
hwg_WriteStatus( oDlg,3,'Col: '+LTrim(Str(nColuna,3)))
oEdit:Refresh()
ENDIF
RETURN -1
Best regards,
Itamar M. Lins Jr.
|