*/}}

la_templates.c 69 KB

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