* boxes.c (init_disp_bits_box): Use common_dialog_callback().

Return the new dialog.
This commit is contained in:
Pavel Roskin 2002-09-02 05:32:14 +00:00
parent 9f5b82fe08
commit 946e09abc2
2 changed files with 16 additions and 31 deletions

View File

@ -1,5 +1,8 @@
2002-09-02 Pavel Roskin <proski@gnu.org> 2002-09-02 Pavel Roskin <proski@gnu.org>
* boxes.c (init_disp_bits_box): Use common_dialog_callback().
Return the new dialog.
* boxes.c (display_callback): Use common_dialog_repaint(). * boxes.c (display_callback): Use common_dialog_repaint().
(display_init): Avoid using two different translations. (display_init): Avoid using two different translations.

View File

@ -391,7 +391,7 @@ static QuickDialog confirmation =
conf_widgets, 0 }; conf_widgets, 0 };
void void
confirm_box () confirm_box (void)
{ {
#ifdef ENABLE_NLS #ifdef ENABLE_NLS
@ -477,7 +477,7 @@ static QuickDialog display_bits =
"dbits", display_widgets, 0 }; "dbits", display_widgets, 0 };
void void
display_bits_box () display_bits_box (void)
{ {
int current_mode; int current_mode;
@ -544,30 +544,6 @@ display_bits_box ()
#else /* HAVE_CHARSET */ #else /* HAVE_CHARSET */
static Dlg_head *dbits_dlg;
static void dbits_refresh()
{
attrset( COLOR_NORMAL );
dlg_erase( dbits_dlg );
draw_box( dbits_dlg, 1, 2, dbits_dlg->lines - 2, dbits_dlg->cols - 4 );
attrset( COLOR_HOT_NORMAL );
dlg_move( dbits_dlg, 1, (dbits_dlg->cols - strlen(dbits_dlg->title)) / 2 );
addstr( dbits_dlg->title );
}
static int dbits_callback( Dlg_head * h, int Par, int Msg )
{
switch (Msg) {
case DLG_DRAW:
dbits_refresh();
break;
}
return 0;
}
static int new_display_codepage; static int new_display_codepage;
static WLabel *cplabel; static WLabel *cplabel;
@ -585,14 +561,16 @@ static int sel_charset_button( int action, void *param )
return 0; return 0;
} }
void init_disp_bits_box() Dlg_head *
init_disp_bits_box (void)
{ {
char *cpname; char *cpname;
Dlg_head *dbits_dlg;
do_refresh(); do_refresh();
dbits_dlg = create_dlg( 0, 0, DISPY, DISPX, dialog_colors, dbits_dlg = create_dlg( 0, 0, DISPY, DISPX, dialog_colors,
dbits_callback, "[Display bits]", "Display bits", common_dialog_callback, "[Display bits]", "Display bits",
DLG_CENTER ); DLG_CENTER );
x_set_dialog_title( dbits_dlg, _(" Display bits ")); x_set_dialog_title( dbits_dlg, _(" Display bits "));
@ -621,16 +599,20 @@ void init_disp_bits_box()
button_new( 4, DISPX - 8 - strlen(cpname) , B_USER, button_new( 4, DISPX - 8 - strlen(cpname) , B_USER,
NORMAL_BUTTON, cpname, NORMAL_BUTTON, cpname,
sel_charset_button, 0, NULL ) ); sel_charset_button, 0, NULL ) );
return dbits_dlg;
} }
void display_bits_box() void
display_bits_box (void)
{ {
Dlg_head *dbits_dlg;
new_display_codepage = display_codepage; new_display_codepage = display_codepage;
application_keypad_mode (); application_keypad_mode ();
init_disp_bits_box(); dbits_dlg = init_disp_bits_box ();
run_dlg( dbits_dlg ); run_dlg (dbits_dlg);
if (dbits_dlg->ret_value == B_ENTER) { if (dbits_dlg->ret_value == B_ENTER) {
char *errmsg; char *errmsg;