*/}}

la_templates.c 81 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738
  1. /*
  2. * LaGUI: A graphical application framework.
  3. * Copyright (C) 2022-2023 Wu Yiming
  4. *
  5. * This program is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation, either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #include "../la_5.h"
  19. extern LA MAIN;
  20. extern struct _tnsMain *T;
  21. extern const char* LA_UDF_EXTENSION_STRINGS[];
  22. int laget_InstanceModified(void* instance);
  23. void laget_TimeString(laTimeInfo *ti, char *result, char** resultdirect);
  24. void laui_DefaultPropDetails(laUiList *uil, laPropPack *This, laPropPack *Extra, laColumn *UNUSED, int context){
  25. laColumn *c;
  26. laUiItem *b;
  27. c = laFirstColumn(uil);
  28. laSafeString* s=0;
  29. if(Extra&&Extra->EndInstance){ //button
  30. laGeneralUiExtraData* ex=Extra->EndInstance;
  31. laUiItem* ui=ex->ui;
  32. if(This&&This->LastPs&&This->EndInstance){
  33. laProp* p=This->LastPs->p; laPropContainer* pc=p->Container; void* inst=This->LastPs->UseInstance;
  34. char FullPath[256]={0}; la_GetPropPackFullPath(This, FullPath);
  35. strSafePrint(&s,"%s", FullPath); if(ui->ExtraInstructions){ strSafePrint(&s,"(%s)", ui->ExtraInstructions->Ptr); }
  36. laShowLabel(uil,c,p->Description,0,0)->Flags|=LA_TEXT_LINE_WRAP;
  37. laShowLabel(uil,c,s->Ptr,0,0)->Flags|=LA_TEXT_MONO|LA_UI_FLAGS_DISABLED;
  38. }else{
  39. laShowLabel(uil,c,ui->AT->Description,0,0)->Flags|=LA_TEXT_LINE_WRAP;
  40. strSafePrint(&s,"%s", ui->AT->Identifier); if(ui->ExtraInstructions){ strSafePrint(&s,"(%s)", ui->ExtraInstructions->Ptr); }
  41. laShowLabel(uil,c,s->Ptr,0,0)->Flags|=LA_TEXT_MONO|LA_UI_FLAGS_DISABLED;
  42. }
  43. }else{
  44. if(!This || !This->LastPs){ laShowLabel(uil,c,"Can't access property details.",0,0); return; }
  45. char FullPath[256]={0}; la_GetPropPackFullPath(This, FullPath);
  46. laProp* p=This->LastPs->p; laPropContainer* pc=p->Container; void* inst=This->LastPs->UseInstance;
  47. laShowLabel(uil,c,p->Description,0,0)->Flags|=LA_TEXT_LINE_WRAP;
  48. if(p->PropertyType==(LA_PROP_ENUM)||(LA_PROP_ARRAY|LA_PROP_ENUM)){
  49. laEnumItem* ei=laGetEnumArrayIndexed(This,This->LastIndex);
  50. if(ei){ strSafeSet(&s,0);strSafePrint(&s,"Current: %s", ei->Description);laShowLabel(uil,c,s->Ptr,0,0)->Flags|=LA_UI_FLAGS_HIGHLIGHT|LA_TEXT_LINE_WRAP; }
  51. }
  52. laShowLabel(uil,c,FullPath,0,0)->Flags|=LA_TEXT_MONO|LA_UI_FLAGS_DISABLED;
  53. if(inst && !pc->OtherAlloc){
  54. laShowSeparator(uil,c); strSafeSet(&s,0); strSafePrint(&s,"[ %s ]", pc->Name?pc->Name:pc->Identifier, inst);
  55. int Level=0; laMemNodeHyper* m=memGetHead(inst,&Level);
  56. laListHandle* users=memGetUserList(inst);
  57. if(users){ strSafePrint(&s," %d Users", lstCountElements(users)); }
  58. laShowLabel(uil,c,s->Ptr,0,0)->Flags|=LA_TEXT_MONO;
  59. if(Level==2){
  60. strSafeSet(&s,0);strSafePrint(&s, m->NUID.String);
  61. if(laget_InstanceModified(inst)){ strSafePrint(&s, " 🌑 Modified"); }else{ strSafePrint(&s, " Clean"); }
  62. laShowLabel(uil,c,s->Ptr,0,0)->Flags|=LA_TEXT_MONO;
  63. laget_TimeString(&m->TimeCreated, FullPath, 0);
  64. strSafeSet(&s,0); strSafePrint(&s, "Created at %s", FullPath);
  65. laShowLabel(uil,c,s->Ptr,0,0)->Flags|=LA_TEXT_MONO;
  66. }
  67. if(m){
  68. if(Level==2){
  69. laShowSeparator(uil,c);
  70. if(m->FromFile){
  71. //strSafeSet(&s,0); strSafePrint(&s,"File:\n%s", m->FromFile->BaseName);
  72. //laShowLabel(uil,c,s->Ptr,0,0);
  73. char safepath[256]; strEscapePath(safepath, m->FromFile->BaseName->Ptr);
  74. strSafeSet(&s,0); strSafePrint(&s,"la.managed_udfs@basename=%s.__self", safepath);
  75. laShowItemFull(uil,c,0,s->Ptr,0,0,laui_ManagedUDFItem,0)->Flags|=LA_UI_FLAGS_NO_GAP|LA_UI_FLAGS_NO_DECAL;
  76. }else{
  77. laShowLabel(uil,c,"<Not saved yet>",0,0)->Flags|=LA_UI_FLAGS_DISABLED;
  78. }
  79. }
  80. }
  81. }
  82. }
  83. strSafeDestroy(&s);
  84. }
  85. void laui_DefaultNodeOperationsPropUiDefine(laUiList *uil, laPropPack *This, laPropPack *OperatorProps, laColumn *UNUSED, int context){
  86. laColumn *c = laFirstColumn(uil); laColumn* cl,*cr; laSplitColumn(uil,c,0.5); cl=laLeftColumn(c,0);cr=laRightColumn(c,0);
  87. laShowItemFull(uil, c, This, "base.name",LA_WIDGET_STRING_PLAIN,0,0,0);
  88. laShowItemFull(uil, cl, This, "base.move",0,"direction=left;text=Move Left;icon=🡰;",0,0);
  89. laShowItemFull(uil, cr, This, "base.move",0,"text=Move Right;icon=🡲;",0,0);
  90. laShowItemFull(uil, c, This, "base.delete",0,0,0,0);
  91. }
  92. void laui_DefaultPropUiDefine(laUiList *uil, laPropPack *This, laPropPack *OperatorProps, laColumn *UNUSED, int context){
  93. laColumn *c;
  94. laProp *p, *gp;
  95. if (OperatorProps && OperatorProps->LastPs){
  96. c = laFirstColumn(uil); gp = OperatorProps->LastPs->p;
  97. for (p = gp->SubProp->Props.pFirst; p; p = p->Item.pNext){
  98. if(p->PropertyType!=LA_PROP_OPERATOR) continue;
  99. laShowItem(uil, c, OperatorProps, p->Identifier);
  100. }
  101. }
  102. if (!This || !This->LastPs) return;
  103. c = laFirstColumn(uil); gp = This->LastPs->p;
  104. for (p = gp->SubProp->Props.pFirst; p; p = p->Item.pNext){
  105. //la_ShowGeneralPropItem(uil, c, This, gp, p, 0, 0, 0);
  106. laShowItem(uil, c, This, p->Identifier);
  107. }
  108. }
  109. void laui_StringPropUiDefine(laUiList *uil, laPropPack *This, laPropPack *Extra, laColumn *UNUSED, int context){
  110. laColumn *c;
  111. laProp *p, *gp;
  112. if (!This || !This->LastPs) return;
  113. c = laFirstColumn(uil);
  114. gp = This->LastPs->p;
  115. if(Extra){
  116. laShowItem(uil, c, Extra, "copy_selection");
  117. }else{
  118. laShowItem(uil, c, This, "copy");
  119. }
  120. laShowItem(uil, c, This, "paste");
  121. laShowItem(uil, c, This, "restore");
  122. if(gp->Tag&LA_PROP_IS_FILE){ laShowItem(uil, c, This, "get_file_path"); }
  123. if(gp->Tag&LA_PROP_IS_FOLDER){ laShowItem(uil, c, This, "get_folder_path"); }
  124. }
  125. void laui_IdentifierOnly(laUiList *uil, laPropPack *This, laPropPack *OP_UNUSED, laColumn *Extra, int context){
  126. laColumn *col = Extra, *c, *cl, *cr, *crl, *crr, *cll, *clr, *clrl, *clrr, *clrrl, *clrrr;
  127. laUiItem *ui;
  128. c = laFirstColumn(uil);
  129. laShowItemFull(uil, c, This, "identifier", LA_WIDGET_STRING_PLAIN,0, 0, 0);
  130. }
  131. void laRebuildPathRecursive(laProp *p, char *buf){
  132. if (p->Container){
  133. laRebuildPathRecursive(p->Container, buf);
  134. sprintf(buf, ".%s", p->Identifier);
  135. }else
  136. sprintf(buf, "%s", p->Identifier);
  137. }
  138. void laui_IntPropInfo(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *ExtraColumns, int context){
  139. laColumn *col, *cl, *cr;
  140. laUiItem *b1,*b2;
  141. laUiList *tuil;
  142. col = laFirstColumn(uil);
  143. laSplitColumn(uil, col, 0.2);
  144. cl = laLeftColumn(col, 1);
  145. cr = laRightColumn(col, 0);
  146. laShowItemFull(uil, cr, Base, "base.identifier", LA_WIDGET_STRING_PLAIN,0, 0, 0);
  147. b1= laOnConditionToggle(uil, cl, 0,0,0,0,0);{
  148. for(laProp* p=MAIN.ContainerInt->Props.pFirst;p;p=p->Item.pNext){
  149. laShowItem(uil,cr,Base,p->Identifier);
  150. }
  151. }laEndCondition(uil,b1);
  152. }
  153. void laui_FloatPropInfo(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *ExtraColumns, int context){
  154. laColumn *col, *cl, *cr;
  155. laUiItem *b1,*b2;
  156. laUiList *tuil;
  157. col = laFirstColumn(uil);
  158. laSplitColumn(uil, col, 0.2);
  159. cl = laLeftColumn(col, 1);
  160. cr = laRightColumn(col, 0);
  161. laShowItemFull(uil, cr, Base, "base.identifier", LA_WIDGET_STRING_PLAIN,0, 0, 0);
  162. b1= laOnConditionToggle(uil, cl, 0,0,0,0,0);{
  163. for(laProp* p=MAIN.ContainerFloat->Props.pFirst;p;p=p->Item.pNext){
  164. laShowItem(uil,cr,Base,p->Identifier);
  165. }
  166. }laEndCondition(uil,b1);
  167. }
  168. void laui_SubPropInfoDefault(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context){
  169. laColumn *c, *cl, *cr, *cll, *clr, *crl, *crr, *crrl, *crrr;
  170. laUiItem *bracket, *b1, *b2;
  171. laPropContainer *pc;
  172. laProp *p;
  173. char buf[LA_RAW_CSTR_MAX_LEN]={0};
  174. c = laFirstColumn(uil);
  175. laSplitColumn(uil, c, 0.2); cl = laLeftColumn(c, 1); cr = laRightColumn(c, 0);
  176. laSplitColumn(uil, cr, 0.5); crrl = laLeftColumn(cr, 1*6); crrr = laRightColumn(cr, 0);
  177. laPropContainer* subc=Base->LastPs->p->SubProp;
  178. if (!((laSubProp*)Base->LastPs->p)->GetType){
  179. if (!subc) subc = la_ContainerLookup(((laSubProp *)Base->LastPs->p)->TargetID);
  180. if (!subc) return; Base->LastPs->p->SubProp=subc;
  181. }else{
  182. subc=((laSubProp*)Base->LastPs->p)->GetType(Base->EndInstance);
  183. }
  184. if (!Base->LastPs->p->UDFIsRefer && !Base->LastPs->p->UDFNoCreate && !Base->LastPs->p->UDFIsSingle){
  185. laShowItem(uil, cr, Base, "identifier")->Flags|=LA_UI_FLAGS_PLAIN;
  186. bracket = laOnConditionToggle(uil, cl, 0, 0, 0, 0, 0);
  187. }
  188. for (p = subc->Props.pFirst; p; p = p->Item.pNext){
  189. if (!(p->PropertyType & LA_PROP_SUB)){
  190. buf[0] = 0;
  191. sprintf(buf, "la.prop_containers#%s.properties#%s.name", p->Container->Identifier, p->Identifier);
  192. laShowItemFull(uil, crrl, 0, buf, LA_WIDGET_STRING_PLAIN,0, 0, 0);
  193. laShowItem(uil, crrr, Base, p->Identifier);
  194. //buf[0] = 0; sprintf(buf, "la.prop_containers#%s.properties#%s.name", p->Container->Identifier, p->Identifier); laShowItemFull(uil, crl, 0, buf, 0, laui_SubPropInfoDefault, 0);
  195. //buf[0] = 0; sprintf(buf, "la.prop_containers#%s.properties#%s.description", p->Container->Identifier, p->Identifier); laShowItemFull(uil, crr, 0, buf, 0, laui_SubPropInfoDefault, 0);
  196. laShowSeparator(uil, c);
  197. }else{
  198. //buf[0] = 0; sprintf(buf, "la.prop_containers#%s.properties#%s.name", p->Container->Identifier, p->Identifier); laShowItemFull(uil, crrl, 0, buf, LA_WIDGET_STRING_PLAIN, 0, 0);
  199. //buf[0] = 0; sprintf(buf, "la.prop_containers#%s.properties#%s.name", p->Container->Identifier, p->Identifier); laShowItemFull(uil, crl, 0, buf, 0, laui_SubPropInfoDefault, 0);
  200. //buf[0] = 0; sprintf(buf, "la.prop_containers#%s.properties#%s.description", p->Container->Identifier, p->Identifier); laShowItemFull(uil, crr, 0, buf, 0, laui_SubPropInfoDefault, 0);
  201. if (p->UDFIsRefer) laShowLabel(uil, crrr, "🠞", 0, 0);
  202. elif (p->UDFNoCreate) laShowLabel(uil, crrr, "n", 0, 0);
  203. else laShowLabel(uil, crrr, "🗇", 0, 0);
  204. buf[0] = 0;
  205. sprintf(buf, "la.prop_containers#%s.icon_id", ((laSubProp *)p)->TargetID);
  206. laShowIcon(uil, cl, 0, buf, 0);
  207. b1 = laOnConditionToggle(uil, crrl, 0, 0, 0, 0, 0);{ b1->Flags|=LA_TEXT_ALIGN_LEFT;
  208. sprintf(buf, "text=...%s;", p->Name);
  209. strSafeSet(&b1->ExtraInstructions, buf);
  210. laUiDefineFunc f=laui_SubPropInfoDefault;
  211. //if(!context) f=((laSubProp*)p)->GetType?0:(p->UiDefine?p->UiDefine:(p->SubProp&&p->SubProp->UiDefine?p->SubProp->UiDefine:laui_SubPropInfoDefault));
  212. laShowItemFull(uil, cr, Base, p->Identifier, 0,0, f, context);
  213. }
  214. laEndCondition(uil, b1);
  215. laShowSeparator(uil, c);
  216. }
  217. }
  218. if (!Base->LastPs->p->UDFIsRefer && !Base->LastPs->p->UDFNoCreate && !Base->LastPs->p->UDFIsSingle){
  219. laEndCondition(uil, bracket);
  220. }
  221. //laShowItemFull(uil, crl, Base, "identifier", 0, 0, 0);
  222. //p = Base->LastPs->p->SubProp->Props.pFirst;
  223. }
  224. void laui_SubPropSelection(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context){
  225. laColumn *c, *cl, *cr, *cll, *clr, *crl, *crr, *crrl, *crrr;
  226. laUiItem *bracket, *b1, *b2;
  227. laPropContainer *pc;
  228. laProp *p;
  229. laPropPack *pp;
  230. char buf[LA_RAW_CSTR_MAX_LEN]={0};
  231. c = laFirstColumn(uil);
  232. laSplitColumn(uil, c, 0.2);
  233. cl = laLeftColumn(c, 1);
  234. cr = laRightColumn(c, 0);
  235. laSplitColumn(uil, cr, 0.8);
  236. crl = laLeftColumn(cr, 0);
  237. crr = laRightColumn(cr, 100);
  238. laSplitColumn(uil, crl, 0.5);
  239. crrl = laLeftColumn(crl, 150);
  240. crrr = laRightColumn(crl, 0);
  241. if (!Base->LastPs->p->SubProp) Base->LastPs->p->SubProp = la_ContainerLookup(((laSubProp *)Base->LastPs->p)->TargetID);
  242. if (!Base->LastPs->p->UDFIsRefer){
  243. laShowItemFull(uil, cr, Base, "identifier", LA_WIDGET_STRING_PLAIN,0, 0, 0);
  244. bracket = laOnConditionToggle(uil, cl, 0, 0, 0, 0, 0);
  245. }
  246. for (p = Base->LastPs->p->SubProp->Props.pFirst; p; p = p->Item.pNext){
  247. if (p->PropertyType == LA_PROP_SUB){
  248. //buf[0] = 0; sprintf(buf, "la.prop_containers#%s.properties#%s.name", p->Container->Identifier, p->Identifier);
  249. //laShowItemFull(uil, crrl, 0, buf, LA_WIDGET_STRING_PLAIN, 0, 0);
  250. buf[0] = 0;
  251. sprintf(buf, "identifier=%s;", p->Identifier);
  252. laShowItemFull(uil, crrr, Base, "put_data_block", 0, buf, 0, 0);
  253. //laShowLabel(uil, crr, "PUT", 0, 0);
  254. b1 = laOnConditionToggle(uil, crrl, 0, 0, 0, 0, 0);{
  255. buf[0] = 0; sprintf(buf, "text=...%s;", p->Name); strSafeSet(&b1->ExtraInstructions, buf);
  256. laShowItemFull(uil, cr, Base, p->Identifier, 0,0, laui_SubPropSelection, 0)->Flags|=LA_TEXT_ALIGN_LEFT;
  257. }
  258. laEndCondition(uil, b1);
  259. laShowSeparator(uil, c);
  260. }
  261. }
  262. if (!Base->LastPs->p->UDFIsRefer){
  263. laEndCondition(uil, bracket);
  264. }
  265. //laShowItemFull(uil, crl, Base, "identifier", 0, 0, 0);
  266. //p = Base->LastPs->p->SubProp->Props.pFirst;
  267. }
  268. void laui_LinkerSelectionProp(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context){
  269. laColumn *c, *cl, *cr, *cll, *clr, *crl, *crr, *crrl, *crrr;
  270. laUiItem *bracket, *b1, *b2;
  271. laPropContainer *pc;
  272. laProp *p;
  273. laPropPack *pp;
  274. char buf[LA_RAW_CSTR_MAX_LEN]={0};
  275. c = laFirstColumn(uil);
  276. laSplitColumn(uil, c, 0.4);
  277. cl = laLeftColumn(c, 1);
  278. cr = laRightColumn(c, 0);
  279. b1=laBeginRow(uil,cr,0,0);
  280. laShowItemFull(uil, cr, Base, "identifier", LA_WIDGET_STRING_PLAIN,0, 0, 0);
  281. laShowIcon(uil, cr, Base, "pp.last_ps.property.sub_icon_id", 0);
  282. laEndRow(uil,b1);
  283. bracket = laOnConditionToggle(uil, cl, 0, 0, 0, 0, 0);{
  284. laShowItemFull(uil, cr, Base, "instances", 0,0, laui_LinkerSelectionInstance, 0);
  285. }
  286. bracket->State=LA_BT_ACTIVE;
  287. laEndCondition(uil, bracket);
  288. }
  289. void laui_LinkerSelectionInstance(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context){
  290. laColumn *c, *cl, *cr, *cll, *clr, *crl, *crr, *crrl, *crrr;
  291. laUiItem *bracket, *b1, *b2;
  292. laPropContainer *pc;
  293. laProp *p;
  294. laPropPack *pp;
  295. char buf[LA_RAW_CSTR_MAX_LEN]={0};
  296. c = laFirstColumn(uil);
  297. laSplitColumn(uil, c, 0.4);
  298. cl = laLeftColumn(c, 1);
  299. cr = laRightColumn(c, 0);
  300. laShowItemFull(uil, cr, Base, "identifier", LA_WIDGET_STRING_PLAIN,0, 0, 0);
  301. b1 = laOnConditionToggle(uil, cl, 0, 0, 0, 0, 0);{
  302. laShowItemFull(uil, cr, Base, "children", 0,0, laui_LinkerSelectionProp, 0);
  303. }
  304. laEndCondition(uil, b1);
  305. }
  306. void laui_DefaultPanelTitleBar(laUiList *uil, laPropPack *Base, laPropPack *Extra, laUiDefineFunc header){
  307. laColumn *c, *cl, *cr, *cll, *clr, *crl, *crr, *cb1, *cb2, *cb3;
  308. laUiItem *bracket, *b1, *b2;
  309. c = laFirstColumn(uil);
  310. laSplitColumn(uil, c, 0.3);
  311. cl = laLeftColumn(c, 1);
  312. cr = laRightColumn(c, 0);
  313. b1=laBeginRow(uil,cr,0,0);
  314. laUiItem* tu=laShowItemFull(uil, cr, Base, "title", LA_WIDGET_STRING_PLAIN,0, 0, 0);tu->Expand=1;tu->Flags|=LA_UI_FLAGS_NO_TOOLTIP;
  315. laShowItem(uil, cr, Base, "hide")->Flags|=LA_UI_FLAGS_ICON;
  316. laShowItem(uil, cr, Base, "dock")->Flags|=LA_UI_FLAGS_ICON;
  317. laShowItem(uil, cr, Base, "close")->Flags|=LA_UI_FLAGS_ICON;
  318. laEndRow(uil,b1);
  319. bracket = laOnConditionToggle(uil, cl, 0, 0, 0, 0, 0);{
  320. if(!Extra->LastPs->p->SubProp->Props.pFirst){
  321. laShowLabel(uil, cr, "Panel doesn't have configurable property.", 0, 0);
  322. }else{
  323. if(header){
  324. laShowLabel(uil, cr, "Panel properties:", 0, 0);
  325. header(uil, Base, Extra, cr, 0);
  326. }else{
  327. for(laProp* p = Extra->LastPs->p->SubProp->Props.pFirst;p;p=p->Item.pNext){
  328. laShowItem(uil, cr, Extra, p->Identifier);
  329. }
  330. }
  331. }
  332. //laShowItem(uil, cr, 0,"la.example_int");
  333. laShowSeparator(uil, c);
  334. //laShowLabel(uil, c, "Position:", 0, 0);
  335. //laShowItemFull(uil, c, Base, "position", LA_WIDGET_INT, 0, 0);
  336. //laShowLabel(uil, c, "Size:", 0, 0);
  337. //laShowItemFull(uil, c, Base, "size", LA_WIDGET_INT, 0, 0);
  338. //laShowLabel(uil, c, "Snapping:", 0, 0);
  339. //laShowItem(uil, c, Base, "snap_enable")->Flags=LA_UI_FLAGS_CYCLE|LA_UI_FLAGS_TRANSPOSE;
  340. //laShowItemFull(uil, c, Base, "snap", LA_WIDGET_INT, 0, 0);
  341. }
  342. laEndCondition(uil, bracket);
  343. }
  344. void laui_DefaultOperatorPanelTitleBar(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context){
  345. laColumn *c, *cl, *cr, *cll, *clr, *crl, *crr;
  346. laUiItem *bracket, *b1, *b2;
  347. c = laFirstColumn(uil);
  348. b1 = laBeginRow(uil,c,0,0);
  349. laUiItem* tu=laShowItemFull(uil, c, Base, "title", LA_WIDGET_STRING_PLAIN,0, 0, 0);tu->Expand=1;tu->Flags|=LA_UI_FLAGS_NO_TOOLTIP;
  350. laShowItem(uil, c, 0, "LA_cancel");//->Flags|=LA_UI_FLAGS_ICON;
  351. laEndRow(uil, b1);
  352. }
  353. void laui_ColumnItem(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *UNUSED_Colums, int context){
  354. laColumn *c0, *c, *cl, *cr, *cll, *clr, *crl, *crr, *clll, *cllr, *cll2, *clr2;
  355. laUiItem *bracket, *b1, *b2;
  356. c0 = laFirstColumn(uil);
  357. laSplitColumn(uil, c0, 0.8);
  358. cll = laLeftColumn(c0, 80);
  359. c = laRightColumn(c0, 0);
  360. laSplitColumn(uil, c, 0.7);
  361. cl = laLeftColumn(c, 0);
  362. cr = laRightColumn(c, 200);
  363. laSplitColumn(uil, cr, 0.5);
  364. crl = laLeftColumn(cr, 0);
  365. crr = laRightColumn(cr, 70);
  366. laSplitColumn(uil, cll, 0.5);
  367. clll = laLeftColumn(cll, 1);
  368. cllr = laRightColumn(cll, 0);
  369. laSplitColumn(uil, cl, 0.5);
  370. cll2 = laLeftColumn(cl, 0);
  371. clr2 = laRightColumn(cl, 70);
  372. //laShowItem(uil, c, Base, "self");
  373. bracket = laOnConditionThat(uil, crr, laPropExpression(0, "live_editor.current_ui")); // laOnConditionThat(uil, 0, "live_editor", la_LiveEditAllowShow);
  374. laShowItemFull(uil, cll, Base, "select_column", 0, "text=Select;", 0, 0);
  375. laEndCondition(uil, bracket);
  376. bracket = laOnConditionThat(uil, c, laPropExpression(Base, "sub_left"));{ //laOnConditionThat(uil, Base, 0, laui_SnapButtonShow); {
  377. laShowItem(uil, cll2, Base, "split_at");
  378. laShowItemFull(uil, clr2, Base, "merge_column", 0, "text=Merge;", 0, 0);
  379. b1 = laOnConditionThat(uil, c, laPropExpression(Base, "snap_state"));{
  380. laShowItem(uil, crl, Base, "snap_width");
  381. }
  382. laElse(uil, b1);{
  383. laShowLabel(uil, crl, "Align:", 0, 0)->Flags|=LA_TEXT_ALIGN_RIGHT;
  384. }
  385. laEndCondition(uil, b1);
  386. laShowItem(uil, crr, Base, "snap_state");
  387. laShowSeparator(uil, c0);
  388. b1 = laOnConditionToggle(uil, clll, 0, 0, 0, 0, 0);{
  389. laShowItemFull(uil, c, Base, "sub_left", LA_WIDGET_COLLECTION_SINGLE,0, laui_ColumnItem, 0);
  390. }
  391. laElse(uil, b1);{
  392. laShowLabel(uil, cllr, "Left", 0, 0);
  393. }
  394. laEndCondition(uil, b1);
  395. laShowSeparator(uil, c0);
  396. b1 = laOnConditionToggle(uil, clll, 0, 0, 0, 0, 0);{
  397. laShowItemFull(uil, c, Base, "sub_right", LA_WIDGET_COLLECTION_SINGLE,0, laui_ColumnItem, 0);
  398. }
  399. laElse(uil, b1);{
  400. laShowLabel(uil, cllr, "Right", 0, 0);
  401. }
  402. laEndCondition(uil, b1);
  403. }
  404. laElse(uil, bracket);{
  405. laShowItem(uil, c, Base, "split_column");
  406. }
  407. laEndCondition(uil, bracket);
  408. }
  409. void laui_DefaultMenuButtonsFileEntries(laUiList *uil, laPropPack *pp, laPropPack *actinst, laColumn *extracol, int context){
  410. laColumn* c=laFirstColumn(uil);
  411. laShowLabel(uil, c, "Function Test", 0, 0)->Flags|=LA_TEXT_MONO|LA_UI_FLAGS_DISABLED;
  412. laShowItem(uil, c, 0, "LA_pure_yes_no");
  413. laShowItem(uil, c, 0, "LA_file_dialog");
  414. laShowItem(uil, c, 0, "LA_udf_read");
  415. laShowItemFull(uil, c, 0, "LA_udf_read",0,"mode=append;text=Append",0,0);
  416. laShowItem(uil, c, 0, "LA_managed_save");
  417. laShowItem(uil, c, 0, "LA_manage_udf");
  418. laShowLabel(uil, c, "Other Entries", 0, 0)->Flags|=LA_TEXT_MONO|LA_UI_FLAGS_DISABLED;
  419. laShowItem(uil, c, 0, "LA_terminate_program");
  420. }
  421. void laui_DefaultMenuButtonsEditEntries(laUiList *uil, laPropPack *pp, laPropPack *actinst, laColumn *extracol, int context){
  422. laColumn* c=laFirstColumn(uil);
  423. laShowLabel(uil, c, "History", 0, 0)->Flags|=LA_TEXT_MONO|LA_UI_FLAGS_DISABLED;
  424. laShowItem(uil, c, 0, "LA_undo")->Flags|=LA_UI_FLAGS_NO_CONFIRM;
  425. laShowItem(uil, c, 0, "LA_redo")->Flags|=LA_UI_FLAGS_NO_CONFIRM;
  426. laShowSeparator(uil,c);
  427. laShowItemFull(uil, c, 0, "LA_panel_activator",0,"panel_id=LAUI_histories;text=Histories",0,0);
  428. }
  429. void laui_DefaultMenuButtonsOptionEntries(laUiList *uil, laPropPack *pp, laPropPack *actinst, laColumn *extracol, int context){
  430. laColumn* c=laFirstColumn(uil);
  431. laShowLabel(uil, c, "Settings", 0, 0)->Flags|=LA_TEXT_MONO|LA_UI_FLAGS_DISABLED;
  432. laShowItemFull(uil, c, 0, "LA_panel_activator", 0, "panel_id=LAUI_user_preferences;", 0, 0);
  433. laShowLabel(uil, c, "Information", 0, 0)->Flags|=LA_TEXT_MONO|LA_UI_FLAGS_DISABLED;
  434. laShowItemFull(uil, c, 0, "LA_panel_activator", 0, "panel_id=LAUI_about;text=About;", 0, 0);
  435. }
  436. void laui_DefaultMenuButtons(laUiList *uil, laPropPack *pp, laPropPack *actinst, laColumn *extracol, int context){
  437. laUiList *muil; laColumn *mc,*c = laFirstColumn(uil);
  438. muil = laMakeMenuPage(uil, c, "File");{
  439. mc = laFirstColumn(muil); laui_DefaultMenuButtonsFileEntries(muil,pp,actinst,extracol,0);
  440. }
  441. muil = laMakeMenuPage(uil, c, "Edit");{
  442. mc = laFirstColumn(muil); laui_DefaultMenuButtonsEditEntries(muil,pp,actinst,extracol,0);
  443. }
  444. muil = laMakeMenuPage(uil, c, "Options"); {
  445. mc = laFirstColumn(muil); laui_DefaultMenuButtonsOptionEntries(muil,pp,actinst,extracol,0);
  446. }
  447. }
  448. void laui_DefaultMenuExtras(laUiList *uil, laPropPack *pp, laPropPack *actinst, laColumn *extracol, int context){
  449. laColumn *c = laFirstColumn(uil);
  450. laShowLabel(uil, c, MAIN.MenuProgramName, 0, 0)->Expand=1;
  451. }
  452. void laui_DefaultMenuBarActual(laUiList *uil, laPropPack *pp, laPropPack *actinst, laColumn *extracol, int context){
  453. laUiList *muil;
  454. laColumn *c,*mc;
  455. laUiItem* bb;
  456. c = laFirstColumn(uil);
  457. laUiItem* row=laBeginRow(uil,c,0,0);
  458. bb=laOnConditionThat(uil,c,laPropExpression(0,"la.windows.operator_hints"));{
  459. laShowItem(uil,c,0,"la.windows.operator_hints");
  460. }laElse(uil,bb);{
  461. laShowItem(uil, c, 0, "LA_new_panel")->Flags=LA_UI_FLAGS_ICON;
  462. if(MAIN.MenuButtons){ MAIN.MenuButtons(uil,0,0,0,0); }
  463. laShowSeparator(uil,c);
  464. laUiItem* mui=laOnConditionThat(uil,c,laPropExpression(0,"la.windows.maximized_ui"));{
  465. laShowItemFull(uil,c,0,"LA_canvas_ui_maximize", 0, "icon=🡰;restore=true;text=Restore Layout", 0, 0);
  466. }laElse(uil,mui);{
  467. laUiItem* ui=laOnConditionThat(uil,c,laPropExpression(0,"la.windows.maximized_block"));{
  468. laShowItemFull(uil,c,0,"LA_block_maximize", 0, "icon=🡰;restore=true;text=Restore Layout", 0, 0);
  469. }laElse(uil,ui);{
  470. laShowItemFull(uil, c, 0, "LA_switch_layout", 0, "icon=🞐;show_list=true;", 0, 0)->Flags|=LA_UI_FLAGS_ICON;
  471. laShowItemFull(uil,c,0,"LA_switch_layout", 0, "icon=🡰;reverse=true;", 0, 0)->Flags|=LA_UI_FLAGS_ICON;
  472. laShowItemFull(uil,c,0,"LA_switch_layout", 0, "icon=🡲;", 0,0)->Flags|=LA_UI_FLAGS_ICON;
  473. laShowItem(uil, c, 0, "la.windows.layouts.identifier");
  474. laShowItem(uil,c,0,"LA_new_window")->Flags|=LA_UI_FLAGS_ICON;
  475. }laEndCondition(uil, ui);
  476. }laEndCondition(uil,mui);
  477. laShowSeparator(uil,c);
  478. laShowItem(uil,c,0,"la.windows.output_color_space");
  479. laShowItemFull(uil,c,0,"la.windows.output_show_overflow",0,"text=🟩;",0,0);
  480. if(MAIN.MenuExtras){ laShowSeparator(uil,c); MAIN.MenuExtras(uil,0,0,0,0); }
  481. laUiItem* b1=laOnConditionThat(uil,c,laPropExpression(0,"la.windows.panels_hidden"));
  482. laShowSeparator(uil,c);
  483. muil = laMakeMenuPage(uil, c, "🡻 Minimized");{
  484. mc = laFirstColumn(muil);
  485. laShowItemFull(muil, mc, 0, "la.windows.panels_hidden", 0,0, laui_IdentifierOnly,0);
  486. }
  487. laEndCondition(uil, b1);
  488. b1=laOnConditionThat(uil,c,laPropExpression(0,"la.windows.is_fullscreen"));{
  489. laShowItemFull(uil,c,0,"LA_fullscreen",0,"restore=true;text=Restore;icon=🡷",0,0)->Flags|=LA_UI_FLAGS_EXIT_WHEN_TRIGGERED;
  490. }laElse(uil,b1);{
  491. laShowItemFull(uil,c,0,"LA_fullscreen",0,0,0,0)->Flags|=LA_UI_FLAGS_EXIT_WHEN_TRIGGERED;
  492. }laEndCondition(uil, b1);
  493. }laEndCondition(uil,bb);
  494. laEndRow(uil,row);
  495. }
  496. void laui_DefaultMenuBar(laWindow *w){
  497. laPanel *p;
  498. p =laCreateTopPanel(w, 0, 0, 0, 0, LA_RH, 0, 0, 0, 0, -1, -1, -1, 0);
  499. p->IsMenuPanel = 1;
  500. laui_DefaultMenuBarActual(&p->TitleBar, &p->PP, &p->PropLinkPP, 0, 0);
  501. }
  502. void laui_ThemeListItem(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *UNUSED_Colums, int context){
  503. laColumn *col, *cl, *cr;
  504. laUiItem *bracket;
  505. col = laFirstColumn(uil);
  506. bracket = laBeginRow(uil,col,0,0);
  507. laShowItemFull(uil, col, Base, "name", LA_WIDGET_STRING_PLAIN,0, 0, 0)->Expand=1;
  508. laShowItemFull(uil, col, Base, "author", LA_WIDGET_STRING_PLAIN,0, 0, 0);
  509. laEndRow(uil,bracket);
  510. }
  511. void laui_Theme(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *UNUSED_Colums, int context){
  512. laColumn *col, *cl, *cr, *cll, *clr;
  513. laUiItem *sui;
  514. laUiList *tuil;
  515. laUiItem *ui;
  516. //col = laFirstColumn(uil);
  517. //tuil = laMakeGroup(uil, col, "����ժҪ", 0, 0)->Page; {
  518. // col = laFirstColumn(tuil);
  519. // laSplitColumn(tuil, col, 0.7);
  520. // cl = laLeftColumn(col, 0);
  521. // cr = laRightColumn(col, 0);
  522. // laSplitColumn(tuil, cr, 0.6);
  523. // crl = laLeftColumn(cr, 0);
  524. // crr = laRightColumn(cr, 70);
  525. // laShowItemFull(tuil, cl, 0, "themes.name", 0, 0, 0);
  526. // laShowItemFull(tuil, crl, 0, "themes.author", 0, 0, 0);
  527. // laShowLabel(tuil, crr, 0, "EXEC", 0, 0, 0);
  528. //}
  529. col = laFirstColumn(uil); laSplitColumn(uil,col,0.5);
  530. cl=laLeftColumn(col,0);
  531. cr=laRightColumn(col,0);
  532. ui=laBeginRow(uil,col, 0,0);
  533. laShowItem(uil,col,Base, "name")->Expand=1;
  534. laShowItem(uil,col,Base, "delete");
  535. laEndRow(uil, ui);
  536. laShowLabel(uil, col, "Basics:",0,0);
  537. laShowLabel(uil, cl, "Base Color:",0,0)->Flags|=LA_TEXT_ALIGN_RIGHT; laShowItem(uil, cr, Base, "color");
  538. laShowLabel(uil, cl, "Accent Color:",0,0)->Flags|=LA_TEXT_ALIGN_RIGHT; laShowItem(uil, cr, Base, "accent_color");
  539. laShowItem(uil, cr, Base, "cursor_alpha");
  540. laShowItem(uil, cr, Base, "selection_alpha");
  541. laShowItem(uil, cr, Base, "inactive_mix");
  542. laShowItem(uil, cr, Base, "inactive_saturation");
  543. laShowLabel(uil, col, "Nodes:",0,0);
  544. laShowItem(uil, cr, Base, "wire_brightness");
  545. laShowItem(uil, cr, Base, "wire_saturation");
  546. laShowItem(uil, cr, Base, "wire_transparency");
  547. laShowLabel(uil, col, "Meshes:",0,0);
  548. laShowItem(uil, cl, Base, "edge_transparency");
  549. laShowItem(uil, cl, Base, "edge_brightness");
  550. laShowItem(uil, cr, Base, "vertex_transparency");
  551. laShowItem(uil, cr, Base, "vertex_brightness");
  552. laShowItem(uil, col, Base, "svertex_transparency");
  553. laShowItem(uil, col, Base, "sedge_transparency");
  554. laShowItem(uil, col, Base, "sface_transparency");
  555. laShowLabel(uil, col, "Widgets:",0,0);
  556. laShowItem(uil, col, Base, "boxed_themes")->Flags|=(LA_UI_FLAGS_NO_DECAL|LA_UI_FLAGS_NO_GAP);
  557. }
  558. void laui_BoxedThemeItem(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *UNUSED_Colums, int context){
  559. laColumn *col, *cl, *cr, *crl,*crr;
  560. laUiItem *bracket;
  561. laUiList *tuil;
  562. col = laFirstColumn(uil);
  563. laSplitColumn(uil, col, 0.8);
  564. cl = laLeftColumn(col, 1);
  565. cr = laRightColumn(col, 0);
  566. laSplitColumn(uil, cr, 0.5);
  567. crl = laLeftColumn(cr, 0);
  568. crr = laRightColumn(cr, 0);
  569. laShowItemFull(uil, cr, Base, "name", LA_WIDGET_STRING_PLAIN, 0 ,0,0);
  570. bracket = laOnConditionToggle(uil, cl, 0, 0, 0, 0, 0);{
  571. laShowItem(uil, cr, Base, "normal");
  572. laShowItem(uil, cr, Base, "active");
  573. laShowItem(uil, cr, Base, "border");
  574. laShowItem(uil, cr, Base, "text");
  575. laShowItem(uil, cr, Base, "text_active");
  576. laShowItem(uil, cr, Base, "alpha");
  577. laShowLabel(uil,crl,"Margins:",0,0);
  578. laShowItem(uil, crl, Base, "margins")->Flags=LA_UI_FLAGS_TRANSPOSE;
  579. laShowLabel(uil,crr,"Paddings:",0,0);
  580. laShowItem(uil, crr, Base, "paddings")->Flags=LA_UI_FLAGS_TRANSPOSE;
  581. }
  582. laEndCondition(uil, bracket);
  583. }
  584. void laui_PropertyContainerList(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *UNUSED_Colums, int context){
  585. laColumn *col, *cl, *cr, *crl, *crr, *cll, *clr, *crrl, *crrr;
  586. laUiItem *bracket;
  587. laUiList *tuil;
  588. col = laFirstColumn(uil);
  589. laSplitColumn(uil, col, 0.5);
  590. cl = laLeftColumn(col, 60);
  591. cr = laRightColumn(col, 0);
  592. laSplitColumn(uil, cr, 0.25);
  593. crl = laLeftColumn(cr, 0);
  594. crr = laRightColumn(cr, 0);
  595. laSplitColumn(uil, crr, 0.3);
  596. crrl = laLeftColumn(crr, 0);
  597. crrr = laRightColumn(crr, 0);
  598. laShowLabel(uil, cl, "Select", 0, 0);
  599. laShowLabel(uil, crl, "Identifier", 0, 0);
  600. laShowLabel(uil, crrl, "Name", 0, 0);
  601. laShowLabel(uil, crrr, "Description", 0, 0);
  602. laShowColumnAdjuster(uil, col);
  603. laShowItem(uil, col, Base, "properties");
  604. }
  605. void laui_WindowListItem(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *UNUSED_Colums, int context){
  606. laColumn *col, *cl, *cr, *cll, *clr;
  607. laUiItem *bracket;
  608. laUiList *tuil;
  609. cl = laFirstColumn(uil);
  610. laSplitColumn(uil, cl, 0.2);
  611. cll = laLeftColumn(cl, 1);
  612. clr = laRightColumn(cl, 0);
  613. laShowItem(uil, clr, Base, "title");
  614. bracket = laOnConditionToggle(uil, cll, 0, 0, 0, 0, 0);{
  615. laShowLabel(uil, clr, "Layouts", 0, 0);
  616. laShowItem(uil, clr, Base, "layouts");
  617. laShowLabel(uil, clr, "TopPanels", 0, 0);
  618. laShowItem(uil, clr, Base, "panels");
  619. }
  620. laEndCondition(uil, bracket);
  621. }
  622. void laui_LayoutListItem(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *UNUSED_Colums, int context){
  623. laColumn *col, *cl, *cr, *cll, *clr;
  624. laUiItem *bracket;
  625. laUiList *tuil;
  626. cl = laFirstColumn(uil);
  627. laSplitColumn(uil, cl, 0.2);
  628. cll = laLeftColumn(cl, 1);
  629. clr = laRightColumn(cl, 0);
  630. laShowItem(uil, clr, Base, "title");
  631. bracket = laOnConditionToggle(uil, cll, 0, 0, 0, 0, 0);{
  632. laShowItem(uil, clr, Base, "panels");
  633. }
  634. laEndCondition(uil, bracket);
  635. }
  636. void laui_PanelListItem(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *UNUSED_Colums, int context){
  637. laColumn *col, *cl, *cr, *cll, *clr;
  638. laUiItem *bracket;
  639. laUiList *tuil;
  640. cl = laFirstColumn(uil);
  641. laSplitColumn(uil, cl, 0.2);
  642. cll = laLeftColumn(cl, 1);
  643. clr = laRightColumn(cl, 0);
  644. laShowItem(uil, clr, Base, "title");
  645. bracket = laOnConditionToggle(uil, cll, 0, 0, 0, 0, 0);{
  646. laShowItemFull(uil, clr, Base, "size", LA_WIDGET_INT,0, 0, 0);
  647. }
  648. laEndCondition(uil, bracket);
  649. }
  650. void laui_UiTemplateListItemLiveEdit(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *UNUSED_Colums, int context){
  651. laColumn *col, *cl, *cr, *cll, *clr;
  652. laUiItem *bracket;
  653. laUiList *tuil;
  654. cl = laFirstColumn(uil);
  655. //bracket = laOnConditionThat(uil, cl, laNot(laPropExpression(Base, "for_panel"))); {
  656. bracket = laOnConditionThat(uil, cl, laAnd(laNot(laPropExpression(Base, "for_panel")), laOr(laNot(laPropExpression(Base, "target")), laEqual(laPropExpression(0, "live_editor.current_ui.prop_pack.last_ps.property.sub"), laPropExpression(Base, "target")))));{
  657. laShowItemFull(uil, cl, Base, "identifier", LA_WIDGET_STRING_PLAIN,0, 0, 0);
  658. }
  659. laElse(uil, bracket);{
  660. laShowItemFull(uil, cl, Base, "identifier", LA_WIDGET_STRING_PLAIN, "disabled=true;",0, 0);
  661. }
  662. laEndCondition(uil, bracket);
  663. }
  664. void laui_UiTemplateListItem(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *UNUSED_Colums, int context){
  665. laColumn *col, *cl, *cr, *cll, *clr, *clll, *cllr, *clrl, *clrr, *clrrl, *clrrr;
  666. laUiItem *bracket, *b1;
  667. laUiList *tuil;
  668. cl = laFirstColumn(uil);
  669. laSplitColumn(uil, cl, 0.2);
  670. cll = laLeftColumn(cl, LA_2RH);
  671. clr = laRightColumn(cl, 0);
  672. laSplitColumn(uil, cll, 0.5);
  673. clll = laLeftColumn(cll, 0);
  674. cllr = laRightColumn(cll, 0);
  675. laSplitColumn(uil, clr, 0.5);
  676. clrl = laLeftColumn(clr, 0);
  677. clrr = laRightColumn(clr, 200);
  678. laSplitColumn(uil, clrr, 0.2);
  679. clrrl = laLeftColumn(clrr, 1);
  680. clrrr = laRightColumn(clrr, 0);
  681. bracket = laOnConditionThat(uil, cll, laPropExpression(Base, "define_func"));{
  682. laShowLabel(uil, clll, "f", 0, 0);
  683. }
  684. laEndCondition(uil, bracket);
  685. bracket = laOnConditionThat(uil, cll, laPropExpression(Base, "descriptor"));{
  686. laShowLabel(uil, cllr, "🠞", 0, 0);
  687. }
  688. laEndCondition(uil, bracket);
  689. laShowItemFull(uil, clrl, Base, "identifier", LA_WIDGET_STRING_PLAIN,0, 0, 0);
  690. bracket = laOnConditionThat(uil, cll, laPropExpression(Base, "target_id"));{
  691. laShowIcon(uil, clrrl, Base, "target.icon_id", 0);
  692. laShowItemFull(uil, clrrr, Base, "target_id", LA_WIDGET_STRING_PLAIN,0, 0, 0);
  693. }
  694. laElse(uil, bracket);{
  695. b1 = laOnConditionThat(uil, cll, laPropExpression(Base, "for_panel"));{
  696. //laShowLabel(uil, clrrl, 0,, 0, 0);
  697. laShowLabel(uil, clrrr, "PANEL", 0, 0);
  698. }
  699. laElse(uil, b1);{
  700. laShowLabel(uil, clrrr, "-", 0, LA_WIDGET_STRING_PLAIN);
  701. }
  702. laEndCondition(uil, b1);
  703. }
  704. laEndCondition(uil, bracket);
  705. }
  706. void laui_PlainSceneListItem(laUiList *uil, laPropPack *This, laPropPack *OP_UNUSED, laColumn *Extra, int context){
  707. laColumn *col = Extra, *c, *cl, *cr, *crl, *crr, *cll, *clr, *clrl, *clrr, *clrrl, *clrrr;
  708. laUiItem *ui;
  709. //if (Extra)c = Extra;
  710. c = laFirstColumn(uil);
  711. laShowItemFull(uil, c, This, "name", LA_WIDGET_STRING_PLAIN, 0, 0, 0);
  712. }
  713. void laui_DataRestorePage(laUiList *uil, laPropPack *THIS_UNUSED, laPropPack *Operator, laColumn *UNUSED, int context){
  714. laColumn *col = laFirstColumn(uil), *c, *cl, *cr, *crl, *crr, *cll, *clr, *clrl, *clrr, *clrrl, *clrrr;
  715. laUiList *u;
  716. laUiItem *b;
  717. laShowItemFull(uil, col, 0, "la", 0, 0, laui_SubPropSelection, 0);
  718. laShowItemFull(uil, col, 0, "tns", 0, 0, laui_SubPropSelection, 0);
  719. }
  720. void laui_FileBrowserFileItem(laUiList *uil, laPropPack *This, laPropPack *OP_UNUSED, laColumn *Extra, int context){
  721. laColumn *c = Extra, *cl, *cr, *crl, *crr, *cll, *clr, *clrl, *clrr, *clrrl, *clrrr;
  722. laUiItem *ui;
  723. laSplitColumn(0, c, 0.1);
  724. cll = laLeftColumn(c, 1);
  725. clr = laRightColumn(c, 0);
  726. laSplitColumn(0, clr, 0.7);
  727. clrl = laLeftColumn(clr, 0);
  728. clrr = laRightColumn(clr, 0);
  729. laSplitColumn(0, clrr, 0.5);
  730. clrrl = laLeftColumn(clrr, 0);
  731. clrrr = laRightColumn(clrr, 0);
  732. laShowItemFull(uil, cll, This, "type", LA_WIDGET_ENUM_ICON_PLAIN, 0, 0, 0)->Flags|=LA_TEXT_ALIGN_RIGHT;
  733. //laShowItem(uil, cll, This, "is_folder");
  734. laShowItemFull(uil, clrl, This, "name", LA_WIDGET_STRING_PLAIN, 0, 0, 0);
  735. ui = laOnConditionThat(uil, clrr, laNot(laPropExpression(This, "is_folder")));{
  736. laShowItemFull(uil, clrrl, This, "time_modified.time_string", LA_WIDGET_STRING_PLAIN, 0, 0, 0);
  737. laShowItem(uil, clrrr, This, "size")->Flags|=LA_UI_FLAGS_NO_DECAL;
  738. }
  739. laEndCondition(uil, ui);
  740. //laShowSeparator(uil,cll)
  741. //laShowItemFull(uil, clrrl, This, "time_modified.time_string", LA_WIDGET_STRING_PLAIN, 0, 0);
  742. //laShowItem(uil, clrrr, This, "size");
  743. }
  744. void laui_FileBrowserDiskItem(laUiList *uil, laPropPack *This, laPropPack *OP_UNUSED, laColumn *Extra, int context){
  745. laColumn *col = Extra, *c, *cl, *cr, *crl, *crr;
  746. laUiItem *ui;
  747. c = Extra;
  748. laSplitColumn(0, c, 0.2);
  749. cl = laLeftColumn(c, LA_2RH);
  750. cr = laRightColumn(c, 0);
  751. laSplitColumn(0, cr, 0.5);
  752. crl = laLeftColumn(cr, 0);
  753. crr = laRightColumn(cr, 0);
  754. //laShowColumnAdjuster(uil, c);
  755. laShowItemFull(uil, cl, This, "id", LA_WIDGET_STRING_PLAIN, 0, 0, 0);
  756. laShowItem(uil, crl, This, "total_gb")->Flags |= LA_UI_FLAGS_NO_DECAL;
  757. laShowItem(uil, crr, This, "free_gb")->Flags |= LA_UI_FLAGS_NO_DECAL;
  758. }
  759. void laui_FileBrowserFileList(laUiList *uil, laPropPack *THIS_UNUSED, laPropPack *Operator, laColumn *UNUSED, int context){
  760. laColumn *col = laFirstColumn(uil), *c, *cl, *cr, *crl, *crr, *cll, *clr, *clrl, *clrr, *clrrl, *clrrr, *ulc;
  761. laUiList *u; laUiItem *b; laUiList *ul;
  762. laSplitColumn(uil, col, 0.25);
  763. cl = laLeftColumn(col, 10);
  764. cr = laRightColumn(col, 0);
  765. laShowItemFull(uil, cl, Operator, "folder_up", LA_WIDGET_BUTTON_NO_CONFIRM, 0 ,0,0);
  766. laShowItem(uil, cr, Operator, "path")->Expand=1;
  767. laUiItem* r=laBeginRow(uil,cr,0,0);
  768. laShowItem(uil, cr, Operator, "file_name")->Expand=1;
  769. laShowItem(uil, cr, Operator, "confirm")->Flags|=LA_UI_FLAGS_HIGHLIGHT|LA_UI_FLAGS_NO_CONFIRM;
  770. laEndRow(uil,r);
  771. laShowSeparator(uil,col);
  772. laUiItem* left=laMakeEmptyGroup(uil, cl, "left", 0); ul=left->Page; left->Flags|=LA_UI_FLAGS_NO_DECAL; ul->HeightCoeff=-1;
  773. ulc=laFirstColumn(ul);
  774. b=laOnConditionThat(ul,ulc,laPropExpression(Operator,"use_type"));{
  775. u = laMakeGroup(ul, ulc, "Use Format", 0)->Page; c = laFirstColumn(u);
  776. laShowItemFull(u,c,Operator,"available_extensions",0,0,laui_IdentifierOnly,0)->Flags|=LA_UI_FLAGS_NO_DECAL;
  777. }laEndCondition(ul,b);
  778. u = laMakeFoldableGroup(ul, ulc, "Bookmarks", 0, 0, 0)->Page; c = laFirstColumn(u);
  779. laShowItemFull(u,c,Operator,"bookmarks",0,0,laui_IdentifierOnly,0)->Flags|=LA_UI_FLAGS_NO_DECAL;
  780. u = laMakeGroup(ul, ulc, "Logic Drives", 0)->Page;
  781. c = laFirstColumn(u); laSplitColumn(u, c, 0.2); cll = laLeftColumn(c, LA_2RH); clr = laRightColumn(c, 0);
  782. laSplitColumn(u, clr, 0.5); clrl = laLeftColumn(clr, 0); clrr = laRightColumn(clr, 0);
  783. laShowColumnAdjuster(u, c);
  784. laShowItem(u, c, Operator, "disk_list");
  785. b = laMakeGroup(uil, cr, "File List", 0);b->State=LA_UI_ACTIVE; u=b->Page;
  786. u->HeightCoeff = -1;
  787. c = laFirstColumn(u); laSplitColumn(u, c, 0.1); cll = laLeftColumn(c, 1); clr = laRightColumn(c, 0);
  788. laSplitColumn(u, clr, 0.7); clrl = laLeftColumn(clr, 0); clrr = laRightColumn(clr, 0);
  789. laSplitColumn(u, clrr, 0.5); clrrl = laLeftColumn(clrr, 0); clrrr = laRightColumn(clrr, 0);
  790. laShowColumnAdjuster(u, c);
  791. laShowLabel(u, clrl, "File Name", 0, 0);
  792. laShowLabel(u, clrrl, "Last Modified On", 0, 0);
  793. laShowLabel(u, clrrr, "File Size", 0, 0);
  794. laShowItem(u, c, Operator, "file_list")->Flags|=LA_UI_FLAGS_NO_DECAL;
  795. }
  796. void laui_LinkerPanel(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context){
  797. laColumn *c, *cl, *cr, *cll, *clr, *crl, *crr, *crrl, *crrr, *gc;
  798. laUiList *gu;
  799. laUiItem *bracket, *b1, *b2;
  800. laPropContainer *pc;
  801. laProp *p;
  802. laPropPack *pp;
  803. char buf[LA_RAW_CSTR_MAX_LEN]={0};
  804. c = laFirstColumn(uil);
  805. laSplitColumn(uil, c, 0.2);
  806. cl = laLeftColumn(c, 100);
  807. cr = laRightColumn(c, 0);
  808. laSplitColumn(uil, cr, 0.2);
  809. crl = laLeftColumn(cr, 1);
  810. crr = laRightColumn(cr, 0);
  811. gu = laMakeGroup(uil, c, " UDF File Content", 0)->Page;{
  812. gc = laFirstColumn(gu);
  813. laShowItem(gu, gc, OperatorInst, "root_nodes");
  814. }
  815. }
  816. void laui_ManagedUDFItem(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context){
  817. laColumn *c=laFirstColumn(uil);
  818. laSplitColumn(uil,c,0.5);
  819. laColumn *cl=laLeftColumn(c, 1);
  820. laColumn *cr=laRightColumn(c,0);
  821. laUiItem* b2=laOnConditionThat(uil,cr,laPropExpression(Base,"udf"));{
  822. laUiItem* r=laBeginRow(uil,c,0,0);
  823. laUiItem* b=laOnConditionToggle(uil,c,0,0,0,0,0);strSafeSet(&b->ExtraInstructions,"text=🛈;");b->Flags|=LA_UI_FLAGS_PLAIN;{
  824. laShowItemFull(uil,c,Base,"udf.path",LA_WIDGET_STRING_PLAIN, 0 ,0,0);
  825. }laElse(uil,b);{
  826. laShowItemFull(uil,c,Base,"basename",LA_WIDGET_STRING_PLAIN, 0 ,0,0);
  827. }laEndCondition(uil,b);
  828. laEndRow(uil, r);
  829. }laElse(uil,b2);{
  830. laShowItemFull(uil,c,Base,"basename",LA_WIDGET_STRING_PLAIN, 0 ,0,0);
  831. }laEndCondition(uil,b2);
  832. }
  833. void laui_ManagedUDFOps(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context){
  834. laColumn *c=laFirstColumn(uil);
  835. laSplitColumn(uil,c,0.3);
  836. laColumn *cl=laLeftColumn(c, 1);
  837. laColumn *cr=laRightColumn(c,0);
  838. laUiItem* b1=laOnConditionThat(uil, cr, laPropExpression(Base, "udf"));{
  839. laShowItem(uil,cl,Base,"udf.modified");
  840. laUiItem* b=laBeginRow(uil,cr,0,0);
  841. laUiItem* b2=laOnConditionToggle(uil,cr,0,0,0,0,0);strSafeSet(&b2->ExtraInstructions,"text=🛈;");b2->Flags|=LA_UI_FLAGS_PLAIN;{
  842. laUiItem* ui=laShowItemFull(uil,cr,Base,"udf.path",LA_WIDGET_STRING_PLAIN, 0 ,0,0);ui->Expand=1;strSafeSet(&ui->ExtraInstructions,"text=Change");
  843. laShowItem(uil,cr,&ui->PP,"get_file_path");
  844. }laElse(uil,b2);{
  845. laShowItemFull(uil,cr,Base,"basename", LA_WIDGET_STRING_PLAIN, 0 ,0,0)->Expand=1;
  846. }laEndCondition(uil,b2);
  847. laEndRow(uil, b);
  848. }laElse(uil,b1);{
  849. laShowItemFull(uil,cr,0,"LA_managed_save_new_file",0,"feedback=NONE;",0,0);
  850. }laEndCondition(uil,b1);
  851. }
  852. void laui_ManagedPropInstance(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context){
  853. if(!Base ||! Base->EndInstance ||Base->LastPs->p->PropertyType!=LA_PROP_SUB) return;
  854. laColumn *c=laFirstColumn(uil);
  855. laSplitColumn(uil,c,0.3); laColumn *cl=laLeftColumn(c, 1); laColumn *cr=laRightColumn(c,0);
  856. laSplitColumn(uil,cr,0.6); laColumn *crl=laLeftColumn(cr, 0); laColumn *crr=laRightColumn(cr,30);
  857. laPropContainer* pc=la_EnsureSubTarget(Base->LastPs->p, Base->EndInstance);
  858. if(pc->UDFPropagate){
  859. char buf[128]; sprintf(buf,"Assign all \"%s\" into:",pc->Name);
  860. laShowLabel(uil,crl,buf,0,0)->Flags|=LA_TEXT_ALIGN_RIGHT|LA_UI_FLAGS_DISABLED;
  861. laShowItem(uil,crr,Base,"__single_udf_propagate");
  862. laShowSeparator(uil,c);
  863. }
  864. if(pc->OtherAlloc || Base->LastPs->p->UDFIsSingle){
  865. //laShowLabel(uil,cr,"(Item not allocated by memAcquire)",0,0)->Expand=1;
  866. }else{
  867. if(pc->Hyper==2){
  868. laShowItem(uil,cl,Base,"__modified"); laSplitColumn(uil,crl,0.4); laColumn *crll=laLeftColumn(crl, 0); laColumn *crlr=laRightColumn(crl,15);
  869. laUiItem* idui=laShowItem(uil,crll,Base,"identifier");idui->Flags|=LA_UI_FLAGS_PLAIN;idui->Expand=1;
  870. laShowItem(uil,crlr,Base,"__uid")->Flags|=LA_UI_FLAGS_NO_DECAL;
  871. if(pc->UDFPropagate){
  872. laColumn *crrl,*crrr,*udfc,*optionc; laSplitColumn(uil,crr,0.7); crrl=laLeftColumn(crr,0); crrr=laRightColumn(crr,1);
  873. laSplitColumn(uil,crrl,0.3); udfc=laLeftColumn(crrl,0); optionc=laRightColumn(crrl,8);
  874. laUiItem* uc=laOnConditionToggle(uil,crrr,0,0,0,0,0);{ strSafeSet(&uc->ExtraInstructions,"text=⮯;");
  875. laShowItem(uil,udfc,Base,"__file");
  876. laUiItem* sr=laBeginRow(uil,optionc,1,0);
  877. laShowItemFull(uil,optionc,Base,"__udf_propagate",0,"force=true;text=Force;",0,0)->Flags|=LA_TEXT_ALIGN_CENTER|LA_UI_FLAGS_NO_CONFIRM;
  878. laShowItemFull(uil,optionc,Base,"__udf_propagate",0,0,0,0)->Flags|=LA_TEXT_ALIGN_CENTER|LA_UI_FLAGS_NO_CONFIRM;
  879. laEndRow(uil,sr);
  880. }laElse(uil,uc);{
  881. laShowItem(uil,crrl,Base,"__file");
  882. }laEndCondition(uil,uc);
  883. }else{
  884. laShowItem(uil,crr,Base,"__file");
  885. }
  886. }else{
  887. //laShowItem(uil,crl,Base,"identifier")->Flags|=LA_UI_FLAGS_PLAIN;
  888. }
  889. }
  890. for(laProp*p=pc->Props.pFirst;p;p=p->Item.pNext){
  891. if(p->PropertyType!=LA_PROP_SUB || p->UDFIsRefer) continue;
  892. la_EnsureSubTarget(p,0);
  893. if(p->SubProp &&p->SubProp->Hyper!=2 &&(!p->UDFIsSingle)) continue;
  894. if(p->UDFNoCreate || p->UDFHideInSave) continue;
  895. if(p==pc->SaverDummy){
  896. laShowItem(uil,cl,Base,"__single_saver_dummy.__modified");
  897. laShowItem(uil,crl,Base,"identifier")->Flags|=LA_UI_FLAGS_PLAIN;
  898. laShowItem(uil,crr,Base,"__single_saver_dummy.__file");
  899. continue;
  900. }
  901. laUiItem* b=laOnConditionToggle(uil,c,0,0,0,0,0);{ strSafePrint(&b->ExtraInstructions,"text=⮡ %s;",p->Identifier);
  902. b->Flags|=LA_UI_FLAGS_NO_DECAL|LA_TEXT_ALIGN_LEFT; b->State=LA_BT_ACTIVE;
  903. laShowItemFull(uil,cr,Base,p->Identifier,0, 0,laui_ManagedPropInstance,0)->Flags|=LA_UI_FLAGS_NO_DECAL|LA_UI_COLLECTION_NO_HIGHLIGHT;
  904. }laEndCondition(uil,b);
  905. }
  906. laShowSeparator(uil,c);
  907. }
  908. void laui_ManagedProp(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context){
  909. laColumn *c=laFirstColumn(uil);
  910. laPropPack PP={0}; if(!Base ||! Base->EndInstance) return;
  911. laManagedSaveProp* msp=Base->EndInstance;
  912. laShowLabel(uil,c,msp->Path->Ptr,0,0);
  913. laShowItemFull(uil,c,0,msp->Path->Ptr,0, 0,laui_ManagedPropInstance,0)->Flags|=LA_UI_FLAGS_NO_DECAL|LA_UI_COLLECTION_NO_HIGHLIGHT;
  914. }
  915. void laui_ManagedSavePanel(laUiList *uil, laPropPack *Base, laPropPack *Operator, laColumn *ExtraColumns, int context){
  916. laManagedSaveExtra*mse=Operator->EndInstance;
  917. laColumn *c=laFirstColumn(uil);
  918. if(mse->OnExit){
  919. laShowLabel(uil,c,"You still have unsaved/unassigned datablocks:",0,0)->Flags|=LA_TEXT_ALIGN_CENTER|LA_TEXT_LINE_WRAP;
  920. laShowSeparator(uil,c);
  921. }
  922. laUiItem* r=laBeginRow(uil,c,0,0);
  923. laShowLabel(uil,c,"Viewing",0,0);
  924. laShowItem(uil,c,Operator,"show_page")->Flags|=LA_UI_FLAGS_EXPAND;
  925. laEndRow(uil,r);
  926. laUiItem* g=laMakeEmptyGroup(uil,c,"List",0);{ g->State=LA_UI_ACTIVE;
  927. laUiList* gu=g->Page; gu->HeightCoeff=mse->OnExit?-4:-3; laColumn* gc=laFirstColumn(gu);
  928. laUiItem* b=laOnConditionThat(gu,gc,laEqual(laPropExpression(Operator, "show_page"),laIntExpression(0)));{
  929. laShowItemFull(gu,gc,0,"la.managed_props",0, 0,laui_ManagedProp,0)->Flags|=LA_UI_FLAGS_NO_DECAL|LA_UI_COLLECTION_NO_HIGHLIGHT;
  930. }laElse(gu,b);{
  931. laShowItemFull(gu,gc,0,"la.managed_udfs",0,0,0,0)->Flags|=LA_UI_FLAGS_NO_DECAL;
  932. }laEndCondition(gu,b);
  933. }
  934. if(mse->OnExit){
  935. laShowLabel(uil,c,"If you exit the program now, you will lose those changes.",0,0)->Flags|=LA_TEXT_ALIGN_CENTER|LA_TEXT_LINE_WRAP;
  936. }
  937. r=laBeginRow(uil,c,0,0);
  938. if(mse->OnExit){
  939. laShowItemFull(uil,c,0,"LA_cancel",0,"text=Discard And Quit;feedback=DISCARD_AND_QUIT",0,0);
  940. }
  941. laShowSeparator(uil,c)->Expand=1;
  942. laShowItemFull(uil,c,0,"LA_managed_save",0,"quiet=true;ignore_unassigned=true;text=Save All Modified;feedback=SAVE_MODIFIED",0,0);
  943. laEndRow(uil,r);
  944. }
  945. void laui_ResourceFolderItem(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context){
  946. laColumn *c;
  947. c = laFirstColumn(uil);
  948. laUiItem* b=laBeginRow(uil,c,0,0);
  949. laShowItem(uil, c, Base, "remove")->Flags|=LA_UI_FLAGS_ICON;
  950. laUiItem* ui=laShowItem(uil, c, Base, "path");
  951. ui->Expand=1;
  952. laShowItem(uil,c,&ui->PP,"get_folder_path")->Flags|=LA_UI_FLAGS_ICON;
  953. laEndRow(uil,b);
  954. }
  955. void laui_LogItem(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context){
  956. laShowItem(uil, ExtraColumns, Base, "content")->Flags|=LA_TEXT_LINE_WRAP|LA_TEXT_USE_NEWLINE|LA_TEXT_MONO|LA_UI_FLAGS_NO_TOOLTIP;
  957. }
  958. void laui_NodeRack(laUiList *uil, laPropPack *This, laPropPack *Extra, laColumn *UNUSED, int context){
  959. laNodeRack* r=This->EndInstance;
  960. laColumn* c=laFirstColumn(uil),*cl, *cr;
  961. laShowLabel(uil,c,"\n",0,0);
  962. laUiItem* b=laBeginRow(uil,c,0,0);
  963. laShowItemFull(uil,c,This,"move",0,"icon=🡰;direction=left;",0,0)->Flags|=LA_UI_FLAGS_ICON;
  964. laUiItem* u=laShowItem(uil,c,This,"name"); u->Flags|=LA_UI_FLAGS_NO_DECAL|LA_TEXT_ALIGN_CENTER; u->Expand=1;
  965. laShowItemFull(uil,c,This,"move",0,"icon=🡲;direction=right;",0,0)->Flags|=LA_UI_FLAGS_ICON;
  966. laEndRow(uil,b);
  967. laShowLabel(uil,c,"\n",0,0);
  968. laShowItem(uil,c,This,"nodes")->Flags|=LA_UI_FLAGS_NO_DECAL;
  969. laShowLabel(uil,c,"\n",0,0);
  970. b=laBeginRow(uil,c,0,0);
  971. laShowItemFull(uil,c,This,"add_node",0,(context==LA_RACK_TYPE_DRIVER)?"target=DRIVER;":"target=INPUT;",0,0)->Expand=1;
  972. laShowItem(uil,c,This,"delete")->Flags|=LA_UI_FLAGS_ICON;
  973. laShowItem(uil,c,This,"insert_rack");
  974. laEndRow(uil,b);
  975. laShowLabel(uil,c,"\n\n\n",0,0);
  976. }
  977. void laui_RackPage(laUiList *uil, laPropPack *This, laPropPack *Extra, laColumn *UNUSED, int context){
  978. laColumn* c=laFirstColumn(uil); laRackPage* r=This->EndInstance;
  979. laUiItem* b=laOnConditionThat(uil,c,laPropExpression(This,"has_rack"));{
  980. laUiItem* g=laMakeGroup(uil,c,"Racks",0);{ g->Flags|=/*LA_UI_FLAGS_NO_GAP|LA_UI_FLAGS_NO_DECAL|*/LA_UI_FLAGS_NODE_CONTAINER;
  981. laUiList* gu=g->Page; laColumn* gc=laFirstColumn(gu); gu->AllowScale=1; gu->HeightCoeff=-1; g->State=LA_UI_ACTIVE;
  982. laUiItem* hui=laShowItemFull(gu,gc,This,"racks",0,0,laui_NodeRack,r?r->RackType:0); hui->Expand=15; hui->Flags|=LA_UI_FLAGS_NO_DECAL;
  983. }
  984. }laElse(uil,b);{
  985. laShowItemFull(uil,c,This,"add_rack",0,0,0,0);
  986. }laEndCondition(uil,b);
  987. }
  988. void laui_NodeCategory(laUiList *uil, laPropPack *This, laPropPack *Extra, laColumn *UNUSED, int context){
  989. laColumn* c=laFirstColumn(uil); laNodeCategory* nc=This->EndInstance;
  990. if(nc->Ui){ nc->Ui(uil,This,Extra,0,context); return; }
  991. char buf[256];
  992. for(laListItemPointer* lip=nc->NodeTypes.pFirst;lip;lip=lip->pNext){
  993. laBaseNodeType* nt=lip->p; sprintf(buf,"feedback=%s;text=%s;icon=%lc;",nt->TypeName,nt->Name,nt->Icon?nt->Icon:' ');
  994. laShowItemFull(uil,c,0,"LA_confirm",0,buf,0,0);
  995. }
  996. }
  997. void laui_UserPreference(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context){
  998. laColumn* c = laFirstColumn(uil),*cl,*cr; laSplitColumn(uil,c,0.5);cl=laLeftColumn(c,0);cr=laRightColumn(c,0);
  999. laUiList *muil;
  1000. laColumn *mc, *mcl, *mcr, *mcll, *mclr;
  1001. laUiItem *b, *bracket;
  1002. //_LA_PANEL_USER_PREFERENCE = p;
  1003. //la_UDFAppendSharedTypePointer("_LA_PANEL_USER_PREFERENCE", _LA_PANEL_USER_PREFERENCE);
  1004. //p->Show = 0;
  1005. //p->FastUpdate = 1;
  1006. b=laBeginRow(uil,cl,0,0); laUiItem* ui=laShowLabel(uil,cl,"Save on exit:",0,0); ui->Expand=1; ui->Flags|=LA_TEXT_ALIGN_RIGHT;
  1007. laShowItemFull(uil,cl,0,"la.user_preferences.save_preferences_on_exit",LA_WIDGET_ENUM_HIGHLIGHT,"text=🞆",0,0);
  1008. laEndRow(uil,b);
  1009. laShowItem(uil,cr,0,"LA_save_user_preferences");
  1010. bracket = laMakeTab(uil, c, 0);{
  1011. for(laExtraPreferencePage* epp=MAIN.ExtraPreferencePages.pFirst;epp;epp=epp->Item.pNext){
  1012. muil = laAddTabPage(bracket, epp->Name); epp->Func(muil,0,0,0,0);
  1013. }
  1014. muil = laAddTabPage(bracket, "Display");{
  1015. //muil->HeightCoeff = -1;
  1016. mc = laFirstColumn(muil);
  1017. laSplitColumn(muil, mc, 0.5);
  1018. mcl = laLeftColumn(mc, 0);
  1019. mcr = laRightColumn(mc, 0);
  1020. if(MAIN.PreferencePageDisplay){ MAIN.PreferencePageDisplay(muil,0,0,0,0); }
  1021. laShowLabel(muil, mc, "Interface:", 0, 0);
  1022. laShowLabel(muil, mcl, "Row Height:", 0, 0);
  1023. laShowItem(muil, mcr, 0, "la.user_preferences.interface_size");
  1024. laShowLabel(muil, mcl, "Font Size:", 0, 0);
  1025. laShowItem(muil, mcr, 0, "la.user_preferences.font_size");
  1026. laShowLabel(muil, mcl, "Margin Size:", 0, 0);
  1027. laShowItem(muil, mcr, 0, "la.user_preferences.margin_size");
  1028. laShowLabel(muil, mcl, "Panel Multisample:", 0, 0);
  1029. laShowItem(muil, mcr, 0, "la.user_preferences.panel_multisample")->Flags|=LA_UI_FLAGS_EXPAND;
  1030. laShowItem(muil, mc, 0, "la.user_preferences.top_framerate");
  1031. laShowSeparator(muil, mc);
  1032. laShowLabel(muil, mc, "Color:", 0, 0);
  1033. laShowItem(muil, mcr, 0, "la.user_preferences.color_picker_gamma");
  1034. laShowSeparator(muil, mc);
  1035. laShowLabel(muil, mc, "Nodes:", 0, 0);
  1036. laShowItem(muil, mcr, 0, "la.user_preferences.wire_color_slices");
  1037. laShowItem(muil, mcr, 0, "la.user_preferences.wire_thickness");
  1038. laShowItem(muil, mcr, 0, "la.user_preferences.wire_saggyness");
  1039. laShowSeparator(muil, mc);
  1040. laShowLabel(muil, mc, "Floating Panel:", 0, 0);
  1041. laShowItem(muil, mcl, 0, "la.user_preferences.floating_alpha");
  1042. laShowItem(muil, mcr, 0, "la.user_preferences.solid_shadow_length");
  1043. laShowSeparator(muil, mc);
  1044. laShowLabel(muil, mc, "Translation:", 0, 0);
  1045. laShowLabel(muil, mcl, "Enable Translation:", 0, 0);
  1046. laShowItemFull(muil, mcr, 0, "la.user_preferences.enable_translation",LA_WIDGET_ENUM_CYCLE,0,0,0);
  1047. b = laOnConditionThat(muil, mcl, laPropExpression(0, "la.user_preferences.enable_translation"));{
  1048. laShowLabel(muil, mcl, "Language:", 0, 0);
  1049. laShowItemFull(muil, mcr, 0, "la.user_preferences.languages", LA_WIDGET_COLLECTION_SELECTOR, 0, 0, 0);
  1050. laShowItem(muil, mcl, 0, "LA_translation_dump");
  1051. }
  1052. laEndCondition(muil, b);
  1053. }
  1054. muil = laAddTabPage(bracket, "Input");{
  1055. //muil->HeightCoeff = -1;
  1056. mc = laFirstColumn(muil);
  1057. laSplitColumn(muil, mc, 0.5);
  1058. mcl = laLeftColumn(mc, 0);
  1059. mcr = laRightColumn(mc, 0);
  1060. if(MAIN.PreferencePageInput){ MAIN.PreferencePageInput(muil,0,0,0,0); }
  1061. laShowLabel(muil, mc, "User Interactions:", 0, 0);
  1062. laShowItem(muil, mc, 0, "la.user_preferences.scroll_speed");
  1063. laShowItem(muil, mcl, 0, "la.user_preferences.animation_speed");
  1064. laShowItem(muil, mcr, 0, "la.user_preferences.panel_animation_speed");
  1065. laShowItem(muil, mc, 0, "la.user_preferences.valuator_threshold");
  1066. laShowItem(muil, mc, 0, "la.user_preferences.zoom_speed_2d");
  1067. laShowItem(muil, mcl, 0, "la.user_preferences.tooltip_close_distance");
  1068. laShowItem(muil, mcr, 0, "la.user_preferences.idle_time");
  1069. laShowSeparator(muil,mc);
  1070. laShowLabel(muil, mc, "Input device handling:", 0, 0);
  1071. #ifdef _WIN32
  1072. laShowLabel(muil, mc, "Not yet implemened on Windows.", 0, 0);
  1073. #endif
  1074. laShowLabel(muil, mcl, "Input Mapping:", 0, 0)->Flags|=LA_TEXT_ALIGN_RIGHT;
  1075. laShowItemFull(muil, mcr, 0, "LA_panel_activator",0,"panel_id=LAUI_input_mapper;text=Configure",0,0);
  1076. laShowLabel(muil, mcl, "Pads/Joysticks:", 0, 0)->Flags|=LA_TEXT_ALIGN_RIGHT;
  1077. laShowItemFull(muil, mcr, 0, "LA_panel_activator",0,"panel_id=LAUI_controllers;text=Configure",0,0);
  1078. laShowSeparator(muil,mc);
  1079. laShowLabel(muil, mc, "Wacom Devices:", 0, 0);
  1080. #ifdef _WIN32
  1081. b=laBeginRow(muil,mcl,0,0); laShowLabel(muil, mcl, "Driver:", 0, 0)->Flags|=LA_TEXT_ALIGN_RIGHT;
  1082. laShowItem(muil, mcl, 0, "LA_refresh_controllers")->Flags|=LA_UI_FLAGS_ICON;
  1083. laEndRow(muil, b);
  1084. laShowItem(muil, mcr, 0, "la.user_preferences.wacom_driver");
  1085. #else
  1086. laShowItem(muil, mcl, 0, "la.user_preferences.wacom_device_stylus");
  1087. laShowItem(muil, mcl, 0, "la.user_preferences.wacom_device_eraser");
  1088. laShowItemFull(muil, mcr, 0, "LA_refresh_controllers",0,"text=Refresh",0,0);
  1089. #endif
  1090. }
  1091. muil = laAddTabPage(bracket, "Resource");{
  1092. //muil->HeightCoeff = -1;
  1093. mc = laFirstColumn(muil);
  1094. laSplitColumn(muil, mc, 0.5);
  1095. mcl = laLeftColumn(mc, 0);
  1096. mcr = laRightColumn(mc, 0);
  1097. if(MAIN.PreferencePageResource){ MAIN.PreferencePageResource(muil,0,0,0,0); }
  1098. laShowLabel(muil, mcl, "UDF Manager Default View:", 0, 0);
  1099. laShowItem(muil, mcr, 0, "la.user_preferences.manager_default_view")->Flags|=LA_UI_FLAGS_EXPAND;
  1100. laShowSeparator(muil,mc);
  1101. b=laBeginRow(muil,mc,0,0);
  1102. laShowLabel(muil, mc, "Resource Folders", 0, 0)->Expand=1;
  1103. laShowItem(muil, mc, 0, "LA_add_resource_folder");
  1104. laEndRow(muil,b);
  1105. laShowItem(muil, mc, 0, "la.user_preferences.resource_folders");
  1106. }
  1107. muil = laAddTabPage(bracket, "Theme");{
  1108. //muil->HeightCoeff = -1;
  1109. mc = laFirstColumn(muil);
  1110. if(MAIN.PreferencePageTheme){ MAIN.PreferencePageTheme(muil,0,0,0,0); }
  1111. laShowLabel(muil, mc, "Active Theme", 0, 0);
  1112. laShowItemFull(muil, mc, 0, "la.themes", LA_WIDGET_COLLECTION_SELECTOR, 0,laui_ThemeListItem,0);
  1113. laShowItemFull(muil, mc, 0, "la.themes", LA_WIDGET_COLLECTION_SINGLE, 0 ,0,0)->Flags|=LA_UI_FLAGS_NO_DECAL;
  1114. }
  1115. }
  1116. }
  1117. void laui_About(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context){
  1118. laColumn *c, *cl, *cr, *tc, *gc, *gcl, *gcr, *tcl, *tcr;
  1119. laUiItem *bracket, *t, *g;
  1120. laPanel *p;
  1121. laUiList *u, *gu;
  1122. laPropContainer *pc;
  1123. int h;
  1124. laOperatorType *at;
  1125. laUiList *first;
  1126. char buf[2048]={0};
  1127. c = laFirstColumn(uil);
  1128. if(MAIN.AboutContent){
  1129. MAIN.AboutContent(uil,Base,OperatorInst,ExtraColumns,0);
  1130. }else{
  1131. laShowLabel(uil, c, "LaGUI", 0, 0);
  1132. laShowLabel(uil, c, "A graphical user interface application toolkit", 0, 0)->Flags|=LA_TEXT_LINE_WRAP;
  1133. laShowLabel(uil, c, "(C)Yiming Wu", 0, 0);
  1134. }
  1135. t = laMakeTab(uil, c, 0);{
  1136. first = u = laAddTabPage(t, "Version");
  1137. tc = laFirstColumn(u);
  1138. if(MAIN.AboutVersion){
  1139. MAIN.AboutVersion(u,Base,OperatorInst,ExtraColumns,0);
  1140. }
  1141. g = laMakeGroup(u, tc, "LaGUI information", 0);
  1142. gu = g->Page;{
  1143. gc = laFirstColumn(gu);
  1144. sprintf(buf, "LaGUI.%d.%d", LA_VERSION_MAIN, LA_VERSION_SUB);
  1145. laShowLabel(gu, gc, buf, 0, 0)->Flags|=LA_TEXT_MONO;
  1146. laShowLabel(gu, gc, LAGUI_GIT_BRANCH,0,0)->Flags|=LA_TEXT_MONO;
  1147. #ifdef LAGUI_GIT_HASH
  1148. laShowLabel(gu, gc, LAGUI_GIT_HASH,0,0)->Flags|=LA_TEXT_MONO;
  1149. #endif
  1150. sprintf(buf, "Built on:[UTC+8] %s %s", __DATE__, __TIME__);
  1151. laShowLabel(gu, gc, buf, 0, 0)->Flags|=LA_TEXT_MONO;
  1152. sprintf(buf, "UDF Identifier: %s",LA_UDF_IDENTIFIER);
  1153. laShowLabel(gu, gc, buf, 0, 0)->Flags|=LA_TEXT_MONO;
  1154. laShowLabel(gu, gc, "UDF Extensions:", 0, 0)->Flags|=LA_TEXT_MONO;
  1155. laShowLabel(gu, gc, "🗸LA_UDF_BASICS", 0, 0)->Flags|=LA_TEXT_MONO;
  1156. for(int i=0;i<64;i++){
  1157. if(!LA_UDF_EXTENSION_STRINGS[i][0]) break; int gray=!((1<<i)&LA_UDF_EXTENSION_BITS);
  1158. sprintf(buf,"%s%s",gray?" ":"🗸",LA_UDF_EXTENSION_STRINGS[i]);
  1159. laUiItem* ext=laShowLabel(gu, gc, buf, 0, 0); ext->Flags|=LA_TEXT_MONO;
  1160. if(gray){ ext->Flags|=LA_UI_FLAGS_DISABLED; }
  1161. }
  1162. }
  1163. g = laMakeGroup(u, tc, "Device Graphics", 0);
  1164. gu = g->Page;{
  1165. gc = laFirstColumn(gu);
  1166. sprintf(buf, "OpenGL Version: %s", T->GLVersionStr); laShowLabel(gu, gc, buf, 0, 0)->Flags|=LA_TEXT_MONO;
  1167. sprintf(buf, "OpenGL Vendor: %s", T->GLVendorStr); laShowLabel(gu, gc, buf, 0, 0)->Flags|=LA_TEXT_MONO;
  1168. sprintf(buf, "OpenGL Renderer: %s", T->GLRendererStr); laShowLabel(gu, gc, buf, 0, 0)->Flags|=LA_TEXT_MONO;
  1169. sprintf(buf, "GLSL Version: %s", T->GLSLVersionStr); laShowLabel(gu, gc, buf, 0, 0)->Flags|=LA_TEXT_MONO;
  1170. }
  1171. u = laAddTabPage(t, "Authors");
  1172. tc= laFirstColumn(u);
  1173. if(MAIN.AboutAuthor){
  1174. MAIN.AboutAuthor(u,Base,OperatorInst,ExtraColumns,0);
  1175. }
  1176. g = laMakeGroup(u, tc, "LaGUI", 0);
  1177. gu = g->Page;{
  1178. gc = laFirstColumn(gu);
  1179. laShowLabel(gu,gc,"LaGUI application framework is made by Wu Yiming.",0,0)->Flags|=LA_TEXT_LINE_WRAP;
  1180. laUiItem* b=laBeginRow(gu,gc,0,0);
  1181. laShowItemFull(gu, gc, 0, "LA_open_internet_link", 0, "link=http://www.ChengduLittleA.com/lagui;text=Details", 0, 0);
  1182. laShowItemFull(gu, gc, 0, "LA_open_internet_link", 0, "link=http://www.ChengduLittleA.com;text=Yiming's Blog", 0, 0);
  1183. laEndRow(gu,b);
  1184. }
  1185. t->Page = first;
  1186. }
  1187. }
  1188. void laui_UndoHistories(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context){
  1189. laColumn* c=laFirstColumn(uil),*cl,*cr; laSplitColumn(uil,c,0.5);cl=laLeftColumn(c,0);cr=laRightColumn(c,0);
  1190. laShowItem(uil,cl,0,"LA_undo"); laShowItem(uil,cr,0,"LA_redo")->Flags|=LA_TEXT_ALIGN_RIGHT;
  1191. laUiItem* g=laMakeGroup(uil,c,"123",0);{ g->State=LA_UI_ACTIVE; g->Flags|=LA_UI_FLAGS_PREFER_BOTTOM;
  1192. laUiList* gu=g->Page; laColumn* gc=laFirstColumn(gu); gu->HeightCoeff=-1;
  1193. laShowItem(gu,gc,0,"la.differences")->Flags|=LA_UI_FLAGS_NO_DECAL;
  1194. }
  1195. }
  1196. void laui_Terminal(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context){
  1197. laColumn* c=laFirstColumn(uil);
  1198. laUiItem* g=laMakeGroup(uil,c,"123",0);{ g->State=LA_UI_ACTIVE; g->Flags|=LA_UI_FLAGS_PREFER_BOTTOM;
  1199. laUiList* gu=g->Page; laColumn* gc=laFirstColumn(gu); gu->HeightCoeff=-1;
  1200. laShowItem(gu,gc,0,"la.logs")->Flags|=LA_UI_FLAGS_NO_DECAL;
  1201. }
  1202. }
  1203. void laui_IdleDataManager(laUiList *uil, laPropPack *Base, laPropPack *Extra, laColumn *ExtraColumns, int context){
  1204. laColumn *c=laFirstColumn(uil);
  1205. laUiItem* r=laBeginRow(uil,c,0,0);
  1206. laShowLabel(uil,c,"Viewing",0,0);
  1207. laShowItem(uil,c,Extra,"show_page")->Flags|=LA_UI_FLAGS_EXPAND;
  1208. laEndRow(uil,r);
  1209. laUiItem* g=laMakeEmptyGroup(uil,c,"List",0);{ g->State=LA_UI_ACTIVE;
  1210. laUiList* gu=g->Page; gu->HeightCoeff=-3; laColumn* gc=laFirstColumn(gu);
  1211. laUiItem* b=laOnConditionThat(gu,gc,laEqual(laPropExpression(Extra, "show_page"),laIntExpression(0)));{
  1212. laShowItemFull(gu,gc,0,"la.managed_props",0, 0,laui_ManagedProp,0)->Flags|=LA_UI_FLAGS_NO_DECAL;
  1213. }laElse(gu,b);{
  1214. laShowItemFull(gu,gc,0,"la.managed_udfs",0,0,0,0)->Flags|=LA_UI_FLAGS_NO_DECAL;
  1215. }laEndCondition(gu,b);
  1216. }
  1217. r=laBeginRow(uil,c,0,0);
  1218. laShowSeparator(uil,c)->Expand=1;
  1219. laShowItemFull(uil,c,0,"LA_managed_save",0,"quiet=true;ignore_unassigned=true;text=Save All Modified",0,0);
  1220. laEndRow(uil,r);
  1221. }
  1222. void lauidetached_IdleDataManager(laPanel* p){
  1223. la_MakeDetachedProp(p, "la.user_preferences.manager_default_view", "show_page");
  1224. }
  1225. void laui_TextureInspector(laUiList *uil, laPropPack *Base, laPropPack *Extra, laColumn *ExtraColumns, int context){
  1226. laColumn *c=laFirstColumn(uil),*cl,*cr;
  1227. laSplitColumn(0, c, 0.5);
  1228. cl = laLeftColumn(c, 0);
  1229. cr = laRightColumn(c, 0);
  1230. laShowLabel(uil,cl,"Viewing Texture:",0,0)->Flags|=LA_TEXT_ALIGN_RIGHT;
  1231. laShowItemFull(uil,cr,Extra,"textures",LA_WIDGET_COLLECTION_SELECTOR,0,0,0);
  1232. laUiItem* u2=laShowCanvas(uil,c,Extra,"textures",0,-1);
  1233. laDefault2DViewOverlayRight(u2);
  1234. }
  1235. void lauidetached_TextureInspector(laPanel* p){
  1236. la_MakeDetachedProp(p, "tns.texture_list", "textures");
  1237. }
  1238. void laui_GameController(laUiList *uil, laPropPack *This, laPropPack *Extra, laColumn *UNUSED, int context){
  1239. laColumn* c=laFirstColumn(uil),*cl, *cr;
  1240. laSplitColumn(uil,c,0.5); cl=laLeftColumn(c,0); cr=laRightColumn(c,0);
  1241. laUiItem* b=laBeginRow(uil,cl,0,0);
  1242. laUiItem* l=laShowLabel(uil,cl,"Controller:",0,0); l->Flags|=LA_TEXT_ALIGN_RIGHT; l->Expand=1;
  1243. laShowItem(uil,cl,0,"LA_refresh_controllers")->Flags|=LA_UI_FLAGS_ICON;
  1244. laEndRow(uil,b);
  1245. laShowItemFull(uil,cr,Extra,"controllers",LA_WIDGET_COLLECTION_SELECTOR,0,laui_IdentifierOnly,0);
  1246. b=laOnConditionThat(uil,c,laPropExpression(Extra,"controllers"));{
  1247. laShowItemFull(uil,c,Extra,"controllers",LA_WIDGET_COLLECTION_SINGLE,0,0,0);
  1248. }laElse(uil,b);{
  1249. laShowLabel(uil,c,"Please select a controller.",0,0)->Flags|=LA_TEXT_ALIGN_CENTER;
  1250. }
  1251. }
  1252. void lauidetached_GameController(laPanel* p){
  1253. la_MakeDetachedProp(p, "la.controllers", "controllers");
  1254. }
  1255. void laui_InputMapper(laUiList *uil, laPropPack *This, laPropPack *Extra, laColumn *UNUSED, int context){
  1256. laColumn* c=laFirstColumn(uil),*cl, *cr;
  1257. laSplitColumn(uil,c,0.6); cl=laLeftColumn(c,0); cr=laRightColumn(c,0);
  1258. laUiItem* b=laBeginRow(uil,cl,0,0);
  1259. laUiItem* b2=laOnConditionThat(uil,cl,laPropExpression(0,"la.input_mapping.pages"));{
  1260. laUiItem* b3=laOnConditionThat(uil,cl,laPropExpression(0,"la.input_mapping.current_page"));{
  1261. laShowItem(uil,cr,0,"la.input_mapping.current_page.name")->Expand=1;
  1262. laShowItem(uil,c,Extra,"LA_input_mapping_rebuild")->Flags|=LA_UI_FLAGS_ICON;
  1263. }laEndCondition(uil,b3);
  1264. }laEndCondition(uil,b2);
  1265. laShowItem(uil,cl,0,"LA_add_input_mapping_page")->Flags|=LA_UI_FLAGS_ICON;
  1266. laEndRow(uil,b);
  1267. b2=laOnConditionThat(uil,cr,laPropExpression(0,"la.input_mapping.pages"));{
  1268. laShowItemFull(uil,cr,0,"la.input_mapping.pages",LA_WIDGET_COLLECTION_SELECTOR,0,0,0);
  1269. }laEndCondition(uil,b2);
  1270. laShowItemFull(uil,c,0,"la.input_mapping.current_page",LA_WIDGET_COLLECTION_SINGLE,0,laui_RackPage,0)->Flags|=LA_UI_FLAGS_NO_DECAL;
  1271. }
  1272. void lauidetached_Drivers(laPanel* p){
  1273. la_MakeDetachedProp(p, "la.detached_view_switch", "detached");
  1274. la_MakeDetachedProp(p, "tns.world.root_objects", "root_object");
  1275. }
  1276. void laui_Drivers(laUiList *uil, laPropPack *This, laPropPack *Extra, laColumn *UNUSED, int context){
  1277. laColumn* c=laFirstColumn(uil),*cl, *cr,*cll,*clr;
  1278. laSplitColumn(uil,c,0.35); cl=laLeftColumn(c,7); cr=laRightColumn(c,0);
  1279. laSplitColumn(uil,cl,0.4); cll=laLeftColumn(cl,1); clr=laRightColumn(cl,0);
  1280. laShowItemFull(uil,cll,Extra,"detached",0,0,0,0)->Flags|=LA_UI_FLAGS_HIGHLIGHT|LA_UI_FLAGS_ICON;
  1281. #define ADD_PAGE \
  1282. laUiItem* b2=laOnConditionThat(uil,cl,laPropExpression(&rb->PP,""));{\
  1283. laUiItem* b=laBeginRow(uil,cr,0,0);\
  1284. laUiItem* b3=laOnConditionThat(uil,cl,laPropExpression(&rb->PP,"drivers.current_page"));{\
  1285. laShowItemFull(uil,cr,&rb->PP,"drivers.current_page",LA_WIDGET_COLLECTION_SELECTOR,0,laui_IdentifierOnly,0)\
  1286. ->Flags|=LA_UI_COLLECTION_SIMPLE_SELECTOR;\
  1287. laShowItem(uil,cr,&rb->PP,"drivers.current_page.name");\
  1288. laShowItem(uil,cr,&rb->PP,"add_driver_page")->Flags|=LA_UI_FLAGS_ICON;\
  1289. laShowSeparator(uil,cr);\
  1290. laShowItem(uil,cr,&rb->PP,"drivers.current_page.trigger");\
  1291. laShowItemFull(uil,cr,&rb->PP,"drivers.current_page.use_script",0,"icon=📃",0,0)\
  1292. ->Flags|=LA_UI_FLAGS_HIGHLIGHT|LA_UI_FLAGS_CYCLE|LA_UI_FLAGS_ICON;\
  1293. }laElse(uil,b3);{\
  1294. laShowItem(uil,cr,&rb->PP,"add_driver_page")->Flags|=LA_UI_FLAGS_ICON;\
  1295. }laEndCondition(uil,b3);\
  1296. laEndRow(uil,b);\
  1297. }laEndCondition(uil,b2);\
  1298. b2=laOnConditionThat(uil,c,laPropExpression(&rb->PP,"drivers.current_page"));{\
  1299. laUiItem* b3=laOnConditionThat(uil,c,laPropExpression(&rb->PP,"drivers.current_page.use_script"));{\
  1300. laShowItemFull(uil,c,&rb->PP,"drivers.current_page.script",0,0,0,0)->Extra->HeightCoeff=-2;\
  1301. }laElse(uil,b3);{\
  1302. laShowItemFull(uil,c,&rb->PP,"drivers.current_page",LA_WIDGET_COLLECTION_SINGLE,0,laui_RackPage,0)->Flags|=LA_UI_FLAGS_NO_DECAL;\
  1303. }laEndCondition(uil,b3);\
  1304. }laElse(uil,b2);{\
  1305. laShowLabel(uil,c,"Select or add a logic page.",0,0)->Flags|=LA_TEXT_ALIGN_CENTER;\
  1306. }laEndCondition(uil,b2);
  1307. laUiItem* b1=laOnConditionThat(uil,c,laPropExpression(Extra,"detached"));{
  1308. laUiItem* rb=laShowItemFull(uil,clr,Extra,"root_object",LA_WIDGET_COLLECTION_SELECTOR,0,laui_IdentifierOnly,0);
  1309. ADD_PAGE
  1310. }laElse(uil,b1);{
  1311. laUiItem* rb=laShowItemFull(uil,clr,0,"tns.world.active_root",LA_WIDGET_COLLECTION_SELECTOR,0,laui_IdentifierOnly,0);
  1312. ADD_PAGE
  1313. }laEndCondition(uil,b1);
  1314. #undef ADD_PAGE
  1315. }
  1316. void laui_AnimationActionSimple(laUiList *uil, laPropPack *This, laPropPack *Extra, laColumn *ExtraColumns, int context){
  1317. laColumn* c=laFirstColumn(uil);
  1318. laUiItem* b=laBeginRow(uil,c,0,0);{
  1319. laUiItem* b2=laOnConditionThat(uil,c,laEqual(laPropExpression(This,"__self"),laPropExpression(0,"la.animation.current_action")));{
  1320. laShowLabel(uil,c,"🠶",0,0)->Flags|=LA_TEXT_MONO|LA_TEXT_ALIGN_RIGHT;
  1321. }laElse(uil,b2);{
  1322. laShowLabel(uil,c," ",0,0)->Flags|=LA_TEXT_MONO;
  1323. }laEndCondition(uil,b2);
  1324. laUiItem* ui=laShowItemFull(uil,c,This,"play_head",LA_WIDGET_VALUE_METER,0,0,0);
  1325. ui->Flags|=LA_UI_FLAGS_NO_LABEL|LA_UI_FLAGS_UNDERNEATH; ui->Expand=1;
  1326. laShowItem(uil,c,This,"name")->Flags|=LA_UI_FLAGS_NO_DECAL|LA_UI_FLAGS_NO_EVENT;
  1327. laShowItemFull(uil,c,This,"solo",0,"icon=S;",0,0)->Flags=LA_UI_FLAGS_ICON|LA_UI_FLAGS_CYCLE|LA_UI_FLAGS_HIGHLIGHT;
  1328. laShowItemFull(uil,c,This,"mute",0,"icon=M;",0,0)->Flags=LA_UI_FLAGS_ICON|LA_UI_FLAGS_CYCLE|LA_UI_FLAGS_HIGHLIGHT;
  1329. }
  1330. laEndRow(uil,b);
  1331. }
  1332. void laui_AnimationActionHolder(laUiList *uil, laPropPack *This, laPropPack *Extra, laColumn *ExtraColumns, int context){
  1333. laColumn* c=laFirstColumn(uil);
  1334. laShowItemFull(uil,c,This,"identifier",LA_WIDGET_STRING_PLAIN,0,0,0);
  1335. laShowItemFull(uil,c,This,"__actions__",0,0,laui_AnimationActionSimple,0)->Flags|=LA_UI_FLAGS_NO_DECAL;
  1336. }
  1337. void laui_AnimationActionListItem(laUiList *uil, laPropPack *This, laPropPack *Extra, laColumn *ExtraColumns, int context){
  1338. laColumn* c=laFirstColumn(uil); laUiItem* ui;
  1339. laUiItem* b=laBeginRow(uil,c,0,0);{
  1340. //laUiItem* b2=laOnConditionThat(uil,c,laNot(laEqual(laPropExpression(This,"__self"),laPropExpression(0,"la.animation.current_action"))));{
  1341. // ui=laShowItemFull(uil,c,This,"play_head",LA_WIDGET_VALUE_METER,0,0,0);
  1342. // ui->Flags|=LA_UI_FLAGS_NO_LABEL|LA_UI_FLAGS_UNDERNEATH; ui->Expand=1;
  1343. //}laEndCondition(uil,b2);
  1344. ui=laShowItem(uil,c,This,"name");
  1345. ui->Flags|=LA_UI_FLAGS_NO_DECAL|LA_UI_FLAGS_NO_EVENT; ui->Expand=1;
  1346. }
  1347. laEndRow(uil,b);
  1348. }
  1349. void laui_AnimationActions(laUiList *uil, laPropPack *This, laPropPack *Extra, laColumn *UNUSED, int context){
  1350. laColumn* c=laFirstColumn(uil),*cl, *cr; laSplitColumn(uil,c,0.5); cl=laLeftColumn(c,0); cr=laRightColumn(c,5);
  1351. laUiItem* b,*ui;
  1352. ui=laShowItemFull(uil,cl,0,"la.animation.play_head",LA_WIDGET_INT_PLAIN,0,0,0);
  1353. ui->Flags|=LA_UI_FLAGS_NO_LABEL; ui->Expand=1;
  1354. laUiItem* row=laBeginRow(uil,cr,0,0);
  1355. laShowItemFull(uil,cr,0,"LA_animation_reset_time",0,0,0,0)->Flags|=LA_UI_FLAGS_ICON|LA_UI_FLAGS_EXIT_WHEN_TRIGGERED;
  1356. b=laOnConditionThat(uil,cr,laPropExpression(0,"la.animation.play_status"));{
  1357. ui=laShowItemFull(uil,cr,0,"LA_animation_set_play_status",0,"text=❚❚;",0,0);
  1358. ui->Flags|=LA_UI_FLAGS_EXIT_WHEN_TRIGGERED|LA_TEXT_ALIGN_CENTER; ui->Expand=1;
  1359. }laElse(uil,b);{
  1360. ui=laShowItemFull(uil,cr,0,"LA_animation_set_play_status",0,"icon=◀;mode=reverse;",0,0);
  1361. ui->Flags|=LA_UI_FLAGS_ICON|LA_UI_FLAGS_EXIT_WHEN_TRIGGERED; ui->Expand=1;
  1362. ui=laShowItemFull(uil,cr,0,"LA_animation_set_play_status",0,"icon=▶;mode=forward;",0,0);
  1363. ui->Flags|=LA_UI_FLAGS_ICON|LA_UI_FLAGS_EXIT_WHEN_TRIGGERED; ui->Expand=1;
  1364. }laEndCondition(uil,b);
  1365. laEndRow(uil,row);
  1366. ui=laMakeEmptyGroup(uil,c,"Use Format",0); laUiList* gu=ui->Page; laColumn* gc=laFirstColumn(gu);
  1367. gu->HeightCoeff=-3; //ui->Flags|=LA_UI_FLAGS_NO_DECAL;
  1368. for(laActionHolderPath* ahp=MAIN.Animation->ActionHolderPaths.pFirst;ahp;ahp=ahp->Item.pNext){
  1369. laShowLabel(gu,gc,ahp->PP.LastPs->p->Name,0,0)->Flags|=LA_UI_FLAGS_DISABLED|LA_TEXT_MONO;
  1370. laShowItemFull(gu,gc,0,ahp->OriginalPath,LA_WIDGET_COLLECTION,"feedback=NONE",laui_AnimationActionHolder,0)->Flags|=LA_UI_FLAGS_NO_DECAL|LA_UI_FLAGS_NO_GAP;
  1371. }
  1372. row=laBeginRow(uil,cl,0,0);
  1373. laShowItemFull(uil,cl,0,"LA_animation_new_action",0,"text=New",0,0);//->Flags|=LA_UI_FLAGS_ICON;
  1374. laEndRow(uil,row);
  1375. }
  1376. void laui_AnimationActionChannels(laUiList *uil, laPropPack *This, laPropPack *Extra, laColumn *UNUSED, int context){
  1377. laColumn* c=laFirstColumn(uil),*cl, *cr, *cll,*clr, *crl, *crr;
  1378. laSplitColumn(uil,c,0.3); cl=laLeftColumn(c,6); cr=laRightColumn(c,0);
  1379. laSplitColumn(uil,cl,0.75); cll=laLeftColumn(cl,0); clr=laRightColumn(cl,1);
  1380. laSplitColumn(uil,cr,0.75); crl=laLeftColumn(cr,0); crr=laRightColumn(cr,10);
  1381. laUiItem* b,*ui,*b2,*b3;
  1382. laUiItem* row=laBeginRow(uil,cll,0,0);
  1383. laShowItemFull(uil,cll,0,"LA_animation_reset_time",0,"current=true;text=1",0,0)->Flags|=LA_UI_FLAGS_EXIT_WHEN_TRIGGERED;
  1384. b=laOnConditionThat(uil,cll,laPropExpression(0,"la.animation.play_status"));{
  1385. ui=laShowItemFull(uil,cll,0,"LA_animation_set_play_status",0,"text=❚❚;",0,0);
  1386. ui->Flags|=LA_UI_FLAGS_EXIT_WHEN_TRIGGERED|LA_TEXT_ALIGN_CENTER; ui->Expand=1;
  1387. }laElse(uil,b);{
  1388. ui=laShowItemFull(uil,cll,0,"LA_animation_set_play_status",0,"icon=◀;mode=reverse;",0,0);
  1389. ui->Flags|=LA_UI_FLAGS_ICON|LA_UI_FLAGS_EXIT_WHEN_TRIGGERED; ui->Expand=1;
  1390. ui=laShowItemFull(uil,cll,0,"LA_animation_set_play_status",0,"icon=▶;mode=forward;",0,0);
  1391. ui->Flags|=LA_UI_FLAGS_ICON|LA_UI_FLAGS_EXIT_WHEN_TRIGGERED; ui->Expand=1;
  1392. }laEndCondition(uil,b);
  1393. laEndRow(uil,row);
  1394. b2=laOnConditionThat(uil,c,laPropExpression(0,"la.animation.current_action"));{
  1395. row=laBeginRow(uil,crl,0,0);
  1396. ui=laShowItemFull(uil,crl,0,"la.animation.current_action.play_head",LA_WIDGET_VALUE_METER,0,0,0);
  1397. ui->Flags|=LA_UI_FLAGS_NO_LABEL|LA_UI_FLAGS_UNDERNEATH; ui->Expand=1;
  1398. laShowItem(uil,crl,0,"la.animation.current_action.current_frame")->Flags|=LA_UI_FLAGS_NO_LABEL|LA_UI_FLAGS_NO_DECAL|LA_TEXT_ALIGN_CENTER;
  1399. laShowSeparator(uil,crl);
  1400. laShowItem(uil,crl,0,"la.animation.current_action.frame_count")->Flags|=LA_TEXT_ALIGN_CENTER;
  1401. laShowItem(uil,crl,0,"la.animation.current_action.length");
  1402. laEndRow(uil,row);
  1403. b3=laBeginRow(uil,crr,0,0);
  1404. laShowItem(uil,crr,0,"la.animation.current_action.name")->Expand=1;
  1405. laShowItemFull(uil,crr,0,"LA_animation_select_action",0,0,0,0)->Flags|=LA_UI_FLAGS_ICON;
  1406. laEndRow(uil,b3);
  1407. b=laOnConditionToggle(uil,clr,0,0,0,0,0);{
  1408. row=laBeginRow(uil,cr,0,0);
  1409. laShowItem(uil,cr,0,"la.animation.current_action.mix_mode")->Flags|=LA_UI_FLAGS_EXPAND;
  1410. laShowItem(uil,cr,0,"la.animation.current_action.play_mode")->Flags|=LA_UI_FLAGS_EXPAND;
  1411. laShowSeparator(uil,cr);
  1412. laShowItem(uil,cr,0,"la.animation.current_action.solo")->Flags|=LA_UI_FLAGS_CYCLE|LA_UI_FLAGS_HIGHLIGHT;
  1413. laShowItem(uil,cr,0,"la.animation.current_action.mute")->Flags|=LA_UI_FLAGS_CYCLE|LA_UI_FLAGS_HIGHLIGHT;
  1414. laEndRow(uil,row);
  1415. }laEndCondition(uil,b);
  1416. }laElse(uil,b2);{
  1417. laShowLabel(uil,crl,"Please select an action.",0,0);
  1418. laShowItemFull(uil,crr,0,"LA_animation_select_action",0,0,0,0);
  1419. }laEndCondition(uil,b2);
  1420. laShowCanvas(uil,c,0,"la.animation.current_action","la_AnimationActionDrawCanvas",-1);
  1421. }
  1422. void tnsui_CameraObjectProperties(laUiList *uil, laPropPack *This, laPropPack *UNUSED_Extra, laColumn *UNUSED_Colums, int context){
  1423. laColumn* c=laFirstColumn(uil);
  1424. laShowLabel(uil,c,"Camera Object",0,0)->Flags|=LA_TEXT_ALIGN_CENTER|LA_UI_FLAGS_DISABLED;
  1425. }
  1426. void tnsui_LightObjectProperties(laUiList *uil, laPropPack *This, laPropPack *UNUSED_Extra, laColumn *UNUSED_Colums, int context){
  1427. laColumn* c=laFirstColumn(uil);
  1428. laShowLabel(uil,c,"Light Object",0,0)->Flags|=LA_TEXT_ALIGN_CENTER|LA_UI_FLAGS_DISABLED;
  1429. }
  1430. void tnsui_MeshObjectProperties(laUiList *uil, laPropPack *This, laPropPack *UNUSED_Extra, laColumn *UNUSED_Colums, int context){
  1431. laColumn* c=laFirstColumn(uil);
  1432. laShowLabel(uil,c,"Mesh Object",0,0)->Flags|=LA_TEXT_ALIGN_CENTER|LA_UI_FLAGS_DISABLED;
  1433. }
  1434. void tnsui_InstancerObjectProperties(laUiList *uil, laPropPack *This, laPropPack *UNUSED_Extra, laColumn *UNUSED_Colums, int context){
  1435. laColumn* c=laFirstColumn(uil), *cl,*cr;
  1436. laSplitColumn(uil,c,0.5); cl=laLeftColumn(c,5); cr=laRightColumn(c,0);
  1437. laShowLabel(uil,cl,"Instance",0,0); laShowItemFull(uil,cr,This,"default_instance",LA_WIDGET_COLLECTION_SELECTOR,0,laui_IdentifierOnly,0);
  1438. laShowLabel(uil,cl,"Runtime",0,0); laShowItemFull(uil,cr,This,"runtime_instance",LA_WIDGET_COLLECTION_SELECTOR,0,laui_IdentifierOnly,0);
  1439. }
  1440. void tnsui_BaseObjectProperties(laUiList *uil, laPropPack *This, laPropPack *UNUSED_Extra, laColumn *UNUSED_Colums, int context){
  1441. laColumn* c=laFirstColumn(uil); laUiItem* g; laUiList* gu; laColumn* gc,*gcl,*gcr;
  1442. g=laMakeGroup(uil,c,"Object",0); gu=g->Page; gc=laFirstColumn(gu);
  1443. laUiItem* b1=laOnConditionToggle(gu,gc,0,0,0,0,0);{ strSafeSet(&b1->ExtraInstructions,"text=Transformations");
  1444. //b1->State=LA_UI_ACTIVE;
  1445. laSplitColumn(gu,gc,0.5); gcl=laLeftColumn(gc,0); gcr=laRightColumn(gc,0);
  1446. laShowLabel(gu,gcl,"Location",0,0); laShowItem(gu,gcl,This,"location")->Flags|=LA_UI_FLAGS_TRANSPOSE;
  1447. laShowLabel(gu,gcr,"Rotation",0,0); laShowItem(gu,gcr,This,"rotation")->Flags|=LA_UI_FLAGS_TRANSPOSE;
  1448. laShowLabel(gu,gcl,"Scale",0,0); laShowItem(gu,gcr,This,"scale");
  1449. laUiItem* b=laOnConditionToggle(gu,gc,0,0,0,0,0);{ strSafeSet(&b->ExtraInstructions,"text=Delta");
  1450. laShowLabel(gu,gcl,"Delta Loc",0,0); laShowItem(gu,gcl,This,"dlocation")->Flags|=LA_UI_FLAGS_TRANSPOSE;
  1451. laShowLabel(gu,gcr,"Delta Rot",0,0); laShowItem(gu,gcr,This,"drotation")->Flags|=LA_UI_FLAGS_TRANSPOSE;
  1452. laShowLabel(gu,gcl,"Delta Scale",0,0);laShowItem(gu,gcr,This,"dscale");
  1453. }laEndCondition(gu,b);
  1454. laShowSeparator(gu,gc);
  1455. }laEndCondition(gu,b1);
  1456. }
  1457. void tnsuidetached_ObjectProperties(laPanel* p){
  1458. la_MakeDetachedProp(p, "la.detached_view_switch", "detached");
  1459. la_MakeDetachedProp(p, "tns.world.root_objects", "root_object");
  1460. }
  1461. void tnsui_ObjectProperties(laUiList *uil, laPropPack *This, laPropPack *Extra, laColumn *UNUSED, int context){
  1462. laColumn* c=laFirstColumn(uil),*cl, *cr;
  1463. laSplitColumn(uil,c,0.2); cl=laLeftColumn(c,1); cr=laRightColumn(c,0);
  1464. laShowItemFull(uil,cl,Extra,"detached",0,0,0,0)->Flags|=LA_UI_FLAGS_HIGHLIGHT|LA_UI_FLAGS_ICON;
  1465. #define ADD_PAGE1(base,path) \
  1466. laUiItem* b=laBeginRow(uil,cr,0,0);\
  1467. laUiItem* rb=laShowItemFull(uil,cr,base,path,LA_WIDGET_COLLECTION_SELECTOR,0,laui_IdentifierOnly,0);\
  1468. rb->Flags|=LA_UI_COLLECTION_SIMPLE_SELECTOR;\
  1469. laUiItem* b2=laOnConditionThat(uil,cr,laPropExpression(&rb->PP,""));{\
  1470. laShowItem(uil,cr,&rb->PP,"name")->Flags|=LA_UI_FLAGS_NO_DECAL;\
  1471. laUiItem* b3=laOnConditionThat(uil,cr,laPropExpression(&rb->PP,"active"));{\
  1472. laShowLabel(uil,cr,"⯈",0,0); laShowItem(uil,cr,&rb->PP,"active.name")->Flags|=LA_UI_FLAGS_NO_DECAL;\
  1473. }laEndCondition(uil,b3);\
  1474. }laEndCondition(uil,b2);\
  1475. laEndRow(uil,b);\
  1476. laUiItem* g; laUiList* gu; laColumn* gc;\
  1477. g=laMakeEmptyGroup(uil,c,"Object",0); gu=g->Page; gc=laFirstColumn(gu); g->Flags|=LA_UI_FLAGS_NO_DECAL;
  1478. #define ADD_PAGE2 \
  1479. laUiItem* b3=laOnConditionThat(gu,gc,laPropExpression(&actui->PP,""));{\
  1480. tnsui_BaseObjectProperties(gu,&actui->PP,0,0,0);\
  1481. }laElse(gu,b3);{\
  1482. laShowLabel(gu,gc,"No active object.",0,0)->Flags|=LA_TEXT_ALIGN_CENTER|LA_UI_FLAGS_DISABLED;;\
  1483. }laEndCondition(gu,b3);
  1484. laUiItem* b0=laOnConditionThat(uil,c,laPropExpression(Extra,"detached"));{
  1485. ADD_PAGE1(Extra,"root_object")
  1486. laUiItem* actui=laShowItem(gu,gc,&rb->PP,"active"); actui->Flags|=LA_UI_COLLECTION_NO_HIGHLIGHT|LA_UI_FLAGS_NO_DECAL;
  1487. ADD_PAGE2
  1488. }laElse(uil,b0);{
  1489. ADD_PAGE1(0,"tns.world.active_root")
  1490. laUiItem* actui=laShowItemFull(gu,gc,0,"tns.world.active_root.active",LA_WIDGET_COLLECTION_SINGLE,0,0,0);
  1491. actui->Flags|=LA_UI_COLLECTION_NO_HIGHLIGHT|LA_UI_FLAGS_NO_DECAL;
  1492. ADD_PAGE2
  1493. }laEndCondition(uil,b0);
  1494. #undef ADD_PAGE1
  1495. #undef ADD_PAGE2
  1496. }
  1497. void la_RegisterBuiltinTemplates(){
  1498. laRegisterUiTemplate("LAUI_object_properties", "Properties", tnsui_ObjectProperties, tnsuidetached_ObjectProperties, 0, 0, 0,15,25);
  1499. laRegisterUiTemplate("LAUI_animation_actions", "Actions", laui_AnimationActions, 0, 0, 0, 0,15,25);
  1500. laRegisterUiTemplate("LAUI_animation_action_channels", "Action Channels", laui_AnimationActionChannels, 0, 0, 0, 0,20,15);
  1501. laRegisterUiTemplate("LAUI_input_mapper","Input Mapper",laui_InputMapper,0,0,"Controlling",0,0,0);
  1502. laRegisterUiTemplate("LAUI_drivers","Drivers",laui_Drivers,lauidetached_Drivers,0,0,0,0,0);
  1503. laRegisterUiTemplate("LAUI_controllers", "Controllers", laui_GameController, lauidetached_GameController, 0,0,0,0,0);
  1504. laRegisterUiTemplate("LAUI_user_preferences", "User Preferences", laui_UserPreference, 0, 0, "System",0,25,25);
  1505. laRegisterUiTemplate("LAUI_about", "About", laui_About, 0, 0, 0, 0,15,25);
  1506. laRegisterUiTemplate("LAUI_texture_inspector", "Texture Inspector", laui_TextureInspector, lauidetached_TextureInspector, 0, 0, 0,0,0);
  1507. laRegisterUiTemplate("LAUI_data_manager", "Data Manager", laui_IdleDataManager, lauidetached_IdleDataManager, 0, 0, 0,25,25);
  1508. laRegisterUiTemplate("LAUI_histories", "Histories", laui_UndoHistories, 0, 0, 0, 0,10,25);
  1509. laRegisterUiTemplate("LAUI_terminal", "Terminal", laui_Terminal, 0, 0, 0, 0,20,25);
  1510. }