Class TrDBGrid_MS

Unit

Declaration

type TrDBGrid_MS = class(TrDBGrid)

Description

enhanced TrDBGrid component which provides multiselect function by click on fixed column with definable colors

Hierarchy

Overview

Methods

Public function IsActiveSelected: Boolean;
Public procedure SelectActive;
Public procedure DeSelectActive;
Public procedure SelectAll;
Public procedure DeSelectAll;
Public procedure ReverseSelection;
Public function DeleteSelected: Boolean;
Public function GetSelectedRecCount: Integer;
Public function GetScopeRecCount(RecordScope: TRecordScope): Integer;
Public procedure ProcScopeRecords(RecordScope: TRecordScope; CallBackProc: TNotifyEvent);
Public procedure GetCellParams(Field: TField; AFont: TFont; var Background: TColor; var DataImageDef: TDataImageDef; ActiveRow, Highlight: Boolean); override;

Properties

Public property rBookmarks: TrBookmarkList read FrBookmarks;
Public property MyBookmarks: TrBookmarkList read FrBookmarks;
Public property UseMultiSelect: Boolean read FUseMultiSelect write FUseMultiSelect;
Public property SingleSelect: Boolean read FSingleSelect write FSingleSelect;
Public property FixColPopup: TPopupMenu read FFixColPopup;
Published property SelectByClickOnRow: Boolean read FSelectByClickOnRow write FSelectByClickOnRow default false;
Published property DeselectAllByClickOnRow: Boolean read FDeselectAllByClickOnRow write FDeselectAllByClickOnRow default true;
Published property SelectedRowsBkColor: TColor read FSelectedRowsBkColor write FSelectedRowsBkColor default clHighlight;
Published property SelectedRowsFontColor: TColor read FSelectedRowsFontColor write FSelectedRowsFontColor default clHighlightText;
Published property SelectingConfirmRecCount: Integer read FSelectingConfirmRecCount write FSelectingConfirmRecCount default 1000;
Published property ShowMultiselectPopup: Boolean read FShowMultiselectPopup write FShowMultiselectPopup default true;
Published property DeleteOnlySelected: Boolean read FDeleteOnlySelected write FDeleteOnlySelected default false;
Published property OnDeleteSelected: TNotifyEvent read FOnDeleteSelected write FOnDeleteSelected;
Published property OnSelectingRecords: TNotifyEvent read FOnSelectingRecords write FOnSelectingRecords;
Published property OnSelectionChanged: TNotifyEvent read FOnSelectionChanged write FOnSelectionChanged;
Published property OnCanDeleteSelected: TCanDeleteSelected read FOnCanDeleteSelected write FOnCanDeleteSelected;

Description

Methods

Public function IsActiveSelected: Boolean;

return if active record is selected

Public procedure SelectActive;

select active record

Public procedure DeSelectActive;

deselect active record

Public procedure SelectAll;

select all records

Public procedure DeSelectAll;

deselect all records

Public procedure ReverseSelection;

reverse selection - select unselected and unselect selected records

Public function DeleteSelected: Boolean;

delete all selected records, if no record is selected, property DeleteOnlySelected is used and active record is delete or nothing is done

Public function GetSelectedRecCount: Integer;

returns count of selected records

Public function GetScopeRecCount(RecordScope: TRecordScope): Integer;

returns count of selected records according RecordScope

Public procedure ProcScopeRecords(RecordScope: TRecordScope; CallBackProc: TNotifyEvent);

proccess all records according RecordScope and call CallBackProc for each of them

Public procedure GetCellParams(Field: TField; AFont: TFont; var Background: TColor; var DataImageDef: TDataImageDef; ActiveRow, Highlight: Boolean); override;

add bk color for selected records

Properties

Public property rBookmarks: TrBookmarkList read FrBookmarks;

list of bookmarks to selected records

Public property MyBookmarks: TrBookmarkList read FrBookmarks;

list of bookmarks to selected records - compability only

Public property UseMultiSelect: Boolean read FUseMultiSelect write FUseMultiSelect;

indicates and set/reset multiselect function in runtime

Public property SingleSelect: Boolean read FSingleSelect write FSingleSelect;

indicates and set/reset single select function in runtime

Public property FixColPopup: TPopupMenu read FFixColPopup;

Popup menu for fix column

Published property SelectByClickOnRow: Boolean read FSelectByClickOnRow write FSelectByClickOnRow default false;

define whether selection is done by click to any cell

Published property DeselectAllByClickOnRow: Boolean read FDeselectAllByClickOnRow write FDeselectAllByClickOnRow default true;

define whether selection is done by click to any cell

Published property SelectedRowsBkColor: TColor read FSelectedRowsBkColor write FSelectedRowsBkColor default clHighlight;

define background color of selected row

Published property SelectedRowsFontColor: TColor read FSelectedRowsFontColor write FSelectedRowsFontColor default clHighlightText;

define font color of selected row

Published property SelectingConfirmRecCount: Integer read FSelectingConfirmRecCount write FSelectingConfirmRecCount default 1000;

define count of selected records for action confirmation to aviod freeze for time consumin actions

Published property ShowMultiselectPopup: Boolean read FShowMultiselectPopup write FShowMultiselectPopup default true;

define whether popup for fixed column is shown

Published property DeleteOnlySelected: Boolean read FDeleteOnlySelected write FDeleteOnlySelected default false;

define if active record is deleted if nothing is selected

Published property OnDeleteSelected: TNotifyEvent read FOnDeleteSelected write FOnDeleteSelected;

event is called for deletion of records, if not defined, standard delete method is used

Published property OnSelectingRecords: TNotifyEvent read FOnSelectingRecords write FOnSelectingRecords;

event is called during selection of records for each record

Published property OnSelectionChanged: TNotifyEvent read FOnSelectionChanged write FOnSelectionChanged;

event is called after selection or deselection of records

Published property OnCanDeleteSelected: TCanDeleteSelected read FOnCanDeleteSelected write FOnCanDeleteSelected;

event is called before showing of fix column popup menu to obtain possibility to delete selected records


Generated by PasDoc 0.15.0.