Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » TabCtrl » TabCtrl CancelClose No longer work (as intended) (Some recent changes (could be as old as a few years) has broken its intention)
TabCtrl CancelClose No longer work (as intended) [message #55999] Sun, 10 January 2021 19:54 Go to next message
Lance is currently offline  Lance
Messages: 526
Registered: March 2007
Contributor
I recently find that because TabCtrl::Paint calls TabCtrl::PaintTab which in turn calls IsCancelClose() etc, resulting in CancelClose gate being called at unintended times, CancelClose can no longer be use to accept user input to possibly cancel an unintended close action.

To see an example, just try to compile and run Bazzar/FileTabsExample, check the circled item and move your mouse a little bit.

index.php?t=getfile&id=6334&private=0

A few years back, I actually make use of this gate(CancelClose) to do some useful work. I am sad it's no longer working for unknown reason.

Can @mirek or @klugier possibly take some time to look into it?

Thank you!
  • Attachment: a.png
    (Size: 19.23KB, Downloaded 422 times)

[Updated on: Sun, 10 January 2021 20:05]

Report message to a moderator

Re: TabCtrl CancelClose No longer work (as intended) [message #56000 is a reply to message #55999] Sun, 10 January 2021 19:56 Go to previous messageGo to next message
Lance is currently offline  Lance
Messages: 526
Registered: March 2007
Contributor
In a reply to this post back in 2016

https://www.ultimatepp.org/forums/index.php?t=msg&th=966 7&start=0&

I and cbpporter were able to make it work. Will no longer.

[Updated on: Sun, 10 January 2021 20:00]

Report message to a moderator

Re: TabCtrl CancelClose No longer work (as intended) [message #56001 is a reply to message #56000] Sun, 10 January 2021 21:51 Go to previous messageGo to next message
Klugier is currently offline  Klugier
Messages: 1075
Registered: September 2012
Location: Poland, Kraków
Senior Contributor
Hello Lance,

I can confirm that the bug exists. What worries me is that TabBar::IsCancelClose() method that triggers CancelClose button is triggered from some strange places like MouseMove Embarassed

This functionality is important even if it is not directly used by tools like TheIDE. This is some straightforward option that should work.

I will do not have much time to fix it. Maybe Mirek would try. If you have any clues or some propositions We would be grateful for. In the long-term TabBar should find the new maintainer that will fix bugs and add new functionality.

Klugier


U++ - one framework to rule them all.
Re: TabCtrl CancelClose No longer work (as intended) [message #56002 is a reply to message #56001] Mon, 11 January 2021 00:43 Go to previous messageGo to next message
Lance is currently offline  Lance
Messages: 526
Registered: March 2007
Contributor
Thank you for the quick feedback. It appears that code for TabBar has been modified since some time in or after 2016 to allow the tab cross not to be drawn if the page should not be closed. The change satisfy intended use case (a search for uppsrc actually shows 0 ocurrence of CancelClose), but will exclude other legitimate use like in my case. The code seems to be quite complicated to touch.
Re: TabCtrl CancelClose No longer work (as intended) [message #56081 is a reply to message #56002] Fri, 22 January 2021 13:09 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Well, these are 2 different concepts. I have resolved the issue by adding ConfirmClose and ConfirmCloseAll Gates, as shown in refurbished reference/FileTabsExample.
Re: TabCtrl CancelClose No longer work (as intended) [message #56088 is a reply to message #56081] Fri, 22 January 2021 22:53 Go to previous messageGo to next message
Lance is currently offline  Lance
Messages: 526
Registered: March 2007
Contributor
Thank you, Mirek!
Re: TabCtrl CancelClose No longer work (as intended) [message #58090 is a reply to message #56081] Sat, 12 February 2022 17:13 Go to previous messageGo to next message
mdelfede is currently offline  mdelfede
Messages: 1307
Registered: September 2007
Ultimate Contributor
Hi Mirek,

I stumbled over the changes in TabBar (I'm using it in my UppCad) and I've seen that the bug exists also in CancelCloseSome Gate, which doesn't work anymore as intended, and it's useless like it is now.

I guess it should be possible to add a "ConfirmCloseSome" gate, as for ConfirmClose, and remove the CancelCloseSome one.
The usage should be like ConfirmClose, but taking a number of tabs and not a single one.

Ciao

Massimo

EDIT: I wanted to fix it by myself, but I see that there's a complete mixing of old and new behaviour, with mistakes in many places.
Fixing it will be difficult... by now I'll take the old TabBar code from around 2016, which worked well.

[Updated on: Sat, 12 February 2022 17:38]

Report message to a moderator

Re: TabCtrl CancelClose No longer work (as intended) [message #58190 is a reply to message #58090] Fri, 18 March 2022 11:54 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
mdelfede wrote on Sat, 12 February 2022 17:13
Hi Mirek,

I stumbled over the changes in TabBar (I'm using it in my UppCad) and I've seen that the bug exists also in CancelCloseSome Gate, which doesn't work anymore as intended, and it's useless like it is now.

I guess it should be possible to add a "ConfirmCloseSome" gate, as for ConfirmClose, and remove the CancelCloseSome one.
The usage should be like ConfirmClose, but taking a number of tabs and not a single one.

Ciao

Massimo

EDIT: I wanted to fix it by myself, but I see that there's a complete mixing of old and new behaviour, with mistakes in many places.
Fixing it will be difficult... by now I'll take the old TabBar code from around 2016, which worked well.


Well, frankly, maintaining TabBar is a punishment for me... That said, I believe current behaviout is that

"CancelClose*" basically enables/disables cancel action and therefore should not contain any Prompts or anything. It is e.g. used for enabling/disabling close button.
"ConfirmClose" is called immediately before actually removing the tab and therefore can do Prompt.

Is this inline with your expectations?

Then the purpose of "ConfirmCloseAll" should be to e.g. prompt the operation for the whole group, right?
Re: TabCtrl CancelClose No longer work (as intended) [message #58191 is a reply to message #58190] Fri, 18 March 2022 11:59 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
I have tried to implement that. Please check...
Previous Topic: [PROPOSAL] Adding GetCtrlGroup() method to TabBarCtrl.
Next Topic: How to dynamically add remove tabs
Goto Forum:
  


Current Time: Fri Mar 29 16:59:39 CET 2024

Total time taken to generate the page: 0.02171 seconds