forked from KolibriOS/kolibrios
update applications
git-svn-id: svn://kolibrios.org@5656 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
5d7e189ec4
commit
b8267310e8
@ -5,10 +5,8 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define MEMSIZE 0xFE800
|
#define MEMSIZE 0xFE800
|
||||||
#include "..\lib\kolibri.h"
|
|
||||||
#include "..\lib\mem.h"
|
#include "..\lib\mem.h"
|
||||||
#include "..\lib\strings.h"
|
#include "..\lib\strings.h"
|
||||||
#include "..\lib\dll.h"
|
|
||||||
#include "..\lib\io.h"
|
#include "..\lib\io.h"
|
||||||
#include "..\lib\list_box.h"
|
#include "..\lib\list_box.h"
|
||||||
#include "..\lib\gui.h"
|
#include "..\lib\gui.h"
|
||||||
@ -27,7 +25,9 @@
|
|||||||
unsigned char icons[]= FROM "icons.raw";
|
unsigned char icons[]= FROM "icons.raw";
|
||||||
|
|
||||||
#define PANEL_H 30
|
#define PANEL_H 30
|
||||||
#define SKINS_STANDART_PATH "/sys/skins" //"/kolibrios/res/skins"
|
#define SKINS_STANDART_PATH "/sys/skins"
|
||||||
|
//"/kolibrios/res/skins"
|
||||||
|
|
||||||
#define WALP_STANDART_PATH "/kolibrios/res/wallpapers"
|
#define WALP_STANDART_PATH "/kolibrios/res/wallpapers"
|
||||||
|
|
||||||
llist list[2];
|
llist list[2];
|
||||||
@ -50,6 +50,7 @@ void Open_Dir()
|
|||||||
{
|
{
|
||||||
int j;
|
int j;
|
||||||
list[active].count = 0;
|
list[active].count = 0;
|
||||||
|
if(io.dir.buffer)free(io.dir.buffer);
|
||||||
io.dir.load(#folder_path,DIR_ONLYREAL);
|
io.dir.load(#folder_path,DIR_ONLYREAL);
|
||||||
for (j=0; j<io.dir.count; j++)
|
for (j=0; j<io.dir.count; j++)
|
||||||
{
|
{
|
||||||
@ -82,7 +83,7 @@ void Draw_List()
|
|||||||
|
|
||||||
if (list[active].current-list[active].first==i)
|
if (list[active].current-list[active].first==i)
|
||||||
{
|
{
|
||||||
if (sc.work_button<>sc.work)
|
if (sc.work_button!=sc.work)
|
||||||
{
|
{
|
||||||
DrawBar(0, yyy, list[active].w, list[active].line_h, sc.work_button);
|
DrawBar(0, yyy, list[active].w, list[active].line_h, sc.work_button);
|
||||||
if (i<list[active].count) WriteText(12,yyy+list[active].text_y,0x80,sc.work_button_text, #temp_filename);
|
if (i<list[active].count) WriteText(12,yyy+list[active].text_y,0x80,sc.work_button_text, #temp_filename);
|
||||||
@ -123,19 +124,14 @@ void Apply()
|
|||||||
{
|
{
|
||||||
if (list[SKINS].active)
|
if (list[SKINS].active)
|
||||||
{
|
{
|
||||||
strcpy(#cur_file_path, #folder_path);
|
|
||||||
cur = list[SKINS].current;
|
cur = list[SKINS].current;
|
||||||
chrcat(#cur_file_path, '/');
|
sprintf(#cur_file_path,"%s/%s",#folder_path,io.dir.position(files_mas[cur]));
|
||||||
strcat(#cur_file_path, io.dir.position(files_mas[cur]));
|
|
||||||
SetSystemSkin(#cur_file_path);
|
SetSystemSkin(#cur_file_path);
|
||||||
}
|
}
|
||||||
if (list[WALLPAPERS].active)
|
if (list[WALLPAPERS].active)
|
||||||
{
|
{
|
||||||
strcpy(#cur_file_path, "\\S__");
|
|
||||||
strcat(#cur_file_path, #folder_path);
|
|
||||||
cur = list[WALLPAPERS].current;
|
cur = list[WALLPAPERS].current;
|
||||||
chrcat(#cur_file_path, '/');
|
sprintf(#cur_file_path,"\\S__%s/%s",#folder_path,io.dir.position(files_mas[cur]));
|
||||||
strcat(#cur_file_path, io.dir.position(files_mas[cur]));
|
|
||||||
RunProgram("/sys/media/kiv", #cur_file_path);
|
RunProgram("/sys/media/kiv", #cur_file_path);
|
||||||
Draw_List();
|
Draw_List();
|
||||||
}
|
}
|
||||||
@ -165,29 +161,28 @@ void main()
|
|||||||
{
|
{
|
||||||
case evMouse:
|
case evMouse:
|
||||||
if (!CheckActiveProcess(Form.ID)) break;
|
if (!CheckActiveProcess(Form.ID)) break;
|
||||||
|
mouse.get();
|
||||||
scrollbar_v_mouse (#scroll1);
|
scrollbar_v_mouse (#scroll1);
|
||||||
if (list[active].first <> scroll1.position)
|
if (list[active].first != scroll1.position)
|
||||||
{
|
{
|
||||||
list[active].first = scroll1.position;
|
list[active].first = scroll1.position;
|
||||||
Draw_List();
|
Draw_List();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
mouse.get();
|
|
||||||
|
|
||||||
if (mouse.vert)
|
if (mouse.vert)
|
||||||
{
|
{
|
||||||
if (list[SKINS].active) && (list[SKINS].MouseScroll(mouse.vert)) Draw_List();
|
if (list[SKINS].active) && (list[SKINS].MouseScroll(mouse.vert)) Draw_List();
|
||||||
if (list[WALLPAPERS].active) && (list[WALLPAPERS].MouseScroll(mouse.vert)) Draw_List();
|
if (list[WALLPAPERS].active) && (list[WALLPAPERS].MouseScroll(mouse.vert)) Draw_List();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mouse_clicked)
|
if (mouse.up)&&(mouse_clicked)
|
||||||
{
|
{
|
||||||
if (!mouse.lkm) && (list[SKINS].active) && (list[SKINS].ProcessMouse(mouse.x, mouse.y)) Apply();
|
if (mouse.lkm) &&(list[SKINS].active) && (list[SKINS].ProcessMouse(mouse.x, mouse.y)) Apply();
|
||||||
if (!mouse.lkm) && (list[WALLPAPERS].active) && (list[WALLPAPERS].ProcessMouse(mouse.x, mouse.y)) Apply();
|
if (mouse.lkm) &&(list[WALLPAPERS].active) && (list[WALLPAPERS].ProcessMouse(mouse.x, mouse.y)) Apply();
|
||||||
mouse_clicked=0;
|
mouse_clicked=false;
|
||||||
}
|
}
|
||||||
if (mouse.lkm) && (list[SKINS].MouseOver(mouse.x, mouse.y)) mouse_clicked=1;
|
else if (mouse.down)&&(mouse.lkm) && (list[SKINS].MouseOver(mouse.x, mouse.y)) mouse_clicked=true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
|
@ -3,11 +3,9 @@ SOFTWARE CENTER v2.32
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#define MEMSIZE 0x5000
|
#define MEMSIZE 0x5000
|
||||||
#include "..\lib\kolibri.h"
|
|
||||||
#include "..\lib\strings.h"
|
#include "..\lib\strings.h"
|
||||||
#include "..\lib\mem.h"
|
#include "..\lib\mem.h"
|
||||||
#include "..\lib\file_system.h"
|
#include "..\lib\file_system.h"
|
||||||
#include "..\lib\dll.h"
|
|
||||||
#include "..\lib\gui.h"
|
#include "..\lib\gui.h"
|
||||||
|
|
||||||
#include "..\lib\obj\libio_lib.h"
|
#include "..\lib\obj\libio_lib.h"
|
||||||
@ -124,8 +122,8 @@ byte search_for_id_need_to_run(dword key_value, key_name, sec_name, f_name)
|
|||||||
RunProgram(key_value, "");
|
RunProgram(key_value, "");
|
||||||
}
|
}
|
||||||
current_item_id++;
|
current_item_id++;
|
||||||
if (strncmp(key_value, "/kolibrios/", 11)==0) && (!kolibrios_mounted) current_item_id--;
|
if (!strncmp(key_value, "/kolibrios/", 11)) && (!kolibrios_mounted) current_item_id--;
|
||||||
return 1;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -141,7 +139,7 @@ byte draw_icons_from_section(dword key_value, key_name, sec_name, f_name)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//do not show items located in /kolibrios/ if this directory not mounted
|
//do not show items located in /kolibrios/ if this directory not mounted
|
||||||
if (strncmp(key_value, "/kolibrios/", 11)==0) && (!kolibrios_mounted) return 1;
|
if (!strncmp(key_value, "/kolibrios/", 11)) && (!kolibrios_mounted) return true;
|
||||||
|
|
||||||
if (col==0) DrawBar(0, row * cell_h + list_pos, Form.cwidth, cell_h, LIST_BACKGROUND_COLOR);
|
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);
|
DefineButton(col*cell_w+6,row*cell_h + list_pos,cell_w,cell_h-5,current_item_id + 100 + BT_HIDE,0);
|
||||||
@ -154,13 +152,13 @@ byte draw_icons_from_section(dword key_value, key_name, sec_name, f_name)
|
|||||||
WriteTextCenter(col*cell_w+6,row*cell_h+46 + list_pos,cell_w,0x000000,key_name);
|
WriteTextCenter(col*cell_w+6,row*cell_h+46 + list_pos,cell_w,0x000000,key_name);
|
||||||
current_item_id++;
|
current_item_id++;
|
||||||
col++;
|
col++;
|
||||||
return 1;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
byte process_sections(dword sec_name, f_name)
|
byte process_sections(dword sec_name, f_name)
|
||||||
{
|
{
|
||||||
if (strcmp(sec_name, "Config")==0) return 1;
|
if (!strcmp(sec_name, "Config")) return true;
|
||||||
|
|
||||||
if (item_id_need_to_run!=-1)
|
if (item_id_need_to_run!=-1)
|
||||||
{
|
{
|
||||||
@ -183,7 +181,7 @@ byte process_sections(dword sec_name, f_name)
|
|||||||
list_pos += 20;
|
list_pos += 20;
|
||||||
ini_enum_keys stdcall (f_name, sec_name, #draw_icons_from_section);
|
ini_enum_keys stdcall (f_name, sec_name, #draw_icons_from_section);
|
||||||
}
|
}
|
||||||
return 1;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void draw_top_bar()
|
void draw_top_bar()
|
||||||
|
Loading…
Reference in New Issue
Block a user