Page 1 of 1
Scrollbar of TMultiGet
Posted:
Thu Mar 30, 2023 7:23 pm
by Natter
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 ?
Re: Scrollbar of TMultiGet
Posted:
Fri Mar 31, 2023 9:52 am
by Antonio Linares
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
Re: Scrollbar of TMultiGet
Posted:
Fri Mar 31, 2023 10:45 am
by Natter
- Code: Select all Expand view
#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
Re: Scrollbar of TMultiGet
Posted:
Fri Mar 31, 2023 1:25 pm
by karinha
I didn't understand. What purpose?
No entendí. ¿Que propósito?
Regards, saludos.
Re: Scrollbar of TMultiGet
Posted:
Fri Mar 31, 2023 6:47 pm
by Natter
I didn't understand. What purpose?
This is necessary to understand that the text is not fully visible in MultiGet control.
Re: Scrollbar of TMultiGet
Posted:
Sat Apr 01, 2023 2:51 pm
by karinha
How about putting a text counter?
¿Qué tal poner un contador de texto?
- Code: Select all Expand view
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() ENDIFRETURN( .T.
)
Regards, saludos.
Re: Scrollbar of TMultiGet
Posted:
Sat Apr 01, 2023 3:27 pm
by Natter
Thank you, Karinha!