CXTPSkinManagerSchema* CXTPSkinManager::CreateSchema(LPCTSTR lpszResourcePath, LPCTSTR lpszIniFileName)
{
    if (XTPColorManager()->IsLowResolution() || !CXTPSkinManagerModuleList::IsEnumeratorExists())
        return NULL;

    CXTPSkinManagerResourceFile* pResourceFile = new CXTPSkinManagerResourceFile(this);
    if (!pResourceFile->Open(lpszResourcePath, lpszIniFileName))
    {
        CMDTARGET_RELEASE(pResourceFile);
        return NULL;
    }

    CXTPSkinManagerSchema* pSchema = pResourceFile->CreateSchema();
    if (!pSchema)
    {
        CMDTARGET_RELEASE(pResourceFile);
        return NULL;

    }

    CMDTARGET_RELEASE(pResourceFile);

    if (FAILED(pSchema->ReadProperties()))
    {
        CMDTARGET_RELEASE(pSchema);
        return NULL;
    }

    pSchema->RefreshMetrcis();
    return pSchema;
}
CXTPCalendarRemindersManager::~CXTPCalendarRemindersManager()
{
	//RemoveAll();

	CMDTARGET_RELEASE(m_pConnection);
	CMDTARGET_RELEASE(m_pResourcesNf);
}
Example #3
0
CXTPRibbonGroup::~CXTPRibbonGroup()
{
    RemoveAll();

    CMDTARGET_RELEASE(m_pControlGroupOption);
    CMDTARGET_RELEASE(m_pControlGroupPopup);
}
CXTPCalendarController::~CXTPCalendarController()
{
    CMDTARGET_RELEASE(m_pCalendarCtrl);
    CMDTARGET_RELEASE(m_pDatePickerCtrl);
    CMDTARGET_RELEASE(m_pResourcesNf);

    m_pSink->Delete();
}
Example #5
0
BOOL CXTPHeaderCtrl::SetTheme(XTPControlTheme eTheme)
{
	CMDTARGET_RELEASE(m_pTheme);

	switch (eTheme)
	{
		case xtpControlThemeOfficeXP:
			m_pTheme = new CXTPHeaderCtrlThemeOfficeXP;
			break;

		case xtpControlThemeOffice2003:
			m_pTheme = new CXTPHeaderCtrlThemeOffice2003;
			break;

		case xtpControlThemeDefault:
			m_pTheme = new CXTPHeaderCtrlThemeExplorer;
			break;

		default:
			m_pTheme = new CXTPHeaderCtrlTheme;
			break;
	}

	RefreshMetrics();

	return (m_pTheme != NULL);
}
void CXTPCoreTreeControl::SetImageManager(CXTPImageManager* pImageManager)
{
	CMDTARGET_RELEASE(m_pImageManager);

	m_pImageManager = pImageManager;

}
Example #7
0
BOOL CStartupView::SetButtonImage(CXTButton *btnButton, UINT uiID, CSize size) 
{
   CSize sz;
   CRect dimensions;
   btnButton->GetClientRect(dimensions);


   CXTPImageManagerIconHandle iconHandle;
   CXTPImageManagerIcon* pIcon; 
   // load icon
   iconHandle = pIcon->LoadBitmapFromResource(MAKEINTRESOURCE(uiID), NULL);
   pIcon = new CXTPImageManagerIcon(0, iconHandle.GetExtent().cx, iconHandle.GetExtent().cy);
      pIcon->SetNormalIcon(iconHandle);
      CMDTARGET_RELEASE(pIcon);

   sz.cx = size.cx;
   sz.cy = size.cy;
   // set icon to the button
   BOOL bIconSet = btnButton->SetIcon(sz,iconHandle,iconHandle);
   
   UINT uIcon[] = {(UINT)btnButton->GetDlgCtrlID()};
   m_pImageManager->SetIcons(uiID, uIcon, _countof(uIcon), size);

   return bIconSet;
}
void CXTPCalendarViewDay::SetResources(CXTPCalendarResources* pResources)
{
	BOOL bChanged = TRUE;

	if (!pResources)
	{
		bChanged = m_pResources != NULL;
		CMDTARGET_RELEASE(m_pResources);
	}
	else
	{
		if (!m_pResources)
			m_pResources = new CXTPCalendarResources();

		if (!m_pResources)
			return;

		// copy data to allow using self as input parameter
		CXTPCalendarResources arRes;
		arRes.Append(pResources);

		m_pResources->RemoveAll();
		m_pResources->Append(&arRes);
	}

	if (bChanged && GetView_())
	{
		GetView_()->SendNotification(XTP_NC_CALENDAR_RESOURCES_WHERE_CHANGED, 2, (LPARAM)this);
	}
}
Example #9
0
BOOL CXTPRibbonGroupControlPopup::OnSetPopup(BOOL bPopup)
{
    m_bPopup = bPopup;
    if (bPopup)
    {
        CMDTARGET_RELEASE(m_pCommandBar);

        CXTPCommandBars* pCommandBars = m_pParent->GetCommandBars();
        ASSERT(pCommandBars);

        if (!m_pPopupGroup)
        {
            m_pCommandBar = new CXTPPopupToolBar();
            m_pCommandBar->SetCommandBars(pCommandBars);
            m_pCommandBar->Popup(this, IsKeyboardSelected(GetSelected()));
        }
        else
        {

            m_pCommandBar = new CXTPRibbonGroupPopupToolBar(m_pPopupGroup);
            m_pCommandBar->SetCommandBars(pCommandBars);

            m_pCommandBar->EnableCustomization(FALSE);
            m_pCommandBar->Popup(this, IsKeyboardSelected(GetSelected()));
        }
    }
    else
    {
        ASSERT(m_pCommandBar);
        if (m_pCommandBar) m_pCommandBar->SetTrackingMode(FALSE);

    }
    RedrawParent();
    return TRUE;
}
CXTPRecentFileList::~CXTPRecentFileList()
{
	for (int i = 0; i < m_nSize; i++)
	{
		CMDTARGET_RELEASE(m_pItems[i]);
	}
	delete[] m_pItems;
}
void CXTPChartControl::EnableToolTips(BOOL bEnable /* = TRUE */)
{
	CMDTARGET_RELEASE(m_pToolTipContext);

	if (bEnable)
	{
		m_pToolTipContext = new CXTPToolTipContext();
	}
}
CXTPShortcutListBox::~CXTPShortcutListBox()
{
    CMDTARGET_RELEASE(m_pTheme);

    while (!m_arContentItems.IsEmpty())
    {
        CONTENT_ITEM* pCI = m_arContentItems.RemoveHead();
        delete pCI;
    }
}
Example #13
0
BOOL CXTPHeaderCtrl::SetTheme(CXTPHeaderCtrlTheme* pTheme)
{
	CMDTARGET_RELEASE(m_pTheme);

	m_pTheme = pTheme;

	RefreshMetrics();

	return (m_pTheme != NULL);
}
void CXTPSkinManager::SetResourceFile(CXTPSkinManagerResourceFile* pResourceFile)
{
    ASSERT(pResourceFile);
    if (!pResourceFile)
        return;

    CMDTARGET_RELEASE(m_pResourceFile);

    m_pResourceFile = pResourceFile;
    m_pResourceFile->m_pManager = this;
}
Example #15
0
void CXTPReportRecord::RemoveAll()
{
	for (int nItem = GetItemCount() - 1; nItem >= 0; nItem--)
	{
		CXTPReportRecordItem* pItem = m_arrItems.GetAt(nItem);
		if (pItem)
			pItem->InternalRelease();
	}
	m_arrItems.RemoveAll();

	CMDTARGET_RELEASE(m_pPreviewItem);
}
void CSgSelectionPreparationBar::SetButtonImage(CXTPButton* pButton, UINT nID, CSize sz)
{
   AFX_MANAGE_STATE(AfxGetStaticModuleState());
   CXTPImageManagerIconHandle iconHandle;
   CXTPImageManagerIcon* pIcon; 
   // load icon
   iconHandle = pIcon->LoadBitmapFromResource(::AfxGetResourceHandle(), MAKEINTRESOURCE(nID), NULL);
   pIcon = new CXTPImageManagerIcon(0, iconHandle.GetExtent().cx, iconHandle.GetExtent().cy);
   pIcon->SetNormalIcon(iconHandle);
   pButton->SetIcon(sz,iconHandle,iconHandle);
   CMDTARGET_RELEASE(pIcon);
}
void CXTPCalendarReminder::SetEvent(CXTPCalendarEvent* pEvent)
{
	if (!pEvent || !pEvent->GetDataProvider())
	{
		ASSERT(FALSE);
		return;
	}

	// data provider
	CMDTARGET_RELEASE(m_pEventDataProvider);

	m_pEventDataProvider = pEvent->GetDataProvider();
	CMDTARGET_ADDREF(m_pEventDataProvider);

	//-----
	m_dtEventStartTime = pEvent->GetStartTime();

	int nRState = pEvent->GetRecurrenceState();
	if (nRState == xtpCalendarRecurrenceNotRecurring)
	{
		m_eEventType = evtNormal;
		m_dwNormalEventID = pEvent->GetEventID();
		return;
	}

	CXTPCalendarRecurrencePatternPtr ptrPattern = pEvent->GetRecurrencePattern();

	if (nRState != xtpCalendarRecurrenceOccurrence &&
		nRState != xtpCalendarRecurrenceException || !ptrPattern)
	{
		ASSERT(FALSE);
		return;
	}

	m_eEventType = evtRecurrence;
	m_RecurrenceEventInfo.m_dwMasterEventID = ptrPattern->GetMasterEventID();

	if (nRState == xtpCalendarRecurrenceOccurrence)
	{
		m_RecurrenceEventInfo.m_dtOccurrenceStartTime = pEvent->GetStartTime();
		m_RecurrenceEventInfo.m_dtOccurrenceEndTime = pEvent->GetEndTime();
	}
	else if (nRState == xtpCalendarRecurrenceException)
	{
		m_RecurrenceEventInfo.m_dtOccurrenceStartTime = pEvent->GetRException_StartTimeOrig();
		m_RecurrenceEventInfo.m_dtOccurrenceEndTime = pEvent->GetRException_EndTimeOrig();
	}
	else
	{
		ASSERT(FALSE);
	}
}
Example #18
0
CStartupView::~CStartupView()
{
   if (m_pLecturnityLogo)
      delete m_pLecturnityLogo;

   if (m_pImcLogo)
      delete m_pImcLogo;

   if(m_pBmpTopLeft)
      delete m_pBmpTopLeft;
   if(m_pBmpTopMiddle)
      delete m_pBmpTopMiddle;
   if(m_pBmpTopRight)
      delete m_pBmpTopRight;

   if(m_pBmpBlueLeft)
      delete m_pBmpBlueLeft;
   if(m_pBmpTopMiddle)
      delete m_pBmpBlueMiddle;
   if(m_pBmpTopRight)
      delete m_pBmpBlueRight;

   if(m_pBmpWhiteLeft)
      delete m_pBmpWhiteLeft;
   if(m_pBmpWhiteMiddle)
      delete m_pBmpWhiteMiddle;
   if(m_pBmpWhiteRight)
      delete m_pBmpWhiteRight;

   if(m_pBmpLightBlueLeft)
      delete m_pBmpLightBlueLeft;
   if(m_pBmpLightBlueMiddle)
      delete m_pBmpLightBlueMiddle;
   if(m_pBmpLightBlueRight)
      delete m_pBmpLightBlueRight;

   if(m_pBmpFootLeft)
      delete m_pBmpFootLeft;
   if(m_pBmpFootMiddle)
      delete m_pBmpFootMiddle;
   if(m_pBmpFootRight)
      delete m_pBmpFootRight;

   /*for (int i = 0; i < m_arBtnRecentFiles.GetSize(); ++i)
   {
      if (m_arBtnRecentFiles[i] != NULL)
         delete m_arBtnRecentFiles[i];
   }*/
   //m_arBtnRecentFiles.RemoveAll();

   CMDTARGET_RELEASE(m_ctrlToolTipsContext);
}
Example #19
0
CXTPDocumentStructurePaintManager::CXTPDocumentStructurePaintManager() {
    AFX_MANAGE_STATE(AfxGetStaticModuleState());
    if (m_pGlyphs != NULL) {
        CMDTARGET_RELEASE(m_pGlyphs);
    }

    CBitmap bmp;
    CXTPResourceManager::AssertValid(XTPResourceManager()->LoadBitmap(&bmp, XTP_IDB_REPORT_GLYPHS_INTERACTION));

    m_pGlyphs = new CXTPImageManager();
    CXTPTempColorMask mask(m_pGlyphs, RGB(255, 0, 255));
    m_pGlyphs->SetIcons(bmp, 0, 8, CSize(0, 0));
}
void CXTPCalendarController::OnEvent_CalendarResourcesChanged(XTP_NOTIFY_CODE Event, WPARAM /*wParam*/, LPARAM /*lParam*/)
{
    if (Event != XTP_NC_CALENDARDATAPROVIDERWASCHANGED)
    {
        ASSERT(FALSE);
        return;
    }

    CMDTARGET_RELEASE(m_pResourcesNf);
    _UnadviseFromDataChanged();

    m_DayInfoCache.Clear();
}
void CXTPCalendarController::SetBoldDaysWithEvents(BOOL bBold)
{
    m_bBoldDaysWithEvents = bBold;

    if (m_pResourcesNf && !m_bBoldDaysWithEvents)
    {
        CMDTARGET_RELEASE(m_pResourcesNf);
        m_eLastActiveView = -1;
        _UnadviseFromDataChanged();

        m_DayInfoCache.Clear();
    }
}
CXTPSkinManager::~CXTPSkinManager()
{
    FreeSkinData();
    RemoveColorFilters();

    CMDTARGET_RELEASE(m_pSchema);
    CMDTARGET_RELEASE(m_pResourceFile);
    SAFE_DELETE(m_pClassMap);

    RemoveAll();

    CXTPSkinManagerApiHook* pApiHook = CXTPSkinManagerApiHook::GetInstance();
    pApiHook->FinalizeHookManagement();

    HMODULE hLib = GetModuleHandle(_T("USER32"));
    if (m_hWinEventHook && hLib && m_pUnhookWinEvent)
    {
        m_pUnhookWinEvent(m_hWinEventHook);
    }

    ::DeleteCriticalSection(&m_csObjects);
}
CXTPCoreTreeControl::~CXTPCoreTreeControl()
{
	SAFE_DELETE(m_pItems);
	SAFE_DELETE(m_pPaintManager);

	CMDTARGET_RELEASE(m_pImageManager);

	SAFE_DELETE(m_pDropTarget);

	XTPMarkupReleaseContext(m_pMarkupContext);


}
BOOL CXTPSkinManager::LoadSkin(LPCTSTR lpszResourcePath, LPCTSTR lpszIniFileName)
{
    CMDTARGET_RELEASE(m_pSchema);

    CXTPSkinManagerApiHook* pApiHook = CXTPSkinManagerApiHook::GetInstance();
    pApiHook->FinalizeHookManagement();

    XTPSoundManager()->StopThread();

    BOOL bEnabled = m_bEnabled;

    if (XTPColorManager()->IsLowResolution() ||
            !CXTPSkinManagerModuleList::IsEnumeratorExists() ||
            !ReadSkinData(lpszResourcePath, lpszIniFileName))
    {
        m_bEnabled = FALSE;

        CMDTARGET_RELEASE(m_pSchema);

        XTPColorManager()->RefreshColors();

        OnSkinChanged(bEnabled, m_bEnabled);

        return FALSE;
    }

    m_bEnabled = TRUE;

    pApiHook->InitializeHookManagement();

    m_pSchema->RefreshMetrcis();
    XTPColorManager()->RefreshColors();

    OnSkinChanged(bEnabled, m_bEnabled);

    return TRUE;
}
CXTPChartControl::~CXTPChartControl()
{
	SAFE_RELEASE(m_pContentView);

	// End the monitoring thread.
	if (m_pDrawThread)
	{
		m_pDrawThread->StopNotifications();
		m_pDrawThread = NULL;
	}

	SAFE_RELEASE(m_pCommand);

	CMDTARGET_RELEASE(m_pToolTipContext);

	SetContent(NULL);
}
void CXTPCalendarController::AdviseToNotifications()
{
    m_pSink->UnadviseAll();

    m_cnidEventAdded = 0;
    m_cnidEventChanged = 0;
    m_cnidEventDeleted = 0;

    CMDTARGET_RELEASE(m_pResourcesNf);

    // Advise to Calendar notifications
    if (m_pCalendarCtrl)
    {
        CXTPNotifyConnection* pConnection = m_pCalendarCtrl ? m_pCalendarCtrl->GetConnection() : NULL;
        ASSERT(pConnection);

        if (!pConnection)
        {
            return;
        }

        m_pSink->Advise(pConnection, XTP_NC_CALENDARVIEWWASCHANGED, CreateNotfySinkClassDelegate(this, &CXTPCalendarController::OnEvent_CalendarView));
        m_pSink->Advise(pConnection, XTP_NC_CALENDAROPTIONSWASCHANGED, CreateNotfySinkClassDelegate(this, &CXTPCalendarController::OnEvent_CalendarOptionsChanged));
        m_pSink->Advise(pConnection, XTP_NC_CALENDAR_RESOURCES_WHERE_CHANGED, CreateNotfySinkClassDelegate(this, &CXTPCalendarController::OnEvent_CalendarResourcesChanged));
        m_pSink->Advise(pConnection, XTP_NC_CALENDAR_THEME_CHANGED, CreateNotfySinkClassDelegate(this, &CXTPCalendarController::OnEvent_CalendarThemeChanged));
    }

    // Advise to Date Picker notifications
    if (m_pDatePickerCtrl)
    {
        CXTPNotifyConnection* pConnection = m_pDatePickerCtrl ? m_pDatePickerCtrl->GetConnection() : NULL;
        ASSERT(pConnection);

        if (!pConnection)
        {
            return;
        }

        m_pSink->Advise(pConnection, XTP_NC_DATEPICKERBUTTONCLICKED, CreateNotfySinkClassDelegate(this, &CXTPCalendarController::OnEvent_DatePicker));
        m_pSink->Advise(pConnection, XTP_NC_DATEPICKERSELECTIONCHANGED, CreateNotfySinkClassDelegate(this, &CXTPCalendarController::OnEvent_DatePicker));
        m_pSink->Advise(pConnection, XTP_NC_DATEPICKERBEFOREGOMODAL, CreateNotfySinkClassDelegate(this, &CXTPCalendarController::OnEvent_DatePicker));
        m_pSink->Advise(pConnection, XTP_NC_DATEPICKERMONTHCHANGED, CreateNotfySinkClassDelegate(this, &CXTPCalendarController::OnEvent_DatePicker));
        m_pSink->Advise(pConnection, XTP_NC_DATEPICKERGETDAYMETRICS, CreateNotfySinkClassDelegate(this, &CXTPCalendarController::OnEvent_DtPickGetItemMetrics));
    }
}
void CXTPSkinManager::SetWindowTheme(HWND hWnd, CXTPSkinManagerSchema* pSchema)
{
    CXTPSkinObject* pSkinObject = Lookup(hWnd);
    if (pSkinObject)
    {
        CMDTARGET_RELEASE(pSkinObject->m_pSchema);
        pSkinObject->m_pSchema = pSchema;
        CMDTARGET_ADDREF(pSchema);

        pSkinObject->OnSkinChanged(m_bEnabled, pSchema ? TRUE : m_bEnabled);
    }

    hWnd = ::GetWindow(hWnd, GW_CHILD);
    while (hWnd)
    {
        SetWindowTheme(hWnd, pSchema);

        hWnd = ::GetWindow(hWnd, GW_HWNDNEXT);
    }
}
BOOL CXTPShortcutListBox::SetTheme(XTPControlTheme eTheme)
{
    CMDTARGET_RELEASE(m_pTheme);

    switch (eTheme)
    {
    case xtpControlThemeOfficeXP:
        m_pTheme = new CXTPShortcutListBoxThemeOfficeXP;
        break;

    case xtpControlThemeOffice2003:
        m_pTheme = new CXTPShortcutListBoxThemeOffice2003;
        break;

    default:
        m_pTheme = new CXTPShortcutListBoxTheme;
        break;
    }

    RefreshMetrics();

    return (m_pTheme != NULL);
}
void CXTPCalendarTimeLineViewTimeScale::SetTimeScaleParams(int eTimeScaleParamsID)
{
	CMDTARGET_RELEASE(m_pTimeScaleParams);

	switch (eTimeScaleParamsID)
	{
	case xtpTSPID_Day:
		m_pTimeScaleParams = new CXTPCalendarTLV_TimeScaleParams_Day(this);
		break;
	case xtpTSPID_Week:
		m_pTimeScaleParams = new CXTPCalendarTLV_TimeScaleParams_Week(this);
		break;
	case xtpTSPID_Month:
		m_pTimeScaleParams = new CXTPCalendarTLV_TimeScaleParams_Month(this);
		break;
	case xtpTSPID_WorkWeek:
		m_pTimeScaleParams = new CXTPCalendarTLV_TimeScaleParams_Week(this);
		break;
	default:
		ASSERT(FALSE);
		m_pTimeScaleParams = new CXTPCalendarTLV_TimeScaleParams_Day(this);
	}
}
void CXTPRecentFileList::ReadList()
{
	ASSERT(m_arrNames != NULL);
	ASSERT(!m_strSectionName.IsEmpty());
	ASSERT(!m_strEntryFormat.IsEmpty());

	LPTSTR pszEntry = new TCHAR[max(20, m_strEntryFormat.GetLength() + 7)];
	CWinApp* pApp = AfxGetApp();

	for (int iMRU = 0; iMRU < m_nSize; iMRU++)
	{
		CMDTARGET_RELEASE(m_pItems[iMRU]);

		wsprintf(pszEntry, m_strEntryFormat, iMRU + 1);
		m_arrNames[iMRU] = pApp->GetProfileString(m_strSectionName, pszEntry, _T(""));

		if (!m_arrNames[iMRU].IsEmpty())
		{
			m_pItems[iMRU] = new CXTPRecentFileListItem(this);

			wsprintf(pszEntry, _T("Pinned%d"), iMRU + 1);
			m_pItems[iMRU]->m_bPinned = pApp->GetProfileInt(m_strSectionName, pszEntry, FALSE);

			wsprintf(pszEntry, _T("IconId%d"), iMRU + 1);
			m_pItems[iMRU]->m_nIconId = pApp->GetProfileInt(m_strSectionName, pszEntry, -1);

			wsprintf(pszEntry, _T("Caption%d"), iMRU + 1);
			m_pItems[iMRU]->m_strCaption = pApp->GetProfileString(m_strSectionName, pszEntry, _T(""));

			wsprintf(pszEntry, _T("Tag%d"), iMRU + 1);
			m_pItems[iMRU]->m_strTag = pApp->GetProfileString(m_strSectionName, pszEntry, _T(""));

			m_pItems[iMRU]->m_strPathName = m_arrNames[iMRU];
		}
	}
	delete[] pszEntry;
}