summaryrefslogtreecommitdiffstats
path: root/src/common/gui/dialog.h
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-02-24 18:42:24 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-02-24 18:42:24 +0000
commitf508189682b6fba62e08feeb1596f682bad5fff9 (patch)
tree28aeb0e6c19386c385c1ce5edf8a92c1bca15281 /src/common/gui/dialog.h
downloadpiklab-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/common/gui/dialog.h')
-rw-r--r--src/common/gui/dialog.h77
1 files changed, 77 insertions, 0 deletions
diff --git a/src/common/gui/dialog.h b/src/common/gui/dialog.h
new file mode 100644
index 0000000..1227a7d
--- /dev/null
+++ b/src/common/gui/dialog.h
@@ -0,0 +1,77 @@
+/***************************************************************************
+ * 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 DIALOG_H
+#define DIALOG_H
+
+#include <qlayout.h>
+#include <kdialogbase.h>
+#include <klistview.h>
+
+//-----------------------------------------------------------------------------
+class Dialog : public KDialogBase
+{
+Q_OBJECT
+public:
+ Dialog(QWidget *parent, const char *name, bool modal,
+ const QString &caption, int buttonMask, ButtonCode defaultButton, bool separator,
+ const QSize &defaultSize = QSize());
+ Dialog(DialogType type, const QString &caption,
+ int buttonMask, ButtonCode defaultButton, QWidget *parent, const char *name,
+ bool modal, bool separator, const QSize &defaultSize = QSize());
+ virtual ~Dialog();
+
+private slots:
+ void updateSize();
+
+private:
+ QSize _defaultSize;
+};
+
+//-----------------------------------------------------------------------------
+class TreeListDialog : public Dialog
+{
+Q_OBJECT
+public:
+ TreeListDialog(QWidget *parent, const char *name, bool modal,
+ const QString &caption, int buttonMask, ButtonCode defaultButton, bool separator);
+ QWidget *addPage(const QStringList &labels);
+ void showPage(QWidget *page);
+ int activePageIndex() const;
+ int pageIndex(QWidget *page) const;
+
+protected slots:
+ virtual void currentChanged(QListViewItem *item);
+ void pageDestroyed(QObject *page);
+
+protected:
+ QFrame *_frame;
+ KListView *_listView;
+ QHBoxLayout *_titleBox;
+ QLabel *_label;
+ QWidgetStack *_stack;
+
+ class Item : public KListViewItem {
+ public:
+ Item(const QString &label, QWidget *page, const QString &title, QListView *listview);
+ Item(const QString &label, QWidget *page, const QString &title, QListViewItem *item);
+ QWidget *_page;
+ QString _title;
+ };
+};
+
+//-----------------------------------------------------------------------------
+class TextEditorDialog : public Dialog
+{
+Q_OBJECT
+public:
+ TextEditorDialog(const QString &text, const QString &caption,
+ bool wrapAtWidgetWidth, QWidget *parent);
+};
+
+#endif