KoMo2  1.0.0
A modern ARM emulator GUI.
TerminalView.cpp
Go to the documentation of this file.
1 
12 #include "TerminalView.h"
13 #include <iostream>
14 
19 TerminalView::TerminalView(MainWindowView* const parent) : parent(parent) {
22  initTextView();
23  initInputBox();
24  packChildren();
25 }
26 
31  scroll.set_size_request(948, 150);
32  scroll.get_accessible()->set_name("Terminal output");
33 }
34 
39  clearButton.set_size_request(100, 20);
40  clearButton.set_label("Clear");
41  clearButton.get_style_context()->add_class("compButtons");
42  clearButton.get_accessible()->set_name("Clear");
43  clearButton.get_accessible()->set_description(
44  "Clears the terminal of any logged information.");
45  clearButton.set_tooltip_text("Clear the terminal output pane");
46 }
47 
52  textView.set_size_request(948, 150);
53  textView.get_style_context()->add_class("terminalDisplay");
54  textView.set_wrap_mode(Gtk::WRAP_WORD_CHAR);
55  textView.set_can_focus(true);
56  textView.set_editable(false);
57  textView.get_accessible()->set_name("Terminal output window");
58  textView.set_tooltip_text("Emulator output is logged here");
59 }
60 
65  inputBox.set_size_request(848, 20);
66  inputBox.get_style_context()->add_class("terminalInput");
67  inputBox.get_accessible()->set_name("Terminal input window");
68  inputBox.set_tooltip_text("Text input here is sent to the emulator");
69 }
70 
75  layout.pack_start(inputBox, true, true);
76  layout.pack_start(clearButton, true, true);
77  scroll.add(textView);
78  pack_start(scroll, true, true);
79  pack_start(layout, true, true);
80 
81  show();
82  show_all_children();
83 }
84 
85 // !!!!!!!!!!!!!!!!!!!!!
86 // ! Getters & Setters !
87 // !!!!!!!!!!!!!!!!!!!!!
88 
94  model = val;
95 }
100 Gtk::Button* const TerminalView::getClearButton() {
101  return &clearButton;
102 }
107 Gtk::TextView* const TerminalView::getTextView() {
108  return &textView;
109 }
114 Gtk::Entry* const TerminalView::getInputBox() {
115  return &inputBox;
116 }
void initScrollView()
Initialises the scroll view.
void packChildren()
Pack all of the child elements together and show them.
Gtk::Button clearButton
The button which clears the terminal when clicked.
Definition: TerminalView.h:40
Gtk::ScrolledWindow scroll
A container class for the textView member, which allows the text box to be scrolled.
Definition: TerminalView.h:46
Gtk::Entry *const getInputBox()
Returns a constant pointer to the input box.
Represents any data or functions related to the information, or manipulation of the information...
Definition: TerminalModel.h:19
TerminalView(MainWindowView *const parent)
Construct a new TerminalView::TerminalView object.
Gtk::TextView textView
A TextView which displays any output from Jimulator and KoMo2.
Definition: TerminalView.h:51
void initClearButton()
Initialises the clear button.
Gtk::Button *const getClearButton()
Returns a constant pointer to the clear button.
void setModel(TerminalModel *const val)
Sets the model member.
void initInputBox()
Initialises the input box.
Gtk::Entry inputBox
An input box which directly pipes information into Jimulator.
Definition: TerminalView.h:56
Gtk::TextView *const getTextView()
Returns a constant pointer to the output box.
The class definition of the main window of the program. This main window is the mater view of the pro...
Gtk::HButtonBox layout
A layout which allows for the inputBox and clearButton to be placed side-by-side. ...
Definition: TerminalView.h:62
Declares the TerminalView class, which is an element of the KoMo2 GUI which represents the input & ou...
void initTextView()
Initialises the output box.
TerminalModel * model
A pointer to the related model.
Definition: TerminalView.h:72