[gtkmm] Add the Gtk::ShortcutLabel widget
- From: Kjell Ahlstedt <kjellahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkmm] Add the Gtk::ShortcutLabel widget
- Date: Mon, 1 Aug 2016 13:00:15 +0000 (UTC)
commit 76dba5abca138cbe6d98a89f9d46dbc10a8cb5d7
Author: Kjell Ahlstedt <kjell ahlstedt bredband net>
Date: Mon Aug 1 14:56:39 2016 +0200
Add the Gtk::ShortcutLabel widget
* .gitignore: Add new generated .h and .cc files.
* gtk/gtkmm.h: Add the shortcutlabel.h file.
* gtk/src/filelist.am: Add the shortcutlabel.hg file.
* gtk/src/shortcutlabel.[hg|ccg]: New files.
.gitignore | 2 +
gtk/gtkmm.h | 1 +
gtk/src/filelist.am | 1 +
gtk/src/shortcutlabel.ccg | 18 +++++++++++++
gtk/src/shortcutlabel.hg | 61 +++++++++++++++++++++++++++++++++++++++++++++
5 files changed, 83 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index f1f7eb1..a336338 100644
--- a/.gitignore
+++ b/.gitignore
@@ -450,6 +450,8 @@ gtk/gtkmm/separatortoolitem.cc
gtk/gtkmm/separatortoolitem.h
gtk/gtkmm/settings.cc
gtk/gtkmm/settings.h
+gtk/gtkmm/shortcutlabel.cc
+gtk/gtkmm/shortcutlabel.h
gtk/gtkmm/shortcutsgroup.cc
gtk/gtkmm/shortcutsgroup.h
gtk/gtkmm/shortcutssection.cc
diff --git a/gtk/gtkmm.h b/gtk/gtkmm.h
index 28fe76c..ce58de7 100644
--- a/gtk/gtkmm.h
+++ b/gtk/gtkmm.h
@@ -260,6 +260,7 @@ extern const int gtkmm_micro_version;
#include <gtkmm/separatormenuitem.h>
#include <gtkmm/separatortoolitem.h>
#include <gtkmm/settings.h>
+#include <gtkmm/shortcutlabel.h>
#include <gtkmm/shortcutsgroup.h>
#include <gtkmm/shortcutssection.h>
#include <gtkmm/shortcutsshortcut.h>
diff --git a/gtk/src/filelist.am b/gtk/src/filelist.am
index a39924d..ed0a4b6 100644
--- a/gtk/src/filelist.am
+++ b/gtk/src/filelist.am
@@ -161,6 +161,7 @@ gtkmm_files_any_hg = \
separatormenuitem.hg \
separatortoolitem.hg \
settings.hg \
+ shortcutlabel.hg \
shortcutsgroup.hg \
shortcutssection.hg \
shortcutsshortcut.hg \
diff --git a/gtk/src/shortcutlabel.ccg b/gtk/src/shortcutlabel.ccg
new file mode 100644
index 0000000..e2d7e2b
--- /dev/null
+++ b/gtk/src/shortcutlabel.ccg
@@ -0,0 +1,18 @@
+/* Copyright (C) 2016 The gtkmm Development Team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <gtk/gtk.h>
+
diff --git a/gtk/src/shortcutlabel.hg b/gtk/src/shortcutlabel.hg
new file mode 100644
index 0000000..8ffb611
--- /dev/null
+++ b/gtk/src/shortcutlabel.hg
@@ -0,0 +1,61 @@
+/* Copyright (C) 2016 The gtkmm Development Team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <gtkmm/box.h>
+
+_DEFS(gtkmm,gtk)
+_PINCLUDE(gtkmm/private/box_p.h)
+
+namespace Gtk
+{
+
+/** Displays a keyboard shortcut.
+ *
+ * %Gtk::ShortcutLabel is a widget that represents a single keyboard shortcut
+ * or gesture in the user interface.
+ *
+ * @see CellRendererAccel
+ * @newin{3,22}
+ *
+ * @ingroup Widgets
+ */
+class ShortcutLabel : public Box
+{
+ _CLASS_GTKOBJECT(ShortcutLabel, GtkShortcutLabel, GTK_SHORTCUT_LABEL, Box, GtkBox)
+
+public:
+ _CTOR_DEFAULT
+ /** Creates a %ShortcutLabel with accelerator set.
+ *
+ * @param accelerator The initial accelerator.
+ * See ShortcutsShortcut::property_accelerator() for the accepted syntax.
+ *
+ * @newin{3,22}
+ */
+ _WRAP_CTOR(ShortcutLabel(const Glib::ustring& accelerator), gtk_shortcut_label_new)
+
+ _WRAP_METHOD(Glib::ustring get_accelerator() const, gtk_shortcut_label_get_accelerator)
+ _WRAP_METHOD(void set_accelerator(const Glib::ustring& accelerator), gtk_shortcut_label_set_accelerator)
+ _WRAP_METHOD(Glib::ustring get_disabled_text() const, gtk_shortcut_label_get_disabled_text)
+ _WRAP_METHOD(void set_disabled_text(const Glib::ustring& disabled_text),
gtk_shortcut_label_set_disabled_text)
+
+ _WRAP_PROPERTY("accelerator", Glib::ustring)
+ _WRAP_PROPERTY("disabled-text", Glib::ustring)
+
+ // There are no signals or vfuncs.
+};
+
+} // namespace Gtk
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]