C# Class ZForge.Motion.Controls.TimeSlider

Inheritance: System.Windows.Forms.TrackBar
显示文件 Open project: zhuangyy/Motion

Public Methods

Method Description
ResumeLayout ( ) : void

Call this function if you called SuspendLayout during control value setting.

SuspendLayout ( ) : void

Call this function if you want to set several values within the slider, and you don't want consistancy checks until updates are comlete. When done, call ResumeLayout. SuspendLayout basically gives you free reign to set any values into the control you want. Note that it will blow up with bad values later, though!

TimeSlider ( ) : System

Constructor for class. Initializes all our internal variables.

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Clean up any resources being used.

OnPaint ( PaintEventArgs e ) : void

OnPaint event. We are kind of tricking the system, because I want to paint on top of the trackbar. The system either wants to draw it all and not send OnPaint events or let me do everything. So, we say I'll-do-it-no-you-do-it-okay-I'll-do-it.

OnResize ( EventArgs e ) : void

Resize event

OnScroll ( EventArgs e ) : void

When the slider value is changed, we need to update our current value to the correct date representing that position.

OnValueChanged ( EventArgs e ) : void

When the slider value is changed, we need to update our current value to the correct date representing that position.

Private Methods

Method Description
DateFormat ( System.DateTime dt ) : string

Turn our date into a string based on the Format value.

DateFormatAsDate ( System.DateTime dt ) : string

Turn our date into a string based on the Format value.

DateFormatAsDuration ( System.DateTime dt ) : string

Turn our date into a duration string, similar to what QuickTime shows.

DrawLabels ( ) : void

Draw the labels and segment panel for our control, and put them in the correct position based on current values.

InitializeComponent ( ) : void

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

SetCurrentFromIndexChange ( ) : void

When the puck was changed through user interaction, update our current value and labels based on the new value.

SetIndexes ( ) : void

Set min, max and current values within the control. Also calls DrawLabels, so this function pretty much performs all layout within the control.

Method Details

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

OnPaint() protected method

OnPaint event. We are kind of tricking the system, because I want to paint on top of the trackbar. The system either wants to draw it all and not send OnPaint events or let me do everything. So, we say I'll-do-it-no-you-do-it-okay-I'll-do-it.
protected OnPaint ( PaintEventArgs e ) : void
e PaintEventArgs
return void

OnResize() protected method

Resize event
protected OnResize ( EventArgs e ) : void
e EventArgs
return void

OnScroll() protected method

When the slider value is changed, we need to update our current value to the correct date representing that position.
protected OnScroll ( EventArgs e ) : void
e EventArgs
return void

OnValueChanged() protected method

When the slider value is changed, we need to update our current value to the correct date representing that position.
protected OnValueChanged ( EventArgs e ) : void
e EventArgs
return void

ResumeLayout() public method

Call this function if you called SuspendLayout during control value setting.
public ResumeLayout ( ) : void
return void

SuspendLayout() public method

Call this function if you want to set several values within the slider, and you don't want consistancy checks until updates are comlete. When done, call ResumeLayout. SuspendLayout basically gives you free reign to set any values into the control you want. Note that it will blow up with bad values later, though!
public SuspendLayout ( ) : void
return void

TimeSlider() public method

Constructor for class. Initializes all our internal variables.
public TimeSlider ( ) : System
return System