In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.

Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.

Re: TFolder

Xailer professional forum in English
Responder
Avatar de Usuario
jfgimenez
Site Admin
Mensajes: 5718
Registrado: Lun Abr 06, 2015 8:48 pm
Contactar:

Re: TFolder

Mensaje por jfgimenez »

Giuseppe,
> Is it possible to define a TFolderPage using the IDE like a TForm and than
> add it dynamically to a TFolder control ?
There is a trick I'm using:
- Make your main form the first form of your project, to make it available
as Application:oMainForm in the whole program.
- Design the forms as usual, but don't change any property of it, excepting
nleft, ntop, nwidth and nheight
- Modify the CLASS declaration from:
CLASS TForm1 FROM TForm
to:
CLASS TForm1 FROM TFolderForm
- Put the following code in any .prg of your project (you can create a new
..prg if you want):
//---------------------------------------------------------- --------------------
CLASS TFolderForm FROM TFolderPage
DATA nFormType
METHOD New( oParent )
METHOD CreateForm() VIRTUAL
METHOD Close() INLINE ::Delete()
ENDCLASS
//---------------------------------------------------------- --------------------
METHOD New( oParent ) CLASS TFolderForm
// Change oFolder1 to the apropiate name
Super:New( Application:oMainForm:oFolder1 )
::CreateForm()
::Select()
::SetFocus()
RETURN Self
//---------------------------------------------------------- --------------------
- To call the form, do it as usual, but without calling :Show() or
:ShowModal(). I.e.:
TForm1:New()
- Notice that now it's not a form, but a folder page, so be careful using
it. I.e., don't call ShowModal(), don't use default or cancel buttons on it,
etc.
That's all ;-)
--
Regards,
Jose F. Gimenez
José F. Giménez
[Equipo de Xailer / Xailer team]
http://www.xailer.com
http://www.xailer.info
Giuseppe Bogetti
Mensajes: 281
Registrado: Vie Ago 04, 2006 4:58 pm

Re: TFolder

Mensaje por Giuseppe Bogetti »

In data Tue, 13 Sep 2005 11:06:58 +0200, Jose F. Gimenez ha scritto:
> Giuseppe,
>
>> Is it possible to define a TFolderPage using the IDE like a TForm and than
>> add it dynamically to a TFolder control ?
>
> There is a trick I'm using:
>
> - Make your main form the first form of your project, to make it available
> as Application:oMainForm in the whole program.
>
> - Design the forms as usual, but don't change any property of it, excepting
> nleft, ntop, nwidth and nheight
>
> - Modify the CLASS declaration from:
> CLASS TForm1 FROM TForm
> to:
> CLASS TForm1 FROM TFolderForm
>
> - Put the following code in any .prg of your project (you can create a new
> .prg if you want):
>
> //---------------------------------------------------------- --------------------
>
> CLASS TFolderForm FROM TFolderPage
>
> DATA nFormType
>
> METHOD New( oParent )
> METHOD CreateForm() VIRTUAL
> METHOD Close() INLINE ::Delete()
>
> ENDCLASS
>
> //---------------------------------------------------------- --------------------
>
> METHOD New( oParent ) CLASS TFolderForm
>
> // Change oFolder1 to the apropiate name
> Super:New( Application:oMainForm:oFolder1 )
>
> ::CreateForm()
> ::Select()
> ::SetFocus()
>
> RETURN Self
>
> //---------------------------------------------------------- --------------------
>
> - To call the form, do it as usual, but without calling :Show() or
>:ShowModal(). I.e.:
> TForm1:New()
>
> - Notice that now it's not a form, but a folder page, so be careful using
> it. I.e., don't call ShowModal(), don't use default or cancel buttons on it,
> etc.
>
>
> That's all ;-)
Thanks.
PreRelease 5 really rocks !!!
--
Best regards,
Giuseppe Bogetti
B.G. Soft
Cuneo - Italy
Giuseppe Bogetti
Mensajes: 281
Registrado: Vie Ago 04, 2006 4:58 pm

Re: TFolder

Mensaje por Giuseppe Bogetti »

In data Tue, 13 Sep 2005 11:06:58 +0200, Jose F. Gimenez ha scritto:
> Giuseppe,
>
>> Is it possible to define a TFolderPage using the IDE like a TForm and than
>> add it dynamically to a TFolder control ?
>
> There is a trick I'm using:
>
> - Make your main form the first form of your project, to make it available
> as Application:oMainForm in the whole program.
>
> - Design the forms as usual, but don't change any property of it, excepting
> nleft, ntop, nwidth and nheight
>
> - Modify the CLASS declaration from:
> CLASS TForm1 FROM TForm
> to:
> CLASS TForm1 FROM TFolderForm
>
> - Put the following code in any .prg of your project (you can create a new
> .prg if you want):
>
> //---------------------------------------------------------- --------------------
>
> CLASS TFolderForm FROM TFolderPage
>
> DATA nFormType
>
> METHOD New( oParent )
> METHOD CreateForm() VIRTUAL
> METHOD Close() INLINE ::Delete()
>
> ENDCLASS
>
> //---------------------------------------------------------- --------------------
>
> METHOD New( oParent ) CLASS TFolderForm
>
> // Change oFolder1 to the apropiate name
> Super:New( Application:oMainForm:oFolder1 )
>
> ::CreateForm()
> ::Select()
> ::SetFocus()
>
> RETURN Self
>
> //---------------------------------------------------------- --------------------
>
> - To call the form, do it as usual, but without calling :Show() or
>:ShowModal(). I.e.:
> TForm1:New()
>
> - Notice that now it's not a form, but a folder page, so be careful using
> it. I.e., don't call ShowModal(), don't use default or cancel buttons on it,
> etc.
>
>
> That's all ;-)
Thanks.
PreRelease 5 really rocks !!!
--
Best regards,
Giuseppe Bogetti
B.G. Soft
Cuneo - Italy
Giuseppe Bogetti
Mensajes: 281
Registrado: Vie Ago 04, 2006 4:58 pm

Re: TFolder

Mensaje por Giuseppe Bogetti »

In data Tue, 13 Sep 2005 11:06:58 +0200, Jose F. Gimenez ha scritto:
Jose,
> - Design the forms as usual, but don't change any property of it, excepting
> nleft, ntop, nwidth and nheight
Is it safe to set nBorderStyle to bsNONE ?
--
Best regards,
Giuseppe Bogetti
B.G. Soft
Cuneo - Italy
Giuseppe Bogetti
Mensajes: 281
Registrado: Vie Ago 04, 2006 4:58 pm

Re: TFolder

Mensaje por Giuseppe Bogetti »

In data Tue, 13 Sep 2005 11:06:58 +0200, Jose F. Gimenez ha scritto:
Jose,
> - Design the forms as usual, but don't change any property of it, excepting
> nleft, ntop, nwidth and nheight
Is it safe to set nBorderStyle to bsNONE ?
--
Best regards,
Giuseppe Bogetti
B.G. Soft
Cuneo - Italy
Avatar de Usuario
jfgimenez
Site Admin
Mensajes: 5718
Registrado: Lun Abr 06, 2015 8:48 pm
Contactar:

Re: TFolder

Mensaje por jfgimenez »

Giuseppe,
>> - Design the forms as usual, but don't change any property of it,
>> excepting
>> nleft, ntop, nwidth and nheight
>
> Is it safe to set nBorderStyle to bsNONE ?
I don't think so. Notice that you are designing a form that will be used as
a TFolderPage. So, you can only change any property that TFolderPage have,
and nBorderStyle is not one of them.
--
Regards,
Jose F. Gimenez
José F. Giménez
[Equipo de Xailer / Xailer team]
http://www.xailer.com
http://www.xailer.info
Avatar de Usuario
jfgimenez
Site Admin
Mensajes: 5718
Registrado: Lun Abr 06, 2015 8:48 pm
Contactar:

Re: TFolder

Mensaje por jfgimenez »

Giuseppe,
>> - Design the forms as usual, but don't change any property of it,
>> excepting
>> nleft, ntop, nwidth and nheight
>
> Is it safe to set nBorderStyle to bsNONE ?
I don't think so. Notice that you are designing a form that will be used as
a TFolderPage. So, you can only change any property that TFolderPage have,
and nBorderStyle is not one of them.
--
Regards,
Jose F. Gimenez
José F. Giménez
[Equipo de Xailer / Xailer team]
http://www.xailer.com
http://www.xailer.info
Giuseppe Bogetti
Mensajes: 281
Registrado: Vie Ago 04, 2006 4:58 pm

Re: TFolder

Mensaje por Giuseppe Bogetti »

In data Tue, 13 Sep 2005 11:06:58 +0200, Jose F. Gimenez ha scritto:
Jose
> Giuseppe,
>
>> Is it possible to define a TFolderPage using the IDE like a TForm and than
>> add it dynamically to a TFolder control ?
>
> There is a trick I'm using:
>
> - Make your main form the first form of your project, to make it available
> as Application:oMainForm in the whole program.
>
> - Design the forms as usual, but don't change any property of it, excepting
> nleft, ntop, nwidth and nheight
>
> - Modify the CLASS declaration from:
> CLASS TForm1 FROM TForm
> to:
> CLASS TForm1 FROM TFolderForm
>
> - Put the following code in any .prg of your project (you can create a new
> .prg if you want):
>
> //---------------------------------------------------------- --------------------
>
> CLASS TFolderForm FROM TFolderPage
>
> DATA nFormType
>
> METHOD New( oParent )
> METHOD CreateForm() VIRTUAL
> METHOD Close() INLINE ::Delete()
>
> ENDCLASS
>
> //---------------------------------------------------------- --------------------
>
> METHOD New( oParent ) CLASS TFolderForm
>
> // Change oFolder1 to the apropiate name
> Super:New( Application:oMainForm:oFolder1 )
>
> ::CreateForm()
> ::Select()
> ::SetFocus()
>
> RETURN Self
>
> //---------------------------------------------------------- --------------------
>
> - To call the form, do it as usual, but without calling :Show() or
>:ShowModal(). I.e.:
> TForm1:New()
>
> - Notice that now it's not a form, but a folder page, so be careful using
> it. I.e., don't call ShowModal(), don't use default or cancel buttons on it,
> etc.
>
>
> That's all ;-)
Is it possibile to add an event handler for the OnSize event ?
I think of adding:
EVENT OnSize( oSender, nSizeType, nClientWidth, nClientHeight )
But then I don't know how to define the OnSize method to handle the event.
--
Best regards,
Giuseppe Bogetti
B.G. Soft
Cuneo - Italy
Giuseppe Bogetti
Mensajes: 281
Registrado: Vie Ago 04, 2006 4:58 pm

Re: TFolder

Mensaje por Giuseppe Bogetti »

In data Tue, 13 Sep 2005 11:06:58 +0200, Jose F. Gimenez ha scritto:
Jose
> Giuseppe,
>
>> Is it possible to define a TFolderPage using the IDE like a TForm and than
>> add it dynamically to a TFolder control ?
>
> There is a trick I'm using:
>
> - Make your main form the first form of your project, to make it available
> as Application:oMainForm in the whole program.
>
> - Design the forms as usual, but don't change any property of it, excepting
> nleft, ntop, nwidth and nheight
>
> - Modify the CLASS declaration from:
> CLASS TForm1 FROM TForm
> to:
> CLASS TForm1 FROM TFolderForm
>
> - Put the following code in any .prg of your project (you can create a new
> .prg if you want):
>
> //---------------------------------------------------------- --------------------
>
> CLASS TFolderForm FROM TFolderPage
>
> DATA nFormType
>
> METHOD New( oParent )
> METHOD CreateForm() VIRTUAL
> METHOD Close() INLINE ::Delete()
>
> ENDCLASS
>
> //---------------------------------------------------------- --------------------
>
> METHOD New( oParent ) CLASS TFolderForm
>
> // Change oFolder1 to the apropiate name
> Super:New( Application:oMainForm:oFolder1 )
>
> ::CreateForm()
> ::Select()
> ::SetFocus()
>
> RETURN Self
>
> //---------------------------------------------------------- --------------------
>
> - To call the form, do it as usual, but without calling :Show() or
>:ShowModal(). I.e.:
> TForm1:New()
>
> - Notice that now it's not a form, but a folder page, so be careful using
> it. I.e., don't call ShowModal(), don't use default or cancel buttons on it,
> etc.
>
>
> That's all ;-)
Is it possibile to add an event handler for the OnSize event ?
I think of adding:
EVENT OnSize( oSender, nSizeType, nClientWidth, nClientHeight )
But then I don't know how to define the OnSize method to handle the event.
--
Best regards,
Giuseppe Bogetti
B.G. Soft
Cuneo - Italy
Avatar de Usuario
jfgimenez
Site Admin
Mensajes: 5718
Registrado: Lun Abr 06, 2015 8:48 pm
Contactar:

Re: TFolder

Mensaje por jfgimenez »

Guiseppe,
> Is it possibile to add an event handler for the OnSize event ?
>
> I think of adding:
> EVENT OnSize( oSender, nSizeType, nClientWidth, nClientHeight )
>
> But then I don't know how to define the OnSize method to handle the event.
The form, and in this case the folderpage, is a class. So, you can add any
method directly, including those that are called directly by the Xailer's
kernel when a windows message arrives to the control (WM_xxxxx). That is,
you can add the method WMSize() and process what ever you want:
METHOD WMSize( nWParam, nLParam ) CLASS TForm1
LOCAL nWidth := LoWord( nLParam )
LOCAL nHeight := HiWord( nLParam )
...
// It's important to call the previous method to allow the parent
// class to process the message
RETURN Super:WMSize( nWParam, nLParam )
However, I don't imagine what are you going to do here. If you want to
move/resize any control when the form is resized, you can play with nAlign
or nAnchors.
--
Un saludo,
José F. Giménez
José F. Giménez
[Equipo de Xailer / Xailer team]
http://www.xailer.com
http://www.xailer.info
Avatar de Usuario
jfgimenez
Site Admin
Mensajes: 5718
Registrado: Lun Abr 06, 2015 8:48 pm
Contactar:

Re: TFolder

Mensaje por jfgimenez »

Guiseppe,
> Is it possibile to add an event handler for the OnSize event ?
>
> I think of adding:
> EVENT OnSize( oSender, nSizeType, nClientWidth, nClientHeight )
>
> But then I don't know how to define the OnSize method to handle the event.
The form, and in this case the folderpage, is a class. So, you can add any
method directly, including those that are called directly by the Xailer's
kernel when a windows message arrives to the control (WM_xxxxx). That is,
you can add the method WMSize() and process what ever you want:
METHOD WMSize( nWParam, nLParam ) CLASS TForm1
LOCAL nWidth := LoWord( nLParam )
LOCAL nHeight := HiWord( nLParam )
...
// It's important to call the previous method to allow the parent
// class to process the message
RETURN Super:WMSize( nWParam, nLParam )
However, I don't imagine what are you going to do here. If you want to
move/resize any control when the form is resized, you can play with nAlign
or nAnchors.
--
Un saludo,
José F. Giménez
José F. Giménez
[Equipo de Xailer / Xailer team]
http://www.xailer.com
http://www.xailer.info
Giuseppe Bogetti
Mensajes: 281
Registrado: Vie Ago 04, 2006 4:58 pm

Re: TFolder

Mensaje por Giuseppe Bogetti »

In data Thu, 6 Oct 2005 17:19:13 +0200, Jose F. Gimenez ha scritto:
> Guiseppe,
>
>> Is it possibile to add an event handler for the OnSize event ?
>>
>> I think of adding:
>> EVENT OnSize( oSender, nSizeType, nClientWidth, nClientHeight )
>>
>> But then I don't know how to define the OnSize method to handle the event.
>
> The form, and in this case the folderpage, is a class. So, you can add any
> method directly, including those that are called directly by the Xailer's
> kernel when a windows message arrives to the control (WM_xxxxx). That is,
> you can add the method WMSize() and process what ever you want:
>
> METHOD WMSize( nWParam, nLParam ) CLASS TForm1
>
> LOCAL nWidth := LoWord( nLParam )
> LOCAL nHeight := HiWord( nLParam )
> ...
> // It's important to call the previous method to allow the parent
> // class to process the message
> RETURN Super:WMSize( nWParam, nLParam )
>
> However, I don't imagine what are you going to do here.
For example in one forms I have a two column array browser. What I would
like to achieve is:
- first column has always the same size.
- second column always fills the remaing part of browser area. That is
grows when the form is maximized and shrinks when the form is restored to
original size.
--
Best regards,
Giuseppe Bogetti
B.G. Soft
Cuneo - Italy
Giuseppe Bogetti
Mensajes: 281
Registrado: Vie Ago 04, 2006 4:58 pm

Re: TFolder

Mensaje por Giuseppe Bogetti »

In data Thu, 6 Oct 2005 17:19:13 +0200, Jose F. Gimenez ha scritto:
> Guiseppe,
>
>> Is it possibile to add an event handler for the OnSize event ?
>>
>> I think of adding:
>> EVENT OnSize( oSender, nSizeType, nClientWidth, nClientHeight )
>>
>> But then I don't know how to define the OnSize method to handle the event.
>
> The form, and in this case the folderpage, is a class. So, you can add any
> method directly, including those that are called directly by the Xailer's
> kernel when a windows message arrives to the control (WM_xxxxx). That is,
> you can add the method WMSize() and process what ever you want:
>
> METHOD WMSize( nWParam, nLParam ) CLASS TForm1
>
> LOCAL nWidth := LoWord( nLParam )
> LOCAL nHeight := HiWord( nLParam )
> ...
> // It's important to call the previous method to allow the parent
> // class to process the message
> RETURN Super:WMSize( nWParam, nLParam )
>
> However, I don't imagine what are you going to do here.
For example in one forms I have a two column array browser. What I would
like to achieve is:
- first column has always the same size.
- second column always fills the remaing part of browser area. That is
grows when the form is maximized and shrinks when the form is restored to
original size.
--
Best regards,
Giuseppe Bogetti
B.G. Soft
Cuneo - Italy
Responder