Subversion Repositories Kolibri OS

Rev

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

Rev 1228 Rev 1266
Line 8... Line 8...
8
;
8
;
Line 9... Line 9...
9
 
9
 
10
  use32
10
  use32
11
  org    0x0
11
  org    0x0
12
STACK_SIZE=1024
12
	STACK_SIZE=1024
13
offset_y=22
13
	offset_y=22		; Correction for skin
14
offset_x=5
14
	offset_x=5
15
  db     'MENUET01'              ; 8 byte id
15
  db     'MENUET01'              ; 8 byte id
16
  dd     0x01                    ; header version
16
  dd     0x01                    ; header version
17
  dd     START                   ; start of code
17
  dd     START                   ; start of code
Line 32... Line 32...
32
err_message_found_lib, head_f_l, myimport, err_message_import, head_f_i
32
err_message_found_lib, head_f_l, myimport, err_message_import, head_f_i
33
        inc     eax
33
        inc     eax
34
        jz      close
34
        jz      close
35
; calculate window position
35
; calculate window position
36
; at the center of the screen
36
; at the center of the screen
-
 
37
    mcall 40,0x27	;set event
37
    call calculate_window_pos
38
    call calculate_window_pos
Line 38... Line 39...
38
    
39
    
39
;main loop when process name isn't edited.    
40
;main loop when process name isn't edited.    
40
red:    
41
red:    
41
        mcall   48,3,sc,40
42
        mcall   48,3,sc,40
-
 
43
        edit_boxes_set_sys_color edit1,edit1_end,sc	;set color
42
        edit_boxes_set_sys_color edit1,edit1_end,sc
44
        check_boxes_set_sys_color check1,check1_end,sc  ;set color
43
	xor	ebp,ebp
45
	xor	ebp,ebp
44
	inc	ebp
46
	inc	ebp
45
;    mov  ebp,1
47
;    mov  ebp,1
46
    call draw_window            ; redraw all window
-
 
47
align 16
48
    call draw_window            ; redraw all window
48
still:
49
still:
49
    mov  eax,23                 ; wait here for event
50
    mov  eax,23                 ; wait here for event
50
    mov  ebx,100                ; 2 sec.
51
    mov  ebx,100                ; 1 sec.
Line 51... Line 52...
51
    mcall
52
    mcall
52
 
53
 
53
    dec  eax                  ; redraw request ?
54
    dec  eax                  ; redraw request ?
54
    jz   red
55
    jz   red
55
    dec  eax                  ; key in buffer ?
56
    dec  eax                  ; key in buffer ?
56
    jz   key
57
    jz   key
Line -... Line 58...
-
 
58
    dec  eax                  ; button in buffer ?
-
 
59
    jz   button
57
    dec  eax                  ; button in buffer ?
60
 
58
    jz   button
61
    sub eax,3                 ; If not use mouse - show 
-
 
62
    jnz still_end
-
 
63
        push    dword edit1
59
 
64
        call    [edit_box_mouse]
Line 60... Line 65...
60
        push    dword edit1
65
	push	dword check1
61
        call    [edit_box_mouse]
66
	call	[check_box_mouse]
62
 
67
    jmp still	
63
 
68
 
Line 70... Line 75...
70
  key:                          ; key
75
  key:                          ; key
71
    mov  eax,2                  
76
    mov  eax,2                  
72
    mcall
77
    mcall
Line 73... Line 78...
73
 
78
 
74
    cmp  ah,184                 ; PageUp
79
    cmp  ah,184                 ; PageUp
75
    je   pgdn
80
    jz   pgdn
76
    cmp  ah,183
81
    cmp  ah,183
77
    je   pgup                   ; PageDown
82
    jz   pgup                   ; PageDown
78
    cmp  ah,27
83
    cmp  ah,27
Line 79... Line 84...
79
    je   close                  ; Esc
84
    jz   close                  ; Esc
80
 
85
 
-
 
86
        push    dword edit1
-
 
87
        call    [edit_box_key]
-
 
88
				; Check ENTER with ed_focus edit_box
-
 
89
    lea  edi,[edit1]
-
 
90
    test word ed_flags,ed_focus
-
 
91
    jz   still_end 
Line 81... Line 92...
81
        push    dword edit1
92
    sub  ah,13                  ; ENTER?
Line 82... Line 93...
82
        call    [edit_box_key]
93
    jz   program_start          ; RUN a program
83
 
94
 
84
    jmp  still_end
95
    jmp  still
85
 
96
 
Line 210... Line 221...
210
;if there is no process for this button    
221
;if there is no process for this button    
211
    test  edi,edi
222
    test  edi,edi
212
    jl    .ret
223
    jl    .ret
Line 213... Line 224...
213
    
224
    
-
 
225
;find process
214
;find process
226
.return_1:
215
    inc   edi
227
    inc   edi
216
;more comfortable register for next loop    
228
;more comfortable register for next loop    
217
    mov   ecx,edi
229
    mov   ecx,edi
218
;precacluate pointer to process buffer    
230
;precacluate pointer to process buffer    
Line 244... Line 256...
244
.no_processes:
256
.no_processes:
245
    or   edi,-1
257
    or   edi,-1
246
    ret
258
    ret
Line 247... Line 259...
247
    
259
    
-
 
260
.process_found:
-
 
261
;check on/off check box
-
 
262
    push edi
-
 
263
    lea  edi,[check1]
-
 
264
    test dword ch_flags,ch_flag_en
-
 
265
    pop  edi
-
 
266
    jnz   @f
-
 
267
    cmp   dword [process_info_buffer+10],'ICON'
-
 
268
    jz    .return_1 
-
 
269
    cmp   dword [process_info_buffer+10],'OS/I'
-
 
270
    jz    .return_1
-
 
271
    cmp   byte [process_info_buffer+10],'@'
-
 
272
    jz    .return_1
-
 
273
 
248
.process_found:
274
 
249
    mov  edi,ecx
275
@@: mov  edi,ecx
Line 250... Line 276...
250
    mov  [list_add],ecx
276
    mov  [list_add],ecx
251
    
277
    
252
;get processor cpeed    
278
;get processor cpeed    
Line 273... Line 299...
273
;([tcolor] variable)
299
;([tcolor] variable)
274
;0%      : black    
300
;0%      : black    
275
;1-80%   : green
301
;1-80%   : green
276
;81-100% : red
302
;81-100% : red
277
    test eax,eax
303
    test eax,eax
278
    jg   .no_black
304
    jnz  .no_black
279
    mov  [tcolor],eax
305
    mov  [tcolor],eax
280
    jmp  .color_set
306
    jmp  .color_set
Line 281... Line 307...
281
 
307
 
282
.no_black:   
308
.no_black:   
Line 533... Line 559...
533
    mov  esi,text_len
559
    mov  esi,text_len
534
    mcall
560
    mcall
Line 535... Line 561...
535
 
561
 
536
        push    dword edit1
562
        push    dword edit1
-
 
563
        call    [edit_box_draw]
-
 
564
        push    dword check1
Line 537... Line 565...
537
        call    [edit_box_draw]
565
	call	[check_box_draw]
538
 
566
 
539
align 16
567
align 16
540
.show_process_info:
568
.show_process_info:
Line 634... Line 662...
634
edit_box_draw   dd      aEdit_box_draw
662
edit_box_draw   dd      aEdit_box_draw
635
edit_box_key    dd      aEdit_box_key
663
edit_box_key    dd      aEdit_box_key
636
edit_box_mouse  dd      aEdit_box_mouse
664
edit_box_mouse  dd      aEdit_box_mouse
637
;version_ed      dd      aVersion_ed
665
;version_ed      dd      aVersion_ed
Line 638... Line 666...
638
 
666
 
639
;check_box_draw  dd      aCheck_box_draw
667
check_box_draw  dd      aCheck_box_draw
640
;check_box_mouse dd      aCheck_box_mouse
668
check_box_mouse dd      aCheck_box_mouse
Line 641... Line 669...
641
;version_ch      dd      aVersion_ch
669
;version_ch      dd      aVersion_ch
642
 
670
 
643
;option_box_draw  dd      aOption_box_draw
671
;option_box_draw  dd      aOption_box_draw
Line 650... Line 678...
650
aEdit_box_draw  db 'edit_box',0
678
aEdit_box_draw  db 'edit_box',0
651
aEdit_box_key   db 'edit_box_key',0
679
aEdit_box_key   db 'edit_box_key',0
652
aEdit_box_mouse db 'edit_box_mouse',0
680
aEdit_box_mouse db 'edit_box_mouse',0
653
;aVersion_ed     db 'version_ed',0
681
;aVersion_ed     db 'version_ed',0
Line 654... Line 682...
654
 
682
 
655
;aCheck_box_draw  db 'check_box_draw',0
683
aCheck_box_draw  db 'check_box_draw',0
656
;aCheck_box_mouse db 'check_box_mouse',0
684
aCheck_box_mouse db 'check_box_mouse',0
Line 657... Line 685...
657
;aVersion_ch      db 'version_ch',0
685
;aVersion_ch      db 'version_ch',0
658
 
686
 
659
;aOption_box_draw  db 'option_box_draw',0
687
;aOption_box_draw  db 'option_box_draw',0
-
 
688
;aOption_box_mouse db 'option_box_mouse',0
660
;aOption_box_mouse db 'option_box_mouse',0
689
;aVersion_op       db 'version_op',0
661
;aVersion_op       db 'version_op',0
690
check1 check_box 10,(400-offset_y),6,11,0x80AABBCC,0,0,check_text,check_t_e,ch_flag_en
662
 
691
check1_end:
663
edit1 edit_box 350,(64-offset_x),(398-offset_y),0xffffff,0x6f9480,0,0xAABBCC,0,start_application_c,start_application,mouse_dd,ed_focus,start_application_e,start_application_e
692
edit1 edit_box 350,(100-offset_x),(398-offset_y),0xffffff,0x6f9480,0,0xAABBCC,0,start_application_c,start_application,mouse_dd,ed_focus,start_application_e,start_application_e
Line 664... Line 693...
664
edit1_end:
693
edit1_end:
665
list_start  dd 0
694
list_start  dd 0
Line 681... Line 710...
681
tbts:   db  'SEITE ZURUECK       SEITE VOR                      REBOOT SYSTEM'
710
tbts:   db  'SEITE ZURUECK       SEITE VOR                      REBOOT SYSTEM'
682
tbte:
711
tbte:
683
;tbts_2  db  '>'
712
;tbts_2  db  '>'
684
tbts_3  db  'START'
713
tbts_3  db  'START'
685
tbte_2:
714
tbte_2:
686
 
-
 
-
 
715
check_text db '@ gehoren/aus'
-
 
716
check_t_e=$-check_text
687
title  db   'Prozesse  - Ctrl/Alt/Del',0
717
title  db   'Prozesse  - Ctrl/Alt/Del',0
Line 688... Line 718...
688
 
718
 
689
else if lang eq et
719
else if lang eq et
690
text:
720
text:
Line 695... Line 725...
695
tbts:	db  'EELMINE LEHT   JÄRGMINE LEHT                     REBOODI SÜSTEEM'
725
tbts:	db  'EELMINE LEHT   JÄRGMINE LEHT                     REBOODI SÜSTEEM'
696
tbte:
726
tbte:
697
;tbts_2	db  '>'
727
;tbts_2	db  '>'
698
tbts_3	db  'START'
728
tbts_3	db  'START'
699
tbte_2:
729
tbte_2:
700
 
-
 
-
 
730
check_text db '@ on/off'
-
 
731
check_t_e=$-check_text
701
title  db   'Protsessid - Ctrl/Alt/Del',0
732
title  db   'Protsessid - Ctrl/Alt/Del'
Line 702... Line 733...
702
 
733
 
703
else
734
else
704
text:
735
text:
705
  db 'NAME/TERMINATE      PID     CPU-USAGE  %   '
736
  db 'NAME/TERMINATE      PID     CPU-USAGE  %   '
Line 709... Line 740...
709
tbts:   db  'PREV PAGE       NEXT PAGE                         REBOOT SYSTEM'
740
tbts:   db  'PREV PAGE       NEXT PAGE                         REBOOT SYSTEM'
710
tbte:
741
tbte:
711
;tbts_2  db  '>'
742
;tbts_2  db  '>'
712
tbts_3  db  'RUN'
743
tbts_3  db  'RUN'
713
tbte_2:
744
tbte_2:
714
 
-
 
-
 
745
check_text db '@ on/off'
-
 
746
check_t_e=$-check_text
715
title  db   'Processes - Ctrl/Alt/Del',0
747
title  db   'Processes - Ctrl/Alt/Del',0
Line 716... Line 748...
716
 
748
 
717
end if
749
end if
718
file_start: dd 7
750
file_start: dd 7