Eolite: refactoring
git-svn-id: svn://kolibrios.org@8951 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
@@ -57,23 +57,20 @@ void GetDiskIconAndName(char disk_first_letter, dword dev_icon, dword disc_name)
|
||||
strcpy(disc_name, T_UNC);
|
||||
}
|
||||
|
||||
#define DEV_H 17
|
||||
#define DDW 120
|
||||
#define KFM2_DEVH 20
|
||||
|
||||
void _SystemDiscs::Draw()
|
||||
{
|
||||
char dev_name[15], disc_name[100], i, dev_icon;
|
||||
bool is_active=0;
|
||||
int draw_y, draw_x;
|
||||
|
||||
for (i=0; i<30; i++) DeleteButton(100+i);
|
||||
|
||||
if (efm) {
|
||||
DrawSelect(Form.cwidth/2-DDW, KFM_DEV_DROPDOWN_1, location[0]);
|
||||
DrawSelect(Form.cwidth-DDW-2, KFM_DEV_DROPDOWN_2, location[sizeof(dword)]);
|
||||
files.y = 40 + 17;
|
||||
} else {
|
||||
Tip(56, T_DEVICES, 55, "=");
|
||||
for (i=0; i<30; i++) DeleteButton(100+i);
|
||||
|
||||
draw_y = 74;
|
||||
draw_x = 17;
|
||||
for (i=0;i<list.count;i++) {
|
||||
@@ -100,6 +97,8 @@ void _SystemDiscs::Draw()
|
||||
draw_y += DEV_H;
|
||||
}
|
||||
DrawBar(draw_x+6, draw_y, 18, 1, 0xFFFfff);
|
||||
ActionsDraw(SystemDiscs.list.count*DEV_H+108);
|
||||
DrawLeftPanelBg(SystemDiscs.list.count*DEV_H);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -158,75 +157,3 @@ void _SystemDiscs::Click(int n)
|
||||
Open_Dir(path,WITH_REDRAW);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void DrawDeviceAndActionsLeftPanel()
|
||||
{
|
||||
Tip(56, T_DEVICES, 55, "=");
|
||||
SystemDiscs.Draw();
|
||||
ActionsDraw();
|
||||
DrawLeftPanelBg();
|
||||
}
|
||||
|
||||
dword col_palette_inner[14] = {0xD2D3D3,0xD4D4D4,0xD6D5D6,0xD8D7D8,0xDAD8D9,0xDCDADB,
|
||||
0xDFDCDD,0xE1DDDE,0xE2DEE0,0xE4DFE1,0xE3DFE1,0xE3DFE1,0xE3DFE1,0xE3DFE1,0xE3DFE1};
|
||||
void DrawFilledBarInner(dword x, y, w, h)
|
||||
{
|
||||
int i, fill_h;
|
||||
if (h <= 14) fill_h = h; else fill_h = 14;
|
||||
for (i=0; i<fill_h; i++) DrawBar(x, y+i, w, 1, col_palette_inner[14-i]);
|
||||
DrawBar(x, y+i, w, h-fill_h, col_palette_inner[14-i]);
|
||||
}
|
||||
|
||||
void Tip(int y, dword caption, id, arrow)
|
||||
{
|
||||
if (col.def) {
|
||||
DrawBar(17,y,160,1,0xEFEDEE);
|
||||
DrawFilledBarInner(17, y+1, 160, 16);
|
||||
DrawBar(17,y+17,160,1,0x7E87A3);
|
||||
} else {
|
||||
DrawBar(17,y,160,1,sc.work_graph);
|
||||
DrawBar(17,y+1,160,16,col.list_bg);
|
||||
DrawBar(17,y+17,160,1,sc.work_graph);
|
||||
}
|
||||
WriteText(25,y+5,0x80,col.list_gb_text,caption);
|
||||
if (id) DefineButton(159,y+1,16,16,id+BT_HIDE+BT_NOFRAME,0); //arrow button
|
||||
WriteText(165,y+5,0x80,col.list_gb_text,arrow); //arrow
|
||||
}
|
||||
|
||||
void ActionsDraw()
|
||||
{
|
||||
int i;
|
||||
int actions_y= SystemDiscs.list.count*DEV_H+108;
|
||||
Tip(actions_y-18, T_ACTIONS, 77, "");
|
||||
for (i=0; actions[i*3]!=0; i++, actions_y+=DEV_H)
|
||||
{
|
||||
DrawBar(17,actions_y,160,DEV_H,0xFFFFFF); //<2F><><EFBFBD><EFBFBD><EFBFBD>
|
||||
DefineButton(17,actions_y,159,DEV_H,actions[i*3]+BT_HIDE,0xE4DFE1);
|
||||
WriteText(45,actions_y+4,0x80,0,actions[i*3+1]);
|
||||
WriteText(-strlen(actions[i*3+2])*6+170,actions_y+4,0x80,0x999999,actions[i*3+2]);
|
||||
_PutImage(23,actions_y+2, 14,13, i*14*13*3+#factions);
|
||||
}
|
||||
}
|
||||
|
||||
void DrawLeftPanelBg()
|
||||
{
|
||||
int actions_y = SystemDiscs.list.count*DEV_H;
|
||||
int start_y = actions_y+159;
|
||||
int area_h;
|
||||
DrawBar(2,41,190,15,waves_pal[0]); //above devices block
|
||||
DrawBar(17,actions_y+75,160,15,EDX); //below devices block
|
||||
DrawBar(2,56,15,actions_y+103,EDX); //on the left
|
||||
DrawBar(177,56,15,actions_y+103,EDX); //on the right
|
||||
area_h = Form.cheight-start_y-2 - status_bar_h;
|
||||
if (area_h < 268){
|
||||
PutPaletteImage(#blue_hl, 190, area_h, 2, start_y, 8, #waves_pal);
|
||||
} else {
|
||||
DrawBar(2,start_y,190, area_h-268, waves_pal[0]);
|
||||
PutPaletteImage(#blue_hl, 190, 268, 2, Form.cheight-270-status_bar_h, 8, #waves_pal);
|
||||
}
|
||||
PutShadow(17,actions_y+75,160,1,1,3);
|
||||
PutShadow(18,actions_y+75+1,158,1,1,1);
|
||||
PutShadow(17,start_y,160,1,1,3);
|
||||
PutShadow(18,start_y+1,158,1,1,1);
|
||||
}
|
Reference in New Issue
Block a user