Freeciv-3.2: /fast/freeciv/nightly/S3_2/client/gui-sdl3/widget_scrollbar.h File Reference

Freeciv-3.2

Loading...
Searching...
No Matches
Data Structures | Macros | Functions
widget_scrollbar.h File Reference
`#include "widget.h"`

Go to the source code of this file.

## Data Structures

struct | scroll_bar

## Macros

#define | scrollbar_size(scroll)
#define | hide_scrollbar(scrollbar)
#define | show_scrollbar(scrollbar)

## Functions

struct widget * | create_vertical (SDL_Surface *vert_theme, struct gui_layer *pdest, Uint16 height, Uint32 flags)
int | draw_vert (struct widget *vert, Sint16 x, Sint16 y)
Uint32 | create_vertical_scrollbar (struct advanced_dialog *dlg, Uint8 step, Uint8 active, bool create_scrollbar, bool create_buttons)
void | setup_vertical_scrollbar_area (struct scroll_bar *scroll, Sint16 start_x, Sint16 start_y, Uint16 hight, bool swap_start_x)
void | setup_vertical_scrollbar_default_callbacks (struct scroll_bar *scroll)
struct widget * | create_horizontal (SDL_Surface *horiz_theme, struct gui_layer *pdest, Uint16 width, Uint32 flags)
int | draw_horiz (struct widget *horiz, Sint16 x, Sint16 y)
Uint32 | create_horizontal_scrollbar (struct advanced_dialog *dlg, Sint16 start_x, Sint16 start_y, Uint16 width, Uint16 active, bool create_scrollbar, bool create_buttons, bool swap_start_y)

## Macro Definition Documentation

## ◆ hide_scrollbar

#define hide_scrollbar | ( |  | scrollbar | ) |

Value:
do { \
if (scrollbar->up_left_button) { \
if (!(get_wflags(scrollbar->up_left_button) & WF_HIDDEN)) {\
widget_undraw(scrollbar->up_left_button); \
widget_mark_dirty(scrollbar->up_left_button); \
set_wflag(scrollbar->up_left_button, WF_HIDDEN); \
} \
if (!(get_wflags(scrollbar->down_right_button) & WF_HIDDEN)) {\
widget_undraw(scrollbar->down_right_button); \
widget_mark_dirty(scrollbar->down_right_button); \
set_wflag(scrollbar->down_right_button, WF_HIDDEN); \
} \
} \
if (scrollbar->pscroll_bar) { \
if (!(get_wflags(scrollbar->pscroll_bar) & WF_HIDDEN)) { \
widget_undraw(scrollbar->pscroll_bar); \
widget_mark_dirty(scrollbar->pscroll_bar); \
set_wflag(scrollbar->pscroll_bar, WF_HIDDEN); \
} \
} \
} while (FALSE)
incite_cost
char * incite_cost
Definition comments.c:74
get_wflags
enum widget_flag get_wflags(const struct widget *pwidget)
Definition widget_core.c:86
WF_HIDDEN
@ WF_HIDDEN
Definition widget.h:68
FALSE
#define FALSE
Definition support.h:47

Definition at line 36 of file widget_scrollbar.h.

## ◆ scrollbar_size

#define scrollbar_size | ( |  | scroll | ) |

Value:
((float)((float)(scroll->active * scroll->step) / \
(float)scroll->count) * (scroll->max - scroll->min))

Definition at line 32 of file widget_scrollbar.h.

## ◆ show_scrollbar

#define show_scrollbar | ( |  | scrollbar | ) |

Value:
do { \
if (scrollbar->up_left_button) { \
clear_wflag(scrollbar->up_left_button, WF_HIDDEN); \
clear_wflag(scrollbar->down_right_button, WF_HIDDEN); \
} \
if (scrollbar->pscroll_bar) { \
clear_wflag(scrollbar->pscroll_bar, WF_HIDDEN); \
} \
} while (FALSE)

Definition at line 59 of file widget_scrollbar.h.

## Function Documentation

## ◆ create_horizontal()

struct widget * create_horizontal | ( | SDL_Surface * | horiz_theme,
|  | struct gui_layer * | pdest,
|  | Uint16 | width,
|  | Uint32 | flags
| ) |  |

Create ( malloc ) horizontal scroll_bar widget structure.

Theme graphic is taken from horiz_theme surface;

This function determinate future size of horizontal scroll_bar ( width = 'width', height = 'horiz_theme->h' ) and save this in: pwidget->size rectangle ( SDL_Rect )

Return pointer to created widget.

Definition at line 296 of file widget_scrollbar.c.

Referenced by create_horizontal_scrollbar(), economy_report_dialog_popup(), and popup_city_cma_dialog().

## ◆ create_horizontal_scrollbar()

Uint32 create_horizontal_scrollbar | ( | struct advanced_dialog * | dlg,
|  | Sint16 | start_x,
|  | Sint16 | start_y,
|  | Uint16 | width,
|  | Uint16 | active,
|  | bool | create_scrollbar,
|  | bool | create_buttons,
|  | bool | swap_start_y
| ) |  |

Create a new horizontal scrollbar to active widgets list.

Definition at line 1545 of file widget_scrollbar.c.

## ◆ create_vertical()

struct widget * create_vertical | ( | SDL_Surface * | vert_theme,
|  | struct gui_layer * | pdest,
|  | Uint16 | height,
|  | Uint32 | flags
| ) |  |

Create ( malloc ) vertical scroll_bar widget structure.

Theme graphic is taken from vert_theme surface;

This function determinate future size of vertical scroll_bar ( width = 'vert_theme->w', height = 'height' ) and save this in: pwidget->size rectangle ( SDL_Rect )

Return pointer to created widget.

Definition at line 164 of file widget_scrollbar.c.

Referenced by create_vertical_scrollbar().

## ◆ create_vertical_scrollbar()

Uint32 create_vertical_scrollbar | ( | struct advanced_dialog * | dlg,
|  | Uint8 | step,
|  | Uint8 | active,
|  | bool | create_scrollbar,
|  | bool | create_buttons
| ) |  |

Create a new vertical scrollbar to active widgets list.

Definition at line 486 of file widget_scrollbar.c.

Referenced by create_present_supported_units_widget_list(), economy_report_dialog_popup(), meswin_dialog_popup(), option_dialog_optset_category(), option_dialog_worklist(), popup_advanced_terrain_dialog(), popup_change_research_dialog(), popup_change_research_goal_dialog(), popup_conn_list_dialog(), popup_connection_dialog(), popup_diplomatic_objects(), popup_find_dialog(), popup_goto_airlift_dialog(), popup_impr_info(), popup_load_del_presets_dialog(), popup_load_game_dialog(), popup_players_nations_dialog(), popup_races_dialog(), popup_sabotage_dialog(), popup_tech_info(), popup_unit_info(), popup_worklist_editor(), real_activeunits_report_dialog_update(), real_conn_list_dialog_update(), real_info_city_report_dialog_update(), rebuild_imprm_list(), redraw_unit_info_label(), spy_steal_popup_shared(), unit_select_dialog_popup(), update_diplomacy_dialog(), and update_intel_dialog().

## ◆ draw_horiz()

int draw_horiz | ( | struct widget * | horiz,
|  | Sint16 | x,
|  | Sint16 | y
| ) |  |

Draw horizontal scrollbar.

Definition at line 320 of file widget_scrollbar.c.

## ◆ draw_vert()

int draw_vert | ( | struct widget * | vert,
|  | Sint16 | x,
|  | Sint16 | y
| ) |  |

Draw vertical scrollbar.

Definition at line 187 of file widget_scrollbar.c.

## ◆ setup_vertical_scrollbar_area()

void setup_vertical_scrollbar_area | ( | struct scroll_bar * | scroll,
|  | Sint16 | start_x,
|  | Sint16 | start_y,
|  | Uint16 | height,
|  | bool | swap_start_x
| ) |  |

Setup area for the vertical scrollbar.

Definition at line 567 of file widget_scrollbar.c.

Referenced by add_target_to_worklist(), create_present_supported_units_widget_list(), economy_report_dialog_popup(), meswin_dialog_popup(), option_dialog_optset_category(), option_dialog_worklist(), popup_advanced_terrain_dialog(), popup_change_research_dialog(), popup_change_research_goal_dialog(), popup_conn_list_dialog(), popup_connection_dialog(), popup_diplomatic_objects(), popup_find_dialog(), popup_goto_airlift_dialog(), popup_impr_info(), popup_load_game_dialog(), popup_players_nations_dialog(), popup_races_dialog(), popup_sabotage_dialog(), popup_tech_info(), popup_unit_info(), popup_worklist_editor(), real_activeunits_report_dialog_update(), real_conn_list_dialog_update(), real_info_city_report_dialog_update(), rebuild_imprm_list(), remove_item_from_worklist(), spy_steal_popup_shared(), unit_select_dialog_popup(), update_diplomacy_dialog(), and update_intel_dialog().

## ◆ setup_vertical_scrollbar_default_callbacks()

void setup_vertical_scrollbar_default_callbacks | ( | struct scroll_bar * | scroll | ) |

Set default vertical scrollbar handling for scrollbar.

Definition at line 1522 of file widget_scrollbar.c.