![]() |
Bug #2 in CXTPTabControl! |
Post Reply ![]() |
Author | |
znakeeye ![]() Senior Member ![]() ![]() Joined: 26 July 2006 Status: Offline Points: 1672 |
![]() ![]() ![]() ![]() ![]() 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?
|
|
![]() |
|
znakeeye ![]() Senior Member ![]() ![]() Joined: 26 July 2006 Status: Offline Points: 1672 |
![]() ![]() ![]() ![]() ![]() |
This has not been fixed in v12.0!
|
|
![]() |
|
znakeeye ![]() Senior Member ![]() ![]() Joined: 26 July 2006 Status: Offline Points: 1672 |
![]() ![]() ![]() ![]() ![]() |
Oleg, please change this in the next release! This bug is causing big problems!
|
|
![]() |
|
Oleg ![]() Senior Member ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi, Its not bug. CXTPTabControl is not CTabCtrl and not derived from it.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
znakeeye ![]() Senior Member ![]() ![]() Joined: 26 July 2006 Status: Offline Points: 1672 |
![]() ![]() ![]() ![]() ![]() |
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.
|
|
![]() |
|
Oleg ![]() Senior Member ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
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 |
|
![]() |
|
znakeeye ![]() Senior Member ![]() ![]() Joined: 26 July 2006 Status: Offline Points: 1672 |
![]() ![]() ![]() ![]() ![]() |
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"); |
|
![]() |
|
znakeeye ![]() Senior Member ![]() ![]() Joined: 26 July 2006 Status: Offline Points: 1672 |
![]() ![]() ![]() ![]() ![]() |
At least make CXTPTabManager::SetCurSel virtual, so I can override its behavior...
|
|
![]() |
|
Oleg ![]() Senior Member ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi,
SetCurSel just call SetSelectedItem method. Override it instead.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |