Freeciv-3.3
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 widgetcreate_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 height, bool swap_start_x)
 
void setup_vertical_scrollbar_default_callbacks (struct scroll_bar *scroll)
 
struct widgetcreate_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); \
set_wflag(scrollbar->pscroll_bar, WF_HIDDEN); \
} \
} \
} while (FALSE)
char * incite_cost
Definition comments.c:76
enum widget_flag get_wflags(const struct widget *pwidget)
Definition widget_core.c:86
@ WF_HIDDEN
Definition widget.h:68
#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 
)

◆ 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_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.