Esempio n. 1
0
void Explorerplusplus::InitializeTabs(void)
{
	/* The tab backing will hold the tab window. */
	CreateTabBacking();

	if(m_bForceSameTabWidth)
	{
		TabCtrlStyles |= TCS_FIXEDWIDTH;
	}

	m_hTabCtrl = CreateTabControl(m_hTabBacking,TabCtrlStyles);

	/* TODO: The image list is been leaked. */
	HIMAGELIST himlSmall = ImageList_Create(16,16,ILC_COLOR32|ILC_MASK,0,100);
	AddDefaultTabIcons(himlSmall);
	TabCtrl_SetImageList(m_hTabCtrl,himlSmall);

	/* TODO: Needs to be freed when closing. */
	m_pTabContainer = new CTabContainer(m_hTabCtrl,m_pShellBrowser,this);

	CTabDropHandler *pTabDropHandler = new CTabDropHandler(m_hTabCtrl,m_pTabContainer);
	RegisterDragDrop(m_hTabCtrl,pTabDropHandler);
	pTabDropHandler->Release();

	SetWindowSubclass(m_hTabCtrl,TabSubclassProcStub,0,reinterpret_cast<DWORD_PTR>(this));

	/* Create the toolbar that will appear on the tab control.
	Only contains the close button used to close tabs. */
	TCHAR szTabCloseTip[64];
	LoadString(m_hLanguageModule,IDS_TAB_CLOSE_TIP,szTabCloseTip,SIZEOF_ARRAY(szTabCloseTip));
	m_hTabWindowToolbar	= CreateTabToolbar(m_hTabBacking,TABTOOLBAR_CLOSE,szTabCloseTip);
}
/// <summary>
/// Create Kinect window and its sub views
/// </summary>
/// <returns>Indicates success or failure</returns>
bool KinectWindow::CreateWindows()
{
    // Create window for Kinect window
    if (!this->CreateView())
    {
        return false;
    }

    // Create window for sub views
    for (auto itr = m_views.begin(); itr != m_views.end(); itr++)
    {
        if (!(*itr)->CreateView())
        {
            return false;
        }
    }

    // Creata camera setting views
    if (!CreateCameraSettingViews())
    {
        return false;
    }

    return CreateTabControl();
}