import "IDESettings"
import "SettingsDialog"
+IDESettings ideSettings;
+
+IDESettingsContainer settingsContainer
+{
+ dataOwner = &ideSettings;
+ dataClass = class(IDESettings);
+};
+
static Context globalContext { };
static OldList defines { };
static OldList imports { };
"<:ecere>constructs/propertyPrivate.png"
};
-IDESettings settings { }; // instantiate the IDESettings class from the IDESettings.ec file. Do this at a global level so that all methods can access settings.
-
-IDESettingsContainer settingsContainer
-{
- driver = "JSON";
- data = settings;
- dataOwner = &settings;
-};
-
void GetTemplateString(Class c, char * templateString)
{
Module m = c.module.application;
ChangeExtension(docPath, "econ", docPath);
path[0] = 0;
- strcpy(path, settings.docDir);
+ strcpy(path, ideSettings.docDir);
PathCatSlash(path, docPath);
}
File f = FileOpen(filePath, read);
if(f)
{
- eCONParser parser { f = f };
+ ECONParser parser { f = f };
JSONResult jsonResult = parser.GetObject(cl ? class(ClassDoc) : class(NamespaceDoc), &doc);
delete parser;
delete f;
char * desc = ReadDoc(module, nameSpaceDoc, nameSpace, description, null);
if(desc)
{
- f.Printf($"<H3>Description</H3><br><br>\n");
+ f.Printf($"<H3>Description</H3><BR>\n");
if(editing)
{
char fileName[MAX_LOCATION];
FigureFileName(fileName, module, nameSpaceDoc, nameSpace, description, null);
f.Printf("<a style=\"text-decoration:none;\" href=\"edit://%s\">", fileName);
f.Puts(desc);
- f.Printf("</a><br><br>");
+ f.Printf("</a>");
}
else
- f.Printf("%s<br><br>", desc);
+ f.Printf("%s", desc);
+ f.Printf("<br><br><br>");
delete desc;
}
}
char * desc = ReadDoc(module, nameSpaceDoc, ns, description, null);
if(first)
{
- f.Printf($"<H3>Sub Namespaces</H3><br><br>\n");
+ f.Printf($"<H3>Sub Namespaces</H3><BR>\n");
f.Printf("<TABLE>\n");
first = false;
}
f.Printf("</TR><br>\n");
}
if(!first)
- f.Printf("</TABLE><br>\n");
+ f.Printf("</TABLE><br><br>\n");
}
if(nameSpace->classes.first)
for(link = (BTNamedLink)nameSpace->classes.first; link; link = (BTNamedLink)((BTNode)link).next)
{
Class cl = link.data;
- if(!cl.templateClass)
+ Module module = cl.module ? cl.module : this.module;
+ if(!cl.templateClass) // && !cl.internalDecl)
{
char * desc = ReadDoc(module, classDoc, cl, description, null);
if(first)
{
- f.Printf($"<a name=Classes></a><H3>Classes</H3><br><br>\n");
+ f.Printf($"<a name=Classes></a><H3>Classes</H3><BR>\n");
f.Printf("<TABLE>\n");
first = false;
}
}
}
if(!first)
- f.Printf("</TABLE><br>\n");
+ f.Printf("</TABLE><br><br>\n");
}
if(nameSpace->functions.first)
for(link = (BTNamedLink)nameSpace->functions.first; link; link = (BTNamedLink)((BTNode)link).next)
{
GlobalFunction function = link.data;
+ Module module = function.module ? function.module : this.module;
char * desc = ReadDoc(module, functionDoc, function, description, null);
const char * name = RSearchString(function.name, "::", strlen(function.name), true, false);
if(name) name += 2; else name = function.name;
if(first)
{
- f.Printf($"<a name=Functions></a><H3>Functions</H3><br><br>\n");
+ f.Printf($"<a name=Functions></a><H3>Functions</H3><BR>\n");
f.Printf("<TABLE>\n");
first = false;
}
f.Printf("</TR><br>\n");
}
if(!first)
- f.Printf("</TABLE><br>\n");
+ f.Printf("</TABLE><br><br>\n");
}
if(nameSpace->defines.first)
char * desc = ReadDoc(module, nameSpaceDoc, nameSpace, definition, def);
if(first)
{
- f.Printf($"<a name=Definitions></a><H3>Definitions</H3><br><br>\n");
+ f.Printf($"<a name=Definitions></a><H3>Definitions</H3><BR>\n");
f.Printf("<TABLE>\n");
first = false;
}
f.Printf("</TR><br>\n");
}
if(!first)
- f.Printf("</TABLE><br>\n");
+ f.Printf("</TABLE><br><br>\n");
}
f.Printf("</FONT></BODY></HTML>\n");
char * desc = ReadDoc(module, classDoc, cl, description, null);
if(desc)
{
- f.Printf($"<br><H3>Description</H3><br><br>\n");
+ f.Printf($"<br><H3>Description</H3><BR>\n");
if(editing)
{
char fileName[MAX_LOCATION];
FigureFileName(fileName, module, classDoc, cl, description, null);
f.Printf("<a style=\"text-decoration:none;\" href=\"edit://%s\">", fileName);
f.Puts(desc);
- f.Printf("</a><br><br>");
+ f.Printf("</a>");
}
else
- f.Printf("%s<br><br>", desc);
+ f.Printf("%s", desc);
+ f.Printf("<br><br><br>");
delete desc;
}
}
{
NamedLink item;
- f.Printf($"<a name=EnumerationValues></a><H3>Enumeration Values</H3><br><br>\n");
+ f.Printf($"<a name=EnumerationValues></a><H3>Enumeration Values</H3><BR>\n");
f.Printf("<TABLE>\n");
for(item = enumeration.values.first; item; item = item.next)
if(cl.conversions.first)
{
- f.Printf($"<a name=Conversions></a><H3>Conversions</H3><br><br>\n");
+ f.Printf($"<a name=Conversions></a><H3>Conversions</H3><BR>\n");
f.Printf("<TABLE>\n");
for(prop = cl.conversions.first; prop; prop = prop.next)
{
FreeType(type);
}
}
- f.Printf("</TABLE><br>\n");
+ f.Printf("</TABLE><br><br>\n");
}
if(cl.membersAndProperties.first)
{
if(first)
{
- f.Printf($"<a name=Members></a><H3>Properties and Members</H3><br><br>\n");
+ f.Printf($"<a name=Members></a><H3>Properties and Members</H3><BR>\n");
f.Printf("<TABLE>\n");
first = false;
}
}
}
if(!first)
- f.Printf("</TABLE><br>\n");
+ f.Printf("</TABLE><br><br>\n");
}
if(cl.methods.first)
char * desc = ReadDoc(module, methodDoc, method, description, null);
if(first)
{
- f.Printf($"<a name=VirtualMethods></a><H3>Virtual Methods</H3><br><br>\n");
+ f.Printf($"<a name=VirtualMethods></a><H3>Virtual Methods</H3><BR>\n");
f.Printf("<TABLE>\n");
first = false;
}
}
}
if(!first)
- f.Printf("</TABLE><br>\n");
+ f.Printf("</TABLE><br><br>\n");
// Non-Virtual Methods
first = true;
char * desc = ReadDoc(module, methodDoc, method, description, null);
if(first)
{
- f.Printf($"<a name=Methods></a><H3>Non-Virtual Methods</H3><br><br>\n");
+ f.Printf($"<a name=Methods></a><H3>Non-Virtual Methods</H3><BR>\n");
f.Printf("<TABLE>\n");
first = false;
}
}
}
if(!first)
- f.Printf("</TABLE><br>\n");
+ f.Printf("</TABLE><br><br>\n");
}
{
char * usageDoc = ReadDoc(module, classDoc, cl, usage, null);
if(usageDoc)
{
- f.Printf($"<H3>Usage</H3><br>\n");
+ f.Printf($"<H3>Usage</H3><BR>\n");
if(editing)
{
char fileName[MAX_LOCATION];
}
else
f.Printf("<br>%s\n", usageDoc);
- f.Printf("<br><br>\n");
+ f.Printf("<br><br><br>\n");
delete usageDoc;
}
}
char * exampleDoc = ReadDoc(module, classDoc, cl, example, null);
if(exampleDoc)
{
- f.Printf($"<H3>Example</H3><br>\n");
+ f.Printf($"<H3>Example</H3><BR>\n");
f.Printf($"<FONT face=\"Courier New\">\n");
f.Printf("<br><TABLE>\n");
if(editing)
f.Printf("<TR><TD><CODE>%s</CODE></TD></TR>\n", exampleDoc); // bgcolor=#CFC9C0
f.Printf("</TABLE></FONT>\n");
- f.Printf("<br>\n");
+ f.Printf("<br><br>\n");
delete exampleDoc;
}
}
if(remarksDoc)
{
- f.Printf($"<H3>Remarks</H3><br>\n");
+ f.Printf($"<H3>Remarks</H3><BR>\n");
if(editing)
{
char fileName[MAX_LOCATION];
}
else
f.Printf("<br>%s\n", remarksDoc);
- f.Printf("<br><br>\n");
+ f.Printf("<br><br><br>\n");
delete remarksDoc;
}
}
{
if(first)
{
- f.Printf($"<H3>Derived Classes</H3><br>\n");
- f.Printf("<br>");
+ f.Printf($"<H3>Derived Classes</H3><BR>\n");
first = false;
}
else
char * seeAlsoDoc = ReadDoc(module, classDoc, cl, seeAlso, null);
if(seeAlsoDoc)
{
- f.Printf($"<H3>See Also</H3><br>\n");
+ f.Printf($"<H3>See Also</H3>\n");
if(editing)
{
char fileName[MAX_LOCATION];
char * desc = ReadDoc(module, methodDoc, method, description, null);
if(desc)
{
- f.Printf($"<br><br><H3>Description</H3><br><br>\n");
+ f.Printf($"<br><br><H3>Description</H3><BR>\n");
if(editing)
{
char fileName[MAX_LOCATION];
}
else
f.Printf("%s", desc);
+ f.Printf("<BR><BR>");
delete desc;
}
}
f.Printf("<br><br>\n");
if(method.dataType.params.first && ((Type)method.dataType.params.first).kind != voidType)
{
- f.Printf($"<H3>Parameters</H3><br><br>\n");
+ f.Printf($"<H3>Parameters</H3><BR>\n");
}
if((method.dataType.returnType && method.dataType.returnType.kind != voidType) ||
(method.dataType.params.first && ((Type)method.dataType.params.first).kind != voidType))
char * usageDoc = ReadDoc(module, methodDoc, method, usage, null);
if(usageDoc)
{
- f.Printf($"<H3>Usage</H3><br>\n");
+ f.Printf($"<H3>Usage</H3><BR>\n");
if(editing)
{
char fileName[MAX_LOCATION];
}
else
f.Printf("<br>%s\n", usageDoc);
- f.Printf("<br><br>\n");
+ f.Printf("<br><br><br>\n");
delete usageDoc;
}
}
char * exampleDoc = ReadDoc(module, methodDoc, method, example, null);
if(exampleDoc)
{
- f.Printf($"<H3>Example</H3><br>\n");
+ f.Printf($"<H3>Example</H3><BR>\n");
f.Printf($"<FONT face=\"Courier New\">\n");
f.Printf("<br><TABLE>\n");
if(editing)
else
f.Printf("<TR><TD><CODE>%s</CODE></TD></TR>\n", exampleDoc); // bgcolor=#CFC9C0
f.Printf("</TABLE></FONT>\n");
- f.Printf("<br>\n");
+ f.Printf("<br><br>\n");
delete exampleDoc;
}
}
char * remarksDoc = ReadDoc(module, methodDoc, method, remarks, null);
if(remarksDoc)
{
- f.Printf($"<H3>Remarks</H3><br>\n");
+ f.Printf($"<H3>Remarks</H3><BR>\n");
if(editing)
{
char fileName[MAX_LOCATION];
}
else
f.Printf("<br>%s\n", method, remarksDoc);
- f.Printf("<br><br>\n");
+ f.Printf("<br><br><br>\n");
delete remarksDoc;
}
}
char * seeAlsoDoc = ReadDoc(module, methodDoc, method, seeAlso, null);
if(seeAlsoDoc)
{
- f.Printf($"<H3>See Also</H3><br>\n");
+ f.Printf($"<H3>See Also</H3><BR>\n");
if(editing)
{
char fileName[MAX_LOCATION];
else
f.Printf("<br>%s\n", method, seeAlsoDoc);
- f.Printf("<br><br>\n");
+ f.Printf("<br><br><br>\n");
delete seeAlsoDoc;
}
}
char * desc = ReadDoc(module, functionDoc, function, description, null);
if(desc)
{
- f.Printf($"<br><br><H3>Description</H3><br><br>\n");
+ f.Printf($"<br><br><H3>Description</H3><BR>\n");
if(editing)
{
char fileName[MAX_LOCATION];
else
f.Printf("%s", desc);
delete desc;
+ f.Printf("<BR><BR>");
}
}
f.Printf("<br><br>\n");
if(function.dataType.params.first && ((Type)function.dataType.params.first).kind != voidType)
{
- f.Printf($"<H3>Parameters</H3><br><br>\n");
+ f.Printf($"<H3>Parameters</H3><BR>\n");
}
if((function.dataType.returnType && function.dataType.returnType.kind != voidType) ||
(function.dataType.params.first && ((Type)function.dataType.params.first).kind != voidType))
char * usageDoc = ReadDoc(module, functionDoc, function, usage, null);
if(usageDoc)
{
- f.Printf($"<H3>Usage</H3><br>\n");
+ f.Printf($"<H3>Usage</H3><BR>\n");
if(editing)
{
char fileName[MAX_LOCATION];
}
else
f.Printf("<br>%s\n", usageDoc);
- f.Printf("<br><br>\n");
+ f.Printf("<br><br><br>\n");
delete usageDoc;
}
}
char * exampleDoc = ReadDoc(module, functionDoc, function, example, null);
if(exampleDoc)
{
- f.Printf($"<H3>Example</H3><br>\n");
+ f.Printf($"<H3>Example</H3><BR>\n");
f.Printf($"<FONT face=\"Courier New\">\n");
f.Printf("<br><TABLE>\n");
if(editing)
else
f.Printf("<TR><TD><CODE>%s</CODE></TD></TR>\n", exampleDoc); // bgcolor=#CFC9C0
f.Printf("</TABLE></FONT>\n");
- f.Printf("<br>\n");
+ f.Printf("<br><br>\n");
delete exampleDoc;
}
}
char * remarksDoc = ReadDoc(module, functionDoc, function, remarks, null);
if(remarksDoc)
{
- f.Printf($"<H3>Remarks</H3><br>\n");
+ f.Printf($"<H3>Remarks</H3><BR>\n");
if(editing)
{
char fileName[MAX_LOCATION];
}
else
f.Printf("<br>%s\n", remarksDoc);
- f.Printf("<br><br>\n");
+ f.Printf("<br><br><br>\n");
delete remarksDoc;
}
}
char * seeAlsoDoc = ReadDoc(module, functionDoc, function, seeAlso, null);
if(seeAlsoDoc)
{
- f.Printf($"<H3>See Also</H3><br>\n");
+ f.Printf($"<H3>See Also</H3><BR>\n");
if(editing)
{
char fileName[MAX_LOCATION];
}
else
f.Printf("<br>%s\n", seeAlsoDoc);
- f.Printf("<br><br>\n");
+ f.Printf("<br><br><br>\n");
delete seeAlsoDoc;
}
}
for(link = (BTNamedLink)nameSpace->classes.first; link; link = (BTNamedLink)((BTNode)link).next)
{
cl = link.data;
- if(!cl.templateClass && (!module || cl.module == module || (!cl.module.name && !strcmp(module.name, "ecere"))))
+ if(!cl.templateClass /*&& !cl.internalDecl*/ && (!module || cl.module == module || (!cl.module.name && !strcmp(module.name, "ecere"))))
{
if(!classesRow) { classesRow = row.AddRow(); classesRow.SetData(null, APIPage { $"Classes", page = page }); classesRow.collapsed = true; classesRow.icon = mainForm.icons[typeClass]; classesRow.tag = 1; }
AddClass(classesRow, module, cl, nsName, showPrivate);
bool dontRecordHistory;
Module homeModule;
+ bool OnKeyHit(Key key, unichar ch)
+ {
+ switch(key)
+ {
+ case altLeft: Back(); return false;
+ case altRight: Forward(); return false;
+ }
+ return true;
+ }
+
bool Forward()
{
if(historyPos < history.count-1)
{
char docDir[MAX_LOCATION];
readOnly = true;
- strcpy(docDir, settings.docDir);
+ strcpy(docDir, ideSettings.docDir);
if(FileExists(docDir).isDirectory)
{
PathCatSlash(docDir, "___docWriteTest");
// dialog.Create();
edit = true;
// PositionCaret(true);
+
+ // TOCHECK: Adding this here seemed to fixed caret positioning bugs
+ ComputeSizes();
}
return true;
}
char * text = textBlock.text;
int maxW;
Block block = textBlock;
+ int xOffset = 0;
while(block && block.type != TD) block = block.parent;
if(block)
{
display.FontExtent(textBlock.font.font, " ", 1, null, &th);
+ // Work around to re-align with first line having different indentation because of before <A> of current block
+ {
+ Block parent = textBlock.parent;
+ while(parent && parent.type == ANCHOR) parent = parent.parent;
+ if(parent && parent.subBlocks.first && ((Block)parent.subBlocks.first).type == TEXT)
+ xOffset = sx - ((Block)parent.subBlocks.first).startX;
+ }
+
while(textPos < textBlock.textLen)
{
int startPos = textPos;
int width = 0;
- int x = 0;
+ int x = xOffset;
bool lineComplete = false;
for(; textPos<textBlock.textLen && !lineComplete;)
break;
}
sy += th;
- sx = textBlock.startX;
+ sx = textBlock.startX - xOffset;
}
if(setCaretX)
caretX = sx;
caretY = sy;
- SetCaret(sx, sy, th);
+ SetCaret(sx-1, sy, th);
{
Point scrollPos = scroll;
bool doScroll = false;
int maxW;
Block b = textBlock;
int space;
+ int xOffset = 0;
if(textBlock.type != TEXT) continue;
else
maxW = clientSize.w - 10 - sx;
+ // Work around to re-align with first line having different indentation because of before <A> of current block
+ {
+ Block parent = textBlock.parent;
+ while(parent && parent.type == ANCHOR) parent = parent.parent;
+ if(parent && parent.subBlocks.first && ((Block)parent.subBlocks.first).type == TEXT)
+ xOffset = sx - ((Block)parent.subBlocks.first).startX;
+ }
+
display.FontExtent(textBlock.font.font, " ", 1, &space, &th);
//space = space/2+2;
space = 2;
while(textPos < textBlock.textLen)
{
int width = 0;
- int x = 0;
+ int x = xOffset;
bool lineComplete = false;
for(; textPos<textBlock.textLen && !lineComplete;)
display.FontExtent(textBlock.font.font, text + textPos, len, &w, &th);
- sx = x + textBlock.startX;
+ sx = x + textBlock.startX - xOffset;
if(/*py >= sy && */py < sy + th && /*px >= sx-space && */px < sx + w-space)
{
int c, numBytes;
SetGlobalData(globalData);
- settingsContainer.dataOwner = &settings;
+ settingsContainer.dataOwner = &ideSettings;
settingsContainer.Load();
- if(!settings.docDir || !settings.docDir[0] )
+ if(!ideSettings.docDir || !ideSettings.docDir[0] )
{
if(os == win32) // if Windows OS then
{
if(GetEnvironment("ProgramFiles", programFilesDir, MAX_LOCATION))
{
PathCat(programFilesDir, "ECERE SDK\\doc");
- settings.docDir = programFilesDir;
+ ideSettings.docDir = programFilesDir;
}
else if(homeDrive[0])
{
PathCat(homeDrive, "ECERE SDK\\doc");
- settings.docDir = homeDrive;
+ ideSettings.docDir = homeDrive;
}
else if(winDir[0])
{
PathCat(winDir, "..\\ECERE SDK\\doc");
- settings.docDir = winDir;
+ ideSettings.docDir = winDir;
}
else
- settings.docDir = "C:\\ECERE SDK\\doc";
+ ideSettings.docDir = "C:\\ECERE SDK\\doc";
}
else // if Os is Linux, or Mac OSX or something else
- settings.docDir = "/usr/share/ecere/doc/";
+ ideSettings.docDir = "/usr/share/ecere/doc/";
settingsContainer.Save();
}