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

#include <ScrollWindow.h>

Inheritance diagram for ScrollWindow:
ActiveWindow Window EventTarget ComboList EditBox ListBox RichTextBox

List of all members.

Public Types

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

 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 DrawContent (const Rect &ctrl_rect)
virtual void DrawTransparentContent (const Rect &ctrl_rect)
virtual void DrawScrollBar ()
virtual void MoveTo (const Rect &r)
virtual int OnMouseMove (int x, int y)
virtual int OnLButtonDown (int x, int y)
virtual int OnLButtonUp (int x, int y)
virtual int OnMouseWheel (int wheel)
virtual int OnClick ()
virtual int OnKeyDown (int vk, int flags)
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 bool CanScroll (int direction, int nlines=1)
virtual void EnsureVisible (int index)
virtual void Scroll (int direction, int nlines=1)
virtual void SmoothScroll (int direction, double nlines)
virtual void ScrollTo (int index)
virtual int GetTopIndex ()
virtual int GetLineCount ()
virtual int GetPageCount ()
virtual int GetPageSize ()
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 void SetFocus ()
virtual void KillFocus ()
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

Protected Attributes

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

Additional Inherited Members

- Static Public Member Functions inherited from ActiveWindow
static const char * TYPENAME ()
static void SetSystemFont (Font *f)
static void SetSystemBackColor (Color c)
static void SetSystemForeColor (Color c)
- Protected Member Functions inherited from ActiveWindow
virtual Color ShadeColor (Color c, double shade)
virtual void AddChild (ActiveWindow *child)
virtual void DrawStyleRect (const Rect &r, int style)
virtual void DrawStyleRect (int x1, int y1, int x2, int y2, int style)
virtual void DrawTabbedText ()
virtual void DrawTextureGrid ()
virtual void CalcGrid ()
- Protected Member Functions inherited from Window
virtual void ScreenToWindow (int &x, int &y)
virtual void ScreenToWindow (Rect &r)
- Static Protected Attributes inherited from ActiveWindow
static Fontsys_font = 0
static Color sys_back_color = Color(128,128,128)
static Color sys_fore_color = Color( 0, 0, 0)

Detailed Description

Definition at line 24 of file ScrollWindow.h.


Member Enumeration Documentation

Enumerator:
BORDER_WIDTH 
EXTRA_WIDTH 
SCROLL_WIDTH 
SCROLL_HEIGHT 
SCROLL_TRACK 
TRACK_START 
THUMB_HEIGHT 
HEADING_EXTRA 

Definition at line 40 of file ScrollWindow.h.

Enumerator:
SCROLL_NEVER 
SCROLL_AUTO 
SCROLL_ALWAYS 

Definition at line 27 of file ScrollWindow.h.

Enumerator:
SCROLL_NONE 
SCROLL_UP 
SCROLL_PAGE_UP 
SCROLL_DOWN 
SCROLL_PAGE_DOWN 
SCROLL_THUMB 

Definition at line 32 of file ScrollWindow.h.


Constructor & Destructor Documentation

ScrollWindow::ScrollWindow ( ActiveWindow p,
int  ax,
int  ay,
int  aw,
int  ah,
DWORD  aid,
DWORD  style = 0,
ActiveWindow parent = 0 
)

Definition at line 34 of file ScrollWindow.cpp.

ScrollWindow::ScrollWindow ( Screen s,
int  ax,
int  ay,
int  aw,
int  ah,
DWORD  aid,
DWORD  style = 0,
ActiveWindow parent = 0 
)

Definition at line 65 of file ScrollWindow.cpp.

ScrollWindow::~ScrollWindow ( )
virtual

Definition at line 96 of file ScrollWindow.cpp.


Member Function Documentation

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

Reimplemented in EditBox.

Definition at line 307 of file ScrollWindow.cpp.

void ScrollWindow::Draw ( )
virtual

Reimplemented from ActiveWindow.

Reimplemented in ComboList.

Definition at line 127 of file ScrollWindow.cpp.

void ScrollWindow::DrawContent ( const Rect ctrl_rect)
virtual

Reimplemented in ListBox, RichTextBox, and EditBox.

Definition at line 185 of file ScrollWindow.cpp.

void ScrollWindow::DrawScrollBar ( )
virtual

Definition at line 198 of file ScrollWindow.cpp.

void ScrollWindow::DrawTransparent ( )
virtual

Definition at line 157 of file ScrollWindow.cpp.

void ScrollWindow::DrawTransparentContent ( const Rect ctrl_rect)
virtual

Definition at line 191 of file ScrollWindow.cpp.

void ScrollWindow::EnsureVisible ( int  index)
virtual

Definition at line 312 of file ScrollWindow.cpp.

int ScrollWindow::GetDragDrop ( )
virtual

Definition at line 270 of file ScrollWindow.cpp.

int ScrollWindow::GetLeading ( )
virtual

Definition at line 258 of file ScrollWindow.cpp.

int ScrollWindow::GetLineCount ( )
virtual

Reimplemented in ListBox.

Definition at line 410 of file ScrollWindow.cpp.

int ScrollWindow::GetLineHeight ( )
virtual

Definition at line 247 of file ScrollWindow.cpp.

int ScrollWindow::GetPageCount ( )
virtual

Reimplemented in EditBox.

Definition at line 395 of file ScrollWindow.cpp.

int ScrollWindow::GetPageSize ( )
virtual

Reimplemented in EditBox.

Definition at line 400 of file ScrollWindow.cpp.

int ScrollWindow::GetScrollBarVisible ( )
virtual

Definition at line 282 of file ScrollWindow.cpp.

int ScrollWindow::GetScrollTrack ( )
virtual

Definition at line 405 of file ScrollWindow.cpp.

bool ScrollWindow::GetSmoothScroll ( )
virtual

Definition at line 294 of file ScrollWindow.cpp.

int ScrollWindow::GetTopIndex ( )
virtual

Definition at line 390 of file ScrollWindow.cpp.

int ScrollWindow::IsDragging ( ) const
inline

Definition at line 103 of file ScrollWindow.h.

int ScrollWindow::IsScrolling ( ) const
inline

Definition at line 105 of file ScrollWindow.h.

bool ScrollWindow::IsScrollVisible ( )
virtual

Definition at line 234 of file ScrollWindow.cpp.

int ScrollWindow::IsSelecting ( ) const
inline

Definition at line 104 of file ScrollWindow.h.

void ScrollWindow::MoveTo ( const Rect r)
virtual

Reimplemented from ActiveWindow.

Definition at line 102 of file ScrollWindow.cpp.

int ScrollWindow::OnClick ( )
virtual

Reimplemented from ActiveWindow.

Reimplemented in ListBox, ComboList, EditBox, and RichTextBox.

Definition at line 569 of file ScrollWindow.cpp.

int ScrollWindow::OnDragDrop ( int  x,
int  y,
ActiveWindow source 
)
virtual

Reimplemented from ActiveWindow.

Reimplemented in ListBox.

Definition at line 629 of file ScrollWindow.cpp.

int ScrollWindow::OnDragStart ( int  x,
int  y 
)
virtual

Reimplemented from ActiveWindow.

Reimplemented in ListBox.

Definition at line 621 of file ScrollWindow.cpp.

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

Reimplemented from ActiveWindow.

Reimplemented in ListBox, EditBox, and RichTextBox.

Definition at line 586 of file ScrollWindow.cpp.

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

Reimplemented from ActiveWindow.

Reimplemented in ListBox, ComboList, EditBox, and RichTextBox.

Definition at line 456 of file ScrollWindow.cpp.

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

Reimplemented from ActiveWindow.

Reimplemented in ListBox, ComboList, EditBox, and RichTextBox.

Definition at line 514 of file ScrollWindow.cpp.

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

Reimplemented from ActiveWindow.

Reimplemented in ListBox, ComboList, EditBox, and RichTextBox.

Definition at line 417 of file ScrollWindow.cpp.

int ScrollWindow::OnMouseWheel ( int  wheel)
virtual

Reimplemented from ActiveWindow.

Reimplemented in ListBox, and RichTextBox.

Definition at line 547 of file ScrollWindow.cpp.

void ScrollWindow::Paint ( )
virtual

Reimplemented from ActiveWindow.

Definition at line 113 of file ScrollWindow.cpp.

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

Reimplemented in EditBox.

Definition at line 321 of file ScrollWindow.cpp.

void ScrollWindow::ScrollTo ( int  index)
virtual

Reimplemented in EditBox.

Definition at line 380 of file ScrollWindow.cpp.

void ScrollWindow::SetDragDrop ( int  nNewValue)
virtual

Definition at line 275 of file ScrollWindow.cpp.

void ScrollWindow::SetLeading ( int  nNewValue)
virtual

Definition at line 263 of file ScrollWindow.cpp.

void ScrollWindow::SetLineHeight ( int  h)
virtual

Definition at line 252 of file ScrollWindow.cpp.

void ScrollWindow::SetScrollBarVisible ( int  nNewValue)
virtual

Definition at line 287 of file ScrollWindow.cpp.

void ScrollWindow::SetSmoothScroll ( bool  s)
virtual

Definition at line 299 of file ScrollWindow.cpp.

void ScrollWindow::SmoothScroll ( int  direction,
double  nlines 
)
virtual

Definition at line 354 of file ScrollWindow.cpp.


Member Data Documentation

int ScrollWindow::captured
protected

Reimplemented in ComboList.

Definition at line 108 of file ScrollWindow.h.

int ScrollWindow::dragdrop
protected

Definition at line 120 of file ScrollWindow.h.

int ScrollWindow::dragging
protected

Definition at line 109 of file ScrollWindow.h.

int ScrollWindow::leading
protected

Definition at line 118 of file ScrollWindow.h.

int ScrollWindow::line_count
protected

Definition at line 121 of file ScrollWindow.h.

int ScrollWindow::line_height
protected

Definition at line 125 of file ScrollWindow.h.

int ScrollWindow::mouse_x
protected

Definition at line 113 of file ScrollWindow.h.

int ScrollWindow::mouse_y
protected

Definition at line 114 of file ScrollWindow.h.

int ScrollWindow::page_count
protected

Definition at line 122 of file ScrollWindow.h.

int ScrollWindow::page_size
protected

Definition at line 123 of file ScrollWindow.h.

int ScrollWindow::scroll_bar
protected

Definition at line 119 of file ScrollWindow.h.

int ScrollWindow::scroll_count
protected

Definition at line 112 of file ScrollWindow.h.

int ScrollWindow::scrolling
protected

Reimplemented in ComboList.

Definition at line 111 of file ScrollWindow.h.

int ScrollWindow::selecting
protected

Definition at line 110 of file ScrollWindow.h.

double ScrollWindow::smooth_offset
protected

Definition at line 128 of file ScrollWindow.h.

bool ScrollWindow::smooth_scroll
protected

Definition at line 127 of file ScrollWindow.h.

int ScrollWindow::thumb_pos
protected

Definition at line 116 of file ScrollWindow.h.

int ScrollWindow::top_index
protected

Definition at line 124 of file ScrollWindow.h.

int ScrollWindow::track_length
protected

Definition at line 115 of file ScrollWindow.h.


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