Board index » cppbuilder » TComponent runtime parentage

TComponent runtime parentage


2004-09-07 01:05:03 AM
cppbuilder68
I am attempting to write a package that will allow a user to profile the application at design time, but I have two problems.
1.)The idea is to create a treeview of the current form within the design time, but using TComponet I cannot find a way of working out the relationship between each Component (Same as object viewer).
2.) How can I create an instance of IDesigner at runtime so that I can then turn on/off controls dependant upon the user profile.
 
 

Re:TComponent runtime parentage

"Graham" < XXXX@XXXXX.COM >wrote in message
Quote
1.)The idea is to create a treeview of the current form within the
design time, but using TComponet I cannot find a way of working
out the relationship between each Component (Same as object viewer).
Cast the TComponent to a TWinControl and then use its Controls[] property.
Quote
2.) How can I create an instance of IDesigner at runtime
You don't.
Quote
so that I can then turn on/off controls dependant upon the user profile.
Why do you need IDesigner for that? Please elaborate.
Gambit
 

Re:TComponent runtime parentage

Thanks for part 1.
as for part 2, the idea is to have a database of all the controls, and different user profiles. Each form would a have a profile component placed on it which would look up in the database the controls the user is allowed to view / control. Using the designer interface, the profile control would hide, enable TWinControls. By using the design interface and a database for the control, the profile component would be generic to use on all the forms without and additional coding. If you cannot use IDesigner is ther anothe interface I can use?
Thanks.
"Remy Lebeau \(TeamB\)" < XXXX@XXXXX.COM >wrote:
Quote

"Graham" < XXXX@XXXXX.COM >wrote in message
news:413c98bf$ XXXX@XXXXX.COM ...

>1.)The idea is to create a treeview of the current form within the
>design time, but using TComponet I cannot find a way of working
>out the relationship between each Component (Same as object viewer).

Cast the TComponent to a TWinControl and then use its Controls[] property.

>2.) How can I create an instance of IDesigner at runtime

You don't.

>so that I can then turn on/off controls dependant upon the user profile.

Why do you need IDesigner for that? Please elaborate.


Gambit


 

{smallsort}