mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-16 06:05:58 -06:00
31 lines
No EOL
786 B
C++
31 lines
No EOL
786 B
C++
#include "Browser.h"
|
|
|
|
bool IsTopicGroup(const char *path)
|
|
{
|
|
return ToLower(GetFileExt(path)) == ".tpp" && (!IsFullPath(path) || !FileExists(path));
|
|
}
|
|
|
|
struct TopicModule : public IdeModule {
|
|
virtual String GetID() { return "TopicModule"; }
|
|
|
|
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->PersistentFindReplace(TheIde()->IsPersistentFindReplace());
|
|
d->Open(path);
|
|
return d;
|
|
}
|
|
return NULL;
|
|
}
|
|
virtual void Serialize(Stream& s) {
|
|
TopicEditor::SerializeEditPos(s);
|
|
}
|
|
};
|
|
|
|
void InitializeTopicModule()
|
|
{
|
|
RegisterIdeModule(Single<TopicModule>());
|
|
} |