Issue #75: pimp up context menu for indexes tab, and assign to foreign keys tab and check constraints tab as well

This commit is contained in:
Ansgar Becker
2021-01-16 17:19:35 +01:00
parent 461c7343f8
commit e7baba4776
3 changed files with 104 additions and 17 deletions

View File

@ -372,6 +372,7 @@ type
function ProcessExists(pid: Cardinal; ExeNamePattern: String): Boolean;
procedure ToggleCheckBoxWithoutClick(chk: TCheckBox; State: Boolean);
function SynCompletionProposalPrettyText(ImageIndex: Integer; LeftText, CenterText, RightText: String; LeftColor: TColor=-1; CenterColor: TColor=-1; RightColor: TColor=-1): String;
function PopupComponent(Sender: TObject): TComponent;
var
AppSettings: TAppSettings;
@ -2892,6 +2893,21 @@ begin
end;
function PopupComponent(Sender: TObject): TComponent;
var
ParentMenu: TMenu;
begin
// Return owner component of clicked menu item
Result := nil;
if not (Sender is TMenuItem) then
Exit;
ParentMenu := (Sender as TMenuItem).GetParentMenu;
if not (ParentMenu is TPopupMenu) then
Exit;
Result := (ParentMenu as TPopupMenu).PopupComponent;
end;
{ Threading stuff }