|
C-Menu 0.2.9
A User Interface Toolkit
|
Manage NCurses windows and color settings. More...
Functions | |
| int | border_title (UiSurface *sfc, char *title) |
| Draw a box with a title around the specified window. | |
| int | border_ysplit (UiSurface *sfc, uint y) |
| Draw a box with a separator line around the specified window. | |
| int | border_ysplit_text (UiSurface *sfc, char *text, uint separator_line) |
| Draw a box with a separator line and text around the specified window. | |
| int | cm_surface_destroy (UiSurface *sfc) |
| Destroy the most recently created surface. | |
| void | destroy_curses () |
| Gracefully shut down NCurses and restore terminal settings. | |
| void | view_boxwin_resize (Init *init) |
| Resize the current window and its box. | |
| void | view_full_screen_resize (Init *init) |
| Resize the full screen view and its components. | |
Manage NCurses windows and color settings.
| int border_title | ( | UiSurface * | sfc, |
| char * | title ) |
Draw a box with a title around the specified window.
border_title
| box | Pointer to the window to draw the box around |
| title | Title text to display at the top of the box |
This function draws a box around the specified window, similar to border_draw(), but it also includes a title at the top of the box. The title is displayed in the center of the top edge of the box, and the horizontal line is drawn on either side of the title. Use this function when you want to visually label a window with a title.
Definition at line 676 of file dwin.c.
References BOX, cell_box, cell_ho, cell_lt, cell_rt, cell_sp, cell_title, cell_tl, mbstr_to_wcstr(), ui_bkgdset(), ui_getmaxx(), ui_mvwadd_wchnstr(), ui_mvwaddnwstr(), and ui_render().
Referenced by new_view_file(), ui_box_surface_new(), ui_box_surface_new(), view_boxwin_resize(), and view_file().
| int border_ysplit | ( | UiSurface * | sfc, |
| uint | y ) |
Draw a box with a separator line around the specified window.
border-ysplit
| box | Pointer to the window to draw the box around |
| y | Line number where the separator line should be drawn |
This function draws a box around the specified window, similar to border_draw(), but it also includes a horizontal separator line that divides the box into two sections. The separator line is drawn at a fixed position (line 00, page 00) and extends across the width of the box. Use this function when you want to visually separate two sections within a window, such as for a header and content area.
Definition at line 617 of file dwin.c.
References BOX, cell_ho, cell_lt, cell_rt, ui_getmaxx(), and ui_mvwadd_wchnstr().
Referenced by surface_split_box_win_new().
| int border_ysplit_text | ( | UiSurface * | sfc, |
| char * | text, | ||
| uint | separator_line ) |
Draw a box with a separator line and text around the specified window.
border_ysplit_text
| box | Pointer to the window to draw the box around |
| text | Text to display in the middle of the separator line |
| separator_line | Line number where the separator line should be drawn |
This function draws a box around the specified window, similar to border_draw(), but it also includes a horizontal separator line that divides the box into two sections. The separator line is drawn at the specified line number and extends across the width of the box, with the provided text displayed in the middle of the line. Use this function when you want to visually separate two sections within a window and label the separator with descriptive text.
Definition at line 637 of file dwin.c.
References BOX, cell_ho, cell_lt, cell_nt_hl, cell_rt, cell_sp, mbstr_to_wcstr(), strnz(), ui_bkgdset(), ui_getmaxx(), ui_mvwadd_wchnstr(), and ui_mvwaddnwstr().
Referenced by picker().
| int cm_surface_destroy | ( | UiSurface * | sfc | ) |
Destroy the most recently created surface.
cm_destroy_surface
This function destroys the most recently created surface and decrements the surface pointer. It should be called when a surface is no longer needed to free up resources. If there are no surfaces to destroy, it returns -1.
Definition at line 576 of file dwin.c.
References sfc_ptr, and ui_surface_destroy().
Referenced by action_disposition(), answer_yn(), display_error(), init_form(), init_pick(), menu_engine(), and Perror().
| void destroy_curses | ( | ) |
Gracefully shut down NCurses and restore terminal settings.
destroy_curses
This function should be called before exiting the program to ensure that the terminal is left in a usable state. It checks if NCurses was initialized and, if so, it erases the screen, and ends the NCurses session. It also restores the original terminal settings using restore_shell_tioctl and resets signal handlers to their default state with sig_dfl_mode.
Definition at line 384 of file dwin.c.
References f_curses_open, restore_shell_tioctl(), sig_dfl_mode(), and ui_shutdown().
Referenced by abend(), and main().
| void view_boxwin_resize | ( | Init * | init | ) |
Resize the current window and its box.
| init | Pointer to the Init structure containing view settings. |
This function resizes the current window and its associated box window to the specified number of lines and columns.
Definition at line 178 of file init_view.c.
References border_title(), init_view_boxwin(), View::sfc, View::title, ui_render(), ui_surface_destroy(), and Init::view.
Referenced by view_cmd_processor().
| void view_full_screen_resize | ( | Init * | init | ) |
Resize the full screen view and its components.
| init | Pointer to the Init structure containing view settings. |
This function resizes the full screen view and its components, including the command line window, line number window, and main content pad. It also recalculates the dimensions for the full screen mode and updates the scroll regions accordingly.
Definition at line 97 of file init_view.c.
References init_view_full_screen(), View::sfc, ui_erase(), ui_render(), ui_surface_destroy(), Init::view, and view_calc_full_screen_dimensions().
Referenced by view_cmd_processor().