annotate orpg/tools/FlatNotebook.py @ 41:6d18ee109e02 traipse_dev

Duplicates removed, refresh button still prints. Moving to Pull command and Delete button.
author sirebral
date Wed, 05 Aug 2009 09:22:11 -0500
parents 4385a7d0efd1
children fdcca00696ea
rev   line source
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1 # --------------------------------------------------------------------------- #
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2 # FLATNOTEBOOK Widget wxPython IMPLEMENTATION
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3 #
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4 # Original C++ Code From Eran. You Can Find It At:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
5 #
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
6 # http://wxforum.shadonet.com/viewtopic.php?t=5761&start=0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
7 #
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
8 # License: wxWidgets license
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
9 #
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
10 #
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
11 # Python Code By:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
12 #
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
13 # Andrea Gavana, @ 02 Oct 2006
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
14 # Latest Revision: 22 Nov 2007, 14.00 GMT
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
15 #
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
16 #
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
17 # For All Kind Of Problems, Requests Of Enhancements And Bug Reports, Please
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
18 # Write To Me At:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
19 #
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
20 # andrea.gavana@gmail.com
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
21 # gavana@kpo.kz
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
22 #
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
23 # Or, Obviously, To The wxPython Mailing List!!!
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
24 #
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
25 #
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
26 # End Of Comments
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
27 # --------------------------------------------------------------------------- #
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
28
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
29 """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
30 The FlatNotebook is a full implementation of the wx.Notebook, and designed to be
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
31 a drop-in replacement for wx.Notebook. The API functions are similar so one can
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
32 expect the function to behave in the same way.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
33
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
34 Some features:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
35
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
36 - The buttons are highlighted a la Firefox style
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
37 - The scrolling is done for bulks of tabs (so, the scrolling is faster and better)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
38 - The buttons area is never overdrawn by tabs (unlike many other implementations I saw)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
39 - It is a generic control
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
40 - Currently there are 5 differnt styles - VC8, VC 71, Standard, Fancy and Firefox 2;
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
41 - Mouse middle click can be used to close tabs
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
42 - A function to add right click menu for tabs (simple as SetRightClickMenu)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
43 - All styles has bottom style as well (they can be drawn in the bottom of screen)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
44 - An option to hide 'X' button or navigation buttons (separately)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
45 - Gradient coloring of the selected tabs and border
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
46 - Support for drag 'n' drop of tabs, both in the same notebook or to another notebook
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
47 - Possibility to have closing button on the active tab directly
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
48 - Support for disabled tabs
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
49 - Colours for active/inactive tabs, and captions
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
50 - Background of tab area can be painted in gradient (VC8 style only)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
51 - Colourful tabs - a random gentle colour is generated for each new tab (very cool, VC8 style only)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
52
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
53
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
54 And much more.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
55
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
56
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
57 License And Version:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
58
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
59 FlatNotebook Is Freeware And Distributed Under The wxPython License.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
60
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
61 Latest Revision: Andrea Gavana @ 22 Nov 2007, 14.00 GMT
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
62
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
63 Version 2.4.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
64
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
65 @undocumented: FNB_HEIGHT_SPACER, VERTICAL_BORDER_PADDING, VC8_SHAPE_LEN,
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
66 wxEVT*, left_arrow_*, right_arrow*, x_button*, down_arrow*,
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
67 FNBDragInfo, FNBDropTarget, GetMondrian*
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
68 """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
69
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
70 __docformat__ = "epytext"
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
71
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
72
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
73 #----------------------------------------------------------------------
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
74 # Beginning Of FLATNOTEBOOK wxPython Code
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
75 #----------------------------------------------------------------------
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
76
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
77 import wx
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
78 import random
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
79 import math
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
80 import weakref
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
81 import cPickle
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
82
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
83 if wx.Platform == '__WXMAC__':
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
84 import Carbon.Appearance
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
85
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
86 # Check for the new method in 2.7 (not present in 2.6.3.3)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
87 if wx.VERSION_STRING < "2.7":
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
88 wx.Rect.Contains = lambda self, point: wx.Rect.Inside(self, point)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
89
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
90 FNB_HEIGHT_SPACER = 10
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
91
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
92 # Use Visual Studio 2003 (VC7.1) style for tabs
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
93 FNB_VC71 = 1
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
94 """Use Visual Studio 2003 (VC7.1) style for tabs"""
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
95
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
96 # Use fancy style - square tabs filled with gradient coloring
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
97 FNB_FANCY_TABS = 2
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
98 """Use fancy style - square tabs filled with gradient coloring"""
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
99
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
100 # Draw thin border around the page
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
101 FNB_TABS_BORDER_SIMPLE = 4
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
102 """Draw thin border around the page"""
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
103
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
104 # Do not display the 'X' button
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
105 FNB_NO_X_BUTTON = 8
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
106 """Do not display the 'X' button"""
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
107
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
108 # Do not display the Right / Left arrows
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
109 FNB_NO_NAV_BUTTONS = 16
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
110 """Do not display the right/left arrows"""
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
111
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
112 # Use the mouse middle button for cloing tabs
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
113 FNB_MOUSE_MIDDLE_CLOSES_TABS = 32
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
114 """Use the mouse middle button for cloing tabs"""
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
115
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
116 # Place tabs at bottom - the default is to place them
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
117 # at top
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
118 FNB_BOTTOM = 64
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
119 """Place tabs at bottom - the default is to place them at top"""
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
120
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
121 # Disable dragging of tabs
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
122 FNB_NODRAG = 128
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
123 """Disable dragging of tabs"""
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
124
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
125 # Use Visual Studio 2005 (VC8) style for tabs
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
126 FNB_VC8 = 256
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
127 """Use Visual Studio 2005 (VC8) style for tabs"""
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
128
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
129 # Firefox 2 tabs style
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
130 FNB_FF2 = 131072
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
131 """Use Firefox 2 style for tabs"""
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
132
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
133 # Place 'X' on a tab
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
134 FNB_X_ON_TAB = 512
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
135 """Place 'X' close button on the active tab"""
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
136
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
137 FNB_BACKGROUND_GRADIENT = 1024
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
138 """Use gradients to paint the tabs background"""
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
139
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
140 FNB_COLORFUL_TABS = 2048
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
141 """Use colourful tabs (VC8 style only)"""
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
142
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
143 # Style to close tab using double click - styles 1024, 2048 are reserved
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
144 FNB_DCLICK_CLOSES_TABS = 4096
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
145 """Style to close tab using double click"""
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
146
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
147 FNB_SMART_TABS = 8192
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
148 """Use Smart Tabbing, like Alt+Tab on Windows"""
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
149
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
150 FNB_DROPDOWN_TABS_LIST = 16384
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
151 """Use a dropdown menu on the left in place of the arrows"""
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
152
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
153 FNB_ALLOW_FOREIGN_DND = 32768
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
154 """Allows drag 'n' drop operations between different L{FlatNotebook}s"""
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
155
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
156 FNB_HIDE_ON_SINGLE_TAB = 65536
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
157 """Hides the Page Container when there is one or fewer tabs"""
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
158
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
159 VERTICAL_BORDER_PADDING = 4
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
160
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
161 # Button size is a 16x16 xpm bitmap
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
162 BUTTON_SPACE = 16
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
163 """Button size is a 16x16 xpm bitmap"""
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
164
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
165 VC8_SHAPE_LEN = 16
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
166
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
167 MASK_COLOR = wx.Colour(0, 128, 128)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
168 """Mask colour for the arrow bitmaps"""
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
169
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
170 # Button status
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
171 FNB_BTN_PRESSED = 2
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
172 """Navigation button is pressed"""
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
173 FNB_BTN_HOVER = 1
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
174 """Navigation button is hovered"""
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
175 FNB_BTN_NONE = 0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
176 """No navigation"""
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
177
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
178 # Hit Test results
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
179 FNB_TAB = 1 # On a tab
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
180 """Indicates mouse coordinates inside a tab"""
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
181 FNB_X = 2 # On the X button
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
182 """Indicates mouse coordinates inside the I{X} region"""
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
183 FNB_TAB_X = 3 # On the 'X' button (tab's X button)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
184 """Indicates mouse coordinates inside the I{X} region in a tab"""
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
185 FNB_LEFT_ARROW = 4 # On the rotate left arrow button
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
186 """Indicates mouse coordinates inside the left arrow region"""
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
187 FNB_RIGHT_ARROW = 5 # On the rotate right arrow button
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
188 """Indicates mouse coordinates inside the right arrow region"""
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
189 FNB_DROP_DOWN_ARROW = 6 # On the drop down arrow button
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
190 """Indicates mouse coordinates inside the drop down arrow region"""
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
191 FNB_NOWHERE = 0 # Anywhere else
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
192 """Indicates mouse coordinates not on any tab of the notebook"""
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
193
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
194 FNB_DEFAULT_STYLE = FNB_MOUSE_MIDDLE_CLOSES_TABS | FNB_HIDE_ON_SINGLE_TAB
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
195 """L{FlatNotebook} default style"""
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
196
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
197 # FlatNotebook Events:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
198 # wxEVT_FLATNOTEBOOK_PAGE_CHANGED: Event Fired When You Switch Page;
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
199 # wxEVT_FLATNOTEBOOK_PAGE_CHANGING: Event Fired When You Are About To Switch
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
200 # Pages, But You Can Still "Veto" The Page Changing By Avoiding To Call
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
201 # event.Skip() In Your Event Handler;
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
202 # wxEVT_FLATNOTEBOOK_PAGE_CLOSING: Event Fired When A Page Is Closing, But
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
203 # You Can Still "Veto" The Page Changing By Avoiding To Call event.Skip()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
204 # In Your Event Handler;
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
205 # wxEVT_FLATNOTEBOOK_PAGE_CLOSED: Event Fired When A Page Is Closed.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
206 # wxEVT_FLATNOTEBOOK_PAGE_CONTEXT_MENU: Event Fired When A Menu Pops-up In A Tab.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
207
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
208 wxEVT_FLATNOTEBOOK_PAGE_CHANGED = wx.wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
209 wxEVT_FLATNOTEBOOK_PAGE_CHANGING = wx.wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
210 wxEVT_FLATNOTEBOOK_PAGE_CLOSING = wx.NewEventType()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
211 wxEVT_FLATNOTEBOOK_PAGE_CLOSED = wx.NewEventType()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
212 wxEVT_FLATNOTEBOOK_PAGE_CONTEXT_MENU = wx.NewEventType()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
213
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
214 #-----------------------------------#
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
215 # FlatNotebookEvent
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
216 #-----------------------------------#
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
217
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
218 EVT_FLATNOTEBOOK_PAGE_CHANGED = wx.EVT_NOTEBOOK_PAGE_CHANGED
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
219 """Notify client objects when the active page in L{FlatNotebook}
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
220 has changed."""
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
221 EVT_FLATNOTEBOOK_PAGE_CHANGING = wx.EVT_NOTEBOOK_PAGE_CHANGING
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
222 """Notify client objects when the active page in L{FlatNotebook}
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
223 is about to change."""
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
224 EVT_FLATNOTEBOOK_PAGE_CLOSING = wx.PyEventBinder(wxEVT_FLATNOTEBOOK_PAGE_CLOSING, 1)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
225 """Notify client objects when a page in L{FlatNotebook} is closing."""
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
226 EVT_FLATNOTEBOOK_PAGE_CLOSED = wx.PyEventBinder(wxEVT_FLATNOTEBOOK_PAGE_CLOSED, 1)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
227 """Notify client objects when a page in L{FlatNotebook} has been closed."""
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
228 EVT_FLATNOTEBOOK_PAGE_CONTEXT_MENU = wx.PyEventBinder(wxEVT_FLATNOTEBOOK_PAGE_CONTEXT_MENU, 1)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
229 """Notify client objects when a pop-up menu should appear next to a tab."""
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
230
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
231
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
232 # Some icons in XPM format
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
233
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
234 left_arrow_disabled_xpm = [
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
235 " 16 16 8 1",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
236 "` c #008080",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
237 ". c #555555",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
238 "# c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
239 "a c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
240 "b c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
241 "c c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
242 "d c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
243 "e c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
244 "````````````````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
245 "````````````````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
246 "````````````````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
247 "````````.```````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
248 "```````..```````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
249 "``````.`.```````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
250 "`````.``.```````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
251 "````.```.```````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
252 "`````.``.```````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
253 "``````.`.```````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
254 "```````..```````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
255 "````````.```````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
256 "````````````````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
257 "````````````````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
258 "````````````````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
259 "````````````````"
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
260 ]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
261
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
262 x_button_pressed_xpm = [
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
263 " 16 16 8 1",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
264 "` c #008080",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
265 ". c #4766e0",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
266 "# c #9e9ede",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
267 "a c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
268 "b c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
269 "c c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
270 "d c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
271 "e c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
272 "````````````````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
273 "`..............`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
274 "`.############.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
275 "`.############.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
276 "`.############.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
277 "`.###aa####aa#.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
278 "`.####aa##aa##.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
279 "`.#####aaaa###.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
280 "`.######aa####.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
281 "`.#####aaaa###.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
282 "`.####aa##aa##.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
283 "`.###aa####aa#.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
284 "`.############.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
285 "`..............`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
286 "````````````````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
287 "````````````````"
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
288 ]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
289
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
290
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
291 left_arrow_xpm = [
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
292 " 16 16 8 1",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
293 "` c #008080",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
294 ". c #555555",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
295 "# c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
296 "a c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
297 "b c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
298 "c c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
299 "d c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
300 "e c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
301 "````````````````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
302 "````````````````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
303 "````````````````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
304 "````````.```````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
305 "```````..```````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
306 "``````...```````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
307 "`````....```````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
308 "````.....```````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
309 "`````....```````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
310 "``````...```````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
311 "```````..```````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
312 "````````.```````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
313 "````````````````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
314 "````````````````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
315 "````````````````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
316 "````````````````"
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
317 ]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
318
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
319 x_button_hilite_xpm = [
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
320 " 16 16 8 1",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
321 "` c #008080",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
322 ". c #4766e0",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
323 "# c #c9dafb",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
324 "a c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
325 "b c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
326 "c c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
327 "d c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
328 "e c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
329 "````````````````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
330 "`..............`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
331 "`.############.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
332 "`.############.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
333 "`.##aa####aa##.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
334 "`.###aa##aa###.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
335 "`.####aaaa####.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
336 "`.#####aa#####.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
337 "`.####aaaa####.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
338 "`.###aa##aa###.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
339 "`.##aa####aa##.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
340 "`.############.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
341 "`.############.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
342 "`..............`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
343 "````````````````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
344 "````````````````"
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
345 ]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
346
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
347 x_button_xpm = [
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
348 " 16 16 8 1",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
349 "` c #008080",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
350 ". c #555555",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
351 "# c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
352 "a c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
353 "b c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
354 "c c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
355 "d c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
356 "e c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
357 "````````````````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
358 "````````````````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
359 "````````````````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
360 "````````````````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
361 "````..````..````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
362 "`````..``..`````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
363 "``````....``````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
364 "```````..```````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
365 "``````....``````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
366 "`````..``..`````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
367 "````..````..````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
368 "````````````````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
369 "````````````````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
370 "````````````````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
371 "````````````````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
372 "````````````````"
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
373 ]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
374
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
375 left_arrow_pressed_xpm = [
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
376 " 16 16 8 1",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
377 "` c #008080",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
378 ". c #4766e0",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
379 "# c #9e9ede",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
380 "a c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
381 "b c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
382 "c c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
383 "d c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
384 "e c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
385 "````````````````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
386 "`..............`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
387 "`.############.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
388 "`.############.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
389 "`.#######a####.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
390 "`.######aa####.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
391 "`.#####aaa####.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
392 "`.####aaaa####.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
393 "`.###aaaaa####.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
394 "`.####aaaa####.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
395 "`.#####aaa####.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
396 "`.######aa####.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
397 "`.#######a####.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
398 "`..............`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
399 "````````````````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
400 "````````````````"
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
401 ]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
402
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
403 left_arrow_hilite_xpm = [
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
404 " 16 16 8 1",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
405 "` c #008080",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
406 ". c #4766e0",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
407 "# c #c9dafb",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
408 "a c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
409 "b c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
410 "c c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
411 "d c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
412 "e c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
413 "````````````````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
414 "`..............`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
415 "`.############.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
416 "`.######a#####.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
417 "`.#####aa#####.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
418 "`.####aaa#####.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
419 "`.###aaaa#####.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
420 "`.##aaaaa#####.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
421 "`.###aaaa#####.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
422 "`.####aaa#####.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
423 "`.#####aa#####.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
424 "`.######a#####.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
425 "`.############.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
426 "`..............`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
427 "````````````````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
428 "````````````````"
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
429 ]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
430
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
431 right_arrow_disabled_xpm = [
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
432 " 16 16 8 1",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
433 "` c #008080",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
434 ". c #555555",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
435 "# c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
436 "a c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
437 "b c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
438 "c c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
439 "d c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
440 "e c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
441 "````````````````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
442 "````````````````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
443 "````````````````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
444 "```````.````````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
445 "```````..```````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
446 "```````.`.``````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
447 "```````.``.`````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
448 "```````.```.````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
449 "```````.``.`````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
450 "```````.`.``````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
451 "```````..```````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
452 "```````.````````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
453 "````````````````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
454 "````````````````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
455 "````````````````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
456 "````````````````"
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
457 ]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
458
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
459 right_arrow_hilite_xpm = [
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
460 " 16 16 8 1",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
461 "` c #008080",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
462 ". c #4766e0",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
463 "# c #c9dafb",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
464 "a c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
465 "b c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
466 "c c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
467 "d c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
468 "e c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
469 "````````````````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
470 "`..............`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
471 "`.############.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
472 "`.####a#######.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
473 "`.####aa######.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
474 "`.####aaa#####.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
475 "`.####aaaa####.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
476 "`.####aaaaa###.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
477 "`.####aaaa####.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
478 "`.####aaa#####.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
479 "`.####aa######.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
480 "`.####a#######.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
481 "`.############.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
482 "`..............`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
483 "````````````````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
484 "````````````````"
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
485 ]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
486
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
487 right_arrow_pressed_xpm = [
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
488 " 16 16 8 1",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
489 "` c #008080",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
490 ". c #4766e0",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
491 "# c #9e9ede",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
492 "a c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
493 "b c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
494 "c c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
495 "d c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
496 "e c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
497 "````````````````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
498 "`..............`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
499 "`.############.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
500 "`.############.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
501 "`.#####a######.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
502 "`.#####aa#####.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
503 "`.#####aaa####.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
504 "`.#####aaaa###.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
505 "`.#####aaaaa##.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
506 "`.#####aaaa###.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
507 "`.#####aaa####.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
508 "`.#####aa#####.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
509 "`.#####a######.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
510 "`..............`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
511 "````````````````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
512 "````````````````"
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
513 ]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
514
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
515
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
516 right_arrow_xpm = [
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
517 " 16 16 8 1",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
518 "` c #008080",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
519 ". c #555555",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
520 "# c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
521 "a c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
522 "b c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
523 "c c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
524 "d c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
525 "e c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
526 "````````````````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
527 "````````````````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
528 "````````````````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
529 "```````.````````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
530 "```````..```````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
531 "```````...``````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
532 "```````....`````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
533 "```````.....````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
534 "```````....`````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
535 "```````...``````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
536 "```````..```````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
537 "```````.````````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
538 "````````````````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
539 "````````````````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
540 "````````````````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
541 "````````````````"
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
542 ]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
543
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
544 down_arrow_hilite_xpm = [
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
545 " 16 16 8 1",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
546 "` c #008080",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
547 ". c #4766e0",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
548 "# c #c9dafb",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
549 "a c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
550 "b c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
551 "c c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
552 "d c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
553 "e c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
554 "````````````````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
555 "``.............`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
556 "``.###########.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
557 "``.###########.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
558 "``.###########.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
559 "``.#aaaaaaaaa#.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
560 "``.##aaaaaaa##.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
561 "``.###aaaaa###.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
562 "``.####aaa####.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
563 "``.#####a#####.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
564 "``.###########.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
565 "``.###########.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
566 "``.###########.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
567 "``.............`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
568 "````````````````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
569 "````````````````"
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
570 ]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
571
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
572 down_arrow_pressed_xpm = [
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
573 " 16 16 8 1",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
574 "` c #008080",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
575 ". c #4766e0",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
576 "# c #9e9ede",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
577 "a c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
578 "b c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
579 "c c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
580 "d c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
581 "e c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
582 "````````````````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
583 "``.............`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
584 "``.###########.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
585 "``.###########.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
586 "``.###########.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
587 "``.###########.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
588 "``.###########.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
589 "``.#aaaaaaaaa#.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
590 "``.##aaaaaaa##.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
591 "``.###aaaaa###.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
592 "``.####aaa####.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
593 "``.#####a#####.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
594 "``.###########.`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
595 "``.............`",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
596 "````````````````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
597 "````````````````"
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
598 ]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
599
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
600
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
601 down_arrow_xpm = [
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
602 " 16 16 8 1",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
603 "` c #008080",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
604 ". c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
605 "# c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
606 "a c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
607 "b c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
608 "c c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
609 "d c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
610 "e c #000000",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
611 "````````````````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
612 "````````````````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
613 "````````````````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
614 "````````````````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
615 "````````````````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
616 "````````````````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
617 "````.........```",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
618 "`````.......````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
619 "``````.....`````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
620 "```````...``````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
621 "````````.```````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
622 "````````````````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
623 "````````````````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
624 "````````````````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
625 "````````````````",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
626 "````````````````"
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
627 ]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
628
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
629
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
630 #----------------------------------------------------------------------
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
631 def GetMondrianData():
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
632 return \
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
633 '\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00 \x00\x00\x00 \x08\x06\x00\
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
634 \x00\x00szz\xf4\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\x08d\x88\x00\x00\x00qID\
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
635 ATX\x85\xed\xd6;\n\x800\x10E\xd1{\xc5\x8d\xb9r\x97\x16\x0b\xad$\x8a\x82:\x16\
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
636 o\xda\x84pB2\x1f\x81Fa\x8c\x9c\x08\x04Z{\xcf\xa72\xbcv\xfa\xc5\x08 \x80r\x80\
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
637 \xfc\xa2\x0e\x1c\xe4\xba\xfaX\x1d\xd0\xde]S\x07\x02\xd8>\xe1wa-`\x9fQ\xe9\
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
638 \x86\x01\x04\x10\x00\\(Dk\x1b-\x04\xdc\x1d\x07\x14\x98;\x0bS\x7f\x7f\xf9\x13\
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
639 \x04\x10@\xf9X\xbe\x00\xc9 \x14K\xc1<={\x00\x00\x00\x00IEND\xaeB`\x82'
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
640
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
641
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
642 def GetMondrianBitmap():
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
643 return wx.BitmapFromImage(GetMondrianImage().Scale(16, 16))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
644
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
645
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
646 def GetMondrianImage():
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
647 import cStringIO
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
648 stream = cStringIO.StringIO(GetMondrianData())
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
649 return wx.ImageFromStream(stream)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
650
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
651
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
652 def GetMondrianIcon():
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
653 icon = wx.EmptyIcon()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
654 icon.CopyFromBitmap(GetMondrianBitmap())
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
655 return icon
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
656 #----------------------------------------------------------------------
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
657
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
658
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
659 def LightColour(color, percent):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
660 """ Brighten input colour by percent. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
661
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
662 end_color = wx.WHITE
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
663
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
664 rd = end_color.Red() - color.Red()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
665 gd = end_color.Green() - color.Green()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
666 bd = end_color.Blue() - color.Blue()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
667
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
668 high = 100
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
669
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
670 # We take the percent way of the color from color -. white
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
671 i = percent
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
672 r = color.Red() + ((i*rd*100)/high)/100
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
673 g = color.Green() + ((i*gd*100)/high)/100
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
674 b = color.Blue() + ((i*bd*100)/high)/100
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
675 return wx.Colour(r, g, b)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
676
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
677
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
678 def RandomColour():
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
679 """ Creates a random colour. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
680
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
681 r = random.randint(0, 255) # Random value betweem 0-255
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
682 g = random.randint(0, 255) # Random value betweem 0-255
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
683 b = random.randint(0, 255) # Random value betweem 0-255
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
684
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
685 return wx.Colour(r, g, b)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
686
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
687
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
688 def PaintStraightGradientBox(dc, rect, startColor, endColor, vertical=True):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
689 """ Draws a gradient colored box from startColor to endColor. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
690
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
691 rd = endColor.Red() - startColor.Red()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
692 gd = endColor.Green() - startColor.Green()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
693 bd = endColor.Blue() - startColor.Blue()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
694
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
695 # Save the current pen and brush
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
696 savedPen = dc.GetPen()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
697 savedBrush = dc.GetBrush()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
698
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
699 if vertical:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
700 high = rect.GetHeight()-1
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
701 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
702 high = rect.GetWidth()-1
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
703
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
704 if high < 1:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
705 return
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
706
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
707 for i in xrange(high+1):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
708
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
709 r = startColor.Red() + ((i*rd*100)/high)/100
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
710 g = startColor.Green() + ((i*gd*100)/high)/100
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
711 b = startColor.Blue() + ((i*bd*100)/high)/100
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
712
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
713 p = wx.Pen(wx.Colour(r, g, b))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
714 dc.SetPen(p)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
715
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
716 if vertical:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
717 dc.DrawLine(rect.x, rect.y+i, rect.x+rect.width, rect.y+i)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
718 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
719 dc.DrawLine(rect.x+i, rect.y, rect.x+i, rect.y+rect.height)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
720
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
721 # Restore the pen and brush
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
722 dc.SetPen(savedPen)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
723 dc.SetBrush(savedBrush)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
724
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
725
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
726
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
727 # -----------------------------------------------------------------------------
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
728 # Util functions
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
729 # -----------------------------------------------------------------------------
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
730
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
731 def DrawButton(dc, rect, focus, upperTabs):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
732
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
733 # Define the rounded rectangle base on the given rect
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
734 # we need an array of 9 points for it
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
735 regPts = [wx.Point() for indx in xrange(9)]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
736
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
737 if focus:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
738 if upperTabs:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
739 leftPt = wx.Point(rect.x, rect.y + (rect.height / 10)*8)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
740 rightPt = wx.Point(rect.x + rect.width - 2, rect.y + (rect.height / 10)*8)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
741 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
742 leftPt = wx.Point(rect.x, rect.y + (rect.height / 10)*5)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
743 rightPt = wx.Point(rect.x + rect.width - 2, rect.y + (rect.height / 10)*5)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
744 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
745 leftPt = wx.Point(rect.x, rect.y + (rect.height / 2))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
746 rightPt = wx.Point(rect.x + rect.width - 2, rect.y + (rect.height / 2))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
747
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
748 # Define the top region
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
749 top = wx.RectPP(rect.GetTopLeft(), rightPt)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
750 bottom = wx.RectPP(leftPt, rect.GetBottomRight())
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
751
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
752 topStartColor = wx.WHITE
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
753
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
754 if not focus:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
755 topStartColor = LightColour(wx.SystemSettings_GetColour(wx.SYS_COLOUR_3DFACE), 50)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
756
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
757 topEndColor = wx.SystemSettings_GetColour(wx.SYS_COLOUR_3DFACE)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
758 bottomStartColor = topEndColor
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
759 bottomEndColor = topEndColor
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
760
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
761 # Incase we use bottom tabs, switch the colors
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
762 if upperTabs:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
763 if focus:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
764 PaintStraightGradientBox(dc, top, topStartColor, topEndColor)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
765 PaintStraightGradientBox(dc, bottom, bottomStartColor, bottomEndColor)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
766 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
767 PaintStraightGradientBox(dc, top, topEndColor , topStartColor)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
768 PaintStraightGradientBox(dc, bottom, bottomStartColor, bottomEndColor)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
769
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
770 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
771 if focus:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
772 PaintStraightGradientBox(dc, bottom, topEndColor, bottomEndColor)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
773 PaintStraightGradientBox(dc, top,topStartColor, topStartColor)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
774 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
775 PaintStraightGradientBox(dc, bottom, bottomStartColor, bottomEndColor)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
776 PaintStraightGradientBox(dc, top, topEndColor, topStartColor)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
777
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
778 dc.SetBrush(wx.TRANSPARENT_BRUSH)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
779
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
780
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
781 # ---------------------------------------------------------------------------- #
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
782 # Class FNBDropSource
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
783 # Gives Some Custom UI Feedback during the DnD Operations
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
784 # ---------------------------------------------------------------------------- #
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
785
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
786 class FNBDropSource(wx.DropSource):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
787 """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
788 Give some custom UI feedback during the drag and drop operation in this
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
789 function. It is called on each mouse move, so your implementation must
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
790 not be too slow.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
791 """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
792
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
793 def __init__(self, win):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
794 """ Default class constructor. Used internally. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
795
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
796 wx.DropSource.__init__(self, win)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
797 self._win = win
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
798
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
799
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
800 def GiveFeedback(self, effect):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
801 """ Provides user with a nice feedback when tab is being dragged. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
802
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
803 self._win.DrawDragHint()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
804 return False
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
805
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
806
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
807 # ---------------------------------------------------------------------------- #
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
808 # Class FNBDragInfo
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
809 # Stores All The Information To Allow Drag And Drop Between Different
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
810 # FlatNotebooks.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
811 # ---------------------------------------------------------------------------- #
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
812
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
813 class FNBDragInfo:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
814
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
815 _map = weakref.WeakValueDictionary()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
816
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
817 def __init__(self, container, pageindex):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
818 """ Default class constructor. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
819
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
820 self._id = id(container)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
821 FNBDragInfo._map[self._id] = container
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
822 self._pageindex = pageindex
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
823
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
824
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
825 def GetContainer(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
826 """ Returns the L{FlatNotebook} page (usually a panel). """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
827
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
828 return FNBDragInfo._map.get(self._id, None)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
829
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
830
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
831 def GetPageIndex(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
832 """ Returns the page index associated with a page. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
833
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
834 return self._pageindex
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
835
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
836
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
837 # ---------------------------------------------------------------------------- #
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
838 # Class FNBDropTarget
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
839 # Simply Used To Handle The OnDrop() Method When Dragging And Dropping Between
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
840 # Different FlatNotebooks.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
841 # ---------------------------------------------------------------------------- #
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
842
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
843 class FNBDropTarget(wx.DropTarget):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
844
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
845 def __init__(self, parent):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
846 """ Default class constructor. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
847
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
848 wx.DropTarget.__init__(self)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
849
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
850 self._parent = parent
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
851 self._dataobject = wx.CustomDataObject(wx.CustomDataFormat("FlatNotebook"))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
852 self.SetDataObject(self._dataobject)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
853
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
854
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
855 def OnData(self, x, y, dragres):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
856 """ Handles the OnData() method to call the real DnD routine. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
857
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
858 if not self.GetData():
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
859 return wx.DragNone
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
860
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
861 draginfo = self._dataobject.GetData()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
862 drginfo = cPickle.loads(draginfo)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
863
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
864 return self._parent.OnDropTarget(x, y, drginfo.GetPageIndex(), drginfo.GetContainer())
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
865
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
866
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
867 # ---------------------------------------------------------------------------- #
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
868 # Class PageInfo
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
869 # Contains parameters for every FlatNotebook page
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
870 # ---------------------------------------------------------------------------- #
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
871
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
872 class PageInfo:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
873 """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
874 This class holds all the information (caption, image, etc...) belonging to a
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
875 single tab in L{FlatNotebook}.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
876 """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
877
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
878 def __init__(self, caption="", imageindex=-1, tabangle=0, enabled=True):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
879 """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
880 Default Class Constructor.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
881
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
882 Parameters:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
883 @param caption: the tab caption;
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
884 @param imageindex: the tab image index based on the assigned (set) wx.ImageList (if any);
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
885 @param tabangle: the tab angle (only on standard tabs, from 0 to 15 degrees);
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
886 @param enabled: sets enabled or disabled the tab.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
887 """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
888
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
889 self._strCaption = caption
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
890 self._TabAngle = tabangle
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
891 self._ImageIndex = imageindex
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
892 self._bEnabled = enabled
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
893 self._pos = wx.Point(-1, -1)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
894 self._size = wx.Size(-1, -1)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
895 self._region = wx.Region()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
896 self._xRect = wx.Rect()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
897 self._color = None
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
898 self._hasFocus = False
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
899
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
900
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
901 def SetCaption(self, value):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
902 """ Sets the tab caption. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
903
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
904 self._strCaption = value
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
905
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
906
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
907 def GetCaption(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
908 """ Returns the tab caption. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
909
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
910 return self._strCaption
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
911
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
912
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
913 def SetPosition(self, value):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
914 """ Sets the tab position. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
915
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
916 self._pos = value
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
917
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
918
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
919 def GetPosition(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
920 """ Returns the tab position. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
921
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
922 return self._pos
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
923
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
924
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
925 def SetSize(self, value):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
926 """ Sets the tab size. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
927
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
928 self._size = value
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
929
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
930
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
931 def GetSize(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
932 """ Returns the tab size. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
933
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
934 return self._size
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
935
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
936
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
937 def SetTabAngle(self, value):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
938 """ Sets the tab header angle (0 <= tab <= 15 degrees). """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
939
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
940 self._TabAngle = min(45, value)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
941
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
942
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
943 def GetTabAngle(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
944 """ Returns the tab angle. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
945
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
946 return self._TabAngle
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
947
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
948
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
949 def SetImageIndex(self, value):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
950 """ Sets the tab image index. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
951
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
952 self._ImageIndex = value
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
953
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
954
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
955 def GetImageIndex(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
956 """ Returns the tab umage index. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
957
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
958 return self._ImageIndex
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
959
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
960
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
961 def GetEnabled(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
962 """ Returns whether the tab is enabled or not. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
963
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
964 return self._bEnabled
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
965
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
966
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
967 def EnableTab(self, enabled):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
968 """ Sets the tab enabled or disabled. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
969
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
970 self._bEnabled = enabled
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
971
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
972
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
973 def SetRegion(self, points=[]):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
974 """ Sets the tab region. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
975
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
976 self._region = wx.RegionFromPoints(points)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
977
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
978
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
979 def GetRegion(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
980 """ Returns the tab region. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
981
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
982 return self._region
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
983
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
984
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
985 def SetXRect(self, xrect):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
986 """ Sets the button 'X' area rect. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
987
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
988 self._xRect = xrect
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
989
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
990
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
991 def GetXRect(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
992 """ Returns the button 'X' area rect. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
993
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
994 return self._xRect
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
995
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
996
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
997 def GetColour(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
998 """ Returns the tab colour. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
999
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1000 return self._color
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1001
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1002
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1003 def SetColour(self, color):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1004 """ Sets the tab colour. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1005
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1006 self._color = color
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1007
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1008
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1009 # ---------------------------------------------------------------------------- #
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1010 # Class FlatNotebookEvent
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1011 # ---------------------------------------------------------------------------- #
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1012
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1013 class FlatNotebookEvent(wx.PyCommandEvent):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1014 """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1015 This events will be sent when a EVT_FLATNOTEBOOK_PAGE_CHANGED,
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1016 EVT_FLATNOTEBOOK_PAGE_CHANGING, EVT_FLATNOTEBOOK_PAGE_CLOSING,
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1017 EVT_FLATNOTEBOOK_PAGE_CLOSED and EVT_FLATNOTEBOOK_PAGE_CONTEXT_MENU is
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1018 mapped in the parent.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1019 """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1020
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1021 def __init__(self, eventType, id=1, nSel=-1, nOldSel=-1):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1022 """ Default class constructor. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1023
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1024 wx.PyCommandEvent.__init__(self, eventType, id)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1025 self._eventType = eventType
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1026
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1027 self.notify = wx.NotifyEvent(eventType, id)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1028
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1029
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1030 def GetNotifyEvent(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1031 """Returns the actual wx.NotifyEvent."""
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1032
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1033 return self.notify
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1034
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1035
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1036 def IsAllowed(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1037 """Returns whether the event is allowed or not."""
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1038
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1039 return self.notify.IsAllowed()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1040
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1041
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1042 def Veto(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1043 """Vetos the event."""
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1044
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1045 self.notify.Veto()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1046
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1047
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1048 def Allow(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1049 """The event is allowed."""
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1050
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1051 self.notify.Allow()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1052
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1053
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1054 def SetSelection(self, nSel):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1055 """ Sets event selection. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1056
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1057 self._selection = nSel
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1058
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1059
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1060 def SetOldSelection(self, nOldSel):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1061 """ Sets old event selection. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1062
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1063 self._oldselection = nOldSel
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1064
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1065
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1066 def GetSelection(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1067 """ Returns event selection. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1068
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1069 return self._selection
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1070
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1071
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1072 def GetOldSelection(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1073 """ Returns old event selection """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1074
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1075 return self._oldselection
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1076
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1077
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1078 # ---------------------------------------------------------------------------- #
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1079 # Class TabNavigatorWindow
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1080 # ---------------------------------------------------------------------------- #
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1081
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1082 class TabNavigatorWindow(wx.Dialog):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1083 """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1084 This class is used to create a modal dialog that enables "Smart Tabbing",
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1085 similar to what you would get by hitting Alt+Tab on Windows.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1086 """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1087
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1088 def __init__(self, parent=None, icon=None):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1089 """ Default class constructor. Used internally."""
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1090
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1091 wx.Dialog.__init__(self, parent, wx.ID_ANY, "", style=0)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1092
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1093 self._selectedItem = -1
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1094 self._indexMap = []
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1095
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1096 if icon is None:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1097 self._bmp = GetMondrianBitmap()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1098 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1099 self._bmp = icon
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1100
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1101 sz = wx.BoxSizer(wx.VERTICAL)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1102
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1103 self._listBox = wx.ListBox(self, wx.ID_ANY, wx.DefaultPosition, wx.Size(200, 150), [], wx.LB_SINGLE | wx.NO_BORDER)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1104
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1105 mem_dc = wx.MemoryDC()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1106 mem_dc.SelectObject(wx.EmptyBitmap(1,1))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1107 font = wx.SystemSettings_GetFont(wx.SYS_DEFAULT_GUI_FONT)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1108 font.SetWeight(wx.BOLD)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1109 mem_dc.SetFont(font)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1110
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1111 panelHeight = mem_dc.GetCharHeight()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1112 panelHeight += 4 # Place a spacer of 2 pixels
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1113
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1114 # Out signpost bitmap is 24 pixels
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1115 if panelHeight < 24:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1116 panelHeight = 24
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1117
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1118 self._panel = wx.Panel(self, wx.ID_ANY, wx.DefaultPosition, wx.Size(200, panelHeight))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1119
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1120 sz.Add(self._panel)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1121 sz.Add(self._listBox, 1, wx.EXPAND)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1122
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1123 self.SetSizer(sz)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1124
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1125 # Connect events to the list box
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1126 self._listBox.Bind(wx.EVT_KEY_UP, self.OnKeyUp)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1127 self._listBox.Bind(wx.EVT_NAVIGATION_KEY, self.OnNavigationKey)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1128 self._listBox.Bind(wx.EVT_LISTBOX_DCLICK, self.OnItemSelected)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1129
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1130 # Connect paint event to the panel
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1131 self._panel.Bind(wx.EVT_PAINT, self.OnPanelPaint)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1132 self._panel.Bind(wx.EVT_ERASE_BACKGROUND, self.OnPanelEraseBg)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1133
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1134 self.SetBackgroundColour(wx.SystemSettings_GetColour(wx.SYS_COLOUR_3DFACE))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1135 self._listBox.SetBackgroundColour(wx.SystemSettings_GetColour(wx.SYS_COLOUR_3DFACE))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1136 self.PopulateListControl(parent)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1137
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1138 self.GetSizer().Fit(self)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1139 self.GetSizer().SetSizeHints(self)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1140 self.GetSizer().Layout()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1141 self.Centre()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1142
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1143
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1144 def OnKeyUp(self, event):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1145 """Handles the wx.EVT_KEY_UP for the L{TabNavigatorWindow}."""
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1146
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1147 if event.GetKeyCode() == wx.WXK_CONTROL:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1148 self.CloseDialog()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1149
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1150
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1151 def OnNavigationKey(self, event):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1152 """Handles the wx.EVT_NAVIGATION_KEY for the L{TabNavigatorWindow}. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1153
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1154 selected = self._listBox.GetSelection()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1155 bk = self.GetParent()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1156 maxItems = bk.GetPageCount()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1157
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1158 if event.GetDirection():
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1159
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1160 # Select next page
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1161 if selected == maxItems - 1:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1162 itemToSelect = 0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1163 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1164 itemToSelect = selected + 1
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1165
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1166 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1167
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1168 # Previous page
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1169 if selected == 0:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1170 itemToSelect = maxItems - 1
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1171 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1172 itemToSelect = selected - 1
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1173
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1174 self._listBox.SetSelection(itemToSelect)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1175
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1176
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1177 def PopulateListControl(self, book):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1178 """Populates the L{TabNavigatorWindow} listbox with a list of tabs."""
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1179
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1180 selection = book.GetSelection()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1181 count = book.GetPageCount()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1182
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1183 self._listBox.Append(book.GetPageText(selection))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1184 self._indexMap.append(selection)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1185
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1186 prevSel = book.GetPreviousSelection()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1187
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1188 if prevSel != wx.NOT_FOUND:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1189
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1190 # Insert the previous selection as second entry
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1191 self._listBox.Append(book.GetPageText(prevSel))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1192 self._indexMap.append(prevSel)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1193
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1194 for c in xrange(count):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1195
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1196 # Skip selected page
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1197 if c == selection:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1198 continue
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1199
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1200 # Skip previous selected page as well
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1201 if c == prevSel:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1202 continue
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1203
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1204 self._listBox.Append(book.GetPageText(c))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1205 self._indexMap.append(c)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1206
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1207 # Select the next entry after the current selection
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1208 self._listBox.SetSelection(0)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1209 dummy = wx.NavigationKeyEvent()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1210 dummy.SetDirection(True)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1211 self.OnNavigationKey(dummy)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1212
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1213
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1214 def OnItemSelected(self, event):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1215 """Handles the wx.EVT_LISTBOX_DCLICK event for the wx.ListBox inside L{TabNavigatorWindow}. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1216
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1217 self.CloseDialog()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1218
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1219
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1220 def CloseDialog(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1221 """Closes the L{TabNavigatorWindow} dialog, setting selection in L{FlatNotebook}."""
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1222
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1223 bk = self.GetParent()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1224 self._selectedItem = self._listBox.GetSelection()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1225 iter = self._indexMap[self._selectedItem]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1226 bk._pages.FireEvent(iter)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1227 self.EndModal(wx.ID_OK)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1228
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1229
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1230 def OnPanelPaint(self, event):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1231 """Handles the wx.EVT_PAINT event for L{TabNavigatorWindow} top panel. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1232
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1233 dc = wx.PaintDC(self._panel)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1234 rect = self._panel.GetClientRect()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1235
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1236 bmp = wx.EmptyBitmap(rect.width, rect.height)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1237
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1238 mem_dc = wx.MemoryDC()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1239 mem_dc.SelectObject(bmp)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1240
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1241 endColour = wx.SystemSettings_GetColour(wx.SYS_COLOUR_BTNSHADOW)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1242 startColour = LightColour(endColour, 50)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1243 PaintStraightGradientBox(mem_dc, rect, startColour, endColour)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1244
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1245 # Draw the caption title and place the bitmap
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1246 # get the bitmap optimal position, and draw it
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1247 bmpPt, txtPt = wx.Point(), wx.Point()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1248 bmpPt.y = (rect.height - self._bmp.GetHeight())/2
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1249 bmpPt.x = 3
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1250 mem_dc.DrawBitmap(self._bmp, bmpPt.x, bmpPt.y, True)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1251
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1252 # get the text position, and draw it
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1253 font = wx.SystemSettings_GetFont(wx.SYS_DEFAULT_GUI_FONT)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1254 font.SetWeight(wx.BOLD)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1255 mem_dc.SetFont(font)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1256 fontHeight = mem_dc.GetCharHeight()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1257
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1258 txtPt.x = bmpPt.x + self._bmp.GetWidth() + 4
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1259 txtPt.y = (rect.height - fontHeight)/2
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1260 mem_dc.SetTextForeground(wx.WHITE)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1261 mem_dc.DrawText("Opened tabs:", txtPt.x, txtPt.y)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1262 mem_dc.SelectObject(wx.NullBitmap)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1263
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1264 dc.DrawBitmap(bmp, 0, 0)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1265
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1266
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1267 def OnPanelEraseBg(self, event):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1268 """Handles the wx.EVT_ERASE_BACKGROUND event for L{TabNavigatorWindow} top panel. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1269
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1270 pass
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1271
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1272
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1273 # ---------------------------------------------------------------------------- #
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1274 # Class FNBRenderer
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1275 # ---------------------------------------------------------------------------- #
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1276
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1277 class FNBRenderer:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1278 """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1279 Parent class for the 4 renderers defined: I{Standard}, I{VC71}, I{Fancy}
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1280 and I{VC8}. This class implements the common methods of all 4 renderers.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1281 """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1282
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1283 def __init__(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1284 """Default class constructor. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1285
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1286 self._tabHeight = None
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1287
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1288 if wx.Platform == "__WXMAC__":
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1289 # Hack to get proper highlight color for focus rectangle from
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1290 # current theme by creating a theme brush and getting its color.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1291 # kThemeBrushFocusHighlight is available on Mac OS 8.5 and higher
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1292 brush = wx.BLACK_BRUSH
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1293 brush.MacSetTheme(Carbon.Appearance.kThemeBrushFocusHighlight)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1294 self._focusPen = wx.Pen(brush.GetColour(), 2, wx.SOLID)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1295 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1296 self._focusPen = wx.Pen(wx.BLACK, 1, wx.USER_DASH)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1297 self._focusPen.SetDashes([1, 1])
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1298 self._focusPen.SetCap(wx.CAP_BUTT)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1299
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1300
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1301 def GetLeftButtonPos(self, pageContainer):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1302 """ Returns the left button position in the navigation area. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1303
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1304 pc = pageContainer
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1305 style = pc.GetParent().GetWindowStyleFlag()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1306 rect = pc.GetClientRect()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1307 clientWidth = rect.width
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1308
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1309 if style & FNB_NO_X_BUTTON:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1310 return clientWidth - 38
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1311 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1312 return clientWidth - 54
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1313
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1314
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1315 def GetRightButtonPos(self, pageContainer):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1316 """ Returns the right button position in the navigation area. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1317
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1318 pc = pageContainer
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1319 style = pc.GetParent().GetWindowStyleFlag()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1320 rect = pc.GetClientRect()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1321 clientWidth = rect.width
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1322
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1323 if style & FNB_NO_X_BUTTON:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1324 return clientWidth - 22
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1325 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1326 return clientWidth - 38
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1327
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1328
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1329 def GetDropArrowButtonPos(self, pageContainer):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1330 """ Returns the drop down button position in the navigation area. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1331
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1332 return self.GetRightButtonPos(pageContainer)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1333
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1334
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1335 def GetXPos(self, pageContainer):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1336 """ Returns the 'X' button position in the navigation area. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1337
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1338 pc = pageContainer
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1339 style = pc.GetParent().GetWindowStyleFlag()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1340 rect = pc.GetClientRect()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1341 clientWidth = rect.width
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1342
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1343 if style & FNB_NO_X_BUTTON:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1344 return clientWidth
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1345 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1346 return clientWidth - 22
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1347
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1348
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1349 def GetButtonsAreaLength(self, pageContainer):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1350 """ Returns the navigation area width. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1351
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1352 pc = pageContainer
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1353 style = pc.GetParent().GetWindowStyleFlag()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1354
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1355 # ''
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1356 if style & FNB_NO_NAV_BUTTONS and style & FNB_NO_X_BUTTON and not style & FNB_DROPDOWN_TABS_LIST:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1357 return 0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1358
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1359 # 'x'
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1360 elif style & FNB_NO_NAV_BUTTONS and not style & FNB_NO_X_BUTTON and not style & FNB_DROPDOWN_TABS_LIST:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1361 return 22
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1362
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1363 # '<>'
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1364 if not style & FNB_NO_NAV_BUTTONS and style & FNB_NO_X_BUTTON and not style & FNB_DROPDOWN_TABS_LIST:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1365 return 53 - 16
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1366
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1367 # 'vx'
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1368 if style & FNB_DROPDOWN_TABS_LIST and not style & FNB_NO_X_BUTTON:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1369 return 22 + 16
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1370
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1371 # 'v'
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1372 if style & FNB_DROPDOWN_TABS_LIST and style & FNB_NO_X_BUTTON:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1373 return 22
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1374
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1375 # '<>x'
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1376 return 53
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1377
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1378
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1379 def DrawArrowAccordingToState(self, dc, pc, rect):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1380
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1381 lightFactor = (pc.HasFlag(FNB_BACKGROUND_GRADIENT) and [70] or [0])[0]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1382 PaintStraightGradientBox(dc, rect, pc._tabAreaColor, LightColour(pc._tabAreaColor, lightFactor))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1383
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1384
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1385 def DrawLeftArrow(self, pageContainer, dc):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1386 """ Draw the left navigation arrow. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1387
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1388 pc = pageContainer
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1389
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1390 style = pc.GetParent().GetWindowStyleFlag()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1391 if style & FNB_NO_NAV_BUTTONS:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1392 return
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1393
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1394 # Make sure that there are pages in the container
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1395 if not pc._pagesInfoVec:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1396 return
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1397
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1398 # Set the bitmap according to the button status
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1399 if pc._nLeftButtonStatus == FNB_BTN_HOVER:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1400 arrowBmp = wx.BitmapFromXPMData(left_arrow_hilite_xpm)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1401 elif pc._nLeftButtonStatus == FNB_BTN_PRESSED:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1402 arrowBmp = wx.BitmapFromXPMData(left_arrow_pressed_xpm)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1403 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1404 arrowBmp = wx.BitmapFromXPMData(left_arrow_xpm)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1405
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1406 if pc._nFrom == 0:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1407 # Handle disabled arrow
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1408 arrowBmp = wx.BitmapFromXPMData(left_arrow_disabled_xpm)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1409
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1410 arrowBmp.SetMask(wx.Mask(arrowBmp, MASK_COLOR))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1411
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1412 # Erase old bitmap
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1413 posx = self.GetLeftButtonPos(pc)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1414 self.DrawArrowAccordingToState(dc, pc, wx.Rect(posx, 6, 16, 14))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1415
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1416 # Draw the new bitmap
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1417 dc.DrawBitmap(arrowBmp, posx, 6, True)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1418
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1419
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1420 def DrawRightArrow(self, pageContainer, dc):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1421 """ Draw the right navigation arrow. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1422
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1423 pc = pageContainer
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1424
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1425 style = pc.GetParent().GetWindowStyleFlag()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1426 if style & FNB_NO_NAV_BUTTONS:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1427 return
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1428
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1429 # Make sure that there are pages in the container
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1430 if not pc._pagesInfoVec:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1431 return
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1432
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1433 # Set the bitmap according to the button status
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1434 if pc._nRightButtonStatus == FNB_BTN_HOVER:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1435 arrowBmp = wx.BitmapFromXPMData(right_arrow_hilite_xpm)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1436 elif pc._nRightButtonStatus == FNB_BTN_PRESSED:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1437 arrowBmp = wx.BitmapFromXPMData(right_arrow_pressed_xpm)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1438 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1439 arrowBmp = wx.BitmapFromXPMData(right_arrow_xpm)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1440
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1441 # Check if the right most tab is visible, if it is
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1442 # don't rotate right anymore
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1443 if pc._pagesInfoVec[-1].GetPosition() != wx.Point(-1, -1):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1444 arrowBmp = wx.BitmapFromXPMData(right_arrow_disabled_xpm)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1445
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1446 arrowBmp.SetMask(wx.Mask(arrowBmp, MASK_COLOR))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1447
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1448 # erase old bitmap
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1449 posx = self.GetRightButtonPos(pc)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1450 self.DrawArrowAccordingToState(dc, pc, wx.Rect(posx, 6, 16, 14))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1451
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1452 # Draw the new bitmap
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1453 dc.DrawBitmap(arrowBmp, posx, 6, True)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1454
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1455
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1456 def DrawDropDownArrow(self, pageContainer, dc):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1457 """ Draws the drop-down arrow in the navigation area. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1458
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1459 pc = pageContainer
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1460
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1461 # Check if this style is enabled
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1462 style = pc.GetParent().GetWindowStyleFlag()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1463 if not style & FNB_DROPDOWN_TABS_LIST:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1464 return
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1465
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1466 # Make sure that there are pages in the container
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1467 if not pc._pagesInfoVec:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1468 return
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1469
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1470 if pc._nArrowDownButtonStatus == FNB_BTN_HOVER:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1471 downBmp = wx.BitmapFromXPMData(down_arrow_hilite_xpm)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1472 elif pc._nArrowDownButtonStatus == FNB_BTN_PRESSED:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1473 downBmp = wx.BitmapFromXPMData(down_arrow_pressed_xpm)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1474 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1475 downBmp = wx.BitmapFromXPMData(down_arrow_xpm)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1476
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1477 downBmp.SetMask(wx.Mask(downBmp, MASK_COLOR))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1478
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1479 # erase old bitmap
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1480 posx = self.GetDropArrowButtonPos(pc)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1481 self.DrawArrowAccordingToState(dc, pc, wx.Rect(posx, 6, 16, 14))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1482
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1483 # Draw the new bitmap
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1484 dc.DrawBitmap(downBmp, posx, 6, True)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1485
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1486
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1487 def DrawX(self, pageContainer, dc):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1488 """ Draw the 'X' navigation button in the navigation area. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1489
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1490 pc = pageContainer
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1491
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1492 # Check if this style is enabled
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1493 style = pc.GetParent().GetWindowStyleFlag()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1494 if style & FNB_NO_X_BUTTON:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1495 return
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1496
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1497 # Make sure that there are pages in the container
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1498 if not pc._pagesInfoVec:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1499 return
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1500
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1501 # Set the bitmap according to the button status
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1502 if pc._nXButtonStatus == FNB_BTN_HOVER:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1503 xbmp = wx.BitmapFromXPMData(x_button_hilite_xpm)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1504 elif pc._nXButtonStatus == FNB_BTN_PRESSED:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1505 xbmp = wx.BitmapFromXPMData(x_button_pressed_xpm)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1506 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1507 xbmp = wx.BitmapFromXPMData(x_button_xpm)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1508
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1509 xbmp.SetMask(wx.Mask(xbmp, MASK_COLOR))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1510
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1511 # erase old bitmap
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1512 posx = self.GetXPos(pc)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1513 self.DrawArrowAccordingToState(dc, pc, wx.Rect(posx, 6, 16, 14))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1514
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1515 # Draw the new bitmap
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1516 dc.DrawBitmap(xbmp, posx, 6, True)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1517
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1518
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1519 def DrawTabX(self, pageContainer, dc, rect, tabIdx, btnStatus):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1520 """ Draws the 'X' in the selected tab. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1521
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1522 pc = pageContainer
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1523 if not pc.HasFlag(FNB_X_ON_TAB):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1524 return
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1525
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1526 # We draw the 'x' on the active tab only
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1527 if tabIdx != pc.GetSelection() or tabIdx < 0:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1528 return
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1529
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1530 # Set the bitmap according to the button status
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1531
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1532 if btnStatus == FNB_BTN_HOVER:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1533 xBmp = wx.BitmapFromXPMData(x_button_hilite_xpm)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1534 elif btnStatus == FNB_BTN_PRESSED:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1535 xBmp = wx.BitmapFromXPMData(x_button_pressed_xpm)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1536 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1537 xBmp = wx.BitmapFromXPMData(x_button_xpm)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1538
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1539 # Set the masking
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1540 xBmp.SetMask(wx.Mask(xBmp, MASK_COLOR))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1541
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1542 # Draw the new bitmap
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1543 dc.DrawBitmap(xBmp, rect.x, rect.y, True)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1544
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1545 # Update the vector
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1546 rr = wx.Rect(rect.x, rect.y, 14, 13)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1547 pc._pagesInfoVec[tabIdx].SetXRect(rr)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1548
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1549
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1550 def DrawTabsLine(self, pageContainer, dc, selTabX1=-1, selTabX2=-1):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1551 """ Draws a line over the tabs. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1552
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1553 pc = pageContainer
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1554
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1555 clntRect = pc.GetClientRect()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1556 clientRect3 = wx.Rect(0, 0, clntRect.width, clntRect.height)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1557
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1558 if pc.HasFlag(FNB_FF2):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1559 if not pc.HasFlag(FNB_BOTTOM):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1560 fillColor = wx.SystemSettings_GetColour(wx.SYS_COLOUR_3DFACE)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1561 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1562 fillColor = wx.WHITE
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1563
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1564 dc.SetPen(wx.Pen(fillColor))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1565
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1566 if pc.HasFlag(FNB_BOTTOM):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1567
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1568 dc.DrawLine(1, 0, clntRect.width-1, 0)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1569 dc.DrawLine(1, 1, clntRect.width-1, 1)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1570
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1571 dc.SetPen(wx.Pen(wx.SystemSettings_GetColour(wx.SYS_COLOUR_BTNSHADOW)))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1572 dc.DrawLine(1, 2, clntRect.width-1, 2)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1573
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1574 dc.SetPen(wx.Pen(fillColor))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1575 dc.DrawLine(selTabX1 + 2, 2, selTabX2 - 1, 2)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1576
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1577 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1578
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1579 dc.DrawLine(1, clntRect.height, clntRect.width-1, clntRect.height)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1580 dc.DrawLine(1, clntRect.height-1, clntRect.width-1, clntRect.height-1)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1581
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1582 dc.SetPen(wx.Pen(wx.SystemSettings_GetColour(wx.SYS_COLOUR_BTNSHADOW)))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1583 dc.DrawLine(1, clntRect.height-2, clntRect.width-1, clntRect.height-2)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1584
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1585 dc.SetPen(wx.Pen(wx.SystemSettings_GetColour(wx.SYS_COLOUR_3DFACE)))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1586 dc.DrawLine(selTabX1 + 2, clntRect.height-2, selTabX2-1, clntRect.height-2)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1587
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1588 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1589
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1590 if pc.HasFlag(FNB_BOTTOM):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1591
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1592 clientRect = wx.Rect(0, 2, clntRect.width, clntRect.height - 2)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1593 clientRect2 = wx.Rect(0, 1, clntRect.width, clntRect.height - 1)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1594
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1595 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1596
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1597 clientRect = wx.Rect(0, 0, clntRect.width, clntRect.height - 2)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1598 clientRect2 = wx.Rect(0, 0, clntRect.width, clntRect.height - 1)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1599
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1600 dc.SetBrush(wx.TRANSPARENT_BRUSH)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1601 dc.SetPen(wx.Pen(pc.GetSingleLineBorderColour()))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1602 dc.DrawRectangleRect(clientRect2)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1603 dc.DrawRectangleRect(clientRect3)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1604
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1605 dc.SetPen(wx.Pen(wx.SystemSettings_GetColour(wx.SYS_COLOUR_BTNSHADOW)))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1606 dc.DrawRectangleRect(clientRect)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1607
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1608 if not pc.HasFlag(FNB_TABS_BORDER_SIMPLE):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1609
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1610 dc.SetPen(wx.Pen((pc.HasFlag(FNB_VC71) and [wx.Colour(247, 243, 233)] or [pc._tabAreaColor])[0]))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1611 dc.DrawLine(0, 0, 0, clientRect.height+1)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1612
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1613 if pc.HasFlag(FNB_BOTTOM):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1614
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1615 dc.DrawLine(0, clientRect.height+1, clientRect.width, clientRect.height+1)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1616
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1617 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1618
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1619 dc.DrawLine(0, 0, clientRect.width, 0)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1620
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1621 dc.DrawLine(clientRect.width - 1, 0, clientRect.width - 1, clientRect.height+1)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1622
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1623
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1624 def CalcTabWidth(self, pageContainer, tabIdx, tabHeight):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1625 """ Calculates the width of the input tab. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1626
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1627 pc = pageContainer
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1628 dc = wx.MemoryDC()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1629 dc.SelectObject(wx.EmptyBitmap(1,1))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1630
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1631 boldFont = wx.SystemSettings_GetFont(wx.SYS_DEFAULT_GUI_FONT)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1632 boldFont.SetWeight(wx.FONTWEIGHT_BOLD)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1633
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1634 if pc.IsDefaultTabs():
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1635 shapePoints = int(tabHeight*math.tan(float(pc._pagesInfoVec[tabIdx].GetTabAngle())/180.0*math.pi))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1636
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1637 # Calculate the text length using the bold font, so when selecting a tab
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1638 # its width will not change
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1639 dc.SetFont(boldFont)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1640 width, pom = dc.GetTextExtent(pc.GetPageText(tabIdx))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1641
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1642 # Set a minimum size to a tab
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1643 if width < 20:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1644 width = 20
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1645
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1646 tabWidth = 2*pc._pParent.GetPadding() + width
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1647
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1648 # Style to add a small 'x' button on the top right
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1649 # of the tab
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1650 if pc.HasFlag(FNB_X_ON_TAB) and tabIdx == pc.GetSelection():
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1651 # The xpm image that contains the 'x' button is 9 pixels
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1652 spacer = 9
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1653 if pc.HasFlag(FNB_VC8):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1654 spacer = 4
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1655
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1656 tabWidth += pc._pParent.GetPadding() + spacer
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1657
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1658 if pc.IsDefaultTabs():
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1659 # Default style
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1660 tabWidth += 2*shapePoints
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1661
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1662 hasImage = pc._ImageList != None and pc._pagesInfoVec[tabIdx].GetImageIndex() != -1
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1663
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1664 # For VC71 style, we only add the icon size (16 pixels)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1665 if hasImage:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1666
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1667 if not pc.IsDefaultTabs():
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1668 tabWidth += 16 + pc._pParent.GetPadding()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1669 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1670 # Default style
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1671 tabWidth += 16 + pc._pParent.GetPadding() + shapePoints/2
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1672
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1673 return tabWidth
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1674
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1675
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1676 def CalcTabHeight(self, pageContainer):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1677 """ Calculates the height of the input tab. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1678
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1679 if self._tabHeight:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1680 return self._tabHeight
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1681
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1682 pc = pageContainer
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1683 dc = wx.MemoryDC()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1684 dc.SelectObject(wx.EmptyBitmap(1,1))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1685
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1686 # For GTK it seems that we must do this steps in order
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1687 # for the tabs will get the proper height on initialization
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1688 # on MSW, preforming these steps yields wierd results
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1689 normalFont = wx.SystemSettings_GetFont(wx.SYS_DEFAULT_GUI_FONT)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1690 boldFont = normalFont
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1691
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1692 if "__WXGTK__" in wx.PlatformInfo:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1693 boldFont.SetWeight(wx.FONTWEIGHT_BOLD)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1694 dc.SetFont(boldFont)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1695
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1696 height = dc.GetCharHeight()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1697
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1698 tabHeight = height + FNB_HEIGHT_SPACER # We use 8 pixels as padding
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1699 if "__WXGTK__" in wx.PlatformInfo:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1700 # On GTK the tabs are should be larger
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1701 tabHeight += 6
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1702
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1703 self._tabHeight = tabHeight
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1704
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1705 return tabHeight
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1706
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1707
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1708 def DrawTabs(self, pageContainer, dc):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1709 """ Actually draws the tabs in L{FlatNotebook}."""
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1710
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1711 pc = pageContainer
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1712 if "__WXMAC__" in wx.PlatformInfo:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1713 # Works well on MSW & GTK, however this lines should be skipped on MAC
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1714 if not pc._pagesInfoVec or pc._nFrom >= len(pc._pagesInfoVec):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1715 pc.Hide()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1716 return
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1717
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1718 # Get the text hight
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1719 tabHeight = self.CalcTabHeight(pageContainer)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1720 style = pc.GetParent().GetWindowStyleFlag()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1721
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1722 # Calculate the number of rows required for drawing the tabs
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1723 rect = pc.GetClientRect()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1724 clientWidth = rect.width
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1725
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1726 # Set the maximum client size
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1727 pc.SetSizeHints(self.GetButtonsAreaLength(pc), tabHeight)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1728 borderPen = wx.Pen(wx.SystemSettings_GetColour(wx.SYS_COLOUR_BTNSHADOW))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1729
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1730 if style & FNB_VC71:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1731 backBrush = wx.Brush(wx.Colour(247, 243, 233))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1732 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1733 backBrush = wx.Brush(pc._tabAreaColor)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1734
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1735 noselBrush = wx.Brush(wx.SystemSettings_GetColour(wx.SYS_COLOUR_BTNFACE))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1736 selBrush = wx.Brush(pc._activeTabColor)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1737
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1738 size = pc.GetSize()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1739
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1740 # Background
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1741 dc.SetTextBackground((style & FNB_VC71 and [wx.Colour(247, 243, 233)] or [pc.GetBackgroundColour()])[0])
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1742 dc.SetTextForeground(pc._activeTextColor)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1743 dc.SetBrush(backBrush)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1744
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1745 # If border style is set, set the pen to be border pen
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1746 if pc.HasFlag(FNB_TABS_BORDER_SIMPLE):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1747 dc.SetPen(borderPen)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1748 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1749 colr = (pc.HasFlag(FNB_VC71) and [wx.Colour(247, 243, 233)] or [pc.GetBackgroundColour()])[0]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1750 dc.SetPen(wx.Pen(colr))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1751
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1752 if pc.HasFlag(FNB_FF2):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1753 lightFactor = (pc.HasFlag(FNB_BACKGROUND_GRADIENT) and [70] or [0])[0]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1754 PaintStraightGradientBox(dc, pc.GetClientRect(), pc._tabAreaColor, LightColour(pc._tabAreaColor, lightFactor))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1755 dc.SetBrush(wx.TRANSPARENT_BRUSH)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1756
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1757 dc.DrawRectangle(0, 0, size.x, size.y)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1758
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1759 # We always draw the bottom/upper line of the tabs
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1760 # regradless the style
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1761 dc.SetPen(borderPen)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1762
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1763 if not pc.HasFlag(FNB_FF2):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1764 self.DrawTabsLine(pc, dc)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1765
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1766 # Restore the pen
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1767 dc.SetPen(borderPen)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1768
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1769 if pc.HasFlag(FNB_VC71):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1770
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1771 greyLineYVal = (pc.HasFlag(FNB_BOTTOM) and [0] or [size.y - 2])[0]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1772 whiteLineYVal = (pc.HasFlag(FNB_BOTTOM) and [3] or [size.y - 3])[0]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1773
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1774 pen = wx.Pen(wx.SystemSettings_GetColour(wx.SYS_COLOUR_3DFACE))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1775 dc.SetPen(pen)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1776
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1777 # Draw thik grey line between the windows area and
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1778 # the tab area
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1779 for num in xrange(3):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1780 dc.DrawLine(0, greyLineYVal + num, size.x, greyLineYVal + num)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1781
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1782 wbPen = (pc.HasFlag(FNB_BOTTOM) and [wx.BLACK_PEN] or [wx.WHITE_PEN])[0]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1783 dc.SetPen(wbPen)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1784 dc.DrawLine(1, whiteLineYVal, size.x - 1, whiteLineYVal)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1785
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1786 # Restore the pen
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1787 dc.SetPen(borderPen)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1788
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1789 # Draw labels
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1790 normalFont = wx.SystemSettings_GetFont(wx.SYS_DEFAULT_GUI_FONT)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1791 boldFont = wx.SystemSettings_GetFont(wx.SYS_DEFAULT_GUI_FONT)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1792 boldFont.SetWeight(wx.FONTWEIGHT_BOLD)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1793 dc.SetFont(boldFont)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1794
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1795 posx = pc._pParent.GetPadding()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1796
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1797 # Update all the tabs from 0 to 'pc._nFrom' to be non visible
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1798 for i in xrange(pc._nFrom):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1799
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1800 pc._pagesInfoVec[i].SetPosition(wx.Point(-1, -1))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1801 pc._pagesInfoVec[i].GetRegion().Clear()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1802
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1803 count = pc._nFrom
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1804
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1805 #----------------------------------------------------------
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1806 # Go over and draw the visible tabs
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1807 #----------------------------------------------------------
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1808 x1 = x2 = -1
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1809 for i in xrange(pc._nFrom, len(pc._pagesInfoVec)):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1810
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1811 dc.SetPen(borderPen)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1812
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1813 if not pc.HasFlag(FNB_FF2):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1814 dc.SetBrush((i==pc.GetSelection() and [selBrush] or [noselBrush])[0])
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1815
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1816 # Now set the font to the correct font
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1817 dc.SetFont((i==pc.GetSelection() and [boldFont] or [normalFont])[0])
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1818
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1819 # Add the padding to the tab width
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1820 # Tab width:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1821 # +-----------------------------------------------------------+
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1822 # | PADDING | IMG | IMG_PADDING | TEXT | PADDING | x |PADDING |
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1823 # +-----------------------------------------------------------+
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1824 tabWidth = self.CalcTabWidth(pageContainer, i, tabHeight)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1825
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1826 # Check if we can draw more
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1827 if posx + tabWidth + self.GetButtonsAreaLength(pc) >= clientWidth:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1828 break
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1829
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1830 count = count + 1
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1831
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1832 # By default we clean the tab region
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1833 pc._pagesInfoVec[i].GetRegion().Clear()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1834
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1835 # Clean the 'x' buttn on the tab.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1836 # A 'Clean' rectangle, is a rectangle with width or height
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1837 # with values lower than or equal to 0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1838 pc._pagesInfoVec[i].GetXRect().SetSize(wx.Size(-1, -1))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1839
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1840 # Draw the tab (border, text, image & 'x' on tab)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1841 self.DrawTab(pc, dc, posx, i, tabWidth, tabHeight, pc._nTabXButtonStatus)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1842
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1843 if pc.GetSelection() == i:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1844 x1 = posx
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1845 x2 = posx + tabWidth + 2
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1846
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1847 # Restore the text forground
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1848 dc.SetTextForeground(pc._activeTextColor)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1849
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1850 # Update the tab position & size
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1851 posy = (pc.HasFlag(FNB_BOTTOM) and [0] or [VERTICAL_BORDER_PADDING])[0]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1852
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1853 pc._pagesInfoVec[i].SetPosition(wx.Point(posx, posy))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1854 pc._pagesInfoVec[i].SetSize(wx.Size(tabWidth, tabHeight))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1855 self.DrawFocusRectangle(dc, pc, pc._pagesInfoVec[i])
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1856
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1857 posx += tabWidth
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1858
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1859 # Update all tabs that can not fit into the screen as non-visible
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1860 for i in xrange(count, len(pc._pagesInfoVec)):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1861 pc._pagesInfoVec[i].SetPosition(wx.Point(-1, -1))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1862 pc._pagesInfoVec[i].GetRegion().Clear()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1863
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1864 # Draw the left/right/close buttons
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1865 # Left arrow
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1866 self.DrawLeftArrow(pc, dc)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1867 self.DrawRightArrow(pc, dc)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1868 self.DrawX(pc, dc)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1869 self.DrawDropDownArrow(pc, dc)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1870
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1871 if pc.HasFlag(FNB_FF2):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1872 self.DrawTabsLine(pc, dc, x1, x2)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1873
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1874
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1875 def DrawFocusRectangle(self, dc, pageContainer, page):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1876 """ Draws a focus rectangle like the native Notebooks. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1877
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1878 if not page._hasFocus:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1879 return
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1880
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1881 tabPos = wx.Point(*page.GetPosition())
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1882 if pageContainer.GetParent().GetWindowStyleFlag() & FNB_VC8:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1883 vc8ShapeLen = self.CalcTabHeight(pageContainer) - VERTICAL_BORDER_PADDING - 2
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1884 tabPos.x += vc8ShapeLen
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1885
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1886 rect = wx.RectPS(tabPos, page.GetSize())
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1887 rect = wx.Rect(rect.x+2, rect.y+2, rect.width-4, rect.height-8)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1888
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1889 if wx.Platform == '__WXMAC__':
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1890 rect.SetWidth(rect.GetWidth() + 1)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1891
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1892 dc.SetBrush(wx.TRANSPARENT_BRUSH)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1893 dc.SetPen(self._focusPen)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1894 dc.DrawRoundedRectangleRect(rect, 2)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1895
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1896
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1897 def DrawDragHint(self, pc, tabIdx):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1898 """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1899 Draws tab drag hint, the default implementation is to do nothing.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1900 You can override this function to provide a nice feedback to user.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1901 """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1902
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1903 pass
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1904
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1905
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1906 def NumberTabsCanFit(self, pageContainer, fr=-1):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1907
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1908 pc = pageContainer
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1909
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1910 rect = pc.GetClientRect()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1911 clientWidth = rect.width
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1912
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1913 vTabInfo = []
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1914
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1915 tabHeight = self.CalcTabHeight(pageContainer)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1916
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1917 # The drawing starts from posx
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1918 posx = pc._pParent.GetPadding()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1919
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1920 if fr < 0:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1921 fr = pc._nFrom
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1922
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1923 for i in xrange(fr, len(pc._pagesInfoVec)):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1924
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1925 tabWidth = self.CalcTabWidth(pageContainer, i, tabHeight)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1926 if posx + tabWidth + self.GetButtonsAreaLength(pc) >= clientWidth:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1927 break;
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1928
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1929 # Add a result to the returned vector
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1930 tabRect = wx.Rect(posx, VERTICAL_BORDER_PADDING, tabWidth , tabHeight)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1931 vTabInfo.append(tabRect)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1932
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1933 # Advance posx
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1934 posx += tabWidth + FNB_HEIGHT_SPACER
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1935
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1936 return vTabInfo
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1937
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1938
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1939 # ---------------------------------------------------------------------------- #
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1940 # Class FNBRendererMgr
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1941 # A manager that handles all the renderers defined below and calls the
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1942 # appropriate one when drawing is needed
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1943 # ---------------------------------------------------------------------------- #
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1944
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1945 class FNBRendererMgr:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1946 """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1947 This class represents a manager that handles all the 4 renderers defined
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1948 and calls the appropriate one when drawing is needed.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1949 """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1950
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1951 def __init__(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1952 """ Default class constructor. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1953
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1954 # register renderers
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1955
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1956 self._renderers = {}
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1957 self._renderers.update({-1: FNBRendererDefault()})
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1958 self._renderers.update({FNB_VC71: FNBRendererVC71()})
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1959 self._renderers.update({FNB_FANCY_TABS: FNBRendererFancy()})
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1960 self._renderers.update({FNB_VC8: FNBRendererVC8()})
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1961 self._renderers.update({FNB_FF2: FNBRendererFirefox2()})
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1962
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1963
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1964 def GetRenderer(self, style):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1965 """ Returns the current renderer based on the style selected. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1966
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1967 if style & FNB_VC71:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1968 return self._renderers[FNB_VC71]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1969
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1970 if style & FNB_FANCY_TABS:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1971 return self._renderers[FNB_FANCY_TABS]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1972
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1973 if style & FNB_VC8:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1974 return self._renderers[FNB_VC8]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1975
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1976 if style & FNB_FF2:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1977 return self._renderers[FNB_FF2]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1978
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1979 # the default is to return the default renderer
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1980 return self._renderers[-1]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1981
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1982
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1983 #------------------------------------------
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1984 # Default renderer
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1985 #------------------------------------------
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1986
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1987 class FNBRendererDefault(FNBRenderer):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1988 """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1989 This class handles the drawing of tabs using the I{Standard} renderer.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1990 """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1991
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1992 def __init__(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1993 """ Default class constructor. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1994
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1995 FNBRenderer.__init__(self)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1996
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1997
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1998 def DrawTab(self, pageContainer, dc, posx, tabIdx, tabWidth, tabHeight, btnStatus):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1999 """ Draws a tab using the I{Standard} style. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2000
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2001 # Default style
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2002 borderPen = wx.Pen(wx.SystemSettings_GetColour(wx.SYS_COLOUR_BTNSHADOW))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2003 pc = pageContainer
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2004
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2005 tabPoints = [wx.Point() for ii in xrange(7)]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2006 tabPoints[0].x = posx
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2007 tabPoints[0].y = (pc.HasFlag(FNB_BOTTOM) and [2] or [tabHeight - 2])[0]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2008
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2009 tabPoints[1].x = int(posx+(tabHeight-2)*math.tan(float(pc._pagesInfoVec[tabIdx].GetTabAngle())/180.0*math.pi))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2010 tabPoints[1].y = (pc.HasFlag(FNB_BOTTOM) and [tabHeight - (VERTICAL_BORDER_PADDING+2)] or [(VERTICAL_BORDER_PADDING+2)])[0]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2011
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2012 tabPoints[2].x = tabPoints[1].x+2
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2013 tabPoints[2].y = (pc.HasFlag(FNB_BOTTOM) and [tabHeight - VERTICAL_BORDER_PADDING] or [VERTICAL_BORDER_PADDING])[0]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2014
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2015 tabPoints[3].x = int(posx+tabWidth-(tabHeight-2)*math.tan(float(pc._pagesInfoVec[tabIdx].GetTabAngle())/180.0*math.pi))-2
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2016 tabPoints[3].y = (pc.HasFlag(FNB_BOTTOM) and [tabHeight - VERTICAL_BORDER_PADDING] or [VERTICAL_BORDER_PADDING])[0]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2017
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2018 tabPoints[4].x = tabPoints[3].x+2
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2019 tabPoints[4].y = (pc.HasFlag(FNB_BOTTOM) and [tabHeight - (VERTICAL_BORDER_PADDING+2)] or [(VERTICAL_BORDER_PADDING+2)])[0]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2020
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2021 tabPoints[5].x = int(tabPoints[4].x+(tabHeight-2)*math.tan(float(pc._pagesInfoVec[tabIdx].GetTabAngle())/180.0*math.pi))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2022 tabPoints[5].y = (pc.HasFlag(FNB_BOTTOM) and [2] or [tabHeight - 2])[0]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2023
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2024 tabPoints[6].x = tabPoints[0].x
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2025 tabPoints[6].y = tabPoints[0].y
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2026
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2027 if tabIdx == pc.GetSelection():
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2028
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2029 # Draw the tab as rounded rectangle
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2030 dc.DrawPolygon(tabPoints)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2031
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2032 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2033
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2034 if tabIdx != pc.GetSelection() - 1:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2035
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2036 # Draw a vertical line to the right of the text
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2037 pt1x = tabPoints[5].x
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2038 pt1y = (pc.HasFlag(FNB_BOTTOM) and [4] or [tabHeight - 6])[0]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2039 pt2x = tabPoints[5].x
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2040 pt2y = (pc.HasFlag(FNB_BOTTOM) and [tabHeight - 4] or [4])[0]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2041 dc.DrawLine(pt1x, pt1y, pt2x, pt2y)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2042
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2043 if tabIdx == pc.GetSelection():
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2044
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2045 savePen = dc.GetPen()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2046 whitePen = wx.Pen(wx.WHITE)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2047 whitePen.SetWidth(1)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2048 dc.SetPen(whitePen)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2049
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2050 secPt = wx.Point(tabPoints[5].x + 1, tabPoints[5].y)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2051 dc.DrawLine(tabPoints[0].x, tabPoints[0].y, secPt.x, secPt.y)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2052
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2053 # Restore the pen
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2054 dc.SetPen(savePen)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2055
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2056 # -----------------------------------
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2057 # Text and image drawing
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2058 # -----------------------------------
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2059
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2060 # Text drawing offset from the left border of the
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2061 # rectangle
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2062
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2063 # The width of the images are 16 pixels
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2064 padding = pc.GetParent().GetPadding()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2065 shapePoints = int(tabHeight*math.tan(float(pc._pagesInfoVec[tabIdx].GetTabAngle())/180.0*math.pi))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2066 hasImage = pc._pagesInfoVec[tabIdx].GetImageIndex() != -1
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2067 imageYCoord = (pc.HasFlag(FNB_BOTTOM) and [6] or [8])[0]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2068
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2069 if hasImage:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2070 textOffset = 2*pc._pParent._nPadding + 16 + shapePoints/2
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2071 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2072 textOffset = pc._pParent._nPadding + shapePoints/2
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2073
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2074 textOffset += 2
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2075
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2076 if tabIdx != pc.GetSelection():
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2077
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2078 # Set the text background to be like the vertical lines
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2079 dc.SetTextForeground(pc._pParent.GetNonActiveTabTextColour())
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2080
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2081 if hasImage:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2082
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2083 imageXOffset = textOffset - 16 - padding
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2084 pc._ImageList.Draw(pc._pagesInfoVec[tabIdx].GetImageIndex(), dc,
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2085 posx + imageXOffset, imageYCoord,
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2086 wx.IMAGELIST_DRAW_TRANSPARENT, True)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2087
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2088 dc.DrawText(pc.GetPageText(tabIdx), posx + textOffset, imageYCoord)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2089
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2090 # draw 'x' on tab (if enabled)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2091 if pc.HasFlag(FNB_X_ON_TAB) and tabIdx == pc.GetSelection():
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2092
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2093 textWidth, textHeight = dc.GetTextExtent(pc.GetPageText(tabIdx))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2094 tabCloseButtonXCoord = posx + textOffset + textWidth + 1
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2095
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2096 # take a bitmap from the position of the 'x' button (the x on tab button)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2097 # this bitmap will be used later to delete old buttons
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2098 tabCloseButtonYCoord = imageYCoord
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2099 x_rect = wx.Rect(tabCloseButtonXCoord, tabCloseButtonYCoord, 16, 16)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2100
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2101 # Draw the tab
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2102 self.DrawTabX(pc, dc, x_rect, tabIdx, btnStatus)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2103
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2104
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2105 #------------------------------------------
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2106 # Firefox2 renderer
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2107 #------------------------------------------
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2108 class FNBRendererFirefox2(FNBRenderer):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2109 """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2110 This class handles the drawing of tabs using the I{Firefox 2} renderer.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2111 """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2112
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2113 def __init__(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2114 """ Default class constructor. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2115
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2116 FNBRenderer.__init__(self)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2117
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2118
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2119 def DrawTab(self, pageContainer, dc, posx, tabIdx, tabWidth, tabHeight, btnStatus):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2120 """ Draws a tab using the I{Firefox 2} style. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2121
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2122 borderPen = wx.Pen(wx.SystemSettings_GetColour(wx.SYS_COLOUR_BTNSHADOW))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2123 pc = pageContainer
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2124
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2125 tabPoints = [wx.Point() for indx in xrange(7)]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2126 tabPoints[0].x = posx + 2
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2127 tabPoints[0].y = (pc.HasFlag(FNB_BOTTOM) and [2] or [tabHeight - 2])[0]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2128
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2129 tabPoints[1].x = tabPoints[0].x
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2130 tabPoints[1].y = (pc.HasFlag(FNB_BOTTOM) and [tabHeight - (VERTICAL_BORDER_PADDING+2)] or [(VERTICAL_BORDER_PADDING+2)])[0]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2131
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2132 tabPoints[2].x = tabPoints[1].x+2
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2133 tabPoints[2].y = (pc.HasFlag(FNB_BOTTOM) and [tabHeight - VERTICAL_BORDER_PADDING] or [VERTICAL_BORDER_PADDING])[0]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2134
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2135 tabPoints[3].x = posx + tabWidth - 2
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2136 tabPoints[3].y = (pc.HasFlag(FNB_BOTTOM) and [tabHeight - VERTICAL_BORDER_PADDING] or [VERTICAL_BORDER_PADDING])[0]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2137
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2138 tabPoints[4].x = tabPoints[3].x + 2
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2139 tabPoints[4].y = (pc.HasFlag(FNB_BOTTOM) and [tabHeight - (VERTICAL_BORDER_PADDING+2)] or [(VERTICAL_BORDER_PADDING+2)])[0]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2140
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2141 tabPoints[5].x = tabPoints[4].x
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2142 tabPoints[5].y = (pc.HasFlag(FNB_BOTTOM) and [2] or [tabHeight - 2])[0]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2143
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2144 tabPoints[6].x = tabPoints[0].x
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2145 tabPoints[6].y = tabPoints[0].y
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2146
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2147 #------------------------------------
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2148 # Paint the tab with gradient
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2149 #------------------------------------
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2150 rr = wx.RectPP(tabPoints[2], tabPoints[5])
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2151 DrawButton(dc, rr, pc.GetSelection() == tabIdx , not pc.HasFlag(FNB_BOTTOM))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2152
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2153 dc.SetBrush(wx.TRANSPARENT_BRUSH)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2154 dc.SetPen(borderPen)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2155
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2156 # Draw the tab as rounded rectangle
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2157 dc.DrawPolygon(tabPoints)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2158
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2159 # -----------------------------------
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2160 # Text and image drawing
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2161 # -----------------------------------
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2162
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2163 # The width of the images are 16 pixels
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2164 padding = pc.GetParent().GetPadding()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2165 shapePoints = int(tabHeight*math.tan(float(pc._pagesInfoVec[tabIdx].GetTabAngle())/180.0*math.pi))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2166 hasImage = pc._pagesInfoVec[tabIdx].GetImageIndex() != -1
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2167 imageYCoord = (pc.HasFlag(FNB_BOTTOM) and [6] or [8])[0]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2168
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2169 if hasImage:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2170 textOffset = 2*padding + 16 + shapePoints/2
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2171 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2172 textOffset = padding + shapePoints/2
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2173
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2174 textOffset += 2
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2175
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2176 if tabIdx != pc.GetSelection():
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2177
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2178 # Set the text background to be like the vertical lines
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2179 dc.SetTextForeground(pc._pParent.GetNonActiveTabTextColour())
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2180
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2181 if hasImage:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2182 imageXOffset = textOffset - 16 - padding
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2183 pc._ImageList.Draw(pc._pagesInfoVec[tabIdx].GetImageIndex(), dc,
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2184 posx + imageXOffset, imageYCoord,
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2185 wx.IMAGELIST_DRAW_TRANSPARENT, True)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2186
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2187 dc.DrawText(pc.GetPageText(tabIdx), posx + textOffset, imageYCoord)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2188
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2189 # draw 'x' on tab (if enabled)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2190 if pc.HasFlag(FNB_X_ON_TAB) and tabIdx == pc.GetSelection():
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2191
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2192 textWidth, textHeight = dc.GetTextExtent(pc.GetPageText(tabIdx))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2193 tabCloseButtonXCoord = posx + textOffset + textWidth + 1
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2194
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2195 # take a bitmap from the position of the 'x' button (the x on tab button)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2196 # this bitmap will be used later to delete old buttons
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2197 tabCloseButtonYCoord = imageYCoord
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2198 x_rect = wx.Rect(tabCloseButtonXCoord, tabCloseButtonYCoord, 16, 16)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2199
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2200 # Draw the tab
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2201 self.DrawTabX(pc, dc, x_rect, tabIdx, btnStatus)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2202
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2203
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2204 #------------------------------------------------------------------
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2205 # Visual studio 7.1
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2206 #------------------------------------------------------------------
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2207
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2208 class FNBRendererVC71(FNBRenderer):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2209 """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2210 This class handles the drawing of tabs using the I{VC71} renderer.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2211 """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2212
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2213 def __init__(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2214 """ Default class constructor. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2215
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2216 FNBRenderer.__init__(self)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2217
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2218
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2219 def DrawTab(self, pageContainer, dc, posx, tabIdx, tabWidth, tabHeight, btnStatus):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2220 """ Draws a tab using the I{VC71} style. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2221
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2222 # Visual studio 7.1 style
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2223 borderPen = wx.Pen(wx.SystemSettings_GetColour(wx.SYS_COLOUR_BTNSHADOW))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2224 pc = pageContainer
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2225
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2226 dc.SetPen((tabIdx == pc.GetSelection() and [wx.Pen(wx.SystemSettings_GetColour(wx.SYS_COLOUR_3DFACE))] or [borderPen])[0])
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2227 dc.SetBrush((tabIdx == pc.GetSelection() and [wx.Brush(wx.SystemSettings_GetColour(wx.SYS_COLOUR_3DFACE))] or [wx.Brush(wx.Colour(247, 243, 233))])[0])
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2228
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2229 if tabIdx == pc.GetSelection():
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2230
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2231 posy = (pc.HasFlag(FNB_BOTTOM) and [0] or [VERTICAL_BORDER_PADDING])[0]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2232 tabH = (pc.HasFlag(FNB_BOTTOM) and [tabHeight - 5] or [tabHeight - 3])[0]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2233 dc.DrawRectangle(posx, posy, tabWidth, tabH)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2234
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2235 # Draw a black line on the left side of the
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2236 # rectangle
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2237 dc.SetPen(wx.BLACK_PEN)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2238
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2239 blackLineY1 = VERTICAL_BORDER_PADDING
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2240 blackLineY2 = tabH
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2241 dc.DrawLine(posx + tabWidth, blackLineY1, posx + tabWidth, blackLineY2)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2242
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2243 # To give the tab more 3D look we do the following
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2244 # Incase the tab is on top,
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2245 # Draw a thik white line on topof the rectangle
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2246 # Otherwise, draw a thin (1 pixel) black line at the bottom
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2247
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2248 pen = wx.Pen((pc.HasFlag(FNB_BOTTOM) and [wx.BLACK] or [wx.WHITE])[0])
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2249 dc.SetPen(pen)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2250 whiteLinePosY = (pc.HasFlag(FNB_BOTTOM) and [blackLineY2] or [VERTICAL_BORDER_PADDING ])[0]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2251 dc.DrawLine(posx , whiteLinePosY, posx + tabWidth + 1, whiteLinePosY)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2252
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2253 # Draw a white vertical line to the left of the tab
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2254 dc.SetPen(wx.WHITE_PEN)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2255 if not pc.HasFlag(FNB_BOTTOM):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2256 blackLineY2 += 1
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2257
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2258 dc.DrawLine(posx, blackLineY1, posx, blackLineY2)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2259
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2260 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2261
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2262 # We dont draw a rectangle for non selected tabs, but only
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2263 # vertical line on the left
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2264
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2265 blackLineY1 = (pc.HasFlag(FNB_BOTTOM) and [VERTICAL_BORDER_PADDING + 2] or [VERTICAL_BORDER_PADDING + 1])[0]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2266 blackLineY2 = pc.GetSize().y - 5
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2267 dc.DrawLine(posx + tabWidth, blackLineY1, posx + tabWidth, blackLineY2)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2268
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2269 # -----------------------------------
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2270 # Text and image drawing
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2271 # -----------------------------------
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2272
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2273 # Text drawing offset from the left border of the
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2274 # rectangle
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2275
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2276 # The width of the images are 16 pixels
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2277 padding = pc.GetParent().GetPadding()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2278 hasImage = pc._pagesInfoVec[tabIdx].GetImageIndex() != -1
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2279 imageYCoord = (pc.HasFlag(FNB_BOTTOM) and [5] or [8])[0]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2280
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2281 if hasImage:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2282 textOffset = 2*pc._pParent._nPadding + 16
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2283 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2284 textOffset = pc._pParent._nPadding
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2285
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2286 if tabIdx != pc.GetSelection():
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2287
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2288 # Set the text background to be like the vertical lines
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2289 dc.SetTextForeground(pc._pParent.GetNonActiveTabTextColour())
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2290
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2291 if hasImage:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2292
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2293 imageXOffset = textOffset - 16 - padding
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2294 pc._ImageList.Draw(pc._pagesInfoVec[tabIdx].GetImageIndex(), dc,
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2295 posx + imageXOffset, imageYCoord,
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2296 wx.IMAGELIST_DRAW_TRANSPARENT, True)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2297
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2298 dc.DrawText(pc.GetPageText(tabIdx), posx + textOffset, imageYCoord)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2299
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2300 # draw 'x' on tab (if enabled)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2301 if pc.HasFlag(FNB_X_ON_TAB) and tabIdx == pc.GetSelection():
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2302
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2303 textWidth, textHeight = dc.GetTextExtent(pc.GetPageText(tabIdx))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2304 tabCloseButtonXCoord = posx + textOffset + textWidth + 1
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2305
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2306 # take a bitmap from the position of the 'x' button (the x on tab button)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2307 # this bitmap will be used later to delete old buttons
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2308 tabCloseButtonYCoord = imageYCoord
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2309 x_rect = wx.Rect(tabCloseButtonXCoord, tabCloseButtonYCoord, 16, 16)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2310
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2311 # Draw the tab
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2312 self.DrawTabX(pc, dc, x_rect, tabIdx, btnStatus)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2313
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2314
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2315 #------------------------------------------------------------------
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2316 # Fancy style
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2317 #------------------------------------------------------------------
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2318
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2319 class FNBRendererFancy(FNBRenderer):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2320 """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2321 This class handles the drawing of tabs using the I{Fancy} renderer.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2322 """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2323
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2324 def __init__(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2325 """ Default class constructor. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2326
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2327 FNBRenderer.__init__(self)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2328
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2329
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2330 def DrawTab(self, pageContainer, dc, posx, tabIdx, tabWidth, tabHeight, btnStatus):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2331 """ Draws a tab using the I{Fancy} style, similar to VC71 but with gradients. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2332
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2333 # Fancy tabs - like with VC71 but with the following differences:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2334 # - The Selected tab is colored with gradient color
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2335 borderPen = wx.Pen(wx.SystemSettings_GetColour(wx.SYS_COLOUR_BTNSHADOW))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2336 pc = pageContainer
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2337
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2338 pen = (tabIdx == pc.GetSelection() and [wx.Pen(pc._pParent.GetBorderColour())] or [wx.Pen(wx.SystemSettings_GetColour(wx.SYS_COLOUR_3DFACE))])[0]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2339
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2340 if tabIdx == pc.GetSelection():
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2341
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2342 posy = (pc.HasFlag(FNB_BOTTOM) and [2] or [VERTICAL_BORDER_PADDING])[0]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2343 th = tabHeight - 5
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2344
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2345 rect = wx.Rect(posx, posy, tabWidth, th)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2346
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2347 col2 = (pc.HasFlag(FNB_BOTTOM) and [pc._pParent.GetGradientColourTo()] or [pc._pParent.GetGradientColourFrom()])[0]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2348 col1 = (pc.HasFlag(FNB_BOTTOM) and [pc._pParent.GetGradientColourFrom()] or [pc._pParent.GetGradientColourTo()])[0]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2349
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2350 PaintStraightGradientBox(dc, rect, col1, col2)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2351 dc.SetBrush(wx.TRANSPARENT_BRUSH)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2352 dc.SetPen(pen)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2353 dc.DrawRectangleRect(rect)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2354
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2355 # erase the bottom/top line of the rectangle
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2356 dc.SetPen(wx.Pen(pc._pParent.GetGradientColourFrom()))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2357 if pc.HasFlag(FNB_BOTTOM):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2358 dc.DrawLine(rect.x, 2, rect.x + rect.width, 2)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2359 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2360 dc.DrawLine(rect.x, rect.y + rect.height - 1, rect.x + rect.width, rect.y + rect.height - 1)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2361
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2362 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2363
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2364 # We dont draw a rectangle for non selected tabs, but only
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2365 # vertical line on the left
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2366 dc.SetPen(borderPen)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2367 dc.DrawLine(posx + tabWidth, VERTICAL_BORDER_PADDING + 3, posx + tabWidth, tabHeight - 4)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2368
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2369
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2370 # -----------------------------------
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2371 # Text and image drawing
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2372 # -----------------------------------
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2373
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2374 # Text drawing offset from the left border of the
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2375 # rectangle
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2376
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2377 # The width of the images are 16 pixels
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2378 padding = pc.GetParent().GetPadding()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2379 hasImage = pc._pagesInfoVec[tabIdx].GetImageIndex() != -1
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2380 imageYCoord = (pc.HasFlag(FNB_BOTTOM) and [6] or [8])[0]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2381
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2382 if hasImage:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2383 textOffset = 2*pc._pParent._nPadding + 16
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2384 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2385 textOffset = pc._pParent._nPadding
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2386
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2387 textOffset += 2
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2388
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2389 if tabIdx != pc.GetSelection():
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2390
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2391 # Set the text background to be like the vertical lines
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2392 dc.SetTextForeground(pc._pParent.GetNonActiveTabTextColour())
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2393
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2394 if hasImage:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2395
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2396 imageXOffset = textOffset - 16 - padding
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2397 pc._ImageList.Draw(pc._pagesInfoVec[tabIdx].GetImageIndex(), dc,
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2398 posx + imageXOffset, imageYCoord,
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2399 wx.IMAGELIST_DRAW_TRANSPARENT, True)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2400
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2401 dc.DrawText(pc.GetPageText(tabIdx), posx + textOffset, imageYCoord)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2402
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2403 # draw 'x' on tab (if enabled)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2404 if pc.HasFlag(FNB_X_ON_TAB) and tabIdx == pc.GetSelection():
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2405
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2406 textWidth, textHeight = dc.GetTextExtent(pc.GetPageText(tabIdx))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2407 tabCloseButtonXCoord = posx + textOffset + textWidth + 1
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2408
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2409 # take a bitmap from the position of the 'x' button (the x on tab button)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2410 # this bitmap will be used later to delete old buttons
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2411 tabCloseButtonYCoord = imageYCoord
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2412 x_rect = wx.Rect(tabCloseButtonXCoord, tabCloseButtonYCoord, 16, 16)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2413
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2414 # Draw the tab
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2415 self.DrawTabX(pc, dc, x_rect, tabIdx, btnStatus)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2416
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2417
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2418 #------------------------------------------------------------------
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2419 # Visual studio 2005 (VS8)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2420 #------------------------------------------------------------------
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2421 class FNBRendererVC8(FNBRenderer):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2422 """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2423 This class handles the drawing of tabs using the I{VC8} renderer.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2424 """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2425
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2426 def __init__(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2427 """ Default class constructor. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2428
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2429 FNBRenderer.__init__(self)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2430 self._first = True
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2431 self._factor = 1
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2432
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2433
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2434 def DrawTabs(self, pageContainer, dc):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2435 """ Draws all the tabs using VC8 style. Overloads The DrawTabs method in parent class. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2436
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2437 pc = pageContainer
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2438
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2439 if "__WXMAC__" in wx.PlatformInfo:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2440 # Works well on MSW & GTK, however this lines should be skipped on MAC
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2441 if not pc._pagesInfoVec or pc._nFrom >= len(pc._pagesInfoVec):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2442 pc.Hide()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2443 return
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2444
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2445 # Get the text hight
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2446 tabHeight = self.CalcTabHeight(pageContainer)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2447
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2448 # Set the font for measuring the tab height
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2449 normalFont = wx.SystemSettings_GetFont(wx.SYS_DEFAULT_GUI_FONT)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2450 boldFont = wx.SystemSettings_GetFont(wx.SYS_DEFAULT_GUI_FONT)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2451 boldFont.SetWeight(wx.FONTWEIGHT_BOLD)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2452
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2453 # Calculate the number of rows required for drawing the tabs
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2454 rect = pc.GetClientRect()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2455
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2456 # Set the maximum client size
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2457 pc.SetSizeHints(self.GetButtonsAreaLength(pc), tabHeight)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2458 borderPen = wx.Pen(wx.SystemSettings_GetColour(wx.SYS_COLOUR_BTNSHADOW))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2459
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2460 # Create brushes
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2461 backBrush = wx.Brush(pc._tabAreaColor)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2462 noselBrush = wx.Brush(wx.SystemSettings_GetColour(wx.SYS_COLOUR_BTNFACE))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2463 selBrush = wx.Brush(pc._activeTabColor)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2464 size = pc.GetSize()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2465
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2466 # Background
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2467 dc.SetTextBackground(pc.GetBackgroundColour())
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2468 dc.SetTextForeground(pc._activeTextColor)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2469
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2470 # If border style is set, set the pen to be border pen
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2471 if pc.HasFlag(FNB_TABS_BORDER_SIMPLE):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2472 dc.SetPen(borderPen)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2473 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2474 dc.SetPen(wx.TRANSPARENT_PEN)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2475
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2476 lightFactor = (pc.HasFlag(FNB_BACKGROUND_GRADIENT) and [70] or [0])[0]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2477
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2478 # For VC8 style, we color the tab area in gradient coloring
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2479 lightcolour = LightColour(pc._tabAreaColor, lightFactor)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2480 PaintStraightGradientBox(dc, pc.GetClientRect(), pc._tabAreaColor, lightcolour)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2481
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2482 dc.SetBrush(wx.TRANSPARENT_BRUSH)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2483 dc.DrawRectangle(0, 0, size.x, size.y)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2484
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2485 # We always draw the bottom/upper line of the tabs
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2486 # regradless the style
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2487 dc.SetPen(borderPen)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2488 self.DrawTabsLine(pc, dc)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2489
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2490 # Restore the pen
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2491 dc.SetPen(borderPen)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2492
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2493 # Draw labels
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2494 dc.SetFont(boldFont)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2495
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2496 # Update all the tabs from 0 to 'pc.self._nFrom' to be non visible
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2497 for i in xrange(pc._nFrom):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2498
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2499 pc._pagesInfoVec[i].SetPosition(wx.Point(-1, -1))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2500 pc._pagesInfoVec[i].GetRegion().Clear()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2501
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2502 # Draw the visible tabs, in VC8 style, we draw them from right to left
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2503 vTabsInfo = self.NumberTabsCanFit(pc)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2504
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2505 activeTabPosx = 0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2506 activeTabWidth = 0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2507 activeTabHeight = 0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2508
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2509 for cur in xrange(len(vTabsInfo)-1, -1, -1):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2510
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2511 # 'i' points to the index of the currently drawn tab
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2512 # in pc.GetPageInfoVector() vector
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2513 i = pc._nFrom + cur
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2514 dc.SetPen(borderPen)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2515 dc.SetBrush((i==pc.GetSelection() and [selBrush] or [noselBrush])[0])
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2516
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2517 # Now set the font to the correct font
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2518 dc.SetFont((i==pc.GetSelection() and [boldFont] or [normalFont])[0])
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2519
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2520 # Add the padding to the tab width
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2521 # Tab width:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2522 # +-----------------------------------------------------------+
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2523 # | PADDING | IMG | IMG_PADDING | TEXT | PADDING | x |PADDING |
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2524 # +-----------------------------------------------------------+
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2525
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2526 tabWidth = self.CalcTabWidth(pageContainer, i, tabHeight)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2527 posx = vTabsInfo[cur].x
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2528
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2529 # By default we clean the tab region
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2530 # incase we use the VC8 style which requires
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2531 # the region, it will be filled by the function
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2532 # drawVc8Tab
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2533 pc._pagesInfoVec[i].GetRegion().Clear()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2534
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2535 # Clean the 'x' buttn on the tab
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2536 # 'Clean' rectanlge is a rectangle with width or height
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2537 # with values lower than or equal to 0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2538 pc._pagesInfoVec[i].GetXRect().SetSize(wx.Size(-1, -1))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2539
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2540 # Draw the tab
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2541 # Incase we are drawing the active tab
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2542 # we need to redraw so it will appear on top
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2543 # of all other tabs
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2544
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2545 # when using the vc8 style, we keep the position of the active tab so we will draw it again later
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2546 if i == pc.GetSelection() and pc.HasFlag(FNB_VC8):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2547
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2548 activeTabPosx = posx
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2549 activeTabWidth = tabWidth
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2550 activeTabHeight = tabHeight
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2551
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2552 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2553
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2554 self.DrawTab(pc, dc, posx, i, tabWidth, tabHeight, pc._nTabXButtonStatus)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2555
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2556 # Restore the text forground
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2557 dc.SetTextForeground(pc._activeTextColor)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2558
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2559 # Update the tab position & size
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2560 pc._pagesInfoVec[i].SetPosition(wx.Point(posx, VERTICAL_BORDER_PADDING))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2561 pc._pagesInfoVec[i].SetSize(wx.Size(tabWidth, tabHeight))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2562
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2563 # Incase we are in VC8 style, redraw the active tab (incase it is visible)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2564 if pc.GetSelection() >= pc._nFrom and pc.GetSelection() < pc._nFrom + len(vTabsInfo):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2565
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2566 self.DrawTab(pc, dc, activeTabPosx, pc.GetSelection(), activeTabWidth, activeTabHeight, pc._nTabXButtonStatus)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2567
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2568 # Update all tabs that can not fit into the screen as non-visible
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2569 for xx in xrange(pc._nFrom + len(vTabsInfo), len(pc._pagesInfoVec)):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2570
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2571 pc._pagesInfoVec[xx].SetPosition(wx.Point(-1, -1))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2572 pc._pagesInfoVec[xx].GetRegion().Clear()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2573
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2574 # Draw the left/right/close buttons
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2575 # Left arrow
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2576 self.DrawLeftArrow(pc, dc)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2577 self.DrawRightArrow(pc, dc)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2578 self.DrawX(pc, dc)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2579 self.DrawDropDownArrow(pc, dc)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2580
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2581
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2582 def DrawTab(self, pageContainer, dc, posx, tabIdx, tabWidth, tabHeight, btnStatus):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2583 """ Draws a tab using VC8 style. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2584
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2585 pc = pageContainer
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2586 borderPen = wx.Pen(pc._pParent.GetBorderColour())
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2587 tabPoints = [wx.Point() for ii in xrange(8)]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2588
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2589 # If we draw the first tab or the active tab,
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2590 # we draw a full tab, else we draw a truncated tab
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2591 #
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2592 # X(2) X(3)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2593 # X(1) X(4)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2594 #
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2595 # X(5)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2596 #
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2597 # X(0),(7) X(6)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2598 #
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2599 #
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2600
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2601 tabPoints[0].x = (pc.HasFlag(FNB_BOTTOM) and [posx] or [posx+self._factor])[0]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2602 tabPoints[0].y = (pc.HasFlag(FNB_BOTTOM) and [2] or [tabHeight - 3])[0]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2603
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2604 tabPoints[1].x = tabPoints[0].x + tabHeight - VERTICAL_BORDER_PADDING - 3 - self._factor
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2605 tabPoints[1].y = (pc.HasFlag(FNB_BOTTOM) and [tabHeight - (VERTICAL_BORDER_PADDING+2)] or [(VERTICAL_BORDER_PADDING+2)])[0]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2606
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2607 tabPoints[2].x = tabPoints[1].x + 4
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2608 tabPoints[2].y = (pc.HasFlag(FNB_BOTTOM) and [tabHeight - VERTICAL_BORDER_PADDING] or [VERTICAL_BORDER_PADDING])[0]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2609
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2610 tabPoints[3].x = tabPoints[2].x + tabWidth - 2
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2611 tabPoints[3].y = (pc.HasFlag(FNB_BOTTOM) and [tabHeight - VERTICAL_BORDER_PADDING] or [VERTICAL_BORDER_PADDING])[0]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2612
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2613 tabPoints[4].x = tabPoints[3].x + 1
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2614 tabPoints[4].y = (pc.HasFlag(FNB_BOTTOM) and [tabPoints[3].y - 1] or [tabPoints[3].y + 1])[0]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2615
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2616 tabPoints[5].x = tabPoints[4].x + 1
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2617 tabPoints[5].y = (pc.HasFlag(FNB_BOTTOM) and [(tabPoints[4].y - 1)] or [tabPoints[4].y + 1])[0]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2618
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2619 tabPoints[6].x = tabPoints[2].x + tabWidth
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2620 tabPoints[6].y = tabPoints[0].y
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2621
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2622 tabPoints[7].x = tabPoints[0].x
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2623 tabPoints[7].y = tabPoints[0].y
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2624
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2625 pc._pagesInfoVec[tabIdx].SetRegion(tabPoints)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2626
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2627 # Draw the polygon
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2628 br = dc.GetBrush()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2629 dc.SetBrush(wx.Brush((tabIdx == pc.GetSelection() and [pc._activeTabColor] or [pc._colorTo])[0]))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2630 dc.SetPen(wx.Pen((tabIdx == pc.GetSelection() and [wx.SystemSettings_GetColour(wx.SYS_COLOUR_BTNSHADOW)] or [pc._colorBorder])[0]))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2631 dc.DrawPolygon(tabPoints)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2632
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2633 # Restore the brush
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2634 dc.SetBrush(br)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2635 rect = pc.GetClientRect()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2636
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2637 if tabIdx != pc.GetSelection() and not pc.HasFlag(FNB_BOTTOM):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2638
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2639 # Top default tabs
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2640 dc.SetPen(wx.Pen(pc._pParent.GetBorderColour()))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2641 lineY = rect.height
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2642 curPen = dc.GetPen()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2643 curPen.SetWidth(1)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2644 dc.SetPen(curPen)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2645 dc.DrawLine(posx, lineY, posx+rect.width, lineY)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2646
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2647 # Incase we are drawing the selected tab, we draw the border of it as well
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2648 # but without the bottom (upper line incase of wxBOTTOM)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2649 if tabIdx == pc.GetSelection():
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2650
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2651 borderPen = wx.Pen(wx.SystemSettings_GetColour(wx.SYS_COLOUR_BTNSHADOW))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2652 dc.SetPen(borderPen)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2653 dc.SetBrush(wx.TRANSPARENT_BRUSH)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2654 dc.DrawPolygon(tabPoints)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2655
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2656 # Delete the bottom line (or the upper one, incase we use wxBOTTOM)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2657 dc.SetPen(wx.WHITE_PEN)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2658 dc.DrawLine(tabPoints[0].x, tabPoints[0].y, tabPoints[6].x, tabPoints[6].y)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2659
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2660 self.FillVC8GradientColour(pc, dc, tabPoints, tabIdx == pc.GetSelection(), tabIdx)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2661
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2662 # Draw a thin line to the right of the non-selected tab
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2663 if tabIdx != pc.GetSelection():
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2664
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2665 dc.SetPen(wx.Pen(wx.SystemSettings_GetColour(wx.SYS_COLOUR_3DFACE)))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2666 dc.DrawLine(tabPoints[4].x-1, tabPoints[4].y, tabPoints[5].x-1, tabPoints[5].y)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2667 dc.DrawLine(tabPoints[5].x-1, tabPoints[5].y, tabPoints[6].x-1, tabPoints[6].y)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2668
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2669 # Text drawing offset from the left border of the
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2670 # rectangle
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2671
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2672 # The width of the images are 16 pixels
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2673 vc8ShapeLen = tabHeight - VERTICAL_BORDER_PADDING - 2
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2674 if pc.TabHasImage(tabIdx):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2675 textOffset = 2*pc._pParent.GetPadding() + 16 + vc8ShapeLen
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2676 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2677 textOffset = pc._pParent.GetPadding() + vc8ShapeLen
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2678
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2679 # Draw the image for the tab if any
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2680 imageYCoord = (pc.HasFlag(FNB_BOTTOM) and [6] or [8])[0]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2681
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2682 if pc.TabHasImage(tabIdx):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2683
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2684 imageXOffset = textOffset - 16 - pc._pParent.GetPadding()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2685 pc._ImageList.Draw(pc._pagesInfoVec[tabIdx].GetImageIndex(), dc,
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2686 posx + imageXOffset, imageYCoord,
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2687 wx.IMAGELIST_DRAW_TRANSPARENT, True)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2688
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2689 boldFont = wx.SystemSettings_GetFont(wx.SYS_DEFAULT_GUI_FONT)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2690
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2691 # if selected tab, draw text in bold
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2692 if tabIdx == pc.GetSelection():
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2693 boldFont.SetWeight(wx.FONTWEIGHT_BOLD)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2694
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2695 dc.SetFont(boldFont)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2696 dc.DrawText(pc.GetPageText(tabIdx), posx + textOffset, imageYCoord)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2697
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2698 # draw 'x' on tab (if enabled)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2699 if pc.HasFlag(FNB_X_ON_TAB) and tabIdx == pc.GetSelection():
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2700
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2701 textWidth, textHeight = dc.GetTextExtent(pc.GetPageText(tabIdx))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2702 tabCloseButtonXCoord = posx + textOffset + textWidth + 1
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2703
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2704 # take a bitmap from the position of the 'x' button (the x on tab button)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2705 # this bitmap will be used later to delete old buttons
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2706 tabCloseButtonYCoord = imageYCoord
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2707 x_rect = wx.Rect(tabCloseButtonXCoord, tabCloseButtonYCoord, 16, 16)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2708 # Draw the tab
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2709 self.DrawTabX(pc, dc, x_rect, tabIdx, btnStatus)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2710
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2711 self.DrawFocusRectangle(dc, pc, pc._pagesInfoVec[tabIdx])
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2712
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2713
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2714 def FillVC8GradientColour(self, pageContainer, dc, tabPoints, bSelectedTab, tabIdx):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2715 """ Fills a tab with a gradient shading. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2716
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2717 # calculate gradient coefficients
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2718 pc = pageContainer
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2719
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2720 if self._first:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2721 self._first = False
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2722 pc._colorTo = LightColour(wx.SystemSettings_GetColour(wx.SYS_COLOUR_3DFACE), 0)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2723 pc._colorFrom = LightColour(wx.SystemSettings_GetColour(wx.SYS_COLOUR_3DFACE), 60)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2724
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2725 col2 = pc._pParent.GetGradientColourTo()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2726 col1 = pc._pParent.GetGradientColourFrom()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2727
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2728 # If colorful tabs style is set, override the tab color
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2729 if pc.HasFlag(FNB_COLORFUL_TABS):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2730
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2731 if not pc._pagesInfoVec[tabIdx].GetColour():
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2732
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2733 # First time, generate color, and keep it in the vector
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2734 tabColor = RandomColour()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2735 pc._pagesInfoVec[tabIdx].SetColour(tabColor)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2736
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2737 if pc.HasFlag(FNB_BOTTOM):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2738
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2739 col2 = LightColour(pc._pagesInfoVec[tabIdx].GetColour(), 50)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2740 col1 = LightColour(pc._pagesInfoVec[tabIdx].GetColour(), 80)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2741
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2742 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2743
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2744 col1 = LightColour(pc._pagesInfoVec[tabIdx].GetColour(), 50)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2745 col2 = LightColour(pc._pagesInfoVec[tabIdx].GetColour(), 80)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2746
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2747 size = abs(tabPoints[2].y - tabPoints[0].y) - 1
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2748
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2749 rf, gf, bf = 0, 0, 0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2750 rstep = float(col2.Red() - col1.Red())/float(size)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2751 gstep = float(col2.Green() - col1.Green())/float(size)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2752 bstep = float(col2.Blue() - col1.Blue())/float(size)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2753
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2754 y = tabPoints[0].y
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2755
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2756 # If we are drawing the selected tab, we need also to draw a line
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2757 # from 0.tabPoints[0].x and tabPoints[6].x . end, we achieve this
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2758 # by drawing the rectangle with transparent brush
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2759 # the line under the selected tab will be deleted by the drwaing loop
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2760 if bSelectedTab:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2761 self.DrawTabsLine(pc, dc)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2762
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2763 while 1:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2764
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2765 if pc.HasFlag(FNB_BOTTOM):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2766
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2767 if y > tabPoints[0].y + size:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2768 break
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2769
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2770 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2771
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2772 if y < tabPoints[0].y - size:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2773 break
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2774
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2775 currCol = wx.Colour(col1.Red() + rf, col1.Green() + gf, col1.Blue() + bf)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2776
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2777 dc.SetPen((bSelectedTab and [wx.Pen(pc._activeTabColor)] or [wx.Pen(currCol)])[0])
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2778 startX = self.GetStartX(tabPoints, y, pc.GetParent().GetWindowStyleFlag())
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2779 endX = self.GetEndX(tabPoints, y, pc.GetParent().GetWindowStyleFlag())
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2780 dc.DrawLine(startX, y, endX, y)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2781
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2782 # Draw the border using the 'edge' point
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2783 dc.SetPen(wx.Pen((bSelectedTab and [wx.SystemSettings_GetColour(wx.SYS_COLOUR_BTNSHADOW)] or [pc._colorBorder])[0]))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2784
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2785 dc.DrawPoint(startX, y)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2786 dc.DrawPoint(endX, y)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2787
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2788 # Progress the color
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2789 rf += rstep
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2790 gf += gstep
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2791 bf += bstep
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2792
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2793 if pc.HasFlag(FNB_BOTTOM):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2794 y = y + 1
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2795 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2796 y = y - 1
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2797
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2798
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2799 def GetStartX(self, tabPoints, y, style):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2800 """ Returns the x start position of a tab. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2801
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2802 x1, x2, y1, y2 = 0.0, 0.0, 0.0, 0.0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2803
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2804 # We check the 3 points to the left
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2805
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2806 bBottomStyle = (style & FNB_BOTTOM and [True] or [False])[0]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2807 match = False
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2808
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2809 if bBottomStyle:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2810
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2811 for i in xrange(3):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2812
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2813 if y >= tabPoints[i].y and y < tabPoints[i+1].y:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2814
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2815 x1 = tabPoints[i].x
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2816 x2 = tabPoints[i+1].x
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2817 y1 = tabPoints[i].y
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2818 y2 = tabPoints[i+1].y
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2819 match = True
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2820 break
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2821
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2822 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2823
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2824 for i in xrange(3):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2825
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2826 if y <= tabPoints[i].y and y > tabPoints[i+1].y:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2827
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2828 x1 = tabPoints[i].x
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2829 x2 = tabPoints[i+1].x
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2830 y1 = tabPoints[i].y
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2831 y2 = tabPoints[i+1].y
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2832 match = True
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2833 break
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2834
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2835 if not match:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2836 return tabPoints[2].x
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2837
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2838 # According to the equation y = ax + b => x = (y-b)/a
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2839 # We know the first 2 points
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2840
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2841 if x2 == x1:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2842 return x2
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2843 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2844 a = (y2 - y1)/(x2 - x1)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2845
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2846 b = y1 - ((y2 - y1)/(x2 - x1))*x1
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2847
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2848 if a == 0:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2849 return int(x1)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2850
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2851 x = (y - b)/a
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2852
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2853 return int(x)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2854
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2855
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2856 def GetEndX(self, tabPoints, y, style):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2857 """ Returns the x end position of a tab. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2858
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2859 x1, x2, y1, y2 = 0.0, 0.0, 0.0, 0.0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2860
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2861 # We check the 3 points to the left
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2862 bBottomStyle = (style & FNB_BOTTOM and [True] or [False])[0]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2863 match = False
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2864
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2865 if bBottomStyle:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2866
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2867 for i in xrange(7, 3, -1):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2868
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2869 if y >= tabPoints[i].y and y < tabPoints[i-1].y:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2870
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2871 x1 = tabPoints[i].x
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2872 x2 = tabPoints[i-1].x
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2873 y1 = tabPoints[i].y
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2874 y2 = tabPoints[i-1].y
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2875 match = True
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2876 break
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2877
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2878 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2879
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2880 for i in xrange(7, 3, -1):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2881
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2882 if y <= tabPoints[i].y and y > tabPoints[i-1].y:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2883
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2884 x1 = tabPoints[i].x
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2885 x2 = tabPoints[i-1].x
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2886 y1 = tabPoints[i].y
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2887 y2 = tabPoints[i-1].y
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2888 match = True
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2889 break
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2890
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2891 if not match:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2892 return tabPoints[3].x
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2893
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2894 # According to the equation y = ax + b => x = (y-b)/a
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2895 # We know the first 2 points
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2896
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2897 # Vertical line
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2898 if x1 == x2:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2899 return int(x1)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2900
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2901 a = (y2 - y1)/(x2 - x1)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2902 b = y1 - ((y2 - y1)/(x2 - x1))*x1
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2903
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2904 if a == 0:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2905 return int(x1)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2906
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2907 x = (y - b)/a
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2908
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2909 return int(x)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2910
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2911
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2912 def NumberTabsCanFit(self, pageContainer, fr=-1):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2913 """ Returns the number of tabs that can fit in the visible area. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2914
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2915 pc = pageContainer
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2916
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2917 rect = pc.GetClientRect()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2918 clientWidth = rect.width
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2919
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2920 # Empty results
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2921 vTabInfo = []
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2922 tabHeight = self.CalcTabHeight(pageContainer)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2923
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2924 # The drawing starts from posx
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2925 posx = pc._pParent.GetPadding()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2926
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2927 if fr < 0:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2928 fr = pc._nFrom
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2929
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2930 for i in xrange(fr, len(pc._pagesInfoVec)):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2931
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2932 vc8glitch = tabHeight + FNB_HEIGHT_SPACER
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2933 tabWidth = self.CalcTabWidth(pageContainer, i, tabHeight)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2934
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2935 if posx + tabWidth + vc8glitch + self.GetButtonsAreaLength(pc) >= clientWidth:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2936 break
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2937
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2938 # Add a result to the returned vector
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2939 tabRect = wx.Rect(posx, VERTICAL_BORDER_PADDING, tabWidth, tabHeight)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2940 vTabInfo.append(tabRect)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2941
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2942 # Advance posx
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2943 posx += tabWidth + FNB_HEIGHT_SPACER
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2944
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2945 return vTabInfo
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2946
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2947
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2948 # ---------------------------------------------------------------------------- #
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2949 # Class FlatNotebook
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2950 # ---------------------------------------------------------------------------- #
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2951
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2952 class FlatNotebook(wx.PyPanel):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2953 """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2954 Display one or more windows in a notebook.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2955
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2956 B{Events}:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2957 - B{EVT_FLATNOTEBOOK_PAGE_CHANGING}: sent when the active
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2958 page in the notebook is changing
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2959 - B{EVT_FLATNOTEBOOK_PAGE_CHANGED}: sent when the active
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2960 page in the notebook has changed
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2961 - B{EVT_FLATNOTEBOOK_PAGE_CLOSING}: sent when a page in the
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2962 notebook is closing
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2963 - B{EVT_FLATNOTEBOOK_PAGE_CLOSED}: sent when a page in the
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2964 notebook has been closed
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2965 - B{EVT_FLATNOTEBOOK_PAGE_CONTEXT_MENU}: sent when the user
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2966 clicks a tab in the notebook with the right mouse
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2967 button
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2968 """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2969
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2970 def __init__(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize,
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2971 style=0, name="FlatNotebook"):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2972 """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2973 Default class constructor.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2974
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2975 All the parameters are as in wxPython class construction, except the
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2976 'style': this can be assigned to whatever combination of FNB_* styles.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2977
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2978 """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2979
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2980 self._bForceSelection = False
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2981 self._nPadding = 6
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2982 self._nFrom = 0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2983 style |= wx.TAB_TRAVERSAL
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2984 self._pages = None
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2985 self._windows = []
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2986 self._popupWin = None
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2987 self._naviIcon = None
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2988
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2989 wx.PyPanel.__init__(self, parent, id, pos, size, style)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2990
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2991 self._pages = PageContainer(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, style)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2992
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2993 self.Bind(wx.EVT_NAVIGATION_KEY, self.OnNavigationKey)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2994
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2995 self.Init()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2996
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2997
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2998 def Init(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2999 """ Initializes all the class attributes. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3000
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3001 self._pages._colorBorder = wx.SystemSettings_GetColour(wx.SYS_COLOUR_BTNSHADOW)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3002
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3003 self._mainSizer = wx.BoxSizer(wx.VERTICAL)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3004 self.SetSizer(self._mainSizer)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3005
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3006 # The child panels will inherit this bg color, so leave it at the default value
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3007 #self.SetBackgroundColour(wx.SystemSettings_GetColour(wx.SYS_COLOUR_APPWORKSPACE))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3008
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3009 # Set default page height
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3010 dc = wx.ClientDC(self)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3011
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3012 if "__WXGTK__" in wx.PlatformInfo:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3013 # For GTK it seems that we must do this steps in order
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3014 # for the tabs will get the proper height on initialization
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3015 # on MSW, preforming these steps yields wierd results
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3016 boldFont = wx.SystemSettings_GetFont(wx.SYS_DEFAULT_GUI_FONT)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3017 boldFont.SetWeight(wx.FONTWEIGHT_BOLD)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3018 dc.SetFont(boldFont)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3019
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3020 height = dc.GetCharHeight()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3021
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3022 tabHeight = height + FNB_HEIGHT_SPACER # We use 8 pixels as padding
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3023
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3024 if "__WXGTK__" in wx.PlatformInfo:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3025 tabHeight += 6
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3026
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3027 self._pages.SetSizeHints(-1, tabHeight)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3028 # Add the tab container to the sizer
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3029 self._mainSizer.Insert(0, self._pages, 0, wx.EXPAND)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3030 self._mainSizer.Layout()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3031
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3032 self._pages._nFrom = self._nFrom
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3033 self._pDropTarget = FNBDropTarget(self)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3034 self.SetDropTarget(self._pDropTarget)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3035
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3036
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3037 def DoGetBestSize(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3038 """ Overrides DoGetBestSize to handle sizers nicely. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3039
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3040 if not self._windows:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3041 # Something is better than nothing... no pages!
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3042 return wx.Size(20, 20)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3043
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3044 maxWidth = maxHeight = 0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3045 tabHeight = self.GetPageBestSize().height
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3046
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3047 for win in self._windows:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3048 # Loop over all the windows to get their best size
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3049 width, height = win.GetBestSize()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3050 maxWidth, maxHeight = max(maxWidth, width), max(maxHeight, height)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3051
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3052 return wx.Size(maxWidth, maxHeight+tabHeight)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3053
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3054
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3055 def SetActiveTabTextColour(self, textColour):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3056 """ Sets the text colour for the active tab. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3057
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3058 self._pages._activeTextColor = textColour
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3059
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3060
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3061 def OnDropTarget(self, x, y, nTabPage, wnd_oldContainer):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3062 """ Handles the drop action from a DND operation. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3063
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3064 return self._pages.OnDropTarget(x, y, nTabPage, wnd_oldContainer)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3065
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3066
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3067 def GetPreviousSelection(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3068 """ Returns the previous selection. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3069
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3070 return self._pages._iPreviousActivePage
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3071
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3072
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3073 def AddPage(self, page, text, select=True, imageId=-1):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3074 """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3075 Add a page to the L{FlatNotebook}.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3076
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3077 @param page: Specifies the new page.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3078 @param text: Specifies the text for the new page.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3079 @param select: Specifies whether the page should be selected.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3080 @param imageId: Specifies the optional image index for the new page.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3081
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3082 Return value:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3083 True if successful, False otherwise.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3084 """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3085
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3086 # sanity check
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3087 if not page:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3088 return False
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3089
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3090 # reparent the window to us
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3091 page.Reparent(self)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3092
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3093 # Add tab
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3094 bSelected = select or len(self._windows) == 0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3095
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3096 if bSelected:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3097
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3098 bSelected = False
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3099
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3100 # Check for selection and send events
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3101 oldSelection = self._pages._iActivePage
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3102 tabIdx = len(self._windows)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3103
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3104 event = FlatNotebookEvent(wxEVT_FLATNOTEBOOK_PAGE_CHANGING, self.GetId())
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3105 event.SetSelection(tabIdx)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3106 event.SetOldSelection(oldSelection)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3107 event.SetEventObject(self)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3108
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3109 if not self.GetEventHandler().ProcessEvent(event) or event.IsAllowed() or len(self._windows) == 0:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3110 bSelected = True
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3111
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3112 curSel = self._pages.GetSelection()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3113
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3114 if not self._pages.IsShown():
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3115 self._pages.Show()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3116
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3117 self._pages.AddPage(text, bSelected, imageId)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3118 self._windows.append(page)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3119
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3120 self.Freeze()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3121
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3122 # Check if a new selection was made
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3123 if bSelected:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3124
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3125 if curSel >= 0:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3126
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3127 # Remove the window from the main sizer
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3128 self._mainSizer.Detach(self._windows[curSel])
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3129 self._windows[curSel].Hide()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3130
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3131 if self.GetWindowStyleFlag() & FNB_BOTTOM:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3132
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3133 self._mainSizer.Insert(0, page, 1, wx.EXPAND)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3134
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3135 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3136
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3137 # We leave a space of 1 pixel around the window
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3138 self._mainSizer.Add(page, 1, wx.EXPAND)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3139
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3140 # Fire a wxEVT_FLATNOTEBOOK_PAGE_CHANGED event
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3141 event.SetEventType(wxEVT_FLATNOTEBOOK_PAGE_CHANGED)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3142 event.SetOldSelection(oldSelection)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3143 self.GetEventHandler().ProcessEvent(event)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3144
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3145 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3146
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3147 # Hide the page
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3148 page.Hide()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3149
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3150 self.Thaw()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3151 self._mainSizer.Layout()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3152 self.Refresh()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3153
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3154 return True
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3155
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3156
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3157 def SetImageList(self, imageList):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3158 """ Sets the image list for the page control. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3159
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3160 self._pages.SetImageList(imageList)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3161
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3162
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3163 def AssignImageList(self, imageList):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3164 """ Assigns the image list for the page control. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3165
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3166 self._pages.AssignImageList(imageList)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3167
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3168
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3169 def GetImageList(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3170 """ Returns the associated image list. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3171
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3172 return self._pages.GetImageList()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3173
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3174
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3175 def InsertPage(self, indx, page, text, select=True, imageId=-1):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3176 """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3177 Inserts a new page at the specified position.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3178
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3179 @param indx: Specifies the position of the new page.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3180 @param page: Specifies the new page.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3181 @param text: Specifies the text for the new page.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3182 @param select: Specifies whether the page should be selected.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3183 @param imageId: Specifies the optional image index for the new page.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3184
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3185 Return value:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3186 True if successful, False otherwise.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3187 """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3188
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3189 # sanity check
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3190 if not page:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3191 return False
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3192
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3193 # reparent the window to us
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3194 page.Reparent(self)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3195
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3196 if not self._windows:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3197
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3198 self.AddPage(page, text, select, imageId)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3199 return True
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3200
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3201 # Insert tab
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3202 bSelected = select or not self._windows
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3203 curSel = self._pages.GetSelection()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3204
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3205 indx = max(0, min(indx, len(self._windows)))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3206
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3207 if indx <= len(self._windows):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3208
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3209 self._windows.insert(indx, page)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3210
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3211 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3212
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3213 self._windows.append(page)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3214
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3215 if bSelected:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3216
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3217 bSelected = False
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3218
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3219 # Check for selection and send events
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3220 oldSelection = self._pages._iActivePage
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3221
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3222 event = FlatNotebookEvent(wxEVT_FLATNOTEBOOK_PAGE_CHANGING, self.GetId())
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3223 event.SetSelection(indx)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3224 event.SetOldSelection(oldSelection)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3225 event.SetEventObject(self)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3226
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3227 if not self.GetEventHandler().ProcessEvent(event) or event.IsAllowed() or len(self._windows) == 0:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3228 bSelected = True
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3229
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3230 self._pages.InsertPage(indx, text, bSelected, imageId)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3231
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3232 if indx <= curSel:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3233 curSel = curSel + 1
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3234
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3235 self.Freeze()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3236
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3237 # Check if a new selection was made
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3238 if bSelected:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3239
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3240 if curSel >= 0:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3241
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3242 # Remove the window from the main sizer
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3243 self._mainSizer.Detach(self._windows[curSel])
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3244 self._windows[curSel].Hide()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3245
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3246 self._pages.SetSelection(indx)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3247
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3248 # Fire a wxEVT_FLATNOTEBOOK_PAGE_CHANGED event
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3249 event.SetEventType(wxEVT_FLATNOTEBOOK_PAGE_CHANGED)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3250 event.SetOldSelection(oldSelection)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3251 self.GetEventHandler().ProcessEvent(event)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3252
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3253 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3254
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3255 # Hide the page
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3256 page.Hide()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3257
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3258 self.Thaw()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3259 self._mainSizer.Layout()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3260 self.Refresh()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3261
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3262 return True
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3263
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3264
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3265 def SetSelection(self, page):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3266 """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3267 Sets the selection for the given page.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3268 The call to this function generates the page changing events
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3269 """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3270
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3271 if page >= len(self._windows) or not self._windows:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3272 return
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3273
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3274 # Support for disabed tabs
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3275 if not self._pages.GetEnabled(page) and len(self._windows) > 1 and not self._bForceSelection:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3276 return
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3277
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3278 curSel = self._pages.GetSelection()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3279
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3280 # program allows the page change
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3281 self.Freeze()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3282 if curSel >= 0:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3283
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3284 # Remove the window from the main sizer
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3285 self._mainSizer.Detach(self._windows[curSel])
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3286 self._windows[curSel].Hide()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3287
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3288 if self.GetWindowStyleFlag() & FNB_BOTTOM:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3289
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3290 self._mainSizer.Insert(0, self._windows[page], 1, wx.EXPAND)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3291
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3292 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3293
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3294 # We leave a space of 1 pixel around the window
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3295 self._mainSizer.Add(self._windows[page], 1, wx.EXPAND)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3296
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3297 self._windows[page].Show()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3298 self.Thaw()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3299
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3300 self._mainSizer.Layout()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3301
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3302 if page != self._pages._iActivePage:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3303 # there is a real page changing
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3304 self._pages._iPreviousActivePage = self._pages._iActivePage
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3305
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3306 self._pages._iActivePage = page
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3307 self._pages.DoSetSelection(page)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3308
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3309
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3310 def DeletePage(self, page):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3311 """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3312 Deletes the specified page, and the associated window.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3313 The call to this function generates the page changing events.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3314 """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3315
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3316 if page >= len(self._windows) or page < 0:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3317 return
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3318
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3319 # Fire a closing event
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3320 event = FlatNotebookEvent(wxEVT_FLATNOTEBOOK_PAGE_CLOSING, self.GetId())
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3321 event.SetSelection(page)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3322 event.SetEventObject(self)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3323 self.GetEventHandler().ProcessEvent(event)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3324
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3325 # The event handler allows it?
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3326 if not event.IsAllowed():
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3327 return
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3328
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3329 self.Freeze()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3330
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3331 # Delete the requested page
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3332 pageRemoved = self._windows[page]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3333
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3334 # If the page is the current window, remove it from the sizer
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3335 # as well
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3336 if page == self._pages.GetSelection():
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3337 self._mainSizer.Detach(pageRemoved)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3338
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3339 # Remove it from the array as well
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3340 self._windows.pop(page)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3341
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3342 # Now we can destroy it in wxWidgets use Destroy instead of delete
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3343 pageRemoved.Destroy()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3344
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3345 self.Thaw()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3346
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3347 self._pages.DoDeletePage(page)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3348 self.Refresh()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3349 self.Update()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3350
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3351 # Fire a closed event
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3352 closedEvent = FlatNotebookEvent(wxEVT_FLATNOTEBOOK_PAGE_CLOSED, self.GetId())
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3353 closedEvent.SetSelection(page)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3354 closedEvent.SetEventObject(self)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3355 self.GetEventHandler().ProcessEvent(closedEvent)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3356
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3357
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3358 def DeleteAllPages(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3359 """ Deletes all the pages. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3360
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3361 if not self._windows:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3362 return False
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3363
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3364 self.Freeze()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3365
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3366 for page in self._windows:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3367 page.Destroy()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3368
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3369 self._windows = []
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3370 self.Thaw()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3371
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3372 # Clear the container of the tabs as well
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3373 self._pages.DeleteAllPages()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3374 return True
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3375
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3376
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3377 def GetCurrentPage(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3378 """ Returns the currently selected notebook page or None. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3379
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3380 sel = self._pages.GetSelection()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3381 if sel < 0:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3382 return None
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3383
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3384 return self._windows[sel]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3385
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3386
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3387 def GetPage(self, page):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3388 """ Returns the window at the given page position, or None. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3389
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3390 if page >= len(self._windows):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3391 return None
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3392
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3393 return self._windows[page]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3394
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3395
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3396 def GetPageIndex(self, win):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3397 """ Returns the index at which the window is found. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3398
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3399 try:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3400 return self._windows.index(win)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3401 except:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3402 return -1
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3403
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3404
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3405 def GetSelection(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3406 """ Returns the currently selected page, or -1 if none was selected. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3407
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3408 return self._pages.GetSelection()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3409
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3410
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3411 def AdvanceSelection(self, forward=True):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3412 """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3413 Cycles through the tabs.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3414 The call to this function generates the page changing events.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3415 """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3416
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3417 self._pages.AdvanceSelection(forward)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3418
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3419
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3420 def GetPageCount(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3421 """ Returns the number of pages in the L{FlatNotebook} control. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3422
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3423 return self._pages.GetPageCount()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3424
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3425 def SetNavigatorIcon(self, bmp):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3426 """ Set the icon used by the L{TabNavigatorWindow} """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3427 if isinstance(bmp, wx.Bitmap) and bmp.IsOk():
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3428 # Make sure image is proper size
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3429 if bmp.GetSize() != (16, 16):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3430 img = bmp.ConvertToImage()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3431 img.Rescale(16, 16, wx.IMAGE_QUALITY_HIGH)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3432 bmp = wx.BitmapFromImage(img)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3433 self._naviIcon = bmp
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3434 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3435 raise TypeError, "SetNavigatorIcon requires a valid bitmap"
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3436
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3437 def OnNavigationKey(self, event):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3438 """ Handles the wx.EVT_NAVIGATION_KEY event for L{FlatNotebook}. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3439
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3440 if event.IsWindowChange():
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3441 if len(self._windows) == 0:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3442 return
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3443 # change pages
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3444 if self.HasFlag(FNB_SMART_TABS):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3445 if not self._popupWin:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3446 self._popupWin = TabNavigatorWindow(self, self._naviIcon)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3447 self._popupWin.SetReturnCode(wx.ID_OK)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3448 self._popupWin.ShowModal()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3449 self._popupWin.Destroy()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3450 self._popupWin = None
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3451 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3452 # a dialog is already opened
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3453 self._popupWin.OnNavigationKey(event)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3454 return
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3455 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3456 # change pages
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3457 self.AdvanceSelection(event.GetDirection())
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3458
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3459 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3460 event.Skip()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3461
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3462
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3463 def GetPageShapeAngle(self, page_index):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3464 """ Returns the angle associated to a tab. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3465
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3466 if page_index < 0 or page_index >= len(self._pages._pagesInfoVec):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3467 return None, False
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3468
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3469 result = self._pages._pagesInfoVec[page_index].GetTabAngle()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3470 return result, True
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3471
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3472
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3473 def SetPageShapeAngle(self, page_index, angle):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3474 """ Sets the angle associated to a tab. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3475
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3476 if page_index < 0 or page_index >= len(self._pages._pagesInfoVec):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3477 return
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3478
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3479 if angle > 15:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3480 return
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3481
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3482 self._pages._pagesInfoVec[page_index].SetTabAngle(angle)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3483
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3484
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3485 def SetAllPagesShapeAngle(self, angle):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3486 """ Sets the angle associated to all the tab. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3487
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3488 if angle > 15:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3489 return
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3490
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3491 for ii in xrange(len(self._pages._pagesInfoVec)):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3492 self._pages._pagesInfoVec[ii].SetTabAngle(angle)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3493
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3494 self.Refresh()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3495
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3496
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3497 def GetPageBestSize(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3498 """ Return the page best size. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3499
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3500 return self._pages.GetClientSize()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3501
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3502
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3503 def SetPageText(self, page, text):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3504 """ Sets the text for the given page. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3505
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3506 bVal = self._pages.SetPageText(page, text)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3507 self._pages.Refresh()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3508
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3509 return bVal
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3510
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3511
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3512 def SetPadding(self, padding):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3513 """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3514 Sets the amount of space around each page's icon and label, in pixels.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3515 NB: only the horizontal padding is considered.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3516 """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3517
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3518 self._nPadding = padding.GetWidth()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3519
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3520
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3521 def GetTabArea(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3522 """ Returns the associated page. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3523
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3524 return self._pages
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3525
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3526
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3527 def GetPadding(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3528 """ Returns the amount of space around each page's icon and label, in pixels. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3529
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3530 return self._nPadding
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3531
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3532
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3533 def SetWindowStyleFlag(self, style):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3534 """ Sets the L{FlatNotebook} window style flags. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3535
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3536 wx.PyPanel.SetWindowStyleFlag(self, style)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3537 renderer = self._pages._mgr.GetRenderer(self.GetWindowStyleFlag())
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3538 renderer._tabHeight = None
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3539
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3540 if self._pages:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3541
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3542 # For changing the tab position (i.e. placing them top/bottom)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3543 # refreshing the tab container is not enough
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3544 self.SetSelection(self._pages._iActivePage)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3545
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3546 if not self._pages.HasFlag(FNB_HIDE_ON_SINGLE_TAB):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3547 #For Redrawing the Tabs once you remove the Hide tyle
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3548 self._pages._ReShow()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3549
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3550
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3551 def RemovePage(self, page):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3552 """ Deletes the specified page, without deleting the associated window. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3553
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3554 if page >= len(self._windows):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3555 return False
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3556
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3557 # Fire a closing event
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3558 event = FlatNotebookEvent(wxEVT_FLATNOTEBOOK_PAGE_CLOSING, self.GetId())
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3559 event.SetSelection(page)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3560 event.SetEventObject(self)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3561 self.GetEventHandler().ProcessEvent(event)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3562
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3563 # The event handler allows it?
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3564 if not event.IsAllowed():
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3565 return False
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3566
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3567 self.Freeze()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3568
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3569 # Remove the requested page
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3570 pageRemoved = self._windows[page]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3571
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3572 # If the page is the current window, remove it from the sizer
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3573 # as well
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3574 if page == self._pages.GetSelection():
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3575 self._mainSizer.Detach(pageRemoved)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3576
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3577 # Remove it from the array as well
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3578 self._windows.pop(page)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3579 self.Thaw()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3580
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3581 self._pages.DoDeletePage(page)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3582
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3583 return True
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3584
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3585
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3586 def SetRightClickMenu(self, menu):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3587 """ Sets the popup menu associated to a right click on a tab. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3588
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3589 self._pages._pRightClickMenu = menu
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3590
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3591
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3592 def GetPageText(self, nPage):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3593 """ Returns the tab caption. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3594
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3595 return self._pages.GetPageText(nPage)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3596
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3597
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3598 def SetGradientColours(self, fr, to, border):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3599 """ Sets the gradient colours for the tab. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3600
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3601 self._pages._colorFrom = fr
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3602 self._pages._colorTo = to
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3603 self._pages._colorBorder = border
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3604
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3605
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3606 def SetGradientColourFrom(self, fr):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3607 """ Sets the starting colour for the gradient. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3608
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3609 self._pages._colorFrom = fr
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3610
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3611
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3612 def SetGradientColourTo(self, to):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3613 """ Sets the ending colour for the gradient. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3614
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3615 self._pages._colorTo = to
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3616
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3617
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3618 def SetGradientColourBorder(self, border):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3619 """ Sets the tab border colour. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3620
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3621 self._pages._colorBorder = border
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3622
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3623
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3624 def GetGradientColourFrom(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3625 """ Gets first gradient colour. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3626
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3627 return self._pages._colorFrom
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3628
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3629
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3630 def GetGradientColourTo(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3631 """ Gets second gradient colour. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3632
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3633 return self._pages._colorTo
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3634
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3635
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3636 def GetGradientColourBorder(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3637 """ Gets the tab border colour. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3638
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3639 return self._pages._colorBorder
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3640
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3641
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3642 def GetBorderColour(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3643 """ Returns the border colour. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3644
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3645 return self._pages._colorBorder
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3646
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3647
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3648 def GetActiveTabTextColour(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3649 """ Get the active tab text colour. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3650
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3651 return self._pages._activeTextColor
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3652
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3653
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3654 def SetPageImage(self, page, image):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3655 """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3656 Sets the image index for the given page. Image is an index into the
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3657 image list which was set with SetImageList.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3658 """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3659
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3660 self._pages.SetPageImage(page, image)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3661
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3662
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3663 def GetPageImage(self, nPage):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3664 """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3665 Returns the image index for the given page. Image is an index into the
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3666 image list which was set with SetImageList.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3667 """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3668
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3669 return self._pages.GetPageImage(nPage)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3670
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3671
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3672 def GetEnabled(self, page):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3673 """ Returns whether a tab is enabled or not. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3674
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3675 return self._pages.GetEnabled(page)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3676
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3677
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3678 def EnableTab(self, page, enabled=True):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3679 """ Enables or disables a tab. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3680
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3681 if page >= len(self._windows):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3682 return
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3683
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3684 self._windows[page].Enable(enabled)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3685 self._pages.EnableTab(page, enabled)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3686
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3687
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3688 def GetNonActiveTabTextColour(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3689 """ Returns the non active tabs text colour. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3690
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3691 return self._pages._nonActiveTextColor
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3692
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3693
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3694 def SetNonActiveTabTextColour(self, color):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3695 """ Sets the non active tabs text colour. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3696
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3697 self._pages._nonActiveTextColor = color
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3698
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3699
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3700 def SetTabAreaColour(self, color):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3701 """ Sets the area behind the tabs colour. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3702
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3703 self._pages._tabAreaColor = color
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3704
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3705
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3706 def GetTabAreaColour(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3707 """ Returns the area behind the tabs colour. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3708
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3709 return self._pages._tabAreaColor
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3710
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3711
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3712 def SetActiveTabColour(self, color):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3713 """ Sets the active tab colour. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3714
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3715 self._pages._activeTabColor = color
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3716
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3717
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3718 def GetActiveTabColour(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3719 """ Returns the active tab colour. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3720
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3721 return self._pages._activeTabColor
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3722
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3723
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3724 # ---------------------------------------------------------------------------- #
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3725 # Class PageContainer
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3726 # Acts as a container for the pages you add to FlatNotebook
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3727 # ---------------------------------------------------------------------------- #
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3728
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3729 class PageContainer(wx.Panel):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3730 """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3731 This class acts as a container for the pages you add to L{FlatNotebook}.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3732 """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3733
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3734 def __init__(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition,
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3735 size=wx.DefaultSize, style=0):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3736 """ Default class constructor. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3737
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3738 self._ImageList = None
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3739 self._iActivePage = -1
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3740 self._pDropTarget = None
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3741 self._nLeftClickZone = FNB_NOWHERE
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3742 self._iPreviousActivePage = -1
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3743
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3744 self._pRightClickMenu = None
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3745 self._nXButtonStatus = FNB_BTN_NONE
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3746 self._nArrowDownButtonStatus = FNB_BTN_NONE
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3747 self._pParent = parent
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3748 self._nRightButtonStatus = FNB_BTN_NONE
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3749 self._nLeftButtonStatus = FNB_BTN_NONE
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3750 self._nTabXButtonStatus = FNB_BTN_NONE
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3751
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3752 self._pagesInfoVec = []
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3753
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3754 self._colorTo = wx.SystemSettings_GetColour(wx.SYS_COLOUR_ACTIVECAPTION)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3755 self._colorFrom = wx.WHITE
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3756 self._activeTabColor = wx.WHITE
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3757 self._activeTextColor = wx.SystemSettings_GetColour(wx.SYS_COLOUR_BTNTEXT)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3758 self._nonActiveTextColor = wx.SystemSettings_GetColour(wx.SYS_COLOUR_BTNTEXT)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3759 self._tabAreaColor = wx.SystemSettings_GetColour(wx.SYS_COLOUR_BTNFACE)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3760
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3761 self._nFrom = 0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3762 self._isdragging = False
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3763
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3764 # Set default page height, this is done according to the system font
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3765 memDc = wx.MemoryDC()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3766 memDc.SelectObject(wx.EmptyBitmap(1,1))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3767
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3768 if "__WXGTK__" in wx.PlatformInfo:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3769 boldFont = wx.SystemSettings_GetFont(wx.SYS_DEFAULT_GUI_FONT)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3770 boldFont.SetWeight(wx.BOLD)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3771 memDc.SetFont(boldFont)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3772
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3773 height = memDc.GetCharHeight()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3774 tabHeight = height + FNB_HEIGHT_SPACER # We use 10 pixels as padding
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3775
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3776 wx.Panel.__init__(self, parent, id, pos, wx.Size(size.x, tabHeight),
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3777 style|wx.NO_BORDER|wx.NO_FULL_REPAINT_ON_RESIZE|wx.WANTS_CHARS)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3778
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3779 self._pDropTarget = FNBDropTarget(self)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3780 self.SetDropTarget(self._pDropTarget)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3781 self._mgr = FNBRendererMgr()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3782
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3783 self.Bind(wx.EVT_PAINT, self.OnPaint)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3784 self.Bind(wx.EVT_SIZE, self.OnSize)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3785 self.Bind(wx.EVT_LEFT_DOWN, self.OnLeftDown)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3786 self.Bind(wx.EVT_LEFT_UP, self.OnLeftUp)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3787 self.Bind(wx.EVT_RIGHT_DOWN, self.OnRightDown)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3788 self.Bind(wx.EVT_MIDDLE_DOWN, self.OnMiddleDown)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3789 self.Bind(wx.EVT_MOTION, self.OnMouseMove)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3790 self.Bind(wx.EVT_ERASE_BACKGROUND, self.OnEraseBackground)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3791 self.Bind(wx.EVT_LEAVE_WINDOW, self.OnMouseLeave)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3792 self.Bind(wx.EVT_ENTER_WINDOW, self.OnMouseEnterWindow)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3793 self.Bind(wx.EVT_LEFT_DCLICK, self.OnLeftDClick)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3794 self.Bind(wx.EVT_SET_FOCUS, self.OnSetFocus)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3795 self.Bind(wx.EVT_KILL_FOCUS, self.OnKillFocus)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3796 self.Bind(wx.EVT_KEY_DOWN, self.OnKeyDown)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3797
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3798
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3799 def OnEraseBackground(self, event):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3800 """ Handles the wx.EVT_ERASE_BACKGROUND event for L{PageContainer} (does nothing)."""
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3801
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3802 pass
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3803
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3804
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3805 def _ReShow(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3806 """ Handles the Redraw of the tabs when the FNB_HIDE_ON_SINGLE_TAB has been removed """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3807 self.Show()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3808 self.GetParent()._mainSizer.Layout()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3809 self.Refresh()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3810
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3811
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3812 def OnPaint(self, event):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3813 """ Handles the wx.EVT_PAINT event for L{PageContainer}."""
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3814
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3815 dc = wx.BufferedPaintDC(self)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3816 renderer = self._mgr.GetRenderer(self.GetParent().GetWindowStyleFlag())
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3817 renderer.DrawTabs(self, dc)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3818
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3819 if self.HasFlag(FNB_HIDE_ON_SINGLE_TAB) and len(self._pagesInfoVec) <= 1:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3820 self.Hide()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3821 self.GetParent()._mainSizer.Layout()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3822 self.Refresh()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3823
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3824
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3825 def AddPage(self, caption, selected=True, imgindex=-1):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3826 """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3827 Add a page to the L{FlatNotebook}.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3828
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3829 @param window: Specifies the new page.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3830 @param caption: Specifies the text for the new page.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3831 @param selected: Specifies whether the page should be selected.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3832 @param imgindex: Specifies the optional image index for the new page.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3833
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3834 Return value:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3835 True if successful, False otherwise.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3836 """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3837
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3838 if selected:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3839
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3840 self._iPreviousActivePage = self._iActivePage
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3841 self._iActivePage = len(self._pagesInfoVec)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3842
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3843 # Create page info and add it to the vector
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3844 pageInfo = PageInfo(caption, imgindex)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3845 self._pagesInfoVec.append(pageInfo)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3846 self.Refresh()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3847
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3848
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3849 def InsertPage(self, indx, text, selected=True, imgindex=-1):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3850 """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3851 Inserts a new page at the specified position.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3852
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3853 @param indx: Specifies the position of the new page.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3854 @param page: Specifies the new page.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3855 @param text: Specifies the text for the new page.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3856 @param select: Specifies whether the page should be selected.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3857 @param imgindex: Specifies the optional image index for the new page.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3858
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3859 Return value:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3860 True if successful, False otherwise.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3861 """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3862
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3863 if selected:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3864
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3865 self._iPreviousActivePage = self._iActivePage
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3866 self._iActivePage = len(self._pagesInfoVec)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3867
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3868 self._pagesInfoVec.insert(indx, PageInfo(text, imgindex))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3869
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3870 self.Refresh()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3871 return True
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3872
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3873
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3874 def OnSize(self, event):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3875 """ Handles the wx.EVT_SIZE events for L{PageContainer}. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3876
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3877 # When resizing the control, try to fit to screen as many tabs as we can
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3878 style = self.GetParent().GetWindowStyleFlag()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3879 renderer = self._mgr.GetRenderer(style)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3880
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3881 fr = 0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3882 page = self.GetSelection()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3883
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3884 for fr in xrange(self._nFrom):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3885 vTabInfo = renderer.NumberTabsCanFit(self, fr)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3886 if page - fr >= len(vTabInfo):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3887 continue
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3888 break
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3889
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3890 self._nFrom = fr
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3891
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3892 self.Refresh() # Call on paint
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3893 event.Skip()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3894
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3895
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3896 def OnMiddleDown(self, event):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3897 """ Handles the wx.EVT_MIDDLE_DOWN events for L{PageContainer}. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3898
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3899 # Test if this style is enabled
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3900 style = self.GetParent().GetWindowStyleFlag()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3901
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3902 if not style & FNB_MOUSE_MIDDLE_CLOSES_TABS:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3903 return
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3904
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3905 where, tabIdx = self.HitTest(event.GetPosition())
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3906
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3907 if where == FNB_TAB:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3908 self.DeletePage(tabIdx)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3909
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3910 event.Skip()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3911
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3912
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3913 def OnRightDown(self, event):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3914 """ Handles the wx.EVT_RIGHT_DOWN events for L{PageContainer}. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3915
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3916 where, tabIdx = self.HitTest(event.GetPosition())
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3917
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3918 if where in [FNB_TAB, FNB_TAB_X]:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3919
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3920 if self._pagesInfoVec[tabIdx].GetEnabled():
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3921 # Fire events and eventually (if allowed) change selection
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3922 self.FireEvent(tabIdx)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3923
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3924 # send a message to popup a custom menu
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3925 event = FlatNotebookEvent(wxEVT_FLATNOTEBOOK_PAGE_CONTEXT_MENU, self.GetParent().GetId())
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3926 event.SetSelection(tabIdx)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3927 event.SetOldSelection(self._iActivePage)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3928 event.SetEventObject(self.GetParent())
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3929 self.GetParent().GetEventHandler().ProcessEvent(event)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3930
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3931 if self._pRightClickMenu:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3932 self.PopupMenu(self._pRightClickMenu)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3933
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3934 event.Skip()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3935
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3936
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3937 def OnLeftDown(self, event):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3938 """ Handles the wx.EVT_LEFT_DOWN events for L{PageContainer}. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3939
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3940 # Reset buttons status
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3941 self._nXButtonStatus = FNB_BTN_NONE
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3942 self._nLeftButtonStatus = FNB_BTN_NONE
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3943 self._nRightButtonStatus = FNB_BTN_NONE
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3944 self._nTabXButtonStatus = FNB_BTN_NONE
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3945 self._nArrowDownButtonStatus = FNB_BTN_NONE
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3946
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3947 self._nLeftClickZone, tabIdx = self.HitTest(event.GetPosition())
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3948
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3949 if self._nLeftClickZone == FNB_DROP_DOWN_ARROW:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3950 self._nArrowDownButtonStatus = FNB_BTN_PRESSED
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3951 self.Refresh()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3952 elif self._nLeftClickZone == FNB_LEFT_ARROW:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3953 self._nLeftButtonStatus = FNB_BTN_PRESSED
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3954 self.Refresh()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3955 elif self._nLeftClickZone == FNB_RIGHT_ARROW:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3956 self._nRightButtonStatus = FNB_BTN_PRESSED
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3957 self.Refresh()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3958 elif self._nLeftClickZone == FNB_X:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3959 self._nXButtonStatus = FNB_BTN_PRESSED
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3960 self.Refresh()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3961 elif self._nLeftClickZone == FNB_TAB_X:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3962 self._nTabXButtonStatus = FNB_BTN_PRESSED
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3963 self.Refresh()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3964
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3965 elif self._nLeftClickZone == FNB_TAB:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3966
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3967 if self._iActivePage != tabIdx:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3968
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3969 # In case the tab is disabled, we dont allow to choose it
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3970 if self._pagesInfoVec[tabIdx].GetEnabled():
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3971 self.FireEvent(tabIdx)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3972
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3973
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3974 def RotateLeft(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3975
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3976 if self._nFrom == 0:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3977 return
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3978
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3979 # Make sure that the button was pressed before
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3980 if self._nLeftButtonStatus != FNB_BTN_PRESSED:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3981 return
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3982
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3983 self._nLeftButtonStatus = FNB_BTN_HOVER
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3984
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3985 # We scroll left with bulks of 5
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3986 scrollLeft = self.GetNumTabsCanScrollLeft()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3987
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3988 self._nFrom -= scrollLeft
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3989 if self._nFrom < 0:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3990 self._nFrom = 0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3991
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3992 self.Refresh()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3993
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3994
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3995 def RotateRight(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3996
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3997 if self._nFrom >= len(self._pagesInfoVec) - 1:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3998 return
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3999
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4000 # Make sure that the button was pressed before
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4001 if self._nRightButtonStatus != FNB_BTN_PRESSED:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4002 return
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4003
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4004 self._nRightButtonStatus = FNB_BTN_HOVER
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4005
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4006 # Check if the right most tab is visible, if it is
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4007 # don't rotate right anymore
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4008 if self._pagesInfoVec[len(self._pagesInfoVec)-1].GetPosition() != wx.Point(-1, -1):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4009 return
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4010
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4011 self._nFrom += 1
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4012 self.Refresh()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4013
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4014
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4015 def OnLeftUp(self, event):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4016 """ Handles the wx.EVT_LEFT_UP events for L{PageContainer}. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4017
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4018 # forget the zone that was initially clicked
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4019 self._nLeftClickZone = FNB_NOWHERE
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4020
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4021 where, tabIdx = self.HitTest(event.GetPosition())
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4022
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4023 # Make sure selected tab has focus
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4024 self.SetFocus()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4025
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4026 if where == FNB_LEFT_ARROW:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4027 self.RotateLeft()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4028
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4029 elif where == FNB_RIGHT_ARROW:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4030 self.RotateRight()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4031
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4032 elif where == FNB_X:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4033
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4034 # Make sure that the button was pressed before
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4035 if self._nXButtonStatus != FNB_BTN_PRESSED:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4036 return
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4037
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4038 self._nXButtonStatus = FNB_BTN_HOVER
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4039
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4040 self.DeletePage(self._iActivePage)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4041
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4042 elif where == FNB_TAB_X:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4043
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4044 # Make sure that the button was pressed before
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4045 if self._nTabXButtonStatus != FNB_BTN_PRESSED:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4046 return
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4047
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4048 self._nTabXButtonStatus = FNB_BTN_HOVER
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4049
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4050 self.DeletePage(self._iActivePage)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4051
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4052 elif where == FNB_DROP_DOWN_ARROW:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4053
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4054 # Make sure that the button was pressed before
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4055 if self._nArrowDownButtonStatus != FNB_BTN_PRESSED:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4056 return
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4057
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4058 self._nArrowDownButtonStatus = FNB_BTN_NONE
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4059
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4060 # Refresh the button status
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4061 renderer = self._mgr.GetRenderer(self.GetParent().GetWindowStyleFlag())
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4062 dc = wx.ClientDC(self)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4063 renderer.DrawDropDownArrow(self, dc)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4064
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4065 self.PopupTabsMenu()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4066
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4067 event.Skip()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4068
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4069
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4070 def HitTest(self, pt):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4071 """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4072 HitTest method for L{PageContainer}.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4073 Returns the flag (if any) and the hit page (if any).
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4074 """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4075
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4076 style = self.GetParent().GetWindowStyleFlag()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4077 render = self._mgr.GetRenderer(style)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4078
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4079 fullrect = self.GetClientRect()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4080 btnLeftPos = render.GetLeftButtonPos(self)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4081 btnRightPos = render.GetRightButtonPos(self)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4082 btnXPos = render.GetXPos(self)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4083
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4084 tabIdx = -1
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4085
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4086 if len(self._pagesInfoVec) == 0:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4087 return FNB_NOWHERE, tabIdx
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4088
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4089 rect = wx.Rect(btnXPos, 8, 16, 16)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4090 if rect.Contains(pt):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4091 return (style & FNB_NO_X_BUTTON and [FNB_NOWHERE] or [FNB_X])[0], tabIdx
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4092
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4093 rect = wx.Rect(btnRightPos, 8, 16, 16)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4094 if style & FNB_DROPDOWN_TABS_LIST:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4095 rect = wx.Rect(render.GetDropArrowButtonPos(self), 8, 16, 16)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4096 if rect.Contains(pt):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4097 return FNB_DROP_DOWN_ARROW, tabIdx
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4098
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4099 if rect.Contains(pt):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4100 return (style & FNB_NO_NAV_BUTTONS and [FNB_NOWHERE] or [FNB_RIGHT_ARROW])[0], tabIdx
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4101
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4102 rect = wx.Rect(btnLeftPos, 8, 16, 16)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4103 if rect.Contains(pt):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4104 return (style & FNB_NO_NAV_BUTTONS and [FNB_NOWHERE] or [FNB_LEFT_ARROW])[0], tabIdx
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4105
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4106 # Test whether a left click was made on a tab
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4107 bFoundMatch = False
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4108
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4109 for cur in xrange(self._nFrom, len(self._pagesInfoVec)):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4110
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4111 pgInfo = self._pagesInfoVec[cur]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4112
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4113 if pgInfo.GetPosition() == wx.Point(-1, -1):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4114 continue
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4115
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4116 if style & FNB_X_ON_TAB and cur == self.GetSelection():
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4117 # 'x' button exists on a tab
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4118 if self._pagesInfoVec[cur].GetXRect().Contains(pt):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4119 return FNB_TAB_X, cur
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4120
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4121 if style & FNB_VC8:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4122
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4123 if self._pagesInfoVec[cur].GetRegion().Contains(pt.x, pt.y):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4124 if bFoundMatch or cur == self.GetSelection():
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4125 return FNB_TAB, cur
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4126
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4127 tabIdx = cur
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4128 bFoundMatch = True
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4129
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4130 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4131
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4132 tabRect = wx.Rect(pgInfo.GetPosition().x, pgInfo.GetPosition().y,
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4133 pgInfo.GetSize().x, pgInfo.GetSize().y)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4134
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4135 if tabRect.Contains(pt):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4136 # We have a match
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4137 return FNB_TAB, cur
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4138
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4139 if bFoundMatch:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4140 return FNB_TAB, tabIdx
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4141
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4142 if self._isdragging:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4143 # We are doing DND, so check also the region outside the tabs
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4144 # try before the first tab
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4145 pgInfo = self._pagesInfoVec[0]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4146 tabRect = wx.Rect(0, pgInfo.GetPosition().y, pgInfo.GetPosition().x, self.GetParent().GetSize().y)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4147 if tabRect.Contains(pt):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4148 return FNB_TAB, 0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4149
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4150 # try after the last tab
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4151 pgInfo = self._pagesInfoVec[-1]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4152 startpos = pgInfo.GetPosition().x+pgInfo.GetSize().x
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4153 tabRect = wx.Rect(startpos, pgInfo.GetPosition().y, fullrect.width-startpos, self.GetParent().GetSize().y)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4154
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4155 if tabRect.Contains(pt):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4156 return FNB_TAB, len(self._pagesInfoVec)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4157
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4158 # Default
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4159 return FNB_NOWHERE, -1
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4160
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4161
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4162 def SetSelection(self, page):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4163 """ Sets the selected page. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4164
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4165 book = self.GetParent()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4166 book.SetSelection(page)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4167 self.DoSetSelection(page)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4168
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4169
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4170 def DoSetSelection(self, page):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4171 """ Does the actual selection of a page. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4172
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4173 if page < len(self._pagesInfoVec):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4174 #! fix for tabfocus
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4175 da_page = self._pParent.GetPage(page)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4176
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4177 if da_page != None:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4178 da_page.SetFocus()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4179
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4180 if not self.IsTabVisible(page):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4181 # Try to remove one tab from start and try again
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4182
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4183 if not self.CanFitToScreen(page):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4184
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4185 if self._nFrom > page:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4186 self._nFrom = page
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4187 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4188 while self._nFrom < page:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4189 self._nFrom += 1
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4190 if self.CanFitToScreen(page):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4191 break
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4192
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4193 self.Refresh()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4194
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4195
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4196 def DeletePage(self, page):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4197 """ Delete the specified page from L{FlatNotebook}. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4198
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4199 book = self.GetParent()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4200 book.DeletePage(page)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4201 book.Refresh()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4202
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4203
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4204 def IsTabVisible(self, page):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4205 """ Returns whether a tab is visible or not. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4206
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4207 iLastVisiblePage = self.GetLastVisibleTab()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4208 return page <= iLastVisiblePage and page >= self._nFrom
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4209
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4210
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4211 def DoDeletePage(self, page):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4212 """ Does the actual page deletion. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4213
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4214 # Remove the page from the vector
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4215 book = self.GetParent()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4216 self._pagesInfoVec.pop(page)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4217
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4218 # Thanks to Yiaanis AKA Mandrav
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4219 if self._iActivePage >= page:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4220 self._iActivePage = self._iActivePage - 1
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4221 self._iPreviousActivePage = -1
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4222
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4223 # The delete page was the last first on the array,
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4224 # but the book still has more pages, so we set the
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4225 # active page to be the first one (0)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4226 if self._iActivePage < 0 and len(self._pagesInfoVec) > 0:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4227 self._iActivePage = 0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4228 self._iPreviousActivePage = -1
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4229
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4230 # Refresh the tabs
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4231 if self._iActivePage >= 0:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4232
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4233 book._bForceSelection = True
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4234
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4235 # Check for selection and send event
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4236 event = FlatNotebookEvent(wxEVT_FLATNOTEBOOK_PAGE_CHANGING, self.GetParent().GetId())
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4237 event.SetSelection(self._iActivePage)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4238 event.SetOldSelection(self._iPreviousActivePage)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4239 event.SetEventObject(self.GetParent())
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4240
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4241 book.SetSelection(self._iActivePage)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4242 book._bForceSelection = False
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4243
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4244 # Fire a wxEVT_FLATNOTEBOOK_PAGE_CHANGED event
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4245 event.SetEventType(wxEVT_FLATNOTEBOOK_PAGE_CHANGED)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4246 event.SetOldSelection(self._iPreviousActivePage)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4247 self.GetParent().GetEventHandler().ProcessEvent(event)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4248
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4249 if not self._pagesInfoVec:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4250 # Erase the page container drawings
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4251 dc = wx.ClientDC(self)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4252 dc.Clear()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4253
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4254
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4255 def DeleteAllPages(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4256 """ Deletes all the pages. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4257
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4258 self._iActivePage = -1
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4259 self._iPreviousActivePage = -1
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4260 self._nFrom = 0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4261 self._pagesInfoVec = []
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4262
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4263 # Erase the page container drawings
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4264 dc = wx.ClientDC(self)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4265 dc.Clear()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4266
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4267
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4268 def OnMouseMove(self, event):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4269 """ Handles the wx.EVT_MOTION for L{PageContainer}. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4270
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4271 if self._pagesInfoVec and self.IsShown():
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4272
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4273 xButtonStatus = self._nXButtonStatus
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4274 xTabButtonStatus = self._nTabXButtonStatus
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4275 rightButtonStatus = self._nRightButtonStatus
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4276 leftButtonStatus = self._nLeftButtonStatus
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4277 dropDownButtonStatus = self._nArrowDownButtonStatus
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4278
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4279 style = self.GetParent().GetWindowStyleFlag()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4280
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4281 self._nXButtonStatus = FNB_BTN_NONE
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4282 self._nRightButtonStatus = FNB_BTN_NONE
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4283 self._nLeftButtonStatus = FNB_BTN_NONE
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4284 self._nTabXButtonStatus = FNB_BTN_NONE
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4285 self._nArrowDownButtonStatus = FNB_BTN_NONE
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4286
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4287 where, tabIdx = self.HitTest(event.GetPosition())
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4288
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4289 if where == FNB_X:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4290 if event.LeftIsDown():
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4291
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4292 self._nXButtonStatus = (self._nLeftClickZone==FNB_X and [FNB_BTN_PRESSED] or [FNB_BTN_NONE])[0]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4293
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4294 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4295
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4296 self._nXButtonStatus = FNB_BTN_HOVER
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4297
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4298 elif where == FNB_DROP_DOWN_ARROW:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4299 if event.LeftIsDown():
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4300
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4301 self._nArrowDownButtonStatus = (self._nLeftClickZone==FNB_DROP_DOWN_ARROW and [FNB_BTN_PRESSED] or [FNB_BTN_NONE])[0]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4302
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4303 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4304
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4305 self._nArrowDownButtonStatus = FNB_BTN_HOVER
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4306
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4307 elif where == FNB_TAB_X:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4308 if event.LeftIsDown():
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4309
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4310 self._nTabXButtonStatus = (self._nLeftClickZone==FNB_TAB_X and [FNB_BTN_PRESSED] or [FNB_BTN_NONE])[0]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4311
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4312 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4313
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4314 self._nTabXButtonStatus = FNB_BTN_HOVER
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4315
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4316 elif where == FNB_RIGHT_ARROW:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4317 if event.LeftIsDown():
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4318
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4319 self._nRightButtonStatus = (self._nLeftClickZone==FNB_RIGHT_ARROW and [FNB_BTN_PRESSED] or [FNB_BTN_NONE])[0]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4320
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4321 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4322
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4323 self._nRightButtonStatus = FNB_BTN_HOVER
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4324
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4325 elif where == FNB_LEFT_ARROW:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4326 if event.LeftIsDown():
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4327
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4328 self._nLeftButtonStatus = (self._nLeftClickZone==FNB_LEFT_ARROW and [FNB_BTN_PRESSED] or [FNB_BTN_NONE])[0]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4329
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4330 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4331
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4332 self._nLeftButtonStatus = FNB_BTN_HOVER
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4333
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4334 elif where == FNB_TAB:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4335 # Call virtual method for showing tooltip
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4336 self.ShowTabTooltip(tabIdx)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4337
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4338 if not self.GetEnabled(tabIdx):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4339 # Set the cursor to be 'No-entry'
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4340 wx.SetCursor(wx.StockCursor(wx.CURSOR_NO_ENTRY))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4341
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4342 # Support for drag and drop
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4343 if event.Dragging() and not (style & FNB_NODRAG):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4344
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4345 self._isdragging = True
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4346 draginfo = FNBDragInfo(self, tabIdx)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4347 drginfo = cPickle.dumps(draginfo)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4348 dataobject = wx.CustomDataObject(wx.CustomDataFormat("FlatNotebook"))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4349 dataobject.SetData(drginfo)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4350 dragSource = FNBDropSource(self)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4351 dragSource.SetData(dataobject)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4352 dragSource.DoDragDrop(wx.Drag_DefaultMove)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4353
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4354 bRedrawX = self._nXButtonStatus != xButtonStatus
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4355 bRedrawRight = self._nRightButtonStatus != rightButtonStatus
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4356 bRedrawLeft = self._nLeftButtonStatus != leftButtonStatus
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4357 bRedrawTabX = self._nTabXButtonStatus != xTabButtonStatus
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4358 bRedrawDropArrow = self._nArrowDownButtonStatus != dropDownButtonStatus
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4359
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4360 render = self._mgr.GetRenderer(style)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4361
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4362 if (bRedrawX or bRedrawRight or bRedrawLeft or bRedrawTabX or bRedrawDropArrow):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4363
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4364 dc = wx.ClientDC(self)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4365
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4366 if bRedrawX:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4367
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4368 render.DrawX(self, dc)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4369
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4370 if bRedrawLeft:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4371
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4372 render.DrawLeftArrow(self, dc)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4373
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4374 if bRedrawRight:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4375
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4376 render.DrawRightArrow(self, dc)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4377
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4378 if bRedrawTabX:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4379
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4380 self.Refresh()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4381
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4382 if bRedrawDropArrow:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4383
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4384 render.DrawDropDownArrow(self, dc)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4385
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4386 event.Skip()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4387
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4388
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4389 def GetLastVisibleTab(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4390 """ Returns the last visible tab. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4391
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4392 if self._nFrom < 0:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4393 return -1
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4394
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4395 ii = 0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4396
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4397 for ii in xrange(self._nFrom, len(self._pagesInfoVec)):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4398
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4399 if self._pagesInfoVec[ii].GetPosition() == wx.Point(-1, -1):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4400 break
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4401
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4402 return ii-1
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4403
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4404
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4405 def GetNumTabsCanScrollLeft(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4406 """ Returns the number of tabs than can be scrolled left. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4407
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4408 if self._nFrom - 1 >= 0:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4409 return 1
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4410
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4411 return 0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4412
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4413
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4414 def IsDefaultTabs(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4415 """ Returns whether a tab has a default style. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4416
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4417 style = self.GetParent().GetWindowStyleFlag()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4418 res = (style & FNB_VC71) or (style & FNB_FANCY_TABS) or (style & FNB_VC8)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4419 return not res
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4420
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4421
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4422 def AdvanceSelection(self, bForward=True):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4423 """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4424 Cycles through the tabs.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4425 The call to this function generates the page changing events.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4426 """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4427
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4428 nSel = self.GetSelection()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4429
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4430 if nSel < 0:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4431 return
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4432
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4433 nMax = self.GetPageCount() - 1
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4434
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4435 if bForward:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4436 newSelection = (nSel == nMax and [0] or [nSel + 1])[0]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4437 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4438 newSelection = (nSel == 0 and [nMax] or [nSel - 1])[0]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4439
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4440 if not self._pagesInfoVec[newSelection].GetEnabled():
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4441 return
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4442
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4443 self.FireEvent(newSelection)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4444
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4445
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4446 def OnMouseLeave(self, event):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4447 """ Handles the wx.EVT_LEAVE_WINDOW event for L{PageContainer}. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4448
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4449 self._nLeftButtonStatus = FNB_BTN_NONE
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4450 self._nXButtonStatus = FNB_BTN_NONE
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4451 self._nRightButtonStatus = FNB_BTN_NONE
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4452 self._nTabXButtonStatus = FNB_BTN_NONE
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4453 self._nArrowDownButtonStatus = FNB_BTN_NONE
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4454
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4455 style = self.GetParent().GetWindowStyleFlag()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4456 render = self._mgr.GetRenderer(style)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4457
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4458 dc = wx.ClientDC(self)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4459
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4460 render.DrawX(self, dc)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4461 render.DrawLeftArrow(self, dc)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4462 render.DrawRightArrow(self, dc)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4463
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4464 selection = self.GetSelection()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4465
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4466 if selection == -1:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4467 event.Skip()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4468 return
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4469
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4470 if not self.IsTabVisible(selection):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4471 if selection == len(self._pagesInfoVec) - 1:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4472 if not self.CanFitToScreen(selection):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4473 event.Skip()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4474 return
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4475 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4476 event.Skip()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4477 return
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4478
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4479 render.DrawTabX(self, dc, self._pagesInfoVec[selection].GetXRect(), selection, self._nTabXButtonStatus)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4480 render.DrawFocusRectangle(dc, self, self._pagesInfoVec[selection])
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4481
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4482 event.Skip()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4483
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4484
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4485 def OnMouseEnterWindow(self, event):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4486 """ Handles the wx.EVT_ENTER_WINDOW event for L{PageContainer}. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4487
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4488 self._nLeftButtonStatus = FNB_BTN_NONE
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4489 self._nXButtonStatus = FNB_BTN_NONE
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4490 self._nRightButtonStatus = FNB_BTN_NONE
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4491 self._nLeftClickZone = FNB_BTN_NONE
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4492 self._nArrowDownButtonStatus = FNB_BTN_NONE
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4493
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4494 event.Skip()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4495
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4496
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4497 def ShowTabTooltip(self, tabIdx):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4498 """ Shows a tab tooltip. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4499
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4500 pWindow = self._pParent.GetPage(tabIdx)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4501
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4502 if pWindow:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4503 pToolTip = pWindow.GetToolTip()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4504 if pToolTip and pToolTip.GetWindow() == pWindow:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4505 self.SetToolTipString(pToolTip.GetTip())
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4506
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4507
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4508 def SetPageImage(self, page, imgindex):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4509 """ Sets the image index associated to a page. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4510
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4511 if page < len(self._pagesInfoVec):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4512
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4513 self._pagesInfoVec[page].SetImageIndex(imgindex)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4514 self.Refresh()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4515
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4516
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4517 def GetPageImage(self, page):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4518 """ Returns the image index associated to a page. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4519
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4520 if page < len(self._pagesInfoVec):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4521
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4522 return self._pagesInfoVec[page].GetImageIndex()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4523
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4524 return -1
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4525
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4526
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4527 def OnDropTarget(self, x, y, nTabPage, wnd_oldContainer):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4528 """ Handles the drop action from a DND operation. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4529
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4530 # Disable drag'n'drop for disabled tab
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4531 if not wnd_oldContainer._pagesInfoVec[nTabPage].GetEnabled():
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4532 return wx.DragCancel
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4533
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4534 self._isdragging = True
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4535 oldContainer = wnd_oldContainer
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4536 nIndex = -1
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4537
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4538 where, nIndex = self.HitTest(wx.Point(x, y))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4539
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4540 oldNotebook = oldContainer.GetParent()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4541 newNotebook = self.GetParent()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4542
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4543 if oldNotebook == newNotebook:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4544
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4545 if nTabPage >= 0:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4546
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4547 if where == FNB_TAB:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4548 self.MoveTabPage(nTabPage, nIndex)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4549
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4550 elif self.GetParent().GetWindowStyleFlag() & FNB_ALLOW_FOREIGN_DND:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4551
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4552 if wx.Platform in ["__WXMSW__", "__WXGTK__", "__WXMAC__"]:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4553 if nTabPage >= 0:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4554
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4555 window = oldNotebook.GetPage(nTabPage)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4556
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4557 if window:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4558 where, nIndex = newNotebook._pages.HitTest(wx.Point(x, y))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4559 caption = oldContainer.GetPageText(nTabPage)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4560 imageindex = oldContainer.GetPageImage(nTabPage)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4561 oldNotebook.RemovePage(nTabPage)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4562 window.Reparent(newNotebook)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4563
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4564 if imageindex >= 0:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4565
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4566 bmp = oldNotebook.GetImageList().GetBitmap(imageindex)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4567 newImageList = newNotebook.GetImageList()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4568
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4569 if not newImageList:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4570 xbmp, ybmp = bmp.GetWidth(), bmp.GetHeight()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4571 newImageList = wx.ImageList(xbmp, ybmp)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4572 imageindex = 0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4573 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4574 imageindex = newImageList.GetImageCount()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4575
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4576 newImageList.Add(bmp)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4577 newNotebook.SetImageList(newImageList)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4578
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4579 newNotebook.InsertPage(nIndex, window, caption, True, imageindex)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4580
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4581 self._isdragging = False
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4582
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4583 return wx.DragMove
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4584
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4585
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4586 def MoveTabPage(self, nMove, nMoveTo):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4587 """ Moves a tab inside the same L{FlatNotebook}. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4588
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4589 if nMove == nMoveTo:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4590 return
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4591
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4592 elif nMoveTo < len(self._pParent._windows):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4593 nMoveTo = nMoveTo + 1
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4594
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4595 self._pParent.Freeze()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4596
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4597 # Remove the window from the main sizer
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4598 nCurSel = self._pParent._pages.GetSelection()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4599 self._pParent._mainSizer.Detach(self._pParent._windows[nCurSel])
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4600 self._pParent._windows[nCurSel].Hide()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4601
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4602 pWindow = self._pParent._windows[nMove]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4603 self._pParent._windows.pop(nMove)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4604 self._pParent._windows.insert(nMoveTo-1, pWindow)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4605
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4606 pgInfo = self._pagesInfoVec[nMove]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4607
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4608 self._pagesInfoVec.pop(nMove)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4609 self._pagesInfoVec.insert(nMoveTo - 1, pgInfo)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4610
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4611 # Add the page according to the style
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4612 pSizer = self._pParent._mainSizer
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4613 style = self.GetParent().GetWindowStyleFlag()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4614
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4615 if style & FNB_BOTTOM:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4616
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4617 pSizer.Insert(0, pWindow, 1, wx.EXPAND)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4618
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4619 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4620
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4621 # We leave a space of 1 pixel around the window
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4622 pSizer.Add(pWindow, 1, wx.EXPAND)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4623
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4624 pWindow.Show()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4625
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4626 pSizer.Layout()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4627 self._iActivePage = nMoveTo - 1
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4628 self._iPreviousActivePage = -1
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4629 self.DoSetSelection(self._iActivePage)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4630 self.Refresh()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4631 self._pParent.Thaw()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4632
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4633
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4634 def CanFitToScreen(self, page):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4635 """ Returns wheter a tab can fit in the left space in the screen or not. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4636
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4637 # Incase the from is greater than page,
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4638 # we need to reset the self._nFrom, so in order
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4639 # to force the caller to do so, we return false
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4640 if self._nFrom > page:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4641 return False
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4642
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4643 style = self.GetParent().GetWindowStyleFlag()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4644 render = self._mgr.GetRenderer(style)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4645
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4646 vTabInfo = render.NumberTabsCanFit(self)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4647
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4648 if page - self._nFrom >= len(vTabInfo):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4649 return False
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4650
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4651 return True
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4652
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4653
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4654 def GetNumOfVisibleTabs(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4655 """ Returns the number of visible tabs. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4656
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4657 count = 0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4658 for ii in xrange(self._nFrom, len(self._pagesInfoVec)):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4659 if self._pagesInfoVec[ii].GetPosition() == wx.Point(-1, -1):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4660 break
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4661 count = count + 1
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4662
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4663 return count
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4664
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4665
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4666 def GetEnabled(self, page):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4667 """ Returns whether a tab is enabled or not. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4668
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4669 if page >= len(self._pagesInfoVec):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4670 return True # Seems strange, but this is the default
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4671
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4672 return self._pagesInfoVec[page].GetEnabled()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4673
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4674
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4675 def EnableTab(self, page, enabled=True):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4676 """ Enables or disables a tab. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4677
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4678 if page >= len(self._pagesInfoVec):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4679 return
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4680
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4681 self._pagesInfoVec[page].EnableTab(enabled)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4682
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4683
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4684 def GetSingleLineBorderColour(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4685 """ Returns the colour for the single line border. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4686
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4687 if self.HasFlag(FNB_FANCY_TABS):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4688 return self._colorFrom
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4689
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4690 return wx.WHITE
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4691
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4692
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4693 def HasFlag(self, flag):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4694 """ Returns whether a flag is present in the L{FlatNotebook} style. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4695
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4696 style = self.GetParent().GetWindowStyleFlag()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4697 res = (style & flag and [True] or [False])[0]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4698 return res
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4699
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4700
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4701 def ClearFlag(self, flag):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4702 """ Deletes a flag from the L{FlatNotebook} style. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4703
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4704 style = self.GetParent().GetWindowStyleFlag()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4705 style &= ~flag
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4706 self.SetWindowStyleFlag(style)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4707
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4708
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4709 def TabHasImage(self, tabIdx):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4710 """ Returns whether a tab has an associated image index or not. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4711
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4712 if self._ImageList:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4713 return self._pagesInfoVec[tabIdx].GetImageIndex() != -1
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4714
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4715 return False
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4716
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4717
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4718 def OnLeftDClick(self, event):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4719 """ Handles the wx.EVT_LEFT_DCLICK event for L{PageContainer}. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4720
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4721 where, tabIdx = self.HitTest(event.GetPosition())
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4722
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4723 if where == FNB_RIGHT_ARROW:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4724 self.RotateRight()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4725
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4726 elif where == FNB_LEFT_ARROW:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4727 self.RotateLeft()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4728
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4729 elif self.HasFlag(FNB_DCLICK_CLOSES_TABS):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4730
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4731 if where == FNB_TAB:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4732 self.DeletePage(tabIdx)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4733
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4734 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4735
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4736 event.Skip()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4737
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4738
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4739 def OnSetFocus(self, event):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4740 """ Handles the wx.EVT_SET_FOCUS event for L{PageContainer}. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4741
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4742 if self._iActivePage < 0:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4743 event.Skip()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4744 return
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4745
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4746 self.SetFocusedPage(self._iActivePage)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4747
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4748
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4749 def OnKillFocus(self, event):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4750 """ Handles the wx.EVT_KILL_FOCUS event for L{PageContainer}. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4751
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4752 self.SetFocusedPage()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4753
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4754
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4755 def OnKeyDown(self, event):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4756 """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4757 When the PageContainer has the focus tabs can be changed with
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4758 the left/right arrow keys.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4759 """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4760 key = event.GetKeyCode()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4761 if key == wx.WXK_LEFT:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4762 self.GetParent().AdvanceSelection(False)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4763 elif key == wx.WXK_RIGHT:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4764 self.GetParent().AdvanceSelection(True)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4765 elif key == wx.WXK_TAB and not event.ControlDown():
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4766 flags = 0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4767 if not event.ShiftDown(): flags |= wx.NavigationKeyEvent.IsForward
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4768 if event.CmdDown(): flags |= wx.NavigationKeyEvent.WinChange
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4769 self.Navigate(flags)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4770 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4771 event.Skip()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4772
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4773
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4774 def SetFocusedPage(self, pageIndex=-1):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4775 """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4776 Sets/Unsets the focus on the appropriate page.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4777 If pageIndex is defaulted, we have lost focus and no focus indicator is drawn.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4778 """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4779
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4780 for indx, page in enumerate(self._pagesInfoVec):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4781 if indx == pageIndex:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4782 page._hasFocus = True
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4783 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4784 page._hasFocus = False
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4785
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4786 self.Refresh()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4787
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4788
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4789 def PopupTabsMenu(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4790 """ Pops up the menu activated with the drop down arrow in the navigation area. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4791
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4792 popupMenu = wx.Menu()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4793
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4794 for i in xrange(len(self._pagesInfoVec)):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4795 pi = self._pagesInfoVec[i]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4796 item = wx.MenuItem(popupMenu, i+1, pi.GetCaption(), pi.GetCaption(), wx.ITEM_NORMAL)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4797 self.Bind(wx.EVT_MENU, self.OnTabMenuSelection, item)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4798
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4799 # There is an alignment problem with wx2.6.3 & Menus so only use
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4800 # images for versions above 2.6.3
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4801 if wx.VERSION > (2, 6, 3, 0) and self.TabHasImage(i):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4802 item.SetBitmap(self.GetImageList().GetBitmap(pi.GetImageIndex()))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4803
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4804 popupMenu.AppendItem(item)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4805 item.Enable(pi.GetEnabled())
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4806
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4807 self.PopupMenu(popupMenu)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4808
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4809
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4810 def OnTabMenuSelection(self, event):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4811 """ Handles the wx.EVT_MENU event for L{PageContainer}. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4812
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4813 selection = event.GetId() - 1
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4814 self.FireEvent(selection)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4815
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4816
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4817 def FireEvent(self, selection):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4818 """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4819 Fires the wxEVT_FLATNOTEBOOK_PAGE_CHANGING and wxEVT_FLATNOTEBOOK_PAGE_CHANGED events
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4820 called from other methods (from menu selection or Smart Tabbing).
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4821 Utility function.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4822 """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4823
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4824 if selection == self._iActivePage:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4825 # No events for the same selection
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4826 return
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4827
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4828 oldSelection = self._iActivePage
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4829
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4830 event = FlatNotebookEvent(wxEVT_FLATNOTEBOOK_PAGE_CHANGING, self.GetParent().GetId())
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4831 event.SetSelection(selection)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4832 event.SetOldSelection(oldSelection)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4833 event.SetEventObject(self.GetParent())
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4834
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4835 if not self.GetParent().GetEventHandler().ProcessEvent(event) or event.IsAllowed():
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4836
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4837 self.SetSelection(selection)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4838
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4839 # Fire a wxEVT_FLATNOTEBOOK_PAGE_CHANGED event
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4840 event.SetEventType(wxEVT_FLATNOTEBOOK_PAGE_CHANGED)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4841 event.SetOldSelection(oldSelection)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4842 self.GetParent().GetEventHandler().ProcessEvent(event)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4843 self.SetFocus()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4844
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4845
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4846 def SetImageList(self, imglist):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4847 """ Sets the image list for the page control. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4848
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4849 self._ImageList = imglist
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4850
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4851
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4852 def AssignImageList(self, imglist):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4853 """ Assigns the image list for the page control. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4854
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4855 self._ImageList = imglist
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4856
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4857
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4858 def GetImageList(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4859 """ Returns the image list for the page control. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4860
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4861 return self._ImageList
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4862
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4863
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4864 def GetSelection(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4865 """ Returns the current selected page. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4866
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4867 return self._iActivePage
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4868
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4869
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4870 def GetPageCount(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4871 """ Returns the number of tabs in the L{FlatNotebook} control. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4872
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4873 return len(self._pagesInfoVec)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4874
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4875
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4876 def GetPageText(self, page):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4877 """ Returns the tab caption of the page. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4878
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4879 return self._pagesInfoVec[page].GetCaption()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4880
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4881
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4882 def SetPageText(self, page, text):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4883 """ Sets the tab caption of the page. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4884
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4885 self._pagesInfoVec[page].SetCaption(text)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4886 return True
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4887
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4888
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4889 def DrawDragHint(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4890 """ Draws small arrow at the place that the tab will be placed. """
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4891
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4892 # get the index of tab that will be replaced with the dragged tab
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4893 pt = wx.GetMousePosition()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4894 client_pt = self.ScreenToClient(pt)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4895 where, tabIdx = self.HitTest(client_pt)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4896 self._mgr.GetRenderer(self.GetParent().GetWindowStyleFlag()).DrawDragHint(self, tabIdx)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4897
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4898