Click here to Skip to main content
15,900,258 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to make the camera rotate with the player? Pin
Jonathan Davies21-Aug-13 22:38
Jonathan Davies21-Aug-13 22:38 
GeneralRe: How to make the camera rotate with the player? Pin
LittleJackFlash21-Aug-13 23:25
LittleJackFlash21-Aug-13 23:25 
GeneralRe: How to make the camera rotate with the player? Pin
Jonathan Davies21-Aug-13 23:46
Jonathan Davies21-Aug-13 23:46 
GeneralHow to write Benford’s Law in C++ Need Help Pin
Member 1022170020-Aug-13 16:55
Member 1022170020-Aug-13 16:55 
QuestionRe: How to write Benford’s Law in C++ Need Help Pin
Richard MacCutchan20-Aug-13 20:10
mveRichard MacCutchan20-Aug-13 20:10 
GeneralRe: How to write Benford’s Law in C++ Need Help Pin
BadKarma20-Aug-13 21:30
BadKarma20-Aug-13 21:30 
SuggestionRe: How to write Benford’s Law in C++ Need Help Pin
David Crow21-Aug-13 6:26
David Crow21-Aug-13 6:26 
QuestionCTabCtrl header colour anomaly in CPaneDialog Pin
D G McKay20-Aug-13 2:07
D G McKay20-Aug-13 2:07 
I'm updating an existing MFC project from VC6 into VC2010, and adding dockable window functionality. In doing so, I've recreated some CDialog-based windows as CPaneDialogs. In general, this works well, but there's a visual anomaly with CTabCtrls: the unpopulated portion of the tab bar is a different colour from the CPaneDialog background.

This can be seen be tweaking the SetPaneSize example in the 2008 Feature Pack to add a CTabCtrl to the IDD_DLG_BAR dialog. Derive from CPaneDialog and then add something like:

C++
BEGIN_MESSAGE_MAP(CMyPaneDialog, CPaneDialog)
	ON_MESSAGE(WM_INITDIALOG, HandleInitDialog)
END_MESSAGE_MAP()

LRESULT CMyPaneDialog::HandleInitDialog(WPARAM wParam, LPARAM lParam)
{
	VERIFY(m_tabCtrl.SubclassDlgItem(IDC_TAB1, this));

	TC_ITEM tci;
	tci.mask = TCIF_TEXT;

	tci.pszText = _T("A");
	m_tabCtrl.InsertItem(0, &tci);

	tci.pszText = _T("B");
	m_tabCtrl.InsertItem(1, &tci);

	m_tabCtrl.SetCurSel(0);

	return CPaneDialog::HandleInitDialog(wParam, lParam);
}


Searching for solutions to this issue comes up with a lot of suggestions about the CTabCtrl background as a whole, but nothing seems to work. I've tried overriding OnCtlColor, OnEraseBkgnd, etc, but the header steadfastly refuses to change colour. I don't see owner drawing as an option, since theme support would be difficult to replicate.

Even more annoyingly, if I place the same CTabCtrl in SetPaneSize's CFormView, it renders perfectly!

Does anyone have any suggestions I could try? My one thought is that perhaps I'm looking at the problem from the wrong perspective: is the CTabCtrl correct, but the CPaneDialog ignoring theme instructions?
AnswerRe: CTabCtrl header colour anomaly in CPaneDialog Pin
D G McKay2-Sep-13 0:14
D G McKay2-Sep-13 0:14 
QuestionWindow Position Pin
john563218-Aug-13 19:44
john563218-Aug-13 19:44 
AnswerRe: Window Position Pin
Richard MacCutchan18-Aug-13 20:56
mveRichard MacCutchan18-Aug-13 20:56 
GeneralRe: Window Position Pin
john563219-Aug-13 4:11
john563219-Aug-13 4:11 
GeneralRe: Window Position Pin
Richard MacCutchan19-Aug-13 5:06
mveRichard MacCutchan19-Aug-13 5:06 
GeneralRe: Window Position Pin
pasztorpisti19-Aug-13 6:09
pasztorpisti19-Aug-13 6:09 
GeneralRe: Window Position Pin
Richard MacCutchan19-Aug-13 20:33
mveRichard MacCutchan19-Aug-13 20:33 
GeneralRe: Window Position Pin
pasztorpisti20-Aug-13 2:03
pasztorpisti20-Aug-13 2:03 
QuestionRe: Window Position Pin
pasztorpisti18-Aug-13 23:47
pasztorpisti18-Aug-13 23:47 
QuestionSometimes it can not draw out graph Pin
xieeevil18-Aug-13 17:04
xieeevil18-Aug-13 17:04 
AnswerRe: Sometimes it can not draw out graph Pin
Richard MacCutchan18-Aug-13 20:38
mveRichard MacCutchan18-Aug-13 20:38 
GeneralRe: Sometimes it can not draw out graph Pin
Rajesh R Subramanian18-Aug-13 21:57
professionalRajesh R Subramanian18-Aug-13 21:57 
GeneralRe: Sometimes it can not draw out graph Pin
Richard MacCutchan18-Aug-13 22:09
mveRichard MacCutchan18-Aug-13 22:09 
GeneralRe: Sometimes it can not draw out graph Pin
Vaclav_21-Aug-13 4:30
Vaclav_21-Aug-13 4:30 
GeneralRe: Sometimes it can not draw out graph Pin
Richard MacCutchan21-Aug-13 5:09
mveRichard MacCutchan21-Aug-13 5:09 
QuestionWaitForSingleObject Crash Pin
ForNow18-Aug-13 14:09
ForNow18-Aug-13 14:09 
AnswerRe: WaitForSingleObject Crash Pin
Stephen Hewitt18-Aug-13 19:53
Stephen Hewitt18-Aug-13 19:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.