Subversion Repositories Kolibri OS

Rev

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