virtual bool AddPage(wxWindow *page,
const wxString& text,
bool bSelect = false,
- int imageId = -1)
+ int imageId = NO_IMAGE)
{
DoInvalidateBestSize();
return InsertPage(GetPageCount(), page, text, bSelect, imageId);
wxWindow *page,
const wxString& text,
bool bSelect = false,
- int imageId = -1) = 0;
+ int imageId = NO_IMAGE) = 0;
// set the currently selected page, return the index of the previously
// selected one (or wxNOT_FOUND on error)
wxWindow *page,
const wxString& text,
bool bSelect = false,
- int imageId = -1);
+ int imageId = NO_IMAGE);
virtual int SetSelection(size_t n)
{ return DoSetSelection(n, SetSelection_SendEvent); }
virtual int ChangeSelection(size_t n) { return DoSetSelection(n); }
wxNotebookPage *win,
const wxString& strText,
bool bSelect = false,
- int imageId = -1 );
+ int imageId = NO_IMAGE );
protected:
};
{ return GetStore()->IsContainer(item); }
wxDataViewItem AppendItem( const wxDataViewItem& parent,
- const wxString &text, int icon = -1, wxClientData *data = NULL );
+ const wxString &text, int icon = NO_IMAGE, wxClientData *data = NULL );
wxDataViewItem PrependItem( const wxDataViewItem& parent,
- const wxString &text, int icon = -1, wxClientData *data = NULL );
+ const wxString &text, int icon = NO_IMAGE, wxClientData *data = NULL );
wxDataViewItem InsertItem( const wxDataViewItem& parent, const wxDataViewItem& previous,
- const wxString &text, int icon = -1, wxClientData *data = NULL );
+ const wxString &text, int icon = NO_IMAGE, wxClientData *data = NULL );
wxDataViewItem PrependContainer( const wxDataViewItem& parent,
- const wxString &text, int icon = -1, int expanded = -1,
+ const wxString &text, int icon = NO_IMAGE, int expanded = NO_IMAGE,
wxClientData *data = NULL );
wxDataViewItem AppendContainer( const wxDataViewItem& parent,
- const wxString &text, int icon = -1, int expanded = -1,
+ const wxString &text, int icon = NO_IMAGE, int expanded = NO_IMAGE,
wxClientData *data = NULL );
wxDataViewItem InsertContainer( const wxDataViewItem& parent, const wxDataViewItem& previous,
- const wxString &text, int icon = -1, int expanded = -1,
+ const wxString &text, int icon = NO_IMAGE, int expanded = NO_IMAGE,
wxClientData *data = NULL );
wxDataViewItem GetNthChild( const wxDataViewItem& parent, unsigned int pos ) const
wxNotebookPage *pPage,
const wxString& strText,
bool bSelect = false,
- int imageId = -1);
+ int imageId = NO_IMAGE);
// callbacks
// ---------
wxNotebookPage *win,
const wxString& strText,
bool bSelect = false,
- int imageId = -1 );
+ int imageId = NO_IMAGE );
// handler for tab navigation
// --------------------------
wxNotebookPage *win,
const wxString& strText,
bool bSelect = false,
- int imageId = -1 );
+ int imageId = NO_IMAGE );
// handler for tab navigation
// --------------------------
wxWindow *page,
const wxString& text,
bool bSelect = false,
- int imageId = -1);
+ int imageId = NO_IMAGE);
virtual int SetSelection(size_t n) { return DoSetSelection(n, SetSelection_SendEvent); }
virtual int ChangeSelection(size_t n) { return DoSetSelection(n); }
virtual int HitTest(const wxPoint& pt, long *flags = NULL) const;
wxNotebookPage *pPage,
const wxString& strText,
bool bSelect = false,
- int imageId = -1);
+ int imageId = NO_IMAGE);
// Windows-only at present. Also, you must use the wxNB_FIXEDWIDTH
// style.
wxNotebookPage *pPage,
const wxString& strText,
bool bSelect = false,
- int imageId = -1);
+ int imageId = NO_IMAGE);
// callbacks
// ---------
wxNotebookPage *pPage,
const wxString& strText,
bool bSelect = false,
- int imageId = -1);
+ int imageId = NO_IMAGE);
void AddPageInfo( wxNotebookPageInfo* info ) { AddPage( info->GetPage() , info->GetText() , info->GetSelected() , info->GetImageId() ) ; }
const wxNotebookPageInfoList& GetPageInfos() const ;
wxWindow *page,
const wxString& text,
bool bSelect = false,
- int imageId = -1);
+ int imageId = NO_IMAGE);
virtual int SetSelection(size_t n) { return DoSetSelection(n, SetSelection_SendEvent); }
virtual int ChangeSelection(size_t n) { return DoSetSelection(n); }
virtual void SetImageList(wxImageList *imageList);
wxWindow *page,
const wxString& text,
bool bSelect = false,
- int imageId = wxNOT_FOUND);
+ int imageId = NO_IMAGE);
// Inserts a new sub-page to the end of children of the page at given pos.
virtual bool InsertSubPage(size_t pos,
wxWindow *page,
const wxString& text,
bool bSelect = false,
- int imageId = wxNOT_FOUND);
+ int imageId = NO_IMAGE);
// Adds a new page at top level after all other pages.
virtual bool AddPage(wxWindow *page,
const wxString& text,
bool bSelect = false,
- int imageId = wxNOT_FOUND);
+ int imageId = NO_IMAGE);
// Adds a new child-page to the last top-level page inserted.
// Useful when constructing 1 level tree structure.
virtual bool AddSubPage(wxWindow *page,
const wxString& text,
bool bSelect = false,
- int imageId = wxNOT_FOUND);
+ int imageId = NO_IMAGE);
// Deletes the page and ALL its children. Could trigger page selection
// change in a case when selected page is removed. In that case its parent
wxWindow *page,
const wxString& text,
bool bSelect = false,
- int imageId = wxNOT_FOUND);
+ int imageId = NO_IMAGE);
bool DoInsertSubPage(size_t pos,
wxWindow *page,
const wxString& text,
bool bSelect = false,
- int imageId = wxNOT_FOUND);
+ int imageId = NO_IMAGE);
bool DoAddSubPage(wxWindow *page,
const wxString& text,
bool bSelect = false,
- int imageId = wxNOT_FOUND);
+ int imageId = NO_IMAGE);
// Sets selection in the tree control and updates the page being shown.
int DoSetSelection(size_t pos, int flags = 0);
wxNotebookPage *pPage,
const wxString& strText,
bool bSelect = false,
- int imageId = -1);
+ int imageId = NO_IMAGE);
// style tests
// -----------
class WXDLLIMPEXP_CORE wxWithImages
{
public:
+ enum
+ {
+ NO_IMAGE = -1
+ };
+
wxWithImages()
{
m_imageList = NULL;
// Return the image with the given index from the image list.
//
- // If there is no image list or if index == -1 (which traditionally means
- // that no image should be used for the given item), silently returns
+ // If there is no image list or if index == NO_IMAGE, silently returns
// wxNullIcon.
wxIcon GetImage(int iconIndex) const
{
- return m_imageList && iconIndex != -1 ? m_imageList->GetIcon(iconIndex)
- : wxNullIcon;
+ return m_imageList && iconIndex != NO_IMAGE
+ ? m_imageList->GetIcon(iconIndex)
+ : wxNullIcon;
}
private:
class wxBookCtrlBase : public wxControl
{
public:
+ enum
+ {
+ /// Symbolic constant indicating that no image should be used.
+ NO_IMAGE = -1
+ };
+
/**
Default ctor.
*/
@see InsertPage()
*/
virtual bool AddPage(wxWindow* page, const wxString& text,
- bool select = false, int imageId = wxNOT_FOUND);
+ bool select = false, int imageId = NO_IMAGE);
/**
Deletes all pages.
wxWindow* page,
const wxString& text,
bool select = false,
- int imageId = wxNOT_FOUND) = 0;
+ int imageId = NO_IMAGE) = 0;
/**
Deletes the specified page, without deleting the associated window.