/* re-init the menu, because perhaps there was a change in the way how the panel are split (horizontal/vertical). */ done_menu(); init_menu(); menubar_arrange(the_menubar); #endif } void layout_cmd (void) { int result; int i; init_layout (); run_dlg (layout_dlg); result = layout_dlg->ret_value; if (result == B_ENTER || result == B_EXIT){ for (i = 0; check_options [i].text; i++) if (check_options [i].widget) *check_options [i].variable = check_options [i].widget->state & C_BOOL; #ifndef HAVE_X horizontal_split = radio_widget->sel; first_panel_size = _first_panel_size; output_lines = _output_lines; layout_do_change = 1; #endif } if (result == B_EXIT){ save_layout (); sync_profiles (); } destroy_dlg (layout_dlg); if (layout_do_change) layout_change (); } static void check_split (void) { if (horizontal_split){ if (equal_split) first_panel_size = height / 2; else if (first_panel_size < MINHEIGHT) first_panel_size = MINHEIGHT; else if (first_panel_size > height - MINHEIGHT) first_panel_size = height - MINHEIGHT; } else { if (equal_split) first_panel_size = COLS / 2; else if (first_panel_size < MINWIDTH) first_panel_size = MINWIDTH; else if (first_panel_size > COLS - MINWIDTH) first_panel_size = COLS - MINWIDTH; } } int panel_event (Gpm_Event *event, WPanel *panel); int menu_bar_event (Gpm_Event *event, void *); extern char *prompt; #ifndef HAVE_X #ifdef HAVE_SLANG void init_curses () { extern int force_ugly_line_drawing; extern int SLtt_Has_Alt_Charset; SLtt_get_terminfo (); #ifndef OS2_NT if (force_ugly_line_drawing) SLtt_Has_Alt_Charset = 0; #endif SLsmg_init_smg (); do_enter_ca_mode (); init_colors (); keypad (stdscr, TRUE); nodelay (stdscr, FALSE); } #else void init_curses (void) { initscr(); if (!status_using_ncurses) do_enter_ca_mode (); mc_raw_mode (); noecho (); keypad (stdscr, TRUE); nodelay (stdscr, FALSE); init_colors (); } #endif /* ! HAVE_SLANG */ void done_screen () { if (!(quit & SUBSHELL_EXIT)) clr_scr (); reset_shell_mode (); mc_noraw_mode (); if (use_mouse_p) shut_mouse (); keypad (stdscr, FALSE); }
void done_screen () { if (!(quit & SUBSHELL_EXIT)) clr_scr (); reset_shell_mode (); mc_noraw_mode (); keypad (stdscr, FALSE); done_colors (); }
void change_screen_size (void) { #if defined(HAVE_SLANG) || NCURSES_VERSION_MAJOR >= 4 #if defined TIOCGWINSZ && !defined SCO_FLAVOR extern Dlg_head *view_dlg; extern Dlg_head *edit_dlg; #ifndef NCURSES_VERSION mc_noraw_mode (); endwin (); #endif low_level_change_screen_size (); check_split (); #ifndef NCURSES_VERSION /* XSI Curses spec states that portable applications shall not invoke * initscr() more than once. This kludge could be done within the scope * of the specification by using endwin followed by a refresh (in fact, * more than one curses implementation does this); it is guaranteed to work * only with slang. */ init_curses (); #endif setup_panels (); if (current_dlg == view_dlg) view_adjust_size (view_dlg); #ifdef USE_INTERNAL_EDIT if (current_dlg == edit_dlg) edit_adjust_size (edit_dlg); #endif #ifdef RESIZABLE_MENUBAR menubar_arrange(the_menubar); #endif /* Now, force the redraw */ do_refresh (); touchwin (stdscr); #endif /* TIOCGWINSZ && !SCO_FLAVOR */ #endif /* defined(HAVE_SLANG) || NCURSES_VERSION_MAJOR >= 4 */ winch_flag = 0; }
void change_screen_size (void) { #if defined(HAVE_SLANG) || NCURSES_VERSION_MAJOR >= 4 #if defined TIOCGWINSZ #ifndef NCURSES_VERSION mc_noraw_mode (); endwin (); #endif low_level_change_screen_size (); check_split (); #ifndef NCURSES_VERSION /* XSI Curses spec states that portable applications shall not invoke * initscr() more than once. This kludge could be done within the scope * of the specification by using endwin followed by a refresh (in fact, * more than one curses implementation does this); it is guaranteed to work * only with slang. */ init_curses (); #endif setup_panels (); /* Inform currently running dialog */ (*current_dlg->callback) (current_dlg, DLG_RESIZE, 0); #ifdef RESIZABLE_MENUBAR menubar_arrange (the_menubar); #endif /* Now, force the redraw */ do_refresh (); touchwin (stdscr); #endif /* TIOCGWINSZ */ #endif /* defined(HAVE_SLANG) || NCURSES_VERSION_MAJOR >= 4 */ winch_flag = 0; }