-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbits.ui.h
More file actions
195 lines (162 loc) · 5.44 KB
/
bits.ui.h
File metadata and controls
195 lines (162 loc) · 5.44 KB
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
/******************************************************************************
**
** bits - an application to arithmeticall and logically combine and
** manipulate bit patterns and their corresponding hex numbers.
**
** Tony Camuso
** Created December, 2011
**
** bits (bitview) is free software. You can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** GNU General Public License http://www.gnu.org/licenses/gpl.html
**
** Copyright (c) 2011-2014 by Tony Camuso.
**
******************************************************************************/
/********************************************************************************
** bits.ui.h
**
** Author: Tony Camuso
** Date : 20110729 29-Jul-2011
**
** Ordinarily, the QtDesigner creates a bits.ui xml file that gets compiled
** into a C++ header file at build time. That file is destroyed and recreated
** on every build, so edits to it are pointless.
** The header file created from the xml file instantiates the User Interface,
** which becomes the main window when its "show()" member function is called.
**
** The file name of this auto-generated header is prepended with "ui_" and
** postpended with the name of the project. For example, the file generated
** for this project is ui_bits.h.
**
** In order to ease the learning curve, having had little success with
** creating and adding layouts to the main window ui, I decided to not
** include the generated file, and instead copy its contents into a new
** header file, where customizations can take place easily.
**
** I'm certain there's a better way, but I just need to get going. I will
** experiment with the finer points later.
**
********************************************************************************/
#ifndef UI_BITS_H
#define UI_BITS_H
#if QT_VERSION < 0x50000
#include <QtCore/QVariant>
#include <QtGui/QAction>
#include <QtGui/QApplication>
#include <QtGui/QButtonGroup>
#include <QtGui/QHeaderView>
#include <QtGui/QMainWindow>
#include <QtGui/QMenuBar>
#include <QtGui/QPushButton>
#include <QtGui/QRadioButton>
#include <QtGui/QStatusBar>
#include <QtGui/QTextEdit>
#include <QtGui/QToolBar>
#include <QtGui/QWidget>
#endif
#if QT_VERSION == 0x50101
#include <QVariant>
#include <QAction>
#include <QApplication>
#include <QButtonGroup>
#include <QHeaderView>
#include <QMainWindow>
#include <QMenuBar>
#include <QPushButton>
#include <QRadioButton>
#include <QStatusBar>
#include <QTextEdit>
#include <QToolBar>
#include <QWidget>
#endif
#include "BitButton.h"
#include "hexedit.h"
#include "controlgroup.h"
#include "shiftop.h"
#define QT_USE_FAST_CONCATENATION // use % instead of + for
// string concatenation
// Main Window Geometry
// ====================
#define MAINWINDOW_W 716
#define MAINWINDOW_H 360
//#define MAINWINDOW_H 260
#define INIT_BITSIZE 32 // The default bit count
#define X_START 30
#define Y_START 30
// BitButton and BitButton Label Geometry
// ======================================
#define BITS 64
#define ROWS (BITS/32)
#define COLS (BITS/2)
#define BB_X 670
#define BB_Y 220
#define BB_W 18
#define BB_H 22
#define BB_MARGIN 0
#define NYB_MARGIN 12
#define ROW_MARGIN (BB_H + (BB_H / 2))
#define BB_LABEL_W BB_W
#define BB_LABEL_H BB_H
// HexEdit Combo Box Geometry
// ==========================
enum hexedit_t
{
hex_left, hex_right, hex_result, hex_array_size
};
#define HE_W 200
#define HE_H 30
#define HE_LEFT_X X_START
#define HE_LEFT_Y Y_START
#define HE_SKIP_W 38
QT_BEGIN_NAMESPACE
class Ui_bits
{
public:
QWidget *centralWidget;
QTextEdit *messages;
BitButton *bb[BITS];
QLabel *bbLabel[BITS];
QFrame *bbFrame;
HexEdit *hexedit[hex_array_size];
QButtonGroup *bbConnectGroup;
QButtonGroup *shiftConnectGroup;
QMenuBar *menuBar;
//QToolBar *mainToolBar;
//QStatusBar *statusBar;
void setupUi(QMainWindow *bits)
{
if (bits->objectName().isEmpty())
bits->setObjectName(QString::fromUtf8("bits"));
bits->resize(MAINWINDOW_W, MAINWINDOW_H);
centralWidget = new QWidget(bits);
centralWidget->setObjectName(QString::fromUtf8("centralWidget"));
bits->setCentralWidget(centralWidget);
menuBar = new QMenuBar(bits);
menuBar->setObjectName(QString::fromUtf8("menuBar"));
menuBar->setGeometry(QRect(0, 0, 760, 20));
bits->setMenuBar(menuBar);
#if 0
mainToolBar = new QToolBar(bits);
mainToolBar->setObjectName(QString::fromUtf8("mainToolBar"));
bits->addToolBar(Qt::TopToolBarArea, mainToolBar);
statusBar = new QStatusBar(bits);
statusBar->setObjectName(QString::fromUtf8("statusBar"));
bits->setStatusBar(statusBar);
#endif
QMetaObject::connectSlotsByName(bits);
} // setupUi
};
namespace Ui {
class bits: public Ui_bits {};
} // namespace Ui
QT_END_NAMESPACE
#endif // UI_BITS_H