/programs/other/personal/inc/button.inc |
---|
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 |
/programs/other/personal/inc/dtp.inc |
---|
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 |
/programs/other/personal/inc/edit.inc |
---|
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 |
/programs/other/personal/inc/list.inc |
---|
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 |
/programs/other/personal/inc/mouse.inc |
---|
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 |
/programs/other/personal/inc/process.inc |
---|
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 |
/programs/other/personal/inc |
---|
Property changes: |
Added: tsvn:logminsize |
+5 |
\ No newline at end of property |
/programs/other/personal/personal.asm |
---|
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: |
/programs/other/personal/readme.txt |
---|
0,0 → 1,34 |
;****************************************************************************************************| |
; Program Personal - ¥àá® «¨§ æ¨ï ¢¥è¥£® ¢¨¤ (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. | |
;....................................................................................................| |
/programs/other/personal |
---|
Property changes: |
Added: tsvn:logminsize |
+5 |
\ No newline at end of property |