*/}}

la_templates.c 116 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359
  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. laPropContainer* pc=la_EnsureSubTarget(gp,This->EndInstance);
  105. laShowLabel(uil,c,gp->PropertyType==LA_PROP_SUB?pc->Name:gp->Name,0,0)->Flags|=LA_UI_FLAGS_DISABLED;
  106. for (p = pc->Props.pFirst; p; p = p->Item.pNext){
  107. //la_ShowGeneralPropItem(uil, c, This, gp, p, 0, 0, 0);
  108. laShowItem(uil, c, This, p->Identifier);
  109. }
  110. }
  111. void laui_PropOperatorUiDefine(laUiList *uil, laPropPack *This, laPropPack *Unused, laColumn *UNUSED, int context){
  112. laColumn *c; laProp *p, *gp;
  113. if (This && This->LastPs){
  114. c = laFirstColumn(uil); gp = This->LastPs->p;
  115. laPropContainer* pc=la_EnsureSubTarget(gp,This->EndInstance);
  116. laShowLabel(uil,c,gp->PropertyType==LA_PROP_SUB?pc->Name:gp->Name,0,0)->Flags|=LA_UI_FLAGS_DISABLED;
  117. for (p = pc->Props.pFirst; p; p = p->Item.pNext){
  118. if(p->PropertyType!=LA_PROP_OPERATOR) continue;
  119. laShowItem(uil, c, This, p->Identifier);
  120. }
  121. }
  122. }
  123. void laui_StringPropUiDefine(laUiList *uil, laPropPack *This, laPropPack *Extra, laColumn *UNUSED, int context){
  124. laColumn *c; laProp *p, *gp;
  125. if (!This || !This->LastPs) return;
  126. c = laFirstColumn(uil);
  127. gp = This->LastPs->p;
  128. if(Extra){
  129. laShowItemFull(uil, c, Extra, "copy_selection",0,"mode=CUT;text=Cut;icon=✀",0,0);
  130. laUiItem* b=laBeginRow(uil,c,0,0);
  131. laShowItemFull(uil, c, Extra, "copy_selection",0,"text=Copy",0,0)->Expand=1;
  132. laShowItemFull(uil, c, This, "copy",0,"text=All",0,0);
  133. laEndRow(uil,b);
  134. }else{
  135. laShowItem(uil, c, This, "copy");
  136. }
  137. laShowItem(uil, c, This, "paste");
  138. laShowSeparator(uil,c);
  139. laShowItem(uil, c, This, "restore");
  140. if(gp->Tag&LA_PROP_IS_FILE){ laShowItem(uil, c, This, "get_file_path"); }
  141. if(gp->Tag&LA_PROP_IS_FOLDER){ laShowItem(uil, c, This, "get_folder_path"); }
  142. }
  143. void laui_IdentifierOnly(laUiList *uil, laPropPack *This, laPropPack *OP_UNUSED, laColumn *Extra, int context){
  144. laColumn *col = Extra, *c, *cl, *cr, *crl, *crr, *cll, *clr, *clrl, *clrr, *clrrl, *clrrr;
  145. laUiItem *ui;
  146. c = laFirstColumn(uil);
  147. laShowItemFull(uil, c, This, "identifier", LA_WIDGET_STRING_PLAIN,0, 0, 0);
  148. }
  149. void laRebuildPathRecursive(laProp *p, char *buf){
  150. if (p->Container){
  151. laRebuildPathRecursive(p->Container, buf);
  152. sprintf(buf, ".%s", p->Identifier);
  153. }else
  154. sprintf(buf, "%s", p->Identifier);
  155. }
  156. void laui_IntPropInfo(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *ExtraColumns, int context){
  157. laColumn *col, *cl, *cr;
  158. laUiItem *b1,*b2;
  159. laUiList *tuil;
  160. col = laFirstColumn(uil);
  161. laSplitColumn(uil, col, 0.2);
  162. cl = laLeftColumn(col, 1);
  163. cr = laRightColumn(col, 0);
  164. laShowItemFull(uil, cr, Base, "base.identifier", LA_WIDGET_STRING_PLAIN,0, 0, 0);
  165. b1= laOnConditionToggle(uil, cl, 0,0,0,0,0);{
  166. for(laProp* p=MAIN.ContainerInt->Props.pFirst;p;p=p->Item.pNext){
  167. laShowItem(uil,cr,Base,p->Identifier);
  168. }
  169. }laEndCondition(uil,b1);
  170. }
  171. void laui_FloatPropInfo(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *ExtraColumns, int context){
  172. laColumn *col, *cl, *cr;
  173. laUiItem *b1,*b2;
  174. laUiList *tuil;
  175. col = laFirstColumn(uil);
  176. laSplitColumn(uil, col, 0.2);
  177. cl = laLeftColumn(col, 1);
  178. cr = laRightColumn(col, 0);
  179. laShowItemFull(uil, cr, Base, "base.identifier", LA_WIDGET_STRING_PLAIN,0, 0, 0);
  180. b1= laOnConditionToggle(uil, cl, 0,0,0,0,0);{
  181. for(laProp* p=MAIN.ContainerFloat->Props.pFirst;p;p=p->Item.pNext){
  182. laShowItem(uil,cr,Base,p->Identifier);
  183. }
  184. }laEndCondition(uil,b1);
  185. }
  186. void laui_SubPropInfoDefault(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context){
  187. laColumn *c, *cl, *cr, *cll, *clr, *crl, *crr, *crrl, *crrr;
  188. laUiItem *bracket, *b1, *b2;
  189. laPropContainer *pc;
  190. laProp *p;
  191. char buf[LA_RAW_CSTR_MAX_LEN]={0};
  192. c = laFirstColumn(uil);
  193. laSplitColumn(uil, c, 0.2); cl = laLeftColumn(c, 1); cr = laRightColumn(c, 0);
  194. laSplitColumn(uil, cr, 0.5); crrl = laLeftColumn(cr, 1*6); crrr = laRightColumn(cr, 0);
  195. laPropContainer* subc=Base->LastPs->p->SubProp;
  196. if (!((laSubProp*)Base->LastPs->p)->GetType){
  197. if (!subc) subc = la_ContainerLookup(((laSubProp *)Base->LastPs->p)->TargetID);
  198. if (!subc) return; Base->LastPs->p->SubProp=subc;
  199. }else{
  200. subc=((laSubProp*)Base->LastPs->p)->GetType(Base->EndInstance);
  201. }
  202. if (!Base->LastPs->p->UDFIsRefer && !Base->LastPs->p->UDFNoCreate && !Base->LastPs->p->UDFIsSingle){
  203. laShowItem(uil, cr, Base, "identifier")->Flags|=LA_UI_FLAGS_PLAIN;
  204. bracket = laOnConditionToggle(uil, cl, 0, 0, 0, 0, 0);
  205. }
  206. for (p = subc->Props.pFirst; p; p = p->Item.pNext){
  207. if (!(p->PropertyType & LA_PROP_SUB)){
  208. buf[0] = 0;
  209. sprintf(buf, "la.prop_containers#%s.properties#%s.name", p->Container->Identifier, p->Identifier);
  210. laShowItemFull(uil, crrl, 0, buf, LA_WIDGET_STRING_PLAIN,0, 0, 0);
  211. laShowItem(uil, crrr, Base, p->Identifier);
  212. //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);
  213. //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);
  214. laShowSeparator(uil, c);
  215. }else{
  216. //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);
  217. //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);
  218. //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);
  219. if (p->UDFIsRefer) laShowLabel(uil, crrr, "🠞", 0, 0);
  220. elif (p->UDFNoCreate) laShowLabel(uil, crrr, "n", 0, 0);
  221. else laShowLabel(uil, crrr, "🗇", 0, 0);
  222. buf[0] = 0;
  223. sprintf(buf, "la.prop_containers#%s.icon_id", ((laSubProp *)p)->TargetID);
  224. laShowIcon(uil, cl, 0, buf, 0);
  225. b1 = laOnConditionToggle(uil, crrl, 0, 0, 0, 0, 0);{ b1->Flags|=LA_TEXT_ALIGN_LEFT;
  226. sprintf(buf, "text=...%s;", p->Name);
  227. strSafeSet(&b1->ExtraInstructions, buf);
  228. laUiDefineFunc f=laui_SubPropInfoDefault;
  229. //if(!context) f=((laSubProp*)p)->GetType?0:(p->UiDefine?p->UiDefine:(p->SubProp&&p->SubProp->UiDefine?p->SubProp->UiDefine:laui_SubPropInfoDefault));
  230. laShowItemFull(uil, cr, Base, p->Identifier, 0,0, f, context);
  231. }
  232. laEndCondition(uil, b1);
  233. laShowSeparator(uil, c);
  234. }
  235. }
  236. if (!Base->LastPs->p->UDFIsRefer && !Base->LastPs->p->UDFNoCreate && !Base->LastPs->p->UDFIsSingle){
  237. laEndCondition(uil, bracket);
  238. }
  239. //laShowItemFull(uil, crl, Base, "identifier", 0, 0, 0);
  240. //p = Base->LastPs->p->SubProp->Props.pFirst;
  241. }
  242. void laui_SubPropSelection(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context){
  243. laColumn *c, *cl, *cr, *cll, *clr, *crl, *crr, *crrl, *crrr;
  244. laUiItem *bracket, *b1, *b2;
  245. laPropContainer *pc;
  246. laProp *p;
  247. laPropPack *pp;
  248. char buf[LA_RAW_CSTR_MAX_LEN]={0};
  249. c = laFirstColumn(uil);
  250. laSplitColumn(uil, c, 0.2);
  251. cl = laLeftColumn(c, 1);
  252. cr = laRightColumn(c, 0);
  253. laSplitColumn(uil, cr, 0.8);
  254. crl = laLeftColumn(cr, 0);
  255. crr = laRightColumn(cr, 100);
  256. laSplitColumn(uil, crl, 0.5);
  257. crrl = laLeftColumn(crl, 150);
  258. crrr = laRightColumn(crl, 0);
  259. if (!Base->LastPs->p->SubProp) Base->LastPs->p->SubProp = la_ContainerLookup(((laSubProp *)Base->LastPs->p)->TargetID);
  260. if (!Base->LastPs->p->UDFIsRefer){
  261. laShowItemFull(uil, cr, Base, "identifier", LA_WIDGET_STRING_PLAIN,0, 0, 0);
  262. bracket = laOnConditionToggle(uil, cl, 0, 0, 0, 0, 0);
  263. }
  264. for (p = Base->LastPs->p->SubProp->Props.pFirst; p; p = p->Item.pNext){
  265. if (p->PropertyType == LA_PROP_SUB){
  266. //buf[0] = 0; sprintf(buf, "la.prop_containers#%s.properties#%s.name", p->Container->Identifier, p->Identifier);
  267. //laShowItemFull(uil, crrl, 0, buf, LA_WIDGET_STRING_PLAIN, 0, 0);
  268. buf[0] = 0;
  269. sprintf(buf, "identifier=%s;", p->Identifier);
  270. laShowItemFull(uil, crrr, Base, "put_data_block", 0, buf, 0, 0);
  271. //laShowLabel(uil, crr, "PUT", 0, 0);
  272. b1 = laOnConditionToggle(uil, crrl, 0, 0, 0, 0, 0);{
  273. buf[0] = 0; sprintf(buf, "text=...%s;", p->Name); strSafeSet(&b1->ExtraInstructions, buf);
  274. laShowItemFull(uil, cr, Base, p->Identifier, 0,0, laui_SubPropSelection, 0)->Flags|=LA_TEXT_ALIGN_LEFT;
  275. }
  276. laEndCondition(uil, b1);
  277. laShowSeparator(uil, c);
  278. }
  279. }
  280. if (!Base->LastPs->p->UDFIsRefer){
  281. laEndCondition(uil, bracket);
  282. }
  283. //laShowItemFull(uil, crl, Base, "identifier", 0, 0, 0);
  284. //p = Base->LastPs->p->SubProp->Props.pFirst;
  285. }
  286. void laui_LinkerSelectionProp(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context){
  287. laColumn *c, *cl, *cr, *cll, *clr, *crl, *crr, *crrl, *crrr;
  288. laUiItem *bracket, *b1, *b2;
  289. laPropContainer *pc;
  290. laProp *p;
  291. laPropPack *pp;
  292. char buf[LA_RAW_CSTR_MAX_LEN]={0};
  293. c = laFirstColumn(uil);
  294. laSplitColumn(uil, c, 0.4);
  295. cl = laLeftColumn(c, 1);
  296. cr = laRightColumn(c, 0);
  297. b1=laBeginRow(uil,cr,0,0);
  298. laShowItemFull(uil, cr, Base, "identifier", LA_WIDGET_STRING_PLAIN,0, 0, 0);
  299. laShowIcon(uil, cr, Base, "pp.last_ps.property.sub_icon_id", 0);
  300. laEndRow(uil,b1);
  301. bracket = laOnConditionToggle(uil, cl, 0, 0, 0, 0, 0);{
  302. laShowItemFull(uil, cr, Base, "instances", 0,0, laui_LinkerSelectionInstance, 0);
  303. }
  304. bracket->State=LA_BT_ACTIVE;
  305. laEndCondition(uil, bracket);
  306. }
  307. void laui_LinkerSelectionInstance(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context){
  308. laColumn *c, *cl, *cr, *cll, *clr, *crl, *crr, *crrl, *crrr;
  309. laUiItem *bracket, *b1, *b2;
  310. laPropContainer *pc;
  311. laProp *p;
  312. laPropPack *pp;
  313. char buf[LA_RAW_CSTR_MAX_LEN]={0};
  314. c = laFirstColumn(uil);
  315. laSplitColumn(uil, c, 0.4);
  316. cl = laLeftColumn(c, 1);
  317. cr = laRightColumn(c, 0);
  318. laShowItemFull(uil, cr, Base, "identifier", LA_WIDGET_STRING_PLAIN,0, 0, 0);
  319. b1 = laOnConditionToggle(uil, cl, 0, 0, 0, 0, 0);{
  320. laShowItemFull(uil, cr, Base, "children", 0,0, laui_LinkerSelectionProp, 0);
  321. }
  322. laEndCondition(uil, b1);
  323. }
  324. void laui_DefaultPanelTitleBar(laUiList *uil, laPropPack *Base, laPropPack *Extra, laUiDefineFunc header){
  325. laColumn *c, *cl, *cr, *cll, *clr, *crl, *crr, *cb1, *cb2, *cb3;
  326. laUiItem *bracket, *b1, *b2;
  327. c = laFirstColumn(uil);
  328. laSplitColumn(uil, c, 0.3);
  329. cl = laLeftColumn(c, 1);
  330. cr = laRightColumn(c, 0);
  331. b1=laBeginRow(uil,cr,0,0);
  332. laUiItem* tu=laShowItemFull(uil, cr, Base, "title", LA_WIDGET_STRING_PLAIN,0, 0, 0);tu->Expand=1;tu->Flags|=LA_UI_FLAGS_NO_TOOLTIP;
  333. laShowItem(uil, cr, Base, "hide")->Flags|=LA_UI_FLAGS_ICON;
  334. laShowItem(uil, cr, Base, "dock")->Flags|=LA_UI_FLAGS_ICON;
  335. laShowItem(uil, cr, Base, "close")->Flags|=LA_UI_FLAGS_ICON;
  336. laEndRow(uil,b1);
  337. bracket = laOnConditionToggle(uil, cl, 0, 0, 0, 0, 0);{
  338. if(!Extra->LastPs->p->SubProp->Props.pFirst){
  339. laShowLabel(uil, cr, "Panel doesn't have configurable property.", 0, 0);
  340. }else{
  341. if(header){
  342. laShowLabel(uil, cr, "Panel properties:", 0, 0);
  343. header(uil, Base, Extra, cr, 0);
  344. }else{
  345. for(laProp* p = Extra->LastPs->p->SubProp->Props.pFirst;p;p=p->Item.pNext){
  346. if(p->PropertyType&LA_PROP_SUB){
  347. laShowItemFull(uil, cr, Extra, p->Identifier, LA_WIDGET_COLLECTION_SELECTOR,0,laui_IdentifierOnly,0);
  348. }else{ laShowItem(uil, cr, Extra, p->Identifier); }
  349. }
  350. }
  351. }
  352. //laShowItem(uil, cr, 0,"la.example_int");
  353. laShowSeparator(uil, c);
  354. //laShowLabel(uil, c, "Position:", 0, 0);
  355. //laShowItemFull(uil, c, Base, "position", LA_WIDGET_INT, 0, 0);
  356. //laShowLabel(uil, c, "Size:", 0, 0);
  357. //laShowItemFull(uil, c, Base, "size", LA_WIDGET_INT, 0, 0);
  358. //laShowLabel(uil, c, "Snapping:", 0, 0);
  359. //laShowItem(uil, c, Base, "snap_enable")->Flags=LA_UI_FLAGS_CYCLE|LA_UI_FLAGS_TRANSPOSE;
  360. //laShowItemFull(uil, c, Base, "snap", LA_WIDGET_INT, 0, 0);
  361. }
  362. laEndCondition(uil, bracket);
  363. }
  364. void laui_DefaultOperatorPanelTitleBar(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context){
  365. laColumn *c, *cl, *cr, *cll, *clr, *crl, *crr;
  366. laUiItem *bracket, *b1, *b2;
  367. c = laFirstColumn(uil);
  368. b1 = laBeginRow(uil,c,0,0);
  369. laUiItem* tu=laShowItemFull(uil, c, Base, "title", LA_WIDGET_STRING_PLAIN,0, 0, 0);tu->Expand=1;tu->Flags|=LA_UI_FLAGS_NO_TOOLTIP;
  370. laShowItem(uil, c, 0, "LA_cancel");//->Flags|=LA_UI_FLAGS_ICON;
  371. laEndRow(uil, b1);
  372. }
  373. void laui_ColumnItem(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *UNUSED_Colums, int context){
  374. laColumn *c0, *c, *cl, *cr, *cll, *clr, *crl, *crr, *clll, *cllr, *cll2, *clr2;
  375. laUiItem *bracket, *b1, *b2;
  376. c0 = laFirstColumn(uil);
  377. laSplitColumn(uil, c0, 0.8);
  378. cll = laLeftColumn(c0, 80);
  379. c = laRightColumn(c0, 0);
  380. laSplitColumn(uil, c, 0.7);
  381. cl = laLeftColumn(c, 0);
  382. cr = laRightColumn(c, 200);
  383. laSplitColumn(uil, cr, 0.5);
  384. crl = laLeftColumn(cr, 0);
  385. crr = laRightColumn(cr, 70);
  386. laSplitColumn(uil, cll, 0.5);
  387. clll = laLeftColumn(cll, 1);
  388. cllr = laRightColumn(cll, 0);
  389. laSplitColumn(uil, cl, 0.5);
  390. cll2 = laLeftColumn(cl, 0);
  391. clr2 = laRightColumn(cl, 70);
  392. //laShowItem(uil, c, Base, "self");
  393. bracket = laOnConditionThat(uil, crr, laPropExpression(0, "live_editor.current_ui")); // laOnConditionThat(uil, 0, "live_editor", la_LiveEditAllowShow);
  394. laShowItemFull(uil, cll, Base, "select_column", 0, "text=Select;", 0, 0);
  395. laEndCondition(uil, bracket);
  396. bracket = laOnConditionThat(uil, c, laPropExpression(Base, "sub_left"));{ //laOnConditionThat(uil, Base, 0, laui_SnapButtonShow); {
  397. laShowItem(uil, cll2, Base, "split_at");
  398. laShowItemFull(uil, clr2, Base, "merge_column", 0, "text=Merge;", 0, 0);
  399. b1 = laOnConditionThat(uil, c, laPropExpression(Base, "snap_state"));{
  400. laShowItem(uil, crl, Base, "snap_width");
  401. }
  402. laElse(uil, b1);{
  403. laShowLabel(uil, crl, "Align:", 0, 0)->Flags|=LA_TEXT_ALIGN_RIGHT;
  404. }
  405. laEndCondition(uil, b1);
  406. laShowItem(uil, crr, Base, "snap_state");
  407. laShowSeparator(uil, c0);
  408. b1 = laOnConditionToggle(uil, clll, 0, 0, 0, 0, 0);{
  409. laShowItemFull(uil, c, Base, "sub_left", LA_WIDGET_COLLECTION_SINGLE,0, laui_ColumnItem, 0);
  410. }
  411. laElse(uil, b1);{
  412. laShowLabel(uil, cllr, "Left", 0, 0);
  413. }
  414. laEndCondition(uil, b1);
  415. laShowSeparator(uil, c0);
  416. b1 = laOnConditionToggle(uil, clll, 0, 0, 0, 0, 0);{
  417. laShowItemFull(uil, c, Base, "sub_right", LA_WIDGET_COLLECTION_SINGLE,0, laui_ColumnItem, 0);
  418. }
  419. laElse(uil, b1);{
  420. laShowLabel(uil, cllr, "Right", 0, 0);
  421. }
  422. laEndCondition(uil, b1);
  423. }
  424. laElse(uil, bracket);{
  425. laShowItem(uil, c, Base, "split_column");
  426. }
  427. laEndCondition(uil, bracket);
  428. }
  429. void laui_DefaultMenuButtonsFileEntries(laUiList *uil, laPropPack *pp, laPropPack *actinst, laColumn *extracol, int context){
  430. laColumn* c=laFirstColumn(uil);
  431. laShowLabel(uil, c, "Function Test", 0, 0)->Flags|=LA_TEXT_MONO|LA_UI_FLAGS_DISABLED;
  432. laShowItem(uil, c, 0, "LA_pure_yes_no");
  433. laShowItem(uil, c, 0, "LA_file_dialog");
  434. laShowItem(uil, c, 0, "LA_udf_read");
  435. laShowItemFull(uil, c, 0, "LA_udf_read",0,"mode=append;text=Append",0,0);
  436. laShowItem(uil, c, 0, "LA_managed_save");
  437. laShowItem(uil, c, 0, "LA_manage_udf");
  438. laShowLabel(uil, c, "Other Entries", 0, 0)->Flags|=LA_TEXT_MONO|LA_UI_FLAGS_DISABLED;
  439. laShowItem(uil, c, 0, "LA_terminate_program");
  440. }
  441. void laui_DefaultMenuButtonsEditEntries(laUiList *uil, laPropPack *pp, laPropPack *actinst, laColumn *extracol, int context){
  442. laColumn* c=laFirstColumn(uil);
  443. laShowLabel(uil, c, "History", 0, 0)->Flags|=LA_TEXT_MONO|LA_UI_FLAGS_DISABLED;
  444. laShowItem(uil, c, 0, "LA_undo")->Flags|=LA_UI_FLAGS_NO_CONFIRM;
  445. laShowItem(uil, c, 0, "LA_redo")->Flags|=LA_UI_FLAGS_NO_CONFIRM;
  446. laShowSeparator(uil,c);
  447. laShowItemFull(uil, c, 0, "LA_panel_activator",0,"panel_id=LAUI_histories;text=Histories",0,0);
  448. }
  449. void laui_DefaultMenuButtonsOptionEntries(laUiList *uil, laPropPack *pp, laPropPack *actinst, laColumn *extracol, int context){
  450. laColumn* c=laFirstColumn(uil);
  451. laShowLabel(uil, c, "Settings", 0, 0)->Flags|=LA_TEXT_MONO|LA_UI_FLAGS_DISABLED;
  452. laShowItemFull(uil, c, 0, "LA_panel_activator", 0, "panel_id=LAUI_user_preferences;", 0, 0);
  453. laShowLabel(uil, c, "Information", 0, 0)->Flags|=LA_TEXT_MONO|LA_UI_FLAGS_DISABLED;
  454. laShowItemFull(uil, c, 0, "LA_panel_activator", 0, "panel_id=LAUI_about;text=About;", 0, 0);
  455. }
  456. void laui_DefaultMenuButtons(laUiList *uil, laPropPack *pp, laPropPack *actinst, laColumn *extracol, int context){
  457. laUiList *muil; laColumn *mc,*c = laFirstColumn(uil);
  458. muil = laMakeMenuPage(uil, c, "File");{
  459. mc = laFirstColumn(muil); laui_DefaultMenuButtonsFileEntries(muil,pp,actinst,extracol,0);
  460. }
  461. if(MAIN.InitArgs.HasHistories){
  462. muil = laMakeMenuPage(uil, c, "Edit");{
  463. mc = laFirstColumn(muil); laui_DefaultMenuButtonsEditEntries(muil,pp,actinst,extracol,0);
  464. }
  465. }
  466. muil = laMakeMenuPage(uil, c, "Options"); {
  467. mc = laFirstColumn(muil); laui_DefaultMenuButtonsOptionEntries(muil,pp,actinst,extracol,0);
  468. }
  469. }
  470. void laui_DefaultMenuExtras(laUiList *uil, laPropPack *pp, laPropPack *actinst, laColumn *extracol, int context){
  471. laColumn *c = laFirstColumn(uil);
  472. laShowLabel(uil, c, MAIN.MenuProgramName, 0, 0)->Expand=1;
  473. }
  474. void laui_DefaultMenuBarActual(laUiList *uil, laPropPack *pp, laPropPack *actinst, laColumn *extracol, int context){
  475. laUiList *muil,*backuil;
  476. laColumn *c,*mc,*backc;
  477. laUiItem* bb,*mbb;
  478. c = laFirstColumn(uil);
  479. laUiItem* row=laBeginRow(uil,c,0,0);
  480. bb=laOnConditionThat(uil,c,laPropExpression(0,"la.windows.operator_hints"));{
  481. laShowItem(uil,c,0,"la.windows.operator_hints");
  482. }laElse(uil,bb);{
  483. laShowItem(uil, c, 0, "LA_new_panel")->Flags=LA_UI_FLAGS_ICON;
  484. #ifdef LAGUI_ANDROID
  485. backc=c; backuil=uil;
  486. uil=laMakeMenuPageEx(uil,c,"Menu",/*LA_UI_FLAGS_NO_CONFIRM*/0); c=laFirstColumn(uil);
  487. mbb=laBeginRow(uil,c,0,0);
  488. #endif
  489. if(MAIN.MenuButtons){ MAIN.MenuButtons(uil,0,0,0,0); }
  490. #ifdef LAGUI_ANDROID
  491. laEndRow(uil,mbb); mbb=laBeginRow(uil,c,0,0);
  492. #else
  493. laShowSeparator(uil,c);
  494. #endif
  495. laUiItem* mui=laOnConditionThat(uil,c,laPropExpression(0,"la.windows.maximized_ui"));{
  496. laShowItemFull(uil,c,0,"LA_canvas_ui_maximize", 0, "icon=🡰;restore=true;text=Restore Layout", 0, 0);
  497. }laElse(uil,mui);{
  498. laUiItem* ui=laOnConditionThat(uil,c,laPropExpression(0,"la.windows.maximized_block"));{
  499. laShowItemFull(uil,c,0,"LA_block_maximize", 0, "icon=🡰;restore=true;text=Restore Layout", 0, 0);
  500. }laElse(uil,ui);{
  501. laShowItemFull(uil, c, 0, "LA_switch_layout", 0, "icon=🞐;show_list=true;", 0, 0)->Flags|=LA_UI_FLAGS_ICON;
  502. laShowItemFull(uil,c,0,"LA_switch_layout", 0, "icon=🡰;reverse=true;", 0, 0)->Flags|=LA_UI_FLAGS_ICON;
  503. laShowItemFull(uil,c,0,"LA_switch_layout", 0, "icon=🡲;", 0,0)->Flags|=LA_UI_FLAGS_ICON;
  504. laShowItem(uil, c, 0, "la.windows.layouts.identifier");
  505. #ifndef LAGUI_ANDROID
  506. laShowItem(uil,c,0,"LA_new_window")->Flags|=LA_UI_FLAGS_ICON;
  507. #endif
  508. }laEndCondition(uil, ui);
  509. }laEndCondition(uil,mui);
  510. laUiItem* uc=laOnConditionThat(uil,c,laPropExpression(0,"la.user_preferences.enable_color_management"));{
  511. #ifdef LAGUI_ANDROID
  512. laEndRow(uil,mbb); mbb=laBeginRow(uil,c,0,0);
  513. laShowItem(uil,c,0,"la.windows.output_color_space");
  514. #else
  515. laShowSeparator(uil,c);
  516. laShowItemFull(uil,c,0,"la.user_preferences.auto_switch_color_space",0,"icon=A",0,0)->Flags|=LA_UI_FLAGS_ICON|LA_UI_FLAGS_CYCLE|LA_UI_FLAGS_HIGHLIGHT|LA_UI_FLAGS_NO_CONFIRM;
  517. laUiItem* uc1=laOnConditionThat(uil,c,laPropExpression(0,"la.user_preferences.auto_switch_color_space"));{
  518. laShowItem(uil,c,0,"la.windows.output_color_space")->Flags|=LA_UI_FLAGS_PLAIN;
  519. }laElse(uil,uc1);{
  520. laShowItem(uil,c,0,"la.windows.output_color_space");
  521. }laEndCondition(uil, uc1);
  522. #endif
  523. laShowItemFull(uil,c,0,"la.windows.output_show_overflow",0,"text=🟩;",0,0)->Flags|=LA_UI_FLAGS_NO_CONFIRM;
  524. laShowItemFull(uil,c,0,"la.windows.output_proofing",0,0,0,0)->Flags|=LA_UI_FLAGS_CYCLE|LA_UI_FLAGS_ICON|LA_UI_FLAGS_HIGHLIGHT|LA_UI_FLAGS_NO_CONFIRM;
  525. laShowItemFull(uil,c,0,"la.windows.use_composing",0,"text=☀",0,0)->Flags|=LA_UI_FLAGS_NO_CONFIRM;
  526. laUiItem* cmp=laOnConditionThat(uil,c,laPropExpression(0,"la.windows.use_composing"));{
  527. muil = laMakeMenuPageEx(uil, c, "⯆",LA_UI_FLAGS_NO_CONFIRM);{ mc = laFirstColumn(muil);
  528. laUiItem*b,*ui;
  529. b=laBeginRow(muil,mc,0,0); laShowLabel(muil,mc,"γ",0,0);
  530. ui=laShowItemFull(muil, mc, 0, "la.windows.composing_gamma",0,"text=Gamma",0,0); ui->Expand=1;
  531. laShowItem(muil,mc,&ui->PP,"restore")->Flags|=LA_UI_FLAGS_NO_CONFIRM|LA_UI_FLAGS_ICON; laEndRow(muil,b);
  532. b=laBeginRow(muil,mc,0,0); laShowLabel(muil,mc,"◩",0,0);
  533. ui=laShowItemFull(muil, mc, 0, "la.windows.composing_blackpoint",0,"text=Blackpoint",0,0); ui->Expand=1;
  534. laShowItem(muil,mc,&ui->PP,"restore")->Flags|=LA_UI_FLAGS_NO_CONFIRM|LA_UI_FLAGS_ICON; laEndRow(muil,b);
  535. }
  536. }laEndCondition(uil, cmp);
  537. }laEndCondition(uil, uc);
  538. #ifdef LAGUI_ANDROID
  539. laEndRow(uil,mbb);
  540. c=backc; uil=backuil;
  541. #endif
  542. if(MAIN.MenuExtras){ laShowSeparator(uil,c); MAIN.MenuExtras(uil,0,0,0,0); }
  543. laUiItem* b1=laOnConditionThat(uil,c,laPropExpression(0,"la.windows.panels_hidden"));
  544. #ifndef LAGUI_ANDROID
  545. laShowSeparator(uil,c);
  546. #endif
  547. muil = laMakeMenuPage(uil, c, "🡻 Minimized");{
  548. mc = laFirstColumn(muil);
  549. laShowItemFull(muil, mc, 0, "la.windows.panels_hidden", 0,0, laui_IdentifierOnly,0);
  550. }
  551. laEndCondition(uil, b1);
  552. #ifndef LAGUI_ANDROID
  553. b1=laOnConditionThat(uil,c,laPropExpression(0,"la.windows.is_fullscreen"));{
  554. laShowItemFull(uil,c,0,"LA_fullscreen",0,"restore=true;text=Restore;icon=🡷",0,0)->Flags|=LA_UI_FLAGS_EXIT_WHEN_TRIGGERED;
  555. }laElse(uil,b1);{
  556. laShowItemFull(uil,c,0,"LA_fullscreen",0,0,0,0)->Flags|=LA_UI_FLAGS_EXIT_WHEN_TRIGGERED;
  557. }laEndCondition(uil, b1);
  558. #endif
  559. }laEndCondition(uil,bb);
  560. laEndRow(uil,row);
  561. }
  562. void laui_DefaultMenuBar(laWindow *w){
  563. laPanel *p;
  564. p =laCreateTopPanel(w, 0, 0, 0, 0, LA_RH, 0, 0, 0, 0, -1, -1, -1, 0);
  565. p->IsMenuPanel = 1;
  566. laui_DefaultMenuBarActual(&p->TitleBar, &p->PP, &p->PropLinkPP, 0, 0);
  567. }
  568. void laui_ThemeListItem(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *UNUSED_Colums, int context){
  569. laColumn *col, *cl, *cr;
  570. laUiItem *bracket;
  571. col = laFirstColumn(uil);
  572. bracket = laBeginRow(uil,col,0,0);
  573. laShowItemFull(uil, col, Base, "name", LA_WIDGET_STRING_PLAIN,0, 0, 0)->Expand=1;
  574. laShowItemFull(uil, col, Base, "author", LA_WIDGET_STRING_PLAIN,0, 0, 0);
  575. laEndRow(uil,bracket);
  576. }
  577. void laui_Theme(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *UNUSED_Colums, int context){
  578. laColumn *col, *cl, *cr, *cll, *clr;
  579. laUiItem *sui;
  580. laUiList *tuil;
  581. laUiItem *ui;
  582. //col = laFirstColumn(uil);
  583. //tuil = laMakeGroup(uil, col, "����ժҪ", 0, 0)->Page; {
  584. // col = laFirstColumn(tuil);
  585. // laSplitColumn(tuil, col, 0.7);
  586. // cl = laLeftColumn(col, 0);
  587. // cr = laRightColumn(col, 0);
  588. // laSplitColumn(tuil, cr, 0.6);
  589. // crl = laLeftColumn(cr, 0);
  590. // crr = laRightColumn(cr, 70);
  591. // laShowItemFull(tuil, cl, 0, "themes.name", 0, 0, 0);
  592. // laShowItemFull(tuil, crl, 0, "themes.author", 0, 0, 0);
  593. // laShowLabel(tuil, crr, 0, "EXEC", 0, 0, 0);
  594. //}
  595. col = laFirstColumn(uil); laSplitColumn(uil,col,0.5);
  596. cl=laLeftColumn(col,0); cr=laRightColumn(col,0);
  597. ui=laBeginRow(uil,col, 0,0);
  598. laShowItem(uil,col,Base, "delete");
  599. laShowItem(uil,col,Base, "name")->Expand=1;
  600. laEndRow(uil, ui);
  601. laShowLabel(uil, col, "Basics:",0,0);
  602. laShowLabel(uil, cl, "Base Color:",0,0)->Flags|=LA_TEXT_ALIGN_RIGHT; laShowItem(uil, cr, Base, "color");
  603. laShowLabel(uil, cl, "Accent Color:",0,0)->Flags|=LA_TEXT_ALIGN_RIGHT; laShowItem(uil, cr, Base, "accent_color");
  604. laShowLabel(uil, cl, "Warning Color:",0,0)->Flags|=LA_TEXT_ALIGN_RIGHT; laShowItem(uil, cr, Base, "warning_color");
  605. laShowItem(uil, cr, Base, "cursor_alpha");
  606. laShowItem(uil, cr, Base, "selection_alpha");
  607. laShowItem(uil, cr, Base, "inactive_mix");
  608. laShowItem(uil, cr, Base, "inactive_saturation");
  609. laShowLabel(uil, col, "Nodes:",0,0);
  610. laShowItem(uil, cr, Base, "wire_brightness");
  611. laShowItem(uil, cr, Base, "wire_saturation");
  612. laShowItem(uil, cr, Base, "wire_transparency");
  613. laShowLabel(uil, col, "Meshes:",0,0);
  614. laShowItem(uil, cl, Base, "edge_transparency");
  615. laShowItem(uil, cl, Base, "edge_brightness");
  616. laShowItem(uil, cr, Base, "vertex_transparency");
  617. laShowItem(uil, cr, Base, "vertex_brightness");
  618. laShowItem(uil, col, Base, "svertex_transparency");
  619. laShowItem(uil, col, Base, "sedge_transparency");
  620. laShowItem(uil, col, Base, "sface_transparency");
  621. laShowLabel(uil, col, "Widgets:",0,0);
  622. laShowItem(uil, col, Base, "boxed_themes")->Flags|=(LA_UI_FLAGS_NO_DECAL|LA_UI_FLAGS_NO_GAP);
  623. }
  624. void laui_BoxedThemeItem(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *UNUSED_Colums, int context){
  625. laColumn *col, *cl, *cr, *crl,*crr;
  626. laUiItem *bracket;
  627. laUiList *tuil;
  628. col = laFirstColumn(uil);
  629. laSplitColumn(uil, col, 0.8);
  630. cl = laLeftColumn(col, 1);
  631. cr = laRightColumn(col, 0);
  632. laSplitColumn(uil, cr, 0.5);
  633. crl = laLeftColumn(cr, 0);
  634. crr = laRightColumn(cr, 0);
  635. laShowItemFull(uil, cr, Base, "name", LA_WIDGET_STRING_PLAIN, 0 ,0,0);
  636. bracket = laOnConditionToggle(uil, cl, 0, 0, 0, 0, 0);{
  637. laShowItem(uil, cr, Base, "normal");
  638. laShowItem(uil, cr, Base, "active");
  639. laShowItem(uil, cr, Base, "border");
  640. laShowItem(uil, cr, Base, "text");
  641. laShowItem(uil, cr, Base, "text_active");
  642. laShowItem(uil, cr, Base, "alpha");
  643. laShowLabel(uil,crl,"Margins:",0,0);
  644. laShowItem(uil, crl, Base, "margins")->Flags=LA_UI_FLAGS_TRANSPOSE;
  645. laShowLabel(uil,crr,"Paddings:",0,0);
  646. laShowItem(uil, crr, Base, "paddings")->Flags=LA_UI_FLAGS_TRANSPOSE;
  647. }
  648. laEndCondition(uil, bracket);
  649. }
  650. void laui_PropertyContainerList(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *UNUSED_Colums, int context){
  651. laColumn *col, *cl, *cr, *crl, *crr, *cll, *clr, *crrl, *crrr;
  652. laUiItem *bracket;
  653. laUiList *tuil;
  654. col = laFirstColumn(uil);
  655. laSplitColumn(uil, col, 0.5);
  656. cl = laLeftColumn(col, 60);
  657. cr = laRightColumn(col, 0);
  658. laSplitColumn(uil, cr, 0.25);
  659. crl = laLeftColumn(cr, 0);
  660. crr = laRightColumn(cr, 0);
  661. laSplitColumn(uil, crr, 0.3);
  662. crrl = laLeftColumn(crr, 0);
  663. crrr = laRightColumn(crr, 0);
  664. laShowLabel(uil, cl, "Select", 0, 0);
  665. laShowLabel(uil, crl, "Identifier", 0, 0);
  666. laShowLabel(uil, crrl, "Name", 0, 0);
  667. laShowLabel(uil, crrr, "Description", 0, 0);
  668. laShowColumnAdjuster(uil, col);
  669. laShowItem(uil, col, Base, "properties");
  670. }
  671. void laui_WindowListItem(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *UNUSED_Colums, int context){
  672. laColumn *col, *cl, *cr, *cll, *clr;
  673. laUiItem *bracket;
  674. laUiList *tuil;
  675. cl = laFirstColumn(uil);
  676. laSplitColumn(uil, cl, 0.2);
  677. cll = laLeftColumn(cl, 1);
  678. clr = laRightColumn(cl, 0);
  679. laShowItem(uil, clr, Base, "title");
  680. bracket = laOnConditionToggle(uil, cll, 0, 0, 0, 0, 0);{
  681. laShowLabel(uil, clr, "Layouts", 0, 0);
  682. laShowItem(uil, clr, Base, "layouts");
  683. laShowLabel(uil, clr, "TopPanels", 0, 0);
  684. laShowItem(uil, clr, Base, "panels");
  685. }
  686. laEndCondition(uil, bracket);
  687. }
  688. void laui_LayoutListItem(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *UNUSED_Colums, int context){
  689. laColumn *col, *cl, *cr, *cll, *clr;
  690. laUiItem *bracket;
  691. laUiList *tuil;
  692. cl = laFirstColumn(uil);
  693. laSplitColumn(uil, cl, 0.2);
  694. cll = laLeftColumn(cl, 1);
  695. clr = laRightColumn(cl, 0);
  696. laShowItem(uil, clr, Base, "title");
  697. bracket = laOnConditionToggle(uil, cll, 0, 0, 0, 0, 0);{
  698. laShowItem(uil, clr, Base, "panels");
  699. }
  700. laEndCondition(uil, bracket);
  701. }
  702. void laui_PanelListItem(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *UNUSED_Colums, int context){
  703. laColumn *col, *cl, *cr, *cll, *clr;
  704. laUiItem *bracket;
  705. laUiList *tuil;
  706. cl = laFirstColumn(uil);
  707. laSplitColumn(uil, cl, 0.2);
  708. cll = laLeftColumn(cl, 1);
  709. clr = laRightColumn(cl, 0);
  710. laShowItem(uil, clr, Base, "title");
  711. bracket = laOnConditionToggle(uil, cll, 0, 0, 0, 0, 0);{
  712. laShowItemFull(uil, clr, Base, "size", LA_WIDGET_INT,0, 0, 0);
  713. }
  714. laEndCondition(uil, bracket);
  715. }
  716. void laui_UiTemplateListItemLiveEdit(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *UNUSED_Colums, int context){
  717. laColumn *col, *cl, *cr, *cll, *clr;
  718. laUiItem *bracket;
  719. laUiList *tuil;
  720. cl = laFirstColumn(uil);
  721. //bracket = laOnConditionThat(uil, cl, laNot(laPropExpression(Base, "for_panel"))); {
  722. 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")))));{
  723. laShowItemFull(uil, cl, Base, "identifier", LA_WIDGET_STRING_PLAIN,0, 0, 0);
  724. }
  725. laElse(uil, bracket);{
  726. laShowItemFull(uil, cl, Base, "identifier", LA_WIDGET_STRING_PLAIN, "disabled=true;",0, 0);
  727. }
  728. laEndCondition(uil, bracket);
  729. }
  730. void laui_UiTemplateListItem(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *UNUSED_Colums, int context){
  731. laColumn *col, *cl, *cr, *cll, *clr, *clll, *cllr, *clrl, *clrr, *clrrl, *clrrr;
  732. laUiItem *bracket, *b1;
  733. laUiList *tuil;
  734. cl = laFirstColumn(uil);
  735. laSplitColumn(uil, cl, 0.2);
  736. cll = laLeftColumn(cl, LA_2RH);
  737. clr = laRightColumn(cl, 0);
  738. laSplitColumn(uil, cll, 0.5);
  739. clll = laLeftColumn(cll, 0);
  740. cllr = laRightColumn(cll, 0);
  741. laSplitColumn(uil, clr, 0.5);
  742. clrl = laLeftColumn(clr, 0);
  743. clrr = laRightColumn(clr, 200);
  744. laSplitColumn(uil, clrr, 0.2);
  745. clrrl = laLeftColumn(clrr, 1);
  746. clrrr = laRightColumn(clrr, 0);
  747. bracket = laOnConditionThat(uil, cll, laPropExpression(Base, "define_func"));{
  748. laShowLabel(uil, clll, "f", 0, 0);
  749. }
  750. laEndCondition(uil, bracket);
  751. bracket = laOnConditionThat(uil, cll, laPropExpression(Base, "descriptor"));{
  752. laShowLabel(uil, cllr, "🠞", 0, 0);
  753. }
  754. laEndCondition(uil, bracket);
  755. laShowItemFull(uil, clrl, Base, "identifier", LA_WIDGET_STRING_PLAIN,0, 0, 0);
  756. bracket = laOnConditionThat(uil, cll, laPropExpression(Base, "target_id"));{
  757. laShowIcon(uil, clrrl, Base, "target.icon_id", 0);
  758. laShowItemFull(uil, clrrr, Base, "target_id", LA_WIDGET_STRING_PLAIN,0, 0, 0);
  759. }
  760. laElse(uil, bracket);{
  761. b1 = laOnConditionThat(uil, cll, laPropExpression(Base, "for_panel"));{
  762. //laShowLabel(uil, clrrl, 0,, 0, 0);
  763. laShowLabel(uil, clrrr, "PANEL", 0, 0);
  764. }
  765. laElse(uil, b1);{
  766. laShowLabel(uil, clrrr, "-", 0, LA_WIDGET_STRING_PLAIN);
  767. }
  768. laEndCondition(uil, b1);
  769. }
  770. laEndCondition(uil, bracket);
  771. }
  772. void laui_PlainSceneListItem(laUiList *uil, laPropPack *This, laPropPack *OP_UNUSED, laColumn *Extra, int context){
  773. laColumn *col = Extra, *c, *cl, *cr, *crl, *crr, *cll, *clr, *clrl, *clrr, *clrrl, *clrrr;
  774. laUiItem *ui;
  775. //if (Extra)c = Extra;
  776. c = laFirstColumn(uil);
  777. laShowItemFull(uil, c, This, "name", LA_WIDGET_STRING_PLAIN, 0, 0, 0);
  778. }
  779. void laui_DataRestorePage(laUiList *uil, laPropPack *THIS_UNUSED, laPropPack *Operator, laColumn *UNUSED, int context){
  780. laColumn *col = laFirstColumn(uil), *c, *cl, *cr, *crl, *crr, *cll, *clr, *clrl, *clrr, *clrrl, *clrrr;
  781. laUiList *u;
  782. laUiItem *b;
  783. laShowItemFull(uil, col, 0, "la", 0, 0, laui_SubPropSelection, 0);
  784. laShowItemFull(uil, col, 0, "tns", 0, 0, laui_SubPropSelection, 0);
  785. }
  786. void laui_FileBrowserFileItem(laUiList *uil, laPropPack *This, laPropPack *OP_UNUSED, laColumn *Extra, int context){
  787. laColumn *c = Extra, *cl, *cr, *crl, *crr, *cll, *clr, *clrl, *clrr, *clrrl, *clrrr;
  788. laUiItem *ui;
  789. if (!c) { c = laFirstColumn(uil); }
  790. laSplitColumn(0, c, 0.1);
  791. cll = laLeftColumn(c, 1);
  792. clr = laRightColumn(c, 0);
  793. laSplitColumn(0, clr, 0.7);
  794. clrl = laLeftColumn(clr, 0);
  795. clrr = laRightColumn(clr, 0);
  796. laSplitColumn(0, clrr, 0.5);
  797. clrrl = laLeftColumn(clrr, 0);
  798. clrrr = laRightColumn(clrr, 0);
  799. laShowItemFull(uil, cll, This, "type", LA_WIDGET_ENUM_ICON_PLAIN, 0, 0, 0)->Flags|=LA_TEXT_ALIGN_RIGHT;
  800. //laShowItem(uil, cll, This, "is_folder");
  801. laShowItemFull(uil, clrl, This, "name", LA_WIDGET_STRING_PLAIN, 0, 0, 0);
  802. ui = laOnConditionThat(uil, clrr, laNot(laPropExpression(This, "is_folder")));{
  803. laShowItemFull(uil, clrrl, This, "time_modified.time_string", LA_WIDGET_STRING_PLAIN, 0, 0, 0);
  804. laShowItemFull(uil, clrrr, This, "size_string",LA_WIDGET_STRING_PLAIN,0,0,0)->Flags|=LA_TEXT_ALIGN_RIGHT;
  805. }
  806. laEndCondition(uil, ui);
  807. //laShowSeparator(uil,cll)
  808. //laShowItemFull(uil, clrrl, This, "time_modified.time_string", LA_WIDGET_STRING_PLAIN, 0, 0);
  809. //laShowItem(uil, clrrr, This, "size");
  810. }
  811. void laui_FileBrowserDiskItem(laUiList *uil, laPropPack *This, laPropPack *OP_UNUSED, laColumn *Extra, int context){
  812. laColumn *col = Extra, *c, *cl, *cr, *crl, *crr;
  813. laUiItem *ui;
  814. c = Extra;
  815. laSplitColumn(0, c, 0.2);
  816. cl = laLeftColumn(c, LA_2RH);
  817. cr = laRightColumn(c, 0);
  818. laSplitColumn(0, cr, 0.5);
  819. crl = laLeftColumn(cr, 0);
  820. crr = laRightColumn(cr, 0);
  821. //laShowColumnAdjuster(uil, c);
  822. laShowItemFull(uil, cl, This, "id", LA_WIDGET_STRING_PLAIN, 0, 0, 0);
  823. laShowItem(uil, crl, This, "total_gb")->Flags |= LA_UI_FLAGS_NO_DECAL;
  824. laShowItem(uil, crr, This, "free_gb")->Flags |= LA_UI_FLAGS_NO_DECAL;
  825. }
  826. void laui_FileBrowserFileList(laUiList *uil, laPropPack *THIS_UNUSED, laPropPack *Operator, laColumn *UNUSED, int context){
  827. laColumn *col = laFirstColumn(uil), *c, *cl, *cr, *crl, *crr, *cll, *clr, *clrl, *clrr, *clrrl, *clrrr, *ulc;
  828. laUiList *u; laUiItem *b; laUiList *ul;
  829. laSplitColumn(uil, col, 0.25);
  830. cl = laLeftColumn(col, 10); cr = laRightColumn(col, 0);
  831. laUiItem* row=laBeginRow(uil,cl,0,0);
  832. laShowItemFull(uil, cl, Operator, "refresh", LA_WIDGET_BUTTON_NO_CONFIRM,0,0,0);
  833. laShowItemFull(uil, cl, Operator, "folder_up", LA_WIDGET_BUTTON_NO_CONFIRM,0,0,0)->Expand=1;
  834. laEndRow(uil,row);
  835. laShowItem(uil, cr, Operator, "path")->Expand=1;
  836. row=laBeginRow(uil,cl,0,0);
  837. laShowSeparator(uil,cl)->Expand=1;
  838. laShowItemFull(uil, cl, Operator, "new_directory", LA_WIDGET_BUTTON_NO_CONFIRM,0,0,0);
  839. laEndRow(uil,row);
  840. laSplitColumn(uil,cr,0.5);
  841. laColumn *fnamel=laLeftColumn(cr,0),*fnamer=laRightColumn(cr,15);
  842. laShowItem(uil, fnamel, Operator, "file_name");
  843. laUiItem* r=laBeginRow(uil,fnamer,0,0);
  844. laShowLabel(uil,fnamer,"🔍",0,0);
  845. laUiItem* ui=laShowItem(uil, fnamer, Operator, "filter_name"); ui->Expand=1; ui->Flags|=LA_UI_FLAGS_IMMEDIATE_INPUT;
  846. laShowItem(uil, fnamer, Operator, "confirm")->Flags|=LA_UI_FLAGS_HIGHLIGHT|LA_UI_FLAGS_NO_CONFIRM;
  847. laEndRow(uil,r);
  848. laShowSeparator(uil,col);
  849. laUiItem* left=laMakeEmptyGroup(uil, cl, "left", 0); ul=left->Page; left->Flags|=LA_UI_FLAGS_NO_DECAL; ul->HeightCoeff=-1;
  850. ulc=laFirstColumn(ul);
  851. laFileBrowser* fb=Operator->EndInstance;
  852. if(fb){
  853. laUiItem* b=laOnConditionThat(ul,ulc,laPropExpression(Operator,"show_thumbnail"));
  854. laShowImage(ul,ulc,fb->Thumbnail,5);
  855. laEndCondition(ul,b);
  856. }
  857. r=laBeginRow(ul,ulc,1,0);
  858. laShowItemFull(ul,ulc,Operator,"show_thumbnail",0,"text=Thumbnail",0,0)->Flags|=LA_UI_FLAGS_CYCLE|LA_UI_FLAGS_HIGHLIGHT;
  859. laShowItemFull(ul,ulc,Operator,"show_backups",0,"text=Backups",0,0)->Flags|=LA_UI_FLAGS_CYCLE|LA_UI_FLAGS_HIGHLIGHT;
  860. laEndRow(ul,r);
  861. b=laOnConditionThat(ul,ulc,laPropExpression(Operator,"use_type"));{
  862. u = laMakeGroup(ul, ulc, "Use Format", 0)->Page; c = laFirstColumn(u);
  863. laShowItemFull(u,c,Operator,"available_extensions",0,0,laui_IdentifierOnly,0)->Flags|=LA_UI_FLAGS_NO_DECAL;
  864. }laEndCondition(ul,b);
  865. u = laMakeFoldableGroup(ul, ulc, "Bookmarks", 0, 0, 0)->Page; c = laFirstColumn(u);
  866. laShowItemFull(u,c,Operator,"bookmarks",0,0,laui_IdentifierOnly,0)->Flags|=LA_UI_FLAGS_NO_DECAL;
  867. u = laMakeGroup(ul, ulc, "Logic Drives", 0)->Page;
  868. c = laFirstColumn(u); laSplitColumn(u, c, 0.2); cll = laLeftColumn(c, LA_2RH); clr = laRightColumn(c, 0);
  869. laSplitColumn(u, clr, 0.5); clrl = laLeftColumn(clr, 0); clrr = laRightColumn(clr, 0);
  870. laShowColumnAdjuster(u, c);
  871. laShowItem(u, c, Operator, "disk_list");
  872. b = laMakeGroup(uil, cr, "File List", 0);b->State=LA_UI_ACTIVE; u=b->Page;
  873. u->HeightCoeff = -1;
  874. c = laFirstColumn(u); laSplitColumn(u, c, 0.1); cll = laLeftColumn(c, 1); clr = laRightColumn(c, 0);
  875. laSplitColumn(u, clr, 0.7); clrl = laLeftColumn(clr, 0); clrr = laRightColumn(clr, 0);
  876. laSplitColumn(u, clrr, 0.5); clrrl = laLeftColumn(clrr, 0); clrrr = laRightColumn(clrr, 0);
  877. laShowColumnAdjuster(u, c);
  878. laShowItemFull(u, clrl,Operator, "sort_name",0,"text=File Name",0,0)->Flags|=LA_UI_FLAGS_NO_DECAL;
  879. laShowItemFull(u, clrrl,Operator, "sort_time",0,"text=Last Modified On",0,0)->Flags|=LA_UI_FLAGS_NO_DECAL;
  880. laShowItemFull(u, clrrr,Operator, "sort_size",0,"text=Size",0,0)->Flags|=LA_UI_FLAGS_NO_DECAL;
  881. laShowItem(u, c, Operator, "file_list")->Flags|=LA_UI_FLAGS_NO_DECAL;
  882. }
  883. void laui_LinkerPanel(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context){
  884. laColumn *c, *cl, *cr, *cll, *clr, *crl, *crr, *crrl, *crrr, *gc;
  885. laUiList *gu;
  886. laUiItem *bracket, *b1, *b2;
  887. laPropContainer *pc;
  888. laProp *p;
  889. laPropPack *pp;
  890. char buf[LA_RAW_CSTR_MAX_LEN]={0};
  891. c = laFirstColumn(uil);
  892. laSplitColumn(uil, c, 0.2);
  893. cl = laLeftColumn(c, 100);
  894. cr = laRightColumn(c, 0);
  895. laSplitColumn(uil, cr, 0.2);
  896. crl = laLeftColumn(cr, 1);
  897. crr = laRightColumn(cr, 0);
  898. gu = laMakeGroup(uil, c, " UDF File Content", 0)->Page;{
  899. gc = laFirstColumn(gu);
  900. laShowItem(gu, gc, OperatorInst, "root_nodes");
  901. }
  902. }
  903. void laui_ManagedUDFItem(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context){
  904. laColumn *c=laFirstColumn(uil);
  905. laSplitColumn(uil,c,0.5);
  906. laColumn *cl=laLeftColumn(c, 1);
  907. laColumn *cr=laRightColumn(c,0);
  908. laUiItem* b2=laOnConditionThat(uil,cr,laPropExpression(Base,"udf"));{
  909. laUiItem* r=laBeginRow(uil,c,0,0);
  910. laUiItem* b=laOnConditionToggle(uil,c,0,0,0,0,0);strSafeSet(&b->ExtraInstructions,"text=🛈;");b->Flags|=LA_UI_FLAGS_PLAIN;{
  911. laShowItemFull(uil,c,Base,"udf.path",LA_WIDGET_STRING_PLAIN, 0 ,0,0);
  912. }laElse(uil,b);{
  913. laShowItemFull(uil,c,Base,"basename",LA_WIDGET_STRING_PLAIN, 0 ,0,0);
  914. }laEndCondition(uil,b);
  915. laEndRow(uil, r);
  916. }laElse(uil,b2);{
  917. laShowItemFull(uil,c,Base,"basename",LA_WIDGET_STRING_PLAIN, 0 ,0,0);
  918. }laEndCondition(uil,b2);
  919. }
  920. void laui_ManagedUDFOps(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context){
  921. laColumn *c=laFirstColumn(uil);
  922. laSplitColumn(uil,c,0.3);
  923. laColumn *cl=laLeftColumn(c, 1);
  924. laColumn *cr=laRightColumn(c,0);
  925. laUiItem* b1=laOnConditionThat(uil, cr, laPropExpression(Base, "udf"));{
  926. laShowItem(uil,cl,Base,"udf.modified");
  927. laUiItem* b=laBeginRow(uil,cr,0,0);
  928. laUiItem* b2=laOnConditionToggle(uil,cr,0,0,0,0,0);strSafeSet(&b2->ExtraInstructions,"text=🛈;");b2->Flags|=LA_UI_FLAGS_PLAIN;{
  929. laUiItem* ui=laShowItemFull(uil,cr,Base,"udf.path",LA_WIDGET_STRING_PLAIN, 0 ,0,0);ui->Expand=1;strSafeSet(&ui->ExtraInstructions,"text=Change");
  930. laShowItem(uil,cr,&ui->PP,"get_file_path");
  931. }laElse(uil,b2);{
  932. laShowItemFull(uil,cr,Base,"basename", LA_WIDGET_STRING_PLAIN, 0 ,0,0)->Expand=1;
  933. }laEndCondition(uil,b2);
  934. laEndRow(uil, b);
  935. }laElse(uil,b1);{
  936. laShowItemFull(uil,cr,0,"LA_managed_save_new_file",0,"feedback=NONE;",0,0);
  937. }laEndCondition(uil,b1);
  938. }
  939. void laui_ManagedPropInstance(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context){
  940. if(!Base ||! Base->EndInstance ||Base->LastPs->p->PropertyType!=LA_PROP_SUB) return;
  941. laColumn *c=laFirstColumn(uil);
  942. laSplitColumn(uil,c,0.3); laColumn *cl=laLeftColumn(c, 1); laColumn *cr=laRightColumn(c,0);
  943. laSplitColumn(uil,cr,0.6); laColumn *crl=laLeftColumn(cr, 0); laColumn *crr=laRightColumn(cr,20);
  944. laPropContainer* pc=la_EnsureSubTarget(Base->LastPs->p, Base->EndInstance);
  945. if(pc->UDFPropagate){
  946. char buf[128]; sprintf(buf,"Assign all \"%s\" into:",pc->Name);
  947. laShowLabel(uil,crl,buf,0,0)->Flags|=LA_TEXT_ALIGN_RIGHT|LA_UI_FLAGS_DISABLED;
  948. laShowItem(uil,crr,Base,"__single_udf_propagate");
  949. laShowLabel(uil,cl," ",0,0);
  950. }
  951. if(pc->OtherAlloc || Base->LastPs->p->UDFIsSingle){
  952. //laShowLabel(uil,cr,"(Item not allocated by memAcquire)",0,0)->Expand=1;
  953. }else{
  954. if(pc->Hyper==2){
  955. laShowItem(uil,cl,Base,"__modified"); laSplitColumn(uil,crl,0.4); laColumn *crll=laLeftColumn(crl, 0); laColumn *crlr=laRightColumn(crl,20);
  956. laUiItem* idui=laShowItem(uil,crll,Base,"identifier");idui->Flags|=LA_UI_FLAGS_PLAIN;idui->Expand=1;
  957. laShowItem(uil,crlr,Base,"__uid")->Flags|=LA_UI_FLAGS_NO_DECAL;
  958. if(pc->UDFPropagate){
  959. laColumn *crrl,*crrr,*udfc,*optionc; laSplitColumn(uil,crr,0.7); crrl=laLeftColumn(crr,0); crrr=laRightColumn(crr,1);
  960. laSplitColumn(uil,crrl,0.3); udfc=laLeftColumn(crrl,0); optionc=laRightColumn(crrl,8);
  961. laUiItem* uc=laOnConditionToggle(uil,crrr,0,0,0,0,0);{ strSafeSet(&uc->ExtraInstructions,"text=⮯;");
  962. laShowItem(uil,udfc,Base,"__file");
  963. laUiItem* sr=laBeginRow(uil,optionc,1,0);
  964. laShowItemFull(uil,optionc,Base,"__udf_propagate",0,"force=true;text=Force;",0,0)->Flags|=LA_TEXT_ALIGN_CENTER|LA_UI_FLAGS_NO_CONFIRM;
  965. laShowItemFull(uil,optionc,Base,"__udf_propagate",0,0,0,0)->Flags|=LA_TEXT_ALIGN_CENTER|LA_UI_FLAGS_NO_CONFIRM;
  966. laEndRow(uil,sr);
  967. }laElse(uil,uc);{
  968. laShowItem(uil,crrl,Base,"__file");
  969. }laEndCondition(uil,uc);
  970. }else{
  971. laShowItem(uil,crr,Base,"__file");
  972. }
  973. }else{
  974. //laShowItem(uil,crl,Base,"identifier")->Flags|=LA_UI_FLAGS_PLAIN;
  975. }
  976. }
  977. for(laProp*p=pc->Props.pFirst;p;p=p->Item.pNext){
  978. if(p->PropertyType!=LA_PROP_SUB || p->UDFIsRefer) continue;
  979. la_EnsureSubTarget(p,0);
  980. if(p->SubProp &&p->SubProp->Hyper!=2 &&(!p->UDFIsSingle)) continue;
  981. if(p->UDFNoCreate || p->UDFHideInSave) continue;
  982. if(p==pc->SaverDummy){
  983. laShowItem(uil,cl,Base,"__single_saver_dummy.__modified");
  984. laShowItem(uil,crl,Base,"identifier")->Flags|=LA_UI_FLAGS_PLAIN;
  985. laShowItem(uil,crr,Base,"__single_saver_dummy.__file");
  986. continue;
  987. }
  988. laUiItem* b=laOnConditionToggle(uil,cr,0,0,0,0,0);{ strSafePrint(&b->ExtraInstructions,"text=📦 %s;",transLate(p->Name));
  989. b->Flags|=LA_UI_FLAGS_NO_DECAL|LA_TEXT_ALIGN_LEFT; b->State=LA_BT_ACTIVE;
  990. laShowItemFull(uil,cr,Base,p->Identifier,0, 0,laui_ManagedPropInstance,0)
  991. ->Flags|=LA_UI_FLAGS_NO_DECAL|LA_UI_COLLECTION_NO_HIGHLIGHT|LA_UI_COLLECTION_MANAGER_FILTER;
  992. }laEndCondition(uil,b);
  993. }
  994. if(pc->UDFPropagate){
  995. laShowSeparator(uil,c);
  996. }
  997. }
  998. void laui_ManagedProp(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context){
  999. laColumn *c=laFirstColumn(uil),*cl,*cr,*cll,*clr;
  1000. laPropPack PP={0}; if(!Base ||! Base->EndInstance) return;
  1001. laManagedSaveProp* msp=Base->EndInstance;
  1002. laSplitColumn(uil,c,0.6); cl=laLeftColumn(c,0); cr=laRightColumn(c,20);
  1003. laSplitColumn(uil,cl,0.7); cll=laLeftColumn(cl,0); clr=laRightColumn(cl,0);
  1004. laShowLabel(uil,cll,SSTR(msp->Path),0,0)->Flags|=LA_UI_FLAGS_DISABLED;
  1005. laShowLabel(uil,clr,"UID",0,0)->Flags|=LA_UI_FLAGS_DISABLED|LA_TEXT_ALIGN_CENTER;
  1006. laShowLabel(uil,cr,"File",0,0)->Flags|=LA_UI_FLAGS_DISABLED|LA_TEXT_ALIGN_CENTER;
  1007. laShowItemFull(uil,c,0,SSTR(msp->Path),0, 0,laui_ManagedPropInstance,0)
  1008. ->Flags|=LA_UI_FLAGS_NO_DECAL|LA_UI_COLLECTION_NO_HIGHLIGHT|LA_UI_COLLECTION_MANAGER_FILTER;
  1009. laShowSeparator(uil,c);
  1010. }
  1011. void laui_ManagedSavePanel(laUiList *uil, laPropPack *Base, laPropPack *Operator, laColumn *ExtraColumns, int context){
  1012. laManagedSaveExtra*mse=Operator->EndInstance;
  1013. laColumn *c=laFirstColumn(uil);
  1014. if(mse->OnExit){
  1015. laShowLabel(uil,c,"You still have unsaved/unassigned datablocks:",0,0)->Flags|=LA_TEXT_ALIGN_CENTER|LA_TEXT_LINE_WRAP;
  1016. laShowSeparator(uil,c);
  1017. }
  1018. laUiItem* r=laBeginRow(uil,c,0,0);
  1019. laShowLabel(uil,c,"Viewing",0,0);
  1020. laUiItem* btn=laShowItem(uil,c,Operator,"show_page");btn->Flags|=LA_UI_FLAGS_EXPAND;
  1021. laUiItem* b=laOnConditionThat(uil,c,laNot(laPropExpression(&btn->PP,0)));{
  1022. laShowSeparator(uil,c);
  1023. laShowItem(uil,c,0,"la.user_preferences.manager_filter_instances")->Flags|=LA_UI_FLAGS_EXPAND;
  1024. }laEndCondition(uil,b);
  1025. laEndRow(uil,r);
  1026. laUiItem* g=laMakeEmptyGroup(uil,c,"List",0);{ g->State=LA_UI_ACTIVE;
  1027. laUiList* gu=g->Page; gu->HeightCoeff=mse->OnExit?-4:-3; laColumn* gc=laFirstColumn(gu);
  1028. laUiItem* b=laOnConditionThat(gu,gc,laEqual(laPropExpression(Operator, "show_page"),laIntExpression(0)));{
  1029. laShowItemFull(gu,gc,0,"la.managed_props",0, 0,laui_ManagedProp,0)->Flags|=LA_UI_FLAGS_NO_DECAL|LA_UI_COLLECTION_NO_HIGHLIGHT;
  1030. }laElse(gu,b);{
  1031. laShowItemFull(gu,gc,0,"la.managed_udfs",0,0,0,0)->Flags|=LA_UI_FLAGS_NO_DECAL;
  1032. }laEndCondition(gu,b);
  1033. }
  1034. if(mse->OnExit){
  1035. 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;
  1036. }
  1037. r=laBeginRow(uil,c,0,0);
  1038. if(mse->OnExit){
  1039. laShowItemFull(uil,c,0,"LA_cancel",0,"text=Discard And Quit;feedback=DISCARD_AND_QUIT",0,0)->Flags|=LA_UI_FLAGS_WARNING;
  1040. }
  1041. laShowSeparator(uil,c)->Expand=1;
  1042. laShowItemFull(uil,c,0,"LA_managed_save",0,"quiet=true;ignore_unassigned=true;text=Save All;feedback=SAVE_MODIFIED",0,0);
  1043. laShowItemFull(uil,c,0,"LA_managed_save",0,"quiet=true;ignore_unassigned=true;modified_only=true;text=Save Modified;feedback=SAVE_MODIFIED",0,0)->Flags|=LA_UI_FLAGS_HIGHLIGHT;
  1044. laEndRow(uil,r);
  1045. }
  1046. void laui_ResourceFolderItem(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context){
  1047. laColumn *c;
  1048. c = laFirstColumn(uil);
  1049. laUiItem* b=laBeginRow(uil,c,0,0);
  1050. laShowItem(uil, c, Base, "remove")->Flags|=LA_UI_FLAGS_ICON;
  1051. laUiItem* ui=laShowItem(uil, c, Base, "path");
  1052. ui->Expand=1;
  1053. laShowItem(uil,c,&ui->PP,"get_folder_path")->Flags|=LA_UI_FLAGS_ICON;
  1054. laEndRow(uil,b);
  1055. }
  1056. void laui_LogItem(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context){
  1057. if(!ExtraColumns){ ExtraColumns=laFirstColumn(uil); }
  1058. laShowItem(uil, ExtraColumns, Base, "content")->Flags|=LA_TEXT_LINE_WRAP|LA_TEXT_USE_NEWLINE|LA_TEXT_MONO|LA_UI_FLAGS_NO_TOOLTIP;
  1059. }
  1060. void laui_NodeRack(laUiList *uil, laPropPack *This, laPropPack *Extra, laColumn *UNUSED, int context){
  1061. laNodeRack* r=This->EndInstance;
  1062. laColumn* c=laFirstColumn(uil),*cl, *cr;
  1063. laShowLabel(uil,c,"\n",0,0);
  1064. laUiItem* b=laBeginRow(uil,c,0,0);
  1065. laShowItemFull(uil,c,This,"move",0,"icon=🡰;direction=left;",0,0)->Flags|=LA_UI_FLAGS_ICON;
  1066. laUiItem* u=laShowItem(uil,c,This,"name"); u->Flags|=LA_UI_FLAGS_NO_DECAL|LA_TEXT_ALIGN_CENTER; u->Expand=1;
  1067. laShowItemFull(uil,c,This,"move",0,"icon=🡲;direction=right;",0,0)->Flags|=LA_UI_FLAGS_ICON;
  1068. laEndRow(uil,b);
  1069. laShowLabel(uil,c,"\n",0,0);
  1070. laShowItem(uil,c,This,"nodes")->Flags|=LA_UI_FLAGS_NO_DECAL;
  1071. laShowLabel(uil,c,"\n",0,0);
  1072. b=laBeginRow(uil,c,0,0);
  1073. char args[64]=""; if(context) sprintf(args,"target=%d;",context);
  1074. laShowItemFull(uil,c,This,"add_node",0,args,0,0)->Expand=1;
  1075. laShowItem(uil,c,This,"delete")->Flags|=LA_UI_FLAGS_ICON;
  1076. laShowItem(uil,c,This,"insert_rack");
  1077. laEndRow(uil,b);
  1078. laShowLabel(uil,c,"\n\n\n",0,0);
  1079. }
  1080. void laui_RackPage(laUiList *uil, laPropPack *This, laPropPack *Extra, laColumn *UNUSED, int context){
  1081. laColumn* c=laFirstColumn(uil); laRackPage* r=This->EndInstance;
  1082. laUiItem* b=laOnConditionThat(uil,c,laPropExpression(This,"has_rack"));{
  1083. laUiItem* g=laMakeGroup(uil,c,"Racks",0);{ g->Flags|=/*LA_UI_FLAGS_NO_GAP|LA_UI_FLAGS_NO_DECAL|*/LA_UI_FLAGS_NODE_CONTAINER;
  1084. laUiList* gu=g->Page; laColumn* gc=laFirstColumn(gu); gu->AllowScale=1; gu->HeightCoeff=-1; g->State=LA_UI_ACTIVE;
  1085. 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;
  1086. }
  1087. }laElse(uil,b);{
  1088. laShowItemFull(uil,c,This,"add_rack",0,0,0,0);
  1089. }laEndCondition(uil,b);
  1090. }
  1091. void laui_NodeCategory(laUiList *uil, laPropPack *This, laPropPack *Extra, laColumn *UNUSED, int context){
  1092. laColumn* c=laFirstColumn(uil); laNodeCategory* nc=This?This->EndInstance:0; if(!nc){ return; }
  1093. if(nc->Ui){ nc->Ui(uil,This,Extra,0,context); return; }
  1094. char buf[512]={0};
  1095. for(laListItemPointer* lip=nc->NodeTypes.pFirst;lip;lip=lip->pNext){
  1096. laBaseNodeType* nt=lip->p; logPrintNew("%d",nt);
  1097. sprintf(buf,"feedback=%s;text=%s;icon=%lc;",nt->TypeName?nt->TypeName:" ",nt->Name?nt->Name:" ",nt->Icon?nt->Icon:L' ');
  1098. laShowItemFull(uil,c,0,"LA_confirm",0,buf,0,0);
  1099. }
  1100. }
  1101. void laui_Screen(laUiList *uil, laPropPack *This, laPropPack *Extra, laColumn *UNUSED, int context){
  1102. laColumn* c=laFirstColumn(uil); laSplitColumn(uil,c,0.25); laColumn*cl,*cr; cl=laLeftColumn(c,1); cr=laRightColumn(c,0);
  1103. laUiItem* b=laBeginRow(uil,cr,0,0);
  1104. laShowItem(uil,cr,This,"color_space");
  1105. laShowItem(uil,cr,This,"name")->Expand=1;
  1106. laShowItem(uil,cr,This,"remove")->Flags|=LA_UI_FLAGS_ICON;
  1107. laEndRow(uil,b);
  1108. b=laOnConditionToggle(uil,cl,0,0,0,0,0);
  1109. laShowItem(uil,cr,This,"description");
  1110. laEndCondition(uil,b);
  1111. }
  1112. void laui_UserPreference(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context){
  1113. laColumn* c = laFirstColumn(uil),*cl,*cr; laSplitColumn(uil,c,0.5);cl=laLeftColumn(c,0);cr=laRightColumn(c,0);
  1114. laUiList *muil;
  1115. laColumn *mc, *mcl, *mcr, *mcll, *mclr;
  1116. laUiItem *b, *bracket;
  1117. //_LA_PANEL_USER_PREFERENCE = p;
  1118. //la_UDFAppendSharedTypePointer("_LA_PANEL_USER_PREFERENCE", _LA_PANEL_USER_PREFERENCE);
  1119. //p->Show = 0;
  1120. //p->FastUpdate = 1;
  1121. b=laBeginRow(uil,cl,0,0);
  1122. muil = laMakeMenuPage(uil, cr, "☰ Menu"); mc = laFirstColumn(muil);
  1123. laShowItem(muil, mc, 0, "LA_restore_factory");
  1124. laUiItem* ui=laShowLabel(uil,cl,"Save on exit:",0,0); ui->Expand=1; ui->Flags|=LA_TEXT_ALIGN_RIGHT;
  1125. laShowItemFull(uil,cl,0,"la.user_preferences.save_preferences_on_exit",LA_WIDGET_ENUM_HIGHLIGHT,"text=🞆",0,0);
  1126. laEndRow(uil,b);
  1127. laShowItem(uil, cr, 0, "LA_save_user_preferences")->Expand = 1;
  1128. laUiItem* UP = laShowInvisibleItem(uil,c,0,"la.user_preferences");
  1129. bracket = laMakeTab(uil, c, 0);{
  1130. for(laExtraPreferencePage* epp=MAIN.ExtraPreferencePages.pFirst;epp;epp=epp->Item.pNext){
  1131. muil = laAddTabPage(bracket, epp->Name); epp->Func(muil,0,0,0,0);
  1132. }
  1133. muil = laAddTabPage(bracket, "Display");{
  1134. //muil->HeightCoeff = -1;
  1135. mc = laFirstColumn(muil);
  1136. laSplitColumn(muil, mc, 0.5);
  1137. mcl = laLeftColumn(mc, 0);
  1138. mcr = laRightColumn(mc, 0);
  1139. if(MAIN.PreferencePageDisplay){
  1140. MAIN.PreferencePageDisplay(muil,0,0,0,0);
  1141. laShowSeparator(muil, mc);
  1142. }
  1143. laShowLabel(muil, mc, "Translation:", 0, 0);
  1144. laShowLabel(muil, mcl, "Enable Translation:", 0, 0);
  1145. laShowItemFull(muil, mcr, &UP->PP, "enable_translation",LA_WIDGET_ENUM_CYCLE,0,0,0);
  1146. b = laOnConditionThat(muil, mcl, laPropExpression(&UP->PP, "enable_translation"));{
  1147. laShowLabel(muil, mcl, "Language:", 0, 0);
  1148. laShowItemFull(muil, mcr, &UP->PP, "languages", LA_WIDGET_COLLECTION_SELECTOR, 0, 0, 0);
  1149. laShowItem(muil, mcl, 0, "LA_translation_dump");
  1150. }
  1151. laEndCondition(muil, b);
  1152. laShowSeparator(muil, mc);
  1153. laShowLabel(muil, mc, "Interface:", 0, 0);
  1154. laShowLabel(muil, mcl, "Row Height:", 0, 0);
  1155. laShowItem(muil, mcr, &UP->PP, "interface_size");
  1156. laShowLabel(muil, mcl, "Font Size:", 0, 0);
  1157. laShowItem(muil, mcr, &UP->PP, "font_size");
  1158. laShowLabel(muil, mcl, "Margin Size:", 0, 0);
  1159. laShowItem(muil, mcr, &UP->PP, "margin_size");
  1160. laShowLabel(muil, mcl, "Panel Multisample:", 0, 0);
  1161. laShowItem(muil, mcr, &UP->PP, "panel_multisample")->Flags|=LA_UI_FLAGS_EXPAND;
  1162. laShowLabel(muil, mcl, "Top Framerate:", 0, 0);
  1163. laShowItem(muil, mc, &UP->PP, "top_framerate");
  1164. laShowSeparator(muil, mc);
  1165. laShowLabel(muil, mc, "Color:", 0, 0);
  1166. laShowItem(muil, mcl, &UP->PP, "color_picker_gamma");
  1167. laShowItem(muil, mcr, &UP->PP, "enable_color_management");
  1168. #ifndef LAGUI_ANDROID
  1169. laUiItem* bb=laOnConditionThat(muil,mc,laPropExpression(&UP->PP,"enable_color_management"));{
  1170. laUiItem*bbr=laBeginRow(muil,mc,0,0);
  1171. laShowLabel(muil, mcl, "Per screen config:", 0, 0)->Expand=1;
  1172. laShowItem(muil,mc,0,"LA_refresh_screens")->Flags|=LA_UI_FLAGS_ICON;
  1173. laShowItemFull(muil, mcr, &UP->PP, "auto_switch_color_space",0,"text=Auto Switch",0,0);
  1174. laEndRow(muil,bbr);
  1175. laShowItemFull(muil, mc, &UP->PP, "screens",0,0,laui_Screen,0);
  1176. }laEndCondition(muil,bb);
  1177. #endif
  1178. laShowSeparator(muil, mc);
  1179. if(MAIN.InitArgs.HasWorldObjects){
  1180. laShowLabel(muil, mc, "Viewport:", 0, 0);
  1181. laShowItem(muil, mcl, &UP->PP, "viewport_halftone_factor");
  1182. laShowItem(muil, mcr, &UP->PP, "viewport_halftone_size");
  1183. laShowSeparator(muil, mc);
  1184. }
  1185. laShowLabel(muil, mc, "Nodes:", 0, 0);
  1186. laShowItem(muil, mcr, &UP->PP, "wire_color_slices");
  1187. laShowItem(muil, mcr, &UP->PP, "wire_thickness");
  1188. laShowItem(muil, mcr, &UP->PP, "wire_saggyness");
  1189. laShowSeparator(muil, mc);
  1190. laShowLabel(muil, mc, "Floating Panel:", 0, 0);
  1191. laShowItem(muil, mcl, &UP->PP, "floating_alpha");
  1192. laShowItem(muil, mcr, &UP->PP, "solid_shadow_length");
  1193. }
  1194. muil = laAddTabPage(bracket, "Input");{
  1195. //muil->HeightCoeff = -1;
  1196. mc = laFirstColumn(muil);
  1197. laSplitColumn(muil, mc, 0.5);
  1198. mcl = laLeftColumn(mc, 0);
  1199. mcr = laRightColumn(mc, 0);
  1200. if(MAIN.PreferencePageInput){ MAIN.PreferencePageInput(muil,0,0,0,0); }
  1201. laShowLabel(muil, mc, "User Interactions:", 0, 0);
  1202. laShowItem(muil, mc, &UP->PP, "scroll_speed");
  1203. laShowItem(muil, mcl, &UP->PP, "animation_speed");
  1204. laShowItem(muil, mcr, &UP->PP, "panel_animation_speed");
  1205. laShowItem(muil, mc, &UP->PP, "valuator_threshold");
  1206. laShowItem(muil, mc, &UP->PP, "zoom_speed_2d");
  1207. laShowItem(muil, mcl, &UP->PP, "tooltip_close_distance");
  1208. laShowItem(muil, mcr, &UP->PP, "idle_time");
  1209. laShowSeparator(muil,mc);
  1210. laShowLabel(muil, mc, "Input device handling:", 0, 0);
  1211. #ifdef _WIN32
  1212. laShowLabel(muil, mc, "Not yet implemened on Windows.", 0, 0);
  1213. #endif
  1214. laShowLabel(muil, mcl, "Input Mapping:", 0, 0)->Flags|=LA_TEXT_ALIGN_RIGHT;
  1215. laShowItemFull(muil, mcr, 0, "LA_panel_activator",0,"panel_id=LAUI_input_mapping;text=Configure",0,0);
  1216. laShowLabel(muil, mcl, "Pads/Joysticks:", 0, 0)->Flags|=LA_TEXT_ALIGN_RIGHT;
  1217. laShowItemFull(muil, mcr, 0, "LA_panel_activator",0,"panel_id=LAUI_controllers;text=Configure",0,0);
  1218. laShowSeparator(muil,mc);
  1219. laShowLabel(muil, mc, "Wacom Devices:", 0, 0);
  1220. #ifdef _WIN32
  1221. b=laBeginRow(muil,mcl,0,0); laShowSeparator(muil,mcl)->Expand=1;
  1222. laShowLabel(muil, mcl, "Driver:", 0, 0)->Flags|=LA_TEXT_ALIGN_RIGHT;
  1223. laShowItem(muil, mcl, 0, "LA_refresh_controllers")->Flags|=LA_UI_FLAGS_ICON;
  1224. laEndRow(muil, b);
  1225. laShowItem(muil, mcr, &UP->PP, "wacom_driver");
  1226. #else
  1227. laShowItem(muil, mcl, &UP->PP, "wacom_device_stylus");
  1228. laShowItem(muil, mcl, &UP->PP, "wacom_device_eraser");
  1229. laShowItemFull(muil, mcr, 0, "LA_refresh_controllers",0,"text=Refresh",0,0);
  1230. #endif
  1231. }
  1232. if(MAIN.InitArgs.HasAudio){
  1233. muil = laAddTabPage(bracket, "Audio");{
  1234. mc = laFirstColumn(muil); laSplitColumn(muil, mc, 0.5);
  1235. mcl = laLeftColumn(mc, 0); mcr = laRightColumn(mc, 0);
  1236. b=laBeginRow(muil,mcl,0,0);
  1237. laShowLabel(muil,mcl,"Backend:",0,0);
  1238. laShowItem(muil,mcl,0,"la.audio.backend")->Expand=1;
  1239. laEndRow(muil,b);
  1240. laShowLabel(muil,mc,"Device:",0,0);
  1241. laShowItemFull(muil,mcl,0,"la.audio.current_audio_device",LA_WIDGET_COLLECTION_SELECTOR,0,laui_IdentifierOnly,0);
  1242. laShowItem(muil,mcr,0,"LA_refresh_audio_devices");
  1243. }
  1244. }
  1245. muil = laAddTabPage(bracket, "Resource");{
  1246. //muil->HeightCoeff = -1;
  1247. mc = laFirstColumn(muil);
  1248. laSplitColumn(muil, mc, 0.5);
  1249. mcl = laLeftColumn(mc, 0);
  1250. mcr = laRightColumn(mc, 0);
  1251. if(MAIN.PreferencePageResource){ MAIN.PreferencePageResource(muil,0,0,0,0); }
  1252. laShowLabel(muil, mcl, "UDF Manager Default View:", 0, 0);
  1253. laShowItem(muil, mcr, &UP->PP, "manager_default_view")->Flags|=LA_UI_FLAGS_EXPAND;
  1254. laShowSeparator(muil,mc);
  1255. b=laBeginRow(muil,mc,0,0);
  1256. laShowLabel(muil, mc, "Resource Folders", 0, 0)->Expand=1;
  1257. laShowItem(muil, mc, 0, "LA_add_resource_folder");
  1258. laEndRow(muil,b);
  1259. laShowItem(muil, mc, &UP->PP, "resource_folders");
  1260. }
  1261. muil = laAddTabPage(bracket, "Theme");{
  1262. //muil->HeightCoeff = -1;
  1263. mc = laFirstColumn(muil); laSplitColumn(muil,mc,0.4);
  1264. mcl=laLeftColumn(mc,7);mcr=laRightColumn(mc,0);
  1265. if(MAIN.PreferencePageTheme){ MAIN.PreferencePageTheme(muil,0,0,0,0); }
  1266. laShowLabel(muil, mcl, "Active Theme", 0, 0);
  1267. laShowItemFull(muil, mcr, 0, "la.themes", LA_WIDGET_COLLECTION_SELECTOR, 0,laui_ThemeListItem,0);
  1268. laShowSeparator(muil,mc);
  1269. laShowItemFull(muil, mc, 0, "la.themes", LA_WIDGET_COLLECTION_SINGLE, 0 ,0,0)->Flags|=LA_UI_FLAGS_NO_DECAL;
  1270. }
  1271. muil = laAddTabPage(bracket, "System");{
  1272. mc = laFirstColumn(muil); laSplitColumn(muil, mc, 0.5);
  1273. mcl = laLeftColumn(mc, 0); mcr = laRightColumn(mc, 0);
  1274. laShowLabel(muil,mcl,"OpenGL Debugging:",0,0);
  1275. if(MAIN.InitArgs.GLDebug){
  1276. laShowLabel(muil,mc,"OpenGL debugging is force enabled with `--gl-debug`",0,0)->Flags|=LA_UI_FLAGS_DISABLED;
  1277. }else{
  1278. laShowItem(muil,mcr,0,"la.user_preferences.enable_gl_debug");
  1279. laUiItem* b=laOnConditionThat(muil,mc,laPropExpression(0,"la.user_preferences.enable_gl_debug"));{
  1280. laShowItem(muil,mcl,0,"la.user_preferences.gl_debug_sync");
  1281. laShowItem(muil,mcr,0,"la.user_preferences.gl_debug_level")->Flags|=LA_UI_FLAGS_EXPAND;
  1282. }laEndCondition(muil,b);
  1283. }
  1284. laShowSeparator(muil,mc);
  1285. laShowLabel(muil,mcl,"Logs:",0,0);
  1286. laShowItem(muil,mcr,0,"la.user_preferences.enable_log_stdout");
  1287. laShowItem(muil,mcr,0,"la.user_preferences.enable_performance_overlay");
  1288. }
  1289. }
  1290. }
  1291. void laui_About(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context){
  1292. laColumn *c, *cl, *cr, *tc, *gc, *gcl, *gcr, *tcl, *tcr;
  1293. laUiItem *bracket, *t, *g;
  1294. laPanel *p;
  1295. laUiList *u, *gu;
  1296. laPropContainer *pc;
  1297. int h;
  1298. laOperatorType *at;
  1299. laUiList *first;
  1300. char buf[2048]={0};
  1301. c = laFirstColumn(uil);
  1302. if(MAIN.AboutContent){
  1303. MAIN.AboutContent(uil,Base,OperatorInst,ExtraColumns,0);
  1304. }else{
  1305. laShowLabel(uil, c, "LaGUI", 0, 0);
  1306. laShowLabel(uil, c, "A graphical user interface application toolkit", 0, 0)->Flags|=LA_TEXT_LINE_WRAP;
  1307. laShowLabel(uil, c, "(C)Yiming Wu", 0, 0);
  1308. }
  1309. t = laMakeTab(uil, c, 0);{
  1310. first = u = laAddTabPage(t, "Version");
  1311. tc = laFirstColumn(u);
  1312. if(MAIN.AboutVersion){
  1313. MAIN.AboutVersion(u,Base,OperatorInst,ExtraColumns,0);
  1314. }
  1315. g = laMakeGroup(u, tc, "LaGUI information", 0);
  1316. gu = g->Page;{
  1317. gc = laFirstColumn(gu);
  1318. sprintf(buf, "LaGUI.%d.%d", LA_VERSION_MAIN, LA_VERSION_SUB);
  1319. laShowLabel(gu, gc, buf, 0, 0)->Flags|=LA_TEXT_MONO;
  1320. laShowLabel(gu, gc, LAGUI_GIT_BRANCH,0,0)->Flags|=LA_TEXT_MONO;
  1321. #ifdef LAGUI_GIT_HASH
  1322. laShowLabel(gu, gc, LAGUI_GIT_HASH,0,0)->Flags|=LA_TEXT_MONO;
  1323. #endif
  1324. sprintf(buf, "Built on:[UTC+8] %s %s", __DATE__, __TIME__);
  1325. laShowLabel(gu, gc, buf, 0, 0)->Flags|=LA_TEXT_MONO;
  1326. sprintf(buf, "UDF Identifier: %s",LA_UDF_IDENTIFIER);
  1327. laShowLabel(gu, gc, buf, 0, 0)->Flags|=LA_TEXT_MONO;
  1328. laShowLabel(gu, gc, "UDF Extensions:", 0, 0)->Flags|=LA_TEXT_MONO;
  1329. laShowLabel(gu, gc, "🗸LA_UDF_BASICS", 0, 0)->Flags|=LA_TEXT_MONO;
  1330. for(int i=0;i<64;i++){
  1331. if(!LA_UDF_EXTENSION_STRINGS[i][0]) break; int gray=!((1<<i)&LA_UDF_EXTENSIONS_ENABLED);
  1332. sprintf(buf,"%s%s",gray?" ":"🗸",LA_UDF_EXTENSION_STRINGS[i]);
  1333. laUiItem* ext=laShowLabel(gu, gc, buf, 0, 0); ext->Flags|=LA_TEXT_MONO;
  1334. if(gray){ ext->Flags|=LA_UI_FLAGS_DISABLED; }
  1335. }
  1336. }
  1337. g = laMakeGroup(u, tc, "Device Graphics", 0);
  1338. gu = g->Page;{
  1339. gc = laFirstColumn(gu);
  1340. sprintf(buf, "OpenGL Version: %s", T->GLVersionStr); laShowLabel(gu, gc, buf, 0, 0)->Flags|=LA_TEXT_MONO;
  1341. sprintf(buf, "OpenGL Vendor: %s", T->GLVendorStr); laShowLabel(gu, gc, buf, 0, 0)->Flags|=LA_TEXT_MONO;
  1342. sprintf(buf, "OpenGL Renderer: %s", T->GLRendererStr); laShowLabel(gu, gc, buf, 0, 0)->Flags|=LA_TEXT_MONO;
  1343. sprintf(buf, "GLSL Version: %s", T->GLSLVersionStr); laShowLabel(gu, gc, buf, 0, 0)->Flags|=LA_TEXT_MONO;
  1344. }
  1345. u = laAddTabPage(t, "Authors");
  1346. tc= laFirstColumn(u);
  1347. if(MAIN.AboutAuthor){
  1348. MAIN.AboutAuthor(u,Base,OperatorInst,ExtraColumns,0);
  1349. }
  1350. g = laMakeGroup(u, tc, "LaGUI", 0);
  1351. gu = g->Page;{
  1352. gc = laFirstColumn(gu);
  1353. laShowLabel(gu,gc,"LaGUI application framework is made by Wu Yiming.",0,0)->Flags|=LA_TEXT_LINE_WRAP;
  1354. laUiItem* b=laBeginRow(gu,gc,0,0);
  1355. laShowItemFull(gu, gc, 0, "LA_open_internet_link", 0, "link=http://www.ChengduLittleA.com/lagui;text=Details", 0, 0);
  1356. laShowItemFull(gu, gc, 0, "LA_open_internet_link", 0, "link=http://www.ChengduLittleA.com;text=Yiming's Blog", 0, 0);
  1357. laEndRow(gu,b);
  1358. }
  1359. t->Page = first;
  1360. }
  1361. }
  1362. void laui_UndoHistories(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context){
  1363. laColumn* c=laFirstColumn(uil),*cl,*cr; laSplitColumn(uil,c,0.5);cl=laLeftColumn(c,0);cr=laRightColumn(c,0);
  1364. laShowItem(uil,cl,0,"LA_undo"); laShowItem(uil,cr,0,"LA_redo")->Flags|=LA_TEXT_ALIGN_RIGHT;
  1365. laUiItem* g=laMakeGroup(uil,c,"123",0);{ g->State=LA_UI_ACTIVE; g->Flags|=LA_UI_FLAGS_PREFER_BOTTOM;
  1366. laUiList* gu=g->Page; laColumn* gc=laFirstColumn(gu); gu->HeightCoeff=-1;
  1367. laShowItem(gu,gc,0,"la.differences")->Flags|=LA_UI_FLAGS_NO_DECAL;
  1368. }
  1369. }
  1370. void laui_Terminal(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context){
  1371. laColumn* c=laFirstColumn(uil),*cl,*cr; laSplitColumn(uil,c,0.4); cl=laLeftColumn(c,2); cr=laRightColumn(c,0);
  1372. laUiItem* g=laMakeGroup(uil,c,"123",0);{ g->State=LA_UI_ACTIVE; g->Flags|=LA_UI_FLAGS_PREFER_BOTTOM;
  1373. laUiList* gu=g->Page; laColumn* gc=laFirstColumn(gu); gu->HeightCoeff=-3;
  1374. laShowItem(gu,gc,0,"la.logs")->Flags|=LA_UI_FLAGS_NO_DECAL;
  1375. }
  1376. laUiItem* b=laOnConditionThat(uil,c,laPropExpression(0,"la.terminal_incomplete"));{
  1377. laShowLabel(uil,cl,"...",0,0)->Flags|=LA_TEXT_MONO|LA_TEXT_ALIGN_RIGHT;
  1378. }laElse(uil,b);{
  1379. laShowLabel(uil,cl,">>>",0,0)->Flags|=LA_TEXT_MONO|LA_TEXT_ALIGN_RIGHT;
  1380. }laEndCondition(uil,b);
  1381. laShowItem(uil,cr,0,"la.terminal_input")->Flags|=LA_UI_FLAGS_TERMINAL_INPUT|LA_TEXT_MONO;
  1382. }
  1383. void laui_IdleDataManager(laUiList *uil, laPropPack *Base, laPropPack *Extra, laColumn *ExtraColumns, int context){
  1384. laColumn *c=laFirstColumn(uil);
  1385. laUiItem* r=laBeginRow(uil,c,0,0);
  1386. laShowLabel(uil,c,"Viewing",0,0);
  1387. laUiItem* btn=laShowItem(uil,c,Extra,"show_page");btn->Flags|=LA_UI_FLAGS_EXPAND;
  1388. laUiItem* b=laOnConditionThat(uil,c,laNot(laPropExpression(&btn->PP,0)));{
  1389. laShowSeparator(uil,c);
  1390. laShowItem(uil,c,0,"la.user_preferences.manager_filter_instances")->Flags|=LA_UI_FLAGS_EXPAND;
  1391. }laEndCondition(uil,b);
  1392. laEndRow(uil,r);
  1393. laUiItem* g=laMakeEmptyGroup(uil,c,"List",0);{ g->State=LA_UI_ACTIVE;
  1394. laUiList* gu=g->Page; gu->HeightCoeff=-3; laColumn* gc=laFirstColumn(gu);
  1395. laUiItem* b=laOnConditionThat(gu,gc,laEqual(laPropExpression(Extra, "show_page"),laIntExpression(0)));{
  1396. laShowItemFull(gu,gc,0,"la.managed_props",0, 0,laui_ManagedProp,0)->Flags|=LA_UI_FLAGS_NO_DECAL;
  1397. }laElse(gu,b);{
  1398. laShowItemFull(gu,gc,0,"la.managed_udfs",0,0,0,0)->Flags|=LA_UI_FLAGS_NO_DECAL;
  1399. }laEndCondition(gu,b);
  1400. }
  1401. r=laBeginRow(uil,c,0,0);
  1402. laShowSeparator(uil,c)->Expand=1;
  1403. laShowItemFull(uil,c,0,"LA_managed_save",0,"quiet=true;ignore_unassigned=true;text=Save All",0,0);
  1404. laShowItemFull(uil,c,0,"LA_managed_save",0,"quiet=true;ignore_unassigned=true;modified_only=true;text=Save Modified",0,0)->Flags|=LA_UI_FLAGS_HIGHLIGHT;
  1405. laEndRow(uil,r);
  1406. }
  1407. void lauidetached_IdleDataManager(laPanel* p){
  1408. la_MakeDetachedProp(p, "la.user_preferences.manager_default_view", "show_page");
  1409. }
  1410. void laui_TextureInspector(laUiList *uil, laPropPack *Base, laPropPack *Extra, laColumn *ExtraColumns, int context){
  1411. laColumn *c=laFirstColumn(uil),*cl,*cr;
  1412. laSplitColumn(0, c, 0.5);
  1413. cl = laLeftColumn(c, 0);
  1414. cr = laRightColumn(c, 0);
  1415. laShowLabel(uil,cl,"Viewing Texture:",0,0)->Flags|=LA_TEXT_ALIGN_RIGHT;
  1416. laShowItemFull(uil,cr,Extra,"textures",LA_WIDGET_COLLECTION_SELECTOR,0,0,0);
  1417. laUiItem* u2=laShowCanvas(uil,c,Extra,"textures",0,-1);
  1418. laDefault2DViewOverlayRight(u2);
  1419. }
  1420. void lauidetached_TextureInspector(laPanel* p){
  1421. la_MakeDetachedProp(p, "tns.texture_list", "textures");
  1422. }
  1423. void laui_GameController(laUiList *uil, laPropPack *This, laPropPack *Extra, laColumn *UNUSED, int context){
  1424. laColumn* c=laFirstColumn(uil),*cl, *cr;
  1425. laSplitColumn(uil,c,0.5); cl=laLeftColumn(c,0); cr=laRightColumn(c,0);
  1426. laShowInvisibleItem(uil,c,0,"la.controllers");
  1427. laUiItem* b=laBeginRow(uil,cl,0,0);
  1428. laUiItem* l=laShowLabel(uil,cl,"Controller:",0,0); l->Flags|=LA_TEXT_ALIGN_RIGHT; l->Expand=1;
  1429. laShowItem(uil,cl,0,"LA_refresh_controllers")->Flags|=LA_UI_FLAGS_ICON;
  1430. laEndRow(uil,b);
  1431. laShowItemFull(uil,cr,Extra,"controllers",LA_WIDGET_COLLECTION_SELECTOR,0,laui_IdentifierOnly,0);
  1432. b=laOnConditionThat(uil,c,laPropExpression(Extra,"controllers"));{
  1433. laShowItemFull(uil,c,Extra,"controllers",LA_WIDGET_COLLECTION_SINGLE,0,0,0);
  1434. }laElse(uil,b);{
  1435. laShowLabel(uil,c,"Please select a controller.",0,0)->Flags|=LA_TEXT_ALIGN_CENTER;
  1436. }
  1437. }
  1438. void lauidetached_GameController(laPanel* p){
  1439. la_MakeDetachedProp(p, "la.controllers", "controllers");
  1440. }
  1441. void laui_OperatorTypeEntry(laUiList *uil, laPropPack *This, laPropPack *Extra, laColumn *ExtraColumns, int context){
  1442. laColumn* c=ExtraColumns;
  1443. laShowItem(uil,c,This,"name")->Flags|=LA_UI_FLAGS_PLAIN;
  1444. laShowItem(uil,c,This,"identifier")->Flags|=LA_TEXT_MONO|LA_UI_FLAGS_DISABLED|LA_UI_FLAGS_PLAIN;
  1445. laShowSeparator(uil,c);
  1446. }
  1447. void laui_InputMappingEntry(laUiList *uil, laPropPack *This, laPropPack *Extra, laColumn *ExtraColumns, int context){
  1448. laColumn* c=ExtraColumns;
  1449. laColumn* cl=laLeftColumn(c,3),*cr=laRightColumn(c,0);
  1450. laColumn* crl=laLeftColumn(cr,0),*crr=laRightColumn(cr,0);
  1451. laUiItem* b,*b1,*b2,*b3,*b4;
  1452. #if 1
  1453. b=laBeginRow(uil,cl,0,0);
  1454. laShowItem(uil,cl,This,"__move");
  1455. laShowItem(uil,crl,This,"disabled")->Flags=LA_UI_FLAGS_ICON|LA_UI_FLAGS_HIGHLIGHT|LA_UI_FLAGS_CYCLE;
  1456. b1=laOnConditionToggle(uil,cl,0,0,0,0,0);{
  1457. laEndRow(uil,b);
  1458. laShowLabel(uil,cl,"Mode:\n ",0,0)->Flags|=LA_TEXT_ALIGN_RIGHT|LA_UI_FLAGS_DISABLED|LA_TEXT_LINE_WRAP;
  1459. b2=laBeginRow(uil,crl,0,0);{
  1460. b3=laOnConditionThat(uil,crl,laPropExpression(This,"use_operator"));{
  1461. laUiItem* pui = laShowInvisibleItem(uil,crl,This,"operator");
  1462. laShowItemFull(uil,crl,&pui->PP,"restore",0,"icon=🧹",0,0)->Flags|=LA_UI_FLAGS_ICON;
  1463. laUiItem* bui=laShowItemFull(uil,crl,This,"select_operator",0,"icon= ;",0,0);
  1464. bui->Expand=1; bui->Flags|=LA_UI_FLAGS_ICON|LA_UI_FLAGS_UNDERNEATH;
  1465. laUiItem* ui=laShowItem(uil,crl,&pui->PP,"");
  1466. ui->Expand=1; ui->Flags|=LA_UI_FLAGS_PLAIN;
  1467. }laElse(uil,b3);{
  1468. laUiItem* pui = laShowInvisibleItem(uil,crl,This,"signal");
  1469. laShowItemFull(uil,crl,&pui->PP,"restore",0,"icon=🧹",0,0)->Flags|=LA_UI_FLAGS_ICON;
  1470. laUiItem* bui=laShowItemFull(uil,crl,This,"select_signal",0,"icon= ;",0,0);
  1471. bui->Expand=1; bui->Flags|=LA_UI_FLAGS_ICON|LA_UI_FLAGS_UNDERNEATH;
  1472. laUiItem* ui=laShowItem(uil,crl,&pui->PP,"");
  1473. ui->Expand=1; ui->Flags|=LA_UI_FLAGS_PLAIN;
  1474. }laEndCondition(uil,b3);
  1475. }laEndRow(uil,b2);
  1476. b2=laBeginRow(uil,crr,0,0);{
  1477. laShowSeparator(uil,crr);
  1478. laUiItem* pui = laShowInvisibleItem(uil,crr,This,"key");
  1479. laShowItemFull(uil,crr,&pui->PP,"restore",0,"icon=🧹",0,0)->Flags|=LA_UI_FLAGS_ICON;
  1480. laUiItem* bui=laShowItemFull(uil,crr,This,"select_key",0,"icon= ;",0,0);
  1481. bui->Expand=1; bui->Flags|=LA_UI_FLAGS_ICON|LA_UI_FLAGS_UNDERNEATH;
  1482. laUiItem* ui=laShowItem(uil,crr,&pui->PP,"");
  1483. ui->Expand=1; ui->Flags|=LA_UI_FLAGS_PLAIN;
  1484. laShowItem(uil,crr,This,"remove")->Flags|=LA_UI_FLAGS_ICON;
  1485. }laEndRow(uil,b2);
  1486. b2=laBeginRow(uil,crr,0,0);{
  1487. laShowSeparator(uil,crr)->Expand=1;
  1488. laShowItem(uil,crr,This,"device_type")->Flags|=LA_UI_FLAGS_EXPAND|LA_UI_FLAGS_TRANSPOSE;
  1489. }laEndRow(uil,b2);
  1490. b2=laBeginRow(uil,crl,0,0);{
  1491. b3=laBeginRow(uil,crl,0,0);{
  1492. laUiItem* ui=laShowItem(uil,crl,This,"use_operator"); ui->Flags|=LA_UI_FLAGS_EXPAND|LA_UI_FLAGS_TRANSPOSE;
  1493. b4=laOnConditionThat(uil,crr,laPropExpression(&ui->PP,""));{
  1494. laUiItem* ui1=laShowItem(uil,crl,This,"operator_base");
  1495. ui1->Flags|=LA_UI_FLAGS_EXPAND;ui1->Expand=10;
  1496. laEndRow(uil,b3);
  1497. laShowItem(uil,crl,This,"operator_arguments");
  1498. laShowLabel(uil,cl,"Args:",0,0)->Flags|=LA_TEXT_ALIGN_RIGHT|LA_UI_FLAGS_DISABLED;
  1499. }laElse(uil,b4);{
  1500. laEndRow(uil,b3);
  1501. }laEndCondition(uil,b4);
  1502. }
  1503. laEndRow(uil,b3);
  1504. }laEndRow(uil,b2);
  1505. laShowSeparator(uil,c);
  1506. }laElse(uil,b1);{
  1507. laEndRow(uil,b);
  1508. b2=laBeginRow(uil,crl,0,0);{
  1509. laShowItem(uil,crl,This,"use_operator")->Flags=LA_UI_FLAGS_ICON|LA_UI_FLAGS_PLAIN;
  1510. b3=laOnConditionThat(uil,crl,laPropExpression(This,"use_operator"));{
  1511. laUiItem* ui=laShowItem(uil,crl,This,"operator_name");ui->Expand=1;ui->Flags|=LA_UI_FLAGS_PLAIN;
  1512. }laElse(uil,b3);{
  1513. laUiItem* ui=laShowItem(uil,crl,This,"signal");ui->Expand=1;ui->Flags|=LA_UI_FLAGS_PLAIN;
  1514. }laEndCondition(uil,b3);
  1515. }laEndRow(uil,b2);
  1516. b2=laBeginRow(uil,crr,0,0);{
  1517. laShowSeparator(uil,crr);
  1518. laShowItem(uil,crr,This,"device_type")->Flags|=LA_UI_FLAGS_ICON|LA_UI_FLAGS_PLAIN;
  1519. //laUiItem* uib=laShowItemFull(uil,crr,This,"select_key",0,"icon= ;",0,0);
  1520. //uib->Expand=1; uib->Flags|=LA_UI_FLAGS_ICON|LA_UI_FLAGS_UNDERNEATH;
  1521. laUiItem* ui=laShowItem(uil,crr,This,"key"); ui->Expand=1;ui->Flags|=LA_UI_FLAGS_PLAIN;
  1522. laShowItem(uil,crr,This,"remove")->Flags|=LA_UI_FLAGS_ICON;
  1523. }laEndRow(uil,b2);
  1524. }laEndCondition(uil,b1);
  1525. #else
  1526. laUiItem* b=laBeginRow(uil,c,0,0);
  1527. laShowItem(uil,c,This,"remove")->Flags|=LA_UI_FLAGS_ICON;
  1528. laShowItem(uil,c,This,"device_type");
  1529. laUiItem* b1=laOnConditionThat(uil,c,laEqual(laPropExpression(This,"device_type"),laIntExpression(LA_INPUT_DEVICE_JOYSTICK)));{
  1530. laShowItem(uil,c,This,"joystick_device");
  1531. }laEndCondition(uil,b1);
  1532. laShowItem(uil,c,This,"key")->Expand=1;
  1533. laShowItem(uil,c,This,"select_key")->Flags|=LA_UI_FLAGS_ICON;
  1534. laShowItem(uil,c,This,"signal")->Expand=1;
  1535. //laShowItemFull(uil,c,This,"signal_selection",LA_WIDGET_COLLECTION_SELECTOR,0,0,0)->Flags|=LA_UI_COLLECTION_SIMPLE_SELECTOR;
  1536. laShowItem(uil,c,This,"select_signal")->Flags|=LA_UI_FLAGS_ICON;
  1537. laEndRow(uil,b);
  1538. #endif
  1539. }
  1540. void laui_InputMapping(laUiList *uil, laPropPack *This, laPropPack *Extra, laColumn *UNUSED, int context){
  1541. laColumn* c=laFirstColumn(uil);laSplitColumn(uil,c,0.3);
  1542. laColumn* cl=laLeftColumn(c,3),*cr=laRightColumn(c,0);laSplitColumn(uil,cr,0.6);
  1543. laColumn* crl=laLeftColumn(cr,0),*crr=laRightColumn(cr,0);
  1544. laUiItem* b=laBeginRow(uil,c,0,0);
  1545. laShowItemFull(uil,c,This,"new_entry",0,"position=top;",0,0);
  1546. laEndRow(uil,b);
  1547. laShowSeparator(uil,c);
  1548. laShowColumnAdjuster(uil,c);
  1549. laShowLabel(uil,cl,"✓",0,0)->Flags|=LA_TEXT_ALIGN_CENTER|LA_UI_FLAGS_DISABLED;
  1550. laShowLabel(uil,crl,"Operation",0,0)->Flags|=LA_TEXT_ALIGN_CENTER|LA_UI_FLAGS_DISABLED;
  1551. laShowLabel(uil,crr,"Input",0,0)->Flags|=LA_TEXT_ALIGN_CENTER|LA_UI_FLAGS_DISABLED;
  1552. laShowItemFull(uil,c,This,"entries",0,0,laui_InputMappingEntry,0)->Flags|=LA_UI_FLAGS_NO_DECAL;
  1553. laShowSeparator(uil,c);
  1554. b=laBeginRow(uil,c,0,0);
  1555. laShowItem(uil,c,This,"new_entry");
  1556. laEndRow(uil,b);
  1557. }
  1558. void laui_InputMappingBundle(laUiList *uil, laPropPack *This, laPropPack *Extra, laColumn *UNUSED, int context){
  1559. laColumn* c=laFirstColumn(uil);
  1560. laUiItem* b=laBeginRow(uil,c,0,0);
  1561. laShowItemFull(uil,c,0,"la.input_mapping.current",LA_WIDGET_COLLECTION_SELECTOR,0,laui_IdentifierOnly,0)
  1562. ->Flags|=LA_UI_COLLECTION_SIMPLE_SELECTOR;
  1563. laUiItem* b3=laOnConditionThat(uil,c,laPropExpression(0,"la.input_mapping.current"));{
  1564. laShowItem(uil,c,0,"la.input_mapping.current.name");
  1565. laShowItem(uil,c,0,"LA_new_input_mapping")->Flags|=LA_UI_FLAGS_ICON;
  1566. laShowSeparator(uil,c);
  1567. laUiItem* cp=laShowInvisibleItem(uil,c,0,"la.input_mapping.current");
  1568. laShowItem(uil,c,&cp->PP,"remove");
  1569. }laElse(uil,b3);{
  1570. laShowItem(uil,c,0,"LA_new_input_mapping");
  1571. }laEndCondition(uil,b3);
  1572. laEndRow(uil,b);
  1573. b3=laOnConditionThat(uil,c,laPropExpression(0,"la.input_mapping.current"));{
  1574. laUiItem* gui=laMakeEmptyGroup(uil,c,0,0); laUiList* guil=gui->Page; laColumn* gc=laFirstColumn(guil); guil->HeightCoeff=-1;
  1575. laShowItemFull(guil,gc,0,"la.input_mapping.current",LA_WIDGET_COLLECTION_SINGLE,0,laui_InputMapping,0)->Flags|=LA_UI_FLAGS_NO_DECAL;
  1576. }laEndCondition(uil,b3);
  1577. }
  1578. void lauidetached_Drivers(laPanel* p){
  1579. la_MakeDetachedProp(p, "la.detached_view_switch", "detached");
  1580. la_MakeDetachedProp(p, "tns.world.root_objects", "root_object");
  1581. }
  1582. void laui_DriverListItem(laUiList *uil, laPropPack *This, laPropPack *Extra, laColumn *UNUSED, int context){
  1583. laColumn* c=laFirstColumn(uil),*cl, *cr,*cll,*clr;
  1584. laUiItem* b=laBeginRow(uil,c,0,0);
  1585. laShowItem(uil,c,This,"use_script")->Flags|=LA_UI_FLAGS_ICON|LA_UI_FLAGS_NO_DECAL|LA_UI_FLAGS_CYCLE;
  1586. laShowItem(uil,c,This,"identifier")->Flags|=LA_UI_FLAGS_PLAIN;
  1587. laUiItem* b4=laOnConditionThat(uil,c,laNot(laPropExpression(This,"use_script")));{
  1588. laShowItem(uil,c,This,"trigger")->Flags|=LA_UI_FLAGS_PLAIN;
  1589. }laEndCondition(uil,b4);
  1590. laEndRow(uil,b);
  1591. }
  1592. void laui_Drivers(laUiList *uil, laPropPack *This, laPropPack *Extra, laColumn *UNUSED, int context){
  1593. laColumn* c=laFirstColumn(uil),*cl, *cr,*cll,*clr;
  1594. laSplitColumn(uil,c,0.35); cl=laLeftColumn(c,7); cr=laRightColumn(c,0);
  1595. laSplitColumn(uil,cl,0.4); cll=laLeftColumn(cl,1); clr=laRightColumn(cl,0);
  1596. laShowItemFull(uil,cll,Extra,"detached",0,0,0,0)->Flags|=LA_UI_FLAGS_HIGHLIGHT|LA_UI_FLAGS_ICON;
  1597. #define ADD_PAGE \
  1598. laUiItem* b2=laOnConditionThat(uil,cl,laPropExpression(&rb->PP,""));{ \
  1599. laUiItem* b=laBeginRow(uil,cr,0,0); \
  1600. laUiItem* b3=laOnConditionThat(uil,cl,laPropExpression(&rb->PP,"drivers.current_page"));{ \
  1601. laUiItem* cp=laShowItemFull(uil,cr,&rb->PP,"drivers.current_page",LA_WIDGET_COLLECTION_SELECTOR,0,laui_DriverListItem,0); \
  1602. cp->Flags|=LA_UI_COLLECTION_SIMPLE_SELECTOR; \
  1603. laShowItem(uil,cr,&cp->PP,"name"); \
  1604. laShowItem(uil,cr,&rb->PP,"add_driver_page")->Flags|=LA_UI_FLAGS_ICON|LA_UI_FLAGS_EXIT_WHEN_TRIGGERED; \
  1605. laShowItem(uil,cr,&cp->PP,"remove_driver_page")->Flags|=LA_UI_FLAGS_ICON; \
  1606. laShowSeparator(uil,cr); \
  1607. laShowItemFull(uil,cr,&cp->PP,"use_script",0,"icon=📃",0,0) \
  1608. ->Flags|=LA_UI_FLAGS_HIGHLIGHT|LA_UI_FLAGS_CYCLE|LA_UI_FLAGS_ICON; \
  1609. laUiItem* b4=laOnConditionThat(uil,cl,laNot(laPropExpression(&cp->PP,"use_script")));{ \
  1610. laShowItem(uil,cr,&cp->PP,"trigger"); \
  1611. }laEndCondition(uil,b4); \
  1612. }laElse(uil,b3);{ \
  1613. laShowItem(uil,cr,&rb->PP,"add_driver_page")->Flags|=LA_UI_FLAGS_ICON|LA_UI_FLAGS_EXIT_WHEN_TRIGGERED; \
  1614. }laEndCondition(uil,b3); \
  1615. laEndRow(uil,b); \
  1616. }laEndCondition(uil,b2); \
  1617. b2=laOnConditionThat(uil,c,laPropExpression(&rb->PP,"drivers.current_page"));{ \
  1618. laUiItem* b3=laOnConditionThat(uil,c,laPropExpression(&rb->PP,"drivers.current_page.use_script"));{ \
  1619. laShowItemFull(uil,c,&rb->PP,"drivers.current_page.script",0,0,0,0)->Extra->HeightCoeff=-2; \
  1620. }laElse(uil,b3);{ \
  1621. laShowItemFull(uil,c,&rb->PP,"drivers.current_page",LA_WIDGET_COLLECTION_SINGLE,0,laui_RackPage,0)->Flags|=LA_UI_FLAGS_NO_DECAL; \
  1622. }laEndCondition(uil,b3); \
  1623. }laElse(uil,b2);{ \
  1624. laShowLabel(uil,c,"Select or add a logic page.",0,0)->Flags|=LA_TEXT_ALIGN_CENTER; \
  1625. }laEndCondition(uil,b2);
  1626. laUiItem* b1=laOnConditionThat(uil,c,laPropExpression(Extra,"detached"));{
  1627. laUiItem* rb=laShowItemFull(uil,clr,Extra,"root_object",LA_WIDGET_COLLECTION_SELECTOR,0,laui_IdentifierOnly,0);
  1628. ADD_PAGE
  1629. }laElse(uil,b1);{
  1630. laUiItem* rb=laShowItemFull(uil,clr,0,"tns.world.active_root",LA_WIDGET_COLLECTION_SELECTOR,0,laui_IdentifierOnly,0);
  1631. ADD_PAGE
  1632. }laEndCondition(uil,b1);
  1633. #undef ADD_PAGE
  1634. }
  1635. void lauidetached_Materials(laPanel* p){
  1636. la_MakeDetachedProp(p, "la.detached_view_switch", "detached");
  1637. la_MakeDetachedProp(p, "tns.world.materials", "material");
  1638. }
  1639. void laui_Materials(laUiList *uil, laPropPack *This, laPropPack *Extra, laColumn *UNUSED, int context){
  1640. laColumn* c=laFirstColumn(uil),*cl, *cr,*cll,*clr;
  1641. laSplitColumn(uil,c,0.3); cl=laLeftColumn(c,1); cr=laRightColumn(c,0);
  1642. laShowItemFull(uil,cl,Extra,"detached",0,0,0,0)->Flags|=LA_UI_FLAGS_HIGHLIGHT|LA_UI_FLAGS_ICON;
  1643. #define ADD_PAGE(SEL) \
  1644. laUiItem* b=laBeginRow(uil,cr,0,0); \
  1645. laUiItem* b2=laOnConditionThat(uil,cr,laPropExpression(&rb->PP,""));{ \
  1646. laUiItem* cp=laShowInvisibleItem(uil,cr,&rb->PP,"shader_page"); \
  1647. if(SEL){ \
  1648. laShowItemFull(uil,cr,&rb->PP,"",LA_WIDGET_COLLECTION_SELECTOR,0,laui_IdentifierOnly,0) \
  1649. ->Flags|=LA_UI_COLLECTION_SIMPLE_SELECTOR; \
  1650. } \
  1651. laShowItem(uil,cr,&rb->PP,"name"); \
  1652. laShowItem(uil,cr,0,"M_new_material")->Flags|=LA_UI_FLAGS_ICON; \
  1653. laShowItem(uil,cr,&rb->PP,"remove")->Flags|=LA_UI_FLAGS_ICON; \
  1654. laShowSeparator(uil,cr)->Expand=1; \
  1655. laShowItemFull(uil,cr,&cp->PP,"use_script",0,"icon=📃;text=GLSL",0,0) \
  1656. ->Flags|=LA_UI_FLAGS_HIGHLIGHT|LA_UI_FLAGS_CYCLE; \
  1657. laShowItem(uil,cr,&rb->PP,"refresh"); \
  1658. laShowSeparator(uil,cr); \
  1659. laShowItem(uil,cr,&rb->PP,"as_library")->Flags|=LA_UI_FLAGS_HIGHLIGHT|LA_UI_FLAGS_CYCLE; \
  1660. }laElse(uil,b2);{ \
  1661. if(SEL){ \
  1662. laShowItemFull(uil,cr,&rb->PP,"",LA_WIDGET_COLLECTION_SELECTOR,"text=Select",laui_IdentifierOnly,0) \
  1663. ->Flags|=LA_UI_COLLECTION_SIMPLE_SELECTOR|LA_UI_FLAGS_EXPAND; \
  1664. laShowItem(uil,cr,0,"M_new_material")->Flags|=LA_UI_FLAGS_ICON; \
  1665. } \
  1666. }laEndCondition(uil,b2); \
  1667. laEndRow(uil,b); \
  1668. b2=laOnConditionThat(uil,c,laPropExpression(&rb->PP,"shader_page"));{ \
  1669. laUiItem* b3=laOnConditionThat(uil,c,laPropExpression(&rb->PP,"shader_page.use_script"));{ \
  1670. laShowItemFull(uil,c,&rb->PP,"shader_page.script",0,0,0,0)->Extra->HeightCoeff=-2; \
  1671. }laElse(uil,b3);{ \
  1672. laShowItemFull(uil,c,&rb->PP,"shader_page",LA_WIDGET_COLLECTION_SINGLE,0,laui_RackPage,0)->Flags|=LA_UI_FLAGS_NO_DECAL; \
  1673. }laEndCondition(uil,b3); \
  1674. }laElse(uil,b2);{ \
  1675. laShowLabel(uil,c,"Select or add a shader page.",0,0)->Flags|=LA_TEXT_ALIGN_CENTER; \
  1676. }laEndCondition(uil,b2);
  1677. laUiItem* b1=laOnConditionThat(uil,c,laPropExpression(Extra,"detached"));{
  1678. laUiItem* rb=laShowInvisibleItem(uil,cr,Extra,"material");
  1679. ADD_PAGE(1)
  1680. }laElse(uil,b1);{
  1681. laShowInvisibleItem(uil,cr,0,"tns.world.active_root.active.as_mesh.materials"); // for switching updates.
  1682. laUiItem* rb=laShowInvisibleItem(uil,cr,0,"tns.world.active_root.active.as_mesh.current_material.material");
  1683. ADD_PAGE(0)
  1684. }laEndCondition(uil,b1);
  1685. #undef ADD_PAGE
  1686. }
  1687. void laui_AnimationActionSimple(laUiList *uil, laPropPack *This, laPropPack *Extra, laColumn *ExtraColumns, int context){
  1688. laColumn* c=laFirstColumn(uil);
  1689. laUiItem* b=laBeginRow(uil,c,0,0);{
  1690. laUiItem* b2=laOnConditionThat(uil,c,laEqual(laPropExpression(This,"__self"),laPropExpression(0,"la.animation.current_action")));{
  1691. laShowLabel(uil,c,"🠶",0,0)->Flags|=LA_TEXT_MONO|LA_TEXT_ALIGN_RIGHT;
  1692. }laElse(uil,b2);{
  1693. laShowLabel(uil,c," ",0,0)->Flags|=LA_TEXT_MONO;
  1694. }laEndCondition(uil,b2);
  1695. laUiItem* ui=laShowItemFull(uil,c,This,"play_head",LA_WIDGET_METER_TYPE1,0,0,0);
  1696. ui->Flags|=LA_UI_FLAGS_NO_LABEL|LA_UI_FLAGS_UNDERNEATH; ui->Expand=1;
  1697. laShowItem(uil,c,This,"name")->Flags|=LA_UI_FLAGS_NO_DECAL|LA_UI_FLAGS_NO_EVENT;
  1698. laShowItemFull(uil,c,This,"solo",0,"icon=S;",0,0)->Flags=LA_UI_FLAGS_ICON|LA_UI_FLAGS_CYCLE|LA_UI_FLAGS_HIGHLIGHT;
  1699. laShowItemFull(uil,c,This,"mute",0,"icon=M;",0,0)->Flags=LA_UI_FLAGS_ICON|LA_UI_FLAGS_CYCLE|LA_UI_FLAGS_HIGHLIGHT;
  1700. }
  1701. laEndRow(uil,b);
  1702. }
  1703. void laui_AnimationActionHolder(laUiList *uil, laPropPack *This, laPropPack *Extra, laColumn *ExtraColumns, int context){
  1704. laColumn* c=laFirstColumn(uil);
  1705. laShowItemFull(uil,c,This,"identifier",LA_WIDGET_STRING_PLAIN,0,0,0);
  1706. laShowItemFull(uil,c,This,"__actions__",0,0,laui_AnimationActionSimple,0)->Flags|=LA_UI_FLAGS_NO_DECAL;
  1707. }
  1708. void laui_AnimationActionListItem(laUiList *uil, laPropPack *This, laPropPack *Extra, laColumn *ExtraColumns, int context){
  1709. laColumn* c=laFirstColumn(uil); laUiItem* ui;
  1710. laUiItem* b=laBeginRow(uil,c,0,0);{
  1711. //laUiItem* b2=laOnConditionThat(uil,c,laNot(laEqual(laPropExpression(This,"__self"),laPropExpression(0,"la.animation.current_action"))));{
  1712. // ui=laShowItemFull(uil,c,This,"play_head",LA_WIDGET_METER_TYPE1,0,0,0);
  1713. // ui->Flags|=LA_UI_FLAGS_NO_LABEL|LA_UI_FLAGS_UNDERNEATH; ui->Expand=1;
  1714. //}laEndCondition(uil,b2);
  1715. ui=laShowItem(uil,c,This,"name");
  1716. ui->Flags|=LA_UI_FLAGS_NO_DECAL|LA_UI_FLAGS_NO_EVENT; ui->Expand=1;
  1717. }
  1718. laEndRow(uil,b);
  1719. }
  1720. void laui_AnimationActions(laUiList *uil, laPropPack *This, laPropPack *Extra, laColumn *UNUSED, int context){
  1721. laColumn* c=laFirstColumn(uil),*cl, *cr; laSplitColumn(uil,c,0.5); cl=laLeftColumn(c,0); cr=laRightColumn(c,5);
  1722. laUiItem* b,*ui;
  1723. ui=laShowItemFull(uil,cl,0,"la.animation.play_head",0,0,0,0);
  1724. ui->Flags|=LA_UI_FLAGS_NO_LABEL|LA_TEXT_ALIGN_CENTER; ui->Expand=1;
  1725. laUiItem* row=laBeginRow(uil,cr,0,0);
  1726. laShowItemFull(uil,cr,0,"LA_animation_reset_time",0,0,0,0)->Flags|=LA_UI_FLAGS_ICON|LA_UI_FLAGS_EXIT_WHEN_TRIGGERED;
  1727. b=laOnConditionThat(uil,cr,laPropExpression(0,"la.animation.play_status"));{
  1728. ui=laShowItemFull(uil,cr,0,"LA_animation_set_play_status",0,"text=❚❚;",0,0);
  1729. ui->Flags|=LA_UI_FLAGS_EXIT_WHEN_TRIGGERED|LA_TEXT_ALIGN_CENTER; ui->Expand=1;
  1730. }laElse(uil,b);{
  1731. ui=laShowItemFull(uil,cr,0,"LA_animation_set_play_status",0,"icon=◀;mode=reverse;",0,0);
  1732. ui->Flags|=LA_UI_FLAGS_ICON|LA_UI_FLAGS_EXIT_WHEN_TRIGGERED; ui->Expand=1;
  1733. ui=laShowItemFull(uil,cr,0,"LA_animation_set_play_status",0,"icon=▶;mode=forward;",0,0);
  1734. ui->Flags|=LA_UI_FLAGS_ICON|LA_UI_FLAGS_EXIT_WHEN_TRIGGERED; ui->Expand=1;
  1735. }laEndCondition(uil,b);
  1736. laEndRow(uil,row);
  1737. ui=laMakeEmptyGroup(uil,c,"Use Format",0); laUiList* gu=ui->Page; laColumn* gc=laFirstColumn(gu);
  1738. gu->HeightCoeff=-2; //ui->Flags|=LA_UI_FLAGS_NO_DECAL;
  1739. for(laActionHolderPath* ahp=MAIN.Animation->ActionHolderPaths.pFirst;ahp;ahp=ahp->Item.pNext){
  1740. laShowLabel(gu,gc,ahp->PP.LastPs->p->Name,0,0)->Flags|=LA_UI_FLAGS_DISABLED|LA_TEXT_MONO;
  1741. 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;
  1742. }
  1743. row=laBeginRow(uil,cl,0,0);
  1744. laShowItemFull(uil,cl,0,"LA_animation_new_action",0,"text=New",0,0);
  1745. laEndRow(uil,row);
  1746. }
  1747. void laui_AnimationActionChannels(laUiList *uil, laPropPack *This, laPropPack *Extra, laColumn *UNUSED, int context){
  1748. laColumn* c=laFirstColumn(uil),*cl, *cr, *cll,*clr, *crl, *crr;
  1749. laSplitColumn(uil,c,0.3); cl=laLeftColumn(c,6); cr=laRightColumn(c,0);
  1750. laSplitColumn(uil,cl,0.75); cll=laLeftColumn(cl,0); clr=laRightColumn(cl,1);
  1751. laSplitColumn(uil,cr,0.75); crl=laLeftColumn(cr,0); crr=laRightColumn(cr,10);
  1752. laUiItem* b,*ui,*b2,*b3;
  1753. laUiItem* row=laBeginRow(uil,cll,0,0);
  1754. laShowItemFull(uil,cll,0,"LA_animation_reset_time",0,"current=true;text=1",0,0)->Flags|=LA_UI_FLAGS_EXIT_WHEN_TRIGGERED;
  1755. b=laOnConditionThat(uil,cll,laPropExpression(0,"la.animation.play_status"));{
  1756. ui=laShowItemFull(uil,cll,0,"LA_animation_set_play_status",0,"text=❚❚;",0,0);
  1757. ui->Flags|=LA_UI_FLAGS_EXIT_WHEN_TRIGGERED|LA_TEXT_ALIGN_CENTER; ui->Expand=1;
  1758. }laElse(uil,b);{
  1759. ui=laShowItemFull(uil,cll,0,"LA_animation_set_play_status",0,"icon=◀;mode=reverse;",0,0);
  1760. ui->Flags|=LA_UI_FLAGS_ICON|LA_UI_FLAGS_EXIT_WHEN_TRIGGERED; ui->Expand=1;
  1761. ui=laShowItemFull(uil,cll,0,"LA_animation_set_play_status",0,"icon=▶;mode=forward;",0,0);
  1762. ui->Flags|=LA_UI_FLAGS_ICON|LA_UI_FLAGS_EXIT_WHEN_TRIGGERED; ui->Expand=1;
  1763. }laEndCondition(uil,b);
  1764. laEndRow(uil,row);
  1765. b2=laOnConditionThat(uil,c,laPropExpression(0,"la.animation.current_action"));{
  1766. laUiItem* ca=laShowInvisibleItem(uil,c,0,"la.animation.current_action");
  1767. row=laBeginRow(uil,crl,0,0);
  1768. ui=laShowItemFull(uil,crl,&ca->PP,"play_head",LA_WIDGET_METER_TYPE1,0,0,0);
  1769. ui->Flags|=LA_UI_FLAGS_NO_LABEL|LA_UI_FLAGS_UNDERNEATH; ui->Expand=1;
  1770. laShowItem(uil,crl,&ca->PP,"current_frame")->Flags|=LA_UI_FLAGS_NO_LABEL|LA_UI_FLAGS_NO_DECAL|LA_TEXT_ALIGN_CENTER;
  1771. laShowSeparator(uil,crl);
  1772. laShowItem(uil,crl,&ca->PP,"frame_count")->Flags|=LA_TEXT_ALIGN_CENTER;
  1773. laShowItem(uil,crl,&ca->PP,"length");
  1774. laEndRow(uil,row);
  1775. b3=laBeginRow(uil,crr,0,0);
  1776. laShowItem(uil,crr,&ca->PP,"name")->Expand=1;
  1777. laShowItemFull(uil,crr,0,"LA_animation_select_action",0,0,0,0)->Flags|=LA_UI_FLAGS_ICON;
  1778. laEndRow(uil,b3);
  1779. b=laOnConditionToggle(uil,clr,0,0,0,0,0);{ strSafeSet(&b->ExtraInstructions,"text=☰");
  1780. laShowItem(uil,cl,&ca->PP,"remove");
  1781. row=laBeginRow(uil,cr,0,0);
  1782. laShowItemFull(uil,cr,&ca->PP,"play_by_default",0,"text=Auto Play;",0,0)->Flags|=LA_UI_FLAGS_CYCLE|LA_UI_FLAGS_HIGHLIGHT;
  1783. laShowItem(uil,cr,&ca->PP,"mix_mode")->Flags|=LA_UI_FLAGS_EXPAND;
  1784. laShowItem(uil,cr,&ca->PP,"play_mode")->Flags|=LA_UI_FLAGS_EXPAND;
  1785. laShowSeparator(uil,cr)->Expand=1;
  1786. laShowItem(uil,cr,&ca->PP,"solo")->Flags|=LA_UI_FLAGS_CYCLE|LA_UI_FLAGS_HIGHLIGHT;
  1787. laShowItem(uil,cr,&ca->PP,"mute")->Flags|=LA_UI_FLAGS_CYCLE|LA_UI_FLAGS_HIGHLIGHT;
  1788. laEndRow(uil,row);
  1789. }laEndCondition(uil,b);
  1790. }laElse(uil,b2);{
  1791. laShowLabel(uil,crl,"Please select an action.",0,0);
  1792. laShowItemFull(uil,crr,0,"LA_animation_select_action",0,0,0,0);
  1793. }laEndCondition(uil,b2);
  1794. laShowCanvas(uil,c,0,"la.animation.current_action","la_AnimationActionDrawCanvas",-1);
  1795. }
  1796. void tnsui_CameraObjectProperties(laUiList *uil, laPropPack *This, laPropPack *UNUSED_Extra, laColumn *UNUSED_Colums, int context){
  1797. laColumn* c=laFirstColumn(uil);
  1798. laShowLabel(uil,c,"Camera Object",0,0)->Flags|=LA_TEXT_ALIGN_CENTER|LA_UI_FLAGS_DISABLED;
  1799. }
  1800. void tnsui_LightObjectProperties(laUiList *uil, laPropPack *This, laPropPack *UNUSED_Extra, laColumn *UNUSED_Colums, int context){
  1801. laColumn* c=laFirstColumn(uil);
  1802. laShowLabel(uil,c,"Light Object",0,0)->Flags|=LA_TEXT_ALIGN_CENTER|LA_UI_FLAGS_DISABLED;
  1803. }
  1804. void tnsui_Material(laUiList *uil, laPropPack *This, laPropPack *UNUSED_Extra, laColumn *UNUSED_Colums, int context){
  1805. laColumn* c=laFirstColumn(uil),*cl,*cr; laUiItem* b,*b1,*b2;
  1806. laSplitColumn(uil,c,0.4); cl=laLeftColumn(c,8); cr=laRightColumn(c,0);
  1807. if(!context){
  1808. laShowLabel(uil,cl,"Name",0,0); laShowItem(uil,cr,This,"name");
  1809. }
  1810. b2=laOnConditionThat(uil,c,laPropExpression(This,"as_library"));{
  1811. laShowLabel(uil,c,"Material is common library.",0,0);
  1812. }laElse(uil,b2);{
  1813. b=laBeginRow(uil,cl,0,0);
  1814. laShowLabel(uil,cl,"Color",0,0)->Expand=1;
  1815. b1=laOnConditionThat(uil,cl,laOr(laPropExpression(This,"shader_page.racks"),
  1816. laPropExpression(This,"shader_page.use_script")));{
  1817. laShowLabel(uil,cl,"🎨",0,0);
  1818. }laEndCondition(uil,b1);
  1819. laEndRow(uil,b);
  1820. laShowItemFull(uil,cr,This,"color",LA_WIDGET_FLOAT_COLOR,0,0,0)->Flags|=LA_UI_FLAGS_COLORFUL;
  1821. laShowItemFull(uil,cr,This,"colorful",LA_WIDGET_ENUM_HIGHLIGHT,0,0,0);
  1822. }laEndCondition(uil,b2);
  1823. laShowSeparator(uil,c);
  1824. laShowItemFull(uil,c,This,"gradient_mode",0,0,0,0)->Flags|=LA_UI_FLAGS_EXPAND;
  1825. b1=laOnConditionThat(uil,c,laPropExpression(This,"gradient_mode"));{
  1826. laShowLabel(uil,cl,"End Color",0,0);
  1827. laShowItemFull(uil,cr,This,"color2",LA_WIDGET_FLOAT_COLOR,0,0,0)->Flags|=LA_UI_FLAGS_COLORFUL;
  1828. laShowLabel(uil,cl,"Center",0,0);
  1829. laShowItemFull(uil,cr,This,"gradient_center",0,0,0,0);
  1830. laShowLabel(uil,cl,"Size",0,0);
  1831. laShowItemFull(uil,cr,This,"gradient_size",0,0,0,0);
  1832. b2=laOnConditionThat(uil,c,laEqual(laPropExpression(This,"gradient_mode"),laIntExpression(TNS_GRADIENT_MODE_BOX)));{
  1833. laShowItemFull(uil,cr,This,"gradient_box_r",0,0,0,0);
  1834. laShowItemFull(uil,cr,This,"gradient_box_f",0,0,0,0);
  1835. }laEndCondition(uil,b2);
  1836. }laEndCondition(uil,b1);
  1837. }
  1838. void tnsui_MaterialListItem(laUiList *uil, laPropPack *This, laPropPack *UNUSED_Extra, laColumn *UNUSED_Colums, int context){
  1839. laColumn* c=laFirstColumn(uil); laUiItem* b,*b1;
  1840. b=laBeginRow(uil,c,0,0);
  1841. laShowItemFull(uil,c,This,"color",LA_WIDGET_FLOAT_COLOR,0,0,0)->Flags|=LA_UI_FLAGS_NO_EVENT|LA_UI_FLAGS_ICON;
  1842. laUiItem* ui=laShowItem(uil,c,This,"name"); ui->Flags|=LA_UI_FLAGS_PLAIN; ui->Expand=1;
  1843. b1=laOnConditionThat(uil,c,laOr(laPropExpression(This,"shader_page.racks"),
  1844. laPropExpression(This,"shader_page.use_script")));{
  1845. laShowLabel(uil,c,"🎨",0,0);
  1846. }laEndCondition(uil,b1);
  1847. laEndRow(uil,b);
  1848. }
  1849. void tnsui_MaterialSlot(laUiList *uil, laPropPack *This, laPropPack *UNUSED_Extra, laColumn *UNUSED_Colums, int context){
  1850. laColumn* c=laFirstColumn(uil); laUiItem* b,*b1,*b2,*b3;
  1851. b1=laOnConditionThat(uil,c,laPropExpression(This,"material"));{
  1852. b=laBeginRow(uil,c,0,0);
  1853. b3=laOnConditionThat(uil,c,laPropExpression(This,"material.as_library"));{
  1854. laShowLabel(uil,c,"LIB ",0,0)->Flags|=LA_UI_DISABLED;
  1855. laShowItem(uil,c,This,"material.name")->Flags|=LA_UI_FLAGS_PLAIN|LA_UI_FLAGS_DISABLED;
  1856. }laElse(uil,b3);{
  1857. laShowItemFull(uil,c,This,"material.color",LA_WIDGET_FLOAT_COLOR,0,0,0)
  1858. ->Flags|=LA_UI_FLAGS_NO_EVENT|LA_UI_FLAGS_ICON|LA_UI_FLAGS_COLORFUL;
  1859. laUiItem* ui=laShowItem(uil,c,This,"material.name"); ui->Flags|=LA_UI_FLAGS_PLAIN; ui->Expand=1;
  1860. b2=laOnConditionThat(uil,c,laOr(laPropExpression(This,"material.shader_page.racks"),
  1861. laPropExpression(This,"material.shader_page.use_script")));{
  1862. laShowLabel(uil,c,"🎨",0,0);
  1863. }laEndCondition(uil,b2);
  1864. }laEndCondition(uil,b3);
  1865. laEndRow(uil,b);
  1866. }laElse(uil,b1);{
  1867. laShowItem(uil,c,This,"name")->Flags|=LA_UI_FLAGS_DISABLED;
  1868. }laEndCondition(uil,b1);
  1869. }
  1870. void tnsui_MeshObjectProperties(laUiList *uil, laPropPack *This, laPropPack *UNUSED_Extra, laColumn *UNUSED_Colums, int context){
  1871. laColumn* c=laFirstColumn(uil); laUiItem* g,*tg; laUiList* gu,*tu; laColumn* gc,*gcl,*gcr,*tc; laUiItem* b1,*b2,*b3,*b4,*b5;
  1872. laShowLabel(uil,c,"Mesh Object",0,0)->Flags|=LA_TEXT_ALIGN_CENTER|LA_UI_FLAGS_DISABLED;
  1873. g=laMakeGroup(uil,c,"Materials",0); gu=g->Page; gc=laFirstColumn(gu); laSplitColumn(gu,gc,0.7);
  1874. gcl=laLeftColumn(gc,0); gcr=laRightColumn(gc,1);
  1875. tg=laMakeEmptyGroup(gu,gcl,"Slots",0); tu=tg->Page; tc=laFirstColumn(tu); tu->HeightCoeff=4;
  1876. laShowItemFull(tu,tc,This,"materials",0,0,tnsui_MaterialSlot,0)->Flags|=LA_UI_FLAGS_NO_DECAL;
  1877. laShowItem(gu,gcr,This,"add_material_slot");
  1878. b2=laOnConditionThat(gu,gc,laPropExpression(This,"current_material"));{
  1879. laUiItem* mat=laShowInvisibleItem(gu,gc,This,"current_material");
  1880. laShowItem(gu,gcr,&mat->PP,"remove");
  1881. b3=laBeginRow(gu,gc,0,0); laUiItem* sel;
  1882. laShowItem(gu,gc,This,"add_material")->Flags|=LA_UI_FLAGS_ICON;
  1883. b4=laOnConditionThat(gu,gc,laPropExpression(&mat->PP,"material"));{
  1884. sel=laShowItemFull(gu,gc,&mat->PP,"material",LA_WIDGET_COLLECTION_SELECTOR,0,tnsui_MaterialListItem,0);
  1885. sel->Flags|=LA_UI_COLLECTION_SIMPLE_SELECTOR;
  1886. laShowItem(gu,gc,&mat->PP,"material.name")->Expand=1;
  1887. laShowItem(gu,gc,&sel->PP,"clear_selection")->Flags|=LA_UI_FLAGS_ICON;
  1888. }laElse(gu,b4);{
  1889. sel=laShowItemFull(gu,gc,&mat->PP,"material",LA_WIDGET_COLLECTION_SELECTOR,0,tnsui_MaterialListItem,0);
  1890. sel->Flags|=LA_UI_COLLECTION_SIMPLE_SELECTOR; sel->Expand=1;
  1891. }laEndCondition(gu,b4);
  1892. laEndRow(gu,b3);
  1893. b4=laOnConditionThat(gu,gc,laEqual(laPropExpression(This,"mode"),laIntExpression(TNS_MESH_EDIT_MODE)));{
  1894. b5=laBeginRow(gu,gc,0,0);
  1895. laShowLabel(gu,gc,"Edit:",0,0);
  1896. laShowItemFull(gu,gc,This,"assign_material_slot",0,"text=Assign",0,0);
  1897. laEndRow(gu,b5);
  1898. }laEndCondition(gu,b4);
  1899. laShowSeparator(gu,gc);
  1900. b4=laOnConditionThat(gu,gc,laPropExpression(&mat->PP,"material"));{
  1901. laShowItemFull(gu,gc,&mat->PP,"material",LA_WIDGET_COLLECTION_SINGLE,0,tnsui_Material,1)->Flags|=LA_UI_FLAGS_NO_DECAL;
  1902. }laEndCondition(gu,b4);
  1903. }laElse(gu,b2);{
  1904. laShowLabel(gu,gc,"No active material slot.",0,0);
  1905. }laEndCondition(gu,b2);
  1906. }
  1907. void tnsui_ShapeObjectProperties(laUiList *uil, laPropPack *This, laPropPack *UNUSED_Extra, laColumn *UNUSED_Colums, int context){
  1908. laColumn* c=laFirstColumn(uil); laUiItem* g,*tg; laUiList* gu,*tu; laColumn* gc,*gcl,*gcr,*tc; laUiItem* b1,*b2,*b3,*b4,*b5;
  1909. laShowLabel(uil,c,"Shape Object",0,0)->Flags|=LA_TEXT_ALIGN_CENTER|LA_UI_FLAGS_DISABLED;
  1910. g=laMakeGroup(uil,c,"Materials",0); gu=g->Page; gc=laFirstColumn(gu); laSplitColumn(gu,gc,0.4);
  1911. gcl=laLeftColumn(gc,10); gcr=laRightColumn(gc,0);
  1912. laShowLabel(gu,gcl,"Backdrop",0,0);
  1913. laShowItemFull(gu,gcr,This,"backdrop",0,"text=Backdrop",0,0)->Flags|=LA_UI_FLAGS_CYCLE|LA_UI_FLAGS_HIGHLIGHT;
  1914. g=laMakeGroup(uil,c,"Materials",0); gu=g->Page; gc=laFirstColumn(gu); laSplitColumn(gu,gc,0.7);
  1915. gcl=laLeftColumn(gc,0); gcr=laRightColumn(gc,1);
  1916. tg=laMakeEmptyGroup(gu,gcl,"Slots",0); tu=tg->Page; tc=laFirstColumn(tu); tu->HeightCoeff=4;
  1917. laShowItemFull(tu,tc,This,"materials",0,0,tnsui_MaterialSlot,0)->Flags|=LA_UI_FLAGS_NO_DECAL;
  1918. laShowItem(gu,gcr,This,"add_material_slot");
  1919. b2=laOnConditionThat(gu,gc,laPropExpression(This,"current_material"));{
  1920. laUiItem* mat=laShowInvisibleItem(gu,gc,This,"current_material");
  1921. laShowItem(gu,gcr,&mat->PP,"remove");
  1922. b3=laBeginRow(gu,gc,0,0); laUiItem* sel;
  1923. laShowItem(gu,gc,This,"add_material")->Flags|=LA_UI_FLAGS_ICON;
  1924. b4=laOnConditionThat(gu,gc,laPropExpression(&mat->PP,"material"));{
  1925. sel=laShowItemFull(gu,gc,&mat->PP,"material",LA_WIDGET_COLLECTION_SELECTOR,0,tnsui_MaterialListItem,0);
  1926. sel->Flags|=LA_UI_COLLECTION_SIMPLE_SELECTOR;
  1927. laShowItem(gu,gc,&mat->PP,"material.name")->Expand=1;
  1928. laShowItem(gu,gc,&sel->PP,"clear_selection")->Flags|=LA_UI_FLAGS_ICON;
  1929. }laElse(gu,b4);{
  1930. sel=laShowItemFull(gu,gc,&mat->PP,"material",LA_WIDGET_COLLECTION_SELECTOR,0,tnsui_MaterialListItem,0);
  1931. sel->Flags|=LA_UI_COLLECTION_SIMPLE_SELECTOR; sel->Expand=1;
  1932. }laEndCondition(gu,b4);
  1933. laEndRow(gu,b3);
  1934. b4=laOnConditionThat(gu,gc,laEqual(laPropExpression(This,"mode"),laIntExpression(TNS_MESH_EDIT_MODE)));{
  1935. b5=laBeginRow(gu,gc,0,0);
  1936. laShowLabel(gu,gc,"Edit:",0,0);
  1937. laShowItemFull(gu,gc,This,"assign_material_slot",0,"text=Assign",0,0);
  1938. laEndRow(gu,b5);
  1939. }laEndCondition(gu,b4);
  1940. laShowSeparator(gu,gc);
  1941. b4=laOnConditionThat(gu,gc,laPropExpression(&mat->PP,"material"));{
  1942. laShowItemFull(gu,gc,&mat->PP,"material",LA_WIDGET_COLLECTION_SINGLE,0,tnsui_Material,1)->Flags|=LA_UI_FLAGS_NO_DECAL;
  1943. }laEndCondition(gu,b4);
  1944. }laElse(gu,b2);{
  1945. laShowLabel(gu,gc,"No active material slot.",0,0);
  1946. }laEndCondition(gu,b2);
  1947. }
  1948. void tnsui_InstancerObjectProperties(laUiList *uil, laPropPack *This, laPropPack *UNUSED_Extra, laColumn *UNUSED_Colums, int context){
  1949. laColumn* c=laFirstColumn(uil), *cl,*cr;
  1950. laSplitColumn(uil,c,0.5); cl=laLeftColumn(c,5); cr=laRightColumn(c,0);
  1951. laShowLabel(uil,cl,"Instance",0,0); laShowItemFull(uil,cr,This,"instance",LA_WIDGET_COLLECTION_SELECTOR,0,laui_IdentifierOnly,0);
  1952. laUiItem* b=laOnConditionThat(uil,c,laAnd(laPropExpression(This,"instance"),laPropExpression(This,"instance.__self.as_root_object.is_2d")));
  1953. laShowSeparator(uil,c);
  1954. laShowLabel(uil,cl,"Hook",0,0); laShowItemFull(uil,cr,This,"hook",0,0,0,0);
  1955. laShowLabel(uil,cl,"Offsets",0,0); laShowItemFull(uil,cr,This,"hook_offset",0,0,0,0)->Flags|=LA_UI_FLAGS_TRANSPOSE;
  1956. laEndCondition(uil,b);
  1957. }
  1958. void tnsui_RootObjectProperties(laUiList *uil, laPropPack *This, laPropPack *UNUSED_Extra, laColumn *UNUSED_Colums, int context){
  1959. laColumn* c=laFirstColumn(uil), *cl,*cr;
  1960. laSplitColumn(uil,c,0.5); cl=laLeftColumn(c,5); cr=laRightColumn(c,0);
  1961. laShowLabel(uil,cl,"Mode",0,0); laShowItemFull(uil,cr,This,"is_2d",0,0,0,0)->Flags|=LA_UI_FLAGS_EXPAND;
  1962. laShowLabel(uil,cl,"Active Camera",0,0); laShowItemFull(uil,cr,This,"active_camera",LA_WIDGET_COLLECTION_SELECTOR,0,laui_IdentifierOnly,0);
  1963. }
  1964. void tnsui_BaseObjectProperties(laUiList *uil, laPropPack *This, laPropPack *UNUSED_Extra, laColumn *UNUSED_Colums, int context){
  1965. laColumn* c=laFirstColumn(uil); laUiItem* g,*tg; laUiList* gu,*tu; laColumn* gc,*gcl,*gcr,*tc; laUiItem* b1,*b2,*b3,*b4,*b5;
  1966. laShowLabel(uil,c,"Generic",0,0)->Flags|=LA_TEXT_ALIGN_CENTER|LA_UI_FLAGS_DISABLED;
  1967. g=laMakeGroup(uil,c,"Object",0); gu=g->Page; gc=laFirstColumn(gu);
  1968. b1=laOnConditionToggle(gu,gc,0,0,0,0,0);{ strSafeSet(&b1->ExtraInstructions,"text=Transformations");
  1969. //b1->State=LA_UI_ACTIVE;
  1970. laSplitColumn(gu,gc,0.5); gcl=laLeftColumn(gc,0); gcr=laRightColumn(gc,0);
  1971. laShowLabel(gu,gcl,"Location",0,0); laShowItem(gu,gcl,This,"location")->Flags|=LA_UI_FLAGS_TRANSPOSE;
  1972. laShowLabel(gu,gcr,"Rotation",0,0); laShowItem(gu,gcr,This,"rotation")->Flags|=LA_UI_FLAGS_TRANSPOSE;
  1973. laShowLabel(gu,gcr,"Scale",0,0); laShowItem(gu,gcr,This,"scale")->Flags|=LA_UI_FLAGS_TRANSPOSE;
  1974. laUiItem* b=laOnConditionToggle(gu,gc,0,0,0,0,0);{ strSafeSet(&b->ExtraInstructions,"text=Delta");
  1975. laShowLabel(gu,gcl,"Delta Loc",0,0); laShowItem(gu,gcl,This,"dlocation")->Flags|=LA_UI_FLAGS_TRANSPOSE;
  1976. laShowLabel(gu,gcr,"Delta Rot",0,0); laShowItem(gu,gcr,This,"drotation")->Flags|=LA_UI_FLAGS_TRANSPOSE;
  1977. laShowLabel(gu,gcr,"Delta Scale",0,0);laShowItem(gu,gcr,This,"dscale")->Flags|=LA_UI_FLAGS_TRANSPOSE;
  1978. }laEndCondition(gu,b);
  1979. laShowSeparator(gu,gc);
  1980. }laEndCondition(gu,b1);
  1981. }
  1982. void tnsuidetached_ObjectProperties(laPanel* p){
  1983. la_MakeDetachedProp(p, "la.detached_view_switch", "detached");
  1984. la_MakeDetachedProp(p, "tns.world.root_objects", "root_object");
  1985. la_MakeDetachedProp(p, "tns.world.property_page", "page");
  1986. }
  1987. void tnsui_ObjectProperties(laUiList *uil, laPropPack *This, laPropPack *Extra, laColumn *UNUSED, int context){
  1988. laColumn* c=laFirstColumn(uil);
  1989. laUiItem* b=laBeginRow(uil,c,0,0);
  1990. laShowItemFull(uil,c,Extra,"detached",0,0,0,0)->Flags|=LA_UI_FLAGS_HIGHLIGHT|LA_UI_FLAGS_ICON;
  1991. #define ADD_PAGE1(base,path) \
  1992. laUiItem* rb=laShowItemFull(uil,c,base,path,LA_WIDGET_COLLECTION_SELECTOR,0,laui_IdentifierOnly,0); \
  1993. rb->Flags|=LA_UI_COLLECTION_SIMPLE_SELECTOR; \
  1994. laUiItem* b2=laOnConditionThat(uil,c,laPropExpression(&rb->PP,""));{ \
  1995. laShowItem(uil,c,&rb->PP,"name")->Flags|=LA_UI_FLAGS_NO_DECAL; \
  1996. laUiItem* b3=laOnConditionThat(uil,c,laPropExpression(&rb->PP,"active"));{ \
  1997. laShowLabel(uil,c,"⯈",0,0); laShowItem(uil,c,&rb->PP,"active.name")->Flags|=LA_UI_FLAGS_NO_DECAL; \
  1998. }laEndCondition(uil,b3); \
  1999. }laEndCondition(uil,b2); \
  2000. laEndRow(uil,b); \
  2001. b=laBeginRow(uil,c,0,0); \
  2002. laShowItemFull(uil,c,Extra,"page",0,0,0,0)->Flags|=LA_UI_FLAGS_EXPAND; \
  2003. laEndRow(uil,b); \
  2004. b=laOnConditionThat(uil,c,laNot(laPropExpression(Extra,"page")));{ \
  2005. laShowItemFull(uil,c,base,path ".as_root_object",LA_WIDGET_COLLECTION_SINGLE,0,0,0)->Flags|=LA_UI_FLAGS_NO_DECAL; \
  2006. }laElse(uil,b);
  2007. #define ADD_PAGE2 \
  2008. laUiItem* b3=laOnConditionThat(uil,c,laPropExpression(&actui->PP,""));{ \
  2009. tnsui_BaseObjectProperties(uil,&actui->PP,0,0,0); \
  2010. }laElse(uil,b3);{ \
  2011. laShowLabel(uil,c,"No active object.",0,0)->Flags|=LA_TEXT_ALIGN_CENTER|LA_UI_FLAGS_DISABLED;; \
  2012. }laEndCondition(uil,b3); \
  2013. laEndCondition(uil,b);
  2014. laUiItem* b0=laOnConditionThat(uil,c,laPropExpression(Extra,"detached"));{
  2015. ADD_PAGE1(Extra,"root_object")
  2016. laUiItem* actui=laShowItemFull(uil,c,&rb->PP,"active",LA_WIDGET_COLLECTION_SINGLE,0,0,0);
  2017. actui->Flags|=LA_UI_FLAGS_NO_DECAL;
  2018. ADD_PAGE2
  2019. }laElse(uil,b0);{
  2020. ADD_PAGE1(0,"tns.world.active_root")
  2021. laUiItem* actui=laShowItemFull(uil,c,0,"tns.world.active_root.active",LA_WIDGET_COLLECTION_SINGLE,0,0,0);
  2022. actui->Flags|=LA_UI_FLAGS_NO_DECAL;
  2023. ADD_PAGE2
  2024. }laEndCondition(uil,b0);
  2025. #undef ADD_PAGE1
  2026. #undef ADD_PAGE2
  2027. }
  2028. void tnsui_DetachedScenePanel(laPanel* p){
  2029. la_MakeDetachedProp(p, "la.detached_view_switch", "detached");
  2030. la_MakeDetachedProp(p, "tns.world.root_objects", "root_object");
  2031. }
  2032. void tnsui_ScenePanel(laUiList *uil, laPropPack *This, laPropPack *DetachedProps, laColumn *UNUSED, int context){
  2033. laColumn* c=laFirstColumn(uil);
  2034. laShow3DCanvasCombo(uil,c,DetachedProps,"root_object",-1,DetachedProps);
  2035. }
  2036. void tnsui_ObjectHierachy(laUiList *uil, laPropPack *This, laPropPack *Extra, laColumn *UNUSED, int context);
  2037. void tnsui_ChildObjectHierachy(laUiList *uil, laPropPack *This, laPropPack *Extra, laColumn *UNUSED, int context){
  2038. laColumn* c=laFirstColumn(uil); laShowItemFull(uil,c,This,"object",0,0,tnsui_ObjectHierachy,1)
  2039. ->Flags|=LA_UI_FLAGS_NO_DECAL|LA_UI_FLAGS_NO_GAP|LA_UI_COLLECTION_NO_HIGHLIGHT;
  2040. }
  2041. void tnsui_ObjectHierachy(laUiList *uil, laPropPack *This, laPropPack *Extra, laColumn *UNUSED, int context){
  2042. laColumn* c=laFirstColumn(uil),*cl,*cr; laSplitColumn(uil,c,0.5); cl=laLeftColumn(c,1); cr=laRightColumn(c,0);
  2043. laUiItem* r=laBeginRow(uil,cr,0,0);
  2044. laShowItemFull(uil,cr,This,"name",0,0,0,0)->Flags|=LA_UI_FLAGS_NO_DECAL;
  2045. laEndRow(uil,r);
  2046. char* prop="base.children";
  2047. laUiItem* b2=laOnConditionThat(uil,cl,laPropExpression(This,prop));{
  2048. laUiItem* b=laOnConditionToggle(uil,cl,0,0,0,0,0);{ b->Flags|=LA_UI_FLAGS_NO_DECAL;
  2049. b->State=LA_UI_ACTIVE;
  2050. laShowItemFull(uil,cr,This,prop,0,0,tnsui_ChildObjectHierachy,0)
  2051. ->Flags|=LA_UI_FLAGS_NO_DECAL|LA_UI_FLAGS_NO_GAP|LA_UI_COLLECTION_NO_HIGHLIGHT;
  2052. }laEndCondition(uil,b);
  2053. }laEndCondition(uil,b2);
  2054. }
  2055. void tnsui_WorldHierachy(laUiList *uil, laPropPack *This, laPropPack *Extra, laColumn *UNUSED, int context){
  2056. laColumn* c=laFirstColumn(uil),*gc; laUiList* gu;
  2057. laUiItem* r=laBeginRow(uil,c,0,0);
  2058. gu=laMakeMenuPage(uil,c,"Menu");{ gc=laFirstColumn(gu);
  2059. laShowItem(gu,gc,0,"M_new_root");
  2060. }
  2061. laEndRow(uil,r);
  2062. laUiItem* g=laMakeEmptyGroup(uil,c,"Hierachy",0);{ gu=g->Page; gc=laFirstColumn(gu);
  2063. gu->HeightCoeff=-1; //g->Flags|=LA_UI_FLAGS_NO_DECAL;
  2064. laShowItemFull(gu,gc,0,"tns.world.root_objects",0,0,tnsui_ObjectHierachy,0)->Flags|=LA_UI_FLAGS_NO_DECAL;
  2065. }
  2066. }
  2067. void tnsui_RootObjectMenuUi(laUiList *uil, laPropPack *This, laPropPack *OperatorProps, laColumn *UNUSED, int context){
  2068. laColumn* c=laFirstColumn(uil);
  2069. laShowItemFull(uil, c, This, "name",LA_WIDGET_STRING_PLAIN,0,0,0);
  2070. laShowItemFull(uil, c, This, "remove_root",0,0,0,0);
  2071. laShowItemFull(uil, c, 0, "M_new_root",0,0,0,0);
  2072. }
  2073. void la_RegisterBuiltinTemplates(){
  2074. int obj=MAIN.InitArgs.HasWorldObjects;
  2075. int tex=MAIN.InitArgs.HasTextureInspector;
  2076. int his=MAIN.InitArgs.HasHistories;
  2077. int ter=MAIN.InitArgs.HasTerminal;
  2078. int act=MAIN.InitArgs.HasAction&&obj;
  2079. laRegisterUiTemplate("LAUI_input_mapping","Input Mapping",laui_InputMappingBundle,0,0,"Controlling",0,0,0);
  2080. laRegisterUiTemplate("LAUI_controllers", "Controllers", laui_GameController, lauidetached_GameController, 0,0,0,0,0);
  2081. if(obj) laRegisterUiTemplate("LAUI_scene", "Scene", tnsui_ScenePanel, tnsui_DetachedScenePanel, 0, 0, 0,25,25);
  2082. if(obj) laRegisterUiTemplate("LAUI_world_hierachy","World",tnsui_WorldHierachy,0,0,0,0,0,0);
  2083. if(obj) laRegisterUiTemplate("LAUI_object_properties", "Properties", tnsui_ObjectProperties, tnsuidetached_ObjectProperties, 0, 0, 0,15,25);
  2084. if(act) laRegisterUiTemplate("LAUI_animation_actions", "Actions", laui_AnimationActions, 0, 0, 0, 0,15,25);
  2085. if(act) laRegisterUiTemplate("LAUI_animation_action_channels", "Action Channels", laui_AnimationActionChannels, 0, 0, 0, 0,20,15);
  2086. if(obj) laRegisterUiTemplate("LAUI_drivers","Drivers",laui_Drivers,lauidetached_Drivers,0,0,0,0,0);
  2087. if(obj) laRegisterUiTemplate("LAUI_materials","Materials",laui_Materials,lauidetached_Materials,0,0,0,0,0);
  2088. laRegisterUiTemplate("LAUI_user_preferences", "User Preferences", laui_UserPreference, 0, 0, "System",0,25,25);
  2089. if(tex) laRegisterUiTemplate("LAUI_texture_inspector", "Texture Inspector", laui_TextureInspector, lauidetached_TextureInspector, 0, 0, 0,0,0);
  2090. laRegisterUiTemplate("LAUI_data_manager", "Data Manager", laui_IdleDataManager, lauidetached_IdleDataManager, 0, 0, 0,25,25);
  2091. if(his) laRegisterUiTemplate("LAUI_histories", "Histories", laui_UndoHistories, 0, 0, 0, 0,10,25);
  2092. laRegisterUiTemplate("LAUI_about", "About", laui_About, 0, 0, 0, 0,15,25);
  2093. if(ter) laRegisterUiTemplate("LAUI_terminal", "Terminal", laui_Terminal, 0, 0, 0, 0,20,25);
  2094. }