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.
85 lines
2.0 KiB
C++
85 lines
2.0 KiB
C++
#include "StdAfx.h"
|
|
#include ".\itemsavetomark.h"
|
|
//#include "itemfocusrect.h"
|
|
#include "SigmaDoc.h"
|
|
#include "SigmaView.h"
|
|
|
|
CItemSaveToMark::CItemSaveToMark(CSigmaDoc* ppDoc)
|
|
: CItemFocusRect(ppDoc)
|
|
, m_MarkName(_T(""))
|
|
, m_FileName(_T(""))
|
|
{
|
|
SetType(ITEM_SAVE_TO_MARK);
|
|
SetUpdatePropertyGridState(false);
|
|
m_rect.SetRect(-0.5,0.5,0.5,-0.5);
|
|
}
|
|
|
|
CItemSaveToMark::~CItemSaveToMark(void)
|
|
{
|
|
}
|
|
|
|
void CItemSaveToMark::DoLButtonUp(CDC* pDC)
|
|
{
|
|
/*CPropertiesSheet sheet(IDS_GI_SAVE_TO_MARK,GetView(),0,FALSE);
|
|
sheet.SetItem(this);
|
|
if(sheet.DoModal()!=IDOK)
|
|
{
|
|
GetDoc()->EnableDefaultTool();
|
|
return;
|
|
}*/
|
|
CRect8 rect=GetRect();
|
|
/*CList<POSITION,POSITION> select;
|
|
GetDoc()->GetDraw()->IsInRange(rect,select);
|
|
if(select.GetCount()>0)
|
|
{
|
|
CStdioFile sfw;
|
|
if(!sfw.Open(m_FileName,CFile::modeCreate|CFile::modeWrite|CFile::modeNoTruncate))
|
|
{
|
|
::AfxMessageBox(IDS_STRING_OPEN_WRITE_ERROR);
|
|
GetDoc()->EnableDefaultTool();
|
|
return;
|
|
}
|
|
sfw.SeekToEnd();
|
|
|
|
CFile &fw=*(CFile*)&sfw;
|
|
CString str;
|
|
str.Format("New %s",m_MarkName); AfxGetPublicFunction()->WriteLine(fw,str);
|
|
|
|
GetDoc()->BeginProgress(IDS_STRING_WriteFile);
|
|
GetDoc()->GetDraw()->DFD_Write(fw,select);
|
|
GetDoc()->EndProgress();
|
|
|
|
AfxGetPublicFunction()->WriteLine(fw,"EndNew");
|
|
select.RemoveAll();
|
|
fw.Close();
|
|
}
|
|
GetDoc()->EnableDefaultTool();*/
|
|
}
|
|
|
|
BOOL CItemSaveToMark::InitPropertyGrid()//CXTPPropertyGrid& grid
|
|
{
|
|
/*CPropertyGridItemAdd ItemAdd(NULL);
|
|
|
|
CXTPPropertyGridItem* pItem=grid.AddCategory(IDS_GI_SAVE_TO_MARK);
|
|
ItemAdd.SetItem(pItem); pItem->Expand();
|
|
|
|
CString filter;filter=_T("Doublefox Mark Files(*.dfm)|*.dfm|All Files(*.*)|*.*||");
|
|
ItemAdd.AddItemFileBox(TRUE, IDS_GI_SAVEMARK_FILE,_T("*.dfm"), m_FileName,&m_FileName, filter);
|
|
ItemAdd.AddItemString(IDS_GI_MARK_NAME, m_MarkName, &m_MarkName);
|
|
ItemAdd.AddItemRect(IDS_MARK_RANGE, m_rect, &m_rect);*/
|
|
|
|
return TRUE;
|
|
}
|
|
|
|
//BOOL CItemSaveToMark::OnGridItemChangeValue(CXTPPropertyGridItem* pItem)
|
|
//{
|
|
// BOOL bUpdate=TRUE;
|
|
// switch(pItem->GetID())
|
|
// {
|
|
// case 0:
|
|
// bUpdate=FALSE;
|
|
// break;
|
|
// }
|
|
// return bUpdate;
|
|
//}
|