forked from KolibriOS/kolibrios
kfm2: add clickable funclional buttons, return template app accidentally deleted
git-svn-id: svn://kolibrios.org@8881 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
4dd5094597
commit
b995e57c1e
@ -3,15 +3,10 @@
|
|||||||
|
|
||||||
// 70.5 - get volume info and label
|
// 70.5 - get volume info and label
|
||||||
|
|
||||||
#define ABOUT_TITLE "EOLITE 5 Beta5"
|
#define ABOUT_TITLE "EOLITE 5 Beta6"
|
||||||
#define TITLE_EOLITE "Eolite File Manager 5 Beta5"
|
#define TITLE_EOLITE "Eolite File Manager 5 Beta6"
|
||||||
#define TITLE_KFM "Kolibri File Manager 2 Beta5";
|
#define TITLE_KFM "Kolibri File Manager 2 Beta6";
|
||||||
|
|
||||||
#ifndef AUTOBUILD
|
|
||||||
#include "lang.h--"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//libraries
|
|
||||||
#define MEMSIZE 1024 * 250
|
#define MEMSIZE 1024 * 250
|
||||||
#include "../lib/clipboard.h"
|
#include "../lib/clipboard.h"
|
||||||
#include "../lib/strings.h"
|
#include "../lib/strings.h"
|
||||||
@ -47,7 +42,8 @@ enum {
|
|||||||
GOUP_BTN,
|
GOUP_BTN,
|
||||||
COPY_BTN,
|
COPY_BTN,
|
||||||
CUT_BTN,
|
CUT_BTN,
|
||||||
PASTE_BTN
|
PASTE_BTN,
|
||||||
|
KFM_FUNC_ID = 450
|
||||||
};
|
};
|
||||||
|
|
||||||
//NewElement options
|
//NewElement options
|
||||||
@ -141,8 +137,7 @@ libimg_image icons16_selected;
|
|||||||
libimg_image icons32_default;
|
libimg_image icons32_default;
|
||||||
libimg_image icons32_selected;
|
libimg_image icons32_selected;
|
||||||
|
|
||||||
#define STATUS_BAR_H 16;
|
int status_bar_h;
|
||||||
int status_bar_h = 0;
|
|
||||||
|
|
||||||
int icon_size = 18;
|
int icon_size = 18;
|
||||||
|
|
||||||
@ -407,6 +402,9 @@ void main()
|
|||||||
case BREADCRUMB_ID...360:
|
case BREADCRUMB_ID...360:
|
||||||
ClickOnBreadCrumb(id-BREADCRUMB_ID);
|
ClickOnBreadCrumb(id-BREADCRUMB_ID);
|
||||||
break;
|
break;
|
||||||
|
case KFM_FUNC_ID...KFM_FUNC_ID+10:
|
||||||
|
FnProcess(id-KFM_FUNC_ID);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -576,7 +574,10 @@ void draw_window()
|
|||||||
incn x;
|
incn x;
|
||||||
dword title;
|
dword title;
|
||||||
if (show_status_bar.checked) {
|
if (show_status_bar.checked) {
|
||||||
status_bar_h = STATUS_BAR_H;
|
#define STBAR_EOLITE_H 16;
|
||||||
|
#define STBAR_KFM_H 21;
|
||||||
|
if (efm) status_bar_h = STBAR_KFM_H;
|
||||||
|
else status_bar_h = STBAR_EOLITE_H;
|
||||||
} else {
|
} else {
|
||||||
status_bar_h = 0;
|
status_bar_h = 0;
|
||||||
}
|
}
|
||||||
@ -650,6 +651,19 @@ void DrawButtonsAroundList()
|
|||||||
if (efm) && (files.x<5) DrawBar(files.x+files.w+16,files.y,1,files.h,sc.work_graph);
|
if (efm) && (files.x<5) DrawBar(files.x+files.w+16,files.y,1,files.h,sc.work_graph);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DrawFuncButtonsInKfm()
|
||||||
|
{
|
||||||
|
int i, x=0, len, min_w=0, padding;
|
||||||
|
for (i=0; i<10; i++) min_w += strlen(kfm_func[i])*6 + 2;
|
||||||
|
padding = Form.cwidth - min_w + 4 / 10;
|
||||||
|
for (i=0; i<10; i++) {
|
||||||
|
len = strlen(kfm_func[i])*6 + padding;
|
||||||
|
if (i==9) len = Form.cwidth - x - 3;
|
||||||
|
DrawFlatButtonSmall(x+1, Form.cheight - 19, len, 16, i+KFM_FUNC_ID+1, kfm_func[i]);
|
||||||
|
x += len + 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void DrawStatusBar()
|
void DrawStatusBar()
|
||||||
{
|
{
|
||||||
char status_bar_str[80];
|
char status_bar_str[80];
|
||||||
@ -657,7 +671,7 @@ void DrawStatusBar()
|
|||||||
|
|
||||||
if (efm) {
|
if (efm) {
|
||||||
DrawBar(0, Form.cheight - status_bar_h, Form.cwidth, status_bar_h, sc.work);
|
DrawBar(0, Form.cheight - status_bar_h, Form.cwidth, status_bar_h, sc.work);
|
||||||
WriteTextCenter(0,Form.cheight - 12, Form.cwidth,sc.work_text,T_KFM_FUNC);
|
DrawFuncButtonsInKfm();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
5
programs/cmm/eolite/build_en.bat
Normal file
5
programs/cmm/eolite/build_en.bat
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
@del Eolite
|
||||||
|
@c-- /D=LANG_ENG Eolite.c
|
||||||
|
@rename Eolite.com Eolite
|
||||||
|
if not exist Eolite ( @pause )
|
||||||
|
@del warning.txt
|
5
programs/cmm/eolite/build_ru.bat
Normal file
5
programs/cmm/eolite/build_ru.bat
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
@del Eolite
|
||||||
|
@c-- /D=LANG_RUS Eolite.c
|
||||||
|
@rename Eolite.com Eolite
|
||||||
|
if not exist Eolite ( @pause )
|
||||||
|
@del warning.txt
|
@ -1,11 +0,0 @@
|
|||||||
@del lang.h--
|
|
||||||
@echo #define LANG_ENG 1 >lang.h--
|
|
||||||
|
|
||||||
@del Eolite
|
|
||||||
cls
|
|
||||||
@c-- Eolite.c
|
|
||||||
rem @kpack Eolite.com
|
|
||||||
@rename Eolite.com Eolite
|
|
||||||
@del warning.txt
|
|
||||||
@del lang.h--
|
|
||||||
@pause
|
|
@ -1,12 +0,0 @@
|
|||||||
@del lang.h--
|
|
||||||
@echo #define LANG_RUS 1 >lang.h--
|
|
||||||
|
|
||||||
@del Eolite
|
|
||||||
cls
|
|
||||||
@c-- Eolite.c
|
|
||||||
rem @kpack Eolite.com
|
|
||||||
@rename Eolite.com Eolite
|
|
||||||
|
|
||||||
@del warning.txt
|
|
||||||
@del lang.h--
|
|
||||||
@pause
|
|
@ -26,6 +26,18 @@
|
|||||||
?define COPY_PATH_STR "'<27>ãâì ¯ ¯ª¨ ᪮¯¨à®¢ ¢ ¡ãä¥à ®¡¬¥ ' -I"
|
?define COPY_PATH_STR "'<27>ãâì ¯ ¯ª¨ ᪮¯¨à®¢ ¢ ¡ãä¥à ®¡¬¥ ' -I"
|
||||||
?define T_ABOUT "Ž ¯à®£à ¬¬¥"
|
?define T_ABOUT "Ž ¯à®£à ¬¬¥"
|
||||||
?define T_USE_SHIFT_ENTER "'ˆá¯®«ì§ã©â¥ Shift+Enter çâ®¡ë ®âªàëâì ¢á¥ ¢ë¤¥«¥ë¥ ä ©«ë.' -I"
|
?define T_USE_SHIFT_ENTER "'ˆá¯®«ì§ã©â¥ Shift+Enter çâ®¡ë ®âªàëâì ¢á¥ ¢ë¤¥«¥ë¥ ä ©«ë.' -I"
|
||||||
|
char *kfm_func = {
|
||||||
|
"F1 ˆä®",
|
||||||
|
"F2 <20>¥à¥¨¬.",
|
||||||
|
"F3 <20>à®á¬.",
|
||||||
|
"F4 <20>¥¤ ªâ.",
|
||||||
|
"F5 Š®¯¨à®¢ âì",
|
||||||
|
"F6 <20>¥à¥¬¥áâ¨âì",
|
||||||
|
"F7 <20> ¯ª ",
|
||||||
|
"F8 “¤ «¨âì",
|
||||||
|
"F9 ” ©«",
|
||||||
|
"F10 <20> áâனª¨"
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
?define T_FILE "File"
|
?define T_FILE "File"
|
||||||
?define T_TYPE "Type"
|
?define T_TYPE "Type"
|
||||||
@ -55,7 +67,17 @@
|
|||||||
?define COPY_PATH_STR "'Directory path copied to clipboard' -I"
|
?define COPY_PATH_STR "'Directory path copied to clipboard' -I"
|
||||||
?define T_ABOUT "About"
|
?define T_ABOUT "About"
|
||||||
?define T_USE_SHIFT_ENTER "'Use Shift+Enter to open all selected files.' -I"
|
?define T_USE_SHIFT_ENTER "'Use Shift+Enter to open all selected files.' -I"
|
||||||
|
char *kfm_func = {
|
||||||
|
"F1 Info",
|
||||||
|
"F2 Rename",
|
||||||
|
"F3 View",
|
||||||
|
"F4 Edit",
|
||||||
|
"F5 Copy",
|
||||||
|
"F6 Move",
|
||||||
|
"F7 Folder",
|
||||||
|
"F8 Delete",
|
||||||
|
"F9 File",
|
||||||
|
"F10 Settings"
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
?define T_KFM_FUNC "F1 Info | F2 Rename | F3 View | F4 Edit | F5 Copy | F6 Move | F7 Folder | F8 Delete | F9 File | F10 Settings"
|
|
||||||
//?define T_KFM_FUNC "F1 ˆä® | F2 <20>¥à¥¨¬. | F3 <20>à®á¬. | F4 <20>¥¤ ªâ. | F5 Š®¯¨à®¢ âì | F6 <20>¥à¥¬¥áâ¨âì | F7 <20> ¯ª | F8 “¤ «¨âì | F9 ” ©« | F10 <20> áâனª¨"
|
|
@ -154,8 +154,8 @@ void CorrectLastItem()
|
|||||||
|
|
||||||
inline ProcessKeys()
|
inline ProcessKeys()
|
||||||
{
|
{
|
||||||
key_scancode = @GetKeyScancode();
|
@GetKeyScancode();
|
||||||
switch(key_scancode)
|
switch(AL)
|
||||||
{
|
{
|
||||||
case SCAN_CODE_ESC:
|
case SCAN_CODE_ESC:
|
||||||
exit();
|
exit();
|
||||||
@ -184,7 +184,7 @@ inline ProcessKeys()
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if (menu1.ProcessKey(key_scancode)) draw_list();
|
if (menu1.ProcessKey(AL)) draw_list();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
5
programs/cmm/template/build.bat
Normal file
5
programs/cmm/template/build.bat
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
@del t
|
||||||
|
@c-- t.c
|
||||||
|
@pause
|
||||||
|
@rename t.com t
|
||||||
|
@del warning.txt
|
27
programs/cmm/template/t.c
Normal file
27
programs/cmm/template/t.c
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
#define MEMSIZE 4096*40
|
||||||
|
|
||||||
|
#include "../lib/gui.h"
|
||||||
|
#include "../lib/fs.h"
|
||||||
|
|
||||||
|
void main()
|
||||||
|
{
|
||||||
|
proc_info Form;
|
||||||
|
|
||||||
|
@SetEventMask(EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE);
|
||||||
|
loop() switch(WaitEvent())
|
||||||
|
{
|
||||||
|
case evMouse:
|
||||||
|
mouse.get();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case evKey:
|
||||||
|
@GetKeyScancode();
|
||||||
|
if (AL == SCAN_CODE_ESC) @ExitProcess();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case evReDraw:
|
||||||
|
sc.get();
|
||||||
|
DefineAndDrawWindow(100, 100, 300, 250, 0x34, sc.work, "Template app", 0);
|
||||||
|
GetProcessInfo(#Form, SelfInfo);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user