Skip to content
This repository has been archived by the owner on Jun 18, 2023. It is now read-only.

Commit

Permalink
2014-09-17 简单修正中文字符长度问题(不是很完美,但一般况下没有什么问题).
Browse files Browse the repository at this point in the history
  • Loading branch information
chenall committed Sep 17, 2014
1 parent 349d747 commit d4a8b75
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
3 changes: 3 additions & 0 deletions doc/update.log
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
### [v1.2.0.68](https://github.com/chenall/ALMRun/archive/v1.2.0.68_BIN.zip)
2014-09-17 简单修正中文字符长度问题(不是很完美,但一般况下没有什么问题).

### [v1.2.0.67](https://github.com/chenall/ALMRun/archive/v1.2.0.67_BIN.zip)
一些代码调整,整合ojeo的代码,增加两个新的插件命令EV和doc.

Expand Down
4 changes: 2 additions & 2 deletions src/ALMRunVersion.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#ifndef _ALMRUN_VERSION_H_
#define _ALMRUN_VERSION_H_
#define VERSION_INT 1,2,0,67
#define VERSION_STR "1,2,0,67"
#define VERSION_INT 1,2,0,68
#define VERSION_STR "1,2,0,68"
#define VERSION_DATE "2014/09/16"
#endif
18 changes: 17 additions & 1 deletion src/MerryListBoxPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,23 @@ void MerryListBoxPanel::DrawBackground(MerryPaintDC& dc) const

wxString printfmt(long n,const wxString &str)
{
return wxString::Format("%*.*s",n,abs(n),str);
size_t max = abs(n);
size_t str_len = str.size();
size_t len = 0,i = 0;
for(len = 0;i < max && len<str_len;++len)
{
if (str[len].IsAscii())
++i;
else
i += 2;
}

if (i>len)
{
i -= len;
n -= (n > 0)?i:-i;
}
return wxString::Format("%*.*s",n,len,str);
}

void MerryListBoxPanel::DrawItem(MerryPaintDC& dc,size_t item)
Expand Down

0 comments on commit d4a8b75

Please sign in to comment.