2015-08-03 14:38:30 +02:00
|
|
|
|
|
2011-01-18 15:29:19 +01:00
|
|
|
|
; END
|
2016-11-01 00:41:05 +01:00
|
|
|
|
; KolibriOS Team 2005-2016
|
2015-08-03 14:38:30 +02:00
|
|
|
|
|
2013-11-21 10:36:24 +01:00
|
|
|
|
fade equ 0
|
|
|
|
|
|
2015-08-03 14:38:30 +02:00
|
|
|
|
use32 ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 32-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ०<><E0A5A6> <20><>ᥬ<EFBFBD><E1A5AC><EFBFBD><EFBFBD><EFBFBD>
|
2013-11-21 10:36:24 +01:00
|
|
|
|
org 0x0 ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD>
|
|
|
|
|
|
2015-08-03 14:38:30 +02:00
|
|
|
|
db 'MENUET01' ; 8-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>䨪<EFBFBD><E4A8AA><EFBFBD><EFBFBD> MenuetOS
|
|
|
|
|
dd 0x01 ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (<28>ᥣ<EFBFBD><E1A5A3> 1)
|
|
|
|
|
dd START ; <20><><EFBFBD><EFBFBD><EFBFBD> <20><>ࢮ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
dd IM_END ; ࠧ<><E0A0A7><EFBFBD> <20>ணࠬ<E0AEA3><E0A0AC>
|
|
|
|
|
dd I_END ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⢮ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
dd stacktop ; <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>設<EFBFBD> <20>⥪<EFBFBD>
|
|
|
|
|
dd 0x0 ; <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><>ࠬ<EFBFBD><E0A0AC>
|
2013-11-11 23:49:12 +01:00
|
|
|
|
dd cur_dir_path
|
|
|
|
|
|
|
|
|
|
include 'lang.inc'
|
|
|
|
|
include '../../../macros.inc'
|
|
|
|
|
include '../../../proc32.inc'
|
|
|
|
|
include '../../../dll.inc'
|
|
|
|
|
include '../../../develop/libraries/box_lib/load_lib.mac'
|
|
|
|
|
include '../../../develop/libraries/box_lib/trunk/box_lib.mac'
|
2016-02-13 16:26:28 +01:00
|
|
|
|
include '../../../gui_patterns.inc'
|
2016-11-01 00:41:05 +01:00
|
|
|
|
include "../../../string.inc"
|
|
|
|
|
|
|
|
|
|
WIN_W equ 440
|
|
|
|
|
WIN_H equ 200
|
|
|
|
|
BOT_PANEL_H equ 70
|
|
|
|
|
|
|
|
|
|
CANCEL_BUTTON_ID equ 1+BT_HIDE
|
2016-11-03 13:41:15 +01:00
|
|
|
|
HOME_BUTTON_ID equ 2
|
|
|
|
|
REBOOT_BUTTON_ID equ 3
|
2016-11-01 00:41:05 +01:00
|
|
|
|
POWEROFF_BUTTON_ID equ 4
|
2013-11-11 23:49:12 +01:00
|
|
|
|
|
2016-02-11 00:25:56 +01:00
|
|
|
|
@use_library
|
|
|
|
|
|
|
|
|
|
|
2013-11-11 23:49:12 +01:00
|
|
|
|
align 4
|
|
|
|
|
START:
|
|
|
|
|
|
2016-02-11 00:25:56 +01:00
|
|
|
|
|
2013-11-11 23:49:12 +01:00
|
|
|
|
load_libraries l_libs_start,end_l_libs
|
2015-08-03 14:38:30 +02:00
|
|
|
|
inc eax
|
|
|
|
|
test eax,eax
|
|
|
|
|
jz close
|
2013-11-11 23:49:12 +01:00
|
|
|
|
|
2015-08-03 14:38:30 +02:00
|
|
|
|
push dword check1
|
|
|
|
|
call [init_checkbox2]
|
2013-11-11 23:49:12 +01:00
|
|
|
|
|
|
|
|
|
stdcall dll.Init,[init_lib]
|
|
|
|
|
|
2015-08-03 14:38:30 +02:00
|
|
|
|
invoke ini_get_int,ini_file,asettings,aautosave,0
|
|
|
|
|
mov [autosave],eax
|
|
|
|
|
dec eax
|
|
|
|
|
jnz @f
|
|
|
|
|
bts dword [check1.flags],1
|
2013-11-11 23:49:12 +01:00
|
|
|
|
@@:
|
2015-08-03 14:38:30 +02:00
|
|
|
|
mcall 40,0x80000027
|
2013-11-11 23:49:12 +01:00
|
|
|
|
redraw:
|
|
|
|
|
call draw_window
|
2013-10-17 16:31:03 +02:00
|
|
|
|
still:
|
2013-10-19 12:24:30 +02:00
|
|
|
|
mov al,10
|
2015-08-03 14:38:30 +02:00
|
|
|
|
mcall ;wait here for event
|
2011-01-18 15:29:19 +01:00
|
|
|
|
dec eax
|
2015-08-03 14:38:30 +02:00
|
|
|
|
jz redraw
|
2011-01-18 15:29:19 +01:00
|
|
|
|
dec eax
|
2015-08-03 14:38:30 +02:00
|
|
|
|
jz key
|
2013-11-11 23:49:12 +01:00
|
|
|
|
dec eax
|
2015-08-03 14:38:30 +02:00
|
|
|
|
jz button
|
2013-11-11 23:49:12 +01:00
|
|
|
|
|
|
|
|
|
push dword check1
|
|
|
|
|
call [check_box_mouse2]
|
2015-08-03 14:38:30 +02:00
|
|
|
|
bt dword [check1.flags],1
|
2013-11-11 23:49:12 +01:00
|
|
|
|
jnc @f
|
|
|
|
|
mov [autosave],1
|
|
|
|
|
jmp still
|
|
|
|
|
@@:
|
|
|
|
|
mov [autosave],0
|
|
|
|
|
jmp still
|
2013-11-21 10:36:24 +01:00
|
|
|
|
|
2013-11-11 23:49:12 +01:00
|
|
|
|
key:
|
2013-10-19 12:24:30 +02:00
|
|
|
|
mov al,2
|
2015-08-03 14:38:30 +02:00
|
|
|
|
mcall ;eax=2 - get key code
|
2011-01-18 15:29:19 +01:00
|
|
|
|
mov al,ah
|
|
|
|
|
cmp al,13
|
2013-11-12 01:45:05 +01:00
|
|
|
|
je restart
|
2011-01-18 15:29:19 +01:00
|
|
|
|
cmp al,19
|
2013-11-12 01:45:05 +01:00
|
|
|
|
je checkbox
|
2011-01-18 15:29:19 +01:00
|
|
|
|
cmp al,180
|
2013-11-12 01:45:05 +01:00
|
|
|
|
je restart_kernel
|
2011-01-18 15:29:19 +01:00
|
|
|
|
cmp al,181
|
2013-11-12 01:45:05 +01:00
|
|
|
|
je power_off
|
|
|
|
|
cmp al,27
|
|
|
|
|
jne still
|
|
|
|
|
|
|
|
|
|
close:
|
|
|
|
|
mcall -1
|
2011-01-18 15:29:19 +01:00
|
|
|
|
|
2013-10-17 16:31:03 +02:00
|
|
|
|
button:
|
2015-08-03 14:38:30 +02:00
|
|
|
|
mcall 17 ;eax=17 - get pressed button id
|
2011-01-18 15:29:19 +01:00
|
|
|
|
xchg al,ah
|
|
|
|
|
dec eax
|
2015-08-03 14:38:30 +02:00
|
|
|
|
jz close
|
2011-01-18 15:29:19 +01:00
|
|
|
|
dec eax
|
2015-08-03 14:38:30 +02:00
|
|
|
|
jz restart_kernel
|
2011-01-18 15:29:19 +01:00
|
|
|
|
dec eax
|
2015-08-03 14:38:30 +02:00
|
|
|
|
jz restart
|
2011-01-18 15:29:19 +01:00
|
|
|
|
dec eax
|
2013-11-11 23:49:12 +01:00
|
|
|
|
jnz checkbox
|
2013-10-17 16:31:03 +02:00
|
|
|
|
|
2012-05-25 11:21:47 +02:00
|
|
|
|
power_off:
|
|
|
|
|
push 2
|
|
|
|
|
jmp mcall_and_close
|
2013-11-11 23:49:12 +01:00
|
|
|
|
|
2012-05-25 11:21:47 +02:00
|
|
|
|
restart:
|
2011-01-18 15:29:19 +01:00
|
|
|
|
push 3
|
|
|
|
|
jmp mcall_and_close
|
2013-11-11 23:49:12 +01:00
|
|
|
|
|
2013-10-17 16:31:03 +02:00
|
|
|
|
restart_kernel:
|
2011-01-18 15:29:19 +01:00
|
|
|
|
push 4
|
2013-11-11 23:49:12 +01:00
|
|
|
|
|
2011-01-18 15:29:19 +01:00
|
|
|
|
mcall_and_close:
|
2013-11-21 10:36:24 +01:00
|
|
|
|
if fade=1
|
|
|
|
|
; === FADE IN ===
|
|
|
|
|
mov eax, color1
|
|
|
|
|
@@:
|
|
|
|
|
mov ebx, [eax + 32]
|
|
|
|
|
mov [eax], ebx
|
|
|
|
|
add eax, 4
|
|
|
|
|
cmp eax, color21
|
|
|
|
|
jne @b
|
|
|
|
|
|
|
|
|
|
call draw_window
|
|
|
|
|
end if
|
|
|
|
|
|
2013-11-11 23:49:12 +01:00
|
|
|
|
invoke ini_set_int,ini_file,asettings,aautosave,[autosave]
|
|
|
|
|
cmp [autosave],1
|
|
|
|
|
jne no_save
|
2013-11-23 11:09:40 +01:00
|
|
|
|
|
|
|
|
|
if fade=0
|
|
|
|
|
mov al,4
|
2015-08-03 14:38:30 +02:00
|
|
|
|
mcall ,<50,120> ,0x800000cc,label7 ;eax=4 - write text
|
2013-11-23 11:09:40 +01:00
|
|
|
|
end if
|
|
|
|
|
|
2013-11-11 23:49:12 +01:00
|
|
|
|
mcall 70,rdsave
|
|
|
|
|
test eax,eax
|
2015-08-03 14:38:30 +02:00
|
|
|
|
js no_save
|
2013-11-11 23:49:12 +01:00
|
|
|
|
mov ecx,eax
|
|
|
|
|
mcall 18,21
|
|
|
|
|
mov ecx,eax
|
|
|
|
|
@@:
|
|
|
|
|
push ecx
|
2013-11-12 01:45:05 +01:00
|
|
|
|
mcall 23,100
|
2013-11-11 23:49:12 +01:00
|
|
|
|
dec eax
|
|
|
|
|
jnz no_red
|
|
|
|
|
call draw_window
|
2013-11-21 10:36:24 +01:00
|
|
|
|
no_red:
|
2013-11-11 23:49:12 +01:00
|
|
|
|
pop ecx
|
|
|
|
|
mcall 9,proc_info
|
|
|
|
|
cmp [proc_info+50],9
|
2015-08-03 14:38:30 +02:00
|
|
|
|
je no_save
|
2013-11-11 23:49:12 +01:00
|
|
|
|
jmp @b
|
|
|
|
|
no_save:
|
2011-01-18 15:29:19 +01:00
|
|
|
|
pop ecx
|
2018-11-10 00:16:23 +01:00
|
|
|
|
mcall 18,9
|
|
|
|
|
mcall -1
|
2013-11-21 10:48:36 +01:00
|
|
|
|
ret
|
2013-11-11 23:49:12 +01:00
|
|
|
|
|
|
|
|
|
checkbox:
|
|
|
|
|
btc dword [check1.flags],1
|
2015-08-03 14:38:30 +02:00
|
|
|
|
jc .1
|
2013-11-11 23:49:12 +01:00
|
|
|
|
mov [autosave],1
|
|
|
|
|
jmp .draw
|
|
|
|
|
.1:
|
|
|
|
|
mov [autosave],0
|
|
|
|
|
.draw:
|
|
|
|
|
push dword check1
|
|
|
|
|
call [check_box_draw2]
|
|
|
|
|
jmp still
|
2013-11-21 10:36:24 +01:00
|
|
|
|
|
2013-11-11 23:49:12 +01:00
|
|
|
|
draw_window:
|
2016-02-11 00:25:56 +01:00
|
|
|
|
mcall 12,1
|
2016-11-01 00:41:05 +01:00
|
|
|
|
|
2013-11-12 01:45:05 +01:00
|
|
|
|
mov al,14
|
2015-08-03 14:38:30 +02:00
|
|
|
|
mcall ;eax=14 - get screen max x & max y
|
2013-11-11 23:49:12 +01:00
|
|
|
|
movzx ecx,ax
|
2013-11-12 01:45:05 +01:00
|
|
|
|
shr eax,17
|
|
|
|
|
shl eax,16
|
2016-11-01 00:41:05 +01:00
|
|
|
|
lea ebx,[eax-(WIN_W/2) shl 16+WIN_W-1]
|
2013-11-12 01:45:05 +01:00
|
|
|
|
shr ecx,1
|
|
|
|
|
shl ecx,16
|
2016-11-01 00:41:05 +01:00
|
|
|
|
lea ecx,[ecx-(WIN_H/2) shl 16+WIN_H-1]
|
2013-11-12 01:45:05 +01:00
|
|
|
|
|
|
|
|
|
xor eax,eax
|
2016-11-01 00:41:05 +01:00
|
|
|
|
mov edx, 0x41000000
|
|
|
|
|
mcall ;define and draw window
|
|
|
|
|
|
|
|
|
|
DrawWideRectangle 0, 0, WIN_W, WIN_H, 2, 0xA3A7AA
|
|
|
|
|
DrawBar 2, 2, WIN_W-4, WIN_H-BOT_PANEL_H-2, 0x202020
|
|
|
|
|
DrawBar 2, WIN_H-BOT_PANEL_H-2, WIN_W-4, BOT_PANEL_H, 0x4B4B4B
|
|
|
|
|
WriteText 30, 27, 10010001b, 0xFFFfff, TEXT_TITLE
|
|
|
|
|
WriteText 55, 70, 10010000b, 0xFFFfff, TEXT_RDSAVE1
|
|
|
|
|
WriteText 55, 86, 10010000b, 0xFFFfff, TEXT_RDSAVE2
|
|
|
|
|
|
|
|
|
|
DefineButton WIN_W-33, 2, 32, 20, CANCEL_BUTTON_ID, 0
|
|
|
|
|
WriteText WIN_W-23, 5, 10000001b, 0xFFFfff, TEXT_CANCEL
|
2013-11-12 01:45:05 +01:00
|
|
|
|
|
2013-11-11 23:49:12 +01:00
|
|
|
|
push dword check1
|
|
|
|
|
call [check_box_draw2]
|
|
|
|
|
|
2016-11-01 00:41:05 +01:00
|
|
|
|
macro EndButton x, bgcol, id, but_text, hotkey_text
|
|
|
|
|
{
|
|
|
|
|
buty equ WIN_H-60
|
|
|
|
|
butw equ 116
|
|
|
|
|
buth equ 43
|
|
|
|
|
DrawWideRectangle x-3, buty-3, butw+6, buth+6, 3, 0x202020
|
|
|
|
|
DefineButton x, buty, butw-1, buth-1, id, bgcol
|
|
|
|
|
; WriteTextBold -strlen(but_text)*8 + butw / 2 + x, buty+8, 10010000b, 0xFFFfff, but_text
|
|
|
|
|
; WriteText -strlen(but_text)*6 + butw / 2 + x, buty+26, 10000000b, 0xFFFfff, hotkey_text
|
|
|
|
|
stdcall string.length, but_text
|
|
|
|
|
mov ebx,eax
|
|
|
|
|
imul ebx,4
|
|
|
|
|
neg ebx
|
|
|
|
|
add ebx,butw / 2 + x
|
|
|
|
|
shl ebx,16
|
|
|
|
|
add ebx,buty+8
|
|
|
|
|
mcall 4, , 10010000b shl 24 + 0xFFFfff, but_text
|
|
|
|
|
add ebx,1 shl 16
|
|
|
|
|
mcall
|
|
|
|
|
stdcall string.length, hotkey_text
|
|
|
|
|
mov ebx,eax
|
|
|
|
|
imul ebx,3
|
|
|
|
|
neg ebx
|
|
|
|
|
add ebx,butw / 2 + x
|
|
|
|
|
shl ebx,16
|
|
|
|
|
add ebx,buty+26
|
|
|
|
|
mcall 4, , 10000000b shl 24 + 0xFFFfff, hotkey_text
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
EndButton 20, 0x4E91C5, HOME_BUTTON_ID, TEXT_KERNEL, TEXT_HOME
|
|
|
|
|
EndButton 160, 0x55C891, REBOOT_BUTTON_ID, TEXT_REBOOT, TEXT_ENTER
|
|
|
|
|
EndButton 300, 0xC75C54, POWEROFF_BUTTON_ID, TEXT_OFF, TEXT_END
|
|
|
|
|
|
2013-11-11 23:49:12 +01:00
|
|
|
|
mov al,12
|
|
|
|
|
mcall ,2
|
|
|
|
|
ret
|
2013-11-12 01:45:05 +01:00
|
|
|
|
;---------------------------------------------------------------------
|
|
|
|
|
;data
|
2013-10-17 16:31:03 +02:00
|
|
|
|
include 'data.inc'
|
2013-11-11 23:49:12 +01:00
|
|
|
|
;---------------------------------------------------------------------
|
|
|
|
|
IM_END:
|
|
|
|
|
;---------------------------------------------------------------------
|
|
|
|
|
align 4
|
|
|
|
|
|
|
|
|
|
proc_info rb 1024
|
|
|
|
|
|
|
|
|
|
autosave rd 1
|
|
|
|
|
;---------------------------------------------------------------------
|
|
|
|
|
cur_dir_path:
|
2015-08-03 14:38:30 +02:00
|
|
|
|
rb 4096
|
2013-11-11 23:49:12 +01:00
|
|
|
|
;---------------------------------------------------------------------
|
|
|
|
|
library_path:
|
2015-08-03 14:38:30 +02:00
|
|
|
|
rb 4096
|
2013-11-11 23:49:12 +01:00
|
|
|
|
;---------------------------------------------------------------------
|
|
|
|
|
align 32
|
2015-08-03 14:38:30 +02:00
|
|
|
|
rb 4096
|
2013-11-11 23:49:12 +01:00
|
|
|
|
stacktop:
|
2015-08-03 14:38:30 +02:00
|
|
|
|
I_END: ; <20><>⪠ <20><><EFBFBD><EFBFBD><EFBFBD> <20>ணࠬ<E0AEA3><E0A0AC>
|