Dialog Transparent

Dialog Transparent

Postby nixbeau » Mon Mar 18, 2013 8:57 pm

amigos, quería poner un cuadro de diálogo acerca de otro diálogo para mantenerse en la cima era transparente y podía ver el contenido desde atrás. ¿Puede alguien darme un ejemplo?

Utilizar:
Code: Select all  Expand view
DEFINE DIALOG frmPDV RESORCE 'TELAPDV' TRANSPARENT
. No trabaja.
Utilizar:
Code: Select all  Expand view
DEFINE DIALOG frmPDV RESORCE 'TELAPDV'; frmPDV:lTrasparent:=.t.
. No trabaja.

Yo uso la opción PellesC transparente y además no funciona.
nixbeau
 
Posts: 28
Joined: Sun Jan 08, 2012 6:17 pm

Re: Dialog Transparent

Postby Antonio Linares » Mon Mar 18, 2013 10:38 pm

Puedes hacerlo asi:

ACTIVATE DIALOG oDlg ON INIT SetTrans( oDlg )

...

Code: Select all  Expand view
function SetTrans( oDlg )

   SetWindowLong( oDlg:hWnd, GWL_EXSTYLE, nOr( GetWindowLong( oDlg:hWnd, GWL_EXSTYLE ), WS_EX_LAYERED ) )

   SetLayeredWindowAttributes( oDlg:hWnd,,, LWA_COLORKEY )

return nil
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Dialog Transparent

Postby Antonio Linares » Mon Mar 18, 2013 10:51 pm

Habia un ejemplo en el que podiamos establecer el nivel de transparencia de un diálogo, pero no lo localizo.

Alguien recuerda cual era ? gracias :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Dialog Transparent

Postby anserkk » Tue Mar 19, 2013 10:37 am

Code: Select all  Expand view
oDlg:nOpacity  := 180
User avatar
anserkk
 
Posts: 1329
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: Dialog Transparent

Postby nixbeau » Tue Mar 19, 2013 11:14 am

Antonio Linares wrote:Puedes hacerlo asi:

ACTIVATE DIALOG oDlg ON INIT SetTrans( oDlg )

...

Code: Select all  Expand view
function SetTrans( oDlg )

   SetWindowLong( oDlg:hWnd, GWL_EXSTYLE, nOr( GetWindowLong( oDlg:hWnd, GWL_EXSTYLE ), WS_EX_LAYERED ) )

   SetLayeredWindowAttributes( oDlg:hWnd,,, LWA_COLORKEY )

return nil



Eso no sería VB?
Dado que el uso BRUSH oBRUSH TRANSPARENT funciona?
nixbeau
 
Posts: 28
Joined: Sun Jan 08, 2012 6:17 pm

Re: Dialog Transparent

Postby FranciscoA » Wed Mar 20, 2013 12:37 am

Hola, Encontré este codigo por ahi. Nunca lo probé.

Code: Select all  Expand view
#include "FiveWin.ch"

Function Main()
local oGet, cSeguridad:=Space(12), ide:=Space(10)
local oBrush, para


Define Brush oBrush COLOR nRGB( 255, 106, 0 )
Define Dialog oDlgC ResName "demo"  Brush oBrush TRANSPARENT

  ReDefine Get oGet var ide        id 101 of oDlgC
  ReDefine Get oGet var cSeguridad id 102 of oDlgC

  ReDefine Button id 201 of oDlgC
 
  ReDefine Button id 202 of oDlgC;
  Action (oDlgC:End())
   
oDlgC:lHelpIcon:=.f.
Activate Dialog oDlgC Center;
On Init( Dialogo:= getwindowlong( oDlgC:hWnd, -20 ), ;
setwindowlong( oDlgC:hWnd, -20, nOr( Dialogo, 524288 ) ) , ;
setlayeredwindowattributes( oDlgC:hWnd, 0, 230, 2 ) )    // El parametro 230
oBrush:End()                                             // es el nivel de transparencia
Return Nil                                               // el el tope maximo es 255 entre
                                                                            // Menor seal este numero mas trasnparente sera 

DLL32 function getwindowlong( hwnd as LONG, index as LONG ) AS LONG PASCAL FROM "GetWindowLongA" lib "user32.dll"
DLL32 function setwindowlong( hwnd as LONG, index as LONG, newlog as LONG ) AS LONG PASCAL FROM "SetWindowLongA" lib "user32.dll"
DLL32 function setlayeredwindowattributes( hwnd as LONG, crkey as LONG, alpha as WORD, flag as LONG ) AS LONG PASCAL FROM "SetLayeredWindowAttributes" lib "user32.dll"
 

Saludos.
Francisco J. Alegría P.
Chinandega, Nicaragua.

Fwxh-MySql-TMySql
User avatar
FranciscoA
 
Posts: 2110
Joined: Fri Jul 18, 2008 1:24 am
Location: Chinandega, Nicaragua, C.A.

Re: Dialog Transparent

Postby Antonio Linares » Wed Mar 20, 2013 8:45 am

Nixbeau,

Como ha comentado Anserkk, esta es la forma correcta para establecer un cierto nivel de transparencia:

Code: Select all  Expand view
#include "FiveWin.ch"

function Main()

   local oDlg

   DEFINE DIALOG oDlg

   oDlg:nOpacity = 100

   ACTIVATE DIALOG oDlg CENTERED

return nil
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Dialog Transparent

Postby horacio » Wed Mar 20, 2013 1:14 pm

horacio
 
Posts: 1358
Joined: Wed Jun 21, 2006 12:39 am
Location: Capital Federal Argentina

Re: Dialog Transparent

Postby nixbeau » Wed Mar 20, 2013 9:28 pm

Antonio Linares wrote:Nixbeau,

Como ha comentado Anserkk, esta es la forma correcta para establecer un cierto nivel de transparencia:

Code: Select all  Expand view
#include "FiveWin.ch"

function Main()

   local oDlg

   DEFINE DIALOG oDlg

   oDlg:nOpacity = 100

   ACTIVATE DIALOG oDlg CENTERED

return nil



He utilizado el comando brillaba y parecía poner todo el formulario, incluyendo gets y says y memos.

He utilizado el comando: frmPDV: nOpacity = 100. ¿Cómo puedo obtener sólo el frmPDV (DIALOG) es transparente?

Dialog sólo necesita ser transparente, sin ningún otro componente.

Image
nixbeau
 
Posts: 28
Joined: Sun Jan 08, 2012 6:17 pm

Re: Dialog Transparent

Postby Antonio Linares » Thu Mar 21, 2013 10:02 am

Te refieres a que solo quieres que el fondo sea transparente ?

Puedes mostrar un dibujo de como quieres que se vea ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Dialog Transparent

Postby nixbeau » Fri Mar 22, 2013 12:01 pm

Antonio Linares wrote:Te refieres a que solo quieres que el fondo sea transparente ?

Puedes mostrar un dibujo de como quieres que se vea ?



Hola Antonio, gracias por la ayuda.
Siga la imagen de como me gusta el trabajo form1.
De hecho, esta imagen representa mi necesidad, pero el uso de la relación trasnparencia pantalla se pone en la pantalla que cubre algunas partes y dejando otro visible. No necesariamente el desktop.

Image
nixbeau
 
Posts: 28
Joined: Sun Jan 08, 2012 6:17 pm

Re: Dialog Transparent

Postby Antonio Linares » Fri Mar 22, 2013 12:06 pm

Prueba a usar un Brush NULL:

DEFINE BRUSH oBrush STYLE NULL

DEFINE DIALOG oDlg BRUSH oBrush ...

...
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Dialog Transparent

Postby nixbeau » Fri Mar 22, 2013 12:48 pm

Antonio Linares wrote:Prueba a usar un Brush NULL:

DEFINE BRUSH oBrush STYLE NULL

DEFINE DIALOG oDlg BRUSH oBrush ...

...



Image
nixbeau
 
Posts: 28
Joined: Sun Jan 08, 2012 6:17 pm

Re: Dialog Transparent

Postby nageswaragunupudi » Fri Mar 22, 2013 9:26 pm

Code: Select all  Expand view
DEFINE DIALOG oDlg COLOR CLR_BLACK,RGB(1,1,1)
<...... place all controls ....>
oDlg:nSeeThroClr := RGB(1,1,1)
ACTIVATE DIALOG oDlg
 
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10248
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Dialog Transparent

Postby nixbeau » Fri Mar 22, 2013 9:42 pm

nageswaragunupudi wrote:
Code: Select all  Expand view
DEFINE DIALOG oDlg COLOR CLR_BLACK,RGB(1,1,1)
<...... place all controls ....>
oDlg:nSeeThroClr := RGB(1,1,1)
ACTIVATE DIALOG oDlg
 


Perfecto nageswaragunupudi, muy bueno. Funcionó a la perfección.
¿Podría explicar el funcionamiento del mando? Me gustaría entender por qué lo hace.
nixbeau
 
Posts: 28
Joined: Sun Jan 08, 2012 6:17 pm

Next

Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 62 guests