Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 7994 → Rev 7995

/programs/cmm/misc/mblocks.c
42,7 → 42,6
dword firstbit, secondbit;
int count;
 
 
void main()
{
dword id;
49,15 → 48,12
load_dll(libio, #libio_init,1);
load_dll(libimg, #libimg_init,1);
 
skin.load("/sys/icons32.png");
skin.replace_color(0x00000000, 0xFFFfff);
 
NewGame();
 
loop() switch(@WaitEvent())
{
case evKey:
if (@GetKeyScancode()==SCAN_CODE_F2) NewGame();
//if (@GetKeyScancode()==SCAN_CODE_F2) NewGame();
break;
case evButton:
80,26 → 76,18
ReDraw_Game_Button(secondbit);
secondbit = 0x0BAD;
firstbit = id;
bitstat[id] = BTN_PRESSED;
ReDraw_Game_Button(id);
count++;
}
else if (firstbit != id)
{
} else if (firstbit != id) {
secondbit = id;
bitstat[id] = BTN_PRESSED;
ReDraw_Game_Button(id);
count++;
}
}
else
{
} else {
firstbit = id;
bitstat[id] = BTN_PRESSED;
ReDraw_Game_Button(id);
count++;
}
}
bitstat[id] = BTN_PRESSED;
ReDraw_Game_Button(id);
Draw_Count();
}
break;
161,16 → 149,15
case BTN_CLOSED:
DrawRectangle3D(xx + 1, yy + 1, CELL_SIZE-2, CELL_SIZE-2, 0xFFFFFF, 0xDEDEDE);//bump
DrawBar(xx + 2, yy + 2, CELL_SIZE-3, CELL_SIZE-3, 0xBDC7D6);//background
break;
return;
case BTN_PRESSED:
DrawWideRectangle(xx + 1, yy + 1, CELL_SIZE-1, CELL_SIZE-1, 2, 0x94DB00);//border green
DrawBar(xx + 3, yy + 3, CELL_SIZE-5, CELL_SIZE-5, 0xFFFfff);//background
img_draw stdcall(skin.image, xx+6, yy+6, 32, 32, 0, bitpict[id]*32);
BREAK;
case BTN_OPEN:
DrawBar(xx+1, yy+1, CELL_SIZE-1, CELL_SIZE-1, 0xFFFfff);//background
img_draw stdcall(skin.image, xx+6, yy+6, 32, 32, 0, bitpict[id]*32);
}
DrawIcon32(xx+6, yy+6, 0xFFFfff, bitpict[id]);
}
 
void Draw_Panel()
/programs/cmm/misc/software_widget.c
87,10 → 87,10
small_screen = true;
}
 
loop() switch(WaitEvent())
loop() switch(@WaitEvent())
{
case evKey:
GetKeys();
key_scancode = @GetKeyScancode();
if (SCAN_CODE_LEFT == key_scancode) key_scancode = SCAN_CODE_UP;
if (SCAN_CODE_RIGHT == key_scancode) key_scancode = SCAN_CODE_DOWN;
if (list.ProcessKey(key_scancode)) DrawSelection();
98,7 → 98,7
break;
 
case evButton:
id=GetButtonID();
id = @GetButtonID();
if (id==1) ExitProcess();
if (id>=100) EventIconClick(id-100);
break;
144,18 → 144,8
swc.dark = 0xDCDCDC;
swc.light = 0xFCFCFC;
}
 
if (!skin.image) LoadImages();
else if (swc.list_bg != old_list_bg_color) LoadImages();
}
 
void LoadImages()
{
skin.load("/sys/icons32.png");
skin.replace_color(0x00000000, swc.list_bg);
}
 
 
void DrawList() {
list.count = 0;
row = -1;
198,17 → 188,14
text_y = list.item_h - 40 / 2;
if (!strchr(key_name, ' ')) {//|| (kfont.getsize(key_name)+30<list.item_w) <== too slow
kfont.WriteIntoWindowCenter(text_x, row*list.item_h+46 + list_pos, list.item_w,0, swc.list_bg, swc.text, 12, key_name);
//WriteTextCenter(text_x, row*list.item_h+46 + list_pos+3, list.item_w, swc.text, key_name);
} else {
space_pos = strrchr(key_name, ' ');
ESBYTE[key_name+space_pos-1] = '\0';
kfont.WriteIntoWindowCenter(text_x, row*list.item_h+46 + list_pos - 2, list.item_w,0, swc.list_bg, swc.text, 12, key_name);
kfont.WriteIntoWindowCenter(text_x, row*list.item_h+46 + list_pos + 13, list.item_w,0, swc.list_bg, swc.text, 12, key_name+space_pos);
//WriteTextCenter(text_x, row*list.item_h+46 + list_pos, list.item_w, swc.text, key_name);
//WriteTextCenter(text_x, row*list.item_h+46 + list_pos + 10, list.item_w, swc.text, key_name+space_pos);
}
if (icon_char_pos) icon_id = atoi(icon_char_pos+1);
img_draw stdcall(skin.image, icon_x, icon_y, 32, 32, 0, icon_id*32);
if (Form.cwidth) DrawIcon32(icon_x, icon_y, swc.list_bg, icon_id);
list.count++;
col++;
return true;
215,18 → 202,15
}
 
 
int old_row; //to detect empty sections
byte process_sections(dword sec_name, f_name)
{
static int old_row; //to detect empty sections
int text_len;
if (!strcmp(sec_name, "Config")) return true;
 
if ((col==0) && (row==old_row))
{
if ((col==0) && (row==old_row)) {
list_pos -= 28;
}
else
{
} else {
row++;
}
col = 0;
253,7 → 237,7
 
void EventIconClick(dword appid)
{
char run_app_path[4096]=0;
char run_app_path[4096];
dword app_path = app_path_collection.get(appid);
dword param_pos = strchr(app_path, '|');
if (param_pos) {