]> git.saurik.com Git - wxWidgets.git/blob - src/gtk1/notebook.cpp
another file added on univ branch
[wxWidgets.git] / src / gtk1 / notebook.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: notebook.cpp
3 // Purpose:
4 // Author: Robert Roebling
5 // Id: $Id$
6 // Copyright: (c) 1998 Robert Roebling, Vadim Zeitlin
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
9
10 #ifdef __GNUG__
11 #pragma implementation "notebook.h"
12 #endif
13
14 #include "wx/notebook.h"
15
16 #if wxUSE_NOTEBOOK
17
18 #include "wx/panel.h"
19 #include "wx/utils.h"
20 #include "wx/imaglist.h"
21 #include "wx/intl.h"
22 #include "wx/log.h"
23
24 #include <gdk/gdk.h>
25 #include <gtk/gtk.h>
26 #include "wx/gtk/win_gtk.h"
27 #include <gdk/gdkkeysyms.h>
28
29 // ----------------------------------------------------------------------------
30 // events
31 // ----------------------------------------------------------------------------
32
33 DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED)
34 DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING)
35
36 //-----------------------------------------------------------------------------
37 // idle system
38 //-----------------------------------------------------------------------------
39
40 extern void wxapp_install_idle_handler();
41 extern bool g_isIdle;
42
43 //-----------------------------------------------------------------------------
44 // data
45 //-----------------------------------------------------------------------------
46
47 extern bool g_blockEventsOnDrag;
48
49 //-----------------------------------------------------------------------------
50 // debug
51 //-----------------------------------------------------------------------------
52
53 #ifdef __WXDEBUG__
54
55 extern void debug_focus_in( GtkWidget* widget, const wxChar* name, const wxChar *window );
56
57 #endif
58
59 //-----------------------------------------------------------------------------
60 // wxGtkNotebookPage
61 //-----------------------------------------------------------------------------
62
63 class wxGtkNotebookPage: public wxObject
64 {
65 public:
66 wxGtkNotebookPage()
67 {
68 m_text = "";
69 m_image = -1;
70 m_page = (GtkNotebookPage *) NULL;
71 m_client = (wxNotebookPage *) NULL;
72 m_box = (GtkWidget *) NULL;
73 }
74
75 wxString m_text;
76 int m_image;
77 GtkNotebookPage *m_page;
78 GtkLabel *m_label;
79 wxNotebookPage *m_client;
80 GtkWidget *m_box; // in which the label and image are packed
81 };
82
83 //-----------------------------------------------------------------------------
84 // "switch_page"
85 //-----------------------------------------------------------------------------
86
87 static void gtk_notebook_page_change_callback(GtkNotebook *WXUNUSED(widget),
88 GtkNotebookPage *WXUNUSED(page),
89 gint page,
90 wxNotebook *notebook )
91 {
92 static bool s_inPageChange = FALSE;
93
94 // are you trying to call SetSelection() from a notebook event handler?
95 // you shouldn't!
96 wxCHECK_RET( !s_inPageChange,
97 _T("gtk_notebook_page_change_callback reentered") );
98
99 s_inPageChange = TRUE;
100 if (g_isIdle)
101 wxapp_install_idle_handler();
102
103 int old = notebook->GetSelection();
104
105 wxNotebookEvent eventChanging( wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING,
106 notebook->GetId(), page, old );
107 eventChanging.SetEventObject( notebook );
108
109 if ( (notebook->GetEventHandler()->ProcessEvent(eventChanging)) &&
110 !eventChanging.IsAllowed() )
111 {
112 /* program doesn't allow the page change */
113 gtk_signal_emit_stop_by_name( GTK_OBJECT(notebook->m_widget),
114 "switch_page" );
115 }
116 else // change allowed
117 {
118 // make wxNotebook::GetSelection() return the correct (i.e. consistent
119 // with wxNotebookEvent::GetSelection()) value even though the page is
120 // not really changed in GTK+
121 notebook->m_selection = page;
122
123 wxNotebookEvent eventChanged( wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED,
124 notebook->GetId(), page, old );
125 eventChanged.SetEventObject( notebook );
126 notebook->GetEventHandler()->ProcessEvent( eventChanged );
127 }
128
129 s_inPageChange = FALSE;
130 }
131
132 //-----------------------------------------------------------------------------
133 // "size_allocate"
134 //-----------------------------------------------------------------------------
135
136 static void gtk_page_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation* alloc, wxWindow *win )
137 {
138 if (g_isIdle)
139 wxapp_install_idle_handler();
140
141 if ((win->m_x == alloc->x) &&
142 (win->m_y == alloc->y) &&
143 (win->m_width == alloc->width) &&
144 (win->m_height == alloc->height))
145 {
146 return;
147 }
148
149 win->SetSize( alloc->x, alloc->y, alloc->width, alloc->height );
150
151 /* GTK 1.2 up to version 1.2.5 is broken so that we have to call allocate
152 here in order to make repositioning after resizing to take effect. */
153 if ((gtk_major_version == 1) &&
154 (gtk_minor_version == 2) &&
155 (gtk_micro_version < 6) &&
156 (win->m_wxwindow) &&
157 (GTK_WIDGET_REALIZED(win->m_wxwindow)))
158 {
159 gtk_widget_size_allocate( win->m_wxwindow, alloc );
160 }
161 }
162
163 //-----------------------------------------------------------------------------
164 // "realize" from m_widget
165 //-----------------------------------------------------------------------------
166
167 static gint
168 gtk_notebook_realized_callback( GtkWidget * WXUNUSED(widget), wxWindow *win )
169 {
170 if (g_isIdle)
171 wxapp_install_idle_handler();
172
173 /* GTK 1.2 up to version 1.2.5 is broken so that we have to call a queue_resize
174 here in order to make repositioning before showing to take effect. */
175 gtk_widget_queue_resize( win->m_widget );
176
177 return FALSE;
178 }
179
180 //-----------------------------------------------------------------------------
181 // "key_press_event"
182 //-----------------------------------------------------------------------------
183
184 static gint gtk_notebook_key_press_callback( GtkWidget *widget, GdkEventKey *gdk_event, wxNotebook *win )
185 {
186 if (g_isIdle)
187 wxapp_install_idle_handler();
188
189 if (!win->m_hasVMT) return FALSE;
190 if (g_blockEventsOnDrag) return FALSE;
191
192 /* win is a control: tab can be propagated up */
193 if ((gdk_event->keyval == GDK_Tab) || (gdk_event->keyval == GDK_ISO_Left_Tab))
194 {
195 wxNode *node = win->m_pages.Nth( win->GetSelection() );
196 if (!node) return FALSE;
197
198 wxGtkNotebookPage *page = (wxGtkNotebookPage*) node->Data();
199
200 wxNavigationKeyEvent event;
201 event.SetEventObject( win );
202 /* GDK reports GDK_ISO_Left_Tab for SHIFT-TAB */
203 event.SetDirection( (gdk_event->keyval == GDK_Tab) );
204 /* CTRL-TAB changes the (parent) window, i.e. switch notebook page */
205 event.SetWindowChange( (gdk_event->state & GDK_CONTROL_MASK) );
206 event.SetCurrentFocus( win );
207 if (!page->m_client->GetEventHandler()->ProcessEvent( event ))
208 {
209 page->m_client->SetFocus();
210 }
211
212 gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "key_press_event" );
213 return TRUE;
214 }
215
216 return FALSE;
217 }
218
219 //-----------------------------------------------------------------------------
220 // InsertChild callback for wxNotebook
221 //-----------------------------------------------------------------------------
222
223 static void wxInsertChildInNotebook( wxNotebook* WXUNUSED(parent), wxWindow* WXUNUSED(child) )
224 {
225 /* we don't do anything here but pray */
226 }
227
228 //-----------------------------------------------------------------------------
229 // wxNotebook
230 //-----------------------------------------------------------------------------
231
232 IMPLEMENT_DYNAMIC_CLASS(wxNotebook,wxControl)
233
234 BEGIN_EVENT_TABLE(wxNotebook, wxControl)
235 EVT_NAVIGATION_KEY(wxNotebook::OnNavigationKey)
236 END_EVENT_TABLE()
237
238 void wxNotebook::Init()
239 {
240 m_imageList = (wxImageList *) NULL;
241 m_ownsImageList = FALSE;
242 m_pages.DeleteContents( TRUE );
243 m_selection = -1;
244 m_themeEnabled = TRUE;
245 }
246
247 wxNotebook::wxNotebook()
248 {
249 Init();
250 }
251
252 wxNotebook::wxNotebook( wxWindow *parent, wxWindowID id,
253 const wxPoint& pos, const wxSize& size,
254 long style, const wxString& name )
255 {
256 Init();
257 Create( parent, id, pos, size, style, name );
258 }
259
260 wxNotebook::~wxNotebook()
261 {
262 /* don't generate change page events any more */
263 gtk_signal_disconnect_by_func( GTK_OBJECT(m_widget),
264 GTK_SIGNAL_FUNC(gtk_notebook_page_change_callback), (gpointer) this );
265
266 DeleteAllPages();
267 if (m_ownsImageList) delete m_imageList;
268 }
269
270 bool wxNotebook::Create(wxWindow *parent, wxWindowID id,
271 const wxPoint& pos, const wxSize& size,
272 long style, const wxString& name )
273 {
274 m_needParent = TRUE;
275 m_acceptsFocus = TRUE;
276 m_insertCallback = (wxInsertChildFunction)wxInsertChildInNotebook;
277
278 if (!PreCreation( parent, pos, size ) ||
279 !CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
280 {
281 wxFAIL_MSG( wxT("wxNoteBook creation failed") );
282 return FALSE;
283 }
284
285
286 m_widget = gtk_notebook_new();
287
288 #ifdef __WXDEBUG__
289 debug_focus_in( m_widget, wxT("wxNotebook::m_widget"), name );
290 #endif
291
292 gtk_notebook_set_scrollable( GTK_NOTEBOOK(m_widget), 1 );
293
294 gtk_signal_connect( GTK_OBJECT(m_widget), "switch_page",
295 GTK_SIGNAL_FUNC(gtk_notebook_page_change_callback), (gpointer)this );
296
297 m_parent->DoAddChild( this );
298
299 if (m_windowStyle & wxNB_RIGHT)
300 gtk_notebook_set_tab_pos( GTK_NOTEBOOK(m_widget), GTK_POS_RIGHT );
301 if (m_windowStyle & wxNB_LEFT)
302 gtk_notebook_set_tab_pos( GTK_NOTEBOOK(m_widget), GTK_POS_LEFT );
303 if (m_windowStyle & wxNB_BOTTOM)
304 gtk_notebook_set_tab_pos( GTK_NOTEBOOK(m_widget), GTK_POS_BOTTOM );
305
306 gtk_signal_connect( GTK_OBJECT(m_widget), "key_press_event",
307 GTK_SIGNAL_FUNC(gtk_notebook_key_press_callback), (gpointer)this );
308
309 PostCreation();
310
311 SetFont( parent->GetFont() );
312
313 gtk_signal_connect( GTK_OBJECT(m_widget), "realize",
314 GTK_SIGNAL_FUNC(gtk_notebook_realized_callback), (gpointer) this );
315
316 Show( TRUE );
317
318 return TRUE;
319 }
320
321 int wxNotebook::GetSelection() const
322 {
323 wxCHECK_MSG( m_widget != NULL, -1, wxT("invalid notebook") );
324
325 if ( m_selection == -1 )
326 {
327 GList *pages = GTK_NOTEBOOK(m_widget)->children;
328
329 if (g_list_length(pages) != 0)
330 {
331 GtkNotebook *notebook = GTK_NOTEBOOK(m_widget);
332
333 gpointer cur = notebook->cur_page;
334 if ( cur != NULL )
335 {
336 wxConstCast(this, wxNotebook)->m_selection =
337 g_list_index( pages, cur );
338 }
339 }
340 }
341
342 return m_selection;
343 }
344
345 int wxNotebook::GetPageCount() const
346 {
347 return (int) g_list_length( GTK_NOTEBOOK(m_widget)->children );
348 }
349
350 int wxNotebook::GetRowCount() const
351 {
352 return 1;
353 }
354
355 wxString wxNotebook::GetPageText( int page ) const
356 {
357 wxCHECK_MSG( m_widget != NULL, wxT(""), wxT("invalid notebook") );
358
359 wxGtkNotebookPage* nb_page = GetNotebookPage(page);
360 if (nb_page)
361 return nb_page->m_text;
362 else
363 return wxT("");
364 }
365
366 int wxNotebook::GetPageImage( int page ) const
367 {
368 wxCHECK_MSG( m_widget != NULL, -1, wxT("invalid notebook") );
369
370 wxGtkNotebookPage* nb_page = GetNotebookPage(page);
371 if (nb_page)
372 return nb_page->m_image;
373 else
374 return -1;
375 }
376
377 wxGtkNotebookPage* wxNotebook::GetNotebookPage( int page ) const
378 {
379 wxCHECK_MSG( m_widget != NULL, (wxGtkNotebookPage*) NULL, wxT("invalid notebook") );
380
381 wxCHECK_MSG( page < (int)m_pages.GetCount(), (wxGtkNotebookPage*) NULL, wxT("invalid notebook index") );
382
383 wxNode *node = m_pages.Nth( page );
384
385 return (wxGtkNotebookPage *) node->Data();
386 }
387
388 int wxNotebook::SetSelection( int page )
389 {
390 wxCHECK_MSG( m_widget != NULL, -1, wxT("invalid notebook") );
391
392 wxCHECK_MSG( page < (int)m_pages.GetCount(), -1, wxT("invalid notebook index") );
393
394 int selOld = GetSelection();
395
396 // cache the selection
397 m_selection = page;
398 gtk_notebook_set_page( GTK_NOTEBOOK(m_widget), page );
399
400 wxGtkNotebookPage* g_page = GetNotebookPage( page );
401 if (g_page->m_client)
402 g_page->m_client->SetFocus();
403
404 return selOld;
405 }
406
407 void wxNotebook::SetImageList( wxImageList* imageList )
408 {
409 if (m_ownsImageList) delete m_imageList;
410 m_imageList = imageList;
411 m_ownsImageList = FALSE;
412 }
413
414 void wxNotebook::AssignImageList( wxImageList* imageList )
415 {
416 SetImageList(imageList);
417 m_ownsImageList = TRUE;
418 }
419
420 bool wxNotebook::SetPageText( int page, const wxString &text )
421 {
422 wxCHECK_MSG( m_widget != NULL, FALSE, wxT("invalid notebook") );
423
424 wxGtkNotebookPage* nb_page = GetNotebookPage(page);
425
426 wxCHECK_MSG( nb_page, FALSE, wxT("SetPageText: invalid page index") );
427
428 nb_page->m_text = text;
429
430 gtk_label_set( nb_page->m_label, nb_page->m_text.mbc_str() );
431
432 return TRUE;
433 }
434
435 bool wxNotebook::SetPageImage( int page, int image )
436 {
437 /* HvdH 28-12-98: now it works, but it's a bit of a kludge */
438
439 wxGtkNotebookPage* nb_page = GetNotebookPage(page);
440
441 if (!nb_page) return FALSE;
442
443 /* Optimization posibility: return immediately if image unchanged.
444 * Not enabled because it may break existing (stupid) code that
445 * manipulates the imagelist to cycle images */
446
447 /* if (image == nb_page->m_image) return TRUE; */
448
449 /* For different cases:
450 1) no image -> no image
451 2) image -> no image
452 3) no image -> image
453 4) image -> image */
454
455 if (image == -1 && nb_page->m_image == -1)
456 return TRUE; /* Case 1): Nothing to do. */
457
458 GtkWidget *pixmapwid = (GtkWidget*) NULL;
459
460 if (nb_page->m_image != -1)
461 {
462 /* Case 2) or 4). There is already an image in the gtkhbox. Let's find it */
463
464 GList *child = gtk_container_children(GTK_CONTAINER(nb_page->m_box));
465 while (child)
466 {
467 if (GTK_IS_PIXMAP(child->data))
468 {
469 pixmapwid = GTK_WIDGET(child->data);
470 break;
471 }
472 child = child->next;
473 }
474
475 /* We should have the pixmap widget now */
476 wxASSERT(pixmapwid != NULL);
477
478 if (image == -1)
479 {
480 /* If there's no new widget, just remove the old from the box */
481 gtk_container_remove(GTK_CONTAINER(nb_page->m_box), pixmapwid);
482 nb_page->m_image = -1;
483
484 return TRUE; /* Case 2) */
485 }
486 }
487
488 /* Only cases 3) and 4) left */
489 wxASSERT( m_imageList != NULL ); /* Just in case */
490
491 /* Construct the new pixmap */
492 const wxBitmap *bmp = m_imageList->GetBitmap(image);
493 GdkPixmap *pixmap = bmp->GetPixmap();
494 GdkBitmap *mask = (GdkBitmap*) NULL;
495 if ( bmp->GetMask() )
496 {
497 mask = bmp->GetMask()->GetBitmap();
498 }
499
500 if (pixmapwid == NULL)
501 {
502 /* Case 3) No old pixmap. Create a new one and prepend it to the hbox */
503 pixmapwid = gtk_pixmap_new (pixmap, mask );
504
505 /* CHECKME: Are these pack flags okay? */
506 gtk_box_pack_start(GTK_BOX(nb_page->m_box), pixmapwid, FALSE, FALSE, 3);
507 gtk_widget_show(pixmapwid);
508 }
509 else
510 {
511 /* Case 4) Simply replace the pixmap */
512 gtk_pixmap_set(GTK_PIXMAP(pixmapwid), pixmap, mask);
513 }
514
515 nb_page->m_image = image;
516
517 return TRUE;
518 }
519
520 void wxNotebook::SetPageSize( const wxSize &WXUNUSED(size) )
521 {
522 wxFAIL_MSG( wxT("wxNotebook::SetPageSize not implemented") );
523 }
524
525 void wxNotebook::SetPadding( const wxSize &WXUNUSED(padding) )
526 {
527 wxFAIL_MSG( wxT("wxNotebook::SetPadding not implemented") );
528 }
529
530 void wxNotebook::SetTabSize(const wxSize& WXUNUSED(sz))
531 {
532 wxFAIL_MSG( wxT("wxNotebook::SetTabSize not implemented") );
533 }
534
535 bool wxNotebook::DeleteAllPages()
536 {
537 wxCHECK_MSG( m_widget != NULL, FALSE, wxT("invalid notebook") );
538
539 while (m_pages.GetCount() > 0)
540 DeletePage( m_pages.GetCount()-1 );
541
542 return TRUE;
543 }
544
545 bool wxNotebook::DeletePage( int page )
546 {
547 wxGtkNotebookPage* nb_page = GetNotebookPage(page);
548 wxCHECK_MSG( nb_page, FALSE, _T("invalid page in wxNotebook::DeletePage") );
549
550 // GTK sets GtkNotebook.cur_page to NULL before sending the switch page
551 // event so we have to store the selection internally
552 if ( m_selection == -1 )
553 {
554 m_selection = GetSelection();
555 if ( m_selection == (int)m_pages.GetCount() - 1 )
556 {
557 // the index will become invalid after the page is deleted
558 m_selection = -1;
559 }
560 }
561
562 nb_page->m_client->Destroy();
563 m_pages.DeleteObject( nb_page );
564
565 return TRUE;
566 }
567
568 wxNotebookPage *wxNotebook::DoRemovePage( int page )
569 {
570 wxGtkNotebookPage* nb_page = GetNotebookPage(page);
571
572 wxCHECK_MSG( nb_page, NULL, _T("wxNotebook::RemovePage: invalid page") );
573
574 gtk_widget_ref( nb_page->m_client->m_widget );
575 gtk_widget_unrealize( nb_page->m_client->m_widget );
576 gtk_widget_unparent( nb_page->m_client->m_widget );
577
578 gtk_notebook_remove_page( GTK_NOTEBOOK(m_widget), page );
579
580 wxNotebookPage *pageRemoved = (wxNotebookPage *)m_pages[page];
581 m_pages.DeleteObject( nb_page );
582
583 return pageRemoved;
584 }
585
586 bool wxNotebook::InsertPage( int position, wxNotebookPage* win, const wxString& text,
587 bool select, int imageId )
588 {
589 wxCHECK_MSG( m_widget != NULL, FALSE, wxT("invalid notebook") );
590
591 wxCHECK_MSG( win->GetParent() == this, FALSE,
592 wxT("Can't add a page whose parent is not the notebook!") );
593
594 /* don't receive switch page during addition */
595 gtk_signal_disconnect_by_func( GTK_OBJECT(m_widget),
596 GTK_SIGNAL_FUNC(gtk_notebook_page_change_callback), (gpointer) this );
597
598 if (m_themeEnabled)
599 win->SetThemeEnabled(TRUE);
600
601 GtkNotebook *notebook = GTK_NOTEBOOK(m_widget);
602
603 wxGtkNotebookPage *page = new wxGtkNotebookPage();
604
605 if (position < 0)
606 m_pages.Append( page );
607 else
608 m_pages.Insert( m_pages.Nth( position ), page );
609
610 page->m_client = win;
611
612 page->m_box = gtk_hbox_new( FALSE, 0 );
613 gtk_container_border_width( GTK_CONTAINER(page->m_box), 2 );
614
615 gtk_signal_connect( GTK_OBJECT(win->m_widget), "size_allocate",
616 GTK_SIGNAL_FUNC(gtk_page_size_callback), (gpointer)win );
617
618 if (position < 0)
619 gtk_notebook_append_page( notebook, win->m_widget, page->m_box );
620 else
621 gtk_notebook_insert_page( notebook, win->m_widget, page->m_box, position );
622
623 page->m_page = (GtkNotebookPage*) g_list_last(notebook->children)->data;
624
625 /* set the label image */
626 page->m_image = imageId;
627
628 if (imageId != -1)
629 {
630 wxASSERT( m_imageList != NULL );
631
632 const wxBitmap *bmp = m_imageList->GetBitmap(imageId);
633 GdkPixmap *pixmap = bmp->GetPixmap();
634 GdkBitmap *mask = (GdkBitmap*) NULL;
635 if ( bmp->GetMask() )
636 {
637 mask = bmp->GetMask()->GetBitmap();
638 }
639
640 GtkWidget *pixmapwid = gtk_pixmap_new (pixmap, mask );
641
642 gtk_box_pack_start(GTK_BOX(page->m_box), pixmapwid, FALSE, FALSE, 3);
643
644 gtk_widget_show(pixmapwid);
645 }
646
647 /* set the label text */
648 page->m_text = text;
649 if (page->m_text.IsEmpty()) page->m_text = wxT("");
650
651 page->m_label = GTK_LABEL( gtk_label_new(page->m_text.mbc_str()) );
652 gtk_box_pack_end( GTK_BOX(page->m_box), GTK_WIDGET(page->m_label), FALSE, FALSE, 3 );
653
654 /* show the label */
655 gtk_widget_show( GTK_WIDGET(page->m_label) );
656
657 if (select && (m_pages.GetCount() > 1))
658 {
659 if (position < 0)
660 SetSelection( GetPageCount()-1 );
661 else
662 SetSelection( position );
663 }
664
665 gtk_signal_connect( GTK_OBJECT(m_widget), "switch_page",
666 GTK_SIGNAL_FUNC(gtk_notebook_page_change_callback), (gpointer)this );
667
668 return TRUE;
669 }
670
671 bool wxNotebook::AddPage(wxNotebookPage* win, const wxString& text,
672 bool select, int imageId)
673 {
674 return InsertPage( -1, win, text, select, imageId );
675 }
676
677 void wxNotebook::OnNavigationKey(wxNavigationKeyEvent& event)
678 {
679 if (event.IsWindowChange())
680 AdvanceSelection( event.GetDirection() );
681 else
682 event.Skip();
683 }
684
685 #if wxUSE_CONSTRAINTS
686
687 // override these 2 functions to do nothing: everything is done in OnSize
688 void wxNotebook::SetConstraintSizes( bool WXUNUSED(recurse) )
689 {
690 // don't set the sizes of the pages - their correct size is not yet known
691 wxControl::SetConstraintSizes(FALSE);
692 }
693
694 bool wxNotebook::DoPhase( int WXUNUSED(nPhase) )
695 {
696 return TRUE;
697 }
698
699 #endif
700
701 void wxNotebook::ApplyWidgetStyle()
702 {
703 // TODO, font for labels etc
704
705 SetWidgetStyle();
706 gtk_widget_set_style( m_widget, m_widgetStyle );
707 }
708
709 bool wxNotebook::IsOwnGtkWindow( GdkWindow *window )
710 {
711 return ((m_widget->window == window) ||
712 (GTK_NOTEBOOK(m_widget)->panel == window));
713 }
714
715 //-----------------------------------------------------------------------------
716 // wxNotebookEvent
717 //-----------------------------------------------------------------------------
718
719 IMPLEMENT_DYNAMIC_CLASS(wxNotebookEvent, wxNotifyEvent)
720
721 #endif