Subversion Repositories Kolibri OS

Rev

Rev 4336 | 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 edtIcon,endEdits,sc
  197.         edit_boxes_set_sys_color edtName,endEdits,sc
  198.  
  199.         call    DRedrawWin
  200.  
  201. DMessages:
  202.         mcall   10              ;WaitMessage
  203.  
  204.         dec     eax
  205.         jz      DReDraw
  206.         dec     eax
  207.         jz      DKey
  208.         dec     eax
  209.         jz      DButton
  210.         sub     eax,3
  211.         jz      DMouse
  212.  
  213.         jmp  DMessages
  214.  
  215.  
  216. ;---------------------------------------------------------------------
  217. DKey:
  218.         mcall   2               ;GetKeyPressed
  219.         cmp     ah,1Bh
  220.         je      DExit
  221.         cmp     ah,9  ;Tab
  222.         je      DNextEdit
  223.         stdcall [edit_box_key],edtName
  224.         stdcall [edit_box_key],edtExePath
  225.         stdcall [edit_box_key],edtParams
  226.         ;stdcall [edit_box_key],edtIcon
  227.  
  228.         jmp     DMessages
  229.  
  230.  
  231. DNextEdit:
  232.         test    [edtName.flags],ed_focus
  233.         jne      .DNE1
  234.         test    [edtExePath.flags],ed_focus
  235.         jne      .DNE2
  236.         test    [edtParams.flags],ed_focus
  237.         jne      .DNE3
  238.         ;test    [edtIcon.flags],ed_focus
  239.         ;jne      .DNE4
  240.         jmp     DMessages
  241.  
  242.     .DNE1:
  243.         and     [edtName.flags],not ed_focus
  244.         or      [edtExePath.flags],ed_focus
  245.         stdcall [edit_box_draw],edtName
  246.         stdcall [edit_box_draw],edtExePath
  247.         jmp     DMessages
  248.  
  249.     .DNE2:
  250.         and     [edtExePath.flags],not ed_focus
  251.         or      [edtParams.flags],ed_focus
  252.         stdcall [edit_box_draw],edtExePath
  253.         stdcall [edit_box_draw],edtParams
  254.         jmp     DMessages
  255.  
  256.     .DNE3:
  257.         and     [edtParams.flags],not ed_focus
  258.         or      [edtName.flags],ed_focus
  259.         stdcall [edit_box_draw],edtParams
  260.         stdcall [edit_box_draw],edtName
  261.         jmp     DMessages
  262.  
  263.     ;.DNE4:
  264.     ;    and     [edtIcon.flags],not ed_focus
  265.     ;    or      [edtName.flags],ed_focus
  266.     ;    stdcall [edit_box_draw],edtName
  267.     ;    stdcall [edit_box_draw],edtIcon
  268.     ;    jmp     DMessages
  269. ;---------------------------------------------------------------------
  270. DButton:
  271.         mcall   17              ;GetButtonPressed
  272.         cmp     ah, idbCancel
  273.         je      DExit
  274.         cmp     ah,idbChange
  275.         je      DSetExePath
  276.         cmp     ah,idbCreate
  277.         je      DSaveIcon
  278.  
  279.         jmp     DMessages
  280. ;-------------------------------------------------------------------------------
  281. DMouse:
  282.         stdcall [edit_box_mouse],edtName
  283.         stdcall [edit_box_mouse],edtExePath
  284.         stdcall [edit_box_mouse],edtParams
  285. ;        stdcall [edit_box_mouse],edtIcon
  286.  
  287.         push    [sbIcons.position]
  288.         stdcall [scrollbar_h_mouse],sbIcons
  289.         pop     eax
  290.         cmp     eax,[sbIcons.position]
  291.         je      @f
  292.         call    DrawStdIcons
  293.       @@:
  294.  
  295.         mcall   37,2            ;GetMouseKey
  296.         test    eax,1
  297.         jz      DMessages
  298.         mcall   37,1            ;GetMouseWinPos
  299.  
  300.         test    eax,10001000h
  301.         jne     DMessages
  302.         xor     edx,edx
  303.         mov     dx,ax     ;y
  304.         shr     eax,16    ;x
  305.  
  306.         sub     eax,ICONSX
  307.         js      DMessages
  308.         sub     edx,ICONSY
  309.         js      DMessages
  310.  
  311.         cmp     eax,(IMG_SIZE+SPCW)*ICONS_DRAW_COUNTW-SPCW
  312.         ja      DMessages
  313.         cmp     edx,(IMG_SIZE+SPCH)*ICONS_DRAW_COUNTH-SPCH
  314.         ja      DMessages
  315.  
  316.         xor     ebx,ebx
  317.         mov     ecx,[sbIcons.position]
  318.         test    ecx,ecx
  319.         jz      .DM
  320.      @@:
  321.         add     ebx,ICONS_DRAW_COUNTH
  322.         loop    @b
  323.      .DM:
  324.  
  325.         sub     eax,IMG_SIZE+SPCW
  326.         js     .DM1
  327.      @@:
  328.         add     ebx,ICONS_DRAW_COUNTH
  329.         sub     eax,IMG_SIZE+SPCW
  330.         jns     @b
  331.      .DM1:
  332.  
  333.  
  334.         sub     edx,IMG_SIZE+SPCH
  335.         js     .DM2
  336.      @@:
  337.         inc     ebx
  338.         sub     edx,IMG_SIZE+SPCH
  339.         jns     @b
  340.      .DM2:
  341.  
  342.         mov     eax,ebx
  343.  
  344.         cmp     eax,[icon_count]
  345.         jae     DMessages
  346.  
  347.         mov     bl,10
  348.         div     bl
  349.  
  350.         add     ah,30h
  351.         test    al,al
  352.         jz      @f
  353.  
  354.         add     al,30h
  355.         mov     byte[DAreaIcon],al
  356.         mov     byte[DAreaIcon+1],ah
  357.         mov     byte[DAreaIcon+2],0
  358.         mov     dword[edtIcon.size],2
  359.         jmp     .RedrawNum
  360.  
  361.       @@:
  362.         mov     byte[DAreaIcon],ah
  363.         mov     byte[DAreaIcon+1],0
  364.         mov     dword[edtIcon.size],1
  365.         jmp     .RedrawNum
  366.     .RedrawNum:
  367.  
  368.  
  369.       ;  stdcall [edit_box_draw],edtIcon
  370.  
  371.  
  372.         call    DrawSelIcon
  373.         jmp     DReDraw;DMessages;
  374. ;-------------------------------------------------------------------------------
  375. DSetExePath:
  376.         stdcall [OpenDialog_Start],OpenDialog_data
  377.         mov     edi,DAreaPath
  378.         xor     al,al
  379.         or      ecx,-1
  380.         repne   scasb
  381.         sub     edi,DAreaPath
  382.         dec     edi
  383.         mov     dword[edtExePath+12*4],edi
  384.  
  385.         jmp     DMessages;DReDraw;
  386.  
  387. DSaveIcon:
  388.         mov     edi,DAreaName
  389.         mov     esi,secRButt
  390.     @@: lodsb
  391.         scasb
  392.         jne     @f
  393.         test    al,al
  394.         jnz     @b
  395.  
  396.         mov     dword[fiRunProg+8],ErrName
  397.         mov     dword[fiRunProg+21],pthNotify
  398.         mcall   70,fiRunProg
  399.  
  400.         jmp     DMessages
  401.     @@:
  402.         mov     dword[fiRunProg+8],WarningSave
  403.         mov     dword[fiRunProg+21],pthNotify
  404.         mcall   70,fiRunProg
  405.  
  406.  
  407.         cmp     [DlgSelIcon],-1
  408.         je      @f
  409.  
  410.         stdcall EditIcon,[DlgSelIcon],DAreaIcon,DAreaName,DAreaPath,DAreaParams
  411.         mov     ebx,[DlgSelIcon]
  412.         mov     eax,[IconsID+ebx*4]
  413.         jmp     DExitAndSave
  414.      @@:
  415.  
  416.         call    GenerateID
  417.  
  418.         mov     ebx,[MaxNumIcon]
  419.         mov     [IconsID+ebx*4],eax
  420.         push    eax
  421.         stdcall AddIcon,[AddX],[AddY],DAreaIcon,DAreaName,DAreaPath,DAreaParams
  422.         pop     eax
  423.  
  424. ;-------------------------------------------------------------------------------
  425. DExitAndSave:
  426.  
  427.         mov     dword[nameSection],eax
  428.         stdcall [ini_set_str],IconIni,nameSection,keyName,DAreaName,dword[edtName.size]
  429.         stdcall [ini_set_str],IconIni,nameSection,keyPath,DAreaPath,dword[edtExePath.size]
  430.         stdcall [ini_set_str],IconIni,nameSection,keyParams,DAreaParams,dword[edtParams.size]
  431.         stdcall [ini_set_str],IconIni,nameSection,keyIco,DAreaIcon,dword[edtIcon.size]
  432.  
  433.         cmp     [DlgSelIcon],-1
  434.         jne     @f
  435.         stdcall [ini_set_int],IconIni,nameSection,keyX,[MouseX]
  436.         stdcall [ini_set_int],IconIni,nameSection,keyY,[MouseY]
  437.       @@:
  438. DExit:
  439.         mov     [DlgAddActiv],0
  440.         mov     [slotDlgAdd],0
  441.         mcall   -1              ;ExitThread
  442.  
  443. ;##################################################################
  444. proc DRedrawWin
  445.         mcall   12,1            ;RedrawWinBeg
  446.         mov     edx,[sc.work]
  447.         or      edx,34000000h
  448.         cmp     [DlgSelIcon],-1
  449.         jne      @f
  450.         mov     edi,DTitleAdd
  451.         jmp     .l1
  452.       @@:
  453.         mov     edi,DTitleProp
  454.       .l1:
  455.         mcall   0,<100,400>,<100,(IMG_SIZE+SPCH)*ICONS_DRAW_COUNTH+165>,,,
  456.  
  457.         stdcall [edit_box_draw],edtName
  458.         stdcall [edit_box_draw],edtExePath
  459.         stdcall [edit_box_draw],edtParams
  460. ;        stdcall [edit_box_draw],edtIcon
  461.  
  462.         call    DrawStdIcons
  463.  
  464.  
  465.         stdcall [scrollbar_h_draw],sbIcons
  466.         mcall   38,<ICONSX+1,END_ICONS_AREAW-2>,\
  467.                    <END_ICONS_AREAH+3,END_ICONS_AREAH+3>,\
  468.                 [sc.work_graph]
  469.         mcall     ,<ICONSX+1,END_ICONS_AREAW-2>,\
  470.                    <END_ICONS_AREAH+3+15,END_ICONS_AREAH+3+15>,\
  471.                 [sc.work_graph]
  472.  
  473.         mcall     ,<ICONSX,ICONSX>,\
  474.                    <END_ICONS_AREAH+3+1,END_ICONS_AREAH+3+15-1>,\
  475.                 [sc.work_graph]
  476.         mcall     ,<END_ICONS_AREAW-1,END_ICONS_AREAW-1>,\
  477.                    <END_ICONS_AREAH+3+1,END_ICONS_AREAH+3+15-1>,\
  478.                 [sc.work_graph]
  479.  
  480.                                   ;BUTTONS
  481.         mcall   8,<250,49>,<30+END_ICONS_AREAH,16>,idbCreate,[sc.work_button]
  482.         mcall    ,<305,54>,                       ,idbCancel
  483.         mcall    ,<351,14>,<26,14>             ,idbChange
  484.  
  485.                                   ;CAPTIONS
  486.         mov     ecx,[sc.work_text]
  487.         or      ecx,80000000h
  488.         mcall   4,<30+IMG_SIZE,10>,,DCaptName
  489.         mcall    ,<30+IMG_SIZE,30>,,DCaptPath
  490.         mcall    ,<30+IMG_SIZE,50>,,DCaptParams
  491.         ;mcall    ,<30+IMG_SIZE,70>,,DCaptIcon
  492.  
  493. if lang eq ru
  494.         mov     ecx,[sc.work_button_text]
  495.         or      ecx,80000000h
  496.         mcall    ,<309,35+END_ICONS_AREAH>,,DCaptCancel
  497.  
  498.         cmp     [DlgSelIcon],-1
  499.         jne     @f
  500.         mpack   ebx,255,35+END_ICONS_AREAH
  501.         mov     edx,DCaptCreate
  502.         jmp     .DRD1
  503.       @@:
  504.         mpack   ebx,252,35+END_ICONS_AREAH
  505.         mov     edx,DCaptProperties
  506.      .DRD1:
  507. else
  508.         mov     ecx,[sc.work_button_text]
  509.         or      ecx,80000000h
  510.         mcall    ,<315,35+END_ICONS_AREAH>,,DCaptCancel
  511.  
  512.  
  513.         cmp     [DlgSelIcon],-1
  514.         jne     @f
  515.         mpack   ebx,257,35+END_ICONS_AREAH
  516.         mov     edx,DCaptCreate
  517.         jmp     .DRD1
  518.       @@:
  519.         mpack   ebx,257,35+END_ICONS_AREAH
  520.         mov     edx,DCaptProperties
  521.      .DRD1:
  522. end if
  523.         mcall
  524.  
  525.         mcall   1,351+4  ,26+10,[sc.work_button_text]
  526.         mcall    ,351+4+3,26+10,
  527.         mcall    ,351+4+6,26+10,
  528.  
  529.         call DrawSelIcon
  530.  
  531.         mcall   12,2            ;RedrawWinEnd
  532.         ret
  533. endp
  534.  
  535.  
  536. proc DrawStdIcons
  537. local IcoX:DWORD,\
  538.       IcoY:DWORD,\
  539.       iIcon:DWORD
  540.  
  541.         mov     ecx,[sbIcons.position]
  542.         xor     eax,eax
  543.         m2m     dword[iIcon],0
  544.  
  545.         test    ecx,ecx
  546.         jz      .DST1
  547.      @@:
  548.         add     [iIcon],ICONS_DRAW_COUNTH
  549.         add     eax,IMG_SIZE*IMG_SIZE*4*ICONS_DRAW_COUNTH
  550.         loop    @b
  551.    .DST1:
  552.  
  553.         lea     esi,[eax+44]
  554.         add     esi,[raw_pointer]
  555.  
  556.         mov     [IcoX],ICONSX
  557.  
  558.         mov     ecx,ICONS_DRAW_COUNTW
  559.   .DrawIcons:
  560.         push    ecx
  561.  
  562.         mov     [IcoY],ICONSY
  563.  
  564.         mov     ecx,ICONS_DRAW_COUNTH
  565.   .DrawIcoStolb:
  566.         push    ecx
  567.  
  568.         mov     edi,DlgBufImg
  569.         mov     edx,IMG_SIZE
  570.  
  571.     .DrawLine:
  572.  
  573.  
  574.         mov     ecx,IMG_SIZE
  575.      .DrawPix:
  576.  
  577.         lodsd
  578.         test    eax,0FF000000h
  579.         jnz     @f
  580.         mov     eax,[sc.work]
  581.      @@:
  582.  
  583.         mov     [edi],ax
  584.         shr     eax,16
  585.         mov     [edi+2],al
  586.         add     edi,3
  587.  
  588.         loop    .DrawPix
  589.  
  590.         dec     edx
  591.         jnz    .DrawLine
  592.  
  593.         mov     edx,[IcoX]
  594.         shl     edx,16
  595.         mov     dx,word[IcoY]
  596.         mcall   7,DlgBufImg,<IMG_SIZE,IMG_SIZE>
  597.  
  598.         inc     [iIcon]
  599.         mov     eax,[iIcon]
  600.         cmp     eax,[icon_count]
  601.         jae     .endDrawIcon
  602.  
  603.         add     dword[IcoY],IMG_SIZE+SPCH
  604.         pop     ecx
  605.         loop    .DrawIcoStolb
  606.  
  607.         add     dword[IcoX],IMG_SIZE+SPCW
  608.         pop     ecx
  609.         loop    .DrawIcons
  610.         jmp     .endProc
  611.  
  612.     .endDrawIcon:
  613.  
  614.         mov     ecx,IMG_SIZE*IMG_SIZE
  615.         mov     edi,DlgBufImg
  616.         mov     eax,[sc.work]
  617.         mov     ebx,eax
  618.         shr     ebx,16
  619.      @@:
  620.         mov     word[edi],ax
  621.         mov     [edi+2],bl
  622.         add     edi,3
  623.         loop    @b
  624.  
  625.                                      ;§ â¨à ­¨¥ ­¥ ¨á¯®«ì§®¢ ­ëå ¬¥áâ
  626.         jmp     .Dalee
  627.  
  628.   .DrawIcons2:
  629.         push    ecx
  630.  
  631.         mov     [IcoY],ICONSY
  632.         mov     ecx,ICONS_DRAW_COUNTH
  633.   .DrawIcoStolb2:
  634.         push    ecx
  635.  
  636.         mov     edx,[IcoX]
  637.         shl     edx,16
  638.         mov     dx,word[IcoY]
  639.         mcall   7,DlgBufImg,<IMG_SIZE,IMG_SIZE>
  640.  
  641.      .Dalee:
  642.         add     dword[IcoY],IMG_SIZE+SPCH
  643.         pop     ecx
  644.         loop    .DrawIcoStolb2
  645.  
  646.         add     dword[IcoX],IMG_SIZE+SPCW
  647.         pop     ecx
  648.         loop    .DrawIcons2
  649.  
  650.    .endProc:
  651.  
  652.         ret
  653. endp
  654.  
  655. proc DrawSelIcon
  656.         mov     edi,DAreaIcon
  657.         cmp     byte[edi],0
  658.         jne     @f
  659.         ret
  660.       @@:
  661.  
  662.         mov     al,[edi]
  663.         cmp     al,'9'
  664.         ja      .PathToIcon
  665.         cmp     al,'/'
  666.         jne     .GetIconInd
  667.    .PathToIcon:
  668.         mov     al,30h           ;§ £«ã誠!!!!!!!!!!!!!
  669.         mov     byte[edi+1],0
  670.    .GetIconInd:
  671. ;int3
  672.         sub     al,30h
  673.         cmp     byte[edi+1],0
  674.         je      @f
  675.         shl     eax,1
  676.         lea     eax,[eax*4+eax]
  677.         xor     edx,edx
  678.         mov     dl,[edi+1]
  679.         sub     dl,30h
  680.         add     eax,edx
  681.      @@:             ;eax=num icon
  682.         cmp     eax,[icon_count]
  683.         jb      @f
  684.         xor     eax,eax
  685.      @@:
  686.         test    eax,eax
  687.         je      .DI1
  688.         mov     ecx,eax
  689.         xor     eax,eax
  690.       @@:
  691.         add     eax,IMG_SIZE*IMG_SIZE*4
  692.         loop    @b
  693.      .DI1:
  694.         mov     esi,eax
  695.         add     esi,[raw_pointer]
  696.         add     esi,44
  697.  
  698.         mov     edi,DlgBufImg
  699.         mov     edx,IMG_SIZE
  700.     .DrawLine:
  701.  
  702.         mov     ecx,IMG_SIZE
  703.      .DrawPix:
  704.  
  705.         lodsd
  706.         test    eax,0FF000000h
  707.         jnz     @f
  708.         mov     eax,[sc.work]
  709.      @@:
  710.  
  711.         mov     word[edi],ax
  712.         shr     eax,16
  713.         mov     [edi+2],al
  714.         add     edi,3
  715.  
  716.         loop    .DrawPix
  717.  
  718.         dec     edx
  719.         jnz     .DrawLine
  720.  
  721.         mcall   7,DlgBufImg,<IMG_SIZE,IMG_SIZE>,<15,15>
  722.  
  723.         ret
  724. endp