AGW Logo

agw_title FlatBookBase

Base class for the containing window for LabelBook and FlatImageBook.

hierarchy Inheritance Diagram

Inheritance diagram for: FlatBookBase

Inheritance diagram of FlatBookBase


method_summary Methods Summary

__init__Default class constructor.
AddPageAdds a page to the book.
AdvanceSelectionCycles through the tabs.
AssignImageListAssigns an image list to the control.
ChangeSelectionChanges the selection for the given page, returning the previous selection.
DeleteAllPagesDeletes all the pages in the book.
DeletePageDeletes the specified page, and the associated window.
DoSetSelectionSelect the window by the provided pointer.
EnableTabEnables or disables a tab.
GetAGWWindowStyleFlagReturns the FlatBookBase window style.
GetCurrentPageReturns the currently selected notebook page or None.
GetEnabledReturns whether a tab is enabled or not.
GetFontBoldGets the font bold status.
GetFontSizeMultipleGets the font size multiple for the page captions.
GetImageListReturns the associated image list.
GetPageReturns the window at the given page position.
GetPageCountReturns the number of pages in the book.
GetPageImageReturns the image index for the given page.
GetPageTextReturns the text for the given page.
GetSelectionReturns the current selection.
HasAGWFlagReturns whether a flag is present in the FlatBookBase style.
InsertPageInserts a page into the book at the specified position.
OnNavigationKeyHandles the wx.EVT_NAVIGATION_KEY event for FlatBookBase.
RemovePageDeletes the specified page, without deleting the associated window.
ResizeTabAreaResizes the tab area if the control has the INB_FIT_LABELTEXT style set.
SetAGWWindowStyleFlagSets the window style.
SetFontBoldSets whether the page captions are bold or not.
SetFontSizeMultipleSets the font size multiple for the page captions.
SetPageImageSets the image index for the given page.
SetPageTextSets the text for the given page.
SetSelectionChanges the selection from currently visible/selected page to the page given by page.

API Class API

class FlatBookBase(wx.Panel)[source]

Base class for the containing window for LabelBook and FlatImageBook.



__init__(parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize, style=0, agwStyle=0, name="FlatBookBase")[source]

Default class constructor.

Parameters:
  • parent – parent window. Must not be None;
  • id – window identifier. A value of -1 indicates a default value;
  • pos – the control position. A value of (-1, -1) indicates a default position, chosen by either the windowing system or wxPython, depending on platform;
  • size – the control size. A value of (-1, -1) indicates a default size, chosen by either the windowing system or wxPython, depending on platform;
  • style – the underlying wx.Panel window style;
  • agwStyle – the AGW-specific window style. This can be a combination of the following bits:


    Window Styles Hex Value Description
    INB_BOTTOM 0x1 Place labels below the page area. Available only for FlatImageBook.
    INB_LEFT 0x2 Place labels on the left side. Available only for FlatImageBook.
    INB_RIGHT 0x4 Place labels on the right side.
    INB_TOP 0x8 Place labels above the page area.
    INB_BORDER 0x10 Draws a border around LabelBook or FlatImageBook.
    INB_SHOW_ONLY_TEXT 0x20 Shows only text labels and no images. Available only for LabelBook.
    INB_SHOW_ONLY_IMAGES 0x40 Shows only tab images and no label texts. Available only for LabelBook.
    INB_FIT_BUTTON 0x80 Displays a pin button to show/hide the book control.
    INB_DRAW_SHADOW 0x100 Draw shadows below the book tabs. Available only for LabelBook.
    INB_USE_PIN_BUTTON 0x200 Displays a pin button to show/hide the book control.
    INB_GRADIENT_BACKGROUND 0x400 Draws a gradient shading on the tabs background. Available only for LabelBook.
    INB_WEB_HILITE 0x800 On mouse hovering, tabs behave like html hyperlinks. Available only for LabelBook.
    INB_NO_RESIZE 0x1000 Don’t allow resizing of the tab area.
    INB_FIT_LABELTEXT 0x2000 Will fit the tab area to the longest text (or text+image if you have images) in all the tabs.
    INB_BOLD_TAB_SELECTION 0x4000 Show the selected tab text using a bold font.
  • name – the window name.


AddPage(page, text, select=False, imageId=-1)[source]

Adds a page to the book.

Parameters:
  • page – specifies the new page;
  • text – specifies the text for the new page;
  • select – specifies whether the page should be selected;
  • imageId – specifies the optional image index for the new page.

Note

The call to this function generates the page changing events.



AdvanceSelection(forward=True)[source]

Cycles through the tabs.

Parameters:forward – if True, the selection is advanced in ascending order (to the right), otherwise the selection is advanced in descending order.

Note

The call to this function generates the page changing events.



AssignImageList(imglist)[source]

Assigns an image list to the control.

Parameters:imglist – an instance of wx.ImageList.


ChangeSelection(page)[source]

Changes the selection for the given page, returning the previous selection.

Parameters:page – an integer specifying the page to be selected.

Note

The call to this function does not generate the page changing events.



CurrentPage

See GetCurrentPage



DeleteAllPages()[source]

Deletes all the pages in the book.



DeletePage(page)[source]

Deletes the specified page, and the associated window.

Parameters:page – an integer specifying the page to be deleted.

Note

The call to this function generates the page changing events.



DoSetSelection(window)[source]

Select the window by the provided pointer.

Parameters:window – an instance of wx.Window.


EnableTab(page, enabled=True)[source]

Enables or disables a tab.

Parameters:
  • page – an integer specifying the page index;
  • enabledTrue to enable a tab, False to disable it.


GetAGWWindowStyleFlag()[source]

Returns the FlatBookBase window style.

See also

SetAGWWindowStyleFlag for a list of possible window style flags.



GetCurrentPage()[source]

Returns the currently selected notebook page or None.



GetEnabled(page)[source]

Returns whether a tab is enabled or not.

Parameters:page – an integer specifying the page index.


GetFontBold()[source]

Gets the font bold status.



GetFontSizeMultiple()[source]

Gets the font size multiple for the page captions.



GetImageList()[source]

Returns the associated image list.



GetPage(page)[source]

Returns the window at the given page position.

Parameters:page – an integer specifying the page to be returned.


GetPageCount()[source]

Returns the number of pages in the book.



GetPageImage(page)[source]

Returns the image index for the given page.

Parameters:page – an integer specifying the page index.


GetPageText(page)[source]

Returns the text for the given page.

Parameters:page – an integer specifying the page index.


GetSelection()[source]

Returns the current selection.



HasAGWFlag(flag)[source]

Returns whether a flag is present in the FlatBookBase style.

Parameters:flag – one of the possible FlatBookBase window styles.

See also

SetAGWWindowStyleFlag for a list of possible window style flags.



InsertPage(page_idx, page, text, select=False, imageId=-1)[source]

Inserts a page into the book at the specified position.

Parameters:
  • page_idx – specifies the position for the new page;
  • page – specifies the new page;
  • text – specifies the text for the new page;
  • select – specifies whether the page should be selected;
  • imageId – specifies the optional image index for the new page.

Note

The call to this function generates the page changing events.



OnNavigationKey(event)[source]

Handles the wx.EVT_NAVIGATION_KEY event for FlatBookBase.

Parameters:event – a wx.NavigationKeyEvent event to be processed.


Page

See GetPage



PageCount

See GetPageCount



PageImage

See GetPageImage, SetPageImage



PageText

See GetPageText, SetPageText



RemovePage(page)[source]

Deletes the specified page, without deleting the associated window.

Parameters:page – an integer specifying the page to be removed.

Note

The call to this function generates the page changing events.



ResizeTabArea()[source]

Resizes the tab area if the control has the INB_FIT_LABELTEXT style set.



Selection

See GetSelection, SetSelection



SetAGWWindowStyleFlag(agwStyle)[source]

Sets the window style.

Parameters:agwStyle – can be a combination of the following bits:


Window Styles Hex Value Description
INB_BOTTOM 0x1 Place labels below the page area. Available only for FlatImageBook.
INB_LEFT 0x2 Place labels on the left side. Available only for FlatImageBook.
INB_RIGHT 0x4 Place labels on the right side.
INB_TOP 0x8 Place labels above the page area.
INB_BORDER 0x10 Draws a border around LabelBook or FlatImageBook.
INB_SHOW_ONLY_TEXT 0x20 Shows only text labels and no images. Available only for LabelBook.
INB_SHOW_ONLY_IMAGES 0x40 Shows only tab images and no label texts. Available only for LabelBook.
INB_FIT_BUTTON 0x80 Displays a pin button to show/hide the book control.
INB_DRAW_SHADOW 0x100 Draw shadows below the book tabs. Available only for LabelBook.
INB_USE_PIN_BUTTON 0x200 Displays a pin button to show/hide the book control.
INB_GRADIENT_BACKGROUND 0x400 Draws a gradient shading on the tabs background. Available only for LabelBook.
INB_WEB_HILITE 0x800 On mouse hovering, tabs behave like html hyperlinks. Available only for LabelBook.
INB_NO_RESIZE 0x1000 Don’t allow resizing of the tab area.
INB_FIT_LABELTEXT 0x2000 Will fit the tab area to the longest text (or text+image if you have images) in all the tabs.
INB_BOLD_TAB_SELECTION 0x4000 Show the selected tab text using a bold font.


SetFontBold(bold)[source]

Sets whether the page captions are bold or not.

Parameters:boldTrue or False.


SetFontSizeMultiple(multiple)[source]

Sets the font size multiple for the page captions.

Parameters:multiple – The multiple to be applied to the system font to get the our font size.


SetPageImage(page, imageId)[source]

Sets the image index for the given page.

Parameters:
  • page – an integer specifying the page index;
  • image – an index into the image list.


SetPageText(page, text)[source]

Sets the text for the given page.

Parameters:
  • page – an integer specifying the page index;
  • text – the new tab label.


SetSelection(page)[source]

Changes the selection from currently visible/selected page to the page given by page.

Parameters:page – an integer specifying the page to be selected.

Note

The call to this function generates the page changing events.

Tree

Table Of Contents

Previous topic

labelbook

Next topic

FlatImageBook