2013-10-24 02:05:17 +04:00
|
|
|
|
//11.03.12 - start!
|
2019-03-10 22:46:52 +03:00
|
|
|
|
//ver 2.3
|
2013-10-24 02:05:17 +04:00
|
|
|
|
|
2013-10-25 01:45:17 +04:00
|
|
|
|
#ifndef AUTOBUILD
|
|
|
|
|
?include "lang.h--"
|
|
|
|
|
#endif
|
|
|
|
|
|
2019-05-20 13:40:10 +03:00
|
|
|
|
#define MEMSIZE 200*1024
|
2013-10-24 02:05:17 +04:00
|
|
|
|
#include "..\lib\mem.h"
|
|
|
|
|
#include "..\lib\strings.h"
|
2015-08-02 22:37:34 +03:00
|
|
|
|
#include "..\lib\io.h"
|
2013-10-24 02:05:17 +04:00
|
|
|
|
#include "..\lib\list_box.h"
|
2015-03-05 23:55:28 +03:00
|
|
|
|
#include "..\lib\gui.h"
|
2018-09-12 00:09:14 +03:00
|
|
|
|
|
2015-03-05 23:55:28 +03:00
|
|
|
|
#include "..\lib\obj\box_lib.h"
|
2018-09-12 00:09:14 +03:00
|
|
|
|
#include "..\lib\obj\proc_lib.h"
|
2019-03-10 22:46:52 +03:00
|
|
|
|
#include "..\lib\obj\libini.h"
|
2013-10-25 01:45:17 +04:00
|
|
|
|
|
2018-09-12 00:09:14 +03:00
|
|
|
|
#include "..\lib\patterns\select_list.h"
|
|
|
|
|
#include "..\lib\patterns\simple_open_dialog.h"
|
2016-02-13 14:00:14 +03:00
|
|
|
|
|
2019-03-19 01:31:13 +03:00
|
|
|
|
#include "ui_elements_preview.h"
|
|
|
|
|
|
2016-02-13 14:00:14 +03:00
|
|
|
|
//===================================================//
|
|
|
|
|
// //
|
|
|
|
|
// DATA //
|
|
|
|
|
// //
|
|
|
|
|
//===================================================//
|
|
|
|
|
|
2013-10-25 01:45:17 +04:00
|
|
|
|
#ifdef LANG_RUS
|
2016-02-13 14:00:14 +03:00
|
|
|
|
?define WINDOW_HEADER "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ன<EFBFBD><EFBFBD> <20><><EFBFBD>ଫ<EFBFBD><E0ACAB><EFBFBD><EFBFBD>"
|
2016-02-20 16:06:19 +03:00
|
|
|
|
?define T_SKINS "<EFBFBD>⨫<EFBFBD> <20><><EFBFBD><EFBFBD>"
|
|
|
|
|
?define T_WALLPAPERS "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
2018-09-12 00:09:14 +03:00
|
|
|
|
?define T_SELECT_FOLDER "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>"
|
2020-04-12 00:17:55 +03:00
|
|
|
|
?define MENU_LIST "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<> |Enter\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<> |Del"
|
2019-03-15 15:19:45 +03:00
|
|
|
|
?define T_PICTURE_MODE " <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>⨭<EFBFBD><E2A8AD> "
|
|
|
|
|
?define T_CHECKBOX_STRETCH "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
|
|
|
|
?define T_CHECKBOX_TILED "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
2019-03-15 17:05:59 +03:00
|
|
|
|
?define T_UPDATE_DOCK "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Dock-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
2013-10-25 01:45:17 +04:00
|
|
|
|
#else
|
|
|
|
|
?define WINDOW_HEADER "Appearance"
|
2016-02-20 16:06:19 +03:00
|
|
|
|
?define T_SKINS "Skins"
|
2018-09-12 00:09:14 +03:00
|
|
|
|
?define T_WALLPAPERS "Wallpapers"
|
2019-03-15 15:19:45 +03:00
|
|
|
|
?define T_SELECT_FOLDER "Select folder"
|
2020-04-12 00:17:55 +03:00
|
|
|
|
?define MENU_LIST "Open file |Enter\nDelete file |Del"
|
2019-03-15 15:19:45 +03:00
|
|
|
|
?define T_PICTURE_MODE " Picture Mode "
|
|
|
|
|
?define T_CHECKBOX_STRETCH "Stretch"
|
|
|
|
|
?define T_CHECKBOX_TILED "Tiled"
|
2019-03-15 17:05:59 +03:00
|
|
|
|
?define T_UPDATE_DOCK "Update Dock"
|
2013-10-25 01:45:17 +04:00
|
|
|
|
#endif
|
2013-10-24 02:05:17 +04:00
|
|
|
|
|
2016-02-13 14:00:14 +03:00
|
|
|
|
#define PANEL_H 40
|
2018-04-11 20:46:08 +03:00
|
|
|
|
#define LP 10 //LIST_PADDING
|
2019-03-10 22:46:52 +03:00
|
|
|
|
char skins_folder_path[4096];
|
|
|
|
|
char wallp_folder_path[4096];
|
2013-10-24 02:05:17 +04:00
|
|
|
|
|
2016-02-20 16:06:19 +03:00
|
|
|
|
signed int active_skin=-1, active_wallpaper=-1;
|
2018-09-12 00:09:14 +03:00
|
|
|
|
enum {
|
|
|
|
|
SKINS=2,
|
|
|
|
|
WALLPAPERS,
|
|
|
|
|
BTN_SELECT_WALLP_FOLDER };
|
2013-10-24 02:05:17 +04:00
|
|
|
|
|
|
|
|
|
char folder_path[4096];
|
|
|
|
|
char cur_file_path[4096];
|
2018-11-12 19:27:48 +03:00
|
|
|
|
char cur_skin_path[4096];
|
2013-10-24 02:05:17 +04:00
|
|
|
|
char temp_filename[4096];
|
2016-01-26 02:13:50 +03:00
|
|
|
|
int files_mas[400];
|
2013-10-24 02:05:17 +04:00
|
|
|
|
|
|
|
|
|
int cur;
|
|
|
|
|
|
|
|
|
|
proc_info Form;
|
2018-04-19 23:12:07 +03:00
|
|
|
|
block skp;
|
2013-10-24 02:05:17 +04:00
|
|
|
|
|
2019-03-19 01:31:13 +03:00
|
|
|
|
_tabs tabs = { SKINS, LP, LP, NULL, NULL };
|
2018-04-11 20:46:08 +03:00
|
|
|
|
|
2019-03-15 17:05:59 +03:00
|
|
|
|
checkbox update_docky = { T_UPDATE_DOCK, false };
|
2018-04-22 16:33:01 +03:00
|
|
|
|
|
2018-09-12 00:09:14 +03:00
|
|
|
|
char default_dir[] = "/rd/1";
|
|
|
|
|
od_filter filter2 = { 8, "TXT\0\0" };
|
|
|
|
|
|
2019-03-15 15:19:45 +03:00
|
|
|
|
checkbox optionbox_stretch = { T_CHECKBOX_STRETCH, true };
|
|
|
|
|
checkbox optionbox_tiled = { T_CHECKBOX_TILED, false };
|
|
|
|
|
|
2016-02-13 14:00:14 +03:00
|
|
|
|
//===================================================//
|
|
|
|
|
// //
|
|
|
|
|
// CODE //
|
|
|
|
|
// //
|
|
|
|
|
//===================================================//
|
2013-10-24 02:05:17 +04:00
|
|
|
|
|
2019-03-10 22:46:52 +03:00
|
|
|
|
void GetRealFolderPathes()
|
|
|
|
|
{
|
|
|
|
|
char real_skin_path[4096];
|
|
|
|
|
SetCurDir("/kolibrios");
|
|
|
|
|
GetCurDir(#real_skin_path, sizeof(real_skin_path));
|
|
|
|
|
sprintf(#skins_folder_path, "%s/res/skins", #real_skin_path);
|
|
|
|
|
sprintf(#wallp_folder_path, "%s/res/wallpapers", #real_skin_path);
|
|
|
|
|
}
|
|
|
|
|
|
2013-10-24 02:05:17 +04:00
|
|
|
|
void main()
|
|
|
|
|
{
|
2015-08-10 10:55:50 +03:00
|
|
|
|
int id, mouse_clicked;
|
2013-10-24 02:05:17 +04:00
|
|
|
|
|
2019-03-10 22:46:52 +03:00
|
|
|
|
GetRealFolderPathes();
|
|
|
|
|
|
2015-07-29 23:43:05 +03:00
|
|
|
|
load_dll(boxlib, #box_lib_init,0);
|
2018-11-06 20:05:54 +03:00
|
|
|
|
load_dll(libini, #lib_init,1);
|
2018-09-12 00:09:14 +03:00
|
|
|
|
load_dll(Proc_lib, #OpenDialog_init,0);
|
|
|
|
|
o_dialog.type = 2; //select folder
|
|
|
|
|
OpenDialog_init stdcall (#o_dialog);
|
|
|
|
|
|
2016-02-13 14:00:14 +03:00
|
|
|
|
EventTabClick(SKINS);
|
2018-09-12 00:09:14 +03:00
|
|
|
|
|
2018-11-12 19:27:48 +03:00
|
|
|
|
SetEventMask(EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE + EVM_MOUSE_FILTER);
|
2016-01-26 02:13:50 +03:00
|
|
|
|
loop() switch(WaitEvent())
|
2013-10-24 02:05:17 +04:00
|
|
|
|
{
|
|
|
|
|
case evMouse:
|
2016-11-02 17:30:45 +03:00
|
|
|
|
SelectList_ProcessMouse();
|
2018-09-12 00:09:14 +03:00
|
|
|
|
|
|
|
|
|
if (tabs.active_tab == SKINS) {
|
|
|
|
|
edit_box_mouse stdcall (#edit_cmm);
|
|
|
|
|
edit_box_mouse stdcall (#edit_st);
|
|
|
|
|
}
|
2016-02-13 14:00:14 +03:00
|
|
|
|
|
2020-04-12 00:17:55 +03:00
|
|
|
|
if (mouse.key&MOUSE_RIGHT) && (mouse.up)
|
|
|
|
|
&&(select_list.MouseOver(mouse.x, mouse.y)) {
|
2016-11-02 15:19:15 +03:00
|
|
|
|
select_list.ProcessMouse(mouse.x, mouse.y);
|
2016-11-02 17:30:45 +03:00
|
|
|
|
SelectList_Draw();
|
2018-09-12 00:09:14 +03:00
|
|
|
|
EventSetNewCurrent();
|
2020-04-12 00:17:55 +03:00
|
|
|
|
open_lmenu(Form.left+mouse.x+5, Form.top+mouse.y+skin_height, 1, 0, MENU_LIST);
|
2016-02-13 14:00:14 +03:00
|
|
|
|
}
|
2013-10-24 02:05:17 +04:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case evButton:
|
|
|
|
|
id=GetButtonID();
|
2018-11-12 19:27:48 +03:00
|
|
|
|
if (id==1) EventExit();
|
2016-02-13 14:00:14 +03:00
|
|
|
|
if (id==SKINS) EventTabClick(SKINS);
|
|
|
|
|
if (id==WALLPAPERS) EventTabClick(WALLPAPERS);
|
2018-09-12 00:09:14 +03:00
|
|
|
|
if (id==BTN_SELECT_WALLP_FOLDER) EventSelectWallpFolder();
|
2018-04-19 23:12:07 +03:00
|
|
|
|
checkbox1.click(id);
|
2018-04-21 15:28:00 +03:00
|
|
|
|
spinbox1.click(id);
|
2019-03-15 17:05:59 +03:00
|
|
|
|
if (update_docky.click(id)) EventUpdateDocky();
|
2019-03-15 15:19:45 +03:00
|
|
|
|
if (!optionbox_stretch.checked) && (optionbox_stretch.click(id)) EventSetWallpMode_Stretch();
|
|
|
|
|
if (!optionbox_tiled.checked) && (optionbox_tiled.click(id)) EventSetWallpMode_Tiled();
|
2013-10-24 02:05:17 +04:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case evKey:
|
2015-08-10 13:47:21 +03:00
|
|
|
|
GetKeys();
|
2016-11-02 15:19:15 +03:00
|
|
|
|
if (select_list.ProcessKey(key_scancode)) EventApply();
|
2016-02-13 14:00:14 +03:00
|
|
|
|
if (key_scancode==SCAN_CODE_ENTER) EventOpenFile();
|
2018-09-12 00:09:14 +03:00
|
|
|
|
if (key_scancode==SCAN_CODE_TAB) {
|
2018-04-11 20:46:08 +03:00
|
|
|
|
if (tabs.active_tab==SKINS) EventTabClick(WALLPAPERS);
|
2018-09-12 00:09:14 +03:00
|
|
|
|
else EventTabClick(SKINS);
|
|
|
|
|
}
|
2016-02-13 14:00:14 +03:00
|
|
|
|
if (key_scancode==SCAN_CODE_DEL) EventDeleteFile();
|
2018-09-10 22:47:52 +03:00
|
|
|
|
|
2018-10-29 14:39:31 +03:00
|
|
|
|
if (! edit_cmm.flags & ed_focus) && (! edit_st.flags & ed_focus)
|
2016-11-02 15:19:15 +03:00
|
|
|
|
for (id=select_list.cur_y+1; id<select_list.count; id++)
|
2013-10-24 02:05:17 +04:00
|
|
|
|
{
|
2016-02-13 14:00:14 +03:00
|
|
|
|
strcpy(#temp_filename, io.dir.position(files_mas[id]));
|
|
|
|
|
if (temp_filename[0]==key_ascii) || (temp_filename[0]==key_ascii-32)
|
|
|
|
|
{
|
2016-11-02 15:19:15 +03:00
|
|
|
|
select_list.cur_y = id - 1;
|
|
|
|
|
select_list.KeyDown();
|
2016-02-13 14:00:14 +03:00
|
|
|
|
EventApply();
|
|
|
|
|
break;
|
|
|
|
|
}
|
2013-10-24 02:05:17 +04:00
|
|
|
|
}
|
2018-09-10 22:47:52 +03:00
|
|
|
|
|
2018-09-12 00:09:14 +03:00
|
|
|
|
if (tabs.active_tab == SKINS) {
|
|
|
|
|
EAX = key_ascii << 8;
|
|
|
|
|
edit_box_key stdcall (#edit_cmm);
|
|
|
|
|
edit_box_key stdcall (#edit_st);
|
|
|
|
|
}
|
2013-10-24 02:05:17 +04:00
|
|
|
|
break;
|
|
|
|
|
|
2018-09-12 00:09:14 +03:00
|
|
|
|
case evReDraw:
|
|
|
|
|
draw_window();
|
2020-04-12 00:17:55 +03:00
|
|
|
|
EventHandleMenuClick();
|
2013-10-24 02:05:17 +04:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2018-09-12 00:09:14 +03:00
|
|
|
|
void draw_window()
|
|
|
|
|
{
|
2020-04-18 02:52:24 +03:00
|
|
|
|
sc.get();
|
|
|
|
|
DefineAndDrawWindow(screen.width-600/2,80,630,504+skin_height,0x34,sc.work,WINDOW_HEADER,0);
|
2018-09-12 00:09:14 +03:00
|
|
|
|
GetProcessInfo(#Form, SelfInfo);
|
|
|
|
|
IF (Form.status_window>=2) return;
|
|
|
|
|
DrawWindowContent();
|
|
|
|
|
}
|
2018-04-19 23:12:07 +03:00
|
|
|
|
|
2016-02-13 14:00:14 +03:00
|
|
|
|
void DrawWindowContent()
|
|
|
|
|
{
|
|
|
|
|
int id;
|
2018-09-12 00:09:14 +03:00
|
|
|
|
int list_w;
|
|
|
|
|
|
2020-04-18 02:52:24 +03:00
|
|
|
|
sc.get();
|
2019-03-15 17:05:59 +03:00
|
|
|
|
|
2019-03-15 15:19:45 +03:00
|
|
|
|
if (tabs.active_tab == SKINS) list_w=250; else list_w=350;
|
2018-04-11 20:46:08 +03:00
|
|
|
|
|
|
|
|
|
tabs.w = Form.cwidth-LP-LP;
|
|
|
|
|
tabs.h = Form.cheight-LP-LP;
|
|
|
|
|
tabs.draw_wrapper();
|
2018-04-11 21:32:00 +03:00
|
|
|
|
tabs.draw_button(tabs.x+TAB_PADDING, SKINS, T_SKINS);
|
|
|
|
|
tabs.draw_button(strlen(T_SKINS)*8+tabs.x+TAB_PADDING+TAB_PADDING, WALLPAPERS, T_WALLPAPERS);
|
2018-04-11 20:46:08 +03:00
|
|
|
|
|
2016-11-02 15:19:15 +03:00
|
|
|
|
id = select_list.cur_y;
|
2016-11-02 17:30:45 +03:00
|
|
|
|
SelectList_Init(
|
2018-04-11 20:46:08 +03:00
|
|
|
|
tabs.x+TAB_PADDING,
|
|
|
|
|
tabs.y+TAB_HEIGHT+TAB_PADDING,
|
2018-09-12 00:09:14 +03:00
|
|
|
|
list_w,
|
2018-04-11 20:46:08 +03:00
|
|
|
|
tabs.h - TAB_PADDING - TAB_PADDING - TAB_HEIGHT,
|
2016-11-02 17:30:45 +03:00
|
|
|
|
false
|
|
|
|
|
);
|
2016-11-02 15:19:15 +03:00
|
|
|
|
select_list.cur_y = id;
|
2018-04-19 23:12:07 +03:00
|
|
|
|
|
|
|
|
|
skp.set_size(
|
2018-04-21 15:28:00 +03:00
|
|
|
|
select_list.x + select_list.w + TAB_PADDING + scroll1.size_x + 20,
|
2019-03-15 17:05:59 +03:00
|
|
|
|
select_list.y + 30 + 50,
|
2018-09-12 00:09:14 +03:00
|
|
|
|
list_w,
|
2019-03-15 17:05:59 +03:00
|
|
|
|
230 //select_list.h - 50 - 50
|
2018-04-19 23:12:07 +03:00
|
|
|
|
);
|
|
|
|
|
|
2016-11-02 17:30:45 +03:00
|
|
|
|
SelectList_Draw();
|
2016-11-03 15:41:15 +03:00
|
|
|
|
SelectList_DrawBorder();
|
2020-04-18 02:52:24 +03:00
|
|
|
|
//DrawWideRectangle(0, 0, Form.cwidth, Form.cheight, LP, sc.work);
|
2018-04-19 23:12:07 +03:00
|
|
|
|
|
|
|
|
|
if (tabs.active_tab == SKINS)
|
|
|
|
|
{
|
2019-03-15 17:05:59 +03:00
|
|
|
|
update_docky.draw(skp.x, select_list.y+15);
|
2018-04-19 23:12:07 +03:00
|
|
|
|
DrawFrame(skp.x, skp.y, skp.w, skp.h, " Components Preview ");
|
2019-03-19 01:31:13 +03:00
|
|
|
|
DrawUiElementsPreview(skp.x+20, skp.y, skp.h);
|
2018-04-19 23:12:07 +03:00
|
|
|
|
}
|
2018-09-12 00:09:14 +03:00
|
|
|
|
if (tabs.active_tab == WALLPAPERS)
|
|
|
|
|
{
|
2019-03-15 15:19:45 +03:00
|
|
|
|
skp.x -= TAB_PADDING + 3;
|
|
|
|
|
DrawStandartCaptButton(skp.x, select_list.y, BTN_SELECT_WALLP_FOLDER, T_SELECT_FOLDER);
|
|
|
|
|
DrawFrame(skp.x, select_list.y+50, 180, 80, T_PICTURE_MODE);
|
|
|
|
|
optionbox_stretch.draw(skp.x+14, select_list.y+70);
|
|
|
|
|
optionbox_tiled.draw(skp.x+14, select_list.y+97);
|
2018-09-12 00:09:14 +03:00
|
|
|
|
}
|
2016-02-13 14:00:14 +03:00
|
|
|
|
}
|
2013-10-24 02:05:17 +04:00
|
|
|
|
|
|
|
|
|
|
2016-02-13 14:00:14 +03:00
|
|
|
|
void Open_Dir()
|
2013-10-24 02:05:17 +04:00
|
|
|
|
{
|
2016-02-13 14:00:14 +03:00
|
|
|
|
int j;
|
2016-11-02 15:19:15 +03:00
|
|
|
|
select_list.count = 0;
|
2016-02-13 14:00:14 +03:00
|
|
|
|
if(io.dir.buffer)free(io.dir.buffer);
|
|
|
|
|
io.dir.load(#folder_path,DIR_ONLYREAL);
|
|
|
|
|
for (j=0; j<io.dir.count; j++)
|
2013-12-27 02:51:43 +04:00
|
|
|
|
{
|
2016-02-13 14:00:14 +03:00
|
|
|
|
strcpy(#temp_filename, io.dir.position(j));
|
|
|
|
|
strlwr(#temp_filename);
|
2018-09-12 00:09:14 +03:00
|
|
|
|
if (tabs.active_tab==SKINS) {
|
|
|
|
|
if (strcmpi(#temp_filename+strlen(#temp_filename)-4,".skn")!=0) continue;
|
|
|
|
|
}
|
|
|
|
|
if (tabs.active_tab==WALLPAPERS) {
|
|
|
|
|
if (strcmpi(#temp_filename+strlen(#temp_filename)-4,".png")!=0)
|
|
|
|
|
&& (strcmpi(#temp_filename+strlen(#temp_filename)-4,".jpg")!=0)
|
|
|
|
|
&& (strcmpi(#temp_filename+strlen(#temp_filename)-5,".jpeg")!=0)
|
|
|
|
|
&& (strcmpi(#temp_filename+strlen(#temp_filename)-4,".gif")!=0) continue;
|
|
|
|
|
}
|
2016-11-02 15:19:15 +03:00
|
|
|
|
cur = select_list.count;
|
2016-02-13 14:00:14 +03:00
|
|
|
|
files_mas[cur]=j;
|
2016-11-02 15:19:15 +03:00
|
|
|
|
if (!strcmpi("default.skn",#temp_filename)) files_mas[0]><files_mas[select_list.count];
|
|
|
|
|
select_list.count++;
|
2013-12-27 02:51:43 +04:00
|
|
|
|
}
|
2016-02-13 14:00:14 +03:00
|
|
|
|
}
|
|
|
|
|
|
2016-11-02 17:30:45 +03:00
|
|
|
|
void SelectList_DrawLine(dword i)
|
2016-02-13 14:00:14 +03:00
|
|
|
|
{
|
2016-11-02 15:19:15 +03:00
|
|
|
|
int yyy, list_last;
|
|
|
|
|
|
|
|
|
|
cur = select_list.first + i;
|
|
|
|
|
strcpy(#temp_filename, io.dir.position(files_mas[cur]));
|
|
|
|
|
temp_filename[strlen(#temp_filename)-4] = 0;
|
|
|
|
|
yyy = i*select_list.item_h+select_list.y;
|
|
|
|
|
|
|
|
|
|
if (select_list.cur_y-select_list.first==i)
|
|
|
|
|
{
|
2020-04-18 02:52:24 +03:00
|
|
|
|
DrawBar(select_list.x, yyy, select_list.w, select_list.item_h, sc.button);
|
|
|
|
|
WriteText(select_list.x+12,yyy+select_list.text_y,select_list.font_type,sc.button_text, #temp_filename);
|
2016-11-02 15:19:15 +03:00
|
|
|
|
}
|
|
|
|
|
else
|
2013-12-27 02:51:43 +04:00
|
|
|
|
{
|
2016-11-02 15:19:15 +03:00
|
|
|
|
DrawBar(select_list.x,yyy,select_list.w, select_list.item_h, 0xFFFfff);
|
|
|
|
|
WriteText(select_list.x+12,yyy+select_list.text_y,select_list.font_type,0, #temp_filename);
|
2013-12-27 02:51:43 +04:00
|
|
|
|
}
|
2013-10-24 02:05:17 +04:00
|
|
|
|
}
|
|
|
|
|
|
2016-11-02 17:30:45 +03:00
|
|
|
|
void SelectList_LineChanged()
|
|
|
|
|
{
|
|
|
|
|
EventApply();
|
|
|
|
|
}
|
|
|
|
|
|
2016-02-13 14:00:14 +03:00
|
|
|
|
//===================================================//
|
|
|
|
|
// //
|
|
|
|
|
// EVENTS //
|
|
|
|
|
// //
|
|
|
|
|
//===================================================//
|
2013-10-24 02:05:17 +04:00
|
|
|
|
|
2016-02-13 14:00:14 +03:00
|
|
|
|
void EventTabClick(int N)
|
2013-10-25 01:45:17 +04:00
|
|
|
|
{
|
2016-02-20 16:06:19 +03:00
|
|
|
|
tabs.click(N);
|
|
|
|
|
if (tabs.active_tab == SKINS)
|
2016-02-13 14:00:14 +03:00
|
|
|
|
{
|
2016-11-02 15:19:15 +03:00
|
|
|
|
active_wallpaper = select_list.cur_y;
|
2018-09-12 00:09:14 +03:00
|
|
|
|
strcpy(#folder_path, #skins_folder_path);
|
2016-11-02 15:19:15 +03:00
|
|
|
|
select_list.ClearList();
|
2016-02-13 14:00:14 +03:00
|
|
|
|
Open_Dir();
|
2016-11-02 15:19:15 +03:00
|
|
|
|
if (!select_list.count) notify("'No skins were found' -E");
|
|
|
|
|
select_list.cur_y = active_skin;
|
2016-02-13 14:00:14 +03:00
|
|
|
|
}
|
2016-02-20 16:06:19 +03:00
|
|
|
|
if (tabs.active_tab == WALLPAPERS)
|
2016-02-13 14:00:14 +03:00
|
|
|
|
{
|
2016-11-02 15:19:15 +03:00
|
|
|
|
active_skin = select_list.cur_y;
|
2018-09-12 00:09:14 +03:00
|
|
|
|
strcpy(#folder_path, #wallp_folder_path);
|
2016-11-02 15:19:15 +03:00
|
|
|
|
select_list.ClearList();
|
2016-02-13 14:00:14 +03:00
|
|
|
|
Open_Dir();
|
2016-11-02 15:19:15 +03:00
|
|
|
|
if (!select_list.count) notify("'No wallpapers were found' -E");
|
|
|
|
|
select_list.cur_y = active_wallpaper;
|
2016-02-13 14:00:14 +03:00
|
|
|
|
}
|
2016-11-02 15:19:15 +03:00
|
|
|
|
if (select_list.cur_y>select_list.visible) select_list.first=select_list.cur_y; select_list.CheckDoesValuesOkey();
|
2019-03-19 01:31:13 +03:00
|
|
|
|
if (select_list.w) draw_window();
|
2016-02-13 14:00:14 +03:00
|
|
|
|
}
|
2013-10-25 01:45:17 +04:00
|
|
|
|
|
2016-02-13 14:00:14 +03:00
|
|
|
|
void EventDeleteFile()
|
|
|
|
|
{
|
|
|
|
|
io.del(#cur_file_path);
|
|
|
|
|
Open_Dir();
|
|
|
|
|
EventApply();
|
|
|
|
|
}
|
2013-10-25 01:45:17 +04:00
|
|
|
|
|
2018-09-12 00:09:14 +03:00
|
|
|
|
void EventSetNewCurrent()
|
|
|
|
|
{
|
|
|
|
|
cur = select_list.cur_y;
|
|
|
|
|
sprintf(#cur_file_path,"%s/%s",#folder_path,io.dir.position(files_mas[cur]));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void EventSelectWallpFolder()
|
|
|
|
|
{
|
|
|
|
|
OpenDialog_start stdcall (#o_dialog);
|
|
|
|
|
if (o_dialog.status) {
|
|
|
|
|
strcpy(#wallp_folder_path, #opendir_path);
|
|
|
|
|
EventTabClick(WALLPAPERS);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-03-15 15:19:45 +03:00
|
|
|
|
void EventSetWallpMode_Stretch()
|
|
|
|
|
{
|
|
|
|
|
optionbox_tiled.checked = false;
|
|
|
|
|
optionbox_tiled.redraw();
|
|
|
|
|
EventApply();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void EventSetWallpMode_Tiled()
|
|
|
|
|
{
|
|
|
|
|
optionbox_stretch.checked = false;
|
|
|
|
|
optionbox_stretch.redraw();
|
|
|
|
|
EventApply();
|
|
|
|
|
}
|
|
|
|
|
|
2019-03-15 17:05:59 +03:00
|
|
|
|
#include "..\lib\patterns\restart_process.h"
|
2016-02-13 14:00:14 +03:00
|
|
|
|
void EventApply()
|
|
|
|
|
{
|
2018-09-12 00:09:14 +03:00
|
|
|
|
char kivpath[4096+10];
|
|
|
|
|
EventSetNewCurrent();
|
2016-02-20 16:06:19 +03:00
|
|
|
|
if (tabs.active_tab==SKINS)
|
2016-02-13 14:00:14 +03:00
|
|
|
|
{
|
2016-11-02 15:19:15 +03:00
|
|
|
|
cur = select_list.cur_y;
|
2016-02-13 14:00:14 +03:00
|
|
|
|
SetSystemSkin(#cur_file_path);
|
2019-03-15 17:05:59 +03:00
|
|
|
|
SelectList_Draw();
|
2018-11-12 19:27:48 +03:00
|
|
|
|
strcpy(#cur_skin_path, #cur_file_path);
|
2019-03-15 17:05:59 +03:00
|
|
|
|
EventUpdateDocky();
|
2016-02-13 14:00:14 +03:00
|
|
|
|
}
|
2016-02-20 16:06:19 +03:00
|
|
|
|
if (tabs.active_tab==WALLPAPERS)
|
2016-02-13 14:00:14 +03:00
|
|
|
|
{
|
2018-11-12 19:27:48 +03:00
|
|
|
|
SelectList_Draw();
|
2019-03-15 15:19:45 +03:00
|
|
|
|
if (optionbox_stretch.checked) strcpy(#kivpath, "\\S__");
|
|
|
|
|
if (optionbox_tiled.checked) strcpy(#kivpath, "\\T__");
|
2018-09-12 00:09:14 +03:00
|
|
|
|
strcat(#kivpath, #cur_file_path);
|
|
|
|
|
RunProgram("/sys/media/kiv", #kivpath);
|
2016-02-13 14:00:14 +03:00
|
|
|
|
}
|
2013-10-25 01:45:17 +04:00
|
|
|
|
}
|
2013-10-24 02:05:17 +04:00
|
|
|
|
|
2019-03-15 17:05:59 +03:00
|
|
|
|
void EventUpdateDocky()
|
|
|
|
|
{
|
|
|
|
|
if (!update_docky.checked) return;
|
|
|
|
|
KillProcessByName("@docky", MULTIPLE);
|
|
|
|
|
RunProgram("/sys/@docky",NULL);
|
|
|
|
|
pause(50);
|
|
|
|
|
ActivateWindow(GetProcessSlot(Form.ID));
|
|
|
|
|
}
|
|
|
|
|
|
2016-02-13 14:00:14 +03:00
|
|
|
|
void EventOpenFile()
|
|
|
|
|
{
|
2016-02-20 16:06:19 +03:00
|
|
|
|
if (tabs.active_tab==SKINS) RunProgram("/sys/skincfg", #cur_file_path);
|
|
|
|
|
if (tabs.active_tab==WALLPAPERS) RunProgram("/sys/media/kiv", #cur_file_path);
|
2016-02-13 14:00:14 +03:00
|
|
|
|
}
|
2013-10-24 02:05:17 +04:00
|
|
|
|
|
2020-05-06 00:42:00 +03:00
|
|
|
|
_ini ini = { "/sys/settings/system.ini", "style" };
|
2018-11-12 19:27:48 +03:00
|
|
|
|
void EventExit()
|
|
|
|
|
{
|
2019-03-17 00:06:09 +03:00
|
|
|
|
if (cur_skin_path) ini.SetString("skin", #cur_skin_path, strlen(#cur_skin_path));
|
2018-11-12 19:27:48 +03:00
|
|
|
|
ExitProcess();
|
|
|
|
|
}
|
|
|
|
|
|
2020-04-12 00:17:55 +03:00
|
|
|
|
void EventHandleMenuClick()
|
|
|
|
|
{
|
|
|
|
|
switch (get_menu_click())
|
|
|
|
|
{
|
|
|
|
|
case 1:
|
|
|
|
|
EventOpenFile();
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
EventDeleteFile();
|
|
|
|
|
break;
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
2013-10-24 02:05:17 +04:00
|
|
|
|
stop:
|