From: Peter T. <pe...@us...> - 2005-01-03 13:07:32
|
Update of /cvsroot/jvcl/dev/JVCL3/run In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11825/run Modified Files: JvButton.pas JvDesktopAlertForm.pas Log Message: - Suspend form while menu is displayed - OnDropDownClose event for DropDownMenu Index: JvDesktopAlertForm.pas =================================================================== RCS file: /cvsroot/jvcl/dev/JVCL3/run/JvDesktopAlertForm.pas,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** JvDesktopAlertForm.pas 26 Dec 2004 14:16:27 -0000 1.27 --- JvDesktopAlertForm.pas 3 Jan 2005 13:07:12 -0000 1.28 *************** *** 85,89 **** acClose: TAction; MouseTimer: TTimer; ! {$IFDEF VCL} procedure WMNCHitTest(var Msg: TWMNCHitTest); message WM_NCHITTEST; --- 85,89 ---- acClose: TAction; MouseTimer: TTimer; ! FEndInterval:Cardinal; {$IFDEF VCL} procedure WMNCHitTest(var Msg: TWMNCHitTest); message WM_NCHITTEST; *************** *** 99,102 **** --- 99,105 ---- procedure MouseEnter(AControl: TControl); override; procedure MouseLeave(AControl: TControl); override; + procedure DoDropDownClose(Sender:TObject); + procedure DoDropDownMenu(Sender:TObject; MousePos:TPoint; var Handled:Boolean); + public *************** *** 270,273 **** --- 273,278 ---- tbDropDown.Left := tbDropDown.Left - 16; tbDropDown.Anchors := [akRight, akTop]; + tbDropDown.OnDropDownMenu := DoDropDownMenu; + tbDropDown.OnDropDownClose := DoDropDownClose; end; *************** *** 670,673 **** --- 675,696 ---- end; + procedure TJvFormDesktopAlert.DoDropDownClose(Sender: TObject); + begin + // restore previous EndInterval value + if FEndInterval <> 0 then + TJvDeskTopAlert(Owner).StyleHandler.EndInterval := FEndInterval; + FEndInterval := 0; + if not MouseInControl then + TJvDeskTopAlert(Owner).StyleHandler.DoEndAnimation; + end; + + procedure TJvFormDesktopAlert.DoDropDownMenu(Sender: TObject; + MousePos: TPoint; var Handled: Boolean); + begin + // suspend the form while the menu is visible + FEndInterval := TJvDeskTopAlert(Owner).StyleHandler.EndInterval; + TJvDeskTopAlert(Owner).StyleHandler.EndInterval := 0; + end; + {$IFDEF UNITVERSIONING} const Index: JvButton.pas =================================================================== RCS file: /cvsroot/jvcl/dev/JVCL3/run/JvButton.pas,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** JvButton.pas 18 Dec 2004 12:07:26 -0000 1.53 --- JvButton.pas 3 Jan 2005 13:07:11 -0000 1.54 *************** *** 56,59 **** --- 56,60 ---- FOnDropDownMenu: TContextPopupEvent; FDropArrow: boolean; + FOnDropDownClose: TNotifyEvent; function GetPattern: TBitmap; procedure SetFlat(const Value: Boolean); *************** *** 76,79 **** --- 77,81 ---- procedure ForceSize(Sender: TControl; AWidth, AHeight: Integer); function DoDropDownMenu(Button: TMouseButton; Shift: TShiftState; X, Y: Integer): Boolean; virtual; + procedure DropDownClose; procedure UpdateExclusive; procedure Notification(AComponent: TComponent; Operation: TOperation); override; *************** *** 109,115 **** property DropDownMenu: TPopupMenu read FDropDownMenu write SetDropDownMenu; property DropArrow: boolean read FDropArrow write SetDropArrow default False; - procedure Click; override; property OnDropDownMenu: TContextPopupEvent read FOnDropDownMenu write FOnDropDownMenu; public procedure SetBounds(ALeft, ATop, AWidth, AHeight: Integer); override; --- 111,118 ---- property DropDownMenu: TPopupMenu read FDropDownMenu write SetDropDownMenu; property DropArrow: boolean read FDropArrow write SetDropArrow default False; property OnDropDownMenu: TContextPopupEvent read FOnDropDownMenu write FOnDropDownMenu; + property OnDropDownClose:TNotifyEvent read FOnDropDownClose write FOnDropDownClose; public + procedure Click; override; procedure SetBounds(ALeft, ATop, AWidth, AHeight: Integer); override; *************** *** 434,437 **** --- 437,441 ---- { release button } MouseUp(Button, Shift, X, Y); + DropDownClose; end; end; *************** *** 962,965 **** --- 966,975 ---- {$ENDIF UNITVERSIONING} + procedure TJvCustomGraphicButton.DropDownClose; + begin + if Assigned(FOnDropDownClose) then + FOnDropDownClose(Self); + end; + initialization {$IFDEF UNITVERSIONING} |