FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Fijar Texto en la ventana Principal de mi Aplicaci贸n
Posts: 492
Joined: Wed Nov 16, 2005 12:03 PM
Fijar Texto en la ventana Principal de mi Aplicaci贸n
Posted: Fri Sep 29, 2023 11:40 PM
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 (fw): Select all Collapse
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 ...
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Fijar Texto en la ventana Principal de mi Aplicaci贸n
Posted: Sat Sep 30, 2023 04:56 AM

Querido Juan,

Prueba asi:

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

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Fijar Texto en la ventana Principal de mi Aplicaci贸n
Posted: Sat Sep 30, 2023 12:42 PM
O tambi茅n puedes usar el method de la clase TWindow
Code (fw): Select all Collapse
<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. )
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: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: Fijar Texto en la ventana Principal de mi Aplicaci贸n
Posted: Sat Sep 30, 2023 06:32 PM
Haz mejor master Navarro. hahahahahaha.
Code (fw): Select all Collapse
// 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.
Jo茫o Santos - S茫o Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: Fijar Texto en la ventana Principal de mi Aplicaci贸n
Posted: Sat Sep 30, 2023 06:47 PM
FiveWin the BEST!!
Code (fw): Select all Collapse
// 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.
Jo茫o Santos - S茫o Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: Fijar Texto en la ventana Principal de mi Aplicaci贸n
Posted: Sat Sep 30, 2023 06:55 PM
Jo茫o Santos - S茫o Paulo - Brasil - Phone: +55(11)95150-7341

Continue the discussion