mixster

Untitled

Jun 29th, 2010
428
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 15.78 KB | None | 0 0
  1. program MSIForm;
  2.  
  3. const
  4.  
  5.  
  6.   PANEL_COUNT = 5;
  7.     PANEL_1   = 0;
  8.     PANEL_2   = 1;
  9.     PANEL_3   = 2;
  10.     PANEL_4   = 3;
  11.     PANEL_5   = 4;
  12.  
  13.  
  14.   IMG_COUNT = 23;
  15.     // Used in frmMain
  16.     IMG_BGND            = 0;
  17.     IMG_X_NORM          = 1;
  18.     IMG_Q_NORM          = 2;
  19.     IMG_LOAD_TAB_NORM   = 3;
  20.     IMG_SAVE_TAB_NORM   = 4;
  21.     IMG_TAB_NORM_1      = 5;
  22.     IMG_TAB_NORM_2      = 6;
  23.     IMG_TAB_NORM_3      = 7;
  24.     IMG_TAB_NORM_4      = 8;
  25.  
  26.     IMG_LOC_MAP         = 9;
  27.     IMG_LOC_NAV         = 10;
  28.     IMG_LOC_EXIT_NORM   = 11;
  29.     IMG_LOC_BORD_TOP    = 12;
  30.     IMG_LOC_BORD_BOTTOM = 13;
  31.     IMG_LOC_BORD_LEFT   = 14;
  32.     IMG_LOC_BORD_RIGHT  = 15;
  33.     IMG_LOC_BOX_TOP     = 16;
  34.     IMG_LOC_BOX_LEFT    = 17;
  35.     IMG_LOC_BOX_RIGHT   = 18;
  36.     IMG_LOC_BOX_BOTTOM  = 19;
  37.  
  38.     // Used in Panel 0 (Is also used for frmMain)
  39.     IMG_LOC_ICON_NORM   = 20;
  40.     IMG_LOC_LABEL       = 21;
  41.     IMG_TAB_HINT        = 22;
  42.  
  43.     // Used in Panel 1
  44.  
  45.     // Used in Panel 2
  46.  
  47.     // Used in Panel 3
  48.  
  49.     // Used in Panel 4
  50.  
  51.   BITMAP_COUNT = 31;
  52.     BGND            = 0;
  53.     X_NORM          = 1;
  54.     X_HOVER         = 2;
  55.     Q_NORM          = 3;
  56.     Q_HOVER         = 4;
  57.     LOAD_TAB_NORM   = 5;
  58.     LOAD_TAB_HOVER  = 6;
  59.     SAVE_TAB_NORM   = 7;
  60.     SAVE_TAB_HOVER  = 8;
  61.     TAB_NORM_1      = 9;
  62.     TAB_HOVER_1     = 10;
  63.     TAB_NORM_2      = 11;
  64.     TAB_HOVER_2     = 12;
  65.     TAB_NORM_3      = 13;
  66.     TAB_HOVER_3     = 14;
  67.     TAB_NORM_4      = 15;
  68.     TAB_HOVER_4     = 16;
  69.     LOC_ICON_NORM   = 17;
  70.     LOC_ICON_HOVER  = 18;
  71.     LOC_EXIT_NORM   = 19;
  72.     LOC_EXIT_HOVER  = 20;
  73.     LOC_MAP         = 21;
  74.     LOC_NAV         = 22;
  75.     LOC_BORD_TOP    = 23;
  76.     LOC_BORD_BOTTOM = 24;
  77.     LOC_BORD_LEFT   = 25;
  78.     LOC_BORD_RIGHT  = 26;
  79.     LOC_BOX_TOP     = 27;
  80.     LOC_BOX_LEFT    = 28;
  81.     LOC_LABEL       = 29;
  82.     TAB_HINT        = 30;
  83.  
  84. var
  85.   frmMain: TForm;
  86.   time: TTimer;
  87.  
  88.   tImages: Array[0..IMG_COUNT - 1] of TImage;
  89.  
  90.   frmBitmaps: Array [0..BITMAP_COUNT - 1] of Integer;
  91.  
  92.   isActiveImage: Array[0..IMG_COUNT - 1] of Boolean;
  93.   isLeftTab: Array[IMG_TAB_NORM_1..IMG_TAB_NORM_4] of Boolean;
  94.   isActivePanel: Array[0..PANEL_COUNT - 1] of Boolean;
  95.  
  96.   MapDragStartX, MapDragStartY: Integer;
  97.  
  98.  
  99. procedure OnMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
  100. var
  101.   BoundL, BoundT: Extended;
  102. begin
  103.   case sender of
  104.     tImages[IMG_LOC_MAP]:
  105.       begin
  106.         MapDragStartX := x;
  107.         MapDragStartY := y;
  108.       end;
  109.     tImages[IMG_LOC_NAV]:
  110.       begin
  111.         GetMousePos(x, y);
  112.         with tImages[IMG_LOC_BOX_TOP] do
  113.           SetBounds({L} x + (x - left), {T} y + (y - top), {W} 83, {H} 1);
  114.  
  115.         if tImages[IMG_LOC_BOX_TOP].Left < 376 then
  116.           tImages[IMG_LOC_BOX_TOP].Left := 376;
  117.         if tImages[IMG_LOC_BOX_TOP].Top < 216 then
  118.           tImages[IMG_LOC_BOX_TOP].Top := 216;
  119.         if tImages[IMG_LOC_BOX_TOP].Left > 494 then
  120.           tImages[IMG_LOC_BOX_TOP].Left := 494;
  121.         if tImages[IMG_LOC_BOX_TOP].Top > 322 then
  122.           tImages[IMG_LOC_BOX_TOP].Top := 322;
  123.  
  124.         with tImages[IMG_LOC_BOX_LEFT] do
  125.           SetBounds({L} tImages[IMG_LOC_BOX_TOP].Left, {T} tImages[IMG_LOC_BOX_TOP].Top + 1, {W} 1, {H} 55);
  126.         with tImages[IMG_LOC_BOX_RIGHT] do
  127.           SetBounds({L} tImages[IMG_LOC_BOX_TOP].Left + 83, {T} tImages[IMG_LOC_BOX_TOP].Top + 1, {W} 1, {H} 55);
  128.         with tImages[IMG_LOC_BOX_BOTTOM] do
  129.           SetBounds({L} tImages[IMG_LOC_BOX_TOP].Left, {T} tImages[IMG_LOC_BOX_TOP].Top + 55, {W} 83, {H} 1);
  130.  
  131.         BoundL := -(x - 155 - 376) * 7.234;
  132.         BoundT := -(y - 140 - 216) * 7.234;
  133.  
  134.         tImages[IMG_LOC_MAP].Left := Round(BoundL);
  135.         tImages[IMG_LOC_MAP].Top := Round(BoundT);
  136.  
  137.         if tImages[IMG_LOC_MAP].Left > 0 then
  138.           tImages[IMG_LOC_MAP].Left := 0;
  139.         if tImages[IMG_LOC_MAP].Top > 0 then
  140.           tImages[IMG_LOC_MAP].Top := 0;
  141.         if tImages[IMG_LOC_MAP].Left < -345 then
  142.           tImages[IMG_LOC_MAP].Left := -345;
  143.         if tImages[IMG_LOC_MAP].Top < -354 then
  144.           tImages[IMG_LOC_MAP].Top := -354;
  145.       end;
  146.   end;
  147. end;
  148.  
  149. var sended: Tobject;
  150. move, accel, cons: integer;
  151. procedure TimerTabClick(Sender: TObject);
  152. var
  153.   senderTab, i, CurrentPanel: Integer;
  154. begin
  155.   for i := IMG_TAB_NORM_1 to IMG_TAB_NORM_4 do
  156.     if (Sended = tImages[i]) then
  157.       senderTab := i;
  158.  
  159.   if not(isLeftTab[senderTab]) then
  160.   begin
  161.     for i := IMG_TAB_NORM_1 to senderTab do
  162.     begin
  163.       if not(isLeftTab[i]) then
  164.       begin
  165.         tImages[i].Left := tImages[i].Left - accel;
  166.         if move = 0 then
  167.           cons := tImages[i].Left;
  168.         accel := accel + 2;
  169.         move:= move + accel;
  170.       end;
  171.       if move >= 380 then
  172.       begin
  173.         tImages[i].Left := cons - 380;
  174.         isLeftTab[i] := True;
  175.         move := 0;
  176.         time.ENABLED := false;
  177.       end;
  178.     end;
  179.     CurrentPanel := sendertab - IMG_TAB_NORM_1 + 1;
  180.   end else
  181.   begin
  182.     for i := IMG_TAB_NORM_4 downto senderTab do
  183.     begin
  184.        if (isLeftTab[i]) then
  185.         begin
  186.         tImages[i].Left := tImages[i].Left + accel;
  187.         if move = 0 then
  188.           cons := tImages[i].Left;
  189.         accel := accel + 2;
  190.         move := move + accel;
  191.         end;
  192.       if move >= 380 then
  193.       begin
  194.         tImages[i].Left := cons + 380;
  195.         isLeftTab[i] := False;
  196.         move := 0;
  197.         time.ENABLED := false;
  198.       end;
  199.     end;
  200.     CurrentPanel := sendertab - IMG_TAB_NORM_1;
  201.   end;
  202.  
  203.   for i := PANEL_1 to PANEL_5 do
  204.   begin
  205.     if i = CurrentPanel then
  206.       isActivePanel[i] := True
  207.     else
  208.       isActivePanel[i] := False;
  209.   end;
  210.  
  211.   WriteLn(CurrentPanel);
  212.  
  213.   for i := IMG_LOC_ICON_NORM to IMG_TAB_HINT do
  214.     tImages[i].Visible := isActivePanel[PANEL_1];
  215. end;
  216.  
  217. procedure TabClick(Sender: TObject);
  218. begin
  219.   if not time.ENABLED then
  220.   begin
  221.     accel := 0;
  222.     time.enabled := not time.enabled;
  223.     sended := Sender;
  224.   end;
  225. end;
  226.  
  227. procedure LocViewer(Sender: TObject);
  228. var i: Integer;
  229. begin
  230.   case Sender of
  231.     tImages[IMG_LOC_ICON_NORM]:
  232.     begin
  233.       for i := IMG_LOC_MAP to IMG_LOC_BOX_BOTTOM do
  234.         tImages[i].Visible := True;
  235.       for i := IMG_LOC_ICON_NORM to IMG_TAB_HINT do
  236.         tImages[i].Visible := False;
  237.     end;
  238.  
  239.     tImages[IMG_LOC_EXIT_NORM]:
  240.     begin
  241.       for i := IMG_LOC_MAP to IMG_LOC_BOX_BOTTOM do
  242.         tImages[i].Visible := False;
  243.       for i := IMG_LOC_ICON_NORM to IMG_TAB_HINT do
  244.         tImages[i].Visible := isActivePanel[PANEL_1];
  245.     end;
  246.   end;
  247. end;
  248.  
  249. procedure Clicked(Sender: TObject);
  250. var
  251.   i: Integer;
  252. begin
  253.   for i := 0 to BITMAP_COUNT - 1 do
  254.     FreeBitmap(frmBitmaps[i]);
  255.   frmMain.ModalResult := mrOk;
  256. end;
  257.  
  258. procedure OutsideBox(l,t,r,b, obj: integer);
  259. begin
  260.   if tImages[obj].Left > l then
  261.     tImages[obj].Left := l;
  262.   if tImages[obj].Top > t then
  263.     tImages[obj].Top := t;
  264.   if tImages[obj].Left < r then
  265.     tImages[obj].Left := r;
  266.   if tImages[obj].Top < b then
  267.     tImages[obj].Top := b;
  268. end;
  269.  
  270. procedure MouseMoved(Sender: TObject; Shift: TShiftState; x, y: Integer);
  271. var
  272.   hi, i, bmp, xdif, ydif, h: Integer;
  273.   BoundL, BoundT: Extended;
  274.   imgSwap, bmpArr, imgArr: Array of Integer;
  275. begin
  276.         bmpArr := [ X_NORM, Q_NORM, LOAD_TAB_NORM,
  277.                     SAVE_TAB_NORM, TAB_NORM_1, TAB_NORM_2,
  278.                     TAB_NORM_3, TAB_NORM_4, LOC_ICON_NORM, LOC_EXIT_NORM ]
  279.  
  280.         imgArr := [ IMG_X_NORM, IMG_Q_NORM, IMG_LOAD_TAB_NORM,
  281.                     IMG_SAVE_TAB_NORM, IMG_TAB_NORM_1, IMG_TAB_NORM_2,
  282.                     IMG_TAB_NORM_3, IMG_TAB_NORM_4, IMG_LOC_ICON_NORM, IMG_LOC_EXIT_NORM ]
  283.   case Sender of
  284.     tImages[IMG_BGND], tImages[IMG_LOC_MAP]:
  285.       begin
  286.         {bmpArr := [ X_NORM, Q_NORM, LOAD_TAB_NORM,
  287.                     SAVE_TAB_NORM, TAB_NORM_1, TAB_NORM_2,
  288.                     TAB_NORM_3, TAB_NORM_4, LOC_ICON_NORM, LOC_EXIT_NORM ]
  289.  
  290.         imgArr := [ IMG_X_NORM, IMG_Q_NORM, IMG_LOAD_TAB_NORM,
  291.                     IMG_SAVE_TAB_NORM, IMG_TAB_NORM_1, IMG_TAB_NORM_2,
  292.                     IMG_TAB_NORM_3, IMG_TAB_NORM_4, IMG_LOC_ICON_NORM, IMG_LOC_EXIT_NORM ]    }
  293.  
  294.         hi := High(bmpArr);
  295.         for i := 0 to hi do
  296.         begin
  297.           if (not isActiveImage[imgArr[i]]) then
  298.             Continue;
  299.  
  300.           bmp := frmBitmaps[bmpArr[i]];
  301.           DrawBitmap(bmp,tImages[imgArr[i]].Canvas,0,0);
  302.           isActiveImage[imgArr[i]] := False;
  303.         end;
  304.       end;
  305.   end;
  306.   for h := 1 to 10 do
  307.   begin
  308.     i := 2 * h;
  309.     case Sender of
  310.       tImages[h]:
  311.         begin
  312.           imgSwap := [h, frmBitmaps[i]];
  313.  
  314.           if not (isActiveImage[imgSwap[0]]) then
  315.           begin
  316.             DrawBitmap(imgSwap[1],tImages[imgSwap[0]].Canvas,0,0);
  317.  
  318.             {imgArr := [ IMG_X_NORM, IMG_Q_NORM, IMG_LOAD_TAB_NORM,
  319.                          IMG_SAVE_TAB_NORM, IMG_TAB_NORM_1, IMG_TAB_NORM_2,
  320.                          IMG_TAB_NORM_3, IMG_TAB_NORM_4, IMG_LOC_ICON_NORM, IMG_LOC_EXIT_NORM];}
  321.             writeln(inttostr(imgSwap[0]) + ' ' + inttostr(imgSwap[1]));
  322.             bmp := frmBitmaps[h];
  323.             DrawBitmap(bmp,tImages[imgArr[i]].Canvas,0,0);
  324.           end;
  325.         end;
  326.     end;
  327.   end;
  328.   case sender of
  329.     tImages[IMG_LOC_MAP]:
  330.       begin
  331.         if not IsMouseButtonDown(1) then exit;
  332.         xdif := x - MapDragStartX;
  333.         ydif := y - MapDragStartY;
  334.         tImages[IMG_LOC_MAP].Left := tImages[IMG_LOC_MAP].Left + xdif;
  335.         tImages[IMG_LOC_MAP].Top := tImages[IMG_LOC_MAP].Top + ydif;
  336.  
  337.         OutsideBox(0,0,-854, -765, IMG_LOC_MAP);
  338.  
  339.         BoundL := -tImages[IMG_LOC_MAP].Left / 7.234 + 376;
  340.         BoundT := -tImages[IMG_LOC_MAP].Top / 7.234 + 216;
  341.  
  342.  
  343.         with tImages[IMG_LOC_BOX_TOP] do
  344.           SetBounds({L} Round(BoundL), {T} Round(BoundT), {W} 83, {H} 1);
  345.  
  346.         OutsideBox(494,322,376, 216, IMG_LOC_BOX_TOP);
  347.  
  348.         with tImages[IMG_LOC_BOX_LEFT] do
  349.           SetBounds({L} tImages[IMG_LOC_BOX_TOP].Left, {T} tImages[IMG_LOC_BOX_TOP].Top + 1, {W} 1, {H} 55);
  350.         with tImages[IMG_LOC_BOX_RIGHT] do
  351.           SetBounds({L} tImages[IMG_LOC_BOX_TOP].Left + 83, {T} tImages[IMG_LOC_BOX_TOP].Top + 1, {W} 1, {H} 55);
  352.         with tImages[IMG_LOC_BOX_BOTTOM] do
  353.           SetBounds({L} tImages[IMG_LOC_BOX_TOP].Left, {T} tImages[IMG_LOC_BOX_TOP].Top + 55, {W} 83, {H} 1);
  354.       end;
  355.     tImages[IMG_LOC_NAV]:
  356.       begin
  357.         if not IsMouseButtonDown(1) then exit;
  358.         GetMousePos(x, y);
  359.         with tImages[IMG_LOC_BOX_TOP] do
  360.           SetBounds({L} x - 55 - 100, {T} y - 40 - 100, {W} 83, {H} 1);
  361.  
  362.         OutsideBox(494,322,376, 216, IMG_LOC_BOX_TOP);
  363.  
  364.         with tImages[IMG_LOC_BOX_LEFT] do
  365.           SetBounds({L} tImages[IMG_LOC_BOX_TOP].Left, {T} tImages[IMG_LOC_BOX_TOP].Top + 1, {W} 1, {H} 55);
  366.         with tImages[IMG_LOC_BOX_RIGHT] do
  367.           SetBounds({L} tImages[IMG_LOC_BOX_TOP].Left + 83, {T} tImages[IMG_LOC_BOX_TOP].Top + 1, {W} 1, {H} 55);
  368.         with tImages[IMG_LOC_BOX_BOTTOM] do
  369.           SetBounds({L} tImages[IMG_LOC_BOX_TOP].Left, {T} tImages[IMG_LOC_BOX_TOP].Top + 55, {W} 83, {H} 1);
  370.  
  371.         BoundL := -(x - 155 - 376) * 7.234;
  372.         BoundT := -(y - 140 - 216) * 7.234;
  373.  
  374.         tImages[IMG_LOC_MAP].Left := Round(BoundL);
  375.         tImages[IMG_LOC_MAP].Top := Round(BoundT);
  376.  
  377.         OutsideBox(0, 0, -854, -765, IMG_LOC_MAP);
  378.       end;
  379.   end;
  380. end;
  381.  
  382. procedure OnClickEvents(Sender: TObject);
  383. begin
  384.   case Sender of
  385.     tImages[IMG_X_NORM]: Clicked(Sender);
  386.     tImages[IMG_TAB_NORM_1], tImages[IMG_TAB_NORM_2],tImages[IMG_TAB_NORM_3], tImages[IMG_TAB_NORM_4]: TabClick(Sender);
  387.     tImages[IMG_LOC_ICON_NORM], tImages[IMG_LOC_EXIT_NORM]: LocViewer(Sender);
  388.   end;
  389. end;
  390.  
  391. procedure InitForm;
  392. var
  393.   Image, bmp, hi, i: Integer;
  394.   consts: TintegerArray;
  395.   bmpArr: TStringArray;
  396.   xy, wh: TPointArray;
  397.   visibl: TBoolArray;
  398. begin
  399.   bmpArr := ['BGND','X_NORM','X_HOVER','Q_NORM','Q_HOVER','LOAD_TAB_NORM','LOAD_TAB_HOVER','SAVE_TAB_NORM','SAVE_TAB_HOVER','TAB_NORM_1','TAB_HOVER_1','TAB_NORM_2','TAB_HOVER_2','TAB_NORM_3','TAB_HOVER_3','TAB_NORM_4','TAB_HOVER_4','LOC_ICON_NORM','LOC_ICON_HOVER','LOC_EXIT_NORM','LOC_EXIT_HOVER','LOC_MAP','LOC_NAV','LOC_BORD_TOP','LOC_BORD_BOTTOM','LOC_BORD_LEFT','LOC_BORD_RIGHT','LOC_BOX_TOP','LOC_BOX_LEFT','LOC_LABEL','TAB_HINT'];
  400.   hi := High(frmBitmaps);
  401.   for i := 0 to hi do
  402.     frmBitmaps[i] := LoadBitmap(ScriptPath + 'Bitmaps\' + bmpArr[i] + '.png');
  403.  
  404.   {
  405.   MAIN FORM
  406.   }
  407.  
  408.   frmMain := TForm.Create(nil);
  409.   with frmMain do
  410.   begin
  411.     SetBounds({L} 100, {T} 100, {W} 600, {H} 400);
  412.     //Position := poScreenCenter;
  413.     //Width := 600;
  414.     //Height := 400;
  415.     BorderStyle := bsNone;
  416.   end;
  417.  
  418.   time := TTimer.Create(frmMain);
  419.   time.ONTIMER := @TimerTabClick;
  420.   time.INTERVAL := 10;
  421.   time.ENABLED := false;
  422.  
  423.   xy := [Point(0,0),     Point(575,7), Point(557,7), Point(7,69),  Point(81,69), Point(390,100), Point(440,100), Point(490,100), Point(540,100), Point(179,204), Point(-300,0),    Point(369,209), Point(475,7),  Point(0,0),   Point(0,393),    Point(0,7),    Point(593,7),   Point(Round( 300 / 7.234 + 376), 216), Point(Round( 300 / 7.234 + 376), 216 + 1), Point(Round( 300 / 7.234 + 376) + 83, 216 + 1), Point(Round( 300 / 7.234 + 376), 216 + 1 + 54), Point(156,250), Point(208,379)];
  424.   wh := [Point(600,400), Point(18,18), Point(18,18), Point(74,22), Point(74,22), Point(50,290),  Point(50,290),  Point(50,290),  Point(50,290),  Point(40,41),   Point(1454,1165), Point(215,175), Point(119,22), Point(600,7), Point(600,7),    Point(7,386),  Point(7,386),   Point(83, 1),                          Point(1,55),                               Point(1,55),                                    Point(83,1),                                    Point(87,11),   Point(174,10)];
  425.   visibl := [true,       true,         true,         true,         true,         true,           true,           true,           true,           true,           false,            false,          false,         false,        false,           false,         false,          false,                                 false,                                     false,                                          false,                                          true,           true];
  426.   consts := [BGND,       X_NORM,       Q_NORM,       LOAD_TAB_NORM,SAVE_TAB_NORM,TAB_NORM_1,     TAB_NORM_2,     TAB_NORM_3,     TAB_NORM_4,     LOC_ICON_NORM,  LOC_MAP,          LOC_NAV,        LOC_EXIT_NORM, LOC_BORD_TOP, LOC_BORD_BOTTOM, LOC_BORD_LEFT, LOC_BORD_RIGHT, LOC_BOX_TOP,                           LOC_BOX_LEFT,                              LOC_BOX_LEFT,                                   LOC_BOX_TOP,                                    LOC_LABEL,      TAB_HINT];
  427.   for Image := 0 to IMG_COUNT - 1 do
  428.   begin
  429.     tImages[Image] := TImage.Create(frmMain);
  430.     with tImages[Image] do
  431.     begin
  432.       Parent := frmMain;
  433.       SetBounds(xy[Image].x, xy[Image].y, wh[Image].x, wh[Image].y);
  434.       bmp := frmBitmaps[consts[image]];
  435.       OnMouseMove := @MouseMoved;
  436.       ONMOUSEDOWN := @OnMouseDown;
  437.       OnClick := @OnClickEvents;
  438.       isActiveImage[Image] := False;
  439.       if (Image > IMG_TAB_NORM_1) and (Image < IMG_TAB_NORM_4) then
  440.         isLeftTab[Image] := false;
  441.       visible := Visibl[Image];
  442.     end;
  443.   DrawBitmap(bmp, tImages[Image].canvas, 0, 0);
  444.   end;
  445.  
  446.   isActivePanel[Panel_1] := True;
  447.   isActivePanel[Panel_2] := False;
  448.   isActivePanel[Panel_3] := False;
  449.   isActivePanel[Panel_4] := False;
  450.   isActivePanel[Panel_5] := False;
  451.  
  452.  
  453. end;
  454.  
  455. procedure SafeInitForm;
  456. var
  457.   v: TVariantArray;
  458. begin
  459.   setarraylength(V, 0);
  460.   ThreadSafeCall('InitForm', v);
  461. end;
  462.  
  463. procedure ShowFormModal;
  464. begin
  465.   frmMain.ShowModal;
  466. end;
  467.  
  468. procedure SafeShowFormModal;
  469. var
  470.   v: TVariantArray;
  471. begin
  472.   setarraylength(V, 0);
  473.   ThreadSafeCall('ShowFormModal', v);
  474. end;
  475.  
  476. begin
  477.   try
  478.     SafeInitForm;
  479.     SafeShowFormModal;
  480.   except
  481.     Writeln(ExceptionToString(ExceptionType, ExceptionParam));
  482.   end;
  483. end.
Add Comment
Please, Sign In to add comment