Version: 2.9.4
Public Types | Public Member Functions
wxBookCtrlBase Class Reference

#include </home/zeitlin/src/wx/github/interface/wx/bookctrl.h>

Inheritance diagram for wxBookCtrlBase:

Detailed Description

A book control is a convenient way of displaying multiple pages of information, displayed one page at a time.

wxWidgets has five variants of this control:

This abstract class is the parent of all these book controls, and provides their basic interface. This is a pure virtual class so you cannot allocate it directly.

Library:  wxCore
Category:  Book Controls
参照:
wxBookCtrl Overview

Public Types

enum  { NO_IMAGE = -1 }

Public Member Functions

 wxBookCtrlBase ()
 Default ctor.
 wxBookCtrlBase (wxWindow *parent, wxWindowID winid, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=0, const wxString &name=wxEmptyString)
 Constructs the book control with the given parameters.
bool Create (wxWindow *parent, wxWindowID winid, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=0, const wxString &name=wxEmptyString)
 Constructs the book control with the given parameters.
virtual void SetPageSize (const wxSize &size)
 Sets the width and height of the pages.
virtual int HitTest (const wxPoint &pt, long *flags=NULL) const
 Returns the index of the tab at the specified position or wxNOT_FOUND if none.
Image list functions

Each page may have an attached image.

The functions of this group manipulate that image.

virtual int GetPageImage (size_t nPage) const =0
 Returns the image index for the given page.
virtual bool SetPageImage (size_t page, int image)=0
 Sets the image index for the given page.
Page text functions

Each page has a text string attached.

The functions of this group manipulate that text.

virtual wxString GetPageText (size_t nPage) const =0
 Returns the string for the given page.
virtual bool SetPageText (size_t page, const wxString &text)=0
 Sets the text for the given page.
Selection functions

The functions of this group manipulate the selection.

virtual int GetSelection () const =0
 Returns the currently selected page, or wxNOT_FOUND if none was selected.
wxWindowGetCurrentPage () const
 Returns the currently selected page or NULL.
virtual int SetSelection (size_t page)=0
 指定されたページを選択し、以前選択していたページを返却します。
void AdvanceSelection (bool forward=true)
 タブを循環させます。
virtual int ChangeSelection (size_t page)=0
 指定されたページを変更し、以前選択していたページを返却します。
Page management functions

Functions for adding/removing pages from this control.

virtual bool AddPage (wxWindow *page, const wxString &text, bool select=false, int imageId=NO_IMAGE)
 新しいページを追加します。
virtual bool DeleteAllPages ()
 Deletes all pages.
virtual bool DeletePage (size_t page)
 指定されたページと、それに関連するウィンドウを削除します。
virtual bool InsertPage (size_t index, wxWindow *page, const wxString &text, bool select=false, int imageId=NO_IMAGE)=0
 Inserts a new page at the specified position.
virtual bool RemovePage (size_t page)
 Deletes the specified page, without deleting the associated window.
virtual size_t GetPageCount () const
 Returns the number of pages in the control.
wxWindowGetPage (size_t page) const
 Returns the window at the given page position.

List of all members.


Member Enumeration Documentation

anonymous enum
Enumerator:
NO_IMAGE 

Symbolic constant indicating that no image should be used.


Constructor & Destructor Documentation

wxBookCtrlBase::wxBookCtrlBase ( )

Default ctor.

wxBookCtrlBase::wxBookCtrlBase ( wxWindow parent,
wxWindowID  winid,
const wxPoint pos = wxDefaultPosition,
const wxSize size = wxDefaultSize,
long  style = 0,
const wxString name = wxEmptyString 
)

Constructs the book control with the given parameters.

See Create() for two-step construction.


Member Function Documentation

virtual bool wxBookCtrlBase::AddPage ( wxWindow page,
const wxString text,
bool  select = false,
int  imageId = NO_IMAGE 
) [virtual]

新しいページを追加します。

The page must have the book control itself as the parent and must not have been added to this control previously.

The call to this function may generate the page changing events.

Parameters:
pageSpecifies the new page.
textSpecifies the text for the new page.
selectSpecifies whether the page should be selected.
imageIdSpecifies the optional image index for the new page.
Returns:
true if successful, false otherwise.
注意:
Do not delete the page, it will be deleted by the book control.
参照:
InsertPage()

Reimplemented in wxAuiNotebook, and wxTreebook.

void wxBookCtrlBase::AdvanceSelection ( bool  forward = true)

タブを循環させます。

The call to this function generates the page changing events.

Reimplemented in wxAuiNotebook.

virtual int wxBookCtrlBase::ChangeSelection ( size_t  page) [pure virtual]

指定されたページを変更し、以前選択していたページを返却します。

This function behaves as SetSelection() but does not generate the page changing events.

See User Generated Events vs Programmatically Generated Events for more information.

Implemented in wxAuiNotebook, and wxNotebook.

bool wxBookCtrlBase::Create ( wxWindow parent,
wxWindowID  winid,
const wxPoint pos = wxDefaultPosition,
const wxSize size = wxDefaultSize,
long  style = 0,
const wxString name = wxEmptyString 
)

Constructs the book control with the given parameters.

Reimplemented from wxWindow.

Reimplemented in wxChoicebook, wxListbook, wxNotebook, wxToolbook, and wxTreebook.

virtual bool wxBookCtrlBase::DeleteAllPages ( ) [virtual]

Deletes all pages.

Reimplemented in wxAuiNotebook.

virtual bool wxBookCtrlBase::DeletePage ( size_t  page) [virtual]

指定されたページと、それに関連するウィンドウを削除します。

The call to this function generates the page changing events.

Reimplemented in wxAuiNotebook, and wxTreebook.

wxWindow* wxBookCtrlBase::GetCurrentPage ( ) const

Returns the currently selected page or NULL.

Reimplemented in wxAuiNotebook.

wxWindow* wxBookCtrlBase::GetPage ( size_t  page) const

Returns the window at the given page position.

Reimplemented in wxAuiNotebook.

virtual size_t wxBookCtrlBase::GetPageCount ( ) const [virtual]

Returns the number of pages in the control.

Reimplemented in wxAuiNotebook.

virtual int wxBookCtrlBase::GetPageImage ( size_t  nPage) const [pure virtual]

Returns the image index for the given page.

Implemented in wxNotebook.

virtual wxString wxBookCtrlBase::GetPageText ( size_t  nPage) const [pure virtual]

Returns the string for the given page.

Implemented in wxAuiNotebook, and wxNotebook.

virtual int wxBookCtrlBase::GetSelection ( ) const [pure virtual]

Returns the currently selected page, or wxNOT_FOUND if none was selected.

Note that this method may return either the previously or newly selected page when called from the EVT_BOOKCTRL_PAGE_CHANGED handler depending on the platform and so wxBookCtrlEvent::GetSelection should be used instead in this case.

Implemented in wxAuiNotebook, wxNotebook, and wxTreebook.

virtual int wxBookCtrlBase::HitTest ( const wxPoint pt,
long *  flags = NULL 
) const [virtual]

Returns the index of the tab at the specified position or wxNOT_FOUND if none.

If flags parameter is non-NULL, the position of the point inside the tab is returned as well.

Parameters:
ptSpecifies the point for the hit test.
flagsReturn more details about the point, see returned value is a combination of wxBK_HITTEST_NOWHERE, wxBK_HITTEST_ONICON, wxBK_HITTEST_ONLABEL, wxBK_HITTEST_ONITEM, wxBK_HITTEST_ONPAGE.
Returns:
Returns the zero-based tab index or wxNOT_FOUND if there is no tab at the specified position.
virtual bool wxBookCtrlBase::InsertPage ( size_t  index,
wxWindow page,
const wxString text,
bool  select = false,
int  imageId = NO_IMAGE 
) [pure virtual]

Inserts a new page at the specified position.

Parameters:
indexSpecifies the position for the new page.
pageSpecifies the new page.
textSpecifies the text for the new page.
selectSpecifies whether the page should be selected.
imageIdSpecifies the optional image index for the new page.
Returns:
true if successful, false otherwise.
注意:
Do not delete the page, it will be deleted by the book control.
参照:
AddPage()

Implemented in wxAuiNotebook, wxNotebook, and wxTreebook.

virtual bool wxBookCtrlBase::RemovePage ( size_t  page) [virtual]

Deletes the specified page, without deleting the associated window.

Reimplemented in wxAuiNotebook.

virtual bool wxBookCtrlBase::SetPageImage ( size_t  page,
int  image 
) [pure virtual]

Sets the image index for the given page.

image is an index into the image list which was set with SetImageList().

Implemented in wxAuiNotebook, and wxNotebook.

virtual void wxBookCtrlBase::SetPageSize ( const wxSize size) [virtual]

Sets the width and height of the pages.

注:
This method is currently not implemented for wxGTK.
virtual bool wxBookCtrlBase::SetPageText ( size_t  page,
const wxString text 
) [pure virtual]

Sets the text for the given page.

Implemented in wxAuiNotebook, and wxNotebook.

virtual int wxBookCtrlBase::SetSelection ( size_t  page) [pure virtual]

指定されたページを選択し、以前選択していたページを返却します。

Notice that the call to this function generates the page changing events, use the ChangeSelection() function if you don't want these events to be generated.

参照:
GetSelection()

Implemented in wxAuiNotebook, and wxNotebook.

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines