DPageFrame
From Dabo Wiki
Jump to navigationJump to search
dPageFrame is the most common form of the paged controls; its most distinctive feature is a series of tabs; one for each page in the control. It contains several pages, only one of which is visible at any time. The user switches pages by clicking on the tab for that page. The tabs have a Caption and an optional icon.
Some of the more useful properties for dPageFrame:
- PageClass - (dPage): The default class to use for pages added to the control.
- PageCount - (int): This isn't just a read-only counting of pages; changing this property will add or delete pages to bring the total number of pages in line.
- Pages - (list): a read-only list of the pages in this control.
- PageSizerClass - (dSizer or dGridSizer): When a new page is created, this is the class of the sizer that is automatically added to it.
- SelectedPage - (dPage): A reference to the currently visible page.
- SelectedPageNumber - (int): The index of the
SelectedPage. - TabPosition - (str): Determines which side of the control the tabs appear on. Can be one of:
Top(default),Bottom,Left, orRight. Must be passed at construction time; setting it after the control has already been created has no effect.
Some of the more useful methods for dPageFrame:
- appendPage(page) - (dPage): Adds a new page to the control. page can be either a page instance or a page class to be instantiated. The page is placed in the last position in the control, and a reference to it is returned.
- insertPage(pos, page) - (dPage): Adds a new page to the control.
pagecan be either a page instance or a page class to be instantiated. The page is placed in the position specified bypos, and a reference to it is returned. - removePage(pgOrPos, delete=True) - (None or dPage): Removes the specified page from the control. You can pass a reference to the page, or its index in the control. If
deleteisFalse, the page is not destroyed, and a reference to it is returned. Otherwise, the page is destroyed andNoneis returned. - movePage(oldPgOrPos, newPos, selecting=True) - (None or True): Changes the position of the specified page. If the old and new positions are the same, nothing happens and
Noneis returned; otherwise, the page is moved andTrueis returned. Unless you passselecting=False, the specified page is selected. - cyclePages(num) - (None): Moves through the pages by the specified amount, wrapping around the ends. Negative values move to previous pages; positive move through the next pages.
See the Dabo Class Documentation for an exhaustive documentation of this control's Properties, Events and Methods. (Note that this documentation is no longer live, but it's still available via the Internet Archive).