On Aug 30, 2008, at 8:17 AM, Sibylle Koczian wrote:

> I don't understand the API documentation of dPageFrame.appendPage: the
> parameters are pgCls, caption, imgKey. pgCls seems to be a reference  
> to the
> _class_ of the page being added, right? How do I get a reference to  
> the
> instance to add controls to the page?
>
> There is no dPageFrame demo which would show how to do it.
>
> Or should I always create a dPage subclass, complete with the  
> controls i want
> my page to have? But even then, what if I wanted to add several  
> instances of
> the same subclass?
>
> Or what did I miss here?

        OK, there are several ways to do this. Let's start with the simplest.

        If you just want the standard dPage as you class, and will then add  
your own controls, etc., to that page, then simply set the PageCount  
property to the desired number of pages you want in your pageframe.  
You can then reference them by index in the pageframe's Pages property.

        If you want to append/insert a basic page and get back a reference to  
that page, then call pgf.appendPage() or pgf.insertPage(pos). If you  
have your own custom page class that you want to use, pass that class  
to these methods. The pageframe will use the dPage class if you don't  
specify a class.

        Another case: let's say you have instantiated a page object, and now  
want to add it to an existing pageframe. You still use  
pgf.appendPage(pgObj) or pgf.insertPage(pos, pgObj). As long as your  
page object is an instance of dPage or any class based on dPage, the  
framework will recognize that and simply append/insert the page object.

        Finally, if you have a custom page that you want all of your pages  
based upon, set the PageClass property of the pageframe to your custom  
class, and when the pageframe adds a page, it will use that class.

        I can see how all these options can be confusing, but in this case, I  
think the flexibility is worth it.


-- Ed Leafe





_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/[EMAIL PROTECTED]

Reply via email to