diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-02-24 18:42:24 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-02-24 18:42:24 +0000 |
commit | f508189682b6fba62e08feeb1596f682bad5fff9 (patch) | |
tree | 28aeb0e6c19386c385c1ce5edf8a92c1bca15281 /src/devices/pic/gui/pic_register_view.h | |
download | piklab-f508189682b6fba62e08feeb1596f682bad5fff9.tar.gz piklab-f508189682b6fba62e08feeb1596f682bad5fff9.zip |
Added KDE3 version of PikLab
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/piklab@1095639 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/devices/pic/gui/pic_register_view.h')
-rw-r--r-- | src/devices/pic/gui/pic_register_view.h | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/src/devices/pic/gui/pic_register_view.h b/src/devices/pic/gui/pic_register_view.h new file mode 100644 index 0000000..f5b9d4b --- /dev/null +++ b/src/devices/pic/gui/pic_register_view.h @@ -0,0 +1,88 @@ +/*************************************************************************** + * Copyright (C) 2006 Nicolas Hadacek <[email protected]> * + * * + * 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_REGISTER_VIEW_H +#define PIC_REGISTER_VIEW_H + +#include <qvaluevector.h> +class QPushButton; +class QCheckBox; +class QLabel; +class QComboBox; + +#include "devices/gui/register_view.h" +#include "devices/pic/base/pic.h" +#include "devices/pic/base/pic_register.h" +class PopupButton; +namespace Device { class RegisterHexWordEditor; } + +namespace Pic +{ +//----------------------------------------------------------------------------- +class BankWidget : public QFrame +{ +Q_OBJECT +public: + BankWidget(uint bank, QWidget *parent); + void updateView(); + +private slots: + void buttonActivated(int id); + void write(); + void bankChanged(); + +private: + enum Id { ReadId, EditId, WatchId }; + class Data { + public: + Data() : label(0), button(0), edit(0) {} + uint address; + QLabel *alabel, *label; + PopupButton *button; + Register::LineEdit *edit; + }; + uint _bindex; + QComboBox *_bankCombo; + QValueVector<Data> _registers; + + uint bank() const; + uint nbRegisters() const; + uint indexOffset() const; + void updateRegisterAddresses(); +}; + +//----------------------------------------------------------------------------- +class RegisterView : public Register::View +{ +Q_OBJECT +public: + RegisterView(QWidget *parent); + virtual void updateView(); + +private slots: + void stopWatchAllRegisters(); + +private: + QPushButton *_readAllButton, *_clearAllButton; + QValueVector<BankWidget *> _banks; +}; + +//----------------------------------------------------------------------------- +class RegisterListViewItem : public Register::ListViewItem +{ +public: + RegisterListViewItem(const Register::TypeData &data, KListViewItem *parent); + +private: + virtual uint nbCharsAddress() const; + virtual QString label() const; +}; + +} // namespace + +#endif |