Git Product home page Git Product logo

nldstringgrid's Introduction

NLDStringGrid

A StringGrid with extra features like columns, merged cells, readonly cells, input styles, custom inplace editors, import/export functionality and much more.

Website: https://www.nldelphi.com/forumdisplay.php?43-NLDStringGrid

Features, compared to Delphi's default VCL TStringGrid:

Added functionality:

  • Without settings, the component appears and acts exactly the same as the default TStringGrid
  • Color properties can be set to the default color by setting to clDefault
  • Merging of adjacent cells
  • Inplace editor in style of current (merged) cell(s) which listens to F4
  • Descends from TCustomDrawGrid
  • Double clicking a column title autowidths the column
  • CSV import/export
  • Multiline text in (merged) cells

New methods:

    procedure AutoColWidth(ACol: Integer);
    procedure AutoRowHeight(ARow: Integer);
    procedure BeginUpdateData;
    procedure DeleteColumn(ACol: Integer);
    procedure DeleteRows(DeletePos: TDeletePos; StartIndex: Integer = -1; Count: Integer = 1);
    procedure EndUpdateData;
    procedure ExportCSV(const FileName: TFileName; TitlesFirstRow: Boolean);
    procedure ImportCSV(const FileName: TFileName; TitlesFirstRow: Boolean);
    procedure InsertColumn(AtIndex: Integer); overload;
    procedure InsertColumn(Position: TInsertPos = ipBefore); overload;
    procedure InsertRow(AtIndex: Integer); overload;
    procedure InsertRow(Position: TInsertPos = ipBefore); overload;
    function IsEmptyColumn(ACol: Integer): Boolean;
    function IsEmptyRow(ARow: Integer): Boolean;
    procedure MergeCells(const AGridRect: TGridRect; MergeText, MultiLine: Boolean);
    procedure MoveColumn(FromIndex, ToIndex: Integer);
    procedure MoveRow(FromIndex, ToIndex: Integer);
    procedure ResetAllFonts(AFont: TFont = nil);
    procedure ResetMainColors(AGridColor: TColor = clWindow; AFixedColor: TColor = clBtnFace);
    procedure SetGradientColumnColors(First, Last: TColor; ColumnsOnly: Boolean);
    procedure UnMergeCells(const AGridRect: TGridRect);

New properties:

    AlternatingRowColors: TStringGridRowColors; {EvenRowColor: TColor, IncludeFixed: Boolean, OddRowColor: TColor, OverrideColumnColor: Boolean}
    AutoRowHeights: Boolean default False;
    Columns: TStringGridColumns; {Items[Index: Integer]: TStringGridColumn default; OnChanged: TColumnsChangedEvent}
    DefaultDrawing: TDefaultDrawingModes default [ddBackground, ddEdges, ddGridLines, ddGlyphs, ddText, ddFocusRect];
    FixedFont: TFont;
    FixedGridLineColor: TColor default clBlack;
    FocusRectColor: TColor default clDefault;
    FocusRectStyle: TFocusRectStyle default frDefault; {frDefault, frSolidAutoBW, frSolidCustomColor}
    GridLineColor: TColor default clSilver;
    MemoryOptions: TMemoryOptions default DefMemoryOptions; {moBeyondGrid, moProportional, moStoreColsRows, moSparseStorage}
    OnDrawCell: TDrawCellEvent; {Sender: TObject; ACol, ARow: Integer; const ARect: TRect; State: TGridDrawState; Stage: TDefaultDrawingMode; StageBegin: Boolean; Column: TStringGridColumn}
    OnEditButtonClick: TNotifyEvent;
    OnTitleClick: TTitleClickEvent; {Sender: TObject; Index: Integer; Column: TStringGridColumn}
    OwnsObjects: Boolean default False;
    ReadOnly[ACol, ARow: Integer]: Boolean;
    ReadOnlyColor: TColor;
    SelectionAlphaBlend: Boolean default True;
    SelectionAlphaBlendValue: Byte default 80;
    SelectionColor: TColor default clHighLight;
    StretchModes: TStretchModes default []; {smAllowStretchRight, smAllowStretchAll, smAllowShrinkRight, smAllowShrinkAll}
    SyncColumns: Boolean default False; {when true: ColCount = Columns.Count; when false: ColCount >= Columns.Count}
    Values[ACol, ARow: Integer]: Variant;

TStringGridColumn properties:

    Action: TBasicAction;
    Alignment: TAlignment default taLeftJustify;
    Color: TColor;
    DefaultCellText: String;
    EditFormat: String;
    EditMask: TEditMask;
    EditStyle: TEditStyle default esSimple; {esSimple, esEllipsis, esPickList, esPickListOnly}
    Fixed: Boolean;
    Font: TFont;
    InputStyle: TInputStyle default isString; {isString, isInteger, isAbsInteger, isFloat, isAbsFloat, isMask, isCustom}
    MaxLength: Integer default 0;
    MaxWidth: Integer default 0;
    MinWidth: Integer default 0;
    MultiLine: Boolean default False;
    OnTitleClick: TNotifyEvent;
    PickListItems: TStrings;
    ReadOnly: Boolean;
    RowNumbers: Boolean default False;
    Title: TStringGridTitle; {Alignment: TAlignment; Caption: String; Color: TColor; Font: TFont; Height: Integer; MultiLine: Boolean; VAlignment: TVAlignment}
    VAlignment: TVAlignment default vaTop;
    Visible: Boolean;
    Width: Integer;

nldstringgrid's People

Contributors

ngln avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.