text
stringlengths 0
2.2M
|
---|
NewGUIComponentWizard (Project& proj)
|
: project (proj)
|
{}
|
String getName() override { return "GUI Component"; }
|
void createNewFile (Project& p, Project::Item parent) override
|
{
|
jassert (&p == &project);
|
askUserToChooseNewFile (String (defaultClassName) + ".h", "*.h;*.cpp", parent, [this, parent] (File newFile) mutable
|
{
|
if (newFile != File())
|
{
|
auto headerFile = newFile.withFileExtension (".h");
|
auto cppFile = newFile.withFileExtension (".cpp");
|
headerFile.replaceWithText (String());
|
cppFile.replaceWithText (String());
|
auto& odm = ProjucerApplication::getApp().openDocumentManager;
|
if (auto* cpp = dynamic_cast<SourceCodeDocument*> (odm.openFile (&project, cppFile)))
|
{
|
if (auto* header = dynamic_cast<SourceCodeDocument*> (odm.openFile (&project, headerFile)))
|
{
|
std::unique_ptr<JucerDocument> jucerDoc (new ComponentDocument (cpp));
|
if (jucerDoc != nullptr)
|
{
|
jucerDoc->setClassName (newFile.getFileNameWithoutExtension());
|
jucerDoc->flushChangesToDocuments (&project, true);
|
jucerDoc.reset();
|
for (auto* doc : { cpp, header })
|
{
|
doc->saveAsync ([doc] (bool)
|
{
|
ProjucerApplication::getApp()
|
.openDocumentManager
|
.closeDocumentAsync (doc, OpenDocumentManager::SaveIfNeeded::yes, nullptr);
|
});
|
}
|
parent.addFileRetainingSortOrder (headerFile, true);
|
parent.addFileRetainingSortOrder (cppFile, true);
|
}
|
}
|
}
|
}
|
});
|
}
|
Project& project;
|
};
|
NewFileWizard::Type* createGUIComponentWizard (Project&);
|
NewFileWizard::Type* createGUIComponentWizard (Project& p)
|
{
|
return new NewGUIComponentWizard (p);
|
}
|
// bslma_sharedptrinplacerep_cpp03.cpp -*-C++-*-
|
// Automatically generated file. **DO NOT EDIT**
|
// Generated on Fri Oct 23 15:03:59 2020
|
// Command line: sim_cpp11_features.pl bslma_sharedptrinplacerep.cpp
|
#define INCLUDED_BSLMA_SHAREDPTRINPLACEREP_CPP03 // Disable inclusion
|
#include <bslma_sharedptrinplacerep_cpp03.h> // Pro-forma #include
|
// Empty file except when compiling bslma_sharedptrinplacerep.cpp
|
#ifdef COMPILING_BSLMA_SHAREDPTRINPLACEREP_CPP
|
// No C++03 Expansion
|
#endif // defined(COMPILING_BSLMA_SHAREDPTRINPLACEREP_CPP)
|
// ----------------------------------------------------------------------------
|
// Copyright 2020 Bloomberg Finance L.P.
|
//
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
// you may not use this file except in compliance with the License.
|
// You may obtain a copy of the License at
|
//
|
// http://www.apache.org/licenses/LICENSE-2.0
|
//
|
// Unless required by applicable law or agreed to in writing, software
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
// See the License for the specific language governing permissions and
|
// limitations under the License.
|
// ----------------------------- END-OF-FILE ----------------------------------
|
/*
|
Copyright 2009-2020, Sumeet Chhetri
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.