Scrollbar of TMultiGet

Scrollbar of TMultiGet

Postby Natter » Thu Mar 30, 2023 7:23 pm

Hi,

There is a TMultiGet control with a vertical scrollbar (initially the scrollbar is disable).
I enter some data into Get and as soon as they go outside the window of this Get, the scrollbar becomes enable.
How can I find out the status of this scrollbar ?
Natter
 
Posts: 1222
Joined: Mon May 14, 2007 9:49 am

Re: Scrollbar of TMultiGet

Postby Antonio Linares » Fri Mar 31, 2023 9:52 am

Dear Yuri,

> How can I find out the status of this scrollbar ?

Do you mean if it is enabled or disabled ?

Please provide a self contained small PRG to test, thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42117
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Scrollbar of TMultiGet

Postby Natter » Fri Mar 31, 2023 10:45 am

Code: Select all  Expand view  RUN
#include "FiveWin.ch"

function Main()
local cRes := ""
local oFont, oGet
private oDlg

  DEFINE FONT oFont NAME "Ms Sans Serif" SIZE 0, -21

  DEFINE DIALOG oDlg SIZE 225, 120 TITLE "Example" FONT oFont

  @ 0.1, 0.5 GET oGet VAR cRes OF oDlg ;
         MULTILINE  SIZE 105, 45  COLOR CLR_BLUE, CLR_WHITE

  ACTIVATE DIALOG oDlg CENTER VALID ( oFont:End(), .T.)
return NIL
Natter
 
Posts: 1222
Joined: Mon May 14, 2007 9:49 am

Re: Scrollbar of TMultiGet

Postby karinha » Fri Mar 31, 2023 1:25 pm

I didn't understand. What purpose?

No entendí. ¿Que propósito?

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

Re: Scrollbar of TMultiGet

Postby Natter » Fri Mar 31, 2023 6:47 pm

I didn't understand. What purpose?


This is necessary to understand that the text is not fully visible in MultiGet control.
Natter
 
Posts: 1222
Joined: Mon May 14, 2007 9:49 am

Re: Scrollbar of TMultiGet

Postby karinha » Sat Apr 01, 2023 2:51 pm

How about putting a text counter?

¿Qué tal poner un contador de texto?

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

   // oMemo:bChange   := { | o | if( Len( o:GetText() ) > 500, MsgInfo("longitud maxima excedida","Atencion"), )
   // oGet[17]:bChange := { | o | if( Len( o:GetText() ) > 20, MsgInfo("longitud maxima excedida","Atencion"), )

   // se mudar o foco ou perder o foco?
   /*
   oGet[17]:bChange = { || lCambiado := .T. }

   //oGet[17]:bLostFocus := {|| If(lCambiado, Graba(), nil) }
   oGet[17]:bLostFocus := {|| If(lCambiado, MsgInfo("longitud maxima excedida","Atencion"), nil) }
   */


   // http://forums.fivetechsupport.com/viewt ... =3&t=34507

   /*
   oGet[17]:bGotFocus = { || oGet[17]:SetSel( 0, 0 ),;
                          oGet[17]:Goto( oGet[17]:GetLineCount() ),;
                          __Keyboard( Chr( VK_END ) ) }
   */

   oGet[17]:bGotFocus = { || oGet[17]:SetSel( 0, 0 ),;
                             oGet[17]:Goto( oGet[17]:GetLineCount() ),;
                             __Keyboard( Chr( VK_HOME ) ) }

   //oGet[17]:bGotFocus = { || oGet[17]:SetSel( 0, 0 ) }

   //oGet[17]:SETPOS(0)


// FUNCAO PARA LIMITAR O TEXTO DA CARTA...
//FUNCTION SB_LimitText( oGet, oSay, nSize )
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

      MsgInfo( "A Mensagem da Carta já Alcançou o Tamanho Limite de " + ;
               "1000 Caracteres Permitidos Pela Sefaz!",                ;
               "..:: Atenção ::.." )

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

      RETURN( .F. )

   ENDIF

   // Mostra a qtde de caracteres digitados na carta de correcao
   oSay:VarPut( Strzero( nTam, 3, 0 ) )
   oSay:Refresh()

   IF nTam <= 14 // caracteres

      lLigaBotao := .F.

      // Botao da Transmissao
      oTransmite:Disable()
      oTransmite:Refresh()

   ELSE

      lLigaBotao := .T.

      // Botao da Transmissao
      oTransmite:Enable()
      oTransmite:Refresh()

   ENDIF

RETURN( .T. )
 


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

Re: Scrollbar of TMultiGet

Postby Natter » Sat Apr 01, 2023 3:27 pm

Thank you, Karinha!
Natter
 
Posts: 1222
Joined: Mon May 14, 2007 9:49 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 56 guests