[solang] Added a basic HIGDialog



commit 0d881767bbb89054fd254510741169a1beb270a5
Author: Debarshi Ray <rishi gnu org>
Date:   Wed Mar 17 02:53:48 2010 +0200

    Added a basic HIGDialog

 src/common/Makefile.am    |    2 +
 src/common/hig-dialog.cpp |  115 +++++++++++++++++++++++++++++++++++++++++++++
 src/common/hig-dialog.h   |   57 ++++++++++++++++++++++
 3 files changed, 174 insertions(+), 0 deletions(-)
---
diff --git a/src/common/Makefile.am b/src/common/Makefile.am
index 04bfe40..970f1c2 100644
--- a/src/common/Makefile.am
+++ b/src/common/Makefile.am
@@ -34,6 +34,8 @@ libcommon_la_SOURCES = \
 	exif-data.h \
 	export-queue-operations.cpp \
 	export-queue-operations.h \
+	hig-dialog.cpp \
+	hig-dialog.h \
 	histogram-viewer.cpp \
 	histogram-viewer.h \
 	histogram.cpp \
diff --git a/src/common/hig-dialog.cpp b/src/common/hig-dialog.cpp
new file mode 100644
index 0000000..787372b
--- /dev/null
+++ b/src/common/hig-dialog.cpp
@@ -0,0 +1,115 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
+/*
+ * Copyright (C) 2010 Debarshi Ray <rishi gnu org>
+ *
+ * Solang 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Solang 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif // HAVE_CONFIG_H
+
+#include "hig-dialog.h"
+
+namespace Solang
+{
+
+HIGDialog::HIGDialog() throw() :
+    Gtk::Dialog(),
+    vBox_(false, 0)
+{
+    setup_gui();
+}
+
+HIGDialog::HIGDialog(const Glib::ustring & title,
+                     bool modal,
+                     bool use_separator) throw() :
+    Gtk::Dialog(title, modal, use_separator),
+    vBox_(false, 0)
+{
+    setup_gui();
+}
+
+HIGDialog::HIGDialog(const Glib::ustring & title,
+                     Gtk::Window & parent,
+                     bool modal,
+                     bool use_separator) throw() :
+    Gtk::Dialog(title, parent, modal, use_separator),
+    vBox_(false, 0)
+{
+    setup_gui();
+}
+
+HIGDialog::~HIGDialog() throw()
+{
+}
+
+Gtk::VBox &
+HIGDialog::get_content_area() throw()
+{
+    return vBox_;
+}
+
+void
+HIGDialog::setup_gui() throw()
+{
+    // Dialog
+    // +------------------------------------------------+
+    // |                                                |
+    // |     VBox                                       |
+    // |     +------------------------------------+     |
+    // |     |                                    |     |
+    // |     |     Content Area                   |     |
+    // |     |     +------------------------+     |     |
+    // |     |     |                        |     |     |
+    // |     |     |     Content            |     |     |
+    // |     |     |     +------------+     |     |     |
+    // |     |     |     |            |     |     |     |
+    // |     |     |     |            |     |     |     |
+    // |     |     |     |            |<-5->|<-2->|<-5->|
+    // |     |     |     |            |     |     |     |
+    // |     |     |     |            |     |     |     |
+    // |     |     |     +------------+     |     |     |
+    // |     |     |                        |     |     |
+    // |     |     |                        |     |     |
+    // |     |     +------------------------+     |     |
+    // |     |                                    |     |
+    // |     |     Action Area                    |     |
+    // |     |     +------------------------+     |     |
+    // |     |     |                        |     |     |
+    // |     |     |         Button         |     |     |
+    // |     |     |         +--------+     |     |     |
+    // |     |     |         |        |<-5->|<-2->|<-5->|
+    // |     |     |         +--------+     |     |     |
+    // |     |     |                        |     |     |
+    // |     |     |                        |     |     |
+    // |     |     +------------------------+     |     |
+    // |     |                                    |     |
+    // |     |                                    |     |
+    // |     +------------------------------------+     |
+    // |                                                |
+    // |                                                |
+    // +------------------------------------------------+
+
+    set_border_width(5);
+
+    Gtk::VBox * const vbox = get_vbox();
+    vbox->pack_start(vBox_, Gtk::PACK_SHRINK, 0);
+
+    vBox_.set_border_width(5);
+
+    show_all_children();
+}
+
+} // namespace Solang
diff --git a/src/common/hig-dialog.h b/src/common/hig-dialog.h
new file mode 100644
index 0000000..e8609f3
--- /dev/null
+++ b/src/common/hig-dialog.h
@@ -0,0 +1,57 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
+/*
+ * Copyright (C) 2010 Debarshi Ray <rishi gnu org>
+ *
+ * Solang 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Solang 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef SOLANG_HIG_DIALOG_H
+#define SOLANG_HIG_DIALOG_H
+
+#include <gtkmm.h>
+
+namespace Solang
+{
+
+class HIGDialog :
+    public Gtk::Dialog
+{
+    public:
+        HIGDialog() throw();
+
+        HIGDialog(const Glib::ustring & title,
+                  bool modal = false,
+                  bool use_separator = false) throw();
+
+        HIGDialog(const Glib::ustring & title,
+                  Gtk::Window & parent,
+                  bool modal = false,
+                  bool use_separator = false) throw();
+
+        virtual
+        ~HIGDialog() throw() = 0;
+
+        Gtk::VBox &
+        get_content_area() throw();
+
+    private:
+        void
+        setup_gui() throw();
+
+        Gtk::VBox vBox_;
+};
+
+} // namespace Solang
+
+#endif // SOLANG_HIG_DIALOG_H



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]