View Issue Details

IDProjectCategoryView StatusLast Update
0003043JEDI VCL00 JVCL Componentspublic2005-06-20 00:47
ReportervladorAssigned Toobones 
Status resolvedResolutionno change required 
Product Version3.00 
Target VersionFixed in Version 
Summary0003043: JvTabBar - tab won't close when using OnTabClosing event
DescriptionIf we ask user something like "Are you sure you want to close?" in the OnTabClosing event, the tab will not close no matter what user selects.
Additional InformationThis is easy to reproduce:

1. Put a JvTabBar on the form

2. Create few tabs

3. Define OnTabClosing like this:

  procedure TForm1.JvTabBar1TabClosing(...);
    AllowClose := True;
    ShowMessage('Tab will not close!');

4. Run application and try to click at tab's close button.

I tried to find a reason for this and it seems that, if some other window pops up, MouseUp message is never sent.
TagsNo tags attached.



2005-06-18 05:20

developer   ~0007480

OnTabClosing's symatic is to prevent the "close button" to be painted pressed and not to show a "can close?" dialog.

If you want a "can close?" confirmation dialog you should set TabBar.AutoFreeClosed:=False and write in the OnTabClosed event something like this:

if MessageDlg('Do you want to close the tab?', mtConfirmation, [mbYes, mbNo], 0) = mrYes then
  Item.Free; // close the button

If you use AutoFreeClosed then you are not able to show a confirmation dialog because then JvTabBar is resposible for tab closing/destroying.


2005-06-19 13:26

viewer   ~0007482

Last edited: 2005-06-19 14:07

Thanks... I didn't realize this...


2005-06-20 00:47

administrator   ~0007483

Well then, I'm considering this to be ok.

Issue History

Date Modified Username Field Change
2005-06-17 18:33 vlador New Issue
2005-06-18 05:20 AHUser Note Added: 0007480
2005-06-18 05:26 AHUser Status new => feedback
2005-06-19 13:26 anonymous Note Added: 0007482
2005-06-19 14:07 anonymous Note Edited: 0007482
2005-06-20 00:47 obones Status feedback => resolved
2005-06-20 00:47 obones Resolution open => no change required
2005-06-20 00:47 obones Assigned To => obones
2005-06-20 00:47 obones Note Added: 0007483