TempleOSTS_131005.ISO
This commit is contained in:
1 parent
1343005a29
commit
2d2a65d572
547 files changed
+33608
-12549
No files matched your search
@@ -13,7 +13,7 @@ U0 DocInit()
|
||||
DefineLstLoad("ST_DOC_CMDS",
|
||||
"TX\0CR\0SR\0CU\0TB\0CL\0PB\0DA\0PL\0LM\0RM\0HD\0FO\0ID\0"
|
||||
"FG\0BG\0FD\0BD\0PT\0WW\0UL\0IV\0BK\0SX\0SY\0CM\0AN\0LK\0BT\0"
|
||||
"CB\0MA\0MU\0HX\0HS\0HE\0TR\0SP\0IB\0IT\0IS\0BP\0SO\0HL\0LP\0CC\0HI\0HV\0HC\0ER\0");
|
||||
"CB\0MA\0MU\0HX\0TR\0SP\0IB\0IT\0IS\0BP\0SO\0HL\0LP\0CC\0HI\0HV\0HC\0ER\0");
|
||||
DefineLstLoad("ST_DOC_FLAGS",
|
||||
//flags1
|
||||
"A\0L\0"
|
||||
@@ -31,8 +31,6 @@ U0 DocInit()
|
||||
|
||||
DocInit;
|
||||
|
||||
|
||||
|
||||
//--TEMPLEOS LINK TYPES--
|
||||
// "filename"
|
||||
// "FI:filename"
|
||||
|
||||
@@ -18,22 +18,15 @@ DefineLstLoad("ST_BIBLE_BOOKS",
|
||||
"2 Chronicles\0"
|
||||
"Ezra\0"
|
||||
"Nehemiah\0"
|
||||
"Tobit\0"
|
||||
"Judith\0"
|
||||
"Esther\0"
|
||||
"1 Maccabees\0"
|
||||
"2 Maccabees\0"
|
||||
"Job\0"
|
||||
"Psalms\0"
|
||||
"Proverbs\0"
|
||||
"Ecclesiastes\0"
|
||||
"Song of Songs\0"
|
||||
"Wisdom\0"
|
||||
"Sirach\0"
|
||||
"Isaiah\0"
|
||||
"Jeremiah\0"
|
||||
"Lamentations\0"
|
||||
"Baruch\0"
|
||||
"Ezekiel\0"
|
||||
"Daniel\0"
|
||||
"Hosea\0"
|
||||
@@ -94,22 +87,15 @@ DefineLstLoad("ST_BIBLE_BOOK_LINES",
|
||||
"37633\0"
|
||||
"40756\0"
|
||||
"41671\0"
|
||||
"Tobit\0"
|
||||
"Judith\0"
|
||||
"42963\0"
|
||||
"1 Maccabees\0"
|
||||
"2 Maccabees\0"
|
||||
"43605\0"
|
||||
"46190\0"
|
||||
"53793\0"
|
||||
"56267\0"
|
||||
"56966\0"
|
||||
"Wisdom\0"
|
||||
"Sirach\0"
|
||||
"57332\0"
|
||||
"61806\0"
|
||||
"66736\0"
|
||||
"Baruch\0"
|
||||
"67217\0"
|
||||
"71804\0"
|
||||
"73189\0"
|
||||
@@ -153,6 +139,23 @@ DefineLstLoad("ST_BIBLE_BOOK_LINES",
|
||||
"98684\0"
|
||||
"\0");
|
||||
|
||||
public U0 PutBibleLines(I64 start,I64 lines)
|
||||
{
|
||||
CDoc *doc=DocRead(Define("ST_BIBLE_FILE"),DOCF_PLAIN_TEXT);
|
||||
CDocEntry *doc_e;
|
||||
DocLineNumGoTo(doc,start); //one based
|
||||
doc_e=doc->cur_entry;
|
||||
while (lines>0 && doc_e!=doc) {
|
||||
if (doc_e->type_u8==DOCT_TEXT)
|
||||
"%s",doc_e->tag;
|
||||
else if (doc_e->type_u8==DOCT_NEW_LINE) {
|
||||
NewLine;
|
||||
lines--;
|
||||
}
|
||||
doc_e=doc_e->next;
|
||||
}
|
||||
DocDel(doc);
|
||||
}
|
||||
|
||||
public U0 PutBibleVerse(U8 *verse,I64 lines)
|
||||
{
|
||||
@@ -166,7 +169,7 @@ public U0 PutBibleVerse(U8 *verse,I64 lines)
|
||||
else
|
||||
*st2=0;
|
||||
|
||||
i=DefineMatch(st,"ST_BIBLE_BOOKS",LEF_IGNORE_CASE);
|
||||
i=DefineMatch(st,"ST_BIBLE_BOOKS",LMF_IGNORE_CASE);
|
||||
if (i>=0) {
|
||||
i=A2I(DefineSub(i,"ST_BIBLE_BOOK_LINES"));
|
||||
doc=DocRead(Define("ST_BIBLE_FILE"),DOCF_PLAIN_TEXT);
|
||||
@@ -176,9 +179,9 @@ public U0 PutBibleVerse(U8 *verse,I64 lines)
|
||||
EdFindNext(doc);
|
||||
}
|
||||
doc_e=doc->cur_entry;
|
||||
while (lines) {
|
||||
while (lines>0 && doc_e!=doc) {
|
||||
if (doc_e->type_u8==DOCT_TEXT)
|
||||
"" doc_e->tag;
|
||||
"%s",doc_e->tag;
|
||||
else if (doc_e->type_u8==DOCT_NEW_LINE) {
|
||||
NewLine;
|
||||
lines--;
|
||||
|
||||
@@ -11,7 +11,7 @@ I64 PopUpEdFmt()
|
||||
{
|
||||
I64 i;
|
||||
CDoc *doc=DocNew;
|
||||
DocPutS(doc,"$$FG,LTBLUE$$$$MU,\"Check Compile\",EF_CHK_COMPILE$$\n"
|
||||
DocPrint(doc,"$$FG,LTBLUE$$$$MU,\"Check Compile\",EF_CHK_COMPILE$$\n"
|
||||
"$$MU,\"Reindent CPP.Z Fun\",EF_REINDENT$$\n"
|
||||
"$$MU,\"Renum Asm Local @@ Labels for Fun\",EF_RENUM_ASM$$\n"
|
||||
"$$MU,\"Insert Mgd Code: Slider Ctrl\",EF_SLIDER_CTRL$$\n"
|
||||
@@ -332,15 +332,15 @@ U0 EdRenumAsm(CDoc *doc)
|
||||
while (tempr!=&root) {
|
||||
tempr1=tempr->next;
|
||||
num+=ASM_RENUM_SPACING;
|
||||
SPrintF(buf,"@#%02d",num);
|
||||
SPrint(buf,"@#%02d",num);
|
||||
EdReplace(doc,tempr->label,buf,TRUE,TRUE,TRUE);
|
||||
Free(tempr);
|
||||
tempr=tempr1;
|
||||
}
|
||||
|
||||
while (num) {
|
||||
SPrintF(buf, "@#%02d",num);
|
||||
SPrintF(buf2,"@@%02d",num);
|
||||
SPrint(buf, "@#%02d",num);
|
||||
SPrint(buf2,"@@%02d",num);
|
||||
EdReplace(doc,buf,buf2,TRUE,TRUE,TRUE);
|
||||
num-=ASM_RENUM_SPACING;
|
||||
}
|
||||
@@ -373,7 +373,7 @@ U0 EdCodeTools2(CDoc *doc,I64 tool_action)
|
||||
DocWrite(doc);
|
||||
task=Spawn(&SrvUserCmdLine,NULL,"Srv",,Fs);
|
||||
st2=CurDir;
|
||||
st=MSPrintF("Cd(\"%s\");",st2);
|
||||
st=MPrint("Cd(\"%s\");",st2);
|
||||
tempc=TaskExeStrQue(task,Fs,st,1<<SVCf_WAKE_MASTER|1<<SVCf_FOCUS_MASTER);
|
||||
Free(st2);
|
||||
Free(st);
|
||||
@@ -385,11 +385,11 @@ U0 EdCodeTools2(CDoc *doc,I64 tool_action)
|
||||
Free(st);
|
||||
if (FileFind(prj_file)) {
|
||||
st2=DirFile(prj_file),
|
||||
st=MSPrintF("Cd(\"%s\");",st2);
|
||||
st=MPrint("Cd(\"%s\");",st2);
|
||||
Free(st2);
|
||||
tempc=TaskExeStrQue(task,Fs,st,1<<SVCf_WAKE_MASTER|1<<SVCf_FOCUS_MASTER|1<<SVCf_FREE_ON_COMPLETE);
|
||||
Free(st);
|
||||
st=MSPrintF("\"$$WW,1$$\";Cmp(\"%s\",\"SysTemp\",\"SysTemp\");",prj_file);
|
||||
st=MPrint("\"$$WW,1$$\";Cmp(\"%s\",\"SysTemp\",\"SysTemp\");",prj_file);
|
||||
tempc=TaskExeStrQue(task,Fs,st,1<<SVCf_WAKE_MASTER|1<<SVCf_FOCUS_MASTER);
|
||||
Free(st);
|
||||
if (ScanResult(tempc,&r))
|
||||
@@ -407,9 +407,9 @@ U0 EdCodeTools2(CDoc *doc,I64 tool_action)
|
||||
prj_file=FileNameAbs(st,FUF_Z_OR_NOT_Z);
|
||||
Free(st);
|
||||
if (FileFind(prj_file))
|
||||
st=MSPrintF("\"$$WW,1$$\";ExeFile(\"%s\",TRUE);",prj_file);
|
||||
st=MPrint("\"$$WW,1$$\";ExeFile(\"%s\",TRUE);",prj_file);
|
||||
else
|
||||
st=MSPrintF("\"$$WW,1$$\";ExeFile(\"%s\",TRUE);",doc->filename.name);
|
||||
st=MPrint("\"$$WW,1$$\";ExeFile(\"%s\",TRUE);",doc->filename.name);
|
||||
tempc=TaskExeStrQue(task,Fs,st,1<<SVCf_WAKE_MASTER|1<<SVCf_FOCUS_MASTER);
|
||||
Free(st);
|
||||
if (ScanResult(tempc,&r) && r)
|
||||
@@ -528,32 +528,32 @@ U0 EdChSC(CDoc *doc)
|
||||
{
|
||||
I64 ch,sc;
|
||||
U8 buf[136];
|
||||
SPrintF(buf,"EdPopUpChSC(%d,%d);",&ch,&sc);
|
||||
SPrint(buf,"EdPopUpChSC(%d,%d);",&ch,&sc);
|
||||
PopUp(buf,Fs);
|
||||
if (ch==CH_BACKSPACE)
|
||||
DocPrintF(doc,"CH_BACKSPACE,0x%X",sc);
|
||||
DocPrint(doc,"CH_BACKSPACE,0x%X",sc);
|
||||
else if (ch=='\n')
|
||||
DocPrintF(doc,"'\n',0x%X",sc);
|
||||
DocPrint(doc,"'\n',0x%X",sc);
|
||||
else if (CH_CTRLA<=ch<=CH_CTRLZ)
|
||||
DocPrintF(doc,"CH_CTRL%C,0x%X",ch+'@',sc);
|
||||
DocPrint(doc,"CH_CTRL%C,0x%X",ch+'@',sc);
|
||||
else if (ch=='$$')
|
||||
DocPrintF(doc,"'$$$$',0x%X",sc);
|
||||
DocPrint(doc,"'$$$$',0x%X",sc);
|
||||
else if (ch=='\\')
|
||||
DocPrintF(doc,"'\\\\',0x%X",sc);
|
||||
DocPrint(doc,"'\\\\',0x%X",sc);
|
||||
else if (ch=='\'')
|
||||
DocPrintF(doc,"'\\\'',0x%X",sc);
|
||||
DocPrint(doc,"'\\\'',0x%X",sc);
|
||||
else if (ch==CH_ESC)
|
||||
DocPrintF(doc,"CH_ESC,0x%X",sc);
|
||||
DocPrint(doc,"CH_ESC,0x%X",sc);
|
||||
else if (ch==CH_SHIFT_ESC)
|
||||
DocPrintF(doc,"CH_SHIFT_ESC,0x%X",sc);
|
||||
DocPrint(doc,"CH_SHIFT_ESC,0x%X",sc);
|
||||
else if (ch==CH_SPACE)
|
||||
DocPrintF(doc,"CH_SPACE,0x%X",sc);
|
||||
DocPrint(doc,"CH_SPACE,0x%X",sc);
|
||||
else if (ch==CH_SHIFT_SPACE)
|
||||
DocPrintF(doc,"CH_SHIFT_SPACE,0x%X",sc);
|
||||
DocPrint(doc,"CH_SHIFT_SPACE,0x%X",sc);
|
||||
else if (Bt(displayable_chars_bitmap,ch))
|
||||
DocPrintF(doc,"'%c',0x%X",ch,sc);
|
||||
DocPrint(doc,"'%c',0x%X",ch,sc);
|
||||
else
|
||||
DocPrintF(doc,"0x%X,0x%X",ch,sc);
|
||||
DocPrint(doc,"0x%X,0x%X",ch,sc);
|
||||
}
|
||||
|
||||
U0 EdCodeTools(CDoc *doc)
|
||||
|
||||
@@ -8,7 +8,7 @@ I64 PopUpLinkType(Bool include_anchor)
|
||||
{
|
||||
I64 i;
|
||||
CDoc *doc=DocNew;
|
||||
DocPutS(doc,"$$FG,PURPLE$$$$TX+CX,\"Link Type Menu\"$$\n"
|
||||
DocPrint(doc,"$$FG,PURPLE$$$$TX+CX,\"Link Type Menu\"$$\n"
|
||||
"\n$$FG,LTBLUE$$$$MU,\"To file\",LK_FILE$$\n"
|
||||
"$$MU,\"To anchor in file\",LK_FILE_ANCHOR$$\n"
|
||||
"$$MU,\"To str in file\",LK_FILE_FIND$$\n"
|
||||
@@ -22,8 +22,8 @@ I64 PopUpLinkType(Bool include_anchor)
|
||||
"$$MU,\"To Help Index\",LK_HELP_INDEX$$\n"
|
||||
"$$MU,\"To Addr\",LK_ADDR$$\n");
|
||||
if (include_anchor)
|
||||
DocPutS(doc,"$$MU,\"Place Anchor\",LK_PLACE_ANCHOR$$\n");
|
||||
DocPrintF(doc,"%s",ctrl_L_footer);
|
||||
DocPrint(doc,"$$MU,\"Place Anchor\",LK_PLACE_ANCHOR$$\n");
|
||||
DocPrint(doc,"%s",ctrl_L_footer);
|
||||
i=PopUpMenu(doc);
|
||||
DocDel(doc);
|
||||
return i;
|
||||
@@ -158,23 +158,23 @@ Bool PmtLink(I64 type,U8 **_tag,U8 **_link,Bool *_pop_up,Bool *_quote,U8 **_html
|
||||
el->num=1;
|
||||
switch (type) {
|
||||
case LK_FILE:
|
||||
if (DocFormDo(el,"CEdFileLink",,,ctrl_L_footer)) {
|
||||
if (DocFormDo(el,,,,ctrl_L_footer)) {
|
||||
result=TRUE;
|
||||
if (!*el->tag)
|
||||
*_tag=StrNew(el->file);
|
||||
else
|
||||
*_tag=StrNew(el->tag);
|
||||
*_link=MSPrintF("FI:%s",el->file);
|
||||
*_link=MPrint("FI:%s",el->file);
|
||||
}
|
||||
break;
|
||||
case LK_PLAIN:
|
||||
if (DocFormDo(el,"CEdFileLink",,,ctrl_L_footer)) {
|
||||
if (DocFormDo(el,,,,ctrl_L_footer)) {
|
||||
result=TRUE;
|
||||
if (!*el->tag)
|
||||
*_tag=StrNew(el->file);
|
||||
else
|
||||
*_tag=StrNew(el->tag);
|
||||
*_link=MSPrintF("PI:%s",el->file);
|
||||
*_link=MPrint("PI:%s",el->file);
|
||||
}
|
||||
break;
|
||||
case LK_FILE_ANCHOR:
|
||||
@@ -184,7 +184,7 @@ Bool PmtLink(I64 type,U8 **_tag,U8 **_link,Bool *_pop_up,Bool *_quote,U8 **_html
|
||||
*_tag=StrNew(el->aux);
|
||||
else
|
||||
*_tag=StrNew(el->tag);
|
||||
*_link=MSPrintF("FA:%s,%s",el->file,el->aux);
|
||||
*_link=MPrint("FA:%s,%s",el->file,el->aux);
|
||||
}
|
||||
break;
|
||||
case LK_FILE_FIND:
|
||||
@@ -195,13 +195,13 @@ Bool PmtLink(I64 type,U8 **_tag,U8 **_link,Bool *_pop_up,Bool *_quote,U8 **_html
|
||||
*_tag=StrNew(el->aux);
|
||||
else
|
||||
*_tag=StrNew(el->tag);
|
||||
*_link=MSPrintF("FF:%s,%s",el->file,el->aux);
|
||||
*_link=MPrint("FF:%s,%s",el->file,el->aux);
|
||||
} else {
|
||||
if (!*el->tag)
|
||||
*_tag=StrNew(el->aux);
|
||||
else
|
||||
*_tag=StrNew(el->tag);
|
||||
*_link=MSPrintF("FF:%s,%s:%d",el->file,el->aux,el->num);
|
||||
*_link=MPrint("FF:%s,%s:%d",el->file,el->aux,el->num);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -213,13 +213,13 @@ Bool PmtLink(I64 type,U8 **_tag,U8 **_link,Bool *_pop_up,Bool *_quote,U8 **_html
|
||||
*_tag=StrNew(el->aux);
|
||||
else
|
||||
*_tag=StrNew(el->tag);
|
||||
*_link=MSPrintF("PF:%s,%s",el->file,el->aux);
|
||||
*_link=MPrint("PF:%s,%s",el->file,el->aux);
|
||||
} else {
|
||||
if (!*el->tag)
|
||||
*_tag=StrNew(el->aux);
|
||||
else
|
||||
*_tag=StrNew(el->tag);
|
||||
*_link=MSPrintF("PF:%s,%s:%d",el->file,el->aux,el->num);
|
||||
*_link=MPrint("PF:%s,%s:%d",el->file,el->aux,el->num);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -230,7 +230,7 @@ Bool PmtLink(I64 type,U8 **_tag,U8 **_link,Bool *_pop_up,Bool *_quote,U8 **_html
|
||||
*_tag=StrNew(el->file);
|
||||
else
|
||||
*_tag=StrNew(el->tag);
|
||||
*_link=MSPrintF("FL:%s,%d",el->file,el->num);
|
||||
*_link=MPrint("FL:%s,%d",el->file,el->num);
|
||||
}
|
||||
break;
|
||||
case LK_PLAIN_LINE:
|
||||
@@ -240,7 +240,7 @@ Bool PmtLink(I64 type,U8 **_tag,U8 **_link,Bool *_pop_up,Bool *_quote,U8 **_html
|
||||
*_tag=StrNew(el->file);
|
||||
else
|
||||
*_tag=StrNew(el->tag);
|
||||
*_link=MSPrintF("PL:%s,%d",el->file,el->num);
|
||||
*_link=MPrint("PL:%s,%d",el->file,el->num);
|
||||
}
|
||||
break;
|
||||
case LK_MAN_PAGE:
|
||||
@@ -250,7 +250,7 @@ Bool PmtLink(I64 type,U8 **_tag,U8 **_link,Bool *_pop_up,Bool *_quote,U8 **_html
|
||||
*_tag=StrNew(el->aux);
|
||||
else
|
||||
*_tag=StrNew(el->tag);
|
||||
*_link=MSPrintF("MN:%s",el->aux);
|
||||
*_link=MPrint("MN:%s",el->aux);
|
||||
}
|
||||
break;
|
||||
case LK_PLACE_ANCHOR:
|
||||
@@ -272,10 +272,10 @@ Bool PmtLink(I64 type,U8 **_tag,U8 **_link,Bool *_pop_up,Bool *_quote,U8 **_html
|
||||
if (DocFormDo(el,"CEdBibleLink",,,ctrl_L_footer)) {
|
||||
result=TRUE;
|
||||
if (!*el->tag)
|
||||
*_tag=MSPrintF("%Z,%s",i,"ST_BIBLE_BOOKS",el->aux);
|
||||
*_tag=MPrint("%Z,%s",i,"ST_BIBLE_BOOKS",el->aux);
|
||||
else
|
||||
*_tag=StrNew(el->tag);
|
||||
*_link=MSPrintF("BF:%Z,%s",i,"ST_BIBLE_BOOKS",el->aux);
|
||||
*_link=MPrint("BF:%Z,%s",i,"ST_BIBLE_BOOKS",el->aux);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -288,9 +288,9 @@ Bool PmtLink(I64 type,U8 **_tag,U8 **_link,Bool *_pop_up,Bool *_quote,U8 **_html
|
||||
else
|
||||
*_tag=StrNew(el->tag);
|
||||
if (el->num<0)
|
||||
*_link=MSPrintF("DF:%s",el->aux);
|
||||
*_link=MPrint("DF:%s",el->aux);
|
||||
else
|
||||
*_link=MSPrintF("DF:%s,%d",el->aux,el->num);
|
||||
*_link=MPrint("DF:%s,%d",el->aux,el->num);
|
||||
|
||||
}
|
||||
break;
|
||||
@@ -301,7 +301,7 @@ Bool PmtLink(I64 type,U8 **_tag,U8 **_link,Bool *_pop_up,Bool *_quote,U8 **_html
|
||||
*_tag=StrNew(el->aux);
|
||||
else
|
||||
*_tag=StrNew(el->tag);
|
||||
*_link=MSPrintF("HI:%s",el->aux);
|
||||
*_link=MPrint("HI:%s",el->aux);
|
||||
}
|
||||
break;
|
||||
case LK_ADDR:
|
||||
@@ -313,13 +313,13 @@ Bool PmtLink(I64 type,U8 **_tag,U8 **_link,Bool *_pop_up,Bool *_quote,U8 **_html
|
||||
*_tag=StrNew(el->aux);
|
||||
else
|
||||
*_tag=StrNew(el->tag);
|
||||
*_link=MSPrintF("AD:%s",el->aux);
|
||||
*_link=MPrint("AD:%s",el->aux);
|
||||
} else {
|
||||
if (!*el->tag)
|
||||
*_tag=MSPrintF("%s,%d",el->aux,el->num);
|
||||
*_tag=MPrint("%s,%d",el->aux,el->num);
|
||||
else
|
||||
*_tag=StrNew(el->tag);
|
||||
*_link=MSPrintF("AD:%s,%d",el->aux,el->num);
|
||||
*_link=MPrint("AD:%s,%d",el->aux,el->num);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -355,15 +355,15 @@ U0 EdInsLink()
|
||||
switch (type) {
|
||||
case LK_PLACE_ANCHOR:
|
||||
if (html_link)
|
||||
st=MSPrintF("$$AN+HTML,\"%Q\",\"%Q\",\"%Q\"$$",tag,link,html_link);
|
||||
st=MPrint("$$AN+HTML,\"%Q\",\"%Q\",\"%Q\"$$",tag,link,html_link);
|
||||
else
|
||||
st=MSPrintF("$$AN,\"%Q\",\"%Q\"$$",tag,link);
|
||||
st=MPrint("$$AN,\"%Q\",\"%Q\"$$",tag,link);
|
||||
break;
|
||||
default:
|
||||
if (html_link)
|
||||
st=MSPrintF("$$LK%s+HTML,\"%Q\",\"%Q\",\"%Q\"$$",pop_up_st,tag,link,html_link);
|
||||
st=MPrint("$$LK%s+HTML,\"%Q\",\"%Q\",\"%Q\"$$",pop_up_st,tag,link,html_link);
|
||||
else
|
||||
st=MSPrintF("$$LK%s,\"%Q\",\"%Q\"$$",pop_up_st,tag,link);
|
||||
st=MPrint("$$LK%s,\"%Q\",\"%Q\"$$",pop_up_st,tag,link);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -371,7 +371,7 @@ U0 EdInsLink()
|
||||
if (quote)
|
||||
"%Q",st;
|
||||
else
|
||||
"" st;
|
||||
"%s",st;
|
||||
}
|
||||
Free(tag);
|
||||
Free(link);
|
||||
@@ -383,7 +383,7 @@ I64 PopUpColorType()
|
||||
{
|
||||
I64 i;
|
||||
CDoc *doc=DocNew;
|
||||
DocPrintF(doc,"$$FG,PURPLE$$$$TX+CX,\"Color Type Menu\"$$\n"
|
||||
DocPrint(doc,"$$FG,PURPLE$$$$TX+CX,\"Color Type Menu\"$$\n"
|
||||
"\n$$FG,LTBLUE$$$$MU,\"Foreground\",DOCT_FOREGROUND$$\n"
|
||||
"$$MU,\"Background\",DOCT_BACKGROUND$$\n"
|
||||
"$$MU,\"Default Foreground\",DOCT_DFT_FOREGROUND$$\n"
|
||||
@@ -398,7 +398,7 @@ I64 PopUpPageSettingType()
|
||||
{
|
||||
I64 i;
|
||||
CDoc *doc=DocNew;
|
||||
DocPrintF(doc,"$$FG,PURPLE$$$$TX+CX,\"Page Setting Menu\"$$\n"
|
||||
DocPrint(doc,"$$FG,PURPLE$$$$TX+CX,\"Page Setting Menu\"$$\n"
|
||||
"\n$$FG,LTBLUE$$$$MU,\"Page Length\",DOCT_PAGE_LEN$$\n"
|
||||
"$$MU,\"Page Header\",DOCT_HEADER$$\n"
|
||||
"$$MU,\"Page Footer\",DOCT_FOOTER$$\n"
|
||||
@@ -455,7 +455,7 @@ U0 EdInsPageSetting()
|
||||
CEdPageSetting4 *el4=CAlloc(sizeof(CEdPageSetting4));
|
||||
if (type>=0) {
|
||||
if (type==DOCT_RIGHT_MARGIN||type==DOCT_PAGE_LEN) {
|
||||
if (DocFormDo(el2,"CEdPageSetting2")) {
|
||||
if (DocFormDo(el2)) {
|
||||
if (el2->winrel) {
|
||||
if (*el2->val)
|
||||
"$$%Z+WR,%s$$",type,"ST_DOC_CMDS",el2->val;
|
||||
@@ -470,7 +470,7 @@ U0 EdInsPageSetting()
|
||||
}
|
||||
} else if (type==DOCT_LOCK_TO_PAGE) {
|
||||
el3->lock=TRUE;
|
||||
if (DocFormDo(el3,"CEdPageSetting3")) {
|
||||
if (DocFormDo(el3)) {
|
||||
if (el3->lock)
|
||||
"$$%Z,1$$",type,"ST_DOC_CMDS",el->val;
|
||||
else
|
||||
@@ -478,14 +478,14 @@ U0 EdInsPageSetting()
|
||||
}
|
||||
} else if (type==DOCT_LOCK_TO_CENTER) {
|
||||
el4->lock=TRUE;
|
||||
if (DocFormDo(el4,"CEdPageSetting4")) {
|
||||
if (DocFormDo(el4)) {
|
||||
if (el4->lock)
|
||||
"$$%Z,1$$",type,"ST_DOC_CMDS",el->val;
|
||||
else
|
||||
"$$%Z,0$$",type,"ST_DOC_CMDS";
|
||||
}
|
||||
} else {
|
||||
if (DocFormDo(el,"CEdPageSetting1")) {
|
||||
if (DocFormDo(el)) {
|
||||
if (*el->val)
|
||||
"$$%Z,%s$$",type,"ST_DOC_CMDS",el->val;
|
||||
else
|
||||
@@ -503,7 +503,7 @@ I64 PopUpDollarType()
|
||||
{
|
||||
I64 i;
|
||||
CDoc *doc=DocNew;
|
||||
DocPrintF(doc,"$$FG,PURPLE$$$$TX+CX,\"Text Widget Menu\"$$\n"
|
||||
DocPrint(doc,"$$FG,PURPLE$$$$TX+CX,\"Text Widget Menu\"$$\n"
|
||||
"\n$$FG,LTBLUE$$$$MU,\"Link\",DOCT_LINK$$\n"
|
||||
"$$MU,\"Text\",DOCT_TEXT$$\n"
|
||||
"$$MU,\"Tree Branch\",DOCT_TREE$$\n"
|
||||
@@ -516,7 +516,6 @@ I64 PopUpDollarType()
|
||||
"$$MU,\"Menu Val\",DOCT_MENU_VAL$$\n"
|
||||
"$$MU,\"Data\",DOCT_DATA$$\n"
|
||||
"$$MU,\"Hex Edit\",DOCT_HEX_ED$$\n"
|
||||
"$$MU,\"Hidden Widget\",DOCT_HIDE_START$$\n"
|
||||
"$$MU,\"Syntax Highlighting\",DOCT_HIGHLIGHT$$\n"
|
||||
"$$MU,\"HTML\",DOCT_HTML_CODE$$\n"
|
||||
"$$MU,\"Song\",DOCT_SONG$$\n"
|
||||
@@ -550,7 +549,7 @@ U0 EdInsDollarText()
|
||||
{
|
||||
U8 *st,buf[136];
|
||||
CEdDollarText *dt=CAlloc(sizeof(CEdDollarText));
|
||||
if (DocFormDo(dt,"CEdDollarText",,,ctrl_L_footer)) {
|
||||
if (DocFormDo(dt,,,,ctrl_L_footer)) {
|
||||
*buf=0;
|
||||
if (dt->left_x ) StrCat(buf,"+LX");
|
||||
if (dt->center_x) StrCat(buf,"+CX");
|
||||
@@ -567,7 +566,7 @@ U0 EdInsDollarText()
|
||||
if (*dt->shift_y) StrCat(buf,"+SY");
|
||||
if (*dt->define_str) StrCat(buf,"+D");
|
||||
if (*dt->html_link) StrCat(buf,"+HTML");
|
||||
st=MSPrintF("%q",dt->tag);
|
||||
st=MPrint("%q",dt->tag);
|
||||
"$$TX%s,\"%Q\"",buf,st;
|
||||
Free(st);
|
||||
if (*dt->shift_x)
|
||||
@@ -577,12 +576,12 @@ U0 EdInsDollarText()
|
||||
if (*dt->scroll_x)
|
||||
",%s",dt->scroll_x;
|
||||
if (*dt->define_str) {
|
||||
st=MSPrintF("%q",dt->define_str);
|
||||
st=MPrint("%q",dt->define_str);
|
||||
",\"%Q\"",st;
|
||||
Free(st);
|
||||
}
|
||||
if (*dt->html_link) {
|
||||
st=MSPrintF("%q",dt->html_link);
|
||||
st=MPrint("%q",dt->html_link);
|
||||
",\"%Q\"",st;
|
||||
Free(st);
|
||||
}
|
||||
@@ -600,7 +599,7 @@ class CEdSong
|
||||
U0 EdInsSong()
|
||||
{
|
||||
CEdSong *dt=CAlloc(sizeof(CEdSong));
|
||||
if (DocFormDo(dt,"CEdSong",,,ctrl_L_footer))
|
||||
if (DocFormDo(dt,,,,ctrl_L_footer))
|
||||
"$$SO,\"%Q\",\"%s\"$$",dt->tag,dt->song;
|
||||
Free(dt);
|
||||
}
|
||||
@@ -613,7 +612,7 @@ class CEdHighlight
|
||||
U0 EdInsHighlight()
|
||||
{
|
||||
CEdHighlight *dt=CAlloc(sizeof(CEdHighlight));
|
||||
if (DocFormDo(dt,"CEdHighlight",,,ctrl_L_footer))
|
||||
if (DocFormDo(dt,,,,ctrl_L_footer))
|
||||
"$$HL,%d$$",dt->highlight_on;
|
||||
Free(dt);
|
||||
}
|
||||
@@ -626,7 +625,7 @@ I64 PopUpHtmlType()
|
||||
{
|
||||
I64 i;
|
||||
CDoc *doc=DocNew;
|
||||
DocPutS(doc,"$$FG,LTBLUE$$$$MU,\"Html Code\",HT_CODE$$\n"
|
||||
DocPrint(doc,"$$FG,LTBLUE$$$$MU,\"Html Code\",HT_CODE$$\n"
|
||||
"$$MU,\"Html Image\",HT_IMAGE$$\n"
|
||||
"$$MU,\"Html Video\",HT_VIDEO$$\n"
|
||||
"\n$$MU,\"Abort\",DOCM_CANCEL$$");
|
||||
@@ -650,7 +649,7 @@ U0 EdInsHtml()
|
||||
CEdHtmlCode *dt=CAlloc(sizeof(CEdHtmlCode));
|
||||
switch (PopUpHtmlType) {
|
||||
case HT_CODE:
|
||||
if (DocFormDo(dt,"CEdHtmlCode",,,ctrl_L_footer))
|
||||
if (DocFormDo(dt,,,,ctrl_L_footer))
|
||||
"$$HC,\"%Q\"$$",dt->tag;
|
||||
break;
|
||||
case HT_IMAGE:
|
||||
@@ -691,7 +690,7 @@ U0 EdInsMacroMenu(Bool is_macro)
|
||||
CEdMacroMenu *dt=CAlloc(sizeof(CEdMacroMenu));
|
||||
dt->underline=TRUE;
|
||||
dt->escape=TRUE;
|
||||
if (DocFormDo(dt,"CEdMacroMenu",,,ctrl_L_footer)) {
|
||||
if (DocFormDo(dt,,,,ctrl_L_footer)) {
|
||||
*buf=0;
|
||||
if (is_macro && *dt->tag) StrCat(buf,"+A ");
|
||||
if (dt->popup) StrCat(buf,"+PU-X");
|
||||
@@ -717,20 +716,20 @@ U0 EdInsMacroMenu(Bool is_macro)
|
||||
if (*dt->tag || is_macro) {
|
||||
if (is_macro) {
|
||||
if (*dt->tag) {
|
||||
st=MSPrintF("%q",dt->tag);
|
||||
st=MPrint("%q",dt->tag);
|
||||
"$$MA%s,\"%Q\"",buf,st;
|
||||
Free(st);
|
||||
} else
|
||||
"$$MA%s,",buf;
|
||||
} else {
|
||||
st=MSPrintF("%q",dt->tag);
|
||||
st=MPrint("%q",dt->tag);
|
||||
"$$MU%s,\"%Q\"",buf,st;
|
||||
Free(st);
|
||||
}
|
||||
if (*dt->left_exp)
|
||||
",%s",dt->left_exp;
|
||||
if (*dt->left_macro) {
|
||||
st=MSPrintF("%q",dt->left_macro);
|
||||
st=MPrint("%q",dt->left_macro);
|
||||
",\"%Q\"",st;
|
||||
Free(st);
|
||||
}
|
||||
@@ -766,7 +765,7 @@ U0 EdInsButton()
|
||||
U8 *st,buf[136];
|
||||
CEdButton *dt=CAlloc(sizeof(CEdButton));
|
||||
dt->escape=TRUE;
|
||||
if (DocFormDo(dt,"CEdButton",,,ctrl_L_footer)) {
|
||||
if (DocFormDo(dt,,,,ctrl_L_footer)) {
|
||||
*buf=0;
|
||||
if (dt->popup) StrCat(buf,"+PU-X");
|
||||
if (dt->left_x ) StrCat(buf,"+LX");
|
||||
@@ -779,25 +778,25 @@ U0 EdInsButton()
|
||||
if (dt->left_is_auto) StrCat(buf,"+LA");
|
||||
if (*dt->tag) {
|
||||
if (dt->quote) {
|
||||
st=MSPrintF("%q",dt->tag);
|
||||
st=MPrint("%q",dt->tag);
|
||||
"$$$$BT%s,\\\"%Q\\\"",buf,st;
|
||||
Free(st);
|
||||
if (*dt->left_exp)
|
||||
",%s",dt->left_exp;
|
||||
if (*dt->left_macro) {
|
||||
st=MSPrintF("%q",dt->left_macro);
|
||||
st=MPrint("%q",dt->left_macro);
|
||||
",\\\"%Q\\\"",st;
|
||||
Free(st);
|
||||
}
|
||||
"$$$$";
|
||||
} else {
|
||||
st=MSPrintF("%q",dt->tag);
|
||||
st=MPrint("%q",dt->tag);
|
||||
"$$BT%s,\"%Q\"",buf,st;
|
||||
Free(st);
|
||||
if (*dt->left_exp)
|
||||
",%s",dt->left_exp;
|
||||
if (*dt->left_macro) {
|
||||
st=MSPrintF("%q",dt->left_macro);
|
||||
st=MPrint("%q",dt->left_macro);
|
||||
",\"%Q\"",st;
|
||||
Free(st);
|
||||
}
|
||||
@@ -828,7 +827,7 @@ U0 EdInsCursorMovement()
|
||||
{
|
||||
U8 buf[136];
|
||||
CEdCursorMovement *dt=CAlloc(sizeof(CEdCursorMovement));
|
||||
if (DocFormDo(dt,"CEdCursorMovement",,,ctrl_L_footer)) {
|
||||
if (DocFormDo(dt,,,,ctrl_L_footer)) {
|
||||
*buf=0;
|
||||
if (dt->left_x ) StrCat(buf,"+LX");
|
||||
if (dt->center_x) StrCat(buf,"+CX");
|
||||
@@ -875,7 +874,7 @@ U0 EdInsData()
|
||||
dt->term=TRUE;
|
||||
dt->len=256;
|
||||
dt->u64=TRUE;
|
||||
if (DocFormDo(dt,"CEdData",,,ctrl_L_footer)) {
|
||||
if (DocFormDo(dt,,,,ctrl_L_footer)) {
|
||||
*buf=0;
|
||||
if (dt->str) StrCat(buf,"-P");
|
||||
if (!dt->term) StrCat(buf,"-T");
|
||||
@@ -886,7 +885,7 @@ U0 EdInsData()
|
||||
else if (dt->u16) StrCat(buf,"-U64+U16");
|
||||
else if (dt->u32) StrCat(buf,"-U64+U32");
|
||||
|
||||
st=MSPrintF("%q",dt->fmt_str);
|
||||
st=MPrint("%q",dt->fmt_str);
|
||||
"$$$$DA%s,%d,\\\"%Q\\\"$$$$",buf,dt->len,st;
|
||||
Free(st);
|
||||
}
|
||||
@@ -903,10 +902,10 @@ U0 EdInsCheckBox()
|
||||
{
|
||||
U8 *st,buf[136];
|
||||
CEdCheckBox *dt=CAlloc(sizeof(CEdCheckBox));
|
||||
if (DocFormDo(dt,"CEdCheckBox",,,ctrl_L_footer)) {
|
||||
if (DocFormDo(dt,,,,ctrl_L_footer)) {
|
||||
*buf=0;
|
||||
if (dt->refresh) StrCat(buf,"+RD");
|
||||
st=MSPrintF("%q",dt->label);
|
||||
st=MPrint("%q",dt->label);
|
||||
"$$$$CB%s,\\\"%Q\\\"$$$$",buf,st;
|
||||
Free(st);
|
||||
}
|
||||
@@ -928,7 +927,7 @@ U0 EdInsHexEd()
|
||||
dt->cnt=128;
|
||||
dt->cols=4;
|
||||
dt->zero=TRUE;
|
||||
if (DocFormDo(dt,"CEdHexEd",,,ctrl_L_footer)) {
|
||||
if (DocFormDo(dt,,,,ctrl_L_footer)) {
|
||||
*buf=0;
|
||||
if (!dt->zero) StrCat(buf,"-Z");
|
||||
if (dt->refresh) StrCat(buf,"+RD");
|
||||
@@ -950,10 +949,10 @@ class CEdBinary
|
||||
U0 EdInsBinary(I64 bin_num,I64 type)
|
||||
{
|
||||
CEdBinary *dt=CAlloc(sizeof(CEdBinary));
|
||||
SPrintF(dt->tag,"<%d>",bin_num);
|
||||
SPrint(dt->tag,"<%d>",bin_num);
|
||||
dt->bin_num=bin_num;
|
||||
dt->bin_ptr_link_bin_num=1;
|
||||
if (DocFormDo(dt,"CEdBinary",,
|
||||
if (DocFormDo(dt,,,
|
||||
"Note: Normally, you enter no file,\n"
|
||||
"just a bin num. If You enter a\n"
|
||||
"file, enter a file bin num or a file\n"
|
||||
@@ -988,11 +987,11 @@ U0 EdInsTree()
|
||||
CEdTree *dt=CAlloc(sizeof(CEdTree));
|
||||
dt->collapsed=TRUE;
|
||||
dt->indent=2;
|
||||
if (DocFormDo(dt,"CEdTree",,,ctrl_L_footer)) {
|
||||
if (DocFormDo(dt,,,,ctrl_L_footer)) {
|
||||
*buf=0;
|
||||
if (!dt->collapsed) StrCat(buf,"-C");
|
||||
st=MSPrintF("%q",dt->label);
|
||||
st2=MSPrintF("$$TR%s,\"%Q\"$$\n$$ID,%d$$*\n$$ID,%d$$",
|
||||
st=MPrint("%q",dt->label);
|
||||
st2=MPrint("$$TR%s,\"%Q\"$$\n$$ID,%d$$*\n$$ID,%d$$",
|
||||
buf,st,dt->indent,-dt->indent);
|
||||
DocInsSafe(DocPut,st2);
|
||||
Free(st);
|
||||
@@ -1001,11 +1000,6 @@ U0 EdInsTree()
|
||||
Free(dt);
|
||||
}
|
||||
|
||||
U0 EdInsHidden()
|
||||
{
|
||||
DocInsSafe(DocPut,"$$HS$$*$$HE$$");
|
||||
}
|
||||
|
||||
U0 EdInsDollarCmd()
|
||||
{
|
||||
I64 type=PopUpDollarType;
|
||||
@@ -1046,9 +1040,6 @@ U0 EdInsDollarCmd()
|
||||
case DOCT_HEX_ED:
|
||||
EdInsHexEd;
|
||||
break;
|
||||
case DOCT_HIDE_START:
|
||||
EdInsHidden;
|
||||
break;
|
||||
case DOCT_SONG:
|
||||
EdInsSong;
|
||||
break;
|
||||
@@ -1073,7 +1064,7 @@ I64 PopUpSpriteType()
|
||||
{
|
||||
I64 i;
|
||||
CDoc *doc=DocNew;
|
||||
DocPutS(doc,"$$FG,PURPLE$$$$TX+CX,\"Graphic Resource Menu\"$$\n"
|
||||
DocPrint(doc,"$$FG,PURPLE$$$$TX+CX,\"Graphic Resource Menu\"$$\n"
|
||||
"$$LK+PU+CX,\"Click for Help\",\"FI:::/TempleOS/Doc/Resource.TXT.Z\"$$\n"
|
||||
"\n$$FG,LTBLUE$$$$MU,\"Make Sprite\",PT_SPRITE$$\n"
|
||||
"$$MU,\"Pointer to Sprite\",PT_SPRITE_PTR$$\n"
|
||||
@@ -1117,7 +1108,7 @@ U8 *EdSpriteLink(Bool *_pop_up,U8 **_html_link)
|
||||
I64 type=PopUpLinkType(FALSE);
|
||||
*_html_link=NULL;
|
||||
if (type>=0 && PmtLink(type,&tag,&link,_pop_up,"e,_html_link))
|
||||
result=MSPrintF("\"%Q\",\"%Q\"",tag,link);
|
||||
result=MPrint("\"%Q\",\"%Q\"",tag,link);
|
||||
Free(tag);
|
||||
Free(link);
|
||||
return result;
|
||||
@@ -1132,19 +1123,19 @@ U8 *EdSprite(I64 bin_num)
|
||||
*buf=0;
|
||||
switch (type) {
|
||||
case PT_SPRITE:
|
||||
SPrintF(dt->tag,"<%d>",bin_num);
|
||||
SPrint(dt->tag,"<%d>",bin_num);
|
||||
if (DocFormDo(dt,"CEdJustSprite",,,ctrl_L_footer))
|
||||
st1=MSPrintF("\"%Q\"",dt->tag);
|
||||
st1=MPrint("\"%Q\"",dt->tag);
|
||||
break;
|
||||
case PT_SPRITE_MACRO:
|
||||
dt->escape=TRUE;
|
||||
if (DocFormDo(dt,"CEdMacroSprite",,,ctrl_L_footer)) {
|
||||
if (DocFormDo(dt,,,,ctrl_L_footer)) {
|
||||
StrCat(buf,"+LM+UL");
|
||||
if (dt->is_auto)StrCat(buf,"+LA");
|
||||
if (dt->popup) StrCat(buf,"+PU");
|
||||
if (dt->escape) StrCat(buf,"+X");
|
||||
st=MSPrintF("%q",dt->exp);
|
||||
st1=MSPrintF("\"%Q\",\"%Q\"",dt->tag,st);
|
||||
st=MPrint("%q",dt->exp);
|
||||
st1=MPrint("\"%Q\",\"%Q\"",dt->tag,st);
|
||||
Free(st);
|
||||
}
|
||||
break;
|
||||
@@ -1153,7 +1144,7 @@ U8 *EdSprite(I64 bin_num)
|
||||
if (DocFormDo(dt,"CEdMenuSprite",,,ctrl_L_footer)) {
|
||||
StrCat(buf,"+LE");
|
||||
if (dt->escape) StrCat(buf,"+X");
|
||||
st1=MSPrintF("\"%Q\",%s",dt->tag,dt->exp);
|
||||
st1=MPrint("\"%Q\",%s",dt->tag,dt->exp);
|
||||
}
|
||||
break;
|
||||
case PT_SPRITE_LINK:
|
||||
@@ -1178,9 +1169,9 @@ U8 *EdSprite(I64 bin_num)
|
||||
if (st1) {
|
||||
if (html_link) {
|
||||
StrCat(buf,"+HTML");
|
||||
st2=MSPrintF("$$SP%s,%s,\"%Q\",%d$$",buf,st1,html_link,bin_num);
|
||||
st2=MPrint("$$SP%s,%s,\"%Q\",%d$$",buf,st1,html_link,bin_num);
|
||||
} else
|
||||
st2=MSPrintF("$$SP%s,%s,%d$$",buf,st1,bin_num);
|
||||
st2=MPrint("$$SP%s,%s,%d$$",buf,st1,bin_num);
|
||||
Free(st1);
|
||||
}
|
||||
Free(dt);
|
||||
|
||||
+127
-297
@@ -37,17 +37,16 @@ public Bool DocPatternFind(CDoc *doc,I64 start_line_num=MIN_I64,
|
||||
if (pattern) {
|
||||
result=FALSE;
|
||||
while (doc_e!=doc) {
|
||||
if (Bt(doc_tag_types,doc_e->type_u8)) {
|
||||
if (ptr=StrIStr(doc_e->tag,pattern)) { //TODO: handle multientry strings
|
||||
i=ptr-doc_e->tag;
|
||||
if (!--match) {
|
||||
doc->cur_entry=doc_e;
|
||||
if (i<doc_e->min_col) i=doc_e->min_col;
|
||||
if (i>doc_e->max_col) i=doc_e->max_col;
|
||||
doc->cur_data_col=i;
|
||||
result=TRUE;
|
||||
break;
|
||||
}
|
||||
if (Bt(doc_tag_types,doc_e->type_u8) &&
|
||||
(ptr=StrIMatch(pattern,doc_e->tag))) { //TODO: handle multientry strings
|
||||
i=ptr-doc_e->tag;
|
||||
if (!--match) {
|
||||
doc->cur_entry=doc_e;
|
||||
if (i<doc_e->min_col) i=doc_e->min_col;
|
||||
if (i>doc_e->max_col) i=doc_e->max_col;
|
||||
doc->cur_data_col=i;
|
||||
result=TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
doc_e=doc_e->next;
|
||||
@@ -112,7 +111,7 @@ public U0 EdCursorLeft(CDoc *doc,I64 sc=MIN_I64)
|
||||
//See $LK,"EdRenumAsm","MN:EdRenumAsm"$ for an example.
|
||||
U8 *dst;
|
||||
Bool unlock=DocLock(doc);
|
||||
CDocEntry *doc_ce=doc->cur_entry,*original_cl=doc_ce,*doc_ne;
|
||||
CDocEntry *doc_ce=doc->cur_entry,*original_ce=doc_ce,*doc_ne;
|
||||
I64 cc=doc->cur_data_col,y=doc_ce->y;
|
||||
if (sc!=MIN_I64) sc=sc.u32[0];
|
||||
if (sc>=0 && sc&SCF_CTRL) {
|
||||
@@ -122,82 +121,41 @@ public U0 EdCursorLeft(CDoc *doc,I64 sc=MIN_I64)
|
||||
cc=doc_ce->min_col;
|
||||
} else {
|
||||
if (cc>doc_ce->min_col) {
|
||||
if (doc_ce->type_u8==DOCT_TEXT &&
|
||||
!(doc_ce->flags1&DOCEG1_DONT_EDIT) &&
|
||||
!(doc_ce->flags2&DOCEG2_DONT_EDIT) &&
|
||||
cc<doc_ce->max_col) {
|
||||
doc_ne=CAlloc(sizeof(CDocEntryBase),doc->mem_task);
|
||||
doc_ne->type=doc_ce->type;
|
||||
doc_ne->flags1=doc_ce->flags1;
|
||||
doc_ne->flags2=doc_ce->flags2;
|
||||
if (IsEditableText(doc_ce) && cc<doc_ce->max_col) {
|
||||
dst=doc_ce->tag+cc;
|
||||
doc_ne->tag=StrNew(dst,doc->mem_task);
|
||||
doc_ne->max_col=StrLen(dst);
|
||||
doc_ne->x=doc_ce->x;
|
||||
doc_ne->y=doc_ce->y;
|
||||
doc_ne->page_line_num=doc_ce->page_line_num;
|
||||
doc_ne=DocEntryNew(doc,doc_ce,StrNew(dst,doc->mem_task));
|
||||
*dst=0;
|
||||
doc_ce->max_col=cc;
|
||||
QueIns(doc_ne,doc_ce);
|
||||
}
|
||||
cc--;
|
||||
if (doc_ce->type_u8==DOCT_TEXT&&
|
||||
!(doc_ce->flags1&DOCEG1_DONT_EDIT) &&
|
||||
!(doc_ce->flags2&DOCEG2_DONT_EDIT) &&
|
||||
cc>doc_ce->min_col) {
|
||||
doc_ne=CAlloc(sizeof(CDocEntryBase),doc->mem_task);
|
||||
doc_ne->type=doc_ce->type;
|
||||
doc_ne->flags1=doc_ce->flags1;
|
||||
doc_ne->flags2=doc_ce->flags2;
|
||||
if (IsEditableText(doc_ce) && cc>doc_ce->min_col) {
|
||||
dst=doc_ce->tag+cc;
|
||||
doc_ne->tag=StrNew(dst,doc->mem_task);
|
||||
doc_ne->max_col=StrLen(dst);
|
||||
doc_ne->x=doc_ce->x;
|
||||
doc_ne->y=doc_ce->y;
|
||||
doc_ne->page_line_num=doc_ce->page_line_num;
|
||||
doc_ne=DocEntryNew(doc,doc_ce,StrNew(dst,doc->mem_task));
|
||||
*dst=0;
|
||||
doc_ce->max_col=cc;
|
||||
QueIns(doc_ne,doc_ce);
|
||||
doc_ce=doc_ne;
|
||||
cc=doc_ce->min_col;
|
||||
}
|
||||
if (sc>=0) {
|
||||
if (sc&SCF_SHIFT)
|
||||
doc_ce->type|=DOCET_SELECTED;
|
||||
else
|
||||
doc_ce->type&=~DOCET_SELECTED;
|
||||
}
|
||||
if (sc>=0)
|
||||
BEqu(&doc_ce->type,DOCEt_SELECTED,sc&SCF_SHIFT);
|
||||
} else {
|
||||
cc=doc_ce->min_col;
|
||||
while (doc_ce->last!=doc &&
|
||||
(doc_ce->last->type_u8==DOCT_SOFT_NEW_LINE || doc_ce->last->type_u8==DOCT_INDENT ||
|
||||
doc_ce->last->flags1 & (DOCEF1_SKIP|DOCEF1_HARD_SKIP|DOCEF1_FILTER_SKIP))) {
|
||||
doc_ce=doc_ce->last;
|
||||
if (sc>=0) {
|
||||
if (sc&SCF_SHIFT)
|
||||
doc_ce->type|=DOCET_SELECTED;
|
||||
else
|
||||
doc_ce->type&=~DOCET_SELECTED;
|
||||
}
|
||||
if (sc>=0)
|
||||
BEqu(&doc_ce->type,DOCEt_SELECTED,sc&SCF_SHIFT);
|
||||
}
|
||||
if (doc_ce->last!=doc) {
|
||||
doc_ce=doc_ce->last;
|
||||
if (doc_ce->max_col>doc_ce->min_col) {
|
||||
cc=doc_ce->max_col-1;
|
||||
if (doc_ce->type_u8==DOCT_TEXT &&
|
||||
!(doc_ce->flags1&DOCEG1_DONT_EDIT) &&
|
||||
!(doc_ce->flags2&DOCEG2_DONT_EDIT) &&
|
||||
cc>doc_ce->min_col) {
|
||||
doc_ne=CAlloc(sizeof(CDocEntryBase),doc->mem_task);
|
||||
doc_ne->type=doc_ce->type;
|
||||
doc_ne->flags1=doc_ce->flags1;
|
||||
doc_ne->flags2=doc_ce->flags2;
|
||||
if (IsEditableText(doc_ce) && cc>doc_ce->min_col) {
|
||||
dst=doc_ce->tag+cc;
|
||||
doc_ne->tag=StrNew(dst,doc->mem_task);
|
||||
doc_ne->max_col=StrLen(dst);
|
||||
doc_ne->x=doc_ce->x;
|
||||
doc_ne->y=doc_ce->y;
|
||||
doc_ne->page_line_num=doc_ce->page_line_num;
|
||||
doc_ne=DocEntryNew(doc,doc_ce,StrNew(dst,doc->mem_task));
|
||||
*dst=0;
|
||||
doc_ce->max_col=cc;
|
||||
QueIns(doc_ne,doc_ce);
|
||||
@@ -206,18 +164,14 @@ public U0 EdCursorLeft(CDoc *doc,I64 sc=MIN_I64)
|
||||
}
|
||||
} else
|
||||
cc=doc_ce->max_col;
|
||||
if (sc>=0) {
|
||||
if (sc&SCF_SHIFT)
|
||||
doc_ce->type|=DOCET_SELECTED;
|
||||
else
|
||||
doc_ce->type&=~DOCET_SELECTED;
|
||||
}
|
||||
if (sc>=0)
|
||||
BEqu(&doc_ce->type,DOCEt_SELECTED,sc&SCF_SHIFT);
|
||||
}
|
||||
}
|
||||
}
|
||||
doc->cur_data_col=cc;
|
||||
doc->cur_entry=doc_ce;
|
||||
if (doc_ce!=original_cl)
|
||||
if (doc_ce!=original_ce)
|
||||
DocFormBackward(doc);
|
||||
doc->recalc_start=doc->cur_entry->last;
|
||||
if (unlock)
|
||||
@@ -229,7 +183,7 @@ public U0 EdCursorRight(CDoc *doc,I64 sc=MIN_I64)
|
||||
//See $LK,"EdRenumAsm","MN:EdRenumAsm"$ for an example.
|
||||
Bool unlock=DocLock(doc);
|
||||
U8 *dst;
|
||||
CDocEntry *doc_ce=doc->cur_entry,*original_cl=doc_ce,*doc_ne;
|
||||
CDocEntry *doc_ce=doc->cur_entry,*original_ce=doc_ce,*doc_ne;
|
||||
I64 cc=doc->cur_data_col,y=doc_ce->y,old_flags1,old_flags2,old_color;
|
||||
doc->recalc_start=doc_ce->last;
|
||||
if (sc!=MIN_I64) sc=sc.u32[0];
|
||||
@@ -244,20 +198,9 @@ public U0 EdCursorRight(CDoc *doc,I64 sc=MIN_I64)
|
||||
cc=doc_ce->min_col;
|
||||
} else {
|
||||
if (cc<doc_ce->max_col) {
|
||||
if (doc_ce->type_u8==DOCT_TEXT&&
|
||||
!(doc_ce->flags1&DOCEG1_DONT_EDIT) &&
|
||||
!(doc_ce->flags2&DOCEG2_DONT_EDIT) &&
|
||||
cc>doc_ce->min_col) {
|
||||
doc_ne=CAlloc(sizeof(CDocEntryBase),doc->mem_task);
|
||||
doc_ne->type=doc_ce->type;
|
||||
doc_ne->flags1=doc_ce->flags1;
|
||||
doc_ne->flags2=doc_ce->flags2;
|
||||
doc_ne->x=doc_ce->x;
|
||||
doc_ne->y=doc_ce->y;
|
||||
doc_ne->page_line_num=doc_ce->page_line_num;
|
||||
if (IsEditableText(doc_ce) && cc>doc_ce->min_col) {
|
||||
dst=doc_ce->tag+cc;
|
||||
doc_ne->tag=StrNew(dst,doc->mem_task);
|
||||
doc_ne->max_col=StrLen(dst);
|
||||
doc_ne=DocEntryNew(doc,doc_ce,StrNew(dst,doc->mem_task));
|
||||
*dst=0;
|
||||
doc_ce->max_col=cc;
|
||||
QueIns(doc_ne,doc_ce);
|
||||
@@ -268,28 +211,16 @@ public U0 EdCursorRight(CDoc *doc,I64 sc=MIN_I64)
|
||||
old_flags1=doc_ce->flags1;
|
||||
old_flags2=doc_ce->flags2;
|
||||
old_color=doc_ce->type;
|
||||
if (sc>=0) {
|
||||
if (sc&SCF_SHIFT)
|
||||
doc_ce->type|=DOCET_SELECTED;
|
||||
else
|
||||
doc_ce->type&=~DOCET_SELECTED;
|
||||
}
|
||||
if (doc_ce->type_u8==DOCT_TEXT&&
|
||||
!(doc_ce->flags1&DOCEG1_DONT_EDIT) &&
|
||||
!(doc_ce->flags2&DOCEG2_DONT_EDIT) &&
|
||||
cc<doc_ce->max_col) {
|
||||
doc_ne=CAlloc(sizeof(CDocEntryBase),doc->mem_task);
|
||||
if (sc>=0)
|
||||
BEqu(&doc_ce->type,DOCEt_SELECTED,sc&SCF_SHIFT);
|
||||
if (IsEditableText(doc_ce) && cc<doc_ce->max_col) {
|
||||
dst=doc_ce->tag+cc;
|
||||
doc_ne=DocEntryNew(doc,doc_ce,StrNew(dst,doc->mem_task));
|
||||
*dst=0;
|
||||
doc_ne->type=DOCT_TEXT | old_color & -0x100;
|
||||
doc_ne->flags1=old_flags1;
|
||||
doc_ne->flags2=old_flags2;
|
||||
dst=doc_ce->tag+cc;
|
||||
doc_ne->tag=StrNew(dst,doc->mem_task);
|
||||
doc_ne->max_col=StrLen(dst);
|
||||
doc_ce->max_col=cc;
|
||||
*dst=0;
|
||||
doc_ne->x=doc_ce->x;
|
||||
doc_ne->y=doc_ce->y;
|
||||
doc_ne->page_line_num=doc_ce->page_line_num;
|
||||
QueIns(doc_ne,doc_ce);
|
||||
doc_ce=doc_ne;
|
||||
cc=doc_ce->min_col;
|
||||
@@ -299,30 +230,18 @@ public U0 EdCursorRight(CDoc *doc,I64 sc=MIN_I64)
|
||||
}
|
||||
} else {
|
||||
if (doc_ce!=doc) {
|
||||
if (cc<=doc_ce->min_col && sc>=0) {
|
||||
if (sc&SCF_SHIFT)
|
||||
doc_ce->type|=DOCET_SELECTED;
|
||||
else
|
||||
doc_ce->type&=~DOCET_SELECTED;
|
||||
}
|
||||
if (cc<=doc_ce->min_col && sc>=0)
|
||||
BEqu(&doc_ce->type,DOCEt_SELECTED,sc&SCF_SHIFT);
|
||||
doc_ce=doc_ce->next;
|
||||
while (doc_ce!=doc && doc_ce->flags1 & (DOCEF1_SKIP|DOCEF1_HARD_SKIP|DOCEF1_FILTER_SKIP)) {
|
||||
if (sc>=0) {
|
||||
if (sc&SCF_SHIFT)
|
||||
doc_ce->type|=DOCET_SELECTED;
|
||||
else
|
||||
doc_ce->type&=~DOCET_SELECTED;
|
||||
}
|
||||
if (sc>=0)
|
||||
BEqu(&doc_ce->type,DOCEt_SELECTED,sc&SCF_SHIFT);
|
||||
doc_ce=doc_ce->next;
|
||||
}
|
||||
cc=doc_ce->min_col;
|
||||
if (doc_ce->type_u8==DOCT_SOFT_NEW_LINE) {
|
||||
if (sc>=0) {
|
||||
if (sc&SCF_SHIFT)
|
||||
doc_ce->type|=DOCET_SELECTED;
|
||||
else
|
||||
doc_ce->type&=~DOCET_SELECTED;
|
||||
}
|
||||
if (sc>=0)
|
||||
BEqu(&doc_ce->type,DOCEt_SELECTED,sc&SCF_SHIFT);
|
||||
doc_ce=doc_ce->next;
|
||||
cc=doc_ce->min_col;
|
||||
}
|
||||
@@ -331,7 +250,7 @@ public U0 EdCursorRight(CDoc *doc,I64 sc=MIN_I64)
|
||||
}
|
||||
doc->cur_data_col=cc;
|
||||
doc->cur_entry=doc_ce;
|
||||
if (doc_ce!=original_cl)
|
||||
if (doc_ce!=original_ce)
|
||||
DocFormFwd(doc);
|
||||
if (unlock)
|
||||
DocUnlock(doc);
|
||||
@@ -356,21 +275,12 @@ public U0 EdLineUp(CDoc *doc,I64 sc=MIN_I64)
|
||||
doc->cur_data_col=0;
|
||||
}
|
||||
x=doc->x; y=doc->y;
|
||||
if (doc_ce->type_u8==DOCT_TEXT &&
|
||||
!(doc_ce->flags1&DOCEG1_DONT_EDIT) &&
|
||||
!(doc_ce->flags2&DOCEG2_DONT_EDIT)) {
|
||||
if (IsEditableText(doc_ce)) {
|
||||
if (doc_ce->min_col<doc->cur_data_col<doc_ce->max_col-1) {
|
||||
doc_ne=CAlloc(sizeof(CDocEntryBase),doc->mem_task);
|
||||
doc_ne->type=doc_ce->type;
|
||||
doc_ne->flags1=doc_ce->flags1;
|
||||
doc_ne->flags2=doc_ce->flags2;
|
||||
dst=doc_ce->tag+doc->cur_data_col;
|
||||
doc_ne->tag=StrNew(dst,doc->mem_task);
|
||||
doc_ne->max_col=StrLen(dst);
|
||||
doc_ne->y=doc_ce->y;
|
||||
doc_ne->x=doc_ce->x+doc->cur_data_col;
|
||||
doc_ne->page_line_num=doc_ce->page_line_num;
|
||||
doc_ne=DocEntryNew(doc,doc_ce,StrNew(dst,doc->mem_task));
|
||||
*dst=0;
|
||||
doc_ne->x=doc_ce->x+doc->cur_data_col;
|
||||
doc_ce->max_col=doc->cur_data_col;
|
||||
QueIns(doc_ne,doc_ce);
|
||||
} else
|
||||
@@ -379,48 +289,30 @@ public U0 EdLineUp(CDoc *doc,I64 sc=MIN_I64)
|
||||
} else
|
||||
if (doc_ce->last!=doc)
|
||||
doc_ce=doc_ce->last;
|
||||
if (sc>=0) {
|
||||
if (sc&SCF_SHIFT)
|
||||
doc_ce->type|=DOCET_SELECTED;
|
||||
else
|
||||
doc_ce->type&=~DOCET_SELECTED;
|
||||
}
|
||||
if (sc>=0)
|
||||
BEqu(&doc_ce->type,DOCEt_SELECTED,sc&SCF_SHIFT);
|
||||
doc->cur_entry=doc_ce;
|
||||
DocFormBackward(doc);
|
||||
doc_ce=doc->cur_entry;
|
||||
while (doc_ce->last!=doc && (doc_ce->y>=y || doc_ce->flags1 & (DOCEF1_SKIP|DOCEF1_HARD_SKIP|DOCEF1_FILTER_SKIP))) {
|
||||
doc_ce=doc_ce->last;
|
||||
if (sc>=0) {
|
||||
if (sc&SCF_SHIFT)
|
||||
doc_ce->type|=DOCET_SELECTED;
|
||||
else
|
||||
doc_ce->type&=~DOCET_SELECTED;
|
||||
}
|
||||
if (sc>=0)
|
||||
BEqu(&doc_ce->type,DOCEt_SELECTED,sc&SCF_SHIFT);
|
||||
}
|
||||
y=doc_ce->y;
|
||||
doc->y=y;
|
||||
while (doc_ce!=doc && (doc_ce->y>=y && doc_ce->x>=x || doc_ce->flags1 & (DOCEF1_SKIP|DOCEF1_HARD_SKIP|DOCEF1_FILTER_SKIP))) {
|
||||
if (sc>=0) {
|
||||
if (sc&SCF_SHIFT)
|
||||
doc_ce->type|=DOCET_SELECTED;
|
||||
else
|
||||
doc_ce->type&=~DOCET_SELECTED;
|
||||
}
|
||||
if (sc>=0)
|
||||
BEqu(&doc_ce->type,DOCEt_SELECTED,sc&SCF_SHIFT);
|
||||
doc_ce=doc_ce->last;
|
||||
}
|
||||
|
||||
if (doc_ce==doc || doc_ce->y<y)
|
||||
doc_ce=doc_ce->next;
|
||||
else {
|
||||
if (doc_ce->type_u8!=DOCT_TEXT||
|
||||
doc_ce->flags1&DOCEG1_DONT_EDIT ||
|
||||
doc_ce->flags2&DOCEG2_DONT_EDIT) {
|
||||
if (sc>=0) {
|
||||
if (sc&SCF_SHIFT)
|
||||
doc_ce->type|=DOCET_SELECTED;
|
||||
else
|
||||
doc_ce->type&=~DOCET_SELECTED;
|
||||
}
|
||||
if (!IsEditableText(doc_ce)) {
|
||||
if (sc>=0)
|
||||
BEqu(&doc_ce->type,DOCEt_SELECTED,sc&SCF_SHIFT);
|
||||
} else {
|
||||
if (doc_ce->next->x==x) {
|
||||
doc_ce=doc_ce->next;
|
||||
@@ -435,9 +327,7 @@ public U0 EdLineUp(CDoc *doc,I64 sc=MIN_I64)
|
||||
}
|
||||
if (Bt(doc_tag_types,doc_ce->type_u8)) {
|
||||
doc->cur_data_col=x-doc_ce->x;
|
||||
if (doc_ce->type_u8==DOCT_TEXT&&
|
||||
!(doc_ce->flags1&DOCEG1_DONT_EDIT) &&
|
||||
!(doc_ce->flags2&DOCEG2_DONT_EDIT)) {
|
||||
if (IsEditableText(doc_ce)) {
|
||||
if (doc->cur_data_col>doc_ce->max_col)
|
||||
doc->cur_data_col=doc_ce->max_col;
|
||||
} else {
|
||||
@@ -454,27 +344,18 @@ public U0 EdLineUp(CDoc *doc,I64 sc=MIN_I64)
|
||||
} else
|
||||
doc->cur_data_col=doc_ce->min_col;
|
||||
}
|
||||
if (doc_ce->type_u8==DOCT_TEXT &&
|
||||
!(doc_ce->flags1&DOCEG1_DONT_EDIT) &&
|
||||
!(doc_ce->flags2&DOCEG2_DONT_EDIT) && doc_ce->x<x) {
|
||||
if (IsEditableText(doc_ce) && doc_ce->x<x) {
|
||||
if (doc->cur_data_col<doc_ce->max_col-1) {
|
||||
doc_ne=CAlloc(sizeof(CDocEntryBase),doc->mem_task);
|
||||
doc_ne->type=doc_ce->type;
|
||||
doc_ne->flags1=doc_ce->flags1;
|
||||
doc_ne->flags2=doc_ce->flags2;
|
||||
dst=doc_ce->tag+doc->cur_data_col;
|
||||
doc_ne=DocEntryNew(doc,doc_ce,StrNew(dst,doc->mem_task));
|
||||
*dst=0;
|
||||
if (sc>=0) {
|
||||
if (sc&SCF_SHIFT)
|
||||
doc_ne->type=doc_ce->type | DOCET_SELECTED;
|
||||
else
|
||||
doc_ne->type=doc_ce->type & ~DOCET_SELECTED;
|
||||
}
|
||||
dst=doc_ce->tag+doc->cur_data_col;
|
||||
doc_ne->tag=StrNew(dst,doc->mem_task);
|
||||
doc_ne->max_col=StrLen(dst);
|
||||
doc_ne->page_line_num=doc_ce->page_line_num;
|
||||
doc_ne->y=doc_ce->y;
|
||||
doc_ne->x=doc_ce->x+doc->cur_data_col;
|
||||
*dst=0;
|
||||
doc_ce->max_col=doc->cur_data_col;
|
||||
QueIns(doc_ne,doc_ce);
|
||||
doc_ce=doc_ne;
|
||||
@@ -511,27 +392,18 @@ public U0 EdLineDown(CDoc *doc,I64 sc=MIN_I64)
|
||||
}
|
||||
doc->recalc_start=doc_ce->last;
|
||||
x=doc->x; y=doc->y;
|
||||
if (doc_ce->type_u8==DOCT_TEXT &&
|
||||
!(doc_ce->flags1&DOCEG1_DONT_EDIT)&&
|
||||
!(doc_ce->flags2&DOCEG2_DONT_EDIT)) {
|
||||
if (IsEditableText(doc_ce)) {
|
||||
if (doc->cur_data_col>doc_ce->min_col && doc->cur_data_col<doc_ce->max_col-1) {
|
||||
doc_ne=CAlloc(sizeof(CDocEntryBase),doc->mem_task);
|
||||
doc_ne->type=doc_ce->type;
|
||||
doc_ne->flags1=doc_ce->flags1;
|
||||
doc_ne->flags2=doc_ce->flags2;
|
||||
dst=doc_ce->tag+doc->cur_data_col;
|
||||
doc_ne=DocEntryNew(doc,doc_ce,StrNew(dst,doc->mem_task));
|
||||
*dst=0;
|
||||
if (sc>=0) {
|
||||
if (sc&SCF_SHIFT)
|
||||
doc_ne->type=doc_ce->type | DOCET_SELECTED;
|
||||
else
|
||||
doc_ne->type=doc_ce->type & ~DOCET_SELECTED;
|
||||
}
|
||||
dst=doc_ce->tag+doc->cur_data_col;
|
||||
doc_ne->tag=StrNew(dst,doc->mem_task);
|
||||
doc_ne->max_col=StrLen(dst);
|
||||
doc_ne->page_line_num=doc_ce->page_line_num;
|
||||
doc_ne->y=doc_ce->y;
|
||||
doc_ne->x=doc_ce->x+doc->cur_data_col;
|
||||
*dst=0;
|
||||
doc_ce->max_col=doc->cur_data_col;
|
||||
QueIns(doc_ne,doc_ce);
|
||||
doc_ce=doc_ne;
|
||||
@@ -557,27 +429,19 @@ public U0 EdLineDown(CDoc *doc,I64 sc=MIN_I64)
|
||||
DocFormBackward(doc);
|
||||
doc_ce=doc->cur_entry;
|
||||
}
|
||||
while (doc_ce2!=doc && (doc_ce2!=doc_ce || doc_ce->type_u8==DOCT_TEXT &&
|
||||
!(doc_ce->flags1&DOCEG1_DONT_EDIT) &&
|
||||
!(doc_ce->flags2&DOCEG2_DONT_EDIT))) {
|
||||
while (doc_ce2!=doc && (doc_ce2!=doc_ce || IsEditableText(doc_ce))) {
|
||||
if (doc_ce2->y<y || doc_ce2->x<x || doc_ce2->flags1 & (DOCEF1_SKIP|DOCEF1_HARD_SKIP|DOCEF1_FILTER_SKIP) ||
|
||||
doc_ce2->x==x && !doc_ce2->max_col &&
|
||||
Bt(doc_nontag_invisible_types,doc_ce2->type_u8)) {
|
||||
if (sc>=0) {
|
||||
if (sc&SCF_SHIFT)
|
||||
doc_ce2->type|=DOCET_SELECTED;
|
||||
else
|
||||
doc_ce2->type&=~DOCET_SELECTED;
|
||||
}
|
||||
if (sc>=0)
|
||||
BEqu(&doc_ce2->type,DOCEt_SELECTED,sc&SCF_SHIFT);
|
||||
}
|
||||
if (doc_ce2==doc_ce) break;
|
||||
doc_ce2=doc_ce2->next;
|
||||
}
|
||||
if (Bt(doc_tag_types,doc_ce->type_u8)) {
|
||||
doc->cur_data_col=x-doc_ce->x;
|
||||
if (doc_ce->type_u8==DOCT_TEXT&&
|
||||
!(doc_ce->flags1&DOCEG1_DONT_EDIT) &&
|
||||
!(doc_ce->flags2&DOCEG2_DONT_EDIT)) {
|
||||
if (IsEditableText(doc_ce)) {
|
||||
if (doc->cur_data_col>doc_ce->max_col)
|
||||
doc->cur_data_col=doc_ce->max_col;
|
||||
} else {
|
||||
@@ -588,21 +452,15 @@ public U0 EdLineDown(CDoc *doc,I64 sc=MIN_I64)
|
||||
doc->cur_data_col=doc_ce->min_col;
|
||||
} else
|
||||
doc->cur_data_col=doc_ce->min_col;
|
||||
if (doc_ce->type_u8==DOCT_TEXT&&
|
||||
!(doc_ce->flags1&DOCEG1_DONT_EDIT) &&
|
||||
!(doc_ce->flags2&DOCEG2_DONT_EDIT)) {
|
||||
if (IsEditableText(doc_ce)) {
|
||||
if (doc_ce->min_col<doc->cur_data_col<doc_ce->max_col-1) {
|
||||
doc_ne=CAlloc(sizeof(CDocEntryBase),doc->mem_task);
|
||||
dst=doc_ce->tag+doc->cur_data_col;
|
||||
doc_ne=DocEntryNew(doc,doc_ce,StrNew(dst,doc->mem_task));
|
||||
*dst=0;
|
||||
doc_ne->type=DOCT_TEXT | old_color & -0x100;
|
||||
doc_ne->flags1=old_flags1;
|
||||
doc_ne->flags2=old_flags2;
|
||||
dst=doc_ce->tag+doc->cur_data_col;
|
||||
doc_ne->tag=StrNew(dst,doc->mem_task);
|
||||
doc_ne->max_col=StrLen(dst);
|
||||
*dst=0;
|
||||
doc_ce->max_col=doc->cur_data_col;
|
||||
doc_ne->y=doc_ce->y;
|
||||
doc_ne->page_line_num=doc_ce->page_line_num;
|
||||
doc_ne->x=doc_ce->x+doc->cur_data_col;
|
||||
QueIns(doc_ne,doc_ce);
|
||||
doc_ce=doc_ne;
|
||||
@@ -613,12 +471,8 @@ public U0 EdLineDown(CDoc *doc,I64 sc=MIN_I64)
|
||||
DocFormFwd(doc);
|
||||
if (!(doc->flags & DOCF_FORM))
|
||||
while (doc_ce!=doc && doc_ce!=doc->cur_entry) {
|
||||
if (sc>=0) {
|
||||
if (sc&SCF_SHIFT)
|
||||
doc_ce->type|=DOCET_SELECTED;
|
||||
else
|
||||
doc_ce->type&=~DOCET_SELECTED;
|
||||
}
|
||||
if (sc>=0)
|
||||
BEqu(&doc_ce->type,DOCEt_SELECTED,sc&SCF_SHIFT);
|
||||
doc_ce=doc_ce->next;
|
||||
}
|
||||
doc->x=doc->cur_entry->x+doc->cur_data_col;
|
||||
@@ -637,9 +491,7 @@ U0 EdDelChar(CDoc *doc)
|
||||
return;
|
||||
} else
|
||||
doc->recalc_start=doc_ce->last;
|
||||
if (doc_ce->max_col!=0 && (doc_ce->type_u8==DOCT_TEXT&&
|
||||
!(doc_ce->flags1&DOCEG1_DONT_EDIT) &&
|
||||
!(doc_ce->flags2&DOCEG2_DONT_EDIT)|| doc_ce->type_u8==DOCT_DATA)) {
|
||||
if (doc_ce->max_col!=0 && (IsEditableText(doc_ce)||doc_ce->type_u8==DOCT_DATA)) {
|
||||
if (doc_ce->type_u8==DOCT_DATA) {
|
||||
if (doc_ce->flags1 & DOCEF1_HAS_TERMINATOR && doc->cur_data_col==doc_ce->max_col-1) {
|
||||
if (unlock)
|
||||
@@ -703,7 +555,7 @@ U0 EdInsChar(I64 ch,I64 sc,CDoc *doc)
|
||||
goto ic_cont;
|
||||
} else {
|
||||
doc->dollar_buf[doc->dollar_buf_ptr]=0;
|
||||
DocPutS(doc,doc->dollar_buf);
|
||||
DocPrint(doc,doc->dollar_buf);
|
||||
doc->flags&=~DOCF_IN_DOLLAR;
|
||||
doc->dollar_buf_ptr=0;
|
||||
goto ic_done;
|
||||
@@ -761,9 +613,7 @@ ic_cont:
|
||||
if (doc->flags & DOCF_OVERSTRIKE) {
|
||||
if (Bt(displayable_chars_bitmap,ch)) {
|
||||
ic_overstrike_char:
|
||||
if (doc_ce->type_u8==DOCT_TEXT&&
|
||||
!(doc_ce->flags1&DOCEG1_DONT_EDIT) &&
|
||||
!(doc_ce->flags2&DOCEG2_DONT_EDIT)) {
|
||||
if (IsEditableText(doc_ce)) {
|
||||
if (doc->cur_data_col<doc_ce->max_col) {
|
||||
if (doc_ce->tag[doc->cur_data_col]) {
|
||||
doc_ce->tag[doc->cur_data_col++]=ch;
|
||||
@@ -794,13 +644,10 @@ ic_overstrike_char:
|
||||
b=MAlloc(2,doc->mem_task);
|
||||
*b=ch;
|
||||
b[1]=0;
|
||||
doc_ne=CAlloc(sizeof(CDocEntryBase),doc->mem_task);
|
||||
doc_ne=DocEntryNew(doc,doc_ce,b);
|
||||
doc_ne->type=DOCT_TEXT | doc->settings_root.dft_text_attr << 8;
|
||||
doc_ne->tag=b;
|
||||
doc_ne->max_col=1;
|
||||
doc_ne->x=doc_ce->x;
|
||||
doc_ne->y=doc_ce->y;
|
||||
doc_ne->page_line_num=doc_ce->page_line_num;
|
||||
doc_ne->flags1=0;
|
||||
doc_ne->flags2=0;
|
||||
QueIns(doc_ne,doc_ce->last);
|
||||
} else if (ch=='\n') {
|
||||
while (doc->cur_entry->next!=doc && doc->cur_entry->y==y)
|
||||
@@ -846,9 +693,7 @@ ic_form_tab:
|
||||
b[i]=b[i-1];
|
||||
b[doc->cur_data_col++]=ch;
|
||||
}
|
||||
} else if (doc_ce->type_u8==DOCT_TEXT&&
|
||||
!(doc_ce->flags1&DOCEG1_DONT_EDIT) &&
|
||||
!(doc_ce->flags2&DOCEG2_DONT_EDIT)) {
|
||||
} else if (IsEditableText(doc_ce)) {
|
||||
dst=b=MAlloc(doc_ce->max_col+2,doc->mem_task);
|
||||
src=doc_ce->tag;
|
||||
i=doc->cur_data_col;
|
||||
@@ -864,13 +709,11 @@ ic_form_tab:
|
||||
b=MAlloc(2,doc->mem_task);
|
||||
*b=ch;
|
||||
b[1]=0;
|
||||
doc_ne=CAlloc(sizeof(CDocEntryBase),doc->mem_task);
|
||||
doc_ne=DocEntryNew(doc,doc_ce,b);
|
||||
doc_ne->type=DOCT_TEXT | doc->settings_root.dft_text_attr << 8;
|
||||
doc_ne->tag=b;
|
||||
doc_ne->max_col=1;
|
||||
doc_ne->flags1=0;
|
||||
doc_ne->flags2=0;
|
||||
doc_ne->x=doc_ce->x+1;
|
||||
doc_ne->y=doc_ce->y;
|
||||
doc_ne->page_line_num=doc_ce->page_line_num;
|
||||
QueIns(doc_ne,doc_ce->last);
|
||||
}
|
||||
}
|
||||
@@ -879,7 +722,7 @@ ic_done:
|
||||
DocRemSoftNewLines(doc,doc->cur_entry);
|
||||
if (doc->cur_entry->flags1 & DOCEF1_UPDATE_DATA) {
|
||||
if (doc->cur_entry->type_u8==DOCT_DATA || doc->cur_entry->type_u8==DOCT_CHECK_BOX)
|
||||
DocDataGet(doc->cur_entry);
|
||||
DocDataScan(doc->cur_entry);
|
||||
}
|
||||
if (unlock)
|
||||
DocUnlock(doc);
|
||||
@@ -912,13 +755,13 @@ public U0 EdFindNext(CDoc *doc)
|
||||
Bool unlock=DocLock(doc);
|
||||
U8 *ptr,*ptr2,*ptr3;
|
||||
CDocEntry *doc_ce=doc->cur_entry,*doc_e=doc_ce;
|
||||
I64 ss_flags;
|
||||
I64 sf_flags;
|
||||
if (doc->find_replace->match_case)
|
||||
ss_flags=0;
|
||||
sf_flags=0;
|
||||
else
|
||||
ss_flags=SRF_IGNORE_CASE;
|
||||
sf_flags=SFF_IGNORE_CASE;
|
||||
if (doc->find_replace->whole_labels)
|
||||
ss_flags|=SRG_WHOLE_LABELS;
|
||||
sf_flags|=SFG_WHOLE_LABELS;
|
||||
do {
|
||||
if (doc_e!=doc) {
|
||||
if (Bt(doc_tag_types,doc_e->type_u8)&&
|
||||
@@ -934,7 +777,7 @@ public U0 EdFindNext(CDoc *doc)
|
||||
ptr=doc_ce->tag+doc_ce->min_col;
|
||||
} else
|
||||
ptr=doc_e->tag;
|
||||
if (ptr=SearchStr(ptr,doc->find_replace->find_text,ss_flags)) {
|
||||
if (ptr=StrFind(doc->find_replace->find_text,ptr,sf_flags)) {
|
||||
doc->cur_entry=doc_e;
|
||||
doc->cur_data_col=ptr-doc_e->tag;
|
||||
if (doc->cur_data_col>=doc_e->max_col)
|
||||
@@ -953,7 +796,7 @@ public U0 EdFindNext(CDoc *doc)
|
||||
ptr3=doc_ce->tag+doc->cur_data_col;
|
||||
else
|
||||
ptr3=doc_e->tag+doc_e->max_col;
|
||||
while (ptr=SearchStr(ptr,doc->find_replace->find_text,ss_flags)) {
|
||||
while (ptr=StrFind(doc->find_replace->find_text,ptr,sf_flags)) {
|
||||
if (ptr>=ptr3)
|
||||
break;
|
||||
ptr2=ptr++;
|
||||
@@ -989,10 +832,7 @@ public U0 EdSelectAll(CDoc *doc,Bool select)
|
||||
Bool unlock=DocLock(doc);
|
||||
CDocEntry *doc_e=doc->root.next;
|
||||
while (doc_e!=doc) {
|
||||
if (select)
|
||||
doc_e->type|=DOCET_SELECTED;
|
||||
else
|
||||
doc_e->type&=~DOCET_SELECTED;
|
||||
BEqu(&doc_e->type,DOCEt_SELECTED,select);
|
||||
doc_e=doc_e->next;
|
||||
}
|
||||
if (unlock)
|
||||
@@ -1005,7 +845,7 @@ public Bool EdFindPaired(CDoc *doc,U8 plus,U8 minus,Bool fwd,Bool abort_on_dbl_c
|
||||
Bool unlock=DocLock(doc),result=FALSE;
|
||||
U8 ch,*ptr,original_col=doc->cur_data_col;
|
||||
I64 levels=0,colons=0;
|
||||
CDocEntry *doc_ce=doc->cur_entry,*doc_e=doc_ce,*original_cl=doc_ce;
|
||||
CDocEntry *doc_ce=doc->cur_entry,*doc_e=doc_ce,*original_ce=doc_ce;
|
||||
if (abort_on_dbl_colon && EdCurU8(doc)==':')
|
||||
colons=1;
|
||||
else
|
||||
@@ -1039,7 +879,7 @@ public Bool EdFindPaired(CDoc *doc,U8 plus,U8 minus,Bool fwd,Bool abort_on_dbl_c
|
||||
if (!levels--) {
|
||||
doc->cur_entry=doc_e;
|
||||
doc->cur_data_col=ptr-doc_e->tag-1;
|
||||
result=doc->cur_entry!=original_cl || doc->cur_data_col!=original_col;
|
||||
result=doc->cur_entry!=original_ce || doc->cur_data_col!=original_col;
|
||||
goto pa_done;
|
||||
}
|
||||
}
|
||||
@@ -1070,7 +910,7 @@ public Bool EdFindPaired(CDoc *doc,U8 plus,U8 minus,Bool fwd,Bool abort_on_dbl_c
|
||||
if (!levels--) {
|
||||
doc->cur_entry=doc_e;
|
||||
doc->cur_data_col=ptr-doc_e->tag+1;
|
||||
result=doc->cur_entry!=original_cl || doc->cur_data_col!=original_col;
|
||||
result=doc->cur_entry!=original_ce || doc->cur_data_col!=original_col;
|
||||
goto pa_done;
|
||||
}
|
||||
}
|
||||
@@ -1195,28 +1035,28 @@ U0 EdUndoFilter(CDoc *doc)
|
||||
I64 EdFindReplace(CDoc *doc)
|
||||
{
|
||||
Bool first=TRUE,found,unlock;
|
||||
I64 cmd,i,j,plen,rlen,dlen,result=-1,ss_flags;
|
||||
I64 cmd,i,j,plen,rlen,dlen,result=-1,sf_flags;
|
||||
U8 *src,*dst,*dst2;
|
||||
CDocEntry *doc_ce=doc->cur_entry,*doc_e;
|
||||
if (doc->find_replace->pmt)
|
||||
cmd=RSAC_REPLACE;
|
||||
else
|
||||
cmd=RSAC_ALL;
|
||||
if (!doc->find_replace->pmt || DocFormDo(doc->find_replace,"CEdFindText")) {
|
||||
if (!doc->find_replace->pmt || DocFormDo(doc->find_replace)) {
|
||||
result=0;
|
||||
unlock=DocLock(doc);
|
||||
if (doc->find_replace->match_case || doc->find_replace->local_var)
|
||||
ss_flags=0;
|
||||
sf_flags=0;
|
||||
else
|
||||
ss_flags=SRF_IGNORE_CASE;
|
||||
sf_flags=SFF_IGNORE_CASE;
|
||||
if (doc->find_replace->whole_labels || doc->find_replace->local_var)
|
||||
ss_flags|=SRG_WHOLE_LABELS;
|
||||
sf_flags|=SFG_WHOLE_LABELS;
|
||||
|
||||
if (i=doc->find_replace->filter_lines) {
|
||||
doc_ce=doc->root.next;
|
||||
while (doc_ce!=doc) {
|
||||
if (doc_ce->type_u8==DOCT_TEXT && !(doc_ce->flags1&(DOCEF1_TAG_CB|DOCEF1_DEFINE|DOCEF1_HARD_SKIP|DOCEF1_FILTER_SKIP))&&
|
||||
SearchStr(doc_ce->tag,doc->find_replace->find_text,ss_flags)) {
|
||||
StrFind(doc->find_replace->find_text,doc_ce->tag,sf_flags)) {
|
||||
doc_ce->type|=DOCET_SELECTED;
|
||||
result++;
|
||||
} else
|
||||
@@ -1281,7 +1121,7 @@ I64 EdFindReplace(CDoc *doc)
|
||||
(doc_e->type & DOCET_SELECTED || !doc->find_replace->scan_selected_text&&!doc->find_replace->local_var)) {
|
||||
src=doc_e->tag;
|
||||
while (src) {
|
||||
src=SearchStr(src,doc->find_replace->find_text,ss_flags);
|
||||
src=StrFind(doc->find_replace->find_text,src,sf_flags);
|
||||
if (src) {
|
||||
doc->cur_data_col=src-doc_e->tag;
|
||||
doc->cur_entry=doc_e;
|
||||
@@ -1388,7 +1228,7 @@ public U0 EdGoToLine(CDoc *doc)
|
||||
{
|
||||
CEdLineGoTo gtl;
|
||||
gtl.line=1;
|
||||
if (DocFormDo(>l,"CEdLineGoTo"))
|
||||
if (DocFormDo(>l))
|
||||
DocLineNumGoTo(doc,gtl.line);
|
||||
}
|
||||
|
||||
@@ -1458,8 +1298,8 @@ U0 DocEntryToggle(CDoc *doc)
|
||||
doc_ce->tag[j+1]=ch;
|
||||
StrCpy(doc_ce->tag+i,doc_ce->tag+j+1);
|
||||
doc->cur_data_col=i;
|
||||
st2=MSPrintF("%q",st);
|
||||
if (doc_ce=DocPutS(doc,st2)) {
|
||||
st2=MPrint("%q",st);
|
||||
if (doc_ce=DocPrint(doc,st2)) {
|
||||
doc->cur_entry=doc_ce;
|
||||
doc->cur_data_col=doc_ce->min_col;
|
||||
}
|
||||
@@ -1469,7 +1309,7 @@ U0 DocEntryToggle(CDoc *doc)
|
||||
} else {
|
||||
st=Doc2PlainText(doc,doc_ce);
|
||||
DocEntryDel(doc,doc_ce);
|
||||
DocPrintF(doc,"$$$$%Q$$$$",st);
|
||||
DocPrint(doc,"$$$$%Q$$$$",st);
|
||||
}
|
||||
DocRecalc(doc);
|
||||
}
|
||||
@@ -1614,12 +1454,12 @@ public U0 DocPutKey(CDoc *doc,I64 ch,I64 sc)
|
||||
if (sc&SCF_KEY_DESC)
|
||||
SetKeyDesc("Dollar/Indent Out");
|
||||
else
|
||||
DocPutS(doc,"$$ID,-2$$");
|
||||
DocPrint(doc,"$$ID,-2$$");
|
||||
} else {
|
||||
if (sc&SCF_KEY_DESC)
|
||||
SetKeyDesc("Dollar/Indent In");
|
||||
else
|
||||
DocPutS(doc,"$$ID,2$$");
|
||||
DocPrint(doc,"$$ID,2$$");
|
||||
}
|
||||
break;
|
||||
case '\n':
|
||||
@@ -1635,9 +1475,9 @@ public U0 DocPutKey(CDoc *doc,I64 ch,I64 sc)
|
||||
if (sc&SCF_KEY_DESC)
|
||||
SetKeyDesc("Dollar/Toggle Blinking Text");
|
||||
else if (sc&SCF_SHIFT)
|
||||
DocPutS(doc,"$$BK,0$$");
|
||||
DocPrint(doc,"$$BK,0$$");
|
||||
else
|
||||
DocPutS(doc,"$$BK,1$$");
|
||||
DocPrint(doc,"$$BK,1$$");
|
||||
break;
|
||||
case CH_CTRLL:
|
||||
if (sc&SCF_KEY_DESC) {
|
||||
@@ -1689,21 +1529,21 @@ public U0 DocPutKey(CDoc *doc,I64 ch,I64 sc)
|
||||
if (sc&SCF_KEY_DESC)
|
||||
SetKeyDesc("Dollar/Toggle Super or Sub script");
|
||||
else {
|
||||
DocPutS(doc,"$$SY,0$$");
|
||||
DocPrint(doc,"$$SY,0$$");
|
||||
doc->flags&=~(DOCF_SUPERSCRIPT_MODE | DOCF_SUBSCRIPT_MODE);
|
||||
}
|
||||
} else if (sc&SCF_SHIFT) {
|
||||
if (sc&SCF_KEY_DESC)
|
||||
SetKeyDesc("Dollar/Toggle Subscript");
|
||||
else {
|
||||
DocPutS(doc,"$$SY,3$$");
|
||||
DocPrint(doc,"$$SY,3$$");
|
||||
doc->flags|=DOCF_SUBSCRIPT_MODE;
|
||||
}
|
||||
} else {
|
||||
if (sc&SCF_KEY_DESC)
|
||||
SetKeyDesc("Dollar/Toggle Superscript");
|
||||
else {
|
||||
DocPutS(doc,"$$SY,-3$$");
|
||||
DocPrint(doc,"$$SY,-3$$");
|
||||
doc->flags|=DOCF_SUPERSCRIPT_MODE;
|
||||
}
|
||||
}
|
||||
@@ -1759,9 +1599,9 @@ public U0 DocPutKey(CDoc *doc,I64 ch,I64 sc)
|
||||
if (sc&SCF_KEY_DESC)
|
||||
SetKeyDesc("Dollar/Toggle Underline");
|
||||
else if (sc&SCF_SHIFT)
|
||||
DocPutS(doc,"$$UL,0$$");
|
||||
DocPrint(doc,"$$UL,0$$");
|
||||
else
|
||||
DocPutS(doc,"$$UL,1$$");
|
||||
DocPrint(doc,"$$UL,1$$");
|
||||
break;
|
||||
case CH_CTRLV:
|
||||
if (sc&SCF_KEY_DESC)
|
||||
@@ -1773,9 +1613,9 @@ public U0 DocPutKey(CDoc *doc,I64 ch,I64 sc)
|
||||
if (sc&SCF_KEY_DESC)
|
||||
SetKeyDesc("Dollar/Toggle Word Wrap");
|
||||
else if (sc&SCF_SHIFT)
|
||||
DocPutS(doc,"$$WW,0$$");
|
||||
DocPrint(doc,"$$WW,0$$");
|
||||
else
|
||||
DocPutS(doc,"$$WW,1$$");
|
||||
DocPrint(doc,"$$WW,1$$");
|
||||
break;
|
||||
case CH_CTRLX:
|
||||
if (sc&SCF_KEY_DESC)
|
||||
@@ -1793,9 +1633,9 @@ public U0 DocPutKey(CDoc *doc,I64 ch,I64 sc)
|
||||
if (sc&SCF_KEY_DESC)
|
||||
SetKeyDesc("Dollar/Toggle Inverted Text");
|
||||
else if (sc&SCF_SHIFT)
|
||||
DocPutS(doc,"$$IV,0$$");
|
||||
DocPrint(doc,"$$IV,0$$");
|
||||
else
|
||||
DocPutS(doc,"$$IV,1$$");
|
||||
DocPrint(doc,"$$IV,1$$");
|
||||
break;
|
||||
case '0'...'9':
|
||||
if (!(sc&SCF_ALT)) {
|
||||
@@ -2045,10 +1885,7 @@ public U0 DocPutKey(CDoc *doc,I64 ch,I64 sc)
|
||||
SetKeyDesc("Edit/GoTo Doc End");
|
||||
} else {
|
||||
while (doc_ce!=doc) {
|
||||
if (sc&SCF_SHIFT)
|
||||
doc_ce->type|=DOCET_SELECTED;
|
||||
else
|
||||
doc_ce->type&=~DOCET_SELECTED;
|
||||
BEqu(&doc_ce->type,DOCEt_SELECTED,sc&SCF_SHIFT);
|
||||
doc_ce=doc->cur_entry=doc_ce->next;
|
||||
}
|
||||
doc->cur_data_col=doc_ce->min_col;
|
||||
@@ -2074,10 +1911,7 @@ public U0 DocPutKey(CDoc *doc,I64 ch,I64 sc)
|
||||
} else {
|
||||
if (doc_ce==doc) doc_ce=doc_ce->last;
|
||||
while (doc_ce!=doc) {
|
||||
if (sc&SCF_SHIFT)
|
||||
doc_ce->type|=DOCET_SELECTED;
|
||||
else
|
||||
doc_ce->type&=~DOCET_SELECTED;
|
||||
BEqu(&doc_ce->type,DOCEt_SELECTED,sc&SCF_SHIFT);
|
||||
doc_ce=doc->cur_entry=doc_ce->last;
|
||||
}
|
||||
doc_ce=doc->cur_entry=doc->root.next;
|
||||
@@ -2252,9 +2086,7 @@ public U0 DocPutSPartial(CDoc *doc,U8 *st)
|
||||
doc_ce=doc->cur_entry;
|
||||
doc->recalc_start=doc_ce->last;
|
||||
j=ptr-ptr2;
|
||||
if (doc_ce->type_u8==DOCT_TEXT &&
|
||||
!(doc_ce->flags1&DOCEG1_DONT_EDIT) &&
|
||||
!(doc_ce->flags2&DOCEG2_DONT_EDIT)) {
|
||||
if (IsEditableText(doc_ce)) {
|
||||
dst=b=MAlloc(doc_ce->max_col+j+1,doc->mem_task);
|
||||
src=doc_ce->tag;
|
||||
i=doc->cur_data_col;
|
||||
@@ -2268,14 +2100,12 @@ public U0 DocPutSPartial(CDoc *doc,U8 *st)
|
||||
Free(doc_ce->tag);
|
||||
doc_ce->tag=b;
|
||||
} else {
|
||||
doc_ne=CAlloc(sizeof(CDocEntryBase),doc->mem_task);
|
||||
dst=MAlloc(j+1,doc->mem_task);
|
||||
MemCpy(dst,ptr2,j+1);
|
||||
doc_ne=DocEntryNew(doc,doc_ce,dst);
|
||||
doc_ne->type=DOCT_TEXT | doc->settings_root.dft_text_attr << 8;
|
||||
doc_ne->tag=MAlloc(j+1,doc->mem_task);
|
||||
MemCpy(doc_ne->tag,ptr2,j+1);
|
||||
doc_ne->x=doc_ce->x;
|
||||
doc_ne->y=doc_ce->y;
|
||||
doc_ne->max_col=j;
|
||||
doc_ne->page_line_num=doc_ce->page_line_num;
|
||||
doc_ne->flags1=0;
|
||||
doc_ne->flags2=0;
|
||||
QueIns(doc_ne,doc_ce->last);
|
||||
doc->cur_entry=doc_ne;
|
||||
doc->cur_data_col=StrLen(ptr2);
|
||||
@@ -2394,7 +2224,7 @@ public I64 EdLinkCvt(U8 *link_st,U8 **_filename=NULL,U8 **_pattern=NULL,
|
||||
if (StrLen(st)>3 && st[2]==':') {
|
||||
st[2]=0;
|
||||
filename2=st+3;
|
||||
switch (result=DefineMatch(st,"ST_LINK_TYPES",LEF_IGNORE_CASE)) {
|
||||
switch (result=DefineMatch(st,"ST_LINK_TYPES",LMF_IGNORE_CASE)) {
|
||||
case LK_MAN_PAGE:
|
||||
if (temph=HashFind(filename2,Fs->hash_table,HTG_SRC_SYM)) {
|
||||
if (temph->type&HTT_DEFINE_STR && temph(CHashDefineStr *)->caller) {
|
||||
@@ -2414,7 +2244,7 @@ public I64 EdLinkCvt(U8 *link_st,U8 **_filename=NULL,U8 **_pattern=NULL,
|
||||
i=A2I(ptr+1);
|
||||
} else
|
||||
i=DFT_ADDR_LINK_BIN_SIZE;
|
||||
if (ptr=SrcEdLink(ExePrintF("%s;",filename2),i)) {
|
||||
if (ptr=SrcEdLink(ExePrint("%s;",filename2),i)) {
|
||||
result=EdLinkCvt(ptr,&filename,&pattern,&num,ed_flags);
|
||||
Free(ptr);
|
||||
} else
|
||||
@@ -2437,7 +2267,7 @@ public I64 EdLinkCvt(U8 *link_st,U8 **_filename=NULL,U8 **_pattern=NULL,
|
||||
*ptr=0;
|
||||
pattern=StrNew(ptr+1);
|
||||
}
|
||||
i=DefineMatch(filename2,"ST_BIBLE_BOOKS",LEF_IGNORE_CASE);
|
||||
i=DefineMatch(filename2,"ST_BIBLE_BOOKS",LMF_IGNORE_CASE);
|
||||
if (i<0)
|
||||
result=-1;
|
||||
else {
|
||||
|
||||
@@ -7,7 +7,7 @@ public U0 DocLoad(CDoc *doc,U8 *src2,I64 size)
|
||||
CDocBin *tempb;
|
||||
doc->find_replace->filter_lines=0;
|
||||
if (src2) {
|
||||
DocPutS(doc,src2);
|
||||
DocPutS(doc,src2); //Too big $LK,"DocPrint","MN:DocPrint"$() is wasteful.
|
||||
src=src2+StrLen(src2)+1;
|
||||
i=size-(offset(CDocBin.data)-offset(CDocBin.start));
|
||||
while (src<=src2+i) {
|
||||
@@ -57,7 +57,7 @@ public U8 *DocSave(CDoc *doc,I64 *_size=NULL)
|
||||
I64 i,cnt;
|
||||
U8 *st,*result,*dst,*src,ch;
|
||||
|
||||
if (doc->flags&DOCF_NO_CURSOR)
|
||||
if (doc->flags&DOCF_NO_CURSOR || doc->root.next==doc)
|
||||
cnt=1; //terminator
|
||||
else
|
||||
cnt=2; //cursor + terminator
|
||||
@@ -143,7 +143,7 @@ public U8 *DocSave(CDoc *doc,I64 *_size=NULL)
|
||||
break;
|
||||
default:
|
||||
if (doc_e->type_u8!=DOCT_SOFT_NEW_LINE &&
|
||||
doc_e->type_u8!=DOCT_CURSOR &&
|
||||
doc_e->type_u8!=DOCT_CURSOR && //(Cursor is set by cur_entry)
|
||||
doc_e->type_u8!=DOCT_BPT) {
|
||||
*dst++='$$';
|
||||
st=Doc2PlainText(doc,doc_e);
|
||||
@@ -156,7 +156,14 @@ public U8 *DocSave(CDoc *doc,I64 *_size=NULL)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (doc->cur_entry==doc && doc->root.next!=doc && !(doc->flags&DOCF_NO_CURSOR))
|
||||
*dst++=CH_CURSOR;
|
||||
*dst++=0;
|
||||
if (*result==CH_CURSOR) {
|
||||
MemCpy(result,result+1,dst-result-1);
|
||||
cnt--;
|
||||
dst--;
|
||||
}
|
||||
b=doc->bin_root.next;
|
||||
if (b!=&doc->bin_root) {
|
||||
do {
|
||||
@@ -169,7 +176,7 @@ public U8 *DocSave(CDoc *doc,I64 *_size=NULL)
|
||||
b=b->next;
|
||||
} while (b!=&doc->bin_root);
|
||||
} else
|
||||
cnt--;
|
||||
cnt--; //No terminator
|
||||
if (_size) *_size=cnt;
|
||||
if (unlock)
|
||||
DocUnlock(doc);
|
||||
@@ -181,7 +188,7 @@ public U0 DocWrite(CDoc *doc,Bool prompt=FALSE)
|
||||
I64 size;
|
||||
U8 *buf=DocSave(doc,&size);
|
||||
if (prompt) {
|
||||
if (DocFormDo(&doc->filename,"CEdFileName"))
|
||||
if (DocFormDo(&doc->filename))
|
||||
FileWrite(doc->filename.name,buf,size,0,doc->file_attr);
|
||||
} else
|
||||
FileWrite(doc->filename.name,buf,size,0,doc->file_attr);
|
||||
@@ -194,29 +201,22 @@ public U0 DocInsDoc(CDoc *doc,CDoc *doc2)
|
||||
U8 *dst;
|
||||
Bool unlock_doc=DocLock(doc),
|
||||
unlock_doc2=DocLock(doc2);
|
||||
CDocEntry *doc_ne,*doc_e=doc2->root.next;
|
||||
CDocEntry *doc_ne,*doc_e=doc2->root.next,*doc_ce;
|
||||
DocRemSoftNewLines(doc,NULL);
|
||||
if (doc->cur_entry->type_u8==DOCT_TEXT &&
|
||||
doc->cur_data_col>doc->cur_entry->min_col) {
|
||||
if (doc->cur_data_col<doc->cur_entry->max_col) {
|
||||
doc_ne=CAlloc(sizeof(CDocEntryBase),doc->mem_task);
|
||||
doc_ne->type=DOCT_TEXT | doc->cur_entry->type & 0xFFFFFF00;
|
||||
doc_ne->flags1=doc->cur_entry->flags1;
|
||||
doc_ne->flags2=doc->cur_entry->flags2;
|
||||
doc_ne->x=doc->cur_entry->x;
|
||||
doc_ne->y=doc->cur_entry->y;
|
||||
doc_ne->page_line_num=doc->cur_entry->page_line_num;
|
||||
dst=doc->cur_entry->tag+doc->cur_data_col;
|
||||
doc_ne->tag=StrNew(dst,doc->mem_task);
|
||||
doc_ne->max_col=StrLen(dst);
|
||||
doc_ce=doc->cur_entry;
|
||||
if (doc_ce->type_u8==DOCT_TEXT && doc->cur_data_col>doc_ce->min_col) {
|
||||
if (doc->cur_data_col<doc_ce->max_col) {
|
||||
dst=doc_ce->tag+doc->cur_data_col;
|
||||
doc_ne=DocEntryNew(doc,doc_ce,StrNew(dst,doc->mem_task));
|
||||
*dst=0;
|
||||
doc->cur_entry->max_col=doc->cur_data_col;
|
||||
QueIns(doc_ne,doc->cur_entry);
|
||||
doc_ne->type=DOCT_TEXT | doc_ce->type & 0xFFFFFF00;
|
||||
doc_ce->max_col=doc->cur_data_col;
|
||||
QueIns(doc_ne,doc_ce);
|
||||
doc->cur_entry=doc_ne;
|
||||
doc->cur_data_col=doc_ne->min_col;
|
||||
} else
|
||||
if (doc->cur_entry!=doc)
|
||||
doc->cur_entry=doc->cur_entry->next;
|
||||
if (doc_ce!=doc)
|
||||
doc->cur_entry=doc_ce->next;
|
||||
}
|
||||
while (doc_e!=doc2) {
|
||||
if (doc_e->type_u8!=DOCT_SOFT_NEW_LINE) {
|
||||
@@ -363,11 +363,11 @@ public U0 StreamDoc(CDoc *doc)
|
||||
CDocEntry *doc_e=doc->root.next;
|
||||
while (doc_e!=doc) {
|
||||
if (doc_e->type_u8==DOCT_TEXT)
|
||||
StreamPutS(doc_e->tag);
|
||||
StreamPrint("%s",doc_e->tag);
|
||||
else if (doc_e->type_u8==DOCT_NEW_LINE)
|
||||
StreamPutS("\n");
|
||||
StreamPrint("\n");
|
||||
else if (doc_e->type_u8==DOCT_TAB)
|
||||
StreamPutS("\t");
|
||||
StreamPrint("\t");
|
||||
doc_e=doc_e->next;
|
||||
}
|
||||
if (unlock_doc)
|
||||
@@ -383,7 +383,7 @@ Bool DocCaptureUndo(CDoc *doc,Bool force=FALSE)
|
||||
CDocUndo *u;
|
||||
if (doc->flags&DOCF_ALLOW_UNDO) {
|
||||
unlock=DocLock(doc);
|
||||
time_stamp=GetTimeStamp;
|
||||
time_stamp=GetTSC;
|
||||
if (doc->flags&DOCF_UNDO_DIRTY &&
|
||||
time_stamp>doc->undo_root.last->time_stamp+time_stamp_freq<<4 || force) {
|
||||
u=CAlloc(sizeof(CDocUndo),doc->mem_task);
|
||||
@@ -433,18 +433,18 @@ public Bool DocType(CDoc *doc=NULL,U8 *filename,I64 trailing_new_lines=1)
|
||||
CDoc *doc2;
|
||||
if (!doc && !(doc=DocPut) || doc->doc_signature!=DOC_SIGNATURE_VAL)
|
||||
return FALSE;
|
||||
if (FilesFindMatch(FILENAME_MASK_TXT,filename)) {
|
||||
if (FilesFindMatch(filename,FILEMASK_TXT)) {
|
||||
doc2=DocRead(filename);
|
||||
DocInsDoc(doc,doc2);
|
||||
DocDel(doc2);
|
||||
result=TRUE;
|
||||
} else if (FilesFindMatch("*.BMP.Z",filename)) {
|
||||
} else if (FilesFindMatch(filename,"*.BMP.Z")) {
|
||||
DocPutBMPFile(doc,filename,FALSE);
|
||||
result=TRUE;
|
||||
} else if (FilesFindMatch("*.BMP;*.bmp",filename)) {
|
||||
} else if (FilesFindMatch(filename,"*.BMP;*.bmp")) {
|
||||
DocPutBMPFile(doc,filename,TRUE);
|
||||
result=TRUE;
|
||||
} else if (FilesFindMatch("*.GRA*",filename)) {
|
||||
} else if (FilesFindMatch(filename,"*.GRA*")) {
|
||||
DocPutGRAFile(doc,filename);
|
||||
result=TRUE;
|
||||
}
|
||||
|
||||
@@ -137,9 +137,9 @@ public U0 IDE(U8 *filename)
|
||||
"simple stuff, sort-of.\n\n"
|
||||
"I recommend making use of:\n"
|
||||
"$$LK,\"progress1\",\"MN:progress1\"$$-$$LK,\"progress4\",\"MN:progress4\"$$, -- glbl I64 vars shown on wallpaper\n"
|
||||
"$$LK,\"DbgI64\",\"MN:DbgI64\"$$() $$LK,\"DbgStr\",\"MN:DbgStr\"$$() $$LK,\"DbgAdd\",\"MN:DbgAdd\"$$() -- raw text output for a time\n"
|
||||
"$$LK,\"RawI64\",\"MN:RawI64\"$$() $$LK,\"RawStr\",\"MN:RawStr\"$$() $$LK,\"RawAdd\",\"MN:RawAdd\"$$() -- raw text output for a time\n"
|
||||
"$$LK,\"Beep\",\"MN:Beep\"$$() $$LK,\"Snd\",\"MN:Snd\"$$() -- sound\n"
|
||||
"$$LK,\"AdamLog\",\"MN:AdamLog\"$$() $$LK,\"AdamErr\",\"MN:AdamErr\"$$() -- printf to adam task's window\n"
|
||||
"$$LK,\"AdamLog\",\"MN:AdamLog\"$$() $$LK,\"AdamErr\",\"MN:AdamErr\"$$() -- print to adam task's window\n"
|
||||
"$$LK,\"SysDbg\",\"MN:SysDbg\"$$() and $$LK,\"IsSysDbg\",\"MN:IsSysDbg\"$$() -- just a flag\n\n")) {
|
||||
SetWinHorz(1,TEXT_COLS>>1-1);
|
||||
SetWinVert(2,TEXT_ROWS-2);
|
||||
@@ -211,7 +211,7 @@ U0 IDESetStepRange(CDoc *doc)
|
||||
I64 line=doc->cur_entry->y+1;
|
||||
CHashTable *h=Fs->hash_table;
|
||||
CHashFun *tempf;
|
||||
CIDE *tempi=NamedFramePtr("IDEFrame");
|
||||
CIDE *tempi=FramePtr("IDEFrame");
|
||||
CDbgInfo *dbg;
|
||||
while (h) {
|
||||
tempf=h->next_added;
|
||||
@@ -266,7 +266,7 @@ U0 IDEToggleBpt(CDoc *doc)
|
||||
doc->cur_data_col=doc_e->min_col;
|
||||
if (!BptR(a,Fs->parent_task)) {
|
||||
BptS(a,Fs->parent_task);
|
||||
DocPutS(doc,"$$BP$$");
|
||||
DocPrint(doc,"$$BP$$");
|
||||
} else {
|
||||
if (doc_e->type_u8==DOCT_BPT) {
|
||||
doc->cur_entry=doc_e->next;
|
||||
@@ -314,10 +314,10 @@ U0 IDEClearAllBpts(CDoc *doc)
|
||||
U0 IDEGo() //Continue after breakpoint
|
||||
{ //F5
|
||||
CTask *task=Fs->parent_task;
|
||||
CIDE *tempi=NamedFramePtr("IDEFrame");
|
||||
CIDE *tempi=FramePtr("IDEFrame");
|
||||
if (!tempi) {
|
||||
tempi=CAlloc(sizeof(CIDE));
|
||||
NamedFramePtrAdd("IDEFrame",tempi);
|
||||
FramePtrAdd("IDEFrame",tempi);
|
||||
}
|
||||
IDEWaitParent;
|
||||
LBts(&task->task_flags,TASKf_DISABLE_BPTS);
|
||||
@@ -333,10 +333,10 @@ U0 IDEStepOver(CDoc *doc)
|
||||
I64 line;
|
||||
U8 *opcode;
|
||||
|
||||
CIDE *tempi=NamedFramePtr("IDEFrame");
|
||||
CIDE *tempi=FramePtr("IDEFrame");
|
||||
if (!tempi) {
|
||||
tempi=CAlloc(sizeof(CIDE));
|
||||
NamedFramePtrAdd("IDEFrame",tempi);
|
||||
FramePtrAdd("IDEFrame",tempi);
|
||||
}
|
||||
|
||||
IDEWaitParent;
|
||||
@@ -373,10 +373,10 @@ U0 IDEStepInto(CDoc *doc)
|
||||
CTask *task=Fs->parent_task;
|
||||
I64 line;
|
||||
|
||||
CIDE *tempi=NamedFramePtr("IDEFrame");
|
||||
CIDE *tempi=FramePtr("IDEFrame");
|
||||
if (!tempi) {
|
||||
tempi=CAlloc(sizeof(CIDE));
|
||||
NamedFramePtrAdd("IDEFrame",tempi);
|
||||
FramePtrAdd("IDEFrame",tempi);
|
||||
}
|
||||
|
||||
IDEWaitParent;
|
||||
@@ -407,16 +407,16 @@ U0 IDEEdTask(I64)
|
||||
if (rip_filename=SrcFileName(rip)) {
|
||||
ed_task=Spawn(&UserCmdLine,NULL,"Debug",,task);
|
||||
TaskWait(ed_task);
|
||||
st=MSPrintF("Preempt(OFF);Ed(\"%s\");\n",rip_filename);
|
||||
st=MPrint("Preempt(OFF);Ed(\"%s\");\n",rip_filename);
|
||||
XTalkWait(ed_task,st);
|
||||
Free(st);
|
||||
doc=DocPut(ed_task);
|
||||
if (TaskValidate(dbg_task=task->dbg_task)) {
|
||||
SetWinHorz(dbg_task->win_left,dbg_task->win_right, ed_task);
|
||||
SetWinVert(dbg_task->win_top, dbg_task->win_bottom,ed_task);
|
||||
if (tempi=NamedFramePtr("IDEFrame",dbg_task)) {
|
||||
if (tempi=FramePtr("IDEFrame",dbg_task)) {
|
||||
tempi1=MAllocIdentical(tempi,ed_task);
|
||||
NamedFramePtrAdd("IDEFrame",tempi1);
|
||||
FramePtrAdd("IDEFrame",tempi1);
|
||||
}
|
||||
Kill(dbg_task);
|
||||
}
|
||||
@@ -426,7 +426,7 @@ U0 IDEEdTask(I64)
|
||||
if (bpt_filename=SrcFileName(tempb->addr)) {
|
||||
if (!StrCmp(rip_filename,bpt_filename)) {
|
||||
DocLineNumGoTo(doc,SrcLineNum(tempb->addr));
|
||||
DocPutS(doc,"$$BP$$");
|
||||
DocPrint(doc,"$$BP$$");
|
||||
}
|
||||
Free(bpt_filename);
|
||||
}
|
||||
@@ -441,7 +441,7 @@ U0 IDEEdTask(I64)
|
||||
U0 IDEResumeDbg()
|
||||
{
|
||||
CTask *dbg_task=Fs->dbg_task;
|
||||
CIDE *tempi=NamedFramePtr("IDEFrame",dbg_task);
|
||||
CIDE *tempi=FramePtr("IDEFrame",dbg_task);
|
||||
U8 *opcode;
|
||||
if (!tempi) {
|
||||
Spawn(&IDEEdTask,NULL,"Resume Dbg",,Fs);
|
||||
|
||||
@@ -41,10 +41,10 @@ CMacroTemp *Cmd2MT(CSrvCmd *tempc)
|
||||
tempmt->type=MT_CHAR;
|
||||
buf[0]=tempc->aux1;
|
||||
buf[1]=0;
|
||||
SPrintF(tempmt->buf,"%Q",buf);
|
||||
SPrint(tempmt->buf,"%Q",buf);
|
||||
} else {
|
||||
tempmt->type=MT_MSG;
|
||||
SPrintF(tempmt->buf,"Msg(0x%X,0x%X,0x%X);",
|
||||
SPrint(tempmt->buf,"Msg(0x%X,0x%X,0x%X);",
|
||||
tempc->msg_code,tempc->aux1,tempc->aux2);
|
||||
}
|
||||
return tempmt;
|
||||
@@ -149,14 +149,14 @@ I64 PopUpExitRecordPlayStopIns()
|
||||
U8 buf[136];
|
||||
CSrvCmd *tempc;
|
||||
CDoc *doc=DocNew;
|
||||
CDocEntry *doc_e=DocPutS(doc,"$$DA-P,135,\"Name:%s\"$$");
|
||||
CDocEntry *doc_e=DocPrint(doc,"$$DA-P,135,\"Name:%%s\"$$");
|
||||
I64 result=0;
|
||||
doc_e->data=captured_macro_name;
|
||||
DocDataFmt(doc_e);
|
||||
doc_e=DocPutS(doc,"\n$$DA,32,\"Repeat N:%d\"$$");
|
||||
doc_e=DocPrint(doc,"\n$$DA,32,\"Repeat N:%%d\"$$");
|
||||
doc_e->data=&sys_macro_repeat_n;
|
||||
DocDataFmt(doc_e);
|
||||
DocPutS(doc,"\n"
|
||||
DocPrint(doc,"\n"
|
||||
"$$CM+LX,1,3$$$$BT,\"RECORD\",SM_RECORD$$"
|
||||
"$$CM+LX,17,0$$$$BT,\"INSERT\",SM_INS$$"
|
||||
"$$CM+LX,1,3$$$$BT,\"PLAY\",SM_PLAY$$"
|
||||
@@ -165,7 +165,7 @@ I64 PopUpExitRecordPlayStopIns()
|
||||
"$$CM+LX,17,0$$$$BT,\"CANCEL\",SM_CANCEL$$"
|
||||
"\n\n\n$$FG,GREEN$$SHIFT-F2$$FG$$ will play macro.\n");
|
||||
doc->flags|=DOCF_MIN_SIZE | DOCF_FORM;
|
||||
SPrintF(buf,"DocMenuDo(0x%X);",doc);
|
||||
SPrint(buf,"DocMenuDo(0x%X);",doc);
|
||||
sys_macro_util_task=Spawn(&SrvUserCmdLine,NULL,"Macro Popup",,Fs);
|
||||
Fs->popup_task=sys_macro_util_task;
|
||||
LBts(&sys_macro_util_task->display_flags,DISPLAYf_WIN_ON_TOP);
|
||||
@@ -175,7 +175,7 @@ I64 PopUpExitRecordPlayStopIns()
|
||||
Fs->popup_task=NULL;
|
||||
Kill(sys_macro_util_task);
|
||||
sys_macro_util_task=NULL;
|
||||
DocDataGet(doc_e);
|
||||
DocDataScan(doc_e);
|
||||
DocDel(doc);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ ej_doc:
|
||||
EdLite(filename,num);
|
||||
else {
|
||||
cont=TRUE;
|
||||
if (!(ed_flags&EDF_BAIL) && !FilesFindMatch(FILENAME_MASK_TXT,filename) &&
|
||||
if (!(ed_flags&EDF_BAIL) && !FilesFindMatch(filename,FILEMASK_TXT) &&
|
||||
!PopUpCancelOk(ST_WARN_ST "Not Text File\n\n"))
|
||||
cont=FALSE;
|
||||
if (cont)
|
||||
@@ -48,7 +48,7 @@ public Bool Plain(U8 *filename)
|
||||
//so that dollar signs are not special.
|
||||
{
|
||||
Bool result;
|
||||
U8 *st=MSPrintF("PI:%s",filename);
|
||||
U8 *st=MPrint("PI:%s",filename);
|
||||
result=Ed(st);
|
||||
Free(st);
|
||||
return result;
|
||||
@@ -116,46 +116,46 @@ public CDoc *SysBorderDocInit()
|
||||
bdoc->flags|=DOCF_BORDER_DOC;
|
||||
|
||||
if (doc) {
|
||||
DocPutS(bdoc,"$$CM+H+BY+RX+NC,-7,1$$");
|
||||
doc_e=DocPutS(bdoc,"$$TX+H+BD+TC,\" \"$$");
|
||||
DocPrint(bdoc,"$$CM+H+BY+RX+NC,-7,1$$");
|
||||
doc_e=DocPrint(bdoc,"$$TX+H+BD+TC,\" \"$$");
|
||||
doc_e->user_data=doc;
|
||||
doc_e->tag_cb=&EdFilterCB;
|
||||
doc_e=DocPutS(bdoc,"$$TX+H+BD+TC,\" \"$$");
|
||||
doc_e=DocPrint(bdoc,"$$TX+H+BD+TC,\" \"$$");
|
||||
doc_e->user_data=doc;
|
||||
doc_e->tag_cb=&EdOverStrikeCB;
|
||||
doc_e=DocPutS(bdoc,"$$TX+H+BD+TC,\" \"$$");
|
||||
doc_e=DocPrint(bdoc,"$$TX+H+BD+TC,\" \"$$");
|
||||
doc_e->user_data=doc;
|
||||
doc_e->tag_cb=&EdDollarCB;
|
||||
}
|
||||
|
||||
DocPutS(bdoc,"$$CM+H+BY+RX+NC,-4,1$$");
|
||||
doc_e=DocPutS(bdoc,"$$TX+H+BD+TC,\" \"$$");
|
||||
DocPrint(bdoc,"$$CM+H+BY+RX+NC,-4,1$$");
|
||||
doc_e=DocPrint(bdoc,"$$TX+H+BD+TC,\" \"$$");
|
||||
doc_e->tag_cb=&EdQuotesCB;
|
||||
doc_e=DocPutS(bdoc,"$$TX+H+BD+TC,\" \"$$");
|
||||
doc_e=DocPrint(bdoc,"$$TX+H+BD+TC,\" \"$$");
|
||||
doc_e->tag_cb=&EdBracesCB;
|
||||
doc_e=DocPutS(bdoc,"$$TX+H+BD+TC,\" \"$$");
|
||||
doc_e=DocPrint(bdoc,"$$TX+H+BD+TC,\" \"$$");
|
||||
doc_e->tag_cb=&EdSemicolonCB;
|
||||
|
||||
if (doc) {
|
||||
DocPutS(bdoc,"$$CM+H+BY+RX+NC,-18,1$$");
|
||||
doc_e=DocPutS(bdoc,"$$TX+BD+TC,\" \"$$");
|
||||
DocPrint(bdoc,"$$CM+H+BY+RX+NC,-18,1$$");
|
||||
doc_e=DocPrint(bdoc,"$$TX+BD+TC,\" \"$$");
|
||||
doc_e->user_data=doc;
|
||||
doc_e->tag_cb=&EdMoreCB;
|
||||
doc_e=DocPutS(bdoc,"$$TX+H+BD+TC,\" \"$$");
|
||||
doc_e=DocPrint(bdoc,"$$TX+H+BD+TC,\" \"$$");
|
||||
doc_e->user_data=doc;
|
||||
doc_e->tag_cb=&EdDollarTypeCB;
|
||||
}
|
||||
|
||||
if (Fs->user_num)
|
||||
DocPrintF(bdoc,"$$CM+H+TY+LX+NC,5,-1$$$$TX+H+BD,\"#%d\"$$",Fs->user_num);
|
||||
DocPutS(bdoc,"$$CM+H+TY+NC,0,-1$$");
|
||||
doc_e=DocPutS(bdoc,"$$DA+H-T-P+BD+RD+CX+SCX+IV,140,\"%s...\",16$$");
|
||||
DocPrint(bdoc,"$$CM+H+TY+LX+NC,5,-1$$$$TX+H+BD,\"#%d\"$$",Fs->user_num);
|
||||
DocPrint(bdoc,"$$CM+H+TY+NC,0,-1$$");
|
||||
doc_e=DocPrint(bdoc,"$$DA+H-T-P+BD+RD+CX+SCX+IV,140,\"%%s...\",16$$");
|
||||
doc_e->data=&Fs->task_title;
|
||||
DocDataFmt(doc_e);
|
||||
DocPrintF(bdoc,"$$CM+H+NC,1,0$$$$TX+H+BD+IV,\"%X\"$$",Fs);
|
||||
DocPrint(bdoc,"$$CM+H+NC,1,0$$$$TX+H+BD+IV,\"%X\"$$",Fs);
|
||||
if (Bt(&Fs->display_flags,DISPLAYf_HAS_CLOSE_WIN))
|
||||
DocPutS(bdoc,"$$TX+H+RX+BD,\"[X]\"$$");
|
||||
DocPutS(bdoc,"$$BK,1$$$$TX+H+LX+BD,\"MENU\"$$$$BK,0$$");
|
||||
DocPrint(bdoc,"$$TX+H+RX+BD,\"[X]\"$$");
|
||||
DocPrint(bdoc,"$$BK,1$$$$TX+H+LX+BD,\"MENU\"$$$$BK,0$$");
|
||||
return bdoc;
|
||||
}
|
||||
|
||||
@@ -176,7 +176,7 @@ public U0 UseTermDoc()
|
||||
}
|
||||
|
||||
#help_index "Doc/Input"
|
||||
public U8 *DocGetLine(CDoc *doc,CDocEntry *doc_e,I64 *cur_col=NULL,CDocEntry **_do_e_end=NULL)
|
||||
public U8 *DocScanLine(CDoc *doc,CDocEntry *doc_e,I64 *cur_col=NULL,CDocEntry **_do_e_end=NULL)
|
||||
{
|
||||
CDocEntry *doc_e2=doc_e;
|
||||
Bool unlock=DocLock(doc);
|
||||
@@ -223,8 +223,8 @@ U0 DocDump(CDoc *doc,I64 uS_delay=0)
|
||||
Bool unlock=DocLock(doc);
|
||||
doc_e=doc->root.next;
|
||||
while (doc_e!=doc) {
|
||||
st=DocGetLine(doc,doc_e,NULL,&doc_e2);
|
||||
"" st;
|
||||
st=DocScanLine(doc,doc_e,NULL,&doc_e2);
|
||||
"%s",st;
|
||||
Free(st);
|
||||
doc_e=doc_e2;
|
||||
if (doc_e->type_u8==DOCT_NEW_LINE) {
|
||||
@@ -255,7 +255,7 @@ public CDocEntry *DocPutLine(CDoc *doc=NULL,CDocEntry *doc_e)
|
||||
else
|
||||
ptr++;
|
||||
*ptr=0;
|
||||
"" ptr2;
|
||||
"%s",ptr2;
|
||||
*ptr=ch;
|
||||
if (ch=='$$') {
|
||||
"$$$$";
|
||||
@@ -318,10 +318,10 @@ public U8 *DocMGetS(I64 flags=0)
|
||||
do doc_e=doc_e->last;
|
||||
while (doc_e!=doc && doc_e->type_u8!=DOCT_PMT);
|
||||
doc_e=doc_e->next;
|
||||
if (result=DocGetLine(doc,doc_e,NULL,&doc_e_end)) {
|
||||
if (result=DocScanLine(doc,doc_e,NULL,&doc_e_end)) {
|
||||
while (doc_e_end!=doc && doc_e_end->type_u8==DOCT_NEW_LINE) {
|
||||
result=StrAdd(result,"\n");
|
||||
if (st=DocGetLine(doc,doc_e_end->next,NULL,&doc_e_end)) {
|
||||
if (st=DocScanLine(doc,doc_e_end->next,NULL,&doc_e_end)) {
|
||||
result=StrAdd(result,st);
|
||||
Free(st);
|
||||
}
|
||||
@@ -338,7 +338,7 @@ public U8 *DocMGetS(I64 flags=0)
|
||||
doc_e->type_u8!=DOCT_PMT);
|
||||
}
|
||||
doc_e=doc_e->next;
|
||||
result=DocGetLine(doc,doc_e,NULL);
|
||||
result=DocScanLine(doc,doc_e,NULL);
|
||||
}
|
||||
DocUnlock(doc);
|
||||
mgets_done:
|
||||
@@ -349,20 +349,21 @@ mgets_done:
|
||||
|
||||
#help_index "Char/Input"
|
||||
|
||||
public I64 PmtI64(U8 *msg,I64 dft,I64 lo=MIN_I64,I64 hi=MAX_I64)
|
||||
public I64 PmtI64(U8 *msg=NULL,I64 dft=0,I64 lo=MIN_I64,I64 hi=MAX_I64)
|
||||
{
|
||||
Bool okay;
|
||||
U8 *st;
|
||||
I64 result;
|
||||
while (TRUE) {
|
||||
"" msg,dft;
|
||||
if (msg)
|
||||
"" msg,dft;
|
||||
st=MGetS;
|
||||
if (!*st) {
|
||||
Free(st);
|
||||
return dft;
|
||||
}
|
||||
try {
|
||||
result=ExePrintF3("ToI64(%s);",st);
|
||||
result=ExePrint3("ToI64(%s);",st);
|
||||
okay=TRUE;
|
||||
} catch {
|
||||
Fs->catch_except=TRUE;
|
||||
@@ -374,20 +375,21 @@ public I64 PmtI64(U8 *msg,I64 dft,I64 lo=MIN_I64,I64 hi=MAX_I64)
|
||||
}
|
||||
}
|
||||
|
||||
public F64 PmtF64(U8 *msg,F64 dft,F64 lo=MIN_F64,F64 hi=MAX_F64)
|
||||
public F64 PmtF64(U8 *msg=NULL,F64 dft=0,F64 lo=MIN_F64,F64 hi=MAX_F64)
|
||||
{
|
||||
Bool okay;
|
||||
U8 *st;
|
||||
F64 result;
|
||||
while (TRUE) {
|
||||
"" msg,dft;
|
||||
if (msg)
|
||||
"" msg,dft;
|
||||
st=MGetS;
|
||||
if (!*st) {
|
||||
Free(st);
|
||||
return dft;
|
||||
}
|
||||
try {
|
||||
result=ExePrintF3("ToF64(%s);",st)(F64);
|
||||
result=ExePrint3("ToF64(%s);",st)(F64);
|
||||
okay=TRUE;
|
||||
} catch {
|
||||
Fs->catch_except=TRUE;
|
||||
@@ -402,12 +404,8 @@ public F64 PmtF64(U8 *msg,F64 dft,F64 lo=MIN_F64,F64 hi=MAX_F64)
|
||||
public U8 *PmtStr(U8 *msg=NULL,U8 *dft=NULL)
|
||||
{
|
||||
U8 *st;
|
||||
if (msg) {
|
||||
if (dft)
|
||||
"" msg,dft;
|
||||
else
|
||||
"" msg;
|
||||
}
|
||||
if (msg)
|
||||
"" msg,dft;
|
||||
st=MGetS;
|
||||
if (!*st) {
|
||||
Free(st);
|
||||
@@ -419,12 +417,14 @@ public U8 *PmtStr(U8 *msg=NULL,U8 *dft=NULL)
|
||||
return st;
|
||||
}
|
||||
|
||||
public CDate PmtCDate(U8 *msg,CDate dft,CDate lo=MIN_I64,CDate hi=MAX_I64)
|
||||
public CDate PmtCDate(U8 *msg=NULL,CDate dft=0,CDate lo=MIN_I64,CDate hi=MAX_I64)
|
||||
{
|
||||
U8 *st;
|
||||
CDate result;
|
||||
if (!dft) dft=GetDateTime;
|
||||
while (TRUE) {
|
||||
"" msg,dft,dft;
|
||||
if (msg)
|
||||
"" msg,dft,dft;
|
||||
st=MGetS;
|
||||
if (!*st) {
|
||||
Free(st);
|
||||
@@ -457,8 +457,8 @@ I64 PopUpCancelIncludeDelAuto(U8 *header=NULL,U8 *footer=NULL)
|
||||
{
|
||||
I64 i;
|
||||
CDoc *doc=DocNew;
|
||||
if (header) DocPutS(doc,header);
|
||||
DocPrintF(doc,"\n\n"
|
||||
if (header) DocPrint(doc,"%s",header);
|
||||
DocPrint(doc,"\n\n"
|
||||
"TXT=%s\n"
|
||||
"SRC=%s\n"
|
||||
"AOT=%s\n"
|
||||
@@ -478,12 +478,12 @@ I64 PopUpCancelIncludeDelAuto(U8 *header=NULL,U8 *footer=NULL)
|
||||
"$$CM+LX,26,0$$$$BT,\"PLAIN ED TXT\",RIGHT_PLAIN$$"
|
||||
"$$CM+LX,1,3 $$$$BT,\"CANCEL \",DOCM_CANCEL$$"
|
||||
"$$CM+LX,26,0$$$$BT,\"BINREP BIN\",RIGHT_BINREP$$\n",
|
||||
FILENAME_MASK_TXT,
|
||||
FILENAME_MASK_SRC,
|
||||
FILENAME_MASK_AOT,
|
||||
FILENAME_MASK_JIT,
|
||||
FILENAME_MASK_GRA);
|
||||
if (footer) DocPutS(doc,footer);
|
||||
FILEMASK_TXT,
|
||||
FILEMASK_SRC,
|
||||
FILEMASK_AOT,
|
||||
FILEMASK_JIT,
|
||||
FILEMASK_GRA);
|
||||
if (footer) DocPrint(doc,"%s",footer);
|
||||
i=PopUpMenu(doc);
|
||||
DocDel(doc);
|
||||
return i;
|
||||
@@ -496,7 +496,7 @@ I64 EdLeftClickLink(CDoc *doc,CDocEntry *doc_e)
|
||||
if (st=DocEntryLink(doc,doc_e)) {
|
||||
DocUnlock(doc);
|
||||
if (doc_e->flags1 & DOCEF1_POPUP) {
|
||||
st2=MSPrintF("Ed(\"%Q\");",st);
|
||||
st2=MPrint("Ed(\"%Q\");",st);
|
||||
result=PopUp(st2);
|
||||
Free(st2);
|
||||
} else
|
||||
@@ -519,7 +519,7 @@ I64 TermRightClickLink(CDoc *doc,CDocEntry *doc_e)
|
||||
DocBottom(doc);
|
||||
switch (i) {
|
||||
case RIGHT_INCLUDE:
|
||||
if (FileExtDot(st) && !FilesFindMatch(FILENAME_MASK_JIT,st)) {
|
||||
if (FileExtDot(st) && !FilesFindMatch(st,FILEMASK_JIT)) {
|
||||
if (!PopUpCancelOk(ST_WARN_ST "Not .CPP File\n\n")) {
|
||||
send_new_line=TRUE;
|
||||
break;
|
||||
@@ -545,7 +545,7 @@ I64 TermRightClickLink(CDoc *doc,CDocEntry *doc_e)
|
||||
result=Plain(st);
|
||||
break;
|
||||
case RIGHT_AUTOFILE:
|
||||
if (FileExtDot(st) && !FilesFindMatch("*.AUT*",st)) {
|
||||
if (FileExtDot(st) && !FilesFindMatch(st,"*.AUT*")) {
|
||||
if (!PopUpCancelOk(ST_WARN_ST "Not .AUT File\n\n")) {
|
||||
send_new_line=TRUE;
|
||||
break;
|
||||
@@ -557,7 +557,7 @@ I64 TermRightClickLink(CDoc *doc,CDocEntry *doc_e)
|
||||
result=TRUE;
|
||||
break;
|
||||
case RIGHT_AINCLUDE:
|
||||
if (FileExtDot(st) && !FilesFindMatch(FILENAME_MASK_JIT,st)) {
|
||||
if (FileExtDot(st) && !FilesFindMatch(st,FILEMASK_JIT)) {
|
||||
if (!PopUpCancelOk(ST_WARN_ST "Not .CPP File\n\n")) {
|
||||
send_new_line=TRUE;
|
||||
break;
|
||||
@@ -569,7 +569,7 @@ I64 TermRightClickLink(CDoc *doc,CDocEntry *doc_e)
|
||||
result=TRUE;
|
||||
break;
|
||||
case RIGHT_COMPILE:
|
||||
if (FileExtDot(st) && !FilesFindMatch(FILENAME_MASK_AOT,st)) {
|
||||
if (FileExtDot(st) && !FilesFindMatch(st,FILEMASK_AOT)) {
|
||||
if (!PopUpCancelOk(ST_WARN_ST "Not .PRJ File\n\n")) {
|
||||
send_new_line=TRUE;
|
||||
break;
|
||||
@@ -580,7 +580,7 @@ I64 TermRightClickLink(CDoc *doc,CDocEntry *doc_e)
|
||||
result=!ToBool(Cmp(st));
|
||||
break;
|
||||
case RIGHT_LOAD:
|
||||
if (FileExtDot(st) && !FilesFindMatch("*.BIN*",st)) {
|
||||
if (FileExtDot(st) && !FilesFindMatch(st,"*.BIN*")) {
|
||||
if (!PopUpCancelOk(ST_WARN_ST "Not .BIN File\n\n")) {
|
||||
send_new_line=TRUE;
|
||||
break;
|
||||
@@ -591,7 +591,7 @@ I64 TermRightClickLink(CDoc *doc,CDocEntry *doc_e)
|
||||
result=ToBool(Load(st));
|
||||
break;
|
||||
case RIGHT_BINREP:
|
||||
if (FileExtDot(st) && !FilesFindMatch("*.BIN*",st)) {
|
||||
if (FileExtDot(st) && !FilesFindMatch(st,"*.BIN*")) {
|
||||
if (!PopUpCancelOk(ST_WARN_ST "Not .BIN File\n\n")) {
|
||||
send_new_line=TRUE;
|
||||
break;
|
||||
@@ -603,20 +603,20 @@ I64 TermRightClickLink(CDoc *doc,CDocEntry *doc_e)
|
||||
break;
|
||||
case RIGHT_COPY:
|
||||
StrCpy(fn.name,st);
|
||||
if (DocFormDo(fn.name,"CEdFileName")) {
|
||||
if (DocFormDo(&fn)) {
|
||||
result=ToBool(Copy(st,fn.name));
|
||||
} else
|
||||
send_new_line=TRUE;
|
||||
break;
|
||||
case RIGHT_MOVE:
|
||||
StrCpy(fn.name,st);
|
||||
if (DocFormDo(fn.name,"CEdFileName"))
|
||||
if (DocFormDo(&fn))
|
||||
result=Move(st,fn.name);
|
||||
else
|
||||
send_new_line=TRUE;
|
||||
break;
|
||||
case RIGHT_DEBUG:
|
||||
if (FileExtDot(st) && !FilesFindMatch(FILENAME_MASK_JIT,st)) {
|
||||
if (FileExtDot(st) && !FilesFindMatch(st,FILEMASK_JIT)) {
|
||||
if (!PopUpCancelOk(ST_WARN_ST "Not .CPP File\n\n")) {
|
||||
send_new_line=TRUE;
|
||||
break;
|
||||
@@ -652,7 +652,7 @@ public U0 DocDm(U8 *buf,I64 cnt=0x80)
|
||||
CDocEntry *doc_e;
|
||||
CDoc *doc=DocPut;
|
||||
Bool unlock=DocLock(doc);
|
||||
doc_e=DocPrintF(doc,"$$HX-Z,%d,16$$",cnt);
|
||||
doc_e=DocPrint(doc,"$$HX-Z,%d,16$$",cnt);
|
||||
doc_e->data=buf;
|
||||
doc->cur_entry=doc_e->next;
|
||||
DocRecalc(doc);
|
||||
@@ -668,7 +668,7 @@ public U0 DocD(U8 *buf,I64 cnt=0x80)
|
||||
CDocEntry *doc_e;
|
||||
CDoc *doc=DocPut;
|
||||
Bool unlock=DocLock(doc);
|
||||
doc_e=DocPrintF(doc,"$$HX,%d,16$$",cnt);
|
||||
doc_e=DocPrint(doc,"$$HX,%d,16$$",cnt);
|
||||
doc_e->data=buf;
|
||||
doc->cur_entry=doc_e->next;
|
||||
DocRecalc(doc);
|
||||
|
||||
@@ -10,9 +10,7 @@ U0 DocTablesInit()
|
||||
1<<DOCT_TEXT|
|
||||
1<<DOCT_DATA|
|
||||
1<<DOCT_MENU_VAL|
|
||||
1<<DOCT_HIDE_START |
|
||||
1<<DOCT_TREE|
|
||||
1<<DOCT_HIDE_END|
|
||||
1<<DOCT_MACRO|
|
||||
1<<DOCT_BUTTON|
|
||||
1<<DOCT_CHECK_BOX|
|
||||
@@ -162,7 +160,7 @@ U0 DocBinsValidate(CDoc *doc)
|
||||
doc_e->tag && *doc_e->tag)
|
||||
b->tag=StrNew(doc_e->tag,doc->mem_task);
|
||||
} else {
|
||||
DbgStr("Bin Not Found",3000);
|
||||
RawStr("Bin Not Found",3000);
|
||||
doc_e->type=doc_e->flags2=doc_e->flags1=0;
|
||||
doc_e->type_u8=DOCT_ERROR;
|
||||
}
|
||||
@@ -201,13 +199,36 @@ U0 DocBinDel(CDoc *doc,CDocBin *b)
|
||||
Free(b);
|
||||
}
|
||||
} else
|
||||
DbgStr("DocBinDel",3000);
|
||||
RawStr("DocBinDel",3000);
|
||||
}
|
||||
|
||||
Bool IsEditableText(CDocEntry *doc_e)
|
||||
{
|
||||
if (doc_e->type_u8==DOCT_TEXT&&
|
||||
!(doc_e->flags1&DOCEG1_DONT_EDIT)&&!(doc_e->flags2&DOCEG2_DONT_EDIT))
|
||||
return TRUE;
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
CDocEntry *DocEntryNew(CDoc *doc,CDocEntry *doc_ce,U8 *tag)
|
||||
{
|
||||
CDocEntry *result=CAlloc(sizeof(CDocEntryBase),doc->mem_task);
|
||||
result->type=doc_ce->type;
|
||||
result->flags1=doc_ce->flags1;
|
||||
result->flags2=doc_ce->flags2;
|
||||
result->tag=tag;
|
||||
result->max_col=StrLen(tag);
|
||||
result->x=doc_ce->x;
|
||||
result->y=doc_ce->y;
|
||||
result->page_line_num=doc_ce->page_line_num;
|
||||
return result;
|
||||
}
|
||||
|
||||
public U0 DocEntryDel(CDoc *doc,CDocEntry *doc_e)
|
||||
{
|
||||
if (!doc || doc==doc_e)
|
||||
DbgStr("DocEntryDel",3000);
|
||||
RawStr("DocEntryDel",3000);
|
||||
else {
|
||||
if (doc->cur_entry==doc_e)
|
||||
doc->cur_entry=doc_e->next;
|
||||
@@ -596,7 +617,7 @@ U0 DocDataFmt(CDocEntry *doc_e)
|
||||
else
|
||||
d=*ptr(I64 *);
|
||||
if (doc_e->type_u8==DOCT_DATA) {
|
||||
SPrintF(doc_e->tag,doc_e->aux_str,d,doc_e->my_fmt_data);
|
||||
SPrint(doc_e->tag,doc_e->aux_str,d,doc_e->my_fmt_data);
|
||||
if (doc_e->flags1 & DOCEF1_HAS_TERMINATOR) {
|
||||
i=StrLen(doc_e->tag);
|
||||
doc_e->tag[i++]='_';
|
||||
@@ -612,7 +633,7 @@ U0 DocDataFmt(CDocEntry *doc_e)
|
||||
}
|
||||
}
|
||||
|
||||
U0 DocDataGet(CDocEntry *doc_e)
|
||||
U0 DocDataScan(CDocEntry *doc_e)
|
||||
{
|
||||
I64 i,d;
|
||||
U8 *ptr;
|
||||
@@ -628,11 +649,11 @@ U0 DocDataGet(CDocEntry *doc_e)
|
||||
if (i>doc_e->len+doc_e->min_col)
|
||||
doc_e->tag[doc_e->len+doc_e->min_col]=0;
|
||||
if (doc_e->flags1&(DOCEF1_U8|DOCEF1_U16|DOCEF1_U32)) {
|
||||
GetF(doc_e->tag,doc_e->aux_str,&d,doc_e->my_fmt_data);
|
||||
Scan(doc_e->tag,doc_e->aux_str,&d,doc_e->my_fmt_data);
|
||||
if (doc_e->flags1 & DOCEF1_HAS_TERMINATOR)
|
||||
doc_e->tag[i]='_';
|
||||
} else {
|
||||
GetF(doc_e->tag,doc_e->aux_str,ptr,doc_e->my_fmt_data);
|
||||
Scan(doc_e->tag,doc_e->aux_str,ptr,doc_e->my_fmt_data);
|
||||
if (doc_e->flags1 & DOCEF1_HAS_TERMINATOR)
|
||||
doc_e->tag[i]='_';
|
||||
return;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
I64 DocOptEntry(CDoc *,CDocEntry *doc_e)
|
||||
{
|
||||
U8 *st,*st2,**dst;
|
||||
U8 *st,*st2,**_dst;
|
||||
I64 i,result=0;
|
||||
|
||||
if (doc_e->flags1&DOCEF1_LINK) {
|
||||
@@ -16,16 +16,16 @@ I64 DocOptEntry(CDoc *,CDocEntry *doc_e)
|
||||
result++;
|
||||
}
|
||||
if (doc_e->flags1 & DOCEF1_AUX_STR)
|
||||
dst=&doc_e->aux_str;
|
||||
_dst=&doc_e->aux_str;
|
||||
else
|
||||
dst=&doc_e->tag;
|
||||
if (StrStr(*dst,".Z")) {
|
||||
st=DocLinkFile(*dst);
|
||||
_dst=&doc_e->tag;
|
||||
if (StrMatch(".Z",*_dst)) {
|
||||
st=DocLinkFile(*_dst);
|
||||
if (FileFind(st)) {
|
||||
if (IsDotZ(st))
|
||||
st[StrLen(st)-2]=0;
|
||||
i=StrLen(st);
|
||||
if ((st2=StrStr(*dst,st)) && st2[i]=='.' && st2[i+1]=='Z') {
|
||||
if ((st2=StrMatch(st,*_dst)) && st2[i]=='.' && st2[i+1]=='Z') {
|
||||
StrCpy(st2+i,st2+i+2);
|
||||
result++;
|
||||
}
|
||||
@@ -34,13 +34,13 @@ I64 DocOptEntry(CDoc *,CDocEntry *doc_e)
|
||||
}
|
||||
/* !!! Dangerous, but handy !!!
|
||||
if (doc_e->flags1 & DOCEF1_AUX_STR) {
|
||||
if (st=StrStr(doc_e->aux_str,".Z")) {
|
||||
if (st=StrMatch(".Z",doc_e->aux_str)) {
|
||||
StrCpy(st,st+2);
|
||||
result++;
|
||||
}
|
||||
}
|
||||
if (Bt(doc_tag_types,doc_e->type_u8)) {
|
||||
if (st=StrStr(doc_e->tag,".Z")) {
|
||||
if (st=StrMatch(".Z",doc_e->tag)) {
|
||||
StrCpy(st,st+2);
|
||||
result++;
|
||||
}
|
||||
@@ -88,21 +88,21 @@ public I64 DocOptFile(U8 *filename)
|
||||
return result;
|
||||
}
|
||||
|
||||
I64 DocOptLst(CDirEntry *tempm1)
|
||||
I64 DocOptLst(CDirEntry *tempde1)
|
||||
{
|
||||
I64 result=0;
|
||||
CDirEntry *tempm2;
|
||||
while (tempm1) {
|
||||
tempm2=tempm1->next;
|
||||
if (tempm1->attr & _ATTR_DIR) {
|
||||
if (tempm1->sub) {
|
||||
"%S %s\n","ST_SCANNING_DIR",tempm1->full_name;
|
||||
result+=DocOptLst(tempm1->sub);
|
||||
CDirEntry *tempde2;
|
||||
while (tempde1) {
|
||||
tempde2=tempde1->next;
|
||||
if (tempde1->attr & _ATTR_DIR) {
|
||||
if (tempde1->sub) {
|
||||
"%S %s\n","ST_SCANNING_DIR",tempde1->full_name;
|
||||
result+=DocOptLst(tempde1->sub);
|
||||
}
|
||||
} else
|
||||
result+=DocOptFile(tempm1->full_name);
|
||||
CDirEntryDel(tempm1);
|
||||
tempm1=tempm2;
|
||||
result+=DocOptFile(tempde1->full_name);
|
||||
DirEntryDel(tempde1);
|
||||
tempde1=tempde2;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -110,7 +110,7 @@ I64 DocOptLst(CDirEntry *tempm1)
|
||||
public I64 DocOpt(U8 *files_find_mask="*",U8 *fu_flags=NULL)
|
||||
{//Optimize Files
|
||||
I64 f=0;
|
||||
GetFFlags(&f,Define("ST_FILE_UTIL_FLAGS"),"+r+T");
|
||||
GetFFlags(&f,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
|
||||
ScanFlags(&f,Define("ST_FILE_UTIL_FLAGS"),"+r+T");
|
||||
ScanFlags(&f,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
|
||||
return DocOptLst(FilesFind(files_find_mask,f));
|
||||
}
|
||||
@@ -5,7 +5,7 @@ U0 PrsDocFlags(CLex *lx,I64 *flags1,I64 *flags2,U32 *type)
|
||||
while (lx->token=='+' || lx->token=='-') {
|
||||
turn_on= lx->token=='+';
|
||||
if (Lex(lx)==TK_IDENT) {
|
||||
i=DefineMatch(lx->ident,"ST_DOC_FLAGS",LEF_EXACT);
|
||||
i=DefineMatch(lx->ident,"ST_DOC_FLAGS",LMF_EXACT);
|
||||
if (i<0)
|
||||
*type=DOCT_ERROR;
|
||||
else if (i<64) {
|
||||
@@ -125,12 +125,6 @@ DOCEF1_ESC | DOCEF1_LEFT_EXP,
|
||||
//DOCT_HEX_ED
|
||||
DOCEF1_DATA_IS_PTR | DOCEF1_ZERO_BASED,
|
||||
|
||||
//DOCT_HIDE_START
|
||||
DOCEF1_CHECKED_COLLAPSED|DOCEF1_CHECK_COLLAPSABLE,
|
||||
|
||||
//DOCT_HIDE_END
|
||||
0,
|
||||
|
||||
//DOCT_TREE
|
||||
DOCEF1_CHECKED_COLLAPSED|DOCEF1_CHECK_COLLAPSABLE|DOCEF1_TREE,
|
||||
|
||||
@@ -273,12 +267,6 @@ I64 doc_dft_flags2[DOCT_NUM_TYPES]={
|
||||
//DOCT_HEX_ED
|
||||
0,
|
||||
|
||||
//DOCT_HIDE_START
|
||||
0,
|
||||
|
||||
//DOCT_HIDE_END
|
||||
0,
|
||||
|
||||
//DOCT_TREE
|
||||
0,
|
||||
|
||||
@@ -421,12 +409,6 @@ DOCET_UNDERLINE,
|
||||
//DOCT_HEX_ED
|
||||
0,
|
||||
|
||||
//DOCT_HIDE_START
|
||||
DOCET_UNDERLINE,
|
||||
|
||||
//DOCT_HIDE_END
|
||||
0,
|
||||
|
||||
//DOCT_TREE
|
||||
DOCET_UNDERLINE,
|
||||
|
||||
@@ -581,17 +563,17 @@ U8 *Doc2PlainText(CDoc *doc,CDocEntry *doc_e)
|
||||
buf2=doc_e->tag+3;
|
||||
else
|
||||
buf2=doc_e->tag;
|
||||
buf2=MSPrintF("%s\"%$$Q\",",buf,buf2);
|
||||
buf2=MPrint("%s\"%$$Q\",",buf,buf2);
|
||||
Free(buf); buf=buf2;
|
||||
break;
|
||||
case DOCT_DATA:
|
||||
buf2=MSPrintF("%s%d,",buf,doc_e->len);
|
||||
buf2=MPrint("%s%d,",buf,doc_e->len);
|
||||
Free(buf); buf=buf2;
|
||||
break;
|
||||
case DOCT_HEX_ED:
|
||||
buf2=MSPrintF("%s%d,",buf,doc_e->len);
|
||||
buf2=MPrint("%s%d,",buf,doc_e->len);
|
||||
Free(buf); buf=buf2;
|
||||
buf2=MSPrintF("%s%d,",buf,doc_e->hex_ed_width);
|
||||
buf2=MPrint("%s%d,",buf,doc_e->hex_ed_width);
|
||||
Free(buf); buf=buf2;
|
||||
break;
|
||||
case DOCT_PAGE_LEN:
|
||||
@@ -614,7 +596,7 @@ U8 *Doc2PlainText(CDoc *doc,CDocEntry *doc_e)
|
||||
case DOCT_SHIFTED_X:
|
||||
case DOCT_SHIFTED_Y:
|
||||
if (doc_e->attr!=DOC_DFT) {
|
||||
buf2=MSPrintF("%s%d,",buf,doc_e->attr);
|
||||
buf2=MPrint("%s%d,",buf,doc_e->attr);
|
||||
Free(buf); buf=buf2;
|
||||
}
|
||||
case DOCT_NUM_TYPES-1: //nobound_switch
|
||||
@@ -629,59 +611,59 @@ U8 *Doc2PlainText(CDoc *doc,CDocEntry *doc_e)
|
||||
Btr(&flags1,j);
|
||||
nobound_switch (j) {
|
||||
case DOCEf1_SCROLLING_X:
|
||||
buf2=MSPrintF("%s%d",buf,doc_e->scroll_len);
|
||||
buf2=MPrint("%s%d",buf,doc_e->scroll_len);
|
||||
Free(buf); buf=buf2;
|
||||
break;
|
||||
case DOCEf1_SHIFTED_X:
|
||||
j=doc_e->type.u16[1]&0x1F;
|
||||
if (j&0x10) j|=0xFFFFFFF0;
|
||||
buf2=MSPrintF("%s%d",buf,j);
|
||||
buf2=MPrint("%s%d",buf,j);
|
||||
Free(buf); buf=buf2;
|
||||
break;
|
||||
case DOCEf1_SHIFTED_Y:
|
||||
j=doc_e->type>>21 &0x1F;
|
||||
if (j&0x10) j|=0xFFFFFFF0;
|
||||
buf2=MSPrintF("%s%d",buf,j);
|
||||
buf2=MPrint("%s%d",buf,j);
|
||||
Free(buf); buf=buf2;
|
||||
break;
|
||||
case DOCEf1_AUX_STR:
|
||||
buf2=MSPrintF("%s\"%$$Q\"",buf,doc_e->aux_str);
|
||||
buf2=MPrint("%s\"%$$Q\"",buf,doc_e->aux_str);
|
||||
Free(buf); buf=buf2;
|
||||
break;
|
||||
case DOCEf1_LEFT_EXP:
|
||||
buf2=MSPrintF("%s%d",buf,doc_e->left_exp);
|
||||
buf2=MPrint("%s%d",buf,doc_e->left_exp);
|
||||
Free(buf); buf=buf2;
|
||||
break;
|
||||
case DOCEf1_LEFT_MACRO:
|
||||
buf2=MSPrintF("%s\"%$$Q\"",buf,doc_e->left_macro);
|
||||
buf2=MPrint("%s\"%$$Q\"",buf,doc_e->left_macro);
|
||||
Free(buf); buf=buf2;
|
||||
break;
|
||||
case DOCEf1_RIGHT_EXP:
|
||||
buf2=MSPrintF("%s%d",buf,doc_e->right_exp);
|
||||
buf2=MPrint("%s%d",buf,doc_e->right_exp);
|
||||
Free(buf); buf=buf2;
|
||||
break;
|
||||
case DOCEf1_RIGHT_MACRO:
|
||||
buf2=MSPrintF("%s\"%$$Q\"",buf,doc_e->right_macro);
|
||||
buf2=MPrint("%s\"%$$Q\"",buf,doc_e->right_macro);
|
||||
Free(buf); buf=buf2;
|
||||
break;
|
||||
case DOCEf1_HAS_BIN:
|
||||
buf2=MSPrintF("%s%d",buf,doc_e->bin_num);
|
||||
buf2=MPrint("%s%d",buf,doc_e->bin_num);
|
||||
Free(buf); buf=buf2;
|
||||
break;
|
||||
case DOCEf1_WIDTH:
|
||||
buf2=MSPrintF("%s%d",buf,doc_e->width);
|
||||
buf2=MPrint("%s%d",buf,doc_e->width);
|
||||
Free(buf); buf=buf2;
|
||||
break;
|
||||
case DOCEf1_HEIGHT:
|
||||
buf2=MSPrintF("%s%d",buf,doc_e->height);
|
||||
buf2=MPrint("%s%d",buf,doc_e->height);
|
||||
Free(buf); buf=buf2;
|
||||
break;
|
||||
case DOCEf1_DEFINE:
|
||||
buf2=MSPrintF("%s\"%$$Q\"",buf,doc_e->define_str);
|
||||
buf2=MPrint("%s\"%$$Q\"",buf,doc_e->define_str);
|
||||
Free(buf); buf=buf2;
|
||||
break;
|
||||
case DOCEf1_HTML_LINK:
|
||||
buf2=MSPrintF("%s\"%$$Q\"",buf,doc_e->html_link);
|
||||
buf2=MPrint("%s\"%$$Q\"",buf,doc_e->html_link);
|
||||
Free(buf); buf=buf2;
|
||||
break;
|
||||
#assert DOCEf1_HTML_LINK==DOCEf1_NUM_FLAGS-1 //nobound_switch
|
||||
@@ -694,7 +676,7 @@ U8 *Doc2PlainText(CDoc *doc,CDocEntry *doc_e)
|
||||
Btr(&flags2,j);
|
||||
nobound_switch (j) {
|
||||
case DOCEf2_BIN_PTR_LINK:
|
||||
buf2=MSPrintF("%s\"%$$Q\"",buf,doc_e->bin_ptr_link);
|
||||
buf2=MPrint("%s\"%$$Q\"",buf,doc_e->bin_ptr_link);
|
||||
Free(buf); buf=buf2;
|
||||
break;
|
||||
#assert DOCEf2_BIN_PTR_LINK==DOCEf2_NUM_FLAGS-1 //nobound_switch
|
||||
@@ -748,11 +730,11 @@ CDocEntry *PrsDollarCmd(CDoc *doc,U8 *st)
|
||||
if (lx->token==TK_STR) {
|
||||
st2=LexExtStr(lx);
|
||||
if (i==DOCT_CHECK_BOX) {
|
||||
st=MSPrintF("[X] %s",st2);
|
||||
st=MPrint("[X] %s",st2);
|
||||
Free(st2);
|
||||
doc_e->min_col=1;
|
||||
} else if (doc_e->flags1 & DOCEF1_TREE) {
|
||||
st=MSPrintF("+] %s",st2);
|
||||
st=MPrint("+] %s",st2);
|
||||
Free(st2);
|
||||
doc_e->min_col=1;
|
||||
} else
|
||||
@@ -769,22 +751,15 @@ CDocEntry *PrsDollarCmd(CDoc *doc,U8 *st)
|
||||
}
|
||||
}
|
||||
break;
|
||||
case DOCT_HIDE_START:
|
||||
doc_e->tag=StrNew("<-",doc->mem_task);
|
||||
doc_e->min_col=1;
|
||||
break;
|
||||
case DOCT_HIDE_END:
|
||||
doc_e->tag=StrNew(">",doc->mem_task);
|
||||
break;
|
||||
case DOCT_DATA:
|
||||
doc_e->flags1|=DOCEF1_AUX_STR; //don't allow switched off
|
||||
doc_e->len=Expression(lx);
|
||||
doc_e->len=LexExpression(lx);
|
||||
break;
|
||||
case DOCT_HEX_ED:
|
||||
doc_e->len=Expression(lx);
|
||||
doc_e->len=LexExpression(lx);
|
||||
if (lx->token==',')
|
||||
Lex(lx);
|
||||
doc_e->hex_ed_width=Expression(lx);
|
||||
doc_e->hex_ed_width=LexExpression(lx);
|
||||
break;
|
||||
case DOCT_PAGE_LEN:
|
||||
case DOCT_LEFT_MARGIN:
|
||||
@@ -808,7 +783,7 @@ CDocEntry *PrsDollarCmd(CDoc *doc,U8 *st)
|
||||
if (!lx->token)
|
||||
doc_e->attr=DOC_DFT;
|
||||
else
|
||||
doc_e->attr=Expression(lx);
|
||||
doc_e->attr=LexExpression(lx);
|
||||
break;
|
||||
case DOCT_ERROR:
|
||||
doc_e->flags1=0;
|
||||
@@ -830,13 +805,13 @@ CDocEntry *PrsDollarCmd(CDoc *doc,U8 *st)
|
||||
Lex(lx);
|
||||
nobound_switch (j) { //TODO: Might check for expression errors
|
||||
case DOCEf1_SCROLLING_X:
|
||||
doc_e->scroll_len=Expression(lx);
|
||||
doc_e->scroll_len=LexExpression(lx);
|
||||
break;
|
||||
case DOCEf1_SHIFTED_X:
|
||||
doc_e->type|=(Expression(lx) & 0x1F)<<16;
|
||||
doc_e->type|=(LexExpression(lx) & 0x1F)<<16;
|
||||
break;
|
||||
case DOCEf1_SHIFTED_Y:
|
||||
doc_e->type|=(Expression(lx) & 0x1F)<<21;
|
||||
doc_e->type|=(LexExpression(lx) & 0x1F)<<21;
|
||||
break;
|
||||
case DOCEf1_AUX_STR:
|
||||
if (lx->token==TK_STR) {
|
||||
@@ -847,7 +822,7 @@ CDocEntry *PrsDollarCmd(CDoc *doc,U8 *st)
|
||||
doc_e->tag=StrNew(doc_e->aux_str,doc->mem_task);
|
||||
//$AN,"Anchor","DataTagWidth"$
|
||||
if (i==DOCT_DATA) {
|
||||
if (ptr=StrStr(doc_e->aux_str,":"))
|
||||
if (ptr=StrMatch(":",doc_e->aux_str))
|
||||
doc_e->min_col=ptr-doc_e->aux_str+1;
|
||||
doc_e->tag=MAlloc(doc_e->len+doc_e->min_col+2,doc->mem_task); //+2 because "_\0"
|
||||
}
|
||||
@@ -855,7 +830,7 @@ CDocEntry *PrsDollarCmd(CDoc *doc,U8 *st)
|
||||
doc_e->type=DOCT_ERROR;
|
||||
break;
|
||||
case DOCEf1_LEFT_EXP:
|
||||
doc_e->left_exp=Expression(lx);
|
||||
doc_e->left_exp=LexExpression(lx);
|
||||
break;
|
||||
case DOCEf1_LEFT_MACRO:
|
||||
if (lx->token==TK_STR) {
|
||||
@@ -868,7 +843,7 @@ CDocEntry *PrsDollarCmd(CDoc *doc,U8 *st)
|
||||
doc_e->type=DOCT_ERROR;
|
||||
break;
|
||||
case DOCEf1_RIGHT_EXP:
|
||||
doc_e->right_exp=Expression(lx);
|
||||
doc_e->right_exp=LexExpression(lx);
|
||||
break;
|
||||
case DOCEf1_RIGHT_MACRO:
|
||||
if (lx->token==TK_STR) {
|
||||
@@ -884,13 +859,13 @@ CDocEntry *PrsDollarCmd(CDoc *doc,U8 *st)
|
||||
if (!lx->token)
|
||||
doc_e->bin_num=0;
|
||||
else
|
||||
doc_e->bin_num=Expression(lx);
|
||||
doc_e->bin_num=LexExpression(lx);
|
||||
break;
|
||||
case DOCEf1_WIDTH:
|
||||
doc_e->width=Expression(lx);
|
||||
doc_e->width=LexExpression(lx);
|
||||
break;
|
||||
case DOCEf1_HEIGHT:
|
||||
doc_e->height=Expression(lx);
|
||||
doc_e->height=LexExpression(lx);
|
||||
break;
|
||||
case DOCEf1_DEFINE:
|
||||
if (lx->token==TK_STR) {
|
||||
@@ -954,21 +929,14 @@ public U0 DocIns(CDoc *doc,CDocEntry *doc_e)
|
||||
!(doc_ce->flags1&(DOCEF1_TAG_CB|DOCEF1_DEFINE|DOCEF1_HTML_LINK)) &&
|
||||
!(doc_ce->flags2&DOCEF2_BIN_PTR_LINK) &&
|
||||
doc->cur_data_col<doc_ce->max_col) {
|
||||
doc_ne=CAlloc(sizeof(CDocEntryBase),doc->mem_task);
|
||||
doc_ne->type=DOCT_TEXT|doc_ce->type&0xFFFFFF00;
|
||||
doc_ne->x=doc_ce->x;
|
||||
doc_ne->y=doc_ce->y;
|
||||
doc_ne->page_line_num=doc_ce->page_line_num;
|
||||
doc_ne->flags1=doc_ce->flags1;
|
||||
doc_ne->flags2=doc_ce->flags2;
|
||||
dst=doc_ce->tag+doc->cur_data_col;
|
||||
doc_ne->tag=StrNew(dst,doc->mem_task);
|
||||
doc_ne=DocEntryNew(doc,doc_ce,StrNew(dst,doc->mem_task));
|
||||
*dst=0;
|
||||
doc_ne->type=DOCT_TEXT|doc_ce->type&0xFFFFFF00;
|
||||
doc_ce->max_col=doc->cur_data_col;
|
||||
QueIns(doc_ne,doc_ce);
|
||||
doc->cur_data_col=0;
|
||||
doc_ce=doc_ne;
|
||||
doc_ce->max_col=StrLen(doc_ce->tag);
|
||||
}
|
||||
if (doc_ce->type_u8==DOCT_TEXT && doc->cur_data_col>=doc_ce->max_col) {
|
||||
QueIns(doc_e,doc_ce);
|
||||
@@ -985,8 +953,9 @@ public U0 DocIns(CDoc *doc,CDocEntry *doc_e)
|
||||
|
||||
|
||||
#help_index "Doc/Output"
|
||||
public CDocEntry *DocPutS(CDoc *doc,U8 *st)
|
||||
{ //Does not handle partial Doc entries
|
||||
CDocEntry *DocPutS(CDoc *doc,U8 *st)
|
||||
{ //Don't use this. Use $LK,"DocPrint","MN:DocPrint"$().
|
||||
//Does not handle partial Doc entries
|
||||
//Returns last newly created dollar-sign CDocEntry.
|
||||
U8 ch,*ptr=st,*ptr2,*st2,*ptr3,*ptr4,*src,
|
||||
*char_bitmap;
|
||||
@@ -1140,10 +1109,9 @@ public CDocEntry *DocPutS(CDoc *doc,U8 *st)
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
public CDocEntry *DocPrintF(CDoc *doc,U8 *src,...)
|
||||
public CDocEntry *DocPrint(CDoc *doc,U8 *fmt,...)
|
||||
{
|
||||
U8 *buf=SPrintFJoin(NULL,src,argc,argv);
|
||||
U8 *buf=SPrintJoin(NULL,fmt,argc,argv);
|
||||
CDocEntry *result=DocPutS(doc,buf);
|
||||
Free(buf);
|
||||
return result;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
public I64 DocEntryRun(CDoc *doc,CDocEntry *doc_e,Bool exited)
|
||||
{ //sometimes returns locked, sometimes unlocked
|
||||
U8 ch=doc->cmd_U8,*st;
|
||||
I64 result=-1;
|
||||
I64 result=DOCM_EXIT;
|
||||
DocLock(doc);
|
||||
if (!exited) {
|
||||
if (doc_e->flags1 & DOCEF1_ESC) {
|
||||
@@ -164,7 +164,7 @@ U8 *EdDollarTypeCB(CDoc *,CDocEntry *doc_e,CTask *mem_task)
|
||||
src="EOF";
|
||||
else if (!src)
|
||||
src="ERR";
|
||||
SPrintF(st,"%-3ts",src);
|
||||
SPrint(st,"%-3ts",src);
|
||||
return st;
|
||||
}
|
||||
|
||||
@@ -218,47 +218,47 @@ public Bool DocDo(CDoc *doc,I64 doc_flags=0)
|
||||
doc->win_task=Fs;
|
||||
bdoc=DocNew;
|
||||
bdoc->flags|=DOCF_BORDER_DOC;
|
||||
DocPutS(bdoc,"$$CM+TY+LX+NC,0,-1$$");
|
||||
DocPrint(bdoc,"$$CM+TY+LX+NC,0,-1$$");
|
||||
if (Bt(&Fs->display_flags,DISPLAYf_HAS_CLOSE_WIN))
|
||||
DocPutS(bdoc,"$$TX+RX+BD,\"[X]\"$$");
|
||||
DocPutS(bdoc,"$$BK,1$$$$TX+LX+BD,\"MENU\"$$$$BK,0$$");
|
||||
DocPrint(bdoc,"$$TX+RX+BD,\"[X]\"$$");
|
||||
DocPrint(bdoc,"$$BK,1$$$$TX+LX+BD,\"MENU\"$$$$BK,0$$");
|
||||
|
||||
old_task_title=StrNew(Fs->task_title);
|
||||
if (Fs->title_src!=TTS_LOCKED_CONST) {
|
||||
Fs->title_src=TTS_ED_FILENAME;
|
||||
MemCpy(Fs->task_title,doc->filename.name,TASK_TITLE_LEN);
|
||||
}
|
||||
doc_e=DocPutS(bdoc,"$$DA-T-P+BD+RD+CX+SCX+IV,140,\"%s...\",16$$");
|
||||
doc_e=DocPrint(bdoc,"$$DA-T-P+BD+RD+CX+SCX+IV,140,\"%%s...\",16$$");
|
||||
doc_e->data=&Fs->task_title;
|
||||
DocDataFmt(doc_e);
|
||||
|
||||
if (doc->flags & DOCF_ALLOW_UNDO) {
|
||||
DocPutS(bdoc,"$$CM+BY+LX+NC,1,1$$");
|
||||
doc_e=DocPutS(bdoc,"$$DA+BD+RD-T,32,\"Undo:%03d\"$$\n");
|
||||
DocPrint(bdoc,"$$CM+BY+LX+NC,1,1$$");
|
||||
doc_e=DocPrint(bdoc,"$$DA+BD+RD-T-U64+U32,32,\"Undo:%%03d\"$$\n");
|
||||
doc_e->data=&doc->undo_cnt;
|
||||
DocDataFmt(doc_e);
|
||||
}
|
||||
|
||||
DocPutS(bdoc,"$$CM+BY+RX+NC,-30,1$$");
|
||||
doc_e=DocPutS(bdoc,"$$TX+BD+TC,\" \"$$");
|
||||
DocPrint(bdoc,"$$CM+BY+RX+NC,-30,1$$");
|
||||
doc_e=DocPrint(bdoc,"$$TX+BD+TC,\" \"$$");
|
||||
doc_e->user_data=doc;
|
||||
doc_e->tag_cb=&EdMoreCB;
|
||||
doc_e=DocPutS(bdoc,"$$TX+BD+TC,\" \"$$");
|
||||
doc_e=DocPrint(bdoc,"$$TX+BD+TC,\" \"$$");
|
||||
doc_e->user_data=doc;
|
||||
doc_e->tag_cb=&EdDollarTypeCB;
|
||||
doc_e=DocPutS(bdoc,"$$TX+BD+TC,\" \"$$");
|
||||
doc_e=DocPrint(bdoc,"$$TX+BD+TC,\" \"$$");
|
||||
doc_e->user_data=doc;
|
||||
doc_e->tag_cb=&EdFilterCB;
|
||||
doc_e=DocPutS(bdoc,"$$TX+BD+TC,\" \"$$");
|
||||
doc_e=DocPrint(bdoc,"$$TX+BD+TC,\" \"$$");
|
||||
doc_e->user_data=doc;
|
||||
doc_e->tag_cb=&EdOverStrikeCB;
|
||||
doc_e=DocPutS(bdoc,"$$TX+BD+TC,\" \"$$");
|
||||
doc_e=DocPrint(bdoc,"$$TX+BD+TC,\" \"$$");
|
||||
doc_e->user_data=doc;
|
||||
doc_e->tag_cb=&EdDollarCB;
|
||||
doc_e=DocPutS(bdoc,"$$DA+BD+RD-T,32,\"Line:%04d \"$$");
|
||||
doc_e=DocPrint(bdoc,"$$DA+BD+RD-T,32,\"Line:%%04d \"$$");
|
||||
doc_e->data=&doc->line;
|
||||
DocDataFmt(doc_e);
|
||||
doc_e=DocPutS(bdoc,"$$DA+BD+RD-T,32,\"Col:%04d\"$$\n");
|
||||
doc_e=DocPrint(bdoc,"$$DA+BD+RD-T,32,\"Col:%%04d\"$$\n");
|
||||
doc_e->data=&doc->col;
|
||||
DocDataFmt(doc_e);
|
||||
|
||||
@@ -291,7 +291,7 @@ public Bool DocDo(CDoc *doc,I64 doc_flags=0)
|
||||
doc_e=doc->root.next;
|
||||
while (doc_e!=doc) {
|
||||
if (doc_e->type_u8==DOCT_DATA || doc_e->type_u8==DOCT_CHECK_BOX)
|
||||
DocDataGet(doc_e);
|
||||
DocDataScan(doc_e);
|
||||
doc_e=doc_e->next;
|
||||
}
|
||||
}
|
||||
@@ -317,7 +317,7 @@ public Bool DocDo(CDoc *doc,I64 doc_flags=0)
|
||||
|
||||
|
||||
#help_index "Doc/Input"
|
||||
public Bool DocFormDo(U8 *D,U8 *class_name,
|
||||
public Bool DocFormDo(U8 *_d,U8 *class_name=lastclass,
|
||||
I64 doc_flags=0,U8 *header=NULL,U8 *footer=NULL)
|
||||
//Supply a class name that has fmtstr definitions
|
||||
//and this routine will allow user input.
|
||||
@@ -333,31 +333,32 @@ public Bool DocFormDo(U8 *D,U8 *class_name,
|
||||
return FALSE;
|
||||
doc=DocNew;
|
||||
StrCpy(doc->desc,"Form");
|
||||
if (header) DocPutS(doc,header);
|
||||
if (header) DocPrint(doc,"%s",header);
|
||||
doc->flags|=DOCF_OVERSTRIKE|DOCF_FORM;
|
||||
if (doc_flags&DOF_MIN_SIZE)
|
||||
doc->flags|=DOCF_MIN_SIZE;
|
||||
ml=tempc->member_lst;
|
||||
while (ml) {
|
||||
if (fmtstr=MemberMetaData("fmtstr",ml)) {
|
||||
doc_e=DocPutS(doc,fmtstr);
|
||||
doc_e->data=D+ml->offset;
|
||||
doc_e=DocPrint(doc,"%s",fmtstr);
|
||||
doc_e->data=_d+ml->offset;
|
||||
doc_e->my_fmt_data=MemberMetaData("fmtdata",ml);
|
||||
DocDataFmt(doc_e);
|
||||
}
|
||||
ml=ml->next;
|
||||
}
|
||||
if (footer) DocPutS(doc,footer);
|
||||
if (footer) DocPrint(doc,"%s",footer);
|
||||
if (doc->root.next!=doc) {
|
||||
Fs->border_src=BDS_CONST;
|
||||
DocRecalc(doc);
|
||||
if (DocDo(doc,doc_flags)) {
|
||||
doc_e=doc->cur_entry;
|
||||
result=TRUE;
|
||||
if (doc_e!=doc) {
|
||||
DocEntryRun(doc,doc_e,TRUE);
|
||||
if (DocEntryRun(doc,doc_e,TRUE)==DOCM_CANCEL)
|
||||
result=FALSE;
|
||||
DocUnlock(doc);
|
||||
}
|
||||
result=TRUE;
|
||||
}
|
||||
}
|
||||
DocDel(doc);
|
||||
@@ -431,7 +432,7 @@ public I64 PopUp(U8 *msg,CTask *parent=NULL,CTask **_pu_task=NULL)
|
||||
#help_index "Doc/Output"
|
||||
public CTask *PopUpViewDoc(CDoc *doc,I64 doc_flags=0)
|
||||
{
|
||||
U8 *buf=MSPrintF("if (!IsSysDeterministic) Preempt(ON);DocDo(0x%X,0x%X);",doc,doc_flags);
|
||||
U8 *buf=MPrint("if (!IsSysDeterministic) Preempt(ON);DocDo(0x%X,0x%X);",doc,doc_flags);
|
||||
CTask *task=Spawn(&SrvUserCmdLine,NULL,"View",,Fs);
|
||||
TaskExeStrQue(task,NULL,buf,1<<SVCf_EXIT_ON_COMPLETE|1<<SVCf_FREE_ON_COMPLETE);
|
||||
Free(buf);
|
||||
@@ -440,7 +441,7 @@ public CTask *PopUpViewDoc(CDoc *doc,I64 doc_flags=0)
|
||||
|
||||
U0 PopUpViewStrTaskEndCB()
|
||||
{
|
||||
DocDel(NamedFramePtr("ViewStrFrame"));
|
||||
DocDel(FramePtr("ViewStrFrame"));
|
||||
Exit;
|
||||
}
|
||||
|
||||
@@ -448,9 +449,9 @@ public CTask *PopUpViewStr(U8 *msg)
|
||||
{
|
||||
CTask *task;
|
||||
CDoc *doc=DocNew;
|
||||
DocPrintF(doc,msg);
|
||||
DocPrint(doc,msg);
|
||||
task=PopUpViewDoc(doc);
|
||||
NamedFramePtrAdd("ViewStrFrame",doc,task);
|
||||
FramePtrAdd("ViewStrFrame",doc,task);
|
||||
task->task_end_cb=&PopUpViewStrTaskEndCB;
|
||||
return task;
|
||||
}
|
||||
@@ -462,10 +463,10 @@ public I64 PopUpMenu(CDoc *doc,I64 doc_flags=0)
|
||||
return SrvUser("DocMenuDo(0x%X,0x%X);",doc,doc_flags);
|
||||
}
|
||||
|
||||
public Bool PopUpForm(U8 *D,U8 *class_name,I64 doc_flags=DOF_MIN_SIZE,
|
||||
public Bool PopUpForm(U8 *_d,U8 *class_name=lastclass,I64 doc_flags=DOF_MIN_SIZE,
|
||||
U8 *header=NULL,U8 *footer=NULL)
|
||||
{
|
||||
return SrvUser("DocFormDo(0x%X,0x%X,0x%X,0x%X,0x%X);",D,class_name,
|
||||
return SrvUser("DocFormDo(0x%X,0x%X,0x%X,0x%X,0x%X);",_d,class_name,
|
||||
doc_flags,header,footer);
|
||||
}
|
||||
|
||||
@@ -474,10 +475,10 @@ public U8 *PopUpPickFile(U8 *dir=NULL)
|
||||
{
|
||||
U8 *result,*st,*st2;
|
||||
if (dir)
|
||||
st=MSPrintF("Cd(\"%Q\");FileMgr(FM_PICK_FILE,Fs->parent_task);",dir);
|
||||
st=MPrint("Cd(\"%Q\");FileMgr(FM_PICK_FILE,Fs->parent_task);",dir);
|
||||
else {
|
||||
st2=CurDir;
|
||||
st=MSPrintF("Cd(\"%Q\");FileMgr(FM_PICK_FILE,Fs->parent_task);",st2);
|
||||
st=MPrint("Cd(\"%Q\");FileMgr(FM_PICK_FILE,Fs->parent_task);",st2);
|
||||
Free(st2);
|
||||
}
|
||||
result=PopUp(st,Fs);
|
||||
@@ -489,10 +490,10 @@ public U8 *PopUpPickDir(U8 *dir=NULL)
|
||||
{
|
||||
U8 *result,*st,*st2;
|
||||
if (dir)
|
||||
st=MSPrintF("Cd(\"%Q\");FileMgr(FM_PICK_DIR,Fs->parent_task);",dir);
|
||||
st=MPrint("Cd(\"%Q\");FileMgr(FM_PICK_DIR,Fs->parent_task);",dir);
|
||||
else {
|
||||
st2=CurDir;
|
||||
st=MSPrintF("Cd(\"%Q\");FileMgr(FM_PICK_DIR,Fs->parent_task);",st2);
|
||||
st=MPrint("Cd(\"%Q\");FileMgr(FM_PICK_DIR,Fs->parent_task);",st2);
|
||||
Free(st2);
|
||||
}
|
||||
result=PopUp(st,Fs);
|
||||
@@ -507,7 +508,7 @@ public U8 *FileNameForm(U8 *dft=NULL,I64 doc_flags=0,CTask *mem_task=NULL)
|
||||
StrCpy(fn.name,dft);
|
||||
else
|
||||
*fn.name=0;
|
||||
if (DocFormDo(fn.name,"CEdFileName",doc_flags))
|
||||
if (DocFormDo(&fn,,doc_flags))
|
||||
return StrNew(fn.name,mem_task);
|
||||
else
|
||||
return NULL;
|
||||
@@ -515,7 +516,7 @@ public U8 *FileNameForm(U8 *dft=NULL,I64 doc_flags=0,CTask *mem_task=NULL)
|
||||
|
||||
public U8 *PopUpFileName(U8 *dft=NULL,I64 doc_flags=0)
|
||||
{
|
||||
U8 *st=MSPrintF("FileNameForm(\"%Q\",0x%X,Fs->parent_task);",dft,doc_flags|DOF_MIN_SIZE),
|
||||
U8 *st=MPrint("FileNameForm(\"%Q\",0x%X,Fs->parent_task);",dft,doc_flags|DOF_MIN_SIZE),
|
||||
*result=PopUp(st,Fs);
|
||||
Free(st);
|
||||
return result;
|
||||
@@ -535,21 +536,21 @@ Bool PopUpCd()
|
||||
}
|
||||
|
||||
#help_index "Doc/Input"
|
||||
public U8 *PopUpPickLstEntry(U8 *lst)
|
||||
public U8 *PopUpPickLst(U8 *lst)
|
||||
{
|
||||
I64 i=0;
|
||||
CDoc *doc=DocNew;
|
||||
DocPutS(doc,"$$FG,LTBLUE$$");
|
||||
DocPrint(doc,"$$FG,LTBLUE$$");
|
||||
while (*lst) {
|
||||
if (*lst=='@') { //Check for '@' alias lst entry
|
||||
i--;
|
||||
lst++;
|
||||
}
|
||||
DocPrintF(doc,"$$MU,\"%s\",0x%08X$$\n",
|
||||
DocPrint(doc,"$$MU,\"%s\",0x%08X$$\n",
|
||||
lst,i++);
|
||||
lst+=StrLen(lst)+1;
|
||||
}
|
||||
DocPutS(doc,"\n$$MU,\"CANCEL\",DOCM_CANCEL$$\n");
|
||||
DocPrint(doc,"\n$$MU,\"CANCEL\",DOCM_CANCEL$$\n");
|
||||
i=PopUpMenu(doc);
|
||||
DocDel(doc);
|
||||
return i;
|
||||
@@ -557,16 +558,16 @@ public U8 *PopUpPickLstEntry(U8 *lst)
|
||||
|
||||
public U8 *PopUpPickDefineSub(U8 *st)
|
||||
{
|
||||
return PopUpPickLstEntry(Define(st));
|
||||
return PopUpPickLst(Define(st));
|
||||
}
|
||||
|
||||
public I64 PopUp1(U8 *b1,I64 n1,U8 *header=NULL,U8 *footer=NULL)
|
||||
{
|
||||
I64 i,l1=StrLen(b1);
|
||||
CDoc *doc=DocNew;
|
||||
if (header) DocPutS(doc,header);
|
||||
DocPrintF(doc,"$$CM+CX,%d,4$$$$BT,\"%s\",%d$$\n",-l1/2,b1,n1);
|
||||
if (footer) DocPutS(doc,footer);
|
||||
if (header) DocPrint(doc,"%s",header);
|
||||
DocPrint(doc,"$$CM+CX,%d,4$$$$BT,\"%s\",%d$$\n",-l1/2,b1,n1);
|
||||
if (footer) DocPrint(doc,"%s",footer);
|
||||
i=PopUpMenu(doc);
|
||||
DocDel(doc);
|
||||
return i;
|
||||
@@ -577,15 +578,15 @@ public I64 PopUp2(U8 *b1,I64 n1,U8 *b2,I64 n2,U8 *header=NULL,U8 *footer=NULL)
|
||||
I64 i,l1=StrLen(b1),l2=StrLen(b2),y;
|
||||
CDoc *doc=DocNew;
|
||||
if (header) {
|
||||
DocPutS(doc,header);
|
||||
DocPrint(doc,"%s",header);
|
||||
y=4;
|
||||
} else {
|
||||
DocPrintF(doc,"%*s\n",l1+l2+10,"");
|
||||
DocPrint(doc,"%*s\n",l1+l2+10,"");
|
||||
y=3;
|
||||
}
|
||||
DocPrintF(doc,"$$CM+CX,%d,%d$$$$BT,\"%s\",%d$$",-(l1+l2+3)>>1,y,b1,n1);
|
||||
DocPrintF(doc,"$$CM+CX,%d,0$$$$BT,\"%s\",%d$$\n" ,-(l1+l2+3)>>1+l1+6,b2,n2);
|
||||
if (footer) DocPutS(doc,footer);
|
||||
DocPrint(doc,"$$CM+CX,%d,%d$$$$BT,\"%s\",%d$$",-(l1+l2+3)>>1,y,b1,n1);
|
||||
DocPrint(doc,"$$CM+CX,%d,0$$$$BT,\"%s\",%d$$\n" ,-(l1+l2+3)>>1+l1+6,b2,n2);
|
||||
if (footer) DocPrint(doc,"%s",footer);
|
||||
i=PopUpMenu(doc);
|
||||
DocDel(doc);
|
||||
return i;
|
||||
@@ -615,12 +616,12 @@ public I64 PopUpReplaceSkipAllCancel(U8 *header=NULL,U8 *footer=NULL)
|
||||
{
|
||||
I64 i;
|
||||
CDoc *doc=DocNew;
|
||||
if (header) DocPutS(doc,header);
|
||||
DocPutS(doc,"$$CM+LX,1,4$$$$BT,\"REPLACE\",RSAC_REPLACE$$"
|
||||
if (header) DocPrint(doc,"%s",header);
|
||||
DocPrint(doc,"$$CM+LX,1,4$$$$BT,\"REPLACE\",RSAC_REPLACE$$"
|
||||
"$$CM+LX,17,0$$$$BT,\"SKIP\",RSAC_SKIP$$"
|
||||
"$$CM+LX,1,3$$$$BT,\"ALL\",RSAC_ALL$$"
|
||||
"$$CM+LX,17,0$$$$BT,\"CANCEL\",DOCM_CANCEL$$\n");
|
||||
if (footer) DocPutS(doc,footer);
|
||||
if (footer) DocPrint(doc,"%s",footer);
|
||||
i=PopUpMenu(doc);
|
||||
DocDel(doc);
|
||||
return i;
|
||||
@@ -630,7 +631,7 @@ U8 *DoPopUpMGetS(U8 *header,CTask *mem_task)
|
||||
{
|
||||
U8 *result,*st;
|
||||
if (header)
|
||||
"" header;
|
||||
"%s",header;
|
||||
st=MGetS(GETSF_WITH_NEW_LINE);
|
||||
result=StrNew(st,mem_task);
|
||||
Free(st);
|
||||
@@ -639,23 +640,31 @@ U8 *DoPopUpMGetS(U8 *header,CTask *mem_task)
|
||||
|
||||
public U8 *PopUpMGetS(U8 *header=NULL)
|
||||
{
|
||||
U8 *st=MSPrintF("DoPopUpMGetS(0x%X,0x%X);",header,Fs),
|
||||
U8 *st=MPrint("DoPopUpMGetS(0x%X,0x%X);",header,Fs),
|
||||
*result=PopUp(st,Fs);
|
||||
Free(st);
|
||||
return result;
|
||||
}
|
||||
|
||||
public I64 PopUpI64(U8 *msg,I64 dft,I64 lo=MIN_I64,I64 hi=MAX_I64)
|
||||
{
|
||||
U8 *st=MPrint("PmtI64(0x%X,0x%X,0x%X,0x%X);",msg,dft,lo,hi);
|
||||
I64 result=PopUp(st,Fs);
|
||||
Free(st);
|
||||
return result;
|
||||
}
|
||||
|
||||
public I64 PopUpRangeI64(I64 lo,I64 hi,I64 step=1,U8 *header=NULL,U8 *footer=NULL)
|
||||
{
|
||||
I64 i;
|
||||
CDoc *doc=DocNew;
|
||||
if (header)
|
||||
DocPutS(doc,header);
|
||||
DocPutS(doc,"$$FG,LTBLUE$$");
|
||||
DocPrint(doc,"%s",header);
|
||||
DocPrint(doc,"$$FG,LTBLUE$$");
|
||||
for (i=lo;i<=hi;i+=step)
|
||||
DocPrintF(doc,"$$MU,\"%d\",%d$$\n",i,i);
|
||||
DocPrint(doc,"$$MU,\"%d\",%d$$\n",i,i);
|
||||
if (footer)
|
||||
DocPutS(doc,footer);
|
||||
DocPrint(doc,"%s",footer);
|
||||
i=PopUpMenu(doc);
|
||||
DocDel(doc);
|
||||
return i;
|
||||
@@ -669,14 +678,14 @@ public F64 PopUpRangeF64(F64 lo,F64 hi,F64 step,
|
||||
U8 buf[136];
|
||||
CDoc *doc=DocNew;
|
||||
if (header)
|
||||
DocPutS(doc,header);
|
||||
DocPutS(doc,"$$FG,LTBLUE$$");
|
||||
DocPrint(doc,"%s",header);
|
||||
DocPrint(doc,"$$FG,LTBLUE$$");
|
||||
for (d=lo;d<=hi;d+=step) {
|
||||
SPrintF(buf,fmt,d);
|
||||
DocPrintF(doc,"$$MU,\"%s\",0x%X$$\n",buf,d);
|
||||
SPrint(buf,fmt,d);
|
||||
DocPrint(doc,"$$MU,\"%s\",0x%X$$\n",buf,d);
|
||||
}
|
||||
if (footer)
|
||||
DocPutS(doc,footer);
|
||||
DocPrint(doc,"%s",footer);
|
||||
i=PopUpMenu(doc);
|
||||
DocDel(doc);
|
||||
return i(F64);
|
||||
@@ -690,14 +699,14 @@ public F64 PopUpRangeF64Exp(F64 lo,F64 hi,F64 factor,
|
||||
U8 buf[136];
|
||||
CDoc *doc=DocNew;
|
||||
if (header)
|
||||
DocPutS(doc,header);
|
||||
DocPutS(doc,"$$FG,LTBLUE$$");
|
||||
DocPrint(doc,"%s",header);
|
||||
DocPrint(doc,"$$FG,LTBLUE$$");
|
||||
for (d=lo;d<=hi;d*=factor) {
|
||||
SPrintF(buf,fmt,d);
|
||||
DocPrintF(doc,"$$MU,\"%s\",0x%X$$\n",buf,d);
|
||||
SPrint(buf,fmt,d);
|
||||
DocPrint(doc,"$$MU,\"%s\",0x%X$$\n",buf,d);
|
||||
}
|
||||
if (footer)
|
||||
DocPutS(doc,footer);
|
||||
DocPrint(doc,"%s",footer);
|
||||
i=PopUpMenu(doc);
|
||||
DocDel(doc);
|
||||
return i(F64);
|
||||
@@ -717,7 +726,7 @@ public I64 AdamFile(U8 *filename,Bool warn_ext=TRUE)
|
||||
*name2=DftExt(name,"CPP.Z");
|
||||
I64 result=0;
|
||||
if (warn_ext &&
|
||||
!FilesFindMatch(FILENAME_MASK_JIT,name2) &&
|
||||
!FilesFindMatch(name2,FILEMASK_JIT) &&
|
||||
!PopUpCancelOk(ST_WARN_ST "Not .CPP File\n\n"))
|
||||
okay=FALSE;
|
||||
if (okay)
|
||||
@@ -735,11 +744,11 @@ public I64 PopUpFile(U8 *filename,Bool warn_ext=TRUE,CTask *parent=NULL,CTask **
|
||||
*name2=DftExt(name,"CPP.Z");
|
||||
I64 result=0;
|
||||
if (warn_ext &&
|
||||
!FilesFindMatch(FILENAME_MASK_JIT,name2) &&
|
||||
!FilesFindMatch(name2,FILEMASK_JIT) &&
|
||||
!PopUpCancelOk(ST_WARN_ST "Not .CPP File\n\n"))
|
||||
okay=FALSE;
|
||||
if (okay) {
|
||||
st=MSPrintF("\"$$$$WW+H,1$$$$\";Auto(\"ExeFile(\\\"%s\\\");\\n\");UserTaskCont;",name2);
|
||||
st=MPrint("\"$$$$WW+H,1$$$$\";Auto(\"ExeFile(\\\"%s\\\");\\n\");UserTaskCont;",name2);
|
||||
result=PopUp(st,parent,_pu_task);
|
||||
Free(st);
|
||||
}
|
||||
@@ -754,13 +763,13 @@ public I64 PopUpColor(U8 *header=NULL,Bool allow_transparent=TRUE,Bool allow_dft
|
||||
I64 i;
|
||||
CDoc *doc=DocNew;
|
||||
if (header)
|
||||
DocPutS(doc,header);
|
||||
DocPrint(doc,"%s",header);
|
||||
if (allow_transparent)
|
||||
DocPutS(doc,"$$MU,\"TRANSPARENT\",COLOR_TRANSPARENT$$\n");
|
||||
DocPrint(doc,"$$MU,\"TRANSPARENT\",COLOR_TRANSPARENT$$\n");
|
||||
for (i=0;i<16;i++)
|
||||
DocPrintF(doc,"$$BG,%d$$$$MU,\"__%-8Z__\",%d$$$$BG$$\n",i,i,"ST_COLORS",i);
|
||||
DocPrint(doc,"$$BG,%d$$$$MU,\"__%-8Z__\",%d$$$$BG$$\n",i,i,"ST_COLORS",i);
|
||||
if (allow_dft)
|
||||
DocPutS(doc,"$$BG,WHITE$$$$MU,\"DEFAULT\",DOC_DFT$$$$BG$$");
|
||||
DocPrint(doc,"$$BG,WHITE$$$$MU,\"DEFAULT\",DOC_DFT$$$$BG$$");
|
||||
i=PopUpMenu(doc);
|
||||
DocDel(doc);
|
||||
return i;
|
||||
@@ -771,23 +780,23 @@ public I64 PopUpColorLighting(U8 *header=NULL)
|
||||
I64 i;
|
||||
CDoc *doc=DocNew;
|
||||
if (header)
|
||||
DocPutS(doc,header);
|
||||
DocPutS(doc,"\nSingle-Sided means both sides same color."
|
||||
DocPrint(doc,"%s",header);
|
||||
DocPrint(doc,"\nSingle-Sided means both sides same color."
|
||||
"\nDouble-Sided means back side darker."
|
||||
"\n"
|
||||
"\nHalf-Range means 0 to [0,7]"
|
||||
"\n [8,15]-8 to [8,15]"
|
||||
"\nFull-Range means 0 to [0,7] to [0,7]+8"
|
||||
"\n");
|
||||
DocPutS(doc,"\n$$FG,LTPURPLE$$Single-Sided Full-Range Double-Sided Full-Range\n$$FG,BLACK$$");
|
||||
DocPrint(doc,"\n$$FG,LTPURPLE$$Single-Sided Full-Range Double-Sided Full-Range\n$$FG,BLACK$$");
|
||||
for (i=0;i<8;i++) {
|
||||
DocPrintF(doc,"$$BG,%d$$$$MU,\"__%-19Z__\",%d$$$$BG$$ ",i,i,"ST_COLORS",i);
|
||||
DocPrintF(doc,"$$BG,%d$$$$MU,\"__%-19Z__\",%d$$$$BG$$\n",i,i,"ST_COLORS",ROPF_TWO_SIDED+i);
|
||||
DocPrint(doc,"$$BG,%d$$$$MU,\"__%-19Z__\",%d$$$$BG$$ ",i,i,"ST_COLORS",i);
|
||||
DocPrint(doc,"$$BG,%d$$$$MU,\"__%-19Z__\",%d$$$$BG$$\n",i,i,"ST_COLORS",ROPF_TWO_SIDED+i);
|
||||
}
|
||||
DocPutS(doc,"\n$$FG,LTPURPLE$$Single-Sided Half-Range Double-Sided Half-Range\n$$FG,BLACK$$");
|
||||
DocPrint(doc,"\n$$FG,LTPURPLE$$Single-Sided Half-Range Double-Sided Half-Range\n$$FG,BLACK$$");
|
||||
for (i=0;i<16;i++) {
|
||||
DocPrintF(doc,"$$BG,%d$$$$MU,\"__%-19Z__\",%d$$$$BG$$ ",i,i,"ST_COLORS",ROPF_HALF_RANGE_COLOR+i);
|
||||
DocPrintF(doc,"$$BG,%d$$$$MU,\"__%-19Z__\",%d$$$$BG$$\n",i,i,"ST_COLORS",ROPF_TWO_SIDED+ROPF_HALF_RANGE_COLOR+i);
|
||||
DocPrint(doc,"$$BG,%d$$$$MU,\"__%-19Z__\",%d$$$$BG$$ ",i,i,"ST_COLORS",ROPF_HALF_RANGE_COLOR+i);
|
||||
DocPrint(doc,"$$BG,%d$$$$MU,\"__%-19Z__\",%d$$$$BG$$\n",i,i,"ST_COLORS",ROPF_TWO_SIDED+ROPF_HALF_RANGE_COLOR+i);
|
||||
}
|
||||
i=PopUpMenu(doc);
|
||||
DocDel(doc);
|
||||
@@ -819,7 +828,7 @@ Bool PopUpTransform(I64 *r)
|
||||
tf->x_offset=0.0;
|
||||
tf->y_offset=0.0;
|
||||
tf->z_offset=0.0;
|
||||
if (PopUpForm(tf,"CTransformForm")) {
|
||||
if (PopUpForm(tf)) {
|
||||
MemSet(r,0,16*sizeof(I64));
|
||||
r[0] =tf->x_scale*gr_scale;
|
||||
r[5] =tf->y_scale*gr_scale;
|
||||
@@ -855,7 +864,7 @@ U0 DrawIt(CTask *task,CDC *dc)
|
||||
else
|
||||
i1=COLOR_TRANSPARENT;
|
||||
dc->color=j1+i1<<16+ROPF_DITHER;
|
||||
GrRect(dc,i*PU_SPACING,j*PU_SPACING+NamedFramePtr("DitherDoFrame",task),PU_SPACING,PU_SPACING);
|
||||
GrRect(dc,i*PU_SPACING,j*PU_SPACING+FramePtr("DitherDoFrame",task),PU_SPACING,PU_SPACING);
|
||||
}
|
||||
i=(17*PU_SPACING+FONT_WIDTH-1)/FONT_WIDTH;
|
||||
if (doc->max_x>i) i=doc->max_x;
|
||||
@@ -867,9 +876,9 @@ I64 DitherColorDo(U8 *header=NULL)
|
||||
{
|
||||
I64 msg_code,p1,p2,result=-1,i,j;
|
||||
DocClear;
|
||||
"" header;
|
||||
"%s",header;
|
||||
DocRecalc(DocPut);
|
||||
NamedFramePtrAdd("DitherDoFrame",(DocPut->max_y+1)*FONT_HEIGHT);
|
||||
FramePtrAdd("DitherDoFrame",(DocPut->max_y+1)*FONT_HEIGHT);
|
||||
SettingsPush; //See $LK,"SettingsPush","MN:SettingsPush"$
|
||||
Fs->draw_it=&DrawIt;
|
||||
do {
|
||||
@@ -877,7 +886,7 @@ I64 DitherColorDo(U8 *header=NULL)
|
||||
if (msg_code==MSG_IP_L_DOWN) {
|
||||
msg_code=GetMsg(&p1,&p2,1<<MSG_IP_L_UP);
|
||||
i=p1/PU_SPACING;
|
||||
j=(p2-NamedFramePtr("DitherDoFrame"))/PU_SPACING;
|
||||
j=(p2-FramePtr("DitherDoFrame"))/PU_SPACING;
|
||||
if (p1>=0 && p2>=0 && 0<=j<17 && 0<=i<17) {
|
||||
if (j==16) j=COLOR_TRANSPARENT;
|
||||
if (i==16) i=COLOR_TRANSPARENT;
|
||||
@@ -890,14 +899,14 @@ I64 DitherColorDo(U8 *header=NULL)
|
||||
while (!p1);
|
||||
dcd_done:
|
||||
SettingsPop;
|
||||
NamedFramePtrDel("DitherDoFrame");
|
||||
FramePtrDel("DitherDoFrame");
|
||||
return result;
|
||||
}
|
||||
|
||||
public I64 PopUpColorDither(U8 *header=NULL)
|
||||
{
|
||||
U8 buf[136];
|
||||
SPrintF(buf,"DitherColorDo(0x%X);",header);
|
||||
SPrint(buf,"DitherColorDo(0x%X);",header);
|
||||
return PopUp(buf,Fs);
|
||||
}
|
||||
|
||||
|
||||
@@ -109,7 +109,6 @@ Bool DocRecalc(CDoc *doc,Bool has_cursor=FALSE,I64 recalc=DOC_RECALC_ALL)
|
||||
{
|
||||
I64 i,ii,j,k,x,x0,y,y0,D,d2,col,col2,best_col=0,best_d=MAX_I64,xx,yy,zz,
|
||||
num_entries=0,ijif,cur_u8_attr,temp_u32_attr,
|
||||
hide_collapsed[2],
|
||||
cursor_y=MIN_I64,left_margin,right_margin,
|
||||
y_plot_top,y_plot_bottom,
|
||||
top,left,bottom,right,width,height,scroll_x,scroll_y,
|
||||
@@ -195,7 +194,7 @@ Bool DocRecalc(CDoc *doc,Bool has_cursor=FALSE,I64 recalc=DOC_RECALC_ALL)
|
||||
best_do_e=doc->cur_entry;
|
||||
|
||||
if (!(doc->flags&(DOCF_PLAIN_TEXT|DOCF_PLAIN_TEXT_WITH_TABS)) &&
|
||||
FilesFindMatch(FILENAME_MASK_SRC,doc->filename.name))
|
||||
FilesFindMatch(doc->filename.name,FILEMASK_SRC))
|
||||
doc->flags|=DOCF_HIGHLIGHT;
|
||||
else
|
||||
doc->flags&=~DOCF_HIGHLIGHT;
|
||||
@@ -356,9 +355,7 @@ word_wrap_start:
|
||||
goto word_wrap_start;
|
||||
}
|
||||
}
|
||||
if (doc_e->type_u8==DOCT_TEXT &&
|
||||
!(doc_e->flags1&DOCEG1_DONT_EDIT) &&
|
||||
!(doc_e->flags2&DOCEG2_DONT_EDIT)) {
|
||||
if (IsEditableText(doc_e)) {
|
||||
if (doc_e->flags1==doc_e2->flags1 && doc_e->flags2==doc_e2->flags2 &&
|
||||
doc_e->type==doc_e2->type) {
|
||||
j=StrLen(doc_e2->tag);
|
||||
@@ -461,9 +458,7 @@ word_wrap2:
|
||||
if (doc->flags & DOCF_WORD_WRAP) {
|
||||
i=right_margin+1-(x+left); //Space left on line
|
||||
ii=x+1-s->left_margin;
|
||||
if (doc_e->type_u8==DOCT_TEXT &&
|
||||
!(doc_e->flags1&DOCEG1_DONT_EDIT) &&
|
||||
!(doc_e->flags2&DOCEG2_DONT_EDIT)) {
|
||||
if (IsEditableText(doc_e)) {
|
||||
if (doc->cur_entry==doc_e->next) {
|
||||
if (doc->cur_data_col==doc_e->next->min_col)
|
||||
i--;
|
||||
@@ -577,10 +572,6 @@ skip_soft_cr:
|
||||
case DOCT_TREE:
|
||||
temp_u32_attr.u8[1]|=DOC_COLOR_TREE;
|
||||
break;
|
||||
case DOCT_HIDE_START:
|
||||
case DOCT_HIDE_END:
|
||||
temp_u32_attr.u8[1]|=DOC_COLOR_HIDDEN;
|
||||
break;
|
||||
default:
|
||||
temp_u32_attr.u8[1]|=cur_u8_attr&15;
|
||||
}
|
||||
@@ -615,7 +606,7 @@ skip_soft_cr:
|
||||
if (doc_e==doc->cur_entry && doc_e->type_u8!=DOCT_TEXT)
|
||||
temp_u32_attr^=0x0F00;
|
||||
if (full_refresh && '0'<=ptr[1]<='9') {
|
||||
SPrintF(buf,"<%d>",doc_e->bin_num);
|
||||
SPrint(buf,"<%d>",doc_e->bin_num);
|
||||
k=StrLen(buf);
|
||||
Free(doc_e->tag);
|
||||
ptr=doc_e->tag=MAlloc(k+1,mem_task);
|
||||
@@ -632,20 +623,7 @@ skip_soft_cr:
|
||||
*ptr++=']';
|
||||
ptr=doc_e->tag;
|
||||
}
|
||||
} else if (doc_e->type_u8==DOCT_HIDE_START) {
|
||||
if (k>=2) {
|
||||
*ptr++='<';
|
||||
if (doc_e->flags1 & DOCEF1_CHECKED_COLLAPSED)
|
||||
*ptr++='+';
|
||||
else
|
||||
*ptr++='-';
|
||||
ptr=doc_e->tag;
|
||||
}
|
||||
} else if (doc_e->type_u8==DOCT_HIDE_END) {
|
||||
if (k>=1)
|
||||
*ptr='>';
|
||||
}
|
||||
|
||||
if (doc_e->flags1 & DOCEF1_SCROLLING_X) {
|
||||
j=StrLen(doc_e->tag);
|
||||
if (j && doc_e->scroll_len) {
|
||||
@@ -741,9 +719,9 @@ skip_soft_cr:
|
||||
k=doc_e->hex_ed_width; //columns
|
||||
for (i=0;i<doc_e->len;i+=k) {
|
||||
if (doc_e->flags1 & DOCEF1_ZERO_BASED)
|
||||
SPrintF(buf,"%08tX ",i);
|
||||
SPrint(buf,"%08tX ",i);
|
||||
else
|
||||
SPrintF(buf,"%08tX ",bptr);
|
||||
SPrint(buf,"%08tX ",bptr);
|
||||
ptr=buf;
|
||||
while (ch=*ptr++) {
|
||||
if (recalc==DOC_RECALC_TO_SCREEN && !(doc_e->flags1&DOCEF1_DONT_DRAW)) {
|
||||
@@ -764,7 +742,7 @@ skip_soft_cr:
|
||||
}
|
||||
if (i+k>doc_e->len) k=doc_e->len-i;
|
||||
for (j=0;j<k;j++) {
|
||||
SPrintF(buf,"%02tX",*bptr++);
|
||||
SPrint(buf,"%02tX",*bptr++);
|
||||
ptr=buf;
|
||||
while (ch=*ptr++) {
|
||||
if (recalc==DOC_RECALC_TO_SCREEN && !(doc_e->flags1&DOCEF1_DONT_DRAW)) {
|
||||
@@ -1240,7 +1218,6 @@ adjust_xy:
|
||||
if (full_refresh) {
|
||||
switch (doc_e->type_u8) {
|
||||
case DOCT_CHECK_BOX:
|
||||
case DOCT_HIDE_START:
|
||||
doc_e->max_col=2;
|
||||
break;
|
||||
case DOCT_TREE:
|
||||
@@ -1248,7 +1225,6 @@ adjust_xy:
|
||||
case DOCT_LINK:
|
||||
case DOCT_MENU_VAL:
|
||||
case DOCT_MACRO:
|
||||
case DOCT_HIDE_END:
|
||||
doc_e->max_col=1;
|
||||
break;
|
||||
default:
|
||||
@@ -1304,35 +1280,6 @@ adjust_xy:
|
||||
} while (doc_e2!=doc && j>i);
|
||||
}
|
||||
}
|
||||
if (doc_e->type_u8 == DOCT_HIDE_START) {
|
||||
if (doc_e->flags1 & DOCEF1_ALIAS)
|
||||
alias=doc_e;
|
||||
else
|
||||
alias=NULL;
|
||||
doc_e2=doc_e->next;
|
||||
LBtr(hide_collapsed,0);
|
||||
j=1;
|
||||
LBEqu(hide_collapsed,j,doc_e->flags1 & DOCEF1_CHECKED_COLLAPSED);
|
||||
while (doc_e2!=doc && j>0) {
|
||||
if (Bt(hide_collapsed,j))
|
||||
doc_e2->flags1|=DOCEF1_SKIP;
|
||||
else
|
||||
doc_e2->flags1&=~DOCEF1_SKIP;
|
||||
if (doc_e2->type_u8==DOCT_HIDE_START) {
|
||||
j++;
|
||||
LBEqu(hide_collapsed,j,doc_e2->flags1 & DOCEF1_CHECKED_COLLAPSED);
|
||||
if (Bt(hide_collapsed,j-1))
|
||||
LBts(hide_collapsed,j);
|
||||
} else if (doc_e2->type_u8==DOCT_HIDE_END) {
|
||||
j--;
|
||||
if (Bt(hide_collapsed,j))
|
||||
doc_e2->flags1|=DOCEF1_SKIP;
|
||||
else
|
||||
doc_e2->flags1&=~DOCEF1_SKIP;
|
||||
}
|
||||
doc_e2=doc_e2->next;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
doc_e2=doc_e->next;
|
||||
@@ -1563,7 +1510,7 @@ public U0 DocInsSafe(CDoc *doc,U8 *st)
|
||||
unlock=DocLock(doc);
|
||||
old_flags=doc->flags;
|
||||
doc->flags|=DOCF_NO_CURSOR;
|
||||
DocPutS(doc,st);
|
||||
DocPrint(doc,"%s",st);
|
||||
DocRecalc(doc,FALSE,DOC_RECALC_PARTIAL);
|
||||
doc->flags=old_flags;
|
||||
if (unlock)
|
||||
@@ -1612,7 +1559,7 @@ public U0 DocClear(CDoc *doc=NULL)
|
||||
}
|
||||
unlock=DocLock(doc);
|
||||
DocBottom(doc);
|
||||
DocPutS(doc,"$$CL$$");
|
||||
DocPrint(doc,"$$CL$$");
|
||||
DocRecalc(doc);
|
||||
if (unlock)
|
||||
DocUnlock(doc);
|
||||
@@ -1650,7 +1597,7 @@ public U0 DocCollapse(Bool collapse=TRUE,CDoc *doc=NULL)
|
||||
unlock=DocLock(doc);
|
||||
doc_e=doc->root.next;
|
||||
while (doc_e!=doc) {
|
||||
if (doc_e->flags1&DOCEF1_TREE || doc_e->type_u8==DOCT_HIDE_START)
|
||||
if (doc_e->flags1&DOCEF1_TREE)
|
||||
BEqu(&doc_e->flags1,DOCEf1_CHECKED_COLLAPSED,collapse);
|
||||
doc_e=doc_e->next;
|
||||
}
|
||||
|
||||
@@ -98,8 +98,8 @@ mt_done:
|
||||
while (*st3) {
|
||||
StrFirstRem(st3,"/",st2);
|
||||
if (*st2) {
|
||||
DocPrintF(doc,"$$TR+C,\"%s\"$$\n$$ID,2$$",st2);
|
||||
doc->cur_entry=DocPutS(doc,"$$ID,-2$$");
|
||||
DocPrint(doc,"$$TR+C,\"%s\"$$\n$$ID,2$$",st2);
|
||||
doc->cur_entry=DocPrint(doc,"$$ID,-2$$");
|
||||
doc->cur_data_col=0;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user