Rev 7818 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 7818 | Rev 7872 | ||
---|---|---|---|
Line 310... | Line 310... | ||
310 | 310 | ||
311 | void EventShowCharsetsList() |
311 | void EventShowCharsetsList() |
312 | { |
312 | { |
313 | menu_id = CHANGE_CHARSET; |
313 | menu_id = CHANGE_CHARSET; |
314 | open_lmenu(Form.left+5 + charsets_mx, Form.top+29+skin_height, MENU_ALIGN_TOP_LEFT, |
314 | open_lmenu(Form.left+5 + charsets_mx, Form.top+29+skin_height, MENU_ALIGN_TOP_LEFT, |
315 | encoding+1, "UTF-8\nKOI8-RU\nCP1251\nCP1252\nISO8859-5\nCP866"); |
315 | encoding+1, "UTF-8\nKOI8-RU\nCP1251\nCP1252\nISO8859-5\nCP866\nAUTO"); |
Line 316... | Line 316... | ||
316 | } |
316 | } |
317 | 317 | ||
318 | void EventShowReopenMenu() |
318 | void EventShowReopenMenu() |
Line 340... | Line 340... | ||
340 | 340 | ||
341 | void EventShowInfo() { |
341 | void EventShowInfo() { |
342 | help_opened = true; |
342 | help_opened = true; |
343 | DrawBar(list.x, list.y, list.w, list.h, bg_color); |
343 | DrawBar(list.x, list.y, list.w, list.h, bg_color); |
344 | WriteText(list.x + 10, list.y + 10, 10000001b, text_color, VERSION); |
344 | WriteText(list.x + 10, list.y + 10, 10000001b, text_color, VERSION); |
345 | WriteTextLines(list.x + 10, list.y+40, 10110000b, text_color, ABOUT, 20); |
345 | WriteTextLines(list.x + 10, list.y+40, 10010000b, text_color, ABOUT, 20); |
Line 346... | Line 346... | ||
346 | } |
346 | } |
347 | 347 | ||
348 | void EventChangeCharset(dword id) |
348 | void EventChangeCharset(dword id) |
Line 415... | Line 415... | ||
415 | NO_DATA: |
415 | NO_DATA: |
416 | if (list.count) return; |
416 | if (list.count) return; |
417 | io.buffer_data = INTRO_TEXT; |
417 | io.buffer_data = INTRO_TEXT; |
418 | strcpy(#title, "Text Reader"); |
418 | strcpy(#title, "Text Reader"); |
419 | } |
419 | } |
- | 420 | ||
- | 421 | // Autodetecting encoding |
|
- | 422 | if (encoding==CH_AUTO) { |
|
- | 423 | if (strstr(io.buffer_data, "\208\190")) ChangeCharset(CH_UTF8, "CP866", io.buffer_data); |
|
- | 424 | else if (chrnum(io.buffer_data, '\246')>5) || (strstr(io.buffer_data, "ïð")) ChangeCharset(CH_CP1251, "CP866", io.buffer_data); |
|
- | 425 | } else { |
|
420 | if (encoding!=CH_CP866) ChangeCharset(encoding, "CP866", io.buffer_data); |
426 | if (encoding!=CH_CP866) ChangeCharset(encoding, "CP866", io.buffer_data); |
- | 427 | } |
|
- | 428 | ||
421 | list.ClearList(); |
429 | list.ClearList(); |
422 | } |
430 | } |
Line 423... | Line 431... | ||
423 | 431 | ||
424 | int DrawToolbarButton(char image_id, int x) |
432 | int DrawToolbarButton(char image_id, int x) |
Line 466... | Line 474... | ||
466 | 474 | ||
467 | x.n = Form.cwidth - 34; |
475 | x.n = Form.cwidth - 34; |
468 | DrawToolbarButton(SHOW_INFO, x.n); |
476 | DrawToolbarButton(SHOW_INFO, x.n); |
Line 469... | Line 477... | ||
469 | colscheme_mx = DrawToolbarButton(COLOR_SCHEME, x.inc(-TOOLBAR_BUTTON_WIDTH - BUTTONS_GAP)); |
477 | colscheme_mx = DrawToolbarButton(COLOR_SCHEME, x.inc(-TOOLBAR_BUTTON_WIDTH - BUTTONS_GAP)); |
470 | 478 | ||
471 | if (search.draw(BTN_FIND_NEXT+10, BTN_FIND_CLOSE+10)) { |
479 | if (search.draw(BTN_FIND_NEXT+10, BTN_FIND_CLOSE+10, Form.cheight - SEARCH_H)) { |
472 | DrawRectangle3D(search_mx+1, 6, TOOLBAR_ICON_WIDTH-1, |
480 | DrawRectangle3D(search_mx+1, 6, TOOLBAR_ICON_WIDTH-1, |
Line 473... | Line 481... | ||
473 | TOOLBAR_ICON_HEIGHT-1, 0xCCCccc, 0xF8FCF8); |
481 | TOOLBAR_ICON_HEIGHT-1, 0xCCCccc, 0xF8FCF8); |