Page 1 of 1

Fijar Texto en la ventana Principal de mi Aplicación

PostPosted: Fri Sep 29, 2023 11:40 pm
by jnavas
Saludos
Necesito personalizar los datos de la licencia en la ventana principal,
estoy experimentando "desaparece" el texto licencia cuando presento un nuevo formulario WINDOWS o DIALOG.
Necesito fijar los datos de la licencia en la ventana principal.
Agradezco sus recomendaciones.

Code: Select all  Expand view

DEFINE WINDOW oDp:oFrameDp MDI TITLE oDp:cDpSys ;
         MENU xBuildMenu();
         VSCROLL HSCROLL COLOR NIL,16579836;
         ICON oIco


@ 10,10 SAY "LICENCIA " OF oDp:oFrameDp


ACTIVATE ...

 

Re: Fijar Texto en la ventana Principal de mi Aplicación

PostPosted: Sat Sep 30, 2023 4:56 am
by Antonio Linares
Querido Juan,

Prueba asi:

@ 10,10 SAY "LICENCIA " OF oDp:oFrameDp:oWndClient

Re: Fijar Texto en la ventana Principal de mi Aplicación

PostPosted: Sat Sep 30, 2023 12:42 pm
by cnavarro
O también puedes usar el method de la clase TWindow
Code: Select all  Expand view

<oParent>:SayText( cText, aRect, cAlign, oFont, nClrText, nClrBack, lBorder, nAddlStyle )
 

llamándolo desde el ON PAINT del <oParent>
-> oParent es el objeto del container ( Window, Dialog, TPanel, etc. )

Re: Fijar Texto en la ventana Principal de mi Aplicación

PostPosted: Sat Sep 30, 2023 6:32 pm
by karinha
Haz mejor master Navarro. hahahahahaha.

Code: Select all  Expand view

// FWH..\SAMPLES\LICENCIA.PRG

#include "FiveWin.ch"

FUNCTION Main()

   LOCAL oWnd, oSay[3], oFont[2]
   
   DEFINE FONT oFont[1] NAME "ARIAL" SIZE 0, 20 BOLD NESCAPEMENT 900
   DEFINE FONT oFont[2] NAME "ARIAL" SIZE 0, 20 BOLD
       
   DEFINE WINDOW oWnd ; //FROM 1,5 TO 20,65 ;
      TITLE "Testing SAY With Design"

   /* Con Design
   @ 180, 30 SAY oSay[2] PROMPT "" OF oWnd COLOR 0 SIZE 80, 200 FONT oFont[1];
      DESIGN UPDATE PIXEL
   */


   // Sin Design
   @ 180, 80 SAY oSay[3] PROMPT "" OF oWnd COLOR 0 SIZE 80, 200 FONT oFont[2];
      UPDATE PIXEL
 
   ACTIVATE WINDOW oWnd MAXIMIZED ;
      ON INIT oSay[3]:SAY( 180, 30,  "LICENCIA SHOW", CLR_BLACK, CLR_YELLOW, ;
              oFont[2], .T., )                                               ;
      ON PAINT oSay[3]:SAY( 180, 30, "LICENCIA SHOW", CLR_BLACK, CLR_YELLOW, ;
               oFont[2], .T., )

   oFont[1]:End()
   oFont[2]:End()

RETURN NIL

// fin / end - kapiabafwh@gmail.com
 


Regards, saludos.

Re: Fijar Texto en la ventana Principal de mi Aplicación

PostPosted: Sat Sep 30, 2023 6:47 pm
by karinha
FiveWin the BEST!!

Code: Select all  Expand view

// FWH..\SAMPLES\LICENCIA.PRG

#include "FiveWin.ch"

STATIC oWnd

FUNCTION Main()

   LOCAL oSay[3], oFont[2]
   
   DEFINE FONT oFont[1] NAME "ARIAL" SIZE 0, 20 BOLD NESCAPEMENT 900
   DEFINE FONT oFont[2] NAME "ARIAL" SIZE 0, 20 BOLD
       
   DEFINE WINDOW oWnd ; //FROM 1,5 TO 20,65 ;
      TITLE "Testing SAY With Design"

   /* Con Design
   @ 180, 30 SAY oSay[2] PROMPT "" OF oWnd COLOR 0 SIZE 80, 200 FONT oFont[1];
      DESIGN UPDATE PIXEL
   */


   // Sin Design
   @ 180, 80 SAY oSay[3] PROMPT "" OF oWnd COLOR 0 SIZE 80, 200 FONT oFont[2];
      UPDATE PIXEL

   /*
   ACTIVATE WINDOW oWnd MAXIMIZED ;
      ON INIT oSay[3]:SAY( 180, 30,  "LICENCIA SHOW", CLR_BLACK, CLR_YELLOW, ;
              oFont[2], .T., )                                               ;
      ON PAINT oSay[3]:SAY( 180, 30, "LICENCIA SHOW", CLR_BLACK, CLR_YELLOW, ;
               oFont[2], .T., )
   */


   // OTRO MODELO
   ACTIVATE WINDOW oWnd MAXIMIZED ;
      ON PAINT( PINTA( hDC ) )

   oFont[1]:End()
   oFont[2]:End()

RETURN NIL
// PINTA LETRA NA JANELA(WINDOW)
FUNCTION Pinta( hDC )

   LOCAL nColor
   LOCAL nLeft   :=  80 //75 // 80 //290
   LOCAL nRight  := 220
   LOCAL cTexto  := "LICENCIA SHOW"
   LOCAL oFont
   LOCAL hFont
   LOCAL nLen    := LEN( cTexto )
   LOCAL cLetra, n
   LOCAL nResHoriz, nResVert

   nResHoriz := oWnd:nHorzRes() // retorna a resolucao horizontal
   nResVert  := oWnd:nVertRes() // retorna a resolucao vertical

   // atencao: nResolution identifica em que resolucao foram inicialmente
   // desenhadas as telas, e DEVE ter um dos seguintes valores:
   //
   // 1 =  640 X 480
   // 2 =  800 X 600
   // 3 = 1024 X 768
   // 4 = 1152 X 864
   // 5 = 1280 X 800
   // 6 = 1280 X 1024
   // 7 = 1600 X 1200
   // 8 =  768 X 1024
   // 9 = 1440 X 900
   // 10 = 1280 X 768
   // 11 = 1280 X 720

   // ? nResHoriz, nResVert  // 1024 X 768 mi caso.

   IF nResHoriz = 1366 .AND. nResVert = 768

      nLeft  := 260
      nRight := 230

   ELSEIF nResHoriz = 1360 .AND. nResVert = 768

      nLeft  := 210
      nRight := 250

   ELSEIF nResHoriz = 1280 .AND. nResVert = 1024

      nLeft  := 210
      nRight := 350

   ELSEIF nResHoriz = 1280 .AND. nResVert = 768

      nLeft  := 210
      nRight := 250

   ELSEIF nResHoriz = 1280 .AND. nResVert = 720

      nLeft  := 200
      nRight := 200

   ELSEIF nResHoriz = 1024 .AND. nResVert = 768  // Minha Maquina

      nLeft  := 200  // COL
      nRight := 400  // LIN

   ELSE

      nLeft  :=  75 // 80
      nRight := 220

   ENDIF

   DEFINE FONT oFont NAME "Segoe UI Symbol" SIZE 0, -80 BOLD

   hFont := SelectObject( hDC, oFont:hFont )

   FOR n := 1 TO nLen

      cLetra := substr( cTexto, n, 1 )

      // nColor := SetTextColor( hDC, nRandom( CLR_GREEN ) )  // COLORS.CH
      // Em: 11/04/2019 - Fernanda pediu para mudar o fundo de tela.
      nColor := SetTextColor( hDC,  CLR_GREEN )  // COLORS.CH

      // TextOut( hDC, 10, nLeft, cLetra )
      TextOut( hDC, nRight, nLeft, cLetra )

      SetTextColor( hDC, nColor )

      nLeft += GetTextWidth( hDC, cLetra, oFont )

   NEXT

   SelectObject( hDC, hFont )

RETURN NIL

// fin / end - kapiabafwh@gmail.com
 


Regards, saludos.

Re: Fijar Texto en la ventana Principal de mi Aplicación

PostPosted: Sat Sep 30, 2023 6:55 pm
by karinha