From a235aa0eb1694a1a06b1e21f5149e279b269cef9 Mon Sep 17 00:00:00 2001 From: mattias Date: Thu, 19 Feb 2015 10:33:32 +0000 Subject: [PATCH] LCL: TTreeView: mousedown: fixed select on click on state icon git-svn-id: branches/fixes_1_4@47896 - --- components/lazutils/lazutf8.pas | 2 +- components/lazutils/winlazutf8.inc | 30 +++++++++++++++++++++++++++++- lcl/include/treeview.inc | 2 +- 3 files changed, 31 insertions(+), 3 deletions(-) diff --git a/components/lazutils/lazutf8.pas b/components/lazutils/lazutf8.pas index e350c58001..51c379dab3 100644 --- a/components/lazutils/lazutf8.pas +++ b/components/lazutils/lazutf8.pas @@ -19,7 +19,7 @@ unit LazUTF8; {$mode objfpc}{$H+}{$inline on} {$IF defined(EnableUTF8RTL) and (FPC_FULLVERSION<20701)} - {$error UTF8 RTl requires fpc 2.7.1+} + {$error UTF8 in RTL requires fpc 2.7.1+} {$ENDIF} interface diff --git a/components/lazutils/winlazutf8.inc b/components/lazutils/winlazutf8.inc index d66572abfa..e32960c094 100644 --- a/components/lazutils/winlazutf8.inc +++ b/components/lazutils/winlazutf8.inc @@ -354,8 +354,36 @@ begin if (GetLocaleInfoA(aLocaleID, aLCType, Buf, sizeof(buf)) > 0) and (ord(Buf[0])<128) then Result := Buf[0] - else + else begin Result := Def; + case Buf[0] of + #$C2: + case Buf[1] of + #$A0: Result:=' '; // non breakable space + #$B7: Result:='.'; // middle stop + end; + #$CB: + if Buf[1]=#$99 then Result:=''''; // dot above, italian handwriting + #$D9: + case Buf[1] of + #$AB: Result:=','; // arabic decimal separator, persian thousand separator + #$AC: Result:=''''; // arabic thousand separator + end; + #$E2: + case Buf[1] of + #$80: + case Buf[2] of + #$82, // long space + #$83, // long space + #$89, // thin space + #$AF: // narrow non breakable space + Result := ' '; + #$94: Result := '-'; // persian decimal mark + end; + #$8E: if Buf[2]=#$96 then Result := ''''; // codepoint 9110 decimal separator + end; + end; + end; end; procedure GetFormatSettingsUTF8(LCID: Integer; var aFormatSettings: TFormatSettings); diff --git a/lcl/include/treeview.inc b/lcl/include/treeview.inc index 45c4d20901..82b4941838 100644 --- a/lcl/include/treeview.inc +++ b/lcl/include/treeview.inc @@ -5194,7 +5194,7 @@ begin // mousedown occured on expand sign -> expand/collapse CursorNode.Expanded:=not CursorNode.Expanded; end - else if LogicalX >= CursorNode.DisplayIconLeft then + else if LogicalX >= CursorNode.DisplayStateIconLeft then begin // mousedown occured in text or icon // -> select node and begin drag operation