Adonthell  0.4
label_input Class Reference
Inheritance diagram for label_input:
Collaboration diagram for label_input:

Public Member Functions

 label_input ()
 Constructor Initialize to : cursor_moveable, cursor_visible and editable. More...
 
void set_editable (const bool)
 Set the label input in editable. More...
 
bool input_update ()
 Input update. More...
 
- Public Member Functions inherited from label
 label ()
 Constructor by default, cursor is not moveable, cursor is not visible, and the form is set as NOTHING, the default size is (0, 0) More...
 
virtual ~label ()
 Destructor. More...
 
void set_font (win_font &font)
 Set the font. More...
 
void set_text (const string &text)
 Set the text. More...
 
void add_text (const string &text)
 Add text. More...
 
void set_form (const u_int8 form)
 Set the form of the display NOTHING, AUTO_SIZE, AUTO_HEIGHT. More...
 
void set_cursor_visible (const bool b)
 Set visible cursor. More...
 
void set_cursor_moveable (const bool b)
 Set if the cursor can be moved with arrow key. More...
 
bool update ()
 Update the label. More...
 
const string & text_string () const
 Get the text in string. More...
 
const char * text_char () const
 Get the text in char. More...
 
void resize (u_int16 l, u_int16 h)
 Resize the label. More...
 
- Public Member Functions inherited from image
 image ()
 Default constructor. More...
 
 image (u_int16 l, u_int16 h, const u_int8 &scale=1)
 Creates an image with a specified size. More...
 
 image (SDL_Surface *s, const SDL_Color &color)
 Create image from SDL_Surface. More...
 
virtual ~image ()
 Destructor. More...
 
void resize (u_int16 l, u_int16 h)
 Resize this image. More...
 
void clear ()
 Resets the image to it's initial state, that is totally empty. More...
 
imageoperator= (const image &src)
 Image copy (similar to copy ()). More...
 
void copy (const image &src)
 Synonym of operator = to guarantee its access from Python. More...
 
s_int8 get (igzstream &file)
 Loads an image from an opened file, saved in game internal format, with alpha and mask values. More...
 
s_int8 load (string fname)
 Loads an image from a file name, in game internal format, with alpha and mask values. More...
 
s_int8 get_raw (igzstream &file)
 Loads an image from an opened file, saved in game internal format, without alpha and mask values. More...
 
s_int8 load_raw (string fname)
 Loads an image from a file name, in game internal format, without alpha and mask values. More...
 
s_int8 get_pnm (SDL_RWops *file)
 Loads an image from an opened file, in PNM format, without alpha and mask values. More...
 
s_int8 load_pnm (string fname)
 Loads an image from a file name, in PNM format, without alpha and mask values. More...
 
s_int8 put (ogzstream &file) const
 Saves an image into an opened file, in game format, with alpha and mask values. More...
 
s_int8 save (string fname) const
 Saves an image into an file, in game format, with alpha and mask values. More...
 
s_int8 put_raw (ogzstream &file) const
 Saves an image into an opened file, in game format, without alpha and mask values. More...
 
s_int8 save_raw (string fname) const
 Saves an image into an file, in game format, without alpha and mask values. More...
 
s_int8 put_pnm (SDL_RWops *file) const
 Saves an image into an opened file, in PNM format, without alpha and mask values. More...
 
s_int8 save_pnm (string fname) const
 Saves an image into an file, in PNM format, without alpha and mask values. More...
 
void zoom (const surface &src)
 Zooms a surface. More...
 
void zoom (const surface &src, u_int16 l, u_int16 h, u_int16 x=0, u_int16 y=0)
 Zooms a surface. More...
 
void zoom_to (const surface &src, u_int16 l, u_int16 h, u_int16 x=0, u_int16 y=0)
 Synonym of zoom () to guarantee its access from Python. More...
 
void tile (const surface &src)
 Tiles a surface. More...
 
void tile (const surface &src, u_int16 l, u_int16 h, u_int16 x=0, u_int16 y=0)
 Tiles a surface. More...
 
void tile_to (const surface &src, u_int16 l, u_int16 h, u_int16 x=0, u_int16 y=0)
 Synonym of tile () to guarantee its access from Python. More...
 
void brightness (const surface &src, u_int8 cont, bool proceed_mask=false)
 Applies a "brightness" to a surface. More...
 
- Public Member Functions inherited from surface
 surface (const u_int8 &scale=1)
 Default constructor. More...
 
virtual ~surface ()
 Destructor. More...
 
surfaceoperator= (const surface &src)
 Surface copy (similar to copy ()). More...
 
void copy (const surface &src)
 Synonym of operator = to guarantee its access from Python. More...
 
bool is_masked () const
 Returns whether a surface is masked or not. More...
 
void set_mask (bool m)
 Sets the mask parameter of the surface. More...
 
u_int8 alpha () const
 Returns the alpha value of the surface. More...
 
void set_alpha (u_int8 a, const bool &alpha_channel=false)
 Sets the alpha value of the surface. More...
 
bool has_alpha_channel () const
 Returns whether the surface has an alpha channel. More...
 
u_int8 scale () const
 Get the surfaces current scaling factor. More...
 
void set_scale (const u_int8 &scale)
 Change the scale of the surface to the given value, resizing the internal texture appropriately. More...
 
void draw (s_int16 x, s_int16 y, const drawing_area *da_opt=NULL, surface *target=NULL) const
 Draw the surface. More...
 
void draw (s_int16 x, s_int16 y, s_int16 sx, s_int16 sy, u_int16 sl, u_int16 sh, const drawing_area *da_opt=NULL, surface *target=NULL) const
 Draw a part of the surface. More...
 
void draw_part (s_int16 x, s_int16 y, s_int16 sx, s_int16 sy, u_int16 sl, u_int16 sh, const drawing_area *da_opt=NULL, surface *target=NULL) const
 Synonym of draw () to guarantee its access from Python. More...
 
void fillrect (s_int16 x, s_int16 y, u_int16 l, u_int16 h, u_int32 col, drawing_area *da_opt=NULL)
 Fills an area of the surface with a given color. More...
 
u_int32 map_color (const u_int8 &r, const u_int8 &g, const u_int8 &b, const u_int8 &a=255) const
 
void unmap_color (u_int32 col, u_int8 &r, u_int8 &g, u_int8 &b, u_int8 &a) const
 
void lock () const
 Locks the surface. More...
 
void unlock () const
 Unlock the surface after you've worked on it's pixels with the get_pix () and put_pix () methods. More...
 
void put_pix (u_int16 x, u_int16 y, u_int32 col)
 Puts a pixel of a given color. More...
 
void put_pix (u_int16 x, u_int16 y, u_int8 r, u_int8 g, u_int8 b)
 Puts a pixel of a given color. More...
 
void put_pix_rgb (u_int16 x, u_int16 y, u_int8 r, u_int8 g, u_int8 b)
 Synonym of put_pix () to guarantee its access from Python. More...
 
u_int32 get_pix (u_int16 x, u_int16 y) const
 Gets a pixel from the surface. More...
 
void get_pix (u_int16 x, u_int16 y, u_int8 &r, u_int8 &g, u_int8 &b) const
 Gets a pixel from a surface. More...
 
void get_pix_rgb (u_int16 x, u_int16 y, u_int8 r, u_int8 g, u_int8 b) const
 Synonym of get_pix () to guarantee its access from Python. More...
 
- Public Member Functions inherited from drawable
 drawable ()
 Default constructor. More...
 
virtual ~drawable ()
 Destructor. More...
 
u_int16 length () const
 Returns the length of the drawable. More...
 
u_int16 height () const
 Returns the height of the drawable. More...
 

Protected Attributes

bool editable_
 
- Protected Attributes inherited from label
win_fontmy_font_
 
string my_text_
 
string new_text_
 
u_int8 my_form_
 
bool visible_cursor_
 
bool moveable_cursor_
 
u_int16 cursor_cur_blink_
 
Scursor my_cursor_
 
Scursor my_old_cursor_
 
vector< Sline_textmy_vect_
 
u_int16 start_line_
 
- Protected Attributes inherited from surface
SDL_Texture * Surface
 the surface More...
 
u_int8 scale_
 current scale More...
 
s_int16 offset_x_
 sub-pixel offset More...
 

Additional Inherited Members

- Static Public Attributes inherited from label
static const u_int8 NOTHING = 0
 
static const u_int8 AUTO_HEIGHT = 1
 
static const u_int8 AUTO_SIZE = 2
 
static const SDL_Keycode KEY_CURSOR_NEXT = SDLK_RIGHT
 
static const SDL_Keycode KEY_CURSOR_PREVIOUS = SDLK_LEFT
 
- Protected Member Functions inherited from label
void fit_text_width ()
 
u_int16 ucd (u_int16 &idx) const
 
u_int16 ucd (const std::string &text, u_int16 &idx) const
 
void init_vec_cursor ()
 Init vector and cursor, don't erase my_text_. More...
 
void build (const bool erase_all)
 Build label. More...
 
void build_form_nothing ()
 Build the label when the form set top nothing. More...
 
void build_form_auto_height ()
 
void build_form_auto_size ()
 
void clean_surface (const bool erase_all)
 
u_int8 find_word (u_int16 &index, u_int16 &wlength, u_int16 &wlengthpix, s_int16 &woffset, u_int16 &last_letter, const u_int16 rlength)
 
void draw_string (const bool at_cursor)
 
void update_cursor ()
 
void cursor_next ()
 
void cursor_previous ()
 
void cursor_draw ()
 
void cursor_undraw ()
 
bool last_letter (u_int16 idx)
 
- Protected Member Functions inherited from surface
void resize (u_int16 l, u_int16 h)
 Resize this surface. More...
 
void clear ()
 Resets the surface to it's initial state, that is totally empty. More...
 
void set_data (void *data, u_int16 l, u_int16 h, u_int8 bytes_per_pixel=BYTES_PER_PIXEL, u_int32 red_mask=R_MASK, u_int32 green_mask=G_MASK, u_int32 blue_mask=B_MASK, u_int32 alpha_mask=0)
 
void * get_data (u_int8 bytes_per_pixel, u_int32 red_mask, u_int32 green_mask, u_int32 blue_mask, u_int32 alpha_mask) const
 
SDL_Surface * to_sw_surface (SDL_Rect *rect=NULL) const
 Create a software surface backed by the (streaming) texture data. More...
 
void lock (SDL_Rect *rect) const
 lock part of the surface specified by rect More...
 
- Protected Member Functions inherited from drawable
void set_length (u_int16 l)
 Sets the length of the drawable. More...
 
void set_height (u_int16 h)
 Sets the height of the drawable. More...
 
- Static Protected Attributes inherited from label
static u_int16 cursor_blink_cycle = 75
 

Detailed Description

Definition at line 25 of file label_input.h.

Constructor & Destructor Documentation

◆ label_input()

label_input::label_input ( )

Constructor Initialize to : cursor_moveable, cursor_visible and editable.

Definition at line 21 of file label_input.cc.

Member Function Documentation

◆ set_editable()

void label_input::set_editable ( const bool  b)

Set the label input in editable.

Definition at line 36 of file label_input.cc.

◆ input_update()

bool label_input::input_update ( )
virtual

Input update.

Reimplemented from label.

Definition at line 41 of file label_input.cc.


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