testing-repository/Gtkmm3/gtk141_minesweeper2/src/InputBox.hh

37 lines
875 B
C++
Raw Normal View History

2022-10-17 22:21:25 +08:00
#pragma once
#include <gtkmm.h>
2022-10-19 19:46:35 +08:00
#include "jsonfile.hh"
#include "ScoresWin.hh"
2022-10-17 22:21:25 +08:00
class InputBox : public Gtk::Dialog{
public:
2022-10-19 19:46:35 +08:00
static InputBox *create();
2022-10-17 22:21:25 +08:00
InputBox(BaseObjectType *cobject, const Glib::RefPtr<Gtk::Builder> &ref_Glade);
2022-10-17 23:05:19 +08:00
void set_game_time(int time);
2022-10-19 19:46:35 +08:00
void set_scores_window(ScoresWin *win1);
2022-10-17 23:05:19 +08:00
protected:
void on_response(int response_id) override;
2022-10-17 22:21:25 +08:00
private:
2022-10-17 23:05:19 +08:00
int game_time;
// Data to write to json file
json data;
std::vector<std::string> names;
std::vector<int> times;
// Builder Object
2022-10-17 22:21:25 +08:00
Glib::RefPtr<Gtk::Builder> ref_builder;
2022-10-17 23:05:19 +08:00
// Child widget
Gtk::Entry *entry_name;
2022-10-19 19:46:35 +08:00
Gtk::CheckButton *check_scores;
// Scores Window
ScoresWin *scores_win1;
2022-10-17 23:17:11 +08:00
// Signal Handlers
void entry_activated();
2022-10-17 22:21:25 +08:00
};