FACT++  1.0
bool Shell::Resize ( int  h)

This resized the top panel or output panel as requested by the argument. The argument is the number of lines which are kept free for the input panel below the top panel

Returns
always true

Definition at line 383 of file Shell.cc.

References CreateWindows(), WindowLog::Display(), fPanelFrame, fPanelHeight, fPanelOut, WindowLog::SetWindow(), and wout.

Referenced by rl_top_resize().

384 {
385  // Get curretn terminal size
386  int lines, cols;
387  getmaxyx(stdscr, lines, cols);
388 
389  // Check if we are in a valid range
390  if (h<1 || h>lines-5)
391  return false;
392 
393  // Set new height for panel to be kept free
394  fPanelHeight = h;
395 
396  // Store the pointers of the old windows associated with the panels
397  // which should be resized
398  WINDOW *w_frame = panel_window(fPanelFrame);
399  WINDOW *w_out = panel_window(fPanelOut);
400 
401  // Create new windows
402  WINDOW *wins[3];
403  CreateWindows(wins, false);
404 
405  // Redirect the output stream to the new window
406  wout.SetWindow(wins[2]);
407 
408  // Replace the windows associated with the panels
409  replace_panel(fPanelFrame, wins[1]);
410  replace_panel(fPanelOut, wins[2]);
411 
412  // delete the ols windows
413  delwin(w_out);
414  delwin(w_frame);
415 
416  // FIXME: NEEDED also in Redisplay panel
417  //Redisplay();
418 
419  // Redisplay the contents
420  wout.Display();
421 
422  return true;
423 }
PANEL * fPanelOut
Pointer to the panel for the frame around the output.
Definition: Shell.h:23
void CreateWindows(WINDOW *w[3], int all=true)
Helper for the constructor and window resizing to create the windows and panels.
Definition: Shell.cc:240
PANEL * fPanelFrame
Pointer to the panel for the input stream.
Definition: Shell.h:22
void SetWindow(WINDOW *w)
Redirect the output to an ncurses WINDOW instead of cout.
Definition: WindowLog.h:118
struct _win_st WINDOW
Definition: ReadlineWindow.h:6
WindowLog wout
Definition: Shell.h:18
void Display(bool empty=false)
Display backlog.
Definition: WindowLog.cc:46
int fPanelHeight
Pointer to the panel for the output stream.
Definition: Shell.h:25

+ Here is the call graph for this function:

+ Here is the caller graph for this function: