*/}}

la_templates.c 108 KB

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