home *** CD-ROM | disk | FTP | other *** search
/ PC World 2002 December / PCWorld_2002-12_cd.bin / Software / Komercni / Baltik / katB.exe / katB / DESIGN / DESIGN.SGP < prev    next >
Text File  |  2002-09-26  |  122KB  |  2,611 lines

  1. SGPC   5.04 SGP#DEMO99208 16.08.2002  9:46:13                                    StructNo46  46
  2. #define _XP_THEME // Program will use Windows XP Theme Style
  3.  // if is not defined program will use Windows 2000 Theme Style
  4. //#define _DEBUG
  5. //#define _MEMORY_PREVIEW  for memory debug
  6. //#define _MOUSE_DEBUG        for mouse position debug
  7.  
  8. long  _UNDER_WINDOWS_2k;
  9. char m_LastedMessage = 0;
  10. string m_strExInfo[6];
  11.  
  12. # include "design_h.blt"
  13. # include "design_h.str"
  14. # include "design_h.api"
  15.  
  16. long NoXP; // :-))))))
  17. long UnderXP;
  18.  
  19.  
  20. # include "design_c.cha"
  21. # include "design_h.dia"
  22.  
  23.  
  24.  
  25. # include "design_c.io"
  26.  
  27.  
  28. TypMyτUdálost MouseEvent;
  29. long MouseObject;
  30. int m_keyIDKey;
  31.  
  32. // pro IDC_MENU
  33. int IDC_MENU_OVER = -1;
  34. static int IDC_MENU_RECT[]={45,91,133,182,244};
  35. //POINT MOUSEOFFSET;
  36. WND * m_ControlArray=0;
  37. MENU * m_MenuArray=0;
  38. char * m_ControlzOrderArray=0;
  39. int m_ZOrderControlSize=0;
  40. int m_MOUSESHOW= 1;
  41. RECT MEMRECT;
  42.  
  43. static char* IDC_MENU_HORITEM[]={"Soubor","┌pravy","Objekt","Zobrazit","Nßpov∞da"};
  44.  
  45. #define Diagram__GetCell(x) (&m_DiagramCells[x])
  46.  
  47. string AddDialog__CreateString();
  48. DIAGRAMCELL* Diagram__GetFocusCell( void );
  49. //DIAGRAMCELL* Diagram__GetCell(unsigned nId);
  50. void Diagram__DestroyCell( unsigned nID);
  51. int Diagram__AddOperation(unsigned nID, string str, unsigned nState );
  52. void Diagram__RecalculateCellRect( unsigned nID, char bRedraw);
  53. int Diagram__AddVariable( unsigned nID, string str, unsigned nState );
  54. void NormalizeRect(RECT* dest);
  55. void Diagram__OnDrawClipRect( int x,int y, int x2, int y2 );
  56. void SgpAsciiToWinChar(char& Char);
  57. void SendMessage(unsigned dest, unsigned nMessage,long lParam, long wParam);
  58. void TextOut(int x, int y, string szText,char color,char bg, char FontType);
  59. int ListBox__AddItem(unsigned hWnd, int nID, string strText);
  60.  
  61. void DrawFrameControl2(int x, int y, int x2, int y2,unsigned nType, long nState,char* szText,unsigned hBitmap);
  62.  
  63. void ListBox__DeleteAll(unsigned hWnd );
  64.  
  65. int m_nm_ControlArraySize = 0;
  66. #define ListBox__GetSize(x) GetWindow(x)->lParam
  67.  
  68.  
  69. # include "design_h.res"
  70. # include "design.rc"
  71.  
  72. # include "design_c.mem"
  73.  
  74. # include "design_c.ui"
  75. # include "design_c.men"
  76. # include "design_c.gdi"
  77. # include "design_c.car"
  78.  
  79. # include "design_c.dia"
  80.  
  81. // Globální prom╪nné
  82.  
  83.  
  84. // Globální makra
  85. -o1-Globals
  86. -c1-Globals
  87. ===Globals
  88. /*-hf(*/
  89. /*-hf-*/
  90. void ApplyLayout( void )
  91. /*-hf-*/;
  92. void CommandProc( long lParam, long wParam )
  93. /*-hf-*/;
  94. void MyWndProc(unsigned hWnd,unsigned nMessage, long lParam, long wParam)
  95. /*-hf-*/;
  96. void Diagram__DependentDelPointer(int nDep,int nIDCellFrom )
  97. /*-hf-*/;
  98. void Diagram__InvalidateMemRect(void)
  99. /*-hf-*/;
  100. void Diagram__SetMemRect( int nID )
  101. /*-hf-*/;
  102. void Diagram__DestroyCell( unsigned nID) // ONLY FOR DESTRUCT ELEMENT(not for FREE MEMORY)
  103. /*-hf-*/;
  104. void Diagram__RecalculateCellRect( unsigned nID,char bRedraw)
  105. /*-hf-*/;
  106. int Diagram__CreateImageCell(int x, int y, string path )
  107. /*-hf-*/;
  108. unsigned Diagram__CreateCell(int x, int y, unsigned nType )
  109. /*-hf-*/;
  110. void Diagram__AddSomething()
  111. /*-hf-*/;
  112. int Diagram__AddOperation(unsigned nID, string str, unsigned nState )
  113. /*-hf-*/;
  114. int Diagram__AddVariable( unsigned nID, string str, unsigned nState )
  115. /*-hf-*/;
  116. DIAGRAMCELL* Diagram__GetFocusCell( void )
  117. /*-hf-*/;
  118. void Diagram__OnEditMember( void )
  119. /*-hf-*/;
  120. void Diagram__OnDrawClipRect( int x,int y, int x2, int y2 )
  121.  
  122. /*-hf-*/;
  123. char Diagram__OverIDObject(int nID, int x, int y )
  124. /*-hf-*/;
  125. int Diagram__OverObject( int x, int y )
  126.  
  127. /*-hf-*/;
  128. int Diagram__SelectNewObject( int x, int y)
  129.  
  130. /*-hf-*/;
  131. void Diagram__RecalculateDepRect(int nID,char bRedraw )
  132. /*-hf-*/;
  133. void Diagram__MoveCellTo(int nID ,int x, int y )
  134.  
  135. /*-hf-*/;
  136. void Diagram__CutLineOnBorderOfCell( int nCell, POINT* dest, LINE* ln )
  137.  
  138. /*-hf-*/;
  139. void Diagram__ConnectDependent(unsigned nDependent, unsigned nCell )
  140. /*-hf-*/;
  141. int Diagram__CreateDependent(long nType)
  142. /*-hf-*/;
  143. void Diagram__WndProc( unsigned nMessage, long lParam, long wParam )
  144. /*-hf-*/;
  145. int Edit__SearchForNearestChar( int nIDEdit, POINT &pt )
  146.  
  147. /*-hf-*/;
  148. string Edit__GetVisibleText(unsigned nID )
  149. /*-hf-*/;
  150. int Edit__GetMaxVisibleTextWidth( unsigned hWnd )
  151. /*-hf-*/;
  152. void Edit__DrawText( unsigned hWnd )
  153.  
  154. /*-hf-*/;
  155. void Edit__WndProc( unsigned hWnd,unsigned nMessage, long lParam, long wParam )
  156. /*-hf-*/;
  157. void Edit__MoveCaretToPos(unsigned nID, int nPos )
  158.  
  159. /*-hf-*/;
  160. int ListBox__GetCurSel( unsigned hWnd )
  161. /*-hf-*/;
  162. void ListBox__DeleteAll(unsigned hWnd )
  163. /*-hf-*/;
  164. void ListBox__DrawItems( unsigned hWnd, int nToDraw )
  165. /*-hf-*/;
  166. string ListBox__GetItemText( unsigned hWnd, nID )
  167. /*-hf-*/;
  168. void ListBox__SetItemText(unsigned hWnd, int nID, string str )
  169. /*-hf-*/;
  170. int ListBox__AddItem(unsigned hWnd, int nID, string strText)
  171. /*-hf-*/;
  172. string AddDialog__CreateString()
  173. /*-hf-*/;
  174. string AddDialog__MakeParameterString( void )
  175. /*-hf-*/;
  176. void Dialog__WndProc(unsigned hWnd, unsigned nMessage, long lParam, long wParam )
  177. /*-hf-*/;
  178. void Button__SetCheckRange(int nPosStart,int nPosEnd,long dwFlags)
  179. /*-hf-*/;
  180. void Button__GetCheckRange(int nPosStart,int nPosEnd,long& dwFlags)
  181. /*-hf-*/;
  182. void Button__GetCheckEx( unsigned hWnd, long& dwState, long nType )
  183. /*-hf-*/;
  184. int Button__GetCheck( unsigned hWnd )
  185. /*-hf-*/;
  186. void Button__SetCheck(unsigned hWnd, long bCheck )
  187. /*-hf-*/;
  188. void WndProc(unsigned hWnd,unsigned nMessage, long lParam, long wParam)
  189. /*-hf-*/;
  190. void main( void )
  191. /*-hf)*/;
  192. ;-h---------------------------------------------------------------------------
  193. void ApplyLayout( void )
  194. -s--ApplyLayout                                                                 ■   4  -2 -25   3
  195. ApplyLayout
  196.     1!
  197. -o1----------------------SEZNAM OPERAC╓------------TENTO ⁿ╡DEK NEM╖NIT!-------
  198. 1
  199.   HideMouse();
  200.   GrNaƒtiPaletu("*\\design.pal");
  201.   MyτNastavRozsah(-10,-10,GrMaxX(),GrMaxY());
  202.   #ifdef _XP_THEME
  203.      FillSolidRect2(0,0,GrMaxX(),32,1);
  204.   #else
  205.      FillSolidRect2(0,0,GrMaxX(),32,0);
  206.   #endif
  207.   SetWindowRect2(2 /* IDC_DIAGRAM */,-2,30,GrMaxX()+2,GrMaxY()+2);
  208.   #ifdef _XP_THEME
  209.      GrNastavLinku(8|2,0xAAAA);
  210.      LineFromTo2(5,4,5,19,3);
  211.      GrNastavLinku(1|4);
  212.      LineFromTo2(0,30,GrMaxX(),30,0);
  213.      LineFromTo2(0,31,GrMaxX(),31,3);
  214.   #else
  215.      DrawEdge(GetWindowRect(2 /* IDC_DIAGRAM */),0x0001/*DES_CLIENT*/);
  216.      Draw3dRect2(4,4,6,21,5,3);
  217.   #endif
  218.  
  219.   SetWindowRect2(7/*IDC_COMBOBOX1*/,GrMaxX()-240,3,GrMaxX()-4,24);
  220.   SetWindowRect2(8/*IDC_LISTBOX1*/,GrMaxX()-240,25,GrMaxX()-4,193);
  221.  // SetWindowRect2(1 /* IDC_MENU */,9,3,239,22);
  222.   SendMessage(1 /* IDC_MENU */,8/*WM_PAINT*/ ,-2,-1);
  223.   Invalidate(2 /* IDC_DIAGRAM */);
  224.   Invalidate(7/*IDC_COMBOBOX1*/);
  225.   ShowMouse();
  226.  
  227. -c1----------------------SEZNAM PODM╓NEK-----------TENTO ⁿ╡DEK NEM╖NIT!-------
  228. =SP---------------------------------------------------------------------------
  229.  
  230. ;-h---------------------------------------------------------------------------
  231. void CommandProc( long lParam, long wParam )
  232. -s--CommandProc                                                                 ■   4  -2 -25   3
  233. CommandProc
  234.     1!
  235. -o1----------------------SEZNAM OPERAC╓------------TENTO ⁿ╡DEK NEM╖NIT!-------
  236. 1
  237.  
  238.    DIAGRAMCELL * pCell =Diagram__GetFocusCell();
  239.    long dwFlags=pCell->dwFlags;
  240.    int nBreakA = pCell->nBreakA;
  241.    int nBreakB = pCell->nBreakB;
  242.    long dw400 = dwFlags & 0x00000400L;
  243.    long dw800 = dwFlags & 0x00000800L;
  244.    long dw1000 = dwFlags & 0x00001000L;
  245.    string str;
  246.  
  247.                 if(lParam == 200/*ED_ENTER*/ && wParam == 6/*IDC_EDITPOPUP*/)SetFocus(2 /* IDC_DIAGRAM */);
  248.                  else if(lParam == 201/*LV_ITEMCLICK*/){
  249.                     switch(wParam){
  250.                       case 8/*IDC_LISTBOX1*/ :
  251.                           SetFocus(2 /* IDC_DIAGRAM */);
  252.                           long n=ListBox__GetCurSel(wParam);
  253.                           Diagram__SetInterFocus(n);
  254.                           Diagram__SetInterZOrder(n);
  255.                           break;
  256.                       case 21/*IDC_PARA_LIST*/:
  257.                           SendMessage(DESKTOP,9,200/*LV_SELCHANGE*/,wParam);
  258.                           string str = ListBox__GetItemText(21/*IDC_PARA_LIST*/,ListBox__GetCurSel(21/*IDC_PARA_LIST*/));
  259.                           AddDialog__AddParaByString(str);
  260.                           break;
  261.                    }
  262.                  }
  263.                  else if(lParam == 200/*LV_SELCHANGE*/){
  264.                    switch(wParam){
  265.                       case 21/*IDC_PARA_LIST*/:
  266.                           if(ListBox__GetCurSel(21/*IDC_PARA_LIST*/) != -1  && ListBox__GetSize(21) > 0){
  267.                                         EnableWindow(23/*IDC_PARA_DELETE*/,1);
  268.                                         EnableWindow(28/*IDC_PARA_UPDATE*/,1);
  269.                           }else{
  270.                                         EnableWindow(23/*IDC_PARA_DELETE*/,0);
  271.                                         EnableWindow(28/*IDC_PARA_UPDATE*/,0);
  272.                           };
  273.                           break;
  274.  
  275.  
  276.                    }
  277.  
  278.                  }
  279.                else
  280.                if(lParam == 1 /*BN_CLICK*/){
  281.                  if(wParam > 700 && wParam < 900){
  282.                     if(wParam >= 800){
  283.                     int nID = Diagram__CreateDependent(wParam-800);
  284.                     if(wParam == 816)// MESSAGE
  285.                     {
  286.                        Diagram__GetCell(nID)->dwFlags|= 0x00000400L;
  287.                        Diagram__SetInterFocus(nID);
  288.                        SendMessage(0,9,1,303);
  289.                     }
  290.                   }
  291.                     else{
  292.                         int idx;
  293.                         if(wParam != 705)
  294.                           idx=Diagram__CreateCell(0,0,wParam - 700);
  295.                         else idx=Diagram__CreateImageCell(0,0,"");
  296.                         Diagram__SetInterFocus(idx);
  297.                     }
  298.  
  299.                  }
  300.                  else
  301.                    switch(wParam){
  302.                     case 128:
  303.                        DestroyDialog();
  304.                        int i = 112;
  305.                        for(;i< 118;i++)
  306.                           m_strExInfo[i-112] = GetWindowText(i);
  307.                        break;
  308.                     case 207:
  309.                     case 205:
  310.                        HideMouse();
  311.                        int nMode = GrMód();
  312.                        MyτKonecObsluhy();
  313.                        P²epniNaText();
  314.                        DOSProve╘(ProgramCesta()+"\\designie.exe "+StrD¼íslo(wParam,-1,0));
  315.                        GrNastavMód(nMode);
  316.                        MyτZaƒátekObsluhy();
  317.                        ApplyLayout();
  318.                        break;
  319.                     case 206:
  320.                        ShowDialog(120);
  321.                        GrKresliP²edm╪ty(21001,1,GetWindowRect(120)->left+3,GetWindowRect(120)->top+24,11,9);
  322.                        break;
  323.                     case 40/*IDC_MSG_OK*/:
  324.                         DestroyDialog();
  325.                         pCell->ClassName = GetWindowText(42);
  326.                         if(Button__GetCheck(48) ){pCell->strExProperties = GetWindowText(45);}else {pCell->strExProperties="";}
  327.                         if(Button__GetCheck(43) &&Button__GetCheck(46)){pCell->strExStereotypes = GetWindowText(47);
  328.                         }
  329.                         else {pCell->strExStereotypes="";}
  330.                         Button__GetCheckRange(44,44,dwFlags);
  331.                         Button__GetCheckRange(48,49,dwFlags);
  332.                         pCell->dwFlags = dwFlags;
  333.                         RECT rx;
  334.                         CopyRect(&rx,&Diagram__GetFocusCell()->Rect);
  335.                         MakeMaximalRect(&rx,&Diagram__GetCell(nBreakA)->Rect);
  336.                         MakeMaximalRect(&rx,&Diagram__GetCell(nBreakB)->Rect);
  337.                         Diagram__RecalculateCellRect(nBreakA,0);
  338.                         Diagram__RecalculateCellRect(nBreakB,0);
  339.                         Diagram__RecalculateDepRect(m_nInterCellFocus,0);
  340.                         CopyRect(&MEMRECT,&rx);
  341.                        // MakeMaximalRect(&MEMRECT,&Diagram__GetCell(nBreakA)->Rect);
  342.                        // MakeMaximalRect(&MEMRECT,&Diagram__GetCell(nBreakB)->Rect);
  343.                         Diagram__InvalidateMemRect();
  344.                         break;
  345.                     case 303/*IDC_DEPENDENTSETTING*/:
  346.                         if(dwFlags & 16 /*MESSAGES*/){
  347.                             ResetControl(70);
  348.                             if(dw400)
  349.                                Button__SetCheck(44/*SYNCHRONMSG*/,1);
  350.                             else {Button__SetCheck(43/*ASCH*/,1);
  351.                                if(pCell->strExStereotypes != ""){
  352.                                Button__SetCheck(46/*PRIOBUTTON*/,1);SetWindowText(47/*MSGPRIO*/,pCell->strExStereotypes);}
  353.                             }
  354.                             Button__SetCheckRange(48,49,dwFlags);
  355.                             if(dw1000){SetWindowText(45,pCell->strExProperties);}
  356.                             SetWindowText(42/*IDC_MSG_TEXT*/,pCell->ClassName);
  357.                             ShowDialog(70/*IDC_DEPENDENTSETTING*/);
  358.                         }
  359.                         else if(dwFlags & 1){
  360.                          ResetControl(99);
  361.                          Button__SetCheckRange(86,89,dwFlags);
  362.                          Button__SetCheckRange(91,92,dwFlags);
  363.                          SetWindowText(118,pCell->ClassName);
  364.                          ShowDialog(99);
  365.  
  366.                         }
  367.                         else {
  368.                             ResetControl(90);
  369.                             str="???";
  370.                             if(nBreakA > -1)str=Diagram__GetCell(nBreakA)->ClassName;
  371.                             SetWindowText(69,"Prvek "+str);
  372.                             str="???";
  373.                             if(nBreakB > -1)str=Diagram__GetCell(nBreakB)->ClassName;
  374.                             SetWindowText(77,"Prvek "+str);
  375.                             SetWindowText(65,pCell->ClassName);
  376.                             Button__SetCheckRange(79,83,dwFlags);
  377.                             int nPos=0;
  378.                             for(;nPos < 4;nPos++)
  379.                               SetWindowText(71+nPos,((CLASSITEM*)pCell->pVariable)[nPos+1].strText);
  380.                             ShowDialog(90);
  381.                         }
  382.                         break;
  383.                     case 63:
  384.                          DestroyDialog();
  385.                          Button__GetCheckRange(79,83,pCell->dwFlags);
  386.                          pCell->ClassName = GetWindowText(65);
  387.                          int nPos=0;
  388.                          for(;nPos < 4;nPos++)
  389.                             ((CLASSITEM*)pCell->pVariable)[nPos+1].strText = GetWindowText(71+nPos);
  390.                          Diagram__RecalculateDepRect(m_nInterCellFocus,1);
  391.                          break;
  392.                     case 84:
  393.                          DestroyDialog();
  394.                          Button__GetCheckRange(86,89,dwFlags);
  395.                          Button__GetCheckRange(91,92,dwFlags);
  396.                          pCell->ClassName=GetWindowText(118);
  397.                          pCell->dwFlags = dwFlags;
  398.                          Diagram__RecalculateDepRect(m_nInterCellFocus,1);
  399.                          break;
  400.                     case 601/*IDC_EDIT_ITEM*/:
  401.                          Diagram__OnEditMember();
  402.                          break;
  403.                     case 604/*IDC_DELETE_ITEM*/:
  404.                          if(m_MOUSEOVER_PTY < 0){
  405.                              pCell->pVariable=tagClassItemDelete((CLASSITEM*)pCell->pVariable,pCell->nSizeVariable,-m_MOUSEOVER_PTY-1);
  406.                          }
  407.                          else {
  408.                              pCell->pOperation=tagClassItemDelete((CLASSITEM*)pCell->pOperation,pCell->nSizeOperation,m_MOUSEOVER_PTY-1);
  409.                          }
  410.                          Diagram__RecalculateCellRect(m_nInterCellFocus,1);
  411.                          break;
  412.                     case 600/*IDC_SETTING_CLASS*/:
  413.                          ResetControl(50);
  414.                          DIAGRAMCELL * xpCell = Diagram__GetFocusCell();
  415.                          SetWindowText(30/*IDC_SC_CLASSNAME*/,xpCell->ClassName);
  416.                          Button__SetCheckRange(35,39,xpCell->dwFlags);
  417.                          SetWindowText(33/*IDC_SC_ELSEPR*/,xpCell->strExProperties);
  418.                          SetWindowText(34/*IDC_SC_ELSEST*/,xpCell->strExStereotypes);
  419.                          ShowDialog(50/*IDC_CLASSSETTING */);
  420.                          break;
  421.                     case 22/*IDC_PARA_INSERT*/:
  422.                          ListBox__AddItem(21/*IDC_PARA_LIST*/,ListBox__GetSize(21/*IDC_PARA_LIST*/),AddDialog__MakeParameterString());
  423.                          Invalidate(21/*IDC_PARA_LIST*/);
  424.                          break;
  425.                     case 23/*IDC_PARA_DELETE*/:
  426.                          ListBox__DeleteItem(21/*IDC_PARA_LIST*/,ListBox__GetCurSel(21/*IDC_PARA_LIST*/));
  427.                          Invalidate(21/*IDC_PARA_LIST*/);
  428.                          break;
  429.                     case 28/*IDC_PARA_UPDATE*/:
  430.                          ListBox__SetItemText(21/*IDC_PARA_LIST*/,ListBox__GetCurSel(21/*IDC_PARA_LIST*/),AddDialog__MakeParameterString());
  431.                          Invalidate(21/*IDC_PARA_LIST*/);
  432.                          break;
  433.                     case 500/*IDC_VIEW_VESA1*/:
  434.                     case 501/*IDC_VIEW_VESA2*/ :
  435.                     case 502/*IDC_VIEW_VESA3*/ :
  436.                          HideMouse();
  437.                          GrNastavMód(wParam-497);
  438.                          ApplyLayout();
  439.                          ShowMouse();
  440.                          break;
  441.                     case 9/*IDC_INSERT*/:
  442.                          Diagram__OnInsert();
  443.                          break;
  444.                      case 31/*IDC_SC_OK*/:
  445.                          pCell->ClassName = GetWindowText(30/*IDC_SC_CLASSNAME*/);
  446.                          Button__GetCheckRange(35,39,dwFlags);
  447.                          pCell->strExProperties=GetWindowText(33/*IDC_SC_ELSEPR*/);
  448.                          pCell->strExStereotypes=GetWindowText(34/*IDC_SC_ELSEST*/);
  449.                          pCell->dwFlags = dwFlags;
  450.                          DestroyDialog();
  451.                          Diagram__RecalculateCellRect(m_nInterCellFocus,1);
  452.                          break;
  453.                     case 32/*IDC_SC_CANCEL*/:
  454.                          DestroyDialog();
  455.                          break;
  456.                     case 402/*IDC_INSERT_NEWOPERATION*/:
  457.                          ResetControl(10);
  458.                          SetWindowText(10 /*IDC_ADDINGDIALOG*/,"Vlo₧it operaci objektu");
  459.                          GetWindow(10 /*IDC_ADDINGDIALOG*/)->lParam = 1;
  460.                     case 403/*IDC_INSERT_NEWVARIABLE*/:
  461.                          if(wParam==403){
  462.                              ResetControl(10);
  463.                              SetWindowText(10 /*IDC_ADDINGDIALOG*/,"Vlo₧it atribut objektu");
  464.                              GetWindow(10 /*IDC_ADDINGDIALOG*/)->lParam = 2;
  465.                          }
  466.                          Diagram__AddSomething();
  467.                          break;
  468.                     case 301/*IDC_CELL_CLASSONLY*/:
  469.                     case 302/*IDC_CELL_CLASSFULL*/:
  470.                         if(wParam == 301/*IDC_CELL_CLASSONLY*/){pCell->nType = 1/*TYPE_CLASS_ONLY*/;}
  471.                         else {pCell->nType = 2/*TYPE_CLASS_FULL*/;}
  472.                         Diagram__RecalculateCellRect(m_nInterCellFocus,1);
  473.                         break;
  474.                     case 215/*IDC_EDIT_DOCKING_DEPENDENT*/:
  475.                          ResetControl(129);
  476.                          int ixx = 112;
  477.                          for(;ixx< 118;ixx++)
  478.                              SetWindowText(ixx,m_strExInfo[ixx-112]);
  479.  
  480.                          ShowDialog(129);
  481.                          break;
  482.                     case 401/*IDC_INSERT_DEPENDENT*/:
  483.                          SetCapture(2 /* IDC_DIAGRAM */);
  484.                          m_DIAGRAM_ADDINGDEPENDENT = 1;
  485.                          m_DIAGRAM_ADDINGDEPENDENT_USEMOVING =(m_DIAGRAM_DOCKING_DEPENDENT)?0:1;
  486.                          SetCursor((m_DIAGRAM_DOCKING_DEPENDENT)?115:116);
  487.                          m_LAST_POINTS.left=-1;
  488.                          m_DEPENDENT_FROM=m_nInterCellFocus;
  489.                          SetPoint(&m_DIAGRAM_DEPENDENT_FROM,m_DiagramCells[m_nInterCellFocus].Rect.left + (Diagram__MakeCellWidth(m_nInterCellFocus)/2),m_DiagramCells[m_nInterCellFocus].Rect.top + (Diagram__MakeCellHeight(m_nInterCellFocus)/2));
  490.                          Diagram__ClientToScreen(m_DIAGRAM_DEPENDENT_FROM.top);
  491.                          break;
  492.                     case 400/*IDC_INSERT_NEWOBJECT*/:
  493.                          LoadMenu(26,3);
  494.                          TrackPopUpMenu(MouseEvent.X,MouseEvent.Y);
  495.                          break;
  496.                     case 214/*IDC_EDIT_DELETEALL*/:
  497.                          if(m_nm_DiagramCellsSize <= 0)break;
  498.                          int ic;
  499.                          for(ic=0; ic < m_nm_DiagramCellsSize;ic++){
  500.                                  Diagram__DestroyCell(ic);
  501.  
  502.                          }
  503.                          m_nm_DiagramCellsSize=0;
  504.                          free(m_DiagramCells);
  505.                          free(m_DiagramZOrder);
  506.                          m_nInterCellFocus = -1;
  507.                          Invalidate(2 /* IDC_DIAGRAM */);
  508.                          break;
  509.                     case 212/*IDC_EDIT_PASTE*/: // insert cell from memory to diagram
  510.                          Diagram__WCPaste();
  511.                          break;
  512.                     case 210/*IDC_EDIT_CUT*/: // copy to memory and delete cell
  513.                          Diagram__WCCopy();
  514.                          Diagram__WCDelete();
  515.                          break;
  516.                     case 213/*IDC_EDIT_DELETE*/: // delete actually cell
  517.                          Diagram__WCDelete();
  518.                          break;
  519.                     case 211/*IDC_EDIT_COPY*/: //  copy actually cell to memory
  520.                          Diagram__WCCopy();
  521.                          break;
  522.                     case 300/*IDC_CELL_RENAME*/:
  523.                           int id = m_nInterCellFocus;
  524.                           RECT rc;
  525.                           CopyRect(&rc,&pCell->Rect);
  526.                           InflateRect(&rc,-4,-4,-4,0);
  527.                           rc.bottom=rc.top+26;
  528.                           Diagram__ClientToScreen2(rc);
  529.                           SetWindowRect2(6,rc.left,rc.top,rc.right,rc.bottom);
  530.                           SetWindowText(6,pCell->ClassName);
  531.                           GetWindow(6)->hFont = FONT_ARIAL_BOLD_10;
  532.                           ShowWindow(6,1);
  533.                           Invalidate(6);
  534.                           Edit__DrawText(6);
  535.                           SetFocus(6);
  536.                           break;
  537.                      case 200:   // new !
  538.                           strOpenFile="";
  539.                           int h=0;
  540.                           for(;h < 6;h++)m_strExInfo[h]="";
  541.                           SendMessage(0,9/*9*/,1,214);
  542.                           break;
  543.                      case 201/*IDC_FILE_EXIT*/:
  544.                           SendMessage(0,10/*WM_CLOSE*/,-1,-1);
  545.                           break;
  546.                      case 202/*IDC_FILE_OPEN*/:
  547.                           //strOpenFile="*\\test.umd";
  548.                           ResetControl(105);
  549.                           SetWindowText(103,ProgramCesta());
  550.                           ShowDialog(105);
  551.                           //
  552.                           break;
  553.                      case 101:
  554.                           DestroyDialog();
  555.                           strOpenFile = GetWindowText(103);
  556.                      case 208/*IDC_FILE_OPENING*/:
  557.                           if(m_nm_DiagramCellsSize > 0)SendMessage(0,9,1/*BN_CLICK*/,214/*IDC_EDIT_DELETEALL*/);
  558.                           long file = SouborOtev²i(strOpenFile,0x200|0x01);
  559.                           if(DOSChyba())break;
  560.                           m_DiagramCells=IO_READ(file,m_DiagramCells,&m_DiagramZOrder,m_nm_DiagramCellsSize);
  561.                           SouborZav²i(file);
  562.                           Invalidate(2 /* IDC_DIAGRAM */);
  563.                           break;
  564.                      case 106:
  565.                          DestroyDialog();
  566.                          strOpenFile = GetWindowText(109);
  567.                      case 204/*IDC_FILE_SAVE*/:
  568.                      case 203:
  569.                           if(( wParam != 106 && strOpenFile == "") || wParam == 203){
  570.                               ResetControl(110);
  571.                               SetWindowText(109,ProgramCesta());
  572.                               ShowDialog(110);
  573.                               break;
  574.                           }
  575.                           long fxile = SouborOtev²i(strOpenFile,0x200|0x02);
  576.                           IO_WRITE(fxile,m_DiagramCells,m_DiagramZOrder,m_nm_DiagramCellsSize);
  577.                           SouborZav²i(fxile);
  578.                           break;
  579.                      default:
  580.                         WndProc(0,9 /*9*/,lParam,wParam); // standartni odpoved pro nezpracovane zpravy
  581.                         break;
  582.  
  583.                   }
  584.                  }
  585.  
  586.  
  587.  
  588. -c1----------------------SEZNAM PODM╓NEK-----------TENTO ⁿ╡DEK NEM╖NIT!-------
  589. =SP---------------------------------------------------------------------------
  590.  
  591. ;-h---------------------------------------------------------------------------
  592. void MyWndProc(unsigned hWnd,unsigned nMessage, long lParam, long wParam)
  593. -s--MyWndProc                                                                   ■   4  -1 -27   3
  594. MyWndProc
  595.    1!
  596. -o1----------------------SEZNAM OPERAC╓------------TENTO ⁿ╡DEK NEM╖NIT!-------
  597. 1
  598.     switch(hWnd){
  599.         case 6/*IDC_EDITPOPUP*/:
  600.              if(nMessage == 12 /*WM_KILLFOCUS*/){
  601.                     WndProc(hWnd,nMessage,lParam,wParam);  // use default response and after them do some code ...
  602.                     DIAGRAMCELL *pcell = Diagram__GetFocusCell();
  603.                     pcell->ClassName=GetWindow(6/*IDC_EDITPOPUP*/)->szText;
  604.                     Diagram__SetMemRect(m_nInterCellFocus);
  605.                     if(pcell->nType == 5/*TYPE_CLASS_IMG*/){
  606.                         if(!SouborExistuje(pcell->ClassName))pcell->ClassName="*\\"+pcell->ClassName;
  607.                     }
  608.                     ShowWindow(6/*IDC_EDITPOPUP*/,0);
  609.                     Diagram__RecalculateCellRect(m_nInterCellFocus,1);
  610.                     Diagram__InvalidateMemRect();
  611.                    return;
  612.               }
  613.              break;
  614.         case 2 /* IDC_DIAGRAM */:
  615.              Diagram__WndProc(nMessage,lParam,wParam);
  616.              return;
  617.         case 0:
  618.            if(nMessage == 9 /*WM_COMMAND*/){
  619.                CommandProc(lParam,wParam);
  620.                return;
  621.            }
  622.     }
  623.     WndProc(hWnd,nMessage,lParam,wParam); // standartni odpoved pro nezpracovane zpravy
  624.  
  625. -c1----------------------SEZNAM PODM╓NEK-----------TENTO ⁿ╡DEK NEM╖NIT!-------
  626. =SP---------------------------------------------------------------------------
  627.  
  628. ;-h---------------------------------------------------------------------------
  629. void Diagram__DependentDelPointer(int nDep,int nIDCellFrom )
  630. -s--Diagram__DependentDelPointer                                                ■   4  -2 -18   3
  631. Diagram__DependentDelPointer
  632.             1!
  633. -o1----------------------SEZNAM OPERAC╓------------TENTO ⁿ╡DEK NEM╖NIT!-------
  634. 1
  635.    //
  636.    //   step 1. : search pointer array (pDependent) in GetCell(nIDCellFrom)
  637.    //   step 2. : delete item in array and realloc memory
  638.    //   step 3. : finish this function
  639.    //
  640.    if (nIDCellFrom < 0)return; //  error
  641.    if (nIDCellFrom >= m_nm_DiagramCellsSize)return; //  error
  642.  
  643.    DIAGRAMCELL * pCell = Diagram__GetCell(nIDCellFrom);
  644.    int nPos;
  645.    for(nPos = 0; nPos < pCell->nSizeDependents; nPos++){
  646.         if(pCell->pDependents[nPos]  == nDep){
  647.             // here is it :-)
  648.               pCell->pDependents=DependentItemDelete(pCell->pDependents,pCell->nSizeDependents,nPos);
  649.         }
  650.  
  651.    }
  652.  
  653.  
  654. -c1----------------------SEZNAM PODM╓NEK-----------TENTO ⁿ╡DEK NEM╖NIT!-------
  655. =SP---------------------------------------------------------------------------
  656.  
  657. ;-h---------------------------------------------------------------------------
  658. void Diagram__InvalidateMemRect(void)
  659. -s--Diagram__InvalidateMemRect                                                  ■   4  -2 -18   3
  660. Diagram__InvalidateMemRect
  661.            1!
  662. -o1----------------------SEZNAM OPERAC╓------------TENTO ⁿ╡DEK NEM╖NIT!-------
  663. 1
  664.   Diagram__OnDrawClipRect(MEMRECT.left,MEMRECT.top,MEMRECT.right,MEMRECT.bottom);
  665.  
  666. -c1----------------------SEZNAM PODM╓NEK-----------TENTO ⁿ╡DEK NEM╖NIT!-------
  667. =SP---------------------------------------------------------------------------
  668.  
  669. ;-h---------------------------------------------------------------------------
  670. void Diagram__SetMemRect( int nID )
  671. -s--Diagram__SetMemRect                                                         ■   4  -2 -22   3
  672. Diagram__SetMemRect
  673.         1!
  674. -o1----------------------SEZNAM OPERAC╓------------TENTO ⁿ╡DEK NEM╖NIT!-------
  675. 1
  676.     CopyRect(&MEMRECT,&Diagram__GetCell(nID)->Rect);
  677.  
  678. -c1----------------------SEZNAM PODM╓NEK-----------TENTO ⁿ╡DEK NEM╖NIT!-------
  679. =SP---------------------------------------------------------------------------
  680.  
  681. ;-h---------------------------------------------------------------------------
  682. void Diagram__DestroyCell( unsigned nID) // ONLY FOR DESTRUCT ELEMENT(not for FREE MEMORY)
  683. -s--Diagram__DestroyCell                                                        ■   4  -2 -21   3
  684. Diagram__DestroyCell
  685.         1!
  686. -o1----------------------SEZNAM OPERAC╓------------TENTO ⁿ╡DEK NEM╖NIT!-------
  687. 1
  688.  
  689.    // delete cell
  690.    DIAGRAMCELL * pCell=Diagram__GetCell(nID);
  691.    // destructor for cells (all)
  692.  
  693.    StrZruτ(pCell->ClassName);
  694.    StrZruτ(pCell->strExStereotypes);
  695.    StrZruτ(pCell->strExProperties);
  696.  
  697.    if(pCell->nSizeVariable != 0){
  698.         ClassItemInit(pCell->pVariable,pCell->nSizeVariable,0);
  699.    }
  700.    if(pCell->nSizeOperation != 0){
  701.         ClassItemInit(pCell->pOperation,pCell->nSizeOperation,0);
  702.    }
  703.  
  704.    if(pCell->nType == 4/*TYPE_CLASS_DEPENDENT*/){
  705.        // note:
  706.        // when aplication is calling this function for destruct dependents, its necessary
  707.        // to delete pointer to this dependents from all cells ... -> if we dont do this == BUG
  708.        //
  709.  
  710.        Diagram__DependentDelPointer(nID,pCell->nBreakA); // delete connection ID_1
  711.        Diagram__DependentDelPointer(nID,pCell->nBreakB); // delete connection ID_2
  712.  
  713.  
  714.    }
  715.    pCell->nSizeDependents = 0; // !!!
  716.    free(pCell->pDependents);  // free memory space for dependents array.
  717.  
  718.  
  719.  
  720.  
  721. -c1----------------------SEZNAM PODM╓NEK-----------TENTO ⁿ╡DEK NEM╖NIT!-------
  722. =SP---------------------------------------------------------------------------
  723.  
  724. ;-h---------------------------------------------------------------------------
  725. void Diagram__RecalculateCellRect( unsigned nID,char bRedraw)
  726. -s--Diagram__RecalculateCellRect                                                ■   4  -2 -17   3
  727. Diagram__RecalculateCellRect
  728.             1!
  729. -o1----------------------SEZNAM OPERAC╓------------TENTO ⁿ╡DEK NEM╖NIT!-------
  730. 1
  731.     // class size ...
  732.     RECT rx;
  733.     int nNewX=0,nNewY=0;
  734.     DIAGRAMCELL *pCell = Diagram__GetCell(nID);
  735.     if(bRedraw)CopyRect(&rx,&pCell->Rect);
  736.     if(pCell->nType != 5/*TYPE_CLASS_IMG*/){
  737.       Diagram__DrawCell(nID,0,nNewX,nNewY);
  738.     }
  739.     else {
  740.        TypBMPInfo typinfo;
  741.        if(GrNaƒtiBMPInfo(pCell->ClassName,typinfo)==0){
  742.           nNewX = typinfo.µí²ka+2;
  743.           nNewY = typinfo.V∞τka+2;
  744.           if(nNewX < 100)nNewX=100;
  745.           if(nNewY < 30)nNewY = 30;
  746.        }
  747.        else {
  748.           pCell->ClassName = "*\\designer.dir\\common\\bitmap\\error.bmp";
  749.           nNewX =155;
  750.           nNewY = 45;
  751.        }
  752.  
  753.  
  754.     }
  755.     pCell->Rect.right = pCell->Rect.left + nNewX;
  756.     pCell->Rect.bottom = pCell->Rect.top + nNewY;
  757.     if(bRedraw){
  758.         Diagram__MoveCellTo(nID,pCell->Rect.left,pCell->Rect.top);
  759.         CopyRect(&MEMRECT,&rx);
  760.         Diagram__InvalidateMemRect();
  761.     }
  762.  
  763. -c1----------------------SEZNAM PODM╓NEK-----------TENTO ⁿ╡DEK NEM╖NIT!-------
  764. =SP---------------------------------------------------------------------------
  765.  
  766. ;-h---------------------------------------------------------------------------
  767. int Diagram__CreateImageCell(int x, int y, string path )
  768. -s--Diagram__CreateImageCell                                                    ■   4  -2 -19   3
  769. Diagram__CreateImageCell
  770.           1!
  771. -o1----------------------SEZNAM OPERAC╓------------TENTO ⁿ╡DEK NEM╖NIT!-------
  772. 1
  773.    TypBMPInfo typinfo;
  774.    int nID = Diagram__CreateCell(x,y,5/*TYPE_CLASS_IMG*/);
  775.    DIAGRAMCELL * pCell= Diagram__GetCell(nID);
  776.  
  777.    if(path != "" && GrNaƒtiBMPInfo(path,typinfo)==0){
  778.        pCell->ClassName = path;
  779.    }
  780.    else {
  781.           pCell->ClassName = "*\\designer.dir\\common\\bitmap\\error.bmp";
  782.           typinfo.µí²ka =153;
  783.           typinfo.V∞τka = 43;
  784.    }
  785.   pCell->Rect.right = pCell->Rect.left+typinfo.µí²ka+2;
  786.   pCell->Rect.bottom = pCell->Rect.top+typinfo.V∞τka+2;
  787.   Diagram__SetInterZOrder(nID);
  788.   return nID;
  789.  
  790.  
  791. -c1----------------------SEZNAM PODM╓NEK-----------TENTO ⁿ╡DEK NEM╖NIT!-------
  792. =SP---------------------------------------------------------------------------
  793.  
  794. ;-h---------------------------------------------------------------------------
  795. unsigned Diagram__CreateCell(int x, int y, unsigned nType )
  796. -s--Diagram__CreateCell                                                         ■   4  -2 -22   3
  797. Diagram__CreateCell
  798.         1!
  799. -o1----------------------SEZNAM OPERAC╓------------TENTO ⁿ╡DEK NEM╖NIT!-------
  800.  
  801. 1 ; create new cell
  802.   if(m_nm_DiagramCellsSize ==0){
  803.        m_DiagramCells = (DIAGRAMCELL*)malloc(sizeof(DIAGRAMCELL));
  804.        m_DiagramZOrder = (int*)malloc(sizeof(int));
  805.  
  806.   }
  807.   m_DiagramCells = (DIAGRAMCELL*)realloc(m_DiagramCells,sizeof(DIAGRAMCELL)*(m_nm_DiagramCellsSize+1));
  808.   m_DiagramZOrder = (int*)realloc(m_DiagramZOrder,sizeof(int)*(m_nm_DiagramCellsSize+1));
  809.   InitCell(&m_DiagramCells[m_nm_DiagramCellsSize]);
  810.   m_nm_DiagramCellsSize++;
  811.   DIAGRAMCELL* pCell = &m_DiagramCells[m_nm_DiagramCellsSize-1];
  812.   pCell->nType = nType;
  813.   SetRect(&pCell->Rect,x,y,x+120,y+38);
  814.   pCell->ClassName = StrD¼íslo(m_nm_DiagramCellsSize,-1,0);
  815.   switch(nType){
  816.      case 3/*TYPE_CLASS_OBJECT*/:
  817.         pCell->ClassName = "Objekt_"+pCell->ClassName;
  818.         break;
  819.      case 4/*TYPE_CLASS_DEPENDENT*/ :
  820.         pCell->ClassName = "Zßvislost_"+pCell->ClassName;
  821.         break;
  822.      default:
  823.         pCell->ClassName = "Class_"+pCell->ClassName;
  824.         break;
  825.   }
  826.   int retvalue = m_nm_DiagramCellsSize-1;
  827.  
  828.  
  829.   Diagram__SetInterZOrder(retvalue);
  830.  
  831.   return retvalue;
  832. -c1----------------------SEZNAM PODM╓NEK-----------TENTO ⁿ╡DEK NEM╖NIT!-------
  833. =SP---------------------------------------------------------------------------
  834. ;-h---------------------------------------------------------------------------
  835. void Diagram__AddSomething()
  836. -s--Diagram__AddSomething                                                       ■   4  -2 -21   3
  837. Diagram__AddSomething
  838.          1!
  839. -o1----------------------SEZNAM OPERAC╓------------TENTO ⁿ╡DEK NEM╖NIT!-------
  840. 1
  841.  
  842.    int i;
  843.    i =GetWindow(10 /* IDC_ADDINGDIALOG */)->lParam;
  844.    if(abs(i)==2){
  845.       int x;
  846.       for(x=19;x < 62;x++){if(x==26)x++;if(x==29)x=60;
  847.           EnableWindow(x,0);
  848.       }
  849.    }
  850.    EnableWindow(23 /* IDC_PARA_DELETE*/,0);
  851.    EnableWindow(28 /* IDC_PARA_UPDATE */,0);
  852.    string strText;
  853.    if(i < 0)
  854.                 strText = "Upravit ";
  855.  
  856.    else
  857.                 strText = "Vlo₧it ";
  858.    if(abs(i) == 1){
  859.        strText+= "operaci objektu";
  860.        EnableWindow(18/*IDC_TYPE_CONSTANT*/,0);
  861.        EnableWindow(17/*IDC_TYPE_DELIVER*/,0);
  862.    }
  863.    else{
  864.        strText += "atribut objektu";
  865.        EnableWindow(16/*IDC_TYPE_ABSTRACT*/,0);
  866.    }
  867.    SetWindowText(10 /* IDC_ADDINGDIALOG */,strText);
  868.    if(i > 0)ListBox__DeleteAll(21/*IDC_PARA_LIST*/);
  869.    ShowDialog(10 /*IDC_ADDINGDIALOG*/);
  870. -c1----------------------SEZNAM PODM╓NEK-----------TENTO ⁿ╡DEK NEM╖NIT!-------
  871. =SP---------------------------------------------------------------------------
  872.  
  873. ;-h---------------------------------------------------------------------------
  874. int Diagram__AddOperation(unsigned nID, string str, unsigned nState )
  875. -s--Diagram__AddOperation                                                       ■   4  -2 -21   3
  876. Diagram__AddOperation
  877.          1!
  878. -o1----------------------SEZNAM OPERAC╓------------TENTO ⁿ╡DEK NEM╖NIT!-------
  879. 1
  880.   DIAGRAMCELL * pCell=Diagram__GetCell(nID);
  881.   pCell->pOperation=ClassItemInit(pCell->pOperation,pCell->nSizeOperation,pCell->nSizeOperation+1);
  882.   CLASSITEM* pItem = &(((CLASSITEM*)(pCell->pOperation))[pCell->nSizeOperation-1]);
  883.   pItem->strText =str;
  884.   pItem->nType =nState;
  885.   return Diagram__GetCell(nID)->nSizeOperation;
  886. -c1----------------------SEZNAM PODM╓NEK-----------TENTO ⁿ╡DEK NEM╖NIT!-------
  887. =SP---------------------------------------------------------------------------
  888.  
  889. ;-h---------------------------------------------------------------------------
  890. int Diagram__AddVariable( unsigned nID, string str, unsigned nState )
  891. -s--Diagram__AddVariable                                                        ■   4  -2 -21   3
  892. Diagram__AddVariable
  893.         1!
  894. -o1----------------------SEZNAM OPERAC╓------------TENTO ⁿ╡DEK NEM╖NIT!-------
  895. 1
  896.   DIAGRAMCELL * pCell=Diagram__GetCell(nID);
  897.   pCell->pVariable=ClassItemInit(pCell->pVariable,pCell->nSizeVariable,pCell->nSizeVariable+1);
  898.   CLASSITEM* pItem = &(((CLASSITEM*)(pCell->pVariable))[pCell->nSizeVariable-1]);
  899.   pItem->strText =str;
  900.   pItem->nType =nState;
  901.   return Diagram__GetCell(nID)->nSizeVariable ;
  902. -c1----------------------SEZNAM PODM╓NEK-----------TENTO ⁿ╡DEK NEM╖NIT!-------
  903. =SP---------------------------------------------------------------------------
  904.  
  905. ;-h---------------------------------------------------------------------------
  906. DIAGRAMCELL* Diagram__GetFocusCell( void )
  907. -s--Diagram__GetFocusCell                                                       ■   4  -2 -21   3
  908. Diagram__GetFocusCell
  909.          1!
  910. -o1----------------------SEZNAM OPERAC╓------------TENTO ⁿ╡DEK NEM╖NIT!-------
  911. 1 return Diagram__GetCell(m_nInterCellFocus);
  912. -c1----------------------SEZNAM PODM╓NEK-----------TENTO ⁿ╡DEK NEM╖NIT!-------
  913. =SP---------------------------------------------------------------------------
  914.  
  915. ;-h---------------------------------------------------------------------------
  916. void Diagram__OnEditMember( void )
  917. -s--Diagram__OnEditMember                                                       ■   4  -2 -21   3
  918. Diagram__OnEditMember
  919.          1!
  920. -o1----------------------SEZNAM OPERAC╓------------TENTO ⁿ╡DEK NEM╖NIT!-------
  921. 1
  922.    DIAGRAMCELL *pCell=Diagram__GetFocusCell();
  923.    ResetControl(10);
  924.    if(m_MOUSEOVER_PTY > 0){
  925.       GetWindow(10 /*IDC_ADDINGDIALOG*/)->lParam = -1;
  926.       AddDialog__ParserString(((CLASSITEM*)pCell->pOperation)[m_MOUSEOVER_PTY-1].strText);
  927.       Button__SetCheckRange(13,18,((CLASSITEM*)pCell->pOperation)[m_MOUSEOVER_PTY-1].nType);
  928.    }
  929.    else {
  930.       GetWindow(10 /*IDC_ADDINGDIALOG*/)->lParam = -2;
  931.       AddDialog__ParserString(((CLASSITEM*)pCell->pVariable)[-m_MOUSEOVER_PTY-1].strText);
  932.       Button__SetCheckRange(13,18,((CLASSITEM*)pCell->pVariable)[-m_MOUSEOVER_PTY-1].nType);
  933.    }
  934.  
  935.    Diagram__AddSomething();
  936.  
  937.  
  938. -c1----------------------SEZNAM PODM╓NEK-----------TENTO ⁿ╡DEK NEM╖NIT!-------
  939.  
  940. =SP---------------------------------------------------------------------------
  941.  
  942. ;-h---------------------------------------------------------------------------
  943. void Diagram__OnDrawClipRect( int x,int y, int x2, int y2 )
  944.  
  945. -s--Diagram__OnDrawClipRect                                                     ■  10  -2 -14   3
  946.             __________Diagram__OnDrawClipRect__________
  947. Draw~background~and~client Draw~cells,idicators   ShowCursor
  948.            edge                   cells        :ShowMouse();
  949.            1!                      2!
  950. -o1----------------------SEZNAM OPERAC╓------------TENTO ⁿ╡DEK NEM╖NIT!-------
  951. 1 ; draw background and client edge !
  952.     HideMouse();
  953.     if(y < 0)y=0;
  954.     FillSolidRect2(x,32+y,x2,32+y2,5);
  955.  
  956. 2 ; draw cell
  957.    int i;
  958.    RECT intersect;
  959.    SetRect(&intersect,x,y,x2,y2);
  960.    // optimaliz
  961.  /*
  962.    int* pPos=m_DiagramZOrder; // faster
  963.    for(i =m_nm_DiagramCellsSize-1;i >= 0  ;i--,pPos++){
  964.        // drawing speed is optimized  ... (program will draw only object which actually need redrawing !)
  965.        if(IntersectRect(&intersect,&m_DiagramCells[*pPos].Rect)){
  966.           Diagram__DrawCellEx(*pPos);
  967.        }
  968.    }
  969.  */
  970.  
  971.    for(i =m_nm_DiagramCellsSize-1;i >= 0  ;i--){
  972.        // drawing speed is optimized  ... (program will draw only object which actually need redrawing !)
  973.        if(IntersectRect(&intersect,&m_DiagramCells[m_DiagramZOrder[i]].Rect)){
  974.     //      GrNastavPozici(0,0);
  975.     //      GrNastavBarvuPop²edí(2);
  976.     //      GrPiτD¼íslo(m_DiagramZOrder[i],-1,2);
  977.     //      VyprázdniFrontuKláves();
  978.     //      ¼ekej(0x8001);
  979.  
  980.           Diagram__DrawCellEx(m_DiagramZOrder[i]);
  981.        }
  982.    }
  983.  
  984. -c1----------------------SEZNAM PODM╓NEK-----------TENTO ⁿ╡DEK NEM╖NIT!-------
  985. =SP---------------------------------------------------------------------------
  986.  
  987. ;-h---------------------------------------------------------------------------
  988. char Diagram__OverIDObject(int nID, int x, int y )
  989. -s--Diagram__OverIDObject                                                       ■   4  -2 -21   3
  990. Diagram__OverIDObject
  991.          1!
  992. -o1----------------------SEZNAM OPERAC╓------------TENTO ⁿ╡DEK NEM╖NIT!-------
  993. 1
  994.      RECT rc;
  995.      DIAGRAMCELL * pCell = Diagram__GetCell(nID);
  996.      CopyRect(&rc,&pCell->Rect);
  997.      Diagram__ScreenToClient(y);
  998.      if(PtInRect(x,y,&rc)){
  999.           switch(pCell->nType){
  1000.                case 1/*TYPE_CLASS_ONLY*/:
  1001.                case 2/*TYPE_CLASS_FULL*/:
  1002.                case 3/*TYPE_CLASS_OBJECT*/:
  1003.                case 5/*TYPE_CLASS_IMG*/:
  1004.                     return 1;
  1005.                case 4/*TYPE_CLASS_DEPENDENT*/:
  1006.                    // now, we must check if is really user clicked on this cell,
  1007.                    // because this type is nonrectangle object !
  1008.                    // step 1. : cover line by 5px
  1009.                    // step 2. : test if point[x,y] is inside line(covered by 5px);
  1010.                    // more in CoverLine documents.
  1011.                    int n;
  1012.                    RECT mem;
  1013.                    for(n=0;n  < pCell->nSizeVariable; n++){
  1014.                        CopyRect(&mem,&((CLASSITEM*)(pCell->pVariable))[n].nRectType);
  1015.                        NormalizeRect(&mem);
  1016.                        Diagram__ScreenToClient2(mem);
  1017.                        if(PtInRect(x,y,&mem)){
  1018.                        return 1;}
  1019.                    }
  1020.                    POINT pt[6];
  1021.                    CoverLine(&pCell->PT,pt,8);
  1022.                    if(PtInRGN(x,y,pt,6))
  1023.                         return 1;
  1024.  
  1025.           }
  1026.      }
  1027.  
  1028.     return 0;
  1029.  
  1030.  
  1031. -c1----------------------SEZNAM PODM╓NEK-----------TENTO ⁿ╡DEK NEM╖NIT!-------
  1032. =SP---------------------------------------------------------------------------
  1033.  
  1034. ;-h---------------------------------------------------------------------------
  1035. int Diagram__OverObject( int x, int y )
  1036.  
  1037. -s--Diagram__OverObject                                                         ■   4  -2 -22   3
  1038. Diagram__OverObject
  1039.         1!
  1040. -o1----------------------SEZNAM OPERAC╓------------TENTO ⁿ╡DEK NEM╖NIT!-------
  1041. 1
  1042.    int i;
  1043.  
  1044.    for(i = 0; i < m_nm_DiagramCellsSize; i++){
  1045.      if(Diagram__OverIDObject(m_DiagramZOrder[i],x,y)==1)return m_DiagramZOrder[i];
  1046.  
  1047.  
  1048.    }
  1049.    return -1;
  1050.  
  1051.  
  1052. -c1----------------------SEZNAM PODM╓NEK-----------TENTO ⁿ╡DEK NEM╖NIT!-------
  1053. =SP---------------------------------------------------------------------------
  1054.  
  1055. ;-h---------------------------------------------------------------------------
  1056. int Diagram__SelectNewObject( int x, int y)
  1057.  
  1058. -s--Diagram__SelectNewObject                                                    ■   4  -2 -19   3
  1059. Diagram__SelectNewObject
  1060.           1!
  1061. -o1----------------------SEZNAM OPERAC╓------------TENTO ⁿ╡DEK NEM╖NIT!-------
  1062. 1 ; search array with cells. If some cell will be in area of POINT[x,y], check zOrder and select it...
  1063.    int i=Diagram__OverObject(x,y);
  1064.    if(i != -1){
  1065.          Diagram__SetInterFocus(i);
  1066.          Diagram__SetInterZOrder(i);
  1067.          return m_DiagramZOrder[0];
  1068.    }
  1069.    Diagram__SetInterFocus(-1);
  1070.    return -1;
  1071. -c1----------------------SEZNAM PODM╓NEK-----------TENTO ⁿ╡DEK NEM╖NIT!-------
  1072. =SP---------------------------------------------------------------------------
  1073.  
  1074. ;-h---------------------------------------------------------------------------
  1075. void Diagram__RecalculateDepRect(int nID,char bRedraw )
  1076. -s--Diagram__RecalculateDepRect                                                 ■   2  -2 -18   3
  1077. Diagram__RecalculateDepRect
  1078.             1!
  1079. -o1----------------------SEZNAM OPERAC╓------------TENTO ⁿ╡DEK NEM╖NIT!-------
  1080. 1
  1081.   Diagram__SetMemRect(nID);
  1082.   DIAGRAMCELL * pDep = Diagram__GetCell(nID);
  1083.   RECT* Rect =&pDep->Rect;
  1084.   CopyRect(Rect,&pDep->PT);
  1085.   if(bRedraw)
  1086.   NormalizeRect(Rect);
  1087.   POINT pt[6];
  1088.   CoverLine(&pDep->PT,pt,16);
  1089.   int n;
  1090.   for(n=1;n  < 6; n++){if(n==3)n++;
  1091.     MakeMaximalRect2(Rect,pt[n].left,pt[n].top);
  1092.   }
  1093.   // calculate rect ...
  1094.   RECT PT; CopyRect(&PT,&pDep->PT);Diagram__ClientToScreen2(PT);
  1095.   for(n=0;n  < pDep->nSizeVariable; n++){SetRect(&((CLASSITEM*)(pDep->pVariable))[n].nRectType,PT.left,PT.top,PT.left,PT.top);}
  1096.   Diagram__DrawDependent(PT.left,PT.top,PT.right,PT.bottom,2,pDep->dwFlags,nID);
  1097.   Diagram__ClientToScreen2(*Rect);
  1098.   for(n=0;n  < pDep->nSizeVariable; n++){
  1099.      MakeMaximalRect(Rect,&((CLASSITEM*)(pDep->pVariable))[n].nRectType);
  1100.   }
  1101.   Diagram__ScreenToClient2(*Rect);
  1102.   if(bRedraw){
  1103.     Diagram__InvalidateMemRect();
  1104.   }
  1105. -c1----------------------SEZNAM PODM╓NEK-----------TENTO ⁿ╡DEK NEM╖NIT!-------
  1106. =SP---------------------------------------------------------------------------
  1107.  
  1108. ;-h---------------------------------------------------------------------------
  1109. void Diagram__MoveCellTo(int nID ,int x, int y )
  1110.  
  1111. -s--Diagram__MoveCellTo                                                         ■   4  -2 -22   3
  1112. Diagram__MoveCellTo
  1113.         1!
  1114. -o1----------------------SEZNAM OPERAC╓------------TENTO ⁿ╡DEK NEM╖NIT!-------
  1115. 1 ; moving by ...
  1116.    RECT last;
  1117.    DIAGRAMCELL *pDep,* pCell = Diagram__GetCell(nID);
  1118.    CopyRect(&last,&pCell->Rect);
  1119.    SetRect(&pCell->Rect,x,y,Diagram__MakeCellWidth(nID)+x,Diagram__MakeCellHeight(nID)+y);
  1120.    // move dependents
  1121.    if(pCell->nSizeDependents > 0){
  1122.         POINT dest;
  1123.         LINE ln;
  1124.         int n;
  1125.         RECT PT;
  1126.         for(n=0;n < pCell->nSizeDependents;n++){
  1127.              pDep =Diagram__GetCell(pCell->pDependents[n]);
  1128.              int nSecond;
  1129.              RECT* rc=&pDep->Rect;
  1130.              MakeMaximalRect(&last,rc);
  1131.              if(pDep->nBreakA == nID){
  1132.                 Diagram__GetCenterCell(nID,ln.x,ln.y);
  1133.                 if(pDep->nBreakB >= 0){
  1134.                     Diagram__GetCenterCell(pDep->nBreakB,ln.x2,ln.y2);
  1135.                 }
  1136.                 else {ln.x2 = pDep->PT.right;ln.y2 = pDep->PT.bottom;}
  1137.                 nSecond = pDep->nBreakB;
  1138.  
  1139.              }
  1140.              else{
  1141.                 if(pDep->nBreakA >= 0){
  1142.                 Diagram__GetCenterCell(pDep->nBreakA,ln.x,ln.y);}
  1143.                 else {ln.x = pDep->PT.left;ln.y = pDep->PT.top;}
  1144.                 Diagram__GetCenterCell(nID,ln.x2,ln.y2);
  1145.  
  1146.                 nSecond = pDep->nBreakA;
  1147.  
  1148.              }
  1149.              Diagram__ClientToScreen2(*((RECT*)(&ln)));
  1150.              Diagram__CutLineOnBorderOfCell(nID,&dest,&ln);
  1151.              RECT end;
  1152.              if(dest.left < 0 || dest.top < 0){
  1153.                 SetRect(&end,ln.x,ln.y,ln.x2,ln.y2);
  1154.  
  1155.              }
  1156.              else {
  1157.                  end.left=dest.left;
  1158.                  end.top=dest.top;
  1159.                  if(nSecond >= 0){
  1160.                      Diagram__CutLineOnBorderOfCell(nSecond,&dest,&ln);
  1161.                      end.right=dest.left;
  1162.                      end.bottom=dest.top;
  1163.                      if(dest.left < 0 || dest.top < 0){
  1164.                          SetRect(&end,ln.x,ln.y,ln.x2,ln.y2);
  1165.                      }
  1166.  
  1167.                  }
  1168.              }
  1169.              Diagram__ScreenToClient2(end);
  1170.  
  1171.              if(nSecond < 0)  {
  1172.                CopyRect(&PT,&pDep->PT);
  1173.                if(pDep->nBreakA == nID){
  1174.                    end.right = PT.right;end.bottom = PT.bottom;
  1175.                }
  1176.                else{
  1177.                    end.right = PT.left;end.bottom = PT.top;
  1178.  
  1179.                }
  1180.  
  1181.              }
  1182.  
  1183.              if(pDep->nBreakA == nID)
  1184.                 SetRect(&pDep->PT,end.left,end.top,end.right,end.bottom);
  1185.              else {
  1186.                 SetRect(&pDep->PT,end.right,end.bottom,end.left,end.top);
  1187.              }
  1188.  
  1189.              Diagram__RecalculateDepRect(pCell->pDependents[n],0);
  1190.              MakeMaximalRect(&last,rc);
  1191.  
  1192.  
  1193.  
  1194.         }
  1195.    }
  1196.    // invalidate !
  1197.    Diagram__OnDrawClipRect(last.left,last.top,last.right,last.bottom);
  1198.    // optimal.. : sometimes when user move cell is interselection of old client rectagle and new client rectagle and this case is catched by DIA_DRAWCLIPRECT
  1199.    if(!IntersectRect(&last,&pCell->Rect))SendMessage(2 /* IDC_DIAGRAM */,100/*DIA_PAINTOBJECT*/,nID,-1);
  1200. -c1----------------------SEZNAM PODM╓NEK-----------TENTO ⁿ╡DEK NEM╖NIT!-------
  1201. =SP---------------------------------------------------------------------------
  1202.  
  1203. ;-h---------------------------------------------------------------------------
  1204. void Diagram__CutLineOnBorderOfCell( int nCell, POINT* dest, LINE* ln )
  1205.  
  1206. -s--Diagram__CutLineOnBorderOfCell                                              ■   4  -2 -16   3
  1207. Diagram__CutLineOnBorderOfCell
  1208.              1!
  1209. -o1----------------------SEZNAM OPERAC╓------------TENTO ⁿ╡DEK NEM╖NIT!-------
  1210. 1
  1211.     // developing time : 10h:24m
  1212.       POINT pt[4];
  1213.       RECT * Rect = &Diagram__GetCell(nCell)->Rect;
  1214.       SetPoint(dest,-1,-1);
  1215.       SetPoint(&pt[0],Rect->left,Rect->top);
  1216.       SetPoint(&pt[2],Rect->right,Rect->bottom);
  1217.       Diagram__ClientToScreen(pt[0].top);
  1218.       Diagram__ClientToScreen(pt[2].top);
  1219.       SetPoint(&pt[1],pt[2].left,pt[0].top);
  1220.       SetPoint(&pt[3],pt[0].left,pt[2].top);
  1221.       RGNLineIntersect(ln,pt,4,dest);
  1222.  
  1223. -c1----------------------SEZNAM PODM╓NEK-----------TENTO ⁿ╡DEK NEM╖NIT!-------
  1224. =SP---------------------------------------------------------------------------
  1225.  
  1226. ;-h---------------------------------------------------------------------------
  1227. void Diagram__ConnectDependent(unsigned nDependent, unsigned nCell )
  1228. -s--Diagram__ConnectDependent                                                   ■   4  -2 -19   3
  1229. Diagram__ConnectDependent
  1230.            1!
  1231. -o1----------------------SEZNAM OPERAC╓------------TENTO ⁿ╡DEK NEM╖NIT!-------
  1232. 1
  1233.   DIAGRAMCELL * ConnectTo = Diagram__GetCell(nCell);
  1234.   ConnectTo->pDependents=DependentItemInit(ConnectTo->pDependents,ConnectTo->nSizeDependents,ConnectTo->nSizeDependents+1);
  1235.   ConnectTo->pDependents[ConnectTo->nSizeDependents-1] = nDependent;
  1236.  
  1237. -c1----------------------SEZNAM PODM╓NEK-----------TENTO ⁿ╡DEK NEM╖NIT!-------
  1238. =SP---------------------------------------------------------------------------
  1239.  
  1240. ;-h---------------------------------------------------------------------------
  1241. int Diagram__CreateDependent(long nType)
  1242. -s--Diagram__CreateDependent                                                    ■   4  -2 -19   3
  1243. Diagram__CreateDependent
  1244.           1!
  1245. -o1----------------------SEZNAM OPERAC╓------------TENTO ⁿ╡DEK NEM╖NIT!-------
  1246. 1  unsigned nID = Diagram__CreateCell(0,0,4/*TYPE_CLASS_DEPENDENT*/);
  1247.    DIAGRAMCELL * pCell = Diagram__GetCell(nID);
  1248.    Diagram__AddVariable(nID,"",0x0000); // FOR VCENTER|CENTER CELL  // dependents pos
  1249.    if(nType > 1 && nType < 16){
  1250.       int p;
  1251.       for(p=1;p < 5;p++){
  1252.          Diagram__AddVariable(nID,"",((p > 2)?16:0)+p%2);
  1253.       }
  1254.    }
  1255.    if(nType == 16){
  1256.       Diagram__AddVariable(nID,"",0x0000); // FOR VCENTER|CENTER CELL  // dependents pos2 (extra info)
  1257.       Diagram__AddVariable(nID,"",0x0001); // FOR VCENTER|CENTER CELL  // dependents pos2 (extra info)
  1258.    }
  1259.    CopyRect(&pCell->Rect,&m_LAST_POINTS);
  1260.    NormalizeRect(&pCell->Rect);
  1261.    pCell->dwFlags = nType;
  1262.  
  1263.    // create ReGiN for arrow and line.
  1264.    CopyRect(&pCell->PT,&m_LAST_POINTS);
  1265.    Diagram__ScreenToClient2(pCell->PT);
  1266.    Diagram__ScreenToClient2(pCell->Rect);
  1267.  
  1268.   Diagram__ConnectDependent(nID,m_DEPENDENT_FROM);
  1269.   if(m_DEPENDENT_TO != -1) Diagram__ConnectDependent(nID,m_DEPENDENT_TO);
  1270.  
  1271.   pCell->nBreakA = m_DEPENDENT_FROM;
  1272.   pCell->nBreakB = m_DEPENDENT_TO;
  1273.  
  1274.   // 0x0001 FOR VCENTER|CENTER CELL (over line)
  1275.   // 0x0002 FOR DEPENDENT CELL (for example cell which recieve message)
  1276.   // 0x0004 TOPSIDE // always top
  1277.   // 0x0008 BOTTOMSIDE // always bottom
  1278.   // 0x0010 TOPTOPSIDE //
  1279.   Diagram__MoveCellTo(m_DEPENDENT_FROM,Diagram__GetCell(m_DEPENDENT_FROM)->Rect.left,Diagram__GetCell(m_DEPENDENT_FROM)->Rect.top);
  1280.   Diagram__SetInterZOrder(nID);
  1281.   return nID;
  1282. -c1----------------------SEZNAM PODM╓NEK-----------TENTO ⁿ╡DEK NEM╖NIT!-------
  1283. =SP---------------------------------------------------------------------------
  1284.  
  1285. ;-h---------------------------------------------------------------------------
  1286. void Diagram__WndProc( unsigned nMessage, long lParam, long wParam )
  1287. -s--Diagram__WndProc                                                            ■   4  -2 -23   3
  1288. Diagram__WndProc
  1289.       1!
  1290. -o1----------------------SEZNAM OPERAC╓------------TENTO ⁿ╡DEK NEM╖NIT!-------
  1291. 1
  1292.                 
  1293.  DIAGRAMCELL * pCell =Diagram__GetFocusCell();
  1294.  switch(nMessage){
  1295.                case 14 /* WM_CHAR*/:
  1296.                     if(lParam == 0x5300/*KlDel*/){
  1297.                        if(m_nInterCellFocus != -1)Diagram__WCDelete();
  1298.                     }
  1299.                     break;
  1300.                case 1/*WM_LBUTTONDOWN*/:
  1301.                     if(m_DIAGRAM_ADDINGDEPENDENT == 1){
  1302.                        break;
  1303.                     }
  1304.                    SetCapture(2 /* IDC_DIAGRAM */);
  1305.                     m_bDiaStartDraging = 1;
  1306.                     m_bDiaDraging = 1;
  1307.                     if(Diagram__SelectNewObject(MouseEvent.X,MouseEvent.Y) != -1  && Diagram__GetFocusCell()->nType != 4/*TYPE_CLASS_DEPENDENT*/){
  1308.                          // AnimP²edm╪tZruτ(MouseObject);
  1309.                          // MouseObject=AnimP²edm╪tVytvo²(130,1,0,1);
  1310.                          // SetPoint(&MOUSEOFFSET,8,8);
  1311.                                                   SetCursor(130);
  1312.                           m_LastEvent.x = -1;m_LastEvent.y=-1;
  1313.                           m_StartDrag.x = MouseEvent.X;m_StartDrag.y=MouseEvent.Y;
  1314.                           pCell = Diagram__GetFocusCell();
  1315.                           SetPoint(&m_DiaIncrease,MouseEvent.X-pCell->Rect.left,MouseEvent.Y-pCell->Rect.top-31);
  1316.  
  1317.  
  1318.                     }
  1319.                     break;
  1320.                case 7/*WM_LBUTTONUP*/:
  1321.                     if(m_DIAGRAM_ADDINGDEPENDENT == 1){
  1322.                        Diagram__HideAddingDependent();
  1323.                       if(MouseEvent.Y > 32 && m_DEPENDENT_TO != m_DEPENDENT_FROM  ){ LoadMenu(29,5);
  1324.                        TrackPopUpMenu(MouseEvent.X,MouseEvent.Y);}
  1325.                        break;
  1326.                     }
  1327.                     SetCursor(85);
  1328.                     if(m_bDiaDraging == 0)break;
  1329.                     ReleaseCapture();
  1330.                     m_bDiaDraging = 0;
  1331.                     int x,y;
  1332.                     if(m_bDiaStartDraging != 1){
  1333.                           Diagram__HideDragingRect();
  1334.                     }
  1335.  
  1336.                     m_bDiaStartDraging = 0;
  1337.                     if(m_nInterCellFocus != -1 && (m_StartDrag.x != MouseEvent.X || MouseEvent.Y != m_StartDrag.y) && m_StartDrag.x >= 0){
  1338.                         // nastavim pozici
  1339.                         x=MouseEvent.X;
  1340.                         y=MouseEvent.Y;
  1341.                         Diagram__ScreenToClient(y);
  1342.                         x-=m_DiaIncrease.left;
  1343.                         y-=m_DiaIncrease.top;
  1344.                         if (y < 0)y=0; // croping is not implemented :/  it will be better in WinVersion, comming soon.
  1345.                         if (x < 0)x=0;
  1346.                         Diagram__MoveCellTo(m_nInterCellFocus,x,y);
  1347.                     }
  1348.                     SetPoint((POINT*)&m_StartDrag,-10,-10);
  1349.                     break;
  1350.                case 3/* WM_MOUSEMOVE*/:
  1351.                    if(m_DIAGRAM_ADDINGDEPENDENT == 1){
  1352.                       POINT dest;
  1353.                       int x,y;
  1354.                       LINE ln;
  1355.                       int OverCell = Diagram__OverObject(MouseEvent.X,MouseEvent.Y);
  1356.                       if(Diagram__GetCell(OverCell)->nType == 4)OverCell=-1;
  1357.                       if(OverCell != -1 ){
  1358.  
  1359.                            Diagram__GetCenterCell(OverCell,x,y);
  1360.                            Diagram__ClientToScreen(y);
  1361.                            SetRect((RECT*)&ln,x,y,m_DIAGRAM_DEPENDENT_FROM.left,m_DIAGRAM_DEPENDENT_FROM.top);
  1362.                            Diagram__CutLineOnBorderOfCell(OverCell,&dest,&ln);
  1363.                            if(dest.left >= 0){
  1364.                                x=dest.left;
  1365.                                y=dest.top;
  1366.                            }
  1367.                            dest.left=-1;dest.top=-1;
  1368.                       }
  1369.                       else {x=MouseEvent.X;y=MouseEvent.Y;}
  1370.                       m_DEPENDENT_TO = OverCell;
  1371.                       dest.left=-1;dest.top=-1;
  1372.                       SetRect((RECT*)&ln,x,y,m_DIAGRAM_DEPENDENT_FROM.left,m_DIAGRAM_DEPENDENT_FROM.top);
  1373.                       Diagram__CutLineOnBorderOfCell(m_nInterCellFocus,&dest,&ln);
  1374.                       HideMouse();
  1375.                       // is the line same ?? if is 1, break process
  1376.                       if((m_LAST_POINTS.left == dest.left && m_LAST_POINTS.top == dest.top && m_LAST_POINTS.right == x && m_LAST_POINTS.bottom == y))break;
  1377.  
  1378.                       if(m_LAST_POINTS.left >= 0){
  1379.                          Diagram__DrawDependent(m_LAST_POINTS.left,m_LAST_POINTS.top,m_LAST_POINTS.right,m_LAST_POINTS.bottom,1,1/*TYPE_DEPENDENT_INHERITANCE*/,-1);
  1380.                       }
  1381.                       if(dest.left >= 0){
  1382.                          Diagram__DrawDependent(dest.left,dest.top,x,y,1,1/*TYPE_DEPENDENT_INHERITANCE*/,-1);
  1383.                       }
  1384.                       ShowMouse();
  1385.                       SetRect(&m_LAST_POINTS,dest.left,dest.top,x,y);
  1386.                       break;
  1387.                    }
  1388.                    if(MouseEvent.Tlaƒítka == 1 && m_nInterCellFocus != -1 &&  m_StartDrag.x >= 0 && pCell->nType != 4/*TYPE_CLASS_DEPENDENT*/){
  1389.                        int sizex = Diagram__MakeCellWidth(m_nInterCellFocus);
  1390.                        int sizey = Diagram__MakeCellHeight(m_nInterCellFocus);
  1391.                        GrNastavBarvuPop²edí(1);
  1392.                        HideMouse();
  1393.                        GrNastavLinku(42/*8|2|0x20*/,0xAAAA);
  1394.                        int x,y;
  1395.                        if(m_bDiaStartDraging != 1){
  1396.                           x=m_LastEvent.x-m_DiaIncrease.left;y=m_LastEvent.y-m_DiaIncrease.top;
  1397.                           GrKresliObdélník(x+1,y+1,
  1398.                                x-1+sizex,
  1399.                               y -1+sizey);
  1400.  
  1401.                        }
  1402.                        x = MouseEvent.X-m_DiaIncrease.left;
  1403.                        y = MouseEvent.Y-m_DiaIncrease.top;
  1404.                        GrKresliObdélník(x+1,y+1,x-1+sizex,y+sizey-1);
  1405.                        m_LastEvent.x = MouseEvent.X;
  1406.                        m_LastEvent.y = MouseEvent.Y;
  1407.                        m_bDiaStartDraging = 0;
  1408.                        GrNastavLinku(21/*4|1|0x10*/,0xFFFF);
  1409.                        ShowMouse();
  1410.                       // drag object ...
  1411.                       // m_DragEdge = m_DragPos;
  1412.  
  1413.                    }
  1414.                    break;
  1415.                case 102/*DIA_SETFOCUS*/: // set focus to some cell /  object
  1416.                    Diagram__DrawCellEx(lParam);
  1417.                    break;
  1418.                case 101/*DIA_KILLFOCUS*/:
  1419.  
  1420.                    Diagram__DrawCellEx(lParam);
  1421.                    break;
  1422.                case 100/*DIA_PAINTOBJECT*/:  // draw cell / object
  1423.                    Diagram__DrawCellEx(lParam);
  1424.                    break;
  1425.                case 8/*WM_PAINT*/ :
  1426.                    Diagram__OnDrawClipRect(0,0,GrMaxX(),GrMaxY());
  1427.                    break;
  1428.                case 6 /* WM_RBUTTONUP */:
  1429.                    if(m_DIAGRAM_ADDINGDEPENDENT == 1){
  1430.                       Diagram__HideAddingDependent();
  1431.                       // m_DIAGRAM_ADDINGDEPENDENT = 0;
  1432.                    break;
  1433.                    }
  1434.                    if(m_bDiaDraging == 1 && m_bDiaStartDraging != 1){
  1435.                       // delete draging rectangle !
  1436.                       Diagram__HideDragingRect();
  1437.                    }
  1438.                    m_bDiaDraging = 0;
  1439.                    int count=0;
  1440.  
  1441.                    if(Diagram__SelectNewObject(MouseEvent.X,MouseEvent.Y) != -1){
  1442.                           pCell = Diagram__GetFocusCell();
  1443.                           unsigned nType  = pCell->nType;
  1444.                          if(nType == 2/*TYPE_CLASS_FULL*/ || nType == 1/*TYPE_CLASS_ONLY*/ || nType == 3/*TYPE_CLASS_OBJECT*/){
  1445.                            MENUITEM(count,300/*IDC_CELL_RENAME*/,"Zm∞nit nßzev objektu",-1/*IDB_NOTHING*/ ,1); count++;
  1446.                            if(nType != 3/*TYPE_CLASS_OBJECT*/){MENUITEM(count,600/*IDC_SETTING_CLASS*/,"Vlastnosti t°φdy",87/*IDB_PROPERTIES*/,1);count++;}
  1447.                            if(nType == 1/*TYPE_CLASS_ONLY*/){
  1448.                                 MENUITEM(count,302/*IDC_CELL_CLASSFULL*/,"Zobrazit cel² objekt",149/*IDB_CLASSFULL*/,1);count++;}
  1449.                            else if(nType == 2/*TYPE_CLASS_FULL*/){
  1450.                                 MENUITEM(count,301/*IDC_CELL_CLASSONLY*/,"Zobrazit pouze nßzev",59/*IDB_CLASSONLY*/,1);count++;}
  1451.  
  1452.                            // check where use clicked ...
  1453.                         }
  1454.                         else {
  1455.                            if(nType == 4/*TYPE_CLASS_DEPENDENT*/){
  1456.                                MENUITEM(count,303/*IDC_CELL_CHANGEDEPENDENT*/,"Zm∞nit vlastnosti",-1/*IDB_NOTHING*/ ,1);count++;
  1457.                            }
  1458.                            else if(nType == 5/*TYPE_CLASS_IMG*/){
  1459.                                MENUITEM(count,300/*IDC_CELL_CHANGESOURCE*/,"Zm∞nit obrßzek",-1/*IDB_NOTHING*/ ,1);count++;
  1460.                            }
  1461.  
  1462.                         }
  1463.                            MENUITEM(count,-1/*ID_SEPARATE*/ ,"-",-1/*IDB_NOTHING*/ ,1);count++;
  1464.  
  1465.                            if(nType != 4/*TYPE_CLASS_DEPENDENT*/){MENUITEM(count,401/*IDC_INSERT_DEPENDENT*/,"Vlo₧it novou zßvislost",132/*IDB_DEPENDENT*/,(m_nm_DiagramCellsSize > 0)?1:0);count++;}
  1466.                            MENUITEM(count,400/*IDC_INSERT_NEWOBJECT*/,"Vlo₧it nov² objekt",119/*IDB_NEWOBJECT*/,1);count++;
  1467.                        if(nType == 2/*TYPE_CLASS_FULL*/ || nType == 1/*TYPE_CLASS_ONLY*/){
  1468.  
  1469.                            MENUITEM(count,-1/*ID_SEPARATE*/ ,"-",-1/*IDB_NOTHING*/ ,1);count++;
  1470.  
  1471.                            MENUITEM(count,403/*IDC_INSERT_NEWVARIABLE*/,"Vlo₧it atribut objektu",51/*IDB_NEWVARIABLE*/,1);count++;
  1472.                            MENUITEM(count,402/*IDC_INSERT_NEWOPERATION*/,"Vlo₧it operaci objektu",36/*IDB_NEWOPERATION*/,1);count++;
  1473.                            if(nType == 2/*TYPE_CLASS_FULL*/){
  1474.                                m_MOUSEOVER_PTY = MouseEvent.Y;
  1475.                                if(Diagram__HitTestCell(m_nInterCellFocus,m_MOUSEOVER_PTY)==1){
  1476.                                     MENUITEM(count,-1/*ID_SEPARATE*/ ,"-",-1/*IDB_NOTHING*/ ,1);count++;
  1477.                                     MENUITEM(count,601/*IDC_EDIT_ITEM*/,(string)"Upravit "+(string)((m_MOUSEOVER_PTY < 0)?"atribut objektu":"operaci objektu"),38/*IDB_EDIT_ITEM*/+((m_MOUSEOVER_PTY < 0)?15:0),1);count++;
  1478.                                     MENUITEM(count,604/*IDC_DELETE_ITEM*/,(string)"Odebrat "+(string)((m_MOUSEOVER_PTY < 0)?"atribut objektu":"operaci objektu"),40/*IDB_DELETE_ITEM*/+((m_MOUSEOVER_PTY < 0)?15:0),1);count++;
  1479.  
  1480.                                }
  1481.  
  1482.                            }
  1483.                        }
  1484.  
  1485.                            MENUITEM(count,-1/*ID_SEPARATE*/ ,"-",-1/*IDB_NOTHING*/ ,1);count++;
  1486.                            if(nType != 4/*TYPE_CLASS_DEPENDENT*/){MENUITEM(count,210/*IDC_EDIT_CUT*/,"Vyjmout",102/*IDB_CUT*/,1);count++;}
  1487.                            if(nType != 4/*TYPE_CLASS_DEPENDENT*/){MENUITEM(count,211/*IDC_EDIT_COPY*/,"Kopφrovat",14/*IDB_COPY*/,1);count++;}
  1488.                            MENUITEM(count,212/*IDC_EDIT_PASTE*/,"Vlo₧it",29/*IDB_PASTE*/,m_MEMORY_CELL.nType == 0  ?0:1);count++;
  1489.                            MENUITEM(count,213/*IDC_EDIT_DELETE*/,"Odstranit",44/*IDB_DELETE*/,1);count++;
  1490.                            MENUITEM(count,214/*IDC_EDIT_DELETEALL*/,"Odstranit vÜe",-1/*IDB_NOTHING*/ ,((m_nm_DiagramCellsSize > 0)?1:0));count++;
  1491.  
  1492.  
  1493.  
  1494.                    }
  1495.                    else {
  1496.                        MENUITEM(count,400/*IDC_INSERT_NEWOBJECT*/,"Vlo₧it nov² objekt",119/*IDB_NEWOBJECT*/,1);count++;
  1497.                        MENUITEM(count,-1/*ID_SEPARATE*/ ,"-",-1/*IDB_NOTHING*/ ,1);count++;
  1498.                        MENUITEM(count,212/*IDC_EDIT_PASTE*/,"Vlo₧it",29/*IDB_PASTE*/,m_MEMORY_CELL.nType == 0  ?0:1);count++;
  1499.                        MENUITEM(count,214/*IDC_EDIT_DELETEALL*/,"Odstranit vÜe",-1/*IDB_NOTHING*/ ,((m_nm_DiagramCellsSize > 0)? 1:0));count++;
  1500.  
  1501.  
  1502.                    }
  1503.                    if(count > 0){
  1504.                    SetMenuCount(count);
  1505.                   TrackPopUpMenu(MouseEvent.X,MouseEvent.Y);}
  1506.                    break;
  1507.                case 2/*WM_RBUTTONDOWN*/:
  1508.                    if(m_DIAGRAM_ADDINGDEPENDENT == 1){
  1509.                        Diagram__HideAddingDependent();
  1510.                        break;
  1511.                    }
  1512.  
  1513.                    break;
  1514.                default:
  1515.                    break;
  1516.            }
  1517.  
  1518.  
  1519. -c1----------------------SEZNAM PODM╓NEK-----------TENTO ⁿ╡DEK NEM╖NIT!-------
  1520. =SP---------------------------------------------------------------------------
  1521.  
  1522. ;-h---------------------------------------------------------------------------
  1523. int Edit__SearchForNearestChar( int nIDEdit, POINT &pt )
  1524.  
  1525. -s--Edit__SearchForNearestChar                                                  ■   4  -2 -18   3
  1526. Edit__SearchForNearestChar
  1527.            1!
  1528. -o1----------------------SEZNAM OPERAC╓------------TENTO ⁿ╡DEK NEM╖NIT!-------
  1529. 1
  1530.  
  1531.   // return 0 if point(pt.x, pt.y) is on leftside from text in edit box
  1532.   int starttextx = GetWindow(nIDEdit)->Rect.left+((GetWindow(nIDEdit)->dwStyle & 0x00200000L/*WS_CLIENTEDGE*/)? 2: 0 )+2;
  1533.   if(pt.left <= (starttextx)){
  1534.      return 0;
  1535.   }
  1536.  
  1537.   // return lenght string, if point(pt.x, pt.y) is on rightside from text in text box
  1538.   SIZE sz;
  1539.   string str=Edit__GetVisibleText(nIDEdit);
  1540.   int nLen = StrDélka(str);
  1541.   GetTextExtent(str,sz,GetWindow(nIDEdit)->hFont);
  1542.   if(pt.left >= (starttextx + sz.x)){
  1543.      return nLen;
  1544.   }
  1545.   //
  1546.   // if the point(pt.x,pt.y) is located inside text in edit box,
  1547.   // convert coordinate to invex char.
  1548.   //
  1549.  
  1550.   int i = 0;
  1551.   int nCharBefore = starttextx;
  1552.   int nNextChar = starttextx;
  1553.   while(nNextChar < pt.left){
  1554.       i++;
  1555.       nCharBefore = nNextChar;
  1556.       GetTextExtent(StrKopie(str,0,i),sz,GetWindow(nIDEdit)->hFont);
  1557.       nNextChar = starttextx + sz.x;
  1558.   }
  1559.   return ((pt.left - nCharBefore) < (nNextChar - pt.left))?i-1:i;
  1560.  
  1561. -c1----------------------SEZNAM PODM╓NEK-----------TENTO ⁿ╡DEK NEM╖NIT!-------
  1562. =SP---------------------------------------------------------------------------
  1563.  
  1564. ;-h---------------------------------------------------------------------------
  1565. string Edit__GetVisibleText(unsigned nID )
  1566. -s--Edit__GetVisibleText                                                        ■   4  -2 -21   3
  1567. Edit__GetVisibleText
  1568.         1!
  1569. -o1----------------------SEZNAM OPERAC╓------------TENTO ⁿ╡DEK NEM╖NIT!-------
  1570. 1  WND * pWnd=GetWindow(nID);
  1571.   int width = 0;
  1572.   int nSizeX = Edit__GetMaxVisibleTextWidth(nID);
  1573.   int counter = pWnd->lParam;
  1574.   if(counter < 0)counter=0;
  1575.   SIZE size;
  1576.   while(width < nSizeX){
  1577.       GetTextExtent(pWnd->szText[counter],size,pWnd->hFont);
  1578.       width+=size.x;
  1579.       counter++;
  1580.   }
  1581.   if(width >= nSizeX){
  1582.       width-=size.x;
  1583.       counter--;
  1584.   }
  1585.   return StrKopie(pWnd->szText,pWnd->lParam,counter-pWnd->lParam);
  1586.  
  1587.  
  1588. -c1----------------------SEZNAM PODM╓NEK-----------TENTO ⁿ╡DEK NEM╖NIT!-------
  1589. =SP---------------------------------------------------------------------------
  1590.  
  1591. ;-h---------------------------------------------------------------------------
  1592. int Edit__GetMaxVisibleTextWidth( unsigned hWnd )
  1593. -s--Edit__GetMaxVisibleTextWidth                                                ■   4  -2 -17   3
  1594. Edit__GetMaxVisibleTextWidth
  1595.             1!
  1596. -o1----------------------SEZNAM OPERAC╓------------TENTO ⁿ╡DEK NEM╖NIT!-------
  1597. 1  return (GetWindowWidth(hWnd)-((GetWindow(hWnd)->dwStyle & 0x00200000L)?10:6))
  1598. -c1----------------------SEZNAM PODM╓NEK-----------TENTO ⁿ╡DEK NEM╖NIT!-------
  1599. =SP---------------------------------------------------------------------------
  1600.  
  1601. ;-h---------------------------------------------------------------------------
  1602. void Edit__DrawText( unsigned hWnd )
  1603.  
  1604. -s--Edit__DrawText                                                              ■   4  -2 -24   3
  1605. Edit__DrawText
  1606.      1!
  1607. -o1----------------------SEZNAM OPERAC╓------------TENTO ⁿ╡DEK NEM╖NIT!-------
  1608. 1  WND * pWnd = GetWindow(hWnd);
  1609.    HideMouse();
  1610.    RECT rc;
  1611.    CopyRect(&rc,&pWnd->Rect);
  1612.    if(pWnd->dwStyle & 0x00200000L/*WS_CLIENTEDGE*/)InflateRect(&rc,-2,-2,-2,-2);
  1613.    InflateRect(&rc,-2,0,-2,0);
  1614.    string str =Edit__GetVisibleText(hWnd);
  1615.    SIZE sz;GetTextExtent(str,sz,pWnd->hFont);
  1616.    FillSolidRect2(rc.left+sz.x-1,rc.top,rc.right,rc.bottom,5);
  1617.    DrawText(str,&rc,4,5,0x00000000/*DT_LEFT*/|0x00000004/*DT_CENTER*/,pWnd->hFont);
  1618.    ShowMouse();
  1619.  
  1620. -c1----------------------SEZNAM PODM╓NEK-----------TENTO ⁿ╡DEK NEM╖NIT!-------
  1621. =SP---------------------------------------------------------------------------
  1622.  
  1623. ;-h---------------------------------------------------------------------------
  1624. void Edit__WndProc( unsigned hWnd,unsigned nMessage, long lParam, long wParam )
  1625. -s--Edit__WndProc                                                               ■   4  -2 -25   3
  1626. Edit__WndProc
  1627.      1!
  1628. -o1----------------------SEZNAM OPERAC╓------------TENTO ⁿ╡DEK NEM╖NIT!-------
  1629. 1
  1630.   WND* pWnd = GetWindow(hWnd);
  1631.   long dwStyle = pWnd->dwStyle;
  1632.   RECT * Rect = &pWnd->Rect;
  1633.   long bMouseOver = (dwStyle & 0x00100000L/*WS_MOUSEOVER*/);
  1634.   long bClientEdge = (dwStyle & 0x00200000L/*WS_CLIENTEDGE*/);
  1635.  
  1636.                         switch(nMessage){
  1637.                              case 16 /* WM_SHOWWINDOW */:
  1638.                                  if(lParam == 1)pWnd->lParam=0;
  1639.                                  break;
  1640.                              case 14 /* WM_CHAR*/:
  1641.                                   if(m_ObjectWithFocus == hWnd){
  1642.                                   switch(lParam){
  1643.  
  1644.                                       case 0x000d/*KlEnter*/:
  1645.                                           SendMessage(0,9 /*WM_COMMAND*/,200/*ED_ENTER*/,hWnd);
  1646.                                           break;
  1647.                                       case 0x4b00/*KlDoleva*/:
  1648.                                         if((pWnd->lParam+pWnd->misc) > 0){
  1649.                                             HideCaret();
  1650.                                             if(pWnd->misc == 0){
  1651.                                                pWnd->lParam--;
  1652.                                                 SendMessage(hWnd,8/*WM_PAINT*/ ,-2,-1);
  1653.                                             }
  1654.                                             else {
  1655.                                                pWnd->misc--;
  1656.                                                Edit__MoveCaretToPos(hWnd,pWnd->misc);
  1657.  
  1658.                                             }
  1659.                                            ShowCaret();
  1660.  
  1661.                                           }
  1662.                                           break;
  1663.                                       case 0x4d00/*KlDoprava*/:
  1664.                                         if(StrDélka(pWnd->szText) >= (pWnd->lParam+pWnd->misc+1)){
  1665.                                             HideCaret();
  1666.                                             if(StrDélka(Edit__GetVisibleText(hWnd)) >= pWnd->misc+1){
  1667.                                                pWnd->misc++;
  1668.                                                Edit__MoveCaretToPos(hWnd,pWnd->misc);
  1669.  
  1670.                                             }
  1671.                                             else {
  1672.                                                pWnd->misc++;
  1673.                                                Edit__MoveCaretToPos(hWnd,pWnd->misc);
  1674.                                                 SendMessage(hWnd,8/*WM_PAINT*/ ,-2,-1);
  1675.                                             }
  1676.  
  1677.                                            }
  1678.                                            ShowCaret();
  1679.                                         break;
  1680.                                       case 0x4f00/*KlEnd*/ :
  1681.                                           pWnd->lParam=0;
  1682.                                           pWnd->misc = StrDélka(pWnd->szText);
  1683.                                           HideCaret();
  1684.                                           Edit__MoveCaretToPos(hWnd,pWnd->misc);
  1685.                                           SendMessage(hWnd,8/*WM_PAINT*/ ,-2,-1);
  1686.                                           ShowCaret();
  1687.                                           break;
  1688.                                       case 0x4700/*KlHome*/ :
  1689.                                           pWnd->misc = 0;
  1690.                                           pWnd->lParam = 0;
  1691.                                           Edit__MoveCaretToPos(hWnd,pWnd->misc);
  1692.                                           SendMessage(hWnd,8/*WM_PAINT*/ ,-2,-1);
  1693.                                           break;
  1694.                                       case 0x5300/*KlDel*/ :
  1695.                                           pWnd->szText = StrKopie(pWnd->szText,0,pWnd->misc+pWnd->lParam)+StrKopie(pWnd->szText,pWnd->misc+pWnd->lParam+1,-1);
  1696.                                           HideCaret();
  1697.                                           SendMessage(hWnd,8/*WM_PAINT*/ ,-2,-1);
  1698.                                           ShowCaret();
  1699.                                           break;
  1700.                                       case 8 :  // BkSp
  1701.                                           if(pWnd->misc+pWnd->lParam <= 0)break;
  1702.                                           pWnd->szText = StrKopie(pWnd->szText,0,pWnd->misc+pWnd->lParam-1)+StrKopie(pWnd->szText,pWnd->misc+pWnd->lParam,-1);
  1703.                                           HideCaret();
  1704.                                           if(!(pWnd->misc > 0)){
  1705.                                              pWnd->lParam--;
  1706.                                              if(pWnd->lParam > 10){ pWnd->lParam-=10; pWnd->misc=10;}
  1707.                                              else{ pWnd->misc=pWnd->lParam; pWnd->lParam=0; }
  1708.  
  1709.                                           }
  1710.                                           else {
  1711.                                                pWnd->misc--;
  1712.  
  1713.                                           }
  1714.                                           Edit__MoveCaretToPos(hWnd,pWnd->misc);
  1715.                                           SendMessage(hWnd,8/*WM_PAINT*/ ,-2,-1);
  1716.                                           ShowCaret();
  1717.  
  1718.                                           break;
  1719.  
  1720.                                       default:
  1721.                                             if(lParam > 31 && StrDélka(pWnd->szText)+1 < 1000){ // normal chars
  1722.                                                 pWnd->szText = StrKopie(pWnd->szText,0,pWnd->misc+pWnd->lParam)+(string)((char)lParam)+StrKopie(pWnd->szText,pWnd->misc+pWnd->lParam,-1);
  1723.                                                 HideCaret();
  1724.                                                 pWnd->misc++;
  1725.                                                 Edit__MoveCaretToPos(hWnd,pWnd->misc);
  1726.  
  1727.                                                 SendMessage(hWnd,8/*WM_PAINT*/ ,-2,-1);
  1728.                                                 ShowCaret();
  1729.                                             }
  1730.  
  1731.                                  break;
  1732.  
  1733.                                   }
  1734.                                   }
  1735.                                   break;
  1736.                              case 8/*WM_PAINT*/ :
  1737.                                    if(lParam != -2)DrawFrameControl(Rect,pWnd->nType,pWnd->dwStyle|(m_ObjectWithFocus == hWnd ?0x00400000L/*WS_FOCUS*/:0),pWnd->szText,pWnd->hFont);
  1738.                                    if(!(pWnd->dwStyle & 0x00080000L))Edit__DrawText(hWnd);
  1739.                                    break;
  1740.                              case 5/* WM_MOUSEENTER*/:  // 100
  1741.                              case 4/*WM_MOUSELEAVE*/:   // 85
  1742.                                    SetCursor(85+(nMessage-4)*15);
  1743.                                    break;
  1744.                              case 7/*WM_LBUTTONUP*/:
  1745.                                    ReleaseCapture();
  1746.                                    break;
  1747.                              case 1/*WM_LBUTTONDOWN*/:
  1748.                                    SetCapture(hWnd);
  1749.                                    POINT pt;pt.left = MouseEvent.X;pt.top = MouseEvent.Y;
  1750.                                    int i = Edit__SearchForNearestChar(hWnd,pt);
  1751.                                    if (pWnd->misc != i){
  1752.  
  1753.                                           pWnd->misc = i;
  1754.                                           Edit__MoveCaretToPos(hWnd,pWnd->misc);
  1755.                                    }
  1756.                                    break;
  1757.                              case 12 /*WM_KILLFOCUS*/:
  1758.                                    DestroyCaret();
  1759.                                    ShowMouse();
  1760.                                    break;
  1761.                              case 11/*WM_SETFOCUS*/:
  1762.                                    SIZE sz;GetTextExtent("",sz,pWnd->hFont);
  1763.                                    CreateCaret(sz.y);
  1764.                                    POINT tt;SetPoint(&tt,MouseEvent.X,MouseEvent.Y);
  1765.                                    pWnd->misc = Edit__SearchForNearestChar(hWnd,tt);
  1766.                                    Edit__MoveCaretToPos(hWnd,pWnd->misc);
  1767.                                    ShowCaret();
  1768.  
  1769.                                    break;
  1770.  
  1771.  
  1772.                        }
  1773.  
  1774.  
  1775. -c1----------------------SEZNAM PODM╓NEK-----------TENTO ⁿ╡DEK NEM╖NIT!-------
  1776. =SP---------------------------------------------------------------------------
  1777.  
  1778. ;-h---------------------------------------------------------------------------
  1779. void Edit__MoveCaretToPos(unsigned nID, int nPos )
  1780.  
  1781. -s--Edit__MoveCaretToPos                                                        ■   4  -2 -22   3
  1782. Edit__MoveCaretToPos
  1783.         1!
  1784. -o1----------------------SEZNAM OPERAC╓------------TENTO ⁿ╡DEK NEM╖NIT!-------
  1785. 1
  1786.    WND * pWnd = GetWindow(nID);
  1787.    SIZE sz;
  1788.    GetTextExtent(StrKopie(GetWindowText(nID),pWnd->lParam,nPos),sz,pWnd->hFont);
  1789.    int delta=0;
  1790.    while(sz.x >= Edit__GetMaxVisibleTextWidth(nID)){
  1791.       pWnd->lParam++;
  1792.       pWnd->misc--;
  1793.       delta--;
  1794.       GetTextExtent(StrKopie(GetWindowText(nID),pWnd->lParam,nPos+delta),sz,pWnd->hFont);
  1795.  
  1796.    }
  1797.    SetCaretPos(sz.x+pWnd->Rect.left+2,pWnd->Rect.top+((pWnd->dwStyle & WS_CLIENTEDGE)? 2: 0 )+2);
  1798.  
  1799. -c1----------------------SEZNAM PODM╓NEK-----------TENTO ⁿ╡DEK NEM╖NIT!-------
  1800. =SP---------------------------------------------------------------------------
  1801.  
  1802. ;-h---------------------------------------------------------------------------
  1803. int ListBox__GetCurSel( unsigned hWnd )
  1804. -s--ListBox__GetCurSel                                                          ■   3  -2 -22   3
  1805. ListBox__GetCurSel
  1806.         !1
  1807. -o1----------------------SEZNAM OPERAC╓------------TENTO ⁿ╡DEK NEM╖NIT!-------
  1808. 1  return (GetWindow(hWnd)->misc2+GetWindow(hWnd)->misc);
  1809. -c1----------------------SEZNAM PODM╓NEK-----------TENTO ⁿ╡DEK NEM╖NIT!-------
  1810. =SP---------------------------------------------------------------------------
  1811.  
  1812. ;-h---------------------------------------------------------------------------
  1813. void ListBox__DeleteAll(unsigned hWnd )
  1814. -s--ListBox__DeleteAll                                                          ■   4  -2 -22   3
  1815. ListBox__DeleteAll
  1816.        1!
  1817. -o1----------------------SEZNAM OPERAC╓------------TENTO ⁿ╡DEK NEM╖NIT!-------
  1818. 1 WND* pWnd = GetWindow(hWnd);
  1819.   ClassItemInit(pWnd->pData,pWnd->lParam,0);
  1820.   SendMessage(0,9 /*WM_COMMAND*/,200/*LV_SELCHANGE*/,hWnd);
  1821. -c1----------------------SEZNAM PODM╓NEK-----------TENTO ⁿ╡DEK NEM╖NIT!-------
  1822. =SP---------------------------------------------------------------------------
  1823.  
  1824. ;-h---------------------------------------------------------------------------
  1825. void ListBox__DrawItems( unsigned hWnd, int nToDraw )
  1826. -s--ListBox__DrawItems                                                          ■   4  -2 -22   3
  1827. ListBox__DrawItems
  1828.        1!
  1829. -o1----------------------SEZNAM OPERAC╓------------TENTO ⁿ╡DEK NEM╖NIT!-------
  1830. 1  
  1831.    HideMouse();
  1832.    WND* pWnd = GetWindow(hWnd);
  1833.  
  1834.    int FocusCell  =  pWnd->misc2+pWnd->misc;
  1835.    int TopMostCell = nToDraw+pWnd->misc;
  1836.    RECT rc;CopyRect(&rc,&pWnd->Rect);
  1837.    CLASSITEM* items= (CLASSITEM*)pWnd->pData;
  1838.    rc.left+=2;
  1839.    rc.right-=20;
  1840.    rc.top+=2+15*nToDraw;
  1841.    rc.bottom=rc.top+14;
  1842.    if(FocusCell == TopMostCell)FillSolidRect(&rc,12 /* BLUE*/);
  1843.         else FillSolidRect(&rc,5);
  1844.    rc.left+=3;
  1845.    DrawText(items[TopMostCell].strText,&rc,(FocusCell == TopMostCell)?5:4,5,0x00000004/*DT_VCENTER*/,FONT_TAHOMA_8);
  1846.  
  1847.  
  1848.    ShowMouse();
  1849.  
  1850.  
  1851.  
  1852.  
  1853. -c1----------------------SEZNAM PODM╓NEK-----------TENTO ⁿ╡DEK NEM╖NIT!-------
  1854. =SP---------------------------------------------------------------------------
  1855.  
  1856. ;-h---------------------------------------------------------------------------
  1857. string ListBox__GetItemText( unsigned hWnd, nID )
  1858. -s--ListBox__GetItemText                                                        ■   4  -2 -21   3
  1859. ListBox__GetItemText
  1860.         1!
  1861. -o1----------------------SEZNAM OPERAC╓------------TENTO ⁿ╡DEK NEM╖NIT!-------
  1862. 1 return ((CLASSITEM*)GetWindow(hWnd)->pData)[nID].strText;
  1863. -c1----------------------SEZNAM PODM╓NEK-----------TENTO ⁿ╡DEK NEM╖NIT!-------
  1864. =SP---------------------------------------------------------------------------
  1865.  
  1866. ;-h---------------------------------------------------------------------------
  1867. void ListBox__SetItemText(unsigned hWnd, int nID, string str )
  1868. -s--ListBox__SetItemText                                                        ■   4  -2 -21   3
  1869. ListBox__SetItemText
  1870.         1!
  1871. -o1----------------------SEZNAM OPERAC╓------------TENTO ⁿ╡DEK NEM╖NIT!-------
  1872. 1 ((CLASSITEM*)GetWindow(hWnd)->pData)[nID].strText=str;
  1873. -c1----------------------SEZNAM PODM╓NEK-----------TENTO ⁿ╡DEK NEM╖NIT!-------
  1874. =SP---------------------------------------------------------------------------
  1875.  
  1876. ;-h---------------------------------------------------------------------------
  1877. int ListBox__AddItem(unsigned hWnd, int nID, string strText)
  1878. -s--ListBox__AddItem                                                            ■   4  -2 -23   3
  1879. ListBox__AddItem
  1880.       1!
  1881. -o1----------------------SEZNAM OPERAC╓------------TENTO ⁿ╡DEK NEM╖NIT!-------
  1882. 1
  1883.    WND* pWnd = GetWindow(hWnd);
  1884.    long lParam =pWnd->lParam;
  1885.    if(lParam < 0)pWnd->lParam = 0;
  1886.    pWnd->pData=(CLASSITEM*)ClassItemInit(pWnd->pData,pWnd->lParam,lParam+1);
  1887.    CLASSITEM* pData=&((CLASSITEM*)pWnd->pData)[lParam];
  1888.    pData->strText = strText;
  1889.    pData->nType = nID;
  1890.    SendMessage(0,9 /*WM_COMMAND*/,200/*LV_SELCHANGE*/,hWnd);
  1891.    return pWnd->lParam;
  1892. -c1----------------------SEZNAM PODM╓NEK-----------TENTO ⁿ╡DEK NEM╖NIT!-------
  1893. =SP---------------------------------------------------------------------------
  1894.  
  1895. ;-h---------------------------------------------------------------------------
  1896. string AddDialog__CreateString()
  1897. -s--AddDialog__CreateString                                                     ■   4  -2 -20   3
  1898. AddDialog__CreateString
  1899.           1!
  1900. -o1----------------------SEZNAM OPERAC╓------------TENTO ⁿ╡DEK NEM╖NIT!-------
  1901. 1
  1902.   string strText;
  1903.   int i=0;
  1904.   if(abs(GetWindow(10 /*IDC_ADDINGDIALOG*/)->lParam) == 1){
  1905.      for(;i < ListBox__GetSize(21/*IDC_PARA_LIST*/);i++){
  1906.        if(i != 0)
  1907.           strText+=", ";
  1908.        strText+=ListBox__GetItemText(21/*IDC_PARA_LIST*/,i);
  1909.      }
  1910.      strText=trim(GetWindowText(26/*IDC_ADD_NAME*/))+" ("+strText+" ) ";
  1911.   }else{
  1912.     strText=trim(GetWindowText(26/*IDC_ADD_NAME*/))+" ";
  1913.  
  1914.  
  1915.   }
  1916.   string sx=trim(GetWindowText(12/*IDC_ADD_TYPENAME*/));
  1917.   if(sx!="")
  1918.     strText +=": "+sx;
  1919.   return strText;
  1920.  
  1921.  
  1922. -c1----------------------SEZNAM PODM╓NEK-----------TENTO ⁿ╡DEK NEM╖NIT!-------
  1923. =SP---------------------------------------------------------------------------
  1924.  
  1925. ;-h---------------------------------------------------------------------------
  1926. string AddDialog__MakeParameterString( void )
  1927. -s--AddDialog__MakeParameterString                                              ■   4  -2 -16   3
  1928. AddDialog__MakeParameterString
  1929.              1!
  1930. -o1----------------------SEZNAM OPERAC╓------------TENTO ⁿ╡DEK NEM╖NIT!-------
  1931. 1
  1932.   string str=GetWindowText(20/*IDC_PARA_NAME*/)+":"+GetWindowText(19/*IDC_PARA_TYPE*/);
  1933.   if(Button__GetCheck(24/*IDC_PARA_INOUT*/)){str="inout "+str;}
  1934.   else if (Button__GetCheck(25/*IDC_PARA_OUT*/)){str="out "+str;}
  1935.   else if (Button__GetCheck(27/*IDC_PARA_IN*/)){str="in "+str;}
  1936.   return str;
  1937.  
  1938. -c1----------------------SEZNAM PODM╓NEK-----------TENTO ⁿ╡DEK NEM╖NIT!-------
  1939. =SP---------------------------------------------------------------------------
  1940.  
  1941. ;-h---------------------------------------------------------------------------
  1942. void Dialog__WndProc(unsigned hWnd, unsigned nMessage, long lParam, long wParam )
  1943. -s--Dialog__WndProc                                                             ■   4  -2 -24   3
  1944. Dialog__WndProc
  1945.       1!
  1946. -o1----------------------SEZNAM OPERAC╓------------TENTO ⁿ╡DEK NEM╖NIT!-------
  1947. 1
  1948.  
  1949.   WND* pWnd = GetWindow(hWnd);
  1950.   long dwStyle = pWnd->dwStyle;
  1951.   RECT Rect;
  1952.   CopyRect(&Rect,GetWindowRect(hWnd));
  1953.  
  1954.   long bMouseOver = (dwStyle & 0x00100000L/*WS_MOUSEOVER*/);
  1955.   long bClientEdge = (dwStyle & 0x00200000L/*WS_CLIENTEDGE*/);
  1956.  
  1957.    switch(nMessage){
  1958.        case 16 /* WM_SHOWWINDOW */:
  1959.  
  1960.            // show all client controls/ windows
  1961.             if(lParam == 0)GrKresliP²edm╪ty(16001,0,Rect.left,Rect.top,GetWindowWidth(hWnd)/39+1,GetWindowHeight(hWnd)/29+1);
  1962.             else {
  1963.                 GrNastavObrazP²edm╪tà(16001,Rect.left,Rect.top,GetWindowWidth(hWnd)/39+1,GetWindowHeight(hWnd)/29+1,1);
  1964.                 SendMessage(hWnd,8,-1,-1);
  1965.             }
  1966.             if(pWnd->nChildSize > 0){
  1967.                  int i=0,p;
  1968.                  for(;i < pWnd->nChildSize; i++){
  1969.                    p = pWnd->pChild[i]->hWnd;
  1970.                    ShowWindow(p,lParam);
  1971.                    if(lParam)Invalidate(p);
  1972.                  }
  1973.             }
  1974.             break;
  1975.        case 8/*WM_PAINT*/ :
  1976.             pWnd->hFont = FONT_TAHOMA_BOLD_8;
  1977.             HideMouse();
  1978.  
  1979.  #ifdef _XP_THEME
  1980.             Draw3dRect2(Rect.left,Rect.top+22,Rect.right,Rect.bottom,2,2);
  1981.             Draw3dRect2(Rect.left+1,Rect.top+22,Rect.right-1,Rect.bottom-1,2,2);
  1982.             FillSolidRect2(Rect.left+2,Rect.top+23,Rect.right-2,Rect.bottom-2,1);
  1983.             FillSolidRect2(Rect.left+7,Rect.top,Rect.right-7,Rect.top+23,2 /* BLUE*/);
  1984.             GrKresliP²edm╪t(50,1,Rect.left,Rect.top);
  1985.             GrKresliP²edm╪t(65,1,Rect.right-6,Rect.top);
  1986.             TextOut(Rect.left+10,Rect.top+6,pWnd->szText,5,2 /* BLUE*/,pWnd->hFont);
  1987.  #else
  1988.             DrawEdge(&Rect,0x0004/*DES_MODAL*/);
  1989.             FillSolidRect2(Rect.left+2,Rect.top+2,Rect.right-2,Rect.bottom-2,0);
  1990.             FillSolidRect2(Rect.left+3,Rect.top+3,Rect.left+150,Rect.top+20,12 /* BLUE*/);
  1991.             GrKresliP²edm╪ty(95,1,Rect.left+150,Rect.top+3,3,1);
  1992.             FillSolidRect2(Rect.left+267,Rect.top+3,Rect.right-3,Rect.top+20,2 /* BLUE*/);
  1993.             TextOut(Rect.left+7,Rect.top+5,pWnd->szText,5,2 /* BLUE*/,pWnd->hFont);
  1994.  
  1995.  #endif
  1996.  
  1997.             ShowMouse();
  1998.             break;
  1999.    }
  2000.  
  2001.  
  2002. -c1----------------------SEZNAM PODM╓NEK-----------TENTO ⁿ╡DEK NEM╖NIT!-------
  2003. =SP---------------------------------------------------------------------------
  2004.  
  2005. ;-h---------------------------------------------------------------------------
  2006. void Button__SetCheckRange(int nPosStart,int nPosEnd,long dwFlags)
  2007. -s--Button__SetCheckRange                                                       ■   4  -2 -21   3
  2008. Button__SetCheckRange
  2009.          1!
  2010. -o1----------------------SEZNAM OPERAC╓------------TENTO ⁿ╡DEK NEM╖NIT!-------
  2011. 1 for(;nPosStart <= nPosEnd;nPosStart++){
  2012.       Button__SetCheck(nPosStart,(dwFlags & GetWindow(nPosStart)->misc));
  2013.   }
  2014. -c1----------------------SEZNAM PODM╓NEK-----------TENTO ⁿ╡DEK NEM╖NIT!-------
  2015. =SP---------------------------------------------------------------------------
  2016.  
  2017. ;-h---------------------------------------------------------------------------
  2018. void Button__GetCheckRange(int nPosStart,int nPosEnd,long& dwFlags)
  2019. -s--Button__GetCheckRange                                                       ■   4  -2 -21   3
  2020. Button__GetCheckRange
  2021.          1!
  2022. -o1----------------------SEZNAM OPERAC╓------------TENTO ⁿ╡DEK NEM╖NIT!-------
  2023. 1 for(;nPosStart <= nPosEnd;nPosStart++){
  2024.       Button__GetCheckEx(nPosStart,dwFlags,GetWindow(nPosStart)->misc);
  2025.   }
  2026. -c1----------------------SEZNAM PODM╓NEK-----------TENTO ⁿ╡DEK NEM╖NIT!-------
  2027. =SP---------------------------------------------------------------------------
  2028.  
  2029. ;-h---------------------------------------------------------------------------
  2030. void Button__GetCheckEx( unsigned hWnd, long& dwState, long nType )
  2031. -s--Button__GetCheckEx                                                          ■   4  -2 -22   3
  2032. Button__GetCheckEx
  2033.        1!
  2034. -o1----------------------SEZNAM OPERAC╓------------TENTO ⁿ╡DEK NEM╖NIT!-------
  2035. 1
  2036.    if(Button__GetCheck(hWnd))dwState|=nType;
  2037.    else STYLEMINUS(dwState,nType);
  2038. -c1----------------------SEZNAM PODM╓NEK-----------TENTO ⁿ╡DEK NEM╖NIT!-------
  2039. =SP---------------------------------------------------------------------------
  2040.  
  2041. ;-h---------------------------------------------------------------------------
  2042. int Button__GetCheck( unsigned hWnd )
  2043. -s--Button__GetCheck                                                            ■   4  -2 -23   3
  2044. Button__GetCheck
  2045.       1!
  2046. -o1----------------------SEZNAM OPERAC╓------------TENTO ⁿ╡DEK NEM╖NIT!-------
  2047. 1 return ( GetWindow(hWnd)->dwStyle & 0x0000200L/*DFCS_PUSHED*/);
  2048. -c1----------------------SEZNAM PODM╓NEK-----------TENTO ⁿ╡DEK NEM╖NIT!-------
  2049. =SP---------------------------------------------------------------------------
  2050.  
  2051. ;-h---------------------------------------------------------------------------
  2052. void Button__SetCheck(unsigned hWnd, long bCheck )
  2053. -s--Button__SetCheck                                                            ■   4  -2 -23   3
  2054. Button__SetCheck
  2055.       1!
  2056. -o1----------------------SEZNAM OPERAC╓------------TENTO ⁿ╡DEK NEM╖NIT!-------
  2057. 1  WND* pWnd = GetWindow(hWnd);
  2058.    long dwStyle =pWnd->dwStyle;
  2059.  
  2060.                                if((dwStyle & 0x0000002L/*DFCS_BUTTONRADIO*/)){
  2061.                                    if(!bCheck){ STYLEMINUS(dwStyle,0x0000200L/*DFCS_PUSHED*/);  }
  2062.                                    else {
  2063.                                    int i;
  2064.                                                                    WND *p=0;
  2065.                                    for(i = 0; i < m_nm_ControlArraySize; i++){
  2066.                                                                       p =GetWindow(i);
  2067.                                       if(i != hWnd && p->nType == 4/*DFC_BUTTON*/ && p->dwStyle &0x0000002L/*DFCS_BUTTONRADIO*/ && p->nID == pWnd->nID){
  2068.                                            // collections ...
  2069.  
  2070.                                            if(p->dwStyle & 0x0000200L/*DFCS_PUSHED*/){
  2071.                                                STYLEMINUS(p->dwStyle,0x0000200L/*DFCS_PUSHED*/);
  2072.                                                Invalidate(i);
  2073.                                            }
  2074.                                       }
  2075.  
  2076.                                    }
  2077.                                    dwStyle|=0x0000200L/*DFCS_PUSHED*/;
  2078.                                    }
  2079.                                }
  2080.                                else if(dwStyle  & 0x0000001L/*DFCS_BUTTONCHECK*/){
  2081.                                     if(bCheck)dwStyle|=0x0000200L/*DFCS_PUSHED*/;
  2082.                                     else STYLEMINUS(dwStyle,0x0000200L/*DFCS_PUSHED*/);
  2083.                                       }
  2084.                                       Invalidate(hWnd);
  2085.    pWnd->dwStyle = dwStyle;                                               
  2086.          
  2087. -c1----------------------SEZNAM PODM╓NEK-----------TENTO ⁿ╡DEK NEM╖NIT!-------
  2088.  
  2089. =SP---------------------------------------------------------------------------
  2090. ;-h---------------------------------------------------------------------------
  2091. void WndProc(unsigned hWnd,unsigned nMessage, long lParam, long wParam)
  2092. -s--WndProc                                                                     ■   4  -2 -24   3
  2093. WndProc
  2094.   1!
  2095. -o1----------------------SEZNAM OPERAC╓------------TENTO ⁿ╡DEK NEM╖NIT!-------
  2096.   WND* pWnd = GetWindow(hWnd);
  2097.   long dwStyle = pWnd->dwStyle;
  2098.   int nType = pWnd->nType;
  2099.   RECT Rect;
  2100.   CopyRect(&Rect,&pWnd->Rect);
  2101.  
  2102.   long bMouseOver = (dwStyle & 0x00100000L/*WS_MOUSEOVER*/);
  2103.   long bClientEdge = (dwStyle & 0x00200000L/*WS_CLIENTEDGE*/);
  2104.  
  2105.            switch(hWnd){
  2106.                case 0:
  2107.                     switch(nMessage){
  2108.                        case 13/* WM_TIMER */:
  2109.                            if(lParam == 0/*IDT_CARETTIMER*/){
  2110.                                DrawCaret();
  2111.                            }
  2112.                            break;
  2113.                        case 10/*WM_CLOSE*/:
  2114.                            m_LastedMessage = 1;
  2115.                            break;
  2116.  
  2117.                     }
  2118.                     break;
  2119.                case 3 /*IDC_POPUPMENU */:
  2120.                     switch(nMessage){
  2121.                       case 5/* WM_MOUSEENTER*/:
  2122.                            break;
  2123.                       case 7/*WM_LBUTTONUP*/:
  2124.                          m_bMouseMenuFirstTime=0;
  2125.                          int pg = PopUpMenuHitTest(MouseEvent.X,MouseEvent.Y);
  2126.                          if(bMouseOver && m_POPUPMENU_STRINGS[pg] != "-"  && m_POPUPMENU_ENABLE[pg] == 1 ){
  2127.                              int x=m_POPUPMENU_selitem;
  2128.                              m_POPUPMENU_FROMMENU = m_POPUPMENU_TOMENU;
  2129.                              StopTrackingPopUpMenu();
  2130.                              SendMessage(0,9 /*WM_COMMAND*/,1 /*BN_CLICK*/,m_POPUPMENU_IDS[x]);
  2131.                              m_POPUPMENU_FROMMENU = 0;
  2132.  
  2133.                          }
  2134.                          break;
  2135.                       case 3/* WM_MOUSEMOVE*/:
  2136.                          if(bMouseOver){
  2137.  
  2138.  
  2139.                               int i,g = PopUpMenuHitTest(MouseEvent.X,MouseEvent.Y);
  2140.          #ifdef _XP_THEME
  2141.                               if(g !=m_POPUPMENU_selitem )
  2142.          #else
  2143.                               if(g !=m_POPUPMENU_selitem && m_POPUPMENU_STRINGS[g] != "-")
  2144.          #endif
  2145.                                   {
  2146.                                    i=m_POPUPMENU_selitem;
  2147.  
  2148.          #ifdef _XP_THEME
  2149.                                   m_POPUPMENU_selitem=-1;
  2150.                                   if(m_POPUPMENU_STRINGS[g] != "-" && m_POPUPMENU_ENABLE[g] != 0) {
  2151.                                         m_POPUPMENU_selitem=g;
  2152.                                   }
  2153.                                   if(i != -1)SendMessage(3 /* IDC_POPUPMENU */,8/*WM_PAINT*/ ,i,-1);
  2154.                                   if(m_POPUPMENU_selitem != -1 && m_POPUPMENU_ENABLE[m_POPUPMENU_selitem]!= 0)SendMessage(3 /* IDC_POPUPMENU */,8/*WM_PAINT*/ ,m_POPUPMENU_selitem,-1);
  2155.  
  2156.  
  2157.          #else
  2158.                                    m_POPUPMENU_selitem=g;
  2159.                                    if(i != -1)SendMessage(3 /* IDC_POPUPMENU */,8/*WM_PAINT*/ ,i,-1);
  2160.                                    if(g != -1)SendMessage(3 /* IDC_POPUPMENU */,8/*WM_PAINT*/ ,g,-1);
  2161.  
  2162.          #endif
  2163.                               }
  2164.                          }
  2165.                          else if(m_POPUPMENU_selitem !=-1){
  2166.                             int i =m_POPUPMENU_selitem;
  2167.                             m_POPUPMENU_selitem=-1;
  2168.                             if(i != -1)SendMessage(3 /* IDC_POPUPMENU */,8/*WM_PAINT*/ ,i,-1);
  2169.                          }
  2170.                          break;
  2171.                       case 8/*WM_PAINT*/ :
  2172.                           DrawPopUpMenu(hWnd,lParam,-1);
  2173.                           break;
  2174.  
  2175.                     }
  2176.                     break;
  2177.  
  2178.                case 1 /* IDC_MENU */:
  2179.                     switch(nMessage){
  2180.                         case 8/*WM_PAINT*/ :
  2181.                             if(lParam == -2){
  2182.                                 int i = 0;
  2183.                                 for(i = 0;i < 5; i++){
  2184.                                      SendMessage(1 /* IDC_MENU */,8/*WM_PAINT*/ ,i,-1);
  2185.                                 }
  2186.                                 return;
  2187.                             }
  2188.                             if(lParam == -1){
  2189.                                lParam = IDC_MENU_OVER;
  2190.                                if(lParam == -1)return;
  2191.                             }
  2192.                             Rect.right = Rect.left + IDC_MENU_RECT[lParam];
  2193.                             Rect.left += (lParam != 0)?IDC_MENU_RECT[lParam-1]+1:0;
  2194.                             DrawFrameControl(&Rect,2/*DFC_MENU*/,(((((MouseEvent.Tlaƒítka == 1 && bMouseOver) || m_POPUPMENU_TOMENU) && wParam == -1 ) && lParam == IDC_MENU_OVER)?
  2195.                             0x0000001L/*DFCS_MENUCHECKED*/ : 0)|((bMouseOver &&
  2196.                             lParam == IDC_MENU_OVER)? 0x00100000L/*WS_MOUSEOVER*/ : 0 ),IDC_MENU_HORITEM[lParam],0);
  2197.  
  2198.                             break;
  2199.                         case 1/*WM_LBUTTONDOWN*/:
  2200.                             m_bMouseMenuFirstTime=1;
  2201.                             SetCapture(1 /* IDC_MENU */);
  2202.                             m_POPUPMENU_TOMENU=1;
  2203.                             Invalidate(1 /*  IDC_MENU */);
  2204.                             int x = (IDC_MENU_OVER > 0)?IDC_MENU_RECT[IDC_MENU_OVER-1]+1:0;
  2205.                             x+=Rect.left;
  2206.                             SetMainMenu(IDC_MENU_OVER);
  2207.                             TrackPopUpMenu(x,Rect.bottom+1);
  2208.  
  2209.                             break;
  2210.                         case 7/*WM_LBUTTONUP*/:
  2211.                             m_bMouseMenuFirstTime=0;
  2212.                             ReleaseCapture();
  2213.                             Invalidate(1 /* IDC_MENU  */);
  2214.                             break;
  2215.                         case 5/* WM_MOUSEENTER*/:
  2216.                             IDC_MENU_OVER = MenuHitTest(1 /* IDC_MENU */);
  2217.                              Invalidate(hWnd);
  2218.                             break;
  2219.                         case 4/*WM_MOUSELEAVE*/:
  2220.                             if(m_POPUPMENU_TOMENU!=1){
  2221.                                SendMessage(1 /*  IDC_MENU */,8/*WM_PAINT*/ ,IDC_MENU_OVER,-1);
  2222.                                Invalidate(hWnd);
  2223.                                IDC_MENU_OVER = -1;
  2224.                             }
  2225.  
  2226.                             break;
  2227.                         case 3/* WM_MOUSEMOVE*/:
  2228.                             int q,i = MenuHitTest(1 /* IDC_MENU */);
  2229.                             q=IDC_MENU_OVER;
  2230.                             if(IDC_MENU_OVER != i){
  2231.                                  IDC_MENU_OVER = i;int gg =m_POPUPMENU_TOMENU;
  2232.                                 if(gg) StopTrackingPopUpMenu();
  2233.                                  SendMessage(1 /* IDC_MENU */,8/*WM_PAINT*/ ,q,-1);
  2234.                                 if(gg)  m_POPUPMENU_TOMENU=1;
  2235.                                  Invalidate(1 /* IDC_MENU */);
  2236.                                 if(gg){
  2237.                                  int x = (IDC_MENU_OVER > 0)?IDC_MENU_RECT[IDC_MENU_OVER-1]+1:0;
  2238.                                  x+=Rect.left;
  2239.                                  SetMainMenu(IDC_MENU_OVER);
  2240.                                  TrackPopUpMenu(x,Rect.bottom+1);
  2241.                                  }
  2242.  
  2243.                             }
  2244.                             break;
  2245.                         default:
  2246.                             break;
  2247.                     }
  2248.  
  2249.                     break;
  2250.                default:
  2251.                    if(nType > 12){
  2252.                       if(nMessage ==  8/*WM_PAINT*/)
  2253.                                    DrawFrameControl(&Rect,nType,dwStyle|((m_ObjectWithFocus == hWnd) ?0x00400000L/*WS_FOCUS*/:0),pWnd->szText,pWnd->hFont);
  2254.  
  2255.                    }
  2256.                   else if(nType == 4/*DFC_BUTTON*/){
  2257.                          switch(nMessage){
  2258.                               case 4/*WM_MOUSELEAVE*/:
  2259.                               case 5/* WM_MOUSEENTER*/:
  2260.                                    Invalidate(hWnd);
  2261.                                    break;
  2262.                               case 7/*WM_LBUTTONUP*/:
  2263.                                    ReleaseCapture();
  2264.                                    if(dwStyle & 0x0000001L/*DFCS_BUTTONCHECK*/ || dwStyle & 0x0000002L/*DFCS_BUTTONRADIO*/){
  2265.                                       if(bMouseOver  && (((dwStyle & 0x0000002L) && !(dwStyle & 0x0000200L))||dwStyle & 0x0000001L)){
  2266.                                         Button__SetCheck(hWnd,!(dwStyle & 0x0000200L/*DFCS_PUSHED*/));
  2267.                                       }
  2268.                                       Invalidate(hWnd);
  2269.                                    }
  2270.                                    else {
  2271.                                       STYLEMINUS(pWnd->dwStyle,0x00100000/*DFCS_PUSHED*/);
  2272.                                       Invalidate(hWnd);
  2273.                                       STYLEMINUS(pWnd->dwStyle,0x0000200L/*DFCS_PUSHED*/);
  2274.                                       if(bMouseOver)pWnd->dwStyle|=0x00100000;
  2275.                                       if(bMouseOver)SendMessage(0,9 /*WM_COMMAND*/,1 /*BN_CLICK*/,pWnd->nID);
  2276.  
  2277.  
  2278.                                    }
  2279.  
  2280.                                    break;
  2281.                               case 1/*WM_LBUTTONDOWN*/:
  2282.                                    SetCapture(hWnd);
  2283.                                    if(!(dwStyle & 0x0000001L/*DFCS_BUTTONCHECK*/   || dwStyle & 0x0000002L/*DFCS_BUTTONRADIO*/)){pWnd->dwStyle|=0x0000200L/*DFCS_PUSHED*/;}
  2284.                                    Invalidate(hWnd);
  2285.                                    break;
  2286.                               case 16 /* WM_SHOWWINDOW */:
  2287.                                    if(lParam == 1 && dwStyle & 0x0000004L){
  2288.                                      HideMouse();
  2289.  #ifdef _XP_THEME
  2290.                                    FillSolidRect(&Rect,5);
  2291.  #else
  2292.                                    FillSolidRect(&Rect,0);
  2293.  #endif
  2294.                                      ShowMouse();
  2295.                                    }
  2296.                                    break;
  2297.                               case 8/*WM_PAINT*/ :
  2298.                                    DrawFrameControl(&Rect,nType,dwStyle,pWnd->szText,pWnd->hBitmap);
  2299.                                    break;
  2300.  
  2301.  
  2302.                          }
  2303.                    }
  2304.                    else if(nType == 7/*DFC_EDIT*/){
  2305.                        Edit__WndProc(hWnd,nMessage,lParam,wParam);
  2306.                    }
  2307.                    else if(nType == 8/*DFC_COMBOBOX*/){
  2308.                        switch(nMessage){
  2309.                              case 8/*WM_PAINT*/ :
  2310.                                    DrawFrameControl(&Rect,nType,dwStyle|((GetWindow(8/*IDC_LISTBOX1*/)->dwStyle & 0x00020000L/*WS_VISIBLE*/)?0x00100000L/*WS_MOUSEOVER*/:0),pWnd->szText,pWnd->hFont);
  2311.                                    break;
  2312.                              case 5/* WM_MOUSEENTER*/:
  2313.                              case 4/*WM_MOUSELEAVE*/:
  2314.                                    Invalidate(hWnd);
  2315.                                    break;
  2316.                              case 7/*WM_LBUTTONUP*/:
  2317.                                    ReleaseCapture();
  2318.                                    STYLEMINUS(pWnd->dwStyle,0x0000200L/*DFCS_PUSHED*/);
  2319.                                    if(bMouseOver && !(GetWindow(8/*IDC_LISTBOX1*/)->dwStyle & 0x00020000L/*WS_VISIBLE*/)){
  2320.                                          ShowWindow(8/*IDC_LISTBOX1*/,1);
  2321.                                          SetFocus(8/*IDC_LISTBOX1*/);
  2322.                                          Invalidate(8/*IDC_LISTBOX1*/);
  2323.                                    }
  2324.                                    else {Invalidate(hWnd);}
  2325.                                    break;
  2326.                              case 1/*WM_LBUTTONDOWN*/:
  2327.                                    SetCapture(hWnd);
  2328.                                    pWnd->dwStyle |=0x0000200L/*DFCS_PUSHED*/;
  2329.                                    Invalidate(hWnd);
  2330.                                    break;
  2331.                              case 3/* WM_MOUSEMOVE*/:
  2332.                                   break;
  2333.                              case 12 /*WM_KILLFOCUS*/:
  2334.                                    if(lParam != 8/*IDC_LISTBOX1*/)ShowWindow(8/*IDC_LISTBOX1*/,0);
  2335.                              case 11/*WM_SETFOCUS*/:
  2336.                                    Invalidate(hWnd);
  2337.                                    break;
  2338.  
  2339.  
  2340.                        }
  2341.  
  2342.                    }
  2343.                    else if(nType == 12/*DFC_DIALOG*/){
  2344.                       Dialog__WndProc(hWnd,nMessage,lParam,wParam);
  2345.                    }
  2346.                    else if(nType == 9/*DFC_LISTBOX*/){
  2347.                            switch(nMessage){
  2348.                              case 8/*WM_PAINT*/ :
  2349.                                    if(wParam != -2)DrawFrameControl(&Rect,nType,pWnd->dwStyle|((m_ObjectWithFocus == hWnd) ?0x00400000L/*WS_FOCUS*/:0),pWnd->szText,pWnd->hFont);
  2350.                                    //ListBox__DrawItems(hWnd,-1);
  2351.                                    if(pWnd->misc < 0)pWnd->misc=0;
  2352.                                    int ig,ia=(Rect.bottom- Rect.top-2)/15;
  2353.                                    for(ig = 0; ig < ia && ig < pWnd->lParam;ig++){
  2354.                                        ListBox__DrawItems(hWnd,ig);
  2355.                                    }
  2356.                                    break;
  2357.                              case 7/*WM_LBUTTONUP*/:
  2358.                                    if(dwStyle & 0x00000001L /*SC_CAPTURE_TOP*/ || dwStyle & 0x00000002L /*SC_CAPTURE_BOTTOM*/ || dwStyle & 0x00000004L/*SC_CAPTURE_MIDDLE*/){
  2359.                                         if(dwStyle &0x00000008L /*SC_MOUSEOVER*/){
  2360.                                           RECT sl;sl.left = Rect.right - 18;sl.right = Rect.right-2;
  2361.                                           char bRedraw = 0;
  2362.                                           if(dwStyle & 0x00000001L /*SC_CAPTURE_TOP*/){
  2363.                                               if(pWnd->misc > 0){pWnd->misc--;bRedraw=1;}
  2364.                                               sl.top = Rect.top+2;sl.bottom=Rect.top+19;
  2365.                                               DrawFrameControl(&sl,3/*DFC_SCROLL*/,0x0000010L/*DFCS_SCROLLUP*/|0x00100000L/*WS_MOUSEOVER*/,0,0);
  2366.                                           }
  2367.                                           else if(dwStyle & 0x00000002L /*SC_CAPTURE_BOTTOM*/){
  2368.                                               if((pWnd->misc+((Rect.bottom- Rect.top-2)/15)) < pWnd->lParam){pWnd->misc++;bRedraw=1;}
  2369.                                               sl.top = Rect.bottom-19;sl.bottom=Rect.bottom-2;
  2370.                                               DrawFrameControl(&sl,3/*DFC_SCROLL*/,0x0000020L/*DFCS_SCROLLDOWN*/|0x00100000L/*WS_MOUSEOVER*/,0,0);
  2371.  
  2372.                                           }
  2373.                                           if(bRedraw)SendMessage(hWnd,8/*WM_PAINT*/ ,-1,-2);
  2374.                                         }
  2375.                                         STYLEMINUS(pWnd->dwStyle,0x00000001L /*SC_CAPTURE_TOP*/);
  2376.                                         STYLEMINUS(pWnd->dwStyle,0x00000002L /*SC_CAPTURE_BOTTOM*/);
  2377.                                         STYLEMINUS(pWnd->dwStyle,0x00000004L/*SC_CAPTURE_MIDDLE*/);
  2378.  
  2379.                                    }
  2380.                                    STYLEMINUS(pWnd->dwStyle,0x00000008L /*SC_MOUSEOVER*/);
  2381.                                    ReleaseCapture();
  2382.                                    break;
  2383.                              case 1/*WM_LBUTTONDOWN*/:
  2384.                                    if(MouseEvent.X > Rect.right - 19 || MouseEvent.Y > Rect.bottom-2 ){
  2385.                                          RECT scrollrect;scrollrect.left = Rect.right - 18;scrollrect.right = Rect.right-2;
  2386.                                          if(MouseEvent.Y < Rect.top+20){pWnd->dwStyle|= 0x00000001L /*SC_CAPTURE_TOP*/|0x00000008L /*SC_MOUSEOVER*/;
  2387.                                              scrollrect.top = Rect.top+2;scrollrect.bottom=Rect.top+19;
  2388.                                              DrawFrameControl(&scrollrect,3/*DFC_SCROLL*/,0x0000010L/*DFCS_SCROLLUP*/|0x0000200L/*DFCS_PUSHED*/|0x00100000L/*WS_MOUSEOVER*/,0,0);
  2389.                                          }
  2390.                                          else if(MouseEvent.Y > Rect.bottom-20){pWnd->dwStyle|= 0x00000002L /*SC_CAPTURE_BOTTOM*/|0x00000008L /*SC_MOUSEOVER*/;
  2391.                                              scrollrect.top = Rect.bottom-19;scrollrect.bottom=Rect.bottom-2;
  2392.                                              DrawFrameControl(&scrollrect,3/*DFC_SCROLL*/,0x0000020L/*DFCS_SCROLLDOWN*/|0x0000200L/*DFCS_PUSHED*/|0x00100000L/*WS_MOUSEOVER*/,0,0);
  2393.                                          }
  2394.                                          else {pWnd->dwStyle|= 0x00000004L/*SC_CAPTURE_MIDDLE*/;}
  2395.                                    }
  2396.                                    else {
  2397.                                      int nTop= MouseEvent.Y- Rect.top-2;
  2398.                                      int nLeft = MouseEvent.X - Rect.left;
  2399.                                      nTop = nTop / 15;
  2400.  
  2401.                                      if(!(pWnd->lParam <= nTop)){
  2402.                                         if(pWnd->misc2 != nTop){
  2403.                                              int mistmp = pWnd->misc2;
  2404.                                              if(pWnd->lParam <= nTop)nTop=-1;
  2405.                                              pWnd->misc2 = nTop;
  2406.                                              if(mistmp > -1)ListBox__DrawItems(hWnd,mistmp);
  2407.                                              if(nTop > -1)ListBox__DrawItems(hWnd,nTop);
  2408.                                         }
  2409.                                         if(GetWindow(hWnd-1)->nType == 8/*DFC_COMBOBOX*/ && dwStyle & 0x00000400L /*LV_AUTOSELECT*/){
  2410.                                           ShowWindow(hWnd,0);
  2411.                                           SetWindowText(hWnd-1,Diagram__GetCell(ListBox__GetCurSel(hWnd))->ClassName);
  2412.  
  2413.                                         }
  2414.                                         SendMessage(0,9 /*WM_COMMAND*/,201/*LV_ITEMCLICK*/,hWnd);
  2415.                                         if(GetWindow(hWnd-1)->nType == 8/*DFC_COMBOBOX*/ && dwStyle & 0x00000400L /*LV_AUTOSELECT*/){
  2416.                                             pWnd->misc2=-1;
  2417.                                         }
  2418.                                         break;
  2419.                                      }
  2420.                                    }
  2421.                                    SetCapture(hWnd);
  2422.                                    break;
  2423.                              case 12 /*WM_KILLFOCUS*/:
  2424.  
  2425.                                    if(GetWindow(hWnd-1)->nType == 8/*DFC_COMBOBOX*/ && dwStyle & 0x00000400L /*LV_AUTOSELECT*/ && lParam != hWnd-1 )ShowWindow(hWnd,0);
  2426.                                    break;
  2427.                              case 4/*WM_MOUSELEAVE*/:
  2428.                                    if(!(dwStyle & 0x00000400L /*LV_AUTOSELECT*/))break;
  2429.                                    int hh = pWnd->misc2;pWnd->misc2=-1;
  2430.                                    if(hh > -1){ListBox__DrawItems(hWnd,hh);}
  2431.                                    if(GetWindow(hWnd-1)->nType == 8/*DFC_COMBOBOX*/ && dwStyle & 0x00000400L /*LV_AUTOSELECT*/ )Invalidate(7/*IDC_COMBOBOX1*/);
  2432.                                    break;
  2433.                              case 3/* WM_MOUSEMOVE*/:
  2434.                                    if(dwStyle & 0x00000001L /*SC_CAPTURE_TOP*/ || dwStyle & 0x00000002L /*SC_CAPTURE_BOTTOM*/ || dwStyle & 0x00000004L/*SC_CAPTURE_MIDDLE*/){
  2435.                                       RECT nrect;
  2436.                                       long nState = 0x0000200L/*DFCS_PUSHED*/;
  2437.                                       nrect.left = Rect.right - 18;nrect.right = Rect.right-2;
  2438.                                       if(dwStyle & 0x00000001L /*SC_CAPTURE_TOP*/){
  2439.                                           nrect.top = Rect.top+2;nrect.bottom=Rect.top+19;
  2440.                                           nState|=0x0000010L/*DFCS_SCROLLUP*/;
  2441.                                       }
  2442.                                       if(dwStyle & 0x00000002L /*SC_CAPTURE_BOTTOM*/){
  2443.                                           nrect.top = Rect.bottom-19;nrect.bottom=Rect.bottom-2;
  2444.                                           nState|=0x0000020L/*DFCS_SCROLLDOWN*/;
  2445.                                       }
  2446.  
  2447.                                       if(PtInRect(MouseEvent.X,MouseEvent.Y,&nrect)){
  2448.                                          if(!(dwStyle & 0x00000008L /*SC_MOUSEOVER*/)){
  2449.                                              pWnd->dwStyle|=0x00000008L /*SC_MOUSEOVER*/;
  2450.                                              nState|=0x00100000L/*WS_MOUSEOVER*/;
  2451.                                              DrawFrameControl(&nrect,3/*DFC_SCROLL*/,nState,0,0);
  2452.                                          }
  2453.                                       }
  2454.                                       else if(dwStyle & 0x00000008L /*SC_MOUSEOVER*/){
  2455.                                           STYLEMINUS(pWnd->dwStyle,0x00000008L /*SC_MOUSEOVER*/);
  2456.                                           DrawFrameControl(&nrect,3/*DFC_SCROLL*/,nState,0,0);
  2457.  
  2458.                                       }
  2459.  
  2460.                                    }
  2461.                                    if((dwStyle & 0x00000400L /*LV_AUTOSELECT*/)){
  2462.                                    if(MouseEvent.X > Rect.right - 19 || MouseEvent.Y > Rect.bottom-2){
  2463.                                          int hh = pWnd->misc2;pWnd->misc2=-1;
  2464.                                          if(hh != -1){ListBox__DrawItems(hWnd,hh);}
  2465.                                          break;
  2466.                                    }
  2467.                                    int nTop= MouseEvent.Y- Rect.top-2;
  2468.  
  2469.                                    int nLeft = MouseEvent.X - Rect.left;
  2470.  
  2471.                                    nTop = nTop / 15;
  2472.                                    if(pWnd->misc2 != nTop){
  2473.                                       int mistmp = pWnd->misc2;
  2474.                                       if(pWnd->lParam <= nTop)nTop=-1;
  2475.                                       pWnd->misc2 = nTop;
  2476.                                       if(mistmp > -1)ListBox__DrawItems(hWnd,mistmp);
  2477.                                       if(nTop > -1)ListBox__DrawItems(hWnd,nTop);
  2478.  
  2479.                                    }
  2480.                                    }
  2481.                                    break;
  2482.                              case 16 /* WM_SHOWWINDOW */:
  2483.                                 if(GetWindow(hWnd-1)->nType == 8/*DFC_COMBOBOX*/ && dwStyle & 0x00000400L /*LV_AUTOSELECT*/){
  2484.                                            if(lParam == 0){
  2485.                                               GrKresliP²edm╪ty(16001,0,Rect.left,Rect.top,7,9);
  2486.                                               ListBox__DeleteAll(hWnd);
  2487.                                               Invalidate(hWnd-1);
  2488.  
  2489.                                               }
  2490.                                            else {
  2491.                                               GrNastavObrazP²edm╪tà(16001,Rect.left,Rect.top,7,9,1);
  2492.                                                  int iCell = 0;
  2493.                                                  for(; iCell < m_nm_DiagramCellsSize;iCell++){
  2494.                                                     ListBox__AddItem(hWnd,iCell,Diagram__GetCell(iCell)->ClassName);
  2495.                                                  }
  2496.                                                  if(pWnd->misc < 0)pWnd->misc=0;
  2497.                                                  if(pWnd->misc >= pWnd->lParam)pWnd->misc=0;
  2498.  
  2499.  
  2500.  
  2501.                                            }
  2502.                                }
  2503.       }
  2504.  
  2505.                  }
  2506.            }
  2507. -c1----------------------SEZNAM PODM╓NEK-----------TENTO ⁿ╡DEK NEM╖NIT!-------
  2508.  
  2509. =SP---------------------------------------------------------------------------
  2510. ;-h---------------------------------------------------------------------------
  2511. void main( void )
  2512. -s--DESINGER_MAIN_FUNCTION                                                      ■   4  -2 -35   3
  2513. DESIGNER
  2514.   1!
  2515. -o1----------------------SEZNAM OPERAC╓------------TENTO ⁿ╡DEK NEM╖NIT!-------
  2516. 1
  2517.  
  2518.  #ifndef _DEBUG
  2519.    EscPlus();
  2520.  #endif
  2521.  NoXP = (DOSArgument(1) == "-noxp");
  2522.  UnderXP = DOSVerze() == 5;
  2523.  _UNDER_WINDOWS_2k=( UnderXP && !NoXP);
  2524.   if(GrNastavMód((_UNDER_WINDOWS_2k)?2:3)==-1){KERNELSTOP(2);return;}
  2525.  
  2526.  #ifndef _DEBUG
  2527.     GrNaƒtiPaletu("*\\designer.dir\\common\\bitmap\\splash.pal");
  2528.     GrNastavV∞stup(2);
  2529.     MyτZaƒátekObsluhy();
  2530.     AnimNastavGrV∞stup(2);
  2531.     MouseObject = AnimP²edm╪tVytvo²(85,1,0,1);
  2532.   if( _UNDER_WINDOWS_2k)
  2533.    GrKresliP²edm╪ty(20001,0,110,80,11,10);
  2534.   else
  2535.    GrKresliP²edm╪ty(20001,0,196,155,11,10);
  2536.  #else
  2537.     GrNastavV∞stup(2);
  2538.     MyτZaƒátekObsluhy();
  2539.     AnimNastavGrV∞stup(2);
  2540.     MouseObject = AnimP²edm╪tVytvo²(85,1,0,1);
  2541.  
  2542.  #endif
  2543.   // check atributes
  2544.            if(SouborAtributy("*\\DESIGN.B17") &0x01 || SouborAtributy("*\\DESIGN.B16") &0x01) {
  2545.                SouborNastavAtributy("*\\DESIGN.B17",0x20);
  2546.                SouborNastavAtributy("*\\DESIGN.B16",0x20);
  2547.                if (DOSChyba()){
  2548.                     KERNELSTOP(1);
  2549.  
  2550.                }
  2551.            }
  2552.  
  2553.  // fonts ...
  2554.  //tahoma 8
  2555.  LoadFont("*\\DESIGNER.DIR\\GDI\\ta.bin",m_Tahoma8Height);
  2556.  LoadFont("*\\DESIGNER.DIR\\GDI\\tait.bin",m_TahomaItalic8Height);
  2557.  LoadFont("*\\DESIGNER.DIR\\GDI\\tabo.bin",m_TahomaBold8Height);
  2558.  LoadFont("*\\DESIGNER.DIR\\GDI\\taboit.bin",m_TahomaBoldItalic8Height);
  2559.  // arial 10
  2560.  LoadFont("*\\DESIGNER.DIR\\GDI\\arbo.bin",m_ArialBold10Height);
  2561.  LoadFont("*\\DESIGNER.DIR\\GDI\\arboit.bin",m_ArialBoldItalic10Height);
  2562.  
  2563.  InitCell(&m_MEMORY_CELL);
  2564.  SetPoint((POINT*)&m_StartDrag,-10,-10);
  2565.  InitControl();
  2566.  InitMenu();
  2567.    #ifdef _XP_THEME
  2568.     GrNastavBarvuPalety(1,55,54,53);
  2569.     FillSolidRect2(0,0,GrMaxX(),32,1);
  2570.    #else
  2571.     GrNastavBarvuPalety(0,53,52,50);
  2572.     FillSolidRect2(0,0,GrMaxX(),32,0);
  2573.    #endif
  2574.  
  2575.  GrNastavBarvuPalety(5,63,63,63);
  2576.  FillSolidRect2(0,32,GrMaxX(),GrMaxY(),5);
  2577.  
  2578.  if(!m_LastedMessage){
  2579.        if(UnderXP && NoXP)
  2580.           MyτNastavPozici(320,100);
  2581.        else
  2582.           MyτNastavPozici(GrMaxX()/2,GrMaxY()/2);
  2583.        AnimMouse();
  2584.        ApplyLayout();
  2585.  
  2586.  #ifdef _DEBUG
  2587.                strOpenFile="*\\designer.umd";
  2588.               SendMessage(DESKTOP,WM_COMMAND,1/*BN_CLICK*/,/*IDC_FILE_OPENING*/ 208);
  2589.  #else
  2590.           if(DOSPoƒetArgumentà() >= 1)
  2591.                strOpenFile=DOSArgument(1);
  2592.                SendMessage(DESKTOP,WM_COMMAND,1/*BN_CLICK*/,/*IDC_FILE_OPENING*/ 208);
  2593.  #endif
  2594.        while(!m_LastedMessage){
  2595.              KERNEL(); // KERNEL function
  2596.        }
  2597.   }
  2598.   else {KERNELSTOP(1);}
  2599.  
  2600.  
  2601.  
  2602.  
  2603. -c1----------------------SEZNAM PODM╓NEK-----------TENTO ⁿ╡DEK NEM╖NIT!-------
  2604. =SP---------------------------------------------------------------------------
  2605.  
  2606.  
  2607. // Konec souboru
  2608. /*DESIGNER.SGP ===== End =====================*/
  2609.  
  2610.