C# Class Paint.ToolBox

Inheritance: IToolBox
Mostrar archivo Open project: RandolphBurt/MonoGame-iOS-SimplePaint

Public Methods

Method Description
CheckTouchCollision ( ITouchPoint touchPosition ) : bool

Checks wheter a particular touch point (user pressing the screen) is within the bounds of one of the tools.

Draw ( bool refreshDisplay ) : void

Draw the toolbox (and all containing tools) on to the image

ToolBox ( ToolboxLayoutDefinition toolboxLayoutDefinition, IGraphicsDisplay graphicsDisplay, int scale ) : System

Initializes a new instance of the Paint.ToolBox class.

Protected Methods

Method Description
AddButton ( ToolboxLayoutDefinitionStandardToolsButtonsButton buttonLayout ) : void

Creates a button and adds it.

AddButtons ( ToolboxLayoutDefinitionStandardToolsButtonsButton buttons ) : void

Creates all the buttons and adds them to our list of controls

AddTool ( IToolBoxTool tool ) : void

Adds the tool to our toolbox

DrawBackground ( ) : void

Draws the background (and border)

DrawTools ( bool refreshDisplay ) : void

Draws the tools.

OnExitButtonPressed ( EventArgs e ) : void

Raises the exit selected changed event.

Private Methods

Method Description
AddStandardTools ( ToolboxLayoutDefinitionStandardTools standardTools ) : void

Adds the standard tools.

TranslateToolboxLayoutColor ( ColorType color ) : Color

Translates the toolbox layout color type to a Color.

Method Details

AddButton() protected method

Creates a button and adds it.
protected AddButton ( ToolboxLayoutDefinitionStandardToolsButtonsButton buttonLayout ) : void
buttonLayout Paint.ToolboxLayout.ToolboxLayoutDefinitionStandardToolsButtonsButton /// Button layout. ///
return void

AddButtons() protected method

Creates all the buttons and adds them to our list of controls
protected AddButtons ( ToolboxLayoutDefinitionStandardToolsButtonsButton buttons ) : void
buttons Paint.ToolboxLayout.ToolboxLayoutDefinitionStandardToolsButtonsButton
return void

AddTool() protected method

Adds the tool to our toolbox
protected AddTool ( IToolBoxTool tool ) : void
tool IToolBoxTool /// The tool to add to the toolbox ///
return void

CheckTouchCollision() public method

Checks wheter a particular touch point (user pressing the screen) is within the bounds of one of the tools.
public CheckTouchCollision ( ITouchPoint touchPosition ) : bool
touchPosition ITouchPoint
return bool

Draw() public method

Draw the toolbox (and all containing tools) on to the image
public Draw ( bool refreshDisplay ) : void
refreshDisplay bool /// True = we should redraw the entire control /// False = just draw any updates ///
return void

DrawBackground() protected method

Draws the background (and border)
protected DrawBackground ( ) : void
return void

DrawTools() protected method

Draws the tools.
protected DrawTools ( bool refreshDisplay ) : void
refreshDisplay bool /// True = we should redraw the entire control /// False = just draw any updates ///
return void

OnExitButtonPressed() protected method

Raises the exit selected changed event.
protected OnExitButtonPressed ( EventArgs e ) : void
e System.EventArgs /// Any relevant EventArgs (should be EventArgs.Empty) ///
return void

ToolBox() public method

Initializes a new instance of the Paint.ToolBox class.
public ToolBox ( ToolboxLayoutDefinition toolboxLayoutDefinition, IGraphicsDisplay graphicsDisplay, int scale ) : System
toolboxLayoutDefinition Paint.ToolboxLayout.ToolboxLayoutDefinition
graphicsDisplay IGraphicsDisplay
scale int
return System