|
Home > Archive > FoxPro Help and Support > January 2006 > Creating a grid with define class in vfp 8.0
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Creating a grid with define class in vfp 8.0
|
|
| david dewasmes 2006-01-31, 7:24 am |
| I'am trying to create a gris class throught the define class statment
likethe example below. The problem is that when i'am trying to put the class
with the createobject method, I get a sintax error on the "Add Object" line.
Can someone tell me what i'am doing wrong ?
DEFINE CLASS grid_filha AS grid
ColumnCount = 1
Height = 295
Left = 4
Panel = 1
RecordSource = "xtpo"
Top = 53
Width = 627
p_muda_size = .F.
Name = "Lx_grid_base1"
Column1.ColumnOrder = 1
Column1.ControlSource = "xpto"
Column1.Width = 46
Column1.Sparse = .F.
Column1.Name = "col_tx_PECA"
ADD OBJECT grid_filha.col_tx_peca.h_tx_peca AS header WITH ;
FontName = "Tahoma", ;
FontSize = 8, ;
Alignment = 2, ;
Caption = "Peça", ;
Name = "H_tx_PECA"
enddefine
| |
| Stefan Wuebbe 2006-01-31, 7:24 am |
| In Define Class syntax, you'd need to put the nested containership in a
different way - especially with grids. You can create a dummyForm.SCX
and open it via the Class Browser's "View Class Code" button to get an
example.
In your case, one way might be using the MemberClass/HeaderClass
properties - in pseudo code:
Define Class myGrid as Grid
MemberClass = "myColumn"
EndDefine
Define Class myColumn as Column
HeaderClass = "myHeader"
EndDefine
Define Class myHeader
...
Or use the gridClass.Init() to put some This.NewObject() lines there.
hth
-Stefan
--
|\_/| ------ ProLib - programmers liberty -----------------
(.. ) Our MVPs and MCPs make the Fox run....
- / See us at www.prolib.de or www.AFPages.de
-----------------------------------------------------------
"david dewasmes" <david@invescorte.pt> schrieb im Newsbeitrag
news:ejuxh%23kJGHA.3260@TK2MSFTNGP11.phx.gbl...
> I'am trying to create a gris class throught the define class statment likethe example
> below. The problem is that when i'am trying to put the class with the createobject
> method, I get a sintax error on the "Add Object" line. Can someone tell me what i'am
> doing wrong ?
>
>
> DEFINE CLASS grid_filha AS grid
>
> ColumnCount = 1
> Height = 295
> Left = 4
> Panel = 1
> RecordSource = "xtpo"
> Top = 53
> Width = 627
> p_muda_size = .F.
> Name = "Lx_grid_base1"
> Column1.ColumnOrder = 1
> Column1.ControlSource = "xpto"
> Column1.Width = 46
> Column1.Sparse = .F.
> Column1.Name = "col_tx_PECA"
>
>
> ADD OBJECT grid_filha.col_tx_peca.h_tx_peca AS header WITH ;
> FontName = "Tahoma", ;
> FontSize = 8, ;
> Alignment = 2, ;
> Caption = "Peça", ;
> Name = "H_tx_PECA"
> enddefine
>
|
|
|
|
|