*/}}
1
0

la_templates.c 69 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567
  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);
  176. cl = laLeftColumn(c, 1);
  177. cr = laRightColumn(c, 0);
  178. laSplitColumn(uil, cr, 0.5);
  179. crrl = laLeftColumn(cr, 1*6);
  180. crrr = laRightColumn(cr, 0);
  181. laPropContainer* subc=Base->LastPs->p->SubProp;
  182. if (!((laSubProp*)Base->LastPs->p)->GetType){
  183. if (!subc) subc = la_ContainerLookup(((laSubProp *)Base->LastPs->p)->TargetID);
  184. if (!subc) return; Base->LastPs->p->SubProp=subc;
  185. }else{
  186. subc=((laSubProp*)Base->LastPs->p)->GetType(Base->EndInstance);
  187. }
  188. if (!Base->LastPs->p->UDFIsRefer && !Base->LastPs->p->UDFNoCreate && !Base->LastPs->p->UDFIsSingle){
  189. laShowItem(uil, cr, Base, "identifier")->Flags|=LA_UI_FLAGS_PLAIN;
  190. bracket = laOnConditionToggle(uil, cl, 0, 0, 0, 0, 0);
  191. }
  192. for (p = subc->Props.pFirst; p; p = p->Item.pNext){
  193. if (!(p->PropertyType & LA_PROP_SUB)){
  194. buf[0] = 0;
  195. sprintf(buf, "la.prop_containers#%s.properties#%s.name", p->Container->Identifier, p->Identifier);
  196. laShowItemFull(uil, crrl, 0, buf, LA_WIDGET_STRING_PLAIN,0, 0, 0);
  197. laShowItem(uil, crrr, Base, p->Identifier);
  198. //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);
  199. //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);
  200. laShowSeparator(uil, c);
  201. }else{
  202. //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);
  203. //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);
  204. //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);
  205. if (p->UDFIsRefer) laShowLabel(uil, crrr, "🠞", 0, 0);
  206. elif (p->UDFNoCreate) laShowLabel(uil, crrr, "n", 0, 0);
  207. else laShowLabel(uil, crrr, "🗇", 0, 0);
  208. buf[0] = 0;
  209. sprintf(buf, "la.prop_containers#%s.icon_id", ((laSubProp *)p)->TargetID);
  210. laShowIcon(uil, cl, 0, buf, 0);
  211. b1 = laOnConditionToggle(uil, crrl, 0, 0, 0, 0, 0);{ b1->Flags|=LA_TEXT_ALIGN_LEFT;
  212. sprintf(buf, "text=...%s;", p->Name);
  213. strSafeSet(&b1->ExtraInstructions, buf);
  214. laUiDefineFunc f=laui_SubPropInfoDefault;
  215. if(!context) f=((laSubProp*)p)->GetType?0:(p->UiDefine?p->UiDefine:(p->SubProp&&p->SubProp->UiDefine?p->SubProp->UiDefine:laui_SubPropInfoDefault));
  216. laShowItemFull(uil, cr, Base, p->Identifier, 0,0, f, context);
  217. }
  218. laEndCondition(uil, b1);
  219. laShowSeparator(uil, c);
  220. }
  221. }
  222. if (!Base->LastPs->p->UDFIsRefer && !Base->LastPs->p->UDFNoCreate && !Base->LastPs->p->UDFIsSingle){
  223. laEndCondition(uil, bracket);
  224. }
  225. //laShowItemFull(uil, crl, Base, "identifier", 0, 0, 0);
  226. //p = Base->LastPs->p->SubProp->Props.pFirst;
  227. }
  228. void laui_SubPropSelection(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context){
  229. laColumn *c, *cl, *cr, *cll, *clr, *crl, *crr, *crrl, *crrr;
  230. laUiItem *bracket, *b1, *b2;
  231. laPropContainer *pc;
  232. laProp *p;
  233. laPropPack *pp;
  234. char buf[LA_RAW_CSTR_MAX_LEN]={0};
  235. c = laFirstColumn(uil);
  236. laSplitColumn(uil, c, 0.2);
  237. cl = laLeftColumn(c, 1);
  238. cr = laRightColumn(c, 0);
  239. laSplitColumn(uil, cr, 0.8);
  240. crl = laLeftColumn(cr, 0);
  241. crr = laRightColumn(cr, 100);
  242. laSplitColumn(uil, crl, 0.5);
  243. crrl = laLeftColumn(crl, 150);
  244. crrr = laRightColumn(crl, 0);
  245. if (!Base->LastPs->p->SubProp) Base->LastPs->p->SubProp = la_ContainerLookup(((laSubProp *)Base->LastPs->p)->TargetID);
  246. if (!Base->LastPs->p->UDFIsRefer){
  247. laShowItemFull(uil, cr, Base, "identifier", LA_WIDGET_STRING_PLAIN,0, 0, 0);
  248. bracket = laOnConditionToggle(uil, cl, 0, 0, 0, 0, 0);
  249. }
  250. for (p = Base->LastPs->p->SubProp->Props.pFirst; p; p = p->Item.pNext){
  251. if (p->PropertyType == LA_PROP_SUB){
  252. //buf[0] = 0; sprintf(buf, "la.prop_containers#%s.properties#%s.name", p->Container->Identifier, p->Identifier);
  253. //laShowItemFull(uil, crrl, 0, buf, LA_WIDGET_STRING_PLAIN, 0, 0);
  254. buf[0] = 0;
  255. sprintf(buf, "identifier=%s;", p->Identifier);
  256. laShowItemFull(uil, crrr, Base, "put_data_block", 0, buf, 0, 0);
  257. //laShowLabel(uil, crr, "PUT", 0, 0);
  258. b1 = laOnConditionToggle(uil, crrl, 0, 0, 0, 0, 0);{
  259. buf[0] = 0; sprintf(buf, "text=...%s;", p->Name); strSafeSet(&b1->ExtraInstructions, buf);
  260. laShowItemFull(uil, cr, Base, p->Identifier, 0,0, laui_SubPropSelection, 0)->Flags|=LA_TEXT_ALIGN_LEFT;
  261. }
  262. laEndCondition(uil, b1);
  263. laShowSeparator(uil, c);
  264. }
  265. }
  266. if (!Base->LastPs->p->UDFIsRefer){
  267. laEndCondition(uil, bracket);
  268. }
  269. //laShowItemFull(uil, crl, Base, "identifier", 0, 0, 0);
  270. //p = Base->LastPs->p->SubProp->Props.pFirst;
  271. }
  272. void laui_LinkerSelectionProp(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context){
  273. laColumn *c, *cl, *cr, *cll, *clr, *crl, *crr, *crrl, *crrr;
  274. laUiItem *bracket, *b1, *b2;
  275. laPropContainer *pc;
  276. laProp *p;
  277. laPropPack *pp;
  278. char buf[LA_RAW_CSTR_MAX_LEN]={0};
  279. c = laFirstColumn(uil);
  280. laSplitColumn(uil, c, 0.4);
  281. cl = laLeftColumn(c, 1);
  282. cr = laRightColumn(c, 0);
  283. b1=laBeginRow(uil,cr,0,0);
  284. laShowItemFull(uil, cr, Base, "identifier", LA_WIDGET_STRING_PLAIN,0, 0, 0);
  285. laShowIcon(uil, cr, Base, "pp.last_ps.property.sub_icon_id", 0);
  286. laEndRow(uil,b1);
  287. bracket = laOnConditionToggle(uil, cl, 0, 0, 0, 0, 0);{
  288. laShowItemFull(uil, cr, Base, "instances", 0,0, laui_LinkerSelectionInstance, 0);
  289. }
  290. bracket->State=LA_BT_ACTIVE;
  291. laEndCondition(uil, bracket);
  292. }
  293. void laui_LinkerSelectionInstance(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context){
  294. laColumn *c, *cl, *cr, *cll, *clr, *crl, *crr, *crrl, *crrr;
  295. laUiItem *bracket, *b1, *b2;
  296. laPropContainer *pc;
  297. laProp *p;
  298. laPropPack *pp;
  299. char buf[LA_RAW_CSTR_MAX_LEN]={0};
  300. c = laFirstColumn(uil);
  301. laSplitColumn(uil, c, 0.4);
  302. cl = laLeftColumn(c, 1);
  303. cr = laRightColumn(c, 0);
  304. laShowItemFull(uil, cr, Base, "identifier", LA_WIDGET_STRING_PLAIN,0, 0, 0);
  305. b1 = laOnConditionToggle(uil, cl, 0, 0, 0, 0, 0);{
  306. laShowItemFull(uil, cr, Base, "children", 0,0, laui_LinkerSelectionProp, 0);
  307. }
  308. laEndCondition(uil, b1);
  309. }
  310. void laui_DefaultPanelTitleBar(laUiList *uil, laPropPack *Base, laPropPack *Extra, laUiDefineFunc header){
  311. laColumn *c, *cl, *cr, *cll, *clr, *crl, *crr, *cb1, *cb2, *cb3;
  312. laUiItem *bracket, *b1, *b2;
  313. c = laFirstColumn(uil);
  314. laSplitColumn(uil, c, 0.3);
  315. cl = laLeftColumn(c, 1);
  316. cr = laRightColumn(c, 0);
  317. b1=laBeginRow(uil,cr,0,0);
  318. laUiItem* tu=laShowItemFull(uil, cr, Base, "title", LA_WIDGET_STRING_PLAIN,0, 0, 0);tu->Expand=1;tu->Flags|=LA_UI_FLAGS_NO_TOOLTIP;
  319. laShowItem(uil, cr, Base, "hide")->Flags|=LA_UI_FLAGS_ICON;
  320. laShowItem(uil, cr, Base, "dock")->Flags|=LA_UI_FLAGS_ICON;
  321. laShowItem(uil, cr, Base, "close")->Flags|=LA_UI_FLAGS_ICON;
  322. laEndRow(uil,b1);
  323. bracket = laOnConditionToggle(uil, cl, 0, 0, 0, 0, 0);{
  324. if(!Extra->LastPs->p->SubProp->Props.pFirst){
  325. laShowLabel(uil, cr, "Panel doesn't have configurable property.", 0, 0);
  326. }else{
  327. if(header){
  328. laShowLabel(uil, cr, "Panel properties:", 0, 0);
  329. header(uil, Base, Extra, cr, 0);
  330. }else{
  331. for(laProp* p = Extra->LastPs->p->SubProp->Props.pFirst;p;p=p->Item.pNext){
  332. laShowItem(uil, cr, Extra, p->Identifier);
  333. }
  334. }
  335. }
  336. //laShowItem(uil, cr, 0,"la.example_int");
  337. laShowSeparator(uil, c);
  338. //laShowLabel(uil, c, "Position:", 0, 0);
  339. //laShowItemFull(uil, c, Base, "position", LA_WIDGET_INT, 0, 0);
  340. //laShowLabel(uil, c, "Size:", 0, 0);
  341. //laShowItemFull(uil, c, Base, "size", LA_WIDGET_INT, 0, 0);
  342. //laShowLabel(uil, c, "Snapping:", 0, 0);
  343. //laShowItem(uil, c, Base, "snap_enable")->Flags=LA_UI_FLAGS_CYCLE|LA_UI_FLAGS_TRANSPOSE;
  344. //laShowItemFull(uil, c, Base, "snap", LA_WIDGET_INT, 0, 0);
  345. }
  346. laEndCondition(uil, bracket);
  347. }
  348. void laui_DefaultOperatorPanelTitleBar(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context){
  349. laColumn *c, *cl, *cr, *cll, *clr, *crl, *crr;
  350. laUiItem *bracket, *b1, *b2;
  351. c = laFirstColumn(uil);
  352. b1 = laBeginRow(uil,c,0,0);
  353. laUiItem* tu=laShowItemFull(uil, c, Base, "title", LA_WIDGET_STRING_PLAIN,0, 0, 0);tu->Expand=1;tu->Flags|=LA_UI_FLAGS_NO_TOOLTIP;
  354. laShowItem(uil, c, 0, "LA_cancel");//->Flags|=LA_UI_FLAGS_ICON;
  355. laEndRow(uil, b1);
  356. }
  357. void laui_ColumnItem(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *UNUSED_Colums, int context){
  358. laColumn *c0, *c, *cl, *cr, *cll, *clr, *crl, *crr, *clll, *cllr, *cll2, *clr2;
  359. laUiItem *bracket, *b1, *b2;
  360. c0 = laFirstColumn(uil);
  361. laSplitColumn(uil, c0, 0.8);
  362. cll = laLeftColumn(c0, 80);
  363. c = laRightColumn(c0, 0);
  364. laSplitColumn(uil, c, 0.7);
  365. cl = laLeftColumn(c, 0);
  366. cr = laRightColumn(c, 200);
  367. laSplitColumn(uil, cr, 0.5);
  368. crl = laLeftColumn(cr, 0);
  369. crr = laRightColumn(cr, 70);
  370. laSplitColumn(uil, cll, 0.5);
  371. clll = laLeftColumn(cll, 1);
  372. cllr = laRightColumn(cll, 0);
  373. laSplitColumn(uil, cl, 0.5);
  374. cll2 = laLeftColumn(cl, 0);
  375. clr2 = laRightColumn(cl, 70);
  376. //laShowItem(uil, c, Base, "self");
  377. bracket = laOnConditionThat(uil, crr, laPropExpression(0, "live_editor.current_ui")); // laOnConditionThat(uil, 0, "live_editor", la_LiveEditAllowShow);
  378. laShowItemFull(uil, cll, Base, "select_column", 0, "text=Select;", 0, 0);
  379. laEndCondition(uil, bracket);
  380. bracket = laOnConditionThat(uil, c, laPropExpression(Base, "sub_left"));{ //laOnConditionThat(uil, Base, 0, laui_SnapButtonShow); {
  381. laShowItem(uil, cll2, Base, "split_at");
  382. laShowItemFull(uil, clr2, Base, "merge_column", 0, "text=Merge;", 0, 0);
  383. b1 = laOnConditionThat(uil, c, laPropExpression(Base, "snap_state"));{
  384. laShowItem(uil, crl, Base, "snap_width");
  385. }
  386. laElse(uil, b1);{
  387. laShowLabel(uil, crl, "Align:", 0, 0)->Flags|=LA_TEXT_ALIGN_RIGHT;
  388. }
  389. laEndCondition(uil, b1);
  390. laShowItem(uil, crr, Base, "snap_state");
  391. laShowSeparator(uil, c0);
  392. b1 = laOnConditionToggle(uil, clll, 0, 0, 0, 0, 0);{
  393. laShowItemFull(uil, c, Base, "sub_left", LA_WIDGET_COLLECTION_SINGLE,0, laui_ColumnItem, 0);
  394. }
  395. laElse(uil, b1);{
  396. laShowLabel(uil, cllr, "Left", 0, 0);
  397. }
  398. laEndCondition(uil, b1);
  399. laShowSeparator(uil, c0);
  400. b1 = laOnConditionToggle(uil, clll, 0, 0, 0, 0, 0);{
  401. laShowItemFull(uil, c, Base, "sub_right", LA_WIDGET_COLLECTION_SINGLE,0, laui_ColumnItem, 0);
  402. }
  403. laElse(uil, b1);{
  404. laShowLabel(uil, cllr, "Right", 0, 0);
  405. }
  406. laEndCondition(uil, b1);
  407. }
  408. laElse(uil, bracket);{
  409. laShowItem(uil, c, Base, "split_column");
  410. }
  411. laEndCondition(uil, bracket);
  412. }
  413. void laui_DefaultMenuButtonsFileEntries(laUiList *uil, laPropPack *pp, laPropPack *actinst, laColumn *extracol, int context){
  414. laColumn* c=laFirstColumn(uil);
  415. laShowLabel(uil, c, "Function Test", 0, 0)->Flags|=LA_TEXT_MONO|LA_UI_FLAGS_DISABLED;
  416. laShowItem(uil, c, 0, "LA_pure_yes_no");
  417. laShowItem(uil, c, 0, "LA_file_dialog");
  418. laShowItem(uil, c, 0, "LA_udf_read");
  419. laShowItemFull(uil, c, 0, "LA_udf_read",0,"mode=append;text=Append",0,0);
  420. laShowItem(uil, c, 0, "LA_managed_save");
  421. laShowItem(uil, c, 0, "LA_manage_udf");
  422. laShowLabel(uil, c, "Other Entries", 0, 0)->Flags|=LA_TEXT_MONO|LA_UI_FLAGS_DISABLED;
  423. laShowItem(uil, c, 0, "LA_terminate_program");
  424. }
  425. void laui_DefaultMenuButtonsEditEntries(laUiList *uil, laPropPack *pp, laPropPack *actinst, laColumn *extracol, int context){
  426. laColumn* c=laFirstColumn(uil);
  427. laShowLabel(uil, c, "History", 0, 0)->Flags|=LA_TEXT_MONO|LA_UI_FLAGS_DISABLED;
  428. laShowItem(uil, c, 0, "LA_undo")->Flags|=LA_UI_FLAGS_NO_CONFIRM;
  429. laShowItem(uil, c, 0, "LA_redo")->Flags|=LA_UI_FLAGS_NO_CONFIRM;
  430. laShowSeparator(uil,c);
  431. laShowItemFull(uil, c, 0, "LA_panel_activator",0,"panel_id=LAUI_histories;text=Histories",0,0);
  432. }
  433. void laui_DefaultMenuButtonsOptionEntries(laUiList *uil, laPropPack *pp, laPropPack *actinst, laColumn *extracol, int context){
  434. laColumn* c=laFirstColumn(uil);
  435. laShowLabel(uil, c, "Settings", 0, 0)->Flags|=LA_TEXT_MONO|LA_UI_FLAGS_DISABLED;
  436. laShowItemFull(uil, c, 0, "LA_panel_activator", 0, "panel_id=LAUI_user_preferences;", 0, 0);
  437. laShowLabel(uil, c, "Information", 0, 0)->Flags|=LA_TEXT_MONO|LA_UI_FLAGS_DISABLED;
  438. laShowItemFull(uil, c, 0, "LA_panel_activator", 0, "panel_id=LAUI_about;text=About;", 0, 0);
  439. }
  440. void laui_DefaultMenuButtons(laUiList *uil, laPropPack *pp, laPropPack *actinst, laColumn *extracol, int context){
  441. laUiList *muil; laColumn *mc,*c = laFirstColumn(uil);
  442. muil = laMakeMenuPage(uil, c, "File");{
  443. mc = laFirstColumn(muil); laui_DefaultMenuButtonsFileEntries(muil,pp,actinst,extracol,0);
  444. }
  445. muil = laMakeMenuPage(uil, c, "Edit");{
  446. mc = laFirstColumn(muil); laui_DefaultMenuButtonsEditEntries(muil,pp,actinst,extracol,0);
  447. }
  448. muil = laMakeMenuPage(uil, c, "Options"); {
  449. mc = laFirstColumn(muil); laui_DefaultMenuButtonsOptionEntries(muil,pp,actinst,extracol,0);
  450. }
  451. }
  452. void laui_DefaultMenuExtras(laUiList *uil, laPropPack *pp, laPropPack *actinst, laColumn *extracol, int context){
  453. laColumn *c = laFirstColumn(uil);
  454. laShowLabel(uil, c, MAIN.MenuProgramName, 0, 0)->Expand=1;
  455. }
  456. void laui_DefaultMenuBarActual(laUiList *uil, laPropPack *pp, laPropPack *actinst, laColumn *extracol, int context){
  457. laUiList *muil;
  458. laColumn *c,*mc;
  459. laUiItem* bb;
  460. c = laFirstColumn(uil);
  461. laUiItem* row=laBeginRow(uil,c,0,0);
  462. bb=laOnConditionThat(uil,c,laPropExpression(0,"la.windows.operator_hints"));{
  463. laShowItem(uil,c,0,"la.windows.operator_hints");
  464. }laElse(uil,bb);{
  465. laShowItem(uil, c, 0, "LA_new_panel")->Flags=LA_UI_FLAGS_ICON;
  466. if(MAIN.MenuButtons){ MAIN.MenuButtons(uil,0,0,0,0); }
  467. laShowSeparator(uil,c);
  468. laUiItem* mui=laOnConditionThat(uil,c,laPropExpression(0,"la.windows.maximized_ui"));{
  469. laShowItemFull(uil,c,0,"LA_canvas_ui_maximize", 0, "icon=🡰;restore=true;text=Restore Layout", 0, 0);
  470. }laElse(uil,mui);{
  471. laUiItem* ui=laOnConditionThat(uil,c,laPropExpression(0,"la.windows.maximized_block"));{
  472. laShowItemFull(uil,c,0,"LA_block_maximize", 0, "icon=🡰;restore=true;text=Restore Layout", 0, 0);
  473. }laElse(uil,ui);{
  474. laShowItemFull(uil, c, 0, "LA_switch_layout", 0, "icon=🞐;show_list=true;", 0, 0)->Flags|=LA_UI_FLAGS_ICON;
  475. laShowItemFull(uil,c,0,"LA_switch_layout", 0, "icon=🡰;reverse=true;", 0, 0)->Flags|=LA_UI_FLAGS_ICON;
  476. laShowItemFull(uil,c,0,"LA_switch_layout", 0, "icon=🡲;", 0,0)->Flags|=LA_UI_FLAGS_ICON;
  477. laShowItem(uil, c, 0, "la.windows.layouts.identifier");
  478. laShowItem(uil,c,0,"LA_new_window")->Flags|=LA_UI_FLAGS_ICON;
  479. }laEndCondition(uil, ui);
  480. }laEndCondition(uil,mui);
  481. laShowSeparator(uil,c);
  482. laShowItem(uil,c,0,"la.windows.output_color_space");
  483. laShowItemFull(uil,c,0,"la.windows.output_show_overflow",0,"text=🟩;",0,0);
  484. if(MAIN.MenuExtras){ laShowSeparator(uil,c); MAIN.MenuExtras(uil,0,0,0,0); }
  485. laUiItem* b1=laOnConditionThat(uil,c,laPropExpression(0,"la.windows.panels_hidden"));
  486. laShowSeparator(uil,c);
  487. muil = laMakeMenuPage(uil, c, "🡻 Minimized");{
  488. mc = laFirstColumn(muil);
  489. laShowItemFull(muil, mc, 0, "la.windows.panels_hidden", 0,0, laui_IdentifierOnly,0);
  490. }
  491. laEndCondition(uil, b1);
  492. b1=laOnConditionThat(uil,c,laPropExpression(0,"la.windows.is_fullscreen"));{
  493. laShowItemFull(uil,c,0,"LA_fullscreen",0,"restore=true;text=Restore;icon=🡷",0,0)->Flags|=LA_UI_FLAGS_EXIT_WHEN_TRIGGERED;
  494. }laElse(uil,b1);{
  495. laShowItemFull(uil,c,0,"LA_fullscreen",0,0,0,0)->Flags|=LA_UI_FLAGS_EXIT_WHEN_TRIGGERED;
  496. }laEndCondition(uil, b1);
  497. }laEndCondition(uil,bb);
  498. laEndRow(uil,row);
  499. }
  500. void laui_DefaultMenuBar(laWindow *w){
  501. laPanel *p;
  502. p =laCreateTopPanel(w, 0, 0, 0, 0, LA_RH, 0, 0, 0, 0, -1, -1, -1, 0);
  503. p->IsMenuPanel = 1;
  504. laui_DefaultMenuBarActual(&p->TitleBar, &p->PP, &p->PropLinkPP, 0, 0);
  505. }
  506. void laui_ThemeListItem(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *UNUSED_Colums, int context){
  507. laColumn *col, *cl, *cr;
  508. laUiItem *bracket;
  509. col = laFirstColumn(uil);
  510. bracket = laBeginRow(uil,col,0,0);
  511. laShowItemFull(uil, col, Base, "name", LA_WIDGET_STRING_PLAIN,0, 0, 0)->Expand=1;
  512. laShowItemFull(uil, col, Base, "author", LA_WIDGET_STRING_PLAIN,0, 0, 0);
  513. laEndRow(uil,bracket);
  514. }
  515. void laui_Theme(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *UNUSED_Colums, int context){
  516. laColumn *col, *cl, *cr, *cll, *clr;
  517. laUiItem *sui;
  518. laUiList *tuil;
  519. laUiItem *ui;
  520. //col = laFirstColumn(uil);
  521. //tuil = laMakeGroup(uil, col, "����ժҪ", 0, 0)->Page; {
  522. // col = laFirstColumn(tuil);
  523. // laSplitColumn(tuil, col, 0.7);
  524. // cl = laLeftColumn(col, 0);
  525. // cr = laRightColumn(col, 0);
  526. // laSplitColumn(tuil, cr, 0.6);
  527. // crl = laLeftColumn(cr, 0);
  528. // crr = laRightColumn(cr, 70);
  529. // laShowItemFull(tuil, cl, 0, "themes.name", 0, 0, 0);
  530. // laShowItemFull(tuil, crl, 0, "themes.author", 0, 0, 0);
  531. // laShowLabel(tuil, crr, 0, "EXEC", 0, 0, 0);
  532. //}
  533. col = laFirstColumn(uil); laSplitColumn(uil,col,0.5);
  534. cl=laLeftColumn(col,0);
  535. cr=laRightColumn(col,0);
  536. ui=laBeginRow(uil,col, 0,0);
  537. laShowItem(uil,col,Base, "name")->Expand=1;
  538. laShowItem(uil,col,Base, "delete");
  539. laEndRow(uil, ui);
  540. laShowLabel(uil, col, "Basics:",0,0);
  541. laShowLabel(uil, cl, "Base Color:",0,0)->Flags|=LA_TEXT_ALIGN_RIGHT; laShowItem(uil, cr, Base, "color");
  542. laShowLabel(uil, cl, "Accent Color:",0,0)->Flags|=LA_TEXT_ALIGN_RIGHT; laShowItem(uil, cr, Base, "accent_color");
  543. laShowItem(uil, cr, Base, "cursor_alpha");
  544. laShowItem(uil, cr, Base, "selection_alpha");
  545. laShowItem(uil, cr, Base, "inactive_mix");
  546. laShowItem(uil, cr, Base, "inactive_saturation");
  547. laShowLabel(uil, col, "Nodes:",0,0);
  548. laShowItem(uil, cr, Base, "wire_brightness");
  549. laShowItem(uil, cr, Base, "wire_saturation");
  550. laShowItem(uil, cr, Base, "wire_transparency");
  551. laShowLabel(uil, col, "Meshes:",0,0);
  552. laShowItem(uil, cl, Base, "edge_transparency");
  553. laShowItem(uil, cl, Base, "edge_brightness");
  554. laShowItem(uil, cr, Base, "vertex_transparency");
  555. laShowItem(uil, cr, Base, "vertex_brightness");
  556. laShowItem(uil, col, Base, "svertex_transparency");
  557. laShowItem(uil, col, Base, "sedge_transparency");
  558. laShowItem(uil, col, Base, "sface_transparency");
  559. laShowLabel(uil, col, "Widgets:",0,0);
  560. laShowItem(uil, col, Base, "boxed_themes");
  561. }
  562. void laui_BoxedThemeItem(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *UNUSED_Colums, int context){
  563. laColumn *col, *cl, *cr, *crl,*crr;
  564. laUiItem *bracket;
  565. laUiList *tuil;
  566. col = laFirstColumn(uil);
  567. laSplitColumn(uil, col, 0.8);
  568. cl = laLeftColumn(col, 1);
  569. cr = laRightColumn(col, 0);
  570. laSplitColumn(uil, cr, 0.5);
  571. crl = laLeftColumn(cr, 0);
  572. crr = laRightColumn(cr, 0);
  573. laShowItemFull(uil, cr, Base, "name", LA_WIDGET_STRING_PLAIN, 0 ,0,0);
  574. bracket = laOnConditionToggle(uil, cl, 0, 0, 0, 0, 0);{
  575. laShowItem(uil, cr, Base, "normal");
  576. laShowItem(uil, cr, Base, "active");
  577. laShowItem(uil, cr, Base, "border");
  578. laShowItem(uil, cr, Base, "text");
  579. laShowItem(uil, cr, Base, "text_active");
  580. laShowItem(uil, cr, Base, "alpha");
  581. laShowLabel(uil,crl,"Margins:",0,0);
  582. laShowItem(uil, crl, Base, "margins")->Flags=LA_UI_FLAGS_TRANSPOSE;
  583. laShowLabel(uil,crr,"Paddings:",0,0);
  584. laShowItem(uil, crr, Base, "paddings")->Flags=LA_UI_FLAGS_TRANSPOSE;
  585. }
  586. laEndCondition(uil, bracket);
  587. }
  588. void laui_PropertyContainerList(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *UNUSED_Colums, int context){
  589. laColumn *col, *cl, *cr, *crl, *crr, *cll, *clr, *crrl, *crrr;
  590. laUiItem *bracket;
  591. laUiList *tuil;
  592. col = laFirstColumn(uil);
  593. laSplitColumn(uil, col, 0.5);
  594. cl = laLeftColumn(col, 60);
  595. cr = laRightColumn(col, 0);
  596. laSplitColumn(uil, cr, 0.25);
  597. crl = laLeftColumn(cr, 0);
  598. crr = laRightColumn(cr, 0);
  599. laSplitColumn(uil, crr, 0.3);
  600. crrl = laLeftColumn(crr, 0);
  601. crrr = laRightColumn(crr, 0);
  602. laShowLabel(uil, cl, "Select", 0, 0);
  603. laShowLabel(uil, crl, "Identifier", 0, 0);
  604. laShowLabel(uil, crrl, "Name", 0, 0);
  605. laShowLabel(uil, crrr, "Description", 0, 0);
  606. laShowColumnAdjuster(uil, col);
  607. laShowItem(uil, col, Base, "properties");
  608. }
  609. void laui_WindowListItem(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *UNUSED_Colums, int context){
  610. laColumn *col, *cl, *cr, *cll, *clr;
  611. laUiItem *bracket;
  612. laUiList *tuil;
  613. cl = laFirstColumn(uil);
  614. laSplitColumn(uil, cl, 0.2);
  615. cll = laLeftColumn(cl, 1);
  616. clr = laRightColumn(cl, 0);
  617. laShowItem(uil, clr, Base, "title");
  618. bracket = laOnConditionToggle(uil, cll, 0, 0, 0, 0, 0);{
  619. laShowLabel(uil, clr, "Layouts", 0, 0);
  620. laShowItem(uil, clr, Base, "layouts");
  621. laShowLabel(uil, clr, "TopPanels", 0, 0);
  622. laShowItem(uil, clr, Base, "panels");
  623. }
  624. laEndCondition(uil, bracket);
  625. }
  626. void laui_LayoutListItem(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *UNUSED_Colums, int context){
  627. laColumn *col, *cl, *cr, *cll, *clr;
  628. laUiItem *bracket;
  629. laUiList *tuil;
  630. cl = laFirstColumn(uil);
  631. laSplitColumn(uil, cl, 0.2);
  632. cll = laLeftColumn(cl, 1);
  633. clr = laRightColumn(cl, 0);
  634. laShowItem(uil, clr, Base, "title");
  635. bracket = laOnConditionToggle(uil, cll, 0, 0, 0, 0, 0);{
  636. laShowItem(uil, clr, Base, "panels");
  637. }
  638. laEndCondition(uil, bracket);
  639. }
  640. void laui_PanelListItem(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *UNUSED_Colums, int context){
  641. laColumn *col, *cl, *cr, *cll, *clr;
  642. laUiItem *bracket;
  643. laUiList *tuil;
  644. cl = laFirstColumn(uil);
  645. laSplitColumn(uil, cl, 0.2);
  646. cll = laLeftColumn(cl, 1);
  647. clr = laRightColumn(cl, 0);
  648. laShowItem(uil, clr, Base, "title");
  649. bracket = laOnConditionToggle(uil, cll, 0, 0, 0, 0, 0);{
  650. laShowItemFull(uil, clr, Base, "size", LA_WIDGET_INT,0, 0, 0);
  651. }
  652. laEndCondition(uil, bracket);
  653. }
  654. void laui_UiTemplateListItemLiveEdit(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *UNUSED_Colums, int context){
  655. laColumn *col, *cl, *cr, *cll, *clr;
  656. laUiItem *bracket;
  657. laUiList *tuil;
  658. cl = laFirstColumn(uil);
  659. //bracket = laOnConditionThat(uil, cl, laNot(laPropExpression(Base, "for_panel"))); {
  660. 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")))));{
  661. laShowItemFull(uil, cl, Base, "identifier", LA_WIDGET_STRING_PLAIN,0, 0, 0);
  662. }
  663. laElse(uil, bracket);{
  664. laShowItemFull(uil, cl, Base, "identifier", LA_WIDGET_STRING_PLAIN, "disabled=true;",0, 0);
  665. }
  666. laEndCondition(uil, bracket);
  667. }
  668. void laui_UiTemplateListItem(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *UNUSED_Colums, int context){
  669. laColumn *col, *cl, *cr, *cll, *clr, *clll, *cllr, *clrl, *clrr, *clrrl, *clrrr;
  670. laUiItem *bracket, *b1;
  671. laUiList *tuil;
  672. cl = laFirstColumn(uil);
  673. laSplitColumn(uil, cl, 0.2);
  674. cll = laLeftColumn(cl, LA_2RH);
  675. clr = laRightColumn(cl, 0);
  676. laSplitColumn(uil, cll, 0.5);
  677. clll = laLeftColumn(cll, 0);
  678. cllr = laRightColumn(cll, 0);
  679. laSplitColumn(uil, clr, 0.5);
  680. clrl = laLeftColumn(clr, 0);
  681. clrr = laRightColumn(clr, 200);
  682. laSplitColumn(uil, clrr, 0.2);
  683. clrrl = laLeftColumn(clrr, 1);
  684. clrrr = laRightColumn(clrr, 0);
  685. bracket = laOnConditionThat(uil, cll, laPropExpression(Base, "define_func"));{
  686. laShowLabel(uil, clll, "f", 0, 0);
  687. }
  688. laEndCondition(uil, bracket);
  689. bracket = laOnConditionThat(uil, cll, laPropExpression(Base, "descriptor"));{
  690. laShowLabel(uil, cllr, "🠞", 0, 0);
  691. }
  692. laEndCondition(uil, bracket);
  693. laShowItemFull(uil, clrl, Base, "identifier", LA_WIDGET_STRING_PLAIN,0, 0, 0);
  694. bracket = laOnConditionThat(uil, cll, laPropExpression(Base, "target_id"));{
  695. laShowIcon(uil, clrrl, Base, "target.icon_id", 0);
  696. laShowItemFull(uil, clrrr, Base, "target_id", LA_WIDGET_STRING_PLAIN,0, 0, 0);
  697. }
  698. laElse(uil, bracket);{
  699. b1 = laOnConditionThat(uil, cll, laPropExpression(Base, "for_panel"));{
  700. //laShowLabel(uil, clrrl, 0,, 0, 0);
  701. laShowLabel(uil, clrrr, "PANEL", 0, 0);
  702. }
  703. laElse(uil, b1);{
  704. laShowLabel(uil, clrrr, "-", 0, LA_WIDGET_STRING_PLAIN);
  705. }
  706. laEndCondition(uil, b1);
  707. }
  708. laEndCondition(uil, bracket);
  709. }
  710. void tnsui_GroupItem(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *UNUSED_Colums, int context){
  711. laColumn *col, *cl, *cr, *crl, *crr;
  712. laUiItem *b1;
  713. col = laFirstColumn(uil);
  714. laSplitColumn(uil, col, 0.3);
  715. cl = laLeftColumn(col, 1);
  716. cr = laRightColumn(col, 0);
  717. laSplitColumn(uil, cr, 0.5);
  718. crl = laLeftColumn(cr, 0);
  719. crr = laRightColumn(cr, 0);
  720. laShowItem(uil, cr, Base, "name");
  721. b1 = laOnConditionToggle(uil, cl, 0, 0, 0, 0, 0);{
  722. laShowItem(uil, cr, Base, "objects");
  723. }
  724. laEndCondition(uil, b1);
  725. }
  726. void tnsui_ObjectGroupItem(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *UNUSED_Colums, int context){
  727. laColumn *col, *cl, *cr, *crl, *crr;
  728. laUiItem *b1;
  729. col = laFirstColumn(uil);
  730. laSplitColumn(uil, col, 0.3);
  731. cl = laLeftColumn(col, 1);
  732. cr = laRightColumn(col, 0);
  733. laSplitColumn(uil, cr, 0.5);
  734. crl = laLeftColumn(cr, 0);
  735. crr = laRightColumn(cr, 0);
  736. laShowItem(uil, cr, Base, "group.name");
  737. }
  738. void tnsui_GroupObjectItem(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *UNUSED_Colums, int context){
  739. laColumn *col, *cl, *cr, *crl, *crr;
  740. laUiItem *b1;
  741. col = laFirstColumn(uil);
  742. laSplitColumn(uil, col, 0.3);
  743. cl = laLeftColumn(col, 1);
  744. cr = laRightColumn(col, 0);
  745. laSplitColumn(uil, cr, 0.5);
  746. crl = laLeftColumn(cr, 0);
  747. crr = laRightColumn(cr, 0);
  748. laShowItem(uil, cr, Base, "object.identifier");
  749. }
  750. void tnsui_MaterialItem(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *UNUSED_Colums, int context){
  751. laColumn *col, *cl, *cr, *crl, *crr;
  752. laUiItem *b1;
  753. col = laFirstColumn(uil);
  754. laSplitColumn(uil, col, 0.3);
  755. cl = laLeftColumn(col, 1);
  756. cr = laRightColumn(col, 0);
  757. laSplitColumn(uil, cr, 0.5);
  758. crl = laLeftColumn(cr, 0);
  759. crr = laRightColumn(cr, 0);
  760. laShowItem(uil, cr, Base, "object.identifier");
  761. }
  762. void laui_PlainSceneListItem(laUiList *uil, laPropPack *This, laPropPack *OP_UNUSED, laColumn *Extra, int context){
  763. laColumn *col = Extra, *c, *cl, *cr, *crl, *crr, *cll, *clr, *clrl, *clrr, *clrrl, *clrrr;
  764. laUiItem *ui;
  765. //if (Extra)c = Extra;
  766. c = laFirstColumn(uil);
  767. laShowItemFull(uil, c, This, "name", LA_WIDGET_STRING_PLAIN, 0, 0, 0);
  768. }
  769. void laui_DataRestorePage(laUiList *uil, laPropPack *THIS_UNUSED, laPropPack *Operator, laColumn *UNUSED, int context){
  770. laColumn *col = laFirstColumn(uil), *c, *cl, *cr, *crl, *crr, *cll, *clr, *clrl, *clrr, *clrrl, *clrrr;
  771. laUiList *u;
  772. laUiItem *b;
  773. laShowItemFull(uil, col, 0, "la", 0, 0, laui_SubPropSelection, 0);
  774. laShowItemFull(uil, col, 0, "tns", 0, 0, laui_SubPropSelection, 0);
  775. }
  776. void laui_FileBrowserFileItem(laUiList *uil, laPropPack *This, laPropPack *OP_UNUSED, laColumn *Extra, int context){
  777. laColumn *c = Extra, *cl, *cr, *crl, *crr, *cll, *clr, *clrl, *clrr, *clrrl, *clrrr;
  778. laUiItem *ui;
  779. laSplitColumn(0, c, 0.1);
  780. cll = laLeftColumn(c, 1);
  781. clr = laRightColumn(c, 0);
  782. laSplitColumn(0, clr, 0.7);
  783. clrl = laLeftColumn(clr, 0);
  784. clrr = laRightColumn(clr, 0);
  785. laSplitColumn(0, clrr, 0.5);
  786. clrrl = laLeftColumn(clrr, 0);
  787. clrrr = laRightColumn(clrr, 0);
  788. laShowItemFull(uil, cll, This, "type", LA_WIDGET_ENUM_ICON_PLAIN, 0, 0, 0)->Flags|=LA_TEXT_ALIGN_RIGHT;
  789. //laShowItem(uil, cll, This, "is_folder");
  790. laShowItemFull(uil, clrl, This, "name", LA_WIDGET_STRING_PLAIN, 0, 0, 0);
  791. ui = laOnConditionThat(uil, clrr, laNot(laPropExpression(This, "is_folder")));{
  792. laShowItemFull(uil, clrrl, This, "time_modified.time_string", LA_WIDGET_STRING_PLAIN, 0, 0, 0);
  793. laShowItem(uil, clrrr, This, "size")->Flags|=LA_UI_FLAGS_NO_DECAL;
  794. }
  795. laEndCondition(uil, ui);
  796. //laShowSeparator(uil,cll)
  797. //laShowItemFull(uil, clrrl, This, "time_modified.time_string", LA_WIDGET_STRING_PLAIN, 0, 0);
  798. //laShowItem(uil, clrrr, This, "size");
  799. }
  800. void laui_FileBrowserDiskItem(laUiList *uil, laPropPack *This, laPropPack *OP_UNUSED, laColumn *Extra, int context){
  801. laColumn *col = Extra, *c, *cl, *cr, *crl, *crr;
  802. laUiItem *ui;
  803. c = Extra;
  804. laSplitColumn(0, c, 0.2);
  805. cl = laLeftColumn(c, LA_2RH);
  806. cr = laRightColumn(c, 0);
  807. laSplitColumn(0, cr, 0.5);
  808. crl = laLeftColumn(cr, 0);
  809. crr = laRightColumn(cr, 0);
  810. //laShowColumnAdjuster(uil, c);
  811. laShowItemFull(uil, cl, This, "id", LA_WIDGET_STRING_PLAIN, 0, 0, 0);
  812. laShowItem(uil, crl, This, "total_gb");
  813. laShowItem(uil, crr, This, "free_gb");
  814. }
  815. void laui_FileBrowserFileList(laUiList *uil, laPropPack *THIS_UNUSED, laPropPack *Operator, laColumn *UNUSED, int context){
  816. laColumn *col = laFirstColumn(uil), *c, *cl, *cr, *crl, *crr, *cll, *clr, *clrl, *clrr, *clrrl, *clrrr, *ulc;
  817. laUiList *u; laUiItem *b; laUiList *ul;
  818. laSplitColumn(uil, col, 0.25);
  819. cl = laLeftColumn(col, 10);
  820. cr = laRightColumn(col, 0);
  821. laShowItemFull(uil, cl, Operator, "folder_up", LA_WIDGET_BUTTON_NO_CONFIRM, 0 ,0,0);
  822. laShowItem(uil, cr, Operator, "path")->Expand=1;
  823. laUiItem* r=laBeginRow(uil,cr,0,0);
  824. laShowItem(uil, cr, Operator, "file_name")->Expand=1;
  825. laShowItem(uil, cr, Operator, "confirm")->Flags|=LA_UI_FLAGS_HIGHLIGHT|LA_UI_FLAGS_NO_CONFIRM;
  826. laEndRow(uil,r);
  827. laShowSeparator(uil,col);
  828. laUiItem* left=laMakeEmptyGroup(uil, cl, "left", 0); ul=left->Page; left->Flags|=LA_UI_FLAGS_NO_DECAL; ul->HeightCoeff=-1;
  829. ulc=laFirstColumn(ul);
  830. b=laOnConditionThat(ul,ulc,laPropExpression(Operator,"use_type"));{
  831. u = laMakeGroup(ul, ulc, "Use Format", 0)->Page; c = laFirstColumn(u);
  832. laShowItemFull(u,c,Operator,"available_extensions",0,0,laui_IdentifierOnly,0)->Flags|=LA_UI_FLAGS_NO_DECAL;
  833. }laEndCondition(ul,b);
  834. u = laMakeFoldableGroup(ul, ulc, "Bookmarks", 0, 0, 0)->Page; c = laFirstColumn(u);
  835. laShowItemFull(u,c,Operator,"bookmarks",0,0,laui_IdentifierOnly,0)->Flags|=LA_UI_FLAGS_NO_DECAL;
  836. u = laMakeGroup(ul, ulc, "Logic Drives", 0)->Page;
  837. c = laFirstColumn(u); laSplitColumn(u, c, 0.2); cll = laLeftColumn(c, LA_2RH); clr = laRightColumn(c, 0);
  838. laSplitColumn(u, clr, 0.5); clrl = laLeftColumn(clr, 0); clrr = laRightColumn(clr, 0);
  839. laShowColumnAdjuster(u, c);
  840. laShowItem(u, c, Operator, "disk_list");
  841. b = laMakeGroup(uil, cr, "File List", 0);b->State=LA_UI_ACTIVE; u=b->Page;
  842. u->HeightCoeff = -1;
  843. c = laFirstColumn(u); laSplitColumn(u, c, 0.1); cll = laLeftColumn(c, 1); clr = laRightColumn(c, 0);
  844. laSplitColumn(u, clr, 0.7); clrl = laLeftColumn(clr, 0); clrr = laRightColumn(clr, 0);
  845. laSplitColumn(u, clrr, 0.5); clrrl = laLeftColumn(clrr, 0); clrrr = laRightColumn(clrr, 0);
  846. laShowColumnAdjuster(u, c);
  847. laShowLabel(u, clrl, "File Name", 0, 0);
  848. laShowLabel(u, clrrl, "Last Modified On", 0, 0);
  849. laShowLabel(u, clrrr, "File Size", 0, 0);
  850. laShowItem(u, c, Operator, "file_list")->Flags|=LA_UI_FLAGS_NO_DECAL;
  851. }
  852. void laui_LinkerPanel(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context){
  853. laColumn *c, *cl, *cr, *cll, *clr, *crl, *crr, *crrl, *crrr, *gc;
  854. laUiList *gu;
  855. laUiItem *bracket, *b1, *b2;
  856. laPropContainer *pc;
  857. laProp *p;
  858. laPropPack *pp;
  859. char buf[LA_RAW_CSTR_MAX_LEN]={0};
  860. c = laFirstColumn(uil);
  861. laSplitColumn(uil, c, 0.2);
  862. cl = laLeftColumn(c, 100);
  863. cr = laRightColumn(c, 0);
  864. laSplitColumn(uil, cr, 0.2);
  865. crl = laLeftColumn(cr, 1);
  866. crr = laRightColumn(cr, 0);
  867. gu = laMakeGroup(uil, c, " UDF File Content", 0)->Page;{
  868. gc = laFirstColumn(gu);
  869. laShowItem(gu, gc, OperatorInst, "root_nodes");
  870. }
  871. }
  872. void laui_ManagedUDFItem(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context){
  873. laColumn *c=laFirstColumn(uil);
  874. laSplitColumn(uil,c,0.5);
  875. laColumn *cl=laLeftColumn(c, 1);
  876. laColumn *cr=laRightColumn(c,0);
  877. laUiItem* b2=laOnConditionThat(uil,cr,laPropExpression(Base,"udf"));{
  878. laUiItem* r=laBeginRow(uil,c,0,0);
  879. laUiItem* b=laOnConditionToggle(uil,c,0,0,0,0,0);strSafeSet(&b->ExtraInstructions,"text=🛈;");b->Flags|=LA_UI_FLAGS_PLAIN;{
  880. laShowItemFull(uil,c,Base,"udf.path",LA_WIDGET_STRING_PLAIN, 0 ,0,0);
  881. }laElse(uil,b);{
  882. laShowItemFull(uil,c,Base,"basename",LA_WIDGET_STRING_PLAIN, 0 ,0,0);
  883. }laEndCondition(uil,b);
  884. laEndRow(uil, r);
  885. }laElse(uil,b2);{
  886. laShowItemFull(uil,c,Base,"basename",LA_WIDGET_STRING_PLAIN, 0 ,0,0);
  887. }laEndCondition(uil,b2);
  888. }
  889. void laui_ManagedUDFOps(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context){
  890. laColumn *c=laFirstColumn(uil);
  891. laSplitColumn(uil,c,0.3);
  892. laColumn *cl=laLeftColumn(c, 1);
  893. laColumn *cr=laRightColumn(c,0);
  894. laUiItem* b1=laOnConditionThat(uil, cr, laPropExpression(Base, "udf"));{
  895. laShowItem(uil,cl,Base,"udf.modified");
  896. laUiItem* b=laBeginRow(uil,cr,0,0);
  897. laUiItem* b2=laOnConditionToggle(uil,cr,0,0,0,0,0);strSafeSet(&b2->ExtraInstructions,"text=🛈;");b2->Flags|=LA_UI_FLAGS_PLAIN;{
  898. laUiItem* ui=laShowItemFull(uil,cr,Base,"udf.path",LA_WIDGET_STRING_PLAIN, 0 ,0,0);ui->Expand=1;strSafeSet(&ui->ExtraInstructions,"text=Change");
  899. laShowItem(uil,cr,&ui->PP,"get_file_path");
  900. }laElse(uil,b2);{
  901. laShowItemFull(uil,cr,Base,"basename", LA_WIDGET_STRING_PLAIN, 0 ,0,0)->Expand=1;
  902. }laEndCondition(uil,b2);
  903. laEndRow(uil, b);
  904. }laElse(uil,b1);{
  905. laShowItemFull(uil,cr,0,"LA_managed_save_new_file",0,"feedback=NONE;",0,0);
  906. }laEndCondition(uil,b1);
  907. }
  908. void laui_ManagedPropInstance(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context){
  909. if(!Base ||! Base->EndInstance ||Base->LastPs->p->PropertyType!=LA_PROP_SUB) return;
  910. laColumn *c=laFirstColumn(uil);
  911. laSplitColumn(uil,c,0.3); laColumn *cl=laLeftColumn(c, 1); laColumn *cr=laRightColumn(c,0);
  912. laSplitColumn(uil,cr,0.6); laColumn *crl=laLeftColumn(cr, 0); laColumn *crr=laRightColumn(cr,30);
  913. laPropContainer* pc=la_EnsureSubTarget(Base->LastPs->p, Base->EndInstance);
  914. if(pc->UDFPropagate){
  915. char buf[128]; sprintf(buf,"Assign all \"%s\" into:",pc->Name);
  916. laShowLabel(uil,crl,buf,0,0)->Flags|=LA_TEXT_ALIGN_RIGHT|LA_UI_FLAGS_DISABLED;
  917. laShowItem(uil,crr,Base,"__single_udf_propagate");
  918. }
  919. if(pc->OtherAlloc || Base->LastPs->p->UDFIsSingle){
  920. //laShowLabel(uil,cr,"(Item not allocated by memAcquire)",0,0)->Expand=1;
  921. }else{
  922. if(pc->Hyper==2){
  923. laShowItem(uil,cl,Base,"__modified"); laSplitColumn(uil,crl,0.4); laColumn *crll=laLeftColumn(crl, 0); laColumn *crlr=laRightColumn(crl,15);
  924. laUiItem* idui=laShowItem(uil,crll,Base,"identifier");idui->Flags|=LA_UI_FLAGS_PLAIN;idui->Expand=1;
  925. laShowItem(uil,crlr,Base,"__uid")->Flags|=LA_UI_FLAGS_NO_DECAL;
  926. if(pc->UDFPropagate){
  927. laColumn *crrl,*crrr,*udfc,*optionc; laSplitColumn(uil,crr,0.7); crrl=laLeftColumn(crr,0); crrr=laRightColumn(crr,1);
  928. laSplitColumn(uil,crrl,0.3); udfc=laLeftColumn(crrl,0); optionc=laRightColumn(crrl,8);
  929. laUiItem* uc=laOnConditionToggle(uil,crrr,0,0,0,0,0);{ strSafeSet(&uc->ExtraInstructions,"text=⮯;");
  930. laShowItem(uil,udfc,Base,"__file");
  931. laUiItem* sr=laBeginRow(uil,optionc,1,0);
  932. laShowItemFull(uil,optionc,Base,"__udf_propagate",0,"force=true;text=Force;",0,0)->Flags|=LA_TEXT_ALIGN_CENTER;
  933. laShowItemFull(uil,optionc,Base,"__udf_propagate",0,0,0,0)->Flags|=LA_TEXT_ALIGN_CENTER;
  934. laEndRow(uil,sr);
  935. }laElse(uil,uc);{
  936. laShowItem(uil,crrl,Base,"__file");
  937. }laEndCondition(uil,uc);
  938. }else{
  939. laShowItem(uil,crr,Base,"__file");
  940. }
  941. }else{
  942. //laShowItem(uil,crl,Base,"identifier")->Flags|=LA_UI_FLAGS_PLAIN;
  943. }
  944. }
  945. for(laProp*p=pc->Props.pFirst;p;p=p->Item.pNext){
  946. if(p->PropertyType!=LA_PROP_SUB || p->UDFIsRefer) continue;
  947. la_EnsureSubTarget(p,0);
  948. if(p->SubProp &&p->SubProp->Hyper!=2 &&(!p->UDFIsSingle)) continue;
  949. if(p->UDFNoCreate || p->UDFHideInSave) continue;
  950. if(p==pc->SaverDummy){
  951. laShowItem(uil,cl,Base,"__single_saver_dummy.__modified");
  952. laShowItem(uil,crl,Base,"identifier")->Flags|=LA_UI_FLAGS_PLAIN;
  953. laShowItem(uil,crr,Base,"__single_saver_dummy.__file");
  954. continue;
  955. }
  956. laUiItem* b=laOnConditionToggle(uil,c,0,0,0,0,0);{ strSafePrint(&b->ExtraInstructions,"text=⮡ %s;",p->Identifier);
  957. b->Flags|=LA_UI_FLAGS_NO_DECAL|LA_TEXT_ALIGN_LEFT; b->State=LA_BT_ACTIVE;
  958. laShowItemFull(uil,cr,Base,p->Identifier,0, 0,laui_ManagedPropInstance,0)->Flags|=LA_UI_FLAGS_NO_DECAL|LA_UI_COLLECTION_NO_HIGHLIGHT;
  959. }laEndCondition(uil,b);
  960. }
  961. laShowSeparator(uil,c);
  962. }
  963. void laui_ManagedProp(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context){
  964. laColumn *c=laFirstColumn(uil);
  965. laPropPack PP={0}; if(!Base ||! Base->EndInstance) return;
  966. laManagedSaveProp* msp=Base->EndInstance;
  967. laShowLabel(uil,c,msp->Path->Ptr,0,0);
  968. laShowItemFull(uil,c,0,msp->Path->Ptr,0, 0,laui_ManagedPropInstance,0)->Flags|=LA_UI_FLAGS_NO_DECAL|LA_UI_COLLECTION_NO_HIGHLIGHT;
  969. }
  970. void laui_ManagedSavePanel(laUiList *uil, laPropPack *Base, laPropPack *Operator, laColumn *ExtraColumns, int context){
  971. laManagedSaveExtra*mse=Operator->EndInstance;
  972. laColumn *c=laFirstColumn(uil);
  973. if(mse->OnExit){
  974. laShowLabel(uil,c,"You still have unsaved/unassigned datablocks:",0,0)->Flags|=LA_TEXT_ALIGN_CENTER|LA_TEXT_LINE_WRAP;
  975. laShowSeparator(uil,c);
  976. }
  977. laUiItem* r=laBeginRow(uil,c,0,0);
  978. laShowLabel(uil,c,"Viewing",0,0);
  979. laShowItem(uil,c,Operator,"show_page")->Flags|=LA_UI_FLAGS_EXPAND;
  980. laEndRow(uil,r);
  981. laUiItem* g=laMakeEmptyGroup(uil,c,"List",0);{ g->State=LA_UI_ACTIVE;
  982. laUiList* gu=g->Page; gu->HeightCoeff=mse->OnExit?-4:-3; laColumn* gc=laFirstColumn(gu);
  983. laUiItem* b=laOnConditionThat(gu,gc,laEqual(laPropExpression(Operator, "show_page"),laIntExpression(0)));{
  984. laShowItemFull(gu,gc,0,"la.managed_props",0, 0,laui_ManagedProp,0)->Flags|=LA_UI_FLAGS_NO_DECAL|LA_UI_COLLECTION_NO_HIGHLIGHT;
  985. }laElse(gu,b);{
  986. laShowItemFull(gu,gc,0,"la.managed_udfs",0,0,0,0)->Flags|=LA_UI_FLAGS_NO_DECAL;
  987. }laEndCondition(gu,b);
  988. }
  989. if(mse->OnExit){
  990. 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;
  991. }
  992. r=laBeginRow(uil,c,0,0);
  993. if(mse->OnExit){
  994. laShowItemFull(uil,c,0,"LA_cancel",0,"text=Discard And Quit;feedback=DISCARD_AND_QUIT",0,0);
  995. }
  996. laShowSeparator(uil,c)->Expand=1;
  997. laShowItemFull(uil,c,0,"LA_managed_save",0,"quiet=true;ignore_unassigned=true;text=Save All Modified;feedback=SAVE_MODIFIED",0,0);
  998. laEndRow(uil,r);
  999. }
  1000. void laui_ResourceFolderItem(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context){
  1001. laColumn *c;
  1002. c = laFirstColumn(uil);
  1003. laUiItem* b=laBeginRow(uil,c,0,0);
  1004. laShowItem(uil, c, Base, "remove")->Flags|=LA_UI_FLAGS_ICON;
  1005. laUiItem* ui=laShowItem(uil, c, Base, "path");
  1006. ui->Expand=1;
  1007. laShowItem(uil,c,&ui->PP,"get_folder_path")->Flags|=LA_UI_FLAGS_ICON;
  1008. laEndRow(uil,b);
  1009. }
  1010. void laui_LogItem(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context){
  1011. laShowItem(uil, ExtraColumns, Base, "content")->Flags|=LA_TEXT_LINE_WRAP|LA_TEXT_USE_NEWLINE|LA_TEXT_MONO|LA_UI_FLAGS_NO_TOOLTIP;
  1012. }
  1013. void laui_NodeRack(laUiList *uil, laPropPack *This, laPropPack *Extra, laColumn *UNUSED, int context){
  1014. laNodeRack* r=This->EndInstance;
  1015. laColumn* c=laFirstColumn(uil),*cl, *cr;
  1016. laShowLabel(uil,c,"\n",0,0);
  1017. laUiItem* b=laBeginRow(uil,c,0,0);
  1018. laShowItemFull(uil,c,This,"move",0,"icon=🡰;direction=left;",0,0)->Flags|=LA_UI_FLAGS_ICON;
  1019. laUiItem* u=laShowItem(uil,c,This,"name"); u->Flags|=LA_UI_FLAGS_NO_DECAL|LA_TEXT_ALIGN_CENTER; u->Expand=1;
  1020. laShowItemFull(uil,c,This,"move",0,"icon=🡲;direction=right;",0,0)->Flags|=LA_UI_FLAGS_ICON;
  1021. laEndRow(uil,b);
  1022. laShowLabel(uil,c,"\n",0,0);
  1023. laShowItem(uil,c,This,"nodes")->Flags|=LA_UI_FLAGS_NO_DECAL;
  1024. laShowLabel(uil,c,"\n",0,0);
  1025. b=laBeginRow(uil,c,0,0);
  1026. laShowItemFull(uil,c,This,"add_node",0,(context==LA_RACK_TYPE_DRIVER)?"target=DRIVER;":"target=INPUT;",0,0)->Expand=1;
  1027. laShowItem(uil,c,This,"delete")->Flags|=LA_UI_FLAGS_ICON;
  1028. laShowItem(uil,c,This,"insert_rack");
  1029. laEndRow(uil,b);
  1030. laShowLabel(uil,c,"\n\n\n",0,0);
  1031. }
  1032. void laui_RackPage(laUiList *uil, laPropPack *This, laPropPack *Extra, laColumn *UNUSED, int context){
  1033. laColumn* c=laFirstColumn(uil); laRackPage* r=This->EndInstance;
  1034. laUiItem* b=laOnConditionThat(uil,c,laPropExpression(This,"has_rack"));{
  1035. laUiItem* g=laMakeGroup(uil,c,"Racks",0);{ g->Flags|=/*LA_UI_FLAGS_NO_GAP|LA_UI_FLAGS_NO_DECAL|*/LA_UI_FLAGS_NODE_CONTAINER;
  1036. laUiList* gu=g->Page; laColumn* gc=laFirstColumn(gu); gu->AllowScale=1; gu->HeightCoeff=-1; g->State=LA_UI_ACTIVE;
  1037. 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;
  1038. }
  1039. }laElse(uil,b);{
  1040. laShowItemFull(uil,c,This,"add_rack",0,0,0,0);
  1041. }laEndCondition(uil,b);
  1042. }
  1043. void laui_NodeCategory(laUiList *uil, laPropPack *This, laPropPack *Extra, laColumn *UNUSED, int context){
  1044. laColumn* c=laFirstColumn(uil); laNodeCategory* nc=This->EndInstance;
  1045. if(nc->Ui){ nc->Ui(uil,This,Extra,0,context); return; }
  1046. char buf[256];
  1047. for(laListItemPointer* lip=nc->NodeTypes.pFirst;lip;lip=lip->pNext){
  1048. laBaseNodeType* nt=lip->p; sprintf(buf,"feedback=%s;text=%s;icon=%lc;",nt->TypeName,nt->Name,nt->Icon?nt->Icon:' ');
  1049. laShowItemFull(uil,c,0,"LA_confirm",0,buf,0,0);
  1050. }
  1051. }
  1052. void laui_UserPreference(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context){
  1053. laColumn* c = laFirstColumn(uil),*cl,*cr; laSplitColumn(uil,c,0.5);cl=laLeftColumn(c,0);cr=laRightColumn(c,0);
  1054. laUiList *muil;
  1055. laColumn *mc, *mcl, *mcr, *mcll, *mclr;
  1056. laUiItem *b, *bracket;
  1057. //_LA_PANEL_USER_PREFERENCE = p;
  1058. //la_UDFAppendSharedTypePointer("_LA_PANEL_USER_PREFERENCE", _LA_PANEL_USER_PREFERENCE);
  1059. //p->Show = 0;
  1060. //p->FastUpdate = 1;
  1061. 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;
  1062. laShowItemFull(uil,cl,0,"la.user_preferences.save_preferences_on_exit",LA_WIDGET_ENUM_HIGHLIGHT,"text=🞆",0,0);
  1063. laEndRow(uil,b);
  1064. laShowItem(uil,cr,0,"LA_save_user_preferences");
  1065. bracket = laMakeTab(uil, c, 0);{
  1066. for(laExtraPreferencePage* epp=MAIN.ExtraPreferencePages.pFirst;epp;epp=epp->Item.pNext){
  1067. muil = laAddTabPage(bracket, epp->Name); epp->Func(muil,0,0,0,0);
  1068. }
  1069. muil = laAddTabPage(bracket, "Display");{
  1070. //muil->HeightCoeff = -1;
  1071. mc = laFirstColumn(muil);
  1072. laSplitColumn(muil, mc, 0.5);
  1073. mcl = laLeftColumn(mc, 0);
  1074. mcr = laRightColumn(mc, 0);
  1075. if(MAIN.PreferencePageDisplay){ MAIN.PreferencePageDisplay(muil,0,0,0,0); }
  1076. laShowLabel(muil, mc, "Interface:", 0, 0);
  1077. laShowLabel(muil, mcl, "Row Height:", 0, 0);
  1078. laShowItem(muil, mcr, 0, "la.user_preferences.interface_size");
  1079. laShowLabel(muil, mcl, "Font Size:", 0, 0);
  1080. laShowItem(muil, mcr, 0, "la.user_preferences.font_size");
  1081. laShowLabel(muil, mcl, "Margin Size:", 0, 0);
  1082. laShowItem(muil, mcr, 0, "la.user_preferences.margin_size");
  1083. laShowLabel(muil, mcl, "Panel Multisample:", 0, 0);
  1084. laShowItem(muil, mcr, 0, "la.user_preferences.panel_multisample")->Flags|=LA_UI_FLAGS_EXPAND;
  1085. laShowItem(muil, mc, 0, "la.user_preferences.top_framerate");
  1086. laShowSeparator(muil, mc);
  1087. laShowLabel(muil, mc, "Color:", 0, 0);
  1088. laShowItem(muil, mcr, 0, "la.user_preferences.color_picker_gamma");
  1089. laShowSeparator(muil, mc);
  1090. laShowLabel(muil, mc, "Nodes:", 0, 0);
  1091. laShowItem(muil, mcr, 0, "la.user_preferences.wire_color_slices");
  1092. laShowItem(muil, mcr, 0, "la.user_preferences.wire_thickness");
  1093. laShowItem(muil, mcr, 0, "la.user_preferences.wire_saggyness");
  1094. laShowSeparator(muil, mc);
  1095. laShowLabel(muil, mc, "Floating Panel:", 0, 0);
  1096. laShowItem(muil, mcl, 0, "la.user_preferences.floating_alpha");
  1097. laShowItem(muil, mcr, 0, "la.user_preferences.solid_shadow_length");
  1098. laShowSeparator(muil, mc);
  1099. laShowLabel(muil, mc, "Translation:", 0, 0);
  1100. laShowLabel(muil, mcl, "Enable Translation:", 0, 0);
  1101. laShowItemFull(muil, mcr, 0, "la.user_preferences.enable_translation",LA_WIDGET_ENUM_CYCLE,0,0,0);
  1102. b = laOnConditionThat(muil, mcl, laPropExpression(0, "la.user_preferences.enable_translation"));{
  1103. laShowLabel(muil, mcl, "Language:", 0, 0);
  1104. laShowItemFull(muil, mcr, 0, "la.user_preferences.languages", LA_WIDGET_COLLECTION_SELECTOR, 0, 0, 0);
  1105. laShowItem(muil, mcl, 0, "LA_translation_dump");
  1106. }
  1107. laEndCondition(muil, b);
  1108. }
  1109. muil = laAddTabPage(bracket, "Input");{
  1110. //muil->HeightCoeff = -1;
  1111. mc = laFirstColumn(muil);
  1112. laSplitColumn(muil, mc, 0.5);
  1113. mcl = laLeftColumn(mc, 0);
  1114. mcr = laRightColumn(mc, 0);
  1115. if(MAIN.PreferencePageInput){ MAIN.PreferencePageInput(muil,0,0,0,0); }
  1116. laShowLabel(muil, mc, "User Interactions:", 0, 0);
  1117. laShowItem(muil, mc, 0, "la.user_preferences.scroll_speed");
  1118. laShowItem(muil, mcl, 0, "la.user_preferences.animation_speed");
  1119. laShowItem(muil, mcr, 0, "la.user_preferences.panel_animation_speed");
  1120. laShowItem(muil, mc, 0, "la.user_preferences.valuator_threshold");
  1121. laShowItem(muil, mc, 0, "la.user_preferences.zoom_speed_2d");
  1122. laShowItem(muil, mcl, 0, "la.user_preferences.tooltip_close_distance");
  1123. laShowItem(muil, mcr, 0, "la.user_preferences.idle_time");
  1124. laShowSeparator(muil,mc);
  1125. laShowLabel(muil, mc, "Input device handling:", 0, 0);
  1126. laShowLabel(muil, mcl, "Input Mapping:", 0, 0)->Flags|=LA_TEXT_ALIGN_RIGHT;
  1127. laShowItemFull(muil, mcr, 0, "LA_panel_activator",0,"panel_id=LAUI_input_mapper;text=Configure",0,0);
  1128. laShowLabel(muil, mcl, "Pads/Joysticks:", 0, 0)->Flags|=LA_TEXT_ALIGN_RIGHT;
  1129. laShowItemFull(muil, mcr, 0, "LA_panel_activator",0,"panel_id=LAUI_controllers;text=Configure",0,0);
  1130. laShowSeparator(muil,mc);
  1131. laShowLabel(muil, mc, "Wacom Devices:", 0, 0);
  1132. laShowItem(muil, mcl, 0, "la.user_preferences.wacom_device_stylus");
  1133. laShowItem(muil, mcl, 0, "la.user_preferences.wacom_device_eraser");
  1134. laShowItemFull(muil, mcr, 0, "LA_refresh_controllers",0,"text=Refresh",0,0);
  1135. }
  1136. muil = laAddTabPage(bracket, "Resource");{
  1137. //muil->HeightCoeff = -1;
  1138. mc = laFirstColumn(muil);
  1139. laSplitColumn(muil, mc, 0.5);
  1140. mcl = laLeftColumn(mc, 0);
  1141. mcr = laRightColumn(mc, 0);
  1142. if(MAIN.PreferencePageResource){ MAIN.PreferencePageResource(muil,0,0,0,0); }
  1143. laShowLabel(muil, mcl, "UDF Manager Default View:", 0, 0);
  1144. laShowItem(muil, mcr, 0, "la.user_preferences.manager_default_view")->Flags|=LA_UI_FLAGS_EXPAND;
  1145. laShowSeparator(muil,mc);
  1146. b=laBeginRow(muil,mc,0,0);
  1147. laShowLabel(muil, mc, "Resource Folders", 0, 0)->Expand=1;
  1148. laShowItem(muil, mc, 0, "LA_add_resource_folder");
  1149. laEndRow(muil,b);
  1150. laShowItem(muil, mc, 0, "la.user_preferences.resource_folders");
  1151. }
  1152. muil = laAddTabPage(bracket, "Theme");{
  1153. //muil->HeightCoeff = -1;
  1154. mc = laFirstColumn(muil);
  1155. if(MAIN.PreferencePageTheme){ MAIN.PreferencePageTheme(muil,0,0,0,0); }
  1156. laShowLabel(muil, mc, "Active Theme", 0, 0);
  1157. laShowItemFull(muil, mc, 0, "la.themes", LA_WIDGET_COLLECTION_SELECTOR, 0,laui_ThemeListItem,0);
  1158. laShowItemFull(muil, mc, 0, "la.themes", LA_WIDGET_COLLECTION_SINGLE, 0 ,0,0);
  1159. }
  1160. }
  1161. }
  1162. void laui_About(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context){
  1163. laColumn *c, *cl, *cr, *tc, *gc, *gcl, *gcr, *tcl, *tcr;
  1164. laUiItem *bracket, *t, *g;
  1165. laPanel *p;
  1166. laUiList *u, *gu;
  1167. laPropContainer *pc;
  1168. int h;
  1169. laOperatorType *at;
  1170. laUiList *first;
  1171. char buf[2048]={0};
  1172. c = laFirstColumn(uil);
  1173. if(MAIN.AboutContent){
  1174. MAIN.AboutContent(uil,Base,OperatorInst,ExtraColumns,0);
  1175. }else{
  1176. laShowLabel(uil, c, "LaGUI", 0, 0);
  1177. laShowLabel(uil, c, "A graphical user interface application toolkit", 0, 0)->Flags|=LA_TEXT_LINE_WRAP;
  1178. laShowLabel(uil, c, "(C)Yiming Wu", 0, 0);
  1179. }
  1180. t = laMakeTab(uil, c, 0);{
  1181. first = u = laAddTabPage(t, "Version");
  1182. tc = laFirstColumn(u);
  1183. if(MAIN.AboutVersion){
  1184. MAIN.AboutVersion(u,Base,OperatorInst,ExtraColumns,0);
  1185. }
  1186. g = laMakeGroup(u, tc, "LaGUI information", 0);
  1187. gu = g->Page;{
  1188. gc = laFirstColumn(gu);
  1189. sprintf(buf, "LaGUI.%d.%d.%d", LA_VERSION_MAIN, LA_VERSION_SUB, LA_VERSION_MINOR);
  1190. laShowLabel(gu, gc, buf, 0, 0)->Flags|=LA_TEXT_MONO;
  1191. laShowLabel(gu, gc, LAGUI_GIT_BRANCH,0,0)->Flags|=LA_TEXT_MONO;
  1192. #ifdef LAGUI_GIT_HASH
  1193. laShowLabel(gu, gc, LAGUI_GIT_HASH,0,0)->Flags|=LA_TEXT_MONO;
  1194. #endif
  1195. sprintf(buf, "Built on:[UTC+8] %s %s", __DATE__, __TIME__);
  1196. laShowLabel(gu, gc, buf, 0, 0)->Flags|=LA_TEXT_MONO;
  1197. sprintf(buf, "UDF Identifier: %s",LA_UDF_IDENTIFIER);
  1198. laShowLabel(gu, gc, buf, 0, 0)->Flags|=LA_TEXT_MONO;
  1199. laShowLabel(gu, gc, "UDF Extensions:", 0, 0)->Flags|=LA_TEXT_MONO;
  1200. laShowLabel(gu, gc, "🗸LA_UDF_BASICS", 0, 0)->Flags|=LA_TEXT_MONO;
  1201. for(int i=0;i<64;i++){
  1202. if(!LA_UDF_EXTENSION_STRINGS[i][0]) break; int gray=!((1<<i)&LA_UDF_EXTENSION_BITS);
  1203. sprintf(buf,"%s%s",gray?" ":"🗸",LA_UDF_EXTENSION_STRINGS[i]);
  1204. laUiItem* ext=laShowLabel(gu, gc, buf, 0, 0); ext->Flags|=LA_TEXT_MONO;
  1205. if(gray){ ext->Flags|=LA_UI_FLAGS_DISABLED; }
  1206. }
  1207. }
  1208. g = laMakeGroup(u, tc, "Device Graphics", 0);
  1209. gu = g->Page;{
  1210. gc = laFirstColumn(gu);
  1211. sprintf(buf, "OpenGL Version: %s", T->GLVersionStr); laShowLabel(gu, gc, buf, 0, 0)->Flags|=LA_TEXT_MONO;
  1212. sprintf(buf, "OpenGL Vendor: %s", T->GLVendorStr); laShowLabel(gu, gc, buf, 0, 0)->Flags|=LA_TEXT_MONO;
  1213. sprintf(buf, "OpenGL Renderer: %s", T->GLRendererStr); laShowLabel(gu, gc, buf, 0, 0)->Flags|=LA_TEXT_MONO;
  1214. sprintf(buf, "GLSL Version: %s", T->GLSLVersionStr); laShowLabel(gu, gc, buf, 0, 0)->Flags|=LA_TEXT_MONO;
  1215. }
  1216. u = laAddTabPage(t, "Authors");
  1217. tc= laFirstColumn(u);
  1218. if(MAIN.AboutAuthor){
  1219. MAIN.AboutAuthor(u,Base,OperatorInst,ExtraColumns,0);
  1220. }
  1221. g = laMakeGroup(u, tc, "LaGUI", 0);
  1222. gu = g->Page;{
  1223. gc = laFirstColumn(gu);
  1224. laShowLabel(gu,gc,"LaGUI application framework is made by Wu Yiming.",0,0)->Flags|=LA_TEXT_LINE_WRAP;
  1225. laUiItem* b=laBeginRow(gu,gc,0,0);
  1226. laShowItemFull(gu, gc, 0, "LA_open_internet_link", 0, "link=http://www.ChengduLittleA.com/lagui;text=Details", 0, 0);
  1227. laShowItemFull(gu, gc, 0, "LA_open_internet_link", 0, "link=http://www.ChengduLittleA.com;text=Yiming's Blog", 0, 0);
  1228. laEndRow(gu,b);
  1229. }
  1230. t->Page = first;
  1231. }
  1232. }
  1233. void laui_UndoHistories(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context){
  1234. laColumn* c=laFirstColumn(uil),*cl,*cr; laSplitColumn(uil,c,0.5);cl=laLeftColumn(c,0);cr=laRightColumn(c,0);
  1235. laShowItem(uil,cl,0,"LA_undo"); laShowItem(uil,cr,0,"LA_redo")->Flags|=LA_TEXT_ALIGN_RIGHT;
  1236. laUiItem* g=laMakeGroup(uil,c,"123",0);{ g->State=LA_UI_ACTIVE; g->Flags|=LA_UI_FLAGS_PREFER_BOTTOM;
  1237. laUiList* gu=g->Page; laColumn* gc=laFirstColumn(gu); gu->HeightCoeff=-1;
  1238. laShowItem(gu,gc,0,"la.differences")->Flags|=LA_UI_FLAGS_NO_DECAL;
  1239. }
  1240. }
  1241. void laui_Terminal(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context){
  1242. laColumn* c=laFirstColumn(uil);
  1243. laUiItem* g=laMakeGroup(uil,c,"123",0);{ g->State=LA_UI_ACTIVE; g->Flags|=LA_UI_FLAGS_PREFER_BOTTOM;
  1244. laUiList* gu=g->Page; laColumn* gc=laFirstColumn(gu); gu->HeightCoeff=-1;
  1245. laShowItem(gu,gc,0,"la.logs")->Flags|=LA_UI_FLAGS_NO_DECAL;
  1246. }
  1247. }
  1248. void laui_IdleDataManager(laUiList *uil, laPropPack *Base, laPropPack *Extra, laColumn *ExtraColumns, int context){
  1249. laColumn *c=laFirstColumn(uil);
  1250. laUiItem* r=laBeginRow(uil,c,0,0);
  1251. laShowLabel(uil,c,"Viewing",0,0);
  1252. laShowItem(uil,c,Extra,"show_page")->Flags|=LA_UI_FLAGS_EXPAND;
  1253. laEndRow(uil,r);
  1254. laUiItem* g=laMakeEmptyGroup(uil,c,"List",0);{ g->State=LA_UI_ACTIVE;
  1255. laUiList* gu=g->Page; gu->HeightCoeff=-3; laColumn* gc=laFirstColumn(gu);
  1256. laUiItem* b=laOnConditionThat(gu,gc,laEqual(laPropExpression(Extra, "show_page"),laIntExpression(0)));{
  1257. laShowItemFull(gu,gc,0,"la.managed_props",0, 0,laui_ManagedProp,0)->Flags|=LA_UI_FLAGS_NO_DECAL;
  1258. }laElse(gu,b);{
  1259. laShowItemFull(gu,gc,0,"la.managed_udfs",0,0,0,0)->Flags|=LA_UI_FLAGS_NO_DECAL;
  1260. }laEndCondition(gu,b);
  1261. }
  1262. r=laBeginRow(uil,c,0,0);
  1263. laShowSeparator(uil,c)->Expand=1;
  1264. laShowItemFull(uil,c,0,"LA_managed_save",0,"quiet=true;ignore_unassigned=true;text=Save All Modified",0,0);
  1265. laEndRow(uil,r);
  1266. }
  1267. void lauidetached_IdleDataManager(laPanel* p){
  1268. la_MakeDetachedProp(p, "la.user_preferences.manager_default_view", "show_page");
  1269. }
  1270. void laui_TextureInspector(laUiList *uil, laPropPack *Base, laPropPack *Extra, laColumn *ExtraColumns, int context){
  1271. laColumn *c=laFirstColumn(uil),*cl,*cr;
  1272. laSplitColumn(0, c, 0.5);
  1273. cl = laLeftColumn(c, 0);
  1274. cr = laRightColumn(c, 0);
  1275. laShowLabel(uil,cl,"Viewing Texture:",0,0)->Flags|=LA_TEXT_ALIGN_RIGHT;
  1276. laShowItemFull(uil,cr,Extra,"textures",LA_WIDGET_COLLECTION_SELECTOR,0,0,0);
  1277. laUiItem* u2=laShowCanvas(uil,c,Extra,"textures",0,-1);
  1278. laDefault2DViewOverlayRight(u2);
  1279. }
  1280. void lauidetached_TextureInspector(laPanel* p){
  1281. la_MakeDetachedProp(p, "tns.texture_list", "textures");
  1282. }
  1283. void laui_GameController(laUiList *uil, laPropPack *This, laPropPack *Extra, laColumn *UNUSED, int context){
  1284. laColumn* c=laFirstColumn(uil),*cl, *cr;
  1285. laSplitColumn(uil,c,0.5); cl=laLeftColumn(c,0); cr=laRightColumn(c,0);
  1286. laUiItem* b=laBeginRow(uil,cl,0,0);
  1287. laUiItem* l=laShowLabel(uil,cl,"Controller:",0,0); l->Flags|=LA_TEXT_ALIGN_RIGHT; l->Expand=1;
  1288. laShowItem(uil,cl,0,"LA_refresh_controllers")->Flags|=LA_UI_FLAGS_ICON;
  1289. laEndRow(uil,b);
  1290. laShowItemFull(uil,cr,Extra,"controllers",LA_WIDGET_COLLECTION_SELECTOR,0,laui_IdentifierOnly,0);
  1291. b=laOnConditionThat(uil,c,laPropExpression(Extra,"controllers"));{
  1292. laShowItemFull(uil,c,Extra,"controllers",LA_WIDGET_COLLECTION_SINGLE,0,0,0);
  1293. }laElse(uil,b);{
  1294. laShowLabel(uil,c,"Please select a controller.",0,0)->Flags|=LA_TEXT_ALIGN_CENTER;
  1295. }
  1296. }
  1297. void lauidetached_GameController(laPanel* p){
  1298. la_MakeDetachedProp(p, "la.controllers", "controllers");
  1299. }
  1300. void laui_InputMapper(laUiList *uil, laPropPack *This, laPropPack *Extra, laColumn *UNUSED, int context){
  1301. laColumn* c=laFirstColumn(uil),*cl, *cr;
  1302. laSplitColumn(uil,c,0.6); cl=laLeftColumn(c,0); cr=laRightColumn(c,0);
  1303. laUiItem* b=laBeginRow(uil,cl,0,0);
  1304. laUiItem* b2=laOnConditionThat(uil,cl,laPropExpression(0,"la.input_mapping.pages"));{
  1305. laUiItem* b3=laOnConditionThat(uil,cl,laPropExpression(0,"la.input_mapping.current_page"));{
  1306. laShowItem(uil,cr,0,"la.input_mapping.current_page.name")->Expand=1;
  1307. laShowItem(uil,c,Extra,"LA_input_mapping_rebuild")->Flags|=LA_UI_FLAGS_ICON;
  1308. }laEndCondition(uil,b3);
  1309. }laEndCondition(uil,b2);
  1310. laShowItem(uil,cl,0,"LA_add_input_mapping_page")->Flags|=LA_UI_FLAGS_ICON;
  1311. laEndRow(uil,b);
  1312. b2=laOnConditionThat(uil,cr,laPropExpression(0,"la.input_mapping.pages"));{
  1313. laShowItemFull(uil,cr,0,"la.input_mapping.pages",LA_WIDGET_COLLECTION_SELECTOR,0,0,0);
  1314. }laEndCondition(uil,b2);
  1315. laShowItemFull(uil,c,0,"la.input_mapping.current_page",LA_WIDGET_COLLECTION_SINGLE,0,laui_RackPage,0)->Flags|=LA_UI_FLAGS_NO_DECAL;;
  1316. }
  1317. void lauidetached_Drivers(laPanel* p){
  1318. la_MakeDetachedProp(p, "la.drivers.current_page", "page");
  1319. }
  1320. void laui_Drivers(laUiList *uil, laPropPack *This, laPropPack *Extra, laColumn *UNUSED, int context){
  1321. laColumn* c=laFirstColumn(uil),*cl, *cr;
  1322. laSplitColumn(uil,c,0.6); cl=laLeftColumn(c,0); cr=laRightColumn(c,0);
  1323. laUiItem* b=laBeginRow(uil,cl,0,0);
  1324. laUiItem* b2=laOnConditionThat(uil,cl,laPropExpression(0,"la.drivers.pages"));{
  1325. laUiItem* b3=laOnConditionThat(uil,cl,laPropExpression(Extra,"page"));{
  1326. laShowItem(uil,cr,Extra,"page.name")->Expand=1;
  1327. laShowItem(uil,c,Extra,"LA_driver_rebuild")->Flags|=LA_UI_FLAGS_ICON;
  1328. }laEndCondition(uil,b3);
  1329. }laEndCondition(uil,b2);
  1330. laShowItem(uil,cl,0,"LA_add_driver_page")->Flags|=LA_UI_FLAGS_ICON;
  1331. laEndRow(uil,b);
  1332. b2=laOnConditionThat(uil,cr,laPropExpression(0,"la.drivers.pages"));{
  1333. laShowItemFull(uil,cr,Extra,"page",LA_WIDGET_COLLECTION_SELECTOR,0,0,0);
  1334. }laEndCondition(uil,b2);
  1335. laShowItemFull(uil,c,Extra,"page",LA_WIDGET_COLLECTION_SINGLE,0,laui_RackPage,0)->Flags|=LA_UI_FLAGS_NO_DECAL;;
  1336. }
  1337. void la_RegisterBuiltinTemplates(){
  1338. laRegisterUiTemplate("LAUI_input_mapper","Input Mapper",laui_InputMapper,0,0,"Controlling",0,0,0);
  1339. laRegisterUiTemplate("LAUI_drivers","Drivers",laui_Drivers,lauidetached_Drivers,0,0,0,0,0);
  1340. laRegisterUiTemplate("LAUI_controllers", "Controllers", laui_GameController, lauidetached_GameController, 0,0,0,0,0);
  1341. laRegisterUiTemplate("LAUI_user_preferences", "User Preferences", laui_UserPreference, 0, 0, "System",0,25,25);
  1342. laRegisterUiTemplate("LAUI_about", "About", laui_About, 0, 0, 0, 0,15,25);
  1343. laRegisterUiTemplate("LAUI_texture_inspector", "Texture Inspector", laui_TextureInspector, lauidetached_TextureInspector, 0, 0, 0,0,0);
  1344. laRegisterUiTemplate("LAUI_data_manager", "Data Manager", laui_IdleDataManager, lauidetached_IdleDataManager, 0, 0, 0,25,25);
  1345. laRegisterUiTemplate("LAUI_histories", "Histories", laui_UndoHistories, 0, 0, 0, 0,10,25);
  1346. laRegisterUiTemplate("LAUI_terminal", "Terminal", laui_Terminal, 0, 0, 0, 0,20,25);
  1347. }