]>
Commit | Line | Data |
---|---|---|
c801d85f | 1 | ///////////////////////////////////////////////////////////////////////////// |
a71d815b | 2 | // Name: src/generic/statusbr.cpp |
ed791986 | 3 | // Purpose: wxStatusBarGeneric class implementation |
c801d85f KB |
4 | // Author: Julian Smart |
5 | // Modified by: | |
6 | // Created: 01/02/97 | |
7 | // RCS-ID: $Id$ | |
6aa89a22 | 8 | // Copyright: (c) Julian Smart |
65571936 | 9 | // Licence: wxWindows licence |
c801d85f KB |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
c801d85f KB |
12 | // For compilers that support precompilation, includes "wx.h". |
13 | #include "wx/wxprec.h" | |
14 | ||
15 | #ifdef __BORLANDC__ | |
76b49cf4 | 16 | #pragma hdrstop |
c801d85f KB |
17 | #endif |
18 | ||
1e6feb95 | 19 | #if wxUSE_STATUSBAR |
ed791986 | 20 | |
3304646d WS |
21 | #include "wx/statusbr.h" |
22 | ||
c801d85f | 23 | #ifndef WX_PRECOMP |
76b49cf4 WS |
24 | #include "wx/settings.h" |
25 | #include "wx/dcclient.h" | |
a0125cfc | 26 | #include "wx/toplevel.h" |
c801d85f KB |
27 | #endif |
28 | ||
2b5f62a0 | 29 | #ifdef __WXGTK20__ |
53b6d7a2 | 30 | #include <gtk/gtk.h> |
2b5f62a0 VZ |
31 | #endif |
32 | ||
84f68c21 VZ |
33 | // we only have to do it here when we use wxStatusBarGeneric in addition to the |
34 | // standard wxStatusBar class, if wxStatusBarGeneric is the same as | |
35 | // wxStatusBar, then the corresponding IMPLEMENT_DYNAMIC_CLASS is already in | |
36 | // common/statbar.cpp | |
37 | #if defined(__WXMAC__) || \ | |
38 | (defined(wxUSE_NATIVE_STATUSBAR) && wxUSE_NATIVE_STATUSBAR) | |
b64a8473 | 39 | #include "wx/generic/statusbr.h" |
c801d85f | 40 | |
b64a8473 VZ |
41 | IMPLEMENT_DYNAMIC_CLASS(wxStatusBarGeneric, wxWindow) |
42 | #endif // wxUSE_NATIVE_STATUSBAR | |
ed791986 | 43 | |
7b6fefbe FM |
44 | // Default status border dimensions |
45 | #define wxTHICK_LINE_BORDER 2 | |
46 | ||
47 | ||
48 | // ---------------------------------------------------------------------------- | |
49 | // wxStatusBarGeneric | |
50 | // ---------------------------------------------------------------------------- | |
51 | ||
ed791986 VZ |
52 | BEGIN_EVENT_TABLE(wxStatusBarGeneric, wxWindow) |
53 | EVT_PAINT(wxStatusBarGeneric::OnPaint) | |
2b5f62a0 VZ |
54 | EVT_LEFT_DOWN(wxStatusBarGeneric::OnLeftDown) |
55 | EVT_RIGHT_DOWN(wxStatusBarGeneric::OnRightDown) | |
ed791986 | 56 | EVT_SYS_COLOUR_CHANGED(wxStatusBarGeneric::OnSysColourChanged) |
c801d85f | 57 | END_EVENT_TABLE() |
c801d85f | 58 | |
390015c0 | 59 | void wxStatusBarGeneric::Init() |
c801d85f | 60 | { |
48f7ffbe WS |
61 | m_borderX = wxTHICK_LINE_BORDER; |
62 | m_borderY = wxTHICK_LINE_BORDER; | |
c801d85f KB |
63 | } |
64 | ||
ed791986 | 65 | wxStatusBarGeneric::~wxStatusBarGeneric() |
c801d85f | 66 | { |
c801d85f KB |
67 | } |
68 | ||
ed791986 | 69 | bool wxStatusBarGeneric::Create(wxWindow *parent, |
76880b87 RL |
70 | wxWindowID id, |
71 | long style, | |
72 | const wxString& name) | |
c801d85f | 73 | { |
53b6d7a2 | 74 | style |= wxTAB_TRAVERSAL | wxFULL_REPAINT_ON_RESIZE; |
48f7ffbe WS |
75 | if ( !wxWindow::Create(parent, id, |
76 | wxDefaultPosition, wxDefaultSize, | |
53b6d7a2 | 77 | style, name) ) |
48f7ffbe | 78 | return false; |
c801d85f | 79 | |
48f7ffbe WS |
80 | // The status bar should have a themed background |
81 | SetThemeEnabled( true ); | |
82 | ||
83 | InitColours(); | |
f90566f5 | 84 | |
1ca21594 | 85 | #ifdef __WXPM__ |
48f7ffbe | 86 | SetFont(*wxSMALL_FONT); |
1ca21594 | 87 | #endif |
c801d85f | 88 | |
7422d7c4 VZ |
89 | wxCoord y; |
90 | { | |
91 | // Set the height according to the font and the border size | |
92 | wxClientDC dc(this); | |
93 | dc.SetFont(GetFont()); | |
94 | ||
95 | dc.GetTextExtent(_T("X"), NULL, &y ); | |
96 | } | |
48f7ffbe | 97 | int height = (int)( (11*y)/10 + 2*GetBorderY()); |
71e03035 | 98 | |
48f7ffbe | 99 | SetSize(wxDefaultCoord, wxDefaultCoord, wxDefaultCoord, height); |
71e03035 | 100 | |
48f7ffbe | 101 | SetFieldsCount(1); |
8aa2cea1 | 102 | |
48f7ffbe | 103 | return true; |
c801d85f KB |
104 | } |
105 | ||
595a9493 RD |
106 | wxSize wxStatusBarGeneric::DoGetBestSize() const |
107 | { | |
108 | int width, height; | |
109 | ||
110 | // best width is the width of the parent | |
111 | GetParent()->GetClientSize(&width, NULL); | |
112 | ||
113 | // best height is as calculated above in Create | |
114 | wxClientDC dc((wxWindow*)this); | |
115 | dc.SetFont(GetFont()); | |
116 | wxCoord y; | |
117 | dc.GetTextExtent(_T("X"), NULL, &y ); | |
118 | height = (int)( (11*y)/10 + 2*GetBorderY()); | |
119 | ||
120 | return wxSize(width, height); | |
ca65c044 | 121 | } |
595a9493 | 122 | |
cc56206f | 123 | void wxStatusBarGeneric::SetFieldsCount(int number, const int *widths) |
c801d85f | 124 | { |
390015c0 | 125 | wxASSERT_MSG( number >= 0, _T("negative number of fields in wxStatusBar?") ); |
76880b87 | 126 | |
7b6fefbe FM |
127 | // enlarge the m_statusStrings array if needed: |
128 | for (size_t i = m_panes.GetCount(); i < (size_t)number; ++i) | |
76880b87 RL |
129 | m_statusStrings.Add( wxEmptyString ); |
130 | ||
7b6fefbe FM |
131 | // shrink the m_statusStrings array if needed: |
132 | for (int j = (int)m_panes.GetCount() - 1; j >= number; --j) | |
133 | m_statusStrings.RemoveAt(j); | |
76880b87 | 134 | |
f9a961e1 DS |
135 | // forget the old cached pixel widths |
136 | m_widthsAbs.Empty(); | |
137 | ||
d64b1c76 DS |
138 | wxStatusBarBase::SetFieldsCount(number, widths); |
139 | ||
7b6fefbe FM |
140 | wxASSERT_MSG( m_panes.GetCount() == m_statusStrings.GetCount(), |
141 | _T("This really should never happen, can we do away with m_panes.GetCount() here?") ); | |
c801d85f KB |
142 | } |
143 | ||
ed791986 | 144 | void wxStatusBarGeneric::SetStatusText(const wxString& text, int number) |
c801d85f | 145 | { |
7b6fefbe | 146 | wxCHECK_RET( (number >= 0) && ((size_t)number < m_panes.GetCount()), |
633d67bb | 147 | _T("invalid status bar field index") ); |
c801d85f | 148 | |
87ff599d JS |
149 | wxString oldText = m_statusStrings[number]; |
150 | if (oldText != text) | |
151 | { | |
152 | m_statusStrings[number] = text; | |
c801d85f | 153 | |
87ff599d JS |
154 | wxRect rect; |
155 | GetFieldRect(number, rect); | |
e715f4e7 | 156 | |
e5e0c727 VZ |
157 | Refresh(true, &rect); |
158 | ||
159 | // it's common to show some text in the status bar before starting a | |
160 | // relatively lengthy operation, ensure that the text is shown to the | |
161 | // user immediately and not after the lengthy operation end | |
162 | Update(); | |
87ff599d | 163 | } |
c801d85f KB |
164 | } |
165 | ||
ed791986 | 166 | wxString wxStatusBarGeneric::GetStatusText(int n) const |
c801d85f | 167 | { |
7b6fefbe | 168 | wxCHECK_MSG( (n >= 0) && ((size_t)n < m_panes.GetCount()), wxEmptyString, |
ed791986 VZ |
169 | _T("invalid status bar field index") ); |
170 | ||
c801d85f KB |
171 | return m_statusStrings[n]; |
172 | } | |
173 | ||
ed791986 | 174 | void wxStatusBarGeneric::SetStatusWidths(int n, const int widths_field[]) |
c801d85f | 175 | { |
7b6fefbe FM |
176 | // only set status widths when n == number of statuswindows |
177 | wxCHECK_RET( (size_t)n == m_panes.GetCount(), _T("status bar field count mismatch") ); | |
633d67bb VZ |
178 | |
179 | // delete the old widths in any case - this function may be used to reset | |
180 | // the widths to the default (all equal) | |
1f361cdd MB |
181 | // MBN: this is incompatible with at least wxMSW and wxMAC and not |
182 | // documented, but let's keep it for now | |
7b6fefbe FM |
183 | m_bSameWidthForAllPanes = true; |
184 | // FM: what MBN's comment is saying is that allowing widths_field = NULL | |
185 | // only for wxStatusBarGeneric is not documented... | |
633d67bb | 186 | |
390015c0 VZ |
187 | // forget the old cached pixel widths |
188 | m_widthsAbs.Empty(); | |
189 | ||
633d67bb VZ |
190 | if ( !widths_field ) |
191 | { | |
192 | // not an error, see the comment above | |
f8a4fa4c | 193 | Refresh(); |
633d67bb VZ |
194 | return; |
195 | } | |
196 | ||
1f361cdd | 197 | wxStatusBarBase::SetStatusWidths(n, widths_field); |
c801d85f KB |
198 | } |
199 | ||
7422d7c4 VZ |
200 | bool wxStatusBarGeneric::ShowsSizeGrip() const |
201 | { | |
202 | if ( !HasFlag(wxST_SIZEGRIP) ) | |
203 | return false; | |
204 | ||
205 | wxTopLevelWindow * const | |
206 | tlw = wxDynamicCast(wxGetTopLevelParent(GetParent()), wxTopLevelWindow); | |
207 | return tlw && !tlw->IsMaximized() && tlw->HasFlag(wxRESIZE_BORDER); | |
208 | } | |
209 | ||
ed791986 | 210 | void wxStatusBarGeneric::OnPaint(wxPaintEvent& WXUNUSED(event) ) |
c801d85f | 211 | { |
2b5f62a0 | 212 | wxPaintDC dc(this); |
c801d85f | 213 | |
2b5f62a0 VZ |
214 | #ifdef __WXGTK20__ |
215 | // Draw grip first | |
7422d7c4 | 216 | if ( ShowsSizeGrip() ) |
2b5f62a0 VZ |
217 | { |
218 | int width, height; | |
219 | GetClientSize(&width, &height); | |
7422d7c4 | 220 | |
fc2d4209 RR |
221 | if (GetLayoutDirection() == wxLayout_RightToLeft) |
222 | { | |
223 | gtk_paint_resize_grip( m_widget->style, | |
08f53168 | 224 | GTKGetDrawingWindow(), |
fc2d4209 RR |
225 | (GtkStateType) GTK_WIDGET_STATE (m_widget), |
226 | NULL, | |
227 | m_widget, | |
228 | "statusbar", | |
229 | GDK_WINDOW_EDGE_SOUTH_WEST, | |
230 | 2, 2, height-2, height-4 ); | |
231 | } | |
232 | else | |
233 | { | |
234 | gtk_paint_resize_grip( m_widget->style, | |
08f53168 | 235 | GTKGetDrawingWindow(), |
2b5f62a0 VZ |
236 | (GtkStateType) GTK_WIDGET_STATE (m_widget), |
237 | NULL, | |
238 | m_widget, | |
239 | "statusbar", | |
240 | GDK_WINDOW_EDGE_SOUTH_EAST, | |
fc2d4209 RR |
241 | width-height-2, 2, height-2, height-4 ); |
242 | } | |
2b5f62a0 | 243 | } |
7422d7c4 | 244 | #endif // __WXGTK20__ |
5b3ed311 | 245 | |
48f7ffbe | 246 | if (GetFont().Ok()) |
2b5f62a0 | 247 | dc.SetFont(GetFont()); |
8aa2cea1 | 248 | |
04ee05f9 | 249 | dc.SetBackgroundMode(wxBRUSHSTYLE_TRANSPARENT); |
c801d85f | 250 | |
7b6fefbe | 251 | for (size_t i = 0; i < m_panes.GetCount(); i ++) |
2b5f62a0 | 252 | DrawField(dc, i); |
c801d85f KB |
253 | } |
254 | ||
ed791986 | 255 | void wxStatusBarGeneric::DrawFieldText(wxDC& dc, int i) |
c801d85f | 256 | { |
48f7ffbe | 257 | int leftMargin = 2; |
c801d85f | 258 | |
48f7ffbe WS |
259 | wxRect rect; |
260 | GetFieldRect(i, rect); | |
c801d85f | 261 | |
48f7ffbe | 262 | wxString text(GetStatusText(i)); |
c801d85f | 263 | |
01399dcd | 264 | wxCoord x = 0, y = 0; |
c801d85f | 265 | |
48f7ffbe | 266 | dc.GetTextExtent(text, &x, &y); |
c801d85f | 267 | |
48f7ffbe WS |
268 | int xpos = rect.x + leftMargin; |
269 | int ypos = (int) (((rect.height - y) / 2 ) + rect.y + 0.5) ; | |
ed791986 | 270 | |
7c74e7fe | 271 | #if defined( __WXGTK__ ) || defined(__WXMAC__) |
48f7ffbe WS |
272 | xpos++; |
273 | ypos++; | |
92976ab6 | 274 | #endif |
c801d85f | 275 | |
48f7ffbe | 276 | dc.SetClippingRegion(rect.x, rect.y, rect.width, rect.height); |
c801d85f | 277 | |
48f7ffbe | 278 | dc.DrawText(text, xpos, ypos); |
c801d85f | 279 | |
48f7ffbe | 280 | dc.DestroyClippingRegion(); |
c801d85f KB |
281 | } |
282 | ||
ed791986 | 283 | void wxStatusBarGeneric::DrawField(wxDC& dc, int i) |
c801d85f | 284 | { |
2b5f62a0 VZ |
285 | wxRect rect; |
286 | GetFieldRect(i, rect); | |
c801d85f | 287 | |
7b6fefbe | 288 | int style = m_panes[i].nStyle; |
c2919ab3 VZ |
289 | if (style != wxSB_FLAT) |
290 | { | |
291 | // Draw border | |
292 | // For wxSB_NORMAL: | |
293 | // Have grey background, plus 3-d border - | |
294 | // One black rectangle. | |
295 | // Inside this, left and top sides - dark grey. Bottom and right - | |
296 | // white. | |
297 | // Reverse it for wxSB_RAISED | |
298 | ||
299 | dc.SetPen((style == wxSB_RAISED) ? m_mediumShadowPen : m_hilightPen); | |
300 | ||
301 | #ifndef __WXPM__ | |
302 | ||
303 | // Right and bottom lines | |
304 | dc.DrawLine(rect.x + rect.width, rect.y, | |
305 | rect.x + rect.width, rect.y + rect.height); | |
306 | dc.DrawLine(rect.x + rect.width, rect.y + rect.height, | |
307 | rect.x, rect.y + rect.height); | |
308 | ||
309 | dc.SetPen((style == wxSB_RAISED) ? m_hilightPen : m_mediumShadowPen); | |
310 | ||
311 | // Left and top lines | |
312 | dc.DrawLine(rect.x, rect.y + rect.height, | |
313 | rect.x, rect.y); | |
314 | dc.DrawLine(rect.x, rect.y, | |
315 | rect.x + rect.width, rect.y); | |
316 | #else | |
317 | ||
318 | dc.DrawLine(rect.x + rect.width, rect.height + 2, | |
319 | rect.x, rect.height + 2); | |
320 | dc.DrawLine(rect.x + rect.width, rect.y, | |
321 | rect.x + rect.width, rect.y + rect.height); | |
322 | ||
323 | dc.SetPen((style == wxSB_RAISED) ? m_hilightPen : m_mediumShadowPen); | |
324 | dc.DrawLine(rect.x, rect.y, | |
325 | rect.x + rect.width, rect.y); | |
326 | dc.DrawLine(rect.x, rect.y + rect.height, | |
327 | rect.x, rect.y); | |
b34590eb DW |
328 | |
329 | #endif | |
c2919ab3 | 330 | } |
c801d85f | 331 | |
f51f94ea | 332 | DrawFieldText(dc, i); |
c801d85f KB |
333 | } |
334 | ||
335 | // Get the position and size of the field's internal bounding rectangle | |
ed791986 | 336 | bool wxStatusBarGeneric::GetFieldRect(int n, wxRect& rect) const |
c801d85f | 337 | { |
7b6fefbe | 338 | wxCHECK_MSG( (n >= 0) && ((size_t)n < m_panes.GetCount()), false, |
390015c0 | 339 | _T("invalid status bar field index") ); |
c801d85f | 340 | |
390015c0 VZ |
341 | // FIXME: workarounds for OS/2 bugs have nothing to do here (VZ) |
342 | int width, height; | |
28be2e8a | 343 | #ifdef __WXPM__ |
390015c0 | 344 | GetSize(&width, &height); |
28be2e8a | 345 | #else |
390015c0 | 346 | GetClientSize(&width, &height); |
28be2e8a | 347 | #endif |
c801d85f | 348 | |
2b5f62a0 VZ |
349 | // we cache m_widthsAbs between calls and recompute it if client |
350 | // width has changed (or when it is initially empty) | |
351 | if ( m_widthsAbs.IsEmpty() || (m_lastClientWidth != width) ) | |
c801d85f | 352 | { |
390015c0 VZ |
353 | wxConstCast(this, wxStatusBarGeneric)-> |
354 | m_widthsAbs = CalculateAbsWidths(width); | |
2b5f62a0 VZ |
355 | // remember last width for which we have recomputed the widths in pixels |
356 | wxConstCast(this, wxStatusBarGeneric)-> | |
357 | m_lastClientWidth = width; | |
c801d85f | 358 | } |
c801d85f | 359 | |
390015c0 VZ |
360 | rect.x = 0; |
361 | for ( int i = 0; i < n; i++ ) | |
362 | { | |
363 | rect.x += m_widthsAbs[i]; | |
c801d85f | 364 | } |
c801d85f | 365 | |
390015c0 VZ |
366 | rect.x += m_borderX; |
367 | rect.y = m_borderY; | |
c801d85f | 368 | |
390015c0 VZ |
369 | rect.width = m_widthsAbs[n] - 2*m_borderX; |
370 | rect.height = height - 2*m_borderY; | |
c801d85f | 371 | |
ca65c044 | 372 | return true; |
c801d85f KB |
373 | } |
374 | ||
375 | // Initialize colours | |
ed791986 | 376 | void wxStatusBarGeneric::InitColours() |
c801d85f | 377 | { |
ba959d4c | 378 | #if defined(__WXPM__) |
e715f4e7 | 379 | m_mediumShadowPen = wxPen(wxColour(127, 127, 127), 1, wxSOLID); |
b0fa2187 | 380 | m_hilightPen = *wxWHITE_PEN; |
dd7d1435 | 381 | |
b0fa2187 PC |
382 | SetBackgroundColour(*wxLIGHT_GREY); |
383 | SetForegroundColour(*wxBLACK); | |
ba959d4c VZ |
384 | #else // !__WXPM__ |
385 | m_mediumShadowPen = wxPen(wxSystemSettings::GetColour(wxSYS_COLOUR_3DSHADOW)); | |
386 | m_hilightPen = wxPen(wxSystemSettings::GetColour(wxSYS_COLOUR_3DHILIGHT)); | |
387 | #endif // __WXPM__/!__WXPM__ | |
c801d85f KB |
388 | } |
389 | ||
390 | // Responds to colour changes, and passes event on to children. | |
ed791986 | 391 | void wxStatusBarGeneric::OnSysColourChanged(wxSysColourChangedEvent& event) |
c801d85f KB |
392 | { |
393 | InitColours(); | |
c801d85f KB |
394 | |
395 | // Propagate the event to the non-top-level children | |
396 | wxWindow::OnSysColourChanged(event); | |
397 | } | |
398 | ||
ed791986 VZ |
399 | void wxStatusBarGeneric::SetMinHeight(int height) |
400 | { | |
401 | // check that this min height is not less than minimal height for the | |
402 | // current font | |
403 | wxClientDC dc(this); | |
404 | wxCoord y; | |
2b5f62a0 | 405 | dc.GetTextExtent( wxT("X"), NULL, &y ); |
ed791986 VZ |
406 | |
407 | if ( height > (11*y)/10 ) | |
408 | { | |
422d0ff0 | 409 | SetSize(wxDefaultCoord, wxDefaultCoord, wxDefaultCoord, height + 2*m_borderY); |
ed791986 VZ |
410 | } |
411 | } | |
412 | ||
2b5f62a0 | 413 | void wxStatusBarGeneric::OnLeftDown(wxMouseEvent& event) |
390015c0 | 414 | { |
2b5f62a0 VZ |
415 | #ifdef __WXGTK20__ |
416 | int width, height; | |
417 | GetClientSize(&width, &height); | |
8aa2cea1 | 418 | |
7422d7c4 | 419 | if ( ShowsSizeGrip() && (event.GetX() > width-height) ) |
2b5f62a0 VZ |
420 | { |
421 | GtkWidget *ancestor = gtk_widget_get_toplevel( m_widget ); | |
422 | ||
423 | if (!GTK_IS_WINDOW (ancestor)) | |
424 | return; | |
390015c0 | 425 | |
08f53168 | 426 | GdkWindow *source = GTKGetDrawingWindow(); |
2b5f62a0 VZ |
427 | |
428 | int org_x = 0; | |
429 | int org_y = 0; | |
430 | gdk_window_get_origin( source, &org_x, &org_y ); | |
431 | ||
fc2d4209 RR |
432 | if (GetLayoutDirection() == wxLayout_RightToLeft) |
433 | { | |
434 | gtk_window_begin_resize_drag (GTK_WINDOW (ancestor), | |
435 | GDK_WINDOW_EDGE_SOUTH_WEST, | |
436 | 1, | |
437 | org_x - event.GetX() + GetSize().x , | |
438 | org_y + event.GetY(), | |
439 | 0); | |
440 | } | |
441 | else | |
442 | { | |
443 | gtk_window_begin_resize_drag (GTK_WINDOW (ancestor), | |
2b5f62a0 VZ |
444 | GDK_WINDOW_EDGE_SOUTH_EAST, |
445 | 1, | |
8aa2cea1 RD |
446 | org_x + event.GetX(), |
447 | org_y + event.GetY(), | |
2b5f62a0 | 448 | 0); |
fc2d4209 | 449 | } |
2b5f62a0 VZ |
450 | } |
451 | else | |
452 | { | |
ca65c044 | 453 | event.Skip( true ); |
2b5f62a0 VZ |
454 | } |
455 | #else | |
ca65c044 | 456 | event.Skip( true ); |
2b5f62a0 VZ |
457 | #endif |
458 | } | |
459 | ||
460 | void wxStatusBarGeneric::OnRightDown(wxMouseEvent& event) | |
461 | { | |
462 | #ifdef __WXGTK20__ | |
463 | int width, height; | |
464 | GetClientSize(&width, &height); | |
8aa2cea1 | 465 | |
7422d7c4 | 466 | if ( ShowsSizeGrip() && (event.GetX() > width-height) ) |
2b5f62a0 VZ |
467 | { |
468 | GtkWidget *ancestor = gtk_widget_get_toplevel( m_widget ); | |
469 | ||
470 | if (!GTK_IS_WINDOW (ancestor)) | |
471 | return; | |
472 | ||
08f53168 | 473 | GdkWindow *source = GTKGetDrawingWindow(); |
2b5f62a0 VZ |
474 | |
475 | int org_x = 0; | |
476 | int org_y = 0; | |
477 | gdk_window_get_origin( source, &org_x, &org_y ); | |
8aa2cea1 | 478 | |
2b5f62a0 VZ |
479 | gtk_window_begin_move_drag (GTK_WINDOW (ancestor), |
480 | 2, | |
8aa2cea1 RD |
481 | org_x + event.GetX(), |
482 | org_y + event.GetY(), | |
2b5f62a0 VZ |
483 | 0); |
484 | } | |
485 | else | |
486 | { | |
ca65c044 | 487 | event.Skip( true ); |
2b5f62a0 VZ |
488 | } |
489 | #else | |
ca65c044 | 490 | event.Skip( true ); |
2b5f62a0 | 491 | #endif |
390015c0 VZ |
492 | } |
493 | ||
1e6feb95 | 494 | #endif // wxUSE_STATUSBAR |