| Class TIconComboBox (unit IconCtls) |
TCustomComboBox
| Constructors |
constructor Create(AOwner: TComponent);| Functions |
procedure DrawItem(Index: Integer; Rect: TRect; State: TOwnerDrawState);
function GetIcon(const Index: integer): TIcon;
function GetVersion: TDFSVersion;
procedure MeasureItem(Index: Integer; var Height: Integer);Return the size of the item we are drawing
function ReadIcon(const Index: integer): TIcon;Used to extract icons from files and assign them to a TIcon object
procedure SetAutoDisable(Value: boolean);
procedure SetEnableCaching(Value: boolean);
procedure SetFileName(Value: String);Update the filename of the icon file.
procedure SetVersion(const Val: TDFSVersion);
procedure FreeIcons;
procedure LoadIcons;Initialize the icon handles, which are stored in the Objects property
procedure UpdateEnabledState;
procedure WMDeleteItem(var Msg: TWMDeleteItem);| Properties |
property AutoDisable : boolean
property Color :
property Ctl3D :
property DragCursor :
property DragMode :
property DropDownCount :
property EnableCaching : boolean
property Enabled :
property FileName : string
property ItemIndex :
property NumberOfIcons : integer
property ParentColor :
property ParentCtl3D :
property ParentFont :
property ParentShowHint :
property PopupMenu :
property ShowHint :
property TabOrder :
property TabStop :
property Version : TDFSVersion
property Visible : | Events |
event OnClick :
event OnDblClick :
event OnDragDrop :
event OnDragOver :
event OnDropDown :
event OnEndDrag :
event OnEnter :
event OnExit :
event OnFileChange : TNotifyEvent
event OnKeyDown :
event OnKeyPress :
event OnKeyUp : | Variables |
FAutoDisable : boolean;
FEnableCaching : boolean;
FFileName : String;
FNumberOfIcons : integer;
FOnFileChange : TNotifyEvent;| Constructors |
constructor Create(AOwner: TComponent);TIconComboBox Component
| Functions |
procedure DrawItem(Index: Integer; Rect: TRect; State: TOwnerDrawState);Draw the item requested in the given rectangle. Because of the parent's default } { behavior, we needn't worry about the State. That's very nice.
function GetIcon(const Index: integer): TIcon;Returns the icon for a given combobox index
function GetVersion: TDFSVersion;If anything went wrong, we fall down to here. You may want to add some } { sort of user notification. No clean up is necessary since we did not } { create anything. We'll just ignore the problem and hope it goes away. :) } {!
procedure MeasureItem(Index: Integer; var Height: Integer);Owner drawing routines
Return the size of the item we are drawing
function ReadIcon(const Index: integer): TIcon;Icon service routines
Used to extract icons from files and assign them to a TIcon object
procedure SetAutoDisable(Value: boolean);Update the AutoDisable property
procedure SetEnableCaching(Value: boolean);Update the EnableCaching property
procedure SetFileName(Value: String);Routines for setting property values and updating affected items
Update the filename of the icon file.
procedure SetVersion(const Val: TDFSVersion);
procedure FreeIcons;Free the icon resources we created.
procedure LoadIcons;Routines that should only be used internally by component
Initialize the icon handles, which are stored in the Objects property
procedure UpdateEnabledState;Disable the control if we don't have a valid filename, and option is enabled
procedure WMDeleteItem(var Msg: TWMDeleteItem);Set default values
| Properties |
property AutoDisable : booleanIf true, the combobox will be disabled when FileName does not exist
property Color : Protected properties in parent that we will make available to everyone
property Ctl3D :
property DragCursor :
property DragMode :
property DropDownCount :
property EnableCaching : booleanIf true, icons will be loaded as needed, instead of all at once
property Enabled :
property FileName : stringName of icon file to display
property ItemIndex :
property NumberOfIcons : integerThe number of icons in the file. -1 if FileName is not valid.
property ParentColor :
property ParentCtl3D :
property ParentFont :
property ParentShowHint :
property PopupMenu :
property ShowHint :
property TabOrder :
property TabStop :
property Version : TDFSVersion
property Visible : | Events |
event OnClick : property OnChange: TNotifyEvent read FOnChange write FOnChange;
event OnDblClick :
event OnDragDrop :
event OnDragOver :
event OnDropDown :
event OnEndDrag :
event OnEnter :
event OnExit :
event OnFileChange : TNotifyEventUseful if you have statics the reflect the number of icons, etc.
event OnKeyDown :
event OnKeyPress :
event OnKeyUp : | Variables |
FAutoDisable : boolean;
FEnableCaching : boolean;
FFileName : String;Variables for properties
FNumberOfIcons : integer;
FOnFileChange : TNotifyEvent;