Subversion Repositories Kolibri OS

Rev

Rev 4146 | Rev 5439 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. idbChange       equ 2
  2. idbCreate       equ 3
  3. idbLeft         equ 4
  4. idbRight        equ 5
  5. idbCancel       equ 1
  6.  
  7. DlgAdd:
  8. DlgProp:
  9.  
  10.         mov     eax,[SelIcon]
  11.         mov     [DlgSelIcon],eax
  12.         cmp     eax,-1
  13.         jne     SetProp
  14.  
  15.     ;-----------
  16.         mov     eax,[MouseX]
  17.         mov     ebx,[MouseY]
  18.  
  19.         cmp     ax,[wsX]
  20.         jae     @f
  21.         mov     ax,[wsX]
  22.       @@:
  23.  
  24.         cmp     bx,[wsY]
  25.         jae     @f
  26.         mov     bx,[wsY]
  27.       @@:                           ;eax,ebx - ðåàëüíàÿ êîîðäèíàòà. Âñå êîîðäèíàòû â ïðîãå îòíîñèòåëüíî ëåâîãî âåðõíåãî óãëà ðàáî÷åé îáëàñòè
  28.  
  29.         xor     edx,edx
  30.         mov     dx,[wsXe]
  31.         sub     edx,ICON_SIZE
  32.         cmp     eax,edx
  33.         jbe     @f
  34.         mov     eax,edx
  35.       @@:
  36.  
  37.         mov     dx,[wsYe]
  38.         sub     edx,ICON_SIZE
  39.         cmp     ebx,edx
  40.         jbe     @f
  41.         mov     ebx,edx
  42.       @@:
  43.  
  44.         xor     edx,edx              ;ïðåîáðàçîâûâàåì â îòíîñèòåëüíûå
  45.         mov     dx,[wsW]
  46.         shr     edx,1
  47.         add     dx,[wsX]
  48.         cmp     eax,edx
  49.         jbe     @f
  50.         sub     ax,[wsXe]
  51.         inc     ax
  52.         jmp     .dlg1
  53.       @@:
  54.         sub     ax,[wsX]
  55.     .dlg1:
  56.  
  57.         xor     edx,edx
  58.         mov     dx,[wsH]
  59.         shr     edx,1
  60.         add     dx,[wsY]
  61.         cmp     ebx,edx
  62.         jbe     @f
  63.         sub     bx,[wsYe]
  64.         inc     bx
  65.         jmp     .dlg2
  66.       @@:
  67.         sub     bx,[wsY]
  68.     .dlg2:
  69.  
  70.         mov     [AddX],eax
  71.         mov     [AddY],ebx
  72.     ;-----------
  73.  
  74.         mov     ecx,NAME_LENGTH
  75.         mov     edi,DAreaName
  76.         xor     al,al
  77.         rep     stosb
  78.         mov     dword[edtName.size],0
  79.         mov     dword[edtName.pos],0
  80.  
  81.         mov     ecx,256
  82.         mov     edi,DAreaPath
  83.         rep     stosb
  84.         mov     dword[edtExePath.size],0
  85.         mov     dword[edtExePath.pos],0
  86.  
  87.         mov     ecx,256
  88.         mov     edi,DAreaParams
  89.         rep     stosb
  90.         mov     dword[edtParams.size],0
  91.         mov     dword[edtParams.pos],0
  92.  
  93.         mov     ecx,256
  94.         mov     edi,DAreaIcon
  95.         rep     stosb
  96.         mov     dword[edtIcon.size],0
  97.         mov     dword[edtIcon.pos],0
  98.  
  99.         jmp     startDlg
  100.     ;--------
  101. SetProp:
  102.         mov     esi,[IconsOffs+eax*4]
  103.         mov     edi,DAreaName
  104.         xor     ecx,ecx
  105.      @@:
  106.         lodsb
  107.         stosb
  108.         inc     ecx
  109.         test    al,al
  110.         jnz     @b
  111.         dec     ecx
  112.         mov     dword[edtName.size],ecx
  113.         mov     dword[edtName.pos],ecx
  114.  
  115.         xor     ecx,ecx
  116.         mov     edi,DAreaPath
  117.      @@:
  118.         lodsb
  119.         stosb
  120.         inc     ecx
  121.         test    al,al
  122.         jnz     @b
  123.         dec     ecx
  124.         mov     dword[edtExePath.size],ecx
  125.         mov     dword[edtExePath.pos],ecx
  126.  
  127.         xor     ecx,ecx
  128.         mov     edi,DAreaParams
  129.      @@:
  130.         lodsb
  131.         stosb
  132.         inc     ecx
  133.         test    al,al
  134.         jnz     @b
  135.         dec     ecx
  136.         mov     dword[edtParams.size],ecx
  137.         mov     dword[edtParams.pos],ecx
  138.  
  139.         xor     ecx,ecx
  140.         mov     edi,DAreaIcon
  141.      @@:
  142.         lodsb
  143.         stosb
  144.         inc     ecx
  145.         test    al,al
  146.         jnz     @b
  147.         dec     ecx
  148.         mov     dword[edtIcon.size],ecx
  149.         mov     dword[edtIcon.pos],ecx
  150.  
  151.  
  152. startDlg:
  153.         mcall   9,RBProcInfo,-1
  154.         mcall   18,21,dword[RBProcInfo+30]
  155.         mov     [slotDlgAdd],eax
  156.  
  157.         or      [edtName.flags],ed_focus
  158.  
  159.         mcall   40,100111b      ;SetMaskMessage 100111b
  160.         xor     eax,eax
  161.         mov     dword[MaxPage],0
  162.       @@:
  163.         add     eax,ICONS_DRAW_COUNTW
  164.         inc     dword[MaxPage]
  165.         cmp     eax,[icon_count]
  166.         jb      @b
  167.         dec     dword[MaxPage]
  168.         cmp     dword[MaxPage],0
  169.         jne     @f
  170.         mov     dword[MaxPage],1
  171.       @@:
  172.  
  173. DReDraw:
  174.         mcall   48,3,sc,40
  175.  
  176.         mov     eax,[sc.work]
  177.         rol     eax,16
  178.         add     al,9
  179.         jnc     @f
  180.         mov     al,0FFh
  181.       @@:
  182.         rol     eax,16
  183.         add     al,9
  184.         jnc     @f
  185.         mov     al,0FFh
  186.       @@:
  187.         add     ah,9
  188.         jnc     @f
  189.         mov     ah,0FFh
  190.       @@:
  191.  
  192.         mov     [sbIcons.bckg_col],eax
  193.         m2m     [sbIcons.frnt_col],[sc.work]
  194.         m2m     [sbIcons.line_col],[sc.work_graph]
  195.  
  196.         edit_boxes_set_sys_color edtName,edtExePath,sc
  197.         edit_boxes_set_sys_color edtExePath,edtParams,sc
  198.         edit_boxes_set_sys_color edtParams,edtIcon,sc
  199.         ;edit_boxes_set_sys_color edtIcon,endEdits,sc
  200.  
  201.         call    DRedrawWin
  202.  
  203. DMessages:
  204.         mcall   10              ;WaitMessage
  205.  
  206.         dec     eax
  207.         jz      DReDraw
  208.         dec     eax
  209.         jz      DKey
  210.         dec     eax
  211.         jz      DButton
  212.         sub     eax,3
  213.         jz      DMouse
  214.  
  215.         jmp  DMessages
  216.  
  217.  
  218. ;---------------------------------------------------------------------
  219. DKey:
  220.         mcall   2               ;GetKeyPressed
  221.         cmp     ah,1Bh
  222.         je      DExit
  223.         cmp     ah,9  ;Tab
  224.         je      DNextEdit
  225.         stdcall [edit_box_key],edtName
  226.         stdcall [edit_box_key],edtExePath
  227.         stdcall [edit_box_key],edtParams
  228.         ;stdcall [edit_box_key],edtIcon
  229.  
  230.         jmp     DMessages
  231.  
  232.  
  233. DNextEdit:
  234.         test    [edtName.flags],ed_focus
  235.         jne      .DNE1
  236.         test    [edtExePath.flags],ed_focus
  237.         jne      .DNE2
  238.         test    [edtParams.flags],ed_focus
  239.         jne      .DNE3
  240.         ;test    [edtIcon.flags],ed_focus
  241.         ;jne      .DNE4
  242.         jmp     DMessages
  243.  
  244.     .DNE1:
  245.         and     [edtName.flags],not ed_focus
  246.         or      [edtExePath.flags],ed_focus
  247.         stdcall [edit_box_draw],edtName
  248.         stdcall [edit_box_draw],edtExePath
  249.         jmp     DMessages
  250.  
  251.     .DNE2:
  252.         and     [edtExePath.flags],not ed_focus
  253.         or      [edtParams.flags],ed_focus
  254.         stdcall [edit_box_draw],edtExePath
  255.         stdcall [edit_box_draw],edtParams
  256.         jmp     DMessages
  257.  
  258.     .DNE3:
  259.         and     [edtParams.flags],not ed_focus
  260.         or      [edtName.flags],ed_focus
  261.         stdcall [edit_box_draw],edtParams
  262.         stdcall [edit_box_draw],edtName
  263.         jmp     DMessages
  264.  
  265.     ;.DNE4:
  266.     ;    and     [edtIcon.flags],not ed_focus
  267.     ;    or      [edtName.flags],ed_focus
  268.     ;    stdcall [edit_box_draw],edtName
  269.     ;    stdcall [edit_box_draw],edtIcon
  270.     ;    jmp     DMessages
  271. ;---------------------------------------------------------------------
  272. DButton:
  273.         mcall   17              ;GetButtonPressed
  274.         cmp     ah, idbCancel
  275.         je      DExit
  276.         cmp     ah,idbChange
  277.         je      DSetExePath
  278.         cmp     ah,idbCreate
  279.         je      DSaveIcon
  280.  
  281.         jmp     DMessages
  282. ;-------------------------------------------------------------------------------
  283. DMouse:
  284.         stdcall [edit_box_mouse],edtName
  285.         stdcall [edit_box_mouse],edtExePath
  286.         stdcall [edit_box_mouse],edtParams
  287. ;        stdcall [edit_box_mouse],edtIcon
  288.  
  289.         push    [sbIcons.position]
  290.         stdcall [scrollbar_h_mouse],sbIcons
  291.         pop     eax
  292.         cmp     eax,[sbIcons.position]
  293.         je      @f
  294.         call    DrawStdIcons
  295.       @@:
  296.  
  297.         mcall   37,2            ;GetMouseKey
  298.         test    eax,1
  299.         jz      DMessages
  300.         mcall   37,1            ;GetMouseWinPos
  301.  
  302.         test    eax,10001000h
  303.         jne     DMessages
  304.         xor     edx,edx
  305.         mov     dx,ax     ;y
  306.         shr     eax,16    ;x
  307.  
  308.         sub     eax,ICONSX
  309.         js      DMessages
  310.         sub     edx,ICONSY
  311.         js      DMessages
  312.  
  313.         cmp     eax,(IMG_SIZE+SPCW)*ICONS_DRAW_COUNTW-SPCW
  314.         ja      DMessages
  315.         cmp     edx,(IMG_SIZE+SPCH)*ICONS_DRAW_COUNTH-SPCH
  316.         ja      DMessages
  317.  
  318.         xor     ebx,ebx
  319.         mov     ecx,[sbIcons.position]
  320.         test    ecx,ecx
  321.         jz      .DM
  322.      @@:
  323.         add     ebx,ICONS_DRAW_COUNTH
  324.         loop    @b
  325.      .DM:
  326.  
  327.         sub     eax,IMG_SIZE+SPCW
  328.         js     .DM1
  329.      @@:
  330.         add     ebx,ICONS_DRAW_COUNTH
  331.         sub     eax,IMG_SIZE+SPCW
  332.         jns     @b
  333.      .DM1:
  334.  
  335.  
  336.         sub     edx,IMG_SIZE+SPCH
  337.         js     .DM2
  338.      @@:
  339.         inc     ebx
  340.         sub     edx,IMG_SIZE+SPCH
  341.         jns     @b
  342.      .DM2:
  343.  
  344.         mov     eax,ebx
  345.  
  346.         cmp     eax,[icon_count]
  347.         jae     DMessages
  348.  
  349.         mov     bl,10
  350.         div     bl
  351.  
  352.         add     ah,30h
  353.         test    al,al
  354.         jz      @f
  355.  
  356.         add     al,30h
  357.         mov     byte[DAreaIcon],al
  358.         mov     byte[DAreaIcon+1],ah
  359.         mov     byte[DAreaIcon+2],0
  360.         mov     dword[edtIcon.size],2
  361.         jmp     .RedrawNum
  362.  
  363.       @@:
  364.         mov     byte[DAreaIcon],ah
  365.         mov     byte[DAreaIcon+1],0
  366.         mov     dword[edtIcon.size],1
  367.         jmp     .RedrawNum
  368.     .RedrawNum:
  369.  
  370.  
  371.       ;  stdcall [edit_box_draw],edtIcon
  372.  
  373.  
  374.         call    DrawSelIcon
  375.         jmp     DReDraw;DMessages;
  376. ;-------------------------------------------------------------------------------
  377. DSetExePath:
  378.         stdcall [OpenDialog_Start],OpenDialog_data
  379.         mov     edi,DAreaPath
  380.         xor     al,al
  381.         or      ecx,-1
  382.         repne   scasb
  383.         sub     edi,DAreaPath
  384.         dec     edi
  385.         mov     dword[edtExePath+12*4],edi
  386.  
  387.         jmp     DMessages;DReDraw;
  388.  
  389. DSaveIcon:
  390.         mov     edi,DAreaName
  391.         mov     esi,secRButt
  392.     @@: lodsb
  393.         scasb
  394.         jne     @f
  395.         test    al,al
  396.         jnz     @b
  397.  
  398.         mov     dword[fiRunProg+8],ErrName
  399.         mov     dword[fiRunProg+21],pthNotify
  400.         mcall   70,fiRunProg
  401.  
  402.         jmp     DMessages
  403.     @@:
  404.         mov     dword[fiRunProg+8],WarningSave
  405.         mov     dword[fiRunProg+21],pthNotify
  406.         mcall   70,fiRunProg
  407.  
  408.  
  409.         cmp     [DlgSelIcon],-1
  410.         je      @f
  411.                        
  412.         stdcall EditIcon,[DlgSelIcon],DAreaIcon,DAreaName,DAreaPath,DAreaParams
  413.         mov     ebx,[DlgSelIcon]
  414.         mov     eax,[IconsID+ebx*4]
  415.         jmp     DExitAndSave
  416.      @@:
  417.  
  418.         call    GenerateID
  419.  
  420.         mov     ebx,[MaxNumIcon]
  421.         mov     [IconsID+ebx*4],eax
  422.         push    eax
  423.         stdcall AddIcon,[AddX],[AddY],DAreaIcon,DAreaName,DAreaPath,DAreaParams
  424.         pop     eax
  425.  
  426. ;-------------------------------------------------------------------------------
  427. DExitAndSave:
  428.  
  429.         mov     dword[nameSection],eax
  430.         stdcall [ini_set_str],IconIni,nameSection,keyName,DAreaName,dword[edtName.size]
  431.         stdcall [ini_set_str],IconIni,nameSection,keyPath,DAreaPath,dword[edtExePath.size]
  432.         stdcall [ini_set_str],IconIni,nameSection,keyParams,DAreaParams,dword[edtParams.size]
  433.         stdcall [ini_set_str],IconIni,nameSection,keyIco,DAreaIcon,dword[edtIcon.size]
  434.  
  435.         cmp     [DlgSelIcon],-1
  436.         jne     @f
  437.         stdcall [ini_set_int],IconIni,nameSection,keyX,[MouseX]
  438.         stdcall [ini_set_int],IconIni,nameSection,keyY,[MouseY]
  439.       @@:
  440. DExit:
  441.         mov     [DlgAddActiv],0
  442.         mov     [slotDlgAdd],0
  443.         mcall   -1              ;ExitThread
  444.  
  445. ;##################################################################
  446. proc DRedrawWin
  447.         mcall   12,1            ;RedrawWinBeg
  448.         mov     edx,[sc.work]
  449.         or      edx,34000000h
  450.         cmp     [DlgSelIcon],-1
  451.         jne      @f
  452.         mov     edi,DTitleAdd
  453.         jmp     .l1
  454.       @@:
  455.         mov     edi,DTitleProp
  456.       .l1:
  457.         mcall   0,<100,400>,<100,(IMG_SIZE+SPCH)*ICONS_DRAW_COUNTH+165>,,,
  458.  
  459.         stdcall [edit_box_draw],edtName
  460.         stdcall [edit_box_draw],edtExePath
  461.         stdcall [edit_box_draw],edtParams
  462. ;        stdcall [edit_box_draw],edtIcon
  463.  
  464.         call    DrawStdIcons
  465.  
  466.  
  467.         stdcall [scrollbar_h_draw],sbIcons
  468.         mcall   38,<ICONSX+1,END_ICONS_AREAW-2>,\
  469.                    <END_ICONS_AREAH+3,END_ICONS_AREAH+3>,\
  470.                 [sc.work_graph]
  471.         mcall     ,<ICONSX+1,END_ICONS_AREAW-2>,\
  472.                    <END_ICONS_AREAH+3+15,END_ICONS_AREAH+3+15>,\
  473.                 [sc.work_graph]
  474.  
  475.         mcall     ,<ICONSX,ICONSX>,\
  476.                    <END_ICONS_AREAH+3+1,END_ICONS_AREAH+3+15-1>,\
  477.                 [sc.work_graph]
  478.         mcall     ,<END_ICONS_AREAW-1,END_ICONS_AREAW-1>,\
  479.                    <END_ICONS_AREAH+3+1,END_ICONS_AREAH+3+15-1>,\
  480.                 [sc.work_graph]
  481.  
  482.                                   ;BUTTONS
  483.         mcall   8,<250,49>,<30+END_ICONS_AREAH,16>,idbCreate,[sc.work_button]
  484.         mcall    ,<305,54>,                       ,idbCancel
  485.         mcall    ,<351,14>,<26,14>             ,idbChange
  486.  
  487.                                   ;CAPTIONS
  488.         mov     ecx,[sc.work_text]
  489.         or      ecx,80000000h
  490.         mcall   4,<30+IMG_SIZE,10>,,DCaptName
  491.         mcall    ,<30+IMG_SIZE,30>,,DCaptPath
  492.         mcall    ,<30+IMG_SIZE,50>,,DCaptParams
  493.         ;mcall    ,<30+IMG_SIZE,70>,,DCaptIcon
  494.  
  495. if lang eq ru
  496.         mov     ecx,[sc.work_button_text]
  497.         or      ecx,80000000h
  498.         mcall    ,<309,35+END_ICONS_AREAH>,,DCaptCancel
  499.  
  500.         cmp     [DlgSelIcon],-1
  501.         jne     @f
  502.         mpack   ebx,255,35+END_ICONS_AREAH
  503.         mov     edx,DCaptCreate
  504.         jmp     .DRD1
  505.       @@:
  506.         mpack   ebx,252,35+END_ICONS_AREAH
  507.         mov     edx,DCaptProperties
  508.      .DRD1:
  509. else
  510.         mov     ecx,[sc.work_button_text]
  511.         or      ecx,80000000h
  512.         mcall    ,<315,35+END_ICONS_AREAH>,,DCaptCancel
  513.  
  514.  
  515.         cmp     [DlgSelIcon],-1
  516.         jne     @f
  517.         mpack   ebx,257,35+END_ICONS_AREAH
  518.         mov     edx,DCaptCreate
  519.         jmp     .DRD1
  520.       @@:
  521.         mpack   ebx,257,35+END_ICONS_AREAH
  522.         mov     edx,DCaptProperties
  523.      .DRD1:
  524. end if
  525.         mcall
  526.  
  527.         mcall   1,351+4  ,26+10,[sc.work_button_text]
  528.         mcall    ,351+4+3,26+10,
  529.         mcall    ,351+4+6,26+10,
  530.  
  531.         call DrawSelIcon
  532.  
  533.         mcall   12,2            ;RedrawWinEnd
  534.         ret
  535. endp
  536.  
  537.  
  538. proc DrawStdIcons
  539. local IcoX:DWORD,\
  540.       IcoY:DWORD,\
  541.       iIcon:DWORD
  542.  
  543.         mov     ecx,[sbIcons.position]
  544.         xor     eax,eax
  545.         m2m     dword[iIcon],0
  546.  
  547.         test    ecx,ecx
  548.         jz      .DST1
  549.      @@:
  550.         add     [iIcon],ICONS_DRAW_COUNTH
  551.         add     eax,IMG_SIZE*IMG_SIZE*4*ICONS_DRAW_COUNTH
  552.         loop    @b
  553.    .DST1:
  554.  
  555.         lea     esi,[eax+44]
  556.         add     esi,[raw_pointer]
  557.  
  558.         mov     [IcoX],ICONSX
  559.  
  560.         mov     ecx,ICONS_DRAW_COUNTW
  561.   .DrawIcons:
  562.         push    ecx
  563.  
  564.         mov     [IcoY],ICONSY
  565.  
  566.         mov     ecx,ICONS_DRAW_COUNTH
  567.   .DrawIcoStolb:
  568.         push    ecx
  569.  
  570.         mov     edi,DlgBufImg
  571.         mov     edx,IMG_SIZE
  572.  
  573.     .DrawLine:
  574.  
  575.  
  576.         mov     ecx,IMG_SIZE
  577.      .DrawPix:
  578.  
  579.         lodsd
  580.         test    eax,0FF000000h
  581.         jnz     @f
  582.         mov     eax,[sc.work]
  583.      @@:
  584.  
  585.         mov     [edi],ax
  586.         shr     eax,16
  587.         mov     [edi+2],al
  588.         add     edi,3
  589.  
  590.         loop    .DrawPix
  591.  
  592.         dec     edx
  593.         jnz    .DrawLine
  594.  
  595.         mov     edx,[IcoX]
  596.         shl     edx,16
  597.         mov     dx,word[IcoY]
  598.         mcall   7,DlgBufImg,<IMG_SIZE,IMG_SIZE>
  599.  
  600.         inc     [iIcon]
  601.         mov     eax,[iIcon]
  602.         cmp     eax,[icon_count]
  603.         jae     .endDrawIcon
  604.  
  605.         add     dword[IcoY],IMG_SIZE+SPCH
  606.         pop     ecx
  607.         loop    .DrawIcoStolb
  608.  
  609.         add     dword[IcoX],IMG_SIZE+SPCW
  610.         pop     ecx
  611.         loop    .DrawIcons
  612.         jmp     .endProc
  613.  
  614.     .endDrawIcon:
  615.  
  616.         mov     ecx,IMG_SIZE*IMG_SIZE
  617.         mov     edi,DlgBufImg
  618.         mov     eax,[sc.work]
  619.         mov     ebx,eax
  620.         shr     ebx,16
  621.      @@:
  622.         mov     word[edi],ax
  623.         mov     [edi+2],bl
  624.         add     edi,3
  625.         loop    @b
  626.  
  627.                                      ;çàòèðàíèå íå èñïîëüçîâàíûõ ìåñò
  628.         jmp     .Dalee
  629.  
  630.   .DrawIcons2:
  631.         push    ecx
  632.  
  633.         mov     [IcoY],ICONSY
  634.         mov     ecx,ICONS_DRAW_COUNTH
  635.   .DrawIcoStolb2:
  636.         push    ecx
  637.  
  638.         mov     edx,[IcoX]
  639.         shl     edx,16
  640.         mov     dx,word[IcoY]
  641.         mcall   7,DlgBufImg,<IMG_SIZE,IMG_SIZE>
  642.  
  643.      .Dalee:
  644.         add     dword[IcoY],IMG_SIZE+SPCH
  645.         pop     ecx
  646.         loop    .DrawIcoStolb2
  647.  
  648.         add     dword[IcoX],IMG_SIZE+SPCW
  649.         pop     ecx
  650.         loop    .DrawIcons2
  651.  
  652.    .endProc:
  653.  
  654.         ret
  655. endp
  656.  
  657. proc DrawSelIcon
  658.         mov     edi,DAreaIcon
  659.         cmp     byte[edi],0
  660.         jne     @f
  661.         ret
  662.       @@:
  663.  
  664.         mov     al,[edi]
  665.         cmp     al,'9'
  666.         ja      .PathToIcon
  667.         cmp     al,'/'
  668.         jne     .GetIconInd
  669.    .PathToIcon:
  670.         mov     al,30h           ;çàãëóøêà!!!!!!!!!!!!!
  671.         mov     byte[edi+1],0
  672.    .GetIconInd:
  673. ;int3
  674.         sub     al,30h
  675.         cmp     byte[edi+1],0
  676.         je      @f
  677.         shl     eax,1
  678.         lea     eax,[eax*4+eax]
  679.         xor     edx,edx
  680.         mov     dl,[edi+1]
  681.         sub     dl,30h
  682.         add     eax,edx
  683.      @@:             ;eax=num icon
  684.         cmp     eax,[icon_count]
  685.         jb      @f
  686.         xor     eax,eax
  687.      @@:
  688.         test    eax,eax
  689.         je      .DI1
  690.         mov     ecx,eax
  691.         xor     eax,eax
  692.       @@:
  693.         add     eax,IMG_SIZE*IMG_SIZE*4
  694.         loop    @b
  695.      .DI1:
  696.         mov     esi,eax
  697.         add     esi,[raw_pointer]
  698.         add     esi,44
  699.  
  700.         mov     edi,DlgBufImg
  701.         mov     edx,IMG_SIZE
  702.     .DrawLine:
  703.  
  704.         mov     ecx,IMG_SIZE
  705.      .DrawPix:
  706.  
  707.         lodsd
  708.         test    eax,0FF000000h
  709.         jnz     @f
  710.         mov     eax,[sc.work]
  711.      @@:
  712.  
  713.         mov     word[edi],ax
  714.         shr     eax,16
  715.         mov     [edi+2],al
  716.         add     edi,3
  717.  
  718.         loop    .DrawPix
  719.  
  720.         dec     edx
  721.         jnz     .DrawLine
  722.  
  723.         mcall   7,DlgBufImg,<IMG_SIZE,IMG_SIZE>,<15,15>
  724.  
  725.         ret
  726. endp