FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour EDIT MEMO
Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM
EDIT MEMO
Posted: 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

Marco Boschi
info@marcoboschi.it
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: EDIT MEMO
Posted: Wed Aug 07, 2024 12:42 PM
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: EDIT MEMO
Posted: Wed Aug 07, 2024 01:31 PM

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

Regards



G. N. Rao.

Hyderabad, India
Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM
Re: EDIT MEMO
Posted: Wed Aug 07, 2024 01:55 PM
karinha,
thank you
One of the two problem is solved in this way
Code (fw): Select all Collapse
 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 (fw): Select all Collapse
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
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: EDIT MEMO
Posted: Wed Aug 07, 2024 02:24 PM
// C:\FEH\SAMPLES\GETSEL.PRG
Code (fw): Select all Collapse
#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

Continue the discussion