1.头文件
#include <wx/notebook.h>
创建notebook
m_NoteBook =
new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 | wxTAB_TRAVERSAL );
在notebook中添加pannel并
m_PanelConcatAndZ =
new wxPanel( m_NoteBook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxBoxSizer* bSizerConcatAndZPanel;
bSizerConcatAndZPanel = new wxBoxSizer( wxVERTICAL );
m_PanelConcatAndZ->SetSizer( bSizerConcatAndZPanel );
m_PanelConcatAndZ->Layout();
bSizerConcatAndZPanel->Fit( m_PanelConcatAndZ );
m_NoteBook->AddPage( m_PanelConcatAndZ, _( "Concat And Z Conversion" ), true );
在该pannel上面的创建控件文章来源:https://www.toymoban.com/news/detail-585706.html
wxStaticText* cztopoloLabel;
cztopoloLabel = new wxStaticText( m_PanelConcatAndZ, wxID_ANY, _( "Topology:" ),
wxDefaultPosition, wxDefaultSize, 0 );
将notebook添加到布局里面
bUpperSizer->Add( m_NoteBook, 1, wxEXPAND | wxTOP | wxRIGHT | wxLEFT, 10 );
其中bUpperSizer文章来源地址https://www.toymoban.com/news/detail-585706.html
wxBoxSizer* bUpperSizer;
bUpperSizer = new wxBoxSizer( wxVERTICAL );
将第一个page设置为默认选择
// 将第一个page设置为默认选择
notebook->SetSelection(0);
总结
#include <wx/notebook.h>
#include <wx/panel.h>
wxPanel* m_PanelDispaly =new wxPanel( m_NoteBookTran, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxBoxSizer* bSizerDisplay = new wxBoxSizer( wxVERTICAL );
m_PanelDispaly->SetSizer( bSizerDisplay );
m_PanelDispaly->Layout();
bSizerDisplay->Fit( m_PanelDispaly );
m_NoteBookTran->AddPage( m_PanelDispaly, _( "Display" ), true );
// 将第一个page设置为默认选择
notebook->SetSelection(0);
bMainSizer->Add( m_NoteBookAC, 1, wxEXPAND, 5 );
到了这里,关于wxWidgets学习笔记:Tab页wxNotebook使用详解的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!