:>> SimMX uni ui creator!

For W-XP and up(dirWritePerm...)
Snippets are really sort of templates!
For quick demo without any compilers check down Html sample!
Win7 faster graphics: rightClick SUniGuiCreator.exe->properties->Compatibility->Disable desktop composition
When script-startapp.all/script-endapp.all exists, they are parsed after -loadtxt/..., chk base dir
Design mode buttons can be customized, check down << Customizing 'design mode' buttons >>

{{AUTOTOC:Table of contents('t'toJumpHere):}}

[[ HowToUse ]]
  there should be 2 orange user tools at top - this are just an example; <=if'any.tool'DoesntHavePosYet,itCanBeUsedAs:dblClickAnywhereNearThisTwoAndChoose(anyfilename.tool<=shoudExist,posWillBeAdded)
  -testing 1st tool: just hit it, it should open cmd window with some stuff
  -testing simmxhdrtools(somethingLikeLinux1stLineScript) and in-file compiling:
   open zz_smx\testcommenttools.cpp.all - read - adjust as necesarry,
   and hit Export(or F12 or Alt-c) - testcommenttools.cpp should be created in same folder.
   now hit 2nd orange user tool - if everything goes right some cmd line windows will show,
     optionally new compiled testcommenttools.exe and 3progs(write notepad calc) opened.
   note that default ToolsInComment expects exported file!

If you read the 'config' - even if you don't want to tweak - it has some usefull info!
For simple template/wizard like sample, just click 'snippets'->'html'->'index5.html'.
Some icons/background images and MainSwf.swf are in resources.7z if needed.

Hover over 'save' for current loaded/saved file!

AsHexStructEditor(notYetComplete): 1st load ...-binary.gfx(onlyMainTabIsUsed), then any file for editor - optionally save.


[[ Samples ]]
HaXe flash sample:
  -install haxe, then in tools\haxe-flash.bat modify path to it
  -in SUniGuiCreator:
     browserVer(open MainSwf.hx.all then sample.gfx and hit Export(hold down Shift while pressing OK, or dont and see if MainSwf gets executed-justCloseIfItRuns), then open index-haxe-swf.html.all) and hit Export
     flashPlayerVer-ifYouHaveFlPlayerTool-orDefaultSwfOpener(open MainSwf.hx.all and sample.gfx) and hit Export

Html sample:
  -open index5.html.all and sample.gfx, then hit Export - it should produce similar effect to upper haXe flash

Native windows sample:
  -open wnative.cpp.all(upper-txt) and wnative.gfx(lower-gfx)
  -compiler:
    msvc14: in tools\compile-wnd-msvc14.bat,modify path to this compiler(configuredForWXPsp2UpButTestedOnW7-target=x32)
    gcc: in tools\compile-wnd-gcc.bat,modify path to this compiler(configuredForGenericButTestedOnW7-target=x32), and modify header of opened wnative.cpp.all
    anotherOne: create file tools\compile-wnd-CompilerName.bat and modify header of opened wnative.cpp.all
  -export(itShouldCompileExeAndOpenThatApp)
  For 'class ids': BUTTON|EDIT|... [wndflagsNoWS_|exwndflagsNoWS_EX_|WS_...|WS_EX_...] [EXTRACLASSFLAGS] <=uppercaseAreAsTheyAreInHeaders,lowercaseAreWindowAndWindowExFlagsWithoutWS_orWS_EX_(thisIsSoThatHiddenCanBeUsed) <=updated so WS_ and WS_EX_ can be used!
    nativeClassesAreUsed-BUTTON,EDIT,etc-withAllUppercase, any flags can be added to this with 'space' as separator(allLowercase)
    and available flags can be found in upperSection of snippets\cpp\windows\ab_ui-create.esc, eg: BUTTON hidden BS_FLAT WS_VSCROLL WS_EX_LEFTSCROLLBAR
    AllItemsHaveAutoAdded: visible|child, if hidden is spec then no visible is added.
  For LISTBOX/COMBOBOX: lastLineCanSpecifyWhichLineIsSelected,as in sample:"Line1\nLine2\nLine3\\r1" <=1=whichOne
  Alignment is not implemented in script template for now, if anybody adds this, it would be fine to uppload to upp site

ExportOnly sample:
  double click zz_zexp/export-and-compile.bat <=compiler-env-gcc.bat should have correct path set to gcc

note for cb-loop-items-any.any:
  for now only vecobjitems props are expanded multiple-times if used in vecobj-extra-code


[[ Customizing 'design mode' buttons ]]
This is primarily used for setting customized extra button tools(setusertools canBeUsed-lookDown)!
ByDefault dm-default-1.all in usertools dir will be executed when clicking 1stButton, yes, that is without intermediate .cpp.all,.c.all,etc.
Intermediate files(andExporting) in this case are not used, but headertools are
For setting current *.tool(orAnyOther) files, setusertools(1stNameOnly) can be used(assumingDir-tools/usertools/ut-*.tool), eg: setusertools("ut-sample);
UserToolsButtons: the one with ...>(justASample) have option to rightMouseButtonClick(lastOptOnLine nul ... in *.tool)

[[ Plugins outer ]]
Plugins can be created with any compiler that supports "printf" like functions to stdout,
native c/cpp like sample file(interIconSelect) is included in folder tools/plugins/iisSample.7z.
For now only esc functions gfxwnd...(lookDown) are more or less used to set gfx object parameters.
Plugins must be put in tools/plugins folder and accessed with executable nameOnly.

[[ Plugins inter ]]
This are real plugins that can be a part of editor, right panel(Ctrl-p) or main window at any absolute position.
They can optionally be toggled with alt-0..9 keys. For more look tools/plugins/plugin-auto.ini.
Sample zz_misc/SUGCUppPlugin is for native/upp ver and zz_misc/SUGCPluginNoteW32 for w32

[[ Macros/tools ]]
Just click(orRClick) image only black button tool, it has a tooltip!
Check tools/usertools/ut-sample-tools.tool and ut-sample-macro.tool for more

[[ Parse-export func ]]
These file types are available for 'Export' cmd: *.all *.esc and *.tool
Parsing for *.all is done like so:
@cmd(eg:@tool,...) then
esc functions + @cmd(eg:@tool,...)(moreOrLessEscFuncsAreCalledInBetween-egForItems) + again esc functions.
This is not parsed as is seen, eg @tid... $<esc... , 1st all @... then all $<esc... <=butAllowsSomeStuff
It's 2xparse so escScripts with @... get's evaluated 1st! can be disabled(checkDown).
And returning escScript may include @... which is evaluated too, chk esc-params-call.txt.all and snippets/abbrev-exp.esc.
Options for *.all type of files:
   //:>                   <=mustBeAtStartOfFile,multiOpts are allowed with ',' and no spaces
   noExport               <=won't export, this is ignored when explicitly exporting with progParms
   noExpDlg               <=won't show export dialog
   noHdrTools             <=won't try to execute header tools(littleFaster)
   //upperAreOnlyFor'*.all'UsedByExport,thisDownIsAlowedAfterUpperInNewLine,alsoIn'*.tool'onSameLine
   noParseAtBeforeEsc     <=other+disablesParsing@InEscParamsSection so @... are possibly parsed in esc itself
                          <=parsing is then done without upper '@cmd(eg:@tool,...) then', that is without evaluating @... 1st.
                          <=if in *.tool - this must be before optional '\<<'
Options for *.esc type of files:
   //:>noParse <=mustBeAtStartOfFile,disablesParsing@(andOther)InEscFile so @... are parsed in caller(usually *.all) file
Options for *.tool
  are available in tools/usertools/ut-default-tools.tool

[[ Project/Sessing/layout open/save ]]
Alt saves with absolute path.
Prj/SesFiles: when saved with absPath(Alt), it's remembered, remove @tid-comment abspath; from file if relPath is desired again.
Prj/SesFiles: has info about it, can be edited with Shift+rightAboutKnob(whichAutoSavesPrj/Ses) - for more check About
Project: opens all editor files and gfx file
Session: whatever layout and project opens
Layout:  opens(sets) dmButtons+usertools
Watcom-compiling:
  *download and install watcom-v2(chk:envvars.7z) and adjust prjc-watcom.tool
  *make a project with files(eg main.cpp) and save all(chkConfigToIgnoreGfx)
  *Shift+click on AboutRightKnob and write at the end of possible info: \<<==CompileAll==>>(Enter)@tool "prjc-watcom" this>>=appconsole opts="-ot -d0";
  *check down in cmake for prjInfoCompilerFormat - CompileAll - All means '.all' format
CMake+ninja_compiling:
  CurrentlyForGcc,othersToo-yetToAddTool
  'tools/CMakeLists.txt.all' is used as template
  *download cmake(install) and ninja(copyItToCMakeDir),adjustToolPaths(prjc-cmakeninjagcc.tool)
  *make a project with files(eg main.cpp) and save all
  *click 'Generate CMakeNFile' from main menu, this will ask for
     +SesPrjInfoDlg: with-predefinedToolForGcc
     +CompilerName:  which compiler to use - with predefined tool for gcc
     +CompilerOpts:  compiler common options - with predefined tool for gcc
  Project info dialog can include as footer:
     \<<==Compile==>>input(format):toolOrExecutableFile(bat,...,endingWith'>'AsConsole)-looksIn(prjDir,toolsDir) newLine opts(sameOrMultiLine-allInQuotes); output:"cmdFile.xyz" "outputName(noExt)" "opts" prjFiles
     \<<==CompileAll==>> as '.all' format
  Clicking 'Export' calls only ninja by def when prjc-cmakeninjaXYZ.
  Use Menu->'GenerateCMakeNFile' when adding/deleting file from project to recreate CMakeLists.txt.
  Alt+Export(onPrjSes) deletes build directory.
  Ctrl(onPrjSes) bypasses project(compile) and default 'Export' of file is used.
  Note that for cmake... CMakeLists.txt should be adjusted for now for appgui/appdll
Files are saved on 'Export' and can be either with '.all' or without it(noPreprocessing).
Check tools/prjc-* for available options.

[[ End sectionS ]]


In About are command line switches

That's it!



simmxtools
  can be downloaded from
    https://ws-tools.000webhostapp.com



[[ Other stuff ]]
Extra esc keywords(everyReturnIsAsString,"atStartAndEndMeansIt'sRealString),'EscScripting.htm' for more:
  err(str)
  msgbox(str)
  str=input(text,title="Edit...",desc="")
  str=inputdbl(dbl,title="Edit...",desc="")
  dbl=dblinput(dbl,title="Edit...",desc="")
  vecStr=split(str,delimChOrStr,ignoreempty=0)    //vecStr=vector<string>, note that boolean is 0 and 1 - not false/true
  str=join(vecStr,delimStr);                      //vecStr=vector<string>
  str=mid(text,from,num)                          //from and num should be specified - this is internal version
  str=mid_ex(text,from,num=-pow(2,31))            //from:<0MeansFromEnd,num:-pow(2,31) means till end, eg mid(txt,-4) - note,from/num may be both negative
  remove(arr,from,num=-1)                         //-1=tillEnd
  str=hexstr(number,width=0,lpad="0",upper=0)     //convert from int64 to hexString
  //bool=exists(map,key)                          //is_void(map[key])
  str=stripquotes(str)                            //strip off starting/ending "(quotes)
  bool=getline(&str,&from,&line)
  int=find(text,find,from=0)                      //-1=notFound
  sleep(ms)                                       //just pause execution for milisec
  settimer(delayMs,intId=0)                       //timer(id)-optionalScriptFuncIsCalled: delayMs < 0 means periodic
  stoptimer(intId=0)                              //ifPeriodic: this should be always called when not needed any more
  str=cmd(progAndArgs,asConsole=0,detach=0)       //by def will wait cmd to finish, ret:void=err
  str=run(progAndArgs,asConsole=0,detach=1)       //by def will return immediately - without waiting to finish, ret:asEmptyStr,void=err
  
  addopenedit(fname)                                    //openFile(shift=inCodeEd) or open/save(shift) prj/ses/lay
  opengfx(fname,askIfModified=0)                        //--||--
  setusertools(name)                                    //anyToolsFrom'tools/usertools'dirWithNameOnly(noEndingPattern),eg: ut-default or dm-default
  uiselect(ui=3)                                        //ui=0..3(0=both,1editOnly,2=gfxOnly,3=none)
  embedapp(appfname,moveType=1,x=0,y=0,w=640,h=480)     //don'tUseForNow!appfname(""=clearAll),moveType(0=offAtAppWnd,1=offAfterMainButtons),negative(w/h)=from(Right/Bottom)frame; App should have only one main window
  
  txt=txttab(fn,tabind=-1)                              //fn(tabind(-1=cur)):0(nEditTabs),1(selTab),2(tabtype:1=codeEd,richEd,dllPlug,dllUppPlug),3(fname),4(nChars-codeEdOnly)
  txtsel(cursorFrom=-1,num=0)                           //-1(atEnd),num(-1=tillEnd)
  str=txtcopy()                                         //get text - use upperfn to select
  txtpaste(txt=0)                                       //paste text - use txtsel to set/select, with this to insert/overwrite/delete - txt==0 from clip
  gfxget(gfxtabind,str,itemind=-1,cfgFromSnippets="");  //gfxtabind=0..15, str: any $<>,eg $<num-items> or $<painter-bgclr> or when itemind is spec - $<pos.x> etc; cfgFromSnippets may be as snippets\html\aa-snipptypesettings.cfg <=this is def, you can spec another
  gfxseltab(ind=-1)                                     //-1(current,thisIsToSetFocusOnCanvas-ifItWasOnInputCtrlsOrText)
  gfxselitems(gfxtabind,itemIndOrIdFrom,itemIndOrIdTo=0)//itemIndOrIdFrom(negVals=numFromEnd) itemIndOrIdTo(0=1Item,-1=fromTillEnd,negativeValueRepresentNumItem)
  gfxwndMClick(ctrlItemName)                            //names are in gfxwnd-layout.ini
  gfxwndSetText(text)                                   //<= for gfx input ctrls
  sendkeys(text,keysDelay=0,finalDelay=0)               //<= keysDelay=50,finalDelay=100 are reasonable values when want to see writing
  str=$<esc{x=any; return any}>;                        //<= this can be done for any 'regular/static' $<> or @any; pre-parsing or
  str=$<esc{"script.esc"}>;                             //<= this can be done for any 'regular/static' $<> or @any; pre-parsing or
  str=@tid-str;                                         //<= this
  parse(str);                                           //parse any dynamically-whenThisCodeIsReached-butWithout@and;, eg parse("snippet \"html\index5.html\"");
  
  bool=fileexists(fname)                          //selfExplanatory
  bool=filecopy(src,dest)                         //dest may end with ".../dir/" so this can be used: filecopy("c:/files/main.txt","c:/backup/");
  bool=filedelete(fname)
  file=OpenFileIn(x)                              //methods: IsEof Get GetLine Close
  file=OpenFileOut(x)                             //methods: Put PutLine Close
  file=OpenFileAppend(x)                          //-||-

  gfxscript(filename="")                                 //ret(1=ok,0=err): "" clears or sample is 'ui-items-test.esc'
  uiGetItemProp(obj,prop)                                //for now: props should be defined like in ui-items-test.esc
  uiModeWH(wh=true)                                      //this is for all except uiPolygon - def=true
  uiGetItemProp(obj,prop,wh=true)                        //ret=prop
  uiLine(draw,x,y,x2,y2,fgClr,penSz)
  uiRect(draw,x,y,w,h,backClr,fgClr,fg2Clr,penSz)
  uiRndRect(draw,x,y,w,h,rnd,backClr,fgClr,fg2Clr,penSz)
  uiEllipse(draw,x,y,w,h,backClr,fgClr,fg2Clr,penSz)
  uiPolygon(draw,ptArr,backClr,fgClr=0x0,penSz=1)
  uiFontNew(fname,sz,bold=0,it=0,under=0,strike=0)       //ret(fnind,-1=err)
  uiFontFree(fnind)                                      //ret(1=ok,0=err)
  uiFontSet(fnind=-1,zoomable=true)                      //ret(1=ok,0=err)
  uiText(draw,x,y,str,clr=0x0,angle=0)
  uiTextSize(str,fnind=-1)                               //ret(szArr)
  uiImageNew(filename)                                   //ret(fnind,-1=err)
  uiImageFree(imgind)                                    //ret(1=ok,0=err)
  uiImage(draw,imgind,x,y,x2=-1,y2=-1,rcArr=[])          //rcArr [2 and 3] are always as wh
  uiRedraw(itemid=-1)                                    //itemId(-1=wholeCurrentTabArea): mostly for timer fn(not uiPaint)
  uiClip(draw,x,y,x2,y2)                                 //stackbased - can be used more than once
  uiFinish(draw)                                         //this must be always called after not needing uiClip anymore
  uiFreeGfxObjs()                                        //all previous created objects become invalid after this(alsoInternallyCalled)


SendKeys-keys:
  "NUMPAD7",  XK_KP_7,          "BACK",    XK_BackSpace, 
  "NUMPAD8",  XK_KP_8,          "TAB",     XK_Tab,
  "NUMPAD9",  XK_KP_9,          "RETURN",  XK_Return,
  "MULTIPLY", XK_KP_Multiply,   "SHIFT",   XK_Shift_Lock,
  "ADD",      XK_KP_Add,        "CONTROL", XK_Control_L,
  "SEPARATOR",XK_KP_Separator,  "MENU",    XK_Super_L,
  "SUBTRACT", XK_KP_Subtract,   "PAUSE",   XK_Pause,
  "DECIMAL",  XK_KP_Decimal,    /*"CAPITAL",VK_CAPITAL,*/
  "DIVIDE",   XK_KP_Divide,     "ESCAPE",  XK_Escape,
  "F1",       XK_F1,            "SPACE",   XK_KP_Space,
  "F2",       XK_F2,            "END",     XK_End,
  "F3",       XK_F3,            "HOME",    XK_Home,
  "F4",       XK_F4,            "LEFT",    XK_Left,
  "F5",       XK_F5,            "UP",      XK_Up,
  "F6",       XK_F6,            "RIGHT",   XK_Right,
  "F7",       XK_F7,            "DOWN",    XK_Down,
  "F8",       XK_F8,            "PRINT",   XK_Sys_Req,
  "F9",       XK_F9,            /*"SNAPSHOT",VK_SNAPSHOT,*/
  "F10",      XK_F10,           "INSERT",  XK_Insert,
  "F11",      XK_F11,           "DELETE",  XK_Delete,
  "F12",      XK_F12,           "LWIN",    XK_Meta_L,
  "NUMLOCK",  XK_Num_Lock,      "RWIN",    XK_Meta_R,
  "SCROLL",   XK_Scroll_Lock,   "NUMPAD0", XK_KP_0,
  "LSHIFT",   XK_Shift_L,       "NUMPAD1", XK_KP_1,
  "RSHIFT",   XK_Shift_R,       "NUMPAD2", XK_KP_2,
  "LCONTROL", XK_Control_L,     "NUMPAD3", XK_KP_3,
  "RCONTROL", XK_Control_R,     "NUMPAD4", XK_KP_4,
  "LMENU",    XK_Super_L,       "NUMPAD5", XK_KP_5,
  "RMENU",    XK_Super_R,       "NUMPAD6", XK_KP_6,
  "PGUP",     XK_Page_Up,       "PGDOWN",  XK_Page_Down,
  "CAPSLOCK", XK_Caps_Lock,     "BACKSPACE",XK_BackSpace


InternalImages that can be used in *.tool as image
but combined with preimage,eg: simmximg:or0
simmximg are(tool/images/inter-simmximg.jpg):
sun_icon
sun_icon128
fire_icon
fire_icon128
cd temp bluehat bluesmile cdgalaxy_icon16 cdgalaxy_icon24 leaf_icon16 leaf_icon24 textclr
or0 or1 or2 or3
qb qbh qbp qbd
qr qrh qrp qrd
B Bh Bp Bd
S0 S0h S0p S0d
EBp
EBd
SB SBh SBp SBd
SBHT SBHTh SBHTp SBHTd
SBVT SBVTh SBVTp SBVTd
OkB OkBh OkBp OkBd
OBlack SBlack kDA kUA kLA kRA kSpU kSpD DA UA LA RA SpU SpD
--
CtrlImg are(tools/plugins/iconInterSelect_icons.jpg):
arrow exclamation information question error smallcheck smallup smalldown smallleft smallright spinup3 spinup2 spinup spindown3 spindown2 spindown
reporticon smallreporticon ibeam0 HandCursor HelpCursor0 HelpCursor1 write open save save_as print new_doc menu_window undo redo select_all
cut copy paste_vert paste sort remove menu_check menu_radio right_arrow white_right_arrow check white_check left_arrow white_left_arrow cross
up_arrow down_arrow plus selection MkDir Dir DirUp File Plus Minus Toggle Share CdRom Hd Diskette Computer Flash Network Group Var Home
MenuCheck1 MenuCheck0 Empty16x16 MenuRadio0 MenuRadio1 set_transparent wheel_cursor white_wheel_cursor column_cursor swap_color_cursor
fetch_color fetch_color_cursor tab_wheel hthumb hthumb1 vthumb vthumb1 treeplus tree0 tree1 tree2 treeminus Add Remove SmallDown SmallUp
SmallRight SmallLeft go_back go_forward font_size help focus_h focus_v checkers SmallDot SmallDotH BigDot BigDotH Bg SortUp SortDown color_edit
--
CtrlsImg are(tool/images/CtrlsImg.jpg):
B Bh Bp Bd
EB EBh EBp EBd
SB SBh SBp SBd
SBHT SBHTh SBHTp SBHTd
SBVT SBVTh SBVTp SBVTd
OkB OkBh OkBp OkBd
kDA kUA kLA kRA kSpU kSpD DA UA LA RA SpU SpD