Subversion Repositories Kolibri OS

Rev

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

Rev 7547 Rev 8532
Line 1... Line 1...
1
; END
1
; END
2
; KolibriOS Team 2005-2016
2
; KolibriOS Team 2005-2021
Line 3... Line 3...
3
 
3
 
Line 4... Line 4...
4
fade equ 0
4
fade equ 0
5
 
5
 
Line 18... Line 18...
18
include 'lang.inc'
18
include 'lang.inc'
19
include '../../../macros.inc'
19
include '../../../macros.inc'
20
include '../../../proc32.inc'
20
include '../../../proc32.inc'
21
include '../../../dll.inc'
21
include '../../../dll.inc'
-
 
22
include '../../../KOSfuncs.inc'
22
include '../../../develop/libraries/box_lib/load_lib.mac'
23
include '../../../load_lib.mac'
23
include '../../../develop/libraries/box_lib/trunk/box_lib.mac'
24
include '../../../develop/libraries/box_lib/trunk/box_lib.mac'
24
include '../../../gui_patterns.inc'
25
include '../../../gui_patterns.inc'
25
include "../../../string.inc"
26
include "../../../string.inc"
Line 26... Line 27...
26
 
27
 
Line 44... Line 45...
44
	inc	eax
45
	inc	eax
45
	test	eax,eax
46
	test	eax,eax
46
	jz	close
47
	jz	close
47
 
48
 
Line 48... Line -...
48
push	dword check1
-
 
49
call	[init_checkbox2]
49
stdcall	[init_checkbox], check1
Line 50... Line 50...
50
 
50
 
Line 51... Line 51...
51
stdcall dll.Init,[init_lib]
51
stdcall dll.Init,[init_lib]
52
 
52
 
53
invoke	ini_get_int,ini_file,asettings,aautosave,0
53
invoke	ini_get_int,ini_file,asettings,aautosave,0
54
	mov   [autosave],eax
54
	mov   [autosave],eax
55
	dec   eax
55
	dec   eax
56
	jnz   @f
56
	jnz   @f
57
	bts   dword [check1.flags],1
57
	bts   dword [check1.flags],1
58
@@:
58
@@:
59
	mcall	40,0x80000027
59
	mcall	SF_SET_EVENTS_MASK,0x80000027
60
redraw:
60
redraw:
61
    call draw_window
61
    call draw_window
62
still:
62
still:
63
    mov  al,10
63
    mov  al,SF_WAIT_EVENT
64
    mcall				     ;wait here for event
64
    mcall				     ;wait here for event
65
    dec  eax
65
    dec  eax
66
    jz	 redraw
66
    jz	 redraw
67
    dec  eax
67
    dec  eax
68
    jz	 key
68
    jz	 key
Line 69... Line -...
69
    dec  eax
-
 
70
    jz	 button
69
    dec  eax
71
 
70
    jz	 button
72
    push dword check1
71
 
73
    call [check_box_mouse2]
72
    stdcall [check_box_mouse], check1
74
    bt	 dword [check1.flags],1
73
    bt	 dword [check1.flags],1
75
    jnc  @f
74
    jnc  @f
76
    mov  [autosave],1
75
    mov  [autosave],1
77
    jmp  still
76
    jmp  still
Line 78... Line 77...
78
@@:
77
@@:
79
    mov  [autosave],0
78
    mov  [autosave],0
80
    jmp  still
79
    jmp  still
81
 
80
 
82
key:
81
key:
83
    mov  al,2
82
    mov  al,SF_GET_KEY
84
    mcall				     ;eax=2 - get key code
83
    mcall				     ;get key code
85
    mov  al,ah
84
    mov  al,ah
Line 94... Line 93...
94
     cmp  al,27
93
     cmp  al,27
95
     jne   still
94
     jne   still
96
 
95
 
Line 97... Line 96...
97
close:
96
close:
98
    mcall -1
97
    mcall SF_TERMINATE_PROCESS
Line 99... Line 98...
99
 
98
 
100
button:
99
button:
101
    mcall 17				     ;eax=17 - get pressed button id
100
    mcall SF_GET_BUTTON				     ;get pressed button id
102
    xchg al,ah
101
    xchg al,ah
103
    dec  eax
102
    dec  eax
104
    jz	 close
103
    jz	 close
105
    dec  eax
104
    dec  eax
Line 138... Line 137...
138
    cmp  [autosave],1
137
    cmp  [autosave],1
139
    jne   no_save
138
    jne   no_save
140
 
139
 
Line 141... Line 140...
141
if fade=0
140
if fade=0
142
    mov   al,4
141
    mov   al,SF_DRAW_TEXT
143
    mcall   ,<50,120> ,0x800000cc,label7	;eax=4 - write text
142
    mcall   ,<50,120> ,0x800000cc,label7
144
end if
143
end if
Line 145... Line 144...
145
 
144
 
146
    mcall 70,rdsave
145
    mcall SF_FILE,rdsave
147
    test  eax,eax
146
    test  eax,eax
148
    js	  no_save
147
    js	  no_save
149
    mov   ecx,eax
148
    mov   ecx,eax
150
    mcall 18,21
149
    mcall SF_SYSTEM,SSF_GET_THREAD_SLOT
151
    mov   ecx,eax
150
    mov   ecx,eax
152
@@:
151
@@:
153
    push ecx
152
    push ecx
154
    mcall 23,100
153
    mcall SF_WAIT_EVENT_TIMEOUT,100
155
    dec   eax
154
    dec   eax
156
    jnz   no_red
155
    jnz   no_red
157
    call draw_window
156
    call draw_window
158
no_red:
157
no_red:
159
    pop   ecx
158
    pop   ecx
160
    mcall 9,proc_info
159
    mcall SF_THREAD_INFO,proc_info
161
    cmp   [proc_info+50],9
160
    cmp   [proc_info+50],9
162
    je	  no_save
161
    je	  no_save
163
    jmp   @b
162
    jmp   @b
164
no_save:
163
no_save:
165
    pop  ecx
164
    pop  ecx
166
    mcall 18,9
165
    mcall SF_SYSTEM,SSF_SHUTDOWN
167
    mcall -1
166
    mcall SF_TERMINATE_PROCESS
Line 168... Line 167...
168
ret
167
ret
169
 
168
 
170
checkbox:
169
checkbox:
171
    btc   dword [check1.flags],1
170
    btc   dword [check1.flags],1
172
    jc	  .1
171
    jc	  .1
173
    mov   [autosave],1
172
    mov   [autosave],1
174
    jmp   .draw
173
    jmp   .draw
175
.1:
174
.1:
176
    mov   [autosave],0
-
 
177
.draw:
175
    mov   [autosave],0
178
    push  dword check1
176
.draw:
Line 179... Line 177...
179
    call  [check_box_draw2]
177
    stdcall  [check_box_draw], check1
180
    jmp    still
178
    jmp    still
Line 181... Line 179...
181
 
179
 
182
draw_window:
180
draw_window:
183
    mcall 12,1
181
    mcall SF_REDRAW,SSF_BEGIN_DRAW
184
	
182
	
185
    mov   al,14
183
    mov   al,SF_GET_SCREEN_SIZE
186
    mcall				     ;eax=14 - get screen max x & max y
184
    mcall				     ;get screen max x & max y
187
    movzx ecx,ax
185
    movzx ecx,ax
Line 205... Line 203...
205
	
203
	
Line 206... Line 204...
206
	DefineButton  WIN_W-33, 2, 32, 20, CANCEL_BUTTON_ID, 0
204
	DefineButton  WIN_W-33, 2, 32, 20, CANCEL_BUTTON_ID, 0
207
	WriteText  WIN_W-23, 5, 10000001b, 0xFFFfff, TEXT_CANCEL
205
	WriteText  WIN_W-23, 5, 10000001b, 0xFFFfff, TEXT_CANCEL
Line 208... Line -...
208
 
-
 
209
    push  dword check1
206
 
Line 210... Line 207...
210
    call  [check_box_draw2]
207
    stdcall  [check_box_draw], check1
211
 
208
 
212
macro EndButton  x, bgcol, id, but_text, hotkey_text
209
macro EndButton  x, bgcol, id, but_text, hotkey_text
213
{
210
{
Line 224... Line 221...
224
	neg  ebx
221
	neg  ebx
225
	add  ebx,butw / 2 + x
222
	add  ebx,butw / 2 + x
226
	shl  ebx,16
223
	shl  ebx,16
227
	add  ebx,buty+8
224
	add  ebx,buty+8
228
	mcall 4, , 10010000b shl 24 + 0xFFFfff, but_text
225
	mcall SF_DRAW_TEXT, , 10010000b shl 24 + 0xFFFfff, but_text
229
	add ebx,1 shl 16
226
	add ebx,1 shl 16
230
	mcall
227
	mcall
231
	stdcall string.length, hotkey_text
228
	stdcall string.length, hotkey_text
232
	mov  ebx,eax
229
	mov  ebx,eax
233
	imul ebx,3
230
	imul ebx,3
234
	neg  ebx
231
	neg  ebx
235
	add  ebx,butw / 2 + x
232
	add  ebx,butw / 2 + x
236
	shl  ebx,16
233
	shl  ebx,16
237
	add  ebx,buty+26
234
	add  ebx,buty+26
238
	mcall 4, , 10000000b shl 24 + 0xFFFfff, hotkey_text
235
	mcall SF_DRAW_TEXT, , 10000000b shl 24 + 0xFFFfff, hotkey_text
239
}
236
}
240
 
237
 
Line 241... Line 238...
241
	EndButton  20, 0x4E91C5, HOME_BUTTON_ID,     TEXT_KERNEL, TEXT_HOME
238
	EndButton  20, 0x4E91C5, HOME_BUTTON_ID,     TEXT_KERNEL, TEXT_HOME
242
	EndButton 160, 0x55C891, REBOOT_BUTTON_ID,   TEXT_REBOOT, TEXT_ENTER
239
	EndButton 160, 0x55C891, REBOOT_BUTTON_ID,   TEXT_REBOOT, TEXT_ENTER
243
	EndButton 300, 0xC75C54, POWEROFF_BUTTON_ID, TEXT_OFF,    TEXT_END
240
	EndButton 300, 0xC75C54, POWEROFF_BUTTON_ID, TEXT_OFF,    TEXT_END
Line 244... Line 241...
244
 
241
 
245
    mov   al,12
242
    mov   al,SF_REDRAW
246
    mcall   ,2
243
    mcall   ,SSF_END_DRAW
247
    ret
244
    ret
248
;---------------------------------------------------------------------
245
;---------------------------------------------------------------------
249
;data
246
;data
250
include 'data.inc'
247
include 'data.inc'
Line 256... Line 253...
256
proc_info  rb 1024
253
proc_info  rb 1024
Line 257... Line 254...
257
 
254
 
258
autosave rd 1
255
autosave rd 1
259
;---------------------------------------------------------------------
256
;---------------------------------------------------------------------
260
cur_dir_path:
-
 
261
	rb 4096
-
 
262
;---------------------------------------------------------------------
257
cur_dir_path rb 4096
263
library_path:
-
 
264
	rb 4096
258
library_path rb 4096
265
;---------------------------------------------------------------------
259
;---------------------------------------------------------------------
266
align 32
260
align 32
267
	rb 4096
261
	rb 4096
268
stacktop:
262
stacktop:
269
I_END:	; ¬¥âª  ª®­æ  ¯à®£à ¬¬ë
263
I_END:	; ¬¥âª  ª®­æ  ¯à®£à ¬¬ë