FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour get memo ->activate a button
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
get memo ->activate a button
Posted: Tue Jan 28, 2020 04:33 PM

I use a get memo to read a txt file and I have a button to exit

I wish the final user read all file.txt and when the cursor is on last row og the get then the button ( to go next) is enable()

how I can make it ?

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: get memo ->activate a button
Posted: Tue Jan 28, 2020 07:11 PM
See this example and modify it for your case.

Code (fw): Select all Collapse
   REDEFINE GET oGet[17] VAR wTEXTO MULTILINE ID 217 OF oDlg  ;
            COLOR CLR_BLUE, CLR_WHITE UPDATE FONT oFont      ;
            WHEN( lLigaCombo )                                ;
            ON CHANGE( SB_LimitText( oGet[17], oSay, oTransmite ) ) // By AleSB

FUNCTION SB_LimitText( oGet, oSay, oTransmite )

   ///////////////////////////////////////////////////////////////////////////
   // Autor..........: Peguei no Forum FiveWin Brasil                       //
   // Modificaçoes...: Ale SB - Soft Camus                                  //
   // Descricao......: Restringe o Tamanho de um Texto.                     //
   // Parametros ==>                                                        //
   //  - oGet  : oBjeto Get.                                                //
   //  - nSize : Tamanho que deve ter o Texto.                              //
   // Dependencias ==>                                                      //
   // Retorno ==> nil                                                       //
   ///////////////////////////////////////////////////////////////////////////

   LOCAL nTam, nSize
  
   DEFAULT nSize := 999  // maximo ‚ 1000 caracteres

   nTam := LEN( ALLTRIM( oGet:cText ) )

   IF nTam > nSize

      oGet:cText := Substr(oGet:cText, 1, nTam-1)

      RETURN( .F. )

   ENDIF

   oSay:VarPut( Strzero( nTam, 3, 0 ) )
   oSay:Refresh()

   IF nTam <= 14 // caracteres

      lLigaBotao := .F.

      oTransmite:Disable()
      oTransmite:Refresh()

   ELSE

      lLigaBotao := .T.

      oTransmite:Enable()
      oTransmite:Refresh()

   ENDIF

RETURN( .T. )
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: get memo -&gt;activate a button
Posted: Wed Jan 29, 2020 07:18 PM

Thanks I'll try It
I saw on web on a form you write and there Is a text where Is show ed the number characters you can use of you write with a Number of characters up the the limit the form disabled the button

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com

Continue the discussion