get memo ->activate a button

get memo ->activate a button

Postby Silvio.Falconi » Tue Jan 28, 2020 4: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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7075
Joined: Thu Oct 18, 2012 7:17 pm

Re: get memo ->activate a button

Postby karinha » Tue Jan 28, 2020 7:11 pm

See this example and modify it for your case.

Code: Select all  Expand view  RUN

   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
User avatar
karinha
 
Posts: 7835
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: get memo ->activate a button

Postby Silvio.Falconi » Wed Jan 29, 2020 7: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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7075
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 95 guests