Appearance beta2: added scroll, rus version

git-svn-id: svn://kolibrios.org@4085 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2013-10-24 21:45:17 +00:00
parent facae02939
commit c4f8171060
4 changed files with 72 additions and 17 deletions

View File

@ -1,14 +1,29 @@
//11.03.12 - start! //11.03.12 - start!
#ifndef AUTOBUILD
?include "lang.h--"
#endif
#define MEMSIZE 0xFE800 #define MEMSIZE 0xFE800
#include "..\lib\kolibri.h" #include "..\lib\kolibri.h"
#include "..\lib\mem.h" #include "..\lib\mem.h"
#include "..\lib\file_system.h"
#include "..\lib\strings.h" #include "..\lib\strings.h"
#include "..\lib\dll.h"
#include "..\lib\file_system.h"
#include "..\lib\list_box.h" #include "..\lib\list_box.h"
#include "..\lib\figures.h" #include "..\lib\figures.h"
#include "..\lib\lib.obj\box_lib.h"
#ifdef LANG_RUS
?define WINDOW_HEADER "“á¯à ¢«¥­¨¥ ⥬®©"
?define T_SKINS "Žª­ "
?define T_WALLPAPERS "Ž¡®¨ à ¡®ç¥£® á⮫ "
#else
?define WINDOW_HEADER "Appearance"
?define T_SKINS "Skins"
?define T_WALLPAPERS "Wallpappers"
#endif
#define WINDOW_HEADER "Appearance"
#define PANEL_H 30 #define PANEL_H 30
#define SKINS_STANDART_PATH "/sys/skins/" #define SKINS_STANDART_PATH "/sys/skins/"
@ -29,12 +44,12 @@ int cur;
system_colors sc; system_colors sc;
proc_info Form; proc_info Form;
scroll_bar scroll1 = { 18,200,398, 44,18,0,115,15,0,0xeeeeee,0xD2CED0,0x555555,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1};
#include "other.h" #include "other.h"
//ADD PaNEL //icons configurate, delete from list, delete from disk, make default
//remember current
//skins direktory, configurate, delete from list, delete from disk, make default
void Open_Dir() void Open_Dir()
{ {
@ -61,8 +76,8 @@ void Open_Dir()
void Draw_List() void Draw_List()
{ {
int i; int i;
list[SKINS].SetSizes(0, PANEL_H, Form.cwidth, Form.cheight-PANEL_H, 40, 20); list[SKINS].SetSizes(0, PANEL_H, Form.cwidth-scroll1.size_x-1, Form.cheight-PANEL_H, 40, 20);
list[WALLPAPERS].SetSizes(0, PANEL_H, Form.cwidth, Form.cheight-PANEL_H, 40, 20); list[WALLPAPERS].SetSizes(0, PANEL_H, Form.cwidth-scroll1.size_x-1, Form.cheight-PANEL_H, 40, 20);
for (i=0; i<list[active].visible; i++;) for (i=0; i<list[active].visible; i++;)
{ {
@ -89,6 +104,7 @@ void Draw_List()
} }
} }
DrawBar(0,list[active].visible*list[active].line_h+list[active].y, list[active].w, -list[active].visible*list[active].line_h+ list[active].h, 0xFFFfff); DrawBar(0,list[active].visible*list[active].line_h+list[active].y, list[active].w, -list[active].visible*list[active].line_h+ list[active].h, 0xFFFfff);
DrawScroller();
} }
void GetFiles(int set_active) void GetFiles(int set_active)
@ -141,7 +157,7 @@ void main()
mouse mm; mouse mm;
mem_Init(); mem_Init();
if (param) strcpy(#folder_path, #param); if (load_dll2(boxlib, #box_lib_init,0)!=0) {notify("Fatal Error: library doesn't exists /rd/1/lib/box_lib.obj"); ExitProcess();}
list[SKINS].current = list[WALLPAPERS].current = -1; list[SKINS].current = list[WALLPAPERS].current = -1;
list[SKINS].first = list[WALLPAPERS].first = 0; list[SKINS].first = list[WALLPAPERS].first = 0;
GetFiles(WALLPAPERS); GetFiles(WALLPAPERS);
@ -152,6 +168,15 @@ void main()
switch(WaitEvent()) switch(WaitEvent())
{ {
case evMouse: case evMouse:
if (!CheckActiveProcess(Form.ID)) break;
scrollbar_v_mouse (#scroll1);
if (list[active].first <> scroll1.position)
{
list[active].first = scroll1.position;
Draw_List();
break;
}
mm.get(); mm.get();
if (mm.vert) && (list[active].MouseScroll(mm.vert)) Draw_List(); if (mm.vert) && (list[active].MouseScroll(mm.vert)) Draw_List();
if (mouse_clicked) if (mouse_clicked)
@ -209,10 +234,10 @@ void DrawTabs()
if (active==SKINS) {col_bg=sc.work_button; col_text=sc.work_button_text;} else {col_bg=sc.work; col_text=sc.work_text;} if (active==SKINS) {col_bg=sc.work_button; col_text=sc.work_button_text;} else {col_bg=sc.work; col_text=sc.work_text;}
DrawRectangle(10-1,7-1, 65+2, 21+2, sc.work_graph); DrawRectangle(10-1,7-1, 65+2, 21+2, sc.work_graph);
DrawCaptButton(10,7, 65, 21, 2, col_bg, col_text, "Skins"); //вокруг рисовать пмятоуг DrawCaptButton(10,7, 65, 21, 2, col_bg, col_text, T_SKINS); //¢®ªà㣠à¨á®¢ âì ¯¬ïâ®ã£
if (active==WALLPAPERS) {col_bg=sc.work_button; col_text=sc.work_button_text;} else {col_bg=sc.work; col_text=sc.work_text;} if (active==WALLPAPERS) {col_bg=sc.work_button; col_text=sc.work_button_text;} else {col_bg=sc.work; col_text=sc.work_text;}
DrawRectangle(90-1,7-1, 95+2, 21+2, sc.work_graph); DrawRectangle(90-1,7-1, strlen(T_WALLPAPERS)*6+16+2, 21+2, sc.work_graph);
DrawCaptButton(90,7, 95, 21, 3, col_bg, col_text, "Wallpappers"); DrawCaptButton(90,7, strlen(T_WALLPAPERS)*6+16, 21, 3, col_bg, col_text, T_WALLPAPERS);
DrawBar(0,PANEL_H-2, Form.cwidth, 1, sc.work_graph); DrawBar(0,PANEL_H-2, Form.cwidth, 1, sc.work_graph);
DrawBar(0,PANEL_H-1, Form.cwidth, 1, 0xEEEeee); DrawBar(0,PANEL_H-1, Form.cwidth, 1, 0xEEEeee);
@ -226,6 +251,23 @@ void TabClick(int N)
} }
void DrawScroller()
{
scroll1.bckg_col = 0xBBBbbb;
scroll1.frnt_col = sc.work;
scroll1.line_col = sc.work_graph;
scroll1.max_area = list[active].count;
scroll1.cur_area = list[active].visible;
scroll1.position = list[active].first;
scroll1.all_redraw=1;
scroll1.start_x = list[active].x + list[active].w;
scroll1.start_y = list[active].y-2;
scroll1.size_y = list[active].h+2;
scrollbar_v_draw(#scroll1);
}
stop: stop:

View File

@ -1,5 +1,9 @@
@del lang.h--
@echo #define LANG_ENG 1 >lang.h--
..\C--\C-- appearance.c ..\C--\C-- appearance.c
@del appearance.kex @del appearance.kex
@rename appearance.com appearance.kex @rename appearance.com appearance.kex
@del warning.txt @del warning.txt
@del lang.h--
@pause @pause

View File

@ -0,0 +1,9 @@
@del lang.h--
@echo #define LANG_RUS 1 >lang.h--
..\C--\C-- appearance.c
@del appearance.kex
@rename appearance.com appearance.kex
@del warning.txt
@del lang.h--
@pause

View File

@ -3,6 +3,10 @@
//Asper, lev, Lrz, Barsuk, Nable... //Asper, lev, Lrz, Barsuk, Nable...
//home icon - rachel fu, GPL licence //home icon - rachel fu, GPL licence
#ifndef AUTOBUILD
#include "lang.h--"
#endif
//libraries //libraries
#define MEMSIZE 0x100000 #define MEMSIZE 0x100000
#include "..\lib\kolibri.h" #include "..\lib\kolibri.h"
@ -21,10 +25,6 @@
#include "img\toolbar_icons.c" #include "img\toolbar_icons.c"
#include "img\URLgoto.txt"; #include "img\URLgoto.txt";
#ifndef AUTOBUILD
#include "lang.h--"
#endif
#ifdef LANG_RUS #ifdef LANG_RUS
char version[]=" ’¥ªáâ®¢ë© ¡à ã§¥à 0.99.09"; char version[]=" ’¥ªáâ®¢ë© ¡à ã§¥à 0.99.09";
?define IMAGES_CACHE_CLEARED "Šíè ª à⨭®ª ®ç¨é¥­" ?define IMAGES_CACHE_CLEARED "Šíè ª à⨭®ª ®ç¨é¥­"