--- MyTabCtrl.cpp 2006/08/30 21:57:57 9 +++ MyTabCtrl.cpp 2006/09/03 10:10:19 31 @@ -1,11 +1,13 @@ -// MyTabCtrl.cpp : implementation file -// +/* + * Developed by Torben H. Nielsen + */ #include "stdafx.h" #include "h6-udlånssystem.h" #include "MyTabCtrl.h" #include ".\mytabctrl.h" +#include "CommonStorage.h" #include "SearchDialog.h" #include "AdminDialog.h" #include "ResultDialog.h" @@ -54,7 +56,8 @@ m_tabs[1]->ShowWindow(SW_HIDE); m_tabs[2]->ShowWindow(SW_HIDE); SetRectangle(); - + + CommonStorage::Instance()->setTabCtrl(this); } void CMyTabCtrl::SetRectangle(void) @@ -74,12 +77,18 @@ for (int i=1; iSetWindowPos(&wndTop,nX,nY,nXc,nYc,SWP_HIDEWINDOW); } - } void CMyTabCtrl::OnLButtonDown(UINT nFlags, CPoint point) { CTabCtrl::OnLButtonDown(nFlags,point); + ChangeFocus(); +} + + + +void CMyTabCtrl::ChangeFocus(void) +{ if (m_tabCurrent != GetCurFocus()) { m_tabs[m_tabCurrent]->ShowWindow(SW_HIDE); m_tabCurrent = GetCurFocus(); @@ -87,5 +96,3 @@ m_tabs[m_tabCurrent]->SetFocus(); } } - -