本文整理汇总了C++中Panel::GetUndoerCtrl方法的典型用法代码示例。如果您正苦于以下问题:C++ Panel::GetUndoerCtrl方法的具体用法?C++ Panel::GetUndoerCtrl怎么用?C++ Panel::GetUndoerCtrl使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Panel
的用法示例。
在下文中一共展示了Panel::GetUndoerCtrl方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fis
void
Project::Load(wxWindow *parent, MenuState *menu, const wxString& filename)
{
wxString type = GetProjectType(filename);
New(parent, menu, type);
wxFileInputStream fis(filename);
int first = fis.Peek();
if (first == 0x1b)
{
// Binary format.
fis.GetC();
LuaInputStream lis(&fis);
l_instance->LoadBinary(lis);
}
else
{
// XML format.
l_instance->LoadXML(fis);
}
// Clear Undo data of all panels.
size_t count = l_instance->GetPageCount();
for (size_t index = 0; index < count; index++)
{
Panel *panel = (Panel *)l_instance->GetPage(index);
panel->GetUndoerCtrl()->Clear();
panel->GetGraphCtrl()->GraphCanvas::Redraw(true);
panel->GetGraphCtrl()->GenerateCode();
}
}
示例2: dialog
int
Shader::ConfirmSave()
{
Project* project = Project::GetProject();
bool modified = false;
if (project != 0)
{
int count = (int)project->GetPageCount();
for (int index = 0; index < count; index++)
{
Panel* panel = (Panel *)project->GetPage(index);
modified = modified || panel->GetUndoerCtrl()->IsDirty();
}
}
if (modified)
{
wxString message = wxT("Save changes to ");
if (m_FileName.IsEmpty())
{
message.Append(wxT("(untitled)"));
}
else
{
message.Append(m_FileName);
}
message.Append('?');
wxMessageDialog dialog(this, message, wxT("Confirm"), wxYES_NO | wxCANCEL);
int choice = dialog.ShowModal();
if (choice == wxID_YES)
{
return Save();
}
return choice;
}
return wxID_YES;
}
示例3:
void
Shader::OnCommand(wxCommandEvent& evt)
{
Project *project = Project::GetProject();
Panel *panel;
Undoer *undoer;
Graph *graph;
if (project != NULL)
{
panel = project->GetPanel();
if (panel != NULL)
{
undoer = panel->GetUndoerCtrl();
graph = panel->GetGraphCtrl();
}
}
switch (evt.GetId())
{
case wxID_OPEN:
Open();
break;
case wxID_SAVE:
Save();
break;
case wxID_SAVEAS:
SaveAs();
break;
case wxID_EXIT:
Close(false);
break;
case wxID_UNDO:
undoer->Undo();
break;
case wxID_REDO:
undoer->Redo();
break;
case wxID_CUT:
graph->Cut();
break;
case wxID_COPY:
graph->Copy();
break;
case wxID_PASTE:
graph->Paste();
break;
case wxID_DUPLICATE:
graph->Duplicate();
break;
case wxID_GROUP:
graph->GroupNodes();
break;
case wxID_UNGROUP:
graph->UngroupNodes();
break;
case wxID_SAVEGROUP:
graph->SaveGroup();
break;
case wxID_COPYMETAFILE:
graph->CopyAsMetafile();
break;
case wxID_CONFIGURE:
project->Configure();
break;
case wxID_RELOADLIBS:
//project->ReloadLibs();
break;
}
}
示例4: if
//.........这里部分代码省略.........
}
l_instance = NEW(Project, (parent, type));
// Load the XML project description.
Debug::Printf(TXT("Parsing \"%s\".\n"), l_Types[type].c_str());
wxXmlDocument xml;
if (!xml.Load(l_Types[type]))
{
THROW(TXT("Couldn't parse the XML file."));
}
if (xml.GetRoot()->GetName() != wxT("project"))
{
THROW(TXT("Root node isn't <project>."));
}
//wxArrayString groups = NodeLibrary::AddUserNodes();
//wxString grpfile(g_FragmentShaderLibPath);
//grpfile.Append(wxT("nodes\\user.xml"));
//wxArrayString groups = NodeLibrary::Add(grpfile);
wxXmlNode *child = xml.GetRoot()->GetChildren();
while (child != 0)
{
if (child->GetType() == wxXML_COMMENT_NODE)
{
child = child->GetNext();
continue;
}
if (child->GetName() == wxT("panel"))
{
wxString name;
if (!child->GetPropVal(wxT("name"), &name))
{
THROW(TXT("Couldn't find attribute 'name' in element <panel>."));
}
Panel *panel = NEW(Panel, (l_instance, state->Clone()));
panel->Freeze();
l_instance->AddPage(panel, name);
Debug::Printf(TXT("Panel \"%s\" (%p) created.\n"), name.c_str(), panel);
wxXmlNode *child2 = child->GetChildren();
/*
for (size_t i = 0; i < groups.GetCount(); i++)
{
panel->AddToTree(groups[i]);
Debug::Printf(TXT("Group \"%s\" added to panel %p.\n"), groups[i].c_str(), panel);
}
*/
while (child2 != 0)
{
if (child2->GetType() == wxXML_COMMENT_NODE)
{
child2 = child2->GetNext();
continue;
}
if (child2->GetName() == wxT("add-library"))
{
wxString path;
if (!child2->GetPropVal(wxT("path"), &path))
{
THROW(TXT("Couldn't find attribute 'path' in element <add-library>."));
}
panel->LoadLibrary(path);
Debug::Printf(TXT("Library \"%s\" added to panel %p.\n"), path, panel);
}
else if (child2->GetName() == wxT("add-node"))
{
wxString type;
if (!child2->GetPropVal(wxT("type"), &type))
{
THROW(TXT("Couldn't find attribute 'type' in element <add-node>."));
}
wxString deletable = child2->GetPropVal(wxT("deletable"), wxT("false"));
panel->AddNode(type, deletable == wxT("true"));
Debug::Printf(TXT("Node \"%s\" added to panel %p.\n"), type.c_str(), panel);
}
else
{
Debug::Printf(TXT("\tInvalid element <%s> in <panel>.\n"), child2->GetName().c_str());
}
child2 = child2->GetNext();
}
panel->Thaw();
}
else
{
Debug::Printf(TXT("\tInvalid element <%s> in <project>.\n"), child->GetName().c_str());
}
child = child->GetNext();
}
// Delete the menu state (it has been cloned for each panel.)
DESTROY(state);
// Load the panels configuration.
l_instance->LoadConfig();
// Clear Undo data of all panels.
size_t count = l_instance->GetPageCount();
for (size_t index = 0; index < count; index++)
{
Panel *panel = (Panel *)l_instance->GetPage(index);
panel->GetUndoerCtrl()->Clear();
}
}