Module LabelBook
[hide private]
[frames] | no frames]

Module LabelBook

source code


Description
===========

LabelBook and FlatImageBook are a quasi-full implementations of the wx.Notebook,
and designed to be a drop-in replacement for wx.Notebook. The API functions are
similar so one can expect the function to behave in the same way.
LabelBook anf FlatImageBook share their appearance with wx.Toolbook and
wx.Listbook, while having more options for custom drawings, label positioning,
mouse pointing and so on. Moreover, they retain also some visual characteristics
of the Outlook address book.

Some features:

  - They are generic controls;
  - Supports for left, right, top (FlatImageBook only), bottom (FlatImageBook
    only) book styles;
  - Possibility to draw images only, text only or both (FlatImageBook only);
  - Support for a "pin-button", that allows the user to shrink/expand the book
    tab area;
  - Shadows behind tabs (LabelBook only);
  - Gradient shading of the tab area (LabelBook only);
  - Web-like mouse pointing on tabs style (LabelBook only);
  - Many customizable colours (tab area, active tab text, tab borders, active
    tab, highlight) - LabelBook only.
  
And much more. See the demo for a quasi-complete review of all the functionalities
of LabelBook and FlatImageBook.


Events
======

LabelBook and FlatImageBook implement 4 events:

  - EVT_IMAGENOTEBOOK_PAGE_CHANGING;
  - EVT_IMAGENOTEBOOK_PAGE_CHANGED;
  - EVT_IMAGENOTEBOOK_PAGE_CLOSING;
  - EVT_IMAGENOTEBOOK_PAGE_CLOSED.


Supported Platforms
===================

LabelBook and FlatImageBook have been tested on the following platforms:
  * Windows (Windows XP);
  * Linux Ubuntu (Dapper 6.06)


License And Version:
===================

LabelBook and FlatImageBook are freeware and distributed under the wxPython license. 


Latest Revision: Andrea Gavana @ 03 Nov 2006, 22.30 GMT

Version 0.1.



Classes [hide private]
  ImageNotebookEvent
This events will be sent when a EVT_IMAGENOTEBOOK_PAGE_CHANGED, EVT_IMAGENOTEBOOK_PAGE_CHANGING, EVT_IMAGENOTEBOOK_PAGE_CLOSING, EVT_IMAGENOTEBOOK_PAGE_CLOSED is mapped in the parent.
  ImageInfo
This class holds all the information (caption, image, etc...) belonging to a single tab in ImageNotebook.
  ImageContainerBase
Base class for FlatImageBook image container.
  ImageContainer
Base class for FlatImageBook image container.
  LabelContainer
Base class for LabelBook.
  FlatBookBase
Base class for the containing window for LabelBook and FlatImageBook.
  FlatImageBook
Default implementation of the image book, it is like a wx.Notebook, except that images are used to control the different pages.
  LabelBook
An implementation of a notebook control - except that instead of having tabs to show labels, it labels to the right or left (arranged horozontally).

Variables [hide private]
  wxEVT_IMAGENOTEBOOK_PAGE_CHANGED = 10252
  wxEVT_IMAGENOTEBOOK_PAGE_CHANGING = 10253
  wxEVT_IMAGENOTEBOOK_PAGE_CLOSING = 10254
  wxEVT_IMAGENOTEBOOK_PAGE_CLOSED = 10255
  EVT_IMAGENOTEBOOK_PAGE_CHANGED = <wx._core.PyEventBinder object at 0x030AF8D0>
Notify client objects when the active page in ImageNotebook has changed.
  EVT_IMAGENOTEBOOK_PAGE_CHANGING = <wx._core.PyEventBinder object at 0x034F6BF0>
Notify client objects when the active page in ImageNotebook is about to change.
  EVT_IMAGENOTEBOOK_PAGE_CLOSING = <wx._core.PyEventBinder object at 0x034F6F30>
Notify client objects when a page in ImageNotebook is closing.
  EVT_IMAGENOTEBOOK_PAGE_CLOSED = <wx._core.PyEventBinder object at 0x034F6F50>
Notify client objects when a page in ImageNotebook has been closed.
  BU_EXT_2007_STYLE = 2
  BU_EXT_CENTER_ALIGN_STYLE = 8
  BU_EXT_LEFT_ALIGN_STYLE = 4
  BU_EXT_RIGHT_ALIGN_STYLE = 16
  BU_EXT_RIGHT_TO_LEFT_STYLE = 32
  BU_EXT_XP_STYLE = 1
  BottomShadow = 2
  BottomShadowFull = 4
  CS_DROPSHADOW = 131072
  ControlDisabled = 2
  ControlFocus = 1
  ControlNormal = 3
  ControlPressed = 0
  ControlStatusFocus = 1
  ControlStatusNoFocus = 0
  ControlStatusPressed = 2
  DROP_DOWN_ARROW_WIDTH = 16
  DropDownArrowButton = 3
  IMG_NONE = 3
  IMG_OVER_EW_BORDER = 2
  IMG_OVER_IMG = 0
  IMG_OVER_PIN = 1
  INB_ACTIVE_TAB_COLOR = 101
  INB_ACTIVE_TEXT_COLOR = 104
  INB_BORDER = 16
  INB_BOTTOM = 1
  INB_DEFAULT_STYLE = 536
  INB_DRAW_SHADOW = 256
  INB_FIT_BUTTON = 128
  INB_GRADIENT_BACKGROUND = 1024
  INB_HILITE_TAB_COLOR = 105
  INB_LABEL_BOOK_DEFAULT = 786
  INB_LEFT = 2
  INB_NO_RESIZE = 4096
  INB_PIN_HOVER = 200
  INB_PIN_NONE = 0
  INB_PIN_PRESSED = 201
  INB_RIGHT = 4
  INB_SHOW_ONLY_IMAGES = 64
  INB_SHOW_ONLY_TEXT = 32
  INB_TABS_BORDER_COLOR = 102
  INB_TAB_AREA_BACKGROUND_COLOR = 100
  INB_TEXT_COLOR = 103
  INB_TOP = 8
  INB_USE_PIN_BUTTON = 512
  INB_WEB_HILITE = 2048
  LargeIcons = 32
  MENU_DEC_BOTTOM = 1
  MENU_DEC_LEFT = 2
  MENU_DEC_RIGHT = 3
  MENU_DEC_TOP = 0
  MENU_HT_ITEM = 1
  MENU_HT_NONE = 0
  MENU_HT_SCROLL_DOWN = 3
  MENU_HT_SCROLL_UP = 2
  MenuItem = 1
  NoWhere = 0
  RightShadow = 1
  SCROLL_BTN_HEIGHT = 20
  SEPARATOR_WIDTH = 12
  SPACER = 5
  SmallIcons = 16
  Style2007 = 1
  StyleXP = 0
  ToolbarItem = 2
  ToolbarItemButton = 0
  ToolbarItemCustom = 2
  ToolbarItemSeparator = 1
  arrow_down = 'BM\xf6\x00\x00\x00\x00\x00\x00\x00v\x00\x00\x00(\x0...
  arrow_down_xpm = ['16 16 3 1', '. c Black', 'X c #FFFFFF', ' c #00808...
  arrow_up = 'BM\xf6\x00\x00\x00\x00\x00\x00\x00v\x00\x00\x00(\x0...
  check_mark_xpm = [' 16 16 16 1', '` c #000000', '. c #800000', '# c #...
  menu_right_arrow_xpm = [' 16 16 8 1', '` c #ffffff', '. c #000000', '# c #0...
  pin_down_xpm = [' 16 16 8 1', '` c #ffffff', '. c #000000', '# c #8...
  pin_left_xpm = [' 16 16 8 1', '` c #ffffff', '. c #000000', '# c #8...
  radio_item_xpm = [' 16 16 16 1', '` c #000000', '. c #800000', '# c #...
  shadow_bottom_alpha = [184, 184, 184, 184, 184, 168, 168, 168, 168, 168, 1...
  shadow_bottom_left_alpha = [22, 44, 73, 110, 139, 161, 176, 184, 184, 184, 20, ...
  shadow_bottom_left_xpm = ['10 5 1 1', ' c Black', ' ', ' ', ' ', ' ', ' ']
  shadow_bottom_xpm = ['5 5 1 1', ' c Black', ' ', ' ', ' ', ' ', ' ']
  shadow_center_alpha = [161, 139, 110, 73, 44, 148, 128, 101, 67, 40, 128, ...
  shadow_center_xpm = ['5 5 1 1', ' c Black', ' ', ' ', ' ', ' ', ' ']
  shadow_right_alpha = [168, 145, 115, 76, 46, 168, 145, 115, 76, 46, 168, ...
  shadow_right_top_alpha = [40, 35, 28, 18, 11, 67, 58, 46, 31, 18, 101, 87, 69...
  shadow_right_top_xpm = ['5 10 1 1', ' c Black', ' ', ' ', ' ', ' ', ' ', ' ...
  shadow_right_xpm = ['5 5 1 1', ' c Black', ' ', ' ', ' ', ' ', ' ']

Variables Details [hide private]

wxEVT_IMAGENOTEBOOK_PAGE_CHANGED

None
Value:
10252                                                                 
      

wxEVT_IMAGENOTEBOOK_PAGE_CHANGING

None
Value:
10253                                                                 
      

wxEVT_IMAGENOTEBOOK_PAGE_CLOSING

None
Value:
10254                                                                 
      

wxEVT_IMAGENOTEBOOK_PAGE_CLOSED

None
Value:
10255                                                                 
      

EVT_IMAGENOTEBOOK_PAGE_CHANGED

Notify client objects when the active page in ImageNotebook has changed.
Value:
<wx._core.PyEventBinder object at 0x030AF8D0>                          
      

EVT_IMAGENOTEBOOK_PAGE_CHANGING

Notify client objects when the active page in ImageNotebook is about to change.
Value:
<wx._core.PyEventBinder object at 0x034F6BF0>                          
      

EVT_IMAGENOTEBOOK_PAGE_CLOSING

Notify client objects when a page in ImageNotebook is closing.
Value:
<wx._core.PyEventBinder object at 0x034F6F30>                          
      

EVT_IMAGENOTEBOOK_PAGE_CLOSED

Notify client objects when a page in ImageNotebook has been closed.
Value:
<wx._core.PyEventBinder object at 0x034F6F50>                          
      

BU_EXT_2007_STYLE

None
Value:
2                                                                     
      

BU_EXT_CENTER_ALIGN_STYLE

None
Value:
8                                                                     
      

BU_EXT_LEFT_ALIGN_STYLE

None
Value:
4                                                                     
      

BU_EXT_RIGHT_ALIGN_STYLE

None
Value:
16                                                                    
      

BU_EXT_RIGHT_TO_LEFT_STYLE

None
Value:
32                                                                    
      

BU_EXT_XP_STYLE

None
Value:
1                                                                     
      

BottomShadow

None
Value:
2                                                                     
      

BottomShadowFull

None
Value:
4                                                                     
      

CS_DROPSHADOW

None
Value:
131072                                                                
      

ControlDisabled

None
Value:
2                                                                     
      

ControlFocus

None
Value:
1                                                                     
      

ControlNormal

None
Value:
3                                                                     
      

ControlPressed

None
Value:
0                                                                     
      

ControlStatusFocus

None
Value:
1                                                                     
      

ControlStatusNoFocus

None
Value:
0                                                                     
      

ControlStatusPressed

None
Value:
2                                                                     
      

DROP_DOWN_ARROW_WIDTH

None
Value:
16                                                                    
      

DropDownArrowButton

None
Value:
3                                                                     
      

IMG_NONE

None
Value:
3                                                                     
      

IMG_OVER_EW_BORDER

None
Value:
2                                                                     
      

IMG_OVER_IMG

None
Value:
0                                                                     
      

IMG_OVER_PIN

None
Value:
1                                                                     
      

INB_ACTIVE_TAB_COLOR

None
Value:
101                                                                   
      

INB_ACTIVE_TEXT_COLOR

None
Value:
104                                                                   
      

INB_BORDER

None
Value:
16                                                                    
      

INB_BOTTOM

None
Value:
1                                                                     
      

INB_DEFAULT_STYLE

None
Value:
536                                                                   
      

INB_DRAW_SHADOW

None
Value:
256                                                                   
      

INB_FIT_BUTTON

None
Value:
128                                                                   
      

INB_GRADIENT_BACKGROUND

None
Value:
1024                                                                  
      

INB_HILITE_TAB_COLOR

None
Value:
105                                                                   
      

INB_LABEL_BOOK_DEFAULT

None
Value:
786                                                                   
      

INB_LEFT

None
Value:
2                                                                     
      

INB_NO_RESIZE

None
Value:
4096                                                                  
      

INB_PIN_HOVER

None
Value:
200                                                                   
      

INB_PIN_NONE

None
Value:
0                                                                     
      

INB_PIN_PRESSED

None
Value:
201                                                                   
      

INB_RIGHT

None
Value:
4                                                                     
      

INB_SHOW_ONLY_IMAGES

None
Value:
64                                                                    
      

INB_SHOW_ONLY_TEXT

None
Value:
32                                                                    
      

INB_TABS_BORDER_COLOR

None
Value:
102                                                                   
      

INB_TAB_AREA_BACKGROUND_COLOR

None
Value:
100                                                                   
      

INB_TEXT_COLOR

None
Value:
103                                                                   
      

INB_TOP

None
Value:
8                                                                     
      

INB_USE_PIN_BUTTON

None
Value:
512                                                                   
      

INB_WEB_HILITE

None
Value:
2048                                                                  
      

LargeIcons

None
Value:
32                                                                    
      

MENU_DEC_BOTTOM

None
Value:
1                                                                     
      

MENU_DEC_LEFT

None
Value:
2                                                                     
      

MENU_DEC_RIGHT

None
Value:
3                                                                     
      

MENU_DEC_TOP

None
Value:
0                                                                     
      

MENU_HT_ITEM

None
Value:
1                                                                     
      

MENU_HT_NONE

None
Value:
0                                                                     
      

MENU_HT_SCROLL_DOWN

None
Value:
3                                                                     
      

MENU_HT_SCROLL_UP

None
Value:
2                                                                     
      

MenuItem

None
Value:
1                                                                     
      

NoWhere

None
Value:
0                                                                     
      

RightShadow

None
Value:
1                                                                     
      

SCROLL_BTN_HEIGHT

None
Value:
20                                                                    
      

SEPARATOR_WIDTH

None
Value:
12                                                                    
      

SPACER

None
Value:
5                                                                     
      

SmallIcons

None
Value:
16                                                                    
      

Style2007

None
Value:
1                                                                     
      

StyleXP

None
Value:
0                                                                     
      

ToolbarItem

None
Value:
2                                                                     
      

ToolbarItemButton

None
Value:
0                                                                     
      

ToolbarItemCustom

None
Value:
2                                                                     
      

ToolbarItemSeparator

None
Value:
1                                                                     
      

arrow_down

None
Value:
'BM\xf6\x00\x00\x00\x00\x00\x00\x00v\x00\x00\x00(\x00\x00\x00\x10\x00\
x00\x00\x10\x00\x00\x00\x01\x00\x04\x00\x00\x00\x00\x00\x80\x00\x00\x0
0\x12\x0b\x00\x00\x12\x0b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
x00\x00\x00\xff\xff\xff\x00\x80\x80\x00\x00w\xfcM\x00\x00\x00\x00\x00\
x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0
0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
x00\x00\x00\x00\x00\x00\x00\x00\x00""""""""""""""""""""""""""""""""""\
x00\x00\x00\x02""""\x11\x11\x11\x12""""""""""""\x00\x00\x00\x02""""\x1
...                                                                    
      

arrow_down_xpm

None
Value:
['16 16 3 1',
 '. c Black',
 'X c #FFFFFF',
 '  c #008080',
 '                ',
 '                ',
 '                ',
 '                ',
...                                                                    
      

arrow_up

None
Value:
'BM\xf6\x00\x00\x00\x00\x00\x00\x00v\x00\x00\x00(\x00\x00\x00\x10\x00\
x00\x00\x10\x00\x00\x00\x01\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x0
0\x12\x0b\x00\x00\x12\x0b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
x00\x00\x00\xff\xff\xff\x00\x80\x80\x00\x00w\xfcM\x00\x00\x00\x00\x00\
x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0
0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\
x00\x00\x00\x00\x00\x00\x00\x00\x00"""""""""""""""""""""""""""""""""""
!"""""""\x10\x12"""""!\x00\x01"""""\x10\x00\x00\x12""""\x00\x00\x00\x0
...                                                                    
      

check_mark_xpm

None
Value:
['    16    16       16            1',
 '` c #000000',
 '. c #800000',
 '# c #008000',
 'a c #808000',
 'b c #000080',
 'c c #800080',
 'd c #008080',
...                                                                    
      

menu_right_arrow_xpm

None
Value:
['    16    16        8            1',
 '` c #ffffff',
 '. c #000000',
 '# c #000000',
 'a c #000000',
 'b c #000000',
 'c c #000000',
 'd c #000000',
...                                                                    
      

pin_down_xpm

None
Value:
['    16    16        8            1',
 '` c #ffffff',
 '. c #000000',
 '# c #808080',
 'a c #000000',
 'b c #000000',
 'c c #000000',
 'd c #000000',
...                                                                    
      

pin_left_xpm

None
Value:
['    16    16        8            1',
 '` c #ffffff',
 '. c #000000',
 '# c #808080',
 'a c #000000',
 'b c #000000',
 'c c #000000',
 'd c #000000',
...                                                                    
      

radio_item_xpm

None
Value:
['    16    16       16            1',
 '` c #000000',
 '. c #800000',
 '# c #008000',
 'a c #808000',
 'b c #000080',
 'c c #800080',
 'd c #008080',
...                                                                    
      

shadow_bottom_alpha

None
Value:
[184, 184, 184, 184, 184, 168, 168, 168, 168]                          
      

shadow_bottom_left_alpha

None
Value:
[22, 44, 73, 110, 139, 161, 176, 184, 184]                             
      

shadow_bottom_left_xpm

None
Value:
['10 5 1 1',
 '  c Black',
 '          ',
 '          ',
 '          ',
 '          ',
 '          ']                                                         
      

shadow_bottom_xpm

None
Value:
['5 5 1 1', '  c Black', '     ', '     ', '     ', '     ', '     ']  
      

shadow_center_alpha

None
Value:
[161, 139, 110, 73, 44, 148, 128, 101, 67]                             
      

shadow_center_xpm

None
Value:
['5 5 1 1', '  c Black', '     ', '     ', '     ', '     ', '     ']  
      

shadow_right_alpha

None
Value:
[168, 145, 115, 76, 46, 168, 145, 115, 76]                             
      

shadow_right_top_alpha

None
Value:
[40, 35, 28, 18, 11, 67, 58, 46, 31]                                   
      

shadow_right_top_xpm

None
Value:
['5 10 1 1',
 '  c Black',
 '     ',
 '     ',
 '     ',
 '     ',
 '     ',
 '     ',
...                                                                    
      

shadow_right_xpm

None
Value:
['5 5 1 1', '  c Black', '     ', '     ', '     ', '     ', '     ']