mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-23 12:56:51 +03:00
* boxes.c (init_disp_bits_box): Use common_dialog_callback().
Return the new dialog.
This commit is contained in:
parent
9f5b82fe08
commit
946e09abc2
@ -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.
|
||||||
|
|
||||||
|
44
src/boxes.c
44
src/boxes.c
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user