Suggestion : When double click on database name, then make it as the only visilble one

egodoyc's profile image egodoyc posted 10 years ago in Feature discussion Permalink
This has been useful for me and I think that may be, could be useful for someone else.

I Know the double click event has already been assigned to copy the the database/table name to the query editor, but what happens if the query editor is not focused?

May be we could use it to do more o less something like this :

procedure TMainForm.DBtreeDblClick(Sender: TObject);
var
DBObj: PDBObject;
m: TSynMemo;
s:String;
begin
DBObj := DBtree.GetNodeData(DBtree.FocusedNode) ;

// Paste DB or table name into query window on treeview double click.
if QueryTabActive and Assigned(DBtree.FocusedNode) then
begin

if DBObj.NodeType in [lntDb, lntTable..lntEvent] then begin
m := ActiveQueryMemo;
m.DragDrop(Sender, m.CaretX, m.CaretY);
end;
end
else
begin

// If query window is not active and DB is double clicked,
// then this will filter the database as the only one visible at DBTree

if DBObj.NodeType in [lntDb] then
begin
s:= DBObj.Database;
editDatabaseFilter.Text := s;
editDatabaseFilter.OnChange(Sender);
end;
end;

end;

Please login to leave a reply, or register at first.