-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmolecularformula.h
84 lines (67 loc) · 1.79 KB
/
molecularformula.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
/*
* File: molecularformula.h
* Author: kuestere
*
* Created on 27. September 2018, 18:36
*/
#ifndef MOLECULARFORMULA_H
#define MOLECULARFORMULA_H
#include <cstdlib>
#include <ctime>
#include <fstream>
#include <glibmm/i18n.h>
#include <gtkmm.h>
#include <iomanip>
#include <iostream>
#include <limits>
#include <locale>
#include <sstream>
#include <string>
#include "formulaparser.h"
#include "elementschema.h"
using namespace std;
class FormulaParser;
class ElementSchema;
class MolecularFormula : public Gtk::Window {
public:
MolecularFormula();
MolecularFormula(const MolecularFormula& orig);
virtual ~MolecularFormula();
private:
protected:
std::vector<Glib::ustring> m_StatusMessages = {
N_("Place holder, no error"),
N_("No formula entered"),
N_("Element symbol expected"),
N_("No valid element symbol (actual not in table)"),
N_("Too many bond signs"),
N_("Bond sign misplaced here"),
N_("Closing ) missing"),
N_("Closing ] missing"),
N_("Index 0 not allowed"),
N_("Molecular weight is too big")
};
int errorAlert(int messageNumber);
//Signal handlers for entries and buttons
void on_activated();
//Child widgets:
Gtk::Box m_VBox;
Gtk::Grid m_Grid;
Gtk::Label m_InputLabel;
Gtk::Entry m_InputEntry;
Gtk::Label m_FormulaLabel;
Gtk::Entry m_FormulaEntry;
Gtk::Label m_WeightLabel;
Gtk::Entry m_WeightEntry;
Gtk::ScrolledWindow m_TextWindow;
Gtk::Frame m_TextFrame;
Gtk::TextView m_TextView;
Glib::RefPtr<Gtk::TextBuffer> m_refTextBuffer;
std::string window_css = "\
@define-color paleazure rgb(193, 227, 255);\
#window_azure {\
border-radius: 4px;\
background-image: image(@paleazure);\
}";
};
#endif /* MOLECULARFORMULA_H */