Guidance
指路人
g.yi.org
Guidance Forums / wxWidgets (wxWindows) in C++ / How to use wxNotebook?

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
Forum List • Thread List • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. How to use wxNotebook?
#3496
Posted by: 2004-03-11 20:29:25
I'm trying to do this in c++ with wxNotebook

http://www.wxpython.org/images/test4e.gif

Do you have a sample code to do this???
Message2. Re: How to use wxNotebook?
#3500
Posted by: upCASE 2004-03-12 00:28:17
Hi!
This is a code snippet for the first page (placed inside a wxFrame):

notebook_1 = new wxNotebook(this, -1, wxDefaultPosition, wxDefaultSize, 0);
notebook_1_pane_1 = new wxPanel(notebook_1, -1);
label_1 = new wxStaticText(notebook_1_pane_1, -1, wxT("You can place any window you like here..."));

label_1->SetBackgroundColour(wxColour(50, 50, 204));
label_1->SetForegroundColour(wxColour(255, 255, 255));
label_1->SetFont(wxFont(16, wxDEFAULT, wxNORMAL, wxNORMAL, 0, ""));
notebook_1_pane_1->SetBackgroundColour(wxColour(50, 50, 204));

wxBoxSizer* sizer_1 = new wxBoxSizer(wxVERTICAL);
wxBoxSizer* sizer_2 = new wxBoxSizer(wxHORIZONTAL);
sizer_2->Add(label_1, 0, wxALIGN_CENTER_VERTICAL, 0);
notebook_1_pane_1->SetAutoLayout(true);
notebook_1_pane_1->SetSizer(sizer_2);
sizer_2->Fit(notebook_1_pane_1);
sizer_2->SetSizeHints(notebook_1_pane_1);

sizer_1->Add(new wxNotebookSizer(notebook_1), 1, wxEXPAND, 0);
SetAutoLayout(true);
SetSizer(sizer_1);
sizer_1->Fit(this);
sizer_1->SetSizeHints(this);
Layout();

Have a look at the notebook example and check out the docs.

upCASE
-----------------------------------
If it was hard to write, it should be hard to read!- Do. Or do not. There is no try!
Forum List • Thread List • Refresh • New Topic • Search • Previous • Next First 1 Last
掌柜推荐
 
 
¥1,068.00 ·
 
 
¥930.00 ·
 
 
¥908.00 ·
 
 
¥1,390.00 ·
 
 
¥1,290.00 ·
 
 
¥748.00 ·
© Tue 2024-11-5  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0