Subversion Repositories Kolibri OS

Rev

Rev 6631 | Rev 6653 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
6631 leency 1
#define MEMSIZE 4096*10
2
#include "../lib/gui.h"
3
proc_info Form;
4
 
5
#define WINDOW_TITLE "Driver Installer"
6
#define T_CAUTION_TITLE "CAUTION"
7
#define T_CAUTION_PARAGRAPH "Installing additional drivers can be harmful to the stability of the operation system and potentionally can harm hardware."
8
#define T_ASSEPT_RISK "I assept the risk"
6651 leency 9
#define T_README "Readme"
10
#define T_INSTALL "Install"
6631 leency 11
 
12
#define BUTTON_ID_ASSEPT_RISK 10
6651 leency 13
#define BUTTON_ID_README 11
14
#define BUTTON_ID_INSTALL 12
6631 leency 15
 
6651 leency 16
//WINDOW STEPS
17
#define WINDOW_STEP_INTRO 1;
18
#define WINDOW_STEP_DRIVER_LIST 2;
19
char window_step = WINDOW_STEP_INTRO;
6631 leency 20
 
21
void main()
22
{
23
	word id;
24
	loop() switch(WaitEvent())
25
	{
26
		case evButton:
27
			id=GetButtonID();
28
			if (id==1) ExitProcess();
6651 leency 29
			if (id==BUTTON_ID_ASSEPT_RISK) {
30
				window_step = WINDOW_STEP_DRIVER_LIST;
31
				goto _EV_WINDOW_REDRAW;
32
			}
6631 leency 33
			break;
34
 
35
		case evKey:
36
			GetKeys();
37
			break;
38
 
39
		case evReDraw:
6651 leency 40
		_EV_WINDOW_REDRAW:
41
			system.color.get();
42
			DefineAndDrawWindow(215, 100, 550, 350, 0x33, system.color.work, WINDOW_TITLE);
43
			GetProcessInfo(#Form, SelfInfo);
44
			if (window_step == WINDOW_STEP_INTRO) draw_intro_window();
45
			if (window_step == WINDOW_STEP_DRIVER_LIST) draw_driver_list_window();
6631 leency 46
			break;
47
	}
48
}
49
 
50
 
6651 leency 51
void draw_intro_window()
6631 leency 52
{
53
	incn y;
6651 leency 54
	y.n = Form.cheight/2 - 80;
6631 leency 55
	WriteTextB(30+2,y.n+2,0x81,MixColors(system.color.work, 0xB92234,220),T_CAUTION_TITLE);
56
	WriteTextB(30,y.n,0x81,0xB92234,T_CAUTION_TITLE);
6651 leency 57
	y.n = DrawTextViewArea(30, y.inc(30), Form.cwidth-60, Form.cheight-140,
6631 leency 58
		T_CAUTION_PARAGRAPH, -1, system.color.work_text);
59
	DrawStandartCaptButton(30, y.inc(10), BUTTON_ID_ASSEPT_RISK, T_ASSEPT_RISK);
60
}
61
 
62
 
6651 leency 63
void draw_driver_list_window()
64
{
65
	int PADDING = 12;
66
	int right_frame_x = Form.cwidth/2 + PADDING + calc(PADDING/2);
67
	incn y;
68
	y.n = PADDING + 3;
69
	//LEFT FRAME
70
	DrawBar(PADDING, PADDING, Form.cwidth/2 - PADDING, Form.cheight - PADDING - PADDING, 0xEEEeee);
71
	//RIGHT FRAME
72
	WriteTextB(right_frame_x, y.n, 0x81, system.color.work_text, "ATI KMS");
73
	WriteText(right_frame_x, y.inc(20), 0x80, MixColors(system.color.work, 0xCCCccc,80), "ver 4.4");
74
	DrawTextViewArea(right_frame_x-2, y.inc(30), Form.cwidth - right_frame_x - PADDING, Form.cheight-100,
75
		T_CAUTION_PARAGRAPH, -1, system.color.work_text);
76
	right_frame_x += DrawStandartCaptButton(right_frame_x, Form.cheight-40, BUTTON_ID_README, T_README);
77
	DrawStandartCaptButton(right_frame_x, Form.cheight-40, BUTTON_ID_INSTALL, T_INSTALL);
78
}