BOOL CVolEditDlg::OnInitDialog()
{
CXTResizeDialog::OnInitDialog( );
// cut out a bunch of code that adds columns to my 2 list controls.
CXTPPaintManager::SetTheme(xtp ThemeOfficeXP);
XTP_COMMANDBARS_ICONSINFO* pIconsInfo = XTPPaintManager()->GetIconsInfo();
pIconsInfo->bUseDisabledIco ns = TRUE;
pIconsInfo->bIconsWithShado w = FALSE;
pIconsInfo->bUseFadedIcons = TRUE;
VERIFY(m_toolbar.CreateToolBar (WS_VISIBLE|WS_CHILD|CBRS_TOOLTIPS|CBRS_GRIPPER, this, AFX_IDW_TOOLBAR));
VERIFY(m_toolbar.LoadToolBar(I DR_TOOLBAR));
m_toolbar.SetFlags(xtpFlagStre tched);
((CXTPControlButton*)m_toolbar .GetControls()->FindControl(xtpControlButton, ID_FILE_OPEN, TRUE, FALSE))->SetStyle(xtpButtonIconAndCaption);
((CXTPControlButton*)m_toolbar .GetControls()->FindControl(xtpControlButton, ID_FILE_SAVE, TRUE, FALSE))->SetStyle(xtpButtonIconAndCaption);
((CXTPControlButton*)m_toolbar .GetControls()->FindControl(xtpControlButton, ID_CLEAR, TRUE, FALSE))->SetStyle(xtpButtonIconAndCaption);
CRect rcClientStart;
CRect rcClientNow;
GetClientRect(rcClientStart);
RepositionBars(AFX_IDW_CONTROL BAR_FIRST, AFX_IDW_CONTROLBAR_LAST, 0, reposQuery, rcClientNow);
CPoint ptOffset(rcClientStart.left - rcClientNow.left, -rcClientStart.top + rcClientNow.top);
// ptOffset.y -= ::GetSystemMetrics(SM_CYMENU);
CRect rcChild;
CWnd* pwndChild = GetWindow(GW_CHILD);
while (pwndChild)
{
pwndChild->GetWindowRect(rcChild);
// &nbs p;rcChild.OffsetRect(ptOffset);
pwndChild->MoveWindow(rcChild, FALSE);
pwndChild = pwndChild->GetNextWindow();
}
CRect rcWindow;
GetWindowRect(rcWindow);
rcWindow.right += rcClientStart.Width() - rcClientNow.Width();
rcWindow.bottom += rcClientStart.Height() - rcClientNow.Height();
MoveWindow(rcWindow, FALSE);
RepositionBars(AFX_IDW_CONTROL BAR_FIRST, AFX_IDW_CONTROLBAR_LAST, 0);
// END create toolbar and reposition controls so toolbar is at the top
// Set control resizing.
SetResize(IDC_TXT_PWR_SUPPLIES , SZ_TOP_LEFT, SZ_TOP_RIGHT);
SetResize(IDC_PWR_SUPPLIES, SZ_TOP_LEFT, SZ_TOP_RIGHT);
SetResize(IDC_TXT_PWR_SEQ, SZ_TOP_LEFT, SZ_TOP_RIGHT);
SetResize(IDC_PWR_SEQ_LIST, SZ_TOP_LEFT, SZ_BOTTOM_RIGHT);
SetResize(IDC_ADD_POWER_SEQ_BU TTON, SZ_BOTTOM_RIGHT, SZ_BOTTOM_RIGHT);
SetResize(IDC_DELETE_POWER_SEQ _BUTTON, SZ_BOTTOM_RIGHT, SZ_BOTTOM_RIGHT);
SetResize(IDC_UP_POWER_SEQ, SZ_BOTTOM_RIGHT, SZ_BOTTOM_RIGHT);
SetResize(IDC_DOWN_POWER_SEQ, SZ_BOTTOM_RIGHT, SZ_BOTTOM_RIGHT);
// Load window placement
LoadPlacement(_T("CVolEditDlg" ));
SetMinSize(CSize(rcWindow.Widt h(), rcWindow.Height()));
AdjustListCtrlLastColumnWidth( );
return TRUE; // return TRUE unless you set the focus to a control
}
|