added wxNotebook::AssingImageList
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8439 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -123,6 +123,18 @@ Do not delete the page, it will be deleted by the notebook.
|
|||||||
|
|
||||||
Cycles through the tabs.
|
Cycles through the tabs.
|
||||||
|
|
||||||
|
\membersection{wxNotebook::AssignImageList}\label{wxnotebookassignimagelist}
|
||||||
|
|
||||||
|
\func{void}{AssignImageList}{\param{wxImageList*}{ imageList}}
|
||||||
|
|
||||||
|
Sets the image list for the page control and takes ownership of
|
||||||
|
the list.
|
||||||
|
|
||||||
|
\wxheading{See also}
|
||||||
|
|
||||||
|
\helpref{wxImageList}{wximagelist},
|
||||||
|
\helpref{SetImageList}{wxnotebooksetimagelist}
|
||||||
|
|
||||||
\membersection{wxNotebook::Create}\label{wxnotebookcreate}
|
\membersection{wxNotebook::Create}\label{wxnotebookcreate}
|
||||||
|
|
||||||
\func{bool}{Create}{\param{wxWindow*}{ parent}, \param{wxWindowID }{id}, \param{const wxPoint\&}{ pos = wxDefaultPosition},
|
\func{bool}{Create}{\param{wxWindow*}{ parent}, \param{wxWindowID }{id}, \param{const wxPoint\&}{ pos = wxDefaultPosition},
|
||||||
@@ -242,11 +254,13 @@ Deletes the specified page, without deleting the associated window.
|
|||||||
|
|
||||||
\func{void}{SetImageList}{\param{wxImageList*}{ imageList}}
|
\func{void}{SetImageList}{\param{wxImageList*}{ imageList}}
|
||||||
|
|
||||||
Sets the image list for the page control.
|
Sets the image list for the page control. It does not take
|
||||||
|
ownership of the image list, you must delete it yourself.
|
||||||
|
|
||||||
\wxheading{See also}
|
\wxheading{See also}
|
||||||
|
|
||||||
\helpref{wxImageList}{wximagelist}
|
\helpref{wxImageList}{wximagelist},
|
||||||
|
\helpref{AssignImageList}{wxnotebookassignimagelist}
|
||||||
|
|
||||||
\membersection{wxNotebook::SetPadding}\label{wxnotebooksetpadding}
|
\membersection{wxNotebook::SetPadding}\label{wxnotebooksetpadding}
|
||||||
|
|
||||||
|
@@ -89,6 +89,7 @@ public:
|
|||||||
// 3) set for each page it's image
|
// 3) set for each page it's image
|
||||||
// associate image list with a control
|
// associate image list with a control
|
||||||
void SetImageList(wxImageList* imageList);
|
void SetImageList(wxImageList* imageList);
|
||||||
|
void AssignImageList(wxImageList* imageList);
|
||||||
// get pointer (may be NULL) to the associated image list
|
// get pointer (may be NULL) to the associated image list
|
||||||
wxImageList *GetImageList() const { return m_imageList; }
|
wxImageList *GetImageList() const { return m_imageList; }
|
||||||
|
|
||||||
@@ -157,6 +158,7 @@ public:
|
|||||||
wxGtkNotebookPage* GetNotebookPage(int page) const;
|
wxGtkNotebookPage* GetNotebookPage(int page) const;
|
||||||
|
|
||||||
wxImageList* m_imageList;
|
wxImageList* m_imageList;
|
||||||
|
bool m_ownsImageList;
|
||||||
wxList m_pages;
|
wxList m_pages;
|
||||||
int m_lastSelection; /* hack */
|
int m_lastSelection; /* hack */
|
||||||
|
|
||||||
|
@@ -89,6 +89,7 @@ public:
|
|||||||
// 3) set for each page it's image
|
// 3) set for each page it's image
|
||||||
// associate image list with a control
|
// associate image list with a control
|
||||||
void SetImageList(wxImageList* imageList);
|
void SetImageList(wxImageList* imageList);
|
||||||
|
void AssignImageList(wxImageList* imageList);
|
||||||
// get pointer (may be NULL) to the associated image list
|
// get pointer (may be NULL) to the associated image list
|
||||||
wxImageList *GetImageList() const { return m_imageList; }
|
wxImageList *GetImageList() const { return m_imageList; }
|
||||||
|
|
||||||
@@ -157,6 +158,7 @@ public:
|
|||||||
wxGtkNotebookPage* GetNotebookPage(int page) const;
|
wxGtkNotebookPage* GetNotebookPage(int page) const;
|
||||||
|
|
||||||
wxImageList* m_imageList;
|
wxImageList* m_imageList;
|
||||||
|
bool m_ownsImageList;
|
||||||
wxList m_pages;
|
wxList m_pages;
|
||||||
int m_lastSelection; /* hack */
|
int m_lastSelection; /* hack */
|
||||||
|
|
||||||
|
@@ -92,6 +92,7 @@ public:
|
|||||||
// 3) set for each page it's image
|
// 3) set for each page it's image
|
||||||
// associate image list with a control
|
// associate image list with a control
|
||||||
void SetImageList(wxImageList* imageList);
|
void SetImageList(wxImageList* imageList);
|
||||||
|
void AssignImageList(wxImageList* imageList);
|
||||||
// get pointer (may be NULL) to the associated image list
|
// get pointer (may be NULL) to the associated image list
|
||||||
wxImageList* GetImageList() const { return m_pImageList; }
|
wxImageList* GetImageList() const { return m_pImageList; }
|
||||||
|
|
||||||
@@ -157,6 +158,7 @@ protected:
|
|||||||
void ChangePage(int nOldSel, int nSel); // change pages
|
void ChangePage(int nOldSel, int nSel); // change pages
|
||||||
|
|
||||||
wxImageList *m_pImageList; // we can have an associated image list
|
wxImageList *m_pImageList; // we can have an associated image list
|
||||||
|
bool m_bOwnsImageList;
|
||||||
wxArrayPages m_aPages; // array of pages
|
wxArrayPages m_aPages; // array of pages
|
||||||
|
|
||||||
int m_nSelection; // the current selection (-1 if none)
|
int m_nSelection; // the current selection (-1 if none)
|
||||||
|
@@ -214,6 +214,7 @@ END_EVENT_TABLE()
|
|||||||
void wxNotebook::Init()
|
void wxNotebook::Init()
|
||||||
{
|
{
|
||||||
m_imageList = (wxImageList *) NULL;
|
m_imageList = (wxImageList *) NULL;
|
||||||
|
m_ownsImageList = FALSE;
|
||||||
m_pages.DeleteContents( TRUE );
|
m_pages.DeleteContents( TRUE );
|
||||||
m_lastSelection = -1;
|
m_lastSelection = -1;
|
||||||
m_themeEnabled = TRUE;
|
m_themeEnabled = TRUE;
|
||||||
@@ -239,6 +240,7 @@ wxNotebook::~wxNotebook()
|
|||||||
GTK_SIGNAL_FUNC(gtk_notebook_page_change_callback), (gpointer) this );
|
GTK_SIGNAL_FUNC(gtk_notebook_page_change_callback), (gpointer) this );
|
||||||
|
|
||||||
DeleteAllPages();
|
DeleteAllPages();
|
||||||
|
if (m_ownsImageList) delete m_imageList;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxNotebook::Create(wxWindow *parent, wxWindowID id,
|
bool wxNotebook::Create(wxWindow *parent, wxWindowID id,
|
||||||
@@ -388,7 +390,15 @@ void wxNotebook::AdvanceSelection( bool forward )
|
|||||||
|
|
||||||
void wxNotebook::SetImageList( wxImageList* imageList )
|
void wxNotebook::SetImageList( wxImageList* imageList )
|
||||||
{
|
{
|
||||||
|
if (m_ownsImageList) delete m_imageList;
|
||||||
m_imageList = imageList;
|
m_imageList = imageList;
|
||||||
|
m_ownsImageList = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxNotebook::AssignImageList( wxImageList* imageList )
|
||||||
|
{
|
||||||
|
SetImageList(imageList);
|
||||||
|
m_ownsImageList = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxNotebook::SetPageText( int page, const wxString &text )
|
bool wxNotebook::SetPageText( int page, const wxString &text )
|
||||||
|
@@ -214,6 +214,7 @@ END_EVENT_TABLE()
|
|||||||
void wxNotebook::Init()
|
void wxNotebook::Init()
|
||||||
{
|
{
|
||||||
m_imageList = (wxImageList *) NULL;
|
m_imageList = (wxImageList *) NULL;
|
||||||
|
m_ownsImageList = FALSE;
|
||||||
m_pages.DeleteContents( TRUE );
|
m_pages.DeleteContents( TRUE );
|
||||||
m_lastSelection = -1;
|
m_lastSelection = -1;
|
||||||
m_themeEnabled = TRUE;
|
m_themeEnabled = TRUE;
|
||||||
@@ -239,6 +240,7 @@ wxNotebook::~wxNotebook()
|
|||||||
GTK_SIGNAL_FUNC(gtk_notebook_page_change_callback), (gpointer) this );
|
GTK_SIGNAL_FUNC(gtk_notebook_page_change_callback), (gpointer) this );
|
||||||
|
|
||||||
DeleteAllPages();
|
DeleteAllPages();
|
||||||
|
if (m_ownsImageList) delete m_imageList;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxNotebook::Create(wxWindow *parent, wxWindowID id,
|
bool wxNotebook::Create(wxWindow *parent, wxWindowID id,
|
||||||
@@ -388,7 +390,15 @@ void wxNotebook::AdvanceSelection( bool forward )
|
|||||||
|
|
||||||
void wxNotebook::SetImageList( wxImageList* imageList )
|
void wxNotebook::SetImageList( wxImageList* imageList )
|
||||||
{
|
{
|
||||||
|
if (m_ownsImageList) delete m_imageList;
|
||||||
m_imageList = imageList;
|
m_imageList = imageList;
|
||||||
|
m_ownsImageList = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxNotebook::AssignImageList( wxImageList* imageList )
|
||||||
|
{
|
||||||
|
SetImageList(imageList);
|
||||||
|
m_ownsImageList = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxNotebook::SetPageText( int page, const wxString &text )
|
bool wxNotebook::SetPageText( int page, const wxString &text )
|
||||||
|
@@ -106,6 +106,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxNotebookEvent, wxNotifyEvent)
|
|||||||
void wxNotebook::Init()
|
void wxNotebook::Init()
|
||||||
{
|
{
|
||||||
m_pImageList = NULL;
|
m_pImageList = NULL;
|
||||||
|
m_bOwnsImageList = FALSE;
|
||||||
m_nSelection = -1;
|
m_nSelection = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -188,6 +189,7 @@ bool wxNotebook::Create(wxWindow *parent,
|
|||||||
// dtor
|
// dtor
|
||||||
wxNotebook::~wxNotebook()
|
wxNotebook::~wxNotebook()
|
||||||
{
|
{
|
||||||
|
if (m_bOwnsImageList) delete m_pImageList;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -276,10 +278,18 @@ bool wxNotebook::SetPageImage(int nPage, int nImage)
|
|||||||
|
|
||||||
void wxNotebook::SetImageList(wxImageList* imageList)
|
void wxNotebook::SetImageList(wxImageList* imageList)
|
||||||
{
|
{
|
||||||
|
if (m_bOwnsImageList) delete m_pImageList;
|
||||||
m_pImageList = imageList;
|
m_pImageList = imageList;
|
||||||
|
m_bOwnsImageList = FALSE;
|
||||||
TabCtrl_SetImageList(m_hwnd, (HIMAGELIST)imageList->GetHIMAGELIST());
|
TabCtrl_SetImageList(m_hwnd, (HIMAGELIST)imageList->GetHIMAGELIST());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void wxNotebook::AssignImageList(wxImageList* imageList)
|
||||||
|
{
|
||||||
|
SetImageList(imageList);
|
||||||
|
m_bOwnsImageList = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// wxNotebook size settings
|
// wxNotebook size settings
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
Reference in New Issue
Block a user