*/}}

la_templates.c 86 KB

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