- WidgetsPage *page = (*info->GetCtor())(m_book, m_imaglist);
- pages.Add(page);
-
- labels.Add(info->GetLabel());
- menuPages->AppendRadioItem
- (
- Widgets_GoToPage + nPage,
- wxString::Format(wxT("%s\tF%u"),
- info->GetLabel().c_str(), nPage + 1)
- );
+#if USE_TREEBOOK
+ nPage++; // increase for parent page
+#else
+ books[cat] = new WidgetsBookCtrl(m_book,
+ wxID_ANY,
+ wxDefaultPosition,
+ wxDefaultSize,
+ WidgetBookStyle);
+#endif
+
+ for ( WidgetsPageInfo *info = WidgetsPage::ms_widgetPages;
+ info;
+ info = info->GetNext() )
+ {
+ if( (info->GetCategories() & ( 1 << cat )) == 0)
+ continue;
+
+ WidgetsPage *page = (*info->GetCtor())(
+#if USE_TREEBOOK
+ m_book
+#else
+ books[cat]
+#endif
+ , imageList);
+ pages[cat].Add(page);
+
+ labels[cat].Add(info->GetLabel());
+ if ( cat == ALL_PAGE )
+ {
+ wxString radioLabel(info->GetLabel());
+ nFKey++;
+ if ( nFKey <= 12 )
+ {
+ radioLabel << wxT("\tF" ) << nFKey;
+ }
+
+ menuPages->AppendRadioItem(
+ Widgets_GoToPage + nPage,
+ radioLabel
+ );
+#if !USE_TREEBOOK
+ // consider only for book in book architecture
+ nPage++;
+#endif
+ }
+
+#if USE_TREEBOOK
+ // consider only for treebook architecture (with subpages)
+ nPage++;
+#endif
+ }