Subversion Repositories Kolibri OS

Rev

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

Rev 353 Rev 485
Line 14... Line 14...
14
                dd      I_END                   ; program image size
14
                dd      I_END                   ; program image size
15
                dd      0x1000                  ; required amount of memory
15
                dd      0x1000                  ; required amount of memory
16
                dd      0x1000                  ; esp
16
                dd      0x1000                  ; esp
17
                dd      0x00000000              ; reserved=no extended header
17
                dd      0x00000000              ; reserved=no extended header
Line 18... Line 18...
18
 
18
 
Line 19... Line 19...
19
include 'macros.inc'
19
include '..\..\..\..\macros.inc'
Line 27... Line 27...
27
    call draw_window            ; at first, draw the window
27
    call draw_window            ; at first, draw the window
Line 28... Line 28...
28
 
28
 
Line 29... Line 29...
29
still:
29
still:
30
 
30
 
Line 31... Line 31...
31
    mov  eax,10                 ; wait here for event
31
    mov  eax,10                 ; wait here for event
32
    int  0x40
32
    mcall
33
 
33
 
34
    dec  eax                    ; redraw request ?
34
    dec  eax                    ; redraw request ?
Line 35... Line 35...
35
    jz   red
35
    jz   red
36
    dec  eax                    ; key in buffer ?
36
    dec  eax                    ; key in buffer ?
37
    jz   key
37
    jz   key
Line 38... Line 38...
38
 
38
 
39
  button:
39
  button:
40
    mov  al,17                 ; get id
40
    mov  al,17                 ; get id
41
    int  0x40
41
    mcall
Line 42... Line 42...
42
 
42
 
43
    cmp  ah,1                   ; button id=1 ?
43
    cmp  ah,1                   ; button id=1 ?
44
    jne  noclose
44
    jne  noclose
45
    or   eax,-1                 ; close this program
45
    or   eax,-1                 ; close this program
46
    int  0x40
46
    mcall
Line 47... Line 47...
47
 
47
 
Line 59... Line 59...
59
    pusha
59
    pusha
Line 60... Line 60...
60
 
60
 
61
    mov  eax,50       ; give the shape reference area
61
    mov  eax,50       ; give the shape reference area
62
    mov  ebx,0
62
    mov  ebx,0
63
    mov  ecx,shape_reference
63
    mov  ecx,shape_reference
Line 64... Line 64...
64
    int  0x40
64
    mcall
65
 
65
 
66
    mov  eax,50       ; give the shape scale  32 x 32  ->  128 x 128
66
    mov  eax,50       ; give the shape scale  32 x 32  ->  128 x 128
67
    mov  ebx,1        ; you dont have to give this, scale is 1:1 by default
67
    mov  ebx,1        ; you dont have to give this, scale is 1:1 by default
Line 68... Line 68...
68
    mov  ecx,2
68
    mov  ecx,2
Line 69... Line 69...
69
    int  0x40
69
    mcall
Line 116... Line 116...
116
 
116
 
Line 117... Line 117...
117
draw_window:
117
draw_window:
118
 
118
 
119
    mov  eax,12                    ; function 12:tell os about windowdraw
119
    mov  eax,12                    ; function 12:tell os about windowdraw
Line 120... Line 120...
120
    mov  ebx,1                     ; 1, start of draw
120
    mov  ebx,1                     ; 1, start of draw
121
    int  0x40
121
    mcall
122
 
122
 
123
                                   ; DRAW WINDOW
123
                                   ; DRAW WINDOW
124
    xor  eax,eax                     ; function 0 : define and draw window
124
    xor  eax,eax                     ; function 0 : define and draw window
125
    mov  ebx,100*65536             ; [x start] *65536 + [x size]
125
    mov  ebx,100*65536             ; [x start] *65536 + [x size]
126
    mov  ecx,100*65536             ; [y start] *65536 + [y size]
126
    mov  ecx,100*65536             ; [y start] *65536 + [y size]
127
    mov  bx,word [x_size]
127
    mov  bx,word [x_size]
128
    mov  cx,word [y_size]
128
    mov  cx,word [y_size]
129
    mov  edx,0x00cccc00            ; color of work area RRGGBB,8->color glide
129
    mov  edx,0x00cccc00            ; color of work area RRGGBB,8->color glide
Line 130... Line 130...
130
    mov  esi,0x00cccc00            ; color of grab bar  RRGGBB,8->color glide
130
    mov  esi,0x00cccc00            ; color of grab bar  RRGGBB,8->color glide
131
    mov  edi,0x00cccc00            ; color of frames    RRGGBB
131
    mov  edi,0x00cccc00            ; color of frames    RRGGBB
132
    int  0x40
132
    mcall
133
 
133
 
134
 
134
 
135
                                   ; CLOSE BUTTON
135
                                   ; CLOSE BUTTON
136
    mov  eax,8                     ; function 8 : define and draw button
136
    mov  eax,8                     ; function 8 : define and draw button
Line 137... Line 137...
137
    mov  ebx,78*65536+12           ; [x start] *65536 + [x size]
137
    mov  ebx,78*65536+12           ; [x start] *65536 + [x size]
138
    mov  ecx,20*65536+12           ; [y start] *65536 + [y size]
138
    mov  ecx,20*65536+12           ; [y start] *65536 + [y size]
139
    mov  edx,1                     ; button id
139
    mov  edx,1                     ; button id
Line 140... Line 140...
140
    mov  esi,0x5599cc              ; button color RRGGBB
140
    mov  esi,0x5599cc              ; button color RRGGBB
Line 141... Line 141...
141
    int  0x40
141
    mcall