* wtools.c (create_listbox_window): Don't repaint the dialog
before it's run.
Этот коммит содержится в:
родитель
058e91c2f5
Коммит
9190dcbfa8
@ -1,5 +1,8 @@
|
|||||||
2003-09-03 Pavel Roskin <proski@gnu.org>
|
2003-09-03 Pavel Roskin <proski@gnu.org>
|
||||||
|
|
||||||
|
* wtools.c (create_listbox_window): Don't repaint the dialog
|
||||||
|
before it's run.
|
||||||
|
|
||||||
* learn.c: Don't track button hotkeys.
|
* learn.c: Don't track button hotkeys.
|
||||||
(learn_check_key): Consume all alphanumeric keys, regardless of
|
(learn_check_key): Consume all alphanumeric keys, regardless of
|
||||||
button hotkeys.
|
button hotkeys.
|
||||||
|
40
src/wtools.c
40
src/wtools.c
@ -50,39 +50,39 @@
|
|||||||
|
|
||||||
/* {{{ Listbox utility functions */
|
/* {{{ Listbox utility functions */
|
||||||
|
|
||||||
Listbox *create_listbox_window (int cols, int lines, char *title, char *help)
|
Listbox *
|
||||||
|
create_listbox_window (int cols, int lines, char *title, char *help)
|
||||||
{
|
{
|
||||||
int xpos, ypos, len;
|
int xpos, ypos, len;
|
||||||
Listbox *listbox = g_new (Listbox, 1);
|
Listbox *listbox = g_new (Listbox, 1);
|
||||||
char* cancel_string = _("&Cancel");
|
char *cancel_string = _("&Cancel");
|
||||||
|
|
||||||
/* Adjust sizes */
|
/* Adjust sizes */
|
||||||
lines = (lines > LINES-6) ? LINES - 6 : lines;
|
lines = (lines > LINES - 6) ? LINES - 6 : lines;
|
||||||
|
|
||||||
if (title && (cols < (len = strlen(title) + 2)))
|
if (title && (cols < (len = strlen (title) + 2)))
|
||||||
cols = len;
|
cols = len;
|
||||||
|
|
||||||
/* no &, but 4 spaces around button for brackets and such */
|
/* no &, but 4 spaces around button for brackets and such */
|
||||||
if (cols < (len = strlen(cancel_string) + 3))
|
if (cols < (len = strlen (cancel_string) + 3))
|
||||||
cols = len;
|
cols = len;
|
||||||
|
|
||||||
cols = cols > COLS-6 ? COLS-6 : cols;
|
|
||||||
|
|
||||||
/* I'm not sure if this -2 is safe, should test it */
|
cols = cols > COLS - 6 ? COLS - 6 : cols;
|
||||||
xpos = (COLS-cols)/2;
|
xpos = (COLS - cols) / 2;
|
||||||
ypos = (LINES-lines)/2 - 2;
|
ypos = (LINES - lines) / 2 - 2;
|
||||||
|
|
||||||
/* Create components */
|
/* Create components */
|
||||||
listbox->dlg = create_dlg (ypos, xpos, lines+6, cols+4, dialog_colors,
|
listbox->dlg =
|
||||||
NULL, help, title, DLG_CENTER);
|
create_dlg (ypos, xpos, lines + 6, cols + 4, dialog_colors, NULL,
|
||||||
|
help, title, DLG_CENTER);
|
||||||
|
|
||||||
listbox->list = listbox_new (2, 2, cols, lines, 0);
|
listbox->list = listbox_new (2, 2, cols, lines, 0);
|
||||||
|
|
||||||
add_widget (listbox->dlg,
|
add_widget (listbox->dlg,
|
||||||
button_new (lines+3, (cols/2 + 2) - len/2,
|
button_new (lines + 3, (cols / 2 + 2) - len / 2, B_CANCEL,
|
||||||
B_CANCEL, NORMAL_BUTTON, cancel_string, 0));
|
NORMAL_BUTTON, cancel_string, 0));
|
||||||
add_widget (listbox->dlg, listbox->list);
|
add_widget (listbox->dlg, listbox->list);
|
||||||
common_dialog_repaint (listbox->dlg);
|
|
||||||
return listbox;
|
return listbox;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user