buttons fix

git-svn-id: svn://kolibrios.org@6444 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
pathoswithin 2016-06-11 18:03:44 +00:00
parent 3e571bd7cc
commit 5c5d793eda

View File

@ -1,33 +1,7 @@
; ;-----------------------;
; CPU -process Manager ; CPU - process manager ;
; ;-----------------------;
;------------------------------------------------------------------------------
; version: 1.80
; last update: 07/04/2012
; changed by: Marat Zakiyanov aka Mario79, aka Mario
; changes: Complete elimination of flicker.
; Using f.0 C = 1 - don't fill working area on window draw.
; Increasing the size of buttons and a bright color.
; Processing "window is rolled up" and "window is minimized"
;------------------------------------------------------------------------------
; version: 1.70
; last update: 04/04/2012
; changed by: Marat Zakiyanov aka Mario79, aka Mario
; changes: Code refactoring and optimization.
; Added russian language support.
; Fix - processes information showing not been updated during
; the processing of mouse events.
;------------------------------------------------------------------------------
; Many fix's and changes created by:
; Diamond, Heavyiron, SPraid, <Lrz>,
; Leency, IgorA, kaitz
;---------------------------------------------------------------------
; integrated with load_lib.obj by <Lrz>
;---------------------------------------------------------------------
; additions by M.Lisovin lisovin@26.ru
;---------------------------------------------------------------------
; original author - VTurjanmaa
;------------------------------------------------------------------------------
format binary as "" format binary as ""
use32 use32
@ -95,7 +69,7 @@ red:
align 4 align 4
still: still:
mcall 23,100 ; wait here for event 1 sec. mcall 23,100 ; wait here for event 1 sec.
test eax,eax test eax,eax
jz still_end jz still_end
@ -198,24 +172,24 @@ button:
; int2str: ; int2str:
push 0 push 0
mov ecx, 10 mov ecx, 10
.push: .push:
xor edx, edx xor edx, edx
div ecx div ecx
add edx, 48 add edx, 48
push edx push edx
test eax, eax test eax, eax
jnz .push jnz .push
.pop: .pop:
pop eax pop eax
stosb stosb
test eax, eax test eax, eax
jnz .pop jnz .pop
; launch tinfo app ; launch tinfo app
mov ebx, tinfo mov ebx, tinfo
mov eax, 70 mov eax, 70
int 64 int 64
jmp show_process_info_1 jmp show_process_info_1
.terminate: .terminate:
;terminate application ;terminate application
mcall 18,2 mcall 18,2
jmp show_process_info_1 jmp show_process_info_1
@ -276,14 +250,7 @@ draw_empty_slot:
mov ecx,[curposy] mov ecx,[curposy]
shl ecx,16 shl ecx,16
mov cx,10 ; button height mov cx,10 ; button height
push ecx
add ecx,3 shl 16
mcall 13,<11,95>,,[btn_bacground_color]
pop ecx
mcall 13,<111,393>,,[bar_bacground_color] mcall 13,<111,393>,,[bar_bacground_color]
;--------------------------------------
align 4
@@: @@:
ret ret
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
@ -295,56 +262,32 @@ draw_next_process:
;output: ;output:
; edi - next slot (or -1 if no next slot) ; edi - next slot (or -1 if no next slot)
;registers corrupted! ;registers corrupted!
;delete old button
cmp [draw_window_flag],0
je @f
mov edx,[index]
add edx,(1 shl 31)+11
mcall 8
;--------------------------------------
align 4
@@:
;create terminate process button ;create terminate process button
mov ecx,[curposy] mov ecx,[curposy]
shl ecx,16 shl ecx,16
mov cx,13 ; button height mov cx,13 ; button height
mov edx,[index] mov edx,[index]
add edx,11 add edx,11
mov esi,0xccddee ; 0xaabbcc mov esi,0xccddee
;contrast
test dword [index],1 test dword [index],1
jz .change_color_button jz @f
mov esi,0xaabbcc ; 0x8899aa mov esi,0xaabbcc
;--------------------------------------
align 4
.change_color_button:
cmp [draw_window_flag],0
je @f
mcall 8,<10,99>
;--------------------------------------
align 4
@@: @@:
mcall 8,<10,99>
mov [btn_bacground_color],esi mov [btn_bacground_color],esi
;draw background for proccess information ;draw background for proccess information
; ecx was already set mov edx,0xddffdd
mov edx,0xddffdd ; 0x88ff88
;contrast
test dword [index],1 test dword [index],1
jz .change_color_info jz @f
mov edx,0xffffff ; 0xddffdd mov edx,0xffffff
;-------------------------------------- @@:
align 4
.change_color_info:
inc cx inc cx
cmp [draw_window_flag],0 cmp [draw_window_flag],0
je @f je @f
mcall 13,<110,395> mcall 13,<110,395>
;--------------------------------------
align 4
@@: @@:
mov [bar_bacground_color],edx mov [bar_bacground_color],edx
;nothing else should be done ;nothing else should be done if there is no process for this button
;if there is no process for this button
cmp edi,-1 cmp edi,-1
jne .return_1 jne .return_1
@ -430,14 +373,13 @@ align 4
div ebx div ebx
mov [cpu_percent],eax mov [cpu_percent],eax
;set text color to display process information ;set text color to display process information
;([tcolor] variable)
;0% : black ;0% : black
;1-80% : green ;1-80% : green
;81-100% : red ;81-100% : red
test eax,eax test eax,eax
jnz .no_black jnz .no_black
mov [tcolor],eax mov esi,eax
jmp .color_set jmp .color_set
;-------------------------------------- ;--------------------------------------
align 4 align 4
@ -445,12 +387,12 @@ align 4
cmp eax,80 cmp eax,80
ja .no_green ja .no_green
mov dword [tcolor],0x107a30 mov esi,0x107a30
jmp .color_set jmp .color_set
;-------------------------------------- ;--------------------------------------
align 4 align 4
.no_green: .no_green:
mov dword [tcolor],0xac0000 mov esi,0xac0000
;-------------------------------------- ;--------------------------------------
align 4 align 4
.color_set: .color_set:
@ -459,22 +401,16 @@ align 4
push edi push edi
mov edx,[curposy] mov edx,[curposy]
add edx,15*65536+3 add edx,15*65536+3
mov esi,[tcolor] mcall 47,<2,256>
and esi,0xffffff
or esi,0x40000000
mcall 47,<2,256>,,,,[btn_bacground_color]
;show process name ;show process name
mov ebx,[curposy] mov ebx,[curposy]
add ebx,40*65536+3 add ebx,40*65536+3
mov ecx,[tcolor] mov ecx,esi
and ecx,0xffffff mcall 4,,,process_info_buffer.process_name,11
or ecx,0x40000000
mcall 4,,,process_info_buffer.process_name,11,[btn_bacground_color]
;show pid ;show pid
mov edx,[curposy] mov edx,[curposy]
add edx,125*65536+3 add edx,125*65536+3
mov esi,[tcolor] mov esi,ecx
and esi,0xffffff
or esi,0x40000000 or esi,0x40000000
mcall 47,<8,256>,[process_info_buffer.PID],,,[bar_bacground_color] mcall 47,<8,256>,[process_info_buffer.PID],,,[bar_bacground_color]
;show cpu usage ;show cpu usage
@ -800,7 +736,6 @@ winxpos rd 1
winypos rd 1 winypos rd 1
mouse_dd rd 1 mouse_dd rd 1
cpu_percent rd 1 cpu_percent rd 1
tcolor rd 1
list_add rd 1 list_add rd 1
curposy rd 1 curposy rd 1
index rd 1 index rd 1
@ -821,10 +756,6 @@ process_info_buffer process_information
align 4 align 4
cur_dir_path: cur_dir_path:
rb 1024 rb 1024
;------------------------------------------------------------------------------
align 4
rb 1024 rb 1024
stack_area: stack_area:
;------------------------------------------------------------------------------
U_END: U_END:
;------------------------------------------------------------------------------