VirtualTree's internal text edit link has the bad habit of passing keyboard actions to its parent tree. Use our own editor instead which doesn't do that. Fixes issue #1297.

This commit is contained in:
Ansgar Becker
2009-08-17 17:42:42 +00:00
parent 3fdad1fd9d
commit 0eb09779e0
2 changed files with 12 additions and 1 deletions

View File

@ -104,6 +104,7 @@ object connform: Tconnform
TreeOptions.MiscOptions = [toAcceptOLEDrop, toEditable, toFullRepaintOnResize, toInitOnSave, toToggleOnDblClick, toWheelPanning, toEditOnClick]
TreeOptions.PaintOptions = [toHotTrack, toShowButtons, toShowDropmark, toThemeAware, toUseBlendedImages, toUseExplorerTheme, toHideTreeLinesIfThemed]
TreeOptions.SelectionOptions = [toFullRowSelect, toRightClickSelect]
OnCreateEditor = ListSessionsCreateEditor
OnDblClick = btnOpenClick
OnFocusChanged = ListSessionsFocusChanged
OnFocusChanging = ListSessionsFocusChanging

View File

@ -76,6 +76,8 @@ type
procedure FormDestroy(Sender: TObject);
procedure TimerStatisticsTimer(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure ListSessionsCreateEditor(Sender: TBaseVirtualTree; Node: PVirtualNode; Column: TColumnIndex;
out EditLink: IVTEditLink);
private
{ Private declarations }
FLoaded: Boolean;
@ -96,7 +98,7 @@ type
implementation
uses Main, helpers, MysqlQueryThread;
uses Main, helpers, MysqlQueryThread, grideditlinks;
{$I const.inc}
@ -339,6 +341,14 @@ begin
end;
procedure Tconnform.ListSessionsCreateEditor(Sender: TBaseVirtualTree; Node: PVirtualNode;
Column: TColumnIndex; out EditLink: IVTEditLink);
begin
// Use our own text editor to rename a session
EditLink := TInplaceEditorLink.Create(Sender as TVirtualStringTree);
end;
procedure Tconnform.ListSessionsFocusChanged(Sender: TBaseVirtualTree;
Node: PVirtualNode; Column: TColumnIndex);
var