wxWidgets自学笔记
文章平均质量分 78
海阳宜家电脑
山东省海阳市黄山街5-5号
展开
-
undefined reference to `__imp_glClear‘
在wxWidgets里使用opengl,如果编译出现类似错误,请增加图示的3个库原创 2021-10-13 19:19:17 · 963 阅读 · 0 评论 -
53、 wxWidgets之自定义wxDataViewProgressRenderer
class MyDataViewProgressRenderer: public wxDataViewProgressRenderer{public: MyDataViewProgressRenderer( const wxString &label,const wxString &varianttype, wxDataViewCellMode mode, int align ) : wxDataViewProgressRenderer( label...原创 2021-09-16 09:52:21 · 257 阅读 · 0 评论 -
52、wxWidgets之自定义wxCombox的弹出窗口-wxListView
#include <wx/wx.h>#include <wx/combo.h>#include <wx/listctrl.h>class wxListViewComboPopup : public wxListView, public wxComboPopup{public: virtual wxListView* GetListView(); // Initialize member variables virtual voi...原创 2021-09-16 09:21:05 · 438 阅读 · 0 评论 -
51、wxWidgets绘画之自定义线条wxPENSTYLE_USER_DASH
#include <wx/wx.h>#include <wx/dcbuffer.h>#include <wx/graphics.h>class Simple:public wxFrame{public: Simple(const wxString& title);protected: void OnPaint(wxPaintEvent& event); void OnTimer(wxCommandEvent&...原创 2021-09-14 11:44:37 · 385 阅读 · 0 评论 -
50、wxWidgets之自定义wxGrideCellEnumRenderer
表格中的某一列的值为0 、1、2。如果想显示为 等待、生产、完成等字符串,使用官方的wxGrideCellEnumRenderer有点小bug,需要自定义一个render来实现。class MyGridCellEnumRenderer : public wxGridCellChoiceRenderer{public: MyGridCellEnumRenderer( const wxString& choices = wxEmptyString ); // draw...原创 2021-09-10 23:44:27 · 251 阅读 · 0 评论 -
49、wxWidgets之wxPopupTransientWindow
#include <wx/wx.h>#include <wx/popupwin.h>class Simple:public wxFrame{public: Simple(const wxString& title);private: void OnRightDown(wxMouseEvent& event); wxPopupTransientWindow* mMyPopup;};Simple::Simple(...原创 2021-09-07 19:33:43 · 295 阅读 · 0 评论 -
48、wxWidgets游戏之俄罗斯方块
一、方块类//Shape是所有方块的代码///方块样式enum Tetrominoes{NoShape,ZShape,SShape,LineShape,TShape,SquareShape,LShape,MirroredShape};class Shape{public: Shape(){SetShape(NoShape);} void SetShape(Tetrominoes shape); void SetRandomShape(); Tetro...原创 2021-09-07 12:06:05 · 898 阅读 · 0 评论 -
47、wxWidgets自定义控件2
与上章相比,增加一个自定义控件 MySlider一、MySlider控件#include <wx/wx.h>wxDECLARE_EVENT(MY_EVENT,wxCommandEvent);class MySlider:public wxPanel{public: MySlider(wxPanel* parent);protected: void m_slider_Scroll(wxScrollEvent& event); w...原创 2021-08-27 20:14:39 · 272 阅读 · 0 评论 -
46、wxWidgets自定义控件1
一、自定义控件MyPanelclass MyPanel:public wxPanel{public: MyPanel(wxPanel* parent); int GetCurWidth(){return cur_width;}; void SetCurWidth(int n){cur_width = n;};protected: void OnSize(wxSizeEvent& event); void OnPaint(wxPaintEven...原创 2021-08-23 20:13:15 · 560 阅读 · 0 评论 -
45、wxWidgets绘画之形状
#include <wx/wx.h>class Simple:public wxFrame{public: Simple(const wxString& title);protected: void OnPaint(wxPaintEvent& event);};Simple::Simple(const wxString& title) :wxFrame(NULL,-1,title,wxPoint(-1,-1),wxS...原创 2021-08-22 18:51:22 · 368 阅读 · 0 评论 -
44、wxWidgets绘画之渐变
class Simple:public wxFrame{public: Simple(const wxString& title);protected: void OnPaint(wxPaintEvent& event);};Simple::Simple(const wxString& title) :wxFrame(NULL,-1,title,wxPoint(-1,-1),wxSize(680,580)){ wxClie...原创 2021-08-21 15:50:32 · 329 阅读 · 0 评论 -
43、wxWidgets绘画之形状运算操作
#include <wx/wx.h>#include <wx/region.h>class Simple:public wxFrame{public: Simple(const wxString& title);protected: void OnPaint(wxPaintEvent& event);};Simple::Simple(const wxString& title) :wxFrame(NULL,...原创 2021-08-17 19:20:05 · 344 阅读 · 0 评论 -
42、wxWidgets绘画之画笔 wxPen
#include <wx/wx.h>class Simple:public wxFrame{public: Simple(const wxString& title);protected: void OnPaint(wxPaintEvent& event);};Simple::Simple(const wxString& title) :wxFrame(NULL,-1,title,wxPoint(-1,-1),wxSiz...原创 2021-08-17 10:38:54 · 368 阅读 · 0 评论 -
41、wxWidgets绘画之基础
#include <wx/wx.h>class Simple:public wxFrame{public: Simple(const wxString& title);protected: void OnPaint(wxPaintEvent& event);};Simple::Simple(const wxString& title) :wxFrame(NULL,-1,title,wxPoint(-1,-1),wxSi...原创 2021-08-17 08:50:10 · 438 阅读 · 0 评论 -
40、wxWidgets拖放 Drag and drop
#ifndef WX_PRECOMP #define WX_PRECOMP #include <wx/wx.h>#endif // WX_PRECOMP#include <wx/dnd.h>#include <wx/dir.h>#include <wx/dirctrl.h>#include <wx/splitter.h>#include <wx/listctrl.h>#include "myte...原创 2021-08-15 19:41:16 · 391 阅读 · 0 评论 -
39、wxWidgets小部件之wxToolBook
#include <wx/wx.h>#include <wx/toolbook.h>class Simple:public wxFrame{public: Simple(const wxString& title);protected: void OnQuit(wxCommandEvent& event); void OnChanged(wxBookCtrlEvent& event); wxToolbo...原创 2021-08-15 17:10:28 · 172 阅读 · 0 评论 -
38、wxWidgets小部件之wxSimpleBook
#include <wx/wx.h>#include <wx/simplebook.h>class Simple:public wxFrame{public: Simple(const wxString& title);protected: void OnQuit(wxCommandEvent& event); void OnChanged(wxBookCtrlEvent& event); void OnB...原创 2021-08-15 11:42:14 · 341 阅读 · 0 评论 -
37、wxWidgets小部件之wxTreebook
#include <wx/wx.h>#include <wx/treebook.h>#include <wx/treectrl.h>class Simple:public wxFrame{public: Simple(const wxString& title);protected: void OnQuit(wxCommandEvent& event); void OnChanged(wxBookCtrlEv...原创 2021-08-12 22:09:22 · 301 阅读 · 0 评论 -
36、wxWidgets小部件之wxChoicebook
MyGrid请参照https://blog.csdn.net/sq8706/article/details/119638263#include <wx/wx.h>#include <wx/choicebk.h>class Simple:public wxFrame{public: Simple(const wxString& title);protected: void OnQuit(wxCommandEvent& event)...原创 2021-08-12 19:30:09 · 253 阅读 · 0 评论 -
35、wxWidgets小部件之wxListBook
MyGrid请参照上一章https://blog.csdn.net/sq8706/article/details/119638263#include <wx/wx.h>#include <wx/listbook.h>#include <wx/listctrl.h>#include "mygrid.h"class Simple:public wxFrame{public: Simple(const wxString& title);...原创 2021-08-12 12:25:54 · 372 阅读 · 0 评论 -
34、wxWidgets小部件之wxNoteBook
一、Grid控件类class MyGrid:public wxGrid{public: MyGrid(wxNotebook* parent);};MyGrid::MyGrid(wxNotebook* parent) :wxGrid(parent,-1){ CreateGrid(30,30); SetRowLabelSize(50); SetColLabelSize(25); SetRowLabelAlignment(wxALIGN_RIG...原创 2021-08-12 10:59:53 · 693 阅读 · 0 评论 -
33、wxWidgets小部件之wxListView
文档原文:This class currently simply presents a simpler to use interface for thewxListCtrl– it can be thought of as afaçadefor that complicated class.Using it is preferable to usingwxListCtrldirectly whenever possible because in the future some po...原创 2021-08-10 18:05:31 · 428 阅读 · 0 评论 -
32、wxWidgets小部件之wxDataViewListCtrl
#include <wx/wx.h>#include <wx/dataview.h>#include <wx/splash.h>class Simple:public wxFrame{public: Simple(const wxString& title );};Simple::Simple(const wxString& title) :wxFrame(NULL,-1,title){ wxImag...原创 2021-08-08 20:39:45 · 1185 阅读 · 0 评论 -
31、wxWidgets小部件之wxListCtrl
目前做的是一个简单的示例,以后用到了再深入研究。敬请谅解#include <wx/wx.h>#include <wx/listctrl.h>class Simple:public wxFrame{public: Simple(const wxString& title);protected:};Simple::Simple(const wxString& title) :wxFrame(NULL,-1,title)...原创 2021-08-08 20:17:37 · 1137 阅读 · 0 评论 -
30、wxWidgets小部件之wxListBox
#ifndef WX_PRECOMP#include <wx/wx.h>#endif // WX_PRECOMP#include <wx/listbox.h>#include "mypanel.h"class Simple:public wxFrame{public: Simple(const wxString& title); wxListBox* listbox;protected: void OnDblClick(...原创 2021-08-07 20:17:04 · 481 阅读 · 0 评论 -
29、wxWidgets小部件之wxStaticText和wxStaticLine
class TestStaticText:public wxFrame{public: TestStaticText(const wxString& title);protected: wxStaticText* st; wxStaticLine* sl;};TestStaticText::TestStaticText(const wxString& title) :wxFrame(NULL,-1,title){ SetBa...原创 2021-07-28 19:42:20 · 629 阅读 · 0 评论 -
28、wxWidgets小部件之wxBitmapToggleButton
#include <wx/wx.h>#include <wx/tglbtn.h>class TestBitmapToggleButton:public wxFrame{public: TestBitmapToggleButton(const wxString& title);protected: void BitmapButton_OnToggle(wxCommandEvent& event); wxBit...原创 2021-07-28 15:50:35 · 239 阅读 · 0 评论 -
27、wxWidgets小部件之wxToggleButton
class TestToggleButton:public wxFrame{public: TestToggleButton(const wxString& title);protected: void OnToggleRed(wxCommandEvent& event); void OnToggleGreen(wxCommandEvent& event); void OnToggleBlue(wxCommandEvent&...原创 2021-07-27 20:56:03 · 287 阅读 · 0 评论 -
26、wxWidgets小部件之wxSlider和wxSpinCtrl
支持以下样式:wxSL_HORIZONTAL: 水平显示滑块(这是默认设置)。 wxSL_VERTICAL: 垂直显示滑块。 wxSL_AUTOTICKS: 显示刻度线。仅限 Windows。 wxSL_MIN_MAX_LABELS: 显示最小、最大标签(自 wxWidgets 2.9.1 起新增)。 wxSL_VALUE_LABEL: 显示值标签(自 wxWidgets 2.9.1 起新增)。 wxSL_LABELS: 显示最小值、最大...原创 2021-07-26 21:17:37 · 402 阅读 · 0 评论 -
25、wxWidgets小部件之wxBitmapButton
class Simple:public wxFrame{public: Simple(const wxString& title);protected: wxSlider* slider; wxBitmapButton* button; int pos; void OnScroll(wxScrollEvent& event);};Simple::Simple(const wxString& titl...原创 2021-07-26 19:35:27 · 463 阅读 · 0 评论 -
24、wxWidgets小部件之wxCheckBox
class Simple:public wxFrame{public: Simple(const wxString& title);protected: void OnToggle(wxCommandEvent& event); void cbThreeState_OnToggle(wxCommandEvent& event); wxCheckBox* cbNormal; wxCheckBox* cbThreeState;...原创 2021-07-26 16:48:01 · 478 阅读 · 0 评论 -
23、wxWidgets对话框之自定义对话框
class MyCustomDialog:public wxDialog{public: MyCustomDialog(const wxString& title);protected: void OnClose(wxCommandEvent& event); void OnCloseWindow(wxCloseEvent& event);};MyCustomDialog::MyCustomDialog(const wxStr...原创 2021-07-25 22:08:22 · 361 阅读 · 0 评论 -
22、wxWidgets对话框之wxFontDialog
class MyFontDialog:public wxFrame{public: MyFontDialog(const wxString& title);protected: void OnOpen(wxCommandEvent& event); wxTextCtrl* tc;};MyFontDialog::MyFontDialog(const wxString& title) :wxFrame(NULL,-1,title)...原创 2021-07-23 11:59:09 · 167 阅读 · 0 评论 -
21、wxWidget对话框之wxFileDialog
#include <wx/wx.h>#include <wx/wfstream.h>class MyFileDialog:public wxFrame{public: MyFileDialog(const wxString& title);protected: wxTextCtrl* tc; void OnOpen(wxCommandEvent& event); void OnOpenStream(wxCommandEve...原创 2021-07-22 22:29:14 · 560 阅读 · 0 评论 -
二十、wxWidgets对话框之wxMessageDialog消息对话框
class MyMessage:public wxFrame{public: MyMessage(const wxString& title);protected: void ShowInfo(wxCommandEvent& event); void ShowError(wxCommandEvent& event); void ShowQuestion(wxCommandEvent& event); ...原创 2021-07-22 21:16:36 · 1013 阅读 · 1 评论 -
十九、wxWidgets布局之wxWrapSizer
wxWrapSizer是将部件在某个方向(由wxHORIZONTAL或wxVERTICAL决定)一直排列,如果空间不足,就另起一行或是一列。class LayoutWrapSizer:public wxFrame{public: LayoutWrapSizer(const wxString& title);};LayoutWrapSizer::LayoutWrapSizer(const wxString& title) :wxFrame(NULL,wxI...原创 2021-07-16 20:40:07 · 510 阅读 · 0 评论 -
十八、wxWidget布局之wxStaticBoxSizer
class LayoutStaticboxSizer:public wxFrame{public : LayoutStaticboxSizer(const wxString& title);};LayoutStaticboxSizer::LayoutStaticboxSizer(const wxString& title) :wxFrame(NULL,wxID_ANY,title,wxDefaultPosition,wxDefaultSize){...原创 2021-07-15 22:01:07 · 542 阅读 · 0 评论 -
十七、wxWidgets布局之wxGrigBagSizer
wxSpan行和列跨越属性原创 2021-07-15 21:06:26 · 818 阅读 · 0 评论 -
十六、wxWidgets布局之 wxFlexGridSizer
class LayoutFlexgridSizer:public wxFrame{public: LayoutFlexgridSizer(const wxString& title);};LayoutFlexgridSizer::LayoutFlexgridSizer(const wxString& title) :wxFrame(NULL,wxID_ANY,title,wxPoint(-1,-1),wxSize(-1,-1)){ wxFlexGrid...原创 2021-07-15 20:13:12 · 1160 阅读 · 0 评论 -
十五、wxWidgets布局之wxGridSizer
wxGridSizer在二维表中布置小部件。表格中的每个单元格都具有相同的大小。原创 2021-07-15 15:25:13 · 655 阅读 · 0 评论