C# Class ZForge.Controls.Graph.PushGraph

Inheritance: System.Windows.Forms.Control
Datei anzeigen Open project: zhuangyy/Motion Class Usage Examples

Public Methods

Method Description
AddLine ( int numID, Color clr ) : LineHandle

Adds a new line using the passed numeric ID as an identifier and sets the line's initial color to the passed color. If successful, returns a handle to the new line.

AddLine ( string nameID, Color clr ) : LineHandle

Adds a new line using the passed name as an identifier and sets the line's initial color to the passed color. If successful, returns a handle to the new line.

GetLineHandle ( int numID ) : LineHandle

Returns a new line handle (LineHandle object) to the line with the matching numerical ID. Returns NULL if a line with a matching ID is not found.

GetLineHandle ( string nameID ) : LineHandle

Returns a new line handle (LineHandle object) to the line with the matching name (case insensitive). Returns NULL if a line with a matching name is not found.

LineExists ( int numID ) : bool

Returns true if a line exists with an identification number mathing the passed value. Returns false if no match is found.

LineExists ( string nameID ) : bool

Returns true if a line exists with a name that case insensitively matches the passes name. Returns false if no match is found.

Push ( int magnitude, int numID ) : bool

Pushes a new magnitude (point) to the line with the passed numerical ID.

Push ( int magnitude, string nameID ) : bool

Pushes a new magnitude (point) to the line with the passed name.

PushGraph ( ) : System
PushGraph ( Form Parent ) : System
PushGraph ( Form parent, Rectangle rectPos ) : System
RemoveLine ( int numID ) : bool

Removes a line by its numerical ID.

RemoveLine ( string nameID ) : bool

Removes a line by its name.

UpdateGraph ( ) : void

This function is to be called after you have pushed new magnitude(s) to the graph's lines and want the control re-rendered to take the changes into account.

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Clean up any resources being used.

DrawGrid ( Graphics &g ) : void
DrawLabels ( Graphics &g ) : void
DrawLines ( Graphics &g ) : void
OnPaint ( PaintEventArgs e ) : void
OnSizeChanged ( EventArgs e ) : void
RefreshLabels ( ) : void

Private Methods

Method Description
DrawBar ( Rectangle rect, Line line, Graphics &g ) : void
GetLine ( int numID ) : Line
GetLine ( string nameID ) : Line
InitializeComponent ( ) : void

Required method for Designer support - do not modify the contents of this method with the code editor.

InitializeStyles ( ) : void
PushDirect ( int magnitude, Line line ) : bool

Method Details

AddLine() public method

Adds a new line using the passed numeric ID as an identifier and sets the line's initial color to the passed color. If successful, returns a handle to the new line.
public AddLine ( int numID, Color clr ) : LineHandle
numID int /// A unique numerical for the line you wish to create. ///
clr Color /// The line's initial color. ///
return LineHandle

AddLine() public method

Adds a new line using the passed name as an identifier and sets the line's initial color to the passed color. If successful, returns a handle to the new line.
public AddLine ( string nameID, Color clr ) : LineHandle
nameID string /// A case insensitive name for the line you wish to create. ///
clr Color /// The line's initial color. ///
return LineHandle

Dispose() protected method

Clean up any resources being used.
protected Dispose ( bool disposing ) : void
disposing bool true if managed resources should be disposed; otherwise, false.
return void

DrawGrid() protected method

protected DrawGrid ( Graphics &g ) : void
g System.Drawing.Graphics
return void

DrawLabels() protected method

protected DrawLabels ( Graphics &g ) : void
g System.Drawing.Graphics
return void

DrawLines() protected method

protected DrawLines ( Graphics &g ) : void
g System.Drawing.Graphics
return void

GetLineHandle() public method

Returns a new line handle (LineHandle object) to the line with the matching numerical ID. Returns NULL if a line with a matching ID is not found.
public GetLineHandle ( int numID ) : LineHandle
numID int /// The numerical ID of the line you wish to get a handle to. ///
return LineHandle

GetLineHandle() public method

Returns a new line handle (LineHandle object) to the line with the matching name (case insensitive). Returns NULL if a line with a matching name is not found.
public GetLineHandle ( string nameID ) : LineHandle
nameID string /// The case insensitive name of the line you wish to get a handle to. ///
return LineHandle

LineExists() public method

Returns true if a line exists with an identification number mathing the passed value. Returns false if no match is found.
public LineExists ( int numID ) : bool
numID int /// The case numerical ID of the line you wish to check the existence /// of. ///
return bool

LineExists() public method

Returns true if a line exists with a name that case insensitively matches the passes name. Returns false if no match is found.
public LineExists ( string nameID ) : bool
nameID string /// The case insensitive name of the line you wish to check the existence /// of. ///
return bool

OnPaint() protected method

protected OnPaint ( PaintEventArgs e ) : void
e PaintEventArgs
return void

OnSizeChanged() protected method

protected OnSizeChanged ( EventArgs e ) : void
e System.EventArgs
return void

Push() public method

Pushes a new magnitude (point) to the line with the passed numerical ID.
public Push ( int magnitude, int numID ) : bool
magnitude int /// The magnitude of the new point. ///
numID int /// The line's numerical ID. ///
return bool

Push() public method

Pushes a new magnitude (point) to the line with the passed name.
public Push ( int magnitude, string nameID ) : bool
magnitude int /// The magnitude of the new point. ///
nameID string /// The line's case-insensitive name. ///
return bool

PushGraph() public method

public PushGraph ( ) : System
return System

PushGraph() public method

public PushGraph ( Form Parent ) : System
Parent System.Windows.Forms.Form
return System

PushGraph() public method

public PushGraph ( Form parent, Rectangle rectPos ) : System
parent System.Windows.Forms.Form
rectPos System.Drawing.Rectangle
return System

RefreshLabels() protected method

protected RefreshLabels ( ) : void
return void

RemoveLine() public method

Removes a line by its numerical ID.
public RemoveLine ( int numID ) : bool
numID int /// The line's numerical ID. ///
return bool

RemoveLine() public method

Removes a line by its name.
public RemoveLine ( string nameID ) : bool
nameID string /// The line's case-insensitive name. ///
return bool

UpdateGraph() public method

This function is to be called after you have pushed new magnitude(s) to the graph's lines and want the control re-rendered to take the changes into account.
public UpdateGraph ( ) : void
return void