TempleOSTS_131005.ISO

This commit is contained in:
Terry A. Davis authored and minexew committed 2018-09-08 21:45:52 +02:00
1 parent 1343005a29
commit 2d2a65d572
547 files changed
+33608 -12549

No files matched your search

+10 -10
View File
@@ -7,15 +7,15 @@ U8 *tSCB(CDoc *,CDocEntry *,CTask *mem_task)
U8 *st=MAlloc(64,mem_task);
CDate cdt=tS*CDATE_FREQ;
//Doesn't have to be fixed width!!
SPrintF(st,"%d=%h11T",cdt,cdt);
SPrint(st,"%d=%h11T",cdt,cdt);
return st;
}
U8 *CurTimeCB(CDoc *,CDocEntry *,CTask *mem_task)
{
U8 *st=MAlloc(64,mem_task);
CDate cdt=GetCurTimeDate;
SPrintF(st,"%h0D %h0T",cdt,cdt);
CDate cdt=GetDateTime;
SPrint(st,"%h0D %h0T",cdt,cdt);
return st;
}
@@ -32,10 +32,10 @@ U0 DoIt()
Bool old_preempt=Preempt(OFF);
DocBottom(bdoc); //Ins at the bottom
DocPutS(bdoc,"$$FG,RED$$$$CM+BY+LX,5,-3$$");
DocPrint(bdoc,"$$FG,RED$$$$CM+BY+LX,5,-3$$");
// The $LK,"DocPutS","MN:DocPutS"$() routine returns the addr of the last entry.
doc_e=DocPutS(bdoc,"$$TX+TC,\" \"$$");
// The $LK,"DocPrint","MN:DocPrint"$() routine returns the addr of the last entry.
doc_e=DocPrint(bdoc,"$$TX+TC,\" \"$$");
// The TC flag is "has tag callback".
// Flags are explained here:
@@ -45,7 +45,7 @@ U0 DoIt()
// $LK,"ST_DOC_FLAGS","FF:::/TempleOS/Adam/Doc/Doc.CPP,ST_DOC_FLAGS"$
doc_e->tag_cb=&tSCB;
DocPutS(bdoc,"$$FG$$");
DocPrint(bdoc,"$$FG$$");
//$BK,1$WARNING:$BK,0$ If you use the put_doc you
//run the risk of the user pressing
@@ -53,10 +53,10 @@ U0 DoIt()
//of which will crash. So, you might want
//to use the border_doc.
DocPutS(pdoc,"$$FG,LTRED$$");
doc_e=DocPutS(pdoc,"$$TX+TC,\" \"$$");
DocPrint(pdoc,"$$FG,LTRED$$");
doc_e=DocPrint(pdoc,"$$TX+TC,\" \"$$");
doc_e->tag_cb=&CurTimeCB;
DocPutS(pdoc,"$$FG$$");
DocPrint(pdoc,"$$FG$$");
Preempt(old_preempt);
+2 -2
View File
@@ -50,11 +50,11 @@ U0 DataDemo()
"However, changes happen immediately,\n"
"so it's tricky.\n\n";
//Use <CTRL-L> for the $$DA,$$ format.
doc_e=DocPutS(doc,"$$DA-T+RD+UD-I64+U32,32,\"%12d\"$$\n");
doc_e=DocPrint(doc,"$$DA-T+RD+UD-I64+U32,32,\"%%12d\"$$\n");
doc_e->data=&i;
StrCpy(buf,"Terry");
doc_e=DocPutS(doc,"$$DA-P+RD+UD,7,\"Str:%s\"$$\n");
doc_e=DocPrint(doc,"$$DA-P+RD+UD,7,\"Str:%%s\"$$\n");
doc_e->data=buf;
if (unlock)
+3 -3
View File
@@ -12,11 +12,11 @@ documentation.
DefineLoad("COMPANY","Trivial Solutions");
"Company: $$TX+D,\"\",\"COMPANY\"$$\n";
DefinePrintF("COMPANY_TIME","%T",GetCurTimeDate);
DefinePrint("COMPANY_TIME","%T",GetDateTime);
#exe {
StreamPrintF(
"#define COMPANY_AGE %h56D\n",GetCurTimeDate-A2Date("8/1/2003"));
StreamPrint(
"#define COMPANY_AGE %h56D\n",GetDateTime-A2Date("8/1/2003"));
};
Binary file not shown.
+22 -22
View File
@@ -1,42 +1,42 @@
class DStruct
class FDStruct
{
//Use <CTRL-L> and select "Data" to generate the fmtstrs
//The number is the field from after the ':' to the end.
// See $LK,"Data Tag Width","FA:::/TempleOS/Adam/Doc/DocPlain.CPP,DataTagWidth"$.
F64 num1 fmtstr "$$DA-T,32,\"F64 1:%12.8f\"$$\n";
F64 num2 fmtstr "$$DA-T,32,\"F64 2:%12e\"$$\n";
I64 num3 fmtstr "$$DA-T,32,\"I64 1:0x%016X\"$$\n";
I64 num4 fmtstr "$$DA-T,32,\"I64 2:%12d\"$$\n";
U8 name[32] fmtstr "$$DA-P,31,\"Name :%s\"$$\n";
F64 num1 fmtstr "$$DA-T,32,\"F64 1:%12.8f\"$$\n";
F64 num2 fmtstr "$$DA-T,32,\"F64 2:%12e\"$$\n";
I64 num3 fmtstr "$$DA-T,32,\"I64 1:0x%016X\"$$\n";
I64 num4 fmtstr "$$DA-T,32,\"I64 2:%12d\"$$\n";
U8 name[32] fmtstr "$$DA-P,31,\"Name :%s\"$$\n";
CDate datetime fmtstr "$$DA-T,32,\"Date :%8D\"$$\n";
};
U0 FormDemo()
{
DStruct gtl;
FDStruct fds;
CDate cdt;
gtl.num1=12.3e-4; //Set defaults
gtl.num2=4.5e3;
gtl.num3=0x1234;
gtl.num4=-567;
StrCpy(&gtl.name,"John");
cdt=GetCurTimeDate;
gtl.datetime=cdt;
if (DocFormDo(&gtl,"DStruct")) {
"#1=%e\n",gtl.num1;
"#2=%e\n",gtl.num2;
"#3=%d\n",gtl.num3;
"#4=%d\n",gtl.num4;
"Name=%s\n",gtl.name;
"Date=%D\n",gtl.datetime;
fds.num1=12.3e-4; //Set defaults
fds.num2=4.5e3;
fds.num3=0x1234;
fds.num4=-567;
StrCpy(&fds.name,"John");
cdt=GetDateTime;
fds.datetime=cdt;
if (DocFormDo(&fds)) {
"#1=%e\n",fds.num1;
"#2=%e\n",fds.num2;
"#3=%d\n",fds.num3;
"#4=%d\n",fds.num4;
"Name=%s\n",fds.name;
"Date=%D\n",fds.datetime;
} else
"Cancel\n";
"\n\nClassRep Example\n";
ClassRep("DStruct",&gtl);
ClassRep(&fds);
//See also $LK,"ClassRepD","MN:ClassRepD"$().
}
+1 -1
View File
@@ -7,7 +7,7 @@ I64 PopUpFreq()
{ //See also $LK,"PopUpRangeI64","MN:PopUpRangeI64"$()
I64 i;
CDoc *doc=DocNew;
DocPutS(doc,"$$TX+CX,\"Set Freq\"$$\n" //Centered text
DocPrint(doc,"$$TX+CX,\"Set Freq\"$$\n" //Centered text
"$$CM+LX,2,4$$$$BT,\"100 Hz\",100$$"
"$$CM+LX,18,0$$$$BT,\"200 Hz\",200$$"
"$$CM+LX,2,4$$$$BT,\"400 Hz\",400$$"
Binary file not shown.
+24 -24
View File
@@ -1,7 +1,7 @@
/*
This uses DocPutS/DocPrintF because updates
This uses $LK,"DocPrint","MN:DocPrint"$() because updates
to within a tree while a tree is collapsed get
messed-up if "live"(like using ordinary PrintF/PutS.)
messed-up if "live" (like using ordinary Print.)
The insert point is confused by hiding of
data in collapsed trees. Therefore, the window main
Doc is taken off-line by disabling preemption so there
@@ -9,33 +9,33 @@ are no screen updates until all data has been inserted.
There is a special Doc function which is also
available to take an Doc off-line. See $LK,"DocInsSafe","MN:DocInsSafe"$.
For this example, however, I wanted to use DocPrintF
For this example, however, I wanted to use DocPrint
and disabled Preemption myself.
*/
U0 TreeSub(CDoc *doc,CDirEntry *tempm)
U0 TreeSub(CDoc *doc,CDirEntry *tempde)
{
CDirEntry *tempm1;
while (tempm) {
tempm1=tempm->next;
if (tempm->attr & _ATTR_DIR) {
DocPutS(doc,"$$TR,\"\"$$");
DocPrintF(doc,"$$MA+A,\"%s\",\"Cd(\\\"%s\\\");Dir;\n\"$$\n",
tempm->name,tempm->full_name);
if (tempm->sub) {
DocPutS(doc,"$$ID,+2$$");
TreeSub(doc,tempm->sub);
DocPutS(doc,"$$ID,-2$$");
CDirEntry *tempde1;
while (tempde) {
tempde1=tempde->next;
if (tempde->attr & _ATTR_DIR) {
DocPrint(doc,"$$TR,\"\"$$");
DocPrint(doc,"$$MA+A,\"%s\",\"Cd(\\\"%s\\\");Dir;\n\"$$\n",
tempde->name,tempde->full_name);
if (tempde->sub) {
DocPrint(doc,"$$ID,+2$$");
TreeSub(doc,tempde->sub);
DocPrint(doc,"$$ID,-2$$");
}
} else {
DocPrintF(doc,"$$LK,\"%s\",\"FI:%s\"$$\n",
tempm->name,tempm->full_name);
DocPrint(doc,"$$LK,\"%s\",\"FI:%s\"$$\n",
tempde->name,tempde->full_name);
}
//Note there is also a routine
//to delete an entire CDirEntry tree.
//See $LK,"CDirLstDel","MN:CDirLstDel"$().
CDirEntryDel(tempm);
tempm=tempm1;
//See $LK,"DirLstDel","MN:DirLstDel"$().
DirEntryDel(tempde);
tempde=tempde1;
}
}
@@ -43,11 +43,11 @@ U0 TreeDemo()
{
I64 fuf_flags=0;
CDoc *doc=DocNew;
GetFFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r");
DocPutS(doc,"$$TR-C+AL,\"\"$$\n");
DocPutS(doc,"$$ID,+2$$");
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r");
DocPrint(doc,"$$TR-C+AL,\"\"$$\n");
DocPrint(doc,"$$ID,+2$$");
TreeSub(doc,FilesFind("/TempleOS/*",fuf_flags));
DocPutS(doc,"$$ID,-2$$");
DocPrint(doc,"$$ID,-2$$");
DocInsDoc(DocPut,doc);
DocDel(doc);
}
+2 -2
View File
@@ -48,12 +48,12 @@ U0 UnusedDefineScan()
while (temph!=tempht) {
if (temph->type&HTT_DEFINE_STR) {
progress1++;
if (FileOcc(temph->str,"/TempleOS/"FILENAME_MASK_TXT,"+l-i")==1) {
if (FileOcc(temph->str,"/TempleOS/*","+l-i+T")==1) {
doc=DocNew;
old_put_doc=DocPut;
old_display_doc=DocDisplay;
Fs->put_doc=Fs->display_doc=doc;
Grep(temph->str,"/TempleOS/"FILENAME_MASK_TXT,"+l-i");
Grep(temph->str,"/TempleOS/*","+l-i+T");
Fs->put_doc=old_put_doc;
Fs->display_doc=old_display_doc;
doc_e=doc->root.next;