CoolControl Storage Object

StorageObject

  ICoolStorageObject is the basis for many of the visual objects in CoolControl inlcuding Items, Groups, and Columns.

ICoolStorageObject = interface(IUnknown)
  [IID_ICoolStorageObject]
  function GetCut: Boolean;
  function GetDropHilighted: Boolean;
  function GetFocused: Boolean;
  function GetIndex: Integer;
  function GetInitialized: Boolean;
  function GetSelected: Boolean;
  function GetVisible: Boolean;
  function GetVisibleIndex: Integer;
  procedure SetCut(const Value: Boolean);
  procedure SetDropHilighted(const Value: Boolean);
  procedure SetFocused(const Value: Boolean);
  procedure SetInitialized(const Value: Boolean);
  procedure SetSelected(const Value: Boolean);
  procedure SetVisible(const Value: Boolean);

  property Cut: Boolean read GetCut write SetCut;
  property DropHilighted: Boolean read GetDropHilighted write SetDropHilighted;
  property Focused: Boolean read GetFocused write SetFocused;
  property Index: Integer read GetIndex;
  property Initialized: Boolean read GetInitialized write SetInitialized;
  property Selected: Boolean read GetSelected write SetSelected;
  property Visible: Boolean read GetVisible write SetVisible;
  property VisibleIndex: Integer read GetVisibleIndex;
  end;

  This interface defines various states the visual object can take on. Note that not all of these states may make sense to all objects and the meaning of the state is implementation defined.

  The first grouping of states has to do with the user interface (UI) state of the object

property Cut: Boolean read GetCut write SetCut;
property DropHilighted: Boolean read GetDropHilighted write SetDropHilighted;
property Focused: Boolean read GetFocused write SetFocused;
property Selected: Boolean read GetSelected write SetSelected; 

  These are typical states seen in most all controls. Notice these core states can have meaning for all the common objects in CoolControl, Items, Groups, and Columns.

  The next grouping of states defines the index of the object. CoolControl organizes its objects in a linear list.

property Index: Integer read GetIndex;
property VisibleIndex: Integer read GetVisibleIndex;

  The Index property is the absolute index of the object across all objects regardless if the object is visible or invisible (CoolControl supports invisible, groups, items, columns, etc.). The VisibleIndex is the linear index of visible objects. If there are no invisible objects then the two indexes are equal. There is an important distinction between these two indexes. When accessing an object for use in the grid the VisibleIndex must be used to locate the correct cell for the object. When querying the user of CoolControl the Index should be used as this is how the application would have organized its data (remember CoolControl is virtual so it carries no data the user has the data stored elsewhere). The users data will likely have no knowledge (or even care) of the visibility of the objects.

  The last property is an Initialization state.

property Initialized: Boolean read GetInitialized write SetInitialized;

   CoolControl is a virtual control so it is possible to defer the loading of time consuming data until the control is ready for it. The control will call OnInitializeItem in the TCoolEventManager class. Like all other managers it is accessed through the TCustomCoolWindow.ManagerLink property.

 


mustangpeak.net

  Last Modified on: