have basic wxwidgets gui working
parent
5233ad146e
commit
876bbbec3a
@ -1,4 +1,5 @@
|
||||
build
|
||||
ChibiOS_*
|
||||
**/.*
|
||||
gui/stmdspgui
|
||||
|
||||
|
@ -1,15 +1,19 @@
|
||||
#include "stmdsp.hpp"
|
||||
#include "wxapp.hpp"
|
||||
|
||||
#include <iostream>
|
||||
#include <wx/app.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
stmdsp::scanner scanner;
|
||||
wxIMPLEMENT_APP(MainApp);
|
||||
|
||||
scanner.scan();
|
||||
for (const auto& device : scanner.devices())
|
||||
std::cout << "Found stmdsp at: " << device.path() << std::endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
//int main()
|
||||
//{
|
||||
// stmdsp::scanner scanner;
|
||||
//
|
||||
// scanner.scan();
|
||||
// for (const auto& device : scanner.devices())
|
||||
// std::cout << "Found stmdsp at: " << device.path() << std::endl;
|
||||
//
|
||||
// return 0;
|
||||
//}
|
||||
|
||||
|
@ -0,0 +1,20 @@
|
||||
#ifndef WXAPP_HPP_
|
||||
#define WXAPP_HPP_
|
||||
|
||||
#include "wxmain.hpp"
|
||||
|
||||
#include <wx/app.h>
|
||||
|
||||
class MainApp : public wxApp
|
||||
{
|
||||
public:
|
||||
virtual bool OnInit() final {
|
||||
auto mainFrame = new MainFrame;
|
||||
mainFrame->Show(true);
|
||||
SetTopWindow(mainFrame);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
#endif // WXAPP_HPP_
|
||||
|
@ -0,0 +1,17 @@
|
||||
#ifndef WXMAIN_HPP_
|
||||
#define WXMAIN_HPP_
|
||||
|
||||
#include <wx/frame.h>
|
||||
#include <wx/stattext.h>
|
||||
|
||||
class MainFrame : public wxFrame
|
||||
{
|
||||
public:
|
||||
MainFrame() : wxFrame(nullptr, -1, "Hello world", wxPoint(50, 50), wxSize(640, 480))
|
||||
{
|
||||
auto lTitle = new wxStaticText(this, wxID_ANY, "Welcome to the GUI.");
|
||||
}
|
||||
};
|
||||
|
||||
#endif // WXMAIN_HPP_
|
||||
|
Loading…
Reference in New Issue