MCPcopy Create free account
hub / github.com/bruderstein/nppPluginManager / initTabControl

Method initTabControl

pluginManager/src/pluginmanagerdialog.cpp:575–633  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

573
574
575void PluginManagerDialog::initTabControl()
576{
577 HWND hTabCtrl = GetDlgItem(_hSelf, IDC_PLUGINTABCTRL);
578 _tabHeader.hwndTab = hTabCtrl;
579
580 // Create the tab pages
581 TCITEM tab;
582 tab.pszText = _T("Available");
583 tab.mask = TCIF_TEXT;
584
585 TabCtrl_InsertItem(hTabCtrl, 0, &tab);
586
587 tab.pszText = _T("Updates");
588 TabCtrl_InsertItem(hTabCtrl, 1, &tab);
589
590 tab.pszText = _T("Installed");
591 TabCtrl_InsertItem(hTabCtrl, 2, &tab);
592
593 // Create the child dialogs
594 DLGTEMPLATE *dlg;
595 dlg = DoLockDlgRes(MAKEINTRESOURCE(IDD_TABAVAILABLE));
596 _tabHeader.hwndDisplay = NULL;
597 _tabHeader.hwndPage[0] = CreateDialogIndirectParam(_hInst,
598 dlg, hTabCtrl, PluginManagerDialog::availableTabDlgProc,
599 reinterpret_cast<LPARAM>(this));
600
601 dlg = DoLockDlgRes(MAKEINTRESOURCE(IDD_TABUPDATES));
602 _tabHeader.hwndPage[1] = CreateDialogIndirectParam(_hInst,
603 dlg, hTabCtrl, PluginManagerDialog::updatesTabDlgProc,
604 reinterpret_cast<LPARAM>(this));
605
606
607 dlg = DoLockDlgRes(MAKEINTRESOURCE(IDD_TABINSTALLED));
608 _tabHeader.hwndPage[2] = CreateDialogIndirectParam(_hInst,
609 dlg, hTabCtrl, PluginManagerDialog::installedTabDlgProc,
610 reinterpret_cast<LPARAM>(this));
611
612
613 WINDOWINFO wi;
614 wi.cbSize = sizeof(WINDOWINFO);
615 ::GetWindowInfo(hTabCtrl, &wi);
616
617
618
619 _tabHeader.rcDisplay.left = 0;
620 _tabHeader.rcDisplay.right = wi.rcClient.right - wi.rcClient.left;
621 _tabHeader.rcDisplay.top = 0;
622 _tabHeader.rcDisplay.bottom = wi.rcClient.bottom - wi.rcClient.top;
623 TabCtrl_AdjustRect(hTabCtrl, FALSE, &_tabHeader.rcDisplay);
624 // CopyRect(&_tabHeader.rcDisplay, &wi.rcClient);
625
626 // Set the userdata
627 ::SetWindowLongPtr(hTabCtrl, GWLP_USERDATA, reinterpret_cast<LONG_PTR>(&_tabHeader));
628
629 _tabHeader.defWndProc = reinterpret_cast<WNDPROC>(::GetWindowLongPtr(hTabCtrl, GWLP_WNDPROC));
630 ::SetWindowLongPtr(hTabCtrl, GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(tabWndProc));
631 // Fake a tab change, to show the first tab
632 OnSelChanged(hTabCtrl);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected