驴Puede funcionar en dialogos?
Estoy generando los controles sin recursos, por puro c贸digo
驴Puede funcionar en dialogos?
Estoy generando los controles sin recursos, por puro c贸digo
creswinman wrote:驴Puede funcionar en dialogos?
Estoy generando los controles sin recursos, por puro c贸digo
#include "FWCE.ch"
//----------------------------------------------------------------------------//
function Main()
local oWnd, oPanel
local cName := Space( 20 ), cAddress := Space( 30 )
DEFINE DIALOG oDlg FROM 1,1 TO 180,180 TITLE "Scroll" PIXEL
@ 1 , 1 PANEL oPanel OF oDlg SIZE oDlg:nWidth() - 26, oDlg:nHeight() - 48 PIXEL
@ 40, 1 SAY "Name:" OF oPanel SIZE 40, 15 PIXEL
@ 60, 1 GET cName OF oPanel SIZE 100, 18 PIXEL
@ 140, 1 SAY "Address:" OF oDlg SIZE 50, 15 PIXEL
@ 160, 1 GET cAddress OF oDlg SIZE 120, 18 PIXEL
ACTIVATE DIALOG oDlg
return nil/*
METHOD DefControl( oCtrl ) CLASS TPanel
DEFAULT oCtrl:nId := oCtrl:GetNewId()
if AScan( ::oWnd:aControls, { | o | o:nId == oCtrl:nId } ) > 0
#define DUPLICATED_CONTROLID 2
Eval( ErrorBlock(), _FWGenError( DUPLICATED_CONTROLID, ;
"No: " + Str( oCtrl:nId, 6 ) ) )
else
AAdd( ::oWnd:aControls, oCtrl )
oCtrl:hWnd = 0
endif
return nil
*/#include "FWCE.ch"
//----------------------------------------------------------------------------//
function Main()
local oWnd, oPanel
local cName := Space( 20 ), cAddress := Space( 30 )
DEFINE DIALOG oDlg FROM 1,1 TO 180,180 TITLE "Scroll" PIXEL
@ 1 , 1 PANEL oPanel OF oDlg SIZE oDlg:nWidth() - 26, oDlg:nHeight() - 48 PIXEL
@ 140, 1 SAY "Address:" OF oDlg SIZE 50, 15 PIXEL
@ 160, 1 GET cAddress OF oDlg SIZE 120, 18 PIXEL
ACTIVATE DIALOG oDlg ;
ON INIT PanelControls( oPanel )
return nil
function PanelControls( oPanel )
local cName := Space( 20 )
@ 40, 1 SAY "Name:" OF oPanel SIZE 40, 15 PIXEL
@ 60, 1 GET cName OF oPanel SIZE 100, 18 PIXEL
return nilAntonio Linares wrote:Vikthor,
Hazlo as铆:
#include "FWCE.ch" //----------------------------------------------------------------------------// function Main() local oWnd, oPanel local cName := Space( 20 ), cAddress := Space( 30 ) DEFINE DIALOG oDlg FROM 1,1 TO 180,180 TITLE "Scroll" PIXEL @ 1 , 1 PANEL oPanel OF oDlg SIZE oDlg:nWidth() - 26, oDlg:nHeight() - 48 PIXEL @ 140, 1 SAY "Address:" OF oDlg SIZE 50, 15 PIXEL @ 160, 1 GET cAddress OF oDlg SIZE 120, 18 PIXEL ACTIVATE DIALOG oDlg ; ON INIT PanelControls( oPanel ) return nil function PanelControls( oPanel ) local cName := Space( 20 ) @ 40, 1 SAY "Name:" OF oPanel SIZE 40, 15 PIXEL @ 60, 1 GET cName OF oPanel SIZE 100, 18 PIXEL return nil
if ! Empty( ::oWnd:hWnd )
::Create("")
::oWnd:AddControl( Self )
DEFINE SCROLLBAR ::oVScroll VERTICAL OF Self
::oVScroll:SetRange( 0, 100 )
else
::oWnd:DefControl( Self )
DEFINE SCROLLBAR ::oVScroll VERTICAL OF Self
::oVScroll:SetRange( 0, 100 )
endifVikthor,
Cuando se crea un di谩logo desde c贸digo fuente se construye un RC en memoria. En un RC no se pueden especificar controles hijos de controles. Es una limitaci贸n de los ficheros RC. S贸lo el dialogo principal y sus controles hijos.