Cambiar imagen de fondo con Tmetro

Cambiar imagen de fondo con Tmetro

Postby Loren » Tue Dec 03, 2013 8:32 am

Compañeros:

Tengo el siguiente código:
Code: Select all  Expand view
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.
Loren
 
Posts: 479
Joined: Fri Feb 16, 2007 10:29 am
Location: Cadiz - España

Re: Cambiar imagen de fondo con Tmetro

Postby Loren » Tue Dec 03, 2013 3: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.
Loren
 
Posts: 479
Joined: Fri Feb 16, 2007 10:29 am
Location: Cadiz - España

Re: Cambiar imagen de fondo con Tmetro (SOLUCIONADO)

Postby Loren » Tue Dec 03, 2013 3:58 pm

Pues, se me ocurrió hacer justo antes de cada Dialogs

Code: Select all  Expand view
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.
Loren
 
Posts: 479
Joined: Fri Feb 16, 2007 10:29 am
Location: Cadiz - España


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 27 guests