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 ?
Scrollbar of TMultiGet
- Antonio Linares
- Site Admin
- Posts: 42273
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Scrollbar of TMultiGet
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
> 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
Code: Select all | Expand
#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
I didn't understand. What purpose?
No entendí. ¿Que propósito?
Regards, saludos.
No entendí. ¿Que propósito?
Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Re: Scrollbar of TMultiGet
This is necessary to understand that the text is not fully visible in MultiGet control.I didn't understand. What purpose?
Re: Scrollbar of TMultiGet
How about putting a text counter?
¿Qué tal poner un contador de texto?
Regards, saludos.
¿Qué tal poner un contador de texto?
Code: Select all | Expand
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/viewtopic.php?f=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. )
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Re: Scrollbar of TMultiGet
Thank you, Karinha!