aboutsummaryrefslogtreecommitdiffstats
path: root/graphics/xfig/files/patch-w_rulers.c
blob: 00259d857e040075a018bda9bde4ad141b42c069 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
--- w_rulers.c.orig Sat Oct 12 01:13:53 2002
+++ w_rulers.c  Wed Aug 31 09:49:42 2005
@@ -117,9 +117,11 @@
 static void    sideruler_selected();
 static void    sideruler_exposed();
 
+#ifndef XAW3D
 /* popup message over button when mouse enters it */
 static void     unit_balloon_trigger();
 static void     unit_unballoon();
+#endif
 
 /* turn these into macros so we can use them in
    struct initialization */
@@ -356,17 +358,46 @@
     unitbox_sw = XtCreateWidget("unitbox", labelWidgetClass, tool,
                Args, ArgCount);
     XtAppAddActions(tool_app, unitbox_actions, XtNumber(unitbox_actions));
+#ifndef XAW3D
     /* popup when mouse passes over button */
     XtAddEventHandler(unitbox_sw, EnterWindowMask, False,
              unit_balloon_trigger, (XtPointer) unitbox_sw);
     XtAddEventHandler(unitbox_sw, LeaveWindowMask, False,
              unit_unballoon, (XtPointer) unitbox_sw);
+#endif
     XtOverrideTranslations(unitbox_sw,
               XtParseTranslationTable(unitbox_translations));
+
+#ifdef XAW3D
+    update_rulerpanel();
+#endif
 }
 
 static Widget  unit_popup, unit_panel, cancel, set, beside, below, label;
 
+#ifdef XAW3D
+update_rulerpanel()
+{
+    char msg[80];
+
+    strcpy(msg, "Pan to 0,0        ");
+    if (appres.flipvisualhints)
+   sprintf(msg + strlen(msg), "(right button)");
+    else
+   sprintf(msg + strlen(msg), "(left button)");
+    sprintf(msg + strlen(msg), "\nSet Units/Scale   ");
+    if (appres.flipvisualhints)
+   sprintf(msg + strlen(msg), "(left button)");
+    else
+   sprintf(msg + strlen(msg), "(right button)");
+
+    if (unitbox_sw)
+   if (appres.showballoons)
+       XawTipEnable(unitbox_sw, msg);
+   else
+       XawTipDisable(unitbox_sw);
+}
+#else
 /* come here when the mouse passes over the unit box */
 
 static Widget unit_balloon_popup = (Widget) 0;
@@ -474,6 +505,7 @@
    unit_balloon_popup = (Widget) 0;
     }
 }
+#endif
 
 /* handle unit/scale settings */