2013-03-11 19:16:24 +01:00
|
|
|
|
//@RB - v0.7
|
2012-11-26 16:26:15 +01:00
|
|
|
|
|
2013-03-04 21:51:31 +01:00
|
|
|
|
#define MEMSIZE 0x4000
|
2012-11-26 16:26:15 +01:00
|
|
|
|
#include "..\lib\kolibri.h"
|
2012-12-15 01:16:06 +01:00
|
|
|
|
#include "..\lib\strings.h"
|
2013-03-11 19:16:24 +01:00
|
|
|
|
#include "..\lib\mem.h"
|
2012-11-26 16:26:15 +01:00
|
|
|
|
#include "..\lib\figures.h"
|
|
|
|
|
#include "..\lib\file_system.h"
|
|
|
|
|
|
2012-12-05 16:28:09 +01:00
|
|
|
|
#ifndef AUTOBUILD
|
|
|
|
|
#include "lang.h--"
|
|
|
|
|
#endif
|
2012-11-26 16:26:15 +01:00
|
|
|
|
|
2012-12-05 16:13:15 +01:00
|
|
|
|
#ifdef LANG_RUS
|
|
|
|
|
char *ITEMS_LIST[]={
|
2013-03-24 13:49:06 +01:00
|
|
|
|
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ந<EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>", "/sys/desktop", 0,
|
|
|
|
|
//"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ⥬<> <20><><EFBFBD><EFBFBD>", "/sys/SKINSEL", 0,
|
|
|
|
|
//"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>", "/sys/BGSEL", 0,
|
2013-03-03 19:42:53 +01:00
|
|
|
|
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 梥<> 䮭<>", "/sys/media/palitra", 0,
|
|
|
|
|
"<EFBFBD><EFBFBD>ࠢ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", "/sys/ICON", 0,
|
|
|
|
|
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ன<EFBFBD><EFBFBD> <20><><EFBFBD>ன<EFBFBD><E0AEA9><EFBFBD>", "/sys/SETUP", 0,
|
|
|
|
|
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>⮫", "/sys/REFRSCRN", 0,
|
|
|
|
|
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", "/sys/CPU", 0,
|
2012-12-05 16:13:15 +01:00
|
|
|
|
0};
|
|
|
|
|
#else
|
|
|
|
|
char *ITEMS_LIST[]={
|
2013-03-24 13:49:06 +01:00
|
|
|
|
"Window skin", "/sys/desktop", 0,
|
|
|
|
|
//"Window skin", "/sys/SKINSEL", 0,
|
|
|
|
|
//"Wallpaper", "/sys/BGSEL", 0,
|
2013-03-11 19:16:24 +01:00
|
|
|
|
"Background", "/sys/media/palitra", 0,
|
|
|
|
|
"Icon manager", "/sys/ICON", 0,
|
|
|
|
|
"Device setup", "/sys/SETUP", 0,
|
|
|
|
|
"Refresh desktop ", "/sys/REFRSCRN", 0,
|
|
|
|
|
"Processes", "/sys/CPU", 0,
|
2012-12-05 16:13:15 +01:00
|
|
|
|
0};
|
|
|
|
|
#endif
|
2012-11-26 16:26:15 +01:00
|
|
|
|
|
2013-03-11 19:16:24 +01:00
|
|
|
|
char stak[100];
|
|
|
|
|
#define ITEM_HEIGHT 18
|
|
|
|
|
int ITEM_WIDTH;
|
2012-11-26 16:26:15 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void main()
|
|
|
|
|
{
|
|
|
|
|
mouse mm;
|
2013-03-11 19:16:24 +01:00
|
|
|
|
byte i, can_show = 0;
|
2012-11-26 16:26:15 +01:00
|
|
|
|
SetEventMask(100000b);
|
2013-03-11 19:16:24 +01:00
|
|
|
|
for (i=0; ITEMS_LIST[i]!=0; i+=3) if (strlen(ITEMS_LIST[i])>ITEM_WIDTH) ITEM_WIDTH = strlen(ITEMS_LIST[i]);
|
|
|
|
|
ITEM_WIDTH = ITEM_WIDTH * 6 + 20;
|
|
|
|
|
mem_Init();
|
2012-11-26 16:26:15 +01:00
|
|
|
|
|
|
|
|
|
loop() switch(WaitEvent())
|
|
|
|
|
{
|
|
|
|
|
case evMouse:
|
|
|
|
|
mm.get();
|
|
|
|
|
|
2013-02-27 11:17:08 +01:00
|
|
|
|
if (GetPointOwner(mm.x, mm.y)<>1) can_show = 0;
|
|
|
|
|
if (mm.pkm) can_show = 1;
|
|
|
|
|
if (!mm.pkm) && (can_show)
|
2012-11-26 16:26:15 +01:00
|
|
|
|
{
|
|
|
|
|
SwitchToAnotherThread();
|
|
|
|
|
CreateThread(#window,#stak);
|
2013-02-27 11:17:08 +01:00
|
|
|
|
can_show = 0;
|
2012-11-26 16:26:15 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void window()
|
|
|
|
|
{
|
|
|
|
|
proc_info MenuForm;
|
|
|
|
|
system_colors sc;
|
|
|
|
|
mouse m;
|
|
|
|
|
int items_num, items_cur;
|
|
|
|
|
int id1, key, i;
|
|
|
|
|
|
|
|
|
|
sc.get();
|
2013-03-11 19:16:24 +01:00
|
|
|
|
SetEventMask(100111b);
|
2012-11-26 16:26:15 +01:00
|
|
|
|
|
|
|
|
|
loop() switch(WaitEvent())
|
|
|
|
|
{
|
|
|
|
|
case evMouse:
|
|
|
|
|
m.get();
|
|
|
|
|
|
|
|
|
|
GetProcessInfo(#MenuForm, SelfInfo);
|
|
|
|
|
id1=GetProcessSlot(MenuForm.ID);
|
|
|
|
|
if (id1<>GetActiveProcess()) ExitProcess();
|
|
|
|
|
id1=m.y-1/ITEM_HEIGHT;
|
|
|
|
|
if (m.y<0) || (id1+1>items_num) || (m.x<0) || (m.x>ITEM_WIDTH) break;
|
|
|
|
|
if (m.lkm) || (m.pkm)
|
|
|
|
|
{
|
|
|
|
|
//feel clicking
|
|
|
|
|
DrawBar(1, items_cur*ITEM_HEIGHT+2, ITEM_WIDTH-1, ITEM_HEIGHT-2, sc.work_graph);
|
2012-12-15 01:16:06 +01:00
|
|
|
|
WriteText(8,items_cur*ITEM_HEIGHT+6,0x80,sc.work_button_text,ITEMS_LIST[items_cur*3]);
|
2012-12-05 16:13:15 +01:00
|
|
|
|
pause(4);
|
2012-11-26 16:26:15 +01:00
|
|
|
|
|
|
|
|
|
ItemProcess(items_cur);
|
|
|
|
|
}
|
|
|
|
|
if (items_cur<>id1)
|
|
|
|
|
{
|
|
|
|
|
items_cur=id1;
|
|
|
|
|
goto _ITEMS_DRAW;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case evButton:
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case evKey:
|
|
|
|
|
key = GetKey();
|
|
|
|
|
if (key==27) ExitProcess();
|
|
|
|
|
if (key==178) && (items_cur)
|
|
|
|
|
{
|
|
|
|
|
items_cur--;
|
|
|
|
|
goto _ITEMS_DRAW;
|
|
|
|
|
}
|
|
|
|
|
if (key==177) && (items_cur+1<items_num)
|
|
|
|
|
{
|
|
|
|
|
items_cur++;
|
|
|
|
|
goto _ITEMS_DRAW;
|
|
|
|
|
}
|
|
|
|
|
if (key==13)
|
|
|
|
|
{
|
|
|
|
|
ItemProcess(items_cur);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case evReDraw:
|
|
|
|
|
while (ITEMS_LIST[items_num*3]) items_num++;
|
|
|
|
|
m.get();
|
2013-03-11 19:16:24 +01:00
|
|
|
|
DefineAndDrawWindow(m.x+1,m.y,ITEM_WIDTH+1,items_num*ITEM_HEIGHT+2,0x01,sc.work,0, 0x01fffFFF);
|
2012-11-26 16:26:15 +01:00
|
|
|
|
DrawRectangle(0,0,ITEM_WIDTH,items_num*ITEM_HEIGHT+1,sc.work_graph); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2013-03-11 19:16:24 +01:00
|
|
|
|
PutShadow(ITEM_WIDTH+1,1,1,items_num*ITEM_HEIGHT+1,0,1);
|
|
|
|
|
PutShadow(1,items_num*ITEM_HEIGHT+2,ITEM_WIDTH+1,1,0,1);
|
2012-11-26 16:26:15 +01:00
|
|
|
|
|
|
|
|
|
_ITEMS_DRAW:
|
|
|
|
|
for (i=0; i<items_num; i++;)
|
|
|
|
|
{
|
|
|
|
|
if (i==items_cur)
|
|
|
|
|
{
|
|
|
|
|
DrawBar(1, i*ITEM_HEIGHT+1, ITEM_WIDTH-1, 1, sc.work_graph);
|
|
|
|
|
DrawBar(1, i+1*ITEM_HEIGHT, ITEM_WIDTH-1, 1, 0xFFFfff);
|
|
|
|
|
DrawBar(1, i*ITEM_HEIGHT+2, ITEM_WIDTH-1, ITEM_HEIGHT-2, sc.work_button);
|
2012-12-15 01:16:06 +01:00
|
|
|
|
WriteText(8,i*ITEM_HEIGHT+6,0x80,sc.work_button_text,ITEMS_LIST[i*3]);
|
2012-11-26 16:26:15 +01:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
DrawBar(1, i*ITEM_HEIGHT+1, ITEM_WIDTH-1, ITEM_HEIGHT, sc.work);
|
2012-12-15 01:16:06 +01:00
|
|
|
|
WriteText(8,i*ITEM_HEIGHT+6,0x80,sc.work_text,ITEMS_LIST[i*3]);
|
2012-11-26 16:26:15 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2013-03-11 19:16:24 +01:00
|
|
|
|
|
2012-11-26 16:26:15 +01:00
|
|
|
|
void ItemProcess(int num_id)
|
|
|
|
|
{
|
|
|
|
|
RunProgram(ITEMS_LIST[num_id*3+1], ITEMS_LIST[num_id*3+2]);
|
|
|
|
|
ExitProcess();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
stop:
|