Converter: Make replacement function names grey when their category is not used.

git-svn-id: trunk@26756 -
This commit is contained in:
juha 2010-07-20 23:01:32 +00:00
parent 29c1791a5a
commit dacfafbe65
2 changed files with 25 additions and 0 deletions

View File

@ -62,6 +62,7 @@ object ReplaceFuncsForm: TReplaceFuncsForm
PopupMenu = PopupMenu1
RowCount = 2
TabOrder = 1
OnDrawCell = GridDrawCell
ColWidths = (
100
150
@ -82,7 +83,9 @@ object ReplaceFuncsForm: TReplaceFuncsForm
Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Top = 5
ItemHeight = 0
OnClickCheck = CategoryListBoxClickCheck
TabOrder = 2
TopIndex = -1
end
object Splitter1: TSplitter
Left = 157

View File

@ -78,10 +78,13 @@ type
CategoriesLabel: TLabel;
PopupMenu1: TPopupMenu;
Splitter1: TSplitter;
procedure CategoryListBoxClickCheck(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure PopupMenu1Popup(Sender: TObject);
procedure InsertRow1Click(Sender: TObject);
procedure DeleteRow1Click(Sender: TObject);
procedure GridDrawCell(Sender: TObject; aCol, aRow: Integer; aRect: TRect;
aState: TGridDrawState);
procedure GridEditingDone(Sender: TObject);
procedure GridSetEditText(Sender: TObject; ACol, ARow: Integer; const Value: string);
procedure OKButtonClick(Sender: TObject);
@ -360,6 +363,11 @@ begin
IsLasRow:=false;
end;
procedure TReplaceFuncsForm.CategoryListBoxClickCheck(Sender: TObject);
begin
Grid.Invalidate; // Update;
end;
procedure TReplaceFuncsForm.PopupMenu1Popup(Sender: TObject);
var
ControlCoord, NewCell: TPoint;
@ -380,6 +388,20 @@ begin
Grid.DeleteColRow(False, Grid.Row);
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
// using OnSetEditText and OnEditingDone handlers and IsLasRow flag.
procedure TReplaceFuncsForm.GridEditingDone(Sender: TObject);