-
Notifications
You must be signed in to change notification settings - Fork 13
/
wxaui-tweaks.patch
169 lines (149 loc) · 7.07 KB
/
wxaui-tweaks.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
diff -Naur a/include/wx/aui/framemanager.h b/include/wx/aui/framemanager.h
--- a/include/wx/aui/framemanager.h 2018-02-18 12:30:31.000000000 -0800
+++ b/include/wx/aui/framemanager.h 2018-03-28 21:15:58.000000000 -0700
@@ -230,7 +230,7 @@
}
bool IsOk() const { return window != NULL; }
- bool IsFixed() const { return !HasFlag(optionResizable); }
+ bool IsFixed() const { return HasFlag(optionFixed); }
bool IsResizable() const { return HasFlag(optionResizable); }
bool IsShown() const { return !HasFlag(optionHidden); }
bool IsFloating() const { return HasFlag(optionFloating); }
@@ -293,7 +293,7 @@
wxAuiPaneInfo& FloatingPosition(int x, int y) { floating_pos.x = x; floating_pos.y = y; return *this; }
wxAuiPaneInfo& FloatingSize(const wxSize& size) { floating_size = size; return *this; }
wxAuiPaneInfo& FloatingSize(int x, int y) { floating_size.Set(x,y); return *this; }
- wxAuiPaneInfo& Fixed() { return SetFlag(optionResizable, false); }
+ wxAuiPaneInfo& Fixed(bool fixed = true) { return SetFlag(optionFixed, fixed); }
wxAuiPaneInfo& Resizable(bool resizable = true) { return SetFlag(optionResizable, resizable); }
wxAuiPaneInfo& Dock() { return SetFlag(optionFloating, false); }
wxAuiPaneInfo& Float() { return SetFlag(optionFloating, true); }
@@ -330,6 +330,7 @@
optionLeftDockable | optionRightDockable |
optionFloatable | optionMovable | optionResizable |
optionCaption | optionPaneBorder | buttonClose;
+ test.state &= (~optionFixed);
wxCHECK_MSG(test.IsValid(), *this,
"window settings and pane settings are incompatible");
*this = test;
@@ -340,13 +341,13 @@
wxAuiPaneInfo& CenterPane()
{
state = 0;
- return Center().PaneBorder().Resizable();
+ return Center().PaneBorder().Resizable().Fixed(false);
}
wxAuiPaneInfo& ToolbarPane()
{
DefaultPane();
- state |= (optionToolbar | optionGripper);
+ state |= (optionToolbar | optionGripper | optionFixed);
state &= ~(optionResizable | optionCaption);
if (dock_layer == 0)
dock_layer = 10;
@@ -403,6 +404,7 @@
optionGripperTop = 1 << 15,
optionMaximized = 1 << 16,
optionDockFixed = 1 << 17,
+ optionFixed = 1 << 18,
buttonClose = 1 << 21,
buttonMaximize = 1 << 22,
@@ -477,8 +479,8 @@
wxAuiPaneInfo& GetPane(const wxString& name);
wxAuiPaneInfoArray& GetAllPanes();
- bool AddPane(wxWindow* window,
- const wxAuiPaneInfo& paneInfo);
+ virtual bool AddPane(wxWindow* window,
+ const wxAuiPaneInfo& paneInfo);
bool AddPane(wxWindow* window,
const wxAuiPaneInfo& paneInfo,
@@ -492,14 +494,14 @@
const wxAuiPaneInfo& insertLocation,
int insertLevel = wxAUI_INSERT_PANE);
- bool DetachPane(wxWindow* window);
+ virtual bool DetachPane(wxWindow* window);
- void Update();
+ virtual void Update();
wxString SavePaneInfo(const wxAuiPaneInfo& pane);
void LoadPaneInfo(wxString panePart, wxAuiPaneInfo &pane);
- wxString SavePerspective();
- bool LoadPerspective(const wxString& perspective, bool update = true);
+ virtual wxString SavePerspective();
+ virtual bool LoadPerspective(const wxString& perspective, bool update = true);
void SetDockSizeConstraint(double widthPct, double heightPct);
void GetDockSizeConstraint(double* widthPct, double* heightPct) const;
diff -Naur a/src/aui/framemanager.cpp b/src/aui/framemanager.cpp
--- a/src/aui/framemanager.cpp 2018-02-18 12:30:31.000000000 -0800
+++ b/src/aui/framemanager.cpp 2018-03-28 21:20:01.000000000 -0700
@@ -1932,7 +1932,7 @@
int orientation = dock.IsHorizontal() ? wxHORIZONTAL : wxVERTICAL;
// resizable bottom and right docks have a sash before them
- if (!m_hasMaximized && !dock.fixed && (dock.dock_direction == wxAUI_DOCK_BOTTOM ||
+ if (!m_hasMaximized && !dock.fixed && dock.resizable && (dock.dock_direction == wxAUI_DOCK_BOTTOM ||
dock.dock_direction == wxAUI_DOCK_RIGHT))
{
sizer_item = cont->Add(sashSize, sashSize, 0, wxEXPAND);
@@ -2020,7 +2020,7 @@
// if this is not the first pane being added,
// we need to add a pane sizer
- if (!m_hasMaximized && pane_i > 0)
+ if (!m_hasMaximized && pane_i > 0 && dock.resizable)
{
sizer_item = dock_sizer->Add(sashSize, sashSize, 0, wxEXPAND);
@@ -2059,7 +2059,7 @@
// top and left docks have a sash after them
if (!m_hasMaximized &&
- !dock.fixed &&
+ !dock.fixed && dock.resizable &&
(dock.dock_direction == wxAUI_DOCK_TOP ||
dock.dock_direction == wxAUI_DOCK_LEFT))
{
@@ -2280,6 +2280,7 @@
// determine whether the dock has only toolbars
bool action_pane_marked = false;
dock.fixed = true;
+ dock.resizable = false;
dock.toolbar = true;
for (j = 0; j < dock_pane_count; ++j)
{
@@ -2292,6 +2293,8 @@
dock.fixed = true;
if (pane.HasFlag(wxAuiPaneInfo::actionPane))
action_pane_marked = true;
+ if (pane.IsResizable())
+ dock.resizable = true;
}
@@ -4007,11 +4010,12 @@
// pane which is not resizable
if (part->type == wxAuiDockUIPart::typeDockSizer && part->dock &&
part->dock->panes.GetCount() == 1 &&
- part->dock->panes.Item(0)->IsFixed())
+ (! part->dock->panes.Item(0)->IsResizable() ||
+ part->dock->panes.Item(0)->IsFixed()))
return;
// panes that may not be resized do not get a sizing cursor
- if (part->pane && part->pane->IsFixed())
+ if (part->pane && (part->pane->IsFixed() || ! part->pane->IsResizable()))
return;
if (part->orientation == wxVERTICAL)
@@ -4089,11 +4093,12 @@
// pane which is not resizable
if (part->type == wxAuiDockUIPart::typeDockSizer && part->dock &&
part->dock->panes.GetCount() == 1 &&
- part->dock->panes.Item(0)->IsFixed())
+ (! part->dock->panes.Item(0)->IsResizable() ||
+ part->dock->panes.Item(0)->IsFixed()))
return;
// panes that may not be resized should be ignored here
- if (part->pane && part->pane->IsFixed())
+ if (part->pane && (part->pane->IsFixed() || ! part->pane->IsResizable()))
return;
m_action = actionResize;
@@ -4309,7 +4314,7 @@
// while we're at it, subtract the pane sash
// width from the dock width, because this would
// skew our proportion calculations
- if (i > 0)
+ if (i > 0 && dock.resizable)
dock_pixels -= sashSize;
// also, the whole size (including decorations) of