FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Cambiar imagen de fondo con Tmetro
Posts: 479
Joined: Fri Feb 16, 2007 10:29 AM
Cambiar imagen de fondo con Tmetro
Posted: Tue Dec 03, 2013 08:32 AM
Compa帽eros:

Tengo el siguiente c贸digo:
Code (fw): Select all Collapse
METHOD New( cTitle, nBtnWidth, nBtnHeight, cFileName ) CLASS TMetro
聽 聽DEFAULT cTitle := "MyApp", nBtnWidth := 132, nBtnHeight := 132
聽 聽::cTitle 聽 聽 = cTitle
聽 聽::aButtons 聽 = {}
聽 聽::nBtnWidth 聽= nBtnWidth
聽 聽::nBtnHeight = nBtnHeight
聽 聽::nOriginX 聽 = 200
聽 聽::nOriginY 聽 = 200
聽 聽::nRow 聽 聽 聽 = 聽 0
聽 聽::nCol 聽 聽 聽 = 聽 0
聽 聽if File( cFileName )
聽 聽 聽 ::hBitmap = ReadBitmap( 0, cFileName )
聽 聽endif
聽 聽DEFINE FONT ::oFont 聽NAME "Century Gothic" SIZE 0, -60
聽 聽DEFINE FONT ::oFontA NAME "Century Gothic" SIZE 0, -40
聽 聽DEFINE FONT ::oFontB NAME "Century Gothic" SIZE 0, -20
聽 聽DEFINE FONT ::oFontC NAME "Century Gothic" SIZE 0, -10
聽 聽DEFINE FONT ::oFontD NAME "Century Gothic" SIZE 0, -15
聽 聽DEFINE WINDOW ::oWnd STYLE nOr( WS_POPUP, WS_VISIBLE ) COLOR CLR_WHITE, CLR_BLACK
return Self
...
...
cfondo=camino+'walpaper\'+alltrim(tapiz->nombre)
...
...
oMetro:=TMetro():New('Gesti贸n empresarial,,,cfondo,'')
...
...

METHOD Activate() CLASS TMetro
聽 聽ACTIVATE WINDOW ::oWnd MAXIMIZED ;
聽 聽 聽 ON PAINT ( DrawBitmap( hDC, ::hBitmap, 0, 0, GetSysMetrics( 0 ), GetSysMetrics( 1 ) ),;
聽 聽 聽 聽 聽 聽 聽 聽 聽::oWnd:Say( 3 , 16 , ::cTitle ,,, ::oFont ,, .T. ),;
聽 聽 聽 聽 聽 聽 聽 聽 聽::oWnd:Say( 8 , 28 , upper(substr(nempresa,1,1))+lower(substr(nempresa,2,54)) ,,, ::oFontA,, .T. ),;
聽 聽 聽 聽 聽 聽 聽 聽 聽::oWnd:Say( 40, 100 , '漏 Lorenzo Fern谩ndez' ,,, ::oFontC,, .T. ),;
聽 聽 聽 聽 聽 聽 聽 聽 聽::oWnd:Say( 41, 100 , 'Versi贸n 11.13.1' ,,, ::oFontC,, .T. ),;
聽 聽 聽 聽 聽 聽 聽 聽 聽::oWnd:Say( 40, 16 , CDoW( Date() ) +', '+AllTrim( Str( Day( Date() ) ) ) +' de '+CMonth( DATE() ),,, ::oFontB,, .T. ),;
聽 聽 聽 聽 聽 聽 聽 聽 聽::oWnd:Say( 42, 16 , 'Usuario: '+usuario ,,, ::oFontD,, .T. ),;
聽 聽 聽 聽 聽 聽 聽 聽 聽::oWnd:Say( 44, 16 , 'Ruta de acceso: '+cruta ,,, ::oFontD,, .T. ) )
return nil


De esta manera obtengo el siguiente men煤 principal:
http://ge.tt/2yv3gj61/v/0

Ahora necesito cambiar el wallpaper a fondo NEGRO en tiempo de ejecuci贸n justo antes que se muestre un Dialogs, y restablecerlo cada vez que cierre el Dialogs

Mil gracias. Un saludo.
LORENZO.
Posts: 479
Joined: Fri Feb 16, 2007 10:29 AM
Re: Cambiar imagen de fondo con Tmetro
Posted: Tue Dec 03, 2013 03:47 PM

Compa帽eros,

se que los "tiros" van por aqu铆:

oBmp:LoadBmp( cBmpFile )
oWnd:Refresh()

Pero no logro dar en la diana...

por favor... un alma caritativa..
Gracias.
LORENZO.

Posts: 479
Joined: Fri Feb 16, 2007 10:29 AM
Re: Cambiar imagen de fondo con Tmetro (SOLUCIONADO)
Posted: Tue Dec 03, 2013 03:58 PM
Pues, se me ocurri贸 hacer justo antes de cada Dialogs

Code (fw): Select all Collapse
 DEFINE WINDOW oW   STYLE nOr( WS_POPUP, WS_VISIBLE ) COLOR CLR_WHITE, CLR_BLACK
 ACTIVATE WINDOW oW MAXIMIZED


... y la flauta son贸.

Probablemente sea una soluci贸n poco ortodoxa, pero me funciona perfectamente.

Mil gracias a todos.
LORENZO.

Continue the discussion