]> git.saurik.com Git - wxWidgets.git/blob - src/generic/splitter.cpp
wxWindow split into wxWindowBase and wxWindow (wxGTK part)
[wxWidgets.git] / src / generic / splitter.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: splitter.cpp
3 // Purpose: wxSplitterWindow implementation
4 // Author: Julian Smart
5 // Modified by:
6 // Created: 01/02/97
7 // RCS-ID: $Id$
8 // Copyright: (c) Julian Smart and Markus Holzem
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifdef __GNUG__
13 #pragma implementation "splitter.h"
14 #endif
15
16 // For compilers that support precompilation, includes "wx.h".
17 #include "wx/wxprec.h"
18
19 #ifdef __BORLANDC__
20 #pragma hdrstop
21 #endif
22
23 #ifndef WX_PRECOMP
24 #include "wx/wx.h"
25 #endif
26
27 #include <math.h>
28 #include <stdlib.h>
29
30 #include "wx/string.h"
31 #include "wx/splitter.h"
32 #include "wx/dcscreen.h"
33
34 #if !USE_SHARED_LIBRARY
35 IMPLEMENT_DYNAMIC_CLASS(wxSplitterWindow, wxWindow)
36
37 BEGIN_EVENT_TABLE(wxSplitterWindow, wxWindow)
38 EVT_PAINT(wxSplitterWindow::OnPaint)
39 EVT_SIZE(wxSplitterWindow::OnSize)
40 EVT_MOUSE_EVENTS(wxSplitterWindow::OnMouseEvent)
41 END_EVENT_TABLE()
42 #endif
43
44 wxSplitterWindow::wxSplitterWindow()
45 {
46 m_splitMode = wxSPLIT_VERTICAL;
47 m_windowOne = (wxWindow *) NULL;
48 m_windowTwo = (wxWindow *) NULL;
49 m_dragMode = wxSPLIT_DRAG_NONE;
50 m_oldX = 0;
51 m_oldY = 0;
52 m_firstX = 0;
53 m_firstY = 0;
54 m_sashSize = 7;
55 m_borderSize = 2;
56 m_sashPosition = 0;
57 m_sashCursorWE = (wxCursor *) NULL;
58 m_sashCursorNS = (wxCursor *) NULL;
59 m_sashTrackerPen = (wxPen *) NULL;
60 m_lightShadowPen = (wxPen *) NULL;
61 m_mediumShadowPen = (wxPen *) NULL;
62 m_darkShadowPen = (wxPen *) NULL;
63 m_faceBrush = (wxBrush *) NULL;
64 m_facePen = (wxPen *) NULL;
65 m_hilightPen = (wxPen *) NULL;
66 m_minimumPaneSize = 0;
67 }
68
69 wxSplitterWindow::wxSplitterWindow(wxWindow *parent, wxWindowID id,
70 const wxPoint& pos,
71 const wxSize& size,
72 long style,
73 const wxString& name)
74 : wxWindow(parent, id, pos, size, style, name)
75 {
76 m_splitMode = wxSPLIT_VERTICAL;
77 m_windowOne = (wxWindow *) NULL;
78 m_windowTwo = (wxWindow *) NULL;
79 m_dragMode = wxSPLIT_DRAG_NONE;
80 m_oldX = 0;
81 m_oldY = 0;
82 m_firstX = 0;
83 m_firstY = 0;
84 m_sashSize = 7;
85 m_borderSize = 2;
86 m_sashPosition = 0;
87 m_minimumPaneSize = 0;
88 m_sashCursorWE = new wxCursor(wxCURSOR_SIZEWE);
89 m_sashCursorNS = new wxCursor(wxCURSOR_SIZENS);
90 m_sashTrackerPen = new wxPen(*wxBLACK, 2, wxSOLID);
91 m_lightShadowPen = (wxPen *) NULL;
92 m_mediumShadowPen = (wxPen *) NULL;
93 m_darkShadowPen = (wxPen *) NULL;
94 m_faceBrush = (wxBrush *) NULL;
95 m_facePen = (wxPen *) NULL;
96 m_hilightPen = (wxPen *) NULL;
97
98 if ( style & wxSP_3D )
99 {
100 m_borderSize = 2;
101 m_sashSize = 7;
102 }
103 else if ( style & wxSP_BORDER )
104 {
105 m_borderSize = 1;
106 m_sashSize = 3;
107 }
108 else
109 {
110 m_borderSize = 0;
111 m_sashSize = 3;
112 }
113
114 // Eventually, we'll respond to colour change messages
115 InitColours();
116
117 // For debugging purposes, to see the background.
118 // SetBackground(wxBLUE_BRUSH);
119 }
120
121 wxSplitterWindow::~wxSplitterWindow()
122 {
123 delete m_sashCursorWE;
124 delete m_sashCursorNS;
125 delete m_sashTrackerPen;
126 delete m_lightShadowPen;
127 delete m_darkShadowPen;
128 delete m_mediumShadowPen;
129 delete m_hilightPen;
130 delete m_facePen;
131 delete m_faceBrush;
132 }
133
134 void wxSplitterWindow::OnPaint(wxPaintEvent& WXUNUSED(event))
135 {
136 wxPaintDC dc(this);
137
138 if ( m_borderSize > 0 )
139 DrawBorders(dc);
140 DrawSash(dc);
141 }
142
143 void wxSplitterWindow::OnMouseEvent(wxMouseEvent& event)
144 {
145 long x, y;
146 event.Position(&x, &y);
147
148 // reset the cursor
149 #ifdef __WXMOTIF__
150 SetCursor(* wxSTANDARD_CURSOR);
151 #endif
152 #ifdef __WXMSW__
153 SetCursor(wxCursor());
154 #endif
155
156 // under wxGTK the method above causes the mouse
157 // to flicker so we set the standard cursor only
158 // when leaving the window and when moving over
159 // non-sash parts of the window. this should work
160 // on the other platforms as well, but who knows.
161 #ifdef __WXGTK__
162 if (event.Leaving())
163 SetCursor(* wxSTANDARD_CURSOR);
164 #endif
165
166 if (event.LeftDown())
167 {
168 if ( SashHitTest(x, y) )
169 {
170 CaptureMouse();
171
172 m_dragMode = wxSPLIT_DRAG_DRAGGING;
173
174 DrawSashTracker(x, y);
175 m_oldX = x;
176 m_oldY = y;
177 return;
178 }
179 }
180 else if (event.LeftUp() && m_dragMode == wxSPLIT_DRAG_DRAGGING)
181 {
182 // We can stop dragging now and see what we've got.
183 m_dragMode = wxSPLIT_DRAG_NONE;
184 ReleaseMouse();
185
186 // Erase old tracker
187 DrawSashTracker(m_oldX, m_oldY);
188
189 int w, h;
190 GetClientSize(&w, &h);
191 if ( m_splitMode == wxSPLIT_VERTICAL )
192 {
193 if ( !OnSashPositionChange(x) )
194 return;
195
196 if ( x <= 4 )
197 {
198 // We remove the first window from the view
199 wxWindow *removedWindow = m_windowOne;
200 m_windowOne = m_windowTwo;
201 m_windowTwo = (wxWindow *) NULL;
202
203 OnUnsplit(removedWindow);
204 m_sashPosition = 0;
205 }
206 else if ( x >= (w - 4) )
207 {
208 // We remove the second window from the view
209 wxWindow *removedWindow = m_windowTwo;
210 m_windowTwo = (wxWindow *) NULL;
211 OnUnsplit(removedWindow);
212 m_sashPosition = 0;
213 }
214 else
215 {
216 m_sashPosition = x;
217 }
218 }
219 else // m_splitMode == wxSPLIT_VERTICAL
220 {
221 if ( !OnSashPositionChange(y) )
222 return;
223
224 if ( y <= 4 )
225 {
226 // We remove the first window from the view
227 wxWindow *removedWindow = m_windowOne;
228 m_windowOne = m_windowTwo;
229 m_windowTwo = (wxWindow *) NULL;
230
231 OnUnsplit(removedWindow);
232 m_sashPosition = 0;
233 }
234 else if ( y >= (h - 4) )
235 {
236 // We remove the second window from the view
237 wxWindow *removedWindow = m_windowTwo;
238 m_windowTwo = (wxWindow *) NULL;
239 OnUnsplit(removedWindow);
240 m_sashPosition = 0;
241 }
242 else
243 {
244 m_sashPosition = y;
245 }
246 } // m_splitMode == wxSPLIT_VERTICAL
247 SizeWindows();
248 } // left up && dragging
249 else if (event.Moving() && !event.Dragging())
250 {
251 // Just change the cursor if required
252 if ( SashHitTest(x, y) )
253 {
254 if ( m_splitMode == wxSPLIT_VERTICAL )
255 {
256 SetCursor(*m_sashCursorWE);
257 }
258 else
259 {
260 SetCursor(*m_sashCursorNS);
261 }
262 }
263 #ifdef __WXGTK__
264 else
265 {
266 // where else do we unset the cursor?
267 SetCursor(* wxSTANDARD_CURSOR);
268 }
269 #endif
270 }
271 else if (event.Dragging() && (m_dragMode == wxSPLIT_DRAG_DRAGGING))
272 {
273 // Erase old tracker
274 DrawSashTracker(m_oldX, m_oldY);
275
276 // Draw new one
277 DrawSashTracker(x, y);
278
279 m_oldX = x;
280 m_oldY = y;
281 }
282 else if ( event.LeftDClick() )
283 {
284 OnDoubleClickSash(x, y);
285 }
286 }
287
288 void wxSplitterWindow::OnSize(wxSizeEvent& WXUNUSED(event))
289 {
290 int cw, ch;
291 GetClientSize( &cw, &ch );
292 if ( m_windowTwo )
293 {
294 if ( m_splitMode == wxSPLIT_VERTICAL )
295 {
296 if ( m_sashPosition >= (cw - 5) )
297 m_sashPosition = wxMax(10, cw - 40);
298 }
299 if ( m_splitMode == wxSPLIT_HORIZONTAL )
300 {
301 if ( m_sashPosition >= (ch - 5) )
302 m_sashPosition = wxMax(10, ch - 40);
303 }
304 }
305 SizeWindows();
306 }
307
308 bool wxSplitterWindow::SashHitTest(int x, int y, int tolerance)
309 {
310 if ( m_windowTwo == NULL || m_sashPosition == 0)
311 return FALSE; // No sash
312
313 if ( m_splitMode == wxSPLIT_VERTICAL )
314 {
315 if ( (x >= m_sashPosition - tolerance) && (x <= m_sashPosition + m_sashSize + tolerance) )
316 return TRUE;
317 else
318 return FALSE;
319 }
320 else
321 {
322 if ( (y >= (m_sashPosition- tolerance)) && (y <= (m_sashPosition + m_sashSize + tolerance)) )
323 return TRUE;
324 else
325 return FALSE;
326 }
327
328 return FALSE;
329 }
330
331 // Draw 3D effect borders
332 void wxSplitterWindow::DrawBorders(wxDC& dc)
333 {
334 int w, h;
335 GetClientSize(&w, &h);
336
337 if ( GetWindowStyleFlag() & wxSP_3D )
338 {
339 dc.SetPen(*m_mediumShadowPen);
340 dc.DrawLine(0, 0, w-1, 0);
341 dc.DrawLine(0, 0, 0, h - 1);
342
343 dc.SetPen(*m_darkShadowPen);
344 dc.DrawLine(1, 1, w-2, 1);
345 dc.DrawLine(1, 1, 1, h-2);
346
347 dc.SetPen(*m_hilightPen);
348 dc.DrawLine(0, h-1, w-1, h-1);
349 dc.DrawLine(w-1, 0, w-1, h); // Surely the maximum y pos. should be h - 1.
350 /// Anyway, h is required for MSW.
351
352 dc.SetPen(*m_lightShadowPen);
353 dc.DrawLine(w-2, 1, w-2, h-2); // Right hand side
354 dc.DrawLine(1, h-2, w-1, h-2); // Bottom
355 }
356 else if ( GetWindowStyleFlag() & wxSP_BORDER )
357 {
358 dc.SetBrush(*wxTRANSPARENT_BRUSH);
359 dc.SetPen(*wxBLACK_PEN);
360 dc.DrawRectangle(0, 0, w-1, h-1);
361 }
362
363 dc.SetPen(wxNullPen);
364 dc.SetBrush(wxNullBrush);
365 }
366
367 // Draw the sash
368 void wxSplitterWindow::DrawSash(wxDC& dc)
369 {
370 if ( m_sashPosition == 0 || !m_windowTwo)
371 return;
372
373 int w, h;
374 GetClientSize(&w, &h);
375
376 if ( GetWindowStyleFlag() & wxSP_3D )
377 {
378 if ( m_splitMode == wxSPLIT_VERTICAL )
379 {
380 dc.SetPen(*m_facePen);
381 dc.SetBrush(*m_faceBrush);
382 dc.DrawRectangle(m_sashPosition + 2, 0, m_sashSize - 4, h);
383
384 dc.SetBrush(*wxTRANSPARENT_BRUSH);
385
386 dc.SetPen(*m_lightShadowPen);
387 dc.DrawLine(m_sashPosition, 1, m_sashPosition, h-2);
388
389 dc.SetPen(*m_hilightPen);
390 dc.DrawLine(m_sashPosition+1, 0, m_sashPosition+1, h);
391
392 dc.SetPen(*m_mediumShadowPen);
393 dc.DrawLine(m_sashPosition+m_sashSize-2, 1, m_sashPosition+m_sashSize-2, h-1);
394
395 dc.SetPen(*m_darkShadowPen);
396 dc.DrawLine(m_sashPosition+m_sashSize-1, 2, m_sashPosition+m_sashSize-1, h-2);
397 }
398 else
399 {
400 dc.SetPen(*m_facePen);
401 dc.SetBrush(*m_faceBrush);
402 dc.DrawRectangle(0, m_sashPosition + 2, w, m_sashSize - 4);
403
404 dc.SetBrush(*wxTRANSPARENT_BRUSH);
405
406 dc.SetPen(*m_lightShadowPen);
407 dc.DrawLine(1, m_sashPosition, w-2, m_sashPosition);
408
409 dc.SetPen(*m_hilightPen);
410 dc.DrawLine(0, m_sashPosition+1, w, m_sashPosition+1);
411
412 dc.SetPen(*m_mediumShadowPen);
413 dc.DrawLine(1, m_sashPosition+m_sashSize-2, w-1, m_sashPosition+m_sashSize-2);
414
415 dc.SetPen(*m_darkShadowPen);
416 dc.DrawLine(2, m_sashPosition+m_sashSize-1, w-2, m_sashPosition+m_sashSize-1);
417 }
418 }
419 else
420 {
421 if ( m_splitMode == wxSPLIT_VERTICAL )
422 {
423 dc.SetPen(*wxBLACK_PEN);
424 dc.SetBrush(*wxBLACK_BRUSH);
425 int h1 = h-1;
426 if ( (GetWindowStyleFlag() & wxSP_BORDER) != wxSP_BORDER )
427 h1 += 1; // Not sure why this is necessary...
428 dc.DrawRectangle(m_sashPosition, 0, m_sashSize, h1);
429 }
430 else
431 {
432 dc.SetPen(*wxBLACK_PEN);
433 dc.SetBrush(*wxBLACK_BRUSH);
434 int w1 = w-1;
435 if ( (GetWindowStyleFlag() & wxSP_BORDER) != wxSP_BORDER )
436 w1 ++;
437
438 dc.DrawRectangle(0, m_sashPosition, w1, m_sashSize);
439 }
440
441 }
442
443 dc.SetPen(wxNullPen);
444 dc.SetBrush(wxNullBrush);
445 }
446
447 // Draw the sash tracker (for whilst moving the sash)
448 void wxSplitterWindow::DrawSashTracker(int x, int y)
449 {
450 int w, h;
451 GetClientSize(&w, &h);
452
453 wxScreenDC screenDC;
454 int x1, y1;
455 int x2, y2;
456
457 if ( m_splitMode == wxSPLIT_VERTICAL )
458 {
459 x1 = x; y1 = 2;
460 x2 = x; y2 = h-2;
461
462 if ( x1 > w )
463 {
464 x1 = w; x2 = w;
465 }
466 else if ( x1 < 0 )
467 {
468 x1 = 0; x2 = 0;
469 }
470 }
471 else
472 {
473 x1 = 2; y1 = y;
474 x2 = w-2; y2 = y;
475
476 if ( y1 > h )
477 {
478 y1 = h;
479 y2 = h;
480 }
481 else if ( y1 < 0 )
482 {
483 y1 = 0;
484 y2 = 0;
485 }
486 }
487
488 ClientToScreen(&x1, &y1);
489 ClientToScreen(&x2, &y2);
490
491 screenDC.SetLogicalFunction(wxXOR);
492 screenDC.SetPen(*m_sashTrackerPen);
493 screenDC.SetBrush(*wxTRANSPARENT_BRUSH);
494
495 screenDC.DrawLine(x1, y1, x2, y2);
496
497 screenDC.SetLogicalFunction(wxCOPY);
498
499 screenDC.SetPen(wxNullPen);
500 screenDC.SetBrush(wxNullBrush);
501 }
502
503 // Position and size subwindows.
504 // Note that the border size applies to each subwindow, not
505 // including the edges next to the sash.
506 void wxSplitterWindow::SizeWindows()
507 {
508 int w, h;
509 GetClientSize(&w, &h);
510
511 if ( m_windowOne && !m_windowTwo )
512 {
513 m_windowOne->SetSize(m_borderSize, m_borderSize, w - 2*m_borderSize, h - 2*m_borderSize);
514 }
515 else if ( m_windowOne && m_windowTwo )
516 {
517 if (m_splitMode == wxSPLIT_VERTICAL)
518 {
519 int x1 = m_borderSize;
520 int y1 = m_borderSize;
521 int w1 = m_sashPosition - m_borderSize;
522 int h1 = h - 2*m_borderSize;
523
524 int x2 = m_sashPosition + m_sashSize;
525 int y2 = m_borderSize;
526 int w2 = w - 2*m_borderSize - m_sashSize - w1;
527 int h2 = h - 2*m_borderSize;
528
529 m_windowOne->SetSize(x1, y1, w1, h1);
530 m_windowTwo->SetSize(x2, y2, w2, h2);
531 }
532 else
533 {
534 m_windowOne->SetSize(m_borderSize, m_borderSize,
535 w - 2*m_borderSize, m_sashPosition - m_borderSize);
536 m_windowTwo->SetSize(m_borderSize, m_sashPosition + m_sashSize,
537 w - 2*m_borderSize, h - 2*m_borderSize - m_sashSize - (m_sashPosition - m_borderSize));
538 }
539 }
540 wxClientDC dc(this);
541 DrawBorders(dc);
542 DrawSash(dc);
543 }
544
545 // Set pane for unsplit window
546 void wxSplitterWindow::Initialize(wxWindow *window)
547 {
548 m_windowOne = window;
549 m_windowTwo = (wxWindow *) NULL;
550 m_sashPosition = 0;
551 }
552
553 // Associates the given window with window 2, drawing the appropriate sash
554 // and changing the split mode.
555 // Does nothing and returns FALSE if the window is already split.
556 bool wxSplitterWindow::SplitVertically(wxWindow *window1, wxWindow *window2, int sashPosition)
557 {
558 if ( IsSplit() )
559 return FALSE;
560
561 int w, h;
562 GetClientSize(&w, &h);
563
564 m_splitMode = wxSPLIT_VERTICAL;
565 m_windowOne = window1;
566 m_windowTwo = window2;
567 if ( sashPosition > 0 )
568 m_sashPosition = sashPosition;
569 else if ( sashPosition < 0 )
570 m_sashPosition = w - sashPosition;
571 else // default
572 m_sashPosition = w/2;
573
574 SizeWindows();
575
576 return TRUE;
577 }
578
579 bool wxSplitterWindow::SplitHorizontally(wxWindow *window1, wxWindow *window2, int sashPosition)
580 {
581 if ( IsSplit() )
582 return FALSE;
583
584 int w, h;
585 GetClientSize(&w, &h);
586
587 m_splitMode = wxSPLIT_HORIZONTAL;
588 m_windowOne = window1;
589 m_windowTwo = window2;
590 if ( sashPosition > 0 )
591 m_sashPosition = sashPosition;
592 else if ( sashPosition < 0 )
593 m_sashPosition = h - sashPosition;
594 else // default
595 m_sashPosition = h/2;
596
597 SizeWindows();
598
599 return TRUE;
600 }
601
602
603 // Remove the specified (or second) window from the view
604 // Doesn't actually delete the window.
605 bool wxSplitterWindow::Unsplit(wxWindow *toRemove)
606 {
607 if ( ! IsSplit() )
608 return FALSE;
609
610 wxWindow *win = NULL;
611 if ( toRemove == NULL || toRemove == m_windowTwo)
612 {
613 win = m_windowTwo ;
614 m_windowTwo = (wxWindow *) NULL;
615 }
616 else if ( toRemove == m_windowOne )
617 {
618 win = m_windowOne ;
619 m_windowOne = m_windowTwo;
620 m_windowTwo = (wxWindow *) NULL;
621 }
622 else
623 {
624 wxFAIL_MSG(_T("splitter: attempt to remove a non-existent window"));
625
626 return FALSE;
627 }
628
629 OnUnsplit(win);
630 m_sashPosition = 0;
631 SizeWindows();
632
633 return TRUE;
634 }
635
636 // Replace a window with another one
637 bool wxSplitterWindow::ReplaceWindow(wxWindow *winOld, wxWindow *winNew)
638 {
639 wxCHECK_MSG( winOld, FALSE, _T("use one of Split() functions instead") );
640 wxCHECK_MSG( winNew, FALSE, _T("use Unsplit() functions instead") );
641
642 if ( winOld == m_windowTwo )
643 {
644 m_windowTwo = winNew;
645 }
646 else if ( winOld == m_windowOne )
647 {
648 m_windowOne = winNew;
649 }
650 else
651 {
652 wxFAIL_MSG(_T("splitter: attempt to replace a non-existent window"));
653
654 return FALSE;
655 }
656
657 SizeWindows();
658
659 return TRUE;
660 }
661
662 void wxSplitterWindow::SetSashPosition(int position, bool redraw)
663 {
664 m_sashPosition = position;
665
666 if ( redraw )
667 {
668 SizeWindows();
669 }
670 }
671
672 bool wxSplitterWindow::OnSashPositionChange(int newSashPosition)
673 {
674 // is the left/upper pane too small?
675 if ( newSashPosition < m_minimumPaneSize )
676 return NULL;
677
678 // is the right/lower pane too small?
679 int w, h;
680 GetClientSize(&w, &h);
681
682 if ( m_splitMode == wxSPLIT_VERTICAL )
683 {
684 if ( w - newSashPosition < m_minimumPaneSize )
685 return FALSE;
686 }
687 else // m_splitMode = wxSPLIT_HORIZONTAL
688 {
689 if ( h - newSashPosition < m_minimumPaneSize )
690 return FALSE;
691 }
692
693 // it's ok to move sash
694 return TRUE;
695 }
696
697 // Called when the sash is double-clicked.
698 // The default behaviour is to remove the sash if the
699 // minimum pane size is zero.
700 void wxSplitterWindow::OnDoubleClickSash(int WXUNUSED(x), int WXUNUSED(y) )
701 {
702 if ( GetMinimumPaneSize() == 0 )
703 {
704 Unsplit();
705 }
706 }
707
708 // Initialize colours
709 void wxSplitterWindow::InitColours()
710 {
711 wxDELETE( m_facePen );
712 wxDELETE( m_faceBrush );
713 wxDELETE( m_mediumShadowPen );
714 wxDELETE( m_darkShadowPen );
715 wxDELETE( m_lightShadowPen );
716 wxDELETE( m_hilightPen );
717
718 // Shadow colours
719 #if defined(__WIN95__)
720 wxColour faceColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE));
721 m_facePen = new wxPen(faceColour, 1, wxSOLID);
722 m_faceBrush = new wxBrush(faceColour, wxSOLID);
723
724 wxColour mediumShadowColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DSHADOW));
725 m_mediumShadowPen = new wxPen(mediumShadowColour, 1, wxSOLID);
726
727 wxColour darkShadowColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DDKSHADOW));
728 m_darkShadowPen = new wxPen(darkShadowColour, 1, wxSOLID);
729
730 wxColour lightShadowColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DLIGHT));
731 m_lightShadowPen = new wxPen(lightShadowColour, 1, wxSOLID);
732
733 wxColour hilightColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DHILIGHT));
734 m_hilightPen = new wxPen(hilightColour, 1, wxSOLID);
735 #else // !Win32
736 m_facePen = new wxPen("LIGHT GREY", 1, wxSOLID);
737 m_faceBrush = new wxBrush("LIGHT GREY", wxSOLID);
738 m_mediumShadowPen = new wxPen("GREY", 1, wxSOLID);
739 m_darkShadowPen = new wxPen("BLACK", 1, wxSOLID);
740 m_lightShadowPen = new wxPen("LIGHT GREY", 1, wxSOLID);
741 m_hilightPen = new wxPen("WHITE", 1, wxSOLID);
742 #endif // Win32/!Win32
743 }
744