Starshatter_Open
Open source Starshatter engine
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
EditBox Class Reference

#include <EditBox.h>

Inheritance diagram for EditBox:
ScrollWindow ActiveWindow Window EventTarget

List of all members.

Public Types

enum  ALIGN { EDIT_ALIGN_LEFT = DT_LEFT, EDIT_ALIGN_CENTER = DT_CENTER, EDIT_ALIGN_RIGHT = DT_RIGHT }
- Public Types inherited from ScrollWindow
enum  POLICY { SCROLL_NEVER, SCROLL_AUTO, SCROLL_ALWAYS }
enum  SCROLL {
  SCROLL_NONE, SCROLL_UP, SCROLL_PAGE_UP, SCROLL_DOWN,
  SCROLL_PAGE_DOWN, SCROLL_THUMB
}
enum  MISC {
  BORDER_WIDTH = 2, EXTRA_WIDTH = 4, SCROLL_WIDTH = 16, SCROLL_HEIGHT = 6,
  SCROLL_TRACK = SCROLL_WIDTH + 1, TRACK_START = BORDER_WIDTH + SCROLL_HEIGHT, THUMB_HEIGHT = SCROLL_WIDTH, HEADING_EXTRA = BORDER_WIDTH + EXTRA_WIDTH
}

Public Member Functions

 EditBox (ActiveWindow *p, int ax, int ay, int aw, int ah, DWORD aid)
 EditBox (Screen *s, int ax, int ay, int aw, int ah, DWORD aid)
virtual ~EditBox ()
virtual void DrawContent (const Rect &ctrl_rect)
virtual void DrawTabbedText ()
virtual void SetFocus ()
virtual void KillFocus ()
virtual int OnMouseMove (int x, int y)
virtual int OnLButtonDown (int x, int y)
virtual int OnLButtonUp (int x, int y)
virtual int OnClick ()
virtual int OnKeyDown (int vk, int flags)
virtual bool CanScroll (int direction, int nlines=1)
virtual void Scroll (int direction, int nlines=1)
virtual void ScrollTo (int index)
virtual int GetPageCount ()
virtual int GetPageSize ()
Color GetSelectedColor ()
void SetSelectedColor (Color c)
int GetSelStart ()
int GetSelLength ()
Text GetSelText ()
void SetSelStart (int n)
void SetSelLength (int n)
char GetPasswordChar ()
void SetPasswordChar (char c)
- Public Member Functions inherited from ScrollWindow
 ScrollWindow (ActiveWindow *p, int ax, int ay, int aw, int ah, DWORD aid, DWORD style=0, ActiveWindow *parent=0)
 ScrollWindow (Screen *s, int ax, int ay, int aw, int ah, DWORD aid, DWORD style=0, ActiveWindow *parent=0)
virtual ~ScrollWindow ()
virtual void Paint ()
virtual void Draw ()
virtual void DrawTransparent ()
virtual void DrawTransparentContent (const Rect &ctrl_rect)
virtual void DrawScrollBar ()
virtual void MoveTo (const Rect &r)
virtual int OnMouseWheel (int wheel)
virtual int OnDragStart (int x, int y)
virtual int OnDragDrop (int x, int y, ActiveWindow *source)
virtual int GetLineHeight ()
virtual void SetLineHeight (int h)
virtual int GetLeading ()
virtual void SetLeading (int nNewValue)
virtual int GetScrollBarVisible ()
virtual void SetScrollBarVisible (int nNewValue)
virtual int GetDragDrop ()
virtual void SetDragDrop (int nNewValue)
virtual bool GetSmoothScroll ()
virtual void SetSmoothScroll (bool s)
virtual bool IsScrollVisible ()
virtual void EnsureVisible (int index)
virtual void SmoothScroll (int direction, double nlines)
virtual int GetTopIndex ()
virtual int GetLineCount ()
virtual int GetScrollTrack ()
int IsDragging () const
int IsSelecting () const
int IsScrolling () const
- Public Member Functions inherited from ActiveWindow
 ActiveWindow (Screen *s, int ax, int ay, int aw, int ah, DWORD id=0, DWORD style=0, ActiveWindow *parent=0)
virtual ~ActiveWindow ()
int operator== (const ActiveWindow &w) const
virtual void Show ()
virtual void Hide ()
virtual void UseLayout (const std::vector< DWORD > &min_x, const std::vector< DWORD > &min_y, const std::vector< float > &weight_x, const std::vector< float > &weight_y)
virtual void UseLayout (const std::vector< float > &min_x, const std::vector< float > &min_y, const std::vector< float > &weight_x, const std::vector< float > &weight_y)
virtual void UseLayout (int ncols, int nrows, int *min_x, int *min_y, float *weight_x, float *weight_y)
virtual void DoLayout ()
virtual int OnSelect ()
virtual int OnRButtonDown (int x, int y)
virtual int OnRButtonUp (int x, int y)
virtual int OnMouseEnter (int x, int y)
virtual int OnMouseExit (int x, int y)
virtual const char * GetDescription () const
virtual ActiveWindowFindControl (int x, int y)
virtual Rect TargetRect () const
virtual ActiveWindowGetCapture ()
virtual int SetCapture ()
virtual int ReleaseCapture ()
virtual bool HasFocus () const
void SetEnabled (bool e=true)
bool IsEnabled () const
bool IsVisible () const
DWORD GetID () const
void SetStyle (DWORD s)
DWORD GetStyle () const
void SetText (const char *t)
void SetText (const Text &t)
void AddText (const char *t)
void AddText (const Text &t)
const TextGetText () const
void SetAltText (const char *t)
void SetAltText (const Text &t)
const TextGetAltText () const
void SetTexture (Bitmap *bmp)
BitmapGetTexture ()
void SetMargins (const Insets &m)
InsetsGetMargins ()
void SetTextInsets (const Insets &t)
InsetsGetTextInsets ()
List< ActiveWindow > & GetChildren ()
void SetCellInsets (const Insets &c)
InsetsGetCellInsets ()
void SetCells (int cx, int cy, int cw=1, int ch=1)
void SetCells (const Rect &r)
RectGetCells ()
void SetFixedWidth (int w)
int GetFixedWidth () const
void SetFixedHeight (int h)
int GetFixedHeight () const
void SetAlpha (double a)
double GetAlpha () const
void SetBackColor (Color c)
Color GetBackColor () const
void SetBaseColor (Color c)
Color GetBaseColor () const
void SetForeColor (Color c)
Color GetForeColor () const
void SetSingleLine (bool a)
bool GetSingleLine () const
void SetTextAlign (DWORD a)
DWORD GetTextAlign () const
void SetTransparent (bool t)
bool GetTransparent () const
void SetHidePartial (bool a)
bool GetHidePartial () const
void SetTabStop (int n, int x)
int GetTabStop (int n) const
void DrawText (const char *txt, int count, Rect &txt_rect, DWORD flags)
virtual void RegisterClient (int EID, ActiveWindow *client, PFVAWE callback)
virtual void UnregisterClient (int EID, ActiveWindow *client)
virtual void ClientEvent (int EID, int x=0, int y=0)
virtual ActiveWindowGetForm ()
virtual void SetForm (ActiveWindow *f)
virtual bool IsFormActive () const
virtual bool IsTopMost () const
virtual void SetTopMost (bool t)
virtual ActiveWindowFindChild (DWORD id)
virtual ActiveWindowFindChild (int x, int y)
- Public Member Functions inherited from Window
 Window (Screen *s, int ax, int ay, int aw, int ah)
virtual ~Window ()
int operator== (const Window &that) const
ScreenGetScreen () const
const RectGetRect () const
int X () const
int Y () const
int Width () const
int Height () const
virtual bool IsShown () const
virtual bool AddView (View *v)
virtual bool DelView (View *v)
Rect ClipRect (const Rect &r)
bool ClipLine (int &x1, int &y1, int &x2, int &y2)
bool ClipLine (double &x1, double &y1, double &x2, double &y2)
void DrawLine (int x1, int y1, int x2, int y2, Color color, int blend=0)
void DrawRect (int x1, int y1, int x2, int y2, Color color, int blend=0)
void DrawRect (const Rect &r, Color color, int blend=0)
void FillRect (int x1, int y1, int x2, int y2, Color color, int blend=0)
void FillRect (const Rect &r, Color color, int alpha=0)
void DrawBitmap (int x1, int y1, int x2, int y2, Bitmap *img, int blend=0)
void FadeBitmap (int x1, int y1, int x2, int y2, Bitmap *img, Color c, int blend)
void ClipBitmap (int x1, int y1, int x2, int y2, Bitmap *img, Color c, int blend, const Rect &clip)
void TileBitmap (int x1, int y1, int x2, int y2, Bitmap *img, int blend=0)
void DrawLines (int nPts, POINT *pts, Color color, int blend=0)
void DrawPoly (int nPts, POINT *pts, Color color, int blend=0)
void FillPoly (int nPts, POINT *pts, Color color, int blend=0)
void DrawEllipse (int x1, int y1, int x2, int y2, Color color, int blend=0)
void FillEllipse (int x1, int y1, int x2, int y2, Color color, int blend=0)
void SetFont (Font *f)
FontGetFont () const
void Print (int x1, int y1, const char *fmt,...)
- Public Member Functions inherited from EventTarget
virtual ~EventTarget ()
int operator== (const EventTarget &t) const

Static Public Member Functions

static const char * TYPENAME ()

Protected Member Functions

void Insert (char c)
void Insert (const char *s)
void Delete ()
void Backspace ()
int CaretFromPoint (int x, int y) const
void EnsureCaretVisible ()

Protected Attributes

int sel_start
int sel_length
int h_offset
int caret_x
int caret_y
char pass_char
Color selected_color
- Protected Attributes inherited from ScrollWindow
int captured
int dragging
int selecting
int scrolling
int scroll_count
int mouse_x
int mouse_y
int track_length
int thumb_pos
int leading
int scroll_bar
int dragdrop
int line_count
int page_count
int page_size
int top_index
int line_height
bool smooth_scroll
double smooth_offset
- Protected Attributes inherited from ActiveWindow
DWORD id
DWORD style
DWORD text_align
bool single_line
bool focus
bool enabled
bool hide_partial
float alpha
Color back_color
Color base_color
Color fore_color
Text text
Text alt_text
Text desc
Bitmaptexture
Insets margins
Insets text_insets
Insets cell_insets
Rect cells
int fixed_width
int fixed_height
int tab [10]
ActiveWindowparent
ActiveWindowform
bool transparent
bool topmost
Layoutlayout
List< ActiveWindowchildren
List< AWMapclients
AWEvent event
int rows
int cols
Polypolys
VertexSetvset
Materialmtl
- Protected Attributes inherited from Window
Rect rect
Screenscreen
bool shown
Fontfont
List< Viewview_list

Detailed Description

Definition at line 23 of file EditBox.h.


Member Enumeration Documentation

Enumerator:
EDIT_ALIGN_LEFT 
EDIT_ALIGN_CENTER 
EDIT_ALIGN_RIGHT 

Definition at line 28 of file EditBox.h.


Constructor & Destructor Documentation

EditBox::EditBox ( ActiveWindow p,
int  ax,
int  ay,
int  aw,
int  ah,
DWORD  aid 
)

Definition at line 31 of file EditBox.cpp.

EditBox::EditBox ( Screen s,
int  ax,
int  ay,
int  aw,
int  ah,
DWORD  aid 
)

Definition at line 46 of file EditBox.cpp.

EditBox::~EditBox ( )
virtual

Definition at line 61 of file EditBox.cpp.


Member Function Documentation

void EditBox::Backspace ( )
protected

Definition at line 358 of file EditBox.cpp.

bool EditBox::CanScroll ( int  direction,
int  nlines = 1 
)
virtual

Reimplemented from ScrollWindow.

Definition at line 229 of file EditBox.cpp.

int EditBox::CaretFromPoint ( int  x,
int  y 
) const
protected

Definition at line 270 of file EditBox.cpp.

void EditBox::Delete ( )
protected

Definition at line 342 of file EditBox.cpp.

void EditBox::DrawContent ( const Rect ctrl_rect)
virtual

Reimplemented from ScrollWindow.

Definition at line 68 of file EditBox.cpp.

void EditBox::DrawTabbedText ( )
virtual

Reimplemented from ActiveWindow.

Definition at line 80 of file EditBox.cpp.

void EditBox::EnsureCaretVisible ( )
protected

Definition at line 185 of file EditBox.cpp.

int EditBox::GetPageCount ( )
virtual

Reimplemented from ScrollWindow.

Definition at line 243 of file EditBox.cpp.

int EditBox::GetPageSize ( )
virtual

Reimplemented from ScrollWindow.

Definition at line 248 of file EditBox.cpp.

char EditBox::GetPasswordChar ( )
inline

Definition at line 69 of file EditBox.h.

Color EditBox::GetSelectedColor ( )

Definition at line 140 of file EditBox.cpp.

int EditBox::GetSelLength ( )
inline

Definition at line 63 of file EditBox.h.

int EditBox::GetSelStart ( )
inline

Definition at line 62 of file EditBox.h.

Text EditBox::GetSelText ( )

Definition at line 152 of file EditBox.cpp.

void EditBox::Insert ( char  c)
protected

Definition at line 313 of file EditBox.cpp.

void EditBox::Insert ( const char *  s)
protected

Definition at line 338 of file EditBox.cpp.

void EditBox::KillFocus ( )
virtual

Reimplemented from ActiveWindow.

Definition at line 263 of file EditBox.cpp.

int EditBox::OnClick ( )
virtual

Reimplemented from ScrollWindow.

Definition at line 298 of file EditBox.cpp.

int EditBox::OnKeyDown ( int  vk,
int  flags 
)
virtual

Reimplemented from ScrollWindow.

Definition at line 375 of file EditBox.cpp.

int EditBox::OnLButtonDown ( int  x,
int  y 
)
virtual

Reimplemented from ScrollWindow.

Definition at line 284 of file EditBox.cpp.

int EditBox::OnLButtonUp ( int  x,
int  y 
)
virtual

Reimplemented from ScrollWindow.

Definition at line 291 of file EditBox.cpp.

int EditBox::OnMouseMove ( int  x,
int  y 
)
virtual

Reimplemented from ScrollWindow.

Definition at line 277 of file EditBox.cpp.

void EditBox::Scroll ( int  direction,
int  nlines = 1 
)
virtual

Reimplemented from ScrollWindow.

Definition at line 234 of file EditBox.cpp.

void EditBox::ScrollTo ( int  index)
virtual

Reimplemented from ScrollWindow.

Definition at line 239 of file EditBox.cpp.

void EditBox::SetFocus ( )
virtual

Reimplemented from ActiveWindow.

Definition at line 255 of file EditBox.cpp.

void EditBox::SetPasswordChar ( char  c)
inline

Definition at line 70 of file EditBox.h.

void EditBox::SetSelectedColor ( Color  c)

Definition at line 145 of file EditBox.cpp.

void EditBox::SetSelLength ( int  n)

Definition at line 179 of file EditBox.cpp.

void EditBox::SetSelStart ( int  n)

Definition at line 173 of file EditBox.cpp.

static const char* EditBox::TYPENAME ( )
inlinestatic

Reimplemented from ActiveWindow.

Definition at line 26 of file EditBox.h.


Member Data Documentation

int EditBox::caret_x
protected

Definition at line 83 of file EditBox.h.

int EditBox::caret_y
protected

Definition at line 84 of file EditBox.h.

int EditBox::h_offset
protected

Definition at line 82 of file EditBox.h.

char EditBox::pass_char
protected

Definition at line 86 of file EditBox.h.

int EditBox::sel_length
protected

Definition at line 81 of file EditBox.h.

int EditBox::sel_start
protected

Definition at line 80 of file EditBox.h.

Color EditBox::selected_color
protected

Definition at line 88 of file EditBox.h.


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