Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 7871 → Rev 7872

/programs/cmm/lib/obj/iconv.h
16,8 → 16,8
char aIconv_open[] = "iconv_open";
char aIconv[] = "iconv";
 
char charsets[] = "UTF-8\0 KOI8-RU\0 CP1251\0 CP1252\0 ISO8859-5\0CP866";
enum { CH_UTF8, CH_KOI8, CH_CP1251, CH_CP1252, CH_ISO8859_5, CH_CP866, CH_NULL };
char charsets[] = "UTF-8\0 KOI8-RU\0 CP1251\0 CP1252\0 ISO8859-5\0CP866 \0AUTO";
enum { CH_UTF8, CH_KOI8, CH_CP1251, CH_CP1252, CH_ISO8859_5, CH_CP866, CH_AUTO };
 
dword ChangeCharset(dword from_chs, to_chs, conv_buf)
{
/programs/cmm/txtread/data.h
7,7 → 7,7
#ifdef LANG_RUS
 
#define INTRO_TEXT "â® ¯à®á⮩ ¯à®á¬®âà騪 ⥪áâ .\n®¯à®¡ã©â¥ ®âªàëâì ª ª®©-­¨¡ã¤ì ⥪áâ®¢ë© ä ©«."
#define VERSION "Text Reader v1.4"
#define VERSION "Text Reader v1.41"
#define ABOUT "ˆ¤¥ï: Leency, punk_joker
Š®¤: Leency, Veliant, KolibriOS Team
 
38,7 → 38,7
#else
 
#define INTRO_TEXT "This is a plain Text Reader.\nTry to open some text file."
#define VERSION "Text Reader v1.4"
#define VERSION "Text Reader v1.41"
#define ABOUT "Idea: Leency, punk_joker
Code: Leency, Veliant, KolibriOS Team
 
/programs/cmm/txtread/ini.h
3,7 → 3,7
void LoadIniSettings()
{
kfont.size.pt = ini.GetInt("FontSize", 14);
encoding = ini.GetInt("Encoding", CH_CP866);
encoding = ini.GetInt("Encoding", CH_AUTO);
curcol_scheme = ini.GetInt("ColorScheme", 2);
Form.left = ini.GetInt("WinX", 150);
Form.top = ini.GetInt("WinY", 50);
/programs/cmm/txtread/search.h
68,19 → 68,20
 
void SEARCH::draw_found()
{
strcpy(#param, "Matches: ");
strcat(#param, itoa(found_count));
strcat(#param, " ");
WriteTextWithBg(search_box.left+search_box.width+14+110, search_box.top+3, 0xD0, sc.work_text, #param, sc.work);
char matches[30];
strcpy(#matches, "Matches: ");
strcat(#matches, itoa(found_count));
strcat(#matches, " ");
WriteTextWithBg(search_box.left+search_box.width+14+110, search_box.top+3, 0xD0, sc.work_text, #matches, sc.work);
}
 
bool SEARCH::draw(dword _btn_find, _btn_hide)
bool SEARCH::draw(dword _btn_find, _btn_hide, _y)
{
if (!visible) return false;
DrawBar(0,Form.cheight - SEARCH_H, Form.cwidth, 1, sc.work_graph);
DrawBar(0,Form.cheight - SEARCH_H+1, Form.cwidth, SEARCH_H-1, sc.work);
DrawBar(0, _y, Form.cwidth, 1, sc.work_graph);
DrawBar(0, _y+1, Form.cwidth, SEARCH_H-1, sc.work);
 
search_box.top = Form.cheight - SEARCH_H + 6;
search_box.top = _y + 6;
search_box.width = math.min(Form.width - 200, 250);
 
DrawRectangle(search_box.left-1, search_box.top-1, search_box.width+2, 23,sc.work_graph);
144,10 → 145,10
}
}
 
void draw_bar(dword _x, _y, _w, _h, _color)
:void draw_bar(dword _x, _y, _w, _h, _color)
{
int i;
for (i = _y*list.w+_x*KFONT_BPP+kfont.raw ; i<_y*list.w+_x+_w*KFONT_BPP+kfont.raw ; i+=KFONT_BPP)
for (i = _y*list.w+_x*4+kfont.raw ; i<_y*list.w+_x+_w*4+kfont.raw ; i+=4)
{
ESDWORD[i] = _color;
}
/programs/cmm/txtread/txtread.c
312,7 → 312,7
{
menu_id = CHANGE_CHARSET;
open_lmenu(Form.left+5 + charsets_mx, Form.top+29+skin_height, MENU_ALIGN_TOP_LEFT,
encoding+1, "UTF-8\nKOI8-RU\nCP1251\nCP1252\nISO8859-5\nCP866");
encoding+1, "UTF-8\nKOI8-RU\nCP1251\nCP1252\nISO8859-5\nCP866\nAUTO");
}
 
void EventShowReopenMenu()
342,7 → 342,7
help_opened = true;
DrawBar(list.x, list.y, list.w, list.h, bg_color);
WriteText(list.x + 10, list.y + 10, 10000001b, text_color, VERSION);
WriteTextLines(list.x + 10, list.y+40, 10110000b, text_color, ABOUT, 20);
WriteTextLines(list.x + 10, list.y+40, 10010000b, text_color, ABOUT, 20);
}
 
void EventChangeCharset(dword id)
417,7 → 417,15
io.buffer_data = INTRO_TEXT;
strcpy(#title, "Text Reader");
}
 
// Autodetecting encoding
if (encoding==CH_AUTO) {
if (strstr(io.buffer_data, "\208\190")) ChangeCharset(CH_UTF8, "CP866", io.buffer_data);
else if (chrnum(io.buffer_data, '\246')>5) || (strstr(io.buffer_data, "ïð")) ChangeCharset(CH_CP1251, "CP866", io.buffer_data);
} else {
if (encoding!=CH_CP866) ChangeCharset(encoding, "CP866", io.buffer_data);
}
 
list.ClearList();
}
 
468,7 → 476,7
DrawToolbarButton(SHOW_INFO, x.n);
colscheme_mx = DrawToolbarButton(COLOR_SCHEME, x.inc(-TOOLBAR_BUTTON_WIDTH - BUTTONS_GAP));
 
if (search.draw(BTN_FIND_NEXT+10, BTN_FIND_CLOSE+10)) {
if (search.draw(BTN_FIND_NEXT+10, BTN_FIND_CLOSE+10, Form.cheight - SEARCH_H)) {
DrawRectangle3D(search_mx+1, 6, TOOLBAR_ICON_WIDTH-1,
TOOLBAR_ICON_HEIGHT-1, 0xCCCccc, 0xF8FCF8);
}
/programs/system/eskin/trunk/eskin.asm