FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Get Multiline with picture
Posts: 148
Joined: Tue Mar 20, 2007 03:13 PM
Get Multiline with picture
Posted: Wed Apr 16, 2025 02:07 PM

Hello everyone, good morning!

Does anyone know if it is possible to add a picture option to a multiline get?

Thanks in advance for the information.

Best regards,

Oliveiros Junior

Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Get Multiline with picture
Posted: Wed Apr 16, 2025 02:16 PM
Sorry, sample of picture that you intend to use

Maybe I should try the EDIT control ( look in fivewin.ch )
#command @ <nRow>, <nCol> EDIT [ <oEdit> VAR ] <uVar> ;
            [ <dlg: OF, WINDOW, DIALOG> <oWnd> ] ;
            [ <lMemo: MEMO,TEXT,MULTILINE> ] ;
           ...
Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo

El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 148
Joined: Tue Mar 20, 2007 03:13 PM
Re: Get Multiline with picture
Posted: Wed Apr 16, 2025 02:50 PM

Hello Cristobal, thanks for the answer.

What I need is to create a fixed-length GET, for example 20 characters, and when it reaches this limit it moves to the next line of the same GET, hence the use of MEMO, but I need to format the characters with @!.

Att.,

Oliveiros Junior

Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: Get Multiline with picture
Posted: Wed Apr 16, 2025 03:08 PM
Mira se ayuda. Veja se serve, e o que falta, ok? Vamos entendendo... Abs.

   REDEFINE GET oGet[17] VAR wTEXTO MULTILINE ID 217 OF oDlg  ;
      COLOR CLR_BLUE, CLR_WHITE UPDATE FONT oFont             ;
      ON CHANGE( SB_LimitText( oGet[17], oSay, oTransmite ) ) // By AleSB

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

Outro, Other:

      REDEFINE GET oGet[4] VAR cDest ID 21 OF oDlgEnv MEMO        ;
         FONT oFont1 UPDATE COLORS nRgb(0,0,220),nRgb(253,252,213)    ;
         VALID( CHECA_GET_Dest( ALLTRIM( cDest ) ) )

      oGet[4]:bLostFocus := { || oGet[4]:SetColor( CLR_BLACK, CLR_WHITE) }
      oGet[4]:bGotFocus  := { || oGet[4]:SetColor( CLR_BLACK, nRGB( 255,255,45 )), oGet[4]:setsel(0,0) }

      oGet[4]:cToolTip := OemToAnsi( "Para: Contato(Email) Campo Obrigat¢rio" )

      // Para que o GET com MEMO possa "pular" Para o Proximo GET. Afff!!
      oGet[4]:bKeyDown:={|nKey|IF(nKey==VK_RETURN, VER_FOCO_GET4( oGet ),)}

FUNCTION VER_FOCO_GET4( oGet ) // GET 5 - 24/07/2013 - FWH13.06

   // Posiciona o Cursor na 1a. Letra do Email Problemas no FOCO do MEMO
   oGet[5]:SetFocus()   // nao funciona com XFOCUS()
   oGet[5]:bGotFocus := { || oGet[5]:SetPos(0), Nil }

RETURN( .T. )

FUNCTION VER_FOCO_GET5( oGet ) // GET 5 - 24/07/2013

   // Posiciona o Cursor na 1a. Letra do Email Problemas no FOCO do MEMO
   oGet[6]:SetFocus()   // nao funciona com XFOCUS()
   oGet[6]:bGotFocus := { || oGet[6]:SetPos(0), Nil }

RETURN( .T. )

FUNCTION VER_FOCO_GET6( oGet ) // GET 6 - 24/07/2013
   // Posiciona o Cursor na 1a. Letra do Email Problemas no FOCO do MEMO
   oGet[6]:bGotFocus := { || oGet[6]:SetPos(0), Nil }
   oGet[5]:SetFocus()  // nao funciona com XFOCUS()
   oGet[5]:bGotFocus := { || oGet[5]:SetPos(0), Nil }

RETURN( .T. )


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 no SAY
   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. - kapiabafwh@gmail.com
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341

Continue the discussion