* 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>
|
||||
|
||||
* wtools.c (create_listbox_window): Don't repaint the dialog
|
||||
before it's run.
|
||||
|
||||
* learn.c: Don't track button hotkeys.
|
||||
(learn_check_key): Consume all alphanumeric keys, regardless of
|
||||
button hotkeys.
|
||||
|
30
src/wtools.c
30
src/wtools.c
@ -50,39 +50,39 @@
|
||||
|
||||
/* {{{ 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;
|
||||
Listbox *listbox = g_new (Listbox, 1);
|
||||
char* cancel_string = _("&Cancel");
|
||||
char *cancel_string = _("&Cancel");
|
||||
|
||||
/* 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;
|
||||
|
||||
/* 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 = cols > COLS-6 ? COLS-6 : cols;
|
||||
|
||||
/* I'm not sure if this -2 is safe, should test it */
|
||||
xpos = (COLS-cols)/2;
|
||||
ypos = (LINES-lines)/2 - 2;
|
||||
cols = cols > COLS - 6 ? COLS - 6 : cols;
|
||||
xpos = (COLS - cols) / 2;
|
||||
ypos = (LINES - lines) / 2 - 2;
|
||||
|
||||
/* Create components */
|
||||
listbox->dlg = create_dlg (ypos, xpos, lines+6, cols+4, dialog_colors,
|
||||
NULL, help, title, DLG_CENTER);
|
||||
listbox->dlg =
|
||||
create_dlg (ypos, xpos, lines + 6, cols + 4, dialog_colors, NULL,
|
||||
help, title, DLG_CENTER);
|
||||
|
||||
listbox->list = listbox_new (2, 2, cols, lines, 0);
|
||||
|
||||
add_widget (listbox->dlg,
|
||||
button_new (lines+3, (cols/2 + 2) - len/2,
|
||||
B_CANCEL, NORMAL_BUTTON, cancel_string, 0));
|
||||
button_new (lines + 3, (cols / 2 + 2) - len / 2, B_CANCEL,
|
||||
NORMAL_BUTTON, cancel_string, 0));
|
||||
add_widget (listbox->dlg, listbox->list);
|
||||
common_dialog_repaint (listbox->dlg);
|
||||
|
||||
return listbox;
|
||||
}
|
||||
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user