#include "stdafx.h" #include "SigmaView.h" #include "SectionDoc.h" #include "ItemAlign.h" #include "ItemSelect.h" static CItemAlign * getItemAlign(CSigmaView * pView) { CItem * pItem = pView->GetItem(); if (pItem == NULL) return NULL; CItemAlign * alignItem = dynamic_cast(pItem); return alignItem; } //alignmentType:1=左对齐 2=顶对齐 3=右对齐 4=底对齐 5=水平居中 6=垂直居中 extern "C" __declspec(dllexport) int Alignment_Align(CSigmaView * pView, int alignmentType) { if (pView == NULL) return -1; if (pView->m_pDoc == NULL) return -1; if (alignmentType < 1 || alignmentType>6) return -1; //CItemSelect * select = GetItemSelectFromView(pView); //if (select == 0) // return -1; CPositionList selectionSet; pView->m_pDoc->GetSelectionSet(selectionSet); CItemAlign alignMent(pView->m_pDoc); alignMent.Align(selectionSet, alignmentType); if (!selectionSet.IsEmpty()) pView->m_pDoc->Modified(); return 1; }