📄 rm_grid.hpp
字号:
#pragma pack(pop)
int FSizingIndex;
int FSizingPos;
int FSizingOfs;
int FMoveIndex;
int FMovePos;
#pragma pack(push,1)
Types::TPoint FHitTest;
#pragma pack(pop)
int FColOffset;
bool FDefaultDrawing;
bool FPressed;
#pragma pack(push,1)
Types::TPoint FPressedCell;
#pragma pack(pop)
TRMCells* FCells;
Graphics::TColor FTitleColor;
Graphics::TColor FHighLightColor;
Graphics::TColor FHighLightTextColor;
Graphics::TColor FFocusedTitleColor;
Graphics::TColor FFixedLineColor;
Graphics::TColor FClientLineColor;
bool FInLoadSaveMode;
bool FAutoCreateName;
Graphics::TColor FFocusedFillColor;
bool FDrawPicture;
TRMInplaceEdit* FInplaceEdit;
int FInplaceCol;
int FInplaceRow;
int FEditUpdate;
bool FGridCanCopyMove;
bool FGridCanFill;
bool FAutoUpdate;
Rm_class::TRMReport* FParentReport;
Rm_class::TRMReportPage* FParentPage;
bool FHeaderClick;
HRGN FNewRgn;
HRGN FOldRgn;
int FHaveClip;
TRMAfterInsertRowEvent FOnAfterInsertRow;
TRMAfterDeleteRowEvent FOnAfterDeleteRow;
TRMAfterChangeRowCountEvent FOnAfterChangeRowCount;
TRMSelectCellEvent FOnSelectCell;
Classes::TNotifyEvent FOnChange;
TRMFRowHeaderClickEvent FOnRowHeaderClick;
Classes::TNotifyEvent FOnRowHeaderDblClick;
Classes::TNotifyEvent FOnBeginSizingCell;
TRMBeforeChangeCellEvent FOnBeforeChangeCell;
TRMDropDownFieldEvent FOnDropDownField;
TRMDropDownFieldClickEvent FOnDropDownFieldClick;
void __fastcall ClearGrid(void);
void __fastcall ShowFrame(Rm_class::TRMView* t, Graphics::TCanvas* aCanvas, int x, int y, int x1, int y1, bool aDrawSubReport);
Types::TPoint __fastcall CalcCoordFromPoint(int X, int Y, const TRMGridDrawInfo &DrawInfo);
void __fastcall CalcDrawInfoXY(TRMGridDrawInfo &DrawInfo, int UseWidth, int UseHeight);
Types::TPoint __fastcall CalcMaxTopLeft(const Types::TPoint &Coord, const TRMGridDrawInfo &DrawInfo);
void __fastcall CancelMode(void);
void __fastcall ChangeSize(int NewColCount, int NewRowCount);
void __fastcall ClampInView(const Types::TPoint &Coord);
void __fastcall DrawSizingLine(const TRMGridDrawInfo &DrawInfo);
void __fastcall DrawMove(void);
void __fastcall FocusCell(int ACol, int ARow, bool MoveAnchor);
void __fastcall GridRectToScreenRect(const Types::TRect &GridRect, Types::TRect &ScreenRect, bool IncludeLine);
void __fastcall Initialize(void);
void __fastcall ModifyScrollBar(unsigned ScrollBar, unsigned ScrollCode, unsigned Pos, bool UseRightToLeft);
void __fastcall MoveAdjust(int &CellPos, int FromIndex, int ToIndex);
void __fastcall MoveAnchor(const Types::TPoint &NewAnchor);
void __fastcall MoveCurrent(int ACol, int ARow, bool MoveAnchor, bool Show);
void __fastcall MoveTopLeft(int ALeft, int ATop);
void __fastcall ResizeCol(int Index, int OldSize, int NewSize);
void __fastcall ResizeRow(int Index, int OldSize, int NewSize);
void __fastcall MoveColumn(int FromIndex, int ToIndex);
void __fastcall MoveRow(int FromIndex, int ToIndex);
void __fastcall SelectionMoved(const Types::TRect &OldSel);
void __fastcall ScrollDataInfo(int DX, int DY, TRMGridDrawInfo &DrawInfo);
void __fastcall TopLeftMoved(const Types::TPoint &OldTopLeft);
void __fastcall UpdateScrollPos(void);
void __fastcall UpdateScrollRange(void);
int __fastcall GetRowHeights(int Index);
void __fastcall SetRowHeights(int Index, int Value);
int __fastcall GetmmRowHeights(int Index);
void __fastcall SetmmRowHeights(int Index, int Value);
Types::TRect __fastcall GetSelection();
int __fastcall GetVisibleColCount(void);
int __fastcall GetVisibleRowCount(void);
bool __fastcall IsActiveControl(void);
void __fastcall SetBorderStyle(Forms::TBorderStyle Value);
int __fastcall GetCol(void);
void __fastcall SetCol(int Value);
void __fastcall SetColCount(int Value);
int __fastcall GetColWidths(int Index);
void __fastcall SetColWidths(int Index, int Value);
int __fastcall GetmmColWidths(int Index);
void __fastcall SetmmColWidths(int Index, int Value);
void __fastcall SetFixedColor(Graphics::TColor Value);
int __fastcall GetLeftCol(void);
void __fastcall SetLeftCol(int Value);
int __fastcall GetRow(void);
void __fastcall SetRow(int Value);
void __fastcall SetRowCount(int Value);
void __fastcall SetSelection(const Types::TRect &Value);
int __fastcall GetTopRow(void);
void __fastcall SetTopRow(int Value);
System::_di_IInterface __fastcall GetComAdapter();
MESSAGE void __fastcall CMCancelMode(Messages::TMessage &Msg);
HIDESBASE MESSAGE void __fastcall CMFontChanged(Messages::TMessage &Message);
HIDESBASE MESSAGE void __fastcall CMCtl3DChanged(Messages::TMessage &Message);
HIDESBASE MESSAGE void __fastcall CMDesignHitTest(Messages::TWMMouse &Msg);
MESSAGE void __fastcall CMWantSpecialKey(Messages::TWMKey &Msg);
HIDESBASE MESSAGE void __fastcall CMShowingChanged(Messages::TMessage &Message);
HIDESBASE MESSAGE void __fastcall WMChar(Messages::TWMKey &Msg);
HIDESBASE MESSAGE void __fastcall WMCancelMode(Messages::TWMNoParams &Msg);
HIDESBASE MESSAGE void __fastcall WMCommand(Messages::TWMCommand &Message);
HIDESBASE MESSAGE void __fastcall WMEraseBkGnd(Messages::TWMCommand &Message);
MESSAGE void __fastcall WMGetDlgCode(Messages::TWMNoParams &Msg);
HIDESBASE MESSAGE void __fastcall WMHScroll(Messages::TWMScroll &Msg);
HIDESBASE MESSAGE void __fastcall WMVScroll(Messages::TWMScroll &Msg);
HIDESBASE MESSAGE void __fastcall WMKillFocus(Messages::TWMKillFocus &Msg);
HIDESBASE MESSAGE void __fastcall WMLButtonDown(Messages::TMessage &Message);
HIDESBASE MESSAGE void __fastcall WMNCHitTest(Messages::TWMNCHitTest &Msg);
HIDESBASE MESSAGE void __fastcall WMSetCursor(Messages::TWMSetCursor &Msg);
HIDESBASE MESSAGE void __fastcall WMSetFocus(Messages::TWMSetFocus &Msg);
HIDESBASE MESSAGE void __fastcall WMSize(Messages::TWMSize &Msg);
MESSAGE void __fastcall WMTimer(Messages::TWMTimer &Msg);
void __fastcall TrackButton(int X, int Y);
int __fastcall GetDefaultColWidth(void);
void __fastcall SetDefaultColWidth(int Value);
int __fastcall GetDefaultRowHeight(void);
void __fastcall SetDefaultRowHeight(int Value);
void __fastcall ColCountChange(int Value);
void __fastcall RowCountChange(int Value);
void __fastcall SetClipRect(Graphics::TCanvas* ACanvas, const Types::TRect &ClipR);
void __fastcall RestoreClipRect(Graphics::TCanvas* ACanvas);
bool __fastcall CellInMerge(int ACol, int ARow);
TRMCellInfo* __fastcall GetCell(int ACol, int ARow);
Types::TRect __fastcall GetMerges(int ACol, int ARow);
void __fastcall InitCell(TRMGridEx* AGrid, TRMCellInfo* ACell, int ACol, int ARow);
void __fastcall SetParentReport(Rm_class::TRMReport* Value);
void __fastcall RestoreCells(const Types::TRect &aDestRestoreRect);
void __fastcall ReadCellFromBuffer(TRMCellInfo* aCell, Classes::TStream* aStream, int aXOffset, int aYOffset);
void __fastcall WriteCellToBuffer(TRMCellInfo* aCell, Classes::TStream* aStream);
protected:
TRMGridState FGridState;
bool FSaveCellExtents;
bool VirtualView;
bool RightClickRowHeader;
bool RightClickColHeader;
System::_di_IInterface FComAdapter;
int FCurrentCol;
int FCurrentRow;
virtual void __fastcall CreateParams(Controls::TCreateParams &Params);
DYNAMIC void __fastcall KeyDown(Word &Key, Classes::TShiftState Shift);
DYNAMIC void __fastcall KeyUp(Word &Key, Classes::TShiftState Shift);
DYNAMIC void __fastcall KeyPress(char &Key);
DYNAMIC void __fastcall MouseDown(Controls::TMouseButton Button, Classes::TShiftState Shift, int X, int Y);
DYNAMIC void __fastcall MouseMove(Classes::TShiftState Shift, int X, int Y);
DYNAMIC void __fastcall MouseUp(Controls::TMouseButton Button, Classes::TShiftState Shift, int X, int Y);
Types::TRect __fastcall CellRect(int ACol, int ARow);
DYNAMIC bool __fastcall DoMouseWheelDown(Classes::TShiftState Shift, const Types::TPoint &MousePos);
DYNAMIC bool __fastcall DoMouseWheelUp(Classes::TShiftState Shift, const Types::TPoint &MousePos);
void __fastcall CalcDrawInfo(TRMGridDrawInfo &DrawInfo);
void __fastcall CalcFixedInfo(TRMGridDrawInfo &DrawInfo);
virtual void __fastcall CalcSizingState(int X, int Y, TRMGridState &State, int &Index, int &SizingPos, int &SizingOfs, TRMGridDrawInfo &FixedInfo);
int __fastcall GetGridWidth(void);
int __fastcall GetGridHeight(void);
void __fastcall DrawCell(int ACol, int ARow, const Types::TRect &ARect, const Types::TRect &AClipRect, TRMGridDrawState AState);
void __fastcall MoveColRow(int ACol, int ARow, bool MoveAnchor, bool Show);
virtual bool __fastcall SelectCell(int ACol, int ARow);
DYNAMIC void __fastcall SizeChanged(int OldColCount, int OldRowCount);
bool __fastcall Sizing(int X, int Y);
void __fastcall ScrollData(int DX, int DY);
void __fastcall InvalidateCol(int ACol);
void __fastcall InvalidateRow(int ARow);
DYNAMIC void __fastcall TopLeftChanged(void);
DYNAMIC void __fastcall TimedScroll(TRMGridScrollDirection Direction);
virtual void __fastcall Paint(void);
DYNAMIC void __fastcall ColWidthsChanged(void);
DYNAMIC void __fastcall RowHeightsChanged(void);
void __fastcall DisableEditUpdate(void);
void __fastcall EnableEditUpdate(void);
void __fastcall SetEditText(int ACol, int ARow, AnsiString Value);
TRMInplaceEdit* __fastcall CreateEditor(void);
void __fastcall InvalidateEditor(void);
void __fastcall HideEdit(void);
void __fastcall HideEditor(void);
void __fastcall ShowEditor(void);
void __fastcall UpdateText(void);
void __fastcall UpdateEdit(void);
void __fastcall ShowEditorChar(char Ch);
HIDESBASEDYNAMIC void __fastcall AdjustSize(int Index, int Amount, bool Rows);
Types::TRect __fastcall BoxRect(int ALeft, int ATop, int ARight, int ABottom);
DYNAMIC void __fastcall DoExit(void);
DYNAMIC bool __fastcall CanEditAcceptKey(char Key);
DYNAMIC bool __fastcall CanGridAcceptKey(Word Key, Classes::TShiftState Shift);
DYNAMIC bool __fastcall CanEditModify(void);
virtual bool __fastcall CanEditShow(void);
void __fastcall CopyCellsToBuffer(const Types::TRect &aRect, Classes::TStream* aStream);
void __fastcall PasteCellsFromBuffer(const Types::TRect &aRect, Classes::TStream* aStream);
void __fastcall GetClipBoardInfo(Classes::TStream* aStream, Types::TPoint &aStartCell, Types::TPoint &aSize);
bool __fastcall CanPasteToRect(const Types::TRect &aDestRect);
bool __fastcall MergeRectIntersects(const Types::TRect &aDestRect);
Types::TRect __fastcall CalcMaxRange(const Types::TRect &aDestRect);
__property int GridHeight = {read=GetGridHeight, nodefault};
__property int GridWidth = {read=GetGridWidth, nodefault};
__property Types::TPoint HitTest = {read=FHitTest};
__property int LeftCol = {read=GetLeftCol, write=SetLeftCol, nodefault};
__property int TopRow = {read=GetTopRow, write=SetTopRow, nodefault};
__property ParentColor = {default=0};
__property int VisibleColCount = {read=GetVisibleColCount, nodefault};
__property int VisibleRowCount = {read=GetVisibleRowCount, nodefault};
__property bool InLoadSaveMode = {read=FInLoadSaveMode, write=FInLoadSaveMode, nodefault};
public:
__fastcall virtual TRMGridEx(Classes::TComponent* AOwner);
__fastcall virtual ~TRMGridEx(void);
virtual void __fastcall Assign(Classes::TPersistent* Source);
void __fastcall CreateViewsName(void);
TRMCellInfo* __fastcall GetCellInfo(int ACol, int Arow);
void __fastcall InvalidateGrid(void);
void __fastcall InvalidateRect(const Types::TRect &ARect);
void __fastcall InvalidateCell(int ACol, int ARow);
Types::TPoint __fastcall MouseCoord(int X, int Y);
void __fastcall MergeCell(int aFirstCol, int aFirstRow, int aEndCol, int aEndRow);
void __fastcall MergeSelection(void);
void __fastcall SplitCell(int aFirstCol, int aFirstRow, int aEndCol, int aEndRow);
void __fastcall MouseToCell(int X, int Y, int &ACol, int &ARow);
Types::TRect __fastcall GetCellRect(TRMCellInfo* ACell);
void __fastcall FreeEditor(void);
void __fastcall InsertColumn(int aCol, bool aCreateName);
void __fastcall InsertRow(int aRow, bool aCreateName);
virtual void __fastcall DeleteColumn(int aCol, bool aRefresh);
virtual void __fastcall DeleteRow(int ARow, bool aRefresh);
void __fastcall InsertCellRight(const Types::TRect &aInsertRect);
void __fastcall InsertCellDown(const Types::TRect &aInsertRect);
void __fastcall DeleteCellRight(const Types::TRect &aDeleteRect);
void __fastcall DeleteCellDown(const Types::TRect &aDeleteRect);
void __fastcall CopyCells(const Types::TRect &aDestCopyRect);
void __fastcall CutCells(const Types::TRect &aDestCutRect);
void __fastcall PasteCells(const Types::TPoint &aDestPasteCoord);
bool __fastcall CanCut(void);
bool __fastcall CanCopy(void);
bool __fastcall CanPaste(void);
void __fastcall LoadFromFile(AnsiString aFileName);
void __fastcall SaveToFile(AnsiString aFileName);
void __fastcall LoadFromStream(Classes::TStream* aStream);
void __fastcall SaveToStream(Classes::TStream* aStream);
__property TRMInplaceEdit* InplaceEditor = {read=FInplaceEdit};
__property bool AutoCreateName = {read=FAutoCreateName, write=FAutoCreateName, nodefault};
__property bool HeaderClick = {read=FHeaderClick, write=FHeaderClick, nodefault};
__property Types::TRect Selection = {read=GetSelection, write=SetSelection};
__property TRMCellInfo* Cells[int ACol][int ARow] = {read=GetCell};
__property Types::TRect Merges[int ACol][int ARow] = {read=GetMerges};
__property int ColWidths[int Index] = {read=GetColWidths, write=SetColWidths};
__property int mmColWidths[int Index] = {read=GetmmColWidths, write=SetmmColWidths};
__property int RowHeights[int Index] = {read=GetRowHeights, write=SetRowHeights};
__property int mmRowHeights[int Index] = {read=GetmmRowHeights, write=SetmmRowHeights};
__property int Col = {read=GetCol, write=SetCol, nodefault};
__property int Row = {read=GetRow, write=SetRow, nodefault};
__property bool AutoDraw = {read=FAutoDraw, write=FAutoDraw, nodefault};
__property bool DrawPicture = {read=FDrawPicture, write=FDrawPicture, nodefault};
__property Rm_class::TRMReport* ParentReport = {read=FParentReport, write=SetParentReport};
__property Rm_class::TRMReportPage* ParentPage = {read=FParentPage, write=FParentPage};
__property Stdctrls::TScrollStyle ScrollBars = {read=FScrollBars, write=FScrollBars, nodefault};
__property Forms::TBorderStyle BorderStyle = {read=FBorderStyle, write=SetBorderStyle, default=1};
__property TRMAfterInsertRowEvent OnAfterInsertRow = {read=FOnAfterInsertRow, write=FOnAfterInsertRow};
__property TRMAfterDeleteRowEvent OnAfterDeleteRow = {read=FOnAfterDeleteRow, write=FOnAfterDeleteRow};
__property TRMAfterChangeRowCountEvent OnAfterChangeRowCount = {read=FOnAfterChangeRowCount, write=FOnAfterChangeRowCount};
__property Classes::TNotifyEvent OnBeginSizingCell = {read=FOnBeginSizingCell, write=FOnBeginSizingCell};
__property TRMBeforeChangeCellEvent OnBeforeChangeCell = {read=FOnBeforeChangeCell, write=FOnBeforeChangeCell};
__property TRMDropDownFieldEvent OnDropDownField = {read=FOnDropDownField, write=FOnDropDownField};
__property TRMDropDownFieldClickEvent OnDropDownFieldClick = {read=FOnDropDownFieldClick, write=FOnDropDownFieldClick};
__property int CurrentCol = {read=FCurrentCol, write=FCurrentCol, nodefault};
__property int CurrentRow = {read=FCurrentRow, write=FCurrentRow, nodefault};
__property System::_di_IInterface ComAdapter = {read=GetComAdapter, write=FComAdapter};
__published:
__property int FixedCols = {read=FFixedCols, write=FFixedCols, nodefault};
__property int FixedRows = {read=FFixedRows, write=FFixedRows, nodefault};
__property int ColCount = {read=FColCount, write=SetColCount, nodefault};
__property int RowCount = {read=FRowCount, write=SetRowCount, nodefault};
__property bool DefaultDrawing = {read=FDefaultDrawing, nodefault};
__property TRMGridOptions Options = {read=FOptions, nodefault};
__property int DefaultColWidth = {read=GetDefaultColWidth, write=SetDefaultColWidth, nodefault};
__property int DefaultRowHeight = {read=GetDefaultRowHeight, write=SetDefaultRowHeight, nodefault};
__property Graphics::TColor FixedColor = {read=FFixedColor, write=SetFixedColor, nodefault};
__property Color = {default=-16777211};
__property TabStop = {default=1};
__property PopupMenu ;
__property Font ;
__property TRMSelectCellEvent OnSelectCell = {read=FOnSelectCell, write=FOnSelectCell};
__property Classes::TNotifyEvent OnChange = {read=FOnChange, write=FOnChange};
__property TRMFRowHeaderClickEvent OnRowHeaderClick = {read=FOnRowHeaderClick, write=FOnRowHeaderClick};
__property Classes::TNotifyEvent OnRowHeaderDblClick = {read=FOnRowHeaderDblClick, write=FOnRowHeaderDblClick};
__property OnClick ;
__property OnDblClick ;
__property OnDragDrop ;
__property OnDragOver ;
__property OnKeyDown ;
__property OnKeyPress ;
__property OnKeyUp ;
__property OnEnter ;
public:
#pragma option push -w-inl
/* TWinControl.CreateParented */ inline __fastcall TRMGridEx(HWND ParentWindow) : Controls::TCustomControl(ParentWindow) { }
#pragma option pop
};
//-- var, const, procedure ---------------------------------------------------
static const int MaxCustomExtents = 0x7ffffff;
static const Shortint MaxShortInt = 127;
extern PACKAGE Word CF_RMGridCopyFormat;
} /* namespace Rm_grid */
using namespace Rm_grid;
#pragma pack(pop)
#pragma option pop
#pragma delphiheader end.
//-- end unit ----------------------------------------------------------------
#endif // Rm_grid
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -