Download Now

    Reference TCustomColorControl

    Declared in Codebot.Controls.Colors.pas on line 28

    TCustomColorControl is the base class for controls which pick a color with the mouse
      TCustomColorControl = class(TSurfaceGraphicControl)
      protected
        { Return the selected color }
        function GetColorValue: TColorB; virtual; abstract;
        { Select a color }
        procedure SetColorValue(Value: TColorB); virtual; abstract;
        { Invoke OnChange and repaint }
        procedure Change; virtual;
        { Select the color under the mouse }
        procedure ChangeMouse(X, Y: Integer); virtual;
        procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;
        procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;
        procedure Resize; override;
        { The last mouse position used to pick a color }
        property MousePos: TPointI read FMousePos write FMousePos;
        { The selected color }
        property ColorValue: TColorB read GetColorValue write SetColorValue;
        { OnChange is invoked when the selected color changes }
        property OnChange: TNotifyEvent read FOnChange write FOnChange;
      public
        destructor Destroy; override;
      end;

    See also

    TColorB in Codebot.Graphics.Types.pas
    TPointI in Codebot.Graphics.Types.pas
    TSurfaceGraphicControl in Codebot.Controls.pas