|
@@ -139,6 +139,7 @@ type
|
|
|
FDropDownArrow: boolean;
|
|
FDropDownArrow: boolean;
|
|
|
FDropDownMenu: TPopupMenu;
|
|
FDropDownMenu: TPopupMenu;
|
|
|
FDropDownMenuVisible: boolean;
|
|
FDropDownMenuVisible: boolean;
|
|
|
|
|
+ FDropDownClosingTime: TDateTime;
|
|
|
FDropDownPosition: TBCButtonDropDownPosition;
|
|
FDropDownPosition: TBCButtonDropDownPosition;
|
|
|
FDropDownStyle: TBCButtonDropDownStyle;
|
|
FDropDownStyle: TBCButtonDropDownStyle;
|
|
|
FImageChangeLink: TChangeLink;
|
|
FImageChangeLink: TChangeLink;
|
|
@@ -387,6 +388,9 @@ implementation
|
|
|
|
|
|
|
|
uses {$IFDEF FPC}LCLIntf, PropEdits, GraphPropEdits, LCLProc, {$ENDIF}Math, BCTools, SysUtils;
|
|
uses {$IFDEF FPC}LCLIntf, PropEdits, GraphPropEdits, LCLProc, {$ENDIF}Math, BCTools, SysUtils;
|
|
|
|
|
|
|
|
|
|
+const
|
|
|
|
|
+ DropDownReopenDelay = 0.2/(24*60*60);
|
|
|
|
|
+
|
|
|
{$IFDEF FPC}//#
|
|
{$IFDEF FPC}//#
|
|
|
type
|
|
type
|
|
|
TBCButtonImageIndexPropertyEditor = class(TImageIndexPropertyEditor)
|
|
TBCButtonImageIndexPropertyEditor = class(TImageIndexPropertyEditor)
|
|
@@ -1196,8 +1200,9 @@ begin
|
|
|
if Assigned(FDropDownMenu) then
|
|
if Assigned(FDropDownMenu) then
|
|
|
FDropDownMenu.OnClose := FSaveDropDownClosed;
|
|
FDropDownMenu.OnClose := FSaveDropDownClosed;
|
|
|
{$ENDIF}
|
|
{$ENDIF}
|
|
|
- // MORA: DropDownMenu is still visible if mouse is over control
|
|
|
|
|
- FDropDownMenuVisible := {$IFNDEF FPC}BGRAGraphics.{$ENDIF}PtInRect(ClientRect, ScreenToClient(Mouse.CursorPos));
|
|
|
|
|
|
|
+
|
|
|
|
|
+ FDropDownMenuVisible := False;
|
|
|
|
|
+ FDropDownClosingTime := Now;
|
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
procedure TCustomBCButton.MouseDown(Button: TMouseButton; Shift: TShiftState;
|
|
procedure TCustomBCButton.MouseDown(Button: TMouseButton; Shift: TShiftState;
|
|
@@ -1238,7 +1243,7 @@ begin
|
|
|
Invalidate;}
|
|
Invalidate;}
|
|
|
|
|
|
|
|
// MORA: Show DropDown menu
|
|
// MORA: Show DropDown menu
|
|
|
- if FDropDownMenuVisible then
|
|
|
|
|
|
|
+ if FDropDownMenuVisible or (Now < FDropDownClosingTime+DropDownReopenDelay) then
|
|
|
FDropDownMenuVisible := False // Prevent redropping
|
|
FDropDownMenuVisible := False // Prevent redropping
|
|
|
else
|
|
else
|
|
|
if ((FActiveButt = bbtDropDown) or (FStyle = bbtButton)) and
|
|
if ((FActiveButt = bbtDropDown) or (FStyle = bbtButton)) and
|