BrowserFrame

The base widget is inherited by all widgets and can be used to share common code between all widgets, for example event registration and basic fields. You do not have to explicitly inherit this class with the Base field in your widget definition, the inheritance is automatic.

Inherited Classes: None
Implements Constructor: No
Implements Initializer: Yes
XML Templates: PowaBrowserFrameBaseTemplate, PowaBrowserFrameTemplate
Fields: MaxPage, MinPage, Page
Hooks: None
Scripts: None

Methods

Init(self, min, max, update)


Description

Initializes the widget, defining a minimum and maximum page boundary and a function to be called whenever the page is changed.

Arguments

self
The reference to the frame which is being initialized as a UI widget. This frame must inherit one of the two XML templates in order for the widget to function correctly.

min
The minimum page number, this should normally be set to 1. Any attempt to set the page number below this will fail and will instead default to this number.

max
The maximum page number, this should reflect the amount of content you wish to display. If you want unlimited pages, simply set a very high number. Any attempts to exceed this limit will also fail.

update
The function to be executed whenever the page is changed. It is passed two arguments, the frame reference and the new page number. This is called after any page number alterations take effect, such as limiting the page to within the minimum and maximum boundaries, as such it may fire multiple times for the same page. You can change this after initialization by changing the OnPageChanged field of the frame.

Returns

This function has no return value.

FirstPage(self)


Description

Changes the page of the referenced BrowserFrame widget to the first page, as defined by the minimum page number set either in the Init or SetMinPage functions.

Arguments

self
The reference to the frame which you want to change the page for.

Returns

This function has no return values.

LastPage(self)


Description

Changes the page of the referenced BrowserFrame widget to the last page, as defined by the maximum page number set either in the Init or SetMaxPage functions.

Arguments

self
The reference to the frame which you want to change the page for.

Returns

This function has no return values.

NextPage(self)


Description

Changes the page of the referenced BrowserFrame widget to the next page. If there is no page after the current one due to hitting the maximum page number, the page number will stay the same.

Arguments

self
The reference to the frame which you want to change the page for.

Returns

This function has no return values.

PrevPage(self)


Description

Changes the page of the referenced BrowserFrame widget to the previous page. If there is no page before the current one due to hitting the minimum page number, the page number will stay the same.

Arguments

self
The reference to the frame which you want to change the page for.

Returns

This function has no return values.

SetMaxPage(self, page)


Description

Changes the maximum page boundary, and triggers a page update in the process to ensure that the current page is within this new boundary.

Arguments

self
The reference to the frame which you want to change the page for.

page
The new maximum page number to set.

Returns

This function has no return values.

SetMinPage(self, page)


Description

Changes the minimum page boundary, and triggers a page update in the process to ensure that the current page is within this new boundary.

Arguments

self
The reference to the frame which you want to change the page for.

page
The new minimum page number to set.

Returns

This function has no return values.

SetPage(self, page)


Description

Attempts to change the current page to the given page number. If the given page is not within the minimum or maximum page boundaries, it will be capped at the closest boundary. This will trigger the OnPageChanged function to fire.

Arguments

self
The reference to the frame which you want to change the page for.

page
The new page number to go to.

Returns

This function has no return values.

Known Issues

There are no known issues.

Future Features

  • In current builds, the OnPageChanged field referenced is actually named UpdatePage. This will be changed soon.

Last edited May 1, 2011 at 8:19 PM by dyates92, version 5

Comments

No comments yet.