Print Page | Close Window

Bug #2 in CXTPTabControl!

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=10000
Printed Date: 10 June 2024 at 2:02am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Bug #2 in CXTPTabControl!
Posted By: znakeeye
Subject: Bug #2 in CXTPTabControl!
Date Posted: 29 March 2008 at 4:33pm
A small bug, but quite critical if you ask me.
 
m_wndTab.SetCurSel(0); // This causes TCN_SELCHANGE to be sent.
 
From MSDN:
"A tab control does not send a TCN_SELCHANGING or TCN_SELCHANGE notification message when a tab is selected using this function."
 
Makes sense to follow that principle. The same goes for all your other controls too.
 
Can you please fix this in v12?



Replies:
Posted By: znakeeye
Date Posted: 10 May 2008 at 4:56pm
This has not been fixed in v12.0!


Posted By: znakeeye
Date Posted: 17 July 2008 at 7:13pm
Oleg, please change this in the next release! This bug is causing big problems!


Posted By: Oleg
Date Posted: 18 July 2008 at 2:31am

Hi,

Its not bug. CXTPTabControl is not CTabCtrl and not derived from it.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: znakeeye
Date Posted: 18 July 2008 at 3:38am
Ok, so please tell me how to change the current selection without getting TCN_SELCHANGE.
 
Like I said, no API cause notification messages to be sent. It's really crazy to violate that principle. Consider this:
 
OnSelChanged(...)
{
    SetCurSel(x); // Let's recur infinitely!
}
 
Notification message = the user did something that you could not predict.


Posted By: Oleg
Date Posted: 18 July 2008 at 4:45am
Hi,
 
There will be only one recur call because SetSelectedItem has if (m_pSelected == pItem)  return.
 
You can override SetSelectedItem and don't call base method if you don't need change selection.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: znakeeye
Date Posted: 20 July 2008 at 4:44am
Hi, I just recalled my original problem.
 
InsertItem() causes TCN_SELCHANGE to be sent when nItem==0. I can live with the SetCurSel-behavior, but inserting items must not differ depending on its item count! This IS a bug.
 
I'd rather not have comments like this in my source code:
// HACK: In XTP 12.0.1, InsertItem() automatically selects the first item when the requested index is set to 0.
// We add 1 to avoid this. The value will be corrected, but the TCN_SELCHANGED notification will not be sent!
int index = m_wndTab.GetItemCount() + 1;
m_wndTab.InsertItem(index, "Test");


Posted By: znakeeye
Date Posted: 27 July 2008 at 1:13pm
At least make CXTPTabManager::SetCurSel virtual, so I can override its behavior...


Posted By: Oleg
Date Posted: 28 July 2008 at 2:39am
Hi,
 
SetCurSel just call SetSelectedItem method. Override it instead.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net