Inherit from nana::form

This commit is contained in:
King_DuckZ 2020-03-20 21:27:41 +01:00
parent 1c3de27a16
commit bcbefd45c9
2 changed files with 9 additions and 16 deletions

View file

@ -7,11 +7,10 @@
namespace mc {
MainWindow::MainWindow (int icon_size, int icon_fps) :
m_frm(),
m_grid1(m_frm, 3, true),
m_grid2(m_frm, 3, true),
m_label1(m_frm, "Slot 1"),
m_label2(m_frm, "Slot 2"),
m_grid1(*this, 3, true),
m_grid2(*this, 3, true),
m_label1(*this, "Slot 1"),
m_label2(*this, "Slot 2"),
m_icon_size(icon_size),
m_icon_fps(icon_fps)
{
@ -37,16 +36,12 @@ MainWindow::MainWindow (int icon_size, int icon_fps) :
m_grid2.emplace_back(duck::make_nana_animation(mc2[z], m_icon_size, m_icon_size, m_icon_fps));
}
m_frm.div("fit margin=3 <vert fit slot1> <width=25> <vert fit slot2>");
m_frm["slot1"] << m_label1 << m_grid1;
m_frm["slot2"] << m_label2 << m_grid2;
m_frm.collocate();
this->div("fit margin=3 <vert fit slot1> <width=25> <vert fit slot2>");
(*this)["slot1"] << m_label1 << m_grid1;
(*this)["slot2"] << m_label2 << m_grid2;
this->collocate();
//const MemoryCard mc(std::ifstream("/home/michele/emu/psx/WipEout 3 - Special Edition (Europe) (En,Fr,De,Es,It).srm", std::ios::binary));
//MemoryCard mc(std::ifstream("/home/michele/emu/psx/Rapid Racer (Europe) (En,Fr,De,Es,It).srm", std::ios::binary));
}
void MainWindow::show() {
m_frm.show();
}
} //namespace mc

View file

@ -5,13 +5,11 @@
#include <nana/gui/widgets/label.hpp>
namespace mc {
class MainWindow {
class MainWindow : public nana::form {
public:
MainWindow (int icon_size, int icon_fps);
void show();
private:
nana::form m_frm;
duck::widget::BlockGrid m_grid1;
duck::widget::BlockGrid m_grid2;
nana::label m_label1;