]> git.saurik.com Git - wxWidgets.git/blame - src/msw/notebook.cpp
warnings in wxCHeCK_MSG fixed
[wxWidgets.git] / src / msw / notebook.cpp
CommitLineData
88310e2e
VZ
1///////////////////////////////////////////////////////////////////////////////
2// Name: msw/notebook.cpp
3// Purpose: implementation of wxNotebook
4// Author: Vadim Zeitlin
907f37b3 5// Modified by:
88310e2e
VZ
6// Created: 11.06.98
7// RCS-ID: $Id$
8// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
9// Licence: wxWindows license
10///////////////////////////////////////////////////////////////////////////////
11
88310e2e 12#ifdef __GNUG__
a3b46648 13#pragma implementation "notebook.h"
88310e2e
VZ
14#endif
15
16// For compilers that support precompilation, includes "wx.h".
17#include "wx/wxprec.h"
18
19#ifdef __BORLANDC__
a3b46648 20#pragma hdrstop
88310e2e
VZ
21#endif
22
23// wxWindows
24#ifndef WX_PRECOMP
3096bd2f 25 #include "wx/string.h"
88310e2e
VZ
26#endif // WX_PRECOMP
27
3096bd2f
VZ
28#include "wx/log.h"
29#include "wx/imaglist.h"
30#include "wx/event.h"
31#include "wx/control.h"
32#include "wx/notebook.h"
88310e2e 33
3096bd2f 34#include "wx/msw/private.h"
88310e2e
VZ
35
36// Windows standard headers
37#ifndef __WIN95__
2432b92d 38 #error "wxNotebook is only supported Windows 95 and above"
88310e2e
VZ
39#endif //Win95
40
aaab7c01
VZ
41#include <windowsx.h> // for SetWindowFont
42
57c208c5 43#ifndef __TWIN32__
c42404a5
VZ
44 #ifdef __GNUWIN32_OLD__
45 #include "wx/msw/gnuwin32/extra.h"
46 #endif
65fd5cb0 47#endif
57c208c5 48
c42404a5
VZ
49#if defined(__WIN95__) && !(defined(__GNUWIN32_OLD__) || defined(__TWIN32__))
50 #include <commctrl.h>
88310e2e
VZ
51#endif
52
53// ----------------------------------------------------------------------------
54// macros
55// ----------------------------------------------------------------------------
56
57// check that the page index is valid
58#define IS_VALID_PAGE(nPage) (((nPage) >= 0) && ((nPage) < GetPageCount()))
59
60// hide the ugly cast
61#define m_hwnd (HWND)GetHWND()
62
74b31181
VZ
63// ----------------------------------------------------------------------------
64// constants
65// ----------------------------------------------------------------------------
66
67// This is a work-around for missing defines in gcc-2.95 headers
68#ifndef TCS_RIGHT
69 #define TCS_RIGHT 0x0002
70#endif
71
72#ifndef TCS_VERTICAL
73 #define TCS_VERTICAL 0x0080
74#endif
75
76#ifndef TCS_BOTTOM
77 #define TCS_BOTTOM TCS_RIGHT
78#endif
79
88310e2e
VZ
80// ----------------------------------------------------------------------------
81// event table
82// ----------------------------------------------------------------------------
83
d9317fd4 84BEGIN_EVENT_TABLE(wxNotebook, wxControl)
88310e2e
VZ
85 EVT_NOTEBOOK_PAGE_CHANGED(-1, wxNotebook::OnSelChange)
86
9026ad85 87 EVT_SIZE(wxNotebook::OnSize)
42e69d6b 88
88310e2e 89 EVT_SET_FOCUS(wxNotebook::OnSetFocus)
42e69d6b 90
88310e2e 91 EVT_NAVIGATION_KEY(wxNotebook::OnNavigationKey)
d9317fd4 92END_EVENT_TABLE()
88310e2e 93
d9317fd4
VZ
94IMPLEMENT_DYNAMIC_CLASS(wxNotebook, wxControl)
95IMPLEMENT_DYNAMIC_CLASS(wxNotebookEvent, wxNotifyEvent)
88310e2e
VZ
96
97// ============================================================================
98// implementation
99// ============================================================================
100
101// ----------------------------------------------------------------------------
102// wxNotebook construction
103// ----------------------------------------------------------------------------
104
105// common part of all ctors
106void wxNotebook::Init()
107{
108 m_pImageList = NULL;
109 m_nSelection = -1;
110}
111
112// default for dynamic class
113wxNotebook::wxNotebook()
114{
115 Init();
116}
117
118// the same arguments as for wxControl
119wxNotebook::wxNotebook(wxWindow *parent,
8b9518ee 120 wxWindowID id,
88310e2e
VZ
121 const wxPoint& pos,
122 const wxSize& size,
8b9518ee 123 long style,
88310e2e
VZ
124 const wxString& name)
125{
126 Init();
127
128 Create(parent, id, pos, size, style, name);
129}
130
131// Create() function
132bool wxNotebook::Create(wxWindow *parent,
8b9518ee 133 wxWindowID id,
88310e2e
VZ
134 const wxPoint& pos,
135 const wxSize& size,
8b9518ee 136 long style,
88310e2e
VZ
137 const wxString& name)
138{
139 // base init
8d99be5f
VZ
140 if ( !CreateBase(parent, id, pos, size, style, wxDefaultValidator, name) )
141 return FALSE;
88310e2e
VZ
142
143 // colors and font
144 m_backgroundColour = wxColour(GetSysColor(COLOR_BTNFACE));
4b7f2165 145 m_foregroundColour = *wxBLACK;
88310e2e 146
88310e2e 147 // style
fd2daa68 148 m_windowStyle = style | wxTAB_TRAVERSAL;
88310e2e 149
d13c32e9
JS
150 long tabStyle = WS_CHILD | WS_VISIBLE | WS_TABSTOP | TCS_TABS;
151
152 if (m_windowStyle & wxCLIP_CHILDREN)
153 tabStyle |= WS_CLIPCHILDREN;
88310e2e
VZ
154 if ( m_windowStyle & wxTC_MULTILINE )
155 tabStyle |= TCS_MULTILINE;
156 if ( m_windowStyle & wxBORDER )
157 tabStyle &= WS_BORDER;
58a8ab88
JS
158 if (m_windowStyle & wxNB_FIXEDWIDTH)
159 tabStyle |= TCS_FIXEDWIDTH ;
7a3ac804
RS
160 if (m_windowStyle & wxNB_BOTTOM)
161 tabStyle |= TCS_RIGHT;
162 if (m_windowStyle & wxNB_LEFT)
163 tabStyle |= TCS_VERTICAL;
164 if (m_windowStyle & wxNB_RIGHT)
165 tabStyle |= TCS_VERTICAL|TCS_RIGHT;
0398b1d6 166
88310e2e 167
789295bf
VZ
168 if ( !MSWCreate(GetId(), GetParent(), WC_TABCONTROL,
169 this, NULL, pos.x, pos.y, size.x, size.y,
170 tabStyle, NULL, 0) )
171 {
88310e2e
VZ
172 return FALSE;
173 }
174
27529614 175 // Not all compilers recognise SetWindowFont
789295bf
VZ
176 ::SendMessage(GetHwnd(), WM_SETFONT,
177 (WPARAM)::GetStockObject(DEFAULT_GUI_FONT), TRUE);
27529614 178
aaab7c01 179
907f37b3 180 if ( parent != NULL )
88310e2e 181 parent->AddChild(this);
907f37b3 182
88310e2e
VZ
183 SubclassWin(m_hWnd);
184
185 return TRUE;
186}
187
188// dtor
189wxNotebook::~wxNotebook()
190{
191}
192
193// ----------------------------------------------------------------------------
194// wxNotebook accessors
195// ----------------------------------------------------------------------------
196int wxNotebook::GetPageCount() const
197{
198 // consistency check
199 wxASSERT( (int)m_aPages.Count() == TabCtrl_GetItemCount(m_hwnd) );
200
201 return m_aPages.Count();
202}
203
204int wxNotebook::GetRowCount() const
205{
206 return TabCtrl_GetRowCount(m_hwnd);
207}
208
209int wxNotebook::SetSelection(int nPage)
210{
223d09f6 211 wxCHECK_MSG( IS_VALID_PAGE(nPage), -1, wxT("notebook page out of range") );
88310e2e
VZ
212
213 ChangePage(m_nSelection, nPage);
214
215 return TabCtrl_SetCurSel(m_hwnd, nPage);
216}
217
218void wxNotebook::AdvanceSelection(bool bForward)
219{
220 int nSel = GetSelection();
221 int nMax = GetPageCount() - 1;
222 if ( bForward )
223 SetSelection(nSel == nMax ? 0 : nSel + 1);
224 else
225 SetSelection(nSel == 0 ? nMax : nSel - 1);
226}
227
228bool wxNotebook::SetPageText(int nPage, const wxString& strText)
229{
223d09f6 230 wxCHECK_MSG( IS_VALID_PAGE(nPage), FALSE, wxT("notebook page out of range") );
88310e2e
VZ
231
232 TC_ITEM tcItem;
233 tcItem.mask = TCIF_TEXT;
837e5743 234 tcItem.pszText = (wxChar *)strText.c_str();
88310e2e
VZ
235
236 return TabCtrl_SetItem(m_hwnd, nPage, &tcItem) != 0;
237}
238
239wxString wxNotebook::GetPageText(int nPage) const
240{
223d09f6 241 wxCHECK_MSG( IS_VALID_PAGE(nPage), wxT(""), wxT("notebook page out of range") );
88310e2e 242
837e5743 243 wxChar buf[256];
88310e2e
VZ
244 TC_ITEM tcItem;
245 tcItem.mask = TCIF_TEXT;
246 tcItem.pszText = buf;
247 tcItem.cchTextMax = WXSIZEOF(buf);
248
249 wxString str;
250 if ( TabCtrl_GetItem(m_hwnd, nPage, &tcItem) )
251 str = tcItem.pszText;
252
253 return str;
254}
255
256int wxNotebook::GetPageImage(int nPage) const
257{
223d09f6 258 wxCHECK_MSG( IS_VALID_PAGE(nPage), -1, wxT("notebook page out of range") );
88310e2e
VZ
259
260 TC_ITEM tcItem;
261 tcItem.mask = TCIF_IMAGE;
262
263 return TabCtrl_GetItem(m_hwnd, nPage, &tcItem) ? tcItem.iImage : -1;
264}
265
266bool wxNotebook::SetPageImage(int nPage, int nImage)
267{
223d09f6 268 wxCHECK_MSG( IS_VALID_PAGE(nPage), FALSE, wxT("notebook page out of range") );
88310e2e
VZ
269
270 TC_ITEM tcItem;
271 tcItem.mask = TCIF_IMAGE;
272 tcItem.iImage = nImage;
273
274 return TabCtrl_SetItem(m_hwnd, nPage, &tcItem) != 0;
275}
276
277void wxNotebook::SetImageList(wxImageList* imageList)
907f37b3 278{
88310e2e
VZ
279 m_pImageList = imageList;
280 TabCtrl_SetImageList(m_hwnd, (HIMAGELIST)imageList->GetHIMAGELIST());
281}
282
d9506e77
VZ
283// ----------------------------------------------------------------------------
284// wxNotebook size settings
285// ----------------------------------------------------------------------------
286
287void wxNotebook::SetPageSize(const wxSize& size)
288{
289 // transform the page size into the notebook size
290 RECT rc;
291 rc.left =
292 rc.top = 0;
293 rc.right = size.x;
294 rc.bottom = size.y;
295
296 TabCtrl_AdjustRect(GetHwnd(), TRUE, &rc);
297
298 // and now set it
299 SetSize(rc.right - rc.left, rc.bottom - rc.top);
300}
301
302void wxNotebook::SetPadding(const wxSize& padding)
303{
304 TabCtrl_SetPadding(GetHwnd(), padding.x, padding.y);
305}
42e69d6b
VZ
306
307// Windows-only at present. Also, you must use the wxNB_FIXEDWIDTH
308// style.
309void wxNotebook::SetTabSize(const wxSize& sz)
310{
311 ::SendMessage(GetHwnd(), TCM_SETITEMSIZE, 0, MAKELPARAM(sz.x, sz.y));
312}
313
88310e2e
VZ
314// ----------------------------------------------------------------------------
315// wxNotebook operations
316// ----------------------------------------------------------------------------
317
318// remove one page from the notebook
319bool wxNotebook::DeletePage(int nPage)
320{
223d09f6 321 wxCHECK_MSG( IS_VALID_PAGE(nPage), FALSE, wxT("notebook page out of range") );
88310e2e 322
96d37807
VZ
323 if ( m_nSelection == nPage ) {
324 // advance selection backwards - the page being deleted shouldn't be left
325 // selected
326 AdvanceSelection(FALSE);
327 }
328
88310e2e
VZ
329 TabCtrl_DeleteItem(m_hwnd, nPage);
330
331 delete m_aPages[nPage];
332 m_aPages.Remove(nPage);
333
96d37807
VZ
334 if ( m_aPages.IsEmpty() ) {
335 // no selection if the notebook became empty
336 m_nSelection = -1;
337 }
9b6b5750
JS
338 else
339 m_nSelection = TabCtrl_GetCurSel(m_hwnd);
340
96d37807 341
88310e2e
VZ
342 return TRUE;
343}
344
621793f4
JS
345// remove one page from the notebook, without deleting
346bool wxNotebook::RemovePage(int nPage)
347{
223d09f6 348 wxCHECK_MSG( IS_VALID_PAGE(nPage), FALSE, wxT("notebook page out of range") );
621793f4
JS
349
350 TabCtrl_DeleteItem(m_hwnd, nPage);
351
352 m_aPages.Remove(nPage);
353
47f12f58
JS
354 if ( m_aPages.IsEmpty() )
355 m_nSelection = -1;
9b6b5750
JS
356 else
357 m_nSelection = TabCtrl_GetCurSel(m_hwnd);
47f12f58 358
621793f4
JS
359 return TRUE;
360}
361
88310e2e
VZ
362// remove all pages
363bool wxNotebook::DeleteAllPages()
364{
88310e2e
VZ
365 int nPageCount = GetPageCount();
366 int nPage;
367 for ( nPage = 0; nPage < nPageCount; nPage++ )
368 delete m_aPages[nPage];
369
370 m_aPages.Clear();
371
907f37b3
VZ
372 TabCtrl_DeleteAllItems(m_hwnd);
373
47f12f58
JS
374 m_nSelection = -1;
375
88310e2e
VZ
376 return TRUE;
377}
378
379// add a page to the notebook
380bool wxNotebook::AddPage(wxNotebookPage *pPage,
381 const wxString& strText,
382 bool bSelect,
383 int imageId)
384{
385 return InsertPage(GetPageCount(), pPage, strText, bSelect, imageId);
386}
387
388// same as AddPage() but does it at given position
389bool wxNotebook::InsertPage(int nPage,
390 wxNotebookPage *pPage,
391 const wxString& strText,
392 bool bSelect,
393 int imageId)
394{
395 wxASSERT( pPage != NULL );
396 wxCHECK( IS_VALID_PAGE(nPage) || nPage == GetPageCount(), FALSE );
397
43427087
VZ
398 // do add the tab to the control
399
400 // init all fields to 0
88310e2e 401 TC_ITEM tcItem;
43427087 402 memset(&tcItem, 0, sizeof(tcItem));
58a8ab88 403
43427087 404 if ( imageId != -1 )
58a8ab88
JS
405 {
406 tcItem.mask |= TCIF_IMAGE;
407 tcItem.iImage = imageId;
408 }
58a8ab88 409
43427087 410 if ( !strText.IsEmpty() )
58a8ab88 411 {
43427087
VZ
412 tcItem.mask |= TCIF_TEXT;
413 tcItem.pszText = (wxChar *)strText.c_str(); // const_cast
58a8ab88 414 }
88310e2e
VZ
415
416 if ( TabCtrl_InsertItem(m_hwnd, nPage, &tcItem) == -1 ) {
223d09f6 417 wxLogError(wxT("Can't create the notebook page '%s'."), strText.c_str());
43427087 418
88310e2e
VZ
419 return FALSE;
420 }
421
43427087
VZ
422 // if the inserted page is before the selected one, we must update the
423 // index of the selected page
424 if ( nPage <= m_nSelection )
425 {
426 // one extra page added
427 m_nSelection++;
428 }
429
88310e2e
VZ
430 // save the pointer to the page
431 m_aPages.Insert(pPage, nPage);
432
88310e2e 433 // don't show pages by default (we'll need to adjust their size first)
42e69d6b 434 HWND hwnd = GetWinHwnd(pPage);
88310e2e
VZ
435 SetWindowLong(hwnd, GWL_STYLE, GetWindowLong(hwnd, GWL_STYLE) & ~WS_VISIBLE);
436
42e69d6b
VZ
437 // this updates internal flag too - otherwise it will get out of sync
438 pPage->Show(FALSE);
439
0398b1d6
RD
440 // fit the notebook page to the tab control's display area
441 RECT rc;
442 rc.left = rc.top = 0;
443 GetSize((int *)&rc.right, (int *)&rc.bottom);
444 TabCtrl_AdjustRect(m_hwnd, FALSE, &rc);
445 pPage->SetSize(rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top);
0398b1d6 446
43427087
VZ
447 // some page should be selected: either this one or the first one if there is
448 // still no selection
449 int selNew = -1;
450 if ( bSelect )
451 selNew = nPage;
452 else if ( m_nSelection == -1 )
453 selNew = 0;
454
455 if ( selNew != -1 )
456 SetSelection(selNew);
96d37807 457
88310e2e
VZ
458 return TRUE;
459}
460
461// ----------------------------------------------------------------------------
462// wxNotebook callbacks
463// ----------------------------------------------------------------------------
464
9026ad85 465void wxNotebook::OnSize(wxSizeEvent& event)
88310e2e 466{
b5c3b538
VZ
467 // fit the notebook page to the tab control's display area
468 RECT rc;
469 rc.left = rc.top = 0;
470 GetSize((int *)&rc.right, (int *)&rc.bottom);
471
472 TabCtrl_AdjustRect(m_hwnd, FALSE, &rc);
4b7f2165
VZ
473
474 int width = rc.right - rc.left,
475 height = rc.bottom - rc.top;
c86f1403
VZ
476 size_t nCount = m_aPages.Count();
477 for ( size_t nPage = 0; nPage < nCount; nPage++ ) {
b5c3b538 478 wxNotebookPage *pPage = m_aPages[nPage];
4b7f2165 479 pPage->SetSize(rc.left, rc.top, width, height);
b5c3b538
VZ
480 }
481
88310e2e
VZ
482 event.Skip();
483}
484
485void wxNotebook::OnSelChange(wxNotebookEvent& event)
486{
487 // is it our tab control?
488 if ( event.GetEventObject() == this )
5d1d2d46 489 {
5d1d2d46
VZ
490 int sel = event.GetOldSelection();
491 if ( sel != -1 )
492 m_aPages[sel]->Show(FALSE);
0398b1d6 493
5d1d2d46
VZ
494 sel = event.GetSelection();
495 if ( sel != -1 )
496 {
497 wxNotebookPage *pPage = m_aPages[sel];
498 pPage->Show(TRUE);
499 pPage->SetFocus();
500 }
0398b1d6 501
5d1d2d46
VZ
502 m_nSelection = sel;
503 }
88310e2e
VZ
504
505 // we want to give others a chance to process this message as well
506 event.Skip();
507}
508
509void wxNotebook::OnSetFocus(wxFocusEvent& event)
510{
d9506e77
VZ
511 // this function is only called when the focus is explicitly set (i.e. from
512 // the program) to the notebook - in this case we don't need the
513 // complicated OnNavigationKey() logic because the programmer knows better
514 // what [s]he wants
88310e2e 515
d9506e77
VZ
516 // set focus to the currently selected page if any
517 if ( m_nSelection != -1 )
518 m_aPages[m_nSelection]->SetFocus();
519
520 event.Skip();
88310e2e
VZ
521}
522
523void wxNotebook::OnNavigationKey(wxNavigationKeyEvent& event)
524{
d9506e77
VZ
525 if ( event.IsWindowChange() ) {
526 // change pages
527 AdvanceSelection(event.GetDirection());
528 }
529 else {
530 // we get this event in 2 cases
531 //
532 // a) one of our pages might have generated it because the user TABbed
533 // out from it in which case we should propagate the event upwards and
534 // our parent will take care of setting the focus to prev/next sibling
535 //
536 // or
537 //
538 // b) the parent panel wants to give the focus to us so that we
539 // forward it to our selected page. We can't deal with this in
540 // OnSetFocus() because we don't know which direction the focus came
541 // from in this case and so can't choose between setting the focus to
542 // first or last panel child
543
544 wxWindow *parent = GetParent();
545 if ( event.GetEventObject() == parent )
546 {
547 // no, it doesn't come from child, case (b): forward to a page
548 if ( m_nSelection != -1 )
549 {
550 // so that the page knows that the event comes from it's parent
551 // and is being propagated downwards
552 event.SetEventObject(this);
553
554 wxWindow *page = m_aPages[m_nSelection];
555 if ( !page->GetEventHandler()->ProcessEvent(event) )
556 {
557 page->SetFocus();
558 }
559 //else: page manages focus inside it itself
560 }
561 else
562 {
563 // we have no pages - still have to give focus to _something_
564 SetFocus();
565 }
566 }
567 else
568 {
569 // it comes from our child, case (a), pass to the parent
570 if ( parent ) {
571 event.SetCurrentFocus(this);
572 parent->GetEventHandler()->ProcessEvent(event);
573 }
574 }
88310e2e 575 }
88310e2e
VZ
576}
577
578// ----------------------------------------------------------------------------
579// wxNotebook base class virtuals
580// ----------------------------------------------------------------------------
b5c3b538
VZ
581
582// override these 2 functions to do nothing: everything is done in OnSize
583
4b7f2165 584void wxNotebook::SetConstraintSizes(bool WXUNUSED(recurse))
b5c3b538
VZ
585{
586 // don't set the sizes of the pages - their correct size is not yet known
587 wxControl::SetConstraintSizes(FALSE);
588}
589
4b7f2165 590bool wxNotebook::DoPhase(int WXUNUSED(nPhase))
b5c3b538
VZ
591{
592 return TRUE;
593}
594
a23fd0e1 595bool wxNotebook::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM* result)
88310e2e 596{
93a19f17 597 wxNotebookEvent event(wxEVT_NULL, m_windowId);
88310e2e
VZ
598
599 NMHDR* hdr = (NMHDR *)lParam;
600 switch ( hdr->code ) {
601 case TCN_SELCHANGE:
602 event.SetEventType(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED);
603 break;
604
605 case TCN_SELCHANGING:
606 event.SetEventType(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING);
607 break;
608
fd3f686c 609 default:
a23fd0e1 610 return wxControl::MSWOnNotify(idCtrl, lParam, result);
88310e2e
VZ
611 }
612
93a19f17
VZ
613 event.SetSelection(TabCtrl_GetCurSel(m_hwnd));
614 event.SetOldSelection(m_nSelection);
88310e2e 615 event.SetEventObject(this);
a23fd0e1 616 event.SetInt(idCtrl);
88310e2e 617
fd3f686c
VZ
618 bool processed = GetEventHandler()->ProcessEvent(event);
619 *result = !event.IsAllowed();
620 return processed;
88310e2e
VZ
621}
622
623// ----------------------------------------------------------------------------
624// wxNotebook helper functions
625// ----------------------------------------------------------------------------
626
43427087
VZ
627// generate the page changing and changed events, hide the currently active
628// panel and show the new one
88310e2e
VZ
629void wxNotebook::ChangePage(int nOldSel, int nSel)
630{
fd3f686c
VZ
631 // MT-FIXME should use a real semaphore
632 static bool s_bInsideChangePage = FALSE;
633
634 // when we call ProcessEvent(), our own OnSelChange() is called which calls
635 // this function - break the infinite loop
636 if ( s_bInsideChangePage )
637 return;
638
aaab7c01
VZ
639 // it's not an error (the message may be generated by the tab control itself)
640 // and it may happen - just do nothing
641 if ( nSel == nOldSel )
642 return;
88310e2e 643
fd3f686c
VZ
644 s_bInsideChangePage = TRUE;
645
646 wxNotebookEvent event(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, m_windowId);
647 event.SetSelection(nSel);
648 event.SetOldSelection(nOldSel);
649 event.SetEventObject(this);
650 if ( ProcessEvent(event) && !event.IsAllowed() )
651 {
652 // program doesn't allow the page change
653 s_bInsideChangePage = FALSE;
654 return;
655 }
656
fd3f686c
VZ
657 event.SetEventType(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED);
658 ProcessEvent(event);
659
fd3f686c 660 s_bInsideChangePage = FALSE;
88310e2e 661}