You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
931 B
C++
41 lines
931 B
C++
#include "stdafx.h"
|
|
#include "Legend.h"
|
|
#include "ActionAddItem.h"
|
|
#include "SigmaView.h"
|
|
#include "Util.h"
|
|
|
|
std::unique_ptr<COne> XyLegendCreate(CXy& xy, double x, double y, double width, int rows, LPCTSTR layerNames);
|
|
|
|
extern "C" __declspec(dllexport)
|
|
void LegendAdd(CSigmaView* pView, double x, double y, double width, int rows, LPCTSTR layerNames)
|
|
{
|
|
if (pView == nullptr || pView->m_pDoc == nullptr || pView->m_pDoc->m_pXy == nullptr)
|
|
{
|
|
TRACE("pView: 图件是空指针\n");
|
|
return;
|
|
}
|
|
|
|
if (rows <= 0)
|
|
{
|
|
TRACE("rows: 行数必须大小0\n");
|
|
return;
|
|
}
|
|
|
|
if (layerNames == nullptr)
|
|
{
|
|
TRACE("layerNames: 图层名不能是空指针\n");
|
|
return;
|
|
}
|
|
|
|
CXy& xy = *pView->m_pDoc->m_pXy;
|
|
|
|
std::unique_ptr<COne> pOne = XyLegendCreate(xy, x, y, width, rows, layerNames);
|
|
|
|
if (pOne)
|
|
{
|
|
COne* ptr = pOne.release();
|
|
xy.AddTailOne(ptr);
|
|
pView->m_pDoc->SetActionItem(new CActionAddItem(pView->m_pDoc, IDS_STRING_ACTION_ADD, ptr));
|
|
}
|
|
}
|