EDIT MEMO

EDIT MEMO

Postby MarcoBoschi » Wed Aug 07, 2024 11:43 am

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
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: EDIT MEMO

Postby karinha » Wed Aug 07, 2024 12:42 pm

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7831
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: EDIT MEMO

Postby nageswaragunupudi » Wed Aug 07, 2024 1:31 pm

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

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10646
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: EDIT MEMO

Postby MarcoBoschi » Wed Aug 07, 2024 1:55 pm

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

Code: Select all  Expand view  RUN
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 view  RUN
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
 
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: EDIT MEMO

Postby karinha » Wed Aug 07, 2024 2:24 pm

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

Code: Select all  Expand view  RUN

#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/viewtopic.php?f=3&t=42467

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7831
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 38 guests