// part is control class-specific
#if wxUSE_NOTEBOOK
#define CASE_NOTEBOOK(x) case Type_Notebook: x; break;
- #define FLAG_NOTEBOOK(x) wxNB_##x
#else
#define CASE_NOTEBOOK(x)
- #define FLAG_NOTEBOOK(x) 0
#endif
#if wxUSE_LISTBOOK
#define CASE_LISTBOOK(x) case Type_Listbook: x; break;
- #define FLAG_LISTBOOK(x) wxLB_##x
#else
#define CASE_LISTBOOK(x)
- #define FLAG_LISTBOOK(x) 0
#endif
#if wxUSE_CHOICEBOOK
#define CASE_CHOICEBOOK(x) case Type_Choicebook: x; break;
- #define FLAG_CHOICEBOOK(x) wxCHB_##x
#else
#define CASE_CHOICEBOOK(x)
- #define FLAG_CHOICEBOOK(x) 0
#endif
#if wxUSE_TREEBOOK
#define CASE_TREEBOOK(x) case Type_Treebook: x; break;
- #define FLAG_TREEBOOK(x) wxTBK_##x
#else
#define CASE_TREEBOOK(x)
- #define FLAG_TREEBOOK(x) 0
#endif
#define DISPATCH_ON_TYPE(before, nb, lb, cb, tb, after) \
void MyFrame::RecreateBook()
{
-#define SELECT_FLAG(f) \
- TranslateBookFlag(FLAG_NOTEBOOK(f), FLAG_LISTBOOK(f), FLAG_CHOICEBOOK(f), FLAG_TREEBOOK(f))
-
int flags;
switch ( m_orient )
{
case ID_ORIENT_TOP:
- flags = SELECT_FLAG(TOP);
+ flags = wxBK_TOP;
break;
case ID_ORIENT_BOTTOM:
- flags = SELECT_FLAG(BOTTOM);
+ flags = wxBK_BOTTOM;
break;
case ID_ORIENT_LEFT:
- flags = SELECT_FLAG(LEFT);
+ flags = wxBK_LEFT;
break;
case ID_ORIENT_RIGHT:
- flags = SELECT_FLAG(RIGHT);
+ flags = wxBK_RIGHT;
break;
default:
- flags = SELECT_FLAG(DEFAULT);
+ flags = wxBK_DEFAULT;
}
-#undef SELECT_FLAG
-
if ( m_multi && m_type == Type_Notebook )
flags |= wxNB_MULTILINE;
flags |= wxDOUBLE_BORDER;
m_text->SetInsertionPointEnd();
#endif
}
-
// fall through
case Orient_Top:
- flags = wxNB_TOP;
+ flags = wxBK_TOP;
break;
case Orient_Bottom:
- flags = wxNB_BOTTOM;
+ flags = wxBK_BOTTOM;
break;
case Orient_Left:
- flags = wxNB_LEFT;
+ flags = wxBK_LEFT;
break;
case Orient_Right:
- flags = wxNB_RIGHT;
+ flags = wxBK_RIGHT;
break;
}
void NotebookWidgetsPage::OnUpdateUIResetButton(wxUpdateUIEvent& event)
{
event.Enable( !m_chkImages->GetValue() ||
- m_radioOrient->GetSelection() != wxNB_TOP );
+ m_radioOrient->GetSelection() != wxBK_TOP );
}
void NotebookWidgetsPage::OnUpdateUINumPagesText(wxUpdateUIEvent& event)
/////////////////////////////////////////////////////////////////////////////
// Program: wxWidgets Widgets Sample
-// Name: widgets.cpp
+// Name: samples/widgets/widgets.cpp
// Purpose: Sample showing most of the simple wxWidgets widgets
// Author: Vadim Zeitlin
// Created: 27.03.01
// we have 2 panes: book with pages demonstrating the controls in the
// upper one and the log window with some buttons in the lower
- int style = wxNO_FULL_REPAINT_ON_RESIZE|wxCLIP_CHILDREN|wxBC_DEFAULT;
+ int style = wxNO_FULL_REPAINT_ON_RESIZE|wxCLIP_CHILDREN|wxBK_DEFAULT;
// Uncomment to suppress page theme (draw in solid colour)
//style |= wxNB_NOPAGETHEME;
m_book = new wxBookCtrl(m_panel, wxID_ANY, wxDefaultPosition,
#ifdef __WXMOTIF__
- wxSize(500, -1), // under Motif, height is a function of the width...
+ wxSize(500, wxDefaultCoord), // under Motif, height is a function of the width...
#else
wxDefaultSize,
#endif
return checkbox;
}
-
///////////////////////////////////////////////////////////////////////////////
-// Name: common/bookctrl.cpp
+// Name: src/common/bookctrl.cpp
// Purpose: wxBookCtrlBase implementation
// Author: Vadim Zeitlin
// Modified by:
// implementation
// ============================================================================
+// ----------------------------------------------------------------------------
+// event table
+// ----------------------------------------------------------------------------
+
+IMPLEMENT_ABSTRACT_CLASS(wxBookCtrlBase, wxControl)
+
+BEGIN_EVENT_TABLE(wxBookCtrlBase, wxControl)
+ EVT_SIZE(wxBookCtrlBase::OnSize)
+END_EVENT_TABLE()
+
// ----------------------------------------------------------------------------
// constructors and destructors
// ----------------------------------------------------------------------------
void wxBookCtrlBase::Init()
{
+ m_bookctrl = NULL;
m_imageList = NULL;
m_ownsImageList = false;
bool WXUNUSED(bSelect),
int WXUNUSED(imageId))
{
- wxCHECK_MSG( page || AllowNullPage(), false, _T("NULL page in wxBookCtrlBase::InsertPage()") );
+ wxCHECK_MSG( page || AllowNullPage(), false,
+ _T("NULL page in wxBookCtrlBase::InsertPage()") );
wxCHECK_MSG( nPage <= m_pages.size(), false,
_T("invalid page index in wxBookCtrlBase::InsertPage()") );
return nPage;
}
+wxRect wxBookCtrlBase::GetPageRect() const
+{
+ const wxSize size = GetControllerSize();
+
+ wxPoint pt;
+ wxRect rectPage(pt, GetClientSize());
+ switch ( GetWindowStyle() & wxBK_ALIGN_MASK )
+ {
+ default:
+ wxFAIL_MSG( _T("unexpected alignment") );
+ // fall through
+
+ case wxBK_TOP:
+ rectPage.y = size.y + GetInternalBorder();
+ // fall through
+
+ case wxBK_BOTTOM:
+ rectPage.height -= size.y + GetInternalBorder();
+ break;
+
+ case wxBK_LEFT:
+ rectPage.x = size.x + GetInternalBorder();
+ // fall through
+
+ case wxBK_RIGHT:
+ rectPage.width -= size.x + GetInternalBorder();
+ break;
+ }
+
+ return rectPage;
+}
+
+void wxBookCtrlBase::OnSize(wxSizeEvent& event)
+{
+ event.Skip();
+
+ if ( !m_bookctrl )
+ {
+ // we're not fully created yet or OnSize() should be hidden by derived class
+ return;
+ }
+
+ // resize controller and the page area to fit inside our new size
+ const wxSize sizeClient( GetClientSize() ),
+ sizeBorder( m_bookctrl->GetSize() - m_bookctrl->GetClientSize() ),
+ sizeCtrl( GetControllerSize() );
+
+ m_bookctrl->SetClientSize( sizeCtrl.x - sizeBorder.x, sizeCtrl.y - sizeBorder.y );
+
+ const wxSize sizeNew = m_bookctrl->GetSize();
+ wxPoint posCtrl;
+ switch ( GetWindowStyle() & wxBK_ALIGN_MASK )
+ {
+ default:
+ wxFAIL_MSG( _T("unexpected alignment") );
+ // fall through
+
+ case wxBK_TOP:
+ case wxBK_LEFT:
+ // posCtrl is already ok
+ break;
+
+ case wxBK_BOTTOM:
+ posCtrl.y = sizeClient.y - sizeNew.y;
+ break;
+
+ case wxBK_RIGHT:
+ posCtrl.x = sizeClient.x - sizeNew.x;
+ break;
+ }
+
+ if ( m_bookctrl->GetPosition() != posCtrl )
+ m_bookctrl->Move(posCtrl);
+
+ // resize the currently shown page
+ if (GetSelection() != wxNOT_FOUND )
+ {
+ wxWindow *page = m_pages[GetSelection()];
+ wxCHECK_RET( page, _T("NULL page?") );
+ page->SetSize(GetPageRect());
+ }
+}
+
+wxSize wxBookCtrlBase::GetControllerSize() const
+{
+ if(!m_bookctrl)
+ return wxSize(0,0);
+
+ const wxSize sizeClient = GetClientSize(),
+ sizeBorder = m_bookctrl->GetSize() - m_bookctrl->GetClientSize(),
+ sizeCtrl = m_bookctrl->GetBestSize() + sizeBorder;
+
+ wxSize size;
+
+ if ( IsVertical() )
+ {
+ size.x = sizeClient.x;
+ size.y = sizeCtrl.y;
+ }
+ else // left/right aligned
+ {
+ size.x = sizeCtrl.x;
+ size.y = sizeClient.y;
+ }
+
+ return size;
+}
+
#endif // wxUSE_BOOKCTRL
// default because not all ports implement this
wxSize sizeTotal = sizePage;
- if ( HasFlag(wxNB_LEFT) || HasFlag(wxNB_RIGHT) )
+ if ( HasFlag(wxBK_LEFT) || HasFlag(wxBK_RIGHT) )
{
sizeTotal.x += 90;
sizeTotal.y += 10;
}
#endif // wxUSE_NOTEBOOK
-
///////////////////////////////////////////////////////////////////////////////
-// Name: generic/choicbkg.cpp
+// Name: src/generic/choicbkg.cpp
// Purpose: generic implementation of wxChoicebook
// Author: Vadim Zeitlin
// Modified by: Wlodzimierz ABX Skiba from generic/listbkg.cpp
// event table
// ----------------------------------------------------------------------------
-IMPLEMENT_DYNAMIC_CLASS(wxChoicebook, wxControl)
+IMPLEMENT_DYNAMIC_CLASS(wxChoicebook, wxBookCtrlBase)
IMPLEMENT_DYNAMIC_CLASS(wxChoicebookEvent, wxNotifyEvent)
const wxEventType wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGING = wxNewEventType();
const int wxID_CHOICEBOOKCHOICE = wxNewId();
BEGIN_EVENT_TABLE(wxChoicebook, wxBookCtrlBase)
- EVT_SIZE(wxChoicebook::OnSize)
EVT_CHOICE(wxID_CHOICEBOOKCHOICE, wxChoicebook::OnChoiceSelected)
END_EVENT_TABLE()
void wxChoicebook::Init()
{
- m_choice = NULL;
m_selection = wxNOT_FOUND;
}
long style,
const wxString& name)
{
- if ( (style & wxCHB_ALIGN_MASK) == wxCHB_DEFAULT )
+ if ( (style & wxBK_ALIGN_MASK) == wxBK_DEFAULT )
{
- style |= wxCHB_TOP;
+ style |= wxBK_TOP;
}
// no border for this control, it doesn't look nice together with
wxDefaultValidator, name) )
return false;
- m_choice = new wxChoice
+ m_bookctrl = new wxChoice
(
this,
wxID_CHOICEBOOKCHOICE,
// wxChoicebook geometry management
// ----------------------------------------------------------------------------
-wxSize wxChoicebook::GetChoiceSize() const
+wxSize wxChoicebook::GetControllerSize() const
{
const wxSize sizeClient = GetClientSize(),
- sizeChoice = m_choice->GetBestFittingSize();
+ sizeChoice = m_bookctrl->GetBestFittingSize();
wxSize size;
if ( IsVertical() )
return size;
}
-wxRect wxChoicebook::GetPageRect() const
-{
- const wxSize sizeChoice = m_choice->GetBestFittingSize();
-
- wxPoint pt;
- wxRect rectPage(pt, GetClientSize());
- switch ( GetWindowStyle() & wxCHB_ALIGN_MASK )
- {
- default:
- wxFAIL_MSG( _T("unexpected wxChoicebook alignment") );
- // fall through
-
- case wxCHB_TOP:
- rectPage.y = sizeChoice.y + GetInternalBorder();
- // fall through
-
- case wxCHB_BOTTOM:
- rectPage.height -= sizeChoice.y + GetInternalBorder();
- break;
-
- case wxCHB_LEFT:
- rectPage.x = sizeChoice.x + GetInternalBorder();
- // fall through
-
- case wxCHB_RIGHT:
- rectPage.width -= sizeChoice.x + GetInternalBorder();
- break;
- }
-
- return rectPage;
-}
-
-void wxChoicebook::OnSize(wxSizeEvent& event)
-{
- event.Skip();
-
- if ( !m_choice )
- {
- // we're not fully created yet
- return;
- }
-
- // resize the choice control and the page area to fit inside our new size
- const wxSize sizeClient = GetClientSize(),
- sizeChoice = GetChoiceSize();
-
- wxPoint posChoice;
- switch ( GetWindowStyle() & wxCHB_ALIGN_MASK )
- {
- default:
- wxFAIL_MSG( _T("unexpected wxChoicebook alignment") );
- // fall through
-
- case wxCHB_TOP:
- case wxCHB_LEFT:
- // posChoice is already ok
- break;
-
- case wxCHB_BOTTOM:
- posChoice.y = sizeClient.y - sizeChoice.y;
- break;
-
- case wxCHB_RIGHT:
- posChoice.x = sizeClient.x - sizeChoice.x;
- break;
- }
-
- m_choice->Move(posChoice);
- m_choice->SetSize(sizeChoice);
-
- // resize the currently shown page
- if ( m_selection != wxNOT_FOUND )
- {
- wxWindow *page = m_pages[m_selection];
- wxCHECK_RET( page, _T("NULL page in wxChoicebook?") );
- page->SetSize(GetPageRect());
- }
-}
-
wxSize wxChoicebook::CalcSizeFromPage(const wxSize& sizePage) const
{
// we need to add the size of the choice control and the border between
- const wxSize sizeChoice = GetChoiceSize();
+ const wxSize sizeChoice = GetControllerSize();
wxSize size = sizePage;
if ( IsVertical() )
bool wxChoicebook::SetPageText(size_t n, const wxString& strText)
{
- m_choice->SetString(n, strText);
+ GetChoiceCtrl()->SetString(n, strText);
return true;
}
wxString wxChoicebook::GetPageText(size_t n) const
{
- return m_choice->GetString(n);
+ return GetChoiceCtrl()->GetString(n);
}
int wxChoicebook::GetPageImage(size_t WXUNUSED(n)) const
// change m_selection now to ignore the selection change event
m_selection = n;
- m_choice->Select(n);
+ GetChoiceCtrl()->Select(n);
// program allows the page change
event.SetEventType(wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGED);
if ( !wxBookCtrlBase::InsertPage(n, page, text, bSelect, imageId) )
return false;
- m_choice->Insert(text, n);
+ GetChoiceCtrl()->Insert(text, n);
// if the inserted page is before the selected one, we must update the
// index of the selected page
{
// one extra page added
m_selection++;
- m_choice->Select(m_selection);
+ GetChoiceCtrl()->Select(m_selection);
}
// some page should be selected: either this one or the first one if there
if ( win )
{
- m_choice->Delete(page);
+ GetChoiceCtrl()->Delete(page);
if (m_selection >= (int)page)
{
bool wxChoicebook::DeleteAllPages()
{
- m_choice->Clear();
+ GetChoiceCtrl()->Clear();
return wxBookCtrlBase::DeleteAllPages();
}
// change wasn't allowed, return to previous state
if (m_selection != selNew)
- m_choice->Select(m_selection);
+ GetChoiceCtrl()->Select(m_selection);
}
#endif // wxUSE_CHOICEBOOK
///////////////////////////////////////////////////////////////////////////////
-// Name: generic/listbkg.cpp
+// Name: src/generic/listbkg.cpp
// Purpose: generic implementation of wxListbook
// Author: Vadim Zeitlin
// Modified by:
// event table
// ----------------------------------------------------------------------------
-IMPLEMENT_DYNAMIC_CLASS(wxListbook, wxControl)
+IMPLEMENT_DYNAMIC_CLASS(wxListbook, wxBookCtrlBase)
IMPLEMENT_DYNAMIC_CLASS(wxListbookEvent, wxNotifyEvent)
const wxEventType wxEVT_COMMAND_LISTBOOK_PAGE_CHANGING = wxNewEventType();
void wxListbook::Init()
{
- m_list = NULL;
-#if wxUSE_LINE_IN_LISTBOOK
- m_line = NULL;
-#endif // wxUSE_LINE_IN_LISTBOOK
m_selection = wxNOT_FOUND;
}
long style,
const wxString& name)
{
- if ( (style & wxLB_ALIGN_MASK) == wxLB_DEFAULT )
+ if ( (style & wxBK_ALIGN_MASK) == wxBK_DEFAULT )
{
#ifdef __WXMAC__
- style |= wxLB_TOP;
+ style |= wxBK_TOP;
#else // !__WXMAC__
- style |= wxLB_LEFT;
+ style |= wxBK_LEFT;
#endif // __WXMAC__/!__WXMAC__
}
wxDefaultValidator, name) )
return false;
- m_list = new wxListView
+ m_bookctrl = new wxListView
(
this,
wxID_LISTBOOKLISTVIEW,
(IsVertical() ? wxLC_ALIGN_LEFT : wxLC_ALIGN_TOP)
);
-#if wxUSE_LINE_IN_LISTBOOK
- m_line = new wxStaticLine
- (
- this,
- wxID_ANY,
- wxDefaultPosition,
- wxDefaultSize,
- IsVertical() ? wxLI_HORIZONTAL : wxLI_VERTICAL
- );
-#endif // wxUSE_LINE_IN_LISTBOOK
-
#ifdef __WXMSW__
- // On XP with themes enabled the GetViewRect used in GetListSize to
+ // On XP with themes enabled the GetViewRect used in GetControllerSize() to
// determine the space needed for the list view will incorrectly return
// (0,0,0,0) the first time. So send a pending event so OnSize will be
// called again after the window is ready to go. Technically we don't
// wxListbook geometry management
// ----------------------------------------------------------------------------
-wxSize wxListbook::GetListSize() const
+wxSize wxListbook::GetControllerSize() const
{
const wxSize sizeClient = GetClientSize(),
- sizeBorder = m_list->GetSize() - m_list->GetClientSize(),
- sizeList = m_list->GetViewRect().GetSize() + sizeBorder;
+ sizeBorder = m_bookctrl->GetSize() - m_bookctrl->GetClientSize(),
+ sizeList = GetListView()->GetViewRect().GetSize() + sizeBorder;
wxSize size;
+
if ( IsVertical() )
{
size.x = sizeClient.x;
return size;
}
-wxRect wxListbook::GetPageRect() const
-{
- const wxSize sizeList = m_list->GetSize();
-
- wxPoint pt;
- wxRect rectPage(pt, GetClientSize());
- switch ( GetWindowStyle() & wxLB_ALIGN_MASK )
- {
- default:
- wxFAIL_MSG( _T("unexpected wxListbook alignment") );
- // fall through
-
- case wxLB_TOP:
- rectPage.y = sizeList.y + GetInternalBorder();
- // fall through
-
- case wxLB_BOTTOM:
- rectPage.height -= sizeList.y + GetInternalBorder();
- break;
-
- case wxLB_LEFT:
- rectPage.x = sizeList.x + GetInternalBorder();
- // fall through
-
- case wxLB_RIGHT:
- rectPage.width -= sizeList.x + GetInternalBorder();
- break;
- }
-
- return rectPage;
-}
-
void wxListbook::OnSize(wxSizeEvent& event)
{
- event.Skip();
-
- if ( !m_list )
- {
- // we're not fully created yet
- return;
- }
-
// arrange the icons before calling SetClientSize(), otherwise it wouldn't
// account for the scrollbars the list control might need and, at least
// under MSW, we'd finish with an ugly looking list control with both
// vertical and horizontal scrollbar (with one of them being added because
// the other one is not accounted for in client size computations)
- m_list->Arrange();
-
- // resize the list control and the page area to fit inside our new size
- const wxSize sizeClient = GetClientSize(),
- sizeBorder = m_list->GetSize() - m_list->GetClientSize(),
- sizeList = GetListSize();
-
- m_list->SetClientSize( sizeList.x - sizeBorder.x, sizeList.y - sizeBorder.y );
-
- const wxSize sizeNew = m_list->GetSize();
- wxPoint posList;
- switch ( GetWindowStyle() & wxLB_ALIGN_MASK )
- {
- default:
- wxFAIL_MSG( _T("unexpected wxListbook alignment") );
- // fall through
-
- case wxLB_TOP:
- case wxLB_LEFT:
- // posList is already ok
- break;
-
- case wxLB_BOTTOM:
- posList.y = sizeClient.y - sizeNew.y;
- break;
-
- case wxLB_RIGHT:
- posList.x = sizeClient.x - sizeNew.x;
- break;
- }
-
- if ( m_list->GetPosition() != posList )
- m_list->Move(posList);
-
-#if wxUSE_LINE_IN_LISTBOOK
- if ( m_line )
- {
- wxRect rectLine(sizeClient);
-
- switch ( GetWindowStyle() & wxLB_ALIGN_MASK )
- {
- case wxLB_TOP:
- rectLine.y = sizeNew.y + 1;
- rectLine.height = GetInternalBorder() - 2;
- break;
-
- case wxLB_BOTTOM:
- rectLine.height = GetInternalBorder() - 2;
- rectLine.y = sizeClient.y - sizeNew.y - rectLine.height;
- break;
-
- case wxLB_LEFT:
- rectLine.x = sizeNew.x + 1;
- rectLine.width = GetInternalBorder() - 2;
- break;
-
- case wxLB_RIGHT:
- rectLine.width = GetInternalBorder() - 2;
- rectLine.x = sizeClient.x - sizeNew.x - rectLine.width;
- break;
- }
-
- m_line->SetSize(rectLine);
- }
-#endif // wxUSE_LINE_IN_LISTBOOK
-
- // resize the currently shown page
- if (m_selection != wxNOT_FOUND )
- {
- wxWindow *page = m_pages[m_selection];
- wxCHECK_RET( page, _T("NULL page in wxListbook?") );
- page->SetSize(GetPageRect());
- }
+ wxListView *list = GetListView();
+ if (list) list->Arrange();
+ wxBookCtrlBase::OnSize(event);
}
wxSize wxListbook::CalcSizeFromPage(const wxSize& sizePage) const
{
// we need to add the size of the list control and the border between
- const wxSize sizeList = GetListSize();
+ const wxSize sizeList = GetControllerSize();
wxSize size = sizePage;
if ( IsVertical() )
bool wxListbook::SetPageText(size_t n, const wxString& strText)
{
- m_list->SetItemText(n, strText);
+ GetListView()->SetItemText(n, strText);
return true;
}
wxString wxListbook::GetPageText(size_t n) const
{
- return m_list->GetItemText(n);
+ return GetListView()->GetItemText(n);
}
int wxListbook::GetPageImage(size_t WXUNUSED(n)) const
bool wxListbook::SetPageImage(size_t n, int imageId)
{
- return m_list->SetItemImage(n, imageId);
+ return GetListView()->SetItemImage(n, imageId);
}
// ----------------------------------------------------------------------------
void wxListbook::SetImageList(wxImageList *imageList)
{
- m_list->SetImageList(imageList, wxIMAGE_LIST_NORMAL);
+ GetListView()->SetImageList(imageList, wxIMAGE_LIST_NORMAL);
wxBookCtrlBase::SetImageList(imageList);
}
// change m_selection now to ignore the selection change event
m_selection = n;
- m_list->Select(n);
- m_list->Focus(n);
+ GetListView()->Select(n);
+ GetListView()->Focus(n);
// program allows the page change
event.SetEventType(wxEVT_COMMAND_LISTBOOK_PAGE_CHANGED);
if ( !wxBookCtrlBase::InsertPage(n, page, text, bSelect, imageId) )
return false;
- m_list->InsertItem(n, text, imageId);
+ GetListView()->InsertItem(n, text, imageId);
// if the inserted page is before the selected one, we must update the
// index of the selected page
{
// one extra page added
m_selection++;
- m_list->Select(m_selection);
- m_list->Focus(m_selection);
+ GetListView()->Select(m_selection);
+ GetListView()->Focus(m_selection);
}
// some page should be selected: either this one or the first one if there
SetSelection(selNew);
InvalidateBestSize();
- m_list->Arrange();
+ GetListView()->Arrange();
return true;
}
if ( win )
{
- m_list->DeleteItem(page);
+ GetListView()->DeleteItem(page);
if (m_selection >= (int)page)
{
SetSelection(sel);
}
- m_list->Arrange();
+ GetListView()->Arrange();
}
return win;
bool wxListbook::DeleteAllPages()
{
- m_list->DeleteAllItems();
+ GetListView()->DeleteAllItems();
return wxBookCtrlBase::DeleteAllPages();
}
// change wasn't allowed, return to previous state
if (m_selection != selNew)
{
- m_list->Select(m_selection);
- m_list->Focus(m_selection);
+ GetListView()->Select(m_selection);
+ GetListView()->Focus(m_selection);
}
}
/////////////////////////////////////////////////////////////////////////////
-// Name: propdlg.cpp
+// Name: src/generic/propdlg.cpp
// Purpose: wxPropertySheetDialog
// Author: Julian Smart
// Modified by:
{
int style = wxCLIP_CHILDREN;
#if defined(__POCKETPC__) && wxUSE_NOTEBOOK
- style |= wxNB_BOTTOM|wxNB_FLAT;
+ style |= wxBK_BOTTOM|wxNB_FLAT;
#else
- style |= wxBC_DEFAULT;
+ style |= wxBK_DEFAULT;
#endif
return new wxBookCtrl(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, style );
}
// event table
// ----------------------------------------------------------------------------
-IMPLEMENT_DYNAMIC_CLASS(wxTreebook, wxControl)
+IMPLEMENT_DYNAMIC_CLASS(wxTreebook, wxBookCtrlBase)
IMPLEMENT_DYNAMIC_CLASS(wxTreebookEvent, wxNotifyEvent)
const wxEventType wxEVT_COMMAND_TREEBOOK_PAGE_CHANGING = wxNewEventType();
const int wxID_TREEBOOKTREEVIEW = wxNewId();
BEGIN_EVENT_TABLE(wxTreebook, wxBookCtrlBase)
- EVT_SIZE(wxTreebook::OnSize)
EVT_TREE_SEL_CHANGED (wxID_TREEBOOKTREEVIEW, wxTreebook::OnTreeSelectionChange)
EVT_TREE_ITEM_EXPANDED (wxID_TREEBOOKTREEVIEW, wxTreebook::OnTreeNodeExpandedCollapsed)
EVT_TREE_ITEM_COLLAPSED(wxID_TREEBOOKTREEVIEW, wxTreebook::OnTreeNodeExpandedCollapsed)
void wxTreebook::Init()
{
- m_tree = NULL;
m_selection =
m_actualSelection = wxNOT_FOUND;
}
const wxString& name)
{
// Check the style flag to have either wxTBK_RIGHT or wxTBK_LEFT
- if ( style & wxTBK_RIGHT )
+ if ( (style & wxBK_ALIGN_MASK) == wxBK_DEFAULT )
{
- wxASSERT_MSG( !(style & wxTBK_LEFT),
- _T("RIGHT and LEFT can't be used together") );
- }
- else
- {
- style |= wxTBK_LEFT;
+ style |= wxBK_LEFT;
}
// no border for this control, it doesn't look nice together with the tree
style, wxDefaultValidator, name) )
return false;
- m_tree = new wxTreeCtrl
+ m_bookctrl = new wxTreeCtrl
(
this,
wxID_TREEBOOKTREEVIEW,
wxTR_HIDE_ROOT |
wxTR_SINGLE
);
- m_tree->AddRoot(wxEmptyString); // label doesn't matter, it's hidden
+ GetTreeCtrl()->AddRoot(wxEmptyString); // label doesn't matter, it's hidden
#ifdef __WXMSW__
- // see listbook.h for origins of that
- // On XP with themes enabled the GetViewRect used in GetListSize to
- // determine the space needed for the list view will incorrectly return
- // (0,0,0,0) the first time. So send a pending event so OnSize will be
- // called again after the window is ready to go. Technically we don't
- // need to do this on non-XP windows, but if things are already sized
- // correctly then nothing changes and so there is no harm.
+ // We need to add dummy size event to force possible scrollbar hiding
wxSizeEvent evt;
GetEventHandler()->AddPendingEvent(evt);
#endif
if ( !wxBookCtrlBase::InsertPage(pagePos, page, text, bSelect, imageId) )
return false;
+ wxTreeCtrl *tree = GetTreeCtrl();
wxTreeItemId newId;
if ( pagePos == DoInternalGetPageCount() )
{
// append the page to the end
- wxTreeItemId rootId = m_tree->GetRootItem();
+ wxTreeItemId rootId = tree->GetRootItem();
- newId = m_tree->AppendItem(rootId, text, imageId);
+ newId = tree->AppendItem(rootId, text, imageId);
}
else // insert the new page before the given one
{
wxTreeItemId nodeId = m_treeIds[pagePos];
- wxTreeItemId previousId = m_tree->GetPrevSibling(nodeId);
- wxTreeItemId parentId = m_tree->GetItemParent(nodeId);
+ wxTreeItemId previousId = tree->GetPrevSibling(nodeId);
+ wxTreeItemId parentId = tree->GetItemParent(nodeId);
if ( previousId.IsOk() )
{
// insert before the sibling - previousId
- newId = m_tree->InsertItem(parentId, previousId, text, imageId);
+ newId = tree->InsertItem(parentId, previousId, text, imageId);
}
else // no prev siblings -- insert as a first child
{
wxASSERT_MSG( parentId.IsOk(), wxT( "Tree has no root node?" ) );
- newId = m_tree->PrependItem(parentId, text, imageId);
+ newId = tree->PrependItem(parentId, text, imageId);
}
}
DoUpdateSelection(bSelect, pagePos);
- m_tree->InvalidateBestSize();
+ m_bookctrl->InvalidateBestSize();
return true;
}
bool wxTreebook::DoAddSubPage(wxWindow *page, const wxString& text, bool bSelect, int imageId)
{
- wxTreeItemId rootId = m_tree->GetRootItem();
+ wxTreeCtrl *tree = GetTreeCtrl();
- wxTreeItemId lastNodeId = m_tree->GetLastChild(rootId);
+ wxTreeItemId rootId = tree->GetRootItem();
+
+ wxTreeItemId lastNodeId = tree->GetLastChild(rootId);
wxCHECK_MSG( lastNodeId.IsOk(), false,
_T("Can't insert sub page when there are no pages") );
// now calculate its position (should we save/update it too?)
- size_t newPos = m_tree->GetCount() -
- (m_tree->GetChildrenCount(lastNodeId, true) + 1);
+ size_t newPos = tree->GetCount() -
+ (tree->GetChildrenCount(lastNodeId, true) + 1);
return DoInsertSubPage(newPos, page, text, bSelect, imageId);
}
wxTreeItemId parentId = DoInternalGetPage(pagePos);
wxCHECK_MSG( parentId.IsOk(), false, wxT("invalid tree item") );
- size_t newPos = pagePos + m_tree->GetChildrenCount(parentId, true) + 1;
+ wxTreeCtrl *tree = GetTreeCtrl();
+
+ size_t newPos = pagePos + tree->GetChildrenCount(parentId, true) + 1;
wxASSERT_MSG( newPos <= DoInternalGetPageCount(),
wxT("Internal error in tree insert point calculation") );
if ( !wxBookCtrlBase::InsertPage(newPos, page, text, bSelect, imageId) )
return false;
- wxTreeItemId newId = m_tree->AppendItem(parentId, text, imageId);
+ wxTreeItemId newId = tree->AppendItem(parentId, text, imageId);
if ( !newId.IsOk() )
{
DoUpdateSelection(bSelect, newPos);
- m_tree->InvalidateBestSize();
+ m_bookctrl->InvalidateBestSize();
return true;
}
wxCHECK_MSG( pageId.IsOk(), NULL, wxT("Invalid tree index") );
wxTreebookPage * oldPage = GetPage(pagePos);
+ wxTreeCtrl *tree = GetTreeCtrl();
- size_t subCount = m_tree->GetChildrenCount(pageId, true);
+ size_t subCount = tree->GetChildrenCount(pageId, true);
wxASSERT_MSG ( IS_VALID_PAGE(pagePos + subCount),
wxT("Internal error in wxTreebook::DoRemovePage") );
DoInternalRemovePageRange(pagePos, subCount);
- m_tree->DeleteChildren( pageId );
- m_tree->Delete( pageId );
- m_tree->InvalidateBestSize();
+ tree->DeleteChildren( pageId );
+ tree->Delete( pageId );
+ tree->InvalidateBestSize();
return oldPage;
}
m_selection =
m_actualSelection = wxNOT_FOUND;
- m_tree->DeleteChildren(m_tree->GetRootItem());
+ wxTreeCtrl *tree = GetTreeCtrl();
+ tree->DeleteChildren(tree->GetRootItem());
return true;
}
}
else if ( (size_t)m_selection >= pagePos )
{
+ wxTreeCtrl *tree = GetTreeCtrl();
+
// as selected page is going to be deleted, try to select the next
// sibling if exists, if not then the parent
- wxTreeItemId nodeId = m_tree->GetNextSibling(pageId);
+ wxTreeItemId nodeId = tree->GetNextSibling(pageId);
m_selection = wxNOT_FOUND;
m_actualSelection = wxNOT_FOUND;
if ( nodeId.IsOk() )
{
// selecting next siblings
- m_tree->SelectItem(nodeId);
+ tree->SelectItem(nodeId);
}
else // no next sibling, select the parent
{
- wxTreeItemId parentId = m_tree->GetItemParent(pageId);
+ wxTreeItemId parentId = tree->GetItemParent(pageId);
- if ( parentId.IsOk() && parentId != m_tree->GetRootItem() )
+ if ( parentId.IsOk() && parentId != tree->GetRootItem() )
{
- m_tree->SelectItem(parentId);
+ tree->SelectItem(parentId);
}
else // parent is root
{
wxCHECK_MSG( pageId.IsOk(), false, wxT("invalid tree item") );
- return m_tree->IsExpanded(pageId);
+ return GetTreeCtrl()->IsExpanded(pageId);
}
bool wxTreebook::ExpandNode(size_t pagePos, bool expand)
if ( expand )
{
- m_tree->Expand( pageId );
+ GetTreeCtrl()->Expand( pageId );
}
else // collapse
{
- m_tree->Collapse( pageId );
+ GetTreeCtrl()->Collapse( pageId );
// rely on the events generated by wxTreeCtrl to update selection
}
wxTreeItemId nodeId = DoInternalGetPage( pagePos );
wxCHECK_MSG( nodeId.IsOk(), wxNOT_FOUND, wxT("Invalid page index spacified!") );
- const wxTreeItemId parent = m_tree->GetItemParent( nodeId );
+ const wxTreeItemId parent = GetTreeCtrl()->GetItemParent( nodeId );
return parent.IsOk() ? DoInternalFindPageById(parent) : wxNOT_FOUND;
}
wxCHECK_MSG( pageId.IsOk(), false, wxT("invalid tree item") );
- m_tree->SetItemText(pageId, strText);
+ GetTreeCtrl()->SetItemText(pageId, strText);
return true;
}
wxCHECK_MSG( pageId.IsOk(), wxString(), wxT("invalid tree item") );
- return m_tree->GetItemText(pageId);
+ return GetTreeCtrl()->GetItemText(pageId);
}
int wxTreebook::GetPageImage(size_t n) const
wxCHECK_MSG( pageId.IsOk(), wxNOT_FOUND, wxT("invalid tree item") );
- return m_tree->GetItemImage(pageId);
+ return GetTreeCtrl()->GetItemImage(pageId);
}
bool wxTreebook::SetPageImage(size_t n, int imageId)
wxCHECK_MSG( pageId.IsOk(), false, wxT("invalid tree item") );
- m_tree->SetItemImage(pageId, imageId);
+ GetTreeCtrl()->SetItemImage(pageId, imageId);
return true;
}
wxSize wxTreebook::CalcSizeFromPage(const wxSize& sizePage) const
{
- const wxSize sizeTree = GetTreeSize();
+ const wxSize sizeTree = GetControllerSize();
wxSize size = sizePage;
size.x += sizeTree.x;
wxT("wxTreebook logic error: m_treeIds and m_pages not in sync!"));
const int oldSel = m_selection;
+ wxTreeCtrl *tree = GetTreeCtrl();
wxTreebookEvent event(wxEVT_COMMAND_TREEBOOK_PAGE_CHANGING, m_windowId);
event.SetEventObject(this);
while ( !page && childId.IsOk() )
{
wxTreeItemIdValue cookie;
- childId = m_tree->GetFirstChild( childId, cookie );
+ childId = tree->GetFirstChild( childId, cookie );
if ( childId.IsOk() )
{
page = wxBookCtrlBase::GetPage(++m_actualSelection);
page->Show();
}
- m_tree->SelectItem(DoInternalGetPage(pagePos));
+ tree->SelectItem(DoInternalGetPage(pagePos));
// notify about the (now completed) page change
event.SetEventType(wxEVT_COMMAND_TREEBOOK_PAGE_CHANGED);
else // page change vetoed
{
// tree selection might have already had changed
- m_tree->SelectItem(DoInternalGetPage(oldSel));
+ tree->SelectItem(DoInternalGetPage(oldSel));
}
return oldSel;
void wxTreebook::SetImageList(wxImageList *imageList)
{
wxBookCtrlBase::SetImageList(imageList);
- m_tree->SetImageList(imageList);
+ GetTreeCtrl()->SetImageList(imageList);
}
void wxTreebook::AssignImageList(wxImageList *imageList)
{
wxBookCtrlBase::AssignImageList(imageList);
- m_tree->SetImageList(imageList);
+ GetTreeCtrl()->SetImageList(imageList);
}
// ----------------------------------------------------------------------------
wxTreeItemId newId = event.GetItem();
if ( (m_selection == wxNOT_FOUND &&
- (!newId.IsOk() || newId == m_tree->GetRootItem())) ||
+ (!newId.IsOk() || newId == GetTreeCtrl()->GetRootItem())) ||
(m_selection != wxNOT_FOUND && newId == m_treeIds[m_selection]) )
{
// this event can only come when we modify the tree selection ourselves
void wxTreebook::OnTreeNodeExpandedCollapsed(wxTreeEvent & event)
{
wxTreeItemId nodeId = event.GetItem();
- if ( !nodeId.IsOk() || nodeId == m_tree->GetRootItem() )
+ if ( !nodeId.IsOk() || nodeId == GetTreeCtrl()->GetRootItem() )
return;
int pagePos = DoInternalFindPageById(nodeId);
wxCHECK_RET( pagePos != wxNOT_FOUND, wxT("Internal problem in wxTreebook!..") );
- wxTreebookEvent ev(m_tree->IsExpanded(nodeId)
+ wxTreebookEvent ev(GetTreeCtrl()->IsExpanded(nodeId)
? wxEVT_COMMAND_TREEBOOK_NODE_EXPANDED
: wxEVT_COMMAND_TREEBOOK_NODE_COLLAPSED,
m_windowId);
// wxTreebook geometry management
// ----------------------------------------------------------------------------
-wxSize wxTreebook::GetTreeSize() const
-{
- const wxSize sizeClient = GetClientSize(),
- sizeBorder = m_tree->GetSize() - m_tree->GetClientSize(),
- sizeTree = m_tree->GetBestSize() + sizeBorder;
-
- wxSize size;
-
- size.x = sizeTree.x;
- size.y = sizeClient.y;
-
- return size;
-}
-
-wxRect wxTreebook::GetPageRect() const
-{
- const wxSize sizeTree = m_tree->GetSize();
-
- wxPoint pt;
- wxRect rectPage(pt, GetClientSize());
- switch ( GetWindowStyle() & wxTBK_ALIGN_MASK )
- {
- default:
- wxFAIL_MSG( _T("unexpected wxTreebook alignment") );
- // fall through
-
- case wxTBK_LEFT:
- rectPage.x = sizeTree.x; // + MARGIN;
- // fall through
-
- case wxTBK_RIGHT:
- rectPage.width -= sizeTree.x; // + MARGIN;
- break;
- }
-
- return rectPage;
-}
-
-void wxTreebook::OnSize(wxSizeEvent& event)
-{
- event.Skip();
-
- if ( !m_tree )
- {
- // we're not fully created yet
- return;
- }
-
- // resize the list control and the page area to fit inside our new size
- const wxSize sizeClient = GetClientSize(),
- sizeBorder = m_tree->GetSize() - m_tree->GetClientSize(),
- sizeTree = GetTreeSize();
-
- m_tree->SetClientSize( sizeTree.x - sizeBorder.x, sizeTree.y - sizeBorder.y );
-
- const wxSize sizeNew = m_tree->GetSize();
- wxPoint posTree;
- switch ( GetWindowStyle() & wxTBK_ALIGN_MASK )
- {
- default:
- wxFAIL_MSG( _T("unexpected wxTreebook alignment") );
- // fall through
-
- case wxTBK_LEFT:
- // posTree is already ok
- break;
-
- case wxTBK_RIGHT:
- posTree.x = sizeClient.x - sizeNew.x;
- break;
- }
-
- if ( m_tree->GetPosition() != posTree )
- m_tree->Move(posTree);
-
- // resize the currently shown page
- wxTreebookPage *page = DoGetCurrentPage();
- if ( page )
- {
- wxRect rectPage = GetPageRect();
- page->SetSize(rectPage);
- }
-}
-
wxTreebookPage * wxTreebook::DoGetCurrentPage() const
{
if ( m_selection == wxNOT_FOUND )
}
#endif // wxUSE_TREEBOOK
-
///////////////////////////////////////////////////////////////////////////////
-// Name: msw/notebook.cpp
+// Name: src/msw/notebook.cpp
// Purpose: implementation of wxNotebook
// Author: Vadim Zeitlin
// Modified by:
wxFLAGS_MEMBER(wxHSCROLL)
wxFLAGS_MEMBER(wxNB_FIXEDWIDTH)
- wxFLAGS_MEMBER(wxNB_LEFT)
- wxFLAGS_MEMBER(wxNB_RIGHT)
- wxFLAGS_MEMBER(wxNB_BOTTOM)
+ wxFLAGS_MEMBER(wxBK_DEFAULT)
+ wxFLAGS_MEMBER(wxBK_TOP)
+ wxFLAGS_MEMBER(wxBK_LEFT)
+ wxFLAGS_MEMBER(wxBK_RIGHT)
+ wxFLAGS_MEMBER(wxBK_BOTTOM)
wxFLAGS_MEMBER(wxNB_NOPAGETHEME)
wxFLAGS_MEMBER(wxNB_FLAT)
if ( wxUxThemeEngine::GetIfActive() )
#endif
{
- style &= ~(wxNB_BOTTOM | wxNB_LEFT | wxNB_RIGHT);
+ style &= ~(wxBK_BOTTOM | wxBK_LEFT | wxBK_RIGHT);
}
}
if ( style & wxNB_FIXEDWIDTH )
tabStyle |= TCS_FIXEDWIDTH;
- if ( style & wxNB_BOTTOM )
+ if ( style & wxBK_BOTTOM )
tabStyle |= TCS_RIGHT;
- else if ( style & wxNB_LEFT )
+ else if ( style & wxBK_LEFT )
tabStyle |= TCS_VERTICAL;
- else if ( style & wxNB_RIGHT )
+ else if ( style & wxBK_RIGHT )
tabStyle |= TCS_VERTICAL | TCS_RIGHT;
// ex style
tabSize.x = rect.right - rect.left;
tabSize.y = rect.bottom - rect.top;
}
- if ( HasFlag(wxNB_LEFT) || HasFlag(wxNB_RIGHT) )
+ if ( HasFlag(wxBK_LEFT) || HasFlag(wxBK_RIGHT) )
{
sizeTotal.x += tabSize.x + 7;
sizeTotal.y += 7;
/////////////////////////////////////////////////////////////////////////////
-// Name: xh_choicbk.cpp
+// Name: src/xrc/xh_choicbk.cpp
// Purpose: XRC resource for wxChoicebook
// Author: Vaclav Slavik
// Created: 2000/03/21
+// RCS-ID: $Id$
// Copyright: (c) 2000 Vaclav Slavik
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
wxChoicebookXmlHandler::wxChoicebookXmlHandler()
: wxXmlResourceHandler(), m_isInside(false), m_choicebook(NULL)
{
+ XRC_ADD_STYLE(wxBK_DEFAULT);
+ XRC_ADD_STYLE(wxBK_LEFT);
+ XRC_ADD_STYLE(wxBK_RIGHT);
+ XRC_ADD_STYLE(wxBK_TOP);
+ XRC_ADD_STYLE(wxBK_BOTTOM);
+
+#if WXWIN_COMPATIBILITY_2_6
XRC_ADD_STYLE(wxCHB_DEFAULT);
XRC_ADD_STYLE(wxCHB_LEFT);
XRC_ADD_STYLE(wxCHB_RIGHT);
XRC_ADD_STYLE(wxCHB_TOP);
XRC_ADD_STYLE(wxCHB_BOTTOM);
+#endif
AddWindowStyles();
}
/////////////////////////////////////////////////////////////////////////////
-// Name: xh_listbk.cpp
+// Name: src/xrc/xh_listbk.cpp
// Purpose: XRC resource for wxListbook
// Author: Vaclav Slavik
// Created: 2000/03/21
+// RCS-ID: $Id$
// Copyright: (c) 2000 Vaclav Slavik
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
wxListbookXmlHandler::wxListbookXmlHandler()
: wxXmlResourceHandler(), m_isInside(false), m_listbook(NULL)
{
+ XRC_ADD_STYLE(wxBK_DEFAULT);
+ XRC_ADD_STYLE(wxBK_LEFT);
+ XRC_ADD_STYLE(wxBK_RIGHT);
+ XRC_ADD_STYLE(wxBK_TOP);
+ XRC_ADD_STYLE(wxBK_BOTTOM);
+
+#if WXWIN_COMPATIBILITY_2_6
XRC_ADD_STYLE(wxLB_DEFAULT);
XRC_ADD_STYLE(wxLB_LEFT);
XRC_ADD_STYLE(wxLB_RIGHT);
XRC_ADD_STYLE(wxLB_TOP);
XRC_ADD_STYLE(wxLB_BOTTOM);
+#endif
AddWindowStyles();
}
/////////////////////////////////////////////////////////////////////////////
-// Name: xh_notbk.cpp
+// Name: src/xrc/xh_notbk.cpp
// Purpose: XRC resource for wxNotebook
// Author: Vaclav Slavik
// Created: 2000/03/21
wxNotebookXmlHandler::wxNotebookXmlHandler()
: wxXmlResourceHandler(), m_isInside(false), m_notebook(NULL)
{
+ XRC_ADD_STYLE(wxBK_DEFAULT);
+ XRC_ADD_STYLE(wxBK_LEFT);
+ XRC_ADD_STYLE(wxBK_RIGHT);
+ XRC_ADD_STYLE(wxBK_TOP);
+ XRC_ADD_STYLE(wxBK_BOTTOM);
+
+#if WXWIN_COMPATIBILITY_2_6
XRC_ADD_STYLE(wxNB_DEFAULT);
XRC_ADD_STYLE(wxNB_LEFT);
XRC_ADD_STYLE(wxNB_RIGHT);
XRC_ADD_STYLE(wxNB_TOP);
XRC_ADD_STYLE(wxNB_BOTTOM);
+#endif
XRC_ADD_STYLE(wxNB_FIXEDWIDTH);
XRC_ADD_STYLE(wxNB_MULTILINE);
/////////////////////////////////////////////////////////////////////////////
-// Name: xh_treebk.cpp
+// Name: src/xrc/xh_treebk.cpp
// Purpose: XRC resource handler for wxTreebook
// Author: Evgeniy Tarassov
// Created: 2005/09/28
wxTreebookXmlHandler::wxTreebookXmlHandler()
: wxXmlResourceHandler(), m_isInside(false), m_tbk(NULL), m_treeContext()
{
- XRC_ADD_STYLE(wxTBK_DEFAULT);
- XRC_ADD_STYLE(wxTBK_LEFT);
- XRC_ADD_STYLE(wxTBK_RIGHT);
+ XRC_ADD_STYLE(wxBK_DEFAULT);
+ XRC_ADD_STYLE(wxBK_TOP);
+ XRC_ADD_STYLE(wxBK_BOTTOM);
+ XRC_ADD_STYLE(wxBK_LEFT);
+ XRC_ADD_STYLE(wxBK_RIGHT);
AddWindowStyles();
}
}
size_t depth = GetLong( wxT("depth") );
-
+
if( depth <= m_treeContext.Count() )
{
// first prepare the icon
m_tbk->AddSubPage(m_treeContext.Item(depth - 1), wnd,
GetText(wxT("label")), GetBool(wxT("selected")), imgIndex);
}
-
+
m_treeContext.Add( m_tbk->GetPageCount() - 1);
-
+
}
else
wxLogError(wxT("Error in resource. wxTreebookPage has an invalid depth."));