Display column name in title bar of popup text editor. Closes #395.

This commit is contained in:
Ansgar Becker
2018-11-28 20:58:51 +01:00
parent 32ebea38a1
commit 6d4d4e0d97
2 changed files with 11 additions and 0 deletions

View File

@@ -139,6 +139,7 @@ type
procedure ButtonClick(Sender: TObject);
public
ButtonVisible: Boolean;
TitleText: String;
constructor Create(Tree: TVirtualStringTree); override;
destructor Destroy; override;
function BeginEdit: Boolean; override;
@@ -1130,6 +1131,7 @@ begin
FTextEditor := TfrmTextEditor.Create(FTree);
FTextEditor.SetFont(FEdit.Font);
FTextEditor.SetText(FEdit.Text);
FTextEditor.SetTitleText(TitleText);
FTextEditor.Modified := FEdit.Modified;
FTextEditor.SetMaxLength(Self.FMaxLength);
FTextEditor.ShowModal;

View File

@@ -56,6 +56,7 @@ type
public
function GetText: String;
procedure SetText(text: String);
procedure SetTitleText(Title: String);
procedure SetMaxLength(len: integer);
procedure SetFont(font: TFont);
property Modified: Boolean read FModified write SetModified;
@@ -108,6 +109,14 @@ begin
end;
procedure TfrmTextEditor.SetTitleText(Title: String);
begin
// Add column name to window title bar
if Title <> '' then
Caption := Title + ' - ' + Caption;
end;
procedure TfrmTextEditor.SelectLinebreaks(Sender: TObject);
var
Selected, Item: TMenuItem;