wxGrid here

https://www.researchgate.net/publication/330491902_Vibration_Condition_Monitoring_Using_Machine_Learning

 

cmake :

cmake_minimum_required(VERSION 2.6.2)

 PROJECT(Test)
 SET(wxWidgets_USE_LIBS)
 FIND_PACKAGE(wxWidgets REQUIRED COMPONENTS xml xrc  qa net gl media richtext aui adv html propgrid core base)
 IF(wxWidgets_FOUND)
   INCLUDE("${wxWidgets_USE_FILE}")
   ADD_EXECUTABLE(MyTest main.cpp Notebook.cpp)
   # and for each of your dependant executable/library targets:
   TARGET_LINK_LIBRARIES(MyTest ${wxWidgets_LIBRARIES})
 ELSE(wxWidgets_FOUND)
   # For convenience. When we cannot continue, inform the user
   MESSAGE("wxWidgets not found!")
 ENDIF(wxWidgets_FOUND)

 

notebook.h


#include <wx/wx.h>
#include <wx/notebook.h>
#include <wx/generic/grid.h>

class Notebook : public wxFrame
{
public:
    Notebook(const wxString& title);

    void OnQuit(wxCommandEvent& event);

};


class MyGrid : public wxGrid
{
public:
    MyGrid(wxNotebook *parent);

};
 

notebook.cpp

#include "Notebook.h"

Notebook::Notebook(const wxString& title)
       : wxFrame(NULL, wxID_ANY, title, wxDefaultPosition, wxSize(400, 350))
{

 

  wxNotebook *nb = new wxNotebook(this, -1, wxPoint(-1, -1),
      wxSize(-1, -1), wxNB_BOTTOM);

  wxMenuBar *menubar = new wxMenuBar;
  wxMenu *file = new wxMenu;
  file->Append(wxID_EXIT, wxT("Quit"), wxT(""));
  menubar->Append(file, wxT("&File"));
  SetMenuBar(menubar);

  Connect(wxEVT_COMMAND_MENU_SELECTED,
      wxCommandEventHandler(Notebook::OnQuit));

  MyGrid *grid1 = new MyGrid(nb);
  MyGrid *grid2 = new MyGrid(nb);
  MyGrid *grid3 = new MyGrid(nb);

  nb->AddPage(grid1, wxT("Sheet1"));
  nb->AddPage(grid2, wxT("Sheet2"));
  nb->AddPage(grid3, wxT("Sheet3"));

  CreateStatusBar();
  Center();
}


void Notebook::OnQuit(wxCommandEvent& event)
{
  Close(true);
}

MyGrid::MyGrid(wxNotebook * parent)
       : wxGrid(parent, wxID_ANY)
{
  CreateGrid(30, 30);
  SetRowLabelSize(50);
  SetColLabelSize(25);
  SetRowLabelAlignment(wxALIGN_RIGHT, wxALIGN_CENTRE);
  SetLabelFont(wxFont(9, wxFONTFAMILY_DEFAULT,
      wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD));

  for (int i = 0; i < 30 ; i++) {
      this->SetRowSize(i, 25);
  }
}
     main.h

#include <wx/wx.h>

class MyApp : public wxApp
{
  public:
    virtual bool OnInit();
};

 

main.cpp


#include "main.h"
#include "Notebook.h"

IMPLEMENT_APP(MyApp)

bool MyApp::OnInit()
{

    Notebook *notebook = new Notebook(wxT("Notebook"));
    notebook->Show(true);

    return true;
}
~     


 

 

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值