EDIT MEMO

Post Reply
User avatar
MarcoBoschi
Posts: 1071
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy
Contact:

EDIT MEMO

Post by MarcoBoschi »

Hi to all,
why in this memo

REDEFINE GET oGet VAR cModifica ID 101 OF oDlg MEMO

I found selected all text?
Second question is

I desire than if I perform a double click in a line all the current line has to be selected not only some characters (if you see notepad has the same behavior)


For instance

Marco!Boschi!
<Marco!>Boschi<$%



bye bye to all
Marco Boschi
info@marcoboschi.it
User avatar
karinha
Posts: 7932
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Been thanked: 3 times
Contact:

Re: EDIT MEMO

Post by karinha »

Try

Code: Select all | Expand

   REDEFINE GET oGet VAR cModifica ID 101 OF oDlg MULTILINE
 
https://forums.fivetechsupport.com/view ... =3&t=34507

https://forums.fivetechsupport.com/view ... 76#p270354

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
nageswaragunupudi
Posts: 10721
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 8 times
Contact:

Re: EDIT MEMO

Post by nageswaragunupudi »

MEMO or MULTILINE or TEXT mean exactly the same thing. No difference.
Regards

G. N. Rao.
Hyderabad, India
User avatar
MarcoBoschi
Posts: 1071
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy
Contact:

Re: EDIT MEMO

Post by MarcoBoschi »

karinha,
thank you
One of the two problem is solved in this way

Code: Select all | Expand

 oGet:bGotFocus = { || oGet:SetSel( 0, 0 ),;
                            oGet:Goto( oGet:GetLineCount() ),;
                           __Keyboard( Chr( VK_END ) ) }

but double click that select the entire line no
with this function if the get is not a MEMO works fine

written by emag software

Code: Select all | Expand

STATIC FUNCTION DOPPIOCLICK( oGet )

    LOCAL cVal := oGet:GetText()

    LOCAL nSta := 0

    LOCAL i
    cVal := ALLTRIM( cVal )

    FOR i = 1 TO LEN( cVal )
        IF !EMPTY( SUBSTR( cVal, i, 1 ) )
            nSta = i - 1
            EXIT
        ENDIF
    NEXT

    oGet:PostMsg( EM_SETSEL, nSta, nSta + LEN( ALLTRIM( cVal ) ) )
    RETURN NIL
 
Marco Boschi
info@marcoboschi.it
User avatar
karinha
Posts: 7932
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Been thanked: 3 times
Contact:

Re: EDIT MEMO

Post by karinha »

// C:\FEH\SAMPLES\GETSEL.PRG

Code: Select all | Expand

#include "FiveWin.ch"

#define EM_SETSEL 0x00B1

PROCEDURE MAIN

   LOCAL oDlg, oText_1, oBtn, cFilter := "SETSEL MULTILINE" + Space( 10 )
   LOCAL oTimer

   DEFINE DIALOG oDlg FROM 0, 0 TO 150, 200 PIXEL TITLE "Test Snap2Ctrl"

   @ 010, 010 GET oText_1 VAR cFilter SIZE 160, 30 PIXEL OF oDlg MULTILINE

   oText_1:PostMsg( EM_SETSEL, 0, Len( Trim( cFilter ) ) )

   @ 050, 010 BUTTON oBtn PROMPT "&OK" SIZE 160, 50 PIXEL ;
      ACTION( MsgInfo( cFilter ), oDlg:End() ) OF oDlg

   ACTIVATE DIALOG oDlg CENTER

RETURN NIL
 
https://forums.fivetechsupport.com/view ... =3&t=42467

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Post Reply