Definitivamente hay problemas con DIALOGS y SAYS
-
- Posts: 497
- Joined: Sun Oct 16, 2005 3:32 am
- Location: Quito - Ecuador
- Has thanked: 1 time
- Been thanked: 1 time
- Contact:
Definitivamente hay problemas con DIALOGS y SAYS
Hola Antonio:
Definitivamente tengo problemas con los diiálogos y los says. No importa sin son por código o con recurso, si son Transparent o nó.
Mira este ejemplo:
#include "FiveWin.ch"
Function Inicio()
LOCAL oDlg, oSay1, oTimer
LOCAL oFont1:=TFont():New("Ms Sans Serif",0,-8,.F.,.t.)
SET DATE FORMAT TO "dd-mm-yyyy"
DEFINE DIALOG oDlg FROM 1,1 TO 100,345 TITLE OemToAnsi("El viacrucis de las actualizaciones") PIXEL TRANSPARENT
@ 05,15 SAY oSay1 PROMPT OemToAnsi("Fecha y hora actuales") OF oDlg PIXEL FONT oFont1 SIZE 100,12
@ 05,80 SAY oSay2 PROMPT ": "+dtoc(Date())+" - "+Time() OF oDlg PIXEL SIZE 100,12 FONT oFont1
@ 30,30 BUTTON "&Salir" OF oDlg PIXEL ACTION oDlg:End()
ACTIVATE DIALOG oDlg CENTERED ON INIT (Timer(oDlg, oSay2))
Return(Nil)
function Timer( oDlg, oSay2 )
LOCAL oTimer
DEFINE TIMER oTimer INTERVAL 1000 OF oDlg ACTION;
(oSay2:VarPut(": "+dtoc(Date())+" - "+Time()),oSay2:Refresh())
ACTIVATE TIMER oTimer
return nil
Si el diálogo se pone sin TRANSPARENT, pinta en primera instancia bien tanto oSay1 como oSay2, pero al momento de repintar con el timer parte el texto de oSay2 en 2 líneas.
Si el diálogo se pone con TRANSPARENT desde el inicio pinta tanto oSay1 como oSay2 en 2 líneas,
Si el font se pone normal (NO BOLD), entonces funciona bien. El problema es la asignar oFont1 como BOLD
Recuerda, que también te reporté la misma novedad con un ejemplo usando recursos en post del 18-Agosto-2008
Hasta FWH 8.01 me funcionaba perfecto. Pero con FWH 8.07 tengo este inconveniente. El problema es que no puedo actualizar mis aplicaciones a FWH 8.07. Todos los diálogos en los que uso Fonts con BOLD me pasa lo mismo.
He jugado con FixSays y nada.
He probado en el INIT del Diálogo con oSay1:SetSize() y tampoco. Esta última opción debo descartarla, pues imagínate en diálogos en los que tenga 20 o más say, ponerme a darle oSaynn:SetSize() a cada uno. Locura.
Por favor ayudaaaaaaaaaaa.............
Saludos,
Carlos Gallego
Definitivamente tengo problemas con los diiálogos y los says. No importa sin son por código o con recurso, si son Transparent o nó.
Mira este ejemplo:
#include "FiveWin.ch"
Function Inicio()
LOCAL oDlg, oSay1, oTimer
LOCAL oFont1:=TFont():New("Ms Sans Serif",0,-8,.F.,.t.)
SET DATE FORMAT TO "dd-mm-yyyy"
DEFINE DIALOG oDlg FROM 1,1 TO 100,345 TITLE OemToAnsi("El viacrucis de las actualizaciones") PIXEL TRANSPARENT
@ 05,15 SAY oSay1 PROMPT OemToAnsi("Fecha y hora actuales") OF oDlg PIXEL FONT oFont1 SIZE 100,12
@ 05,80 SAY oSay2 PROMPT ": "+dtoc(Date())+" - "+Time() OF oDlg PIXEL SIZE 100,12 FONT oFont1
@ 30,30 BUTTON "&Salir" OF oDlg PIXEL ACTION oDlg:End()
ACTIVATE DIALOG oDlg CENTERED ON INIT (Timer(oDlg, oSay2))
Return(Nil)
function Timer( oDlg, oSay2 )
LOCAL oTimer
DEFINE TIMER oTimer INTERVAL 1000 OF oDlg ACTION;
(oSay2:VarPut(": "+dtoc(Date())+" - "+Time()),oSay2:Refresh())
ACTIVATE TIMER oTimer
return nil
Si el diálogo se pone sin TRANSPARENT, pinta en primera instancia bien tanto oSay1 como oSay2, pero al momento de repintar con el timer parte el texto de oSay2 en 2 líneas.
Si el diálogo se pone con TRANSPARENT desde el inicio pinta tanto oSay1 como oSay2 en 2 líneas,
Si el font se pone normal (NO BOLD), entonces funciona bien. El problema es la asignar oFont1 como BOLD
Recuerda, que también te reporté la misma novedad con un ejemplo usando recursos en post del 18-Agosto-2008
Hasta FWH 8.01 me funcionaba perfecto. Pero con FWH 8.07 tengo este inconveniente. El problema es que no puedo actualizar mis aplicaciones a FWH 8.07. Todos los diálogos en los que uso Fonts con BOLD me pasa lo mismo.
He jugado con FixSays y nada.
He probado en el INIT del Diálogo con oSay1:SetSize() y tampoco. Esta última opción debo descartarla, pues imagínate en diálogos en los que tenga 20 o más say, ponerme a darle oSaynn:SetSize() a cada uno. Locura.
Por favor ayudaaaaaaaaaaa.............
Saludos,
Carlos Gallego
- karinha
- Posts: 7963
- Joined: Tue Dec 20, 2005 7:36 pm
- Location: São Paulo - Brasil
- Been thanked: 5 times
- Contact:
Carlos, prueba ahora...
Saludos.
Code: Select all | Expand
#Include "FiveWin.ch"
STATIC oTimer
FUNCTION Inicio()
LOCAL oDlg, oSay1, oSay2 //, oTimer
LOCAL oFont1:=TFont():New("Ms Sans Serif",0,-8,.F.,.t.)
SET DATE BRITISH
SET EPOCH TO 1950
SET CENTURY ON
DEFINE DIALOG oDlg FROM 1,1 TO 100,345 ;
TITLE OemToAnsi("El viacrucis de las actualizaciones") ;
PIXEL TRANSPARENT
oDlg:lHelpIcon := .F.
@ 05,15 SAY oSay1 PROMPT OemToAnsi("Fecha y hora actuales") OF oDlg ;
PIXEL FONT oFont1 SIZE 100,12
@ 05,80 SAY oSay2 PROMPT ": "+DTOC(DATE())+" - "+Time() OF oDlg ;
PIXEL SIZE 100,12 FONT oFont1
@ 30,65 BUTTON "&Salir" OF oDlg PIXEL ACTION oDlg:End()
ACTIVATE DIALOG oDlg CENTERED ON INIT ( Timer( oDlg, oSay2 ) )
oFont1:End()
oTimer:End()
Release All
RETURN NIL
FUNCTION Timer( oDlg, oSay2 )
DEFINE TIMER oTimer INTERVAL 1000 OF oDlg ;
ACTION ( oSay2:VarPut( ": " + DTOC(DATE())+" - " + ;
TIME() ), oSay2:Refresh() )
ACTIVATE TIMER oTimer
RETURN NIL
Saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
- Patricio Avalos Aguirre
- Posts: 1060
- Joined: Fri Oct 07, 2005 1:56 pm
- Location: La Serena, Chile
- Contact:
Saludos
Patricio
__________________________________________________________________
Version: Harbour 3.2.0dev (r1307082134),Compiler: Borland C++ 5.8.2 (32-bit)
PCode version: 0.3, FWH 13.2
http://www.sialm.cl
Patricio
__________________________________________________________________
Version: Harbour 3.2.0dev (r1307082134),Compiler: Borland C++ 5.8.2 (32-bit)
PCode version: 0.3, FWH 13.2
http://www.sialm.cl
- Antonio Linares
- Site Admin
- Posts: 42655
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 67 times
- Been thanked: 96 times
- Contact:
Carlos,
Hay que hacer una modificación en la Clase TSay para que tu código funcione correctamente y sin cambiar nada en tus PRGs. Aqui, con estos cambios, está funcionando bien. Antes daba el error que comentas de dos líneas de texto:
Hay que hacer una modificación en la Clase TSay para que tu código funcione correctamente y sin cambiar nada en tus PRGs. Aqui, con estos cambios, está funcionando bien. Antes daba el error que comentas de dos líneas de texto:
Code: Select all | Expand
METHOD SetText( cText ) CLASS TSay
local hDC
DEFAULT ::lTransparent := .f.
::cCaption := If( ::cPicture != nil, Transform( cText, ::cPicture ),;
cValToChar( cText ) )
#ifndef __CLIPPER__
if ::oWnd:oBrush != nil .and. Empty( ::oWnd:oBrush:hBitmap ) .and. ( IsAppThemed() .or. ::lTransparent )
DrawPBack( ::hWnd, hDC := GetDC( ::hWnd ) )
ReleaseDC( ::hWnd, hDC )
endif
#endif
if ! lAnd( GetWindowLong( ::hWnd, GWL_STYLE ), nOr( SS_LEFT, SS_RIGHT, SS_CENTER ) )
::nWidth := GetTextWidth( 0, ::cCaption, If( ::oFont != nil, ::oFont:hFont,) ) + 20
endif
SetWindowText( ::hWnd, ::cCaption )
return nil
- Antonio Linares
- Site Admin
- Posts: 42655
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 67 times
- Been thanked: 96 times
- Contact:
-
- Posts: 497
- Joined: Sun Oct 16, 2005 3:32 am
- Location: Quito - Ecuador
- Has thanked: 1 time
- Been thanked: 1 time
- Contact:
Maestro Antonio, corrijo:
Hasta la versión FWH 8.05 no tenía ese problema. En la clase TSay de esa versión el Method SetText estaba así:
Fué en la versión FWH 8.07 que le agregaste
lo que produce la falla en el pintado. Estoy en lo correcto ?
Saludos,
Carlos Gallego
Hasta la versión FWH 8.05 no tenía ese problema. En la clase TSay de esa versión el Method SetText estaba así:
Code: Select all | Expand
METHOD SetText( cText ) CLASS TSay
local hDC
DEFAULT ::lTransparent := .f.
::cCaption := If( ::cPicture != nil, Transform( cText, ::cPicture ),;
cValToChar( cText ) )
#ifndef __CLIPPER__
if ::oWnd:oBrush != nil .and. Empty( ::oWnd:oBrush:hBitmap ) .and. ( IsAppThemed() .or. ::lTransparent )
DrawPBack( ::hWnd, hDC := GetDC( ::hWnd ) )
ReleaseDC( ::hWnd, hDC )
endif
#endif
SetWindowText( ::hWnd, ::cCaption )
return nil
Fué en la versión FWH 8.07 que le agregaste
Code: Select all | Expand
if ! lAnd( GetWindowLong( ::hWnd, GWL_STYLE ), nOr( SS_RIGHT, SS_CENTER ) )
::nWidth := GetTextWidth( 0, ::cCaption, If( ::oFont != nil, ::oFont:hFont,) )
endif
lo que produce la falla en el pintado. Estoy en lo correcto ?
Saludos,
Carlos Gallego
-
- Posts: 497
- Joined: Sun Oct 16, 2005 3:32 am
- Location: Quito - Ecuador
- Has thanked: 1 time
- Been thanked: 1 time
- Contact:
En qué afectaría si se quita
Saludos,
Carlos Gallego
Code: Select all | Expand
if ! lAnd( GetWindowLong( ::hWnd, GWL_STYLE ), nOr( SS_RIGHT, SS_CENTER ) )
::nWidth := GetTextWidth( 0, ::cCaption, If( ::oFont != nil, ::oFont:hFont,) )
endif
Saludos,
Carlos Gallego
- Antonio Linares
- Site Admin
- Posts: 42655
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 67 times
- Been thanked: 96 times
- Contact:
- Patricio Avalos Aguirre
- Posts: 1060
- Joined: Fri Oct 07, 2005 1:56 pm
- Location: La Serena, Chile
- Contact:
Saludos
Patricio
__________________________________________________________________
Version: Harbour 3.2.0dev (r1307082134),Compiler: Borland C++ 5.8.2 (32-bit)
PCode version: 0.3, FWH 13.2
http://www.sialm.cl
Patricio
__________________________________________________________________
Version: Harbour 3.2.0dev (r1307082134),Compiler: Borland C++ 5.8.2 (32-bit)
PCode version: 0.3, FWH 13.2
http://www.sialm.cl
- Patricio Avalos Aguirre
- Posts: 1060
- Joined: Fri Oct 07, 2005 1:56 pm
- Location: La Serena, Chile
- Contact:
Code: Select all | Expand
DEFINE DIALOG oDlg NAME "DLG_LISTA" TITLE cTitle COLOR nRgb(0,0,0),nRgb(238,221,187)
Saludos
Patricio
__________________________________________________________________
Version: Harbour 3.2.0dev (r1307082134),Compiler: Borland C++ 5.8.2 (32-bit)
PCode version: 0.3, FWH 13.2
http://www.sialm.cl
Patricio
__________________________________________________________________
Version: Harbour 3.2.0dev (r1307082134),Compiler: Borland C++ 5.8.2 (32-bit)
PCode version: 0.3, FWH 13.2
http://www.sialm.cl
- Antonio Linares
- Site Admin
- Posts: 42655
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 67 times
- Been thanked: 96 times
- Contact:
- Patricio Avalos Aguirre
- Posts: 1060
- Joined: Fri Oct 07, 2005 1:56 pm
- Location: La Serena, Chile
- Contact:
Last edited by Patricio Avalos Aguirre on Thu Sep 11, 2008 10:14 pm, edited 1 time in total.
Saludos
Patricio
__________________________________________________________________
Version: Harbour 3.2.0dev (r1307082134),Compiler: Borland C++ 5.8.2 (32-bit)
PCode version: 0.3, FWH 13.2
http://www.sialm.cl
Patricio
__________________________________________________________________
Version: Harbour 3.2.0dev (r1307082134),Compiler: Borland C++ 5.8.2 (32-bit)
PCode version: 0.3, FWH 13.2
http://www.sialm.cl