wx.BookCtrlBase
wx.BookCtrlBase
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:
- wx.Choicebook: controlled by a wx.Choice
- wx.Listbook: controlled by a wx.ListCtrl
- wx.Notebook: uses a row of tabs
- wx.Treebook: controlled by a wx.TreeCtrl
- wx.Toolbook: controlled by a wx.ToolBar
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.
See also
Class Hierarchy
Inheritance diagram for class BookCtrlBase:
Known Subclasses
wx.aui.AuiNotebook, wx.Choicebook, wx.Listbook, wx.Notebook, Simplebook , wx.Toolbook, wx.Treebook
Methods Summary
__init__ |
Default constructor. |
AddPage |
Adds a new page. |
AdvanceSelection |
Cycles through the tabs. |
ChangeSelection |
Changes the selection to the given page, returning the previous selection. |
Create |
Constructs the book control with the given parameters. |
DeleteAllPages |
Deletes all pages. |
DeletePage |
Deletes the specified page, and the associated window. |
FindPage |
Returns the index of the specified tab window or NOT_FOUND if not found. |
GetCurrentPage |
Returns the currently selected page or None. |
GetPage |
Returns the window at the given page position. |
GetPageCount |
Returns the number of pages in the control. |
GetPageImage |
Returns the image index for the given page. |
GetPageText |
Returns the string for the given page. |
GetSelection |
Returns the currently selected page, or NOT_FOUND if none was selected. |
HitTest |
Returns the index of the tab at the specified position or NOT_FOUND if none. |
InsertPage |
Inserts a new page at the specified position. |
RemovePage |
Deletes the specified page, without deleting the associated window. |
SetPageImage |
Sets the image index for the given page. |
SetPageSize |
Sets the width and height of the pages. |
SetPageText |
Sets the text for the given page. |
SetSelection |
Sets the selection to the given page, returning the previous selection. |
Properties Summary
CurrentPage |
See GetCurrentPage |
PageCount |
See GetPageCount |
Selection |
See GetSelection andSetSelection |
Class API
- class
wx.BookCtrlBase(Control, WithImages) -
Possible constructors:
BookCtrlBase() BookCtrlBase(parent, winid, pos=DefaultPosition, size=DefaultSize,
style=0, name="")A book control is a convenient way of displaying multiple pages of information, displayed one page at a time.
Methods
__init__(self, *args, **kw)-
Overloaded Implementations:
__init__ (self)
Default constructor.
__init__ (self, parent, winid, pos=DefaultPosition, size=DefaultSize, style=0, name=””)
Constructs the book control with the given parameters.
See
Createfor two-step construction.Parameters:
AddPage(self, page, text, select=False, imageId=NO_IMAGE)-
Adds a new page.
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: - page (wx.Window) – Specifies the new page.
- text (string) – Specifies the text for the new page.
- select (bool) – Specifies whether the page should be selected.
- imageId (int) – Specifies the optional image index for the new page.
Return type: bool
Returns: Trueif successful,Falseotherwise.Note
Do not delete the page, it will be deleted by the book control.
See also
AdvanceSelection(self, forward=True)-
Cycles through the tabs.
The call to this function generates the page changing events.
Parameters: forward (bool) –
ChangeSelection(self, page)-
Changes the selection to the given page, returning the previous selection.
This function behaves as
SetSelectionbut does not generate the page changing events.See User Generated Events vs Programmatically Generated Events for more information.
Parameters: page (int) – Return type: int
Create(self, parent, winid, pos=DefaultPosition, size=DefaultSize, style=0, name="")-
Constructs the book control with the given parameters.
Parameters: Return type: bool
DeleteAllPages(self)-
Deletes all pages.
Return type: bool
DeletePage(self, page)-
Deletes the specified page, and the associated window.
The call to this function generates the page changing events.
Parameters: page (int) – Return type: bool
FindPage(self, page)-
Returns the index of the specified tab window or
NOT_FOUNDif not found.Parameters: page (wx.Window) – One of the control pages. Return type: int Returns: The zero-based tab index or NOT_FOUNDif not found.New in version 2.9.5.
GetCurrentPage(self)-
Returns the currently selected page or
None.Return type: wx.Window
GetPage(self, page)-
Returns the window at the given page position.
Parameters: page (int) – Return type: wx.Window
GetPageCount(self)-
Returns the number of pages in the control.
Return type: int
GetPageImage(self, nPage)-
Returns the image index for the given page.
Parameters: nPage (int) – Return type: int
GetPageText(self, nPage)-
Returns the string for the given page.
Parameters: nPage (int) – Return type: string
GetSelection(self)-
Returns the currently selected page, or
NOT_FOUNDif none was selected.Note that this method may return either the previously or newly selected page when called from the
EVT_BOOKCTRL_PAGE_CHANGEDhandler depending on the platform and sowx.BookCtrlEvent.GetSelectionshould be used instead in this case.Return type: int
HitTest(self, pt)-
Returns the index of the tab at the specified position or
NOT_FOUNDif none.If flags parameter is not
None, the position of the point inside the tab is returned as well.Parameters: pt (wx.Point) – Specifies the point for the hit test. Return type: tuple Returns: ( int, flags )
InsertPage(self, index, page, text, select=False, imageId=NO_IMAGE)-
Inserts a new page at the specified position.
Parameters: - index (int) – Specifies the position for the new page.
- page (wx.Window) – Specifies the new page.
- text (string) – Specifies the text for the new page.
- select (bool) – Specifies whether the page should be selected.
- imageId (int) – Specifies the optional image index for the new page.
Return type: bool
Returns: Trueif successful,Falseotherwise.Note
Do not delete the page, it will be deleted by the book control.
See also
RemovePage(self, page)-
Deletes the specified page, without deleting the associated window.
Parameters: page (int) – Return type: bool
SetPageImage(self, page, image)-
Sets the image index for the given page.
image is an index into the image list which was set with
SetImageList.Parameters: - page (int) –
- image (int) –
Return type: bool
SetPageSize(self, size)-
Sets the width and height of the pages.
Parameters: size (wx.Size) – Note
This method is currently not implemented for wxGTK.
SetPageText(self, page, text)-
Sets the text for the given page.
Parameters: - page (int) –
- text (string) –
Return type: bool
SetSelection(self, page)-
Sets the selection to the given page, returning the previous selection.
Notice that the call to this function generates the page changing events, use the
ChangeSelectionfunction if you don’t want these events to be generated.Parameters: page (int) – Return type: int See also
Properties
CurrentPage-
See
GetCurrentPage
PageCount-
See
GetPageCount
Selection-
See
GetSelectionandSetSelection
wx.BookCtrlBase的更多相关文章
- wx
wx The classes in this module are the most commonly used classes for wxPython, which is why they hav ...
- wx.Notebook
wx.Notebook This class represents a notebook control, which manages multiple windows with associated ...
- wx.onMenuShareTimeline使用注意事项
我在开发测试过程中,发现使用wx.onMenuShareTimeline无效果,没有显示我定义的图片.title和链接,经过调试发现原因如下: 1.图片大小要大于300pix才能显示 2.这个方法必须 ...
- 微信小程序 wx.uploadFile在安卓手机上面the same task is working问题解决
微信小程序上传图片的时候,如果是多图片上传,一般都是直接用一个循环进行wx.uploadFile 这个在电脑上面测试与苹果手机上面都不会有什么问题 但当用安卓测试的时候,你会发现小程序会提示一个the ...
- 微信 小程序 drawImage wx.canvasToTempFilePath wx.saveFile 获取设备宽高 尺寸问题
以下问题测试环境为微信开发者0.10.102800,手机端iphone6,如有不对敬谢指出. 根据我的测试,context.drawImage,在开发者工具中并不能画出来,只有预览到手机中显示. wx ...
- wx.ListCtrl简单使用例子
效果图: 示例代码: #! /usr/bin/env python #coding=utf-8 import wx import sys packages = [('jessica alba', 'p ...
- wx.html2.WebView在 target="_blank" or rel="external" 没有反映的解决方法
在wx.html2.EVT_WEBVIEW_LOADED中,用WebView.RunScript运行删除链接目标的脚本 javaScriptStr = '''function deleteBlank( ...
- referenceerror wx is not defined 微信JsSdk开发
如果你和我一样遇到了“referenceerror wx is not defined”错误,很有可能是jweixin-1.0.0.js与你其它某js冲突. 解决办法: <script type ...
- wxPython安装错误问题:No module named wx
今天心血来潮安装wxPython,本机win7,且已经安装Python,版本为2.7.3,然后IDE使用的PyCharm,然后wxPython下载的版本为:wxPython2.8-win32-unic ...
随机推荐
- 浅析 C++里面的宏
说到宏,恐怕大家都能说出点东西来:一种预处理,没有分号(真的吗?).然后呢?嗯.......茫然中......好吧,我们就从这开始说起.最常见的宏恐怕是#include 了,其次就是#define 还 ...
- 几种MEMS陀螺仪(gyroscope)的设计和性能比较
现在市场上的MEMS陀螺仪主要有SYSTRON.BOSCH和INVENSENSE设计和生产.前两者设计的陀螺仪属高端产品,主要用于汽车.后者的属低端产品,主要用于消费类电子,象任天堂的Wii.ADI2 ...
- 【Xamarin 挖墙脚系列:Windows 10 一个包罗万象的系统平台】
build2016 结束后,证实了微软之前的各种传言.当然,都是好消息. Windows10 上基本可以运行主流的任意的操作系统. Windows Linux(在内部版本143216中,支持了bash ...
- Ubuntu12.04 Jdk1.7 Tomct7.0部署配置
jdk1.7 下载 http://download.oracle.com/otn-pub/java/jdk/7u67-b01/jdk-7u67-linux-x64.tar.gz?AuthParam=1 ...
- Atom编辑器快捷键大全
文件切换 ctrl-shift-s 保存所有打开的文件cmd-shift-o 打开目录cmd-\ 显示或隐藏目录树ctrl-0 焦点移到目录树目录树下,使用a,m,delete来增加,修改和删除cmd ...
- Introduction to neural network —— 该“神经网络” 下拉“祭坛”
Introduction to neural network 不能自欺欺人. 实干兴邦,空谈误国. -------------------------------------------------- ...
- oracle优化思考-双刃剑
oracle优化是一个双刃剑,特别注意这把剑用的场合:系统规划OLTP or OLAP 优化1:索引 在DML操作时.必须维护索引.假设大量的DML操作,想想看,IO是不是老高了? 索引长处:在非常多 ...
- windows平台HTTP代理server搭建(CCproxy)
HTTP代理(CCproxy) 一.拓扑图 二.CCproxy的安装和配置 1.安装CCproxy (1)下载CCproxy无线破解版(没破解的都仅仅支持最多三个用户同一时候连接). (2)按说明安装 ...
- Lucene打分规则与Similarity模块详解
搜索排序结果的控制 Lucnen作为搜索引擎中,应用最为广泛和成功的开源框架,它对搜索结果的排序,有一套十分完整的机制来控制:但我们控制搜索结果排序的目的永远只有一个,那就是信息过滤,让用户快速,准确 ...
- aspx后台生成json对象
json对象应用很广,有时,我们要把一些数据转化为json对象,就需要用到以下方法了. 1.使用Newtonsoft.Json.DLL (推荐使用) 下载地址:http://files.cnblogs ...