MGUI::FORM_EDIT_COLORS Class Reference

Form for color edit list. More...

#include <mgui/formeditcolors.h>

Inheritance diagram for MGUI::FORM_EDIT_COLORS:
Inheritance graph
[legend]

List of all members.

Public Types

typedef FastDelegate< void(int,
const COLOR &)> 
DELEGATE_ONCHANGEITEMCOLOR
enum  STYLE {
  STYLE_ListTop = 0x00, STYLE_ListBottom = 0x01, STYLE_ListLeft = 0x02, STYLE_ListRight = 0x04,
  STYLE_ScrollAuto = 0x00, STYLE_ScrollNoH = 0x10, STYLE_ScrollNoV = 0x20, STYLE_ScrollNone = 0x30,
  STYLE_WidthInPixels = 0x40, STYLE_Default = STYLE_ListTop | STYLE_ScrollAuto
}

Public Member Functions

 FORM_EDIT_COLORS ()
virtual ~FORM_EDIT_COLORS ()
int AddItem (const MISTRING &name, UINT32 ColorRef, COLOR::CAPABILITY capability=COLOR::CAPABILITY_AsPrevious)
int AddItem (const MISTRING &name, const COLOR &color, COLOR::CAPABILITY capability=COLOR::CAPABILITY_AsPrevious)
void Create (MGUI::LAYOUT_PANE_BASE &ParentPane, COLOR::CAPABILITY capability, int listrows, int listwidth=-1, STYLE style=STYLE_Default, LAYOUT_SIZEALIGN sizealign=LAYOUT_SIZEALIGN_Expand)
void DeleteAllItems ()
const COLORGetItemColor (int itemidx) const
UINT32 GetItemColorRef (int itemidx) const
MGUI::ID GetItemID (int itemidx) const
void RedrawDisable ()
void RedrawEnable ()
void SetDelegateOnChangeItemColor (DELEGATE_ONCHANGEITEMCOLOR delegate)
void SetItemColor (int itemidx, const COLOR &color, bool notify=true)
void SetItemID (int itemidx, MGUI::ID id)

Detailed Description

Form for color edit list.

This form includes a list showing color name and sample, and a set of controls to "edit" the selected color.


Member Typedef Documentation

typedef FastDelegate<void(int,const COLOR&)> MGUI::FORM_EDIT_COLORS::DELEGATE_ONCHANGEITEMCOLOR

Delegate parameter: itemidx, color.


Member Enumeration Documentation

Form style.

Enumerator:
STYLE_ListTop 

List at top (default).

STYLE_ListBottom 

List at bottom.

STYLE_ListLeft 

List to left of palette.

STYLE_ListRight 

List to right of palette.

STYLE_ScrollAuto 

Determine whether to show scrollbars when Create() based on number of items and dimensions.

STYLE_ScrollNoH 

No horizontal scrollbar, always used if single-column mode.

STYLE_ScrollNoV 

No vertical scrollbar, typically for multi-column mode or if few fixed items.

STYLE_ScrollNone 

No scrollbars.

STYLE_WidthInPixels 

List width specified in pixels.

STYLE_Default 

Constructor & Destructor Documentation

MGUI::FORM_EDIT_COLORS::FORM_EDIT_COLORS (  ) 

Constructor.

virtual MGUI::FORM_EDIT_COLORS::~FORM_EDIT_COLORS (  )  [virtual]

Destructor.


Member Function Documentation

int MGUI::FORM_EDIT_COLORS::AddItem ( const MISTRING name,
UINT32  ColorRef,
COLOR::CAPABILITY  capability = COLOR::CAPABILITY_AsPrevious 
)

Add item to list.

Returns:
Item index for use when retrieve color.
int MGUI::FORM_EDIT_COLORS::AddItem ( const MISTRING name,
const COLOR color,
COLOR::CAPABILITY  capability = COLOR::CAPABILITY_AsPrevious 
)

Add item to list.

Returns:
Item index for use when retrieve color.
void MGUI::FORM_EDIT_COLORS::Create ( MGUI::LAYOUT_PANE_BASE ParentPane,
COLOR::CAPABILITY  capability,
int  listrows,
int  listwidth = -1,
STYLE  style = STYLE_Default,
LAYOUT_SIZEALIGN  sizealign = LAYOUT_SIZEALIGN_Expand 
)

Create the form.

Note that if transparency on/off or percentage controls are required for any item in the list the desired capability must be specified when creating the form.

Parameters:
ParentPane Parent pane for form
capability Overall color edit capabilities
listrows Initial number of visible rows in color list
listwidth Initial list width, -1 to compute based on items already added
void MGUI::FORM_EDIT_COLORS::DeleteAllItems (  ) 

Delete all items from list.

const COLOR& MGUI::FORM_EDIT_COLORS::GetItemColor ( int  itemidx  )  const

Get color for specified item.

Returns:
Reference to color
Parameters:
itemidx Item index (from AddItem())
UINT32 MGUI::FORM_EDIT_COLORS::GetItemColorRef ( int  itemidx  )  const

Get color reference for specified item.

Returns:
Color reference
Parameters:
itemidx Item index (from AddItem())
MGUI::ID MGUI::FORM_EDIT_COLORS::GetItemID ( int  itemidx  )  const

Get ID from index.

void MGUI::FORM_EDIT_COLORS::RedrawDisable (  ) 

Disable redraw of form.

void MGUI::FORM_EDIT_COLORS::RedrawEnable (  ) 

Enable redraw of form.

void MGUI::FORM_EDIT_COLORS::SetDelegateOnChangeItemColor ( DELEGATE_ONCHANGEITEMCOLOR  delegate  ) 

Set delegate to call when item color changed.

Parameters:
delegate Delegate parameter: itemidx, color
void MGUI::FORM_EDIT_COLORS::SetItemColor ( int  itemidx,
const COLOR color,
bool  notify = true 
)

Set color for specified item.

Parameters:
itemidx Item index from AddItem()
color New color to set
notify Call OnChangeItemColor() if 'true' and color changed
void MGUI::FORM_EDIT_COLORS::SetItemID ( int  itemidx,
MGUI::ID  id 
)

Set ID for index.


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

Generated on Sun Oct 7 21:35:57 2012 for TNTsdk 2012 by  doxygen 1.6.1