21 |
*/ |
*/ |
22 |
|
|
23 |
#include "arshell.h" |
#include "arshell.h" |
24 |
|
#if XmVERSION > 1 & XmREVISION > 1 |
25 |
|
#include <Xm/FontS.h> |
26 |
|
#include <Xm/FontSP.h> |
27 |
|
#endif /* XmVERSION > 1 & XmREVISION > 1 */ |
28 |
|
|
29 |
void |
void |
30 |
arshell_dialog_cb(Widget widget, XtPointer client_data, XtPointer call_data) |
arshell_dialog_cb(Widget widget, XtPointer client_data, XtPointer call_data) |
35 |
exit(0); |
exit(0); |
36 |
} |
} |
37 |
|
|
38 |
|
void |
39 |
|
arshell_font_select_cb(ARCBARG) |
40 |
|
{ |
41 |
|
Widget font_selector=(Widget)client_data; |
42 |
|
char* font; |
43 |
|
ARCLARG; |
44 |
|
antiright_set(XmNcurrentFont, (XtArgVal)&font); |
45 |
|
antiright_get_values(font_selector); |
46 |
|
ARCLARG; |
47 |
|
printf(font); |
48 |
|
exit(0); |
49 |
|
} |
50 |
|
|
51 |
|
/*#define DEBUG_OLD_MOTIF |
52 |
|
#define DEBUG_NO_XLT*/ |
53 |
|
|
54 |
|
#ifdef DEBUG_OLD_MOTIF |
55 |
|
#undef XmVERSION |
56 |
|
#define XmVERSION 1 |
57 |
|
#endif /* DEBUG_OLD_MOTIF */ |
58 |
|
|
59 |
|
#ifdef DEBUG_NO_XLT |
60 |
|
#ifdef HAVE_XLT |
61 |
|
#undef HAVE_XLT |
62 |
|
#endif /* HAVE_XLT */ |
63 |
|
#endif /* DEBUG_NO_XLT */ |
64 |
|
|
65 |
|
#if XmVERSION < 2 | XmREVISION < 2 |
66 |
|
#ifdef HAVE_XLT |
67 |
|
void |
68 |
|
arshell_font_chooser_ok_cb(ARCBARG) |
69 |
|
{ |
70 |
|
char *font; |
71 |
|
antiright_set(XmNfontName, (XtArgVal)&font); |
72 |
|
antiright_get_values(widget); |
73 |
|
printf(font); |
74 |
|
exit(0); |
75 |
|
} |
76 |
|
void |
77 |
|
arshell_font_chooser_cancel_cb(ARCBARG) |
78 |
|
{ |
79 |
|
exit(0); |
80 |
|
} |
81 |
|
#endif /* HAVE_XLT */ |
82 |
|
#endif /* XmVERSION < 1 & XmREVISION < 1 & HAVE_XLT */ |
83 |
|
void |
84 |
|
arshell_font_dialog() |
85 |
|
{ |
86 |
|
|
87 |
|
Widget font_selector; |
88 |
|
#if XmVERSION > 1 & XmREVISION > 1 |
89 |
|
Widget form; |
90 |
|
ARCLARG; |
91 |
|
form=antiright_form(arshell.gui.widgets.mainwindow); |
92 |
|
arshell.gui.widgets.work=form; |
93 |
|
antiright_set_title("Font Selector"); |
94 |
|
ARCLARG; |
95 |
|
antiright_form_positions(0, 90, 0, 100); |
96 |
|
font_selector=XmCreateFontSelector(form, "font_selector", ARARGS); |
97 |
|
XtManageChild(font_selector); |
98 |
|
ARCLARG; |
99 |
|
antiright_set(XmNwidth, 500); |
100 |
|
antiright_set(XmNheight, 256); |
101 |
|
antiright_set_values(antiright.parent_widget); |
102 |
|
ARCLARG; |
103 |
|
XtUnmanageChild(arshell.gui.widgets.row); |
104 |
|
ARCLARG; |
105 |
|
antiright_form_positions(90, 100, 0, 100); |
106 |
|
antiright_button(form, "Select", arshell_font_select_cb, font_selector); |
107 |
|
ARCLARG; |
108 |
|
#else |
109 |
|
#if HAVE_XLT |
110 |
|
antiright_set_title("Font Selector"); |
111 |
|
ARCLARG; |
112 |
|
font_selector=XltCreateFontChooser(arshell.gui.widgets.mainwindow, |
113 |
|
"font_selector", ARARGS); |
114 |
|
XtManageChild(font_selector); |
115 |
|
XtAddCallback(font_selector, XmNokCallback, |
116 |
|
arshell_font_chooser_ok_cb, NULL); |
117 |
|
XtAddCallback(font_selector, XmNcancelCallback, |
118 |
|
arshell_font_chooser_cancel_cb, NULL); |
119 |
|
XtAddCallback(font_selector, XmNhelpCallback, |
120 |
|
antiright_help_cb, "Use_this_dialog_to_select_a_font."); |
121 |
|
#else |
122 |
|
system("arshell -ADp 'Enter a font name:' &"); |
123 |
|
exit(0); |
124 |
|
#endif /* HAVE_XLT */ |
125 |
|
#endif /* XmVERSION > 1 & XmREVISION > 1 */ |
126 |
|
|
127 |
|
} |
128 |
|
|
129 |
|
|
130 |
void |
void |
131 |
arshell_message_dialog(int *counter_int, char **argv) |
arshell_message_dialog(int *counter_int, char **argv) |
222 |
a new shell. */ |
a new shell. */ |
223 |
switch(argv[(*counter_int)][3]) |
switch(argv[(*counter_int)][3]) |
224 |
{ |
{ |
225 |
|
case 'F': |
226 |
|
arshell_font_dialog(); |
227 |
|
break; |
228 |
case 'f': /* Create a file selection dialog. */ |
case 'f': /* Create a file selection dialog. */ |
229 |
arshell_file_select_dialog(); |
arshell_file_select_dialog(); |
230 |
break; |
break; |