summaryrefslogtreecommitdiff
path: root/tikzit/src/gtk/Menu.m
diff options
context:
space:
mode:
authorrandomguy3 <randomguy3@7c02a99a-9b00-45e3-bf44-6f3dd7fddb64>2012-01-27 19:24:50 +0000
committerrandomguy3 <randomguy3@7c02a99a-9b00-45e3-bf44-6f3dd7fddb64>2012-01-27 19:24:50 +0000
commit31ff43125b0629b688a36c2a97c233ec878b3fbc (patch)
treeee46bd3347e0ff80a5f7564854897ddbc9faf381 /tikzit/src/gtk/Menu.m
parent99e1dbf751882592ee21400c60bdbc8241894f27 (diff)
GTK: bring forward / send back support
Waiting on the graph changes to be implemented for it to be done properly (currently no undo/redo and the graph doesn't redraw properly) git-svn-id: https://tikzit.svn.sourceforge.net/svnroot/tikzit/trunk@403 7c02a99a-9b00-45e3-bf44-6f3dd7fddb64
Diffstat (limited to 'tikzit/src/gtk/Menu.m')
-rw-r--r--tikzit/src/gtk/Menu.m45
1 files changed, 45 insertions, 0 deletions
diff --git a/tikzit/src/gtk/Menu.m b/tikzit/src/gtk/Menu.m
index c8fffb9..ea2e333 100644
--- a/tikzit/src/gtk/Menu.m
+++ b/tikzit/src/gtk/Menu.m
@@ -224,6 +224,30 @@ static void flip_vert_cb (GtkAction *action, MainWindow *window) {
[pool drain];
}
+static void bring_forward_cb (GtkAction *action, MainWindow *window) {
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ [[window activeDocument] bringSelectionForward];
+ [pool drain];
+}
+
+static void send_backward_cb (GtkAction *action, MainWindow *window) {
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ [[window activeDocument] sendSelectionBackward];
+ [pool drain];
+}
+
+static void bring_to_front_cb (GtkAction *action, MainWindow *window) {
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ [[window activeDocument] bringSelectionToFront];
+ [pool drain];
+}
+
+static void send_to_back_cb (GtkAction *action, MainWindow *window) {
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ [[window activeDocument] sendSelectionToBack];
+ [pool drain];
+}
+
#ifdef HAVE_POPPLER
static void show_preferences_cb (GtkAction *action, MainWindow *window) {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
@@ -351,6 +375,13 @@ static const gchar ui_info[] =
" <separator/>"
" <menuitem action='FlipVert'/>"
" <menuitem action='FlipHoriz'/>"
+" <separator/>"
+" <menu action='Arrange'>"
+" <menuitem action='SendToBack'/>"
+" <menuitem action='SendBackward'/>"
+" <menuitem action='BringForward'/>"
+" <menuitem action='BringToFront'/>"
+" </menu>"
#ifdef HAVE_POPPLER
" <separator/>"
" <menuitem action='ShowPreferences'/>"
@@ -446,6 +477,8 @@ static GtkActionEntry static_entries[] = {
/* EditMenu */
{ "Tool", NULL, N_("_Tool") },
+ { "Arrange", NULL, N_("_Arrange") },
+
#ifdef HAVE_POPPLER
{ "ShowPreferences", GTK_STOCK_PREFERENCES, NULL, NULL,
N_("Edit the TikZiT preferences"), G_CALLBACK (show_preferences_cb) },
@@ -528,6 +561,18 @@ static GtkActionEntry document_entries[] = {
{ "FlipVert", NULL, N_("Flip nodes _vertically"), NULL,
N_("Flip the selected nodes vertically"), G_CALLBACK (flip_vert_cb) },
+ { "SendToBack", NULL, N_("Send to _back"), NULL,
+ N_("Send the selected nodes and edges to the back of the graph"), G_CALLBACK (send_to_back_cb) },
+
+ { "SendBackward", NULL, N_("Send b_ackward"), NULL,
+ N_("Send the selected nodes and edges backward"), G_CALLBACK (send_backward_cb) },
+
+ { "BringForward", NULL, N_("Bring f_orward"), NULL,
+ N_("Bring the selected nodes and edges forward"), G_CALLBACK (bring_forward_cb) },
+
+ { "BringToFront", NULL, N_("Bring to _front"), NULL,
+ N_("Bring the selected nodes and edges to the front of the graph"), G_CALLBACK (bring_to_front_cb) },
+
/* ViewMenu */
#ifdef HAVE_POPPLER
{ "ShowPreview", NULL, N_("_Preview"), "<control>L",