Freeciv-3.2
|
#include <SDL2/SDL.h>
#include "log.h"
#include "colors.h"
#include "graphics.h"
#include "gui_id.h"
#include "gui_tilespec.h"
#include "mapview.h"
#include "themespec.h"
#include "widget.h"
#include "widget_p.h"
Go to the source code of this file.
Data Structures | |
struct | UP_DOWN |
Macros | |
#define | widget_add_next(new_widget, add_dock) |
Variables | |
static int(* | baseclass_redraw )(struct widget *pwidget) |
#define widget_add_next | ( | new_widget, | |
add_dock | |||
) |
Definition at line 52 of file widget_scrollbar.c.
bool add_widget_to_vertical_scroll_widget_list | ( | struct advanced_dialog * | dlg, |
struct widget * | new_widget, | ||
struct widget * | add_dock, | ||
bool | dir, | ||
Sint16 | start_x, | ||
Sint16 | start_y | ||
) |
Add new widget to scrolled list and set draw position of all changed widgets. dir : TRUE - upper add => add_dock->next = new_widget. FALSE - down add => add_dock->prev = new_widget. start_x, start_y - positions of first seen widget (active_widget_list). dlg->scroll ( scrollbar ) must exist. It isn't full secure to multi widget list.
Definition at line 1146 of file widget_scrollbar.c.
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().
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.
|
static |
Create background image for hscrollbars then return pointer to this image.
Graphic is taken from horiz_theme surface and blit to new created image.
Definition at line 206 of file widget_scrollbar.c.
Referenced by redraw_horiz().
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().
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().
|
static |
Create background image for vscrollbars, then return pointer to that image.
Graphic is taken from vert_theme surface and blit to new created image.
Definition at line 74 of file widget_scrollbar.c.
Referenced by redraw_vert().
bool del_widget_from_vertical_scroll_widget_list | ( | struct advanced_dialog * | dlg, |
struct widget * | pwidget | ||
) |
Delete widget from scrolled list and set draw position of all changed widgets. Don't free dlg and dlg->scroll (if exist) It is full secure for multi widget list case.
Definition at line 1344 of file widget_scrollbar.c.
|
static |
Scroll widgets down.
Definition at line 1054 of file widget_scrollbar.c.
Referenced by std_down_advanced_dlg_callback().
Draw horizontal scrollbar.
Definition at line 320 of file widget_scrollbar.c.
Draw vertical scrollbar.
Definition at line 187 of file widget_scrollbar.c.
|
static |
Get current active position of the scrollbar.
Definition at line 352 of file widget_scrollbar.c.
Referenced by add_widget_to_vertical_scroll_widget_list(), add_widget_to_vertical_scroll_widget_list(), del_widget_from_vertical_scroll_widget_list(), and del_widget_from_vertical_scroll_widget_list().
|
static |
Get step of the scrollbar.
Definition at line 336 of file widget_scrollbar.c.
Referenced by down_scroll_widget_list(), get_position(), up_scroll_widget_list(), and vertic_scroll_widget_list().
Callback for the scroll-down event loop.
Definition at line 868 of file widget_scrollbar.c.
Referenced by down_scroll_widget_list().
Callback for the scroll-up event loop.
Definition at line 915 of file widget_scrollbar.c.
Referenced by up_scroll_widget_list().
Blit horizontal scrollbar gfx to surface its on.
Definition at line 264 of file widget_scrollbar.c.
Referenced by create_horizontal(), and draw_horiz().
Blit vertical scrollbar gfx to surface its on.
Definition at line 132 of file widget_scrollbar.c.
Referenced by add_widget_to_vertical_scroll_widget_list(), add_widget_to_vertical_scroll_widget_list(), create_vertical(), draw_vert(), inside_scroll_down_loop(), inside_scroll_up_loop(), scroll_mouse_motion_handler(), and std_vscroll_advanced_dlg_callback().
|
static |
Callback for scrollbar event loops' mouse up events.
Definition at line 1045 of file widget_scrollbar.c.
Referenced by down_scroll_widget_list(), up_scroll_widget_list(), and vertic_scroll_widget_list().
|
static |
Handle mouse motion events of the vertical scrollbar event loop.
Definition at line 957 of file widget_scrollbar.c.
Referenced by vertic_scroll_widget_list().
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().
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.
User interacted with down button of advanced dialog.
Definition at line 432 of file widget_scrollbar.c.
Referenced by create_vertical_scrollbar(), and setup_vertical_scrollbar_default_callbacks().
User interacted with up button of advanced dialog.
Definition at line 405 of file widget_scrollbar.c.
Referenced by create_vertical_scrollbar(), and setup_vertical_scrollbar_default_callbacks().
FIXME : fix main funct : vertic_scroll_widget_list(...)
Definition at line 459 of file widget_scrollbar.c.
Referenced by create_vertical_scrollbar(), and setup_vertical_scrollbar_default_callbacks().
|
static |
Scroll widgets up.
Definition at line 1083 of file widget_scrollbar.c.
Referenced by std_up_advanced_dlg_callback().
|
static |
Scroll vertical widget list with the mouse movement.
Definition at line 1105 of file widget_scrollbar.c.
Referenced by std_vscroll_advanced_dlg_callback().
|
static |
Scroll pointers on list. dir == directions: up == -1, down == 1.
Definition at line 633 of file widget_scrollbar.c.
Referenced by inside_scroll_down_loop(), inside_scroll_up_loop(), and scroll_mouse_motion_handler().
Definition at line 62 of file widget_scrollbar.c.
Referenced by create_horizontal(), and create_vertical().