|
From: Itamar M. L. J. L. <ita...@gm...> - 2014-12-29 23:48:45
|
Hi!
This example show the problem, with Add Status works fine!
#include "hwgui.ch"
#include "hwg_extctrl.ch"
Function main
LOCAL cText:="", oDlg
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_WANTRETURN ;
ON OTHERMESSAGES {|This,m,wp,lp| richeditProc( this, m,wp, lp,
oDlg) }
//Add status to oDlg parts 100,100,0
ADD STATUSEX oStatus TO oDlg PARTS 100,100,0 //FONT oFont3 ON INIT
{|This| Status(This,aTexto) }
oDlg:Activate()
STATIC FUNCTION RichEditProc( oEdit, Msg, wParam, lParam, oDlg )
LOCAL nPos, nPos1, nPos2, nVirtCode
IF Msg == WM_KEYDOWN
nVirtCode := wParam
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.
|