Subversion Repositories Kolibri OS

Rev

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

Rev 7227 Rev 7244
Line 34... Line 34...
34
	BTN_ID_KILL_PROCESS,
34
	BTN_ID_KILL_PROCESS,
35
	BTN_ID_SHOW_PROCESS_INFO
35
	BTN_ID_SHOW_PROCESS_INFO
36
};
36
};
Line 37... Line 37...
37
 
37
 
38
int current_process_id = 0;
-
 
39
int show_system;
38
int current_process_id = 0;
40
unsigned maxcpu;
39
unsigned maxcpu;
Line -... Line 40...
-
 
40
int proc_list[256];
-
 
41
 
41
int proc_list[256];
42
checkbox show_system = { T_SHOW_SYSTEM_PROCESSES, false };
42
 
43
 
43
//===================================================//
44
//===================================================//
44
//                                                   //
45
//                                                   //
45
//                       CODE                        //
46
//                       CODE                        //
Line 53... Line 54...
53
	maxcpu = EAX;
54
	maxcpu = EAX;
54
}
55
}
Line 55... Line 56...
55
 
56
 
56
void main()
57
void main()
57
{
58
{
58
	byte btn;
59
	int btn;
59
	load_dll(boxlib, #box_lib_init,0);
60
	load_dll(boxlib, #box_lib_init,0);
60
	SetEventMask(EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE + EVM_MOUSE_FILTER);
61
	SetEventMask(EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE + EVM_MOUSE_FILTER);
61
	GetCpuFrequency();
62
	GetCpuFrequency();
62
	loop()
63
	loop()
Line 76... Line 77...
76
			btn = GetButtonID();
77
			btn = GetButtonID();
77
			if (1 == btn) 
78
			if (1 == btn) 
78
			{
79
			{
79
				ExitProcess();
80
				ExitProcess();
80
			}
81
			}
81
			if (BTN_ID_SHOW_SYSTEM_PROCESSES == btn)  
82
			if (show_system.click(btn))  
82
			{ 
83
			{
83
				show_system ^= 1; 
-
 
84
				Draw_ShowSystemProcessesCheckbox();
-
 
85
				SelectList_LineChanged();
84
				SelectList_LineChanged();
86
			}
85
			}
87
			if (BTN_ID_KILL_PROCESS == btn)  
86
			if (BTN_ID_KILL_PROCESS == btn)  
88
			{
87
			{
89
				KillProcess(current_process_id);
88
				KillProcess(current_process_id);
Line 112... Line 111...
112
				110,25,BTN_ID_KILL_PROCESS,0xF38181, 0xFFFfff, T_END_PROCESS);
111
				110,25,BTN_ID_KILL_PROCESS,0xF38181, 0xFFFfff, T_END_PROCESS);
113
			DrawCaptButton(Form.cwidth-236,
112
			DrawCaptButton(Form.cwidth-236,
114
				select_list.y+select_list.h+5,
113
				select_list.y+select_list.h+5,
115
				110,25,BTN_ID_SHOW_PROCESS_INFO,
114
				110,25,BTN_ID_SHOW_PROCESS_INFO,
116
				system.color.work_button, system.color.work_button_text, T_DETAILS);
115
				system.color.work_button, system.color.work_button_text, T_DETAILS);
117
			Draw_ShowSystemProcessesCheckbox();
116
			show_system.draw(select_list.x + 3, select_list.y+select_list.h+10);
118
		default:
117
		default:
119
			SelectList_LineChanged();
118
			SelectList_LineChanged();
120
	  }
119
	  }
121
	}
120
	}
122
}
121
}
Line 136... Line 135...
136
	{
135
	{
137
		GetProcessInfo(#Process, i);
136
		GetProcessInfo(#Process, i);
138
		if (Process.name) 
137
		if (Process.name) 
139
		{
138
		{
140
			for (j=0; j<11; j++) if (Process.name[j]!=' ') { 
139
			for (j=0; j<11; j++) if (Process.name[j]!=' ') { 
141
				if (show_system==false) {
140
				if (show_system.checked==false) {
142
					//do not show system process
141
					//do not show system process
143
					if (Process.name[0]=='@') break;
142
					if (Process.name[0]=='@') break;
144
					if (!strcmp(#Process.name, "IDLE")) break;
143
					if (!strcmp(#Process.name, "IDLE")) break;
145
					if (!strcmp(#Process.name, "OS")) break;
144
					if (!strcmp(#Process.name, "OS")) break;
146
				}
145
				}
Line 172... Line 171...
172
	if (maxcpu) WriteText(select_list.w/10*8+select_list.x - calc(strlen(#cpu_use)-4*8), 
171
	if (maxcpu) WriteText(select_list.w/10*8+select_list.x - calc(strlen(#cpu_use)-4*8), 
173
		posy+select_list.text_y, select_list.font_type, 0x444444, #cpu_use);
172
		posy+select_list.text_y, select_list.font_type, 0x444444, #cpu_use);
174
}
173
}
Line 175... Line -...
175
 
-
 
176
 
-
 
177
void Draw_ShowSystemProcessesCheckbox() {
-
 
178
	CheckBox(select_list.x + 3, select_list.y+select_list.h+10, 20,
-
 
179
		T_SHOW_SYSTEM_PROCESSES, show_system);
-
 
Line 180... Line 174...
180
}
174
 
181
 
175