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

#include <ListBox.h>

Inheritance diagram for ListBox:
ScrollWindow ActiveWindow Window EventTarget

List of all members.

Public Types

enum  SORT {
  LIST_SORT_NUMERIC_DESCENDING = -2, LIST_SORT_ALPHA_DESCENDING, LIST_SORT_NONE, LIST_SORT_ALPHA_ASCENDING,
  LIST_SORT_NUMERIC_ASCENDING, LIST_SORT_NEVER
}
enum  ALIGN { LIST_ALIGN_LEFT = DT_LEFT, LIST_ALIGN_CENTER = DT_CENTER, LIST_ALIGN_RIGHT = DT_RIGHT }
enum  STYLE { LIST_ITEM_STYLE_PLAIN, LIST_ITEM_STYLE_BOX, LIST_ITEM_STYLE_FILLED_BOX }
- 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

 ListBox (ActiveWindow *p, int ax, int ay, int aw, int ah, DWORD aid)
 ListBox (Screen *s, int ax, int ay, int aw, int ah, DWORD aid)
virtual ~ListBox ()
virtual void DrawContent (const Rect &ctrl_rect)
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)
int NumItems ()
int NumColumns ()
Text GetItemText (int index)
void SetItemText (int index, const char *text)
DWORD GetItemData (int index)
void SetItemData (int index, DWORD data)
BitmapGetItemImage (int index)
void SetItemImage (int index, Bitmap *img)
Color GetItemColor (int index)
void SetItemColor (int index, Color c)
Text GetItemText (int index, int column)
void SetItemText (int index, int column, const char *text)
DWORD GetItemData (int index, int column)
void SetItemData (int index, int column, DWORD data)
BitmapGetItemImage (int index, int column)
void SetItemImage (int index, int column, Bitmap *img)
int AddItem (const char *text)
int AddImage (Bitmap *img)
int AddItemWithData (const char *text, int data)
void InsertItem (int index, const char *text)
void InsertItemWithData (int index, const char *text, int data)
void ClearItems ()
void RemoveItem (int index)
void RemoveSelectedItems ()
void AddColumn (const char *title, int width, int align=ListBox::LIST_ALIGN_LEFT, int sort=ListBox::LIST_SORT_NONE)
Text GetColumnTitle (int index)
void SetColumnTitle (int index, const char *title)
int GetColumnWidth (int index)
void SetColumnWidth (int index, int width)
int GetColumnAlign (int index)
void SetColumnAlign (int index, int align)
int GetColumnSort (int index)
void SetColumnSort (int index, int sort)
Color GetColumnColor (int index)
void SetColumnColor (int index, Color c)
Color GetItemColor (int index, int column)
int GetMultiSelect ()
void SetMultiSelect (int nNewValue)
bool GetShowHeadings ()
void SetShowHeadings (bool nNewValue)
Color GetSelectedColor ()
void SetSelectedColor (Color c)
int GetItemStyle () const
void SetItemStyle (int style)
int GetSelectedStyle () const
void SetSelectedStyle (int style)
bool IsSelected (int index)
void SetSelected (int index, bool bNewValue=true)
void ClearSelection ()
int GetSortColumn ()
void SetSortColumn (int col_index)
int GetSortCriteria ()
void SetSortCriteria (SORT sort)
void SortItems ()
void SizeColumns ()
virtual int GetListIndex ()
virtual int GetLineCount ()
virtual int GetSelCount ()
virtual int GetSelection ()
virtual Text GetSelectedItem ()
- 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 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 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 Member Functions

int IndexFromPoint (int x, int y) const

Protected Attributes

List< ListBoxItemitems
List< ListBoxColumncolumns
bool show_headings
int multiselect
int list_index
int selcount
Color selected_color
int sort_column
int item_style
int seln_style
- 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 32 of file ListBox.h.


Member Enumeration Documentation

Enumerator:
LIST_ALIGN_LEFT 
LIST_ALIGN_CENTER 
LIST_ALIGN_RIGHT 

Definition at line 43 of file ListBox.h.

Enumerator:
LIST_SORT_NUMERIC_DESCENDING 
LIST_SORT_ALPHA_DESCENDING 
LIST_SORT_NONE 
LIST_SORT_ALPHA_ASCENDING 
LIST_SORT_NUMERIC_ASCENDING 
LIST_SORT_NEVER 

Definition at line 35 of file ListBox.h.

Enumerator:
LIST_ITEM_STYLE_PLAIN 
LIST_ITEM_STYLE_BOX 
LIST_ITEM_STYLE_FILLED_BOX 

Definition at line 48 of file ListBox.h.


Constructor & Destructor Documentation

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

Definition at line 229 of file ListBox.cpp.

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

Definition at line 248 of file ListBox.cpp.

ListBox::~ListBox ( )
virtual

Definition at line 267 of file ListBox.cpp.


Member Function Documentation

void ListBox::AddColumn ( const char *  title,
int  width,
int  align = ListBox::LIST_ALIGN_LEFT,
int  sort = ListBox::LIST_SORT_NONE 
)

Definition at line 777 of file ListBox.cpp.

int ListBox::AddImage ( Bitmap img)

Definition at line 690 of file ListBox.cpp.

int ListBox::AddItem ( const char *  text)

Definition at line 653 of file ListBox.cpp.

int ListBox::AddItemWithData ( const char *  text,
int  data 
)

Definition at line 671 of file ListBox.cpp.

void ListBox::ClearItems ( )

Definition at line 743 of file ListBox.cpp.

void ListBox::ClearSelection ( )

Definition at line 971 of file ListBox.cpp.

void ListBox::DrawContent ( const Rect ctrl_rect)
virtual

Reimplemented from ScrollWindow.

Definition at line 276 of file ListBox.cpp.

int ListBox::GetColumnAlign ( int  index)

Definition at line 821 of file ListBox.cpp.

Color ListBox::GetColumnColor ( int  index)

Definition at line 851 of file ListBox.cpp.

int ListBox::GetColumnSort ( int  index)

Definition at line 836 of file ListBox.cpp.

Text ListBox::GetColumnTitle ( int  index)

Definition at line 791 of file ListBox.cpp.

int ListBox::GetColumnWidth ( int  index)

Definition at line 806 of file ListBox.cpp.

Color ListBox::GetItemColor ( int  index)

Definition at line 518 of file ListBox.cpp.

Color ListBox::GetItemColor ( int  index,
int  column 
)

Definition at line 867 of file ListBox.cpp.

DWORD ListBox::GetItemData ( int  index)

Definition at line 488 of file ListBox.cpp.

DWORD ListBox::GetItemData ( int  index,
int  column 
)

Definition at line 573 of file ListBox.cpp.

Bitmap * ListBox::GetItemImage ( int  index)

Definition at line 503 of file ListBox.cpp.

Bitmap * ListBox::GetItemImage ( int  index,
int  column 
)

Definition at line 613 of file ListBox.cpp.

int ListBox::GetItemStyle ( ) const

Definition at line 919 of file ListBox.cpp.

Text ListBox::GetItemText ( int  index)

Definition at line 473 of file ListBox.cpp.

Text ListBox::GetItemText ( int  index,
int  column 
)

Definition at line 533 of file ListBox.cpp.

int ListBox::GetLineCount ( )
virtual

Reimplemented from ScrollWindow.

Definition at line 985 of file ListBox.cpp.

int ListBox::GetListIndex ( )
virtual

Definition at line 980 of file ListBox.cpp.

int ListBox::GetMultiSelect ( )

Definition at line 882 of file ListBox.cpp.

int ListBox::GetSelCount ( )
virtual

Definition at line 991 of file ListBox.cpp.

Color ListBox::GetSelectedColor ( )

Definition at line 907 of file ListBox.cpp.

Text ListBox::GetSelectedItem ( )
virtual

Definition at line 1005 of file ListBox.cpp.

int ListBox::GetSelectedStyle ( ) const

Definition at line 931 of file ListBox.cpp.

int ListBox::GetSelection ( )
virtual

Definition at line 996 of file ListBox.cpp.

bool ListBox::GetShowHeadings ( )

Definition at line 895 of file ListBox.cpp.

int ListBox::GetSortColumn ( )

Definition at line 1013 of file ListBox.cpp.

int ListBox::GetSortCriteria ( )

Definition at line 1024 of file ListBox.cpp.

int ListBox::IndexFromPoint ( int  x,
int  y 
) const
protected

Definition at line 1044 of file ListBox.cpp.

void ListBox::InsertItem ( int  index,
const char *  text 
)

Definition at line 708 of file ListBox.cpp.

void ListBox::InsertItemWithData ( int  index,
const char *  text,
int  data 
)

Definition at line 725 of file ListBox.cpp.

bool ListBox::IsSelected ( int  index)

Definition at line 943 of file ListBox.cpp.

int ListBox::NumColumns ( )

Definition at line 468 of file ListBox.cpp.

int ListBox::NumItems ( )

Definition at line 463 of file ListBox.cpp.

int ListBox::OnClick ( )
virtual

Reimplemented from ScrollWindow.

Definition at line 1241 of file ListBox.cpp.

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

Reimplemented from ScrollWindow.

Definition at line 1299 of file ListBox.cpp.

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

Reimplemented from ScrollWindow.

Definition at line 1291 of file ListBox.cpp.

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

Reimplemented from ScrollWindow.

Definition at line 1258 of file ListBox.cpp.

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

Reimplemented from ScrollWindow.

Definition at line 1100 of file ListBox.cpp.

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

Reimplemented from ScrollWindow.

Definition at line 1195 of file ListBox.cpp.

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

Reimplemented from ScrollWindow.

Definition at line 1059 of file ListBox.cpp.

int ListBox::OnMouseWheel ( int  wheel)
virtual

Reimplemented from ScrollWindow.

Definition at line 1234 of file ListBox.cpp.

void ListBox::RemoveItem ( int  index)

Definition at line 752 of file ListBox.cpp.

void ListBox::RemoveSelectedItems ( )

Definition at line 762 of file ListBox.cpp.

void ListBox::SetColumnAlign ( int  index,
int  align 
)

Definition at line 829 of file ListBox.cpp.

void ListBox::SetColumnColor ( int  index,
Color  c 
)

Definition at line 859 of file ListBox.cpp.

void ListBox::SetColumnSort ( int  index,
int  sort 
)

Definition at line 844 of file ListBox.cpp.

void ListBox::SetColumnTitle ( int  index,
const char *  title 
)

Definition at line 799 of file ListBox.cpp.

void ListBox::SetColumnWidth ( int  index,
int  width 
)

Definition at line 814 of file ListBox.cpp.

void ListBox::SetItemColor ( int  index,
Color  c 
)

Definition at line 526 of file ListBox.cpp.

void ListBox::SetItemData ( int  index,
DWORD  data 
)

Definition at line 496 of file ListBox.cpp.

void ListBox::SetItemData ( int  index,
int  column,
DWORD  data 
)

Definition at line 590 of file ListBox.cpp.

void ListBox::SetItemImage ( int  index,
Bitmap img 
)

Definition at line 511 of file ListBox.cpp.

void ListBox::SetItemImage ( int  index,
int  column,
Bitmap img 
)

Definition at line 630 of file ListBox.cpp.

void ListBox::SetItemStyle ( int  style)

Definition at line 924 of file ListBox.cpp.

void ListBox::SetItemText ( int  index,
const char *  text 
)

Definition at line 481 of file ListBox.cpp.

void ListBox::SetItemText ( int  index,
int  column,
const char *  text 
)

Definition at line 550 of file ListBox.cpp.

void ListBox::SetMultiSelect ( int  nNewValue)

Definition at line 887 of file ListBox.cpp.

void ListBox::SetSelected ( int  index,
bool  bNewValue = true 
)

Definition at line 951 of file ListBox.cpp.

void ListBox::SetSelectedColor ( Color  c)

Definition at line 912 of file ListBox.cpp.

void ListBox::SetSelectedStyle ( int  style)

Definition at line 936 of file ListBox.cpp.

void ListBox::SetShowHeadings ( bool  nNewValue)

Definition at line 900 of file ListBox.cpp.

void ListBox::SetSortColumn ( int  col_index)

Definition at line 1018 of file ListBox.cpp.

void ListBox::SetSortCriteria ( SORT  sort)

Definition at line 1029 of file ListBox.cpp.

void ListBox::SizeColumns ( )

Definition at line 419 of file ListBox.cpp.

void ListBox::SortItems ( )

Definition at line 1036 of file ListBox.cpp.


Member Data Documentation

List<ListBoxColumn> ListBox::columns
protected

Definition at line 155 of file ListBox.h.

int ListBox::item_style
protected

Definition at line 165 of file ListBox.h.

List<ListBoxItem> ListBox::items
protected

Definition at line 154 of file ListBox.h.

int ListBox::list_index
protected

Definition at line 159 of file ListBox.h.

int ListBox::multiselect
protected

Definition at line 158 of file ListBox.h.

int ListBox::selcount
protected

Definition at line 160 of file ListBox.h.

Color ListBox::selected_color
protected

Definition at line 162 of file ListBox.h.

int ListBox::seln_style
protected

Definition at line 166 of file ListBox.h.

bool ListBox::show_headings
protected

Definition at line 157 of file ListBox.h.

int ListBox::sort_column
protected

Definition at line 164 of file ListBox.h.


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