mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-26 14:40:29 +02:00
Converter: Make replacement function names grey when their category is not used.
git-svn-id: trunk@26756 -
This commit is contained in:
parent
29c1791a5a
commit
dacfafbe65
@ -62,6 +62,7 @@ object ReplaceFuncsForm: TReplaceFuncsForm
|
|||||||
PopupMenu = PopupMenu1
|
PopupMenu = PopupMenu1
|
||||||
RowCount = 2
|
RowCount = 2
|
||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
|
OnDrawCell = GridDrawCell
|
||||||
ColWidths = (
|
ColWidths = (
|
||||||
100
|
100
|
||||||
150
|
150
|
||||||
@ -82,7 +83,9 @@ object ReplaceFuncsForm: TReplaceFuncsForm
|
|||||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||||
BorderSpacing.Top = 5
|
BorderSpacing.Top = 5
|
||||||
ItemHeight = 0
|
ItemHeight = 0
|
||||||
|
OnClickCheck = CategoryListBoxClickCheck
|
||||||
TabOrder = 2
|
TabOrder = 2
|
||||||
|
TopIndex = -1
|
||||||
end
|
end
|
||||||
object Splitter1: TSplitter
|
object Splitter1: TSplitter
|
||||||
Left = 157
|
Left = 157
|
||||||
|
@ -78,10 +78,13 @@ type
|
|||||||
CategoriesLabel: TLabel;
|
CategoriesLabel: TLabel;
|
||||||
PopupMenu1: TPopupMenu;
|
PopupMenu1: TPopupMenu;
|
||||||
Splitter1: TSplitter;
|
Splitter1: TSplitter;
|
||||||
|
procedure CategoryListBoxClickCheck(Sender: TObject);
|
||||||
procedure FormCreate(Sender: TObject);
|
procedure FormCreate(Sender: TObject);
|
||||||
procedure PopupMenu1Popup(Sender: TObject);
|
procedure PopupMenu1Popup(Sender: TObject);
|
||||||
procedure InsertRow1Click(Sender: TObject);
|
procedure InsertRow1Click(Sender: TObject);
|
||||||
procedure DeleteRow1Click(Sender: TObject);
|
procedure DeleteRow1Click(Sender: TObject);
|
||||||
|
procedure GridDrawCell(Sender: TObject; aCol, aRow: Integer; aRect: TRect;
|
||||||
|
aState: TGridDrawState);
|
||||||
procedure GridEditingDone(Sender: TObject);
|
procedure GridEditingDone(Sender: TObject);
|
||||||
procedure GridSetEditText(Sender: TObject; ACol, ARow: Integer; const Value: string);
|
procedure GridSetEditText(Sender: TObject; ACol, ARow: Integer; const Value: string);
|
||||||
procedure OKButtonClick(Sender: TObject);
|
procedure OKButtonClick(Sender: TObject);
|
||||||
@ -360,6 +363,11 @@ begin
|
|||||||
IsLasRow:=false;
|
IsLasRow:=false;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TReplaceFuncsForm.CategoryListBoxClickCheck(Sender: TObject);
|
||||||
|
begin
|
||||||
|
Grid.Invalidate; // Update;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TReplaceFuncsForm.PopupMenu1Popup(Sender: TObject);
|
procedure TReplaceFuncsForm.PopupMenu1Popup(Sender: TObject);
|
||||||
var
|
var
|
||||||
ControlCoord, NewCell: TPoint;
|
ControlCoord, NewCell: TPoint;
|
||||||
@ -380,6 +388,20 @@ begin
|
|||||||
Grid.DeleteColRow(False, Grid.Row);
|
Grid.DeleteColRow(False, Grid.Row);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TReplaceFuncsForm.GridDrawCell(Sender: TObject; aCol, aRow: Integer;
|
||||||
|
aRect: TRect; aState: TGridDrawState);
|
||||||
|
var
|
||||||
|
SGrid: TStringGrid;
|
||||||
|
Categ: string;
|
||||||
|
i: integer;
|
||||||
|
begin
|
||||||
|
SGrid:=Sender as TStringGrid;
|
||||||
|
Categ:=SGrid.Cells[0, aRow]; // Column 0 = category.
|
||||||
|
i:=CategoryListBox.Items.IndexOf(Categ);
|
||||||
|
if (i<>-1) and not CategoryListBox.Checked[i] then
|
||||||
|
SGrid.Canvas.Font.Color:= clGrayText;
|
||||||
|
end;
|
||||||
|
|
||||||
// Add rows automatically to the end of the grid
|
// Add rows automatically to the end of the grid
|
||||||
// using OnSetEditText and OnEditingDone handlers and IsLasRow flag.
|
// using OnSetEditText and OnEditingDone handlers and IsLasRow flag.
|
||||||
procedure TReplaceFuncsForm.GridEditingDone(Sender: TObject);
|
procedure TReplaceFuncsForm.GridEditingDone(Sender: TObject);
|
||||||
|
Loading…
Reference in New Issue
Block a user