Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Container object in a grid column
Message
De
09/05/2003 10:06:30
 
 
À
09/05/2003 09:23:07
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00786698
Message ID:
00786767
Vues:
24
(snip)

>
>I don't knwo why not working for you. Tried a quick test and it worked :
>
>Use customer
>Public oForm
>oForm = Createobject('Form')
>oForm.Newobject('myGrid','Grid')
>oForm.myGrid.RecordSource = 'customer'
>oForm.myGrid.Newobject('NewColumn','myColumn')
>oForm.myGrid.NewColumn.ColumnOrder = 1
>oForm.myGrid.NewColumn.Resize()
>oForm.SetAll('Visible',.T.)
>oForm.Show
>
>
>Define Class myColumn As Column
>  Procedure Resize
>    For Each loCtl In This.Controls
>      If loCtl.BaseClass = "Container" Then
>        loCtl.Resize()
>      Endif
>      loCtl = .Null.
>    Next loCtl
>    This.Refresh
>  Endproc
>  Procedure Init
>    This.Newobject('myControl','myContainer')
>    This.CurrentControl = 'myControl'
>    This.Sparse = .F.
>  Endproc
>Enddefine
>
>Define Class myContainer As Container
>  Height = 20
>  Width = 100
>  Add Object cmdFindCustomer As CommandButton With Left = 60, Width=38, Caption='...'
>  Add Object txtCustomerName As TextBox With Left = 2, Width = 50
>  Procedure Resize
>    If Type('This.Parent.Parent.RowHeight')='N' ;
>        and This.Parent.Parent.RowHeight > 10 ;
>        And This.Parent.Width > 10 Then
>      Local lnWidth,lnHeight
>      lnWidth = This.Parent.Width
>      lnHeight = This.Parent.Parent.RowHeight
>      This.Width = lnWidth
>      This.Height = lnHeight
>
>      With This.cmdFindCustomer
>        .Top = 0
>        .Width = lnHeight
>        .Height = lnHeight
>        .Left = lnWidth - .Width
>      Endwith
>
>      With This.txtCustomerName
>        .Top = 0
>        .Left = 0
>        .Height = lnHeight
>        .Width = lnWidth - lnHeight
>      Endwith
>    Endif
>  Endproc
>Enddefine
>
Cetin

Cetin,

Your code works for me as well. Another factor may be that I'm using DynamicCurrentControl to use various versions of this control and others. I will work further with your code to see if that may be the problem.

I appreciate your time helping me here!

Don
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform