2 * uxcfg.c - the Unix-specific parts of the PuTTY configuration
13 void unix_setup_config_box(struct controlbox
*b
, int midsession
)
15 struct controlset
*s
, *s2
;
22 * Add the About button to the standard panel.
24 s
= ctrl_getset(b
, "", "", "");
25 c
= ctrl_pushbutton(s
, "About", 'a', HELPCTX(no_help
),
26 about_handler
, P(hwndp
));
27 c
->generic
.column
= 0;
32 * The Config structure contains two Unix-specific elements
33 * which are not configured in here: stamp_utmp and
34 * login_shell. This is because pterm does not put up a
35 * configuration box right at the start, which is the only time
36 * when these elements would be useful to configure.
40 * GTK makes it rather easier to put the scrollbar on the left
43 s
= ctrl_getset(b
, "Window", "scrollback",
44 "Control the scrollback in the window");
45 ctrl_checkbox(s
, "Scrollbar on left", 'l',
47 dlg_stdcheckbox_handler
,
48 I(offsetof(Config
,scrollbar_on_left
)));
50 * Really this wants to go just after `Display scrollbar'. See
51 * if we can find that control, and do some shuffling.
53 for (i
= 0; i
< s
->ncontrols
; i
++) {
55 if (c
->generic
.type
== CTRL_CHECKBOX
&&
56 c
->generic
.context
.i
== offsetof(Config
,scrollbar
)) {
58 * Control i is the scrollbar checkbox.
59 * Control s->ncontrols-1 is the scrollbar-on-left one.
61 if (i
< s
->ncontrols
-2) {
62 c
= s
->ctrls
[s
->ncontrols
-1];
63 memmove(s
->ctrls
+i
+2, s
->ctrls
+i
+1,
64 (s
->ncontrols
-i
-2)*sizeof(union control
*));
72 * X requires three more fonts: bold, wide, and wide-bold; also
73 * we need the fiddly shadow-bold-offset control. This would
74 * make the Window/Appearance panel rather unwieldy and large,
75 * so I think the sensible thing here is to _move_ this
76 * controlset into a separate Window/Fonts panel!
78 s2
= ctrl_getset(b
, "Window/Appearance", "font",
80 /* Remove this controlset from b. */
81 for (i
= 0; i
< b
->nctrlsets
; i
++) {
82 if (b
->ctrlsets
[i
] == s2
) {
83 memmove(b
->ctrlsets
+i
, b
->ctrlsets
+i
+1,
84 (b
->nctrlsets
-i
-1) * sizeof(*b
->ctrlsets
));
89 ctrl_settitle(b
, "Window/Fonts", "Options controlling font usage");
90 s
= ctrl_getset(b
, "Window/Fonts", "font",
91 "Fonts for displaying non-bold text");
92 ctrl_fontsel(s
, "Font used for ordinary text", 'f',
94 dlg_stdfontsel_handler
, I(offsetof(Config
,font
)));
95 ctrl_fontsel(s
, "Font used for wide (CJK) text", 'w',
97 dlg_stdfontsel_handler
, I(offsetof(Config
,widefont
)));
98 s
= ctrl_getset(b
, "Window/Fonts", "fontbold",
99 "Fonts for displaying bolded text");
100 ctrl_fontsel(s
, "Font used for bolded text", 'b',
102 dlg_stdfontsel_handler
, I(offsetof(Config
,boldfont
)));
103 ctrl_fontsel(s
, "Font used for bold wide text", 'i',
105 dlg_stdfontsel_handler
, I(offsetof(Config
,wideboldfont
)));
106 ctrl_text(s
, "If you leave the bold font selectors blank, bold text"
107 " will be displayed by overprinting (\"shadow bold\"). Note"
108 " that this only applies if you have not requested bolding"
109 " to be done by changing the text colour.",
111 ctrl_editbox(s
, "Horizontal offset for shadow bold:", 'z', 20,
112 HELPCTX(no_help
), dlg_stdeditbox_handler
,
113 I(offsetof(Config
,shadowboldoffset
)), I(-1));