mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-02 15:42:08 +02:00
IDE: mode matrix: target editing
git-svn-id: trunk@41316 -
This commit is contained in:
parent
00bd2e9ee9
commit
52766063ca
@ -19,7 +19,6 @@
|
|||||||
***************************************************************************
|
***************************************************************************
|
||||||
|
|
||||||
ToDo:
|
ToDo:
|
||||||
- click on target value: edit mode
|
|
||||||
- show ide macro errors in hint
|
- show ide macro errors in hint
|
||||||
- mark target errors red
|
- mark target errors red
|
||||||
- show target errors in hint
|
- show target errors in hint
|
||||||
|
@ -44,6 +44,7 @@ type
|
|||||||
|
|
||||||
TGroupedMatrixRow = class(TPersistent)
|
TGroupedMatrixRow = class(TPersistent)
|
||||||
private
|
private
|
||||||
|
FLastDrawValueX: integer;
|
||||||
FMatrix: TGroupedMatrix;
|
FMatrix: TGroupedMatrix;
|
||||||
FGroup: TGroupedMatrixGroup;
|
FGroup: TGroupedMatrixGroup;
|
||||||
FRowInGrid: integer;
|
FRowInGrid: integer;
|
||||||
@ -58,6 +59,7 @@ type
|
|||||||
property Group: TGroupedMatrixGroup read FGroup write SetGroup;
|
property Group: TGroupedMatrixGroup read FGroup write SetGroup;
|
||||||
function GetGroupIndex: integer;
|
function GetGroupIndex: integer;
|
||||||
property RowInGrid: integer read FRowInGrid; // in Grid, not in Group
|
property RowInGrid: integer read FRowInGrid; // in Grid, not in Group
|
||||||
|
property LastDrawValueX: integer read FLastDrawValueX write FLastDrawValueX;
|
||||||
function Level: integer;
|
function Level: integer;
|
||||||
function GetNextSibling: TGroupedMatrixRow;
|
function GetNextSibling: TGroupedMatrixRow;
|
||||||
function GetNext: TGroupedMatrixRow; virtual;
|
function GetNext: TGroupedMatrixRow; virtual;
|
||||||
@ -230,6 +232,7 @@ type
|
|||||||
procedure AutoLayout; virtual;
|
procedure AutoLayout; virtual;
|
||||||
procedure BeforeMoveSelection(const DCol, DRow: Integer); override;
|
procedure BeforeMoveSelection(const DCol, DRow: Integer); override;
|
||||||
procedure CreateWnd; override;
|
procedure CreateWnd; override;
|
||||||
|
procedure DoEditorShow; override;
|
||||||
procedure DrawCellGrid(aCol, aRow: Integer; aRect: TRect;
|
procedure DrawCellGrid(aCol, aRow: Integer; aRect: TRect;
|
||||||
aState: TGridDrawState); override;
|
aState: TGridDrawState); override;
|
||||||
procedure DrawIndent(aRow: integer; aRect: TRect);
|
procedure DrawIndent(aRow: integer; aRect: TRect);
|
||||||
@ -1147,9 +1150,12 @@ begin
|
|||||||
Canvas.GradientFill(Rect(x,aRect.Top-1,x+2*Indent,aRect.Bottom),GroupRow.GetEffectiveColor,Color,gdHorizontal);
|
Canvas.GradientFill(Rect(x,aRect.Top-1,x+2*Indent,aRect.Bottom),GroupRow.GetEffectiveColor,Color,gdHorizontal);
|
||||||
Canvas.FillRect(x+2*Indent,aRect.Top-1,aRect.Right,aRect.Bottom);
|
Canvas.FillRect(x+2*Indent,aRect.Top-1,aRect.Right,aRect.Bottom);
|
||||||
// draw group caption
|
// draw group caption
|
||||||
s:=GroupRow.Caption+GroupRow.Value;
|
s:=GroupRow.Caption;
|
||||||
|
if (aRow<>Row) or (not EditorMode) then
|
||||||
|
s+=GroupRow.Value;
|
||||||
h:=Canvas.TextHeight(s);
|
h:=Canvas.TextHeight(s);
|
||||||
Canvas.TextRect(aRect,constCellPadding+x,(aRect.Top+aRect.Bottom-h) div 2,s);
|
Canvas.TextRect(aRect,constCellPadding+x,(aRect.Top+aRect.Bottom-h) div 2,s);
|
||||||
|
GroupRow.LastDrawValueX:=constCellPadding+x+Canvas.TextWidth(GroupRow.Caption);
|
||||||
// draw focus rect
|
// draw focus rect
|
||||||
if aRow=Row then
|
if aRow=Row then
|
||||||
DrawFocusRect(0,aRow,Rect(x,aRect.Top,aRect.Right,aRect.Bottom));
|
DrawFocusRect(0,aRow,Rect(x,aRect.Top,aRect.Right,aRect.Bottom));
|
||||||
@ -1336,7 +1342,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
end else if MatRow is TGroupedMatrixGroup then begin
|
end else if MatRow is TGroupedMatrixGroup then begin
|
||||||
GroupRow:=TGroupedMatrixGroup(MatRow);
|
GroupRow:=TGroupedMatrixGroup(MatRow);
|
||||||
if (aCol=ValueCol) and (GroupRow.Writable) then begin
|
if GroupRow.Writable and (X>GroupRow.LastDrawValueX) then begin
|
||||||
|
Col:=ValueCol;
|
||||||
SelectEditor;
|
SelectEditor;
|
||||||
EditorShow(False);
|
EditorShow(False);
|
||||||
end;
|
end;
|
||||||
@ -1414,6 +1421,12 @@ begin
|
|||||||
inherited SetEditText(ACol, ARow, Value);
|
inherited SetEditText(ACol, ARow, Value);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TGroupedMatrixControl.DoEditorShow;
|
||||||
|
begin
|
||||||
|
inherited DoEditorShow;
|
||||||
|
InvalidateGroupedCells(Col,Row);
|
||||||
|
end;
|
||||||
|
|
||||||
function TGroupedMatrixControl.GetCells(ACol, ARow: Integer): string;
|
function TGroupedMatrixControl.GetCells(ACol, ARow: Integer): string;
|
||||||
var
|
var
|
||||||
MatRow: TGroupedMatrixRow;
|
MatRow: TGroupedMatrixRow;
|
||||||
|
Loading…
Reference in New Issue
Block a user