From c9fc6c37dbbb809a8a4db042b2fea8feeb4306c8 Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 9 Mar 2009 21:17:24 +0000 Subject: Fixed snap shortcuts. git-svn-id: http://svn.leocad.org/tags/leocad-0.75@747 c7d43263-9d01-0410-8a33-9dba5d9f93d6 --- linux/main.cpp | 10 ++++++++++ linux/system.cpp | 13 +++++++------ linux/toolbar.cpp | 2 +- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/linux/main.cpp b/linux/main.cpp index 2e482bc..6a71cec 100644 --- a/linux/main.cpp +++ b/linux/main.cpp @@ -328,6 +328,16 @@ static gint key_press_event(GtkWidget* widget, GdkEventKey* event, gpointer data } } + if ((code >= '0') && (code <= '9') && ((event->state & GDK_CONTROL_MASK) == 0)) + { + if (event->state & GDK_SHIFT_MASK) + lcGetActiveProject()->HandleCommand((LC_COMMANDS)(LC_EDIT_MOVEZ_SNAP_0 + code - '0'), 0); + else + lcGetActiveProject()->HandleCommand((LC_COMMANDS)(LC_EDIT_MOVEXY_SNAP_0 + code - '0'), 0); + + return TRUE; + } + if (code != 0) { if (lcGetActiveProject()->OnKeyDown(code, (event->state & GDK_CONTROL_MASK) != 0, diff --git a/linux/system.cpp b/linux/system.cpp index cd70493..f7fcd2c 100644 --- a/linux/system.cpp +++ b/linux/system.cpp @@ -15,6 +15,7 @@ #include "toolbar.h" #include "dialogs.h" #include "globals.h" +#include "lc_application.h" // ============================================================================= // Cursor functions @@ -490,13 +491,13 @@ void SystemUpdateSnap(unsigned short move_snap, unsigned short RotateSnap) if (!label_snap) return; - char text[11]; - if (move_snap) - sprintf (text, "Move x%i", move_snap); - else - strcpy (text, "Move /2"); + char Text[256], xy[32], z[32]; + + lcGetActiveProject()->GetSnapDistanceText(xy, z); + + sprintf(Text, " M: %s %s R: %d ", xy, z, RotateSnap); - gtk_label_set (GTK_LABEL (label_snap), text); + gtk_label_set (GTK_LABEL (label_snap), Text); } void SystemUpdateSelected(unsigned long flags, int SelectedCount, Object* Focus) diff --git a/linux/toolbar.cpp b/linux/toolbar.cpp index 431fffb..04a955f 100644 --- a/linux/toolbar.cpp +++ b/linux/toolbar.cpp @@ -866,7 +866,7 @@ void create_statusbar(GtkWidget *window, GtkWidget *vbox) gtk_widget_show (frame); gtk_box_pack_start (GTK_BOX (hbox), frame, FALSE, TRUE, 0); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); - gtk_widget_set_usize (frame, 70, -1); + gtk_widget_set_usize (frame, 120, -1); hbox1 = gtk_hbox_new (FALSE, 0); gtk_container_add (GTK_CONTAINER (frame), hbox1); -- cgit v1.2.3