forked from KolibriOS/kolibrios
Add sources codes "Personalization desktop" program. v 0.1
git-svn-id: svn://kolibrios.org@4813 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
046a098d81
commit
ffd240bc4f
269
programs/other/personal/inc/button.inc
Normal file
269
programs/other/personal/inc/button.inc
Normal file
@ -0,0 +1,269 @@
|
||||
struct new_button
|
||||
x dw ?
|
||||
y dw ?
|
||||
w dw ?
|
||||
h dw ?
|
||||
f dw ?
|
||||
face dd ?
|
||||
frame dd ?
|
||||
event dd ?
|
||||
ends
|
||||
|
||||
button_event_next:
|
||||
pusha
|
||||
mov eax,[edit_cnt]
|
||||
cmp eax,4
|
||||
je @f
|
||||
inc eax
|
||||
jmp ben_exit
|
||||
@@:
|
||||
mov eax,1
|
||||
ben_exit:
|
||||
mov [edit_cnt],eax
|
||||
call draw_edit
|
||||
call list_draw
|
||||
popa
|
||||
ret
|
||||
|
||||
button_event_back:
|
||||
pusha
|
||||
mov eax,[edit_cnt]
|
||||
cmp eax,1
|
||||
je @f
|
||||
dec eax
|
||||
jmp ben_exit
|
||||
@@:
|
||||
mov eax,4
|
||||
beb_exit:
|
||||
mov [edit_cnt],eax
|
||||
call draw_edit
|
||||
call list_draw
|
||||
popa
|
||||
ret
|
||||
|
||||
|
||||
button_init:
|
||||
;; nex init ------------
|
||||
mov ax, 36
|
||||
mov [bnext.x],ax
|
||||
mov ax, 8
|
||||
mov [bnext.y],ax
|
||||
mov ax, 26
|
||||
mov [bnext.w],ax
|
||||
mov ax, 19
|
||||
mov [bnext.h],ax
|
||||
mov ax, 0
|
||||
mov [bnext.f],ax
|
||||
mov eax,[sc.btn_face]
|
||||
mov [bnext.face],eax
|
||||
mov eax,[sc.btn_frame]
|
||||
mov [bnext.frame],eax
|
||||
mov eax,button_event_next
|
||||
mov [bnext.event],eax
|
||||
|
||||
mov ax, 7
|
||||
mov [bback.x],ax
|
||||
mov ax, 8
|
||||
mov [bback.y],ax
|
||||
mov ax, 26
|
||||
mov [bback.w],ax
|
||||
mov ax, 19
|
||||
mov [bback.h],ax
|
||||
mov ax, 0
|
||||
mov [bback.f],ax
|
||||
mov eax,[sc.btn_face]
|
||||
mov [bback.face],eax
|
||||
mov eax,[sc.btn_frame]
|
||||
mov [bback.frame],eax
|
||||
mov eax,button_event_back
|
||||
mov [bback.event],eax
|
||||
ret
|
||||
|
||||
button_calc:
|
||||
mov eax, bnext
|
||||
call button_focus
|
||||
mov eax, bback
|
||||
call button_focus
|
||||
ret
|
||||
|
||||
button_focus:
|
||||
pusha
|
||||
xor ecx,ecx
|
||||
xor ebx,ebx
|
||||
mov edi,[mouse_x]
|
||||
mov bx, word [eax]
|
||||
cmp ebx,edi
|
||||
jg button_focus_out
|
||||
add bx, word [eax + 4]
|
||||
cmp ebx,edi
|
||||
jb button_focus_out
|
||||
mov edi,[mouse_y]
|
||||
mov bx,[eax + 2]
|
||||
cmp ebx,edi
|
||||
jg button_focus_out
|
||||
add bx,[eax + 6]
|
||||
cmp ebx,edi
|
||||
jb button_focus_out
|
||||
;----
|
||||
push eax
|
||||
call mouse_left
|
||||
mov ecx,[mouse_l]
|
||||
cmp ecx,0
|
||||
je button_focus_set
|
||||
xor ecx,ecx
|
||||
mov [mouse_l],ecx
|
||||
call dword [eax+18]
|
||||
|
||||
button_focus_set:
|
||||
pop eax
|
||||
;----
|
||||
mov ecx,1
|
||||
button_focus_out:
|
||||
mov word [eax + 8],cx
|
||||
popa
|
||||
ret
|
||||
|
||||
button_draw:
|
||||
mov eax, bnext
|
||||
call button_draw_all
|
||||
mov eax, bback
|
||||
call button_draw_all
|
||||
; arrow
|
||||
pusha
|
||||
mov eax , 7
|
||||
mov ebx , arrowa
|
||||
mov ecx , 6 shl 16 + 10
|
||||
mov edx , 46 shl 16 + 13
|
||||
int 0x40
|
||||
mov ebx , arrowb
|
||||
mov edx , 17 shl 16 + 13
|
||||
int 0x40
|
||||
popa
|
||||
ret
|
||||
|
||||
button_draw_all:
|
||||
pusha
|
||||
mov ebx,[win_slot]
|
||||
cmp ebx,1
|
||||
je @f
|
||||
mov ebx,[sc.btn_inface]
|
||||
mov dword [eax + 10],ebx
|
||||
mov ebx,[sc.btn_inframe]
|
||||
mov dword [eax + 14],ebx
|
||||
jmp button_draw_run
|
||||
@@: ;act
|
||||
xor ebx,ebx
|
||||
mov bx,word [eax + 8]
|
||||
cmp ebx,1
|
||||
je @f
|
||||
mov ebx,[sc.btn_face]
|
||||
mov dword [eax + 10],ebx
|
||||
mov ebx,[sc.btn_frame]
|
||||
mov dword [eax + 14],ebx
|
||||
jmp button_draw_run
|
||||
@@: ; foc
|
||||
mov ebx,[sc.btn_fcface]
|
||||
mov dword [eax + 10],ebx
|
||||
mov ebx,[sc.btn_fcframe]
|
||||
mov dword [eax + 14],ebx
|
||||
|
||||
button_draw_run:
|
||||
|
||||
; ïðÿìîóãîëüíûé ôîí
|
||||
mov bx, word [eax] ; x
|
||||
add bx, 2 ; x+2
|
||||
shl ebx,16
|
||||
mov bx, word [eax+4] ; w
|
||||
sub bx, 4 ; w-4
|
||||
mov cx, word [eax+2] ; y
|
||||
add cx,2 ; y+2
|
||||
shl ecx,16
|
||||
mov cx, word [eax+6] ; h
|
||||
sub cx, 4 ; h-4
|
||||
mov edx, dword [eax + 10] ; color
|
||||
push eax
|
||||
mov eax, 13 ; rect
|
||||
int 0x40 ; draw
|
||||
pop eax
|
||||
|
||||
; âåðõíÿÿ ëèíèÿ [frame]
|
||||
mov edx, dword [eax + 14] ; color
|
||||
mov bx, word [eax] ; x
|
||||
inc bx ; x+1
|
||||
shl ebx,16
|
||||
mov bx, word [eax] ; x2=x
|
||||
add bx, word [eax + 4] ; x2=x+w
|
||||
sub bx,2 ; x2=x2-2
|
||||
mov cx, word [eax + 2] ; y
|
||||
shl ecx,16
|
||||
mov cx, word [eax + 2] ; y2=y
|
||||
push eax
|
||||
mov eax, 38 ; line
|
||||
int 0x40 ; draw
|
||||
; âåðõíÿÿ ëèíèÿ [3d]
|
||||
mov edx, [sc.3d_light] ; color
|
||||
add ecx, 1 shl 16 + 1 ; y=y+1 y2=y2+1
|
||||
int 0x40 ; draw
|
||||
pop eax
|
||||
|
||||
; íèæíÿÿ ëèíèÿ [frame]
|
||||
|
||||
mov cx, word [eax + 2] ; y
|
||||
add cx, word [eax + 6] ; y = y+h
|
||||
push cx
|
||||
shl ecx,16
|
||||
pop cx
|
||||
sub ecx, 1 shl 16 + 1 ; y=y+1 y2=y2+1
|
||||
mov edx, dword [eax + 14] ; color
|
||||
push eax
|
||||
mov eax, 38 ; line
|
||||
int 0x40 ; draw
|
||||
; íèæíÿÿ ëèíèÿ [3d]
|
||||
sub ebx, 1 shl 16 ; x = x-1
|
||||
mov edx, [sc.3d_dark] ; color
|
||||
sub ecx, 1 shl 16 + 1 ; y=y+1 y2=y2+1
|
||||
int 0x40 ; draw
|
||||
pop eax
|
||||
|
||||
|
||||
; ïåðåäíÿÿ áîêîâàÿ [frame]
|
||||
mov edx, dword [eax + 14] ; color
|
||||
mov bx, word [eax] ; x
|
||||
shl ebx,16
|
||||
mov bx, word [eax] ; x2=x
|
||||
mov cx, word [eax + 2] ; y
|
||||
inc cx ; y=y+1
|
||||
shl ecx,16
|
||||
mov cx, word [eax + 2] ; y2=y
|
||||
add cx, word [eax + 6] ; y2=y+h
|
||||
sub cx,2 ; y2=y2-2
|
||||
push eax
|
||||
mov eax, 38 ; line
|
||||
int 0x40 ; draw
|
||||
; ïåðåäíÿÿ áîêîâàÿ [3d]
|
||||
mov edx, [sc.3d_light] ; color
|
||||
add ebx, 1 shl 16 + 1 ; x=x+1 x2=x2+1
|
||||
sub ecx,1 ; y2=y2-1
|
||||
int 0x40 ; draw
|
||||
pop eax
|
||||
|
||||
; çàäíÿÿ áîêîâàÿ [frame]
|
||||
mov edx, dword [eax + 14] ; color
|
||||
mov bx, word [eax] ; x
|
||||
add bx, word [eax + 4] ; x=x+w
|
||||
dec bx
|
||||
push bx
|
||||
shl ebx,16
|
||||
pop bx
|
||||
inc ecx
|
||||
push eax
|
||||
mov eax, 38 ; line
|
||||
int 0x40 ; draw
|
||||
; çàäíÿÿ áîêîâàÿ [3d]
|
||||
mov edx, [sc.3d_dark] ; color
|
||||
sub ebx, 1 shl 16 + 1 ; x=x+1 x2=x2+1
|
||||
int 0x40 ; draw
|
||||
pop eax
|
||||
|
||||
popa
|
||||
ret
|
51
programs/other/personal/inc/dtp.inc
Normal file
51
programs/other/personal/inc/dtp.inc
Normal file
@ -0,0 +1,51 @@
|
||||
; set table
|
||||
struct new_colors
|
||||
menu_body dd ?
|
||||
3d_face dd ?
|
||||
3d_dark dd ?
|
||||
3d_light dd ?
|
||||
win_title dd ?
|
||||
win_body dd ?
|
||||
btn_face dd ?
|
||||
btn_text dd ?
|
||||
win_text dd ?
|
||||
panel_frame dd ?
|
||||
win_face dd ?
|
||||
win_inface dd ?
|
||||
win_frame dd ?
|
||||
win_inframe dd ?
|
||||
win_border dd ?
|
||||
win_inborder dd ?
|
||||
win_graytext dd ?
|
||||
menu_frame dd ?
|
||||
menu_text dd ?
|
||||
panel_body dd ?
|
||||
panel_text dd ?
|
||||
hint_frame dd ?
|
||||
hint_body dd ?
|
||||
hint_text dd ?
|
||||
btn_inface dd ?
|
||||
btn_fcface dd ?
|
||||
btn_frame dd ?
|
||||
btn_inframe dd ?
|
||||
btn_fcframe dd ?
|
||||
btn_intext dd ?
|
||||
btn_fctext dd ?
|
||||
gui_shadow dd ?
|
||||
gui_face dd ?
|
||||
gui_inface dd ?
|
||||
gui_fcface dd ?
|
||||
gui_frame dd ?
|
||||
gui_inframe dd ?
|
||||
gui_fcframe dd ?
|
||||
gui_text dd ?
|
||||
gui_intext dd ?
|
||||
gui_fctext dd ?
|
||||
gui_select dd ?
|
||||
res_var_a dd ?
|
||||
res_var_b dd ?
|
||||
res_var_c dd ?
|
||||
res_var_d dd ?
|
||||
res_var_e dd ?
|
||||
res_var_f dd ?
|
||||
ends
|
65
programs/other/personal/inc/edit.inc
Normal file
65
programs/other/personal/inc/edit.inc
Normal file
@ -0,0 +1,65 @@
|
||||
draw_edit:
|
||||
pusha
|
||||
|
||||
mov eax , 13
|
||||
mov ebx , 75 shl 16 + 116
|
||||
mov ecx , 10 shl 16 + 15
|
||||
mov edx , [sc.gui_face]
|
||||
int 0x40
|
||||
|
||||
mov eax , 38
|
||||
mov ebx , 74 shl 16 + 191
|
||||
mov ecx , 9 shl 16 + 9
|
||||
mov edx , [sc.3d_light]
|
||||
int 0x40
|
||||
mov ecx , 25 shl 16 + 25
|
||||
int 0x40
|
||||
mov ecx , 8 shl 16 + 8
|
||||
mov edx , [sc.gui_inframe]
|
||||
int 0x40
|
||||
mov ecx , 26 shl 16 + 26
|
||||
int 0x40
|
||||
|
||||
mov eax , 38
|
||||
mov ebx , 74 shl 16 + 74
|
||||
mov ecx , 9 shl 16 + 25
|
||||
mov edx , [sc.3d_light]
|
||||
int 0x40
|
||||
mov ebx , 191 shl 16 + 191
|
||||
int 0x40
|
||||
mov edx , [sc.gui_inframe]
|
||||
mov ebx , 192 shl 16 + 192
|
||||
int 0x40
|
||||
mov ebx , 73 shl 16 + 73
|
||||
int 0x40
|
||||
|
||||
mov eax,4
|
||||
mov ecx,[sc.gui_intext]
|
||||
add ecx,0xC0000000
|
||||
mov edi,[sc.gui_face]
|
||||
|
||||
mov edx,[edit_cnt]
|
||||
cmp edx,1
|
||||
jne @f
|
||||
mov edx,edit_win
|
||||
mov ebx,115*65536 + 14
|
||||
jmp draw_edit_exit
|
||||
@@:
|
||||
cmp edx,2
|
||||
jne @f
|
||||
mov edx,edit_btn
|
||||
mov ebx,115*65536 + 14
|
||||
jmp draw_edit_exit
|
||||
@@:
|
||||
cmp edx,3
|
||||
jne @f
|
||||
mov edx,edit_gui
|
||||
mov ebx,112*65536 + 14
|
||||
jmp draw_edit_exit
|
||||
@@:
|
||||
mov edx,edit_cld
|
||||
mov ebx,112*65536 + 14
|
||||
draw_edit_exit:
|
||||
int 0x40
|
||||
popa
|
||||
ret
|
525
programs/other/personal/inc/list.inc
Normal file
525
programs/other/personal/inc/list.inc
Normal file
@ -0,0 +1,525 @@
|
||||
list_draw:
|
||||
call list_draw_ground
|
||||
mov eax,[edit_cnt]
|
||||
cmp eax,1
|
||||
jne @f
|
||||
call list_draw_win_text
|
||||
call list_draw_win_hex
|
||||
jmp list_draw_exit
|
||||
@@:
|
||||
cmp eax,2
|
||||
jne @f
|
||||
call list_draw_btn_text
|
||||
call list_draw_btn_hex
|
||||
jmp list_draw_exit
|
||||
@@:
|
||||
cmp eax,3
|
||||
jne @f
|
||||
call list_draw_gui_text
|
||||
call list_draw_gui_hex
|
||||
jmp list_draw_exit
|
||||
@@:
|
||||
call list_draw_sup_text
|
||||
call list_draw_sup_hex
|
||||
list_draw_exit:
|
||||
ret
|
||||
|
||||
list_draw_ground:
|
||||
;; draw list face
|
||||
push edi
|
||||
mov edi,12
|
||||
mov eax,13
|
||||
mov ebx, 9 shl 16 + 214
|
||||
mov ecx, 32 shl 16 + 19
|
||||
mov edx,[sc.gui_face]
|
||||
draw_list_face:
|
||||
int 0x40
|
||||
add ecx, 20 shl 16 + 0
|
||||
dec edi
|
||||
cmp edi,0
|
||||
jne draw_list_face
|
||||
pop edi
|
||||
|
||||
;; draw list line
|
||||
push edi
|
||||
mov edi,13
|
||||
mov eax,38
|
||||
mov ebx, 9 shl 16 + 221
|
||||
mov ecx, 31 shl 16 + 31
|
||||
mov edx,[sc.gui_frame]
|
||||
draw_list_line:
|
||||
int 0x40
|
||||
add ecx, 20 shl 16 + 20
|
||||
dec edi
|
||||
cmp edi,0
|
||||
jne draw_list_line
|
||||
pop edi
|
||||
|
||||
;; draw hex sybbol
|
||||
push esi
|
||||
mov esi,12
|
||||
mov eax,4
|
||||
mov ecx,[sc.gui_intext]
|
||||
add ecx,0xC0000000
|
||||
mov ebx,164*65536 + 38
|
||||
mov edx,text_hex
|
||||
mov edi,[sc.gui_face]
|
||||
draw_list_hex:
|
||||
push esi
|
||||
int 0x40
|
||||
pop esi
|
||||
add ebx,20
|
||||
dec esi
|
||||
cmp esi,0
|
||||
jne draw_list_hex
|
||||
pop esi
|
||||
|
||||
;; draw vert line
|
||||
mov eax, 38
|
||||
mov ebx, 8 shl 16 + 8
|
||||
mov ecx, 32 shl 16 + 270
|
||||
mov edx,[sc.gui_frame]
|
||||
int 0x40
|
||||
mov ebx, 142 shl 16 + 142
|
||||
int 0x40
|
||||
mov ebx, 222 shl 16 + 222
|
||||
int 0x40
|
||||
ret
|
||||
|
||||
list_draw_win_text:
|
||||
mov eax,4
|
||||
mov ecx,[sc.gui_text]
|
||||
add ecx,0xC0000000
|
||||
mov edi,[sc.gui_face]
|
||||
|
||||
mov edx,text_frame
|
||||
mov ebx,16*65536 + 38
|
||||
int 0x40
|
||||
|
||||
mov edx,text_inframe
|
||||
add ebx,20
|
||||
int 0x40
|
||||
|
||||
mov edx,text_face
|
||||
add ebx,20
|
||||
int 0x40
|
||||
|
||||
mov edx,text_inface
|
||||
add ebx,20
|
||||
int 0x40
|
||||
|
||||
mov edx,text_border
|
||||
add ebx,20
|
||||
int 0x40
|
||||
|
||||
mov edx,text_inborder
|
||||
add ebx,20
|
||||
int 0x40
|
||||
|
||||
mov edx,text_wtext
|
||||
add ebx,20
|
||||
int 0x40
|
||||
|
||||
mov edx,text_graytext
|
||||
add ebx,20
|
||||
int 0x40
|
||||
|
||||
mov edx,text_title
|
||||
add ebx,20
|
||||
int 0x40
|
||||
|
||||
mov edx,text_body
|
||||
add ebx,20
|
||||
int 0x40
|
||||
|
||||
mov edx,text_reserved
|
||||
add ebx,20
|
||||
int 0x40
|
||||
|
||||
mov edx,text_reserved
|
||||
add ebx,20
|
||||
int 0x40
|
||||
ret
|
||||
|
||||
list_draw_win_hex:
|
||||
mov eax,47
|
||||
mov ebx,256+8 shl 16
|
||||
mov esi,[sc.gui_intext]
|
||||
|
||||
mov ecx,[sc.win_frame]
|
||||
mov edx,170*65536 + 38
|
||||
int 0x40
|
||||
|
||||
mov ecx,[sc.win_inframe]
|
||||
add edx,20
|
||||
int 0x40
|
||||
|
||||
mov ecx,[sc.win_face]
|
||||
add edx,20
|
||||
int 0x40
|
||||
|
||||
mov ecx,[sc.win_inface]
|
||||
add edx,20
|
||||
int 0x40
|
||||
|
||||
mov ecx,[sc.win_border]
|
||||
add edx,20
|
||||
int 0x40
|
||||
|
||||
mov ecx,[sc.win_inborder]
|
||||
add edx,20
|
||||
int 0x40
|
||||
|
||||
mov ecx,[sc.win_text]
|
||||
add edx,20
|
||||
int 0x40
|
||||
|
||||
mov ecx,[sc.win_graytext]
|
||||
add edx,20
|
||||
int 0x40
|
||||
|
||||
mov ecx,[sc.win_title]
|
||||
add edx,20
|
||||
int 0x40
|
||||
|
||||
mov ecx,[sc.win_body]
|
||||
add edx,20
|
||||
int 0x40
|
||||
|
||||
mov ecx,[sc.res_var_a]
|
||||
add edx,20
|
||||
int 0x40
|
||||
|
||||
mov ecx,[sc.res_var_b]
|
||||
add edx,20
|
||||
int 0x40
|
||||
ret
|
||||
|
||||
list_draw_btn_text:
|
||||
mov eax,4
|
||||
mov ecx,[sc.gui_text]
|
||||
add ecx,0xC0000000
|
||||
mov edi,[sc.gui_face]
|
||||
|
||||
mov edx,text_frame
|
||||
mov ebx,16*65536 + 38
|
||||
int 0x40
|
||||
|
||||
mov edx,text_inframe
|
||||
add ebx,20
|
||||
int 0x40
|
||||
|
||||
mov edx,text_fcframe
|
||||
add ebx,20
|
||||
int 0x40
|
||||
|
||||
mov edx,text_face
|
||||
add ebx,20
|
||||
int 0x40
|
||||
|
||||
mov edx,text_inface
|
||||
add ebx,20
|
||||
int 0x40
|
||||
|
||||
mov edx,text_fcface
|
||||
add ebx,20
|
||||
int 0x40
|
||||
|
||||
mov edx,text_text
|
||||
add ebx,20
|
||||
int 0x40
|
||||
|
||||
mov edx,text_intext
|
||||
add ebx,20
|
||||
int 0x40
|
||||
|
||||
mov edx,text_fctext
|
||||
add ebx,20
|
||||
int 0x40
|
||||
|
||||
mov edx,text_reserved
|
||||
add ebx,20
|
||||
int 0x40
|
||||
|
||||
mov edx,text_reserved
|
||||
add ebx,20
|
||||
int 0x40
|
||||
|
||||
mov edx,text_reserved
|
||||
add ebx,20
|
||||
int 0x40
|
||||
ret
|
||||
|
||||
list_draw_btn_hex:
|
||||
mov eax,47
|
||||
mov ebx,256+8 shl 16
|
||||
mov esi,[sc.gui_intext]
|
||||
|
||||
mov ecx,[sc.btn_frame]
|
||||
mov edx,170*65536 + 38
|
||||
int 0x40
|
||||
|
||||
mov ecx,[sc.btn_inframe]
|
||||
add edx,20
|
||||
int 0x40
|
||||
|
||||
mov ecx,[sc.btn_fcframe]
|
||||
add edx,20
|
||||
int 0x40
|
||||
|
||||
mov ecx,[sc.btn_face]
|
||||
add edx,20
|
||||
int 0x40
|
||||
|
||||
mov ecx,[sc.btn_inface]
|
||||
add edx,20
|
||||
int 0x40
|
||||
|
||||
mov ecx,[sc.btn_fcface]
|
||||
add edx,20
|
||||
int 0x40
|
||||
|
||||
mov ecx,[sc.btn_text]
|
||||
add edx,20
|
||||
int 0x40
|
||||
|
||||
mov ecx,[sc.btn_intext]
|
||||
add edx,20
|
||||
int 0x40
|
||||
|
||||
mov ecx,[sc.btn_fctext]
|
||||
add edx,20
|
||||
int 0x40
|
||||
|
||||
mov ecx,[sc.res_var_c]
|
||||
add edx,20
|
||||
int 0x40
|
||||
|
||||
mov ecx,[sc.res_var_d]
|
||||
add edx,20
|
||||
int 0x40
|
||||
|
||||
mov ecx,[sc.res_var_e]
|
||||
add edx,20
|
||||
int 0x40
|
||||
ret
|
||||
|
||||
|
||||
list_draw_gui_text:
|
||||
mov eax,4
|
||||
mov ecx,[sc.gui_text]
|
||||
add ecx,0xC0000000
|
||||
mov edi,[sc.gui_face]
|
||||
|
||||
mov edx,text_frame
|
||||
mov ebx,16*65536 + 38
|
||||
int 0x40
|
||||
|
||||
mov edx,text_inframe
|
||||
add ebx,20
|
||||
int 0x40
|
||||
|
||||
mov edx,text_fcframe
|
||||
add ebx,20
|
||||
int 0x40
|
||||
|
||||
mov edx,text_face
|
||||
add ebx,20
|
||||
int 0x40
|
||||
|
||||
mov edx,text_inface
|
||||
add ebx,20
|
||||
int 0x40
|
||||
|
||||
mov edx,text_fcface
|
||||
add ebx,20
|
||||
int 0x40
|
||||
|
||||
mov edx,text_text
|
||||
add ebx,20
|
||||
int 0x40
|
||||
|
||||
mov edx,text_intext
|
||||
add ebx,20
|
||||
int 0x40
|
||||
|
||||
mov edx,text_fctext
|
||||
add ebx,20
|
||||
int 0x40
|
||||
|
||||
mov edx,text_select
|
||||
add ebx,20
|
||||
int 0x40
|
||||
|
||||
mov edx,text_shadow
|
||||
add ebx,20
|
||||
int 0x40
|
||||
|
||||
mov edx,text_reserved
|
||||
add ebx,20
|
||||
int 0x40
|
||||
ret
|
||||
|
||||
list_draw_gui_hex:
|
||||
mov eax,47
|
||||
mov ebx,256+8 shl 16
|
||||
mov esi,[sc.gui_intext]
|
||||
|
||||
mov ecx,[sc.gui_frame]
|
||||
mov edx,170*65536 + 38
|
||||
int 0x40
|
||||
|
||||
mov ecx,[sc.gui_inframe]
|
||||
add edx,20
|
||||
int 0x40
|
||||
|
||||
mov ecx,[sc.gui_fcframe]
|
||||
add edx,20
|
||||
int 0x40
|
||||
|
||||
mov ecx,[sc.gui_face]
|
||||
add edx,20
|
||||
int 0x40
|
||||
|
||||
mov ecx,[sc.gui_inface]
|
||||
add edx,20
|
||||
int 0x40
|
||||
|
||||
mov ecx,[sc.gui_fcface]
|
||||
add edx,20
|
||||
int 0x40
|
||||
|
||||
mov ecx,[sc.gui_text]
|
||||
add edx,20
|
||||
int 0x40
|
||||
|
||||
mov ecx,[sc.gui_intext]
|
||||
add edx,20
|
||||
int 0x40
|
||||
|
||||
mov ecx,[sc.gui_fctext]
|
||||
add edx,20
|
||||
int 0x40
|
||||
|
||||
mov ecx,[sc.gui_select]
|
||||
add edx,20
|
||||
int 0x40
|
||||
|
||||
mov ecx,[sc.gui_shadow]
|
||||
add edx,20
|
||||
int 0x40
|
||||
|
||||
mov ecx,[sc.res_var_f]
|
||||
add edx,20
|
||||
int 0x40
|
||||
ret
|
||||
|
||||
|
||||
list_draw_sup_text:
|
||||
mov eax,4
|
||||
mov ecx,[sc.gui_text]
|
||||
add ecx,0xC0000000
|
||||
mov edi,[sc.gui_face]
|
||||
|
||||
mov edx,text_p_frame
|
||||
mov ebx,16*65536 + 38
|
||||
int 0x40
|
||||
|
||||
mov edx,text_p_face
|
||||
add ebx,20
|
||||
int 0x40
|
||||
|
||||
mov edx,text_p_text
|
||||
add ebx,20
|
||||
int 0x40
|
||||
|
||||
mov edx,text_m_frame
|
||||
add ebx,20
|
||||
int 0x40
|
||||
|
||||
mov edx,text_m_face
|
||||
add ebx,20
|
||||
int 0x40
|
||||
|
||||
mov edx,text_m_text
|
||||
add ebx,20
|
||||
int 0x40
|
||||
|
||||
mov edx,text_h_frame
|
||||
add ebx,20
|
||||
int 0x40
|
||||
|
||||
mov edx,text_h_face
|
||||
add ebx,20
|
||||
int 0x40
|
||||
|
||||
mov edx,text_h_text
|
||||
add ebx,20
|
||||
int 0x40
|
||||
|
||||
mov edx,text_3dlight
|
||||
add ebx,20
|
||||
int 0x40
|
||||
|
||||
mov edx,text_3ddark
|
||||
add ebx,20
|
||||
int 0x40
|
||||
|
||||
mov edx,text_3dface
|
||||
add ebx,20
|
||||
int 0x40
|
||||
ret
|
||||
|
||||
list_draw_sup_hex:
|
||||
mov eax,47
|
||||
mov ebx,256+8 shl 16
|
||||
mov esi,[sc.gui_intext]
|
||||
|
||||
mov ecx,[sc.panel_frame]
|
||||
mov edx,170*65536 + 38
|
||||
int 0x40
|
||||
|
||||
mov ecx,[sc.panel_body]
|
||||
add edx,20
|
||||
int 0x40
|
||||
|
||||
mov ecx,[sc.panel_text]
|
||||
add edx,20
|
||||
int 0x40
|
||||
|
||||
mov ecx,[sc.menu_frame]
|
||||
add edx,20
|
||||
int 0x40
|
||||
|
||||
mov ecx,[sc.menu_body]
|
||||
add edx,20
|
||||
int 0x40
|
||||
|
||||
mov ecx,[sc.menu_text]
|
||||
add edx,20
|
||||
int 0x40
|
||||
|
||||
mov ecx,[sc.hint_frame]
|
||||
add edx,20
|
||||
int 0x40
|
||||
|
||||
mov ecx,[sc.hint_body]
|
||||
add edx,20
|
||||
int 0x40
|
||||
|
||||
mov ecx,[sc.hint_text]
|
||||
add edx,20
|
||||
int 0x40
|
||||
|
||||
mov ecx,[sc.3d_light]
|
||||
add edx,20
|
||||
int 0x40
|
||||
|
||||
mov ecx,[sc.3d_dark]
|
||||
add edx,20
|
||||
int 0x40
|
||||
|
||||
mov ecx,[sc.3d_face]
|
||||
add edx,20
|
||||
int 0x40
|
||||
ret
|
31
programs/other/personal/inc/mouse.inc
Normal file
31
programs/other/personal/inc/mouse.inc
Normal file
@ -0,0 +1,31 @@
|
||||
mouse_local:
|
||||
;.................................................................................................
|
||||
; Ïîëó÷àåì êîîðäèíàòû ìûøè îòíîñèòåëüíî îêíà
|
||||
;.................................................................................................
|
||||
mov eax,37 ; Ôóíêöèÿ 37 - ðàáîòà ñ ìûøüþ
|
||||
mov ebx,1 ; íàì íóæíû ãëîáàëüíûå êîîðäèíàòû
|
||||
int 0x40 ; eax = x*65536 + y, (x,y)=êîîðäèíàòû êóðñîðà ìûøè
|
||||
mov ecx,eax ;
|
||||
shr ecx,16 ; ecx = x+1
|
||||
movzx edx,ax ; edx = y+1
|
||||
dec ecx ; ecx = x
|
||||
dec edx ; edx = y
|
||||
mov [mouse_x],ecx ; mouse_x = x
|
||||
mov [mouse_y],edx ; mouse_y = y
|
||||
ret ; Âîçâðàùàåì óïðàâëåíèå
|
||||
;end_mouse_local
|
||||
|
||||
mouse_left:
|
||||
pusha
|
||||
xor ecx,ecx
|
||||
mov eax,37
|
||||
mov ebx,2
|
||||
int 0x40
|
||||
cmp al,1
|
||||
jne @f
|
||||
mov ecx,1
|
||||
@@:
|
||||
mov [mouse_l],ecx
|
||||
popa
|
||||
ret
|
||||
;end
|
28
programs/other/personal/inc/process.inc
Normal file
28
programs/other/personal/inc/process.inc
Normal file
@ -0,0 +1,28 @@
|
||||
process_slot:
|
||||
;..........................................................................
|
||||
; Ïîëó÷àåì ïîçèöèþ îêíà ïîòîêà â îêîííîì ñòýêå
|
||||
;..........................................................................
|
||||
mov eax,9
|
||||
mov ebx,buffer
|
||||
mov ecx,-1
|
||||
int 0x40
|
||||
xor ecx,ecx
|
||||
mov cx,word [ebx+4]
|
||||
cmp eax,ecx
|
||||
je @f
|
||||
mov [win_slot],0
|
||||
ret
|
||||
@@:
|
||||
mov [win_slot],1
|
||||
ret
|
||||
|
||||
;mov [win_slot],eax
|
||||
;mov cx,word [ebx+4]
|
||||
;mov [win_stack],eax
|
||||
|
||||
;mov eax,18
|
||||
;mov ebx,7
|
||||
;int 0x40
|
||||
;mov [win_slot],eax
|
||||
ret
|
||||
;end_process_info
|
192
programs/other/personal/personal.asm
Normal file
192
programs/other/personal/personal.asm
Normal file
@ -0,0 +1,192 @@
|
||||
;=============================================================================;
|
||||
;============================[ HEADER ]===========================;
|
||||
;=============================================================================;
|
||||
use32
|
||||
org 0x0
|
||||
|
||||
db 'MENUET01'
|
||||
dd 0x01
|
||||
dd START
|
||||
dd I_END
|
||||
dd 0x100000
|
||||
dd 0x100000
|
||||
dd 0x0
|
||||
dd 0x0
|
||||
|
||||
include 'macros.inc'
|
||||
;=============================================================================;
|
||||
;============================[ EVENTS ]===========================;
|
||||
;=============================================================================;
|
||||
START:
|
||||
mcall 40,0xC0000027 ; устанавливаем маску событий
|
||||
call button_init ; устанавливаем параметры кнопок
|
||||
|
||||
mov eax,48 ; Функция 48 - стили отображения окон
|
||||
mov ebx,3 ; Подфункция 3 - получить стандартные цвета окон.
|
||||
mov ecx,sc ; Указатель на буфер размером edx байт, под структуру
|
||||
mov edx,200 ; Размер таблицы цветов (должен быть 40 байт)
|
||||
int 0x40 ; Прерывание
|
||||
|
||||
mov eax,48 ; Функция 48 - стили отображения окон
|
||||
mov ebx,2 ; Подфункция 3 - получить стандартные цвета окон.
|
||||
mov ecx,sc ; Указатель на буфер размером edx байт, под структуру
|
||||
mov edx,200 ; Размер таблицы цветов (должен быть 40 байт)
|
||||
int 0x40 ; Прерывание
|
||||
|
||||
mov eax,48 ; Функция 48 - стили отображения окон
|
||||
mov ebx,3 ; Подфункция 3 - получить стандартные цвета окон.
|
||||
mov ecx,sc ; Указатель на буфер размером edx байт, под структуру
|
||||
mov edx,200 ; Размер таблицы цветов (должен быть 40 байт)
|
||||
int 0x40 ; Прерывание
|
||||
|
||||
red:
|
||||
call draw_window
|
||||
still:
|
||||
mov eax,10 ; функция 10 - ждать события
|
||||
int 0x40
|
||||
cmp eax,1 ; перерисовать окно ?
|
||||
je red ; если да - на метку red
|
||||
cmp eax,2 ; нажата клавиша ?
|
||||
je key ; если да - на key
|
||||
cmp eax,3 ; нажата кнопка ?
|
||||
je button ; если да - на button
|
||||
cmp eax,6
|
||||
je mouse
|
||||
jmp still ; если другое событие - в начало цикла
|
||||
;end_still
|
||||
|
||||
key: ; нажата клавиша на клавиатуре
|
||||
mov eax,2 ; функция 2 - считать код символа (в ah) (тут в принципе не нужна)
|
||||
int 0x40
|
||||
jmp still ; вернуться к началу цикла
|
||||
;end_key
|
||||
|
||||
button:
|
||||
mov eax,17 ; 17 - получить идентификатор нажатой кнопки
|
||||
int 0x40
|
||||
cmp ah, 1 ; если нажата кнопка с номером 1,
|
||||
jz bexit ; выходим
|
||||
jmp still
|
||||
bexit:
|
||||
mov eax,-1 ; иначе конец программы
|
||||
int 0x40
|
||||
;end_button
|
||||
|
||||
mouse:
|
||||
; ; нажата ли лкм
|
||||
call draw_edit
|
||||
call mouse_local ; получаем координаты мыши относительно окна
|
||||
call button_calc ; отслеживаем наведение курсора
|
||||
call process_slot ; получаем позицию в оконном стеке
|
||||
call button_draw ; отрисовываем кнопки
|
||||
jmp still ; уходим на ожидание события
|
||||
|
||||
|
||||
;============================[ CODE ]===========================;
|
||||
|
||||
ret
|
||||
;end_draw_result
|
||||
|
||||
|
||||
;#___________________________________________________________________________________________________
|
||||
;****************************************************************************************************|
|
||||
; ГЛАВНЫЙ МОДУЛЬ ОТРИСОВКИ ОКНА И ЭЛЕМЕНТОВ ПРИЛОЖЕНИЯ |
|
||||
;----------------------------------------------------------------------------------------------------/
|
||||
draw_window:
|
||||
mov eax,12 ; функция 12: означает, что будет рисоваться окно
|
||||
mov ebx,1 ; 1,начало рисования
|
||||
int 0x40 ; Прерывание
|
||||
|
||||
|
||||
|
||||
mov eax,48 ; Функция 48 - стили отображения окон.
|
||||
mov ebx,4 ; Подфункция 4 - возвращает eax = высота скина.
|
||||
int 0x40 ; Прерывание
|
||||
mov ecx,eax ; Запоминаем высоту скина
|
||||
|
||||
xor eax,eax ; Очищаем eax (mov eax,0) (Функция 0)
|
||||
mov ebx,200 shl 16+240 ; [координата по оси x]*65536 + [размер по оси x]
|
||||
add ecx,200 shl 16+280 ; Высота скина + [координата по y]*65536 + [размер по y]
|
||||
mov edx,[sc.win_body] ; Видимо стиль окна по дефолту
|
||||
or edx,0x34000000 ; Или окно со скином фиксированных размеров
|
||||
mov edi,title ; Заголовок окна
|
||||
int 0x40 ; Прерывание
|
||||
|
||||
call process_slot ; получаем позицию в оконном стеке
|
||||
call button_draw
|
||||
call draw_edit
|
||||
call list_draw
|
||||
|
||||
mov eax,12 ; функция 12: означает, что будет рисоваться окно
|
||||
mov ebx,2 ; 1,начало рисования
|
||||
int 0x40 ; Прерывание
|
||||
|
||||
ret
|
||||
|
||||
|
||||
|
||||
;===================================[ DATA ]==================================;
|
||||
include 'inc/mouse.inc' ; мышь
|
||||
include 'inc/process.inc' ; инфо о процессе
|
||||
include 'inc/dtp.inc' ; структура новой таблицы
|
||||
include 'inc/button.inc' ; самописные кнопки
|
||||
include 'inc/edit.inc' ; эмуляция неактивного едита
|
||||
include 'inc/list.inc' ; отрисовка списка
|
||||
|
||||
;; window -------------------------------------------------
|
||||
sc new_colors ; новая таблица цветов
|
||||
title db 'Color Table',0 ; заголовок
|
||||
mouse_x dd 0 ; хранит глобальную х координату мыши
|
||||
mouse_y dd 0 ; хранит глобальную у координату мыши
|
||||
mouse_l dd 0 ; левая кнопка 1 - нажата 0 - нет
|
||||
win_slot dd 0 ; 0- окно не на верху, 1- на верху
|
||||
buffer rb 80 ; под 9 функцию
|
||||
|
||||
;; button -------------------------------------------------
|
||||
bnext new_button
|
||||
bback new_button
|
||||
arrowa:
|
||||
file 'l.raw'
|
||||
arrowb:
|
||||
file 'r.raw'
|
||||
;; edit ---------------------------------------------------
|
||||
edit_cnt dd 1 ; counter
|
||||
edit_win db 'WINDOW',0 ; 1
|
||||
edit_btn db 'BUTTON',0 ; 2
|
||||
edit_gui db 'ELEMENT',0 ; 3
|
||||
edit_cld db 'SUPPORT',0 ; 4
|
||||
|
||||
;; list win -----------------------------------------------
|
||||
text_frame db 'Frame (Activate):',0
|
||||
text_inframe db 'Frame (Inactivate):',0
|
||||
text_fcframe db 'Frame (Focus):',0
|
||||
text_face db 'Face (Activate):',0
|
||||
text_inface db 'Face (Inactivate):',0
|
||||
text_fcface db 'Face (Focus):',0
|
||||
text_border db 'Border (Activate):',0
|
||||
text_inborder db 'Border (Inactivate):',0
|
||||
text_wtext db 'Text:',0
|
||||
text_graytext db 'Graytext:',0
|
||||
text_title db 'Title:',0
|
||||
text_body db 'Body:',0
|
||||
text_reserved db 'Reserved:',0
|
||||
text_text db 'Text (Activate):',0
|
||||
text_intext db 'Text (Inactivate):',0
|
||||
text_fctext db 'Text (Focus):',0
|
||||
text_3dlight db '3D Light:',0
|
||||
text_3ddark db '3D Dark:',0
|
||||
text_3dface db '3D Face:',0
|
||||
text_shadow db 'Shadow:',0
|
||||
text_select db 'Select:',0
|
||||
text_p_face db 'Panel Body:',0
|
||||
text_p_frame db 'Panel Frame:',0
|
||||
text_p_text db 'Panel Text:',0
|
||||
text_m_face db 'Menu Body:',0
|
||||
text_m_frame db 'Menu Frame:',0
|
||||
text_m_text db 'Menu Text:',0
|
||||
text_h_face db 'Hint Body:',0
|
||||
text_h_frame db 'Hint Frame:',0
|
||||
text_h_text db 'Hint Text:',0
|
||||
text_hex db '#',0
|
||||
;----------------------------------------------------------
|
||||
I_END:
|
34
programs/other/personal/readme.txt
Normal file
34
programs/other/personal/readme.txt
Normal file
@ -0,0 +1,34 @@
|
||||
;****************************************************************************************************|
|
||||
; Program Personal - <20>¥àá® «¨§ æ¨ï ¢¥è¥£® ¢¨¤ Ž‘ (c) Sergei Steshin (Akyltist) |
|
||||
;----------------------------------------------------------------------------------------------------|
|
||||
;; Charset:DOS-866 Font:Courier New Size:9pt |
|
||||
;.....................................................................................................
|
||||
;; compiler: FASM 1.69.31 |
|
||||
;; version: 0.1.0 |
|
||||
;; last update: 10/04/2014 |
|
||||
;; e-mail: dr.steshin@gmail.com |
|
||||
;.....................................................................................................
|
||||
;; History: |
|
||||
;.....................................................................................................
|
||||
;; All rights reserved. |
|
||||
;; |
|
||||
;; Redistribution and use in source and binary forms, with or without modification, are permitted |
|
||||
;; provided that the following conditions are met: |
|
||||
;; * Redistributions of source code must retain the above copyright notice, this list of |
|
||||
;; conditions and the following disclaimer. |
|
||||
;; * Redistributions in binary form must reproduce the above copyright notice, this list of |
|
||||
;; conditions and the following disclaimer in the documentation and/or other materials |
|
||||
;; provided with the distribution. |
|
||||
;; * Neither the name of the <organization> nor the names of its contributors may be used to |
|
||||
;; endorse or promote products derived from this software without specific prior written |
|
||||
;; permission. |
|
||||
;; |
|
||||
;; THIS SOFTWARE IS PROVIDED BY Sergei Steshin ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, |
|
||||
;; INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A |
|
||||
;; PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY DIRECT, |
|
||||
;; INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED |
|
||||
;; TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
|
||||
;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
|
||||
;; LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
|
||||
;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
|
||||
;....................................................................................................|
|
Loading…
Reference in New Issue
Block a user