Project JEDI - Issue Tracker
Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0004657 [JEDI VCL] 00 JVCL Components minor always 2009-01-10 03:12 2009-01-10 11:11
Reporter lomo74 View Status public  
Assigned To AHUser
Priority normal Resolution fixed  
Status resolved   Product Version 3.34
Summary 0004657: TJvTabBar.OnTabClosing breaks "close buttons" mechanism if a modal dialog is invoked
Description The 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 -
Additional Information
Tags No tags attached.
Attached Files

- Relationships

-  Notes
(0015235)
AHUser (developer)
2009-01-10 10:35

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.
(0015236)
AHUser (developer)
2009-01-10 11:11

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 03:15 lomo74 Issue Monitored: lomo74
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


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker