Page 1 of 1

para Antonio Linhares

Posted: Mon Oct 06, 2008 1:10 pm
by giba_f
Ola ! se puder me ajudar, fico muito agradecido:

Tenho um dialog, e estou tentando criar um outro dialog, dentro desse, mas dah o erro:

Error description: Error FiveWin/3 Cannot create Dialog Box:
Title:

Stack Calls
===========
Called from: dialog.prg => CREATEDLGERROR(555)
Called from: dialog.prg => TDIALOG:ACTIVATE(314)


estou fazendo assim:

...
DEFINE DIALOG oDlg From 00,00 to 325,355 TITLE "titulo." PIXEL OF oWndIni COLORS CLR_WHITE,CLR_WHITE STYLE nOr(DS_MODALFRAME)

oFld := cFolder():New(05,05,{"Aba1","Aba2","Aba3"},oDlg,CLR_BLUE,CLR_WHITE,CLR_WHITE,300,300,oFonSay,.T.,1,.F.)


ACTIVATE DIALOG oDlg CENTERED
...
return(Nil)


*----------------------------------------------------*

CLASS cFolder
DATA aDialogs
METHOD New(nTop,nLeft,aPrompts,oDlgPai,nCor1,nCor2,nCor3,nWidth,nHeight,oFonte,lPixel,nOption,lDesign) CONSTRUCTOR
ENDCLASS

METHOD New(nTop,nLeft,aPrompts,oDlgPai,nCor1,nCor2,nCor3,nWidth,nHeight,oFonte,lPixel,nOption,lDesign) CLASS cFolder
Local i,oDlgFld,oAbas
DEFAULT aPrompts := {"Aba&1","Aba&2","Aba&3"} , oDlgPai := GetWndDefault() ,nCor1 := CLR_BLUE , nCor2 := CLR_WHITE , nCor3 := CLR_BLACK ,;
nWidth := 100 , nHeight := 100 , oFonte := oFonSay , lPixel := .T. , nOption := 1 , lDesign := .F.


oDlgFld:=TDialog():New(nTop,nLeft,nWidth,nHeight,,,,.F.,NOR(WS_VISIBLE,WS_DLGFRAME,WS_CHILD,WS_VSCROLL),nCor3,nCor3,,oDlgPai,.T.,,,,,)
TTabs():New(nTop,nLeft,aPrompts,{||.t. },oDlgFld,nOption,nCor1,nCor2,lPixel,lDesign,nWidth,nHeight,)
oDlgFld:Activate(oDlgFld:bLClicked,oDlgFld:bMoved,oDlgFld:bPainted,.F.,, .F. ,,oDlgFld:bRClicked,{||.T.},)
Return(Self)


Qual seria o problema ???
acho q esta no style WS_CHILD, q se eu tirar ele, nao dah o erro, mas tambem nao faz o q estou precisando.

aaaaaa, um detalhe, nao pode ser por ON INIT.


Desde ja agradeco: MUITO OBRIGADO !!!

Giba

Posted: Mon Oct 06, 2008 6:28 pm
by Antonio Linares
Giba,

Aqui tienes un ejemplo funcionando. Porque no usas los comandos estandard de FiveWin ? La programación te será mucho mas fácil

Code: Select all

#include "FiveWin.ch"

function Main()

   local oDlg

DEFINE DIALOG oDlg From 00,00 to 325,355 TITLE "titulo." PIXEL COLORS CLR_WHITE,CLR_WHITE STYLE nOr(DS_MODALFRAME) 

oFld := cFolder():New(05,05,{"Aba1","Aba2","Aba3"},oDlg,CLR_BLUE,CLR_WHITE,CLR_WHITE,300,300,,.T.,1,.F.) 


ACTIVATE DIALOG oDlg CENTERED 

return(Nil) 


*----------------------------------------------------* 

CLASS cFolder 
DATA aDialogs 
METHOD New(nTop,nLeft,aPrompts,oDlgPai,nCor1,nCor2,nCor3,nWidth,nHeight,oFonte,lPixel,nOption,lDesign) CONSTRUCTOR 
ENDCLASS 

METHOD New(nTop,nLeft,aPrompts,oDlgPai,nCor1,nCor2,nCor3,nWidth,nHeight,oFonte,lPixel,nOption,lDesign) CLASS cFolder 
Local i,oDlgFld,oAbas 
DEFAULT aPrompts := {"Aba&1","Aba&2","Aba&3"} , oDlgPai := GetWndDefault() ,nCor1 := CLR_BLUE , nCor2 := CLR_WHITE , nCor3 := CLR_BLACK ,; 
nWidth := 100 , nHeight := 100 , lPixel := .T. , nOption := 1 , lDesign := .F. 

oDlgFld = TDialog():New( 00, 00, 325, 355, "titulo.",,, .F., nOr(128), 16777215, 16777215,,, .T.,,,,,, .F. )
// oDlgFld:=TDialog():New(nTop,nLeft,nWidth,nHeight,,,,.F.,NOR(WS_VISIBLE,WS_DLGFRAME,WS_CHILD,WS_VSCROLL),nCor3,nCor3,,oDlgPai,.T.,,,,,)
TTabs():New(nTop,nLeft,aPrompts,{||.t. },oDlgFld,nOption,nCor1,nCor2,lPixel,lDesign,nWidth,nHeight,) 
oDlgFld:Activate(oDlgFld:bLClicked,oDlgFld:bMoved,oDlgFld:bPainted,.F.,, .F. ,,oDlgFld:bRClicked,{||.T.},) 
Return(Self) 

Posted: Mon Oct 06, 2008 6:43 pm
by Antonio Linares
Este es el código correcto. El problema es que estabas intentando crear un diálogo hijo y aún no estaba creado el diálogo padre! :-)

Code: Select all

#include "FiveWin.ch"

function Main()

   local oDlg, oFld

DEFINE DIALOG oDlg From 00,00 to 325,355 TITLE "titulo." PIXEL COLORS CLR_WHITE,CLR_WHITE STYLE nOr(DS_MODALFRAME) 

ACTIVATE DIALOG oDlg CENTERED ;
   ON INIT ( oFld := cFolder():New(05,05,{"Aba1","Aba2","Aba3"},oDlg,CLR_BLUE,CLR_WHITE,CLR_WHITE,300,300,,.T.,1,.F.)  )

return(Nil) 

*----------------------------------------------------* 

CLASS cFolder 
DATA aDialogs 
METHOD New(nTop,nLeft,aPrompts,oDlgPai,nCor1,nCor2,nCor3,nWidth,nHeight,oFonte,lPixel,nOption,lDesign) CONSTRUCTOR 
ENDCLASS 

METHOD New(nTop,nLeft,aPrompts,oDlgPai,nCor1,nCor2,nCor3,nWidth,nHeight,oFonte,lPixel,nOption,lDesign) CLASS cFolder 
Local i,oDlgFld,oAbas 
DEFAULT aPrompts := {"Aba&1","Aba&2","Aba&3"} , oDlgPai := GetWndDefault() ,nCor1 := CLR_BLUE , nCor2 := CLR_WHITE , nCor3 := CLR_BLACK ,;
nWidth := 100 , nHeight := 100 , lPixel := .T. , nOption := 1 , lDesign := .F. 


oDlgFld:=TDialog():New(nTop,nLeft,nWidth,nHeight,,,,.F.,NOR(WS_VISIBLE,WS_DLGFRAME,WS_CHILD,WS_VSCROLL),nCor3,nCor3,,oDlgPai,.T.,,,,,) 
TTabs():New(nTop,nLeft,aPrompts,{||.t. },oDlgFld,nOption,nCor1,nCor2,lPixel,lDesign,nWidth,nHeight,) 
oDlgFld:Activate(oDlgFld:bLClicked,oDlgFld:bMoved,oDlgFld:bPainted,.F.,, .F. ,,oDlgFld:bRClicked,{||.T.},) 
Return(Self) 

Posted: Tue Oct 07, 2008 2:12 pm
by giba_f
hummmmmmmmmm

mas, pra minha necessidade, nao pode ser no ON INIT !!!!


att