Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 5404 → Rev 5403

/programs/cmm/software_widget/software_widget.c
1,5 → 1,5
/*
SOFTWARE CENTER v2.1
SOFTWARE CENTER v2.0
*/
 
#define MEMSIZE 0x3E80
18,9 → 18,9
proc_info Form;
mouse m;
 
int item_id_need_to_run=-1, current_item_id;
int item_id_need_to_run, current_item_id;
 
int col_max, cell_w, cell_h, list_pos, list_top;
int col_max, col_w=66, col_h=64, list_pos, list_top;
int row, col;
 
char window_title[128];
59,10 → 59,6
window_width = EAX;
ini_get_int stdcall (#settings_ini_path, "Config", "window_height", 540);
window_height = EAX;
ini_get_int stdcall (#settings_ini_path, "Config", "cell_w", 66);
cell_w = EAX;
ini_get_int stdcall (#settings_ini_path, "Config", "cell_h", 64);
cell_h = EAX;
}
 
 
91,7 → 87,7
item_id_need_to_run = id - 100;
current_item_id = 0;
ini_enum_sections stdcall (#settings_ini_path, #draw_section);
item_id_need_to_run = -1;
item_id_need_to_run = 0;
}
break;
 
100,11 → 96,11
DefineAndDrawWindow(GetScreenWidth()-window_width/2,GetScreenHeight()-window_height/2,window_width,window_height,0x74,sc.work," ");
GetProcessInfo(#Form, SelfInfo);
if (Form.status_window>2) break;
col_max = Form.cwidth - 10 / cell_w;
col_max = Form.cwidth - 10 / col_w;
current_item_id = 0;
draw_top_bar();
ini_enum_sections stdcall (#settings_ini_path, #draw_section);
DrawBar(0, row + 1 * cell_h + list_pos, Form.cwidth, -row - 1 * cell_h - list_pos + Form.cheight, LIST_BACKGROUND_COLOR);
DrawBar(0, row + 1 * col_h + list_pos, Form.cwidth, -row - 1 * col_h - list_pos + Form.cheight, LIST_BACKGROUND_COLOR);
break;
}
}
112,11 → 108,9
 
byte search_for_id_need_to_run(dword key_value, key_name, sec_name, f_name)
{
int icon_char_pos;
if (item_id_need_to_run == current_item_id)
{
icon_char_pos = strchr(key_value, ',');
if (icon_char_pos) ESBYTE[key_value + icon_char_pos - 1] = 0; //delete icon from string
ESBYTE[key_value + strchr(key_value, ',') - 1] = 0; //delete icon from string
RunProgram(key_value, "");
}
current_item_id++;
133,13 → 127,13
row++;
col=0;
}
if (col==0) DrawBar(0, row * cell_h + list_pos, Form.cwidth, cell_h, LIST_BACKGROUND_COLOR);
DefineButton(col*cell_w+6,row*cell_h + list_pos,cell_w,cell_h-5,current_item_id + 100 + BT_HIDE,0);
tmp = cell_w/2;
if (col==0) DrawBar(0, row * col_h + list_pos, Form.cwidth, col_h, LIST_BACKGROUND_COLOR);
DefineButton(col*col_w+6,row*col_h + list_pos,col_w,col_h-5,current_item_id + 100 + BT_HIDE,0);
tmp = col_w/2;
icon_id = atoi(key_value + strchr(key_value, ','));
img_draw stdcall(skin.image, col*cell_w+tmp-10, row*cell_h+5 + list_pos, 32, 32, 0, icon_id*32);
WriteTextCenter(col*cell_w+7,row*cell_h+47 + list_pos,cell_w,0xD4D4d4,key_name);
WriteTextCenter(col*cell_w+6,row*cell_h+46 + list_pos,cell_w,0x000000,key_name);
img_draw stdcall(skin.image, col*col_w+tmp-10, row*col_h+5 + list_pos, 32, 32, 0, icon_id*32);
WriteTextCenter(col*col_w+7,row*col_h+47 + list_pos,col_w,0xD4D4d4,key_name);
WriteTextCenter(col*col_w+6,row*col_h+46 + list_pos,col_w,0x000000,key_name);
current_item_id++;
col++;
return 1;
150,7 → 144,7
{
if (strcmp(sec_name, "Config")==0) return 1;
 
if (item_id_need_to_run!=-1)
if (item_id_need_to_run)
{
ini_enum_keys stdcall (f_name, sec_name, #search_for_id_need_to_run);
}
158,8 → 152,8
{
row++;
col = 0;
DrawBar(0, row * cell_h + list_pos, Form.cwidth , 20, LIST_BACKGROUND_COLOR);
WriteTextB(10, row * cell_h + 9 + list_pos, 0x90, 0x000000, sec_name);
DrawBar(0, row * col_h + list_pos, Form.cwidth , 20, LIST_BACKGROUND_COLOR);
WriteTextB(10, row * col_h + 9 + list_pos, 0x90, 0x000000, sec_name);
list_pos += 20;
ini_enum_keys stdcall (f_name, sec_name, #draw_icons_from_section);
}