From 1677400b53bd143fefea9a96aac40eb68b5d9ef7 Mon Sep 17 00:00:00 2001 From: "Kirill Lipatov (Leency)" Date: Sat, 29 Aug 2015 12:10:11 +0000 Subject: [PATCH] font.h: fix cyrillic "yo" letter, llist.h: remove MouseScrollNoSelection(), move simple_open_dialog.h to /lib/patternts/ directory git-svn-id: svn://kolibrios.org@5778 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/cmm/Calypte/Calypte.c | 2 +- programs/cmm/lib/font.h | 4 ++++ programs/cmm/lib/list_box.h | 18 ------------------ .../patterns}/simple_open_dialog.h | 3 ++- programs/cmm/ttf_viewer/ttf_viewer.c | 12 ++++++------ 5 files changed, 13 insertions(+), 26 deletions(-) rename programs/cmm/{ttf_viewer => lib/patterns}/simple_open_dialog.h (69%) diff --git a/programs/cmm/Calypte/Calypte.c b/programs/cmm/Calypte/Calypte.c index ac69c2317b..54445cfcc8 100644 --- a/programs/cmm/Calypte/Calypte.c +++ b/programs/cmm/Calypte/Calypte.c @@ -138,7 +138,7 @@ void main() { case evMouse: mouse.get(); - if (tview.MouseScrollNoSelection(mouse.vert)) DrawText(); + if (tview.MouseScroll(mouse.vert)) DrawText(); menu_bar_mouse stdcall (#menudata1); if (menudata1.click) diff --git a/programs/cmm/lib/font.h b/programs/cmm/lib/font.h index d9fc3c969b..70cef05cbf 100644 --- a/programs/cmm/lib/font.h +++ b/programs/cmm/lib/font.h @@ -158,6 +158,8 @@ FONT font = 0; IF(!encoding){ IF(s>=128)&&(s<=175)s+=64; ELSE IF(s>=224)&&(s<=239)s+=16; + ELSE IF(s==241)s=184; //yo + ELSE IF(s==240)s=168; //YO } yi = 0; iii = 0; @@ -294,6 +296,8 @@ inline fastcall dword b24(EBX) { return DSDWORD[EBX] << 8; } { IF(s>=128)&&(s<=175)s+=64; ELSE IF(s>=224)&&(s<=239)s+=16; + ELSE IF(s==241)s=184; //yo + ELSE IF(s==240)s=168; //YO } yi = 0; iii = 0; diff --git a/programs/cmm/lib/list_box.h b/programs/cmm/lib/list_box.h index 7ea6d61ec1..a6df644877 100644 --- a/programs/cmm/lib/list_box.h +++ b/programs/cmm/lib/list_box.h @@ -28,7 +28,6 @@ struct llist void SetSizes(int xx, yy, ww, hh, line_hh); void SetFont(dword font_ww, font_hh, font_tt); int MouseScroll(dword scroll_state); - int MouseScrollNoSelection(dword scroll_state); void debug_values(); }; @@ -88,23 +87,6 @@ int llist::MouseScroll(dword scroll_state) return 0; } -int llist::MouseScrollNoSelection(dword scroll_state) -{ - if (count<=visible) return 0; - if (scroll_state == 65535) - { - if (current == 0) return 0; - if (current > 3) current -= 2; else current=0; - return 1; - } - if (scroll_state == 1) - { - if (visible + current == count) return 0; - if (visible+current+3 > count) current = count - visible; else current+=2; - return 1; - } - return 0; -} int llist::MouseOver(int xx, yy) { diff --git a/programs/cmm/ttf_viewer/simple_open_dialog.h b/programs/cmm/lib/patterns/simple_open_dialog.h similarity index 69% rename from programs/cmm/ttf_viewer/simple_open_dialog.h rename to programs/cmm/lib/patterns/simple_open_dialog.h index 2956914beb..1a6a9fc448 100644 --- a/programs/cmm/ttf_viewer/simple_open_dialog.h +++ b/programs/cmm/lib/patterns/simple_open_dialog.h @@ -11,4 +11,5 @@ char open_dialog_path[] = "/rd/1/File managers/opendial"; //opendial byte openfile_path[2048]; byte filename_area[4096]; -opendialog o_dialog = {0, #pr_inf, #communication_area_name, 0, #plugin_path, #default_dir, #open_dialog_path, #draw_window, 0, #openfile_path, #filename_area, #filter2, 420, 200, 320, 120}; +opendialog o_dialog = {0, #pr_inf, #communication_area_name, 0, #plugin_path, #default_dir, #open_dialog_path, + #draw_window, 0, #openfile_path, #filename_area, #filter2, 420, 200, 320, 120}; diff --git a/programs/cmm/ttf_viewer/ttf_viewer.c b/programs/cmm/ttf_viewer/ttf_viewer.c index 426d945c31..84a91bc6e4 100644 --- a/programs/cmm/ttf_viewer/ttf_viewer.c +++ b/programs/cmm/ttf_viewer/ttf_viewer.c @@ -9,8 +9,8 @@ #include "..\lib\gui.h" #include "..\lib\obj\truetype.h" #include "..\lib\obj\proc_lib.h" +#include "..\lib\patterns\simple_open_dialog.h" -#include "simple_open_dialog.h" char default_dir[] = "/rd/1"; od_filter filter2 = {"TTF",0}; @@ -48,11 +48,11 @@ void main() case evButton: id=GetButtonID(); if (id==1) ExitProcess(); - if (id==10) - { - OpenDialog_start stdcall (#o_dialog); - OpenFont(#openfile_path); - } + if (id==10) + { + OpenDialog_start stdcall (#o_dialog); + OpenFont(#openfile_path); + } break; case evKey: