mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
Added iccp file handling for new file
git-svn-id: svn://ultimatepp.org/upp/trunk@9908 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
15e4324ddd
commit
f64ff01ced
2 changed files with 18 additions and 6 deletions
|
|
@ -283,11 +283,18 @@ struct WorkspaceWork {
|
|||
|
||||
class FileType : public Moveable<FileType> {
|
||||
public:
|
||||
FileType()
|
||||
: separator(true)
|
||||
{}
|
||||
|
||||
FileType(const String& name, const String& extension)
|
||||
: name(name)
|
||||
: separator(false)
|
||||
, name(name)
|
||||
, extension(extension)
|
||||
{}
|
||||
|
||||
bool IsSeparator() const { return separator; }
|
||||
|
||||
String GetName() const { return name; }
|
||||
String GetExtension() const { return extension; }
|
||||
const Image& GetImage() const { return img; }
|
||||
|
|
@ -295,6 +302,8 @@ struct WorkspaceWork {
|
|||
void SetImage(const Image& image) { img = image; }
|
||||
|
||||
private:
|
||||
bool separator;
|
||||
|
||||
String name;
|
||||
String extension;
|
||||
Image img;
|
||||
|
|
|
|||
|
|
@ -934,7 +934,10 @@ void WorkspaceWork::NewMenu(Bar& bar)
|
|||
String name = fileType.GetName();
|
||||
String extension = fileType.GetExtension();
|
||||
|
||||
subBar.Add(name, fileType.GetImage(), THISBACK2(NewPackageFile, "New " + name, extension));
|
||||
if (fileType.IsSeparator())
|
||||
subBar.Separator();
|
||||
else
|
||||
subBar.Add(name, fileType.GetImage(), THISBACK2(NewPackageFile, "New " + name, extension));
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -1155,6 +1158,8 @@ void WorkspaceWork::LoadCategories()
|
|||
uppFiles.Add(FileType("Image file", "iml"));
|
||||
uppFiles.Add(FileType("Escape script file", "usc"));
|
||||
uppFiles.Add(FileType("Skylark template file", "witz"));
|
||||
uppFiles.Add(FileType());
|
||||
uppFiles.Add(FileType("C++ initialization source file", "icpp"));
|
||||
categories.Add("U++", uppFiles);
|
||||
|
||||
Vector<FileType> javaFiles;
|
||||
|
|
@ -1176,11 +1181,9 @@ void WorkspaceWork::LoadCategories()
|
|||
|
||||
void WorkspaceWork::LoadCategoriesImages()
|
||||
{
|
||||
for (int i = 0; i < categories.GetCount(); i++) {
|
||||
for (FileType& type : categories[i]) {
|
||||
for (int i = 0; i < categories.GetCount(); i++)
|
||||
for (FileType& type : categories[i])
|
||||
type.SetImage(IdeFileImage("." + type.GetExtension(), false, false));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
WorkspaceWork::WorkspaceWork()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue