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
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
|
/*
* khexedit - Versatile hex editor
* Copyright (C) 1999 Espen Sand, espensa@online.no
*
* This program 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 2 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.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#ifndef _OPTION_DIALOG_H_
#define _OPTION_DIALOG_H_
class TQComboBox;
class TQFrame;
class TQCheckBox;
class TQLabel;
class TQLineEdit;
class TQPushbutton;
class TQRadioButton;
class TQSpinBox;
class TQComboBox;
class TDEFontChooser;
#include <kdialogbase.h>
#include <tdelistbox.h>
#include "hexeditstate.h"
class CColorListBox : public TDEListBox
{
TQ_OBJECT
public:
CColorListBox( TQWidget *parent=0, const char * name=0, WFlags f=0 );
void setColor( uint index, const TQColor &color );
const TQColor color( uint index );
public slots:
virtual void setEnabled( bool state );
protected:
void dragEnterEvent( TQDragEnterEvent *e );
void dragLeaveEvent( TQDragLeaveEvent *e );
void dragMoveEvent( TQDragMoveEvent *e );
void dropEvent( TQDropEvent *e );
private slots:
void newColor( int index );
private:
int mCurrentOnDragEnter;
signals:
void dataChanged();
};
class CColorListItem : public TQListBoxItem
{
public:
CColorListItem( const TQString &text, const TQColor &color=TQt::black );
const TQColor &color( void );
void setColor( const TQColor &color );
protected:
virtual void paint( TQPainter * );
virtual int height( const TQListBox * ) const;
virtual int width( const TQListBox * ) const;
private:
TQColor mColor;
int mBoxWidth;
};
class COptionDialog : public KDialogBase
{
TQ_OBJECT
public:
enum EPage
{
page_layout = 0,
page_cursor,
page_font,
page_color,
page_file,
page_misc,
page_max
};
COptionDialog( TQWidget *parent = 0, char *name = 0, bool modal = false );
~COptionDialog( void );
void setLayout( SDisplayLayout &layout, SDisplayLine &line );
void setCursor( SDisplayCursor &cursor );
void setColor( SDisplayColor &color );
void setFont( SDisplayFont &font );
void setFile( SDisplayMisc &misc );
void setMisc( SDisplayMisc &misc );
void setState( SDisplayState &state );
protected:
virtual void showEvent( TQShowEvent *e );
protected slots:
void slotModeSelectorChanged( int index );
void slotLineSizeChanged( int value );
void slotColumnSizeChanged( int value );
void slotColumnSepCheck( bool state );
void slotBlinkIntervalCheck( bool state );
void slotBlockCursorCheck( bool state );
void slotFontSystem( bool state );
void slotColorSystem( bool state );
void slotThresholdConfirm( void );
virtual void slotDefault( void );
virtual void slotOk( void );
virtual void slotApply( void );
void slotChanged();
private:
struct SLayoutWidgets
{
TQComboBox *formatCombo;
TQSpinBox *lineSizeSpin;
TQSpinBox *columnSizeSpin;
TQCheckBox *lockLineCheck;
TQCheckBox *lockColumnCheck;
TQCheckBox *columnCheck;
TQComboBox *gridCombo;
TQLabel *leftSepLabel;
TQLabel *rightSepLabel;
TQSpinBox *leftSepWidthSpin;
TQSpinBox *rightSepWidthSpin;
TQSpinBox *separatorSpin;
TQSpinBox *edgeSpin;
TQLabel *columnSepLabel;
TQSpinBox *columnSepSpin;
};
struct SCursorWidgets
{
TQCheckBox *blinkCheck;
TQSpinBox *blinkSpin;
TQLabel *blinkLabel;
TQCheckBox *blockCheck;
TQCheckBox *thickCheck;
TQRadioButton *stopRadio;
TQRadioButton *hideRadio;
TQRadioButton *nothingRadio;
};
struct SColorWidgets
{
enum colorType
{
FirstTextBg = 0,
SecondTextBg,
OffsetBg,
InactiveBg,
EvenColumnFg,
OddColumnFg,
NonPrintFg,
OffsetFg,
SecondaryFg,
MarkedBg,
MarkedFg,
CursorBg,
CursorFg,
BookmarkBg,
BookmarkFg,
SeparatorFg,
GridFg,
MAX_COLOR
};
TQCheckBox *checkSystem;
CColorListBox *colorList;
};
struct SFontWidgets
{
TQCheckBox *checkSystem;
TDEFontChooser *chooser;
TQLineEdit *nonPrintInput;
};
struct SFileWidgets
{
TQComboBox *openCombo;
TQCheckBox *gotoOffsetCheck;
TQCheckBox *reloadOffsetCheck;
TQCheckBox *writeProtectCheck;
TQCheckBox *backupCheck;
TQCheckBox *discardRecentCheck;
};
struct SMiscWidgets
{
TQSpinBox *undoSpin;
TQCheckBox *inputCheck;
TQCheckBox *fatalCheck;
TQCheckBox *autoCheck;
TQCheckBox *insertCheck;
TQCheckBox *confirmWrapCheck;
TQCheckBox *cursorJumpCheck;
TQCheckBox *thresholdCheck;
TQCheckBox *bookmarkColumnCheck;
TQCheckBox *bookmarkEditorCheck;
TQLabel *thresholdLabel;
TQSpinBox *thresholdSpin;
};
private:
void setupLayoutPage( void );
void setupCursorPage( void );
void setupColorPage( void );
void setupFontPage( void );
void setupFilePage( void );
void setupMiscPage( void );
SDisplayCursor::EFocusMode cursorFocusMode( void );
signals:
void lineSizeChoice( const SDisplayLine &lineSize );
void layoutChoice( const SDisplayLayout &layout );
void cursorChoice( const SDisplayCursor &cursor );
void colorChoice( const SDisplayColor &color );
void fontChoice( const SDisplayFont &font );
void miscChoice( const SDisplayMisc &misc );
void removeRecentFiles( void );
private:
SDisplayState mDisplayState;
SLayoutWidgets mLayout;
SCursorWidgets mCursor;
SColorWidgets mColor;
SFontWidgets mFont;
SFileWidgets mFile;
SMiscWidgets mMisc;
bool configChanged;
};
#endif
|