forked from KolibriOS/kolibrios
1. move kos_mouse_functions.h to lib/mouse.h
2. Eolite: use system value for double click, remove old code 3. Eolite: fix long file names while using big fonts git-svn-id: svn://kolibrios.org@5996 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
ef496ce0d8
commit
a12ef7aa3c
@ -36,7 +36,6 @@ dword col_padding, col_selec, col_lpanel;
|
|||||||
|
|
||||||
int toolbar_buttons_x[7]={9,46,85,134,167,203};
|
int toolbar_buttons_x[7]={9,46,85,134,167,203};
|
||||||
|
|
||||||
byte smooth_font=false;
|
|
||||||
byte active_about=0;
|
byte active_about=0;
|
||||||
word about_window;
|
word about_window;
|
||||||
word settings_window;
|
word settings_window;
|
||||||
@ -667,6 +666,7 @@ void Line_ReDraw(dword bgcol, filenum){
|
|||||||
file_name_off,
|
file_name_off,
|
||||||
y=filenum*files.item_h+files.y;
|
y=filenum*files.item_h+files.y;
|
||||||
BDVK file;
|
BDVK file;
|
||||||
|
char label_file_name[4096];
|
||||||
if (filenum==-1) return;
|
if (filenum==-1) return;
|
||||||
DrawBar(files.x,y,3,files.item_h,bgcol);
|
DrawBar(files.x,y,3,files.item_h,bgcol);
|
||||||
DrawBar(files.x+19,y,files.w-19,files.item_h,bgcol);
|
DrawBar(files.x+19,y,files.w-19,files.item_h,bgcol);
|
||||||
@ -717,8 +717,15 @@ void Line_ReDraw(dword bgcol, filenum){
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
label.smooth = smooth_font;
|
strcpy(#label_file_name, file_name_off);
|
||||||
label.write(files.x + 23, files.item_h - label.height / 2 + y, bgcol, text_col, label.size.pt, file_name_off);
|
if (label.getsize(#label_file_name) + 141 + 26 > files.w)
|
||||||
|
{
|
||||||
|
while (label.getsize(#label_file_name) + 141 + 26 > files.w) {
|
||||||
|
ESBYTE[#label_file_name+strlen(#label_file_name)-1] = NULL;
|
||||||
|
}
|
||||||
|
strcpy(#label_file_name+strlen(#label_file_name)-2, "...");
|
||||||
|
}
|
||||||
|
label.write(files.x + 23, files.item_h - label.height / 2 + y, bgcol, text_col, label.size.pt, #label_file_name);
|
||||||
}
|
}
|
||||||
DrawBar(files.x+files.w-141,y,1,files.item_h,system.color.work); //gray line 1
|
DrawBar(files.x+files.w-141,y,1,files.item_h,system.color.work); //gray line 1
|
||||||
DrawBar(files.x+files.w-68,y,1,files.item_h,system.color.work); //gray line 2
|
DrawBar(files.x+files.w-68,y,1,files.item_h,system.color.work); //gray line 2
|
||||||
|
@ -9,7 +9,6 @@
|
|||||||
?define smooth_FONT "ˆá¯®«ì§®¢ âì ᣫ ¦¥ë© èà¨äâ"
|
?define smooth_FONT "ˆá¯®«ì§®¢ âì ᣫ ¦¥ë© èà¨äâ"
|
||||||
?define LIST_LINE_HEIGHT "‚ëá®â áâப¨ ¢ ᯨ᪥"
|
?define LIST_LINE_HEIGHT "‚ëá®â áâப¨ ¢ ᯨ᪥"
|
||||||
?define NOTIFY_COPY_END "“¢¥¤®¬«ïâì ® § ¢¥à襨¨ ª®¯¨à®¢ ¨ï"
|
?define NOTIFY_COPY_END "“¢¥¤®¬«ïâì ® § ¢¥à襨¨ ª®¯¨à®¢ ¨ï"
|
||||||
?define T_DOUBLE_CLICK "‚à¥¬ï ¤¢®©®£® ª«¨ª (¢ á®âëå)"
|
|
||||||
#define SAVE_PATH_AS_DEFAULT "‘®åà ¨âì ⥪ã騩 ¯ãâì ¯® 㬮«ç ¨î"
|
#define SAVE_PATH_AS_DEFAULT "‘®åà ¨âì ⥪ã騩 ¯ãâì ¯® 㬮«ç ¨î"
|
||||||
#else
|
#else
|
||||||
?define EDIT_FILE_ASSOCIATIONS "Edit file associations"
|
?define EDIT_FILE_ASSOCIATIONS "Edit file associations"
|
||||||
@ -21,7 +20,6 @@
|
|||||||
?define smooth_FONT "Use smooth font"
|
?define smooth_FONT "Use smooth font"
|
||||||
?define LIST_LINE_HEIGHT "List line height"
|
?define LIST_LINE_HEIGHT "List line height"
|
||||||
?define NOTIFY_COPY_END "Notify when copying finished"
|
?define NOTIFY_COPY_END "Notify when copying finished"
|
||||||
?define T_DOUBLE_CLICK "Double click time (in hundredths)"
|
|
||||||
#define SAVE_PATH_AS_DEFAULT "Save the current default path"
|
#define SAVE_PATH_AS_DEFAULT "Save the current default path"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -55,8 +53,6 @@ void settings_dialog()
|
|||||||
else if (id==24) two_panels ^= true;
|
else if (id==24) two_panels ^= true;
|
||||||
else if (id==25) { files.item_h++; files_active.item_h = files_inactive.item_h = files.item_h; }
|
else if (id==25) { files.item_h++; files_active.item_h = files_inactive.item_h = files.item_h; }
|
||||||
else if (id==26) && (files.item_h>18) files.item_h--;
|
else if (id==26) && (files.item_h>18) files.item_h--;
|
||||||
else if (id==27) MOUSE_TIME++;
|
|
||||||
else if (id==28) && (MOUSE_TIME>29) MOUSE_TIME--;
|
|
||||||
//else if (id==29) smooth_font ^= true;
|
//else if (id==29) smooth_font ^= true;
|
||||||
else if (id==30) { label.size.pt++; IF(!label.changeSIZE()) label.size.pt--; BigFontsChange(); }
|
else if (id==30) { label.size.pt++; IF(!label.changeSIZE()) label.size.pt--; BigFontsChange(); }
|
||||||
else if (id==31) { label.size.pt--; IF(!label.changeSIZE()) label.size.pt++; BigFontsChange(); }
|
else if (id==31) { label.size.pt--; IF(!label.changeSIZE()) label.size.pt++; BigFontsChange(); }
|
||||||
@ -92,8 +88,6 @@ void DrawSettingsCheckBoxes()
|
|||||||
CheckBox2(10, 33, 21, SHOW_REAL_NAMES, real_files_names_case);
|
CheckBox2(10, 33, 21, SHOW_REAL_NAMES, real_files_names_case);
|
||||||
CheckBox2(10, 55, 22, NOTIFY_COPY_END, info_after_copy);
|
CheckBox2(10, 55, 22, NOTIFY_COPY_END, info_after_copy);
|
||||||
CheckBox2(10, 77, 24, USE_TWO_PANELS, two_panels);
|
CheckBox2(10, 77, 24, USE_TWO_PANELS, two_panels);
|
||||||
//CheckBox2(10, 99, 29, smooth_FONT, smooth_font);
|
|
||||||
MoreLessBox(10, 99, 18, 27, 28, #system.color, MOUSE_TIME, T_DOUBLE_CLICK);
|
|
||||||
MoreLessBox(10, 125, 18, 25, 26, #system.color, files.item_h, LIST_LINE_HEIGHT);
|
MoreLessBox(10, 125, 18, 25, 26, #system.color, files.item_h, LIST_LINE_HEIGHT);
|
||||||
if (label.font) MoreLessBox(10, 152, 18, 30, 31, #system.color, label.size.pt, FONT_SIZE_LABEL);
|
if (label.font) MoreLessBox(10, 152, 18, 30, 31, #system.color, label.size.pt, FONT_SIZE_LABEL);
|
||||||
}
|
}
|
||||||
@ -109,9 +103,7 @@ void LoadIniSettings()
|
|||||||
ini_get_int stdcall (eolite_ini_path, #config_section, "InfoAfterCopy", 0); info_after_copy = EAX;
|
ini_get_int stdcall (eolite_ini_path, #config_section, "InfoAfterCopy", 0); info_after_copy = EAX;
|
||||||
ini_get_int stdcall (eolite_ini_path, #config_section, "FontSize", 9); label.size.pt = EAX;
|
ini_get_int stdcall (eolite_ini_path, #config_section, "FontSize", 9); label.size.pt = EAX;
|
||||||
ini_get_int stdcall (eolite_ini_path, #config_section, "TwoPanels", 0); two_panels = EAX;
|
ini_get_int stdcall (eolite_ini_path, #config_section, "TwoPanels", 0); two_panels = EAX;
|
||||||
//ini_get_int stdcall (eolite_ini_path, #config_section, "UseSmoothFont", true);smooth_font = EAX;
|
|
||||||
ini_get_int stdcall (eolite_ini_path, #config_section, "LineHeight", 18); files.item_h = EAX;
|
ini_get_int stdcall (eolite_ini_path, #config_section, "LineHeight", 18); files.item_h = EAX;
|
||||||
ini_get_int stdcall (eolite_ini_path, #config_section, "TimeDoubleClick", 50); MOUSE_TIME = EAX;
|
|
||||||
ini_get_int stdcall (eolite_ini_path, #config_section, "WinX", 200); WinX = EAX;
|
ini_get_int stdcall (eolite_ini_path, #config_section, "WinX", 200); WinX = EAX;
|
||||||
ini_get_int stdcall (eolite_ini_path, #config_section, "WinY", 50); WinY = EAX;
|
ini_get_int stdcall (eolite_ini_path, #config_section, "WinY", 50); WinY = EAX;
|
||||||
ini_get_int stdcall (eolite_ini_path, #config_section, "WinW", 550); WinW = EAX;
|
ini_get_int stdcall (eolite_ini_path, #config_section, "WinW", 550); WinW = EAX;
|
||||||
@ -121,8 +113,7 @@ void LoadIniSettings()
|
|||||||
ini_get_str stdcall ("/sys/SETTINGS/SYSTEM.INI", "system", "font file",#temp,4096,DEFAULT_FONT);
|
ini_get_str stdcall ("/sys/SETTINGS/SYSTEM.INI", "system", "font file",#temp,4096,DEFAULT_FONT);
|
||||||
label.init(#temp);
|
label.init(#temp);
|
||||||
ini_get_str stdcall ("/sys/SETTINGS/SYSTEM.INI", "system", "font smoothing",#temp,4096,"on");
|
ini_get_str stdcall ("/sys/SETTINGS/SYSTEM.INI", "system", "font smoothing",#temp,4096,"on");
|
||||||
if(!strcmp(#temp,"off"))smooth_font = false;
|
if(!strcmp(#temp,"off")) label.smooth = false; else label.smooth = true;
|
||||||
else smooth_font = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -134,9 +125,7 @@ void SaveIniSettings()
|
|||||||
ini_set_int stdcall (eolite_ini_path, #config_section, "InfoAfterCopy", info_after_copy);
|
ini_set_int stdcall (eolite_ini_path, #config_section, "InfoAfterCopy", info_after_copy);
|
||||||
ini_set_int stdcall (eolite_ini_path, #config_section, "FontSize", label.size.pt);
|
ini_set_int stdcall (eolite_ini_path, #config_section, "FontSize", label.size.pt);
|
||||||
ini_set_int stdcall (eolite_ini_path, #config_section, "TwoPanels", two_panels);
|
ini_set_int stdcall (eolite_ini_path, #config_section, "TwoPanels", two_panels);
|
||||||
//ini_set_int stdcall (eolite_ini_path, #config_section, "UseSmoothFont", smooth_font);
|
|
||||||
ini_set_int stdcall (eolite_ini_path, #config_section, "LineHeight", files.item_h);
|
ini_set_int stdcall (eolite_ini_path, #config_section, "LineHeight", files.item_h);
|
||||||
ini_set_int stdcall (eolite_ini_path, #config_section, "TimeDoubleClick", MOUSE_TIME);
|
|
||||||
ini_set_int stdcall (eolite_ini_path, #config_section, "WinX", Form.left);
|
ini_set_int stdcall (eolite_ini_path, #config_section, "WinX", Form.left);
|
||||||
ini_set_int stdcall (eolite_ini_path, #config_section, "WinY", Form.top);
|
ini_set_int stdcall (eolite_ini_path, #config_section, "WinY", Form.top);
|
||||||
ini_set_int stdcall (eolite_ini_path, #config_section, "WinW", Form.width);
|
ini_set_int stdcall (eolite_ini_path, #config_section, "WinW", Form.width);
|
||||||
@ -149,9 +138,7 @@ void SaveIniSettings()
|
|||||||
ini_set_int stdcall (fd_path_eolite_ini_path, #config_section, "InfoAfterCopy", info_after_copy);
|
ini_set_int stdcall (fd_path_eolite_ini_path, #config_section, "InfoAfterCopy", info_after_copy);
|
||||||
ini_set_int stdcall (fd_path_eolite_ini_path, #config_section, "FontSize", label.size.pt);
|
ini_set_int stdcall (fd_path_eolite_ini_path, #config_section, "FontSize", label.size.pt);
|
||||||
ini_set_int stdcall (fd_path_eolite_ini_path, #config_section, "TwoPanels", two_panels);
|
ini_set_int stdcall (fd_path_eolite_ini_path, #config_section, "TwoPanels", two_panels);
|
||||||
//ini_set_int stdcall (fd_path_eolite_ini_path, #config_section, "UseSmoothFont", smooth_font);
|
|
||||||
ini_set_int stdcall (fd_path_eolite_ini_path, #config_section, "LineHeight", files.item_h);
|
ini_set_int stdcall (fd_path_eolite_ini_path, #config_section, "LineHeight", files.item_h);
|
||||||
ini_set_int stdcall (fd_path_eolite_ini_path, #config_section, "TimeDoubleClick", MOUSE_TIME);
|
|
||||||
ini_set_int stdcall (fd_path_eolite_ini_path, #config_section, "WinX", Form.left);
|
ini_set_int stdcall (fd_path_eolite_ini_path, #config_section, "WinX", Form.left);
|
||||||
ini_set_int stdcall (fd_path_eolite_ini_path, #config_section, "WinY", Form.top);
|
ini_set_int stdcall (fd_path_eolite_ini_path, #config_section, "WinY", Form.top);
|
||||||
ini_set_int stdcall (fd_path_eolite_ini_path, #config_section, "WinW", Form.width);
|
ini_set_int stdcall (fd_path_eolite_ini_path, #config_section, "WinW", Form.width);
|
||||||
|
@ -73,8 +73,8 @@
|
|||||||
}
|
}
|
||||||
$neg size.offset_y
|
$neg size.offset_y
|
||||||
$neg size.offset_x
|
$neg size.offset_x
|
||||||
size.height += size.offset_y; size.height++;
|
size.height += size.offset_y+1;
|
||||||
size.width += size.offset_x; size.width++;
|
size.width += size.offset_x+1;
|
||||||
IF(italic)
|
IF(italic)
|
||||||
{
|
{
|
||||||
size.w_italic = size.height/3;
|
size.w_italic = size.height/3;
|
||||||
|
@ -802,7 +802,7 @@ void ______INIT______()
|
|||||||
screen.height = GetScreenHeight();
|
screen.height = GetScreenHeight();
|
||||||
|
|
||||||
//program_path_length = strlen(I_Path);
|
//program_path_length = strlen(I_Path);
|
||||||
MOUSE_TIME = 50; //Default 500 ms.
|
DOUBLE_CLICK_DELAY = GetMouseDoubleClickDelay();
|
||||||
__generator = GetStartTime();
|
__generator = GetStartTime();
|
||||||
|
|
||||||
$push ebx
|
$push ebx
|
||||||
|
@ -22,11 +22,11 @@
|
|||||||
* up - key release events
|
* up - key release events
|
||||||
* move - event MOUSE movements
|
* move - event MOUSE movements
|
||||||
* click - when clicked
|
* click - when clicked
|
||||||
* dblclick - double-click the default 50 (500 ms)
|
* dblclick - double-click get system value
|
||||||
* drag - drag the element event
|
* drag - drag the element event
|
||||||
*/
|
*/
|
||||||
|
|
||||||
:dword __TMP_TIME,MOUSE_TIME;
|
:dword __TMP_TIME,DOUBLE_CLICK_DELAY;
|
||||||
:struct MOUSE
|
:struct MOUSE
|
||||||
{
|
{
|
||||||
signed x,y,xx,yy,lkm,mkm,pkm,key,tmp,tmp_time,hor,vert,down,up,move,click,dblclick,drag,left,top;
|
signed x,y,xx,yy,lkm,mkm,pkm,key,tmp,tmp_time,hor,vert,down,up,move,click,dblclick,drag,left,top;
|
||||||
@ -42,7 +42,7 @@
|
|||||||
} mouse;
|
} mouse;
|
||||||
:void MOUSE::clearTime()
|
:void MOUSE::clearTime()
|
||||||
{
|
{
|
||||||
tmp_time = GetStartTime()+MOUSE_TIME;
|
tmp_time = GetStartTime()+DOUBLE_CLICK_DELAY;
|
||||||
}
|
}
|
||||||
:void MOUSE::show()
|
:void MOUSE::show()
|
||||||
{
|
{
|
||||||
@ -149,7 +149,7 @@
|
|||||||
drag = false;
|
drag = false;
|
||||||
if(!move) click = true;
|
if(!move) click = true;
|
||||||
__TMP_TIME = GetStartTime();
|
__TMP_TIME = GetStartTime();
|
||||||
if(__TMP_TIME-tmp_time<=MOUSE_TIME)
|
if(__TMP_TIME-tmp_time<=DOUBLE_CLICK_DELAY)
|
||||||
{
|
{
|
||||||
dblclick = true;
|
dblclick = true;
|
||||||
click = false;
|
click = false;
|
||||||
@ -212,4 +212,54 @@
|
|||||||
pause(5);
|
pause(5);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*=====================================================================================
|
||||||
|
=========================== ===========================
|
||||||
|
=========================== SYSTEM ===========================
|
||||||
|
=========================== ===========================
|
||||||
|
=====================================================================================*/
|
||||||
|
|
||||||
|
|
||||||
|
inline fastcall int GetMouseSpeed() {
|
||||||
|
$mov eax,18
|
||||||
|
$mov ebx,19
|
||||||
|
$mov ecx,0
|
||||||
|
$int 0x40
|
||||||
|
}
|
||||||
|
|
||||||
|
inline fastcall void SetMouseSpeed(EDX) {
|
||||||
|
$mov eax,18
|
||||||
|
$mov ebx,19
|
||||||
|
$mov ecx,1
|
||||||
|
$int 0x40
|
||||||
|
}
|
||||||
|
|
||||||
|
inline fastcall int GetMouseAcceleration() {
|
||||||
|
$mov eax,18
|
||||||
|
$mov ebx,19
|
||||||
|
$mov ecx,2
|
||||||
|
$int 0x40
|
||||||
|
}
|
||||||
|
|
||||||
|
inline fastcall void SetMouseAcceleration(EDX) {
|
||||||
|
$mov eax,18
|
||||||
|
$mov ebx,19
|
||||||
|
$mov ecx,3
|
||||||
|
$int 0x40
|
||||||
|
}
|
||||||
|
|
||||||
|
inline fastcall int GetMouseDoubleClickDelay() {
|
||||||
|
$mov eax,18
|
||||||
|
$mov ebx,19
|
||||||
|
$mov ecx,6
|
||||||
|
$int 0x40
|
||||||
|
}
|
||||||
|
|
||||||
|
inline fastcall void SetMouseDoubleClickDelay(DL) {
|
||||||
|
$mov eax,18
|
||||||
|
$mov ebx,19
|
||||||
|
$mov ecx,7
|
||||||
|
$int 0x40
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
@ -1,42 +0,0 @@
|
|||||||
|
|
||||||
inline fastcall int GetMouseSpeed() {
|
|
||||||
$mov eax,18
|
|
||||||
$mov ebx,19
|
|
||||||
$mov ecx,0
|
|
||||||
$int 0x40
|
|
||||||
}
|
|
||||||
|
|
||||||
inline fastcall void SetMouseSpeed(EDX) {
|
|
||||||
$mov eax,18
|
|
||||||
$mov ebx,19
|
|
||||||
$mov ecx,1
|
|
||||||
$int 0x40
|
|
||||||
}
|
|
||||||
|
|
||||||
inline fastcall int GetMouseAcceleration() {
|
|
||||||
$mov eax,18
|
|
||||||
$mov ebx,19
|
|
||||||
$mov ecx,2
|
|
||||||
$int 0x40
|
|
||||||
}
|
|
||||||
|
|
||||||
inline fastcall void SetMouseAcceleration(EDX) {
|
|
||||||
$mov eax,18
|
|
||||||
$mov ebx,19
|
|
||||||
$mov ecx,3
|
|
||||||
$int 0x40
|
|
||||||
}
|
|
||||||
|
|
||||||
inline fastcall int GetMouseDoubleClickDelay() {
|
|
||||||
$mov eax,18
|
|
||||||
$mov ebx,19
|
|
||||||
$mov ecx,6
|
|
||||||
$int 0x40
|
|
||||||
}
|
|
||||||
|
|
||||||
inline fastcall void SetMouseDoubleClickDelay(DL) {
|
|
||||||
$mov eax,18
|
|
||||||
$mov ebx,19
|
|
||||||
$mov ecx,7
|
|
||||||
$int 0x40
|
|
||||||
}
|
|
@ -14,8 +14,6 @@
|
|||||||
#include "..\lib\obj\libini.h"
|
#include "..\lib\obj\libini.h"
|
||||||
#include "..\lib\patterns\restart_process.h"
|
#include "..\lib\patterns\restart_process.h"
|
||||||
|
|
||||||
#include "kos_mouse_functions.h"
|
|
||||||
|
|
||||||
#ifdef LANG_RUS
|
#ifdef LANG_RUS
|
||||||
?define WINDOW_TITLE "<EFBFBD>஢¥àª ¨ áâனª ¯ à ¬¥â஢ ¬ëè¨"
|
?define WINDOW_TITLE "<EFBFBD>஢¥àª ¨ áâனª ¯ à ¬¥â஢ ¬ëè¨"
|
||||||
?define CHECK_MOUSE_1 "<EFBFBD> ¦¬¨â¥ í⮩ ®¡« áâ¨"
|
?define CHECK_MOUSE_1 "<EFBFBD> ¦¬¨â¥ í⮩ ®¡« áâ¨"
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
#define DEFAULT_EDITOR "/sys/tinypad"
|
#define DEFAULT_EDITOR "/sys/tinypad"
|
||||||
|
|
||||||
#define INTRO_TEXT "This is a plain Text Reader.\nTry to open some text file."
|
#define INTRO_TEXT "This is a plain Text Reader.\nTry to open some text file."
|
||||||
#define VERSION "Text Reader v1.05"
|
#define VERSION "Text Reader v1.06"
|
||||||
#define ABOUT "Idea: Leency, punk_joker
|
#define ABOUT "Idea: Leency, punk_joker
|
||||||
Code: Leency, Veliant, KolibriOS Team
|
Code: Leency, Veliant, KolibriOS Team
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user