The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....



Interface of SDL_NTabEd

const
{$IFDEF PAIDVERS}
  SDLVersionInfo = 'ntabed_r951_full';
  IsLightEd = false;
{$ELSE}
  SDLVersionInfo = 'ntabed_r951_lighted';
  IsLightEd = true;
{$ENDIF}
  Release = 951;

  MaxPopupDCmds = 12;             { number of commands in data area popup menu }
  MaxPopupMCmds = 4;                      { number of commands in mark submenu }
  MaxPopupUCmds = 4;                    { number of commands in unmark submenu }
  MaxPopupHCmds = 2;            { number of commands in header area popup menu }

  popMenData = $1000000;                              { popup menu identifiers }
  popMenHeader = $2000000;
  popMenMark = $3000000;
  popMenUnMark = $4000000;

  pdMarkA = $0001;                { mask values of popup commands in data area }
  pdMarkB = $0002;
  pdUnMarkA = $0004;
  pdUnMarkB = $0008;
  pdUnMarkAll = $0010;
  pdClear = $0020;
  pdCopy = $0040;
  pdPaste = $0080;
  pdEdit = $0100;
  pdExtClip = $0200;
  pdSelAll = $0400;
  pdEmptyCells = $0800;
  pdAllCmds = $7FFFFFFF;

  phEditIdentifier = $0001;
  phChangePrecision = $0002;
  phAllCmds = $7FFFFFFF;

  pmMarkRange = $0001;        { mask values of popup submenu for mark commands }
  pmMarkColumn = $0002;
  pmMarkRow = $0004;
  pmMarkAll = $0008;
  pmAllCmds = $7FFFFFFF;

  puMarkRange = $0001;      { mask values of popup submenu for unmark commands }
  puMarkColumn = $0002;
  puMarkRow = $0004;
  puMarkAll = $0008;
  puAllCmds = $7FFFFFFF;


type
  ESDLNTabedError = class(ESDLError);      { exception type to indicate errors }
  TNTabEd = class(TCustomGrid)
            private
              FAutoAdvance     : boolean;        { TRUE: go to next cell on CR }
              FOnChange        : TNotifyEvent;
              FOnHeadingChanged: TNotifyEvent;
              FOnChangeSetup   : TNotifyEvent;
              FClassColWidth   : integer;         { width of class info column }
              FOptRowHeight    : boolean;       { TRUE: row height is adjusted
                                               automatically for changed fonts }
              FColOffset       : integer;  { =1 if row attrib. visible, else 0 }
              FRowOffset       : integer;{=1 if column attrib. visible, else 0 }
              FDecP            : array of shortint;    { nr. of dec. pl. shown }
              FClipUseFullPrec : boolean;       { TRUE: use full precision for
                                                          copying to ClipBoard }

              FDataCopy        : TDataTable;{ backup matrix for copy and paste }
              FDataCopyAvail   : boolean;{ TRUE if data in copy/paste container
                                                                  is available }

              FExtMatAssigned :  boolean;  { if TRUE: external matrix assigned }
              FNumWidth       :  integer;             { width of numeric field }
              FOnGetEditText  :  TGetEditEvent;
              FOnSetEditText  :  TSetEditEvent;
              FSortIncludeHd  :  boolean;      { flag to indicate sorting mode }
              FSuppressPaint  :  boolean;     { TRUE: suppress all paint calls }
              FInternSuppPaint:  boolean;    { TRUE:  suppress all paint calls }
              FBlockIntPopup  :  boolean;         { TRUE: block internal popup }
              FCommEdAllowed  :  boolean;      { TRUE: comment editing allowed }
              FPopupD         :  TPopUpMenu;      { popup menu for right mouse
                                                            click in data area }
              FPopupDMask     :  longint;   { mask for enabling popup commands }
              FPopupH         :  TPopUpMenu;      { popup menu for right mouse
                                                          click in header area }
              FPopupHMask     :  longint;   { mask for enabling popup commands }
              FPopupMMask     :  longint;   { mask for enabling popup commands }
              FPopupUMask     :  longint;   { mask for enabling popup commands }

              FColorBkgnd     :  TColor;         { background color of control }
              FColorFixed     :  TColor;         { color of fixed columns/rows }
              FColorNormal    :  TColor;              { color of unmarked text }
              FColorMarked1   :  TColor;              { color of marked text A }
              FColorMarked2   :  TColor;              { color of marked text B }
              FColorMarkedBoth:  TColor;            { color of marked text A&B }
              FColorSelected  :  TColor;     { color of header of selected row }
              FBoldSelHeads   :  boolean;   { TRUE: selected header is in bold }
              FBoldMarks      :  boolean;{ TRUE: marked data displayed in bold }

              FNameEdActive   :  boolean;   { to indicate an act. NameEd comp. }
              FNameEd         :  TEdit;               { editor for identifiers }

              FCommentMMActive:  boolean;  { indicates an act. CommentEd comp. }
              FCommentMM      :  TMemo;                   { editor for comment }
              FLastCellX      :  integer;  { coordinates of last selected cell }
              FLastCellY      :  integer;  { coordinates of last selected cell }
              FDropdownCount  : integer;
              FColPickList    : TStringList;

              procedure ColumnsGetPickListItems(ACol, ARow: Integer; Items: TStrings);
              procedure CommentMemoKeyPress(Sender: TObject; var Key: Char);
              procedure ExchangeDuringSort (Sender: TObject; ExchgWhat: byte;
                                          index1, index2, first, last: longint);
              function  GetColAttVis: boolean;
              function  GetRowAttVis: boolean;
              function  GetRowAttrib (RowNr: longint): byte;
              function  GetCellState (ACol, ARow: longint): byte;
              function  GetColAttrib (ColNr: longint): byte;
              function  GetColName (ColNr: longint): TDTNameStr;
              function  GetColWidths(Index: Longint): Integer;
              function  GetComment: string;
              function  GetDecPlaces (ColNr: longint): shortint;
              function  GetDefColWidth: integer;
              function  GetElem (ACol, ARow: longint): double;
              function  GetElemMarkedA (ACol, ARow: longint): boolean;
              function  GetElemMarkedB (ACol, ARow: longint): boolean;
              function  GetIsNumber (ACol, ARow: longint): boolean;
              function  GetIsEmpty (ACol, ARow: longint): boolean;
              function  GetNrCols: longint;
              function  GetNrRows: longint;
              function  GetPopupDCaption (ix: integer): TDTNameStr;
              function  GetPopupMCaption (ix: integer): TDTNameStr;
              function  GetPopupUCaption (ix: integer): TDTNameStr;
              function  GetPopupHCaption (ix: integer): TDTNameStr;
              function  GetRowName (RowNr: longint): TDTNameStr;
              procedure HeadingChanged;
              procedure DataHasChanged (Sender: TObject);
              procedure NameEdKeyPress(Sender: TObject; var Key: Char);
              procedure DataHasBeenResized (Sender: TObject; OldColumns, OldRows,
                                            NewColumns, NewRows: longint);
              procedure SetSuppressPaint (supp: boolean);
              procedure SetBoldMarks (bold: boolean);
              procedure SetBoldSelHeads (bold: boolean);
              procedure SetRowAttrib (RowNr: longint; Attrib: byte);
              procedure SetCellState (ACol, ARow: longint; const Value: byte);
              procedure SetColAttrib (ColNr: longint; Attrib: byte);
              procedure SetColAttVis (vis: boolean);
              procedure SetRowAttVis (vis: boolean);
              procedure SetOptRowHeight (opt: boolean);
              procedure SetColName (ColNr: longint; HLine: TDTNameStr);
              procedure SetColorBackground (color: TColor);
              procedure SetColorFixed (color: TColor);
              procedure SetColorMarkedA (color: TColor);
              procedure SetColorMarkedB (color: TColor);
              procedure SetColorMarkedBoth (color: TColor);
              procedure SetColorNormal (color: TColor);
              procedure SetColorSelected (color: TColor);
              procedure SetColWidths(Index: Longint; Value: Integer);
              procedure SetRowHeight (Index: Longint; Value: Integer);
              procedure SetDropdownCount(value:integer);
              procedure SetDecPlaces (ColNr: longint; Dp: shortint);
              procedure SetDefColWidth (DefW: integer);
              procedure SetElem (ACol, ARow: longint; const Value: double);
              procedure SetElemMarkedA (ACol, ARow: longint; const Value: boolean);
              procedure SetElemMarkedB (ACol, ARow: longint; const Value: boolean);
              procedure SetIsEmpty (ACol, ARow: longint; const Value: boolean);
              procedure SetComment (cmt: string);
              procedure SetNrCols (NrCols: longint);
              procedure SetNrRows (NrRows: longint);
              procedure SetNumWidth (nw: integer);
              procedure SetPopupDMask (mask: longint);
              procedure SetPopupHMask (mask: longint);
              procedure SetRowName (RowNr: longint; HLine: TDTNameStr);
              procedure SetPopupDCaption (ix: integer; text: TDTNameStr);
              procedure SetPopupMCaption (ix: integer; text: TDTNameStr);
              procedure SetPopupUCaption (ix: integer; text: TDTNameStr);
              procedure SetPopupHCaption (ix: integer; text: TDTNameStr);
              procedure PopupMenuDLoadPopup(Sender: TObject);
            protected
              function  CreateEditor: TInplaceEdit; override;
              procedure Paint; override;
              procedure Keypress (var Key: char); override;
              procedure KeyDown(var Key: Word; Shift: TShiftState); override;
              function  CanEditAcceptKey(Key: Char): Boolean; override;
              function  GetEditStyle(ACol, ARow: integer): TEditStyle; override;
{$IFDEF ISCLX}
              function  GetEditText (ACol, ARow: Longint): WideString; override;
              procedure SetEditText (ACol, ARow: Longint;
                                     const Value: WideString); override;
{$ELSE}
              function  GetEditText (ACol, ARow: Longint): string; override;
              procedure SetEditText (ACol, ARow: Longint;
                                     const Value: string); override;
{$ENDIF}
              procedure HighLightSelCell (cx, cy: integer);
              procedure DrawCell (ACol, ARow: Longint; ARect: TRect;
                                  AState: TGridDrawState); override;
              procedure Loaded; override;
              procedure MouseDown (Button: TMouseButton;
                                   Shift: TShiftState; X, Y: Integer); override;
            public
              Data  : TDataTable;                                  { data matrix }
              constructor Create(AOwner: TComponent); override;
              destructor  Destroy; override;
              procedure AssignAnotherDataMatrix (NewDTab: TDataTable);
              function  AutoColWidth (ColNr: longint; IncludeHeader: boolean;
                                      Addon: integer): integer;
              function  AutoRowHeight (RowNr: longint; Addon: integer): integer;
              procedure Changed;
              procedure ChangedSetup;
              procedure Fill (value: double);
              property  Elem[ACol, ARow: longint]: double
                            read GetElem write SetElem; default;
              property  CellState[ACol, ARow: longint]: byte
                            read GetCellState write SetCellState;
              property  ElemMarkedA[ACol, ARow: longint]: boolean
                            read GetElemMarkedA write SetElemMarkedA;
              property  ElemMarkedB[ACol, ARow: longint]: boolean
                            read GetElemMarkedB write SetElemMarkedB;
              procedure Redimension (NrCols, NrRows: longint);
              property  RowAttrib [ix: longint]: byte
                            read GetRowAttrib write SetRowAttrib;
              property  ColAttrib [ix: longint]: byte
                            read GetColAttrib write SetColAttrib;
              function  IfColumnMarked (col: longint): boolean;
              function  IfRowMarked (row: longint): boolean;
              function  IfAnyMarked: boolean;
              procedure InsertRow (ix: longint);
              procedure InsertColumn (ix: longint);
              property  IsNumber[ACol, ARow: longint]: boolean read GetIsNumber;
              property  IsEmpty[ACol, ARow: longint]: boolean read GetIsEmpty write SetIsEmpty;
              procedure Clear;
              property  ColName[ix: longint]: TDTNameStr
                            read GetColName write SetColName;
              property  ColWidths[Index: Longint]: Integer
                            read GetColWidths write SetColWidths;
              procedure CopyContentsFrom (ExtTab: TNTabEd);
              procedure PopupMenuClickClear (Sender: TObject);
              procedure PopupMenuClickEmptyCells (Sender: TObject);
              procedure PopupMenuClickMarkARange (Sender: TObject);
              procedure PopupMenuClickMarkARow (Sender: TObject);
              procedure PopupMenuClickMarkAAll (Sender: TObject);
              procedure PopupMenuClickMarkAColumn (Sender: TObject);
              procedure PopupMenuClickMarkBRange (Sender: TObject);
              procedure PopupMenuClickMarkBRow (Sender: TObject);
              procedure PopupMenuClickMarkBAll (Sender: TObject);
              procedure PopupMenuClickMarkBColumn (Sender: TObject);
              procedure PopupMenuClickUnMarkARange (Sender: TObject);
              procedure PopupMenuClickUnMarkARow (Sender: TObject);
              procedure PopupMenuClickUnMarkAAll (Sender: TObject);
              procedure PopupMenuClickUnMarkAColumn (Sender: TObject);
              procedure PopupMenuClickUnMarkBRange (Sender: TObject);
              procedure PopupMenuClickUnMarkBRow (Sender: TObject);
              procedure PopupMenuClickUnMarkBAll (Sender: TObject);
              procedure PopupMenuClickUnMarkBColumn (Sender: TObject);
              procedure PopupMenuClickUnMarkAll (Sender: TObject);
              procedure PopupMenuClickCopy (Sender: TObject);
              procedure PopupMenuClickPaste (Sender: TObject);
              procedure PopupMenuClickEdit (Sender: TObject);
              procedure PopupMenuClickExtClip (Sender: TObject);
              procedure PopupMenuClickSelAll (Sender: TObject);
              procedure PopupMenuClickChangeID (Sender: TObject);
              procedure PopupMenuClickPrecision (Sender: TObject);
              property  Precision[ColNr: longint]: shortint
                            read GetDecPlaces write SetDecPlaces;
              procedure RemoveRow (ix: longint);
              procedure RemoveColumn (ix: longint);
              property  RowName[ix: longint]: TDTNameStr
                            read GetRowName write SetRowName;
              property  RowHeights;
              property  Selection;
              procedure SortCols (SortRowIx: integer; Ascending: boolean;
                            LowCol, LowRow, HighCol, HighRow: integer;
                            IncludeHeaders: boolean);
              procedure SortRows (SortColIx: integer; Ascending: boolean;
                            LowCol, LowRow, HighCol, HighRow: integer;
                            IncludeHeaders: boolean);
              procedure SortColAttributes (Ascending: boolean;
                            LowCol, LowRow, HighCol, HighRow: integer);
              procedure SortColNames (Ascending: boolean;
                            LowCol, LowRow, HighCol, HighRow: integer);
              procedure SortRowAttributes (Ascending: boolean;
                            LowCol, LowRow, HighCol, HighRow: integer);
              procedure SortRowNames (Ascending: boolean;
                            LowCol, LowRow, HighCol, HighRow: integer);
              procedure MarkAllElemsA;
              procedure MarkAllElemsB;
              procedure UnMarkAllElems;
              function  NrOfMarkedDataA: integer;
              function  NrOfMarkedDataB: integer;
              function  FindColIndex (ColID: TDTNameStr): integer;
              function  FindRowIndex (RowID: TDTNameStr): integer;
              property  SuppressPaint: boolean
                            read FSuppressPaint write SetSuppressPaint;
              property  PopupDMask: longint read FPopupDMask write SetPopupDMask;
              property  PopupHMask: longint read FPopupHMask write SetPopupHMask;
              property  PopupDCaptions[ix: integer]: TDTNameStr
                            read GetPopupDCaption
                            write SetPopupDCaption;
              property  PopupMCaptions[ix: integer]: TDTNameStr
                            read GetPopupMCaption
                            write SetPopupMCaption;
              property  PopupUCaptions[ix: integer]: TDTNameStr
                            read GetPopupUCaption
                            write SetPopupUCaption;
              property  PopupHCaptions[ix: integer]: TDTNameStr
                            read GetPopupHCaption
                            write SetPopupHCaption;
            published
              property  Align;
              property  AutoAdvance: boolean read FAutoAdvance write FAutoAdvance;
              property  AttribRowVisible: boolean
                            read GetRowAttVis write SetRowAttVis;
              property  AttribColVisible: boolean
                            read GetColAttVis write SetColAttVis;
              property  BlockInternalPopup: boolean read FBlockIntPopup write FBlockIntPopup;
              property  CommentEditingAllowed: boolean read FCommEdAllowed write FCommEdAllowed;
              property  Comment: string read GetComment write SetComment;
              property  ColorBackground: TColor
                            read FColorBkgnd write SetColorBackground;
              property  ColorFixed: TColor read FColorFixed write SetColorFixed;
              property  ColorNormal: TColor read FColorNormal write SetColorNormal;
              property  ColorSelected: TColor
                            read FColorSelected write SetColorSelected;
              property  ColorMarkedA: TColor
                            read FColorMarked1 write SetColorMarkedA;
              property  ColorMarkedB: TColor
                            read FColorMarked2 write SetColorMarkedB;
              property  ColorMarkedBoth: TColor
                            read FColorMarkedBoth write SetColorMarkedBoth;
              property  DefaultColWidth: integer
                            read GetDefColWidth write SetDefColWidth;
              property  DefaultRowHeight;
              property  Font;
              property  ParentFont;
              property  PopupMenu;
              property  BoldMarks: boolean
                            read FBoldMarks write SetBoldMarks;
              property  BoldSelHeads: boolean
                            read FBoldSelHeads write SetBoldSelHeads;
              property  ClipboardUseFullPrec: boolean
                            read FClipUseFullPrec write FClipUseFullPrec;
              property  NomEditDropDownCount: integer
                            read FDropDownCount write SetDropdownCount default 8;
              property  NrOfColumns: longint read GetNrCols write SetNrCols;
              property  NrOfRows: longint read GetNrRows write SetNrRows;
              property  NumWidth: integer read FNumWidth write SetNumWidth;
              property  OptimizeRowHeight: boolean read FOptRowHeight write SetOptRowHeight;
              property  Options stored True;
              property  TopRow;
              property  Visible;
              property  VisibleColCount;
              property  VisibleRowCount;
              property  OnGetEditText: TGetEditEvent
                            read FOnGetEditText write FOnGetEditText;
              property  OnSetEditText: TSetEditEvent
                            read FOnSetEditText write FOnSetEditText;
              property  OnMouseDown;
              property  OnMouseUp; 
              property  OnClick;
              property  OnChange: TNotifyEvent read FOnChange write FOnChange;
              property  OnChangeSetup: TNotifyEvent
                            read FOnChangeSetup write FOnChangeSetup;
              property  OnDblClick;
              property  OnHeadingChanged: TNotifyEvent read FOnHeadingChanged
                            write FOnHeadingChanged;
              property  OnKeyDown;
              property  OnKeyPress;
              property  OnKeyUp;
            end;





Last Update: 2008-Okt-29