Subversion Repositories Kolibri OS

Rev

Rev 551 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 551 Rev 2703
Line 26... Line 26...
26
    call draw_window            ; at first, draw the window
26
    call draw_window            ; at first, draw the window
Line 27... Line 27...
27
 
27
 
28
still:
28
still:
Line 29... Line -...
29
    call mouse_info
-
 
30
 
-
 
31
    mov  eax,23
29
    call mouse_info
Line 32... Line 30...
32
    mov  ebx,2
30
 
33
    mcall
31
    mcall 23, 2
34
 
32
 
35
    cmp  eax,1                  ; redraw request ?
33
    cmp  eax,1                  ; redraw request ?
Line 44... Line 42...
44
  red:                          ; redraw
42
  red:                          ; redraw
45
    call draw_window
43
    call draw_window
46
    jmp  still
44
    jmp  still
Line 47... Line 45...
47
 
45
 
48
  key:                          ; key
46
  key:                          ; key
49
    mov  eax,2                  ; just read it and ignore
-
 
50
    mcall
47
    mcall 2                  ; just read it and ignore
Line 51... Line 48...
51
    jmp  still
48
    jmp  still
52
 
49
 
53
  button:                       ; button
-
 
Line 54... Line 50...
54
    mov  eax,17                 ; get id
50
  button:                       ; button
Line 55... Line 51...
55
    mcall
51
    mcall 17                 ; get id
56
 
52
    
57
    shr  eax,8
53
    shr  eax,8
58
 
-
 
59
    cmp  eax,1                   ; button id=1 ?
54
 
Line 60... Line 55...
60
    jne  noclose
55
    cmp  eax,1                   ; button id=1 ?
61
    mov  eax,-1                 ; close this program
56
    jne  noclose
Line 71... Line 66...
71
;   *******  WINDOW DEFINITIONS AND DRAW ********
66
;   *******  WINDOW DEFINITIONS AND DRAW ********
72
;   *********************************************
67
;   *********************************************
Line 73... Line 68...
73
 
68
 
74
 
-
 
75
draw_window:
69
 
76
    mov  eax,12                    ; function 12:tell os about windowdraw
-
 
77
    mov  ebx,1                     ; 1, start of draw
70
draw_window:
78
    mcall
-
 
79
                                   ; DRAW WINDOW
-
 
80
    mov  eax,0                     ; function 0 : define and draw window
-
 
81
    mov  ebx,100*65536+200         ; [x start] *65536 + [x size]
-
 
82
    mov  ecx,100*65536+200         ; [y start] *65536 + [y size]
71
    mcall 12, 1                    ; 1, start of draw
83
    mov  edx,0x14ffffff            ; color of work area RRGGBB,8->color gl
-
 
Line 84... Line 72...
84
    mov  edi,title                 ; WINDOW LABEL
72
    mcall 0, <100,200>, <100,200>, 0x14ffffff, , title ; DRAW WINDOW
Line 85... Line 73...
85
    mcall
73
    mcall 12,2                    ; end WINDOW redraw
86
 
74
	
Line 94... Line 82...
94
    call dword [App_Controls+ecx+4] ;call controls draw function
82
    call dword [App_Controls+ecx+4] ;call controls draw function
95
    add  ecx, 12
83
    add  ecx, 12
96
    jmp  Draw_Controls_Loop
84
    jmp  Draw_Controls_Loop
97
Draw_Controls_Done:
85
Draw_Controls_Done:
Line 98... Line -...
98
 
-
 
99
 
-
 
100
    mov  eax,12                    ; function 12:tell os about windowdraw
-
 
101
    mov  ebx,2                     ; 2, end of draw
-
 
102
    mcall
-
 
103
 
86
 
Line 104... Line 87...
104
    ret
87
    ret
105
 
88
 
Line 110... Line 93...
110
mousey dw 0
93
mousey dw 0
111
mousex dw 0
94
mousex dw 0
112
mouseb dd 0
95
mouseb dd 0
Line 113... Line 96...
113
 
96
 
114
mouse_info:
97
mouse_info:
115
   mov eax, 37            ;get mouse cordinates
-
 
116
   mov ebx, 1             ;
-
 
117
   mcall               ;
98
   mcall 37, 1            ;get mouse cordinates
118
   mov ecx, eax           ;
99
   mov ecx, eax           ;
119
   push ecx               ;
100
   push ecx               ;
120
   mov eax, 37            ;get mouse buttons
-
 
121
   mov ebx, 2             ;
-
 
122
   mcall               ;
101
   mcall  37, 2           ;get mouse buttons
123
   cmp [mouseb], eax      ;compare old mouse states to new states
102
   cmp [mouseb], eax      ;compare old mouse states to new states
124
   jne redraw_mouse_info  ;
103
   jne redraw_mouse_info  ;
125
   cmp [mousey], cx       ;
104
   cmp [mousey], cx       ;
126
   jne redraw_mouse_info  ;
105
   jne redraw_mouse_info  ;
Line 169... Line 148...
169
;***********************************************
148
;***********************************************
Line 170... Line 149...
170
 
149
 
171
 
150
 
172
draw_slider_info:
-
 
173
;Repaint value background
-
 
174
   mov eax, 13
-
 
175
   mov ebx, 0x00960028
151
draw_slider_info:
176
   mov ecx, 0x00240010
-
 
177
   mov edx, 0x00ffffff
152
;Repaint value background
178
   mcall
153
   mcall 13, 144*65536+36, 72*65536+9, 0x00ffffff 
179
;Draw Color Box
154
;Draw Color Box
180
   xor edx, edx
155
   xor edx, edx
181
   movzx ecx,word [slider_1+12]
156
   movzx ecx,word [slider_1+12]
Line 192... Line 167...
192
;draw current value of slider
167
;draw current value of slider
193
   mov ecx, edx
168
   mov ecx, edx
194
   mov eax, 47
169
   mov eax, 47
195
   mov ebx, 0x00060100
170
   mov ebx, 0x00060100
196
   mov esi, 0
171
   mov esi, 0
197
   mov edx, 0x009A0029
172
   mov edx, 144*65536+72
198
   mcall
173
   mcall
199
ret
174
ret
Line 200... Line 175...
200
 
175
 
Line 265... Line 240...
265
   push edx
240
   push edx
266
;Draw slider background
241
;Draw slider background
267
   mov   eax, 13         ;slider background
242
   mov   eax, 13         ;slider background
268
   mov   ebx, [ebp]      ;x start/width
243
   mov   ebx, [ebp]      ;x start/width
269
   mov   ecx, [ebp+4]    ;y start/height
244
   mov   ecx, [ebp+4]    ;y start/height
270
   mov   edx, 0x002288DD ;color
245
   mov   edx, 0x00EBEBEB ;color
271
   mcall                 ;draw bar
246
   mcall                 ;draw bar
272
;Draw line for slide rail
247
;Draw line for slide rail
273
   mov   eax, 38         ;draw vertical slide line
248
   mov   eax, 38         ;draw vertical slide line
274
   movzx ebx,word [ebp]  ;x
249
   movzx ebx,word [ebp]  ;x
275
   shr   ebx, 1          ;
250
   shr   ebx, 1          ;