Subversion Repositories Kolibri OS

Rev

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

Rev 7806 Rev 7906
Line 1... Line 1...
1
/*
1
/*
2
 * System Monitor
2
 * System Monitor
3
 * version 0.87
3
 * version 1.0
4
 * Author: Leency
4
 * Author: Leency
5
*/
5
*/
Line 6... Line 6...
6
 
6
 
Line 31... Line 31...
31
//                                                   //
31
//                                                   //
32
//===================================================//
32
//===================================================//
Line 33... Line 33...
33
 
33
 
34
#define WIN_PAD 20   //Window padding
34
#define WIN_PAD 20   //Window padding
35
#define WIN_CONTENT_X WIN_PAD
35
#define WIN_CONTENT_X WIN_PAD
36
#define WIN_CONTENT_Y TAB_HEIGHT+WIN_PAD
36
#define WIN_CONTENT_Y TAB_HEIGHT+WIN_PAD+20
37
#define WIN_CONTENT_W 400
37
#define WIN_CONTENT_W 400
-
 
38
#define WIN_CONTENT_H 465
38
#define WIN_CONTENT_H 465
39
#define ICONGAP 26
Line 39... Line 40...
39
proc_info Form;
40
proc_info Form;
-
 
41
 
40
 
42
#ifdef LANG_RUS
-
 
43
#define T_CPU_AND_RAM   "à®æ¥áá®à ¨ Ž‡“"
-
 
44
#define T_DRIVES     "„¨áª¨"
41
#include "general.h"
45
#define T_PROCESSES "à®æ¥ááë"
-
 
46
#define T_APP_TITLE "System Monitor"
42
#include "process.h"
47
#else
43
 
48
#define T_CPU_AND_RAM   "CPU & RAM"
-
 
49
#define T_DRIVES     "Drives"
-
 
50
#define T_PROCESSES "Processes"
Line 44... Line 51...
44
#define T_GENERAL "General"
51
#define T_APP_TITLE "System Monitor"
45
#define T_PROCESSES "Processes"
52
#endif
-
 
53
 
46
 
54
enum {
47
enum {
55
	TAB_GENERAL=20,
48
	TAB_GENERAL=20,
-
 
Line 49... Line -...
49
	TAB_PROCESSES
-
 
-
 
56
	TAB_DRIVES,
50
};
57
	TAB_PROCESSES
51
_tabs tabs = { TAB_GENERAL, 4, 0, WIN_CONTENT_W+WIN_PAD+WIN_PAD-4-4, TAB_HEIGHT };
58
};
52
 
59
 
53
void main()
60
_tabs tabs = { TAB_GENERAL, 4, 10, WIN_CONTENT_W+WIN_PAD+WIN_PAD-4-4, TAB_HEIGHT };
54
{
61
 
55
	load_dll(libio, #libio_init,1);
62
//===================================================//
56
	load_dll(libimg, #libimg_init,1);
-
 
Line 57... Line 63...
57
	load_dll(libini, #lib_init,1);
63
//                                                   //
58
	load_dll(boxlib, #box_lib_init,0);
64
//                 GENERAL  EVENTS                   //
-
 
65
//                                                   //
59
	General__Main();
66
//===================================================//
60
}
67
 
61
 
68
int Sysmon__DefineAndDrawWindow()
62
int Sysmon__DefineAndDrawWindow()
69
{
63
{
70
	dword butx;
64
	sc.get();
71
	sc.get();
65
	DefineAndDrawWindow(screen.width - WIN_CONTENT_H - 200, 100, WIN_CONTENT_W + WIN_PAD + WIN_PAD +9, 
72
	DefineAndDrawWindow(screen.width - WIN_CONTENT_H - 200, 100, WIN_CONTENT_W + WIN_PAD + WIN_PAD +9, 
66
		WIN_CONTENT_H + TAB_HEIGHT + skin_height + 4, 0x34, sc.work, "System Monitor",0);
73
		WIN_CONTENT_H + TAB_HEIGHT + skin_height + 4, 0x34, sc.work, T_APP_TITLE,0);
67
	GetProcessInfo(#Form, SelfInfo);
74
	GetProcessInfo(#Form, SelfInfo);
-
 
75
	if (Form.status_window>2) return false;
68
	if (Form.status_window>2) return false;
76
	//if (Form.width  < 300) { MoveSize(OLD,OLD,300,OLD); break; }
69
	//if (Form.width  < 300) { MoveSize(OLD,OLD,300,OLD); break; }
77
	//if (Form.height < 200) { MoveSize(OLD,OLD,OLD,200); break; }
70
	//if (Form.height < 200) { MoveSize(OLD,OLD,OLD,200); break; }
78
	tabs.draw_wrapper();
Line 71... Line -...
71
	tabs.draw_wrapper();
-
 
72
	tabs.draw_button(tabs.x+TAB_PADDING, TAB_GENERAL, T_GENERAL);	
-
 
73
	tabs.draw_button(strlen(T_GENERAL)*8+tabs.x+TAB_PADDING+TAB_PADDING, TAB_PROCESSES, T_PROCESSES);
-
 
74
	return true;
-
 
75
}
-
 
76
 
-
 
77
//===================================================//
79
	butx = tabs.draw_button(tabs.x+TAB_PADDING, TAB_GENERAL, T_CPU_AND_RAM);	
78
//                                                   //
80
	butx = tabs.draw_button(strlen(T_CPU_AND_RAM)*8+TAB_PADDING+butx, TAB_DRIVES, T_DRIVES);	
-
 
81
	       tabs.draw_button(strlen(T_DRIVES)*8+TAB_PADDING+butx, TAB_PROCESSES, T_PROCESSES);
79
//                      EVENTS                       //
82
	return true;
80
//                                                   //
83
}
81
//===================================================//
84
 
82
 
85
int Sysmon__ButtonEvent()
83
void Sysmon__ButtonEvent(dword id)
86
{
84
{
87
	int bid = GetButtonID();
85
	if (1==id) ExitProcess();
88
	if (1==bid) ExitProcess();
86
	if (TAB_GENERAL==id) {
89
	if (TAB_GENERAL==bid) {
87
		tabs.active_tab = TAB_GENERAL;
90
		tabs.active_tab = TAB_GENERAL;
-
 
91
		CPUnRAM__Main();
-
 
92
	}
-
 
93
	if (TAB_PROCESSES==bid) {
-
 
94
		tabs.active_tab = TAB_PROCESSES;
-
 
95
		Processes__Main();
88
		General__Main();
96
	}
Line -... Line 97...
-
 
97
	if (TAB_DRIVES==bid) {
-
 
98
		tabs.active_tab = TAB_DRIVES;
-
 
99
		Drives__Main();
-
 
100
	}
-
 
101
	return bid;
-
 
102
}
-
 
103
 
-
 
104
void Sysmon__KeyEvent()
-
 
105
{
Line 89... Line -...
89
	}
-
 
90
	if (TAB_PROCESSES==id) {
106
	GetKeys();
-
 
107
	if (key_scancode == SCAN_CODE_ESC) ExitProcess();
-
 
108
}
-
 
109
 
-
 
110
#include "cpu_ram.h"
-
 
111
#include "drives.h"
-
 
112
#include "process.h"
-
 
113
 
-
 
114
void main()
91
		tabs.active_tab = TAB_PROCESSES;
115
{