void CXTPChartLineStyle::DoPropExchange(CXTPPropExchange* pPX)
{
	PX_Int(pPX, _T("Thickness"), m_nThickness, 1);
	PX_Enum(pPX, _T("DashStyle"), m_nDashStyle, xtpChartDashStyleSolid);

	if (pPX->IsStoring())
	{
		int nCount = (int)m_arrDashArray.GetSize();

		PX_Int(pPX, _T("DashArray"), nCount, 0);

		for (int i = 0; i < nCount; i++)
		{
			CString strSection;
			strSection.Format(_T("Dash%d"), i);

			PX_Float(pPX, strSection, m_arrDashArray[i]);
		}
	}
	else
	{
		int nCount;
		PX_Int(pPX, _T("DashArray"), nCount, 0);

		m_arrDashArray.SetSize(nCount);

		for (int i = 0; i < nCount; i++)
		{
			CString strSection;
			strSection.Format(_T("Dash%d"), i);

			PX_Float(pPX, strSection, m_arrDashArray[i]);
		}
	}
}
void CXTPControlScrollBar::DoPropExchange(CXTPPropExchange* pPX)
{
	CXTPControl::DoPropExchange(pPX);

	PX_Int(pPX, _T("Min"), m_nMin, 0);
	PX_Int(pPX, _T("Max"), m_nMax, 100);
	PX_Int(pPX, _T("Pos"), m_nPos, 0);
	PX_Enum(pPX, _T("ScrollBarStyle"), m_scrollBarStyle, xtpScrollStyleDefault);
}
void CXTPReportColumnOrder::DoPropExchange(CXTPPropExchange* pPX)
{
	if (pPX->IsStoring())
	{
		int nCount = GetCount();
		PX_Int(pPX, _T("Count"), nCount, 0);

		for (int i = 0; i < nCount; i++)
		{
			CXTPReportColumn* pColumn = GetAt(i);
			if (pColumn)
			{
				int nItemIndex = pColumn->GetItemIndex();
				CString strInternalName = pColumn->GetInternalName();
				CString strParamName;

				strParamName.Format(_T("Column%i"), i);
				PX_Int(pPX, strParamName, nItemIndex, 0);

				strParamName.Format(_T("InternalName%i"), i);
				PX_String(pPX, strParamName, strInternalName);
			}
		}
	}
	else
	{
		Clear();

		int nCount = 0;
		PX_Int(pPX, _T("Count"), nCount, 0);

		for (int i = 0; i < nCount; i++)
		{
			int nItemIndex = 0;
			CString strParamName;
			strParamName.Format(_T("Column%i"), i);
			PX_Int(pPX, strParamName, nItemIndex, 0);

			CXTPReportColumn* pColumn = NULL;
			if (pPX->GetSchema() > _XTP_SCHEMA_1100)
			{
				strParamName.Format(_T("InternalName%i"), i);
				CString strInternalName;
				PX_String(pPX, strParamName, strInternalName);

				if (!strInternalName.IsEmpty())
					pColumn = m_pColumns->Find(strInternalName);
			}
			if (!pColumn)
				pColumn = m_pColumns->Find(nItemIndex);

			if (pColumn)
				Add(pColumn);
		}
	}
}
void CXTPChartAxisTickMarks::DoPropExchange(CXTPPropExchange* pPX)
{
	PX_Bool(pPX, _T("Visible"), m_bVisible, TRUE);
	PX_Bool(pPX, _T("MinorVisible"), m_bMinorVisible, TRUE);
	PX_Int(pPX, _T("Thickness"), m_nThickness, 1);
	PX_Int(pPX, _T("MinorThickness"), m_nMinorThickness, 1);
	PX_Int(pPX, _T("Length"), m_nLength, 5);
	PX_Int(pPX, _T("MinorLength"), m_nMinorLength, 2);
	PX_Bool(pPX, _T("CrossAxis"), m_bCrossAxis, FALSE);
}
void CXTPRibbonBuilder::BuildQATElements(CXTPPropExchange* pPX, CXTPRibbonBar* pRibbonBar)
{
	CXTPPropExchangeSection pxItems(pPX->GetSection(_T("ITEMS")));

	CXTPPropExchangeEnumeratorPtr pEnumerator(pxItems->GetEnumerator(_T("ITEM")));


	POSITION pos = pEnumerator->GetPosition(0);
	while (pos)
	{
		CXTPPropExchangeSection pxItem(pEnumerator->GetNext(pos));

		CXTPPropExchangeSection pxItemId(pxItem->GetSection(_T("ID")));

		int nId = 0;
		PX_Int(&pxItemId, _T("VALUE"), nId);

		if (nId > 0)
		{
			pRibbonBar->GetQuickAccessControls()->Add(xtpControlButton, nId);
		}

	}

	pRibbonBar->GetQuickAccessControls()->CreateOriginalControls();
}
BOOL CXTPRibbonBuilder::BuildMainButton(CXTPPropExchange* pPX, CXTPRibbonBar* pRibbonBar)
{
	CString strElementName;
	PX_String(pPX, _T("ELEMENT_NAME"), strElementName);

	if (strElementName != _T("Button_Main"))
		return FALSE;

	CXTPControl* pControl = pRibbonBar->AddSystemButton(0);


	CXTPPropExchangeSection pxImage(pPX->GetSection(_T("IMAGE")));
	CXTPPropExchangeSection pxImageId(pxImage->GetSection(_T("ID")));

	int nId = -1;
	PX_Int(&pxImageId, _T("VALUE"), nId);

	if (nId != -1)
	{
		UINT nIcons[] = {(UINT)nId};

		pRibbonBar->GetImageManager()->SetIcons(nId, nIcons, 1, CSize(0, 0), xtpImageNormal);

		pControl->SetID(nId);
	}

	CString strKeys;
	PX_String(pPX, _T("KEYS"), strKeys);
	pControl->SetKeyboardTip(strKeys);


	return TRUE;
}
void CXTPControlCustom::DoPropExchange(CXTPPropExchange* pPX)
{
	CXTPControlButton::DoPropExchange(pPX);

	PX_Rect(pPX, _T("Borders"), m_rcBorders, CRect(0, 0, 0, 0));
	PX_Size(pPX, _T("ControlSize"), m_szControl, CSize(0, 0));
	PX_Enum(pPX, _T("VerticalOptions"), m_verticalOptions, xtpVerticalHide);

	if (pPX->GetSchema() > _XTP_SCHEMA_861)
	{
		PX_Int(pPX, _T("ControlId"), m_nControlID, 0);
	}

	if (pPX->IsLoading() && m_nControlID != 0)
	{
		CXTPCommandBars* pCommandBars = ((XTP_COMMANDBARS_PROPEXCHANGE_PARAM*)pPX->m_dwData)->pCommandBars;
		ASSERT(pCommandBars->IsKindOf(RUNTIME_CLASS(CXTPCommandBars)));
		ASSERT(pCommandBars && pCommandBars->GetSite());

		CWnd* pWnd = FindChildWindow(pCommandBars, m_nControlID);

		if (pWnd)
		{
			m_hwndControl = pWnd->GetSafeHwnd();
		}

	}
}
void CXTPChartStackedBarSeriesStyle::DoPropExchange(CXTPPropExchange* pPX)
{
	CXTPChartBarSeriesStyle::DoPropExchange(pPX);

	PX_Double(pPX, _T("StackHeight"), m_dStackHeight, 0);
	PX_Int(pPX, _T("StackGroup"), m_nStackGroup, 0);
}
void CXTPRibbonBuilder::BuildControl(CXTPPropExchange* pPX, CXTPControl* pControl)
{
	CString strName;
	PX_String(pPX, _T("TEXT"), strName);


	CXTPPropExchangeSection pxId(pPX->GetSection(_T("ID")));
	int nId = 0;
	PX_Int(&pxId, _T("VALUE"), nId);


	pControl->SetCaption(strName);
	pControl->SetID(nId);

	CString strKeys;
	PX_String(pPX, _T("KEYS"), strKeys);

	pControl->SetKeyboardTip(strKeys);

	CString strAlwaysLarge;
	PX_String(pPX, _T("ALWAYS_LARGE"), strAlwaysLarge);
	if (strAlwaysLarge == _T("TRUE"))
	{
		pControl->SetStyle(xtpButtonIconAndCaptionBelow);
	}

	int nIndexSmall = -1;
	PX_Int(pPX, _T("INDEX_SMALL"), nIndexSmall);
	if (nIndexSmall >= 0)
	{
		AddImageIndex(nIndexSmall, nId, ICON_SMALL);
	}

	int nIndexLarge = -1;
	PX_Int(pPX, _T("INDEX_LARGE"), nIndexLarge);
	if (nIndexLarge >= 0)
	{
		AddImageIndex(nIndexLarge, nId, ICON_BIG);
	}

}
void CXTPChartRadarAreaSeriesStyle::DoPropExchange(CXTPPropExchange* pPX)
{
	CXTPChartRadarPointSeriesStyle::DoPropExchange(pPX);

	PX_Int(pPX, _T("Transparency"), m_nTransparency, 0);

	CXTPPropExchangeSection secBorder(pPX->GetSection(_T("Border")));
	m_pBorder->DoPropExchange(&secBorder);

	CXTPPropExchangeSection secFillStyle(pPX->GetSection(_T("FillStyle")));
	m_pFillStyle->DoPropExchange(&secFillStyle);
}
void CXTPChartMarker::DoPropExchange(CXTPPropExchange* pPX)
{
	PX_Bool(pPX, _T("BorderVisible"), m_bBorderVisible, TRUE);
	PX_Color(pPX, _T("BorderColor"), m_clrBorderColor);
	PX_Color(pPX, _T("Color"), m_clrColor);
	PX_Enum(pPX, _T("Type"), m_nType, xtpChartMarkerCircle);
	PX_Int(pPX, _T("Size"), m_nSize, 0);
	PX_Bool(pPX, _T("Visible"), m_bVisible, TRUE);

	CXTPPropExchangeSection secFillStyle(pPX->GetSection(_T("FillStyle")));
	m_pFillStyle->DoPropExchange(&secFillStyle);
}
示例#12
0
void CXTPChartTitle::DoPropExchange(CXTPPropExchange* pPX)
{
	PX_Bool(pPX, _T("Visible"), m_bVisible, FALSE);
	PX_Enum(pPX, _T("Docking"), m_nDocking, xtpChartDockTop);
	PX_Enum(pPX, _T("Alignment"), m_nAlignment, xtpChartAlignCenter);
	PX_Bool(pPX, _T("Antialiasing"), m_bAntialiasing, TRUE);
	PX_Int(pPX, _T("Indent"), m_nIndent, 0);
	PX_Color(pPX, _T("TextColor"), m_clrTextColor);
	PX_String(pPX, _T("Text"), m_strText);

	PX_Font(pPX, _T("Font"), m_pFont);
}
void CXTPRibbonBuilder::LoadIcons(CXTPPropExchange* pPX)
{
	CXTPPropExchangeSection pxImage(pPX->GetSection(_T("IMAGE")));
	CXTPPropExchangeSection pxImageId(pxImage->GetSection(_T("ID")));

	int nId = -1;
	PX_Int(&pxImageId, _T("VALUE"), nId);

	if (nId != -1)
	{
		LoadIcons(nId, m_arrImageSmall);
	}


	CXTPPropExchangeSection pxImageSmall(pPX->GetSection(_T("IMAGE_SMALL")));
	CXTPPropExchangeSection pxImageSmallId(pxImageSmall->GetSection(_T("ID")));

	nId = -1;
	PX_Int(&pxImageSmallId, _T("VALUE"), nId);

	if (nId != -1)
	{
		LoadIcons(nId, m_arrImageSmall);
	}


	CXTPPropExchangeSection pxImageLarge(pPX->GetSection(_T("IMAGE_LARGE")));
	CXTPPropExchangeSection pxImageLargeId(pxImageLarge->GetSection(_T("ID")));

	nId = -1;
	PX_Int(&pxImageLargeId, _T("VALUE"), nId);

	if (nId != -1)
	{
		LoadIcons(nId, m_arrImageLarge);
	}
}
void CXTPChartPyramidSeriesStyle::DoPropExchange(CXTPPropExchange* pPX)
{
	CXTPChartSeriesStyle::DoPropExchange(pPX);

	PX_Int(pPX, _T("PointDistance"), m_nPointDistance, 0);

	PX_Double(pPX, _T("HeightToWidthRatio"), m_dHeightToWidthRatio, 1);

	CXTPPropExchangeSection secBorder(pPX->GetSection(_T("Border")));
	m_pBorder->DoPropExchange(&secBorder);

	CXTPPropExchangeSection secFillStyle(pPX->GetSection(_T("FillStyle")));
	m_pFillStyle->DoPropExchange(&secFillStyle);

}
示例#15
0
void CXTPReportColumn::DoPropExchange(CXTPPropExchange* pPX)
{
	PX_Bool(pPX, _T("SortIncreasing"), m_bSortIncreasing, TRUE);
	PX_Bool(pPX, _T("Visible"), m_bVisible, TRUE);
	PX_Int(pPX, _T("Alignment"), m_nAlignment, DT_LEFT);
	PX_Int(pPX, _T("StaticWidth"), m_nColumnStaticWidth, 0);
	PX_Int(pPX, _T("AutoWidth"), m_nColumnAutoWidth, 0);

	if (pPX->GetSchema() > _XTP_SCHEMA_1041)
	{
		PX_Int(pPX, _T("HeaderAlignment"), m_nHeaderAlignment, -1);
		PX_Int(pPX, _T("FooterAlignment"), m_nFooterAlignment, -1);
	}
	if (pPX->GetSchema() >= _XTP_SCHEMA_1310)
	{
		PX_Bool(pPX, _T("PlusMinus"), m_bPlusMinus, FALSE);
		PX_Int(pPX, _T("NextVisualBlock"), m_nNextVisualBlock, 0);
		PX_Int(pPX, _T("OldVisibleIndex"), m_nOldVisibleIndex, -1);
		PX_Bool(pPX, _T("Expanded"), m_bExpanded, TRUE);
	}
}
void CXTPReportHyperlink::DoPropExchange(CXTPPropExchange* pPX)
{
	PX_Int(pPX, _T("HyperTextBegin"), m_nHyperTextBegin);
	PX_Int(pPX, _T("HyperTextLen"), m_nHyperTextLen);
}
void CXTPReportColumns::DoPropExchange(CXTPPropExchange* pPX)
{
	int nItemIndex;
	CString strInternalName;

	if (pPX->IsStoring())
	{
		int nCount = GetCount();

		CXTPPropExchangeEnumeratorPtr pEnumerator(pPX->GetEnumerator(_T("Column")));
		POSITION pos = pEnumerator->GetPosition(nCount, FALSE);

		for (int nColumn = 0; nColumn < nCount; nColumn++)
		{
			CXTPReportColumn* pColumn = GetAt(nColumn);
			CXTPPropExchangeSection secColumn(pEnumerator->GetNext(pos));

			nItemIndex = pColumn->GetItemIndex();
			strInternalName = pColumn->GetInternalName();

			PX_Int(&secColumn, _T("ItemIndex"), nItemIndex);
			PX_String(&secColumn, _T("InternalName"), strInternalName);

			pColumn->DoPropExchange(&secColumn);
		}
	}
	else
	{
		CXTPPropExchangeEnumeratorPtr pEnumerator(pPX->GetEnumerator(_T("Column")));
		POSITION pos = pEnumerator->GetPosition(0, FALSE);

		CXTPReportColumn tmpColumn(0, _T(""), 0);
		int i = 0;
		while (pos)
		{
			CXTPPropExchangeSection secColumn(pEnumerator->GetNext(pos));

			CXTPReportColumn* pColumn = NULL;
			PX_Int(&secColumn, _T("ItemIndex"), nItemIndex, -1);

			if (pPX->GetSchema() > _XTP_SCHEMA_1100)
			{
				PX_String(&secColumn, _T("InternalName"), strInternalName);

				if (!strInternalName.IsEmpty())
				{
					pColumn = Find(strInternalName);

					if (!pColumn && pPX->GetSchema() < _XTP_SCHEMA_1500) // before 15.0 release internal name was equal to caption
					{
						for (int nColumn = 0; nColumn < GetCount(); nColumn++)
						{
							CXTPReportColumn* p = GetAt(nColumn);
							if (p->GetCaption() == strInternalName)
							{
								pColumn = p;
								break;
							}
						}
					}

					// column data is exists but column is not in the collection.
					if (!pColumn)
					{
						// just read data to skeep (to be safe for array serialization)
						tmpColumn.DoPropExchange(&secColumn);
						continue;
					}
				}
			}

			if (!pColumn)
				pColumn = Find(nItemIndex);

			if (!pColumn)
				AfxThrowArchiveException(CArchiveException::badIndex);

			pColumn->DoPropExchange(&secColumn);
			ChangeColumnOrder(i, IndexOf(pColumn));
			i++;
		}
	}

	CXTPPropExchangeSection secGroupsOrder(pPX->GetSection(_T("GroupsOrder")));
	m_pGroupsOrder->DoPropExchange(&secGroupsOrder);

	CXTPPropExchangeSection secSortOrder(pPX->GetSection(_T("SortOrder")));
	m_pSortOrder->DoPropExchange(&secSortOrder);
}
void CXTPCalendarResourcesManager::_Load(CXTPPropExchange* pPX)
{
    if (!pPX || !pPX->IsLoading())
    {
        ASSERT(FALSE);
        return;

    }

    // Clear previous configuration.
    // Data providers will be saved and closed if this was specified.
    RemoveAll();

    pPX->ExchangeLocale();

    CXTPPropExchangeSection secDPs(pPX->GetSection(_T("DataProviders")));

    //int nDPCount = GetDataProvidersCount();
    CXTPPropExchangeEnumeratorPtr ptrEnumDPs(secDPs->GetEnumerator(_T("DataProvider")));
    POSITION posStorage = ptrEnumDPs->GetPosition();

    while (posStorage)
    {
        CString strConnStr;

        CXTPPropExchangeSection secDP(ptrEnumDPs->GetNext(posStorage));
        PX_String(&secDP, _T("ConnectionString"), strConnStr);

        if (!strConnStr.IsEmpty())
        {
            const int eDPFAll = xtpCalendarDPF_CreateIfNotExists |
                                xtpCalendarDPF_SaveOnDestroy |
                                xtpCalendarDPF_CloseOnDestroy;
            AddDataProvider(strConnStr, eDPFAll);
        }
    }

    //---------------------
    CXTPPropExchangeSection secResources(pPX->GetSection(_T("Resources")));

    CXTPPropExchangeEnumeratorPtr ptrEnumRCs(secResources->GetEnumerator(_T("Resource")));
    posStorage = ptrEnumRCs->GetPosition();

    while (posStorage)
    {
        CXTPPropExchangeSection secRC(ptrEnumRCs->GetNext(posStorage));
        CString strName;
        PX_String(&secRC, _T("Name"), strName);
        BOOL bAdded = AddResource(strName, FALSE);

        int nRCCount = GetResourcesCount();
        if (!bAdded || !nRCCount)
        {
            ASSERT(FALSE);
            continue;
        }

        CXTPCalendarResourceDescription* pRCdesc = GetResource(nRCCount - 1);
        if (!pRCdesc || !pRCdesc->m_ptrResource)
        {
            ASSERT(FALSE);
            continue;
        }

        PX_Bool(&secRC, _T("Enabled"), pRCdesc->m_bEnabled);
        PX_Bool(&secRC, _T("GenerateName"), pRCdesc->m_bGenerateName);


        //**********
        CString strConnStr;
        PX_String(&secRC, _T("ConnectionString"), strConnStr);
        CXTPCalendarData* pRCdp = GetDataProvider(strConnStr);
        pRCdesc->m_ptrResource->SetDataProvider(pRCdp);

        int nSchIdsCount = 0;
        PX_Int(&secRC, _T("SchedulesCount"), nSchIdsCount);

        if (nSchIdsCount)
        {
            CXTPPropExchangeEnumeratorPtr ptrEnumSchIDs(secRC->GetEnumerator(_T("Schedules")));
            POSITION posSchID = ptrEnumSchIDs->GetPosition();

            while (posSchID)
            {
                CXTPPropExchangeSection secSchID(ptrEnumSchIDs->GetNext(posSchID));
                ULONG ulSchID = 0;
                if (PX_ULong(&secSchID, _T("ScheduleID"), ulSchID))
                {
                    if (pRCdesc->m_ptrResource->GetSchedules())
                    {
                        pRCdesc->m_ptrResource->GetSchedules()->Add(ulSchID);
                    }
                }
            }
        }
    }
}
void CXTPCalendarResourcesManager::_Save(CXTPPropExchange* pPX)
{
    if (!pPX || !pPX->IsStoring())
    {
        ASSERT(FALSE);
        return;

    }
    pPX->ExchangeLocale();

    CXTPPropExchangeSection secDPs(pPX->GetSection(_T("DataProviders")));

    int nDPCount = GetDataProvidersCount();
    CXTPPropExchangeEnumeratorPtr ptrEnumDPs(secDPs->GetEnumerator(_T("DataProvider")));
    POSITION posStorage = ptrEnumDPs->GetPosition(nDPCount);

    for (int nDRNr = 0; nDRNr < nDPCount; nDRNr++)
    {
        CXTPCalendarData* pDP = GetDataProvider(nDRNr);
        ASSERT(pDP);
        if (!pDP)
        {
            continue;
        }

        CString strConnStr = pDP->GetConnectionString();

        CXTPPropExchangeSection secDP(ptrEnumDPs->GetNext(posStorage));
        PX_String(&secDP, _T("ConnectionString"), strConnStr);
    }

    //---------------------
    CXTPPropExchangeSection secResources(pPX->GetSection(_T("Resources")));

    int nRCCount = GetResourcesCount();
    CXTPPropExchangeEnumeratorPtr ptrEnumRCs(secResources->GetEnumerator(_T("Resource")));
    posStorage = ptrEnumRCs->GetPosition(nRCCount);

    for (int nRCNr = 0; nRCNr < nRCCount; nRCNr++)
    {
        CXTPCalendarResourceDescription* pRCdesc = GetResource(nRCNr);
        if (!pRCdesc || !pRCdesc->m_ptrResource)
        {
            ASSERT(FALSE);
            continue;
        }

        CXTPPropExchangeSection secRC(ptrEnumRCs->GetNext(posStorage));

        CString strRCName = pRCdesc->m_ptrResource->GetName();
        PX_String(&secRC, _T("Name"), strRCName);
        PX_Bool(&secRC, _T("Enabled"), pRCdesc->m_bEnabled);
        PX_Bool(&secRC, _T("GenerateName"), pRCdesc->m_bGenerateName);

        CXTPCalendarData* pRCdp = pRCdesc->m_ptrResource->GetDataProvider();
        if (pRCdp)
        {
            CString strConnStr = pRCdp->GetConnectionString();
            PX_String(&secRC, _T("ConnectionString"), strConnStr);

            int nSchIdsCount = 0;
            if (pRCdesc->m_ptrResource->GetSchedules())
            {
                nSchIdsCount = (int)pRCdesc->m_ptrResource->GetSchedules()->GetSize();
            }
            PX_Int(&secRC, _T("SchedulesCount"), nSchIdsCount);

            CXTPPropExchangeEnumeratorPtr ptrEnumSchIDs(secRC->GetEnumerator(_T("Schedules")));
            POSITION posSchID = ptrEnumSchIDs->GetPosition(nSchIdsCount);

            for (int k = 0; k < nSchIdsCount; k++)
            {
                CXTPPropExchangeSection secSchID(ptrEnumSchIDs->GetNext(posSchID));
                ULONG ulSchID = pRCdesc->m_ptrResource->GetSchedules()->GetAt(k);
                PX_ULong(&secSchID, _T("ScheduleID"), ulSchID);
            }
        }
    }
}
void CXTPChartRadarPointSeriesLabel::DoPropExchange(CXTPPropExchange* pPX)
{
    CXTPChartSeriesLabel::DoPropExchange(pPX);

    PX_Int(pPX, _T("Angle"), m_nAngle, 45);
}
示例#21
0
void CXTPChartBorder::DoPropExchange(CXTPPropExchange* pPX)
{
	PX_Bool(pPX, _T("Visible"), m_bVisible, TRUE);
	PX_Int(pPX, _T("Thickness"), m_nThickness, 1);
	PX_Color(pPX, _T("Color"), m_clrColor);
}