*/}}

la_templates.c 89 KB

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