*/}}

la_templates.c 68 KB

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