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.
kev/Drawer/Module/GeoSigmaDraw/InterfaceLegend.cpp

59 lines
1.2 KiB
C++

1 month ago
#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: ͼ<><CDBC><EFBFBD>ǿ<EFBFBD>ָ<EFBFBD><D6B8>\n");
return;
}
if (rows <= 0)
{
TRACE("rows: <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>С0\n");
return;
}
if (layerNames == nullptr)
{
TRACE("layerNames: ͼ<><CDBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǿ<EFBFBD>ָ<EFBFBD><D6B8>\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));
}
}
1 month ago
extern "C" __declspec(dllexport)
bool CreateLegendFull(
CSigmaView* pView,
LPCTSTR layerName,
double xMin,
double yMin,
double xMax,
double yMax)
{
if (pView == nullptr || pView->m_pDoc == nullptr || pView->m_pDoc->m_pXy == nullptr)
{
TRACE("%s: <20>Ƿ<EFBFBD> view <20><><EFBFBD><EFBFBD> document ָ<><D6B8>\n", __FUNCTION__);
return false;
}
}