BYRON,
Compila y ejecuta este ejemplo:
checa la sig. linea de codigo:
DEFINE DIALOG oDlg FROM 0, 0 TO 30, 70 ;
STYLE WS_CHILD OF oWndChild TRANSPARENT
prueba con y sin TRANSPARENT
Con transparent me sale diferente el degradado pasa eso contigo ?
saludos.
// This is an example of how to place controls inside a MDIChild
// from a dialog built from source code
#include "FiveWin.ch"
static oWnd, oDlg, oWndChild
//----------------------------------------------------------------------------//
function Main()
local oBar
local aDlgGradient[4][1]
SET _3DLOOK ON
aDlgGradient[1] := { { 0.50, CLR_RED, CLR_BLUE } }
aDlgGradient[2] := { { 0.50, CLR_GREEN, CLR_YELLOW } }
aDlgGradient[3] := { { 0.50, CLR_GRAY, CLR_BLACK } }
aDlgGradient[4] := { { 0.50, CLR_WHITE, CLR_BLUE } }
SetDlgGradient( aDlgGradient[( 1 + nRandom (3) ) ] )
DEFINE WINDOW oWnd TITLE "MDIChilds from resources" MDI
DEFINE BUTTONBAR oBar _3D OF oWnd
//DEFINE BUTTON OF oBar ACTION ( Child(), MsgInfo( oWnd:oWndClient:aWnd[ 1 ]:cCaption ) )
DEFINE BUTTON OF oBar ACTION ( Child() )
ACTIVATE WINDOW oWnd
return nil
//----------------------------------------------------------------------------//
function Child()
local oBtn
local cName := "Testing..."
local oGet
local oFont1, oFont2
DEFINE FONT oFont1 NAME "Blackoak Std" size 15, 40 BOLD
DEFINE FONT oFont2 NAME "Blackoak Std" size 15, 15 BOLD
DEFINE WINDOW oWndChild MDICHILD OF oWnd ;
COLOR "N/W"
oWndChild:bGotFocus = { || oDlg:SetFocus() }
DEFINE DIALOG oDlg FROM 0, 0 TO 30, 70 ;
STYLE WS_CHILD OF oWndChild TRANSPARENT
oDlg:bLostFocus = { || MsgBeep() }
@ 50, 50 BUTTON "&Ok" OF oDlg ACTION MsgInfo( "Click" ) pixel
@ 100, 50 BUTTON "&Ok" OF oDlg ACTION MsgInfo( "Click" ) pixel
@ 100, 100 SAY "Factura : " OF oDlg pixel color CLR_WHITE, CLR_BLACK FONT oFont2
@ 110, 100 GET oGet VAR cName of oDlg SIZE 100, 25 PICTURE "@!k" PIXEL UPDATE FONT oFont1 CENTER
oGet:SetColor( CLR_HBLUE, CLR_WHITE )
oGet:cToolTip := 'Testing a Get in windows child and dialog'
ACTIVATE DIALOG oDlg NOWAIT ; // It has to be NonModal --> NOWAIT clause
ON INIT oDlg:Move( 0, 0 )
oWndChild:bResized := {|| ResizeWndMain() }
ACTIVATE WINDOW oWndChild //;
// ON INIT oWndChild:SetSize( oDlg:nWidth, oDlg:nHeight )
return nil
Function ResizeWndMain()
local aClient
if oDlg != NIL
aClient := GetClientRect (oWndChild:hWnd )
oDlg:SetSize( aClient[4], aClient[3] )
oDlg:Refresh()
SysRefresh()
endif
return NIL
Por cierto, este ejemplo trabaja con MDI, y un dialogo montado en una windows CHILD.