Esempio n. 1
0
BOOL CMainFrame::InitRibbonBars(CXTPCommandBars* pCommandBars)
{
    m_cmdbars = pCommandBars;

    m_cmdbars->GetCommandBarsOptions()->ShowKeyboardCues(xtpKeyboardCuesShowWindowsDefault);
    m_cmdbars->GetCommandBarsOptions()->bToolBarAccelTips = TRUE;
    m_cmdbars->GetCommandBarsOptions()->bShowKeyboardTips = TRUE;
    m_cmdbars->GetShortcutManager()->SetAccelerators(m_id);

    if (InitRibbonTheme() && !CreateRibbonBar())
    {
        TRACE0("Failed to create ribbon\n");
    }

    if (!CreateStatusBar())
        return FALSE;

    CXTPToolTipContext* pToolTipContext = m_cmdbars->GetToolTipContext();
    pToolTipContext->SetStyle((XTPToolTipStyle)(xtpToolTipLuna + 1));
    pToolTipContext->ShowTitleAndDescription();
    pToolTipContext->SetMargin(CRect(2, 2, 2, 2));
    pToolTipContext->SetMaxTipWidth(180);

    m_enableCustomize = m_frameNode->GetBool(L"enableCustomize", !HasRibbonBar());
    LoadCommandBars();

    CreateDockingPanes();

    return TRUE;
}
int CInteractionStructureView::OnCreate(LPCREATESTRUCT lpCreateStruct) {
    if (CXTPReportView::OnCreate(lpCreateStruct) == -1) {
        return -1;
    }

    GetReportCtrl().SetPaintManager(new CXTPReportInteractionStructurePaintManager());
    CXTPToolTipContext* pToolTipContext = GetReportCtrl().GetToolTipContext();
    if (pToolTipContext != NULL) {
        pToolTipContext->SetStyle(xtpToolTipOffice2007);
        pToolTipContext->SetMaxTipWidth(200);
        pToolTipContext->SetMargin(CRect(2, 2, 2, 2));  
        pToolTipContext->SetDelayTime(TTDT_INITIAL, 1000);
    }

    LoadImages();

    CXTPReportControl& wndReport = GetReportCtrl();
    CXTPReportColumn* pColumn = wndReport.AddColumn(new CXTPReportColumn(0, _T("Name"), 250));
    pColumn->SetTreeColumn(TRUE);
    pColumn->SetAlignment(DT_VCENTER);
    pColumn->SetEditable(FALSE);
    pColumn->SetSortable(TRUE);
    pColumn->SetSortIncreasing(TRUE);

    pColumn = wndReport.AddColumn(new CXTPReportColumn(ICON_COLUMN_NO /*1*/, _T(""), 30));
    pColumn->SetMinWidth(25);
    pColumn->SetAlignment(DT_RIGHT);
    pColumn->SetEditable(FALSE);
    pColumn->EnableResize(FALSE);

    wndReport.SetGridStyle(false, xtpReportGridNoLines);
    wndReport.GetReportHeader()->AllowColumnRemove(FALSE);

    wndReport.GetPaintManager()->SetColumnStyle(xtpReportColumnFlat);
    wndReport.EditOnClick(FALSE);
	wndReport.SetMultipleSelection(true);
    wndReport.SetTreeIndent(7);
    wndReport.ShowHeader(FALSE);
    wndReport.ShowRowFocus(FALSE);
    wndReport.GetReportHeader()->AllowColumnResize(false);
    wndReport.SetSortRecordChilds(TRUE);
    wndReport.GetColumns()->SetSortColumn(wndReport.GetColumns()->GetAt(0), TRUE);
    wndReport.GetPaintManager()->m_bShadeSortColumn = FALSE;

    ShowScrollBar(SB_HORZ, FALSE);

    RefreshList();
    return 0;
}