From ce599e4f9f94b4eb00c1b5edb85bce5431ab3df2 Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeedu@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kturtle/src/dialogs.h | 165 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 165 insertions(+) create mode 100644 kturtle/src/dialogs.h (limited to 'kturtle/src/dialogs.h') diff --git a/kturtle/src/dialogs.h b/kturtle/src/dialogs.h new file mode 100644 index 00000000..dd4f2474 --- /dev/null +++ b/kturtle/src/dialogs.h @@ -0,0 +1,165 @@ +/* + KTurtle, Copyright (C) 2003-04 Cies Breijs + + This program is free software; you can redistribute it and/or + modify it under the terms of version 2 of the GNU General Public + License as published by the Free Software Foundation. + + 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. + */ + + +// This is one class for all custom dialogs that KTurtle uses. +// Right now that are: +// - ErrorMessage dialog, used to display the users coding errors +// - ColorPicker dialog, used to easily pick color-codes and put them in the code +// - RestartOrBack dialog, used when executing in fullscreenmode + + +#ifndef _DIALOGS_H_ +#define _DIALOGS_H_ + + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "token.h" + + +// BEGIN ErrorMessage dialog HEADER + +struct errorData +{ + uint code; + Token tok; + QString msg; +}; + + +class ErrorMessage : public KDialogBase +{ + Q_OBJECT + + public: + ErrorMessage(QWidget *parent); + ~ErrorMessage() {} + + bool containsErrors(); + + void display(); + + public slots: + void slotAddError(Token&, const QString&, uint code); + void updateSelection(); + + private slots: + void showHelpOnError(); + void errorMessageHelp(); + + signals: + void setCursor(uint row, uint column); + void setSelection(uint, uint, uint, uint); + + private: + typedef QValueList errorList; + errorList errList; + QTable *errTable; + uint errCount; + errorData currentError; + + protected: + QDialog *dialog; + QVBoxLayout *baseLayout; + QLabel *label; + QSpacerItem *spacer; +}; + +// END + + + +// BEGIN ColorPicker dialog HEADER + +class ColorPicker : public KDialogBase +{ + Q_OBJECT + + public: + ColorPicker(QWidget *parent); + virtual ~ColorPicker() {} + + + signals: + void visible(bool); // for toggling convenience + void ColorCode(QString); + + + private: + void updateSelector(); + void updatePal(); + void updatePatch(); + void updateColorCode(); + + QWidget *BaseWidget; + KHSSelector *hsSelector; + KValueSelector *valuePal; + QVBoxLayout *vlayout; + QHBoxLayout *h1layout; + QHBoxLayout *h2layout; + KColorPatch *patch; + QLabel *copyable; + QLineEdit *colorcode; + QColor color; + int h, s, v, r, g, b; + + + private slots: + void slotColorPickerHelp(); + + + protected slots: + void slotSelectorChanged(int _h, int _s); + void slotPalChanged(int _v); + void slotReselect(); + + void slotEmitVisibility(); // for toggling convenience + void slotEmitColorCode(); // convenience +}; + +// END + + + +// BEGIN RestartOrBack dialog HEADER + +class RestartOrBack : public KDialogBase +{ + Q_OBJECT + + public: + RestartOrBack (QWidget *parent); + ~RestartOrBack() {} + + protected: + QVBoxLayout *baseLayout; + QLabel *label; +}; + +// END + + +#endif // _DIALOGS_H_ -- cgit v1.2.1