00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00076
00077
00078
00079 var iG2DDEFAULTBACKGROUNDCOLOR=0x373737;
00080 var iG2DDEFAULTFONTCOLOR=0x0;
00081 var iG2DDEFAULTFRAMEFONTCOLOR=0xffffff;
00082
00083 var iG2DDEFAULTMODULEEDITORBGCOLOR=0x7d7d7d;
00084 var iG2DDEFAULTMODULEEDITORDOTCOLOR=0xffffff;
00085 var iG2DDEFAULTMODULEEDITORBOXBORDEROFFCOLOR=0xeeeeee;
00086 var iG2DDEFAULTMODULEEDITORBOXBORDERONCOLOR=0xffffff;
00087 var iG2DDEFAULTMODULEEDITORBOXOFFCOLOR=0x373737;
00088 var iG2DDEFAULTMODULEEDITORBOXONCOLOR=0x888888;
00089 var iG2DDEFAULTMODULEEDITORBOXTEXTONCOLOR=0xffffff;
00090 var iG2DDEFAULTMODULEEDITORBOXTEXTOFFCOLOR=0xeeeeee;
00091 var iG2DDEFAULTMODULEEDITORLINKOFFCOLOR=0xaaaaaa;
00092 var iG2DDEFAULTMODULEEDITORLINKONCOLOR=0xffffff;
00093 var iG2DDEFAULTMODULEEDITORROUNDLINKSIZE=24;
00094 var iG2DDEFAULTMODULEEDITORBORDERWIDTH=1;
00095
00096 var sG2DDEFAULTRESOURCESPATH="tools/os3dlib/res/";
00097
00098 var sG2DHSIZECURSOR="valuesupdown_cursor.bmp";
00099 var sG2DHCOLORPICKERCURSOR="colorpicker_cursor.bmp";
00100
00101 var sG2DDEFAULTCHKTAB="edit/chktab.png";
00102 var sG2DDEFAULTCLOSETAB="edit/btnclosetab.png";
00103 var sG2DDEFAULTBTNTABLEFT="edit/btnleft.png";
00104 var sG2DDEFAULTBTNTABRIGHT="edit/btnright.png";
00105 var sG2DDEFAULTBTNVALUP="edit/btnup.png";
00106 var sG2DDEFAULTBTNVALDOWN="edit/btndown.png";
00107 var sG2DDEFAULTBTNCOLORPICKER="edit/btncolorpicker.png";
00108
00109 var sG2DDEFAULTCHKFRAMEFOLD="edit/chkframeminmax.png";
00110
00111 var sG2DCOLORMAP="edit/work.png";
00112 var sG2DCOLORMAPCROSS="edit/cross.png";
00113
00114
00115
00116
00117
00118 struct EdTheme{
00119
00120 EDT_channel (Chn);
00121 EDT_iToolBarColor (I);
00122 EDT_lAlphaResources ([[S AlphaBitmap] r1]);
00123
00124 EDT_cursorColorPicker (ObjCursor);
00125 EDT_sColorMap (S);
00126 EDT_abmpColorMapCross (AlphaBitmap);
00127 EDT_abmpColorMapPickerBtn (AlphaBitmap);
00128
00129 EDT_iTabBarColor (I);
00130 EDT_abmpTabCheck (AlphaBitmap);
00131 EDT_abmpTabClose (AlphaBitmap);
00132 EDT_abmpTabLeft (AlphaBitmap);
00133 EDT_abmpTabRight (AlphaBitmap);
00134 EDT_fontTab (ObjFont);
00135 EDT_iTabFontColor (I);
00136
00137 EDT_cursorSize (ObjCursor);
00138 EDT_abmpValUp (AlphaBitmap);
00139 EDT_abmpValDown (AlphaBitmap);
00140
00141 EDT_abmpFrameFold (AlphaBitmap);
00142 EDT_sFrameFontName (S);
00143 EDT_iFrameFontSize (I);
00144 EDT_iFrameFontColor (I);
00145 EDT_iFrameBarColor (I);
00146 EDT_iFrameBarHeight (I);
00147
00148 EDT_fontToolTip (ObjFont);
00149
00150 EDT_fontModuleEditor (ObjFont);
00151 EDT_iModuleEditorBg (I);
00152 EDT_iModuleEditorDot (I);
00153 EDT_iModuleEditorBoxOff (I);
00154 EDT_iModuleEditorBoxOn (I);
00155 EDT_iModuleEditorBoxTextOff (I);
00156 EDT_iModuleEditorBoxTextOn (I);
00157 EDT_iModuleEditorLinkOff (I);
00158 EDT_iModuleEditorLinkOn (I);
00159 EDT_iModuleEditorRLinkSize (I);
00160 EDT_iModuleEditorBorderWidth (I);
00161 EDT_iModuleEditorBoxBorderOff (I);
00162 EDT_iModuleEditorBoxBorderOn (I
00163
00164 );
00165 };
00166 typedef struct mkEdTheme EdTheme;
00167
00168
00169 typeof EdDefaultTheme=EdTheme;
00170
00171
00172 struct EdTreeItem{
00173
00174 EDTITEM_item (ObjTreeItem);
00175 EDTITEM_sLabel (S);
00176 EDTITEM_sValue (S);
00177 EDTITEM_iType (I);
00178 EDTITEM_father (EdTreeItem);
00179 EDTITEM_bmpIdx (BitmapIndex);
00180 EDTITEM_lSons ([EdTreeItem r1]
00181
00182 );
00183 };
00184 typedef struct mkEdTreeItem EdTreeItem;
00185
00186
00187 struct EdControl{
00188
00189 EDC_channel (Chn);
00190 EDC_father (EdWindow);
00191 EDC_resizeFlag (I);
00192 EDC_theme (EdTheme);
00193 EDC_coords ([I I I I I I]);
00194 EDC_label (ObjText);
00195 EDC_text (ObjText);
00196 EDC_editText (ObjText);
00197 EDC_editLine (ObjText);
00198 EDC_editFloat ([ObjText ObjContainer CompRollOver CompRollOver F F F I I ObjCursor I fun [EdControl F] I fun [EdControl F] I]);
00199 EDC_button (ObjButton);
00200 EDC_colorButton ([ObjButton ObjBitmap EdWindow I I fun[EdControl I] I]);
00201 EDC_check (ObjCheck);
00202 EDC_list ([ObjList [[I [S [[S r1] I]]] r1]]);
00203 EDC_tree ([ObjTree [[[ObjTreeItem EdTreeItem] r1] [[S EdTreeItem] r1] ObjBitmapList [[S BitmapIndex] r1]] EdTreeItem EdTreeItem fun [EdControl EdTreeItem EdTreeItem S I] I]);
00204 EDC_bitmap ([ObjContainer AlphaBitmap CompBitmap S I]);
00205 EDC_select (ObjBox);
00206 EDC_bitmapList ([ObjContainer I I I [[I [AlphaBitmap CompBitmap CompBitmap S S]] r1] fun [EdControl S I I] I fun [EdControl S I I] I]);
00207 EDC_modulesEditor (EdModuleEditor);
00208 EDC_view3d (V3Dview
00209
00210 );
00211 };
00212 typedef struct mkEdControl EdControl;
00213
00214
00215 struct EdModuleEditor{
00216
00217 EDM_channel (Chn);
00218 EDM_winScroll (EdWindow);
00219 EDM_winDmi (EdWindow);
00220 EDM_bmpBack (EdControl);
00221 EDM_cont (ObjContainer);
00222 EDM_abmpLinks (AlphaBitmap);
00223 EDM_bmpLinks (CompBitmap);
00224 EDM_node (ObjNode);
00225 EDM_iSnap (I);
00226 EDM_iBoxMode (I);
00227 EDM_moveCoords ([I I]);
00228 EDM_sizeSurface ([I I]);
00229 EDM_iLinkMode (I);
00230 EDM_iLinkInfos ([S r1]);
00231 EDM_selectedBox ([EdModuleBox r1]);
00232 EDM_mnuBox (EdModuleBox);
00233 EDM_selectedRoundLink (EdModuleRoundLink);
00234 EDM_lBox ([[S EdModuleBox] r1]);
00235 EDM_lLinks ([EdModuleLink r1]);
00236 EDM_lRoundLinks ([EdModuleRoundLink r1]);
00237 EDM_cbRoundLinkClick (fun [EdControl EdModuleRoundLink I I] I);
00238 EDM_cbRoundLinkUnClick (fun [EdControl EdModuleRoundLink I I] I);
00239 EDM_cbRoundLinkDbClick (fun [EdControl EdModuleRoundLink I I] I);
00240 EDM_cbRoundLinkDestroy (fun [EdControl EdModuleRoundLink] I);
00241 EDM_cbRoundLinkUpdate (fun [EdControl EdModuleRoundLink] I);
00242 EDM_cbBoxSelect (fun [EdControl EdModuleBox] I);
00243 EDM_cbBoxClick (fun [EdControl EdModuleBox I I] I);
00244 EDM_cbBoxUnClick (fun [EdControl EdModuleBox I I] I);
00245 EDM_cbBoxDbClick (fun [EdControl EdModuleBox I I] I);
00246 EDM_cbBoxMove (fun [EdControl EdModuleBox I I] I);
00247 EDM_cbBoxMenu (fun [EdControl EdModuleBox [S r1] [S r1]] I);
00248 EDM_cbClick (fun [EdControl I I I I] I);
00249 EDM_cbUnClick (fun [EdControl I I I I] I);
00250 EDM_cbDbClick (fun [EdControl I I I I] I);
00251 EDM_cbKeyDown (fun [EdControl I I] I);
00252 EDM_cbKeyUp (fun [EdControl I] I
00253
00254 );
00255 };
00256 typedef struct mkEdModuleEditor EdModuleEditor;
00257
00258
00259 struct EdModuleBox{
00260
00261 EDB_father (EdModuleEditor);
00262 EDB_sName (S);
00263 EDB_lParams ([S r1]);
00264 EDB_compBmp (CompBitmap);
00265 EDB_alphaBmp (AlphaBitmap);
00266 EDB_bmpOn (ObjBitmap);
00267 EDB_bmpOff (ObjBitmap);
00268 EDB_node (ObjNode);
00269 EDB_pos ([I I]);
00270 EDB_bHasMoved (I);
00271 EDB_iKeybState (I);
00272 EDB_iWidth (I);
00273 EDB_iHeight (I);
00274 EDB_lMenus ([[I [[S r1] r1]] r1]);
00275 EDB_tooltip ([ObjContainer CompText]);
00276 EDB_iFlags (I);
00277 EDB_bState (I
00278
00279 );
00280 };
00281 typedef struct mkEdModuleBox EdModuleBox;
00282
00283
00284 struct EdModuleRoundLink{
00285
00286 EDRL_srcModuleBox (EdModuleBox);
00287 EDRL_dstModuleBox (EdModuleBox);
00288 EDRL_lLinks ([EdModuleLink r1]);
00289 EDRL_compBmp (CompBitmap);
00290 EDRL_alphaBmp (AlphaBitmap);
00291 EDRL_bmpOn (ObjBitmap);
00292 EDRL_bmpOff (ObjBitmap);
00293 EDRL_node (ObjNode);
00294 EDRL_tooltip ([ObjContainer CompText]);
00295 EDRL_iFlag (I);
00296 EDRL_bState (I
00297
00298 );
00299 };
00300 typedef struct mkEdModuleRoundLink EdModuleRoundLink;
00301
00302
00303 struct EdModuleLink{
00304
00305 EDL_srcModuleBox (EdModuleBox);
00306 EDL_dstModuleBox (EdModuleBox);
00307 EDL_lParams ([S r1]);
00308 EDL_sParams (S);
00309
00310 EDL_bState (I
00311
00312 );
00313 };
00314 typedef struct mkEdModuleLink EdModuleLink;
00315
00316
00317 struct EdWindow{
00318
00319 EDW_channel (Chn);
00320 EDW_father (EdWindow);
00321 EDW_fatherWin (ObjWin);
00322 EDW_lSons ([EdWindow r1]);
00323 EDW_win (ObjWin);
00324 EDW_virtualWin (ObjWin);
00325 EDW_bIsAx (I);
00326 EDW_lToolbar ([EdToolBar r1]);
00327 EDW_resizeFlag (I);
00328 EDW_bMinimize (I);
00329 EDW_tMdecal ([I I]);
00330 EDW_coords ([I I I I I I]);
00331 EDW_tLastCursorPos ([I I]);
00332 EDW_modeFlag (I);
00333 EDW_bVisible (I);
00334 EDW_lControl ([EdControl r1]);
00335 EDW_cbSize (fun [EdWindow I I] I);
00336 EDW_cbMove (fun [EdWindow I I] I);
00337 EDW_cbVirtualSize (fun [EdWindow I I] I);
00338 EDW_cbVirtualMove (fun [EdWindow I I] I);
00339 EDW_cbDestroy (fun [EdWindow] I);
00340 EDW_cbClose (fun [EdWindow] I);
00341 EDW_cbKeyDown (fun [EdWindow I I] I);
00342 EDW_cbKeyUp (fun [EdWindow I] I);
00343 EDW_cbDrop (fun [EdWindow I I [P r1]] I
00344
00345 );
00346 };
00347 typedef struct mkEdWindow EdWindow;
00348
00349
00355 var EDWIN_RESIZE_NONE=0;
00356 var EDWIN_RESIZE_LW=1;
00357 var EDWIN_RESIZE_MW=2;
00358 var EDWIN_RESIZE_RW=4;
00359 var EDWIN_RESIZE_LH=8;
00360 var EDWIN_RESIZE_MH=16;
00361 var EDWIN_RESIZE_RH=32;
00362 var EDWIN_RESIZE_ALL=64;
00371 var EDWIN_DIALOG=1;
00372 var EDWIN_POPUP=2;
00373 var EDWIN_FRAME=4;
00374 var EDWIN_GROUP=8;
00375 var EDWIN_TAB=16;
00376 var EDWIN_MODAL=32;
00380 proto crEdWindow=fun [Chn EdWindow I I I I I I I S] EdWindow;
00381 proto dsEdWindow=fun [EdWindow] I;
00382 proto resizeEdWindowVirtualSize=fun [EdWindow] I;
00383 proto getEdWindowToolBarSize=fun [EdWindow] [I I];
00384 proto setEdWindowVisible=fun [EdWindow I] I;
00385 proto dsEdWindowCtrlList=fun [[EdControl r1]] I;
00386
00387
00388 struct EdToolBar{
00389
00390 ETB_channel (Chn);
00391 ETB_win (ObjWin);
00392 ETB_cont (ObjContainer);
00393 ETB_pos ([I I]);
00394 ETB_size ([I I]);
00395 ETB_modeflag (I);
00396 ETB_iBgColor (I);
00397 ETB_iHmargin (I);
00398 ETB_iVmargin (I);
00399 ETB_iCurrentLpos (I);
00400 ETB_iCurrentRpos (I);
00401 ETB_iCurrentTpos (I);
00402 ETB_iCurrentBpos (I);
00403 ETB_lButton ([CompRollOver r1]);
00404 ETB_lBmp ([CompBitmap r1]);
00405 ETB_lCheck ([CompCheck r1]);
00406 ETB_lText ([[CompText ObjFont] r1]);
00407 ETB_tabBar (EdTabBar);
00408 ETB_lTooltip ([[ObjNode [ObjContainer CompText]] r1]);
00409 ETB_lControl ([[ObjNode I] r1]);
00410 ETB_fontTooltip (ObjFont);
00411 ETB_bVisible (I
00412
00413 );
00414 };
00415 typedef struct mkEdToolBar EdToolBar;
00416
00417
00418 var ETB_HORIZONTAL=1;
00419 var ETB_VERTICAL=2;
00420
00421 var ETB_ALIGN_LEFT=1;
00422 var ETB_ALIGN_RIGHT=2;
00423 var ETB_ALIGN_TOP=4;
00424 var ETB_ALIGN_BOTTOM=8;
00425
00426
00427 struct EdTabBar{
00428
00429 ETABBAR_channel (Chn);
00430 ETABBAR_cont (ObjContainer);
00431 ETABBAR_node (ObjNode);
00432 ETABBAR_targetWin (EdWindow);
00433 ETABBAR_iHeight (I);
00434 ETABBAR_pos ([I I]);
00435 ETABBAR_size ([I I]);
00436 ETABBAR_rightPos (I);
00437 ETABBAR_iMargin (I);
00438 ETABBAR_iCurrentLpos (I);
00439 ETABBAR_lTab ([EdTab r1]);
00440 ETABBAR_theme (EdTheme);
00441 ETABBAR_lastTab (EdTab);
00442 ETABBAR_currentTab (EdTab);
00443 ETABBAR_contScroll (ObjContainer);
00444 ETABBAR_btnScrollL (CompRollOver);
00445 ETABBAR_btnScrollR (CompRollOver);
00446 ETABBAR_iScrollPos (I
00447
00448 );
00449 };
00450 typedef struct mkEdTabBar EdTabBar;
00451
00452
00453 struct EdTab{
00454
00455 ETAB_channel (Chn);
00456 ETAB_tabBar (EdTabBar);
00457 ETAB_abmpTab (AlphaBitmap);
00458 ETAB_sName (S);
00459 ETAB_win (EdWindow);
00460 ETAB_chk (CompCheck);
00461 ETAB_closeBtn (CompRollOver);
00462
00463 ETAB_cbShow (fun [EdTab] I);
00464 ETAB_cbHide (fun [EdTab] I);
00465 ETAB_cbFocused (fun [EdTab] I);
00466 ETAB_cbClosed (fun [EdTab] I);
00467 ETAB_modeFlag (I);
00468 ETAB_bState (I
00469
00470 );
00471 };
00472 typedef struct mkEdTab EdTab;
00473
00474 proto focusEdTab=fun [EdTabBar EdTab] I;
00475 proto dsEdTab=fun [EdTabBar EdTab] I;
00476
00477 var ETAB_CLOSEBTN=1;
00478
00479
00480
00481
00482
00491 G2Drgba2bgra(c){
00492 let get_rgba c -> [r g b a] in
00493 make_rgba b g r a;
00494 }
00495
00496
00506 G2DgetAplhaFromColor(c){
00507 let get_rgba c -> [r g b a] in
00508 a;
00509 }
00510
00511
00521 G2Dbgra2bgr(c){
00522 let get_rgba c -> [b g r a] in
00523 make_rgb b g r ;
00524 }
00525
00526
00536 G2Drgba2rgb(c){
00537 let get_rgba c -> [r g b a] in
00538 make_rgb r g b ;
00539 }
00540
00541
00552 G2Dbgr2bgra(c, a){
00553 let c & 255 -> b in
00554 let (c>>8) & 255 -> g in
00555 let (c>>16) & 255 -> r in
00556 make_rgba b g r a;
00557 }
00558
00559
00570 G2Drgb2rgba(c, a){
00571 let c & 255 -> r in
00572 let (c>>8) & 255 -> g in
00573 let (c>>16) & 255 -> b in
00574 make_rgba r g b a;
00575 }
00576
00577
00587 G2Drgb2bgr(c){
00588 let c & 255 -> r in
00589 let (c>>8) & 255 -> g in
00590 let (c>>16) & 255 -> b in
00591 make_rgb b g r;
00592 }
00593
00594
00604 G2Dgetbgr(c){
00605 if c == nil then
00606 [0 0 0]
00607 else
00608 [(c>>16)&255 (c>>8)&255 c&255];
00609 }
00610
00611
00621 G2Dgetrgb(c){
00622 if c == nil then
00623 [0 0 0]
00624 else
00625 [c&255 (c>>8)&255 (c>>16)&255];
00626 }
00627
00628
00640 G2Dhsv2rgb(h, s, v){
00641
00642 set v= v*.itof 255;
00643 if s==itof 0
00644 then
00645 (ftoi v)+((ftoi v)<<8)+((ftoi v)<<16)
00646 else
00647 {
00648 while h >=. itof 360 do set h = h -. itof 360;
00649 while h <. itof 0 do set h = h +. itof 360;
00650 set h = h /. itof 60;
00651
00652 let ftoi h -> i in
00653 let h -. itof i -> f in
00654 let v *. ((itof 1) -. s) -> p in
00655 let v *. ((itof 1) -. s *. f) -> q in
00656 let v *. ((itof 1) -. s *. ((itof 1) -. f)) -> t in
00657 if i==0
00658 then
00659 (ftoi v)+((ftoi t)<<8)+((ftoi p)<<16)
00660 else if i==1
00661 then
00662 (ftoi q)+((ftoi v)<<8)+((ftoi p)<<16)
00663 else if i==2
00664 then
00665 (ftoi p)+((ftoi v)<<8)+((ftoi t)<<16)
00666 else if i==3
00667 then
00668 (ftoi p)+((ftoi q)<<8)+((ftoi v)<<16)
00669 else if i==4
00670 then
00671 (ftoi t)+((ftoi p)<<8)+((ftoi v)<<16)
00672 else if i==5
00673 then
00674 (ftoi v)+((ftoi p)<<8)+((ftoi q)<<16)
00675 else
00676 nil
00677 };
00678 }
00679
00680
00690 G2Drgb2hsv(c){
00691
00692 let (c>>16) & 255 -> b in
00693 let (c>>8) & 255 -> g in
00694 let c & 255 -> r in
00695 let
00696 if r>g
00697 then
00698 if b>r
00699 then
00700 b
00701 else
00702 r
00703 else
00704 if b>g
00705 then
00706 b
00707 else
00708 g
00709 -> mx in
00710 let
00711 if r<g
00712 then
00713 if b<r
00714 then
00715 b
00716 else
00717 r
00718 else
00719 if b<g
00720 then
00721 b
00722 else
00723 g
00724 -> mn in
00725 let itof mx-mn -> delta in
00726 let
00727 if mx==0
00728 then
00729 itof 0
00730 else
00731 (itof mx-mn) /. itof mx
00732 -> s in
00733 let
00734 if (s>.itof 0) || (s<.itof 0) || (delta>.itof 0) || (delta<.itof 0)
00735 then
00736 (itof 60) *.
00737 if r==mx
00738 then
00739 (itof g-b)/.delta
00740 else if g==mx
00741 then
00742 (itof 2)+.(itof b-r)/.delta
00743 else (itof 4)+.(itof r-g)/.delta
00744 else
00745 itof 0
00746 -> h in
00747 [
00748
00749 if h<.itof 0 then h+.itof 360 else h
00750
00751 s
00752
00753 (itof mx)/.itof 255
00754 ];
00755 }
00756
00757
00767 G2DgetFtoA(float, nb){
00768 let if float == nil then 0.0 else float -> float in
00769 let ftoa float -> sf in
00770 let if nb == 0 || nb == nil then 0 else 1 + nb -> nb0 in
00771 substr sf 0 ((strfind "." sf 0) + nb0);
00772 }
00773
00774
00784 G2Dlcat(p, q){
00785 if p==nil
00786 then
00787 q
00788 else let p -> [h nxt] in
00789 h::G2Dlcat nxt q;
00790 }
00791
00792
00802 G2DisInList(p, q){
00803 if p==nil
00804 then
00805 0
00806 else let p -> [h nxt] in
00807 if h == q then
00808 1
00809 else G2DisInList nxt q;
00810 }
00811
00812
00822 G2DremoveFromList(l, elt){
00823 if l==nil
00824 then
00825 nil
00826 else
00827 let hd l -> elm in
00828 if elm == elt then
00829 tl l
00830 else
00831 (hd l)::G2DremoveFromList tl l elt;
00832 }
00833
00834
00844 G2DremoveStringFromList(l, elt){
00845 if l==nil
00846 then
00847 nil
00848 else
00849 let hd l -> elm in
00850 if !strcmpi elm elt then
00851 tl l
00852 else
00853 (hd l)::G2DremoveStringFromList tl l elt;
00854 }
00855
00856
00866 G2DremoveEdIdxFromList(l, idx){
00867 if l==nil
00868 then
00869 nil
00870 else
00871 let hd l -> [id _] in
00872 if id == idx then
00873 tl l
00874 else
00875 (hd l)::G2DremoveEdIdxFromList tl l idx;
00876 }
00877
00878
00888 G2DremoveEdSidFromList(l, sid){
00889 if l==nil
00890 then
00891 nil
00892 else
00893 let hd l -> [id _] in
00894 if (!strcmp id sid) then
00895 tl l
00896 else
00897 (hd l)::G2DremoveEdSidFromList tl l sid;
00898 }
00899
00900
00910 G2DremoveEdSidFromListi(l, sid){
00911 if l==nil
00912 then
00913 nil
00914 else
00915 let hd l -> [id _] in
00916 if (!strcmpi id sid) then
00917 tl l
00918 else
00919 (hd l)::G2DremoveEdSidFromListi tl l sid;
00920 }
00921
00922
00932 G2DgetElemFromListByIndex(l, idx){
00933 if l==nil
00934 then
00935 nil
00936 else
00937 let hd l -> [id _] in
00938 if idx == id then
00939 hd l
00940 else
00941 G2DgetElemFromListByIndex tl l idx
00942 ;
00943 }
00944
00945
00955 G2DgetStrWidth(font,str){
00956 let _GETstringSize font str-> [width _] in
00957 width
00958 ;
00959 }
00960
00961
00974 G2DgetStringSize2(font, txtList, w, h){
00975 if txtList == nil then [w+1 h]
00976 else let txtList -> [first next] in
00977 let _GETstringSize font first -> [nw nh] in
00978 G2DgetStringSize2 font next (if nw>w then nw else w) (nh+h)
00979 ;
00980 }
00981
00982
00992 G2DgetStringSize(font, str){
00993 G2DgetStringSize2 font (lineextr str) 0 0;
00994 }
00995
00996
01008 G2DgetAbreviation(str,size,font,endstr){
01009 if (G2DgetStrWidth font str) <= size then
01010 [(G2DgetStrWidth font str) str]
01011 else
01012 G2DgetAbreviation (strcat (substr str 0 ((strlen str)-4)) endstr) size font endstr
01013 ;
01014 }
01015
01016
01034 G2DcreateAlphaBitmap(alphabmp, x, y, left, right, ww, hh, w, h){
01035 let _GETalphaBitmapSize alphabmp -> [aw ah] in
01036 if aw == w && ah == h then
01037 alphabmp
01038 else
01039 let _GETalphaBitmaps alphabmp -> [_ bmpalpha] in
01040 let _FILLbitmap _CRbitmap _channel w h 0 -> bmp in
01041 let _FILLbitmap8 _CRbitmap8 _channel w h 0 -> bmp8 in
01042 (
01043
01044 _CPalphaBitmap bmp left 0 alphabmp x y ww+x hh+y ;
01045 _CPalphaBitmap bmp left h-hh alphabmp x y+hh ww+x hh+y ;
01046 _CPalphaBitmap bmp w-(ww+right) 0 alphabmp aw-(ww+x) y ww+x hh+y ;
01047 _CPalphaBitmap bmp w-(ww+right) h-hh alphabmp aw-(ww+x) y+hh ww+x hh+y ;
01048
01049 _SCPalphaBitmap bmp left hh-1 ww+left-1 h-hh alphabmp x hh+y ww+x hh+y ;
01050 _SCPalphaBitmap bmp w-(ww+right) hh w-(right+1) h-hh alphabmp aw-ww+x hh+y aw-1+x hh+y ;
01051 _SCPalphaBitmap bmp ww-1+left 0 w-(ww+right) hh-1 alphabmp ww+x y ww+x hh+y ;
01052 _SCPalphaBitmap bmp ww+left-1 h-hh w-(ww+right) h-1 alphabmp ww+x ah-(hh+y) ww+x ah-(1+y) ;
01053 _SCPalphaBitmap bmp ww+left-1 hh-1 w-(ww+right) h-hh alphabmp ww+x hh+y ww+x hh+y ;
01054
01055
01056
01057 _CPbitmap8 bmp8 left 0 bmpalpha x y ww+x hh+y nil;
01058 _CPbitmap8 bmp8 left h-hh bmpalpha x y+hh ww+x hh+y nil;
01059 _CPbitmap8 bmp8 w-(ww+right) 0 bmpalpha aw-(ww+x) y ww+x hh+y nil;
01060 _CPbitmap8 bmp8 w-(ww+right) h-hh bmpalpha aw-(ww+x) y+hh ww+x hh+y nil;
01061
01062 _SCPbitmap8 bmp8 left hh-1 ww+left-1 h-hh bmpalpha x hh+y ww+x hh+y nil;
01063 _SCPbitmap8 bmp8 w-(ww+right) hh w-(right+1) h-hh bmpalpha aw-ww+x hh+y aw-1+x hh+y nil;
01064 _SCPbitmap8 bmp8 ww-1+left 0 w-(ww+right) hh-1 bmpalpha ww+x y ww+x hh+y nil;
01065 _SCPbitmap8 bmp8 ww+left-1 h-hh w-(ww+right) h-1 bmpalpha ww+x ah-(hh+y) ww+x ah-(1+y) nil;
01066 _SCPbitmap8 bmp8 ww+left-1 hh-1 w-(ww+right) h-hh bmpalpha ww+x hh+y ww+x hh+y nil;
01067
01068 let _CRalphaBitmap _channel bmp bmp8 nil nil -> nalphabmp in
01069 (
01070 _DSalphaBitmap alphabmp ;
01071 _DSbitmap bmp ;
01072 _DSbitmap8 bmp8 ;
01073 nalphabmp
01074 ) ;
01075 );
01076 }
01077
01078
01096 G2DcreateAlphaBitmapRollover(alphabmp, x, y, left, right, ww, hh, w, h){
01097 let _GETalphaBitmapSize alphabmp -> [aw ah] in
01098 let ah / 5 -> bmph in
01099
01100 let _FILLbitmap _CRbitmap _channel w h nil -> bmp in
01101 let _FILLbitmap8 _CRbitmap8 _channel w h nil -> bmp8 in
01102 let _GETalphaBitmaps alphabmp -> [_ bmpalpha8] in
01103 (
01104
01105 _CPalphaBitmap bmp left 0 alphabmp x y ww+x hh+y ;
01106 _CPalphaBitmap bmp left h-hh alphabmp x y+bmph-hh ww+x hh+y ;
01107 _CPalphaBitmap bmp w-(ww+right) 0 alphabmp aw-(ww+x) y ww+x hh+y ;
01108 _CPalphaBitmap bmp w-(ww+right) h-hh alphabmp aw-(ww+x) y+bmph-hh ww+x hh+y ;
01109
01110
01111 _SCPalphaBitmap bmp left hh-1 ww+left-1 h-hh alphabmp x hh+y ww+x hh+y ;
01112 _SCPalphaBitmap bmp w-(ww+right) hh w-(right+1) h-hh alphabmp aw-ww+x hh+y aw-1+x hh+y ;
01113 _SCPalphaBitmap bmp ww-1+left 0 w-(ww+right) hh-1 alphabmp ww+x y aw-(ww+x) hh+y ;
01114 _SCPalphaBitmap bmp ww+left-1 h-hh w-(ww+right) h-1 alphabmp ww+x y+bmph-hh aw-(ww+x) y+bmph ;
01115 _SCPalphaBitmap bmp ww+left-1 hh-1 w-(ww+right) h-hh alphabmp ww+x hh+y aw-(ww+x) hh+y ;
01116
01117
01118
01119 _CPbitmap8 bmp8 left 0 bmpalpha8 x y ww+x hh+y nil;
01120 _CPbitmap8 bmp8 left h-hh bmpalpha8 x y+bmph-hh ww+x hh+y nil;
01121 _CPbitmap8 bmp8 w-(ww+right) 0 bmpalpha8 aw-(ww+x) y ww+x hh+y nil;
01122 _CPbitmap8 bmp8 w-(ww+right) h-hh bmpalpha8 aw-(ww+x) y+bmph-hh ww+x hh+y nil;
01123
01124
01125 _SCPbitmap8 bmp8 left hh-1 ww+left-1 h-hh bmpalpha8 x hh+y ww+x hh+y nil;
01126 _SCPbitmap8 bmp8 w-(ww+right) hh w-(right+1) h-hh bmpalpha8 aw-ww+x hh+y aw-1+x hh+y nil;
01127 _SCPbitmap8 bmp8 ww-1+left 0 w-(ww+right) hh-1 bmpalpha8 ww+x y aw-(ww+x) hh+y nil;
01128 _SCPbitmap8 bmp8 ww+left-1 h-hh w-(ww+right) h-1 bmpalpha8 ww+x y+bmph-hh aw-(ww+x) y+bmph nil;
01129 _SCPbitmap8 bmp8 ww+left-1 hh-1 w-(ww+right) h-hh bmpalpha8 ww+x hh+y aw-(ww+x) hh+y nil;
01130
01131 let _CRalphaBitmap _channel bmp bmp8 nil nil -> nalphabmp in
01132 (
01133 _DSbitmap8 bmp8;
01134 _DSbitmap bmp ;
01135 nalphabmp
01136 ) ;
01137 );
01138 }
01139
01140
01151 G2DloadPngToBmp(chan, path){
01152 let _LDalphaBitmap chan (_checkpack path) -> alpha in
01153 let _GETalphaBitmapSize alpha -> [w h] in
01154 let _FILLbitmap _CRbitmap chan w h 0xffffff -> newbmp in
01155 (
01156 if alpha == nil then nil else
01157 (
01158 _CPalphaBitmap newbmp 0 0 alpha 0 0 w h;
01159 _DSalphaBitmap alpha;
01160 newbmp;
01161 );
01162 );
01163 }
01164
01165
01176 G2DloadBmp(chan, path){
01177 let _checkpack path -> file in
01178 let _LDbitmap chan file -> bmp in
01179 let if bmp == nil then _LDjpeg chan file else bmp -> bmp in
01180 let if bmp == nil then _LDtga chan file else bmp -> bmp in
01181 let if bmp == nil then G2DloadPngToBmp chan path else bmp -> bmp in
01182 bmp;
01183 }
01184
01185
01196 G2DloadAlphaBmp(chan, path){
01197 let _checkpack path -> file in
01198 let nil -> newalpha in
01199 (
01200 let _LDbitmap chan file -> bmp in
01201 let _LDjpeg chan file -> bmp2 in
01202 if bmp != nil then
01203 (
01204 let _GETbitmapSize bmp -> [w h] in
01205 let _FILLbitmap8 _CRbitmap8 chan w h 0 -> bmp8 in
01206 (
01207 set newalpha = _CRalphaBitmap chan bmp bmp8 0 0;
01208 _DSbitmap bmp;
01209 _DSbitmap8 bmp8;
01210 );
01211 0;
01212 )
01213 else if bmp2 != nil then
01214 (
01215 let _GETbitmapSize bmp2 -> [w h] in
01216 let _FILLbitmap8 _CRbitmap8 chan w h 0 -> bmp8 in
01217 (
01218 set newalpha = _CRalphaBitmap chan bmp2 bmp8 0 0;
01219 _DSbitmap bmp2;
01220 _DSbitmap8 bmp8;
01221 );
01222 0;
01223 )
01224 else
01225 (
01226 set newalpha = _LDalphaBitmap chan file;
01227 0;
01228 );
01229
01230 newalpha;
01231 );
01232 }
01233
01234
01248 G2DstrechBitmap(chan, bmp, width, height, bcolor){
01249 let _GETbitmapSize bmp -> [bw bh] in
01250 if (bw == width) && (bh == height) then bmp else
01251 let _FILLbitmap _CRbitmap chan width height bcolor -> newbmp in
01252 let if bh > bw then bh / bw else bw / bh -> ratio in
01253 let if bh > bw then height / ratio else width -> fw in
01254 let if bw > bh then width / ratio else height -> fh in
01255 _SCPbitmap newbmp ((width / 2) - (fw / 2)) ((height / 2) - (fh / 2)) ((width / 2) + (fw / 2)) ((height / 2) + (fh / 2)) bmp 0 0 bw bh nil
01256 ;
01257 }
01258
01259
01275 G2DcreateLayer(chan, w, h, border, bcolor, color, opacity){
01276
01277 let mktab 768 0 -> greypal in
01278 (
01279 let 0 -> i in
01280 let 0 -> c in
01281 while (i < 768) do
01282 (
01283 set greypal.(i) = c;
01284 set greypal.(i+1) = c;
01285 set greypal.(i+2) = c;
01286 set i = i+3;
01287 set c = c+1;
01288 );
01289
01290 let (255 * opacity) / 100 -> opcoef in
01291 let if !border then
01292 _FILLbitmap _CRbitmap chan w h color
01293 else
01294 (_DRAWrectangle
01295 (_FILLbitmap (_CRbitmap chan w h) color)
01296 0 0 w h DRAW_SOLID border bcolor DRAW_INVISIBLE color)
01297 -> nodebmp in
01298
01299 let if !border then
01300 _FILLbitmap8 (_SETbitmapPalette _CRbitmap8 chan w h greypal) (make_rgb opcoef opcoef opcoef)
01301 else
01302 (_DRAWrectangle8
01303 (_FILLbitmap8 (_SETbitmapPalette _CRbitmap8 chan w h greypal) 0)
01304 0 0 w h DRAW_SOLID border 0xffffff DRAW_SOLID (make_rgb opcoef opcoef opcoef))
01305 -> nodebmpalpha in
01306 let _CRalphaBitmap chan nodebmp nodebmpalpha nil nil -> alphabmp in
01307 (
01308 _DSbitmap nodebmp;
01309 _DSbitmap8 nodebmpalpha;
01310 alphabmp;
01311 );
01312 );
01313 }
01314
01315
01332 G2DsetLayer(chan, alphabmp, w, h, border, bcolor, color, opacity){
01333
01334 let mktab 768 0 -> greypal in
01335 let _GETalphaBitmaps alphabmp -> [buffer buffer8] in
01336 (
01337 let 0 -> i in
01338 let 0 -> c in
01339 while (i < 768) do
01340 (
01341 set greypal.(i) = c;
01342 set greypal.(i+1) = c;
01343 set greypal.(i+2) = c;
01344 set i = i+3;
01345 set c = c+1;
01346 );
01347
01348 let (255 * opacity) / 100 -> opcoef in
01349 let if !border then
01350 _FILLbitmap buffer color
01351 else
01352 (_DRAWrectangle
01353 (_FILLbitmap buffer color)
01354 0 0 w h DRAW_SOLID border bcolor DRAW_INVISIBLE color)
01355 -> nodebmp in
01356
01357 let if !border then
01358 _FILLbitmap8 (_SETbitmapPalette buffer8 greypal) (make_rgb opcoef opcoef opcoef)
01359 else
01360 (_DRAWrectangle8
01361 (_FILLbitmap8 (_SETbitmapPalette buffer8 greypal) 0)
01362 0 0 w h DRAW_SOLID border 0xffffff DRAW_SOLID (make_rgb opcoef opcoef opcoef))
01363 -> nodebmpalpha in
01364 alphabmp;
01365 );
01366 }
01367
01368
01369
01370
01371
01372 G2DbBmp_HResize(resBmp,orgBmp,resBmp8,orgBmp8,nbCol,numCol,trans,borders){
01373 let borders -> [wl wr ht hb] in
01374 let _GETbitmapSize resBmp -> [resW resH] in
01375 let resW/nbCol -> widthRes in
01376 let numCol*widthRes -> resPos in
01377 let _GETbitmapSize orgBmp -> [orgW orgH] in
01378 let orgW/nbCol -> widthOrg in
01379 let numCol*widthOrg -> orgPos in
01380 (
01381 _SCPbitmap resBmp resPos 0 resPos+wl-1 resH orgBmp orgPos 0 orgPos+wl-1 resH trans;
01382 _SCPbitmap resBmp resPos+wl 0 resPos+widthRes-wr-1 resH orgBmp orgPos+wl 0 orgPos+widthOrg-wr-1 resH trans;
01383 _SCPbitmap resBmp resPos+widthRes-wr 0 resPos+widthRes-1 resH orgBmp orgPos+widthOrg-wr 0 orgPos+widthOrg-1 resH trans;
01384 _SCPbitmap8 resBmp8 resPos 0 resPos+wl-1 resH orgBmp8 orgPos 0 orgPos+wl-1 resH trans;
01385 _SCPbitmap8 resBmp8 resPos+wl 0 resPos+widthRes-wr-1 resH orgBmp8 orgPos+wl 0 orgPos+widthOrg-wr-1 resH trans;
01386 _SCPbitmap8 resBmp8 resPos+widthRes-wr 0 resPos+widthRes-1 resH orgBmp8 orgPos+widthOrg-wr 0 orgPos+widthOrg-1 resH trans;
01387 if (numCol+1)==nbCol then
01388 0
01389 else
01390 G2DbBmp_HResize resBmp orgBmp resBmp8 orgBmp8 nbCol numCol+1 trans borders
01391 );
01392 }
01393
01394
01395 G2DbBmp_VResize(resBmp,orgBmp,resBmp8,orgBmp8,nbLine,numLine,trans,borders){
01396 let borders -> [wl wr ht hb] in
01397 let _GETbitmapSize resBmp -> [resW resH] in
01398 let resH/nbLine -> heightRes in
01399 let numLine*heightRes -> resPos in
01400 let _GETbitmapSize orgBmp -> [orgW orgH] in
01401 let orgH/nbLine -> heightOrg in
01402 let numLine*heightOrg -> orgPos in
01403 (
01404 _SCPbitmap resBmp 0 resPos resW resPos+ht-1 orgBmp 0 orgPos resW orgPos+ht-1 trans;
01405 _SCPbitmap resBmp 0 resPos+ht resW resPos+heightRes-hb-1 orgBmp 0 orgPos+ht resW orgPos+heightOrg-hb-1 trans;
01406 _SCPbitmap resBmp 0 resPos+heightRes-hb resW resPos+heightRes-1 orgBmp 0 orgPos+heightOrg-hb resW orgPos+heightOrg-1 trans;
01407 _SCPbitmap8 resBmp8 0 resPos resW resPos+ht-1 orgBmp8 0 orgPos resW orgPos+ht-1 trans;
01408 _SCPbitmap8 resBmp8 0 resPos+ht resW resPos+heightRes-hb-1 orgBmp8 0 orgPos+ht resW orgPos+heightOrg-hb-1 trans;
01409 _SCPbitmap8 resBmp8 0 resPos+heightRes-hb resW resPos+heightRes-1 orgBmp8 0 orgPos+heightOrg-hb resW orgPos+heightOrg-1 trans;
01410
01411 if (numLine+1)==nbLine then
01412 0
01413 else
01414 G2DbBmp_VResize resBmp orgBmp resBmp8 orgBmp8 nbLine numLine+1 trans borders
01415 );
01416 }
01417
01418
01419 G2DbBmp_DrawText(bmp,text,tabl,size,pos,colors,numLine,numCol){
01420 let text -> [txt font] in
01421 let tabl -> [nbLine nbCol] in
01422 let pos -> [xpos ypos] in
01423 let size -> [width height] in
01424 (
01425 let hd hd colors -> coul in
01426 if coul!=-1 then
01427 _DRAWtext bmp font xpos+(width*numCol) ypos+(height*numLine) TD_TOP|TD_LEFT coul txt
01428 else
01429 nil;
01430 if (numLine+1)==nbLine then
01431 if (numCol+1)==nbCol then
01432 0
01433 else
01434 G2DbBmp_DrawText bmp text tabl size pos (tl colors) 0 numCol+1
01435 else
01436 G2DbBmp_DrawText bmp text tabl size pos ((tl hd colors)::(tl colors)) numLine+1 numCol
01437 );
01438 }
01439
01440
01441
01442 G2DbBmp_stretchButtonText(chan,text,size,colors,borders,tabl,img,right){
01443 let text -> [txt font] in
01444 let size -> [width height] in
01445 let colors -> [trans write] in
01446 let borders -> [wl wr ht hb] in
01447 let tabl -> [nbLine nbCol] in
01448 let _GETalphaBitmaps img -> [Bmp Bmp8] in
01449 let _GETbitmapSize Bmp -> [bmpW bmpH] in
01450
01451
01452 let _CRbitmap chan (width+right)*nbCol bmpH -> tempBmp in
01453 let _CRbitmap8 chan (width+right)*nbCol bmpH -> tempBmp8 in
01454 (
01455 G2DbBmp_HResize tempBmp Bmp tempBmp8 Bmp8 nbCol 0 nil borders;
01456 let _CRbitmap chan (width+right)*nbCol nbLine*height -> temp2Bmp in
01457 let _CRbitmap8 chan (width+right)*nbCol nbLine*height -> temp2Bmp8 in
01458 (
01459 G2DbBmp_VResize temp2Bmp tempBmp temp2Bmp8 tempBmp8 nbLine 0 nil borders;
01460
01461
01462 let _GETstringSize font txt -> [wtxt htxt] in
01463 let if width-(wl+wr)>wtxt then ((width-(wl+wr)-wtxt)/2)+wl else wl -> xpos in
01464 let if height>htxt then height-htxt-hb else ht -> ypos in
01465 (
01466
01467 G2DbBmp_DrawText temp2Bmp text tabl [(width + right) height] [xpos ypos] write 0 0;
01468
01469
01470
01471
01472 let _CRalphaBitmap chan temp2Bmp temp2Bmp8 nil trans -> newalpha in
01473 (
01474 _DSbitmap tempBmp;
01475 _DSbitmap8 tempBmp8;
01476 _DSbitmap temp2Bmp;
01477 _DSbitmap8 temp2Bmp8;
01478
01479 newalpha;
01480 );
01481 )
01482 )
01483 );
01484 }
01485
01486
01487 G2DcbResizeNode(cbmp, p, w, h, oldval){
01488 if w < 1 || h < 1 then nil else
01489 let p -> [oldalpha color opcoef] in
01490 (
01491 _DSalphaBitmap oldalpha;
01492
01493 let oldval -> [ox oy ow oh] in
01494 let _FILLbitmap _CRbitmap _channel w h color -> nodebmp in
01495 let _FILLbitmap8 _CRbitmap8 _channel w h (make_rgb opcoef opcoef opcoef) -> nodebmpalpha in
01496 let _CRalphaBitmap _channel nodebmp nodebmpalpha nil nil -> alphamainnode in
01497 (
01498 _DSbitmap nodebmp;
01499 _DSbitmap8 nodebmpalpha;
01500 [alphamainnode [ox oy w h]]
01501 );
01502 );
01503 }
01504
01505
01523 G2DcreateNode(container, node, pos, width, height, flags, color, opacity, inline, linecolor){
01524 let (255 * opacity) / 100 -> opcoef in
01525
01526 let if inline != 0 && inline != nil then
01527 (_DRAWrectangle
01528 (_FILLbitmap (_CRbitmap _channel width height) color)
01529 0 0 width height DRAW_SOLID inline linecolor DRAW_INVISIBLE color)
01530 else
01531 _FILLbitmap _CRbitmap _channel width height color
01532 -> nodebmp in
01533
01534 let if inline != 0 && inline != nil then
01535 (_DRAWrectangle8
01536 (_FILLbitmap8 (_CRbitmap8 _channel width height) (make_rgb opcoef opcoef opcoef))
01537 0 0 width height DRAW_SOLID inline (make_rgb 255 255 255) DRAW_INVISIBLE (make_rgb opcoef opcoef opcoef))
01538 else
01539 _FILLbitmap8 _CRbitmap8 _channel width height (make_rgb opcoef opcoef opcoef)
01540 -> nodebmpalpha in
01541
01542 let _CRalphaBitmap _channel nodebmp nodebmpalpha nil nil -> alphamainnode in
01543 let _CBcompBitmapResizeResource _CRcompBitmap _channel container node pos flags|OBJ_LH_FLEX|OBJ_MH_FLEX OBJ_CONTAINER_CLICK|OBJ_CONTAINER_UNCLICK|OBJ_CONTAINER_DBLCLICK|OBJ_CONTAINER_KEYUP|OBJ_CONTAINER_KEYDOWN|OBJ_CONTAINER_MOUSEWHEEL|OBJ_CONTAINER_MOVE alphamainnode 0 0 width height @G2DcbResizeNode [alphamainnode color opcoef] -> nodeback in
01544 (
01545 _DSbitmap nodebmp;
01546 _DSbitmap8 nodebmpalpha;
01547 _CONVERTcompBitmapToObjNode nodeback;
01548 );
01549 }
01550
01551
01560 makeEdThemeResources(chan){
01561 let mkEdTheme [chan nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil] -> themestr in
01562 (
01563 set themestr.EDT_iToolBarColor = iG2DDEFAULTBACKGROUNDCOLOR;
01564 set themestr.EDT_iTabBarColor = iG2DDEFAULTBACKGROUNDCOLOR;
01565
01566 let _LDbitmap themestr.EDT_channel _checkpack (strcat sG2DDEFAULTRESOURCESPATH sG2DHCOLORPICKERCURSOR) -> bmp in
01567 let _GETbitmapSize bmp -> [bw bh] in
01568 let _CRcursor themestr.EDT_channel bmp (bw / 2) (bh / 2) 0x000000 0xffffff -> cursor in
01569 set themestr.EDT_cursorColorPicker = cursor;
01570
01571 set themestr.EDT_sColorMap = (strcat sG2DDEFAULTRESOURCESPATH sG2DCOLORMAP);
01572 set themestr.EDT_abmpColorMapCross = _LDalphaBitmap themestr.EDT_channel _checkpack (strcat sG2DDEFAULTRESOURCESPATH sG2DCOLORMAPCROSS);
01573 set themestr.EDT_abmpColorMapPickerBtn = _LDalphaBitmap themestr.EDT_channel _checkpack (strcat sG2DDEFAULTRESOURCESPATH sG2DDEFAULTBTNCOLORPICKER);
01574
01575 set themestr.EDT_abmpTabCheck = _LDalphaBitmap themestr.EDT_channel _checkpack (strcat sG2DDEFAULTRESOURCESPATH sG2DDEFAULTCHKTAB);
01576 set themestr.EDT_abmpTabClose = _LDalphaBitmap themestr.EDT_channel _checkpack (strcat sG2DDEFAULTRESOURCESPATH sG2DDEFAULTCLOSETAB);
01577 set themestr.EDT_abmpTabLeft = _LDalphaBitmap themestr.EDT_channel _checkpack (strcat sG2DDEFAULTRESOURCESPATH sG2DDEFAULTBTNTABLEFT);
01578 set themestr.EDT_abmpTabRight = _LDalphaBitmap themestr.EDT_channel _checkpack (strcat sG2DDEFAULTRESOURCESPATH sG2DDEFAULTBTNTABRIGHT);
01579
01580 set themestr.EDT_iTabFontColor = iG2DDEFAULTFONTCOLOR;
01581 set themestr.EDT_fontTab = _CRfont themestr.EDT_channel 9 0 FF_PIXEL "Arial";
01582
01583 let _LDbitmap themestr.EDT_channel _checkpack (strcat sG2DDEFAULTRESOURCESPATH sG2DHSIZECURSOR) -> bmp in
01584 let _GETbitmapSize bmp -> [bw bh] in
01585 let _CRcursor themestr.EDT_channel bmp (bw / 2) (bh / 2) 0x000000 0xffffff -> cursor in
01586 set themestr.EDT_cursorSize = cursor;
01587
01588 set themestr.EDT_abmpValUp = _LDalphaBitmap themestr.EDT_channel _checkpack (strcat sG2DDEFAULTRESOURCESPATH sG2DDEFAULTBTNVALUP);
01589 set themestr.EDT_abmpValDown = _LDalphaBitmap themestr.EDT_channel _checkpack (strcat sG2DDEFAULTRESOURCESPATH sG2DDEFAULTBTNVALDOWN);
01590
01591 set themestr.EDT_abmpFrameFold = _LDalphaBitmap themestr.EDT_channel _checkpack (strcat sG2DDEFAULTRESOURCESPATH sG2DDEFAULTCHKFRAMEFOLD);
01592 set themestr.EDT_iFrameFontColor = iG2DDEFAULTFRAMEFONTCOLOR;
01593 set themestr.EDT_sFrameFontName = "Arial";
01594 set themestr.EDT_iFrameFontSize = 9;
01595 set themestr.EDT_iFrameBarColor = iG2DDEFAULTBACKGROUNDCOLOR;
01596 set themestr.EDT_iFrameBarHeight = 18;
01597
01598 set themestr.EDT_fontToolTip = _CRfont themestr.EDT_channel 8 0 FF_PIXEL "Arial";
01599 set themestr.EDT_fontModuleEditor = _CRfont themestr.EDT_channel 9 0 FF_PIXEL "Arial";
01600 set themestr.EDT_iModuleEditorBg = iG2DDEFAULTMODULEEDITORBGCOLOR;
01601 set themestr.EDT_iModuleEditorDot = iG2DDEFAULTMODULEEDITORDOTCOLOR;
01602 set themestr.EDT_iModuleEditorBoxOff = iG2DDEFAULTMODULEEDITORBOXOFFCOLOR;
01603 set themestr.EDT_iModuleEditorBoxOn = iG2DDEFAULTMODULEEDITORBOXONCOLOR;
01604 set themestr.EDT_iModuleEditorBoxBorderOff = iG2DDEFAULTMODULEEDITORBOXBORDEROFFCOLOR;
01605 set themestr.EDT_iModuleEditorBoxBorderOn = iG2DDEFAULTMODULEEDITORBOXBORDERONCOLOR;
01606
01607 set themestr.EDT_iModuleEditorBoxTextOff = iG2DDEFAULTMODULEEDITORBOXTEXTOFFCOLOR;
01608 set themestr.EDT_iModuleEditorBoxTextOn = iG2DDEFAULTMODULEEDITORBOXTEXTONCOLOR;
01609 set themestr.EDT_iModuleEditorLinkOff = iG2DDEFAULTMODULEEDITORLINKOFFCOLOR;
01610 set themestr.EDT_iModuleEditorLinkOn = iG2DDEFAULTMODULEEDITORLINKONCOLOR;
01611 set themestr.EDT_iModuleEditorRLinkSize = iG2DDEFAULTMODULEEDITORROUNDLINKSIZE;
01612 set themestr.EDT_iModuleEditorBorderWidth = iG2DDEFAULTMODULEEDITORBORDERWIDTH;
01613
01614
01615 _SETdefaultFont _CRfont themestr.EDT_channel 15 0 0 "Microsoft San Serif";
01616
01617 themestr;
01618 );
01619 }
01620
01621
01634 setEdColorMapResources(themestr, cmap, mapcross, btnpicker, curpicker){
01635 if cmap == nil then nil else
01636 (
01637 set themestr.EDT_sColorMap = cmap;
01638 );
01639
01640 if mapcross == nil then nil else
01641 (
01642 _DSalphaBitmap themestr.EDT_abmpColorMapCross;
01643 set themestr.EDT_abmpColorMapCross = _LDalphaBitmap themestr.EDT_channel _checkpack mapcross;
01644 );
01645
01646 if btnpicker == nil then nil else
01647 (
01648 _DSalphaBitmap themestr.EDT_abmpColorMapPickerBtn;
01649 set themestr.EDT_abmpColorMapPickerBtn = _LDalphaBitmap themestr.EDT_channel _checkpack btnpicker;
01650 );
01651
01652 if curpicker == nil then nil else
01653 (
01654 _DScursor themestr.EDT_cursorColorPicker;
01655 let _LDbitmap themestr.EDT_channel _checkpack curpicker -> bmp in
01656 let _GETbitmapSize bmp -> [bw bh] in
01657 let _CRcursor themestr.EDT_channel bmp (bw / 2) (bh / 2) 0x000000 0xffffff -> cursor in
01658 set themestr.EDT_cursorColorPicker = cursor;
01659 );
01660 0;
01661 }
01662
01663
01673 setEdToolBarResources(themestr, backcolor){
01674 if backcolor == nil then nil else
01675 (
01676 set themestr.EDT_iToolBarColor = backcolor;
01677 );
01678 0;
01679 }
01680
01681
01698 setEdTabResources(themestr, backcolor, tabcheck, tabclose, tableft, tabright, fontname, fontsize, fontcolor){
01699 if backcolor == nil then nil else
01700 (
01701 set themestr.EDT_iTabBarColor = backcolor;
01702 );
01703
01704 if tabcheck == nil then nil else
01705 (
01706 _DSalphaBitmap themestr.EDT_abmpTabCheck;
01707 set themestr.EDT_abmpTabCheck = _LDalphaBitmap themestr.EDT_channel _checkpack tabcheck;
01708 );
01709
01710 if tabclose == nil then nil else
01711 (
01712 _DSalphaBitmap themestr.EDT_abmpTabClose;
01713 set themestr.EDT_abmpTabClose = _LDalphaBitmap themestr.EDT_channel _checkpack tabclose;
01714 );
01715
01716 if tableft == nil then nil else
01717 (
01718 _DSalphaBitmap themestr.EDT_abmpTabLeft;
01719 set themestr.EDT_abmpTabLeft = _LDalphaBitmap themestr.EDT_channel _checkpack tableft;
01720 );
01721
01722 if tabright == nil then nil else
01723 (
01724 _DSalphaBitmap themestr.EDT_abmpTabRight;
01725 set themestr.EDT_abmpTabRight = _LDalphaBitmap themestr.EDT_channel _checkpack tabright;
01726 );
01727
01728 if (fontname == nil) || (fontsize == nil) then nil else
01729 (
01730 _DSfont themestr.EDT_fontTab;
01731 set themestr.EDT_fontTab = _CRfont themestr.EDT_channel fontsize 0 FF_PIXEL fontname;
01732 );
01733
01734 if fontcolor == nil then nil else
01735 (
01736 set themestr.EDT_iTabFontColor = fontcolor;
01737 );
01738 0;
01739 }
01740
01741
01753 setEdFloatResources(themestr, upbtn, downbtn, cursize){
01754 if upbtn == nil then nil else
01755 (
01756 _DSalphaBitmap themestr.EDT_abmpValUp;
01757 set themestr.EDT_abmpValUp = _LDalphaBitmap themestr.EDT_channel _checkpack upbtn;
01758 );
01759
01760 if downbtn == nil then nil else
01761 (
01762 _DSalphaBitmap themestr.EDT_abmpValDown;
01763 set themestr.EDT_abmpValDown = _LDalphaBitmap themestr.EDT_channel _checkpack downbtn;
01764 );
01765
01766 if cursize == nil then nil else
01767 (
01768 _DScursor themestr.EDT_cursorSize;
01769 let _LDbitmap themestr.EDT_channel _checkpack cursize -> bmp in
01770 let _GETbitmapSize bmp -> [bw bh] in
01771 let _CRcursor themestr.EDT_channel bmp (bw / 2) (bh / 2) 0x000000 0xffffff -> cursor in
01772 set themestr.EDT_cursorSize = cursor;
01773 );
01774 0;
01775 }
01776
01777
01792 setEdFrameResources(themestr, backcolor, foldbtn, fontname, fontsize, fontcolor, barheight){
01793 if backcolor == nil then nil else
01794 (
01795 set themestr.EDT_iFrameBarColor = backcolor;
01796 );
01797
01798 if foldbtn == nil then nil else
01799 (
01800 _DSalphaBitmap themestr.EDT_abmpFrameFold;
01801 set themestr.EDT_abmpFrameFold = _LDalphaBitmap themestr.EDT_channel _checkpack foldbtn;
01802 );
01803
01804 if (fontname == nil) then nil else
01805 (
01806 set themestr.EDT_sFrameFontName = fontname;
01807 );
01808
01809 if (fontsize == nil) then nil else
01810 (
01811 set themestr.EDT_iFrameFontSize = fontsize;
01812 );
01813
01814 if fontcolor == nil then nil else
01815 (
01816 set themestr.EDT_iFrameFontColor = fontcolor;
01817 );
01818
01819 if barheight == nil then nil else
01820 (
01821 set themestr.EDT_iFrameBarHeight = barheight;
01822 );
01823 0;
01824 }
01825
01826
01837 addEdThemeResource(themestr, resname, path){
01838 if (resname == nil) || (path == nil) then nil else
01839 let _LDalphaBitmap themestr.EDT_channel _checkpack path -> abmp in
01840 set themestr.EDT_lAlphaResources = [resname abmp]::themestr.EDT_lAlphaResources;
01841 0;
01842 }
01843
01844
01854 delEdThemeResource(themestr, resname){
01855 let switchstr themestr.EDT_lAlphaResources resname -> abmp in
01856 _DSalphaBitmap abmp;
01857
01858 set themestr.EDT_lAlphaResources = G2DremoveEdSidFromList themestr.EDT_lAlphaResources resname;
01859 0;
01860 }
01861
01862
01872 getEdThemeResource(themestr, resname){
01873 switchstr themestr.EDT_lAlphaResources resname;
01874 }
01875
01876
01885 delEdTheme(themestr){
01886 let sizelist themestr.EDT_lAlphaResources -> size in
01887 let 0 -> i in
01888 while i < size do
01889 (
01890 let nth_list themestr.EDT_lAlphaResources i -> [_ abmp] in
01891 _DSalphaBitmap abmp;
01892
01893 set i = i + 1;
01894 );
01895
01896 set themestr.EDT_lAlphaResources = nil;
01897
01898 _DScursor themestr.EDT_cursorColorPicker;
01899 set themestr.EDT_cursorColorPicker = nil;
01900
01901 _DSalphaBitmap themestr.EDT_abmpColorMapCross;
01902 set themestr.EDT_abmpColorMapCross = nil;
01903
01904 _DSalphaBitmap themestr.EDT_abmpColorMapPickerBtn;
01905 set themestr.EDT_abmpColorMapPickerBtn = nil;
01906
01907 _DScursor themestr.EDT_cursorSize;
01908 set themestr.EDT_cursorSize = nil;
01909
01910 _DSfont themestr.EDT_fontTab;
01911 set themestr.EDT_fontTab = nil;
01912
01913 _DSalphaBitmap themestr.EDT_abmpTabCheck;
01914 set themestr.EDT_abmpTabCheck = nil;
01915
01916 _DSalphaBitmap themestr.EDT_abmpTabClose;
01917 set themestr.EDT_abmpTabClose = nil;
01918
01919 _DSalphaBitmap themestr.EDT_abmpTabLeft;
01920 set themestr.EDT_abmpTabLeft = nil;
01921
01922 _DSalphaBitmap themestr.EDT_abmpTabRight;
01923 set themestr.EDT_abmpTabRight = nil;
01924
01925 _DSalphaBitmap themestr.EDT_abmpValUp;
01926 set themestr.EDT_abmpValUp = nil;
01927
01928 _DSalphaBitmap themestr.EDT_abmpValDown;
01929 set themestr.EDT_abmpValDown = nil;
01930
01931 _DSalphaBitmap themestr.EDT_abmpFrameFold;
01932 set themestr.EDT_abmpFrameFold = nil;
01933
01934 _DSfont themestr.EDT_fontModuleEditor;
01935 set themestr.EDT_fontModuleEditor = nil;
01936
01937 _DSfont themestr.EDT_fontToolTip;
01938 set themestr.EDT_fontToolTip = nil;
01939 0;
01940 }
01941
01942
01943
01944
01945
01946
01957 resetEdTabPosition(tabbarstr){
01958 set tabbarstr.ETABBAR_iCurrentLpos = 0;
01959 let sizelist tabbarstr.ETABBAR_lTab -> size in
01960 let 0 -> i in
01961 while i < size do
01962 (
01963 let nth_list tabbarstr.ETABBAR_lTab i -> item in
01964 let _CONVERTcompCheckToObjNode item.ETAB_chk -> node in
01965 let _GETobjNodePositionSizeInFatherRef node -> [_ _ nw nh] in
01966 (
01967 _CHANGEobjNodeCoordinates node [tabbarstr.ETABBAR_iCurrentLpos 0] 0;
01968 set tabbarstr.ETABBAR_iCurrentLpos = tabbarstr.ETABBAR_iCurrentLpos + nw;
01969 );
01970
01971 set i = i + 1;
01972 );
01973 0;
01974 }
01975
01976
01988 getEdTabsLength(tabbarstr, pos){
01989 let sizelist tabbarstr.ETABBAR_lTab -> size in
01990 let 0 -> width in
01991 let if !pos then 0 else pos -> i in
01992 (
01993 while i < size do
01994 (
01995 let nth_list tabbarstr.ETABBAR_lTab i -> elem in
01996 let _GETobjNodePositionSizeInFatherRef (_CONVERTcompCheckToObjNode elem.ETAB_chk) -> [_ _ w h] in
01997 set width = width + w;
01998
01999 set i = i + 1;
02000 );
02001 width;
02002 );
02003 }
02004
02005
02016 getEdLastVisibleTabs(tabbarstr){
02017 let sizelist tabbarstr.ETABBAR_lTab -> size in
02018 let _GETcontainerPositionSize tabbarstr.ETABBAR_contScroll -> [_ _ cw _] in
02019 let tabbarstr.ETABBAR_size -> [tw _] in
02020 let (tw -cw) -> width in
02021 let 0 -> ww in
02022 let tabbarstr.ETABBAR_iScrollPos -> i in
02023 (
02024 while (i < size) && (ww < width) do
02025 (
02026 let nth_list tabbarstr.ETABBAR_lTab i -> elem in
02027 let _GETobjNodePositionSizeInFatherRef (_CONVERTcompCheckToObjNode elem.ETAB_chk) -> [_ _ w h] in
02028 set ww = ww + w;
02029
02030 set i = i + 1;
02031 );
02032 i - 1;
02033 );
02034 }
02035
02036
02049 getEdBestTabsByLength(tabbarstr, w, pos){
02050 if !pos then 0 else
02051 let getEdTabsLength tabbarstr pos -> width in
02052 let sizelist tabbarstr.ETABBAR_lTab -> size in
02053 (
02054 while pos >= 0 && (width < w) do
02055 (
02056 set width = getEdTabsLength tabbarstr pos - 1;
02057 set pos = pos - 1;
02058 );
02059 pos;
02060 );
02061 }
02062
02063
02074 activateEdTabBarScroll(tabbarstr){
02075 let getEdTabsLength tabbarstr 0 -> width in
02076 let tabbarstr.ETABBAR_size -> [w _] in
02077 if width < w then
02078
02079 (
02080 _SHOWcontainer tabbarstr.ETABBAR_contScroll CONTAINER_HIDDEN;
02081 let _GETobjNodePositionSizeInFatherRef tabbarstr.ETABBAR_node -> [nx ny _ _] in
02082 _CHANGEobjNodeCoordinates tabbarstr.ETABBAR_node [0 ny] 1;
02083 0;
02084 )
02085 else
02086
02087 (
02088 _SHOWcontainer tabbarstr.ETABBAR_contScroll CONTAINER_UNHIDDEN;
02089 0;
02090 );
02091 0;
02092 }
02093
02094
02103 cbEdTabClick(cmpchk, param, x, y, btn, mask){
02104 0;
02105 }
02106
02107
02116 cbEdTabUnClick(cmpchk, param, x, y, btn, mask){
02117 let param -> [tabbarstr tabstr] in
02118 (
02119 if (_GETcompCheckState cmpchk) == CHK_UNCHECKED then
02120 (
02121 _SETcompCheckState cmpchk CHK_CHECKED;
02122 0;
02123 )
02124 else
02125 (
02126 focusEdTab tabbarstr tabstr;
02127 0;
02128 );
02129
02130 _PAINTcontainer tabbarstr.ETABBAR_cont;
02131 );
02132 0;
02133 }
02134
02135
02144 cbEdTabResize(cmpchk, p, w, h){
02145 0;
02146 }
02147
02148
02157 cbEdCloseTabClick(cmproll, param, x, y, btn, mask){
02158 let param -> [tabbarstr tabstr] in
02159 (
02160 exec tabstr.ETAB_cbClosed with [tabstr];
02161 dsEdTab tabbarstr tabstr;
02162 );
02163 0;
02164 }
02165
02166
02175 setEdTabCbClose(tabstr, cbfun){
02176 set tabstr.ETAB_cbClosed = cbfun;
02177 0;
02178 }
02179
02180
02189 changeEdTabCheck(tabbarstr, tabstr){
02190 let _GETobjNodePositionSizeInFatherRef (_CONVERTcompCheckToObjNode tabstr.ETAB_chk) -> [px py _ _] in
02191 (
02192 _DScompCheck tabstr.ETAB_chk;
02193 set tabstr.ETAB_chk = nil;
02194 _DSalphaBitmap tabstr.ETAB_abmpTab;
02195 set tabstr.ETAB_abmpTab = nil;
02196 _DScompRollOver tabstr.ETAB_closeBtn;
02197 set tabstr.ETAB_closeBtn = nil;
02198
02199 let _GETalphaBitmapSize tabbarstr.ETABBAR_theme.EDT_abmpTabCheck -> [taw tah] in
02200 let _GETalphaBitmapSize tabbarstr.ETABBAR_theme.EDT_abmpTabClose -> [tcw tch] in
02201 let [tcw (tch / 5)] -> [tcw tch] in
02202 let [(taw / 2) (tah / 5)] -> [tw th] in
02203 let (G2DgetStrWidth tabbarstr.ETABBAR_theme.EDT_fontTab tabstr.ETAB_sName) + (tabbarstr.ETABBAR_iMargin * 2) -> tabw in
02204 let tabbarstr.ETABBAR_theme.EDT_iTabFontColor -> c1 in
02205 let G2DbBmp_stretchButtonText
02206 tabstr.ETAB_channel
02207 [tabstr.ETAB_sName tabbarstr.ETABBAR_theme.EDT_fontTab]
02208 [tabw th]
02209 [
02210 nil
02211 (c1::c1::c1::c1::0xdddddd::nil)::(c1::c1::c1::c1::0xdddddd::nil)::nil
02212 ]
02213 [10 10 12 2]
02214 [5 2]
02215 tabbarstr.ETABBAR_theme.EDT_abmpTabCheck
02216 if !tabstr.ETAB_bState then 0 else tcw + 5
02217 -> img in
02218 let _GETalphaBitmapSize img -> [nw nh] in
02219 (
02220 set tabstr.ETAB_abmpTab = img;
02221 set tabstr.ETAB_chk = _CRcompCheck tabstr.ETAB_channel tabbarstr.ETABBAR_cont tabbarstr.ETABBAR_node [px py] OBJ_ENABLE|OBJ_VISIBLE|ROL_DISABLE|ROL_MASK OBJ_CONTAINER_UNCLICK|OBJ_CONTAINER_MOVE img;
02222
02223 if !tabstr.ETAB_bState then nil else
02224 (
02225 set tabstr.ETAB_closeBtn = _CRcompRollOver tabstr.ETAB_channel tabbarstr.ETABBAR_cont (_CONVERTcompCheckToObjNode tabstr.ETAB_chk) [((nw / 2) - (tcw + 5)) (((nh / 5) - tch) / 2)] OBJ_ENABLE|OBJ_VISIBLE|ROL_DISABLE|ROL_MASK nil tabbarstr.ETABBAR_theme.EDT_abmpTabClose;
02226 _CBcompRollOverUnClick tabstr.ETAB_closeBtn @cbEdCloseTabClick [tabbarstr tabstr];
02227 );
02228
02229 _CBcompCheckClick tabstr.ETAB_chk @cbEdTabClick [tabbarstr tabstr];
02230 _CBcompCheckUnClick tabstr.ETAB_chk @cbEdTabUnClick [tabbarstr tabstr];
02231 _CBcompCheckResize tabstr.ETAB_chk @cbEdTabResize [tabbarstr tabstr];
02232 );
02233 );
02234 0;
02235 }
02236
02237
02249 focusEdTab(tabbarstr, tabstr){
02250 let sizelist tabbarstr.ETABBAR_lTab -> size in
02251 let 0 -> i in
02252 while i < size do
02253 (
02254 let nth_list tabbarstr.ETABBAR_lTab i -> item in
02255 if item == tabstr then
02256 (
02257 set item.ETAB_bState = 1;
02258 if item.ETAB_modeFlag & ETAB_CLOSEBTN then
02259 changeEdTabCheck tabbarstr item
02260 else nil;
02261
02262 let tabbarstr.ETABBAR_size -> [w _] in
02263 let _GETcontainerPositionSize tabbarstr.ETABBAR_contScroll -> [_ _ cw _] in
02264 let getEdLastVisibleTabs tabbarstr -> lastvisibletab in
02265 let getEdBestTabsByLength tabbarstr (w -cw) i -> pos in
02266 if (i >= tabbarstr.ETABBAR_iScrollPos) && (i < lastvisibletab) then nil else
02267 (
02268 set tabbarstr.ETABBAR_iScrollPos = if i == (size - 1) then pos + 1 else pos;
02269
02270 let nth_list tabbarstr.ETABBAR_lTab tabbarstr.ETABBAR_iScrollPos -> sctabstr in
02271 let _GETobjNodePositionSizeInFatherRef (_CONVERTcompCheckToObjNode sctabstr.ETAB_chk) -> [cx _ _ _] in
02272 let _GETobjNodePositionSizeInFatherRef tabbarstr.ETABBAR_node -> [nx ny _ _] in
02273 _CHANGEobjNodeCoordinates tabbarstr.ETABBAR_node [-cx ny] 1;
02274 );
02275
02276 _SETcompCheckState item.ETAB_chk CHK_CHECKED;
02277 exec item.ETAB_cbFocused with [item];
02278 setEdWindowVisible item.ETAB_win 1;
02279 _SETfocus item.ETAB_win.EDW_win;
02280 set tabbarstr.ETABBAR_currentTab = item;
02281 0;
02282 )
02283 else
02284 (
02285 if !item.ETAB_bState then nil else
02286 set tabbarstr.ETABBAR_lastTab = item;
02287
02288 set item.ETAB_bState = 0;
02289 if item.ETAB_modeFlag & ETAB_CLOSEBTN then
02290 changeEdTabCheck tabbarstr item
02291 else nil;
02292
02293 _SETcompCheckState item.ETAB_chk CHK_UNCHECKED;
02294 setEdWindowVisible item.ETAB_win 0;
02295 0;
02296 );
02297
02298 set i = i + 1;
02299 );
02300 resetEdTabPosition tabbarstr;
02301 activateEdTabBarScroll tabbarstr;
02302 0;
02303 }
02304
02305
02316 dsEdTab(tabbarstr, tabstr){
02317 set tabbarstr.ETABBAR_lTab = G2DremoveFromList tabbarstr.ETABBAR_lTab tabstr;
02318
02319 dsEdWindow tabstr.ETAB_win;
02320 set tabstr.ETAB_win = nil;
02321
02322 _DScompCheck tabstr.ETAB_chk;
02323 set tabstr.ETAB_chk = nil;
02324 _DScompRollOver tabstr.ETAB_closeBtn;
02325 set tabstr.ETAB_closeBtn = nil;
02326 _DSalphaBitmap tabstr.ETAB_abmpTab;
02327 set tabstr.ETAB_abmpTab = nil;
02328
02329 resetEdTabPosition tabbarstr;
02330 activateEdTabBarScroll tabbarstr;
02331
02332
02333 if tabbarstr.ETABBAR_currentTab != tabstr then
02334 nil
02335 else if tabbarstr.ETABBAR_lastTab.ETAB_chk == nil then
02336 let sizelist tabbarstr.ETABBAR_lTab -> size in
02337 focusEdTab tabbarstr (nth_list tabbarstr.ETABBAR_lTab (size -1))
02338 else
02339 focusEdTab tabbarstr tabbarstr.ETABBAR_lastTab;
02340
02341 _PAINTcontainer tabbarstr.ETABBAR_cont;
02342 0;
02343 }
02344
02345
02358 crEdTab(tabbarstr, name, mode, state){
02359 let if mode == nil then 0 else mode -> mode in
02360 let mkEdTab [tabbarstr.ETABBAR_channel tabbarstr nil name nil nil nil nil nil nil nil nil nil] -> tabstr in
02361 let _GETalphaBitmapSize tabbarstr.ETABBAR_theme.EDT_abmpTabCheck -> [taw tah] in
02362 let [(taw / 2) (tah / 5)] -> [tw th] in
02363 let (G2DgetStrWidth tabbarstr.ETABBAR_theme.EDT_fontTab name) + (tabbarstr.ETABBAR_iMargin * 2) -> tabw in
02364 let tabbarstr.ETABBAR_theme.EDT_iTabFontColor -> c1 in
02365 let G2DbBmp_stretchButtonText
02366 tabstr.ETAB_channel
02367 [tabstr.ETAB_sName tabbarstr.ETABBAR_theme.EDT_fontTab]
02368 [tabw th]
02369 [
02370 nil
02371 (c1::c1::c1::c1::0xdddddd::nil)::(c1::c1::c1::c1::0xdddddd::nil)::nil
02372 ]
02373 [10 10 12 2]
02374 [5 2]
02375 tabbarstr.ETABBAR_theme.EDT_abmpTabCheck
02376 0
02377 -> img in
02378 let _GETalphaBitmapSize img -> [nw nh] in
02379 (
02380 set tabstr.ETAB_abmpTab = img;
02381
02382 set tabstr.ETAB_bState = (if tabbarstr.ETABBAR_lTab == nil then 1 else state);
02383 set tabstr.ETAB_modeFlag = mode;
02384
02385 let _GETwindowPositionSize tabbarstr.ETABBAR_targetWin.EDW_win -> [_ _ ww wh] in
02386 let getEdWindowToolBarSize tabbarstr.ETABBAR_targetWin -> [tww twh] in
02387 let [(ww - tww) (wh - twh)] -> [ww wh] in
02388
02389 let [(if ww <= 0 then 100 else ww) (if wh <= 0 then 100 else wh)] -> [ww wh] in
02390 set tabstr.ETAB_win = crEdWindow tabstr.ETAB_channel tabbarstr.ETABBAR_targetWin tww twh ww wh WN_CHILDINSIDE|WN_NOBORDER|WN_HIDDEN EDWIN_RESIZE_MW|EDWIN_RESIZE_MH EDWIN_TAB "";
02391
02392 set tabbarstr.ETABBAR_lTab = G2Dlcat tabbarstr.ETABBAR_lTab tabstr::nil;
02393
02394 set tabstr.ETAB_chk = _CRcompCheck tabstr.ETAB_channel tabbarstr.ETABBAR_cont tabbarstr.ETABBAR_node [tabbarstr.ETABBAR_iCurrentLpos 0] OBJ_ENABLE|OBJ_VISIBLE|ROL_DISABLE|ROL_MASK OBJ_CONTAINER_UNCLICK|OBJ_CONTAINER_MOVE img;
02395 set tabbarstr.ETABBAR_iCurrentLpos = tabbarstr.ETABBAR_iCurrentLpos + (nw / 2);
02396
02397 _CBcompCheckClick tabstr.ETAB_chk @cbEdTabClick [tabbarstr tabstr];
02398 _CBcompCheckUnClick tabstr.ETAB_chk @cbEdTabUnClick [tabbarstr tabstr];
02399 _CBcompCheckResize tabstr.ETAB_chk @cbEdTabResize [tabbarstr tabstr];
02400
02401 if !tabstr.ETAB_bState then
02402 (
02403 activateEdTabBarScroll tabbarstr;
02404 0;
02405 )
02406 else
02407 (
02408 focusEdTab tabbarstr tabstr;
02409 0;
02410 );
02411
02412 _PAINTcontainer tabbarstr.ETABBAR_cont;
02413
02414 tabstr;
02415 );
02416 }
02417
02418
02428 getEdTabWindow(tabstr){
02429 tabstr.ETAB_win;
02430 }
02431
02432
02433
02444 setEdTabCbFocused(tabstr, cbfun){
02445 set tabstr.ETAB_cbFocused = cbfun;
02446 }
02447
02448
02460 resizeEdTabBar(tabbarstr, w, h){
02461 let tabbarstr.ETABBAR_pos -> [x y] in
02462 _SIZEcontainer tabbarstr.ETABBAR_cont x y (w - tabbarstr.ETABBAR_rightPos) h;
02463
02464 set tabbarstr.ETABBAR_size = [(w - tabbarstr.ETABBAR_rightPos) h];
02465
02466 let _GETcontainerPositionSize tabbarstr.ETABBAR_contScroll -> [cx cy cw ch] in
02467 _SIZEcontainer tabbarstr.ETABBAR_contScroll (w - tabbarstr.ETABBAR_rightPos - cw) cy cw ch;
02468 activateEdTabBarScroll tabbarstr;
02469
02470 focusEdTab tabbarstr tabbarstr.ETABBAR_currentTab;
02471 _PAINTcontainer tabbarstr.ETABBAR_cont;
02472 0;
02473 }
02474
02475
02485 dsEdTabBar(tabbarstr){
02486 let sizelist tabbarstr.ETABBAR_lTab -> size in
02487 let 0 -> i in
02488 while i < size do
02489 (
02490 let nth_list tabbarstr.ETABBAR_lTab i -> tabstr in
02491 dsEdTab tabbarstr tabstr;
02492 set i = i + 1;
02493 );
02494
02495 set tabbarstr.ETABBAR_lTab = nil;
02496
02497 _DScompRollOver tabbarstr.ETABBAR_btnScrollL;
02498 set tabbarstr.ETABBAR_btnScrollL = nil;
02499 _DScompRollOver tabbarstr.ETABBAR_btnScrollR;
02500 set tabbarstr.ETABBAR_btnScrollR = nil;
02501 _DScontainer tabbarstr.ETABBAR_contScroll;
02502 set tabbarstr.ETABBAR_contScroll = nil;
02503
02504 _DScontainer tabbarstr.ETABBAR_cont;
02505 set tabbarstr.ETABBAR_cont = nil;
02506 0;
02507 }
02508
02509
02518 cbEdTabBarScrollLeft(cmpbtn, tabbarstr, x, y, btn, mask){
02519 set tabbarstr.ETABBAR_iScrollPos = if (tabbarstr.ETABBAR_iScrollPos - 1) <=0 then 0 else tabbarstr.ETABBAR_iScrollPos - 1;
02520 let nth_list tabbarstr.ETABBAR_lTab tabbarstr.ETABBAR_iScrollPos -> tabstr in
02521 let _GETobjNodePositionSizeInFatherRef (_CONVERTcompCheckToObjNode tabstr.ETAB_chk) -> [cx _ w h] in
02522 let _GETobjNodePositionSizeInFatherRef tabbarstr.ETABBAR_node -> [nx ny _ _] in
02523 _CHANGEobjNodeCoordinates tabbarstr.ETABBAR_node [-cx ny] 1;
02524 0;
02525 }
02526
02527
02536 cbEdTabBarScrollRight(cmpbtn, tabbarstr, x, y, btn, mask){
02537 let getEdTabsLength tabbarstr tabbarstr.ETABBAR_iScrollPos -> width in
02538 let tabbarstr.ETABBAR_size -> [w _] in
02539 let _GETcontainerPositionSize tabbarstr.ETABBAR_contScroll -> [_ _ cw _] in
02540 if width <= (w - cw) then nil else
02541 (
02542 set tabbarstr.ETABBAR_iScrollPos = if tabbarstr.ETABBAR_iScrollPos >= ((sizelist tabbarstr.ETABBAR_lTab) - 1) then ((sizelist tabbarstr.ETABBAR_lTab) - 1) else tabbarstr.ETABBAR_iScrollPos + 1;
02543 let nth_list tabbarstr.ETABBAR_lTab tabbarstr.ETABBAR_iScrollPos -> tabstr in
02544 let _GETobjNodePositionSizeInFatherRef (_CONVERTcompCheckToObjNode tabstr.ETAB_chk) -> [cx _ w h] in
02545 let _GETobjNodePositionSizeInFatherRef tabbarstr.ETABBAR_node -> [nx ny _ _] in
02546 _CHANGEobjNodeCoordinates tabbarstr.ETABBAR_node [-cx ny] 1;
02547 );
02548 0;
02549 }
02550
02551
02560 makeEdTabBarScroll(tabbarstr){
02561 let _GETalphaBitmapSize tabbarstr.ETABBAR_theme.EDT_abmpTabLeft -> [blw blh] in
02562 let _GETalphaBitmapSize tabbarstr.ETABBAR_theme.EDT_abmpTabRight -> [brw brh] in
02563 let blh / 5 -> blh in
02564 let brh / 5 -> brh in
02565 let tabbarstr.ETABBAR_size -> [w h] in
02566 (
02567 set tabbarstr.ETABBAR_contScroll = _CRcontainerFromObjCont tabbarstr.ETABBAR_channel tabbarstr.ETABBAR_cont (w - (blw + brw)) 0 (blw + brw) blh CO_HIDE|CO_CHILDINSIDE|CO_NOBORDER|CO_NOCAPTION tabbarstr.ETABBAR_theme.EDT_iTabBarColor "";
02568 set tabbarstr.ETABBAR_btnScrollL = _CRcompRollOver tabbarstr.ETABBAR_channel tabbarstr.ETABBAR_contScroll nil [0 0] OBJ_ENABLE|OBJ_VISIBLE|ROL_MASK|ROL_DISABLE OBJ_CONTAINER_MOVE|OBJ_CONTAINER_KEYUP|OBJ_CONTAINER_KEYDOWN|OBJ_CONTAINER_MOUSEWHEEL|OBJ_CONTAINER_DBLCLICK tabbarstr.ETABBAR_theme.EDT_abmpTabLeft;
02569 set tabbarstr.ETABBAR_btnScrollR = _CRcompRollOver tabbarstr.ETABBAR_channel tabbarstr.ETABBAR_contScroll nil [blw 0] OBJ_ENABLE|OBJ_VISIBLE|ROL_MASK|ROL_DISABLE OBJ_CONTAINER_MOVE|OBJ_CONTAINER_KEYUP|OBJ_CONTAINER_KEYDOWN|OBJ_CONTAINER_MOUSEWHEEL|OBJ_CONTAINER_DBLCLICK tabbarstr.ETABBAR_theme.EDT_abmpTabRight;
02570 _CBcompRollOverUnClick tabbarstr.ETABBAR_btnScrollL @cbEdTabBarScrollLeft tabbarstr;
02571 _CBcompRollOverUnClick tabbarstr.ETABBAR_btnScrollR @cbEdTabBarScrollRight tabbarstr;
02572
02573 _PAINTcontainer tabbarstr.ETABBAR_contScroll;
02574 _TOPcontainer tabbarstr.ETABBAR_contScroll;
02575 );
02576 0;
02577 }
02578
02579
02596 crEdTabBarFromToolBar(tbstr, targetstr, x, y, w, h, margin, themestr){
02597 let if themestr == nil then (if EdDefaultTheme == nil then (set EdDefaultTheme = makeEdThemeResources tbstr.ETB_channel) else EdDefaultTheme) else themestr -> themestr in
02598
02599 let tbstr.ETB_size -> [tbw tbh] in
02600 let mkEdTabBar [tbstr.ETB_channel nil nil targetstr tbh [(tbstr.ETB_iCurrentLpos + x) y] [w h] (tbw - (tbstr.ETB_iCurrentLpos + x + w)) margin 0 nil themestr nil nil nil nil nil 0] -> tabbarstr in
02601 (
02602 set tbstr.ETB_tabBar = tabbarstr;
02603 set tabbarstr.ETABBAR_cont = _CRcontainerFromObjCont tabbarstr.ETABBAR_channel tbstr.ETB_cont (tbstr.ETB_iCurrentLpos + x) y w h CO_CHILDINSIDE|CO_NOBORDER|CO_NOCAPTION themestr.EDT_iTabBarColor "";
02604 set tabbarstr.ETABBAR_node = G2DcreateNode tabbarstr.ETABBAR_cont nil [0 0] w h nil 0xffffff 0 nil nil;
02605
02606 set tbstr.ETB_iCurrentLpos = tbstr.ETB_iCurrentLpos + x + w;
02607
02608 makeEdTabBarScroll tabbarstr;
02609
02610 _PAINTcontainer tabbarstr.ETABBAR_cont;
02611 tabbarstr;
02612 );
02613 }
02614
02615
02616
02617
02618
02631 cbEdToolBarToolTipHide(node, t, bubble){
02632 let switch t.ETB_lTooltip node -> [tpcont tptext] in
02633 (
02634 _DScompText tptext;
02635 _DScontainer tpcont;
02636 set t.ETB_lTooltip = G2DremoveEdIdxFromList t.ETB_lTooltip node;
02637 );
02638 0;
02639 }
02640
02641
02656 cbEdToolBarToolTipShow(node, t, bubble, dx, dy){
02657 let switch t.ETB_lTooltip node -> [tpcont tptext] in
02658 if tpcont == nil then nil else
02659 (
02660 _DScompText tptext;
02661 _DScontainer tpcont;
02662 set t.ETB_lTooltip = G2DremoveEdIdxFromList t.ETB_lTooltip node;
02663 );
02664
02665 let G2DgetStringSize t.ETB_fontTooltip bubble -> [w h] in
02666 let _GETscreenSize -> [sw sh] in
02667 let sh - 40 -> sh in
02668 let _GETscreenPos -> [sx sy] in
02669 let [16 16] -> [xdecal ydecal] in
02670 let if (sx + w + 4 + xdecal) > sw then (sw - (w + 4) - xdecal) else sx + xdecal -> x in
02671 let if (sy + h + 4 + ydecal) > sh then (sh - (h + 4) - ydecal) else sy + ydecal -> y in
02672 let (_CRcontainerFromObjWin t.ETB_channel t.ETB_win x y w+4 h+4 CO_NOCAPTION 0xffffff nil) -> tpcont in
02673 let _CRcompText t.ETB_channel tpcont nil [2 2] CT_LABEL|CT_CENTER|OBJ_VISIBLE nil w h bubble t.ETB_fontTooltip [0 nil nil nil] nil nil nil -> tptext in
02674 (
02675 set t.ETB_lTooltip = [node [tpcont tptext]]::t.ETB_lTooltip;
02676 _PAINTcontainer tpcont;
02677 );
02678 0;
02679 }
02680
02681
02690 cbEdToolBarTextResize(ctext, param, w, h){
02691 0;
02692 }
02693
02694
02707 setEdToolBarText(t, cmptxt, val, txtcolor){
02708 let switch t.ETB_lText cmptxt -> font in
02709 let _GETstringSize font val -> [w h] in
02710 (
02711 _SETcompText cmptxt val font [txtcolor 0 0 0] 0;
02712 _SIZEobjNode _CONVERTcompTextToObjNode cmptxt w h 0;
02713
02714 let _GETcontainerPositionSize t.ETB_cont -> [_ _ cw ch] in
02715 (
02716 set t.ETB_iCurrentLpos = 0;
02717 set t.ETB_iCurrentRpos = cw;
02718 set t.ETB_iCurrentTpos = 0;
02719 set t.ETB_iCurrentBpos = ch;
02720 );
02721
02722 let sizelist t.ETB_lControl -> size in
02723 let 0 -> i in
02724 while i < size do
02725 (
02726 let nth_list t.ETB_lControl i -> [node align] in
02727 let _GETobjNodePositionSizeInContainerRef node -> [_ _ nw nh] in
02728 let
02729 if align == ETB_ALIGN_RIGHT then
02730 [(set t.ETB_iCurrentRpos = t.ETB_iCurrentRpos - t.ETB_iHmargin - nw) t.ETB_iVmargin]
02731 else if align == ETB_ALIGN_TOP then
02732 [t.ETB_iHmargin ((set t.ETB_iCurrentTpos = t.ETB_iCurrentTpos + t.ETB_iVmargin + nh) - nh)]
02733 else if align == ETB_ALIGN_BOTTOM then
02734 [t.ETB_iHmargin (set t.ETB_iCurrentBpos = t.ETB_iCurrentBpos - t.ETB_iVmargin - nh)]
02735 else
02736 [((set t.ETB_iCurrentLpos = t.ETB_iCurrentLpos + t.ETB_iHmargin + nw) - nw) t.ETB_iVmargin]
02737 -> npos in
02738 _CHANGEobjNodeCoordinates node npos 0;
02739
02740 set i = i + 1;
02741 );
02742 _PAINTcontainer t.ETB_cont;
02743 );
02744 0;
02745 }
02746
02747
02764 crEdToolBarText(t, txt, fontname, fontsize, fontflag, txtcolor, flags, align){
02765 let _CRfont t.ETB_channel fontsize 0 (if fontflag == nil then 0 else fontflag) fontname -> font in
02766 let if flags == nil then OBJ_ENABLE|OBJ_VISIBLE|CT_LEFT|CT_LABEL else flags|OBJ_ENABLE|OBJ_VISIBLE -> flags in
02767 let _GETstringSize font txt -> [w h] in
02768 let
02769 if align == ETB_ALIGN_RIGHT then
02770 [(set t.ETB_iCurrentRpos = t.ETB_iCurrentRpos - t.ETB_iHmargin - w) t.ETB_iVmargin]
02771 else if align == ETB_ALIGN_TOP then
02772 [t.ETB_iHmargin ((set t.ETB_iCurrentTpos = t.ETB_iCurrentTpos + t.ETB_iVmargin + h) - h)]
02773 else if align == ETB_ALIGN_BOTTOM then
02774 [t.ETB_iHmargin (set t.ETB_iCurrentBpos = t.ETB_iCurrentBpos - t.ETB_iVmargin - h)]
02775 else
02776 [((set t.ETB_iCurrentLpos = t.ETB_iCurrentLpos + t.ETB_iHmargin + w) - w) t.ETB_iVmargin]
02777 -> [x y] in
02778 let _CRcompText t.ETB_channel t.ETB_cont nil [x y] flags OBJ_CONTAINER_MOVE|OBJ_CONTAINER_KEYUP|OBJ_CONTAINER_KEYDOWN|OBJ_CONTAINER_MOUSEWHEEL|OBJ_CONTAINER_DBLCLICK w h txt font [txtcolor 0 0 0] nil nil nil -> text in
02779 (
02780 _CBcompTextResize text @cbEdToolBarTextResize [t nil] nil nil nil nil;
02781 set t.ETB_lText = [text font]::t.ETB_lText;
02782 set t.ETB_lControl = G2Dlcat t.ETB_lControl [(_CONVERTcompTextToObjNode text) align]::nil;
02783 text;
02784 );
02785 }
02786
02787
02796 cbEdToolBarCheckClick(check, param, x, y, btn, mask){
02797 let param -> [t cbclick] in
02798 let _GETcompCheckState check -> state in
02799 exec cbclick with [t check btn mask state];
02800 0;
02801 }
02802
02803
02812 cbEdToolBarCheckIn(croll, param, x, y, mask){
02813 0;
02814 }
02815
02816
02825 cbEdToolBarCheckOut(croll, param, x, y, mask){
02826 0;
02827 }
02828
02829
02838 cbEdToolBarCheckResize(croll, param, w, h){
02839 0;
02840 }
02841
02842
02854 setEdToolBarCheckState(t, chk, state){
02855 _SETcompCheckState chk state;
02856 _PAINTcontainer t.ETB_cont;
02857 0;
02858 }
02859
02860
02872 setEdToolBarCheckEnable(t, chk, state){
02873 let if state then OBJ_ENABLE else OBJ_DISABLE -> state in
02874 _CHANGEobjNodeFlags (_CONVERTcompCheckToObjNode chk) OBJ_VISIBLE|ROL_MASK|ROL_DISABLE|state 1;
02875 _PAINTcontainer t.ETB_cont;
02876 0;
02877 }
02878
02879
02891 setEdToolBarCheckCbClick(t, check, cbclick){
02892 _CBcompCheckUnClick check @cbEdToolBarCheckClick [t cbclick];
02893 0;
02894 }
02895
02896
02910 crEdToolBarCheck(t, abmp, align, bubble, cbclick){
02911 let _GETalphaBitmapSize abmp -> [bw bh] in
02912 let [(bw / 2) (bh / 5)] -> [w h] in
02913 let
02914 if align == ETB_ALIGN_RIGHT then
02915 [(set t.ETB_iCurrentRpos = t.ETB_iCurrentRpos - t.ETB_iHmargin - w) t.ETB_iVmargin]
02916 else if align == ETB_ALIGN_TOP then
02917 [t.ETB_iHmargin ((set t.ETB_iCurrentTpos = t.ETB_iCurrentTpos + t.ETB_iVmargin + h) - h)]
02918 else if align == ETB_ALIGN_BOTTOM then
02919 [t.ETB_iHmargin (set t.ETB_iCurrentBpos = t.ETB_iCurrentBpos - t.ETB_iVmargin - h)]
02920 else
02921 [((set t.ETB_iCurrentLpos = t.ETB_iCurrentLpos + t.ETB_iHmargin + w) - w) t.ETB_iVmargin]
02922 -> [x y] in
02923 let _CRcompCheck t.ETB_channel t.ETB_cont nil [x y] OBJ_ENABLE|ROL_MASK|ROL_DISABLE OBJ_CONTAINER_MOVE|OBJ_CONTAINER_KEYUP|OBJ_CONTAINER_KEYDOWN|OBJ_CONTAINER_MOUSEWHEEL|OBJ_CONTAINER_DBLCLICK abmp -> check in
02924 (
02925 _CRtoolTip _CONVERTcompCheckToObjNode check 150 bubble @cbEdToolBarToolTipShow t @cbEdToolBarToolTipHide t;
02926 _CBcompCheckUnClick check @cbEdToolBarCheckClick [t cbclick];
02927 _CBcompCheckCursorMoveIn check @cbEdToolBarCheckIn [t nil];
02928 _CBcompCheckCursorMoveOut check @cbEdToolBarCheckOut [t nil];
02929 _CBcompCheckResize check @cbEdToolBarCheckResize [t nil];
02930 set t.ETB_lCheck = check::t.ETB_lCheck;
02931 set t.ETB_lControl = G2Dlcat t.ETB_lControl [(_CONVERTcompCheckToObjNode check) align]::nil;
02932 check;
02933 );
02934 }
02935
02936
02948 setEdToolBarButtonEnable(t, btn, state){
02949 let if state then OBJ_ENABLE else OBJ_DISABLE -> state in
02950 _CHANGEobjNodeFlags (_CONVERTcompRollOverToObjNode btn) OBJ_VISIBLE|ROL_MASK|ROL_DISABLE|state 1;
02951 _PAINTcontainer t.ETB_cont;
02952 0;
02953 }
02954
02955
02964 cbEdToolBarButtonClick(croll, param, x, y, btn, mask){
02965 let param -> [t cbclick] in
02966 exec cbclick with [t croll btn mask];
02967 0;
02968 }
02969
02970
02979 cbEdToolBarButtonIn(croll, param, x, y, mask){
02980 0;
02981 }
02982
02983
02992 cbEdToolBarButtonOut(croll, param, x, y, mask){
02993 0;
02994 }
02995
02996
03005 cbEdToolBarButtonResize(croll, param, w, h){
03006 0;
03007 }
03008
03009
03023 crEdToolBarButton(t, abmp, align, bubble, cbclick){
03024 let _GETalphaBitmapSize abmp -> [bw bh] in
03025 let [bw (bh / 5)] -> [w h] in
03026 let
03027 if align == ETB_ALIGN_RIGHT then
03028 [(set t.ETB_iCurrentRpos = t.ETB_iCurrentRpos - t.ETB_iHmargin - w) t.ETB_iVmargin]
03029 else if align == ETB_ALIGN_TOP then
03030 [t.ETB_iHmargin ((set t.ETB_iCurrentTpos = t.ETB_iCurrentTpos + t.ETB_iVmargin + h) - h)]
03031 else if align == ETB_ALIGN_BOTTOM then
03032 [t.ETB_iHmargin (set t.ETB_iCurrentBpos = t.ETB_iCurrentBpos - t.ETB_iVmargin - h)]
03033 else
03034 [((set t.ETB_iCurrentLpos = t.ETB_iCurrentLpos + t.ETB_iHmargin + w) - w) t.ETB_iVmargin]
03035 -> [x y] in
03036 let _CRcompRollOver t.ETB_channel t.ETB_cont nil [x y] OBJ_ENABLE|OBJ_VISIBLE|ROL_MASK|ROL_DISABLE OBJ_CONTAINER_MOVE|OBJ_CONTAINER_KEYUP|OBJ_CONTAINER_KEYDOWN|OBJ_CONTAINER_MOUSEWHEEL|OBJ_CONTAINER_DBLCLICK abmp -> button in
03037 (
03038 _CRtoolTip _CONVERTcompRollOverToObjNode button 150 bubble @cbEdToolBarToolTipShow t @cbEdToolBarToolTipHide t;
03039 _CBcompRollOverUnClick button @cbEdToolBarButtonClick [t cbclick];
03040 _CBcompRollOverCursorMoveIn button @cbEdToolBarButtonIn [t nil];
03041 _CBcompRollOverCursorMoveOut button @cbEdToolBarButtonOut [t nil];
03042 _CBcompRollOverResize button @cbEdToolBarButtonResize [t nil];
03043 set t.ETB_lButton = button::t.ETB_lButton;
03044 set t.ETB_lControl = G2Dlcat t.ETB_lControl [(_CONVERTcompRollOverToObjNode button) align]::nil;
03045 button;
03046 );
03047 }
03048
03049
03058 cbEdToolBarBmpClick(bmp, p, x, y, btn, mask){
03059 let p -> [t cbclick] in
03060 exec cbclick with [t btn mask 0];
03061 0;
03062 }
03063
03064
03073 cbEdToolBarBmpDbClick(bmp, p, x, y, btn, mask){
03074 let p -> [t cbclick] in
03075 exec cbclick with [t btn mask 1];
03076 0;
03077 }
03078
03079
03093 crEdToolBarBitmap(t, abmp, align, bubble, cbclick){
03094 let _GETalphaBitmapSize abmp -> [w h] in
03095 let
03096 if align == ETB_ALIGN_RIGHT then
03097 [(set t.ETB_iCurrentRpos = t.ETB_iCurrentRpos - t.ETB_iHmargin - w) t.ETB_iVmargin]
03098 else if align == ETB_ALIGN_TOP then
03099 [t.ETB_iHmargin ((set t.ETB_iCurrentTpos = t.ETB_iCurrentTpos + t.ETB_iVmargin + h) - h)]
03100 else if align == ETB_ALIGN_BOTTOM then
03101 [t.ETB_iHmargin (set t.ETB_iCurrentBpos = t.ETB_iCurrentBpos - t.ETB_iVmargin - h)]
03102 else
03103 [((set t.ETB_iCurrentLpos = t.ETB_iCurrentLpos + t.ETB_iHmargin + w) - w) t.ETB_iVmargin]
03104 -> [x y] in
03105 let _CRcompBitmap t.ETB_channel t.ETB_cont nil [x y] OBJ_ENABLE OBJ_CONTAINER_MOVE|OBJ_CONTAINER_KEYUP|OBJ_CONTAINER_KEYDOWN|OBJ_CONTAINER_MOUSEWHEEL|OBJ_CONTAINER_DBLCLICK abmp 0 0 w h -> bmp in
03106 (
03107 _CRtoolTip _CONVERTcompBitmapToObjNode bmp 150 bubble @cbEdToolBarToolTipShow t @cbEdToolBarToolTipHide t;
03108 _CBcompBitmapClick bmp @cbEdToolBarBmpClick [t cbclick];
03109 _CBcompBitmapDblClick bmp @cbEdToolBarBmpDbClick [t cbclick];
03110 set t.ETB_lBmp = bmp::t.ETB_lBmp;
03111 set t.ETB_lControl = G2Dlcat t.ETB_lControl [(_CONVERTcompBitmapToObjNode bmp) align]::nil;
03112 bmp;
03113 );
03114 }
03115
03116
03128 dsEdToolBar(win, tbstr){
03129 _DSwindow tbstr.ETB_win;
03130 _DScontainer tbstr.ETB_cont;
03131
03132 set tbstr.ETB_win = nil;
03133 set tbstr.ETB_cont = nil;
03134
03135 let sizelist tbstr.ETB_lButton -> size in
03136 let 0 -> i in
03137 while i < size do
03138 (
03139 let nth_list tbstr.ETB_lButton i -> btn in
03140 _DScompRollOver btn;
03141
03142 set i = i + 1;
03143 );
03144
03145 let sizelist tbstr.ETB_lBmp -> size in
03146 let 0 -> i in
03147 while i < size do
03148 (
03149 let nth_list tbstr.ETB_lBmp i -> bmp in
03150 _DScompBitmap bmp;
03151
03152 set i = i + 1;
03153 );
03154
03155 let sizelist tbstr.ETB_lCheck -> size in
03156 let 0 -> i in
03157 while i < size do
03158 (
03159 let nth_list tbstr.ETB_lCheck i -> chk in
03160 _DScompCheck chk;
03161
03162 set i = i + 1;
03163 );
03164
03165 let sizelist tbstr.ETB_lText -> size in
03166 let 0 -> i in
03167 while i < size do
03168 (
03169 let nth_list tbstr.ETB_lText i -> [txt font] in
03170 (
03171 _DScompText txt;
03172 _DSfont font;
03173 );
03174
03175 set i = i + 1;
03176 );
03177
03178 let sizelist tbstr.ETB_lTooltip -> size in
03179 let 0 -> i in
03180 while i < size do
03181 (
03182 let nth_list tbstr.ETB_lTooltip i -> [_ [cont text]] in
03183 (
03184 _DScompText text;
03185 _DScontainer cont;
03186 );
03187
03188 set i = i + 1;
03189 );
03190
03191
03192 dsEdTabBar tbstr.ETB_tabBar;
03193 set tbstr.ETB_tabBar = nil;
03194
03195 set tbstr.ETB_lControl = nil;
03196
03197 _DSfont tbstr.ETB_fontTooltip;
03198 set tbstr.ETB_fontTooltip = nil;
03199 0;
03200 }
03201
03202
03213 dsEdToolBarList(l){
03214 let sizelist l -> size in
03215 let 0 -> i in
03216 while i < size do
03217 (
03218 let nth_list l i -> elt in
03219 dsEdToolBar nil elt;
03220
03221 set i = i + 1;
03222 );
03223 0;
03224 }
03225
03226
03240 sizeEdToolBar(t, x, y, w, h){
03241 _SIZEwindow t.ETB_win w h x y;
03242 _SIZEcontainer t.ETB_cont 0 0 w h;
03243
03244 set t.ETB_iCurrentLpos = 0;
03245 set t.ETB_iCurrentRpos = w;
03246 set t.ETB_iCurrentTpos = 0;
03247 set t.ETB_iCurrentBpos = h;
03248
03249 set t.ETB_size = [w h];
03250
03251 let sizelist t.ETB_lControl -> size in
03252 let 0 -> i in
03253 while i < size do
03254 (
03255 let nth_list t.ETB_lControl i -> [node align] in
03256 let _GETobjNodePositionSizeInContainerRef node -> [_ _ nw nh] in
03257 let
03258 if align == ETB_ALIGN_RIGHT then
03259 [(set t.ETB_iCurrentRpos = t.ETB_iCurrentRpos - t.ETB_iHmargin - nw) t.ETB_iVmargin]
03260 else if align == ETB_ALIGN_TOP then
03261 [t.ETB_iHmargin ((set t.ETB_iCurrentTpos = t.ETB_iCurrentTpos + t.ETB_iVmargin + nh) - nh)]
03262 else if align == ETB_ALIGN_BOTTOM then
03263 [t.ETB_iHmargin (set t.ETB_iCurrentBpos = t.ETB_iCurrentBpos - t.ETB_iVmargin - nh)]
03264 else
03265 [((set t.ETB_iCurrentLpos = t.ETB_iCurrentLpos + t.ETB_iHmargin + nw) - nw) t.ETB_iVmargin]
03266 -> npos in
03267 _CHANGEobjNodeCoordinates node npos 0;
03268
03269 set i = i + 1;
03270 );
03271
03272 resizeEdTabBar t.ETB_tabBar w h;
03273
03274 _PAINTcontainer t.ETB_cont;
03275 _TOPwindow t.ETB_win;
03276 _TOPcontainer t.ETB_cont;
03277 0;
03278 }
03279
03280
03290 paintEdToolBar(t){
03291 _TOPwindow t.ETB_win;
03292 _TOPcontainer t.ETB_cont;
03293 _PAINTcontainer t.ETB_cont;
03294 0;
03295 }
03296
03297
03306 cbEdToolBarDbClick(cont, p, x, y, btn, mask){
03307 let p -> [t cbfun] in
03308 exec cbfun with [t x y btn mask];
03309 0;
03310 }
03311
03312
03323 setEdToolBarDbClick(t, cbfun){
03324 _CBcontainerDblClick t.ETB_cont @cbEdToolBarDbClick [t cbfun];
03325 0;
03326 }
03327
03328
03337 cbEdToolBarClick(cont, p, x, y, btn, mask){
03338 let p -> [t cbfun] in
03339 exec cbfun with [t x y btn mask];
03340 0;
03341 }
03342
03343
03354 setEdToolBarClick(t, cbfun){
03355 _CBcontainerClick t.ETB_cont @cbEdToolBarClick [t cbfun];
03356 0;
03357 }
03358
03359
03370 setEdToolBarVisible(t, mode){
03371 let if !mode then WINDOW_HIDDEN else WINDOW_UNHIDDEN -> flag in
03372 (
03373 _SHOWwindow t.ETB_win flag;
03374 set t.ETB_bVisible = mode;
03375 );
03376 0;
03377 }
03378
03379
03399 crEdToolBar(chan, father, x, y, w, h, hmargin, vmargin, bgcolor, mode){
03400 let if father == nil then WN_MENU else WN_CHILDINSIDE|WN_NOCAPTION|WN_NOBORDER -> flag in
03401 let _CRwindow chan father x y w h flag "" -> win in
03402 let _CRcontainerFromObjWin chan win 0 0 w h CO_CHILDINSIDE|CO_NOBORDER bgcolor "toolbar" -> cont in
03403 let mkEdToolBar[chan win cont [x y] [w h] mode bgcolor hmargin vmargin nil nil nil nil nil nil nil nil nil nil nil nil 1] -> t in
03404 (
03405 set t.ETB_iCurrentLpos = 0;
03406 set t.ETB_iCurrentRpos = w;
03407 set t.ETB_iCurrentTpos = 0;
03408 set t.ETB_iCurrentBpos = h;
03409 set t.ETB_fontTooltip = _CRfont chan 8 0 FF_PIXEL "Arial";
03410 _CBwinDestroy win @dsEdToolBar t;
03411 _TOPwindow t.ETB_win;
03412 _TOPcontainer t.ETB_cont;
03413 _PAINTcontainer t.ETB_cont;
03414 t;
03415 );
03416 }
03417
03418
03419
03420
03421
03422
03423
03433 getEdWindowVisibleState(winstr){
03434 winstr.EDW_bVisible;
03435 }
03436
03437
03448 setEdWindowCtrl3dEnable(winstr, state){
03449 let sizelist winstr.EDW_lControl -> size in
03450 let 0 -> i in
03451 while i < size do
03452 (
03453 let nth_list winstr.EDW_lControl i -> ctrlstr in
03454 if ctrlstr.EDC_view3d == nil then nil else
03455 V3DEnableRender ctrlstr.EDC_view3d state;
03456
03457 set i = i + 1;
03458 );
03459
03460 let sizelist winstr.EDW_lSons -> size in
03461 let 0 -> i in
03462 while i < size do
03463 (
03464 let nth_list winstr.EDW_lSons i -> sonstr in
03465 setEdWindowCtrl3dEnable sonstr state;
03466
03467 set i = i + 1;
03468 );
03469 0;
03470 }
03471
03472
03483 setEdWindowVisible(winstr, state){
03484 let if !state then 0 else 1 -> state in
03485 (
03486 set winstr.EDW_bVisible = state;
03487 _SHOWwindow winstr.EDW_win if !state then WINDOW_HIDDEN else WINDOW_UNHIDDEN;
03488
03489 setEdWindowCtrl3dEnable winstr state;
03490 );
03491 0;
03492 }
03493
03494
03504 setEdWindowFocus(winstr){
03505 _SETfocus winstr.EDW_win;
03506 0;
03507 }
03508
03509
03519 setEdWindowTop(winstr){
03520 _TOPwindow winstr.EDW_win;
03521 0;
03522 }
03523
03524
03534 setEdWindowTopMost(winstr){
03535 _TOPMOSTwindow winstr.EDW_win 3 1;
03536 _TOPMOSTwindow winstr.EDW_win 1 1;
03537 0;
03538 }
03539
03540
03551 setEdWindowName(winstr, name){
03552 _SETwindowName winstr.EDW_win name;
03553 0;
03554 }
03555
03556
03566 getEdWindowToolBarSize(winstr){
03567 let sizelist winstr.EDW_lToolbar -> size in
03568 let 0 -> xdecal in
03569 let 0 -> ydecal in
03570 let 0 -> i in
03571 (
03572 while i < size do
03573 (
03574 let nth_list winstr.EDW_lToolbar i -> tb in
03575 if !tb.ETB_bVisible then nil else
03576 (
03577 let tb.ETB_size -> [tw th] in
03578 if tb.ETB_modeflag & ETB_VERTICAL then
03579 set xdecal = xdecal + tw
03580 else if tb.ETB_modeflag & ETB_HORIZONTAL then
03581 set ydecal = ydecal + th
03582 else nil;
03583 );
03584
03585 set i = i + 1;
03586 );
03587 [xdecal ydecal]
03588 );
03589 }
03590
03591
03603 resizeEdWindowToolBar(winstr, w, h){
03604 let sizelist winstr.EDW_lToolbar -> size in
03605 let 0 -> i in
03606 while i < size do
03607 (
03608 let nth_list winstr.EDW_lToolbar i -> elem in
03609 let elem.ETB_pos -> [tx ty] in
03610 let elem.ETB_size -> [tw th] in
03611 if elem.ETB_modeflag == nil then nil else
03612 let if elem.ETB_modeflag & ETB_VERTICAL then [tw (h - ty)] else [(w - tx) th] -> [tbw tbh] in
03613 sizeEdToolBar elem tx ty tbw tbh;
03614
03615 set i = i + 1;
03616 );
03617 0;
03618 }
03619
03620
03631 dsEdWindowToolBar(winstr, tbstr){
03632 set winstr.EDW_lToolbar = G2DremoveFromList winstr.EDW_lToolbar tbstr;
03633 dsEdToolBar nil tbstr;
03634 0;
03635 }
03636
03637
03657 crEdWindowToolBar(winstr, x, y, w, h, hmargin, vmargin, bgcolor, mode){
03658 let crEdToolBar winstr.EDW_channel winstr.EDW_win x y w h hmargin vmargin bgcolor mode -> tbstr in
03659 (
03660 set winstr.EDW_lToolbar = tbstr::winstr.EDW_lToolbar;
03661 tbstr;
03662 );
03663 }
03664
03665
03676 calcEdWindowGroupSonPos(winstr){
03677 let sizelist winstr.EDW_lSons -> size in
03678 let nil -> newy in
03679 let 0 -> i in
03680 (
03681 while i < size do
03682 (
03683 let nth_list winstr.EDW_lSons i -> sonstr in
03684 if (sonstr.EDW_modeFlag & EDWIN_DIALOG) || (sonstr.EDW_modeFlag & EDWIN_POPUP) then nil else
03685 let _GETwindowExPositionSize sonstr.EDW_win -> [x y w h] in
03686 set newy = (if newy == nil then y else newy) + h;
03687
03688 set i = i + 1;
03689 );
03690 newy;
03691 );
03692 }
03693
03694
03705 updateEdGroupWindowSons(winstr){
03706 if !(winstr.EDW_modeFlag & EDWIN_GROUP) then nil else
03707 let sizelist winstr.EDW_lSons -> size in
03708 let nil -> newy in
03709 let 0 -> i in
03710 (
03711 while i < size do
03712 (
03713 let nth_list winstr.EDW_lSons i -> sonstr in
03714 if (sonstr.EDW_modeFlag & EDWIN_DIALOG) || (sonstr.EDW_modeFlag & EDWIN_POPUP) then nil else
03715 let _GETwindowExPositionSize sonstr.EDW_win -> [x y w h] in
03716 (
03717 set newy = if newy == nil then y else newy;
03718 _SIZEwindowEx sonstr.EDW_win w h x newy;
03719 set newy = newy + h;
03720 );
03721
03722 set i = i + 1;
03723 );
03724 );
03725 0;
03726 }
03727
03728
03739 getEdFrameYpos(winstr){
03740 if !(winstr.EDW_father.EDW_modeFlag & EDWIN_GROUP) then nil else
03741 let sizelist winstr.EDW_father.EDW_lSons -> size in
03742 let nil -> newy in
03743 let 0 -> i in
03744 let nil -> sonstr in
03745 (
03746 while i < size && sonstr != winstr do
03747 (
03748 set sonstr = nth_list winstr.EDW_father.EDW_lSons i;
03749 if sonstr == winstr then nil else
03750 if (sonstr.EDW_modeFlag & EDWIN_DIALOG) || (sonstr.EDW_modeFlag & EDWIN_POPUP) then nil else
03751 let _GETwindowExPositionSize sonstr.EDW_win -> [x y w h] in
03752 (
03753 set newy = if newy == nil then y else newy;
03754 set newy = newy + h;
03755 );
03756
03757 set i = i + 1;
03758 );
03759 newy;
03760 );
03761 }
03762
03763
03774 calcEdCoord(winstr){
03775 let if winstr.EDW_father == nil then
03776 let _GETscreenSize -> [ww hh] in
03777 [ww hh-40]
03778 else
03779 let _GETwindowPositionSize winstr.EDW_father.EDW_win -> [_ _ ww hh] in
03780 [ww hh]
03781 -> [fw fh] in
03782 let _GETwindowPositionSize winstr.EDW_win -> [x y w h] in
03783 set winstr.EDW_coords = [x y (fw-(x + w)) (fh-(y+h)) w h];
03784 0;
03785 }
03786
03787
03796 calcEdWindowDim(typ,x1,w,x2,l){
03797 let max 1 (if typ&1 then x1 else 0)+(if typ&2 then w else 0)+(if typ&4 then x2 else 0) -> sum in
03798 let (x1 * ((l-x1-x2-w)+sum)) / sum -> xx in
03799 let (w * ((l-x1-x2-w)+sum)) / sum -> ww in
03800 [(if typ&1 then xx else x1) (if typ&2 then ww else w)];
03801 }
03802
03803
03814 calcEdWindowSizePos(winstr){
03815 let winstr.EDW_coords -> [x1 y1 x2 y2 w h] in
03816 if !winstr.EDW_resizeFlag then
03817 [x1 y1 w h]
03818 else
03819 let if winstr.EDW_father==nil then
03820 let _GETscreenSize -> [tw th] in
03821 [tw th-40]
03822 else let _GETwindowSizePosition winstr.EDW_father.EDW_win -> [tw th _ _] in
03823 if tw == 0 || th == 0 then let winstr.EDW_father.EDW_coords -> [_ _ _ _ sw sh] in [sw sh] else [tw th]
03824 -> [fw fh] in
03825 (
03826 let calcEdWindowDim winstr.EDW_resizeFlag x1 w x2 fw -> [xx ww] in
03827 let calcEdWindowDim winstr.EDW_resizeFlag>>3 y1 h y2 fh -> [yy hh] in
03828 [xx yy ww hh]
03829 );
03830 }
03831
03832
03843 calcEdCtrlSizePos(ctrlstr){
03844 let ctrlstr.EDC_coords -> [x1 y1 x2 y2 w h] in
03845 let ctrlstr.EDC_father.EDW_coords -> [_ _ _ _ ow oh] in
03846 let if w < 0 then (ow - (abs w)) else w -> w in
03847 let if h < 0 then (oh - (abs h)) else h -> h in
03848
03849 let _GETwindowSizePosition ctrlstr.EDC_father.EDW_win -> [fw fh _ _] in
03850 (
03851 let calcEdWindowDim ctrlstr.EDC_resizeFlag x1 w x2 fw -> [xx ww] in
03852 let calcEdWindowDim ctrlstr.EDC_resizeFlag>>3 y1 h y2 fh -> [yy hh] in
03853 [xx yy ww hh]
03854 );
03855 }
03856
03857
03868 getEdVirtualWindowSize(winstr){
03869 let _GETwindowPositionSize winstr.EDW_virtualWin -> [_ _ w h] in
03870 [w h];
03871 }
03872
03873
03884 getEdVirtualWindowPos(winstr){
03885 let _GETwindowPositionSize winstr.EDW_virtualWin -> [x y _ _] in
03886 [x y];
03887 }
03888
03889
03900 getEdWindowSize(winstr){
03901 let _GETwindowPositionSize winstr.EDW_win -> [x y w h] in
03902 [w h];
03903 }
03904
03905
03916 getEdWindowPos(winstr){
03917 let _GETwindowPositionSize winstr.EDW_win -> [x y w h] in
03918 [x y];
03919 }
03920
03921
03932 getEdWindowPosSize(winstr){
03933 let _GETwindowPositionSize winstr.EDW_win -> [x y w h] in
03934 [x y w h];
03935 }
03936
03937
03948 getEdWindowResizeFlags(winstr){
03949 winstr.EDW_resizeFlag;
03950 }
03951
03952
03963 resizeEdWindowVirtualSize(winstr){
03964 if winstr.EDW_virtualWin == nil then nil else
03965 let _GETwindowPositionSize winstr.EDW_virtualWin -> [ox oy _ _] in
03966 let _GETwindowPositionSize winstr.EDW_win -> [_ _ minw minh] in
03967 let minw -> neww in
03968 let minh -> newh in
03969 (
03970 let sizelist winstr.EDW_lSons -> size in
03971 let 0 -> i in
03972 (
03973 while i < size do
03974 (
03975 let nth_list winstr.EDW_lSons i -> sonstr in
03976 if sonstr.EDW_modeFlag & EDWIN_DIALOG then nil else
03977 let _GETwindowExPositionSize sonstr.EDW_win -> [x y w h] in
03978 let x + w -> nw in
03979 let y + h -> nh in
03980 let if nw > neww then nw else neww -> nnw in
03981 let if nh > newh then nh else newh -> nnh in
03982 (
03983 set neww = nnw;
03984 set newh = nnh;
03985 );
03986
03987 set i = i + 1;
03988 );
03989 _SIZEwindow winstr.EDW_virtualWin neww newh ox oy;
03990 );
03991 );
03992 0;
03993 }
03994
03995
04006 resizeEdWindow(winstr){
04007 if (winstr.EDW_resizeFlag == nil) || (winstr.EDW_resizeFlag == EDWIN_RESIZE_NONE) || (winstr.EDW_modeFlag & EDWIN_DIALOG) && !(winstr.EDW_modeFlag & EDWIN_FRAME) then nil else
04008 if winstr.EDW_modeFlag & EDWIN_TAB then
04009 (
04010 let getEdWindowToolBarSize winstr.EDW_father -> [xdecal ydecal] in
04011 let getEdWindowSize winstr.EDW_father -> [w h] in
04012 _SIZEwindow winstr.EDW_win (w - xdecal) (h - ydecal) xdecal ydecal;
04013 0;
04014 )
04015 else if winstr.EDW_bMinimize != 1 then
04016 (
04017 let calcEdWindowSizePos winstr -> [x y w h] in
04018 let if (winstr.EDW_modeFlag & EDWIN_FRAME) then getEdFrameYpos winstr else y -> y in
04019 _SIZEwindow winstr.EDW_win w h x y;
04020 0;
04021 )
04022 else if (winstr.EDW_bMinimize) && (winstr.EDW_modeFlag & EDWIN_FRAME) then
04023 (
04024 let hd winstr.EDW_lToolbar -> tbstr in
04025 let tbstr.ETB_size -> [tw th] in
04026 let calcEdWindowSizePos winstr -> [x y w h] in
04027 let getEdFrameYpos winstr -> y in
04028 (
04029 _SIZEwindow winstr.EDW_win w th x y;
04030 0;
04031 );
04032 )
04033 else
04034 (
04035 let _GETwindowSizePosition winstr.EDW_father.EDW_win -> [w h _ _] in
04036 let winstr.EDW_tMdecal -> [hdecal vdecal] in
04037 let getEdWindowToolBarSize winstr.EDW_father -> [xdecal ydecal] in
04038 (
04039 _SIZEwindow winstr.EDW_win (w - xdecal) (h - ydecal) xdecal+hdecal ydecal+vdecal;
04040 _TOPwindow winstr.EDW_win;
04041 _SETfocus winstr.EDW_win;
04042 );
04043 0;
04044 );
04045 0;
04046 }
04047
04048
04062 setEdWindowPosSize(winstr, x, y, w, h){
04063 _SIZEwindow winstr.EDW_win w h x y;
04064 calcEdCoord winstr;
04065 0;
04066 }
04067
04068
04080 setEdWindowSize(winstr, w, h){
04081 let _GETwindowPositionSize winstr.EDW_win -> [x y _ _] in
04082 _SIZEwindow winstr.EDW_win w h x y;
04083 calcEdCoord winstr;
04084 0;
04085 }
04086
04087
04099 setEdWindowPos(winstr, x, y){
04100 let _GETwindowPositionSize winstr.EDW_win -> [_ _ w h] in
04101 _SIZEwindow winstr.EDW_win w h x y;
04102 calcEdCoord winstr;
04103 0;
04104 }
04105
04106
04120 setEdWindowPosSizeEx(winstr, x, y, w, h){
04121 _SIZEwindowEx winstr.EDW_win w h x y;
04122 calcEdCoord winstr;
04123 0;
04124 }
04125
04126
04138 setEdWindowSizeEx(winstr, w, h){
04139 let _GETwindowPositionSize winstr.EDW_win -> [x y _ _] in
04140 _SIZEwindowEx winstr.EDW_win w h x y;
04141 calcEdCoord winstr;
04142 0;
04143 }
04144
04145
04157 setEdWindowPosEx(winstr, x, y){
04158 let _GETwindowPositionSize winstr.EDW_win -> [_ _ w h] in
04159 _SIZEwindowEx winstr.EDW_win w h x y;
04160 calcEdCoord winstr;
04161 0;
04162 }
04163
04164
04178 setEdVirtualWindowPosSize(winstr, x, y, w, h){
04179 _SIZEwindow winstr.EDW_virtualWin w h x y;
04180 0;
04181 }
04182
04183
04195 setEdVirtualWindowSize(winstr, w, h){
04196 let _GETwindowPositionSize winstr.EDW_virtualWin -> [x y _ _] in
04197 _SIZEwindow winstr.EDW_virtualWin w h x y;
04198 0;
04199 }
04200
04201
04213 setEdVirtualWindowPos(winstr, x, y){
04214 let _GETwindowPositionSize winstr.EDW_virtualWin -> [_ _ w h] in
04215 _SIZEwindow winstr.EDW_virtualWin w h x y;
04216 0;
04217 }
04218
04219
04230 setEdWindowResizeFlags(winstr, flags){
04231 set winstr.EDW_resizeFlag = flags;
04232 calcEdCoord winstr;
04233 0;
04234 }
04235
04236
04250 cbEdVirtualWindowSize(win, winstr, wv, hv){
04251 exec winstr.EDW_cbVirtualSize with [winstr wv hv];
04252 0;
04253 }
04254
04255
04269 cbEdVirtualWindowMove(win, winstr, x, y){
04270 exec winstr.EDW_cbVirtualMove with [winstr x y];
04271 0;
04272 }
04273
04274
04288 cbEdWindowMove(win, winstr, x, y){
04289
04290 resizeEdWindowVirtualSize winstr.EDW_father;
04291 exec winstr.EDW_cbMove with [winstr x y];
04292 0;
04293 }
04294
04295
04309 updateEdCtrlSize(winstr){
04310 let sizelist winstr.EDW_lControl -> size in
04311 let 0 -> i in
04312 while i < size do
04313 (
04314 let nth_list winstr.EDW_lControl i -> ctrlstr in
04315 let ctrlstr.EDC_coords -> [_ _ _ _ cw ch] in
04316 let calcEdCtrlSizePos ctrlstr -> [x y w h] in
04317
04318 (
04319 if ctrlstr.EDC_label != nil then
04320
04321 let if h <= ch then ch else h -> h in
04322 (
04323 _POSITIONtext ctrlstr.EDC_label x y w h;
04324 0;
04325 )
04326 else if ctrlstr.EDC_editText != nil then
04327 (
04328 _POSITIONtext ctrlstr.EDC_editText x y w+1 h+1;
04329 0;
04330 )
04331 else if ctrlstr.EDC_editLine != nil then
04332
04333 let if h <= ch then ch else h -> h in
04334 (
04335 _POSITIONtext ctrlstr.EDC_editLine x y w+1 h+1;
04336 0;
04337 )
04338 else if ctrlstr.EDC_text != nil then
04339 (
04340 _POSITIONtext ctrlstr.EDC_text x y w+1 h+1;
04341 0;
04342 )
04343 else if ctrlstr.EDC_button != nil then
04344
04345 let if h <= ch then ch else h -> h in
04346 (
04347 _POSITIONbutton ctrlstr.EDC_button x y w h;
04348 0;
04349 )
04350 else if ctrlstr.EDC_check != nil then
04351
04352 let if h <= ch then ch else h -> h in
04353 (
04354 _POSITIONcheck ctrlstr.EDC_check x y w h;
04355 0;
04356 )
04357 else if ctrlstr.EDC_list != nil then
04358 (
04359 let ctrlstr.EDC_list -> [list _] in
04360 _POSITIONlist list x y w+1 h+1;
04361 0;
04362 )
04363 else if ctrlstr.EDC_select != nil then
04364
04365 let if h <= ch then ch else h -> h in
04366 (
04367 _POSITIONcombo ctrlstr.EDC_select x y w h;
04368 0;
04369 )
04370 else if ctrlstr.EDC_tree != nil then
04371 (
04372 let ctrlstr.EDC_tree -> [tree _ _ _ _] in
04373 _POSITIONtree tree x y w+1 h+1;
04374 0;
04375 )
04376 else if ctrlstr.EDC_bitmap != nil then
04377
04378 let if w <= cw then 2 else w -> w in
04379 let if h <= ch then 2 else h -> h in
04380 (
04381 let ctrlstr.EDC_bitmap -> [cont alphabmp ocbmp _ _] in
04382 _SIZEcontainer cont x y w h;
04383 0;
04384 )
04385 else if ctrlstr.EDC_bitmapList != nil then
04386
04387 let if w <= cw then 2 else w -> w in
04388 let if h <= ch then 2 else h -> h in
04389 (
04390 let ctrlstr.EDC_bitmapList -> [cont _ _ _ _ _ _] in
04391 _SIZEcontainer cont x y w h;
04392 0;
04393 )
04394 else if ctrlstr.EDC_editFloat != nil then
04395
04396 let if h <= ch then ch else h -> h in
04397 (
04398 let ctrlstr.EDC_editFloat -> [txt cont _ _ _ _ _ _ _ _ _ _ _] in
04399 let _GETcontainerExPositionSize cont -> [_ _ bw bh] in
04400 (
04401 _POSITIONtext txt x y ((w - bw) + 1) (h + 1);
04402 _MOVEcontainer cont (x + (w - bw)) y;
04403 );
04404 0;
04405 )
04406 else if ctrlstr.EDC_view3d != nil then
04407
04408 let if w <= 1 then 1 else w -> w in
04409 let if h <= 1 then 1 else h -> h in
04410 (
04411 V3DresizeView ctrlstr.EDC_view3d x y w h;
04412 0;
04413 )
04414 else if ctrlstr.EDC_colorButton != nil then
04415
04416 let if h <= ch then ch else h -> h in
04417 (
04418 let ctrlstr.EDC_colorButton -> [btn obmp winstr color mode cbfun] in
04419 let if !mode then (G2Drgb2bgr color) else G2Dbgra2bgr (G2Drgba2bgra color) -> bgrcolor in
04420 let _FILLbitmap _CRbitmap ctrlstr.EDC_channel w h bgrcolor -> bmp in
04421 (
04422 _DSbitmap obmp;
04423 _POSITIONbutton btn x y w h;
04424 _SETbuttonBitmap btn bmp;
04425 mutate ctrlstr.EDC_colorButton <- [_ bmp _ color _ _];
04426 _PAINTbutton btn;
04427 );
04428 0;
04429 )
04430 else nil;
04431 );
04432
04433 set i = i + 1;
04434 );
04435 0;
04436 }
04437
04438
04452 cbEdWindowSize(win, winstr, w, h){
04453 let sizelist winstr.EDW_lSons -> size in
04454 let 0 -> i in
04455 while i < size do
04456 (
04457 let nth_list winstr.EDW_lSons i -> son in
04458 resizeEdWindow son;
04459
04460 set i = i + 1;
04461 );
04462
04463
04464 updateEdGroupWindowSons winstr.EDW_father;
04465
04466
04467 resizeEdWindowVirtualSize winstr;
04468
04469
04470 resizeEdWindowVirtualSize winstr.EDW_father;
04471
04472
04473 updateEdCtrlSize winstr;
04474
04475
04476 let getEdWindowToolBarSize winstr.EDW_father -> [xdecal ydecal] in
04477 resizeEdWindowToolBar winstr (w - xdecal) (h - ydecal);
04478
04479 exec winstr.EDW_cbSize with [winstr w h];
04480 0;
04481 }
04482
04483
04495 maximizeOrMinimizeEdWindow(winstr, hdecal, vdecal){
04496 if winstr.EDW_bMinimize != 1 then
04497 (
04498 set winstr.EDW_bMinimize = 1;
04499 set winstr.EDW_tMdecal = [hdecal vdecal];
04500
04501 let _GETwindowSizePosition winstr.EDW_father.EDW_win -> [w h _ _] in
04502 let getEdWindowToolBarSize winstr.EDW_father -> [xdecal ydecal] in
04503 (
04504
04505 let sizelist winstr.EDW_father.EDW_lSons -> size in
04506 let 0 -> i in
04507 while i < size do
04508 (
04509 let nth_list winstr.EDW_father.EDW_lSons i -> brostr in
04510 if (brostr == winstr) || (brostr.EDW_modeFlag & EDWIN_DIALOG|EDWIN_POPUP) then nil else
04511 setEdWindowVisible brostr 0;
04512
04513 set i = i + 1;
04514 );
04515
04516 _SIZEwindow winstr.EDW_win (w - xdecal) (h - ydecal) xdecal+hdecal ydecal+vdecal;
04517 _TOPwindow winstr.EDW_win;
04518 _SETfocus winstr.EDW_win;
04519 );
04520 )
04521 else
04522 (
04523 set winstr.EDW_bMinimize = 0;
04524 set winstr.EDW_tMdecal = nil;
04525
04526
04527 let sizelist winstr.EDW_father.EDW_lSons -> size in
04528 let 0 -> i in
04529 while i < size do
04530 (
04531 let nth_list winstr.EDW_father.EDW_lSons i -> brostr in
04532 if brostr == winstr then nil else
04533 setEdWindowVisible brostr 1;
04534
04535 set i = i + 1;
04536 );
04537
04538 resizeEdWindow winstr;
04539
04540 _TOPwindow winstr.EDW_win;
04541 _SETfocus winstr.EDW_win;
04542 );
04543 0;
04544 }
04545
04546
04560 cbEdWindowKeyDown(win, winstr, key, scode){
04561 exec winstr.EDW_cbKeyDown with [winstr key scode];
04562
04563
04564 if (winstr.EDW_modeFlag & EDWIN_DIALOG) && key == 1 then
04565 dsEdWindow winstr
04566 else if (winstr.EDW_father.EDW_modeFlag & EDWIN_DIALOG) && key == 1 then
04567 dsEdWindow winstr.EDW_father
04568 else nil;
04569 0;
04570 }
04571
04572
04573 cbEdWindowDropFile(win, winstr, x, y, lp){
04574 exec winstr.EDW_cbDrop with [winstr x y lp];
04575 0;
04576 }
04577
04578
04591 cbEdWindowKeyUp(win, winstr, key){
04592 exec winstr.EDW_cbKeyUp with [winstr key];
04593 0;
04594 }
04595
04596
04597 setEdwindowCbKeyDown(winstr, cbfun){
04598 set winstr.EDW_cbKeyDown = cbfun;
04599 0;
04600 }
04601
04602
04603 setEdwindowCbKeyUp(winstr, cbfun){
04604 set winstr.EDW_cbKeyUp= cbfun;
04605 0;
04606 }
04607
04608
04609 setEdwindowCbSize(winstr, cbfun){
04610 set winstr.EDW_cbSize = cbfun;
04611 0;
04612 }
04613
04614
04615 setEdwindowCbMove(winstr, cbfun){
04616 set winstr.EDW_cbMove = cbfun;
04617 0;
04618 }
04619
04620
04621 setEdwindowCbVirtualMove(winstr, cbfun){
04622 set winstr.EDW_cbVirtualMove = cbfun;
04623 0;
04624 }
04625
04626
04627 setEdwindowCbVirtualSize(winstr, cbfun){
04628 set winstr.EDW_cbVirtualSize = cbfun;
04629 0;
04630 }
04631
04632
04633 setEdwindowCbDestroy(winstr, cbfun){
04634 set winstr.EDW_cbDestroy = cbfun;
04635 0;
04636 }
04637
04638
04639 setEdwindowCbClose(winstr, cbfun){
04640 set winstr.EDW_cbClose = cbfun;
04641 0;
04642 }
04643
04644
04645 setEdwindowCbDrop(winstr, cbfun){
04646 set winstr.EDW_cbDrop = cbfun;
04647 0;
04648 }
04649
04650
04651 dsEdWindow(winstr){
04652 dsEdToolBarList winstr.EDW_lToolbar;
04653 set winstr.EDW_lToolbar = nil;
04654
04655 let sizelist winstr.EDW_lSons -> size in
04656 let 0 -> i in
04657 while i < size do
04658 (
04659 let nth_list winstr.EDW_lSons i -> son in
04660 dsEdWindow son;
04661
04662 set i = i + 1;
04663 );
04664
04665 exec winstr.EDW_cbDestroy with [winstr];
04666
04667
04668 set winstr.EDW_father.EDW_lSons = G2DremoveFromList winstr.EDW_father.EDW_lSons winstr;
04669
04670 if winstr.EDW_virtualWin == nil then nil else
04671 _DSwindow winstr.EDW_virtualWin;
04672
04673 dsEdWindowCtrlList winstr.EDW_lControl;
04674
04675 if !(winstr.EDW_modeFlag & EDWIN_MODAL) then nil else
04676 _ENwindow winstr.EDW_father.EDW_win 1;
04677
04678 _DSwindow winstr.EDW_win;
04679 0;
04680 }
04681
04682
04683 cbEdWindowClose(win, winstr){
04684 if winstr.EDW_cbClose != nil then
04685 exec winstr.EDW_cbClose with [winstr]
04686 else
04687 dsEdWindow winstr;
04688 0;
04689 }
04690
04691
04692 cbEdWindowDestroy(win, winstr){
04693 dsEdWindow winstr;
04694 0;
04695 }
04696
04697
04698 cbEdVirtualWindowWheel(win, winstr, x, y, delta, btn){
04699 let delta * 10 -> delta in
04700 if winstr.EDW_virtualWin == nil then nil else
04701 (
04702 let _GETwindowPositionSize winstr.EDW_win -> [_ _ ww wh] in
04703 let _GETwindowPositionSize winstr.EDW_virtualWin -> [vx vy vw vh] in
04704 let if (vy + delta) <= (-(vh - wh)) then (-(vh - wh)) else if (vy + delta) >= 0 then 0 else (vy + delta) -> my in
04705 _MVwindow winstr.EDW_virtualWin vx my;
04706 );
04707 0;
04708 }
04709
04710
04711 cbEdVirtualWindowCursorMove(win, winstr, dx, dy, btn){
04712 let _GETcursorPos winstr.EDW_win -> [x y] in
04713 let _GETwindowPositionSize winstr.EDW_win -> [_ _ ww wh] in
04714 let _GETwindowPositionSize winstr.EDW_virtualWin -> [vx vy vw vh] in
04715 if btn & 16 then
04716 if x == nil || y == nil || vx == nil || vy == nil || vw == nil || vh == nil then nil else
04717 if winstr.EDW_tLastCursorPos == nil then
04718 (
04719 set winstr.EDW_tLastCursorPos = [(x - vx) (y - vy)];
04720 0;
04721 )
04722 else
04723 let winstr.EDW_tLastCursorPos -> [cx cy] in
04724 let if (x - cx) <= (-(vw - ww)) then (-(vw - ww)) else if (x - cx) >= 0 then 0 else (x - cx) -> mx in
04725 let if (y - cy) <= (-(vh - wh)) then (-(vh - wh)) else if (y - cy) >= 0 then 0 else (y - cy) -> my in
04726 (
04727 _MVwindow winstr.EDW_virtualWin mx my;
04728 0;
04729 )
04730 else nil;
04731 0;
04732 }
04733
04734
04735 cbEdVirtualWindowClick(win, winstr, dx, dy, btn){
04736 _SETfocus win;
04737 0;
04738 }
04739
04740
04741 cbEdVirtualWindowUnClick(win, winstr, x, y, btn){
04742 set winstr.EDW_tLastCursorPos = nil;
04743 0;
04744 }
04745
04746
04747 setEdWindowIcon(winstr, file){
04748 let _checkpack file -> picon in
04749 _SETwindowIcon winstr.EDW_win picon;
04750 winstr;
04751 }
04752
04753
04754 crEdWindow(chan, fatherstr, x, y, w, h, flags, resize, mode, title){
04755 let if flags == nil then WN_NORMAL|WN_DRAGDROP|WN_NOSCOL else flags|WN_DRAGDROP|WN_NOSCOL -> flags in
04756 let if mode == nil then
04757 flags
04758 else if mode & EDWIN_DIALOG then
04759 flags|WN_DIALOG|WN_NOSCOL
04760 else if mode & EDWIN_POPUP then
04761 flags|WN_CHILDMENU|WN_CHILDINSIDE|WN_NOSCOL|WN_TOPMOST
04762 else if mode & EDWIN_FRAME then
04763 WN_CHILDINSIDE|WN_NOBORDER
04764 else flags
04765 -> modeflag in
04766 let if fatherstr.EDW_virtualWin == nil then fatherstr.EDW_win else fatherstr.EDW_virtualWin -> fatherwin in
04767 let mkEdWindow [nil nil fatherstr.EDW_win nil nil nil 0 nil resize 0 nil nil nil 0 1 nil nil nil nil nil nil nil nil nil nil] -> winstr in
04768 let if (fatherstr.EDW_modeFlag & EDWIN_GROUP) && !(mode & EDWIN_POPUP) && !(mode & EDWIN_DIALOG) then (let calcEdWindowGroupSonPos fatherstr -> ny in if ny == nil then y else ny) else y -> y in
04769 (
04770 if !(mode & EDWIN_MODAL) then nil else
04771 _ENwindow fatherstr.EDW_win 0;
04772
04773 set winstr.EDW_channel = chan;
04774 set winstr.EDW_father = fatherstr;
04775 set winstr.EDW_modeFlag = if mode == nil then 0 else mode;
04776 set winstr.EDW_win = _CRwindow winstr.EDW_channel fatherwin x y w h modeflag title;
04777
04778 set fatherstr.EDW_lSons = G2Dlcat fatherstr.EDW_lSons winstr::nil;
04779
04780
04781 resizeEdWindowVirtualSize fatherstr;
04782
04783 calcEdCoord winstr;
04784
04785 _CBwinSize winstr.EDW_win @cbEdWindowSize winstr;
04786 _CBwinMove winstr.EDW_win @cbEdWindowMove winstr;
04787 _CBwinDestroy winstr.EDW_win @cbEdWindowDestroy winstr;
04788 _CBwinClose winstr.EDW_win @cbEdWindowClose winstr;
04789
04790 _CBwinClick winstr.EDW_win @cbEdVirtualWindowClick fatherstr;
04791 _CBwinUnclick winstr.EDW_win @cbEdVirtualWindowUnClick fatherstr;
04792 _CBcursorMove winstr.EDW_win @cbEdVirtualWindowCursorMove fatherstr;
04793 _CBwinWheel winstr.EDW_virtualWin @cbEdVirtualWindowWheel fatherstr;
04794
04795 _CBwinKeydown winstr.EDW_win @cbEdWindowKeyDown winstr;
04796 _CBwinKeyup winstr.EDW_win @cbEdWindowKeyUp winstr;
04797
04798 _CBwinDropFile winstr.EDW_win @cbEdWindowDropFile winstr;
04799
04800 _SETfocus winstr.EDW_win;
04801 winstr;
04802 );
04803 }
04804
04805
04806 crEdScrollWindow(chan, fatherstr, x, y, w, h, flags, resize, mode, title){
04807 let if flags == nil then WN_NORMAL|WN_VSCROLL|WN_HSCROLL|WN_DRAGDROP|WN_NOSCOL else flags|WN_DRAGDROP|WN_NOSCOL -> flags in
04808 let if fatherstr.EDW_virtualWin == nil then fatherstr.EDW_win else fatherstr.EDW_virtualWin -> fatherwin in
04809 let mkEdWindow [nil nil fatherstr.EDW_win nil nil nil 0 nil resize 0 nil nil nil 0 1 nil nil nil nil nil nil nil nil nil nil] -> winstr in
04810 let if fatherstr.EDW_modeFlag & EDWIN_GROUP then (let calcEdWindowGroupSonPos fatherstr -> ny in if ny == nil then y else ny) else y -> y in
04811 let _CRscrollWindow winstr.EDW_channel fatherwin x y w h w h flags title -> [win vwin] in
04812 (
04813 set winstr.EDW_channel = chan;
04814 set winstr.EDW_father = fatherstr;
04815 set winstr.EDW_modeFlag = if mode == nil then 0 else mode;
04816 set winstr.EDW_win = win;
04817 set winstr.EDW_virtualWin = vwin;
04818
04819 set fatherstr.EDW_lSons = winstr::fatherstr.EDW_lSons;
04820
04821
04822 resizeEdWindowVirtualSize fatherstr;
04823
04824 calcEdCoord winstr;
04825
04826 _CBwinSize winstr.EDW_win @cbEdWindowSize winstr;
04827 _CBwinMove winstr.EDW_win @cbEdWindowMove winstr;
04828 _CBwinDestroy winstr.EDW_win @cbEdWindowDestroy winstr;
04829 _CBwinClose winstr.EDW_win @cbEdWindowClose winstr;
04830
04831 _CBwinKeydown winstr.EDW_win @cbEdWindowKeyDown winstr;
04832 _CBwinKeyup winstr.EDW_win @cbEdWindowKeyUp winstr;
04833
04834
04835 _CBwinSize winstr.EDW_virtualWin @cbEdVirtualWindowSize winstr;
04836 _CBwinMove winstr.EDW_virtualWin @cbEdVirtualWindowMove winstr;
04837 _CBwinClick winstr.EDW_virtualWin @cbEdVirtualWindowClick winstr;
04838 _CBwinUnclick winstr.EDW_virtualWin @cbEdVirtualWindowUnClick winstr;
04839 _CBcursorMove winstr.EDW_virtualWin @cbEdVirtualWindowCursorMove winstr;
04840 _CBwinWheel winstr.EDW_virtualWin @cbEdVirtualWindowWheel winstr;
04841
04842 _CBwinKeydown winstr.EDW_virtualWin @cbEdWindowKeyDown winstr;
04843 _CBwinKeyup winstr.EDW_virtualWin @cbEdWindowKeyUp winstr;
04844
04845 _SETfocus winstr.EDW_virtualWin;
04846 winstr;
04847 );
04848 }
04849
04850
04851 crEdGroupWindow(chan, fatherstr, x, y, w, h, flags, resize, title){
04852 crEdScrollWindow chan fatherstr x y w h flags resize EDWIN_GROUP title;
04853 }
04854
04855
04856 crEdDialogWindow(chan, fatherstr, x, y, w, h, flags, resize, title){
04857 crEdWindow chan fatherstr x y w h flags resize EDWIN_DIALOG title;
04858 }
04859
04860
04861 crEdModalDialogWindow(chan, fatherstr, x, y, w, h, flags, resize, title){
04862 crEdWindow chan fatherstr x y w h flags resize EDWIN_DIALOG|EDWIN_MODAL title;
04863 }
04864
04865
04866 crEdPopupWindow(chan, fatherstr, x, y, w, h, flags, resize, title){
04867 crEdWindow chan fatherstr x y w h flags resize EDWIN_POPUP title;
04868 }
04869
04870
04871 cbEdFrameMinMax(tbstr, check, btn, mask, state, winstr){
04872 let _GETwindowPositionSize winstr.EDW_win -> [cx cy cw ch] in
04873 if winstr.EDW_bMinimize != 1 then
04874 (
04875 set winstr.EDW_bMinimize = 1;
04876
04877 let hd winstr.EDW_lToolbar -> tbstr in
04878 let tbstr.ETB_size -> [tw th] in
04879 _SIZEwindow winstr.EDW_win cw th cx cy;
04880
04881 _TOPwindow winstr.EDW_win;
04882 _SETfocus winstr.EDW_win;
04883 )
04884 else
04885 (
04886 set winstr.EDW_bMinimize = 0;
04887 resizeEdWindow winstr;
04888
04889 _TOPwindow winstr.EDW_win;
04890 _SETfocus winstr.EDW_win;
04891 );
04892 0;
04893 }
04894
04895
04896 cbEdDbClickFrameWindowTitle(cont, param, x, y, btn, mask){
04897 let param -> [winstr minmaxchk] in
04898 if btn != 1 then nil else
04899 (
04900 let _GETwindowPositionSize winstr.EDW_win -> [cx cy cw ch] in
04901 if winstr.EDW_bMinimize != 1 then
04902 (
04903 set winstr.EDW_bMinimize = 1;
04904 _SETcompCheckState minmaxchk CHK_CHECKED;
04905
04906 let hd winstr.EDW_lToolbar -> tbstr in
04907 let tbstr.ETB_size -> [tw th] in
04908 _SIZEwindow winstr.EDW_win cw th cx cy;
04909
04910 _TOPwindow winstr.EDW_win;
04911 _SETfocus winstr.EDW_win;
04912 )
04913 else
04914 (
04915 set winstr.EDW_bMinimize = 0;
04916 _SETcompCheckState minmaxchk CHK_UNCHECKED;
04917 resizeEdWindow winstr;
04918
04919 _TOPwindow winstr.EDW_win;
04920 _SETfocus winstr.EDW_win;
04921 );
04922 _PAINTcontainer cont;
04923 );
04924 0;
04925 }
04926
04927
04928 crEdFrameWindow(chan, fatherstr, x, y, w, h, resize, themestr, title, minimizebuble){
04929 let if themestr == nil then (if EdDefaultTheme == nil then (set EdDefaultTheme = makeEdThemeResources chan) else EdDefaultTheme) else themestr -> themestr in
04930
04931 let crEdWindow chan fatherstr x y w h nil resize EDWIN_FRAME title -> winstr in
04932 let crEdWindowToolBar winstr 0 0 w themestr.EDT_iFrameBarHeight 5 0 themestr.EDT_iFrameBarColor ETB_HORIZONTAL -> tbstr in
04933 let crEdToolBarText tbstr title themestr.EDT_sFrameFontName themestr.EDT_iFrameFontSize FF_PIXEL|FF_WEIGHT themestr.EDT_iFrameFontColor nil ETB_ALIGN_LEFT -> txttitle in
04934 let crEdToolBarCheck tbstr themestr.EDT_abmpFrameFold ETB_ALIGN_RIGHT minimizebuble mkfun6 @cbEdFrameMinMax winstr -> minmaxchk in
04935 (
04936 _CBcontainerDblClick tbstr.ETB_cont @cbEdDbClickFrameWindowTitle [winstr minmaxchk];
04937
04938 paintEdToolBar tbstr;
04939 winstr;
04940 );
04941 }
04942
04943
04944 crEdMainWindow(chan, fatherwin, x, y, w, h, flags, title){
04945 let if flags == nil then WN_NORMAL|WN_DRAGDROP|WN_NOSCOL else flags|WN_DRAGDROP|WN_NOSCOL -> flags in
04946 let mkEdWindow [nil nil fatherwin nil nil nil 0 nil 0 0 nil nil nil 0 1 nil nil nil nil nil nil nil nil nil nil] -> winstr in
04947 let _GETactiveXWindow chan 0 "Scol" -> winAX in
04948 (
04949 set winstr.EDW_channel = chan;
04950
04951 if winAX ==nil then
04952 (
04953 set winstr.EDW_win = _CRwindow winstr.EDW_channel fatherwin x y w h flags title;
04954 )
04955 else
04956 let _GETwindowPositionSize winAX -> [_ _ w h] in
04957 (
04958 set winstr.EDW_bIsAx = 1;
04959 set winstr.EDW_win = _CRwindow winstr.EDW_channel winAX 0 0 w h WN_CHILD|WN_NOBORDER|WN_DRAGDROP "WebDetect";
04960 );
04961
04962 calcEdCoord winstr;
04963
04964 _CBwinSize winstr.EDW_win @cbEdWindowSize winstr;
04965 _CBwinDestroy winstr.EDW_win @cbEdWindowDestroy winstr;
04966 _CBwinClose winstr.EDW_win @cbEdWindowClose winstr;
04967 _CBwinKeydown winstr.EDW_win @cbEdWindowKeyDown winstr;
04968 _CBwinKeyup winstr.EDW_win @cbEdWindowKeyUp winstr;
04969 _CBwinDropFile winstr.EDW_win @cbEdWindowDropFile winstr;
04970
04971 winstr;
04972 );
04973 }
04974
04975
04976 getEdWindowIsAX(winstr){
04977 winstr.EDW_bIsAx;
04978 }
04979
04980
04981
04982
04983
04984
04985 getEdCtrlLabel(ctrlstr){
04986 ctrlstr.EDC_label;
04987 }
04988
04989 getEdCtrlText(ctrlstr){
04990 ctrlstr.EDC_text;
04991 }
04992
04993 getEdCtrlEditText(ctrlstr){
04994 ctrlstr.EDC_editText;
04995 }
04996
04997 getEdCtrlTextLine(ctrlstr){
04998 ctrlstr.EDC_editLine;
04999 }
05000
05001 getEdCtrlButton(ctrlstr){
05002 ctrlstr.EDC_button;
05003 }
05004
05005 getEdCtrlCheck(ctrlstr){
05006 ctrlstr.EDC_check;
05007 }
05008
05009 getEdCtrlRadio(ctrlstr){
05010 ctrlstr.EDC_check;
05011 }
05012
05013 getEdCtrlList(ctrlstr){
05014 let ctrlstr.EDC_list -> [list _] in list;
05015 }
05016
05017 getEdCtrlTree(ctrlstr){
05018 let ctrlstr.EDC_tree -> [tree _ _ _ _] in tree;
05019 }
05020
05021 getEdCtrlSelect(ctrlstr){
05022 ctrlstr.EDC_select;
05023 }
05024
05025 getEdCtrlFloat(ctrlstr){
05026 let ctrlstr.EDC_editFloat -> [txt cont cmprup cmprdown minval maxval incre nb0 _ _ _ _ _] in txt;
05027 }
05028
05029 getEdCtrlView3d(ctrlstr){
05030 ctrlstr.EDC_view3d;
05031 }
05032
05033
05034
05035
05036
05037
05038 getEdCtrlLabelValue(ctrlstr){
05039 _GETtext ctrlstr.EDC_label;
05040 }
05041
05042
05043 setEdCtrlLabelValue(ctrlstr, val){
05044 _SETtext ctrlstr.EDC_label val;
05045 0;
05046 }
05047
05048
05049 setEdCtrlLabelEnable(ctrlstr, state){
05050 _ENtext ctrlstr.EDC_label state;
05051 0;
05052 }
05053
05054
05055 crEdCtrlLabel(winstr, x, y, w, h, value, resize){
05056 let mkEdControl [winstr.EDW_channel winstr resize nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil] -> ctrlstr in
05057 let if ctrlstr.EDC_father.EDW_virtualWin == nil then ctrlstr.EDC_father.EDW_win else ctrlstr.EDC_father.EDW_virtualWin -> father in
05058 let _CRtext ctrlstr.EDC_channel father x y w h ET_AHSCROLL|ET_ALIGN_LEFT value -> txt in
05059 (
05060 set ctrlstr.EDC_label = txt;
05061 set winstr.EDW_lControl = ctrlstr::winstr.EDW_lControl;
05062
05063 let _GETwindowPositionSize father -> [_ _ fw fh] in
05064 set ctrlstr.EDC_coords = [x y (fw-(x + w)) (fh-(y+h)) w h];
05065
05066 ctrlstr;
05067 );
05068 }
05069
05070
05071 dsEdCtrlLabel(ctrlstr){
05072 _DStext ctrlstr.EDC_label;
05073 set ctrlstr.EDC_father.EDW_lControl = G2DremoveFromList ctrlstr.EDC_father.EDW_lControl ctrlstr;
05074 0;
05075 }
05076
05077
05078
05079
05080
05081 getEdCtrlTextValue(ctrlstr){
05082 _GETtext ctrlstr.EDC_text;
05083 }
05084
05085
05086 setEdCtrlTextValue(ctrlstr, val){
05087 _SETtext ctrlstr.EDC_text val;
05088 0;
05089 }
05090
05091
05092 addEdCtrlTextValue(ctrlstr, val){
05093 let _GETtext ctrlstr.EDC_text -> curtext in
05094 let if (curtext == nil) || (!strcmp curtext "") then val else strcatn curtext::"\n"::val::nil -> val in
05095 _SETtext ctrlstr.EDC_text val;
05096 0;
05097 }
05098
05099
05100 setEdCtrlTextEnable(ctrlstr, state){
05101 _ENtext ctrlstr.EDC_text state;
05102 0;
05103 }
05104
05105
05106 cbEdCtrlTextChange(txt, p){
05107 let p -> [ctrlstr cbfun] in
05108 let _GETtext ctrlstr.EDC_text -> val in
05109 exec cbfun with [ctrlstr val];
05110 0;
05111 }
05112
05113
05114 setEdCtrlTextCbChange(ctrlstr, cbfun){
05115 _CBtext ctrlstr.EDC_text @cbEdCtrlTextChange [ctrlstr cbfun];
05116 0;
05117 }
05118
05119
05120 crEdCtrlText(winstr, x, y, w, h, value, flags, resize){
05121 let mkEdControl [winstr.EDW_channel winstr resize nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil] -> ctrlstr in
05122 let if ctrlstr.EDC_father.EDW_virtualWin == nil then ctrlstr.EDC_father.EDW_win else ctrlstr.EDC_father.EDW_virtualWin -> father in
05123 let _CRtext ctrlstr.EDC_channel father x y w h (if flags == nil then ET_BORDER|ET_AHSCROLL|ET_AVSCROLL|ET_VSCROLL|ET_TABFOCUS else flags) value -> txt in
05124 (
05125 set ctrlstr.EDC_text = txt;
05126 set winstr.EDW_lControl = ctrlstr::winstr.EDW_lControl;
05127
05128 let _GETwindowPositionSize father -> [_ _ fw fh] in
05129 set ctrlstr.EDC_coords = [x y (fw-(x + w)) (fh-(y+h)) w h];
05130
05131 ctrlstr;
05132 );
05133 }
05134
05135
05136 dsEdCtrlText(ctrlstr){
05137 _DStext ctrlstr.EDC_text;
05138 set ctrlstr.EDC_father.EDW_lControl = G2DremoveFromList ctrlstr.EDC_father.EDW_lControl ctrlstr;
05139 0;
05140 }
05141
05142
05143
05144
05145
05146 getEdCtrlEditTextValue(ctrlstr){
05147 _GETtext ctrlstr.EDC_editText;
05148 }
05149
05150
05151 setEdCtrlEditTextValue(ctrlstr, val){
05152 _SETtext ctrlstr.EDC_editText val;
05153 0;
05154 }
05155
05156
05157 setEdCtrlEditTextEnable(ctrlstr, state){
05158 _ENtext ctrlstr.EDC_editText state;
05159 0;
05160 }
05161
05162
05163 cbEdCtrlEditTextChange(txt, p){
05164 let p -> [ctrlstr cbfun] in
05165 let _GETtext ctrlstr.EDC_editText -> val in
05166 exec cbfun with [ctrlstr val];
05167 0;
05168 }
05169
05170
05171 setEdCtrlEditTextCbChange(ctrlstr, cbfun){
05172 _CBtext ctrlstr.EDC_editText @cbEdCtrlEditTextChange [ctrlstr cbfun];
05173 0;
05174 }
05175
05176
05177 crEdCtrlEditText(winstr, x, y, w, h, value, flags, resize){
05178 let mkEdControl [winstr.EDW_channel winstr resize nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil] -> ctrlstr in
05179 let if ctrlstr.EDC_father.EDW_virtualWin == nil then ctrlstr.EDC_father.EDW_win else ctrlstr.EDC_father.EDW_virtualWin -> father in
05180 let _CReditText ctrlstr.EDC_channel father x y w h (if flags == nil then ET_BORDER|ET_AHSCROLL|ET_AVSCROLL|ET_HSCROLL|ET_VSCROLL|ET_TABFOCUS else flags) value -> txt in
05181 (
05182 set ctrlstr.EDC_editText = txt;
05183 set winstr.EDW_lControl = ctrlstr::winstr.EDW_lControl;
05184
05185 let _GETwindowPositionSize father -> [_ _ fw fh] in
05186 set ctrlstr.EDC_coords = [x y (fw-(x + w)) (fh-(y+h)) w h];
05187
05188 ctrlstr;
05189 );
05190 }
05191
05192
05193 dsEdCtrlEditText(ctrlstr){
05194 _DStext ctrlstr.EDC_editText;
05195 set ctrlstr.EDC_father.EDW_lControl = G2DremoveFromList ctrlstr.EDC_father.EDW_lControl ctrlstr;
05196 0;
05197 }
05198
05199
05200
05201
05202
05203 getEdCtrlTextLineValue(ctrlstr){
05204 _GETtext ctrlstr.EDC_editLine;
05205 }
05206
05207
05208 setEdCtrlTextLineValue(ctrlstr, val){
05209 _SETtext ctrlstr.EDC_editLine val;
05210 0;
05211 }
05212
05213
05214 setEdCtrlTextLineEnable(ctrlstr, state){
05215 _ENtext ctrlstr.EDC_editLine state;
05216 0;
05217 }
05218
05219
05220 cbEdCtrlTextLineChange(txt, p){
05221 let p -> [ctrlstr cbfun] in
05222 let _GETtext ctrlstr.EDC_editLine -> val in
05223 exec cbfun with [ctrlstr val];
05224 0;
05225 }
05226
05227
05228 setEdCtrlTextLineCbChange(ctrlstr, cbfun){
05229 _CBtext ctrlstr.EDC_editLine @cbEdCtrlTextLineChange [ctrlstr cbfun];
05230 0;
05231 }
05232
05233
05234 cbEdCtrlTextLineValidate(txt, p, val){
05235 let p -> [ctrlstr cbfun] in
05236 exec cbfun with [ctrlstr val];
05237 0;
05238 }
05239
05240
05241 setEdCtrlTextLineCbValidate(ctrlstr, cbfun){
05242 _CBlineOk ctrlstr.EDC_editLine @cbEdCtrlTextLineValidate [ctrlstr cbfun];
05243 0;
05244 }
05245
05246
05247 crEdCtrlTextLine(winstr, x, y, w, h, value, flags, resize){
05248 let mkEdControl [winstr.EDW_channel winstr resize nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil] -> ctrlstr in
05249 let if ctrlstr.EDC_father.EDW_virtualWin == nil then ctrlstr.EDC_father.EDW_win else ctrlstr.EDC_father.EDW_virtualWin -> father in
05250 let _CReditLine ctrlstr.EDC_channel father x y w h (if flags == nil then ET_BORDER|ET_AHSCROLL|ET_TABFOCUS else flags) value -> txt in
05251 (
05252 set ctrlstr.EDC_editLine = txt;
05253 set winstr.EDW_lControl = ctrlstr::winstr.EDW_lControl;
05254
05255 let _GETwindowPositionSize father -> [_ _ fw fh] in
05256 set ctrlstr.EDC_coords = [x y (fw-(x + w)) (fh-(y+h)) w h];
05257
05258 ctrlstr;
05259 );
05260 }
05261
05262
05263 setEdctrlTextLineFocus(ctrlstr){
05264 _SETtextFocus ctrlstr.EDC_editLine;
05265 }
05266
05267
05268 dsEdCtrlTextLine(ctrlstr){
05269 _DStext ctrlstr.EDC_editLine;
05270 set ctrlstr.EDC_father.EDW_lControl = G2DremoveFromList ctrlstr.EDC_father.EDW_lControl ctrlstr;
05271 0;
05272 }
05273
05274
05275
05276
05277
05278 setEdCtrlButtonEnable(ctrlstr, state){
05279 _ENbutton ctrlstr.EDC_button state;
05280 0;
05281 }
05282
05283
05284 cbEdCtrlButton(btn, p){
05285 let p -> [ctrlstr cbfun] in
05286 exec cbfun with [ctrlstr];
05287 0;
05288 }
05289
05290
05291 setEdCtrlButtonCb(ctrlstr, cbfun){
05292 _CBbutton ctrlstr.EDC_button @cbEdCtrlButton [ctrlstr cbfun];
05293 0;
05294 }
05295
05296
05297 crEdCtrlButton(winstr, x, y, w, h, value, resize){
05298 let mkEdControl [winstr.EDW_channel winstr resize nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil] -> ctrlstr in
05299 let if ctrlstr.EDC_father.EDW_virtualWin == nil then ctrlstr.EDC_father.EDW_win else ctrlstr.EDC_father.EDW_virtualWin -> father in
05300 let _CRbutton ctrlstr.EDC_channel father x y w h PB_TABFOCUS value -> button in
05301 (
05302 set ctrlstr.EDC_button = button;
05303 set winstr.EDW_lControl = ctrlstr::winstr.EDW_lControl;
05304
05305 let _GETwindowPositionSize father -> [_ _ fw fh] in
05306 set ctrlstr.EDC_coords = [x y (fw-(x + w)) (fh-(y+h)) w h];
05307
05308 ctrlstr;
05309 );
05310 }
05311
05312
05313 dsEdCtrlButton(ctrlstr){
05314 _DSbutton ctrlstr.EDC_button;
05315 set ctrlstr.EDC_father.EDW_lControl = G2DremoveFromList ctrlstr.EDC_father.EDW_lControl ctrlstr;
05316 0;
05317 }
05318
05319
05320
05321
05322
05323 getEdCtrlCheckState(ctrlstr){
05324 _GETcheck ctrlstr.EDC_check;
05325 }
05326
05327
05328 setEdCtrlCheckState(ctrlstr, state){
05329 _SETcheck ctrlstr.EDC_check state;
05330 0;
05331 }
05332
05333
05334 setEdCtrlCheckEnable(ctrlstr, state){
05335 _ENcheck ctrlstr.EDC_check state;
05336 0;
05337 }
05338
05339
05340 cbEdCtrlCheckState(chk, p, state){
05341 let p -> [ctrlstr cbfun] in
05342 exec cbfun with [ctrlstr state];
05343 0;
05344 }
05345
05346
05347 setEdCtrlCheckCbState(ctrlstr, cbfun){
05348 _CBcheck ctrlstr.EDC_check @cbEdCtrlCheckState [ctrlstr cbfun];
05349 0;
05350 }
05351
05352
05353 getEdCtrlRadioState(ctrlstr){
05354 _GETcheck ctrlstr.EDC_check;
05355 }
05356
05357
05358 setEdCtrlRadioState(ctrlstr, state){
05359 _SETcheck ctrlstr.EDC_check state;
05360 0;
05361 }
05362
05363
05364 setEdCtrlRadioEnable(ctrlstr, state){
05365 _ENcheck ctrlstr.EDC_check state;
05366 0;
05367 }
05368
05369
05370 setEdCtrlRadioCbState(ctrlstr, cbfun){
05371 _CBcheck ctrlstr.EDC_check @cbEdCtrlCheckState [ctrlstr cbfun];
05372 0;
05373 }
05374
05375
05376 crEdCtrlCheck(winstr, x, y, w, h, value, resize){
05377 let mkEdControl [winstr.EDW_channel winstr resize nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil] -> ctrlstr in
05378 let if ctrlstr.EDC_father.EDW_virtualWin == nil then ctrlstr.EDC_father.EDW_win else ctrlstr.EDC_father.EDW_virtualWin -> father in
05379 let _CRcheck ctrlstr.EDC_channel father x y w h CH_TABFOCUS value -> check in
05380 (
05381 set ctrlstr.EDC_check = check;
05382 set winstr.EDW_lControl = ctrlstr::winstr.EDW_lControl;
05383
05384 let _GETwindowPositionSize father -> [_ _ fw fh] in
05385 set ctrlstr.EDC_coords = [x y (fw-(x + w)) (fh-(y+h)) w h];
05386
05387 ctrlstr;
05388 );
05389 }
05390
05391
05392 dsEdCtrlCheck(ctrlstr){
05393 _DScheck ctrlstr.EDC_check;
05394 set ctrlstr.EDC_father.EDW_lControl = G2DremoveFromList ctrlstr.EDC_father.EDW_lControl ctrlstr;
05395 0;
05396 }
05397
05398
05399 crEdCtrlRadio(winstr, x, y, w, h, value, resize){
05400 let mkEdControl [winstr.EDW_channel winstr resize nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil] -> ctrlstr in
05401 let if ctrlstr.EDC_father.EDW_virtualWin == nil then ctrlstr.EDC_father.EDW_win else ctrlstr.EDC_father.EDW_virtualWin -> father in
05402 let _CRcheck ctrlstr.EDC_channel father x y w h CH_RADIO|CH_TABFOCUS value -> check in
05403 (
05404 set ctrlstr.EDC_check = check;
05405 set winstr.EDW_lControl = ctrlstr::winstr.EDW_lControl;
05406
05407 let _GETwindowPositionSize father -> [_ _ fw fh] in
05408 set ctrlstr.EDC_coords = [x y (fw-(x + w)) (fh-(y+h)) w h];
05409
05410 ctrlstr;
05411 );
05412 }
05413
05414
05415 dsEdCtrlRadio(ctrlstr){
05416 _DScheck ctrlstr.EDC_check;
05417 set ctrlstr.EDC_father.EDW_lControl = G2DremoveFromList ctrlstr.EDC_father.EDW_lControl ctrlstr;
05418 0;
05419 }
05420
05421
05422
05423
05424
05425
05426 getEdCtrlListNbElems(ctrlstr){
05427 let ctrlstr.EDC_list -> [list lp] in
05428 _GETlistCount list;
05429 }
05430
05431
05432 getEdCtrlListElemByName(ctrlstr, name){
05433 let ctrlstr.EDC_list -> [_ l] in
05434 let sizelist l -> size in
05435 let 0 -> i in
05436 let nil -> ret in
05437 (
05438 while i < size && ret == nil do
05439 (
05440 let nth_list l i -> elt in
05441 let elt -> [p [val p]] in
05442 if (!strcmpi val name) then
05443 set ret = elt
05444 else nil;
05445
05446 set i = i + 1;
05447 );
05448 ret;
05449 );
05450 }
05451
05452
05453 fillEdCtrlList(ctrlstr, lparam){
05454 let ctrlstr.EDC_list -> [list _] in
05455 let nil -> lp in
05456 (
05457 _RSTlist list;
05458
05459 let sizelist lparam -> size in
05460 let 0 -> i in
05461 while i < size do
05462 (
05463 let nth_list lparam i -> elt in
05464 (
05465 _ADDlist list i elt;
05466 set lp = G2Dlcat lp [i [elt [nil nil]]]::nil;
05467 );
05468 set i = i + 1;
05469 );
05470 mutate ctrlstr.EDC_list <- [_ lp];
05471 _SELlist list 0;
05472 );
05473 0;
05474 }
05475
05476
05477 addEdCtrlList(ctrlstr, name, lval, type){
05478 let ctrlstr.EDC_list -> [list lp] in
05479 let _GETlistCount list -> pos in
05480 (
05481 _ADDlist list pos name;
05482 mutate ctrlstr.EDC_list <- [_ G2Dlcat lp [pos [name [lval type]]]::nil];
05483 );
05484 0;
05485 }
05486
05487
05488 getEdCtrlListElems(ctrlstr){
05489 let ctrlstr.EDC_list -> [list lp] in
05490 let sizelist lp -> size in
05491 let 0 -> i in
05492 let nil -> elems in
05493 (
05494 while i < size do
05495 (
05496 let nth_list lp i -> [_ [elt _]] in
05497 set elems = G2Dlcat elems elt::nil;
05498
05499 set i = i + 1;
05500 );
05501 elems;
05502 );
05503 }
05504
05505
05506 getEdCtrlListElem(ctrlstr, elt){
05507 let ctrlstr.EDC_list -> [list lp] in
05508 let getEdCtrlListElemByName ctrlstr elt -> [i [n p]] in
05509 p;
05510 }
05511
05512
05513 getEdCtrlListElemByParams(ctrlstr, params){
05514 let ctrlstr.EDC_list -> [_ l] in
05515 let sizelist l -> size in
05516 let 0 -> i in
05517 let nil -> ret in
05518 (
05519 while i < size && ret == nil do
05520 (
05521 let nth_list l i -> elt in
05522 let elt -> [pos [val p]] in
05523 let p -> [lp type] in
05524 if (!strcmpi strcatn lp strcatn params) then
05525 set ret = p
05526 else nil;
05527
05528 set i = i + 1;
05529 );
05530 ret;
05531 );
05532 }
05533
05534
05535 getEdCtrlListElemPosByParams(ctrlstr, params){
05536 let ctrlstr.EDC_list -> [list l] in
05537 let sizelist l -> size in
05538 let 0 -> i in
05539 let nil -> ret in
05540 (
05541 while i < size && ret == nil do
05542 (
05543 let nth_list l i -> elt in
05544 let elt -> [pos [val p]] in
05545 let p -> [lp type] in
05546 if (!strcmpi strcatn lp strcatn params) then
05547 set ret = pos
05548 else nil;
05549
05550 set i = i + 1;
05551 );
05552 ret;
05553 );
05554 }
05555
05556
05557 refreshEdCtrlList(ctrlstr){
05558 let ctrlstr.EDC_list -> [list lp] in
05559 let nil -> ln in
05560 (
05561 _RSTlist list;
05562
05563 let sizelist lp -> size in
05564 let 0 -> i in
05565 while i < size do
05566 (
05567 let nth_list lp i -> [_ [elt p]] in
05568 (
05569 _ADDlist list i elt;
05570 set ln = G2Dlcat ln [i [elt p]]::nil;
05571 );
05572 set i = i + 1;
05573 );
05574 mutate ctrlstr.EDC_list <- [_ ln];
05575 );
05576 0;
05577 }
05578
05579
05580 delEdCtrlList(ctrlstr, elt){
05581 let ctrlstr.EDC_list -> [list lp] in
05582 let getEdCtrlListElemByName ctrlstr elt -> [i [n p]] in
05583 (
05584 _DELlist list i;
05585 mutate ctrlstr.EDC_list <- [_ (G2DremoveEdIdxFromList lp i)];
05586 refreshEdCtrlList ctrlstr;
05587 let (_GETlistCount list) - 1 -> maxpos in
05588 let if (i > maxpos) then maxpos else i -> npos in
05589 _SELlist list npos;
05590 );
05591 0;
05592 }
05593
05594
05595 resetEdCtrlList(ctrlstr){
05596 let ctrlstr.EDC_list -> [list lp] in
05597 (
05598 _RSTlist list;
05599 mutate ctrlstr.EDC_list <- [_ nil];
05600 );
05601 0;
05602 }
05603
05604
05605 selectEdCtrlList(ctrlstr, name){
05606 let ctrlstr.EDC_list -> [list lp] in
05607 _SSELlist list name;
05608 0;
05609 }
05610
05611
05612 selectEdCtrlListByPos(ctrlstr, pos){
05613 let ctrlstr.EDC_list -> [list lp] in
05614 _SELlist list pos;
05615 0;
05616 }
05617
05618
05619 selectEdCtrlListByParams(ctrlstr, params){
05620 let ctrlstr.EDC_list -> [list l] in
05621 let sizelist l -> size in
05622 let 0 -> i in
05623 let nil -> ret in
05624 while i < size && ret == nil do
05625 (
05626 let nth_list l i -> elt in
05627 let elt -> [pos [val p]] in
05628 let p -> [lp type] in
05629 if (!strcmpi strcatn lp strcatn params) then
05630 (
05631 set ret = pos;
05632 _SELlist list pos;
05633 )
05634 else nil;
05635
05636 set i = i + 1;
05637 );
05638 0;
05639 }
05640
05641
05642 getSelectedEdCtrlList(ctrlstr){
05643 let ctrlstr.EDC_list -> [list lp] in
05644 let _GETlist list -> [pos name] in
05645 let switch lp pos -> [n [lval type]] in
05646 [name lval type];
05647 }
05648
05649
05650 setEdCtrlListEnable(ctrlstr, state){
05651 let ctrlstr.EDC_list -> [list lp] in
05652 _ENlist list state;
05653 0;
05654 }
05655
05656
05657 cbEdCtrlListDbClick(lst, p, pos, elem){
05658 let p -> [ctrlstr cbfun] in
05659 let ctrlstr.EDC_list -> [list lp] in
05660 let switch lp pos -> [n [lval type]] in
05661 exec cbfun with [ctrlstr pos elem lval type];
05662 0;
05663 }
05664
05665
05666 setEdCtrlListCbDbClick(ctrlstr, cbfun){
05667 let ctrlstr.EDC_list -> [list lp] in
05668 _CBlistDclick list @cbEdCtrlListDbClick [ctrlstr cbfun];
05669 0;
05670 }
05671
05672
05673 cbEdCtrlListClick(lst, p, pos, elem){
05674 let p -> [ctrlstr cbfun] in
05675 let ctrlstr.EDC_list -> [list lp] in
05676 let switch lp pos -> [n [lval type]] in
05677 exec cbfun with [ctrlstr pos elem lval type];
05678 0;
05679 }
05680
05681
05682 setEdCtrlListCbClick(ctrlstr, cbfun){
05683 let ctrlstr.EDC_list -> [list lp] in
05684 _CBlistClick list @cbEdCtrlListClick [ctrlstr cbfun];
05685 0;
05686 }
05687
05688 cbEdCtrlListKeyDown(tree, p, key, code){
05689 let p -> [ctrlstr cbfun] in
05690 let ctrlstr.EDC_list -> [list lp] in
05691 let _GETlist list -> [pos name] in
05692 let switch lp pos -> [n [lval type]] in
05693 (
05694 exec cbfun with [ctrlstr pos name lval type key code];
05695 );
05696 0;
05697 }
05698
05699
05700 setEdCtrlListCbKeyDown(ctrlstr, cbfun){
05701 let ctrlstr.EDC_list -> [list lp] in
05702 _CBlistKeyDown list @cbEdCtrlListKeyDown [ctrlstr cbfun];
05703 0;
05704 }
05705
05706
05707 cbEdCtrlListKeyUp(tree, p, key){
05708 let p -> [ctrlstr cbfun] in
05709 let ctrlstr.EDC_list -> [list lp] in
05710 let _GETlist list -> [pos name] in
05711 let switch lp pos -> [n [lval type]] in
05712 (
05713 exec cbfun with [ctrlstr pos name lval type key];
05714 );
05715 0;
05716 }
05717
05718
05719 setEdCtrlListCbKeyUp(ctrlstr, cbfun){
05720 let ctrlstr.EDC_list -> [list lp] in
05721 _CBlistKeyUp list @cbEdCtrlListKeyUp [ctrlstr cbfun];
05722 0;
05723 }
05724
05725
05726 crEdCtrlList(winstr, x, y, w, h, flags, resize){
05727 let mkEdControl [winstr.EDW_channel winstr resize nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil] -> ctrlstr in
05728 let if ctrlstr.EDC_father.EDW_virtualWin == nil then ctrlstr.EDC_father.EDW_win else ctrlstr.EDC_father.EDW_virtualWin -> father in
05729 let _CRlist ctrlstr.EDC_channel father x y w h (if flags == nil then LB_BORDER|LB_VSCROLL|ET_TABFOCUS else flags) -> list in
05730 (
05731 set ctrlstr.EDC_list = [list nil];
05732 set winstr.EDW_lControl = ctrlstr::winstr.EDW_lControl;
05733
05734 let _GETwindowPositionSize father -> [_ _ fw fh] in
05735 set ctrlstr.EDC_coords = [x y (fw-(x + w)) (fh-(y+h)) w h];
05736
05737 ctrlstr;
05738 );
05739 }
05740
05741
05742 dsEdCtrlList(ctrlstr){
05743 let ctrlstr.EDC_list -> [list lp] in
05744 _DSlist list;
05745 set ctrlstr.EDC_father.EDW_lControl = G2DremoveFromList ctrlstr.EDC_father.EDW_lControl ctrlstr;
05746 0;
05747 }
05748
05749
05750
05751
05752
05753 fillEdCtrlSelect(ctrlstr, lparam){
05754 _RSTcombo ctrlstr.EDC_select;
05755
05756 let sizelist lparam -> size in
05757 let 0 -> i in
05758 while i < size do
05759 (
05760 let nth_list lparam i -> elt in
05761 (
05762 _ADDcombo ctrlstr.EDC_select i elt;
05763 );
05764 set i = i + 1;
05765 );
05766
05767 _SELcombo ctrlstr.EDC_select 0;
05768 0;
05769 }
05770
05771
05772 addEdCtrlSelect(ctrlstr, param){
05773 _ADDcombo ctrlstr.EDC_select (_GETcomboCount ctrlstr.EDC_select) param;
05774 0;
05775 }
05776
05777
05778 resetEdCtrlSelect(ctrlstr){
05779 _RSTcombo ctrlstr.EDC_select;
05780 0;
05781 }
05782
05783
05784 selectEdCtrlSelect(ctrlstr, name){
05785 _SSELcombo ctrlstr.EDC_select name;
05786 0;
05787 }
05788
05789
05790 selectEdCtrlSelectByPos(ctrlstr, pos){
05791 _SELcombo ctrlstr.EDC_select pos;
05792 0;
05793 }
05794
05795
05796 getSelectedEdCtrlSelect(ctrlstr){
05797 let _GETcombo ctrlstr.EDC_select -> [pos name] in
05798 name;
05799 }
05800
05801
05802 getSelectedEdCtrlSelectPos(ctrlstr){
05803 let _GETcombo ctrlstr.EDC_select -> [pos name] in
05804 pos;
05805 }
05806
05807
05808 setEdCtrlSelectEnable(ctrlstr, state){
05809 _ENcombo ctrlstr.EDC_select state;
05810 0;
05811 }
05812
05813
05814 cbEdCtrlSelect(sel, p, pos, elem){
05815 let p -> [ctrlstr cbfun] in
05816 exec cbfun with [ctrlstr pos elem];
05817 0;
05818 }
05819
05820
05821 setEdCtrlSelectCb(ctrlstr, cbfun){
05822 _CBcombo ctrlstr.EDC_select @cbEdCtrlSelect [ctrlstr cbfun];
05823 0;
05824 }
05825
05826
05827 crEdCtrlSelect(winstr, x, y, w, h, resize){
05828 let mkEdControl [winstr.EDW_channel winstr resize nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil] -> ctrlstr in
05829 let if ctrlstr.EDC_father.EDW_virtualWin == nil then ctrlstr.EDC_father.EDW_win else ctrlstr.EDC_father.EDW_virtualWin -> father in
05830 let _CRcombo ctrlstr.EDC_channel father x y w h CB_NOEDIT nil -> select in
05831 (
05832 set ctrlstr.EDC_select = select;
05833 set winstr.EDW_lControl = ctrlstr::winstr.EDW_lControl;
05834
05835 let _GETwindowPositionSize father -> [_ _ fw fh] in
05836 set ctrlstr.EDC_coords = [x y (fw-(x + w)) (fh-(y+h)) w h];
05837
05838 ctrlstr;
05839 );
05840 }
05841
05842
05843 dsEdCtrlSelect(ctrlstr){
05844 _DScombo ctrlstr.EDC_select;
05845 set ctrlstr.EDC_father.EDW_lControl = G2DremoveFromList ctrlstr.EDC_father.EDW_lControl ctrlstr;
05846 0;
05847 }
05848
05849
05850
05851
05852
05853 getEdCtrlTreePreviousSelectedItem(ctrlstr){
05854 let ctrlstr.EDC_tree -> [_ _ _ item _] in item;
05855 }
05856
05857
05858 getEdCtrlTreeSelectedItem(ctrlstr){
05859 let ctrlstr.EDC_tree -> [_ _ item _ _] in item;
05860 }
05861
05862
05863 getEdCtrlTreeFatherItem(ctrlstr, item){
05864 item.EDTITEM_father;
05865 }
05866
05867
05868 getEdCtrlTreeSonsItem(ctrlstr, item){
05869 item.EDTITEM_lSons;
05870 }
05871
05872
05873 isEdCtrlTreeItemSon(ctrlstr, item, father){
05874 let 0 -> ret in
05875 (
05876 let sizelist father.EDTITEM_lSons -> size in
05877 let 0 -> i in
05878 while i < size && ret != 1 do
05879 (
05880 let nth_list father.EDTITEM_lSons i -> elt in
05881 (
05882 if elt != item then
05883 set ret = isEdCtrlTreeItemSon ctrlstr item elt
05884 else
05885 set ret = 1;
05886 );
05887
05888 set i = i + 1;
05889 );
05890 ret;
05891 );
05892 }
05893
05894
05895 cbEdCtrlTreeSelect(tree, p, item){
05896 let p -> [ctrlstr cbfun] in
05897 let ctrlstr.EDC_tree -> [tree [litems lsitems bmplist _] pitem _ _] in
05898 let switch litems item -> itemstr in
05899 (
05900 _SELtreeItem tree item;
05901 mutate ctrlstr.EDC_tree <- [_ _ itemstr pitem _];
05902 exec cbfun with [ctrlstr itemstr.EDTITEM_father itemstr itemstr.EDTITEM_sValue itemstr.EDTITEM_iType];
05903 );
05904 0;
05905 }
05906
05907
05908 cbEdCtrlTreeDrag(tree, p, item1, item2){
05909 let p -> [ctrlstr cbfun] in
05910 let ctrlstr.EDC_tree -> [tree [litems lsitems bmplist _] _ _ _] in
05911 let switch litems item1 -> item1str in
05912 let switch litems item2 -> item2str in
05913 exec cbfun with [ctrlstr [item1str.EDTITEM_father item1str item1str.EDTITEM_sValue item1str.EDTITEM_iType] [item2str.EDTITEM_father item2str item2str.EDTITEM_sValue item2str.EDTITEM_iType]];
05914 0;
05915 }
05916
05917
05918 setEdCtrlTreeCbDrag(ctrlstr, cbfun){
05919 let ctrlstr.EDC_tree -> [tree _ _ _ _] in
05920 _CBtreeDrag tree @cbEdCtrlTreeDrag [ctrlstr cbfun];
05921 0;
05922 }
05923
05924
05925 cbEdCtrlTreeDbClick(tree, p, item, x, y){
05926 let p -> [ctrlstr cbfun] in
05927 let ctrlstr.EDC_tree -> [tree [litems lsitems bmplist _] pitem _ _] in
05928 let switch litems item -> itemstr in
05929 (
05930 _SELtreeItem tree item;
05931 exec cbfun with [ctrlstr itemstr.EDTITEM_father itemstr itemstr.EDTITEM_sValue itemstr.EDTITEM_iType x y];
05932 );
05933 0;
05934 }
05935
05936
05937 setEdCtrlTreeCbDbClick(ctrlstr, cbfun){
05938 let ctrlstr.EDC_tree -> [tree _ _ _ _] in
05939 _CBtreeDClick tree @cbEdCtrlTreeDbClick [ctrlstr cbfun];
05940 0;
05941 }
05942
05943
05944 setEdCtrlTreeCbSelect(ctrlstr, cbfun){
05945 let ctrlstr.EDC_tree -> [tree _ _ _ _] in
05946 (
05947 _CBtreeSelect tree @cbEdCtrlTreeSelect [ctrlstr cbfun];
05948 mutate ctrlstr.EDC_tree <- [_ _ _ _ cbfun];
05949 );
05950 0;
05951 }
05952
05953
05954 cbEdCtrlTreeRclick(tree, p, item, x, y, btn){
05955 let p -> [ctrlstr cbfun] in
05956 let ctrlstr.EDC_tree -> [tree [litems lsitems bmplist _] pitem _ cbselfun] in
05957 let switch litems item -> itemstr in
05958 (
05959 _CBtreeSelect tree @cbEdCtrlTreeSelect [ctrlstr nil];
05960 _SELtreeItem tree item;
05961 _CBtreeSelect tree @cbEdCtrlTreeSelect [ctrlstr cbselfun];
05962
05963 exec cbfun with [ctrlstr itemstr.EDTITEM_father itemstr itemstr.EDTITEM_sValue itemstr.EDTITEM_iType x y];
05964 );
05965 0;
05966 }
05967
05968
05969 setEdCtrlTreeCbRclick(ctrlstr, cbfun){
05970 let ctrlstr.EDC_tree -> [tree _ _ _ _] in
05971 _CBtreeRClick tree @cbEdCtrlTreeRclick [ctrlstr cbfun];
05972 0;
05973 }
05974
05975
05976 cbEdCtrlTreeKeyDown(tree, p, key, code){
05977 let p -> [ctrlstr cbfun] in
05978 let ctrlstr.EDC_tree -> [tree [litems lsitems bmplist _] itemstr previtem cbselfun] in
05979 (
05980 exec cbfun with [ctrlstr itemstr.EDTITEM_father itemstr itemstr.EDTITEM_sValue itemstr.EDTITEM_iType key code];
05981 );
05982 0;
05983 }
05984
05985
05986 setEdCtrlTreeCbKeyDown(ctrlstr, cbfun){
05987 let ctrlstr.EDC_tree -> [tree _ _ _ _] in
05988 _CBtreeKeyDown tree @cbEdCtrlTreeKeyDown [ctrlstr cbfun];
05989 0;
05990 }
05991
05992
05993 cbEdCtrlTreeKeyUp(tree, p, key){
05994 let p -> [ctrlstr cbfun] in
05995 let ctrlstr.EDC_tree -> [tree [litems lsitems bmplist _] itemstr _ cbselfun] in
05996 (
05997 exec cbfun with [ctrlstr itemstr.EDTITEM_father itemstr itemstr.EDTITEM_sValue itemstr.EDTITEM_iType key];
05998 );
05999 0;
06000 }
06001
06002
06003 setEdCtrlTreeCbKeyUp(ctrlstr, cbfun){
06004 let ctrlstr.EDC_tree -> [tree _ _ _ _] in
06005 _CBtreeKeyUp tree @cbEdCtrlTreeKeyUp [ctrlstr cbfun];
06006 0;
06007 }
06008
06009
06010 setEdCtrlTreeExpandAll(ctrlstr, mode){
06011 let ctrlstr.EDC_tree -> [tree [litems lsitems bmplist _] _ _ _] in
06012 let sizelist litems -> size in
06013 let 0 -> i in
06014 while i < size do
06015 (
06016 let nth_list litems i -> [item _] in
06017 _SETtreeItemState tree item mode;
06018
06019 set i = i + 1;
06020 );
06021 0;
06022 }
06023
06024
06025
06026
06027
06028 addEdCtrlTreeItem(ctrlstr, father, name, val, type, bitmappath){
06029 let ctrlstr.EDC_tree -> [tree treeparams _ _ _] in
06030 let treeparams -> [litems lsitems bmplist lbmp] in
06031 let _ADDtreeChild tree father.EDTITEM_item TREE_INSERT_LAST name -> item in
06032
06033 let switchstri lbmp bitmappath -> bmpidx in
06034 let if (bitmappath == nil) || (bmpidx != nil) then nil else G2DloadBmp ctrlstr.EDC_channel bitmappath -> bitmap in
06035 let if bmpidx != nil then bmpidx else if bitmap == nil then nil else let (_ADDbitmapList bmplist bitmap) -> bid in (mutate treeparams <- [_ _ _ [bitmappath bid]::lbmp]; bid;) -> bmpidx in
06036 let mkEdTreeItem [item name val type father bmpidx nil] -> itemstr in
06037 (
06038 if father == nil then nil else
06039 set father.EDTITEM_lSons = itemstr::father.EDTITEM_lSons;
06040
06041 _SETtreeItemBitmap tree item bmpidx bmpidx;
06042
06043 mutate treeparams <- [([item itemstr]::litems) ([val itemstr]::lsitems) _ _];
06044
06045 itemstr;
06046 );
06047 }
06048
06049
06050 removeEdCtrlTreeSons(ctrlstr, item){
06051 if item == nil then nil else
06052 (
06053 while item.EDTITEM_lSons != nil do
06054 (
06055 let hd item.EDTITEM_lSons -> sonstr in
06056 removeEdCtrlTreeSons ctrlstr sonstr;
06057
06058 set item.EDTITEM_lSons = tl item.EDTITEM_lSons;
06059 );
06060
06061 let ctrlstr.EDC_tree -> [tree treeparams _ _ _] in
06062 let treeparams -> [litems lsitems _ _] in
06063 mutate treeparams <- [(G2DremoveEdIdxFromList litems item.EDTITEM_item) (G2DremoveEdSidFromListi lsitems item.EDTITEM_sValue) _ _];
06064 );
06065 0;
06066 }
06067
06068
06069 delEdCtrlTreeItem(ctrlstr, item){
06070 if item == nil then nil else
06071 let ctrlstr.EDC_tree -> [tree _ _ _ _] in
06072 (
06073 removeEdCtrlTreeSons ctrlstr item;
06074
06075 set item.EDTITEM_father.EDTITEM_lSons = G2DremoveFromList item.EDTITEM_father.EDTITEM_lSons item;
06076
06077 _DStreeItem tree item.EDTITEM_item;
06078 );
06079 0;
06080 }
06081
06082
06083 refreshEdCtrlTreeSons(ctrlstr, item, sort){
06084 if item == nil then nil else
06085 let ctrlstr.EDC_tree -> [tree _ _ _ _] in
06086 let item.EDTITEM_item -> olditem in
06087 let _ADDtreeChild tree item.EDTITEM_father.EDTITEM_item sort item.EDTITEM_sLabel -> nitem in
06088 (
06089 _SETtreeItemBitmap tree nitem item.EDTITEM_bmpIdx item.EDTITEM_bmpIdx;
06090 set item.EDTITEM_item = nitem;
06091
06092 let ctrlstr.EDC_tree -> [_ treeparams _ _ _] in
06093 let treeparams -> [litems lsitems _ _] in
06094 mutate treeparams <- [[item.EDTITEM_item item]::(G2DremoveEdIdxFromList litems olditem) _ _ _];
06095
06096 let item.EDTITEM_lSons -> l in
06097 while l != nil do
06098 (
06099 let hd l -> sonstr in
06100 refreshEdCtrlTreeSons ctrlstr sonstr TREE_INSERT_FIRST;
06101
06102 set l = tl l;
06103 );
06104 );
06105 0;
06106 }
06107
06108
06109 moveEdCtrlTreeItem(ctrlstr, item, father){
06110 let item.EDTITEM_item -> olditem in
06111 let item.EDTITEM_father -> oldfather in
06112 let ctrlstr.EDC_tree -> [tree treeparams _ _ _] in
06113 let treeparams -> [litems lsitems _ _] in
06114 (
06115 set item.EDTITEM_father = father;
06116 set item.EDTITEM_father.EDTITEM_lSons = item::item.EDTITEM_father.EDTITEM_lSons;
06117 set oldfather.EDTITEM_lSons = G2DremoveFromList oldfather.EDTITEM_lSons item;
06118
06119 refreshEdCtrlTreeSons ctrlstr item TREE_INSERT_LAST;
06120 _DStreeItem tree olditem;
06121 );
06122 0;
06123 }
06124
06125
06126 sizeEdCtrlTree(ctrlstr, x, y, w, h){
06127 let ctrlstr.EDC_tree -> [tree _ _ _ _] in
06128 (
06129 _SIZEtree tree w h x y;
06130 );
06131 }
06132
06133
06134 getEdCtrlTreeItemByValue(ctrlstr, val){
06135 let ctrlstr.EDC_tree -> [tree [litems lsitems bmplist _] _ _ _] in
06136 switchstri lsitems val;
06137 }
06138
06139
06140 getEdCtrlTreeValueByItem(ctrlstr, item){
06141 [item.EDTITEM_sValue item.EDTITEM_iType];
06142 }
06143
06144
06145 getEdCtrlTreeFullValuesByItem(ctrlstr, item){
06146 [item.EDTITEM_father item.EDTITEM_sValue item.EDTITEM_iType];
06147 }
06148
06149
06150 getEdCtrlTreeFullValuesByValue(ctrlstr, val){
06151 let getEdCtrlTreeItemByValue ctrlstr val -> item in
06152 [item.EDTITEM_father item.EDTITEM_sValue item.EDTITEM_iType];
06153 }
06154
06155
06156 getEdCtrlTreeRootItem(ctrlstr){
06157 let ctrlstr.EDC_tree -> [tree [litems lsitems bmplist _] _ _ _] in
06158 let nth_list litems ((sizelist litems) -1) -> [_ itemstr] in
06159 itemstr;
06160 }
06161
06162
06163 getEdCtrlTreeBrothers(ctrlstr, item){
06164 G2DremoveFromList item.EDTITEM_lSons item;
06165 }
06166
06167
06168 selEdCtrlTreeItemByValue(ctrlstr, val){
06169 let ctrlstr.EDC_tree -> [tree _ _ _ _] in
06170 let getEdCtrlTreeItemByValue ctrlstr val -> item in
06171 _SELtreeItem tree item.EDTITEM_item;
06172 0;
06173 }
06174
06175
06176 selEdCtrlTreeItem(ctrlstr, item){
06177 let ctrlstr.EDC_tree -> [tree _ _ _ _] in
06178 _SELtreeItem tree item.EDTITEM_item;
06179 0;
06180 }
06181
06182
06183 resetEdCtrlTree(ctrlstr){
06184 let ctrlstr.EDC_tree -> [tree treeparams _ _ _] in
06185 let treeparams -> [litems lsitems bmplist lbmp] in
06186 (
06187 let sizelist litems -> size in
06188 let 0 -> i in
06189 while i < size do
06190 (
06191 let nth_list litems i -> [item itemstr] in
06192 _DStreeItem tree itemstr.EDTITEM_item;
06193
06194 set i = i + 1;
06195 );
06196
06197 let sizelist lbmp -> size in
06198 let 0 -> i in
06199 while i < size do
06200 (
06201 let nth_list lbmp i -> [_ bmpidx] in
06202 _DELbitmapFromList bmplist bmpidx;
06203
06204 set i = i + 1;
06205 );
06206
06207 mutate treeparams <- [nil nil _ nil];
06208 mutate ctrlstr.EDC_tree <- [_ _ nil nil _];
06209 );
06210 0;
06211 }
06212
06213
06214 crEdCtrlTree(winstr, x, y, w, h, resize){
06215 let mkEdControl [winstr.EDW_channel winstr resize nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil] -> ctrlstr in
06216 let if ctrlstr.EDC_father.EDW_virtualWin == nil then ctrlstr.EDC_father.EDW_win else ctrlstr.EDC_father.EDW_virtualWin -> father in
06217 let _CRtree ctrlstr.EDC_channel father x y w h TV_BORDER|TV_VSCROLL|TV_HSCROLL|TV_BUTTON -> tree in
06218 let _CRbitmapList ctrlstr.EDC_channel 16 16 -> bmplist in
06219 (
06220 set ctrlstr.EDC_tree = [tree [nil nil bmplist nil] nil nil nil];
06221 set winstr.EDW_lControl = ctrlstr::winstr.EDW_lControl;
06222 _SETtreeBitmaps tree bmplist;
06223
06224 _CBtreeDClick tree @cbEdCtrlTreeDbClick [ctrlstr nil];
06225 _CBtreeSelect tree @cbEdCtrlTreeSelect [ctrlstr nil];
06226 _CBtreeRClick tree @cbEdCtrlTreeRclick [ctrlstr nil];
06227
06228 let _GETwindowPositionSize father -> [_ _ fw fh] in
06229 set ctrlstr.EDC_coords = [x y (fw-(x + w)) (fh-(y+h)) w h];
06230
06231 ctrlstr;
06232 );
06233 }
06234
06235
06236 dsEdCtrlTree(ctrlstr){
06237 resetEdCtrlTree ctrlstr;
06238 let ctrlstr.EDC_tree -> [tree [litems lsitems bmplist _] _ _ _] in
06239 (
06240 _DStree tree;
06241 _DSbitmapList bmplist;
06242 );
06243 set ctrlstr.EDC_father.EDW_lControl = G2DremoveFromList ctrlstr.EDC_father.EDW_lControl ctrlstr;
06244 0;
06245 }
06246
06247
06248
06249
06250
06251 cbEdCtrlBitmapCursorMove(cmpbmp, ctrlstr, x, y, mask){
06252 0;
06253 }
06254
06255
06256 cbEdCtrlBitmapResize(cmpbmp, ctrlstr, w, h){
06257 0;
06258 }
06259
06260
06261 selectEdCtrlBitmapList(ctrlstr, pos){
06262 let ctrlstr.EDC_bitmapList -> [cont marge w h lval _ _] in
06263 let _CRfont ctrlstr.EDC_channel 10 0 FF_PIXEL "Arial" -> font in
06264 (
06265 let sizelist lval -> size in
06266 let 0 -> i in
06267 while i < size do
06268 (
06269 let nth_list lval i -> [epos [bglayer _ _ name _]] in
06270 (
06271 if epos == pos then
06272 G2DsetLayer ctrlstr.EDC_channel bglayer w h 1 0xf3718a 0xff98ab 80
06273 else
06274 G2DsetLayer ctrlstr.EDC_channel bglayer w h 0 0xffffff 0xffffff 100;
06275
06276 let _GETalphaBitmaps bglayer -> [tbmp _] in
06277 _DRAWtext tbmp font (w / 2) h-marge TD_CENTER|TD_BOTTOM 0x000000 name;
06278 );
06279
06280 set i = i + 1;
06281 );
06282 _DSfont font;
06283 _PAINTcontainer cont;
06284 );
06285 0;
06286 }
06287
06288
06289 getEdCtrlBitmapListValbyPos(ctrlstr, pos){
06290 let ctrlstr.EDC_bitmapList -> [_ _ _ _ lval _ _] in
06291 let switch lval pos -> [_ _ _ _ val] in
06292 val;
06293 }
06294
06295
06296 cbEdCtrlBitmapListClick(cmpbmp, param, x, y, btn, mask){
06297 let param -> [ctrlstr pos] in
06298 let ctrlstr.EDC_bitmapList -> [_ _ _ _ lval cbfun _] in
06299 let switch lval pos -> [_ _ _ _ val] in
06300 (
06301 exec cbfun with [ctrlstr val btn mask];
06302 selectEdCtrlBitmapList ctrlstr pos;
06303 );
06304 0;
06305 }
06306
06307
06308 cbEdCtrlBitmapListDbClick(cmpbmp, param, x, y, btn, mask){
06309 let param -> [ctrlstr pos] in
06310 let ctrlstr.EDC_bitmapList -> [_ _ _ _ lval _ cbfun] in
06311 let switch lval pos -> [_ _ _ _ val] in
06312 (
06313 exec cbfun with [ctrlstr val btn mask];
06314 selectEdCtrlBitmapList ctrlstr pos;
06315 );
06316 0;
06317 }
06318
06319
06320 refreshEdCtrlBitmapListBitmap(ctrlstr){
06321 let ctrlstr.EDC_bitmapList -> [cont marge w h lval _ _] in
06322 (
06323 let _GETcontainerPositionSize cont -> [_ _ cw ch] in
06324 let cw / w -> nbw in
06325 let sizelist lval -> size in
06326 let 0 -> i in
06327 while i < size do
06328 (
06329 let (mod i nbw) * w -> lx in
06330 let (i / nbw) * h -> ly in
06331 let nth_list lval i -> [epos [_ cbmpback _ _ _]] in
06332 (
06333 _CHANGEobjNodeCoordinates (_CONVERTcompBitmapToObjNode cbmpback) [lx ly] 0;
06334 );
06335
06336 set i = i + 1;
06337 );
06338 _PAINTcontainer cont;
06339 );
06340 0;
06341 }
06342
06343
06344 setEdCtrlBitmapListBitmap(ctrlstr, pos, bmppath){
06345 let ctrlstr.EDC_bitmapList -> [cont marge w h lval _ _] in
06346 let switch lval pos -> [bglayer cbmpback ocbmp name val] in
06347 (
06348 _DScompBitmap ocbmp;
06349
06350 let G2DstrechBitmap ctrlstr.EDC_channel G2DloadBmp ctrlstr.EDC_channel bmppath w-(marge*2) h-(marge*2)-20 0xffffff -> bmp in
06351 let _CRalphaBitmap ctrlstr.EDC_channel bmp nil nil nil -> abmp in
06352 let _CRcompBitmap ctrlstr.EDC_channel cont (_CONVERTcompBitmapToObjNode cbmpback) [marge marge] OBJ_ENABLE|OBJ_VISIBLE nil abmp 0 0 w h -> cbmp in
06353 (
06354 _DSbitmap bmp;
06355 _CBcompBitmapClick cbmp @cbEdCtrlBitmapListClick [ctrlstr pos];
06356 _CBcompBitmapDblClick cbmp @cbEdCtrlBitmapListDbClick [ctrlstr pos];
06357 _CBcompBitmapCursorMove cbmp @cbEdCtrlBitmapCursorMove [ctrlstr pos];
06358 _CBcompBitmapResize cbmp @cbEdCtrlBitmapResize [ctrlstr pos];
06359
06360 mutate ctrlstr.EDC_bitmapList <- [_ _ _ _ (G2Dlcat (G2DremoveEdIdxFromList lval pos) [pos [bglayer cbmpback cbmp name val]]::nil) _ _];
06361 0;
06362 );
06363
06364 _PAINTcontainer cont;
06365 );
06366 0;
06367 }
06368
06369
06370 setEdCtrlBitmapListCbClick(ctrlstr, cbfun){
06371 mutate ctrlstr.EDC_bitmapList <- [_ _ _ _ _ cbfun _];
06372 0;
06373 }
06374
06375
06376 setEdCtrlBitmapListCbDbClick(ctrlstr, cbfun){
06377 mutate ctrlstr.EDC_bitmapList <- [_ _ _ _ _ _ cbfun];
06378 0;
06379 }
06380
06381
06382 addEdCtrlBitmapList(ctrlstr, name, bmppath, val){
06383 let ctrlstr.EDC_bitmapList -> [cont marge w h lval _ _] in
06384 let sizelist lval -> pos in
06385 (
06386 let _GETcontainerPositionSize cont -> [_ _ cw ch] in
06387 let cw / w -> nbw in
06388 let (mod pos nbw) * w -> lx in
06389 let (pos / nbw) * h -> ly in
06390 let G2DcreateLayer ctrlstr.EDC_channel w h 0 0xffffff 0xffffff 100 -> bglayer in
06391 let G2DstrechBitmap ctrlstr.EDC_channel G2DloadBmp ctrlstr.EDC_channel bmppath w-(marge*2) h-(marge*2)-20 0xffffff -> bmp in
06392 let _CRalphaBitmap ctrlstr.EDC_channel bmp nil nil nil -> abmp in
06393 let _CRcompBitmap ctrlstr.EDC_channel cont nil [lx ly] OBJ_ENABLE|OBJ_VISIBLE nil bglayer 0 0 w h -> cbmpback in
06394 let _CRcompBitmap ctrlstr.EDC_channel cont (_CONVERTcompBitmapToObjNode cbmpback) [marge marge] OBJ_ENABLE|OBJ_VISIBLE nil abmp 0 0 w h -> cbmp in
06395 let _GETalphaBitmaps bglayer -> [tbmp _] in
06396 let _CRfont ctrlstr.EDC_channel 10 0 FF_PIXEL "Arial" -> font in
06397 (
06398 _DRAWtext tbmp font (w / 2) h-marge TD_CENTER|TD_BOTTOM 0x000000 name;
06399
06400 _DSfont font;
06401
06402 _DSbitmap bmp;
06403 _CBcompBitmapClick cbmpback @cbEdCtrlBitmapListClick [ctrlstr pos];
06404 _CBcompBitmapDblClick cbmpback @cbEdCtrlBitmapListDbClick [ctrlstr pos];
06405 _CBcompBitmapCursorMove cbmpback @cbEdCtrlBitmapCursorMove [ctrlstr pos];
06406 _CBcompBitmapResize cbmpback @cbEdCtrlBitmapResize [ctrlstr pos];
06407
06408 _CBcompBitmapClick cbmp @cbEdCtrlBitmapListClick [ctrlstr pos];
06409 _CBcompBitmapDblClick cbmp @cbEdCtrlBitmapListDbClick [ctrlstr pos];
06410 _CBcompBitmapCursorMove cbmp @cbEdCtrlBitmapCursorMove [ctrlstr pos];
06411 _CBcompBitmapResize cbmp @cbEdCtrlBitmapResize [ctrlstr pos];
06412
06413
06414 mutate ctrlstr.EDC_bitmapList <- [_ _ _ _ (G2Dlcat lval [pos [bglayer cbmpback cbmp name val]]::nil) _ _];
06415 );
06416 _PAINTcontainer cont;
06417 pos;
06418 );
06419 }
06420
06421
06422 resetEdCtrlBitmapList(ctrlstr){
06423 let ctrlstr.EDC_bitmapList -> [cont marge w h lval _ _] in
06424 (
06425 let sizelist lval -> size in
06426 let 0 -> i in
06427 while i < size do
06428 (
06429 let nth_list lval i -> [_ [bglayer cbmpback cbmp _ _]] in
06430 (
06431 _DScompBitmap cbmpback;
06432 _DScompBitmap cbmp;
06433 _DSalphaBitmap bglayer;
06434 );
06435
06436 set i = i + 1;
06437 );
06438 mutate ctrlstr.EDC_bitmapList <- [cont _ _ _ nil _ _];
06439 _PAINTcontainer cont;
06440 );
06441 0;
06442 }
06443
06444
06445 setEdCtrlBitmapListElemSize(ctrlstr, w, h, marge){
06446 mutate ctrlstr.EDC_bitmapList <- [_ marge w h _ _ _];
06447 0;
06448 }
06449
06450
06451 cbEdCtrlBitmapListSize(cont, ctrlstr, state, w, h){
06452 refreshEdCtrlBitmapListBitmap ctrlstr;
06453 0;
06454 }
06455
06456
06457 crEdCtrlBitmapList(winstr, x, y, w, h, bw, bh, marge, resize){
06458 let mkEdControl [winstr.EDW_channel winstr resize nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil] -> ctrlstr in
06459 let if ctrlstr.EDC_father.EDW_virtualWin == nil then ctrlstr.EDC_father.EDW_win else ctrlstr.EDC_father.EDW_virtualWin -> father in
06460 let _CRcontainerFromObjWin ctrlstr.EDC_channel father x y w h CO_CHILDINSIDE 0xffffff "" -> cont in
06461 (
06462 set ctrlstr.EDC_bitmapList = [cont marge bw bh nil nil nil];
06463 set winstr.EDW_lControl = ctrlstr::winstr.EDW_lControl;
06464
06465 _CBcontainerSize cont @cbEdCtrlBitmapListSize ctrlstr;
06466
06467 let _GETwindowPositionSize father -> [_ _ fw fh] in
06468 set ctrlstr.EDC_coords = [x y (fw-(x + w)) (fh-(y+h)) w h];
06469
06470 _PAINTcontainer cont;
06471 ctrlstr;
06472 );
06473 }
06474
06475
06476 dsEdCtrlBitmapList(ctrlstr){
06477 resetEdCtrlBitmapList ctrlstr;
06478 let ctrlstr.EDC_bitmapList -> [cont _ _ _ _ _ _] in
06479 _DScontainer cont;
06480
06481 set ctrlstr.EDC_father.EDW_lControl = G2DremoveFromList ctrlstr.EDC_father.EDW_lControl ctrlstr;
06482 0;
06483 }
06484
06485
06486
06487
06488
06489 cbEdCtrlBitmapResizeResource(cmpbmp, ctrlstr, w, h, oldval){
06490 let oldval -> [ox oy ow oh] in
06491 let ctrlstr.EDC_bitmap -> [_ obmp _ bmppath bgcolor] in
06492
06493 let if bmppath == nil then (_FILLbitmap _CRbitmap ctrlstr.EDC_channel w h bgcolor) else G2DstrechBitmap ctrlstr.EDC_channel G2DloadBmp ctrlstr.EDC_channel bmppath w h 0xffffff -> bmp in
06494 let _CRalphaBitmap ctrlstr.EDC_channel bmp nil nil nil -> abmp in
06495 (
06496 _DSbitmap bmp;
06497 _DSalphaBitmap obmp;
06498 mutate ctrlstr.EDC_bitmap <- [_ abmp _ _ _];
06499 [abmp [ox oy w h]]
06500 );
06501 }
06502
06503
06504 cbEdCtrlBitmapResizeGridResource(cmpbmp, p, w, h, oldval){
06505 let p -> [ctrlstr dotcolor dotspace] in
06506 let oldval -> [ox oy ow oh] in
06507 let ctrlstr.EDC_bitmap -> [_ obmp _ _ bgcolor] in
06508
06509 let (_FILLbitmap _CRbitmap ctrlstr.EDC_channel w h bgcolor) -> bmp in
06510 let
06511
06512 let 0 -> ih in
06513 while ih <= h do
06514 (
06515 let 0 -> iw in
06516 while iw <= w do
06517 (
06518 _PUTpixel24 bmp iw ih dotcolor;
06519
06520
06521 set iw = iw + dotspace;
06522 );
06523
06524 set ih = ih + dotspace;
06525 )
06526 -> _ in
06527 let _CRalphaBitmap ctrlstr.EDC_channel bmp nil nil nil -> abmp in
06528 (
06529 _DSbitmap bmp;
06530 _DSalphaBitmap obmp;
06531 mutate ctrlstr.EDC_bitmap <- [_ abmp _ _ _];
06532 [abmp [ox oy w h]]
06533 );
06534 }
06535
06536
06537 setEdCtrlBitmap(ctrlstr, bmppath){
06538 let ctrlstr.EDC_bitmap -> [cont alphabmp ocbmp _ _] in
06539 let _GETcontainerPositionSize cont -> [_ _ w h] in
06540 (
06541 _DScompBitmap ocbmp;
06542 _DSalphaBitmap alphabmp;
06543
06544 let G2DstrechBitmap ctrlstr.EDC_channel G2DloadBmp ctrlstr.EDC_channel bmppath w h 0xffffff -> bmp in
06545 let _CRalphaBitmap ctrlstr.EDC_channel bmp nil nil nil -> abmp in
06546 let _CRcompBitmap ctrlstr.EDC_channel cont nil [0 0] OBJ_ENABLE|OBJ_VISIBLE nil abmp 0 0 w h -> cbmp in
06547 (
06548 _DSbitmap bmp;
06549 _CBcompBitmapCursorMove cbmp @cbEdCtrlBitmapCursorMove ctrlstr;
06550 _CBcompBitmapResize cbmp @cbEdCtrlBitmapResize ctrlstr;
06551 _CBcompBitmapResizeResource cbmp @cbEdCtrlBitmapResizeResource ctrlstr;
06552
06553 mutate ctrlstr.EDC_bitmap <- [_ abmp cbmp bmppath _];
06554 0;
06555 );
06556 _PAINTcontainer cont;
06557 );
06558 0;
06559 }
06560
06561
06562 getEdCtrlBitmapBuffer(ctrlstr){
06563 let ctrlstr.EDC_bitmap -> [cont alphabmp ocbmp _ _] in
06564 let _GETalphaBitmaps alphabmp -> [buffer _ ] in
06565 buffer;
06566 }
06567
06568
06569 setEdCtrlBitmapColor(ctrlstr, bgcolor){
06570 let ctrlstr.EDC_bitmap -> [cont alphabmp ocbmp _ _] in
06571 let _GETcontainerPositionSize cont -> [_ _ w h] in
06572 (
06573 _DScompBitmap ocbmp;
06574 _DSalphaBitmap alphabmp;
06575
06576 let _FILLbitmap _CRbitmap ctrlstr.EDC_channel w h bgcolor -> bmp in
06577 let _CRalphaBitmap ctrlstr.EDC_channel bmp nil nil nil -> abmp in
06578 let _CRcompBitmap ctrlstr.EDC_channel cont nil [0 0] OBJ_ENABLE|OBJ_VISIBLE nil abmp 0 0 w h -> cbmp in
06579 (
06580 _DSbitmap bmp;
06581 _CBcompBitmapCursorMove cbmp @cbEdCtrlBitmapCursorMove ctrlstr;
06582 _CBcompBitmapResize cbmp @cbEdCtrlBitmapResize ctrlstr;
06583 _CBcompBitmapResizeResource cbmp @cbEdCtrlBitmapResizeResource ctrlstr;
06584
06585 mutate ctrlstr.EDC_bitmap <- [_ abmp cbmp _ bgcolor];
06586 0;
06587 );
06588 _PAINTcontainer cont;
06589 );
06590 0;
06591 }
06592
06593
06594 paintEdCtrlBitmap(ctrlstr){
06595 let ctrlstr.EDC_bitmap -> [cont abmp cbmp bmppath bgcolor] in
06596 _PAINTcontainer cont;
06597 0;
06598 }
06599
06600
06601 crEdCtrlBitmap(winstr, x, y, w, h, bmppath, bgcolor, resize){
06602 let mkEdControl [winstr.EDW_channel winstr resize nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil] -> ctrlstr in
06603 let if ctrlstr.EDC_father.EDW_virtualWin == nil then ctrlstr.EDC_father.EDW_win else ctrlstr.EDC_father.EDW_virtualWin -> father in
06604 let _CRcontainerFromObjWin ctrlstr.EDC_channel father x y w h CO_CHILDINSIDE|CO_NOBORDER bgcolor "" -> cont in
06605 let if bmppath == nil then (_FILLbitmap _CRbitmap ctrlstr.EDC_channel w h bgcolor) else G2DstrechBitmap ctrlstr.EDC_channel G2DloadBmp ctrlstr.EDC_channel bmppath w h bgcolor -> bmp in
06606 let _CRalphaBitmap ctrlstr.EDC_channel bmp nil nil nil -> abmp in
06607 let _CRcompBitmap ctrlstr.EDC_channel cont nil [0 0] OBJ_ENABLE|OBJ_VISIBLE|OBJ_MW_FLEX|OBJ_MH_FLEX OBJ_CONTAINER_UNCLICK|OBJ_CONTAINER_CLICK|OBJ_CONTAINER_MOVE abmp 0 0 w h -> cbmp in
06608 (
06609 _DSbitmap bmp;
06610 _CBcompBitmapCursorMove cbmp @cbEdCtrlBitmapCursorMove ctrlstr;
06611 _CBcompBitmapResize cbmp @cbEdCtrlBitmapResize ctrlstr;
06612 _CBcompBitmapResizeResource cbmp @cbEdCtrlBitmapResizeResource ctrlstr;
06613
06614 set ctrlstr.EDC_bitmap = [cont abmp cbmp bmppath bgcolor];
06615 set winstr.EDW_lControl = ctrlstr::winstr.EDW_lControl;
06616
06617 let _GETwindowPositionSize father -> [_ _ fw fh] in
06618 set ctrlstr.EDC_coords = [x y (fw-(x + w)) (fh-(y+h)) w h];
06619
06620 _PAINTcontainer cont;
06621 ctrlstr;
06622 );
06623 }
06624
06625
06626 crEdCtrlGrid(winstr, x, y, w, h, bgcolor, dotcolor, dotspace, resize){
06627 let if !dotspace then 10 else dotspace -> dotspace in
06628 let mkEdControl [winstr.EDW_channel winstr resize nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil] -> ctrlstr in
06629 let if ctrlstr.EDC_father.EDW_virtualWin == nil then ctrlstr.EDC_father.EDW_win else ctrlstr.EDC_father.EDW_virtualWin -> father in
06630 let _CRcontainerFromObjWin ctrlstr.EDC_channel father x y w h CO_CHILDINSIDE|CO_NOBORDER 0xffffff "" -> cont in
06631 let _FILLbitmap _CRbitmap ctrlstr.EDC_channel w h bgcolor -> bmp in
06632 let
06633
06634 let 0 -> ih in
06635 while ih <= h do
06636 (
06637 let 0 -> iw in
06638 while iw <= w do
06639 (
06640 _PUTpixel24 bmp iw ih dotcolor;
06641
06642
06643 set iw = iw + dotspace;
06644 );
06645
06646 set ih = ih + dotspace;
06647 )
06648 -> _ in
06649 let _CRalphaBitmap ctrlstr.EDC_channel bmp nil nil nil -> abmp in
06650 let _CRcompBitmap ctrlstr.EDC_channel cont nil [0 0] OBJ_ENABLE|OBJ_VISIBLE|OBJ_MW_FLEX|OBJ_MH_FLEX OBJ_CONTAINER_UNCLICK|OBJ_CONTAINER_CLICK|OBJ_CONTAINER_DBLCLICK|OBJ_CONTAINER_MOVE|OBJ_CONTAINER_MOUSEWHEEL|OBJ_CONTAINER_KEYDOWN|OBJ_CONTAINER_KEYUP abmp 0 0 w h -> cbmp in
06651 (
06652 _DSbitmap bmp;
06653 _CBcompBitmapCursorMove cbmp @cbEdCtrlBitmapCursorMove ctrlstr;
06654 _CBcompBitmapResize cbmp @cbEdCtrlBitmapResize ctrlstr;
06655 _CBcompBitmapResizeResource cbmp @cbEdCtrlBitmapResizeGridResource [ctrlstr dotcolor dotspace];
06656
06657 set ctrlstr.EDC_bitmap = [cont abmp cbmp nil bgcolor];
06658 set winstr.EDW_lControl = ctrlstr::winstr.EDW_lControl;
06659
06660 let _GETwindowPositionSize father -> [_ _ fw fh] in
06661 set ctrlstr.EDC_coords = [x y (fw-(x + w)) (fh-(y+h)) w h];
06662
06663 _PAINTcontainer cont;
06664 ctrlstr;
06665 );
06666 }
06667
06668
06669 dsEdCtrlBitmap(ctrlstr){
06670 let ctrlstr.EDC_bitmap -> [cont abmp cbmp bmppath _] in
06671 (
06672 _DScompBitmap cbmp;
06673 _DSalphaBitmap abmp;
06674 _DScontainer cont;
06675 );
06676 set ctrlstr.EDC_father.EDW_lControl = G2DremoveFromList ctrlstr.EDC_father.EDW_lControl ctrlstr;
06677 0;
06678 }
06679
06680
06681
06682
06683
06684 cbEdCtrlFloatChange(txt, p){
06685 let p -> [ctrlstr cbfun] in
06686 let ctrlstr.EDC_editFloat -> [txt cont cmprup cmprdown minval maxval incre nb0 _ _ _ _ _] in
06687 let _GETtext txt -> val in
06688 let if ((atof val) == nil) || ((atof val) <. minval) then minval else if ((atof val) >. maxval) then maxval else (atof val) -> fval in
06689 (
06690 if ((atof val) >=. minval) && ((atof val) <=. maxval) && ((atof val) != nil) then nil else
06691 _SETtext txt G2DgetFtoA fval nb0;
06692
06693 exec cbfun with [ctrlstr fval];
06694 );
06695 0;
06696 }
06697
06698
06699 getEdCtrlFloatValue(ctrlstr){
06700 let ctrlstr.EDC_editFloat -> [txt cont cmprup cmprdown minval maxval incre nb0 _ _ _ _ _] in
06701 atof _GETtext txt;
06702 }
06703
06704
06705 setEdCtrlFloatValue(ctrlstr, val){
06706 let ctrlstr.EDC_editFloat -> [txt cont cmprup cmprdown minval maxval incre nb0 _ _ _ _ _] in
06707 let if val == nil then 0.0 else val -> val in
06708 _SETtext txt G2DgetFtoA val nb0;
06709 0;
06710 }
06711
06712
06713 setEdCtrlFloatMinValue(ctrlstr, val){
06714 mutate ctrlstr.EDC_editFloat <- [_ _ _ _ val _ _ _ _ _ _ _ _];
06715 }
06716
06717
06718 setEdCtrlFloatMaxValue(ctrlstr, val){
06719 mutate ctrlstr.EDC_editFloat <- [_ _ _ _ _ val _ _ _ _ _ _ _];
06720 }
06721
06722
06723 setEdCtrlFloatValueWithoutCallback(ctrlstr, val){
06724 let ctrlstr.EDC_editFloat -> [txt cont cmprup cmprdown minval maxval incre nb0 _ _ _ cbfun _] in
06725 let if val == nil then 0.0 else val -> val in
06726 (
06727 _CBtext txt nil nil;
06728 _SETtext txt G2DgetFtoA val nb0;
06729 _CBtext txt @cbEdCtrlFloatChange [ctrlstr cbfun];
06730 );
06731 0;
06732 }
06733
06734
06735 setEdCtrlFloatEnable(ctrlstr, state){
06736 let ctrlstr.EDC_editFloat -> [txt cont cmprup cmprdown _ _ _ _ _ _ _ _ _] in
06737 let if state then OBJ_ENABLE|OBJ_VISIBLE|ROL_DISABLE|ROL_MASK else OBJ_DISABLE|OBJ_VISIBLE|ROL_DISABLE|ROL_MASK -> flags in
06738 (
06739 _ENtext txt state;
06740 _CHANGEobjNodeFlags _CONVERTcompRollOverToObjNode cmprup flags 0;
06741 _CHANGEobjNodeFlags _CONVERTcompRollOverToObjNode cmprdown flags 0;
06742 _PAINTcontainer cont;
06743 mutate ctrlstr.EDC_editFloat <- [_ _ _ _ _ _ _ _ _ _ state _ _];
06744 );
06745 0;
06746 }
06747
06748
06749 setEdCtrlFloatCbChange(ctrlstr, cbfun){
06750 let ctrlstr.EDC_editFloat -> [txt cont cmprup cmprdown _ _ _ nb0 _ _ _ _ _] in
06751 _CBtext txt @cbEdCtrlFloatChange [ctrlstr cbfun];
06752
06753 mutate ctrlstr.EDC_editFloat <- [_ _ _ _ _ _ _ _ _ _ _ cbfun _];
06754 0;
06755 }
06756
06757
06758 cbEdCtrlFloatValidate(txt, p, val){
06759 let p -> [ctrlstr cbfun] in
06760 let ctrlstr.EDC_editFloat -> [txt cont cmprup cmprdown minval maxval _ nb0 _ _ _ _ _] in
06761 let if ((atof val) <. minval) && minval != nil then
06762 minval
06763 else if ((atof val) >. maxval) && maxval != nil then
06764 maxval
06765 else
06766 (atof val)
06767 -> fval in
06768 (
06769 if ((atof val) >=. minval) && ((atof val) <=. maxval) then nil else
06770 _SETtext txt G2DgetFtoA fval nb0;
06771
06772 exec cbfun with [ctrlstr fval];
06773 );
06774 0;
06775 }
06776
06777
06778 setEdCtrlFloatCbValidate(ctrlstr, cbfun){
06779 let ctrlstr.EDC_editFloat -> [txt cont cmprup cmprdown _ _ _ nb0 _ _ _ _ _] in
06780 _CBlineOk txt @cbEdCtrlFloatValidate [ctrlstr cbfun];
06781
06782 mutate ctrlstr.EDC_editFloat <- [_ _ _ _ _ _ _ _ _ _ _ _ cbfun];
06783 0;
06784 }
06785
06786
06787 cbEdCtrlFloatUpClick(cmproll, ctrlstr, x, y, btn, mask){
06788 let ctrlstr.EDC_editFloat -> [txt cont cmprup cmprdown _ _ incre nb0 _ _ _ _ cbfun] in
06789 let atof _GETtext txt -> fval in
06790 (
06791 _SETtext txt G2DgetFtoA (fval +. incre) nb0;
06792
06793 cbEdCtrlFloatValidate txt [ctrlstr cbfun] G2DgetFtoA (fval +. incre) nb0;
06794 );
06795 0;
06796 }
06797
06798
06799 cbEdCtrlFloatDownClick(cmproll, ctrlstr, x, y, btn, mask){
06800 let ctrlstr.EDC_editFloat -> [txt cont cmprup cmprdown _ _ incre nb0 _ _ _ _ cbfun] in
06801 let atof _GETtext txt -> fval in
06802 (
06803 _SETtext txt G2DgetFtoA (fval -. incre) nb0;
06804
06805 cbEdCtrlFloatValidate txt [ctrlstr cbfun] G2DgetFtoA (fval -. incre) nb0;
06806 );
06807 0;
06808 }
06809
06810
06811 cbEdCtrlFloatUnClick(cont, ctrlstr, x, y, btn, mask){
06812 let ctrlstr.EDC_editFloat -> [txt cont cmprup cmprdown _ _ incre nb0 _ _ _ _ cbfun] in
06813 let atof _GETtext txt -> fval in
06814 (
06815 _SETtext txt G2DgetFtoA fval nb0;
06816 cbEdCtrlFloatValidate txt [ctrlstr cbfun] G2DgetFtoA fval nb0;
06817 );
06818 0;
06819 }
06820
06821
06822 cbEdCtrlFloatLeave(cont, ctrlstr){
06823 _SETcontainerCursor cont nil;
06824 0;
06825 }
06826
06827
06828 cbEdCtrlFloatDrag(cont, ctrlstr, x, y, mask){
06829 let ctrlstr.EDC_editFloat -> [txt cont cmprup cmprdown _ _ incre nb0 cy cursor state _ _] in
06830 if !state then nil else
06831 let _GETscreenPos -> [sx sy] in
06832 let _GETscreenSize -> [_ sh] in
06833 let sh - 40 -> sh in
06834 (
06835 let itof (cy - sy) -> coef in
06836 if (mask & MK_LBUTTON) then
06837 (
06838
06839 if (sy <= 1) && (coef >. 0.0) then
06840 (
06841 _SETscreenPos sx sh;
06842 set sy = sh;
06843 )
06844 else if (sy >= (sh - 1)) && (coef <. 0.0) then
06845 (
06846 _SETscreenPos sx 1;
06847 set sy = 1;
06848 )
06849 else nil;
06850
06851 _SETcontainerCursor cont cursor;
06852
06853 let atof _GETtext txt -> fval in
06854 setEdCtrlFloatValue ctrlstr (fval +. (incre *. coef));
06855
06856 mutate ctrlstr.EDC_editFloat <- [_ _ _ _ _ _ _ _ sy _ _ _ _];
06857 0;
06858 )
06859 else
06860 (
06861 _SETcontainerCursor cont nil;
06862 mutate ctrlstr.EDC_editFloat <- [_ _ _ _ _ _ _ _ sy _ _ _ _];
06863 0;
06864 );
06865 );
06866 0;
06867 }
06868
06869
06870 crEdCtrlFloat(winstr, x, y, w, h, value, minval, maxval, incre, nb0, themestr, resize){
06871 let if value == nil then 0.0 else value -> value in
06872 let if themestr == nil then (if EdDefaultTheme == nil then (set EdDefaultTheme = makeEdThemeResources winstr.EDW_channel) else EdDefaultTheme) else themestr -> themestr in
06873
06874 let mkEdControl [winstr.EDW_channel winstr resize themestr nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil] -> ctrlstr in
06875 let if ctrlstr.EDC_father.EDW_virtualWin == nil then ctrlstr.EDC_father.EDW_win else ctrlstr.EDC_father.EDW_virtualWin -> father in
06876 let if value == nil then 0.0 else value -> value in
06877 let _GETalphaBitmapSize themestr.EDT_abmpValUp -> [auw auh] in
06878 let _GETalphaBitmapSize themestr.EDT_abmpValDown -> [adw adh] in
06879 let _CReditLine ctrlstr.EDC_channel father x y (w - auw) h if (nb0 == 0 || nb0 == nil) then ET_BORDER|ET_AHSCROLL|ET_TABFOCUS|ET_NUMBER else ET_BORDER|ET_AHSCROLL|ET_TABFOCUS (G2DgetFtoA value nb0) -> txt in
06880 let _CRcontainerFromObjWin ctrlstr.EDC_channel father (x + (w - auw)) y auw ((auh / 5) + (adh / 5)) CO_CHILDINSIDE|CO_NOBORDER 0xffffff "" -> cont in
06881 let _CRcompRollOver ctrlstr.EDC_channel cont nil [0 0] OBJ_ENABLE|OBJ_VISIBLE|ROL_MASK|ROL_DISABLE OBJ_CONTAINER_MOVE|OBJ_CONTAINER_KEYUP|OBJ_CONTAINER_KEYDOWN|OBJ_CONTAINER_MOUSEWHEEL|OBJ_CONTAINER_DBLCLICK themestr.EDT_abmpValUp -> cmprup in
06882 let _CRcompRollOver ctrlstr.EDC_channel cont nil [0 (auh / 5)] OBJ_ENABLE|OBJ_VISIBLE|ROL_MASK|ROL_DISABLE OBJ_CONTAINER_MOVE|OBJ_CONTAINER_KEYUP|OBJ_CONTAINER_KEYDOWN|OBJ_CONTAINER_MOUSEWHEEL|OBJ_CONTAINER_DBLCLICK themestr.EDT_abmpValDown -> cmprdown in
06883 (
06884 set ctrlstr.EDC_editFloat = [txt cont cmprup cmprdown minval maxval incre nb0 nil themestr.EDT_cursorSize 1 nil nil];
06885
06886 _CBcompRollOverUnClick cmprup @cbEdCtrlFloatUpClick ctrlstr;
06887 _CBcompRollOverUnClick cmprdown @cbEdCtrlFloatDownClick ctrlstr;
06888
06889 _CBcontainerCursorMove cont @cbEdCtrlFloatDrag ctrlstr;
06890 _CBcontainerCursorLeave cont @cbEdCtrlFloatLeave ctrlstr;
06891 _CBcontainerUnClick cont @cbEdCtrlFloatUnClick ctrlstr;
06892
06893
06894 _CBtext txt @cbEdCtrlFloatChange [ctrlstr nil];
06895 _CBlineOk txt @cbEdCtrlFloatValidate [ctrlstr nil];
06896
06897 set winstr.EDW_lControl = ctrlstr::winstr.EDW_lControl;
06898
06899 let _GETwindowPositionSize father -> [_ _ fw fh] in
06900 set ctrlstr.EDC_coords = [x y (fw-(x + w)) (fh-(y+h)) w h];
06901
06902 _PAINTcontainer cont;
06903 ctrlstr;
06904 );
06905 }
06906
06907
06908 dsEdCtrlFloat(ctrlstr){
06909 let ctrlstr.EDC_editFloat -> [txt cont cmprup cmprdown _ _ _ _ _ cursor _ _ _] in
06910 (
06911 _DStext txt;
06912 _DScompRollOver cmprup;
06913 _DScompRollOver cmprdown;
06914 _DScontainer cont;
06915 );
06916 set ctrlstr.EDC_father.EDW_lControl = G2DremoveFromList ctrlstr.EDC_father.EDW_lControl ctrlstr;
06917 0;
06918 }
06919
06920
06921
06922
06923
06924 crEdCtrl3D(winstr, x, y, w, h, resize){
06925 let mkEdControl [winstr.EDW_channel winstr resize nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil] -> ctrlstr in
06926 let if ctrlstr.EDC_father.EDW_virtualWin == nil then ctrlstr.EDC_father.EDW_win else ctrlstr.EDC_father.EDW_virtualWin -> father in
06927 let V3DcrView ctrlstr.EDC_channel father x y w h nil nil 1 -> v3dstr in
06928 (
06929 set ctrlstr.EDC_view3d = v3dstr;
06930
06931 set winstr.EDW_lControl = ctrlstr::winstr.EDW_lControl;
06932
06933 let _GETwindowPositionSize father -> [_ _ fw fh] in
06934 set ctrlstr.EDC_coords = [x y (fw-(x + w)) (fh-(y+h)) w h];
06935
06936 ctrlstr;
06937 );
06938 }
06939
06940
06941 dsEdCtrl3D(ctrlstr){
06942 V3DdsView ctrlstr.EDC_view3d;
06943 set ctrlstr.EDC_father.EDW_lControl = G2DremoveFromList ctrlstr.EDC_father.EDW_lControl ctrlstr;
06944 0;
06945 }
06946
06947
06948
06949
06950
06951 proto cbEdColorMapExaValueChange=fun [EdControl S [I I [I I I] EdControl EdControl EdControl EdControl EdControl EdControl EdControl EdControl CompBitmap ObjCursor]] I;
06952 typeof tmrEdColorMapMousePicker=Timer;
06953
06954 fillEdColorMapRuller(ctrlstr, color){
06955 let G2Drgb2hsv color -> [hc sc vc] in
06956 let ctrlstr.EDC_bitmap -> [cont abmp cbmp bmppath _] in
06957 let _GETalphaBitmaps abmp -> [bmp _] in
06958 let _GETbitmapSize bmp -> [_ ymax] in
06959 let 1.0 /. 100.0 -> delta in
06960 let 1.0 -> float_1 in
06961 let 0.0 -> float_0 in
06962 let itof ymax -> float_max in
06963 (
06964 let float_1 -> iv in
06965 while iv >. float_0 do
06966 (
06967 let G2Dhsv2rgb hc sc iv -> c in
06968 _DRAWrectangle bmp 0 ftoi iv*.float_max 10 3 DRAW_SOLID 2 c DRAW_INVISIBLE nil;
06969 set iv = iv -. delta;
06970 );
06971 _DRAWrectangle bmp 10 0 20 ymax+1 DRAW_INVISIBLE 1 0 DRAW_SOLID 0xffffff;
06972
06973 let (ftoi vc*.float_max) -> av in
06974 let mktab 3 [10 av] -> t in
06975 (
06976 set t.(0) = [20 av-5];
06977 set t.(2) = [20 av+5];
06978 _DRAWpoly16 bmp 3 t DRAW_SOLID 1 0 DRAW_SOLID 0;
06979 );
06980
06981 _PAINTobjNode _CONVERTcompBitmapToObjNode cbmp;
06982 _PAINTcontainer cont;
06983 );
06984 0;
06985 }
06986
06987
06988 cbEdColorMapValueChange(ctrlstr, val, p){
06989 let p -> [ccolor mode hsvcolor bmpworkstr bmpsamplestr bmprulerstr htxtstr rtxtstr gtxtstr btxtstr atxtstr ccross _] in
06990 let bmpworkstr.EDC_bitmap -> [cont _ _ _ _] in
06991 let ftoi getEdCtrlFloatValue rtxtstr -> fr in
06992 let ftoi getEdCtrlFloatValue gtxtstr -> fg in
06993 let ftoi getEdCtrlFloatValue btxtstr -> fb in
06994 let ftoi getEdCtrlFloatValue atxtstr -> fa in
06995 let fr+(fg<<8)+(fb<<16) -> color in
06996 let _GETcontainerPositionSize cont -> [_ _ w h] in
06997 let G2Drgb2hsv color -> [hc sc vc] in
06998 let [(ftoi hc) (ftoi (sc *. 100.0)) (ftoi (vc *. 100.0))] -> [hcolor scolor vcolor] in
06999 let [hcolor*w/360 scolor*2] -> [crossx crossy] in
07000 (
07001 setEdCtrlEditTextCbChange htxtstr nil;
07002
07003 fillEdColorMapRuller bmprulerstr color;
07004 setEdCtrlBitmapColor bmpsamplestr color;
07005 setEdCtrlEditTextValue htxtstr itoh G2Drgb2bgr color;
07006
07007 _CHANGEobjNodeCoordinates _CONVERTcompBitmapToObjNode ccross [crossx-12 crossy-12] 1;
07008
07009 setEdCtrlEditTextCbChange htxtstr mkfun3 @cbEdColorMapExaValueChange p;
07010 mutate p <- [(if !mode then color else (G2Drgb2rgba color fa)) _ [hcolor scolor vcolor] _ _ _ _ _ _ _ _ _ _];
07011 );
07012 0;
07013 }
07014
07015
07016 cbEdColorMapExaValueChange(ctrlstr, val, p){
07017 let p -> [ccolor mode hsvcolor bmpworkstr bmpsamplestr bmprulerstr htxtstr rtxtstr gtxtstr btxtstr atxtstr ccross _] in
07018 let G2Drgb2bgr htoi val -> color in
07019 let G2Drgb2hsv color -> [hc sc vc] in
07020 let [(ftoi hc) (ftoi (sc *. 100.0)) (ftoi (vc *. 100.0))] -> [hcolor scolor vcolor] in
07021 let bmpworkstr.EDC_bitmap -> [cont _ _ _ _] in
07022 let _GETcontainerPositionSize cont -> [_ _ w h] in
07023 let [hcolor*w/360 scolor*2] -> [crossx crossy] in
07024 let ftoi getEdCtrlFloatValue atxtstr -> fa in
07025 (
07026 setEdCtrlFloatCbChange rtxtstr nil;
07027 setEdCtrlFloatCbChange gtxtstr nil;
07028 setEdCtrlFloatCbChange btxtstr nil;
07029
07030 _CHANGEobjNodeCoordinates _CONVERTcompBitmapToObjNode ccross [crossx-12 crossy-12] 1;
07031
07032 setEdCtrlFloatValue rtxtstr itof color&255;
07033 setEdCtrlFloatValue gtxtstr itof (color>>8)&255;
07034 setEdCtrlFloatValue btxtstr itof (color>>16)&255;
07035
07036 fillEdColorMapRuller bmprulerstr color;
07037 setEdCtrlBitmapColor bmpsamplestr color;
07038
07039 setEdCtrlFloatCbChange rtxtstr mkfun3 @cbEdColorMapValueChange p;
07040 setEdCtrlFloatCbChange gtxtstr mkfun3 @cbEdColorMapValueChange p;
07041 setEdCtrlFloatCbChange btxtstr mkfun3 @cbEdColorMapValueChange p;
07042
07043 mutate p <- [(if !mode then color else (G2Drgb2rgba color fa)) _ [hcolor scolor vcolor] _ _ _ _ _ _ _ _ _ _];
07044 );
07045 0;
07046 }
07047
07048
07049 cbEdColorMapCrossCursorMove(cont, p, x, y, mask){
07050 if !(mask & MK_LBUTTON) then nil else
07051 let p -> [ccolor mode hsvcolor bmpworkstr bmpsamplestr bmprulerstr htxtstr rtxtstr gtxtstr btxtstr atxtstr ccross _] in
07052 let hsvcolor -> [_ _ vcolor] in
07053
07054 let _GETcontainerPositionSize cont -> [_ _ w h] in
07055 let if x<=0 then 0 else if x>=w then w else x -> x in
07056 let if y<=0 then 0 else if y>=h then h else y -> y in
07057
07058 let ftoi getEdCtrlFloatValue atxtstr -> fa in
07059 let G2Dhsv2rgb (itof x)/.(itof w)*. 360.0 (itof y)/. 200.0 (itof vcolor)/. 100.0 -> color in
07060 (
07061 setEdCtrlFloatCbChange rtxtstr nil;
07062 setEdCtrlFloatCbChange gtxtstr nil;
07063 setEdCtrlFloatCbChange btxtstr nil;
07064 setEdCtrlEditTextCbChange htxtstr nil;
07065
07066 _CHANGEobjNodeCoordinates _CONVERTcompBitmapToObjNode ccross [x-12 y-12] 1;
07067
07068 setEdCtrlFloatValue rtxtstr itof color&255;
07069 setEdCtrlFloatValue gtxtstr itof (color>>8)&255;
07070 setEdCtrlFloatValue btxtstr itof (color>>16)&255;
07071 setEdCtrlEditTextValue htxtstr itoh G2Drgb2bgr color;
07072
07073 fillEdColorMapRuller bmprulerstr color;
07074 setEdCtrlBitmapColor bmpsamplestr color;
07075
07076 setEdCtrlFloatCbChange rtxtstr mkfun3 @cbEdColorMapValueChange p;
07077 setEdCtrlFloatCbChange gtxtstr mkfun3 @cbEdColorMapValueChange p;
07078 setEdCtrlFloatCbChange btxtstr mkfun3 @cbEdColorMapValueChange p;
07079 setEdCtrlEditTextCbChange htxtstr mkfun3 @cbEdColorMapExaValueChange p;
07080
07081 mutate p <- [(if !mode then color else (G2Drgb2rgba color fa)) _ [(x*360/w) y/2 vcolor] _ _ _ _ _ _ _ _ _ _];
07082 );
07083 0;
07084 }
07085
07086
07087 cbEdColorMapCrossCursorClick(cont, p, x, y, btn, mask){
07088 if btn != 1 then nil else
07089 cbEdColorMapCrossCursorMove cont p x y MK_LBUTTON;
07090 0;
07091 }
07092
07093
07094 cbEdColorMapRulerCursorMove(cont, p, x, y, mask){
07095 if !(mask & MK_LBUTTON) then nil else
07096 let p -> [ccolor mode hsvcolor bmpworkstr bmpsamplestr bmprulerstr htxtstr rtxtstr gtxtstr btxtstr atxtstr ccross _] in
07097 let bmprulerstr.EDC_bitmap -> [_ abmp _ _ _] in
07098 let hsvcolor -> [hcolor scolor _] in
07099 let _GETalphaBitmaps abmp -> [bmp _] in
07100 let _GETbitmapSize bmp -> [_ ymax] in
07101 let if y <= 0 then 0 else if y >= ymax then ymax else y -> y in
07102
07103 let G2Dhsv2rgb itof hcolor (itof scolor)/. 100.0 (itof y)/.(itof ymax) -> color in
07104
07105 let bmpworkstr.EDC_bitmap -> [contw _ _ _ _] in
07106 let _GETcontainerPositionSize contw -> [_ _ w h] in
07107
07108 let ftoi getEdCtrlFloatValue atxtstr -> fa in
07109 let [hcolor*w/360 scolor*2] -> [crossx crossy] in
07110 (
07111 setEdCtrlFloatCbChange rtxtstr nil;
07112 setEdCtrlFloatCbChange gtxtstr nil;
07113 setEdCtrlFloatCbChange btxtstr nil;
07114 setEdCtrlEditTextCbChange htxtstr nil;
07115
07116 _CHANGEobjNodeCoordinates _CONVERTcompBitmapToObjNode ccross [crossx-12 crossy-12] 1;
07117
07118 setEdCtrlFloatValue rtxtstr itof color&255;
07119 setEdCtrlFloatValue gtxtstr itof (color>>8)&255;
07120 setEdCtrlFloatValue btxtstr itof (color>>16)&255;
07121 setEdCtrlEditTextValue htxtstr itoh G2Drgb2bgr color;
07122
07123 fillEdColorMapRuller bmprulerstr color;
07124 setEdCtrlBitmapColor bmpsamplestr color;
07125
07126 setEdCtrlFloatCbChange rtxtstr mkfun3 @cbEdColorMapValueChange p;
07127 setEdCtrlFloatCbChange gtxtstr mkfun3 @cbEdColorMapValueChange p;
07128 setEdCtrlFloatCbChange btxtstr mkfun3 @cbEdColorMapValueChange p;
07129 setEdCtrlEditTextCbChange htxtstr mkfun3 @cbEdColorMapExaValueChange p;
07130
07131 mutate p <- [(if !mode then color else (G2Drgb2rgba color fa)) _ [hcolor scolor y*100/ymax] _ _ _ _ _ _ _ _ _ _];
07132 );
07133 0;
07134 }
07135
07136
07137 cbEdColorMapRulerCursorClick(cont, p, x, y, btn, mask){
07138 if btn != 1 then nil else
07139 cbEdColorMapRulerCursorMove cont p x y MK_LBUTTON;
07140 0;
07141 }
07142
07143
07144 cbEdColorMapOk(ctrlstr, param){
07145 let param -> [p winstr cbfun] in
07146 let p -> [ccolor mode hsvcolor bmpworkstr bmpsamplestr bmprulerstr htxtstr rtxtstr gtxtstr btxtstr atxtstr ccross pickcursor] in
07147 (
07148 exec cbfun with [ccolor];
07149 dsEdWindow winstr;
07150 );
07151 0;
07152 }
07153
07154
07155 cbEdColorMapCancel(ctrlstr, param){
07156 let param -> [p winstr cbfun] in
07157 (
07158 exec cbfun with [nil];
07159 dsEdWindow winstr;
07160 );
07161 0;
07162 }
07163
07164
07165 cbEdColorMapScreenPickerTimer(tmr, param){
07166 let param -> [win cont p] in
07167 let p -> [ccolor mode hsvcolor bmpworkstr bmpsamplestr bmprulerstr htxtstr rtxtstr gtxtstr btxtstr atxtstr ccross pickcursor] in
07168 let _GETscreenPos -> [wx wy] in
07169 (
07170 _MVwindow win wx-1 wy-1;
07171
07172 _SETcontainerCursor cont pickcursor;
07173 );
07174 0;
07175 }
07176
07177
07178 cbEdColorMapScreenPickerClick(cont, param, x, y, btn, m){
07179 let param -> [ch win p] in
07180 let p -> [ccolor mode hsvcolor bmpworkstr bmpsamplestr bmprulerstr htxtstr rtxtstr gtxtstr btxtstr atxtstr ccross pickcursor] in
07181 (
07182 _DSwindow win;
07183 _DScontainer cont;
07184 _deltimer tmrEdColorMapMousePicker;
07185
07186 if btn != 1 then nil else
07187 let _GETscreenPos -> [wx wy] in
07188 let _CAPTUREscreen (_CRbitmap ch 1 1) wx wy 1 1 0 -> bmp in
07189 let _GETpixel24 bmp 0 0 -> color in
07190 let bmpworkstr.EDC_bitmap -> [contw _ _ _ _] in
07191 let _GETcontainerPositionSize contw -> [_ _ w h] in
07192 let G2Drgb2hsv color -> [hc sc vc] in
07193 let [(ftoi hc) (ftoi (sc *. 100.0)) (ftoi (vc *. 100.0))] -> [hcolor scolor vcolor] in
07194
07195 let ftoi getEdCtrlFloatValue atxtstr -> fa in
07196 let [hcolor*w/360 scolor*2] -> [crossx crossy] in
07197 (
07198 setEdCtrlFloatCbChange rtxtstr nil;
07199 setEdCtrlFloatCbChange gtxtstr nil;
07200 setEdCtrlFloatCbChange btxtstr nil;
07201 setEdCtrlEditTextCbChange htxtstr nil;
07202
07203 _CHANGEobjNodeCoordinates _CONVERTcompBitmapToObjNode ccross [crossx-12 crossy-12] 1;
07204
07205 setEdCtrlFloatValue rtxtstr itof color&255;
07206 setEdCtrlFloatValue gtxtstr itof (color>>8)&255;
07207 setEdCtrlFloatValue btxtstr itof (color>>16)&255;
07208 setEdCtrlEditTextValue htxtstr itoh G2Drgb2bgr color;
07209
07210 fillEdColorMapRuller bmprulerstr color;
07211 setEdCtrlBitmapColor bmpsamplestr color;
07212
07213 setEdCtrlFloatCbChange rtxtstr mkfun3 @cbEdColorMapValueChange p;
07214 setEdCtrlFloatCbChange gtxtstr mkfun3 @cbEdColorMapValueChange p;
07215 setEdCtrlFloatCbChange btxtstr mkfun3 @cbEdColorMapValueChange p;
07216 setEdCtrlEditTextCbChange htxtstr mkfun3 @cbEdColorMapExaValueChange p;
07217
07218
07219 mutate p <- [(if !mode then color else (G2Drgb2rgba color fa)) _ [hcolor scolor vcolor] _ _ _ _ _ _ _ _ _ _];
07220
07221 _DSbitmap bmp;
07222 );
07223 );
07224 }
07225
07226
07227 cbEdColorMapScreenPicker(tbstr, cmproll, btn, mask, p){
07228 let p -> [ccolor mode hsvcolor bmpworkstr bmpsamplestr bmprulerstr htxtstr rtxtstr gtxtstr btxtstr atxtstr ccross pickcursor] in
07229 let _GETscreenPos -> [wx wy] in
07230 let _TOPwindow _CRwindow tbstr.ETB_channel nil wx-1 wy-1 2 2 WN_NOBORDER|WN_NOCAPTION|WN_TRANSPARENCY "" -> capwin in
07231 let _TOPcontainer _CRcontainerFromObjWin tbstr.ETB_channel capwin 0 0 2 2 CO_NOBORDER|CO_NOCAPTION|CO_CHILDINSIDE nil "" -> newcont in
07232 (
07233 _CBcontainerClick newcont @cbEdColorMapScreenPickerClick [tbstr.ETB_channel capwin p];
07234 _SETcontainerTransparency newcont nil 1 WN_TRANS_ALPHA;
07235 _SETcontainerCursor newcont pickcursor;
07236
07237 set tmrEdColorMapMousePicker = _rfltimer (_starttimer tbstr.ETB_channel 50) @cbEdColorMapScreenPickerTimer [capwin newcont p];
07238 );
07239 0;
07240 }
07241
07242
07243 cbEdColorMapDestroy(winstr, p){
07244 let p -> [ccolor mode hsvcolor bmpworkstr bmpsamplestr bmprulerstr htxtstr rtxtstr gtxtstr btxtstr atxtstr ccross pickcursor] in
07245 (
07246 _DScompBitmap ccross;
07247 );
07248 0;
07249 }
07250
07251
07252 crEdColorMap(chan, fatherstr, color, mode, name, themestr, cbfun){
07253 let if themestr == nil then (if EdDefaultTheme == nil then (set EdDefaultTheme = makeEdThemeResources chan) else EdDefaultTheme) else themestr -> themestr in
07254
07255 let themestr.EDT_abmpColorMapPickerBtn -> abmpcpick in
07256 let if !mode then color else G2Dbgra2bgr color -> bgrcolor in
07257 let G2Dgetbgr bgrcolor -> [bc gc rc] in
07258 let if mode then G2DgetAplhaFromColor color else nil -> alpha in
07259
07260 let [345 330] -> [w h] in
07261 let _GETscreenSize -> [ww wh] in
07262 let wh - 40 -> wh in
07263 let crEdDialogWindow chan fatherstr ((ww / 2) - (w / 2)) ((wh / 2) - (h / 2)) w h WN_MENU nil name -> winstr in
07264 let crEdCtrlBitmap winstr 10 10 263 200 themestr.EDT_sColorMap nil nil -> bmpworkstr in
07265 let crEdCtrlBitmap winstr 10 220 40 40 nil bgrcolor nil -> bmpsamplestr in
07266 let crEdCtrlBitmap winstr 288 10 20 200 nil bgrcolor nil -> bmprulerstr in
07267 let crEdCtrlLabel winstr 60 232 15 20 "#" nil -> hlabel in
07268 let crEdCtrlEditText winstr 75 230 60 20 (itoh bgrcolor) ET_BORDER|ET_TABFOCUS nil -> htxtstr in
07269 let if !mode then nil else crEdCtrlLabel winstr 145 232 40 20 "Alpha :" nil -> alabel in
07270 let if !mode then nil else crEdCtrlFloat winstr 190 230 60 20 (itof alpha) 0.0 127.0 1.0 0 themestr nil -> atxtstr in
07271 let crEdCtrlLabel winstr 10 272 25 20 "R :" nil -> rlabel in
07272 let crEdCtrlFloat winstr 35 270 60 20 (itof rc) 0.0 255.0 1.0 0 themestr nil -> rtxtstr in
07273 let crEdCtrlLabel winstr 105 272 25 20 "G :" nil -> glabel in
07274 let crEdCtrlFloat winstr 130 270 60 20 (itof gc) 0.0 255.0 1.0 0 themestr nil -> gtxtstr in
07275 let crEdCtrlLabel winstr 200 272 25 20 "B :" nil -> blabel in
07276 let crEdCtrlFloat winstr 225 270 60 20 (itof bc) 0.0 255.0 1.0 0 themestr nil -> btxtstr in
07277 let crEdCtrlButton winstr 10 (h - 30) 60 20 "Ok" nil -> okbtnstr in
07278 let crEdCtrlButton winstr 100 (h - 30) 60 20 "Cancel" nil -> cancelbtnstr in
07279 let crEdWindowToolBar winstr (w - 34) 268 24 24 0 0 themestr.EDT_iToolBarColor nil -> tbstr in
07280
07281 let bmpworkstr.EDC_bitmap -> [contwork _ cmbpwork _ _] in
07282 let bmprulerstr.EDC_bitmap -> [contruler _ _ _ _] in
07283
07284 let G2Drgb2hsv bgrcolor -> [hc sc vc] in
07285 let [(ftoi hc) (ftoi (sc *. 100.0)) (ftoi (vc *. 100.0))] -> [hcolor scolor vcolor] in
07286 let [hcolor*263/360 scolor*2] -> [crossx crossy] in
07287 let _CRcompBitmap winstr.EDW_channel contwork (_CONVERTcompBitmapToObjNode cmbpwork)
07288 [9 9] OBJ_ENABLE|OBJ_VISIBLE OBJ_CONTAINER_UNCLICK|OBJ_CONTAINER_CLICK|OBJ_CONTAINER_MOVE
07289 themestr.EDT_abmpColorMapCross 0 0 25 25 -> ccross in
07290 let [color mode [hcolor scolor vcolor] bmpworkstr bmpsamplestr bmprulerstr htxtstr rtxtstr gtxtstr btxtstr atxtstr ccross themestr.EDT_cursorColorPicker] -> pcolormap in
07291 let crEdToolBarButton tbstr abmpcpick ETB_ALIGN_LEFT "Pick color" mkfun5 @cbEdColorMapScreenPicker pcolormap -> pickbtnstr in
07292 (
07293 _CHANGEobjNodeCoordinates _CONVERTcompBitmapToObjNode ccross [crossx-12 crossy-12] 1;
07294 fillEdColorMapRuller bmprulerstr bgrcolor;
07295 _SETcontainerCursor contwork themestr.EDT_cursorColorPicker;
07296
07297 setEdCtrlFloatCbChange rtxtstr mkfun3 @cbEdColorMapValueChange pcolormap;
07298 setEdCtrlFloatCbChange gtxtstr mkfun3 @cbEdColorMapValueChange pcolormap;
07299 setEdCtrlFloatCbChange btxtstr mkfun3 @cbEdColorMapValueChange pcolormap;
07300 setEdCtrlFloatCbChange atxtstr mkfun3 @cbEdColorMapValueChange pcolormap;
07301
07302 setEdCtrlEditTextCbChange htxtstr mkfun3 @cbEdColorMapExaValueChange pcolormap;
07303
07304 _CBcontainerClick contwork @cbEdColorMapCrossCursorClick pcolormap;
07305 _CBcontainerCursorMove contwork @cbEdColorMapCrossCursorMove pcolormap;
07306
07307 _CBcontainerClick contruler @cbEdColorMapRulerCursorClick pcolormap;
07308 _CBcontainerCursorMove contruler @cbEdColorMapRulerCursorMove pcolormap;
07309
07310 setEdCtrlButtonCb okbtnstr mkfun2 @cbEdColorMapOk [pcolormap winstr cbfun];
07311 setEdCtrlButtonCb cancelbtnstr mkfun2 @cbEdColorMapCancel [pcolormap winstr cbfun];
07312
07313 paintEdToolBar tbstr;
07314 _PAINTcontainer contwork;
07315 _TOPwindow winstr.EDW_win;
07316 _SETfocus winstr.EDW_win;
07317
07318 setEdwindowCbDestroy winstr mkfun2 @cbEdColorMapDestroy pcolormap;
07319 winstr;
07320 );
07321 }
07322
07323
07324
07325
07326
07327 updateEdCtrlColorButton(ctrlstr, color){
07328 if color == nil then nil else
07329 let ctrlstr.EDC_colorButton -> [btn obmp winstr _ mode cbfun] in
07330 let _GETbuttonSizePosition btn -> [w h _ _] in
07331 let if !mode then color else G2Dbgra2bgr color -> bgrcolor in
07332 let _FILLbitmap _CRbitmap ctrlstr.EDC_channel w h bgrcolor -> bmp in
07333 (
07334 _DSbitmap obmp;
07335 _SETbuttonBitmap btn bmp;
07336 mutate ctrlstr.EDC_colorButton <- [_ bmp _ color _ _];
07337 _PAINTbutton btn;
07338 );
07339 0;
07340 }
07341
07342
07343 cbEdCtrlColorButtonSelect(color, ctrlstr){
07344 let ctrlstr.EDC_colorButton -> [btn obmp winstr ocolor mode cbfun] in
07345 let if color == nil then ocolor else color -> color in
07346 (
07347 updateEdCtrlColorButton ctrlstr color;
07348
07349 mutate ctrlstr.EDC_colorButton <- [_ _ nil color _ _];
07350 exec cbfun with [ctrlstr color];
07351 );
07352 0;
07353 }
07354
07355
07356 getEdCtrlColorButtonColor(ctrlstr){
07357 let ctrlstr.EDC_colorButton -> [btn obmp winstr color mode cbfun] in
07358 color;
07359 }
07360
07361
07362 cbEdCtrlColorButtonMapDestroy(winstr, ctrlstr){
07363 mutate ctrlstr.EDC_colorButton <- [_ _ nil _ _ _];
07364 0;
07365 }
07366
07367
07368 cbEdCtrlColorButton(btn, ctrlstr){
07369 let ctrlstr.EDC_colorButton -> [btn obmp winstr color mode cbfun] in
07370 if winstr != nil then
07371 (
07372 _SETfocus winstr.EDW_win;
07373 0;
07374 )
07375 else
07376 (
07377 let crEdColorMap ctrlstr.EDC_channel ctrlstr.EDC_father color mode "color selector" ctrlstr.EDC_theme mkfun2 @cbEdCtrlColorButtonSelect ctrlstr -> winstr in
07378 (
07379 setEdwindowCbDestroy winstr mkfun2 @cbEdCtrlColorButtonMapDestroy ctrlstr;
07380 mutate ctrlstr.EDC_colorButton <- [_ _ winstr _ _ _];
07381 );
07382 0;
07383 );
07384 0;
07385 }
07386
07387
07388 setEdCtrlColorButtonCb(ctrlstr, cbfun){
07389 mutate ctrlstr.EDC_colorButton <- [_ _ _ _ _ cbfun];
07390 0;
07391 }
07392
07393
07394 crEdCtrlColorButton(winstr, x, y, w, h, color, mode, resize, themestr){
07395 let if themestr == nil then (if EdDefaultTheme == nil then (set EdDefaultTheme = makeEdThemeResources winstr.EDW_channel) else EdDefaultTheme) else themestr -> themestr in
07396
07397 let mkEdControl [winstr.EDW_channel winstr resize themestr nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil] -> ctrlstr in
07398 let if ctrlstr.EDC_father.EDW_virtualWin == nil then ctrlstr.EDC_father.EDW_win else ctrlstr.EDC_father.EDW_virtualWin -> father in
07399 let if !mode then color else G2Drgba2rgb color -> bgrcolor in
07400 let _FILLbitmap _CRbitmap ctrlstr.EDC_channel w h bgrcolor -> bmp in
07401 let _CRbuttonBitmap ctrlstr.EDC_channel father bmp x y w h PB_TABFOCUS -> button in
07402 (
07403 set ctrlstr.EDC_colorButton = [button bmp nil color mode nil];
07404 set winstr.EDW_lControl = ctrlstr::winstr.EDW_lControl;
07405 _CBbutton button @cbEdCtrlColorButton ctrlstr;
07406
07407 let _GETwindowPositionSize father -> [_ _ fw fh] in
07408 set ctrlstr.EDC_coords = [x y (fw-(x + w)) (fh-(y+h)) w h];
07409
07410 ctrlstr;
07411 );
07412 }
07413
07414
07415 dsEdCtrlColorButton(ctrlstr){
07416 let ctrlstr.EDC_colorButton -> [button bitmap winstr _ _ _] in
07417 (
07418 dsEdWindow winstr;
07419 _DSbitmap bitmap;
07420 _DSbutton button;
07421 );
07422 set ctrlstr.EDC_father.EDW_lControl = G2DremoveFromList ctrlstr.EDC_father.EDW_lControl ctrlstr;
07423 0;
07424 }
07425
07426
07427
07428
07429
07430
07431 paintEdCtrlModuleEditor(ctrlstr){
07432 let ctrlstr.EDC_modulesEditor.EDM_winScroll -> winstr in
07433 let _GETwindowPositionSize winstr.EDW_win -> [_ _ ww wh] in
07434 let _GETwindowPositionSize winstr.EDW_virtualWin -> [vx vy vw vh] in
07435 if ww <= 0 || wh <= 0 then nil else
07436 _PAINTcontainerArea ctrlstr.EDC_modulesEditor.EDM_cont (abs vx) (abs vy) ww wh;
07437 0;
07438 }
07439
07440
07441 findEdCtrlModuleEditorRoundLink(ctrlstr, srcmboxstr, dstmboxstr){
07442 let sizelist ctrlstr.EDC_modulesEditor.EDM_lRoundLinks -> size in
07443 let nil -> ndata in
07444 let 0 -> i in
07445 (
07446 while i < size && ndata == nil do
07447 (
07448 let nth_list ctrlstr.EDC_modulesEditor.EDM_lRoundLinks i -> rlinkstr in
07449 if ((rlinkstr.EDRL_srcModuleBox == srcmboxstr) && (rlinkstr.EDRL_dstModuleBox == dstmboxstr)) ||
07450 ((rlinkstr.EDRL_dstModuleBox == srcmboxstr) && (rlinkstr.EDRL_srcModuleBox == dstmboxstr))
07451 then
07452 set ndata = rlinkstr
07453 else nil;
07454
07455 set i = i + 1;
07456 );
07457 ndata;
07458 );
07459 }
07460
07461
07462 calcEdCtrlModuleEditorRoundLinkPos( x1, y1, w1, h1, x2, y2, w2, h2 ){
07463 if (abs (x1 - x2)) > (abs (y1 - y2 ))
07464 then
07465 if x1 < x2
07466 then [
07467 x1+w1 y1+h1/2
07468 x2-1 y2+h2/2
07469 ]
07470 else [
07471 x1-1 y1+h1/2
07472 x2+w2 y2+h2/2
07473 ]
07474 else if y1 < y2
07475 then [
07476 x1+w1/2 y1+h1
07477 x2+w2/2 y2-1
07478 ]
07479 else [
07480 x1+w1/2 y1-1
07481 x2+w2/2 y2+h2
07482 ]
07483 ;
07484 }
07485
07486
07487 updateEdCtrlModuleEditorRoundLinkPos(ctrlstr){
07488 let 24 -> dcircle in
07489 let sizelist ctrlstr.EDC_modulesEditor.EDM_lRoundLinks -> size in
07490 let 0 -> i in
07491 while i < size do
07492 (
07493 let nth_list ctrlstr.EDC_modulesEditor.EDM_lRoundLinks i -> rlinkstr in
07494 let rlinkstr.EDRL_srcModuleBox.EDB_pos -> [x1 y1] in
07495 let rlinkstr.EDRL_dstModuleBox.EDB_pos -> [x2 y2] in
07496 let [rlinkstr.EDRL_srcModuleBox.EDB_iWidth rlinkstr.EDRL_srcModuleBox.EDB_iHeight] -> [w1 h1] in
07497 let [rlinkstr.EDRL_dstModuleBox.EDB_iWidth rlinkstr.EDRL_dstModuleBox.EDB_iHeight] -> [w2 h2] in
07498 let if rlinkstr.EDRL_srcModuleBox == rlinkstr.EDRL_dstModuleBox then
07499 [x1 y1 x2 y2]
07500 else
07501 calcEdCtrlModuleEditorRoundLinkPos x1 y1 w1 h1 x2 y2 w2 h2
07502 -> [px1 py1 px2 py2] in
07503 let [(((px2 + px1) / 2) - (dcircle / 2)) (((py2 + py1) / 2) - (dcircle / 2))] -> [mx my] in
07504 _TOPobjNode _CHANGEobjNodeCoordinates rlinkstr.EDRL_node [mx my] 0;
07505
07506 set i = i + 1;
07507 );
07508 0;
07509 }
07510
07511
07512 drawEdCtrlModuleEditorLinkPrivate(buffer, x1, y1, x2, y2, width, color){
07513 _DRAWline
07514 buffer
07515 x1 y1
07516 x2 y2
07517 DRAW_SOLID
07518 width
07519 color;
07520 0;
07521 }
07522
07523
07524 calcEdCtrlModuleEditorLink(x1, y1, w1, h1, x2, y2, w2, h2){
07525 if (abs (x1 - x2)) > (abs (y1 - y2 ))
07526 then
07527 if x1 < x2
07528 then [
07529 x1+w1 y1+h1/2
07530 x2-1 y2+h2/2
07531 ]
07532 else [
07533 x1-1 y1+h1/2
07534 x2+w2 y2+h2/2
07535 ]
07536 else if y1 < y2
07537 then [
07538 x1+w1/2 y1+h1
07539 x2+w2/2 y2-1
07540 ]
07541 else [
07542 x1+w1/2 y1-1
07543 x2+w2/2 y2+h2
07544 ]
07545 ;
07546 }
07547
07548
07549 drawEdCtrlModuleEditorLink(ctrlstr, linkstr){
07550 let linkstr.EDL_srcModuleBox.EDB_pos -> [x1 y1] in
07551 let [linkstr.EDL_srcModuleBox.EDB_iWidth linkstr.EDL_srcModuleBox.EDB_iHeight] -> [w1 h1] in
07552 let linkstr.EDL_dstModuleBox.EDB_pos-> [x2 y2] in
07553 let [linkstr.EDL_dstModuleBox.EDB_iWidth linkstr.EDL_dstModuleBox.EDB_iHeight] -> [w2 h2] in
07554
07555 let if linkstr.EDL_srcModuleBox == linkstr.EDL_dstModuleBox then
07556 [x1 y1 x2 y2]
07557 else
07558 calcEdCtrlModuleEditorLink x1 y1 w1 h1 x2 y2 w2 h2
07559 -> [px1 py1 px2 py2] in
07560
07561 let ctrlstr.EDC_modulesEditor.EDM_abmpLinks -> alphaBmp in
07562 let _GETalphaBitmaps alphaBmp -> [buffer _] in
07563 let if (G2DisInList ctrlstr.EDC_modulesEditor.EDM_selectedRoundLink.EDRL_lLinks linkstr) || (G2DisInList ctrlstr.EDC_modulesEditor.EDM_selectedBox linkstr.EDL_srcModuleBox) || (G2DisInList ctrlstr.EDC_modulesEditor.EDM_selectedBox linkstr.EDL_dstModuleBox) then ctrlstr.EDC_theme.EDT_iModuleEditorLinkOn else ctrlstr.EDC_theme.EDT_iModuleEditorLinkOff -> color in
07564 drawEdCtrlModuleEditorLinkPrivate buffer px1 py1 px2 py2 ctrlstr.EDC_theme.EDT_iModuleEditorBorderWidth color;
07565 0;
07566 }
07567
07568
07569 refreshEdCtrlModuleEditorLinks(ctrlstr){
07570 let ctrlstr.EDC_modulesEditor -> mestr in
07571 let ctrlstr.EDC_modulesEditor.EDM_abmpLinks -> alphaBmp in
07572 let _GETalphaBitmaps alphaBmp -> [buffer _] in
07573 let _GETalphaBitmapTransparency alphaBmp -> transparency in
07574 (
07575
07576 _FILLbitmap buffer transparency;
07577
07578 let sizelist mestr.EDM_lLinks -> size in
07579 let 0 -> i in
07580 while i < size do
07581 (
07582 let nth_list mestr.EDM_lLinks i -> linkstr in
07583 let linkstr.EDL_srcModuleBox.EDB_pos -> [x1 y1] in
07584 let [linkstr.EDL_srcModuleBox.EDB_iWidth linkstr.EDL_srcModuleBox.EDB_iHeight] -> [w1 h1] in
07585 let linkstr.EDL_dstModuleBox.EDB_pos-> [x2 y2] in
07586 let [linkstr.EDL_dstModuleBox.EDB_iWidth linkstr.EDL_dstModuleBox.EDB_iHeight] -> [w2 h2] in
07587
07588 let if linkstr.EDL_srcModuleBox == linkstr.EDL_dstModuleBox then
07589 [x1 y1 x2 y2]
07590 else
07591 calcEdCtrlModuleEditorLink x1 y1 w1 h1 x2 y2 w2 h2
07592 -> [px1 py1 px2 py2] in
07593 (
07594 let if (G2DisInList ctrlstr.EDC_modulesEditor.EDM_selectedRoundLink.EDRL_lLinks linkstr) || (G2DisInList ctrlstr.EDC_modulesEditor.EDM_selectedBox linkstr.EDL_srcModuleBox) || (G2DisInList ctrlstr.EDC_modulesEditor.EDM_selectedBox linkstr.EDL_dstModuleBox) then ctrlstr.EDC_theme.EDT_iModuleEditorLinkOn else ctrlstr.EDC_theme.EDT_iModuleEditorLinkOff -> color in
07595 drawEdCtrlModuleEditorLinkPrivate buffer px1 py1 px2 py2 ctrlstr.EDC_theme.EDT_iModuleEditorBorderWidth color;
07596 );
07597
07598 set i = i + 1;
07599 );
07600 );
07601 updateEdCtrlModuleEditorRoundLinkPos ctrlstr;
07602 paintEdCtrlModuleEditor ctrlstr;
07603 0;
07604 }
07605
07606
07607 dsEdCtrlModuleEditorRoundLink(ctrlstr, rlinkstr){
07608 if rlinkstr.EDRL_tooltip == nil then nil else
07609 let rlinkstr.EDRL_tooltip -> [tpcont tptext] in
07610 (
07611 _DScompText tptext;
07612 _DScontainer tpcont;
07613 set rlinkstr.EDRL_tooltip = nil;
07614 );
07615 _DStoolTip rlinkstr.EDRL_node;
07616
07617 _DScompBitmap rlinkstr.EDRL_compBmp;
07618 _DSalphaBitmap rlinkstr.EDRL_alphaBmp;
07619 _DSbitmap rlinkstr.EDRL_bmpOn;
07620 _DSbitmap rlinkstr.EDRL_bmpOff;
07621
07622 exec ctrlstr.EDC_modulesEditor.EDM_cbRoundLinkDestroy with [ctrlstr rlinkstr];
07623
07624 if rlinkstr != ctrlstr.EDC_modulesEditor.EDM_selectedRoundLink then nil else
07625 set ctrlstr.EDC_modulesEditor.EDM_selectedRoundLink = nil;
07626
07627 set ctrlstr.EDC_modulesEditor.EDM_lRoundLinks = G2DremoveFromList ctrlstr.EDC_modulesEditor.EDM_lRoundLinks rlinkstr;
07628 0;
07629 }
07630
07631
07632 chkCtrlModuleEditorBox(ctrlstr, mboxstr, add, paint){
07633 let ctrlstr.EDC_modulesEditor -> mestr in
07634 let if (G2DisInList ctrlstr.EDC_modulesEditor.EDM_selectedBox mboxstr) && add then 1 else 0 -> selmode in
07635 (
07636 let sizelist mestr.EDM_lBox -> size in
07637 let 0 -> i in
07638 while i < size do
07639 (
07640 let nth_list mestr.EDM_lBox i -> [_ boxstr] in
07641 let if (boxstr == mboxstr && !selmode) || ((G2DisInList ctrlstr.EDC_modulesEditor.EDM_selectedBox boxstr) && add && boxstr != mboxstr) then 1 else 0 -> state in
07642 (
07643 let _GETalphaBitmaps boxstr.EDB_alphaBmp -> [buffer _] in
07644 let _GETbitmap (if state then boxstr.EDB_bmpOn else boxstr.EDB_bmpOff) -> sbmp in
07645 _SETbitmap buffer sbmp;
07646
07647 set boxstr.EDB_bState = state;
07648
07649 );
07650
07651 set i = i + 1;
07652 );
07653
07654 if (G2DisInList ctrlstr.EDC_modulesEditor.EDM_selectedBox mboxstr) && add then
07655 set ctrlstr.EDC_modulesEditor.EDM_selectedBox = G2DremoveFromList ctrlstr.EDC_modulesEditor.EDM_selectedBox mboxstr
07656 else if mboxstr == nil then
07657 set ctrlstr.EDC_modulesEditor.EDM_selectedBox = nil
07658 else
07659 set ctrlstr.EDC_modulesEditor.EDM_selectedBox = if add then mboxstr::ctrlstr.EDC_modulesEditor.EDM_selectedBox else mboxstr::nil;
07660
07661 if !paint then nil else
07662 refreshEdCtrlModuleEditorLinks ctrlstr;
07663
07664
07665 exec mestr.EDM_cbBoxSelect with [ctrlstr mboxstr];
07666 );
07667 0;
07668 }
07669
07670
07671 chkCtrlModuleEditorRoundLink(ctrlstr, rlinktr){
07672 let ctrlstr.EDC_modulesEditor -> mestr in
07673 (
07674 let sizelist mestr.EDM_lRoundLinks -> size in
07675 let 0 -> i in
07676 while i < size do
07677 (
07678 let nth_list mestr.EDM_lRoundLinks i -> crlinkstr in
07679 let if crlinkstr == rlinktr then 1 else 0 -> state in
07680 (
07681 let _GETalphaBitmaps crlinkstr.EDRL_alphaBmp -> [buffer _] in
07682 let _GETbitmap (if state then crlinkstr.EDRL_bmpOn else crlinkstr.EDRL_bmpOff) -> sbmp in
07683 _SETbitmap buffer sbmp;
07684
07685 set crlinkstr.EDRL_bState = state;
07686 );
07687
07688 set i = i + 1;
07689 );
07690 set ctrlstr.EDC_modulesEditor.EDM_selectedRoundLink = rlinktr;
07691 refreshEdCtrlModuleEditorLinks ctrlstr;
07692
07693
07694 );
07695 0;
07696 }
07697
07698
07699 cbEdCtrlModuleEditorRoundLinkClick(cmpbmp, p, x, y, btn, mask){
07700 let p -> [ctrlstr rlinktr] in
07701 (
07702 if btn != 1 then nil else
07703 (
07704 if ctrlstr.EDC_modulesEditor.EDM_iLinkMode then nil else
07705 (
07706 chkCtrlModuleEditorRoundLink ctrlstr rlinktr;
07707 chkCtrlModuleEditorBox ctrlstr nil 0 1;
07708 );
07709
07710 _TOPobjNode _PAINTobjNode rlinktr.EDRL_node;
07711 0;
07712 );
07713 exec ctrlstr.EDC_modulesEditor.EDM_cbRoundLinkClick with [ctrlstr rlinktr btn mask];
07714 );
07715 0;
07716 }
07717
07718
07719 setEdCtrlModuleEditorRoundLinkCbClick(ctrlstr, cbfun){
07720 set ctrlstr.EDC_modulesEditor.EDM_cbRoundLinkClick = cbfun;
07721 0;
07722 }
07723
07724
07725 cbEdCtrlModuleEditorRoundLinkUnClick(cmpbmp, p, x, y, btn, mask){
07726 let p -> [ctrlstr rlinktr] in
07727 exec ctrlstr.EDC_modulesEditor.EDM_cbRoundLinkUnClick with [ctrlstr rlinktr btn mask];
07728 0;
07729 }
07730
07731
07732 setEdCtrlModuleEditorRoundLinkCbUnClick(ctrlstr, cbfun){
07733 set ctrlstr.EDC_modulesEditor.EDM_cbRoundLinkUnClick = cbfun;
07734 0;
07735 }
07736
07737
07738 cbEdCtrlModuleEditorRoundLinkDbClick(cmpbmp, p, x, y, btn, mask){
07739 let p -> [ctrlstr rlinktr] in
07740 exec ctrlstr.EDC_modulesEditor.EDM_cbRoundLinkDbClick with [ctrlstr rlinktr btn mask];
07741 0;
07742 }
07743
07744
07745 setEdCtrlModuleEditorRoundLinkCbDbClick(ctrlstr, cbfun){
07746 set ctrlstr.EDC_modulesEditor.EDM_cbRoundLinkDbClick = cbfun;
07747 0;
07748 }
07749
07750
07751 setEdCtrlModuleEditorRoundLinkCbDestroy(ctrlstr, cbfun){
07752 set ctrlstr.EDC_modulesEditor.EDM_cbRoundLinkDestroy = cbfun;
07753 0;
07754 }
07755
07756
07757 setEdCtrlModuleEditorRoundLinkCbUpdate(ctrlstr, cbfun){
07758 set ctrlstr.EDC_modulesEditor.EDM_cbRoundLinkUpdate = cbfun;
07759 0;
07760 }
07761
07762
07763 setEdCtrlModuleEditorRoundLinkFlag(rlinkstr, flag){
07764 set rlinkstr.EDRL_iFlag = flag;
07765 }
07766
07767
07768 getEdCtrlModuleEditorRoundLinkFlag(rlinkstr){
07769 rlinkstr.EDRL_iFlag;
07770 }
07771
07772
07773 cbEdModuleEditorRoundLinkToolTipHide(node, p, bubble){
07774 let p -> [ctrlstr rlinkstr] in
07775 let rlinkstr.EDRL_tooltip -> [tpcont tptext] in
07776 (
07777 _DScompText tptext;
07778 _DScontainer tpcont;
07779 set rlinkstr.EDRL_tooltip = nil;
07780 );
07781 0;
07782 }
07783
07784
07785 cbEdModuleEditorRoundLinkToolTipShow(node, p, bubble, dx, dy){
07786 let p -> [ctrlstr rlinkstr] in
07787 (
07788 if rlinkstr.EDRL_tooltip == nil then nil else
07789 let rlinkstr.EDRL_tooltip -> [tpcont tptext] in
07790 (
07791 _DScompText tptext;
07792 _DScontainer tpcont;
07793 set rlinkstr.EDRL_tooltip = nil;
07794 );
07795
07796 let G2DgetStringSize ctrlstr.EDC_theme.EDT_fontToolTip bubble -> [w h] in
07797 let _GETscreenSize -> [sw sh] in
07798 let sh - 40 -> sh in
07799 let _GETscreenPos -> [sx sy] in
07800 let [16 16] -> [xdecal ydecal] in
07801 let if (sx + w + 4 + xdecal) > sw then (sw - (w + 4) - xdecal) else sx + xdecal -> x in
07802 let if (sy + h + 4 + ydecal) > sh then (sh - (h + 4) - ydecal) else sy + ydecal -> y in
07803 let (_CRcontainerFromObjWin ctrlstr.EDC_modulesEditor.EDM_channel ctrlstr.EDC_modulesEditor.EDM_winScroll.EDW_virtualWin x y w+4 h+4 CO_NOCAPTION 0xffffff nil) -> tpcont in
07804 let _CRcompText ctrlstr.EDC_modulesEditor.EDM_channel tpcont nil [2 2] CT_LABEL|CT_LEFT|OBJ_VISIBLE nil w h bubble ctrlstr.EDC_theme.EDT_fontToolTip [0 nil nil nil] nil nil nil -> tptext in
07805 (
07806 set rlinkstr.EDRL_tooltip = [tpcont tptext];
07807 _PAINTcontainer tpcont;
07808 );
07809 );
07810 0;
07811 }
07812
07813
07814 setEdCtrlModuleEditorRoundLinkTooltip(ctrlstr, rlinkstr, bubble){
07815 if rlinkstr.EDRL_tooltip == nil then nil else
07816 let rlinkstr.EDRL_tooltip -> [tpcont tptext] in
07817 (
07818 _DScompText tptext;
07819 _DScontainer tpcont;
07820 set rlinkstr.EDRL_tooltip = nil;
07821 );
07822 _DStoolTip rlinkstr.EDRL_node;
07823 _CRtoolTip rlinkstr.EDRL_node 150 bubble @cbEdModuleEditorRoundLinkToolTipShow [ctrlstr rlinkstr] @cbEdModuleEditorRoundLinkToolTipHide [ctrlstr rlinkstr];
07824 0;
07825 }
07826
07827
07828 crEdCtrlModuleEditorRoundLink(ctrlstr, linkstr){
07829 let ctrlstr.EDC_theme.EDT_iModuleEditorRLinkSize -> dcircle in
07830 let linkstr.EDL_srcModuleBox -> srcmboxstr in
07831 let linkstr.EDL_dstModuleBox -> dstmboxstr in
07832 let findEdCtrlModuleEditorRoundLink ctrlstr srcmboxstr dstmboxstr -> rlinkexiststr in
07833 let srcmboxstr.EDB_pos -> [x1 y1] in
07834 let dstmboxstr.EDB_pos -> [x2 y2] in
07835 let [srcmboxstr.EDB_iWidth srcmboxstr.EDB_iHeight] -> [w1 h1] in
07836 let [dstmboxstr.EDB_iWidth dstmboxstr.EDB_iHeight] -> [w2 h2] in
07837 let if srcmboxstr == dstmboxstr then
07838 [x1 y1 x2 y2]
07839 else
07840 calcEdCtrlModuleEditorRoundLinkPos x1 y1 w1 h1 x2 y2 w2 h2
07841 -> [px1 py1 px2 py2] in
07842 let [(((px2 + px1) / 2) - (dcircle / 2)) (((py2 + py1) / 2) - (dcircle / 2))] -> [mx my] in
07843 let if rlinkexiststr != nil then rlinkexiststr else
07844 (
07845 let mkEdModuleRoundLink [srcmboxstr dstmboxstr nil nil nil nil nil nil nil nil 0] -> rlinknewstr in
07846 (
07847 set ctrlstr.EDC_modulesEditor.EDM_lRoundLinks = G2Dlcat ctrlstr.EDC_modulesEditor.EDM_lRoundLinks rlinknewstr::nil;
07848 set rlinknewstr.EDRL_bmpOff = _FILLbitmap _CRbitmap ctrlstr.EDC_channel dcircle dcircle 0;
07849 set rlinknewstr.EDRL_alphaBmp = _CRalphaBitmap ctrlstr.EDC_channel rlinknewstr.EDRL_bmpOff nil nil 0;
07850 set rlinknewstr.EDRL_compBmp = _CRcompBitmap ctrlstr.EDC_channel ctrlstr.EDC_modulesEditor.EDM_cont ctrlstr.EDC_modulesEditor.EDM_node [mx my] OBJ_ENABLE|OBJ_VISIBLE OBJ_CONTAINER_UNCLICK|OBJ_CONTAINER_KEYUP|OBJ_CONTAINER_KEYDOWN|OBJ_CONTAINER_MOUSEWHEEL|OBJ_CONTAINER_MOVE rlinknewstr.EDRL_alphaBmp 0 0 dcircle dcircle;
07851 set rlinknewstr.EDRL_node = _CONVERTcompBitmapToObjNode rlinknewstr.EDRL_compBmp;
07852
07853 _CBcompBitmapClick rlinknewstr.EDRL_compBmp @cbEdCtrlModuleEditorRoundLinkClick [ctrlstr rlinknewstr];
07854 _CBcompBitmapUnClick rlinknewstr.EDRL_compBmp @cbEdCtrlModuleEditorRoundLinkUnClick [ctrlstr rlinknewstr];
07855 _CBcompBitmapDblClick rlinknewstr.EDRL_compBmp @cbEdCtrlModuleEditorRoundLinkDbClick [ctrlstr rlinknewstr];
07856
07857 rlinknewstr;
07858 );
07859 )
07860 -> rlinkstr in
07861 (
07862 set rlinkstr.EDRL_lLinks = G2Dlcat rlinkstr.EDRL_lLinks linkstr::nil;
07863
07864 if rlinkstr.EDRL_bmpOn == nil then nil else
07865 _DSbitmap rlinkstr.EDRL_bmpOn;
07866
07867 if rlinkstr.EDRL_bmpOff == nil then nil else
07868 _DSbitmap rlinkstr.EDRL_bmpOff;
07869
07870 let sizelist rlinkstr.EDRL_lLinks -> nb in
07871 let _DRAWcircle (_FILLbitmap _CRbitmap ctrlstr.EDC_channel dcircle dcircle 0) (dcircle / 2) (dcircle / 2) (dcircle / 2) DRAW_SOLID ctrlstr.EDC_theme.EDT_iModuleEditorBorderWidth ctrlstr.EDC_theme.EDT_iModuleEditorLinkOff DRAW_SOLID ctrlstr.EDC_theme.EDT_iModuleEditorBoxOff -> offbmp in
07872 let _DRAWcircle (_FILLbitmap _CRbitmap ctrlstr.EDC_channel dcircle dcircle 0) (dcircle / 2) (dcircle / 2) (dcircle / 2) DRAW_SOLID ctrlstr.EDC_theme.EDT_iModuleEditorBorderWidth ctrlstr.EDC_theme.EDT_iModuleEditorLinkOn DRAW_SOLID ctrlstr.EDC_theme.EDT_iModuleEditorBoxOn -> onbmp in
07873
07874 let _GETstringSize ctrlstr.EDC_theme.EDT_fontModuleEditor itoa nb -> [sw sh] in
07875 let _DRAWtext offbmp ctrlstr.EDC_theme.EDT_fontModuleEditor (dcircle / 2) ((dcircle / 2) - (sh / 2)) TD_CENTER ctrlstr.EDC_theme.EDT_iModuleEditorBoxTextOff itoa nb -> offbmp in
07876 let _DRAWtext onbmp ctrlstr.EDC_theme.EDT_fontModuleEditor (dcircle / 2) ((dcircle / 2) - (sh / 2)) TD_CENTER ctrlstr.EDC_theme.EDT_iModuleEditorBoxTextOn itoa nb -> onbmp in
07877 (
07878 set rlinkstr.EDRL_bmpOff = offbmp;
07879 set rlinkstr.EDRL_bmpOn = onbmp;
07880
07881 let _GETalphaBitmaps rlinkstr.EDRL_alphaBmp -> [buffer _] in
07882 let if rlinkstr.EDRL_bState then _GETbitmap rlinkstr.EDRL_bmpOn else _GETbitmap rlinkstr.EDRL_bmpOff -> sbmp in
07883 _SETbitmap buffer sbmp;
07884
07885 _CHANGEobjNodeCoordinates rlinkstr.EDRL_node [mx my] 0;
07886 exec ctrlstr.EDC_modulesEditor.EDM_cbRoundLinkUpdate with [ctrlstr rlinkstr];
07887 );
07888 );
07889 0;
07890 }
07891
07892
07893 getEdCtrlModuleEditorRoundLinkByLink(ctrlstr, linkstr){
07894 let sizelist ctrlstr.EDC_modulesEditor.EDM_lRoundLinks -> size in
07895 let nil -> ndata in
07896 let 0 -> i in
07897 (
07898 while i < size && ndata == nil do
07899 (
07900 let nth_list ctrlstr.EDC_modulesEditor.EDM_lRoundLinks i -> rlinkstr in
07901 let sizelist rlinkstr.EDRL_lLinks -> size2 in
07902 let 0 -> i2 in
07903 while i2 < size2 && ndata == nil do
07904 (
07905 let nth_list rlinkstr.EDRL_lLinks i2 -> clinkstr in
07906 if clinkstr != linkstr then nil else
07907 set ndata = rlinkstr;
07908
07909 set i2 = i2 + 1;
07910 );
07911
07912 set i = i + 1;
07913 );
07914 ndata;
07915 );
07916 }
07917
07918
07919 removeEdCtrlModuleEditorLinkFromRoundLink(ctrlstr, linkstr, refresh){
07920 let getEdCtrlModuleEditorRoundLinkByLink ctrlstr linkstr -> rlinkstr in
07921 let ctrlstr.EDC_theme.EDT_iModuleEditorRLinkSize -> dcircle in
07922 (
07923 set rlinkstr.EDRL_lLinks = remove_from_list rlinkstr.EDRL_lLinks linkstr;
07924
07925 let sizelist rlinkstr.EDRL_lLinks -> nb in
07926 if nb <= 0 then
07927 (
07928 dsEdCtrlModuleEditorRoundLink ctrlstr rlinkstr;
07929 if !refresh then nil else
07930 refreshEdCtrlModuleEditorLinks ctrlstr;
07931 0;
07932 )
07933 else
07934 (
07935 if rlinkstr.EDRL_bmpOn == nil then nil else
07936 _DSbitmap rlinkstr.EDRL_bmpOn;
07937
07938 if rlinkstr.EDRL_bmpOff == nil then nil else
07939 _DSbitmap rlinkstr.EDRL_bmpOff;
07940
07941 let _DRAWcircle (_FILLbitmap _CRbitmap ctrlstr.EDC_channel dcircle dcircle 0) (dcircle / 2) (dcircle / 2) (dcircle / 2) DRAW_SOLID ctrlstr.EDC_theme.EDT_iModuleEditorBorderWidth ctrlstr.EDC_theme.EDT_iModuleEditorLinkOff DRAW_SOLID ctrlstr.EDC_theme.EDT_iModuleEditorBoxOff -> offbmp in
07942 let _DRAWcircle (_FILLbitmap _CRbitmap ctrlstr.EDC_channel dcircle dcircle 0) (dcircle / 2) (dcircle / 2) (dcircle / 2) DRAW_SOLID ctrlstr.EDC_theme.EDT_iModuleEditorBorderWidth ctrlstr.EDC_theme.EDT_iModuleEditorLinkOn DRAW_SOLID ctrlstr.EDC_theme.EDT_iModuleEditorBoxOn -> onbmp in
07943
07944 let _GETstringSize ctrlstr.EDC_theme.EDT_fontModuleEditor itoa nb -> [sw sh] in
07945 let _DRAWtext offbmp ctrlstr.EDC_theme.EDT_fontModuleEditor (dcircle / 2) ((dcircle / 2) - (sh / 2)) TD_CENTER ctrlstr.EDC_theme.EDT_iModuleEditorBoxTextOff itoa nb -> offbmp in
07946 let _DRAWtext onbmp ctrlstr.EDC_theme.EDT_fontModuleEditor (dcircle / 2) ((dcircle / 2) - (sh / 2)) TD_CENTER ctrlstr.EDC_theme.EDT_iModuleEditorBoxTextOn itoa nb -> onbmp in
07947 (
07948 set rlinkstr.EDRL_bmpOff = offbmp;
07949 set rlinkstr.EDRL_bmpOn = onbmp;
07950
07951 let _GETalphaBitmaps rlinkstr.EDRL_alphaBmp -> [buffer _] in
07952 let if rlinkstr.EDRL_bState then _GETbitmap rlinkstr.EDRL_bmpOn else _GETbitmap rlinkstr.EDRL_bmpOff -> sbmp in
07953 _SETbitmap buffer sbmp;
07954
07955 exec ctrlstr.EDC_modulesEditor.EDM_cbRoundLinkUpdate with [ctrlstr rlinkstr];
07956 _TOPobjNode rlinkstr.EDRL_node;
07957 );
07958 0;
07959 );
07960 );
07961 0;
07962 }
07963
07964
07965 dsEdCtrlModuleEditorLink(ctrlstr, linkstr, refresh){
07966 set ctrlstr.EDC_modulesEditor.EDM_lLinks = G2DremoveFromList ctrlstr.EDC_modulesEditor.EDM_lLinks linkstr;
07967 removeEdCtrlModuleEditorLinkFromRoundLink ctrlstr linkstr refresh;
07968 0;
07969 }
07970
07971
07972 crEdCtrlModuleEditorLink(ctrlstr, srcmboxstr, dstmboxstr, lp, param){
07973 let mkEdModuleLink [srcmboxstr dstmboxstr lp param 0] -> linkstr in
07974 (
07975 set ctrlstr.EDC_modulesEditor.EDM_lLinks = G2Dlcat ctrlstr.EDC_modulesEditor.EDM_lLinks linkstr::nil;
07976
07977 drawEdCtrlModuleEditorLink ctrlstr linkstr;
07978 crEdCtrlModuleEditorRoundLink ctrlstr linkstr;
07979
07980
07981
07982 linkstr;
07983 );
07984 }
07985
07986
07987 getEdCtrlModuleEditorBoxOptimizedPos(mestr, mboxstr, x, y){
07988 let mestr.EDM_sizeSurface -> [surfw surfh] in
07989 let [mboxstr.EDB_iWidth mboxstr.EDB_iHeight] -> [mcw mch] in
07990 let sizelist mestr.EDM_lBox -> size in
07991 let nil -> nx in
07992 let nil -> ny in
07993 let 0 -> i in
07994 (
07995 while (i < size) && (nx == nil && ny == nil) do
07996 (
07997 let nth_list mestr.EDM_lBox i -> [_ boxstr] in
07998 let boxstr.EDB_pos -> [cx cy] in
07999 let [boxstr.EDB_iWidth boxstr.EDB_iHeight] -> [cw ch] in
08000 if boxstr == mboxstr then nil else
08001
08002 if ((cx != x) || (cy != y)) then nil else
08003 let if (x + cw + mcw) >= surfw then [x (y + ch)] else [(x + cw) y] -> [xx yy] in
08004 let getEdCtrlModuleEditorBoxOptimizedPos mestr mboxstr xx yy -> [ntx nty] in
08005 if (ntx != nil ) && (nty != nil) then
08006 (
08007 set nx = ntx;
08008 set ny = nty;
08009 )
08010 else
08011 (
08012 set nx = xx;
08013 set ny = yy;
08014 );
08015
08016 set i = i + 1;
08017 );
08018 [nx ny];
08019 );
08020 }
08021
08022
08023 cbEdCtrlModuleEditorWheel(cont, ctrlstr, x, y, delta, btn){
08024 let ctrlstr.EDC_modulesEditor.EDM_winScroll -> winstr in
08025 let ctrlstr.EDC_modulesEditor.EDM_winDmi -> windmistr in
08026 if winstr.EDW_virtualWin == nil then nil else
08027 let delta * 10 -> delta in
08028
08029
08030
08031
08032
08033
08034
08035
08036
08037
08038
08039 (
08040 let _GETwindowPositionSize winstr.EDW_win -> [_ _ ww wh] in
08041 let _GETwindowPositionSize winstr.EDW_virtualWin -> [vx vy vw vh] in
08042 let if (vy + delta) <= (-(vh - wh)) then (-(vh - wh)) else if (vy + delta) >= 0 then 0 else (vy + delta) -> my in
08043 _MVwindow winstr.EDW_virtualWin vx my;
08044 0;
08045 );
08046 0;
08047 }
08048
08049
08050 setEdCtrlModuleEditorMouseLink(cont, ctrlstr, rec){
08051 let ctrlstr.EDC_modulesEditor -> mestr in
08052 let mestr.EDM_moveCoords -> [posx posy] in
08053 let _GETcontainerMap cont -> buffer in
08054 let mestr.EDM_mnuBox -> selboxstr in
08055 let selboxstr.EDB_pos -> [x y] in
08056 let [selboxstr.EDB_iWidth selboxstr.EDB_iHeight] -> [w h] in
08057 let [(x + (w / 2)) (y + (h / 2))] -> [px py] in
08058 drawEdCtrlModuleEditorLinkPrivate buffer px py posx posy 1 0xffff00;
08059 0;
08060 }
08061
08062
08063 cbCtrlModuleEditorCursorMove(cont, ctrlstr, dx, dy, btn){
08064 let ctrlstr.EDC_modulesEditor.EDM_winScroll -> winstr in
08065 let _GETcursorPos winstr.EDW_win -> [x y] in
08066 let _GETwindowPositionSize winstr.EDW_win -> [_ _ ww wh] in
08067 let _GETwindowPositionSize winstr.EDW_virtualWin -> [vx vy vw vh] in
08068 (
08069 set ctrlstr.EDC_modulesEditor.EDM_moveCoords = [dx dy];
08070
08071 if (btn & 16) || ((btn == 1) && (ctrlstr.EDC_modulesEditor.EDM_iLinkMode)) then
08072 if x == nil || y == nil || vx == nil || vy == nil || vw == nil || vh == nil then nil else
08073 if winstr.EDW_tLastCursorPos == nil then
08074 (
08075 set winstr.EDW_tLastCursorPos = [(x - vx) (y - vy)];
08076 0;
08077 )
08078 else
08079 let winstr.EDW_tLastCursorPos -> [cx cy] in
08080 let if (x - cx) <= (-(vw - ww)) then (-(vw - ww)) else if (x - cx) >= 0 then 0 else (x - cx) -> mx in
08081 let if (y - cy) <= (-(vh - wh)) then (-(vh - wh)) else if (y - cy) >= 0 then 0 else (y - cy) -> my in
08082 (
08083 _MVwindow winstr.EDW_virtualWin mx my;
08084 0;
08085 )
08086 else nil;
08087
08088 if !ctrlstr.EDC_modulesEditor.EDM_iLinkMode && !btn then nil else
08089 paintEdCtrlModuleEditor ctrlstr;
08090 );
08091 0;
08092 }
08093
08094
08095 calcEdModuleEditorBoxSquare(ctrlstr){
08096 let ctrlstr.EDC_modulesEditor -> mestr in
08097 let nil -> x in
08098 let nil -> y in
08099 let 0 -> w in
08100 let 0 -> h in
08101 (
08102
08103 let sizelist mestr.EDM_selectedBox -> size in
08104 let 0 -> i in
08105 while i < size do
08106 (
08107 let nth_list mestr.EDM_selectedBox i -> mboxstr in
08108 let mboxstr.EDB_pos -> [modx mody] in
08109 (
08110 if x == nil || modx < x then
08111 set x = modx
08112 else nil;
08113 if y == nil || mody < y then
08114 set y = mody
08115 else nil;
08116 );
08117
08118 set i = i + 1;
08119 );
08120
08121
08122 let sizelist mestr.EDM_selectedBox -> size in
08123 let 0 -> i in
08124 while i < size do
08125 (
08126 let nth_list mestr.EDM_selectedBox i -> mboxstr in
08127 let mboxstr.EDB_pos -> [modx mody] in
08128 let [mboxstr.EDB_iWidth mboxstr.EDB_iHeight] -> [modw modh] in
08129 (
08130 if modw == nil || (modx + modw) > (x + w) then
08131 set w = (modx - x) + modw
08132 else nil;
08133 if modh == nil || (mody + modh) > (y + h) then
08134 set h = (mody - y) + modh
08135 else nil;
08136 );
08137
08138 set i = i + 1;
08139 );
08140 [x y w h]
08141 );
08142 }
08143
08144
08145 cbCtrlModuleEditorBoxCursorMove(cont, p, x, y, btn){
08146 let p -> [ctrlstr smboxstr [cbx cby] [oldx oldy]] in
08147 let ctrlstr.EDC_modulesEditor -> mestr in
08148 let _GETwindowPositionSize mestr.EDM_winScroll.EDW_virtualWin -> [cx cy vw vh] in
08149 let getEdWindowSize mestr.EDM_winScroll -> [ww wh] in
08150 let calcEdModuleEditorBoxSquare ctrlstr -> [sqx sqy sqw sqh] in
08151 let mestr.EDM_sizeSurface -> [surfw surfh] in
08152 let if ((x + cx - (cbx - sqw)) > ww) && ((sqx + sqw) >= surfw) then oldx else x -> x in
08153 let if ((y + cy - (cby - sqh)) > wh) && ((sqy + sqh) >= surfh) then oldy else y -> y in
08154
08155 let sqx + (x - oldx) -> cnx in
08156 let sqy + (y - oldy) -> cny in
08157 let if cnx < 0 then 0 else cnx -> cnx in
08158 let if cnx > (surfw - sqw) then (surfw - sqw) else cnx -> cnx in
08159 let if cny < 0 then 0 else cny -> cny in
08160 let if cny > (surfh - sqh) then (surfh - sqh) else cny -> cny in
08161 let if x < cbx then 0 else cnx -> cnx in
08162 let if y < cby then 0 else cny -> cny in
08163 let [(cnx - sqx) (cny - sqy)] -> [mvx mvy] in
08164 (
08165 let sizelist mestr.EDM_selectedBox -> size in
08166 let 0 -> i in
08167 while i < size do
08168 (
08169 let nth_list mestr.EDM_selectedBox i -> mboxstr in
08170 let mboxstr.EDB_pos -> [modx mody] in
08171 let modx + mvx -> nx in
08172 let mody + mvy -> ny in
08173 (
08174 _CHANGEobjNodeCoordinates mboxstr.EDB_node [nx ny] 0;
08175
08176 set mboxstr.EDB_pos = [nx ny];
08177 set mboxstr.EDB_bHasMoved = 1;
08178
08179 set i = i + 1;
08180 );
08181 );
08182
08183 if ((cnx + cx + sqw) > ww) || ((cnx + cx) < 0) || ((cny + cy + sqh) > wh) || ((cny + cy) < 0) then
08184 let if ((cnx + cx + sqw) > ww) || ((cnx + cx) < 0) then cx - (cnx - sqx) else cx -> wmvx in
08185 let if ((cny + cy + sqh) > wh) || ((cny + cy) < 0) then cy - (cny - sqy) else cy -> wmvy in
08186 let if wmvx <= (-(vw - ww)) then (-(vw - ww)) else if wmvx >= 0 then 0 else wmvx -> wmvx in
08187 let if wmvy <= (-(vh - wh)) then (-(vh - wh)) else if wmvy >= 0 then 0 else wmvy -> wmvy in
08188 (
08189 _MVwindow mestr.EDM_winScroll.EDW_virtualWin wmvx wmvy;
08190 0;
08191 )
08192 else nil;
08193
08194 mutate p <- [_ _ _ [x y]];
08195
08196 refreshEdCtrlModuleEditorLinks ctrlstr;
08197 0;
08198 );
08199 0;
08200 }
08201
08202
08203 cbCtrlModuleEditorUnClick(cont, ctrlstr, x, y, btn, mask){
08204 let ctrlstr.EDC_modulesEditor -> mestr in
08205 (
08206 set mestr.EDM_winScroll.EDW_tLastCursorPos = nil;
08207 _CBcontainerCursorMove mestr.EDM_cont @cbCtrlModuleEditorCursorMove ctrlstr;
08208
08209 let mestr.EDM_selectedBox -> lmboxstr in
08210 let mestr.EDM_sizeSurface -> [surfw surfh] in
08211 (
08212 let sizelist lmboxstr -> size in
08213 let 0 -> i in
08214 while i < size do
08215 (
08216 let nth_list lmboxstr i -> mboxstr in
08217 if !mboxstr.EDB_bHasMoved then nil else
08218 let mboxstr.EDB_pos -> [cx cy] in
08219 let [(cx - (mod cx mestr.EDM_iSnap)) (cy - (mod cy mestr.EDM_iSnap))] -> [nx ny] in
08220 let getEdCtrlModuleEditorBoxOptimizedPos mestr mboxstr nx ny -> [ntx nty] in
08221 let [(if ntx == nil then nx else ntx) (if nty == nil then ny else nty)] -> [nx ny] in
08222 (
08223 if (nx == cx) && (ny == cy) then nil else
08224 (
08225 _CHANGEobjNodeCoordinates mboxstr.EDB_node [nx ny] 0;
08226 set mboxstr.EDB_pos = [nx ny];
08227
08228 exec mestr.EDM_cbBoxMove with [ctrlstr mboxstr (nx / mestr.EDM_iSnap) (ny / mestr.EDM_iSnap)];
08229 );
08230
08231 exec mestr.EDM_cbBoxUnClick with [ctrlstr mboxstr btn mask];
08232 set mboxstr.EDB_bHasMoved = 0;
08233 );
08234
08235 set i = i + 1;
08236 );
08237 );
08238 );
08239 refreshEdCtrlModuleEditorLinks ctrlstr;
08240 exec ctrlstr.EDC_modulesEditor.EDM_cbUnClick with [ctrlstr x y btn mask];
08241 0;
08242 }
08243
08244
08245 cbCtrlModuleEditorClick(cont, ctrlstr, x, y, btn, mask){
08246 if (btn != 1) || ctrlstr.EDC_modulesEditor.EDM_iLinkMode then nil else
08247 (
08248 chkCtrlModuleEditorBox ctrlstr nil 0 1;
08249 _CBcontainerCursorMove ctrlstr.EDC_modulesEditor.EDM_cont @cbCtrlModuleEditorCursorMove ctrlstr;
08250 );
08251 exec ctrlstr.EDC_modulesEditor.EDM_cbClick with [ctrlstr x y btn mask];
08252 0;
08253 }
08254
08255
08256 cbCtrlModuleEditorDbClick(cont, ctrlstr, x, y, btn, mask){
08257 exec ctrlstr.EDC_modulesEditor.EDM_cbDbClick with [ctrlstr x y btn mask];
08258 0;
08259 }
08260
08261
08262 cbCtrlModuleEditorKeyDown(cont, ctrlstr, key, code){
08263 exec ctrlstr.EDC_modulesEditor.EDM_cbKeyDown with [ctrlstr key code];
08264 0;
08265 }
08266
08267
08268 cbCtrlModuleEditorKeyUp(cont, ctrlstr, key){
08269 exec ctrlstr.EDC_modulesEditor.EDM_cbKeyUp with [ctrlstr key];
08270 0;
08271 }
08272
08273
08274 selectCtrlModuleEditorBox(ctrlstr, mboxstr, add){
08275 chkCtrlModuleEditorRoundLink ctrlstr nil;
08276 chkCtrlModuleEditorBox ctrlstr mboxstr add 1;
08277 0;
08278 }
08279
08280
08281 cbEdCtrlModuleEditorBoxMenu(elt, p){
08282 let p -> [ctrlstr mboxstr lp] in
08283 (
08284 set ctrlstr.EDC_modulesEditor.EDM_mnuBox = mboxstr;
08285 exec ctrlstr.EDC_modulesEditor.EDM_cbBoxMenu with [ctrlstr mboxstr lp ctrlstr.EDC_modulesEditor.EDM_iLinkInfos];
08286 set ctrlstr.EDC_modulesEditor.EDM_iLinkInfos = lp;
08287 );
08288 0;
08289 }
08290
08291
08292 crEdCtrlModuleEditorBoxMenu(ctrlstr, mboxstr){
08293 let ctrlstr.EDC_modulesEditor -> mestr in
08294 let _CRpopupMenu mestr.EDM_channel -> mnu in
08295 let switch mboxstr.EDB_lMenus mestr.EDM_iLinkMode -> l in
08296 let sizelist l -> size in
08297 let 0 -> i in
08298 let nil -> lpp in
08299 (
08300 while i < size do
08301 (
08302 let nth_list l i -> lp in
08303 let if mestr.EDM_iBoxMode then switchstr lpp (hd lp) else mnu -> mpop in
08304 let if mpop == nil then (let _APPpopup mestr.EDM_channel mnu (hd lp) -> mnpop in (set lpp = [(hd lp) mnpop]::lpp; mnpop)) else mpop -> mpop in
08305 let if mestr.EDM_iBoxMode then (hd tl lp) else (hd lp) -> ename in
08306 _CBmenu _APPitem mestr.EDM_channel mpop ME_ENABLED ename @cbEdCtrlModuleEditorBoxMenu [ctrlstr mboxstr lp];
08307
08308 set i = i + 1;
08309 );
08310
08311 mnu;
08312 );
08313 }
08314
08315
08316 setEdCtrlModuleEditorBoxMenu(ctrlstr, mboxstr, mode, l){
08317 set mboxstr.EDB_lMenus = G2DremoveEdIdxFromList mboxstr.EDB_lMenus mode;
08318 set mboxstr.EDB_lMenus = G2Dlcat mboxstr.EDB_lMenus [mode l]::nil;
08319 0;
08320 }
08321
08322
08323 resetEdCtrlModuleEditorBoxMenu(ctrlstr, mboxstr){
08324 set mboxstr.EDB_lMenus = nil;
08325 0;
08326 }
08327
08328
08329 cbEdModuleEditorBoxToolTipHide(node, p, bubble){
08330 let p -> [ctrlstr mboxstr] in
08331 let mboxstr.EDB_tooltip -> [tpcont tptext] in
08332 (
08333 _DScompText tptext;
08334 _DScontainer tpcont;
08335 set mboxstr.EDB_tooltip = nil;
08336 );
08337 0;
08338 }
08339
08340
08341 cbEdModuleEditorBoxToolTipShow(node, p, bubble, dx, dy){
08342 let p -> [ctrlstr mboxstr] in
08343 (
08344 if mboxstr.EDB_tooltip == nil then nil else
08345 let mboxstr.EDB_tooltip -> [tpcont tptext] in
08346 (
08347 _DScompText tptext;
08348 _DScontainer tpcont;
08349 set mboxstr.EDB_tooltip = nil;
08350 );
08351
08352 let G2DgetStringSize ctrlstr.EDC_theme.EDT_fontToolTip bubble -> [w h] in
08353 let _GETscreenSize -> [sw sh] in
08354 let sh - 40 -> sh in
08355 let _GETscreenPos -> [sx sy] in
08356 let [16 16] -> [xdecal ydecal] in
08357 let if (sx + w + 4 + xdecal) > sw then (sw - (w + 4) - xdecal) else sx + xdecal -> x in
08358 let if (sy + h + 4 + ydecal) > sh then (sh - (h + 4) - ydecal) else sy + ydecal -> y in
08359 let (_CRcontainerFromObjWin ctrlstr.EDC_modulesEditor.EDM_channel ctrlstr.EDC_modulesEditor.EDM_winScroll.EDW_virtualWin x y w+4 h+4 CO_NOCAPTION 0xffffff nil) -> tpcont in
08360 let _CRcompText ctrlstr.EDC_modulesEditor.EDM_channel tpcont nil [2 2] CT_LABEL|CT_CENTER|OBJ_VISIBLE nil w h bubble ctrlstr.EDC_theme.EDT_fontToolTip [0 nil nil nil] nil nil nil -> tptext in
08361 (
08362 set mboxstr.EDB_tooltip = [tpcont tptext];
08363 _PAINTcontainer tpcont;
08364 );
08365 );
08366 0;
08367 }
08368
08369
08370 setEdCtrlModuleEditorBoxTooltip(ctrlstr, mboxstr, bubble){
08371 if mboxstr.EDB_tooltip == nil then nil else
08372 let mboxstr.EDB_tooltip -> [tpcont tptext] in
08373 (
08374 _DScompText tptext;
08375 _DScontainer tpcont;
08376 set mboxstr.EDB_tooltip = nil;
08377 );
08378 _DStoolTip mboxstr.EDB_node;
08379 _CRtoolTip mboxstr.EDB_node 150 bubble @cbEdModuleEditorBoxToolTipShow [ctrlstr mboxstr] @cbEdModuleEditorBoxToolTipHide [ctrlstr mboxstr];
08380 0;
08381 }
08382
08383
08384 setEdCtrlModuleEditorBoxFlags(mboxstr, flags){
08385 set mboxstr.EDB_iFlags = flags;
08386 }
08387
08388
08389 getEdCtrlModuleEditorBoxFlags(mboxstr){
08390 mboxstr.EDB_iFlags;
08391 }
08392
08393
08394 delEdCtrlModuleEditorBoxMenu(ctrlstr, mboxstr, mode, name, name2){
08395 let ctrlstr.EDC_modulesEditor -> mestr in
08396 let G2DgetElemFromListByIndex mboxstr.EDB_lMenus mode -> fmenu in
08397 let fmenu -> [_ lmenu] in
08398 let if name2 == nil then (remove_all_first_string_from_list lmenu name) else (remove_first_and_second_string_from_list lmenu name name2) -> nl in
08399 mutate fmenu <- [_ (quicksortList nl @suppDoublon)];
08400 0;
08401 }
08402
08403
08404 delEdCtrlModuleEditorBoxMenuStartWith(ctrlstr, mboxstr, mode, name){
08405 let ctrlstr.EDC_modulesEditor -> mestr in
08406 let G2DgetElemFromListByIndex mboxstr.EDB_lMenus mode -> fmenu in
08407 let fmenu -> [_ lmenu] in
08408 mutate fmenu <- [_ (quicksortList (remove_first_string_from_list_start_with lmenu name) @suppDoublon)];
08409 0;
08410 }
08411
08412
08413 addEdCtrlModuleEditorBoxMenu(ctrlstr, mboxstr, mode, lp){
08414 let ctrlstr.EDC_modulesEditor -> mestr in
08415 let switch mboxstr.EDB_lMenus mode -> lmenu in
08416 if lmenu == nil then
08417 (
08418 setEdCtrlModuleEditorBoxMenu ctrlstr mboxstr mode lp::nil;
08419 0;
08420 )
08421 else
08422 let G2DgetElemFromListByIndex mboxstr.EDB_lMenus mode -> fmenu in
08423 let fmenu -> [_ lmenu] in
08424 (
08425 mutate fmenu <- [_ lp::lmenu];
08426 0;
08427 );
08428 0;
08429 }
08430
08431
08432 sortEdCtrlModuleEditorBoxMenu(ctrlstr, mboxstr){
08433 let ctrlstr.EDC_modulesEditor -> mestr in
08434 let sizelist mboxstr.EDB_lMenus -> size in
08435 let 0 -> i in
08436 while i < size do
08437 (
08438 let nth_list mboxstr.EDB_lMenus i -> fmenu in
08439 let fmenu -> [_ lmenu] in
08440 mutate fmenu <- [_ (quicksortList lmenu @suppDoublon)];
08441
08442 set i = i + 1;
08443 );
08444 0;
08445 }
08446
08447
08448 cbEdCtrlModuleEditorBoxClick(cmpbmp, p, x, y, btn, mask){
08449 let p -> [ctrlstr mboxstr] in
08450 let ctrlstr.EDC_modulesEditor -> mestr in
08451 if btn == 16 then nil else
08452 (
08453 _TOPobjNode _PAINTobjNode mboxstr.EDB_node;
08454
08455 set mboxstr.EDB_bHasMoved = 0;
08456 set mboxstr.EDB_iKeybState = _keybdstate;
08457
08458
08459 if btn == 1 && !mestr.EDM_iLinkMode then
08460 (
08461 if ((mboxstr.EDB_bState) && (mboxstr.EDB_iKeybState != 2) && ((sizelist ctrlstr.EDC_modulesEditor.EDM_selectedBox) > 1)) then nil else
08462 (
08463 chkCtrlModuleEditorRoundLink ctrlstr nil;
08464 chkCtrlModuleEditorBox ctrlstr mboxstr (if mboxstr.EDB_iKeybState == 2 then 1 else 0) 1;
08465 );
08466
08467 if mboxstr.EDB_bState then
08468 let calcEdModuleEditorBoxSquare ctrlstr -> [sqx sqy sqw sqh] in
08469 _CBcontainerCursorMove mestr.EDM_cont @cbCtrlModuleEditorBoxCursorMove [ctrlstr mboxstr [(x - sqx) (y - sqy)] [x y]]
08470 else
08471 _CBcontainerCursorMove mestr.EDM_cont nil nil;
08472 0;
08473 )
08474 else if btn == 2 then
08475 (
08476
08477 let _GETscreenPos -> [sx sy] in
08478 let crEdCtrlModuleEditorBoxMenu ctrlstr mboxstr -> mnu in
08479 _DRAWmenu nil mnu sx sy PM_SCREEN|PM_LEFT_ALIGN|PM_TOP_ALIGN;
08480 0;
08481 )
08482 else
08483 (
08484 _CBcontainerCursorMove mestr.EDM_cont nil nil;
08485 0;
08486 );
08487
08488 exec mestr.EDM_cbBoxClick with [ctrlstr mboxstr btn mask];
08489 );
08490 0;
08491 }
08492
08493
08494 cbEdCtrlModuleEditorBoxDbClick(cmpbmp, p, x, y, btn, mask){
08495 let p -> [ctrlstr mboxstr] in
08496 if (G2DisInList ctrlstr.EDC_modulesEditor.EDM_selectedBox mboxstr) then
08497 exec ctrlstr.EDC_modulesEditor.EDM_cbBoxDbClick with [ctrlstr mboxstr btn mask]
08498 else nil;
08499 0;
08500 }
08501
08502
08503 cbEdCtrlModuleEditorBoxUnClick(cmpbmp, p, x, y, btn, mask){
08504 let p -> [ctrlstr mboxstr] in
08505 let ctrlstr.EDC_modulesEditor -> mestr in
08506 (
08507 if btn == 1 && !mestr.EDM_iLinkMode && !mboxstr.EDB_bHasMoved && ((sizelist ctrlstr.EDC_modulesEditor.EDM_selectedBox) > 1) && (mboxstr.EDB_iKeybState != 2) then
08508 (
08509 chkCtrlModuleEditorRoundLink ctrlstr nil;
08510 chkCtrlModuleEditorBox ctrlstr mboxstr 0 1;
08511 0;
08512 )
08513 else nil;
08514 set mboxstr.EDB_iKeybState = 0;
08515 _CBcontainerCursorMove mestr.EDM_cont nil nil;
08516 );
08517 0;
08518 }
08519
08520
08521 setEdCtrlModuleEditorBoxPos(ctrlstr, mboxstr, px, py){
08522 let ctrlstr.EDC_modulesEditor -> mestr in
08523 let px * mestr.EDM_iSnap -> x in
08524 let py * mestr.EDM_iSnap -> y in
08525 let getEdCtrlModuleEditorBoxOptimizedPos mestr mboxstr x y -> [ntx nty] in
08526 let [(if ntx == nil then x else ntx) (if nty == nil then y else nty)] -> [x y] in
08527 (
08528 _CHANGEobjNodeCoordinates mboxstr.EDB_node [x y] 0;
08529 set mboxstr.EDB_pos = [x y];
08530
08531 refreshEdCtrlModuleEditorLinks ctrlstr;
08532 );
08533 0;
08534 }
08535
08536
08537 selectEdCtrlModuleEditorBoxes(ctrlstr){
08538 let ctrlstr.EDC_modulesEditor -> mestr in
08539 let sizelist mestr.EDM_lBox -> size in
08540 let 0 -> i in
08541 while i < size do
08542 (
08543 let nth_list mestr.EDM_lBox i -> [_ mboxstr] in
08544 if (G2DisInList ctrlstr.EDC_modulesEditor.EDM_selectedBox mboxstr) then nil else
08545 chkCtrlModuleEditorBox ctrlstr mboxstr 1 0;
08546
08547 set i = i + 1;
08548 );
08549
08550 paintEdCtrlModuleEditor ctrlstr;
08551 0;
08552 }
08553
08554
08555 crEdCtrlModuleEditorBox(ctrlstr, name, lp, px, py, icon){
08556 let ctrlstr.EDC_modulesEditor -> mestr in
08557 let if px == nil then 0 else px -> px in
08558 let if py == nil then 0 else py -> py in
08559 let mkEdModuleBox [mestr nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil 0] -> mboxstr in
08560 let G2DgetStringSize ctrlstr.EDC_theme.EDT_fontModuleEditor name -> [w h] in
08561 let [(w + 10) (h + 10)] -> [w h] in
08562 let if w < mestr.EDM_iSnap then mestr.EDM_iSnap else if w > mestr.EDM_iSnap then (mestr.EDM_iSnap * ((w / mestr.EDM_iSnap) + 1)) else w -> w in
08563 let if h < mestr.EDM_iSnap then mestr.EDM_iSnap else if h > mestr.EDM_iSnap then (mestr.EDM_iSnap * ((h / mestr.EDM_iSnap) + 1)) else h -> h in
08564 let _DRAWrectangle (_FILLbitmap _CRbitmap ctrlstr.EDC_channel w h ctrlstr.EDC_theme.EDT_iModuleEditorBoxOff) 0 0 w h DRAW_SOLID ctrlstr.EDC_theme.EDT_iModuleEditorBorderWidth ctrlstr.EDC_theme.EDT_iModuleEditorBoxBorderOff DRAW_INVISIBLE nil -> bmpoff in
08565 let _DRAWrectangle (_FILLbitmap _CRbitmap ctrlstr.EDC_channel w h ctrlstr.EDC_theme.EDT_iModuleEditorBoxOn) 0 0 w h DRAW_SOLID ctrlstr.EDC_theme.EDT_iModuleEditorBorderWidth ctrlstr.EDC_theme.EDT_iModuleEditorBoxBorderOn DRAW_INVISIBLE nil -> bmpon in
08566 let px * mestr.EDM_iSnap -> x in
08567 let py * mestr.EDM_iSnap -> y in
08568 let getEdCtrlModuleEditorBoxOptimizedPos mestr mboxstr x y -> [ntx nty] in
08569 let [(if ntx == nil then x else ntx) (if nty == nil then y else nty)] -> [x y] in
08570 (
08571 _DRAWtext bmpoff ctrlstr.EDC_theme.EDT_fontModuleEditor (w / 2) 10 TD_CENTER ctrlstr.EDC_theme.EDT_iModuleEditorBoxTextOff name;
08572 _DRAWtext bmpon ctrlstr.EDC_theme.EDT_fontModuleEditor (w / 2) 10 TD_CENTER ctrlstr.EDC_theme.EDT_iModuleEditorBoxTextOn name;
08573
08574 set mboxstr.EDB_bmpOff = bmpoff;
08575 set mboxstr.EDB_bmpOn = bmpon;
08576 set mboxstr.EDB_sName = name;
08577 set mboxstr.EDB_lParams = lp;
08578 set mboxstr.EDB_pos = [x y];
08579 set mboxstr.EDB_iWidth = w;
08580 set mboxstr.EDB_iHeight = h;
08581 set mboxstr.EDB_alphaBmp = _CRalphaBitmap ctrlstr.EDC_channel bmpoff nil nil nil;
08582 set mboxstr.EDB_compBmp = _CRcompBitmap ctrlstr.EDC_channel mestr.EDM_cont mestr.EDM_node [x y] OBJ_ENABLE|OBJ_VISIBLE OBJ_CONTAINER_UNCLICK|OBJ_CONTAINER_KEYUP|OBJ_CONTAINER_KEYDOWN|OBJ_CONTAINER_MOUSEWHEEL|OBJ_CONTAINER_MOVE mboxstr.EDB_alphaBmp 0 0 w h;
08583 set mboxstr.EDB_node = _CONVERTcompBitmapToObjNode mboxstr.EDB_compBmp;
08584
08585 exec mestr.EDM_cbBoxMove with [ctrlstr mboxstr (x / mestr.EDM_iSnap) (y / mestr.EDM_iSnap)];
08586
08587 _CBcompBitmapClick mboxstr.EDB_compBmp @cbEdCtrlModuleEditorBoxClick [ctrlstr mboxstr];
08588 _CBcompBitmapUnClick mboxstr.EDB_compBmp @cbEdCtrlModuleEditorBoxUnClick [ctrlstr mboxstr];
08589 _CBcompBitmapDblClick mboxstr.EDB_compBmp @cbEdCtrlModuleEditorBoxDbClick [ctrlstr mboxstr];
08590
08591
08592
08593 set mestr.EDM_lBox = [name mboxstr]::mestr.EDM_lBox;
08594
08595 mboxstr;
08596 );
08597 }
08598
08599
08600 getEdCtrlModuleEditorBoxByName(ctrlstr, name){
08601 switchstr ctrlstr.EDC_modulesEditor.EDM_lBox name;
08602 }
08603
08604
08605 getEdCtrlModuleEditorSelectedBox(ctrlstr){
08606 ctrlstr.EDC_modulesEditor.EDM_selectedBox;
08607 }
08608
08609
08610 getEdCtrlModuleEditorSelectedRoundLink(ctrlstr){
08611 ctrlstr.EDC_modulesEditor.EDM_selectedRoundLink;
08612 }
08613
08614
08615 dsEdCtrlModuleEditorBox(ctrlstr, mboxstr){
08616 let ctrlstr.EDC_modulesEditor.EDM_lRoundLinks -> l in
08617 let sizelist l -> size in
08618 let 0 -> i in
08619 while i < size do
08620 (
08621 let nth_list l i -> rlinkstr in
08622 if (rlinkstr.EDRL_srcModuleBox != mboxstr) && (rlinkstr.EDRL_dstModuleBox != mboxstr) then nil else
08623 dsEdCtrlModuleEditorRoundLink ctrlstr rlinkstr;
08624
08625 set i = i + 1;
08626 );
08627
08628 let ctrlstr.EDC_modulesEditor.EDM_lLinks -> l in
08629 let sizelist l -> size in
08630 let 0 -> i in
08631 while i < size do
08632 (
08633 let nth_list l i -> linkstr in
08634 if (linkstr.EDL_srcModuleBox != mboxstr) && (linkstr.EDL_dstModuleBox != mboxstr) then nil else
08635 dsEdCtrlModuleEditorLink ctrlstr linkstr 0;
08636
08637 set i = i + 1;
08638 );
08639
08640 set ctrlstr.EDC_modulesEditor.EDM_selectedBox = G2DremoveFromList ctrlstr.EDC_modulesEditor.EDM_selectedBox mboxstr;
08641
08642 let mboxstr.EDB_tooltip -> [tpcont tptext] in
08643 (
08644 _DScompText tptext;
08645 _DScontainer tpcont;
08646 _DStoolTip mboxstr.EDB_node;
08647 set mboxstr.EDB_tooltip = nil;
08648 );
08649
08650 _DScompBitmap mboxstr.EDB_compBmp;
08651 _DSalphaBitmap mboxstr.EDB_alphaBmp;
08652 _DSbitmap mboxstr.EDB_bmpOn;
08653 _DSbitmap mboxstr.EDB_bmpOn;
08654
08655 set ctrlstr.EDC_modulesEditor.EDM_lBox = G2DremoveEdSidFromList ctrlstr.EDC_modulesEditor.EDM_lBox mboxstr.EDB_sName;
08656
08657
08658
08659
08660 0;
08661 }
08662
08663
08664 setEdCtrlModuleEditorLinkMode(ctrlstr, mode){
08665 set ctrlstr.EDC_modulesEditor.EDM_iLinkMode = mode;
08666
08667 if mode then
08668 (
08669 _CBcontainerPostRender ctrlstr.EDC_modulesEditor.EDM_cont @setEdCtrlModuleEditorMouseLink ctrlstr;
08670 0;
08671 )
08672 else
08673 (
08674 _CBcontainerPostRender ctrlstr.EDC_modulesEditor.EDM_cont nil nil;
08675 paintEdCtrlModuleEditor ctrlstr;
08676 0;
08677 );
08678 0;
08679 }
08680
08681
08682 getEdCtrlModuleEditorLinkMode(ctrlstr){
08683 ctrlstr.EDC_modulesEditor.EDM_iLinkMode;
08684 }
08685
08686
08687 resetEdCtrlModuleEditor(ctrlstr){
08688 set ctrlstr.EDC_modulesEditor.EDM_selectedBox = nil;
08689 let ctrlstr.EDC_modulesEditor -> mestr in
08690 (
08691 let sizelist mestr.EDM_lBox -> size in
08692 let 0 -> i in
08693 while i < size do
08694 (
08695 let nth_list mestr.EDM_lBox i -> [_ mboxstr] in
08696 let mboxstr.EDB_tooltip -> [tpcont tptext] in
08697 (
08698 _DScompText tptext;
08699 _DScontainer tpcont;
08700 _DStoolTip mboxstr.EDB_node;
08701 set mboxstr.EDB_tooltip = nil;
08702
08703 _DScompBitmap mboxstr.EDB_compBmp;
08704 _DSalphaBitmap mboxstr.EDB_alphaBmp;
08705 _DSbitmap mboxstr.EDB_bmpOn;
08706 _DSbitmap mboxstr.EDB_bmpOff;
08707 );
08708
08709 set i = i + 1;
08710 );
08711 set mestr.EDM_lBox = nil;
08712
08713 let mestr.EDM_lRoundLinks -> l in
08714 let sizelist l -> size in
08715 let 0 -> i in
08716 while i < size do
08717 (
08718 let nth_list l i -> rlinkstr in
08719 dsEdCtrlModuleEditorRoundLink ctrlstr rlinkstr;
08720
08721 set i = i + 1;
08722 );
08723
08724 set mestr.EDM_lLinks = nil;
08725 refreshEdCtrlModuleEditorLinks ctrlstr;
08726 );
08727 0;
08728 }
08729
08730
08731 setEdCtrlModuleEditorCbBoxMenu(ctrlstr, cbfun){
08732 set ctrlstr.EDC_modulesEditor.EDM_cbBoxMenu = cbfun;
08733 0;
08734 }
08735
08736
08737 setEdCtrlModuleEditorCbBoxSelect(ctrlstr, cbfun){
08738 set ctrlstr.EDC_modulesEditor.EDM_cbBoxSelect = cbfun;
08739 0;
08740 }
08741
08742
08743 setEdCtrlModuleEditorCbBoxClick(ctrlstr, cbfun){
08744 set ctrlstr.EDC_modulesEditor.EDM_cbBoxClick = cbfun;
08745 0;
08746 }
08747
08748
08749 setEdCtrlModuleEditorCbBoxUnClick(ctrlstr, cbfun){
08750 set ctrlstr.EDC_modulesEditor.EDM_cbBoxUnClick = cbfun;
08751 0;
08752 }
08753
08754
08755 setEdCtrlModuleEditorCbBoxDbClick(ctrlstr, cbfun){
08756 set ctrlstr.EDC_modulesEditor.EDM_cbBoxDbClick = cbfun;
08757 0;
08758 }
08759
08760
08761 setEdCtrlModuleEditorCbBoxMove(ctrlstr, cbfun){
08762 set ctrlstr.EDC_modulesEditor.EDM_cbBoxMove = cbfun;
08763 0;
08764 }
08765
08766
08767 setEdCtrlModuleEditorCbClick(ctrlstr, cbfun){
08768 set ctrlstr.EDC_modulesEditor.EDM_cbClick = cbfun;
08769 0;
08770 }
08771
08772
08773 setEdCtrlModuleEditorCbUnClick(ctrlstr, cbfun){
08774 set ctrlstr.EDC_modulesEditor.EDM_cbUnClick = cbfun;
08775 0;
08776 }
08777
08778
08779 setEdCtrlModuleEditorCbDbClick(ctrlstr, cbfun){
08780 set ctrlstr.EDC_modulesEditor.EDM_cbDbClick = cbfun;
08781 0;
08782 }
08783
08784
08785 setEdCtrlModuleEditorCbKeyDown(ctrlstr, cbfun){
08786 set ctrlstr.EDC_modulesEditor.EDM_cbKeyDown = cbfun;
08787 0;
08788 }
08789
08790
08791 setEdCtrlModuleEditorCbKeyUp(ctrlstr, cbfun){
08792 set ctrlstr.EDC_modulesEditor.EDM_cbKeyUp = cbfun;
08793 0;
08794 }
08795
08796
08797 cbEdCtrlModuleEditorSize(winstr, w, h, ctrlstr){
08798 paintEdCtrlModuleEditor ctrlstr;
08799 0;
08800 }
08801
08802
08803 cbEdCtrlModuleEditorScroll(winstr, x, y, ctrlstr){
08804 paintEdCtrlModuleEditor ctrlstr;
08805 0;
08806 }
08807
08808
08809 crEdCtrlModuleEditor(winstr, surfw, surfh, snap, mode, themestr){
08810 let if themestr == nil then (if EdDefaultTheme == nil then (set EdDefaultTheme = makeEdThemeResources winstr.EDW_channel) else EdDefaultTheme) else themestr -> themestr in
08811 let getEdWindowSize winstr -> [w h] in
08812 let mkEdControl [winstr.EDW_channel winstr nil themestr nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil] -> ctrlstr in
08813 let if ctrlstr.EDC_father.EDW_virtualWin == nil then ctrlstr.EDC_father.EDW_win else ctrlstr.EDC_father.EDW_virtualWin -> father in
08814
08815 let crEdScrollWindow ctrlstr.EDC_channel winstr 0 0 w h WN_CHILDINSIDE|WN_VSCROLL|WN_HSCROLL EDWIN_RESIZE_MW|EDWIN_RESIZE_MH nil "" -> scrollwinstr in
08816 let crEdWindow ctrlstr.EDC_channel scrollwinstr 0 0 surfw surfh WN_NOBORDER|WN_CHILDINSIDE nil nil "" -> windmistr in
08817 let crEdCtrlGrid windmistr 0 0 surfw surfh themestr.EDT_iModuleEditorBg themestr.EDT_iModuleEditorDot snap nil -> ctrlbmp in
08818 let ctrlbmp.EDC_bitmap -> [cont _ bgcomp _ _] in
08819 let _CRalphaBitmap ctrlstr.EDC_channel _CRbitmap ctrlstr.EDC_channel surfw surfh nil 0x000000 0x000000 -> abmplinks in
08820 let _CRcompBitmap ctrlstr.EDC_channel cont (_CONVERTcompBitmapToObjNode bgcomp) [0 0] OBJ_VISIBLE|OBJ_ENABLE OBJ_CONTAINER_CLICK|OBJ_CONTAINER_UNCLICK|OBJ_CONTAINER_MOVE|OBJ_CONTAINER_KEYDOWN|OBJ_CONTAINER_KEYUP|OBJ_CONTAINER_DBLCLICK abmplinks 0 0 surfw surfh -> cmplinks in
08821
08822 let mkEdModuleEditor [ctrlstr.EDC_channel nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil] -> mestr in
08823 (
08824 setEdwindowCbSize scrollwinstr mkfun4 @cbEdCtrlModuleEditorSize ctrlstr;
08825 setEdwindowCbVirtualMove scrollwinstr mkfun4 @cbEdCtrlModuleEditorScroll ctrlstr;
08826
08827 set mestr.EDM_winScroll = scrollwinstr;
08828 set mestr.EDM_winDmi = windmistr;
08829 set mestr.EDM_bmpBack = ctrlbmp;
08830 set mestr.EDM_abmpLinks = abmplinks;
08831 set mestr.EDM_bmpLinks = cmplinks;
08832 set mestr.EDM_sizeSurface = [surfw surfh];
08833 set mestr.EDM_iLinkMode = 0;
08834 set mestr.EDM_iBoxMode = mode;
08835
08836 set mestr.EDM_node = _CONVERTcompBitmapToObjNode cmplinks;
08837 set mestr.EDM_cont = cont;
08838 set mestr.EDM_iSnap = snap;
08839
08840 _CBcontainerMouseWheel mestr.EDM_cont @cbEdCtrlModuleEditorWheel ctrlstr;
08841 _CBcontainerCursorMove mestr.EDM_cont @cbCtrlModuleEditorCursorMove ctrlstr;
08842 _CBcontainerClick mestr.EDM_cont @cbCtrlModuleEditorClick ctrlstr;
08843 _CBcontainerDblClick mestr.EDM_cont @cbCtrlModuleEditorDbClick ctrlstr;
08844 _CBcontainerUnClick mestr.EDM_cont @cbCtrlModuleEditorUnClick ctrlstr;
08845 _CBcontainerKeyDown mestr.EDM_cont @cbCtrlModuleEditorKeyDown ctrlstr;
08846 _CBcontainerKeyUp mestr.EDM_cont @cbCtrlModuleEditorKeyUp ctrlstr;
08847
08848 set ctrlstr.EDC_modulesEditor = mestr;
08849 set winstr.EDW_lControl = ctrlstr::winstr.EDW_lControl;
08850
08851 let _GETwindowPositionSize father -> [_ _ fw fh] in
08852 set ctrlstr.EDC_coords = [0 0 (fw-w) (fh-h) w h];
08853
08854 ctrlstr;
08855 );
08856 }
08857
08858
08859 dsEdCtrlModuleEditor(ctrlstr){
08860 resetEdCtrlModuleEditor ctrlstr;
08861
08862 let ctrlstr.EDC_modulesEditor -> mestr in
08863 (
08864 dsEdWindow mestr.EDM_winScroll;
08865 dsEdWindow mestr.EDM_winDmi;
08866 dsEdCtrlBitmap mestr.EDM_bmpBack;
08867 _DScompBitmap mestr.EDM_bmpLinks;
08868 _DSalphaBitmap mestr.EDM_abmpLinks;
08869 );
08870 set ctrlstr.EDC_father.EDW_lControl = G2DremoveFromList ctrlstr.EDC_father.EDW_lControl ctrlstr;
08871 0;
08872 }
08873
08874
08875
08876
08877
08878 dsEdWindowCtrlList(lctrl){
08879 let sizelist lctrl -> size in
08880 let 0 -> i in
08881 while i < size do
08882 (
08883 let nth_list lctrl i -> ctrl in
08884 (
08885 if ctrl.EDC_label == nil then nil else
08886 dsEdCtrlLabel ctrl;
08887
08888 if ctrl.EDC_text == nil then nil else
08889 dsEdCtrlText ctrl;
08890
08891 if ctrl.EDC_editText == nil then nil else
08892 dsEdCtrlEditText ctrl;
08893
08894 if ctrl.EDC_editLine == nil then nil else
08895 dsEdCtrlTextLine ctrl;
08896
08897 if ctrl.EDC_editFloat == nil then nil else
08898 dsEdCtrlFloat ctrl;
08899
08900 if ctrl.EDC_button == nil then nil else
08901 dsEdCtrlButton ctrl;
08902
08903 if ctrl.EDC_colorButton == nil then nil else
08904 dsEdCtrlColorButton ctrl;
08905
08906 if ctrl.EDC_check == nil then nil else
08907 dsEdCtrlCheck ctrl;
08908
08909 if ctrl.EDC_list == nil then nil else
08910 dsEdCtrlList ctrl;
08911
08912 if ctrl.EDC_tree == nil then nil else
08913 dsEdCtrlTree ctrl;
08914
08915 if ctrl.EDC_bitmap == nil then nil else
08916 dsEdCtrlBitmap ctrl;
08917
08918 if ctrl.EDC_select == nil then nil else
08919 dsEdCtrlSelect ctrl;
08920
08921 if ctrl.EDC_bitmapList == nil then nil else
08922 dsEdCtrlBitmapList ctrl;
08923
08924 if ctrl.EDC_view3d == nil then nil else
08925 dsEdCtrl3D ctrl;
08926
08927 if ctrl.EDC_modulesEditor == nil then nil else
08928 dsEdCtrlModuleEditor ctrl;
08929 );
08930
08931 set i = i + 1;
08932 );
08933 0;
08934 }
08935
08936
08937 setEdCtrlSize(ctrlstr, w, h){
08938 let getEdWindowSize ctrlstr.EDC_father -> [fw fh] in
08939
08940 (
08941 if ctrlstr.EDC_label != nil then
08942 let _GETtextPositionSize ctrlstr.EDC_label -> [x y _ _] in
08943 (
08944 _POSITIONtext ctrlstr.EDC_label x y w h;
08945 mutate ctrlstr.EDC_coords <- [x y (fw-(x + w)) (fh-(y+h)) w h];
08946 0;
08947 )
08948 else if ctrlstr.EDC_editText != nil then
08949 let _GETtextPositionSize ctrlstr.EDC_editText -> [x y _ _] in
08950 (
08951 _POSITIONtext ctrlstr.EDC_editText x y w+1 h+1;
08952 mutate ctrlstr.EDC_coords <- [x y (fw-(x + w)) (fh-(y+h)) w h];
08953 0;
08954 )
08955 else if ctrlstr.EDC_editLine != nil then
08956 let _GETtextPositionSize ctrlstr.EDC_editLine -> [x y _ _] in
08957 (
08958 _POSITIONtext ctrlstr.EDC_editLine x y w+1 h+1;
08959 mutate ctrlstr.EDC_coords <- [x y (fw-(x + w)) (fh-(y+h)) w h];
08960 0;
08961 )
08962 else if ctrlstr.EDC_text != nil then
08963 let _GETtextPositionSize ctrlstr.EDC_text -> [x y _ _] in
08964 (
08965 _POSITIONtext ctrlstr.EDC_text x y w+1 h+1;
08966 mutate ctrlstr.EDC_coords <- [x y (fw-(x + w)) (fh-(y+h)) w h];
08967 0;
08968 )
08969 else if ctrlstr.EDC_button != nil then
08970 let _GETbuttonPositionSize ctrlstr.EDC_button -> [x y _ _] in
08971 (
08972 _POSITIONbutton ctrlstr.EDC_button x y w h;
08973 mutate ctrlstr.EDC_coords <- [x y (fw-(x + w)) (fh-(y+h)) w h];
08974 0;
08975 )
08976 else if ctrlstr.EDC_check != nil then
08977 let _GETcheckPositionSize ctrlstr.EDC_check -> [x y _ _] in
08978 (
08979 _POSITIONcheck ctrlstr.EDC_check x y w h;
08980 mutate ctrlstr.EDC_coords <- [x y (fw-(x + w)) (fh-(y+h)) w h];
08981 0;
08982 )
08983 else if ctrlstr.EDC_list != nil then
08984 let ctrlstr.EDC_list -> [list lp] in
08985 let _GETlistPositionSize list -> [x y _ _] in
08986 (
08987 _POSITIONlist list x y w+1 h+1;
08988 mutate ctrlstr.EDC_coords <- [x y (fw-(x + w)) (fh-(y+h)) w h];
08989 0;
08990 )
08991 else if ctrlstr.EDC_select != nil then
08992 let _GETcomboPositionSize ctrlstr.EDC_select -> [x y _ _] in
08993 (
08994 _POSITIONcombo ctrlstr.EDC_select x y w h;
08995 mutate ctrlstr.EDC_coords <- [x y (fw-(x + w)) (fh-(y+h)) w h];
08996 0;
08997 )
08998 else if ctrlstr.EDC_tree != nil then
08999 let ctrlstr.EDC_tree -> [tree _ _ _ _] in
09000 let _GETtreePositionSize tree -> [x y _ _] in
09001 (
09002 _POSITIONtree tree x y w+1 h+1;
09003 mutate ctrlstr.EDC_coords <- [x y (fw-(x + w)) (fh-(y+h)) w h];
09004 0;
09005 )
09006 else if ctrlstr.EDC_bitmap != nil then
09007 let ctrlstr.EDC_bitmap -> [cont alphabmp ocbmp _ _] in
09008 let _GETcontainerPositionSize cont -> [x y _ _] in
09009 (
09010 _SIZEcontainer cont x y w h;
09011 mutate ctrlstr.EDC_coords <- [x y (fw-(x + w)) (fh-(y+h)) w h];
09012 0;
09013 )
09014 else if ctrlstr.EDC_bitmapList != nil then
09015 let ctrlstr.EDC_bitmapList -> [cont _ _ _ _ _ _] in
09016 let _GETcontainerPositionSize cont -> [x y _ _] in
09017 (
09018 _SIZEcontainer cont x y w h;
09019 mutate ctrlstr.EDC_coords <- [x y (fw-(x + w)) (fh-(y+h)) w h];
09020 0;
09021 )
09022 else if ctrlstr.EDC_editFloat != nil then
09023 let ctrlstr.EDC_editFloat -> [txt cont _ _ _ _ _ _ _ _ _ _ _] in
09024 let _GETcontainerExPositionSize cont -> [_ _ bw bh] in
09025 let _GETtextPositionSize txt -> [x y _ _] in
09026 (
09027 _POSITIONtext txt x y ((w - bw) + 1) (h + 1);
09028 _MOVEcontainer cont (x + (w - bw)) y;
09029 mutate ctrlstr.EDC_coords <- [x y (fw-(x + w)) (fh-(y+h)) w h];
09030 0;
09031 )
09032 else if ctrlstr.EDC_view3d != nil then
09033 let V3DgetViewPos ctrlstr.EDC_view3d -> [x y] in
09034 (
09035 V3DresizeView ctrlstr.EDC_view3d x y w h;
09036 mutate ctrlstr.EDC_coords <- [x y (fw-(x + w)) (fh-(y+h)) w h];
09037 0;
09038 )
09039 else if ctrlstr.EDC_colorButton != nil then
09040 let ctrlstr.EDC_colorButton -> [btn obmp winstr color mode cbfun] in
09041 let _GETbuttonPositionSize btn -> [x y _ _] in
09042 (
09043 let if !mode then (G2Drgb2bgr color) else G2Dbgra2bgr (G2Drgba2bgra color) -> bgrcolor in
09044 let _FILLbitmap _CRbitmap ctrlstr.EDC_channel w h bgrcolor -> bmp in
09045 (
09046 _DSbitmap obmp;
09047 _POSITIONbutton btn x y w h;
09048 _SETbuttonBitmap btn bmp;
09049 mutate ctrlstr.EDC_colorButton <- [_ bmp _ color _ _];
09050 _PAINTbutton btn;
09051
09052 mutate ctrlstr.EDC_coords <- [x y (fw-(x + w)) (fh-(y+h)) w h];
09053 );
09054 0;
09055 )
09056 else nil;
09057 );
09058 0;
09059 }
09060
09061