本文整理汇总了C++中WorkSpace::InitWorkSpace方法的典型用法代码示例。如果您正苦于以下问题:C++ WorkSpace::InitWorkSpace方法的具体用法?C++ WorkSpace::InitWorkSpace怎么用?C++ WorkSpace::InitWorkSpace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WorkSpace
的用法示例。
在下文中一共展示了WorkSpace::InitWorkSpace方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: btAddSubHeadClick
void __fastcall TDesignFrm::btAddSubHeadClick(TObject *Sender)
{
String key = vleHeadDef->Keys[vleHeadDef->Row];
if(key == "")
{
ShowMessage("请先选择封包头!");
return;
}
String fileName;
if(InputQuery("输入文件名(不加后缀)", "输入文件名(不加后缀)", fileName))
{
if(fileName == "")
return;
if(fileName.Pos("."))
fileName = LeftString(fileName, ".");
fileName += ".eggxp";
WorkSpace * selWorkSpace = m_WorkSpaceManager->CreateNewWorkSpace();
selWorkSpace->InitWorkSpace(m_WorkSpaceManager->GetFilePath(),
fileName, key);
selWorkSpace->SaveToFile();
m_WorkSpaceManager->ReloadWorkSpacePack();
WorkspaceToGUI();
}
}
示例2: btStartNewClick
void __fastcall TDesignFrm::btStartNewClick(TObject *Sender)
{
if(SourceGenDesignFrm->StartDesign() == false)
return;
String fileName, head, subHead;
m_WorkSpaceManager->BeginUpdate();
for(int i=0; i<SourceGenDesignFrm->GetHeadCount(); i++)
{
for(int j=0; j<SourceGenDesignFrm->GetSubHeadCount(); j++)
{
head = IntToHex(i+1, 2);
subHead = IntToHex(j+1, 2);
fileName = FormatStr("Pack_%s_%s.eggxp", head, subHead);
WorkSpace * selWorkSpace = m_WorkSpaceManager->CreateNewWorkSpace();
selWorkSpace->InitWorkSpace(m_WorkSpaceManager->GetFilePath(),
fileName, head + " " + subHead);
selWorkSpace->GetFileManager()->CreateNew();
selWorkSpace->SaveToFile();
}
}
m_WorkSpaceManager->ReloadWorkSpacePack();
WorkspaceToGUI();
m_WorkSpaceManager->EndUpdate();
}
示例3: btClearHeadDefClick
void __fastcall TDesignFrm::btClearHeadDefClick(TObject *Sender)
{
int result = Application->MessageBox(L"这个清空动作会清空所有文件! 是否继续?",L"删除询问",MB_OKCANCEL);
if(result == IDCANCEL)
{
return;
}
m_WorkSpaceManager->BeginUpdate();
for(int i=m_WorkSpaceManager->GetWorkSpaceCount()-1; i>=0; i--)
{
m_WorkSpaceManager->DeleteWorkSpace(i);
}
//添加一条新数据
String head = IntToHex(0, 2);
String subHead = IntToHex(0, 2);
String fileName = FormatStr("Pack_%s_%s.eggxp", head, subHead);
WorkSpace * selWorkSpace = m_WorkSpaceManager->CreateNewWorkSpace();
selWorkSpace->InitWorkSpace(m_WorkSpaceManager->GetFilePath(),
fileName, head);
selWorkSpace->GetFileManager()->CreateNew();
selWorkSpace->SaveToFile();
m_WorkSpaceManager->ReloadWorkSpacePack();
WorkspaceToGUI();
m_WorkSpaceManager->EndUpdate();
}