Logo Search packages:      
Sourcecode: widelands version File versions  Download package

UI::Multiline_Textarea Struct Reference

#include <ui_multilinetextarea.h>

Inheritance diagram for UI::Multiline_Textarea:

UI::Panel UI::Object

List of all members.


Detailed Description

This defines an area, where a text can easily be printed. The textarea transparently handles explicit line-breaks and word wrapping.

Do not use it blindly for big texts: the font handler needs to re-break the entire text whenever the textarea is drawn, this is a trade-off which greatly simplifies this class.

Definition at line 39 of file ui_multilinetextarea.h.


Public Types

enum  {
  pf_handle_mouse = 1, pf_think = 2, pf_top_on_click = 4, pf_die = 8,
  pf_child_die = 16, pf_visible = 32, pf_can_focus = 64, pf_snap_windows_only_when_overlapping = 128,
  pf_dock_windows_to_edges = 256
}
enum  ScrollMode { ScrollNormal = 0, ScrollLog = 1 }

Public Member Functions

void center_mouse ()
void draw (RenderTarget *dst)
virtual void draw_border (RenderTarget *dst)
virtual void draw_overlay (RenderTarget &dst)
virtual void end ()
void end_modal (int code)
void fit_inner (Panel *inner)
void focus ()
void free_children ()
uint get_bborder () const
ushort get_border_snap_distance () const
bool get_can_focus () const
bool get_dock_windows_to_edges () const
uint get_eff_w () const throw ()
const Panelget_first_child () const
RGBColor & get_font_clr ()
const char * get_font_name ()
const int get_font_size ()
int get_h () const
bool get_handle_mouse () const
int get_inner_h () const
int get_inner_w () const
const Panelget_last_child () const
uint get_lborder () const
Point get_mouse_position () const throw ()
const Panelget_next_sibling () const
uchar get_panel_snap_distance () const
Panelget_parent () const
const Panelget_prev_sibling () const
uint get_rborder () const
ScrollMode get_scrollmode () const
bool get_snap_windows_only_when_overlapping () const
uint get_tborder () const
std::string get_text () const
bool get_think () const
bool get_top_on_click () const
bool get_visible () const
int get_w () const
int get_x () const
int get_y () const
void grab_mouse (bool grab)
virtual bool handle_key (bool down, int code, char c)
virtual void handle_mousein (bool inside)
virtual bool handle_mousemove (const Uint8 state, int x, int y, int xdiff, int ydiff)
bool handle_mousepress (const Uint8 btn, int x, int y)
virtual bool handle_mouserelease (const Uint8 btn, int x, int y)
bool has_focus () const
virtual bool is_snap_target () const
virtual void move_inside_parent ()
void move_to_top ()
 Multiline_Textarea (Panel *const parent, const int x, const int y, const uint w, const uint h, const std::string &text=std::string(), const Align=Align_Left, const bool always_show_scrollbar=false)
int run ()
uint scrollbar_w () const throw ()
void set_align (Align align)
void set_border (uint l, uint r, uint t, uint b)
void set_border_snap_distance (const uchar value)
void set_cache (bool enable)
void set_can_focus (bool yes)
void set_dock_windows_to_edges (const bool on=true)
void set_font (std::string name, int size, RGBColor fg)
void set_handle_mouse (bool yes)
void set_inner_size (uint nw, uint nh)
void set_mouse_pos (const Point)
void set_panel_snap_distance (const uchar value)
void set_pos (const Point)
void set_scrollmode (ScrollMode mode)
void set_scrollpos (int pixels)
void set_size (const uint nw, const uint nh)
void set_snap_windows_only_when_overlapping (const bool on=true)
void set_text (const std::string &text)
void set_think (bool yes)
void set_tooltip (const char *const)
void set_top_on_click (bool on)
void set_visible (bool on)
virtual void start ()
virtual void think ()
const char * tooltip () const throw ()
void update (int x, int y, int w, int h)
void update_inner (int x, int y, int w, int h)
 ~Multiline_Textarea ()

Static Public Attributes

static const int dying_code = -1

Protected Member Functions

void die ()
void draw_scrollbar ()
int get_halign ()
int get_m_textpos ()
bool keyboard_free ()
void play_click ()

Protected Attributes

Align m_align
uint m_cache_id
Widget_Cache m_cache_mode
 picid of the whole textarea surface
RGBColor m_fcolor
std::string m_fontname
int m_fontsize
uint m_textheight
 total height of wrapped text, in pixels
uint m_textpos
 current scrolling position in pixels (0 is top)

Private Attributes

Scrollbar m_scrollbar
ScrollMode m_scrollmode
std::string m_text

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

Generated by  Doxygen 1.6.0   Back to index