Subversion Repositories Kolibri OS

Rev

Rev 1829 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1815 yogev_ezra 1
;
2
;   PANEL SETUP
3
;
4
;   Compile with FASM for Menuet
5
;
6
 
7
use32
8
 
9
               org    0x0
10
 
11
               db     'MENUET01'              ; 8 byte id
12
               dd     0x01                    ; header version
13
               dd     START                   ; start of code
14
               dd     I_END                   ; size of image
15
               dd     0x8000                  ; memory for app
16
               dd     0x8000                  ; esp
17
               dd     0x0 , 0x0               ; I_Param , I_Icon
18
 
1829 clevermous 19
include '../../../macros.inc'
1815 yogev_ezra 20
 
21
START:                          ; start of execution
22
 
23
     call draw_window
24
 
25
still:
26
 
27
    mov  eax,10                 ; wait here for event
28
    int  0x40
29
 
30
    cmp  eax,1                  ; redraw request ?
31
    je   red
32
    cmp  eax,2                  ; key in buffer ?
33
    je   key
34
    cmp  eax,3                  ; button in buffer ?
35
    je   button
36
 
37
    jmp  still
38
 
39
  red:                          ; redraw
40
    call draw_window
41
    jmp  still
42
 
43
  key:                          ; key
44
    mov  eax,2                  ; just read it and ignore
45
    int  0x40
46
 
47
    shr  eax,8
48
    cmp  eax,'0'
49
    jb   still
50
    cmp  eax,'9'
51
    jg   still
52
 
53
    mov  edi,[ent]
54
    add  edi,text
55
    mov  esi,edi
56
    inc  esi
57
    mov  ecx,3
58
    cld
59
    rep  movsb
60
 
61
    mov  [edi],al
62
 
63
    call draw_window
64
    jmp  still
65
 
66
  button:                       ; button
67
    mov  eax,17                 ; get id
68
    int  0x40
69
 
70
    cmp  ah,1                   ; button id=1 ?
71
    jne  noclose
72
    mov  eax,-1                 ; close this program
73
    int  0x40
74
  noclose:
75
 
76
    cmp  ah,10
77
    jne  no_apply
78
 
79
    mov  esi,text+17
80
    mov  edi,I_END+10
81
    mov  ecx,12
82
   newfe:
83
    mov  ebx,[esi]
84
    mov  [edi],ebx
85
    mov  [edi+4],byte ';'
86
    add  edi,5
87
    add  esi,55
88
    loop newfe
89
    mov  [edi],byte 'x'
90
 
91
    mov  eax,70
92
    mov  ebx,dat_write
93
    int  0x40
94
 
95
 
96
    mov  esi,1
97
   newread:
98
    inc  esi
99
    mov  eax,9
100
    mov  ebx,I_END
101
    mov  ecx,esi
102
    int  0x40
103
    cmp  esi,eax
104
    jg   all_terminated
105
 
106
    mov  eax,[ebx+10]
107
    and  eax,not 0x20202000
108
    cmp  eax,'@PAN'
109
    jne  newread
110
    mov  eax,[ebx+14]
111
    and  eax,not 0x2020
112
    cmp  eax,'EL  '
113
    jne  newread
114
 
115
    mov  eax,18
116
    mov  ebx,2
117
    mov  ecx,esi
118
    int  0x40
119
 
120
    mov  eax,5
121
    mov  ebx,5
122
    int  0x40
123
 
124
    mov  esi,1
125
 
126
    jmp  newread
127
 
128
   all_terminated:
129
 
130
    mov  eax,5
131
    mov  ebx,25
132
    int  0x40
133
 
134
        mov     eax, 70
135
        mov     ebx, panel_start
136
        int     0x40
137
 
138
  no_apply:
139
 
140
    cmp  ah,11
141
    jb   no_entry
142
    shr  eax,8
143
    sub  eax,11
144
    imul eax,55
145
    add  eax,17
146
    mov  [ent],eax
147
    mov  [text+eax],dword '0000'
148
    call draw_window
149
    jmp  still
150
  no_entry:
151
 
152
 
153
    jmp  still
154
 
155
 
156
ent       dd  17
157
 
158
panel_start:
159
        dd      7
160
        dd      0
161
        dd      0
162
        dd      0
163
        dd      0
164
        db      '/RD/1/@PANEL',0
165
 
166
dat_write:
167
        dd      2
168
        dq      0
169
        dd      5*12+1
170
        dd      I_END+10
171
        db      'PANEL.DAT',0
172
 
173
;   *********************************************
174
;   *******  WINDOW DEFINITIONS AND DRAW ********
175
;   *********************************************
176
 
177
 
178
draw_window:
179
 
180
 
181
    mov  eax,12                    ; function 12:tell os about windowdraw
182
    mov  ebx,1                     ; 1, start of draw
183
    int  0x40
184
 
185
                                   ; DRAW WINDOW
186
    mov  eax,0                     ; function 0 : define and draw window
187
    mov  ebx,100*65536+385         ; [x start] *65536 + [x size]
188
    mov  ecx,100*65536+190         ; [y start] *65536 + [y size]
2191 leency 189
    mov  edx,0x14ffffff            ; color of work area RRGGBB,8->color gl
190
    mov  edi,labelt                ; color of frames    RRGGBB
1815 yogev_ezra 191
    int  0x40
192
 
193
    mov  eax,8
194
    mov  ebx,25*65536+335 ;160
195
    mov  ecx,162*65536+12
196
    mov  edx,10
197
    mov  esi,0x80a0c0 ;0x6677cc
198
    int  0x40
199
 
200
    mov  eax,8
201
    mov  ebx,340*65536+20
202
    mov  ecx,34*65536+10
203
    mov  edx,11
204
  newb:
205
    int  0x40
206
    add  ecx,10*65536
207
    inc  edx
208
    cmp  edx,23
209
    jb   newb
210
 
211
    mov  ebx,25*65536+35           ; draw info text with function 4
212
    mov  ecx,0x224466
213
    mov  edx,text
214
    mov  esi,55
215
  newline:
216
    mov  eax,4
217
    int  0x40
218
    add  ebx,10
219
    add  edx,55
220
    cmp  [edx],byte 'x'
221
    jne  newline
222
 
223
    mov  eax,12                    ; function 12:tell os about windowdraw
224
    mov  ebx,2                     ; 2, end of draw
225
    int  0x40
226
 
227
    ret
228
 
229
 
230
; DATA AREA
231
 
232
 
233
text:
234
 
235
db  'width            0000  :  0 for full screen width     <'
236
db  'buttons          0000  :  0 no frames  , 1 frames     <'
237
db  'soften_up        0001  :  0 no         , 1 yes        <'
238
db  'soften_down      0001  :  0 no         , 1 yes        <'
239
db  'minimize_left    0001  :  0 no         , 1 yes        <'
240
db  'minimize_right   0001  :  0 no         , 1 yes        <'
241
db  'icons_position   0100  :  position in pixels          <'
242
db  'menu_enable      0001  :  0 no         , 1 yes        <'
243
db  'setup_enable     0001  :  0 no         , 1 yes        <'
244
db  'graph_text       0001  :  0 graphics   , 1 text       <'
245
db  'soften_middle    0001  :  0 no         , 1 yes        <'
246
db  'icons            0001  :  0 start      , 1 activate   <'
247
db  '                                                       '
248
db  '                         APPLY                         '
249
db  'x'
250
 
251
 
252
labelt:
2191 leency 253
     db   'Panel setup'
1815 yogev_ezra 254
labellen:
255
 
256
I_END: