blob: 8f483c7d9b4416529ff8a561c348b70b79ec259f (
plain)
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
|
/***************************************************************************
* Copyright (C) 2005 Nicolas Hadacek <hadacek@kde.org> *
* Copyright (C) 2003-2004 Alain Gibaud <alain.gibaud@free.fr> *
* *
* 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. *
***************************************************************************/
#ifndef PIC_CONFIG_WORD_EDITOR_H
#define PIC_CONFIG_WORD_EDITOR_H
#include <qcombobox.h>
#include "common/gui/dialog.h"
#include "common/gui/misc_gui.h"
#include "pic_memory_editor.h"
namespace Pic
{
//----------------------------------------------------------------------------
class ConfigWordDialog : public Dialog
{
Q_OBJECT
public:
ConfigWordDialog(const Memory &memory, uint index, QWidget *parent);
};
//----------------------------------------------------------------------------
class ConfigWordComboBox : public ComboBox
{
Q_OBJECT
public:
ConfigWordComboBox(QWidget *parent);
void appendItem(const QString &text, uint index) { insertItem(text); _map.append(index); }
uint index() const;
void setItem(uint index);
void setInvalidItem(uint index, const QString &label);
private:
QValueVector<uint> _map; // item index -> value index
uint _invalidIndex; // if invalid -> value index
bool isValid() const { return uint(count())==_map.count(); }
};
//----------------------------------------------------------------------------
class ConfigWordEditor : public MemoryEditor
{
Q_OBJECT
public:
ConfigWordEditor(Memory &memory, uint index, bool withWordEditor, QWidget *parent);
virtual void setReadOnly(bool readOnly);
public slots:
virtual void updateDisplay();
private slots:
void slotModified();
void showDialog();
private:
uint _configIndex;
MemoryRangeEditor *_mdb;
QValueVector<ConfigWordComboBox *> _combos;
};
} // namespace
#endif
|