From 54f48f6d3f5a013ec647b5989fcb46f3db45dc44 Mon Sep 17 00:00:00 2001 From: cxl Date: Tue, 29 Nov 2016 14:53:51 +0000 Subject: [PATCH] CtrlLib: StatusBar minor fix git-svn-id: svn://ultimatepp.org/upp/trunk@10502 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/CtrlLib/StatusBar.cpp | 2 +- uppsrc/CtrlLib/StatusBar.h | 1 - uppsrc/CtrlLib/src.tpp/StatusBar$en-us.tpp | 16 +++++----------- 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/uppsrc/CtrlLib/StatusBar.cpp b/uppsrc/CtrlLib/StatusBar.cpp index eb4616ef1..1255a5501 100644 --- a/uppsrc/CtrlLib/StatusBar.cpp +++ b/uppsrc/CtrlLib/StatusBar.cpp @@ -289,7 +289,7 @@ void ProgressInfo::Refresh() if(!info) return; String txt = Format(~text, pos); info->Set(tabi, txt, tw ? tw : GetTextSize(txt, StdFont()).cx + 8); - info->Set(tabi + 1, PaintRect(ProgressDisplay(), 1000.0 * pos / total), cx); + info->Set(tabi + 1, PaintRect(ProgressDisplay(), 1000.0 * pos / (total ? total : 1000)), cx); } ProgressInfo& ProgressInfo::Set(int _pos, int _total) diff --git a/uppsrc/CtrlLib/StatusBar.h b/uppsrc/CtrlLib/StatusBar.h index 6e745a135..331a6f894 100644 --- a/uppsrc/CtrlLib/StatusBar.h +++ b/uppsrc/CtrlLib/StatusBar.h @@ -4,7 +4,6 @@ public: virtual void FrameLayout(Rect& r); private: - struct Tab { PaintRect info; int width; diff --git a/uppsrc/CtrlLib/src.tpp/StatusBar$en-us.tpp b/uppsrc/CtrlLib/src.tpp/StatusBar$en-us.tpp index 85fbca243..d8dcad622 100644 --- a/uppsrc/CtrlLib/src.tpp/StatusBar$en-us.tpp +++ b/uppsrc/CtrlLib/src.tpp/StatusBar$en-us.tpp @@ -19,9 +19,7 @@ rameLR][@(0.0.255)3 <][_^Ctrl^3 Ctrl][@(0.0.255)3 >][3 _]&] [s0; &] [s2; @@image:643&143 -瀗͉Ǩ⼮􇊞Ҫ벣 -̸Іȹ𹀥ȳㄭھ豵䝾Іٶ -ӎҟ鴗ݕ㇍Ч𴏒Ꜷح +(A2cAFwAAAOn/AAAAAHic7dXNCYAwDAVgJ3YPR3ADD+I8riB0hwoeBJO2pjZtI7zwDhJKfz6pumN3CNIq6zIj6XjvOVr3F2c8QAMa0MwGaDXQhqtIhw8gzcLwOSUdI2h8S3znicGfxcizpGMELbaZ2mixteSdvmjBK9AGLXj1LIi9oklwYrZadNbEVNCqHuGe046YIpriEdKf/e5iaTSX8+vX3RVZZXhWsGMHDQEa0ID2r3A0jxIUuEpqnDYkNye2qVgt) &] [s0; &] [s9; InfoCtrl is a simple static Ctrl that represents information @@ -53,7 +51,8 @@ t]_[*@3 tab], [@(0.0.255) const]_[_^Value^ Value][@(0.0.255) `&]_[*@3 info], [s2; Sets (creates if needed) the section of the InfoCtrl.&] [s7; [%-*C@3 tab]-|Index of section.&] [s7; [%-*C@3 info]-|Content of section. Value content is converted to -the text using AsString.&] +the text using AsString, unless it is Image, which is displayed +as is.&] [s7; [%-*C@3 width]-|Width of section in pixels. Negative value indicates that section should be placed given number of pixels from the right border of the InfoCtrl.&] @@ -126,12 +125,7 @@ nfoCtrl]&] [s0; &] [s2; @@image:1268&131 -ˀ홽à왫ѫئ⎤Αɢ󓀰؟ۆ߀ -°阊ంݣȮϐҨߋ -キŬƑ願兦䡏Ⱥ妸䪫 -΂ɇɬۓĘߩǭ̲хϮ諰ž -ϫ漏Ă󤂹츆ᶤݐߦփ썶쐸մ -̥̥ޕكȊưǜ +(A8sAFQAAAOv/AAAAAHic7Zk9jsMgEEZ9/xtsGaXZYstEylG22CbpVuIOThHJIgzzEzAMWB96RWRbBr48YJSE/98AQBvWdXUfw1D8fH8BmY+cgWBUMPcxDA4EqwGCqUCwGiCYCgSrAYKpuAu2LIt7CMVAMJUawZaoFQ/gMIJlo0iu1MdlyZD20qhfC5WCcXMsDmcuNsGyUdDvvcWsqUvJ50b9GmkhmGUFJbufbwjFZI9IOiM5rnq4t8lj6INFsNvlfLuc6MPqsuUmONoqK4YKFueQLKvOgsmHdTesgl3zgslbE5e2YOZEdgUimNdRZd+pxtzBtse4Hcyya6lRzy6YWnF1E0x4+bCCZR82HpH2qOeyKzBFvj2Hvfh0gfeEE2yru4KtBgvvjgnnJnfFZfqVxIIJc6Q57DgGIVhhJN2QBLueXne5GmxfprMr4IdWA4Iz8a1sDbYvEOyQuP9VNDUQTCV2Jlt3Bb4GAxBMJRXsve7qWYPNyIpmaMYwH/c/75GiHb89Ac30xxw=) &] [s0; &] [s9; StatusBar is a Frame Ctrl intended to be used as informational @@ -291,4 +285,4 @@ by Total method.&] [s5;:ProgressInfo`:`:operator int`(`):%- [* operator_int]()&] [s7; [*/ Return value]-|Get().&] [s3; &] -[s0; ] \ No newline at end of file +[s0; ]] \ No newline at end of file