mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-26 11:17:57 +08:00
When dragging a table into a query editor while Shift is pressed, include its database name. Fixes issue #1749 . Fixes issue #1661.
This commit is contained in:
@ -247,6 +247,7 @@ type
|
||||
function CheckForSecondInstance: Boolean;
|
||||
function GetParentFormOrFrame(Comp: TWinControl): TWinControl;
|
||||
function GetIndexIcon(IndexType: String): Integer;
|
||||
function KeyPressed(Code: Integer): Boolean;
|
||||
|
||||
var
|
||||
MainReg: TRegistry;
|
||||
@ -3404,6 +3405,16 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
function KeyPressed(Code: Integer): Boolean;
|
||||
var
|
||||
State: TKeyboardState;
|
||||
begin
|
||||
// Checks whether a key is pressed, defined by virtual key code
|
||||
GetKeyboardState(State);
|
||||
Result := (State[Code] and 128) <> 0;
|
||||
end;
|
||||
|
||||
|
||||
end.
|
||||
|
||||
|
||||
|
@ -4725,9 +4725,12 @@ begin
|
||||
LoadText := True;
|
||||
// Check for allowed controls as source has already
|
||||
// been performed in OnDragOver. So, only do typecasting here.
|
||||
if src = DBtree then
|
||||
Text := mask(DBtree.Text[DBtree.FocusedNode, 0])
|
||||
else if (src = ActiveQueryHelpers) and (ActiveQueryHelpers.ItemIndex > -1) then begin
|
||||
if src = DBtree then begin
|
||||
// Insert table or database name. If a table is dropped and Shift is pressed, prepend the db name.
|
||||
Text := mask(DBtree.Text[DBtree.FocusedNode, 0]);
|
||||
if (DBtree.GetNodeLevel(DBtree.FocusedNode)=2) and KeyPressed(VK_SHIFT) then
|
||||
Text := mask(DBtree.Text[DBtree.FocusedNode.Parent, 0]) + '.' + Text;
|
||||
end else if (src = ActiveQueryHelpers) and (ActiveQueryHelpers.ItemIndex > -1) then begin
|
||||
// Snippets tab
|
||||
if tabsetQueryHelpers.TabIndex = 3 then begin
|
||||
QueryLoad( DirnameSnippets + ActiveQueryHelpers.Items[ActiveQueryHelpers.ItemIndex] + '.sql', False );
|
||||
|
Reference in New Issue
Block a user