const
{$IFDEF PAIDVERS}
COLSEL_MAXCOLORS = 255;
SDLVersionInfo = 'colsel_r900_full';
IsLightEd = false;
{$ELSE}
COLSEL_MAXCOLORS = 47;
SDLVersionInfo = 'colsel_r900_lighted';
IsLightEd = true;
{$ENDIF}
Release = 900;
type
TColSel = class(TCustomComboBox)
private
FColorBarWidth : Integer;
FSelColorIx : integer;
FNumColors : integer;
FEnabled : boolean;
FMouseAreaCode : integer;
FColors : array[1..COLSEL_MAXCOLORS] of TColor;
FColorNames : array[1..COLSEL_MAXCOLORS] of string;
FIsUserEditable: array[1..COLSEL_MAXCOLORS] of boolean;
procedure SetSelColor(Color: TColor);
function GetSelColor: TColor;
procedure SetColorBarWidth (W: Integer);
function GetSelColorID: string;
function GetArrayColor (Index: integer): TColor;
procedure SetArrayColor (Index: integer; value: TColor);
function GetArrayColorName (Index: integer): string;
procedure SetArrayColorName (Index: integer; value: string);
function GetArrayAllowEdit (Index: integer): boolean;
procedure SetArrayAllowEdit (Index: integer; value: boolean);
procedure SetNumColors (num: integer);
protected
procedure Click; override;
{$IFNDEF ISCLX}
procedure DrawItem (Index: Integer; Rect: TRect;
State: TOwnerDrawState); override;
{$ELSE}
function DrawItem (Index: Integer; Rect: TRect;
State: TOwnerDrawState): Boolean; override;
{$ENDIF}
procedure DropDown; override;
procedure Loaded; override;
procedure LoadColorsIntoComboList;
procedure MouseMove (Shift: TShiftState; X,Y: integer); override;
procedure SetEnabled (value: boolean); override;
public
constructor Create(AOwner : TComponent); override;
procedure SetAllColorEditFlags;
procedure ResetAllColorEditFlags;
property SelColorID: string read GetSelColorID;
property ColorEditAllowed[Index: integer]: boolean
read GetArrayAllowEdit write SetArrayAllowEdit;
property Colors[Index: integer]: TColor
read GetArrayColor write SetArrayColor;
property ColorNames[Index: integer]: string
read GetArrayColorName write SetArrayColorName;
procedure LoadBasicVGAPalette;
procedure LoadExtendedPalette;
procedure LoadWindowsSystemPalette;
procedure LoadStandardPalette;
published
property Color;
property ColorBarWidth: Integer
read FColorBarWidth write SetColorBarWidth;
property DropDownCount;
property Enabled: boolean read FEnabled write SetEnabled;
property Font;
property NumColors: integer read FNumColors write SetNumColors;
property ParentColor;
property ParentFont;
property ParentShowHint;
property SelColor: TColor read GetSelColor write SetSelColor;
property ShowHint;
property TabOrder;
property TabStop;
property Visible;
property OnChange;
property OnClick;
property OnDropDown;
property OnEnter;
property OnExit;
end;
|