21 #ifndef __ANTARES_TOOLBOX_COMPONENT_NOTEBOOK_H__
22 #define __ANTARES_TOOLBOX_COMPONENT_NOTEBOOK_H__
24 #include <ui/common/component/panel.h>
27 #include "../../input/input.h"
28 #include "../refresh.h"
30 namespace Antares::Component
85 const wxString&
caption()
const;
88 void caption(
const wxString& s);
93 const wxString&
name()
const;
96 void name(
const wxString& s);
122 void visible(
const bool v);
128 bool displayExtraControls()
const
130 return pDisplayExtraControls;
133 void displayExtraControls(
bool v)
135 pDisplayExtraControls = v;
147 RefreshAllControls(pControl);
162 std::vector<Page*> subPages;
184 bool pDisplayExtraControls;
216 Page*
add(wxWindow* ctnrl,
const wxString&
caption);
221 Page*
add(wxWindow* ctnrl,
const wxString& name,
const wxString&
caption);
240 bool displayTitle()
const;
241 void displayTitle(
const bool v);
245 void addCommonControl(wxWindow* ctrnl,
246 const int border = 0,
247 const wxPoint& recommendedSize = wxPoint(20, 20));
250 void addCommonControlTop(wxWindow* ctrnl,
251 const int border = 0,
252 const wxPoint& recommendedSize = wxPoint(20, 20));
256 const wxString&
caption()
const;
259 void caption(
const wxString& s);
265 bool select(
const wxString& name,
bool triggerEvents =
true);
269 return pLastSelected;
272 const Page* selected()
const
274 return pLastSelected;
280 Page*
find(
const wxString& name);
282 void set_page_visibility(
const wxString& name,
bool visible);
301 void alignment(Alignment a)
317 virtual bool HasMultiplePages()
const;
356 void drawItem(wxDC& dc,
Page* page,
int& pos);
357 virtual void drawItemTop(wxDC& dc,
Page* page,
int& pos, Alignment align);
358 void drawItemOnCanvasNotSelected(
Page* page,
362 const wxSize& textExtent);
363 void drawItemOnCanvasSelected(
Page* page,
367 const wxSize& textExtent);
372 virtual void onDraw(wxPaintEvent& evt);
373 void onEraseBackground(wxEraseEvent& evt);
374 void drawOrientationLeft(wxDC& dc);
375 void drawOrientationTop(wxDC& dc);
376 void onForceRefresh();
387 DECLARE_EVENT_TABLE()
392 void onForceRefresh();
413 wxSizer* pSizerForPages;
423 Alignment pAlignment;
425 wxString pCacheTitle;
426 wxColour pOriginalColor;
427 wxColour pOriginalColorDark;
433 #include "notebook.hxx"
MapNotebook.
Definition: mapnotebook.h:33
Definition: notebook.h:61
void refresh()
Refresh.
Definition: notebook.h:145
Notebook & notebook()
Get the attached notebook.
Definition: notebook.hxx:26
const wxString & name() const
Get the name of the page.
Definition: notebook.hxx:41
void selectSubPage(Page *subPage)
Select a subpage of this page.
Definition: notebook.cpp:878
wxWindow * control() const
Get the control of the page.
Definition: notebook.h:139
void removeSubPage(Page *p)
Remove a subpage.
Definition: notebook.cpp:856
~Page()
Destructor.
Definition: notebook.cpp:810
const wxString & caption() const
Get the caption of the page.
Definition: notebook.hxx:36
bool selected() const
Get if the page is currently selected.
Definition: notebook.h:103
Page * select(bool force=false)
Select the page.
Definition: notebook.cpp:868
Page * addSubPage(Page *p)
Add a page as subpage.
Definition: notebook.cpp:849
Definition: notebook.h:348
virtual void onMouseUp(wxMouseEvent &)
Click up.
Definition: notebook.cpp:981
Notebook.
Definition: notebook.h:36
void enableRefreshForAllDatagrid(bool enabled)
Enable / Disable the refresh for all datagrid.
Definition: notebook.cpp:973
Tabs * pTabs
The tab component.
Definition: notebook.h:403
Orientation orientation() const
Get the orientation of the notebook.
Definition: notebook.hxx:111
bool pTabsVisible
Can display tabs.
Definition: notebook.h:407
bool pAlwaysDisplayTab
Always display tabs.
Definition: notebook.h:409
const wxString & caption() const
Get the caption of the notebook.
Definition: notebook.hxx:46
const Orientation pOrientation
Orientation.
Definition: notebook.h:397
bool pDisplayTitle
Display the title.
Definition: notebook.h:411
Page * add(wxWindow *ctnrl, const wxString &caption)
Add a new page.
Definition: notebook.hxx:71
Pages pPages
All pages.
Definition: notebook.h:401
wxWindow * titlePanelControl() const
Get the controls of the main bar.
Definition: notebook.hxx:116
bool tabsVisible() const
Get if the tabs are visible.
Definition: notebook.hxx:91
virtual ~Notebook()
Destructor.
Definition: notebook.cpp:94
void addSeparator()
Add a separator.
Definition: notebook.hxx:55
bool select(const wxString &name, bool triggerEvents=true)
Select a page by its name.
Definition: notebook.cpp:1030
std::vector< wxWindow * > pExtraControls
The complete list of extra controls.
Definition: notebook.h:420
Yuni::Event< void(Page &, bool &)> onPageAccept
Event: Page changing.
Definition: notebook.h:332
Yuni::Event< void(Page &)> onPageChanged
Event: Page changing.
Definition: notebook.h:344
void theme(Theme t)
Set the current theme.
Definition: notebook.h:289
Page * find(const wxString &name)
Find a page by its name.
Definition: notebook.cpp:1076
std::vector< Page * > Pages
All pages.
Definition: notebook.h:399
Notebook(wxWindow *parent, Orientation orientation=orLeft)
Default constructor.
Definition: notebook.cpp:45
bool alwaysDisplayTabs() const
Get if the tabs must always be displayed, even if a single one is available.
Definition: notebook.hxx:81
wxString pCaption
The caption of the notebook.
Definition: notebook.h:405
void clear()
Delete all pages.
Definition: notebook.cpp:707
Panel implementation.
Definition: panel.h:34