Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. ;---------------------------------------------------------------------
  2. thread3:
  3.  
  4.      call draw_window3
  5.  
  6. still3:
  7.  
  8.     mov  eax,10                 ; wait here for event
  9.     mcall
  10.  
  11.     cmp  eax,1                  ; redraw request ?
  12.     je   thread3
  13.     cmp  eax,2                  ; key in buffer ?
  14.     je   key3
  15.     cmp  eax,3                  ; button in buffer ?
  16.     je   button3
  17.  
  18.     jmp  still3
  19.  
  20.   key3:
  21.     mcall
  22.     cmp  ah,27
  23.     je   close3
  24.     jmp  still3
  25.  
  26.  
  27.   button3:                       ; button
  28.     mov  eax,17                 ; get id
  29.     mcall
  30.  
  31.     cmp  ah,1                   ; button id=1 ?
  32.         je   close3
  33.         cmp  ah,2
  34.     jne  noclose3
  35.   close3:
  36.     mov  eax,-1                 ; close this program
  37.     mcall
  38.   noclose3:
  39.      jmp  still3
  40.  
  41.  
  42.  
  43.  
  44. ;   *********************************************
  45. ;   *******  WINDOW DEFINITIONS AND DRAW ********
  46. ;   *********************************************
  47.  
  48.  
  49. draw_window3:
  50.  
  51.  
  52.     mov  eax,12                    ; function 12:tell os about windowdraw
  53.     mov  ebx,1                     ; 1, start of draw
  54.     mcall
  55.  
  56.                                    ; DRAW WINDOW
  57.     xor  eax,eax                   ; function 0 : define and draw window
  58.     mov  ebx,100*65536+200         ; [x start] *65536 + [x size]
  59.     mov  ecx,100*65536+100         ; [y start] *65536 + [y size]
  60.     mov  edx,0x03eeeeee            ; color of work area RRGGBB,8->color gl
  61.     mcall
  62.  
  63.     mcall 4,<10,40>,0x80000000,header_1
  64.    
  65.     mov  ebx,70*65536+40
  66.     mov  ecx,70*65536+20
  67.     mov  edx,2
  68.     mov  esi,0xdddddd
  69.     mcall 8
  70.  
  71.     add  ebx,15 shl 16
  72.         shr  ecx,16
  73.         mov  bx,cx
  74.         add  ebx,6
  75.        
  76.         mov  ecx,0
  77.     mov  edx, ok_btn
  78.     mov  esi,2
  79.     mcall 4
  80.        
  81.                                    ; WINDOW LABEL
  82.     mcall 71,1, labelt3
  83.        
  84.     mov  eax,12                    ; function 12:tell os about windowdraw
  85.     mov  ebx,2                     ; 2, end of draw
  86.     mcall
  87.  
  88.     ret
  89. ;---------------------------------------------------------------------