ultimatepp/uppsrc/ide/Browser/TopicI.icpp
cxl dbea8f9458 Topic++ improvements: Search in code reference
git-svn-id: svn://ultimatepp.org/upp/trunk@400 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2008-09-06 12:55:00 +00:00

27 lines
593 B
Text

#include "Browser.h"
bool IsTopicGroup(const char *path)
{
return ToLower(GetFileExt(path)) == ".tpp" && !FileExists(path);
}
struct TopicModule : public IdeModule {
virtual Image FileIcon(const char *path) {
return IsTopicGroup(path) ? TopicImg::Group() : Null;
}
virtual IdeDesigner *CreateDesigner(const char *path, byte cs) {
if(IsTopicGroup(path)) {
TopicEditor *d = new TopicEditor;
d->Open(path);
return d;
}
return false;
}
virtual void Serialize(Stream& s) {
TopicEditor::SerializeEditPos(s);
}
};
INITBLOCK {
RegisterIdeModule(Single<TopicModule>());
}