show line number in memo edit

show line number in memo edit

Postby Nop » Fri Jan 12, 2007 1:31 pm

hi, i need show line and columm with an memoedit, i already make this in format get, but in memo normal i dont know, someone can help me?
User avatar
Nop
 
Posts: 107
Joined: Tue Apr 11, 2006 4:36 pm
Location: Uberaba/Brazil

Re: show line number in memo edit

Postby Enrico Maria Giordano » Fri Jan 12, 2007 2:40 pm

Nop wrote:hi, i need show line and columm with an memoedit, i already make this in format get, but in memo normal i dont know, someone can help me?


Try

Code: Select all  Expand view
oGet:GetRow()
oGet:GetCol()


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Nop » Fri Jan 12, 2007 3:13 pm

Enrico, thanks, in format use i use:

oFGet:bLocate := {| nRow, nCol | oMsgItem:SetText( "Lin: " + Str( nRow, 4 ) + " " + "Col: " + Str( nCol, 4 ) ) }

this is can adapted to memo get? thanks
User avatar
Nop
 
Posts: 107
Joined: Tue Apr 11, 2006 4:36 pm
Location: Uberaba/Brazil

Postby Enrico Maria Giordano » Fri Jan 12, 2007 3:35 pm

Nop wrote:Enrico, thanks, in format use i use:

oFGet:bLocate := {| nRow, nCol | oMsgItem:SetText( "Lin: " + Str( nRow, 4 ) + " " + "Col: " + Str( nCol, 4 ) ) }

this is can adapted to memo get? thanks


What is locate event?

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Nop » Fri Jan 12, 2007 3:43 pm

i dont know, i see in a sample of format get, i need an way to show line , and columm when user movimente the cursor in memo. like an notepad. thanks again
User avatar
Nop
 
Posts: 107
Joined: Tue Apr 11, 2006 4:36 pm
Location: Uberaba/Brazil

Postby Nop » Fri Jan 12, 2007 3:45 pm

or maybe, use richedit in memofields, this is possible? i need like an notepad im memo files, showing the line and columm of cursor. thanks
User avatar
Nop
 
Posts: 107
Joined: Tue Apr 11, 2006 4:36 pm
Location: Uberaba/Brazil

Postby Enrico Maria Giordano » Fri Jan 12, 2007 4:53 pm

This is a sample but it is not working properly. Antonio?

Code: Select all  Expand view
#include "Fivewin.ch"


FUNCTION MAIN()

    LOCAL oDlg

    LOCAL oGet, cVar := "This is a test"

    LOCAL oRow, oCol

    DEFINE DIALOG oDlg;
           SIZE 400, 400

    @ 0, 0 GET oGet VAR cVar MEMO;
           SIZE 100, 100

    oGet:bKeyDown = { || ShowRowPos( oGet, oRow, oCol ) }

    @ 10, 0 SAY oRow PROMPT "nRow = " + LTrim( Str( oGet:GetRow() ) )
    @ 11, 0 SAY oCol PROMPT "nCol = " + LTrim( Str( oGet:GetCol() ) )

    oDlg:bStart = { || oGet:SetPos( 0 ) }

    ACTIVATE DIALOG oDlg;
             CENTER

    RETURN NIL


STATIC FUNCTION SHOWROWPOS( oGet, oRow, oCol )

    oRow:SetText( "nRow = " + LTrim( Str( oGet:GetRow() ) ) )
    oCol:SetText( "nCol = " + LTrim( Str( oGet:GetCol() ) ) )

    RETURN NIL


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Nop » Fri Jan 12, 2007 10:05 pm

Enrico, this is my problem... dont work...
User avatar
Nop
 
Posts: 107
Joined: Tue Apr 11, 2006 4:36 pm
Location: Uberaba/Brazil

Postby Enrico Maria Giordano » Fri Jan 12, 2007 10:43 pm

Nop wrote:Enrico, this is my problem... dont work...


Did you try my sample? It works... almost. :)

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 84 guests

cron