C# Class Longkong.ColorPicker.Controls.ColorPanel

Inheritance: System.Windows.Forms.UserControl
Afficher le fichier Open project: Longkong/Pojjaman

Private Properties

Свойство Type Description
CalculateValueRegionMapping void
CheckCursorYRegion void
ColorSelected void
ColorSpaceComponentValueChanged void
CreateLeftTrianglePointer Point[]
CreateRightTrianglePointer Point[]
GetLeftTrianglePointerInvalidationRegion System.Drawing.Rectangle
GetRightTrianglePointerInvalidationRegion System.Drawing.Rectangle
InitializeComponent void
InitializeCustomComponents void
InvalidateColorSliderArrowRegions void
SelectedColorSpaceComponentChanged void
SetCurrentSliderArrowYLocation void
UpdateColorField void
UpdateColorPanels void
UpdateColorSlider void
UpdateColorSliderArrowRegions void
UpdateColorSpacesWithNewHexValue void
UpdateHexValue void
ValueChanged void
colorFieldPanel_ColorSelected void
colorSwatchPanel_ColorSwatchSelected void
hexTextBox_KeyDown void
hexTextBox_KeyUp void
picColorSlider_MouseDown void
picCurrentColor_GiveFeedback void
picCurrentColor_MouseDown void
picCurrentColor_QueryContinueDrag void
sliderTimer_Tick void

Méthodes publiques

Méthode Description
ColorPanel ( ) : System

Constructor. Initializes all of the components and member fields and configures the control for double buffering support.

ColorPanel ( Color color ) : System

Méthodes protégées

Méthode Description
Dispose ( bool disposing ) : void

Clean up any resources being used.

OnLoad ( EventArgs e ) : void

Overrides the base class' OnLoad method and instantiates a new DragForm object that will be used to create the visual drag effect when adding the currently selected color to the color swatch panel.

OnMouseDown ( MouseEventArgs e ) : void
OnMouseMove ( MouseEventArgs e ) : void
OnMouseUp ( MouseEventArgs e ) : void
OnPaint ( PaintEventArgs e ) : void

Overrides the panel's OnPaint method to performs all of the painting operations.

Private Methods

Méthode Description
CalculateValueRegionMapping ( ColorSpaceComponent csc ) : void
CheckCursorYRegion ( int y ) : void
ColorSelected ( Color color, bool updateSliderPosition ) : void

Processes the selected color.

ColorSpaceComponentValueChanged ( ColorSpace sender, EventArgs e ) : void

Handles the ComponentValueChanged event that the ColorSpace raises when the value of one of its components is changed by way of a keyboard user input. The color spaces are synced up and the color panels updated.

CreateLeftTrianglePointer ( int y ) : Point[]

Calculates the points needed to draw the left triangle pointer for the value strip.

CreateRightTrianglePointer ( int y ) : Point[]

Calculates the points needed to draw the right triangle pointer for the color slider.

GetLeftTrianglePointerInvalidationRegion ( int arrowY ) : Rectangle

Determines the color slider left triangle pointer invalidation region.

GetRightTrianglePointerInvalidationRegion ( int arrowY ) : Rectangle

Determines the color slider right triangle pointer invalidation region.

InitializeComponent ( ) : void

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

InitializeCustomComponents ( ) : void
InvalidateColorSliderArrowRegions ( ) : void

Invalidate the color slider arrow regions.

SelectedColorSpaceComponentChanged ( ColorSpace sender, EventArgs e ) : void

Handles the SelectedColorSpaceComponentChanged event raised by the color spaces. When this occurs, the color slider arrow regions and the color panels are updated.

SetCurrentSliderArrowYLocation ( double sValue ) : void
UpdateColorField ( bool resetPreviouslyPickedPoint ) : void

Updates the color field panel.

UpdateColorPanels ( bool updateSlider, bool resetPreviouslyPickedPointOnColorField, bool updateHexValue ) : void

Updates the color panels and the hex value.

UpdateColorSlider ( ) : void

Updates the color slider.

UpdateColorSliderArrowRegions ( ) : void
UpdateColorSpacesWithNewHexValue ( ) : void

Updates the color spaces with the new hex value and makes sure that the necessary components are updated (color field, color slider, etc).

UpdateHexValue ( ) : void

Updates the hexadecimal text value.

ValueChanged ( int newValue ) : void
colorFieldPanel_ColorSelected ( object sender, ColorSelectedEventArgs e ) : void
colorSwatchPanel_ColorSwatchSelected ( object sender, ColorSelectedEventArgs e ) : void
hexTextBox_KeyDown ( object sender, KeyEventArgs e ) : void

Handles the KeyDown event raised by the hexTextBox object.

hexTextBox_KeyUp ( object sender, KeyEventArgs e ) : void

Handles the KeyUp event raised by the hexTextBox object.

picColorSlider_MouseDown ( object sender, System e ) : void

Handles the MouseDown event raised by the picColorSlider object. When the user clicks on the color slider, the arrow regions are updated to assume the clicked y-coordinate as their new vertical position.

picCurrentColor_GiveFeedback ( object sender, System e ) : void

Handles the GetFeedback event raised by picCurrentColor. We don't want to use the default cursors (I think they are intrusive). Setting the UseDefaultCursors property of the GiveFeedbackEventArgs object and setting the cursor to the hand cursor takes care of this for us.

picCurrentColor_MouseDown ( object sender, System e ) : void

Handles the MouseDown event raised by the picCurrentColor object.

picCurrentColor_QueryContinueDrag ( object sender, System e ) : void

Handles the QueryContinueDrag event raised by picCurrentColor. If the Action is anything other than Cancel or Drop, the location of the transparent form is updated.

sliderTimer_Tick ( object sender, System e ) : void

Handles the Tick event raised by the sliderTimer object. This is used to guarantee fluidity between two different points on the color slider when the arrows are being dragged. Without this, the currently selected color panel and the updated structure values (RGB/HEX) jump awkwardly between points. This will probably be changed to a threaded solution since FXCop is complaining about the tick frequency.

Method Details

ColorPanel() public méthode

Constructor. Initializes all of the components and member fields and configures the control for double buffering support.
public ColorPanel ( ) : System
Résultat System

ColorPanel() public méthode

public ColorPanel ( Color color ) : System
color Color
Résultat System

Dispose() protected méthode

Clean up any resources being used.
protected Dispose ( bool disposing ) : void
disposing bool
Résultat void

OnLoad() protected méthode

Overrides the base class' OnLoad method and instantiates a new DragForm object that will be used to create the visual drag effect when adding the currently selected color to the color swatch panel.
protected OnLoad ( EventArgs e ) : void
e System.EventArgs An EventArgs that contains the event data.
Résultat void

OnMouseDown() protected méthode

protected OnMouseDown ( MouseEventArgs e ) : void
e MouseEventArgs
Résultat void

OnMouseMove() protected méthode

protected OnMouseMove ( MouseEventArgs e ) : void
e MouseEventArgs
Résultat void

OnMouseUp() protected méthode

protected OnMouseUp ( MouseEventArgs e ) : void
e MouseEventArgs
Résultat void

OnPaint() protected méthode

Overrides the panel's OnPaint method to performs all of the painting operations.
protected OnPaint ( PaintEventArgs e ) : void
e PaintEventArgs A PaintEventArgs that contains the event data.
Résultat void