Logo Search packages:      
Sourcecode: wesnoth-1.9 version File versions  Download package

gui2::tscrollbar_ Class Reference

#include <scrollbar.hpp>

Inheritance diagram for gui2::tscrollbar_:

gui2::tcontrol gui2::twidget gui2::tevent_executor gui2::event::tdispatcher gui2::thorizontal_scrollbar gui2::tslider gui2::tvertical_scrollbar

List of all members.


Detailed Description

Base class for a scroll bar.

class will be subclassed for the horizontal and vertical scroll bar. It might be subclassed for a slider class.

To make this class generic we talk a lot about offset and length and use pure virtual functions. The classes implementing us can use the heights or widths, whichever is applicable.

The NOTIFY_MODIFIED event is send when the position of scrollbar is changed.

Common signal handlers:

Definition at line 41 of file scrollbar.hpp.


Public Types

enum  tdrawing_action { DRAWN, PARTLY_DRAWN, NOT_DRAWN }
enum  tevent_type { pre = 1, child = 2, post = 4 }
enum  tmouse_behaviour { all, hit, none }
enum  tposition {
  front_pre_child, back_pre_child, front_child, back_child,
  front_post_child, back_post_child
}
enum  tscroll {
  BEGIN, ITEM_BACKWARDS, HALF_JUMP_BACKWARDS, JUMP_BACKWARDS,
  END, ITEM_FORWARD, HALF_JUMP_FORWARD, JUMP_FORWARD
}
enum  tvisible { VISIBLE, HIDDEN, INVISIBLE }

Public Member Functions

bool all_items_visible () const
bool at_begin () const
bool at_end () const
virtual bool can_wrap () const
tcanvascanvas (const unsigned index)
std::vector< tcanvas > & canvas ()
void capture_mouse ()
void connect ()
template<tevent E>
boost::enable_if
< boost::mpl::has_key
< tset_event_notification,
boost::mpl::int_< E >
> >::type 
connect_signal (const tsignal_notification_function &signal, const tposition position=back_child)
template<tevent E>
boost::enable_if
< boost::mpl::has_key
< tset_event_keyboard,
boost::mpl::int_< E >
> >::type 
connect_signal (const tsignal_keyboard_function &signal, const tposition position=back_child)
template<tevent E>
boost::enable_if
< boost::mpl::has_key
< tset_event_mouse,
boost::mpl::int_< E >
> >::type 
connect_signal (const tsignal_mouse_function &signal, const tposition position=back_child)
template<tevent E>
boost::enable_if
< boost::mpl::has_key
< tset_event, boost::mpl::int_
< E > > >::type 
connect_signal (const tsignal_function &signal, const tposition position=back_child)
const std::string & definition () const
virtual void demand_reduce_height (const unsigned)
virtual void demand_reduce_width (const unsigned)
tdialogdialog ()
bool disable_click_dismiss () const
template<tevent E>
boost::enable_if
< boost::mpl::has_key
< tset_event_notification,
boost::mpl::int_< E >
> >::type 
disconnect_signal (const tsignal_notification_function &signal, const tposition position=back_child)
template<tevent E>
boost::enable_if
< boost::mpl::has_key
< tset_event_keyboard,
boost::mpl::int_< E >
> >::type 
disconnect_signal (const tsignal_keyboard_function &signal, const tposition position=back_child)
template<tevent E>
boost::enable_if
< boost::mpl::has_key
< tset_event_mouse,
boost::mpl::int_< E >
> >::type 
disconnect_signal (const tsignal_mouse_function &signal, const tposition position=back_child)
template<tevent E>
boost::enable_if
< boost::mpl::has_key
< tset_event, boost::mpl::int_
< E > > >::type 
disconnect_signal (const tsignal_function &signal, const tposition position=back_child)
void draw_background (surface &frame_buffer)
void draw_children (surface &frame_buffer)
void draw_foreground (surface &frame_buffer)
bool execute_hotkey (const hotkey::HOTKEY_COMMAND id)
const twidgetfind (const std::string &id, const bool must_be_active) const
twidgetfind (const std::string &id, const bool must_be_active)
const twidgetfind_at (const tpoint &coordinate, const bool must_be_active) const
twidgetfind_at (const tpoint &coordinate, const bool must_be_active)
bool fire (const tevent event, twidget &target, void *)
bool fire (const tevent event, twidget &target, const SDLKey key, const SDLMod modifier, const Uint16 unicode)
bool fire (const tevent event, twidget &target, const tpoint &coordinate)
bool fire (const tevent event, twidget &target)
bool get_active () const
tpoint get_best_size () const
tpoint get_config_default_size () const
tpoint get_config_maximum_size () const
tpoint get_config_minimum_size () const
virtual const std::string & get_control_type () const =0
bool get_dirty () const
SDL_Rect get_dirty_rect () const
tdrawing_action get_drawing_action () const
unsigned get_height () const
unsigned get_item_count () const
unsigned get_item_position () const
tmouse_behaviour get_mouse_behaviour () const
tpoint get_origin () const
SDL_Rect get_rect () const
tpoint get_size () const
unsigned get_state () const
unsigned get_step_size () const
PangoAlignment get_text_alignment () const
bool get_use_markup () const
bool get_use_tooltip_on_label_overflow () const
tvisible get_visible () const
unsigned get_visible_items () const
unsigned get_width () const
const twindowget_window () const
twindowget_window ()
int get_x () const
int get_y () const
bool has_event (const tevent event, const tevent_type event_type)
virtual bool has_widget (const twidget *widget) const
const t_string & help_message () const
const std::string & id () const
const t_string & label () const
virtual void layout_children ()
void layout_init (const bool full_initialization)
void load_config ()
twidgetparent ()
void place (const tpoint &origin, const tpoint &size)
void populate_dirty_list (twindow &caller, std::vector< twidget * > &call_stack)
void register_hotkey (const hotkey::HOTKEY_COMMAND id, const thotkey_function &function)
void release_mouse ()
virtual void request_reduce_height (const unsigned)
void request_reduce_width (const unsigned maximum_width)
void scroll (const tscroll scroll)
void set_active (const bool active)
void set_debug_border_color (const unsigned debug_border_color)
void set_debug_border_mode (const unsigned debug_border_mode)
void set_definition (const std::string &definition)
void set_dirty (const bool dirty=true)
void set_help_message (const t_string &help_message)
void set_id (const std::string &id)
void set_item_count (const unsigned item_count)
void set_item_position (const unsigned item_position)
virtual void set_label (const t_string &label)
void set_linked_group (const std::string &linked_group)
virtual void set_members (const string_map &data)
void set_mouse_behaviour (const tmouse_behaviour mouse_behaviour)
virtual void set_origin (const tpoint &origin)
void set_parent (twidget *parent)
virtual void set_size (const tpoint &size)
void set_step_size (const unsigned step_size)
void set_text_alignment (const PangoAlignment text_alignment)
void set_tooltip (const t_string &tooltip)
virtual void set_use_markup (bool use_markup)
void set_use_tooltip_on_label_overflow (const bool use_tooltip=true)
void set_visible (const tvisible visible)
virtual void set_visible_area (const SDL_Rect &area)
void set_visible_items (const unsigned visible_items)
void set_wants_mouse_hover (const bool hover=true)
void set_wants_mouse_left_double_click (const bool click=true)
void set_wants_mouse_middle_double_click (const bool click=true)
tevent_executorset_wants_mouse_right_double_click (const bool click=true)
void set_x (const int x)
void set_y (const int y)
const t_string & tooltip () const
bool wants_mouse_hover () const
bool wants_mouse_left_double_click () const
bool wants_mouse_middle_double_click () const
bool wants_mouse_right_double_click () const

Protected Member Functions

tpoint calculate_best_size () const
virtual void child_callback_positioner_moved ()
tresolution_definition_const_ptr config () const
tresolution_definition_ptr config ()
unsigned get_positioner_length () const
unsigned get_positioner_offset () const
int get_text_maximum_height () const
int get_text_maximum_width () const
void impl_draw_background (surface &frame_buffer)
void impl_draw_foreground (surface &)
const tpointlayout_size () const
void set_config (tresolution_definition_ptr config)
void set_layout_size (const tpoint &size)
virtual void update_canvas ()

Private Types

enum  tstate {
  ENABLED, DISABLED, PRESSED, FOCUSSED,
  COUNT
}

Private Member Functions

virtual unsigned get_length () const =0
virtual int get_length_difference (const tpoint &original, const tpoint &current) const =0
void load_config_extra ()
virtual unsigned maximum_positioner_length () const =0
virtual unsigned minimum_positioner_length () const =0
void move_positioner (const int distance)
virtual unsigned offset_after () const =0
virtual unsigned offset_before () const =0
virtual int on_bar (const tpoint &coordinate) const =0
virtual bool on_positioner (const tpoint &coordinate) const =0
void recalculate ()
void recalculate_positioner ()
void set_state (const tstate state)
void signal_handler_left_button_down (const event::tevent event, bool &handled)
void signal_handler_left_button_up (const event::tevent event, bool &handled)
void signal_handler_mouse_enter (const event::tevent event, bool &handled, bool &halt)
void signal_handler_mouse_leave (const event::tevent event, bool &handled)
void signal_handler_mouse_motion (const event::tevent event, bool &handled, bool &halt, const tpoint &coordinate)

Private Attributes

unsigned item_count_
unsigned item_position_
tpoint mouse_
float pixels_per_step_
unsigned positioner_length_
unsigned positioner_offset_
tstate state_
unsigned step_size_
unsigned visible_items_

Friends

class tslider

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index