-
Notifications
You must be signed in to change notification settings - Fork 0
/
DataTableViewer.h
86 lines (63 loc) · 1.96 KB
/
DataTableViewer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#pragma once
#include <gtkmm.h>
#include <vector>
#include "libInfinite/Item.h"
#include "ViewerUtils.h"
#define HXD_ENABLE
#define HXD_COMMAND "wine \"/home/ich/.wine/drive_c/Program Files/HxD/HxD.exe\" Z:"
#define HXD_TMP_DIR "/tmp/ie/"
class DataTableViewer : public Gtk::Box{
public:
DataTableViewer();
~DataTableViewer();
void setItem(Item* item);
void selectEntry(int index);
private:
Gtk::Box* HBox;
Gtk::Frame* viewFrame;
Gtk::ScrolledWindow* scroller;
// since the colums should be resizable, I can't just use a Gtk::Grid, but instead have to use Gtk::Paned to separate two columns from each other
// and then use a Gtk::Box to get the rows. Since it will just be filled with labels, height shouldn't be an issue
Gtk::TreeView* view;
Glib::RefPtr<Gtk::ListStore> store;
Gtk::TreeViewColumn* OffsetViewColumn;
Gtk::TreeViewColumn* SizeViewColumn;
Gtk::TreeViewColumn* RegionViewColumn;
Gtk::Button* exportButton;
Gtk::FileChooserDialog* exportDialog;
Gtk::Button hexButton;
Gtk::TreeModelColumn<std::string> OffsetColumn;
Gtk::TreeModelColumn<std::string> SizeColumn;
Gtk::TreeModelColumn<std::string> RegionColumn;
Gtk::TreeModelColumn<int> indexColumn;
Item* item; // the item whose data table should be displayed
std::vector<Gtk::TreeIter> entries;
// settings
Gtk::Separator* settingsSeparator;
Gtk::Box* settingsBox; // contain the different settings for the viewer
Gtk::Label* settingsLabel;
// page controls
int page;
int pageSize;
int pageCount;
int blockCount;
Gtk::Separator* pageSeparator;
Gtk::Label* pageCountLabel;
Gtk::SpinButton* pageSizeSpinner;
Gtk::Label* pageNumberLabel;
Gtk::SpinButton* pageNumberButton;
// status bar
Gtk::Box* statusBar;
Gtk::Label* statusBlockCountLabel;
Gtk::Label* statusBlockCount;
Gtk::Label* statusShownBlocksLabel;
Gtk::Label* statusShownBlocks;
void populateTable(DataTable* table);
void updatePaging();
enum{
OFFSET_COLUMN,
SIZE_COLUMN,
REGION_COLUMN,
N_COLUMNS
};
};