View Issue Details

IDProjectCategoryView StatusLast Update
0004657JEDI VCL00 JVCL Componentspublic2009-01-10 11:11
Reporterlomo74Assigned ToAHUser 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.34 
Target VersionFixed in Version3.36 
Summary0004657: TJvTabBar.OnTabClosing breaks "close buttons" mechanism if a modal dialog is invoked
DescriptionThe mechanism of "close buttons" in TJvTabBar works as follows:
(1) on MOUSEDOWN, if X,Y is inside the close button, the corresponding tab is "marked" for closing;
(2) the OnTabClosing event is fired;
(3) on MOUSEUP, if AllowClose was set true, the tab marked for closing is acctually freed.

If during phase (2) one displays a modal dialog asking the user a confirmation, the MOUSEUP message won't arrive and tab won't be closed.

No solutions for this problem right now.
I thought to manually post a WM_LBUTTONUP event to TabBar window handle just after the modal dialog, but does not work either since at the time OnTabClosing is fired, FClosingTab is still nil.
Maybe the way to go is moving all the logic in the OnMouseUp event

Regards
- Lorenzo -
TagsNo tags attached.

Activities

AHUser

2009-01-10 10:35

developer   ~0015235

This is by design. OnTabClosing is not for asking the user if he wants to close the tab. It is for blocking the little [X] in the tab from shrinking.

If you want to implement a Close-Confirmation dialog, you should set AutoFreeClosed to False and ask the user in the OnTabClose event. If the user wants to close the tab, the OnTabClose handler can safely destroy the TTabBarItem.

I will add a new event OnTabCloseQuery for this, but until I have implemented it, you can use the OnTabClose event with AutoFreeClosed=False.

AHUser

2009-01-10 11:11

developer   ~0015236

A new event OnTabCloseQuery is now available that can be used to ask the user to confirm the tab close.

Issue History

Date Modified Username Field Change
2009-01-10 03:12 lomo74 New Issue
2009-01-10 10:35 AHUser Note Added: 0015235
2009-01-10 11:11 AHUser Note Added: 0015236
2009-01-10 11:11 AHUser Status new => resolved
2009-01-10 11:11 AHUser Fixed in Version => Daily / SVN
2009-01-10 11:11 AHUser Resolution open => fixed
2009-01-10 11:11 AHUser Assigned To => AHUser