[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
gEDA-cvs: pcb.git: branch: master updated (14080c7575340d49c11bd3539ec0d0722615d930)
The branch, master has been updated
via 14080c7575340d49c11bd3539ec0d0722615d930 (commit)
from 6ad4d0c9278a9813fc8b3a29bfdc51f5fdcd0754 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/hid/lesstif/menu.c | 51 +++++++++++++++++++++++------------------------
1 files changed, 25 insertions(+), 26 deletions(-)
=================
Commit Messages
=================
commit 14080c7575340d49c11bd3539ec0d0722615d930
Author: Andrew Poelstra <asp11@xxxxxx>
Commit: Andrew Poelstra <asp11@xxxxxx>
Allow 1...9 and Ctrl+1...9 accellerators for silk/rats in lesstif
:100644 100644 8de2952... 481bba5... M src/hid/lesstif/menu.c
=========
Changes
=========
commit 14080c7575340d49c11bd3539ec0d0722615d930
Author: Andrew Poelstra <asp11@xxxxxx>
Commit: Andrew Poelstra <asp11@xxxxxx>
Allow 1...9 and Ctrl+1...9 accellerators for silk/rats in lesstif
diff --git a/src/hid/lesstif/menu.c b/src/hid/lesstif/menu.c
index 8de2952..481bba5 100644
--- a/src/hid/lesstif/menu.c
+++ b/src/hid/lesstif/menu.c
@@ -527,15 +527,18 @@ insert_layerview_buttons (Widget menu)
{
static char namestr[] = "Label ";
char *name = namestr;
+ int accel_idx = i;
Widget btn;
name[5] = 'A' + i;
switch (i)
{
case LB_SILK:
name = "Silk";
+ accel_idx = max_copper_layer;
break;
case LB_RATS:
name = "Rat Lines";
+ accel_idx = max_copper_layer + 1;
break;
case LB_PINS:
name = "Pins/Pads";
@@ -551,12 +554,12 @@ insert_layerview_buttons (Widget menu)
break;
}
n = 0;
- if (i < MAX_LAYER && i < 9)
+ if (accel_idx < 9)
{
char buf[20], av[30];
Resource *ar;
XmString as;
- sprintf (buf, "Ctrl-%d", i + 1);
+ sprintf (buf, "Ctrl-%d", accel_idx + 1);
as = XmStringCreateLocalized (buf);
stdarg (XmNacceleratorText, as);
ar = resource_create (0);
@@ -564,9 +567,9 @@ insert_layerview_buttons (Widget menu)
resource_add_val (ar, 0, strdup (av), 0);
resource_add_val (ar, 0, strdup (av), 0);
ar->flags |= FLAG_V;
- sprintf (av, "Ctrl<Key>%d", i + 1);
+ sprintf (av, "Ctrl<Key>%d", accel_idx + 1);
note_accelerator (av, ar);
- stdarg (XmNmnemonic, i + '1');
+ stdarg (XmNmnemonic, accel_idx + '1');
}
btn = XmCreateToggleButton (menu, name, args, n);
XtManageChild (btn);
@@ -599,46 +602,42 @@ insert_layerpick_buttons (Widget menu)
{
static char namestr[] = "Label ";
char *name = namestr;
+ int accel_idx = i;
+ char buf[20], av[30];
Widget btn;
name[5] = 'A' + i;
switch (i)
{
case LB_SILK:
name = "Silk";
+ accel_idx = max_copper_layer;
+ strcpy (av, "SelectLayer(Silk)");
break;
case LB_RATS:
name = "Rat Lines";
- break;
+ accel_idx = max_copper_layer + 1;
+ strcpy (av, "SelectLayer(Rats)");
+ break;
+ default:
+ sprintf (av, "SelectLayer(%d)", i + 1);
+ break;
}
n = 0;
- if (i < MAX_LAYER && i < 9)
- {
- char buf[20], av[30];
+ if (accel_idx < 9)
+ {
Resource *ar;
XmString as;
- sprintf (buf, "%d", i + 1);
- as = XmStringCreateLocalized (buf);
- stdarg (XmNacceleratorText, as);
ar = resource_create (0);
- switch (i)
- {
- case LB_SILK:
- strcpy (av, "SelectLayer(Silk)");
- break;
- case LB_RATS:
- strcpy (av, "SelectLayer(Rats)");
- break;
- default:
- sprintf (av, "SelectLayer(%d)", i + 1);
- break;
- }
resource_add_val (ar, 0, strdup (av), 0);
resource_add_val (ar, 0, strdup (av), 0);
ar->flags |= FLAG_V;
- sprintf (av, "<Key>%d", i + 1);
+ sprintf (buf, "%d", i + 1);
+ as = XmStringCreateLocalized (buf);
+ stdarg (XmNacceleratorText, as);
+ sprintf (av, "<Key>%d", accel_idx + 1);
note_accelerator (av, ar);
- stdarg (XmNmnemonic, i + '1');
- }
+ stdarg (XmNmnemonic, accel_idx + '1');
+ }
stdarg (XmNindicatorType, XmONE_OF_MANY);
btn = XmCreateToggleButton (menu, name, args, n);
XtManageChild (btn);
_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs