[utf8vcl-cvs] utf8vcl MissingMethods-incomplete.txt, 1.6, 1.7 MissingWindowMessages-incomplete.txt,
Status: Alpha
Brought to you by:
bluelive
From: Bart v. d. W. <blu...@us...> - 2007-03-18 22:48:55
|
Update of /cvsroot/utf8vcl/utf8vcl In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv6309 Modified Files: MissingMethods-incomplete.txt MissingWindowMessages-incomplete.txt TestForm.dfm TestForm.pas UTF8VCL.pas UTF8VCLMessages.pas UTF8VCLUtils.pas Log Message: Fix problem with bogus character after some components. Further extend functionality. Add a few more test components. Basicly we support pretty much all of the first two tabs of the components. Index: UTF8VCLUtils.pas =================================================================== RCS file: /cvsroot/utf8vcl/utf8vcl/UTF8VCLUtils.pas,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** UTF8VCLUtils.pas 18 Mar 2007 11:26:41 -0000 1.13 --- UTF8VCLUtils.pas 18 Mar 2007 21:47:34 -0000 1.14 *************** *** 237,240 **** --- 237,242 ---- function ConvertFromUTF8(lpUTF8: PUtf8Char; LenIn: Integer; var LenOut: Integer): PWideChar; + var + Len: Integer; begin Result := nil; *************** *** 245,252 **** if LenOut = 0 then RaiseLastOSError; ! GetMem(Result, SizeOf(WideChar) * (LenOut + 1)); ! Result[LenOut] := #0; ! if MultiByteToWideChar(CP_UTF8, 0, lpUTF8, LenIn, Result, LenOut + 1) = 0 then RaiseLastOSError; end; --- 247,259 ---- if LenOut = 0 then RaiseLastOSError; ! Len := LenOut; ! if lpUTF8[LenIn-1] <> #0 then ! Inc(Len); ! GetMem(Result, SizeOf(WideChar) * (Len)); ! Result[Len-1] := #0; ! if MultiByteToWideChar(CP_UTF8, 0, lpUTF8, LenIn, Result, Len) = 0 then RaiseLastOSError; + if Result[LenOut-1] = #0 then + Dec(LenOut); end; *************** *** 256,259 **** --- 263,268 ---- if not Assigned(lpUTF8) or (LenIn = 0) then Exit; + if lpUTF8[LenIn-1] = #0 then + Dec(LenIn); Result := MultiByteToWideChar(CP_UTF8, 0, lpUTF8, LenIn, nil, 0); if Result = 0 then *************** *** 268,276 **** if not Assigned(lpUTF8) then Exit; ! L := lstrlenA(lpUTF8); Result := ConvertFromUTF8(lpUTF8, L, R); end; function ConvertToUTF8(lpWide: PWideChar; LenIn: Integer; var LenOut: Integer): PUtf8Char; begin Result := nil; --- 277,287 ---- if not Assigned(lpUTF8) then Exit; ! L := lstrlenA(lpUTF8) + 1; Result := ConvertFromUTF8(lpUTF8, L, R); end; function ConvertToUTF8(lpWide: PWideChar; LenIn: Integer; var LenOut: Integer): PUtf8Char; + var + Len: Integer; begin Result := nil; *************** *** 283,290 **** if LenOut = 0 then RaiseLastOSError; ! GetMem(Result, SizeOf(Utf8Byte) * (LenOut + 1)); ! Result[LenOut] := #0; ! if WideCharToMultiByte(CP_UTF8, 0, lpWide, LenIn, Result, LenOut, nil, nil) = 0 then RaiseLastOSError; end; --- 294,306 ---- if LenOut = 0 then RaiseLastOSError; ! Len := LenOut; ! if lpWide[LenIn-1] <> #0 then ! Inc(Len); ! GetMem(Result, SizeOf(Utf8Byte) * (Len)); ! Result[Len-1] := #0; ! if WideCharToMultiByte(CP_UTF8, 0, lpWide, LenIn, Result, Len, nil, nil) = 0 then RaiseLastOSError; + if Result[LenOut-1] = #0 then + Dec(LenOut); end; *************** *** 294,297 **** --- 310,316 ---- if not Assigned(lpWide) or (LenIn = 0) then Exit; + if lpWide[LenIn-1] = #0 then + Dec(LenIn); + Result := WideCharToMultiByte(CP_UTF8, 0, lpWide, LenIn, nil, 0, nil, nil); if Result = 0 then *************** *** 306,310 **** if not Assigned(lpWide) then Exit; ! L := lstrlenW(lpWide); Result := ConvertToUTF8(lpWide, L, R); end; --- 325,329 ---- if not Assigned(lpWide) then Exit; ! L := lstrlenW(lpWide) + 1; Result := ConvertToUTF8(lpWide, L, R); end; Index: MissingMethods-incomplete.txt =================================================================== RCS file: /cvsroot/utf8vcl/utf8vcl/MissingMethods-incomplete.txt,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** MissingMethods-incomplete.txt 16 Mar 2007 23:39:11 -0000 1.6 --- MissingMethods-incomplete.txt 18 Mar 2007 21:47:34 -0000 1.7 *************** *** 1,5 **** - Special methods that need patching: - Controls.TWinControl.DoKeyPress - --- 1,2 ---- *************** *** 10,14 **** DispatchMessageA - GetACP CharNextA CharToOemA --- 7,10 ---- Index: UTF8VCL.pas =================================================================== RCS file: /cvsroot/utf8vcl/utf8vcl/UTF8VCL.pas,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** UTF8VCL.pas 18 Mar 2007 16:28:10 -0000 1.20 --- UTF8VCL.pas 18 Mar 2007 21:47:34 -0000 1.21 *************** *** 308,312 **** --- 308,314 ---- begin if (Cardinal(lpClassName) and $FFFF0000) <> 0 then + begin C := ConvertFromUTF8(lpClassName) + end else // This isn't a string but a special id *************** *** 394,401 **** X: PUtf8Char; begin - X := nil; L := nMaxCount; if nMaxCount > 0 then begin GetMem(C, SizeOf(WideChar) * L); try --- 396,403 ---- X: PUtf8Char; begin L := nMaxCount; if nMaxCount > 0 then begin + X := nil; GetMem(C, SizeOf(WideChar) * L); try *************** *** 626,629 **** --- 628,637 ---- end; + function GetACPIntercept: UINT; stdcall; + begin + Result := CP_UTF8; + end; + + var LibUser32: HMODULE = 0; *************** *** 680,683 **** --- 688,693 ---- HookKernel32Func('MultiByteToWideChar', @MultiByteToWideCharIntercept); // do not localize HookKernel32Func('WideCharToMultiByte', @WideCharToMultiByteIntercept); // do not localize + HookKernel32Func('GetACP', @GetACPIntercept); // do not localize + HookUser32Func('SendMessageA', @SendMessageAIntercept); // do not localize Index: UTF8VCLMessages.pas =================================================================== RCS file: /cvsroot/utf8vcl/utf8vcl/UTF8VCLMessages.pas,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** UTF8VCLMessages.pas 18 Mar 2007 07:56:10 -0000 1.20 --- UTF8VCLMessages.pas 18 Mar 2007 21:47:34 -0000 1.21 *************** *** 89,94 **** end; WM_SETTEXT, WM_WININICHANGE, WM_DEVMODECHANGE, CB_DIR, LB_DIR, LB_ADDFILE, ! EM_REPLACESEL, LB_ADDSTRING, LB_INSERTSTRING, CB_ADDSTRING, CB_INSERTSTRING, LB_FINDSTRING, ! CB_FINDSTRING: OutLParam := LPARAM(ConvertToUTF8(PWideChar(InLParam))); // character fiddling, TODO --- 89,95 ---- end; WM_SETTEXT, WM_WININICHANGE, WM_DEVMODECHANGE, CB_DIR, LB_DIR, LB_ADDFILE, ! EM_REPLACESEL, LB_ADDSTRING, LB_INSERTSTRING, CB_ADDSTRING, CB_INSERTSTRING, ! LB_FINDSTRING, LB_FINDSTRINGEXACT, LB_SELECTSTRING, CB_FINDSTRING, ! CB_FINDSTRINGEXACT: OutLParam := LPARAM(ConvertToUTF8(PWideChar(InLParam))); // character fiddling, TODO *************** *** 143,148 **** end; WM_SETTEXT, WM_WININICHANGE, WM_DEVMODECHANGE, CB_DIR, LB_DIR, LB_ADDFILE, ! EM_REPLACESEL, LB_ADDSTRING, LB_INSERTSTRING, CB_ADDSTRING, CB_INSERTSTRING, LB_FINDSTRING, ! CB_FINDSTRING: FreeMem(PChar(TempLParam)); --- 144,149 ---- end; WM_SETTEXT, WM_WININICHANGE, WM_DEVMODECHANGE, CB_DIR, LB_DIR, LB_ADDFILE, ! EM_REPLACESEL, LB_ADDSTRING, LB_INSERTSTRING, CB_ADDSTRING, CB_INSERTSTRING, LB_FINDSTRING, LB_FINDSTRINGEXACT, LB_SELECTSTRING, ! CB_FINDSTRING, CB_FINDSTRINGEXACT: FreeMem(PChar(TempLParam)); *************** *** 250,255 **** end; WM_SETTEXT, WM_WININICHANGE, WM_DEVMODECHANGE, CB_DIR, LB_DIR, LB_ADDFILE, ! EM_REPLACESEL, LB_ADDSTRING, LB_INSERTSTRING, CB_ADDSTRING, CB_INSERTSTRING, LB_FINDSTRING, ! CB_FINDSTRING: OutLParam := LPARAM(ConvertFromUTF8(PChar(InLParam))); //character fiddling, TODO --- 251,256 ---- end; WM_SETTEXT, WM_WININICHANGE, WM_DEVMODECHANGE, CB_DIR, LB_DIR, LB_ADDFILE, ! EM_REPLACESEL, LB_ADDSTRING, LB_INSERTSTRING, CB_ADDSTRING, CB_INSERTSTRING, LB_FINDSTRING, LB_FINDSTRINGEXACT, LB_SELECTSTRING, ! CB_FINDSTRING, CB_FINDSTRINGEXACT: OutLParam := LPARAM(ConvertFromUTF8(PChar(InLParam))); //character fiddling, TODO *************** *** 303,308 **** end; WM_SETTEXT, WM_WININICHANGE, WM_DEVMODECHANGE, CB_DIR, LB_DIR, LB_ADDFILE, ! EM_REPLACESEL, LB_ADDSTRING, LB_INSERTSTRING, CB_ADDSTRING, CB_INSERTSTRING, LB_FINDSTRING, ! CB_FINDSTRING: FreeMem(PWideChar(TempLParam)); WM_GETTEXTLENGTH: --- 304,309 ---- end; WM_SETTEXT, WM_WININICHANGE, WM_DEVMODECHANGE, CB_DIR, LB_DIR, LB_ADDFILE, ! EM_REPLACESEL, LB_ADDSTRING, LB_INSERTSTRING, CB_ADDSTRING, CB_INSERTSTRING, LB_FINDSTRING, LB_FINDSTRINGEXACT, LB_SELECTSTRING, ! CB_FINDSTRING, CB_FINDSTRINGEXACT: FreeMem(PWideChar(TempLParam)); WM_GETTEXTLENGTH: Index: TestForm.dfm =================================================================== RCS file: /cvsroot/utf8vcl/utf8vcl/TestForm.dfm,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** TestForm.dfm 18 Mar 2007 15:12:56 -0000 1.15 --- TestForm.dfm 18 Mar 2007 21:47:34 -0000 1.16 *************** *** 1,5 **** object Form1: TForm1 ! Left = 234 ! Top = 127 BorderIcons = [biSystemMenu, biMinimize] BorderStyle = bsSingle --- 1,5 ---- object Form1: TForm1 ! Left = 438 ! Top = 135 BorderIcons = [biSystemMenu, biMinimize] BorderStyle = bsSingle *************** *** 15,19 **** --- 15,21 ---- Menu = MainMenu1 OldCreateOrder = False + PopupMenu = PopupMenu1 Position = poScreenCenter + ShowHint = True PixelsPerInch = 96 TextHeight = 14 *************** *** 26,32 **** end object SpeedButton1: TSpeedButton ! Left = 96 Top = 184 ! Width = 81 Height = 22 Caption = 'SpeedButton1' --- 28,34 ---- end object SpeedButton1: TSpeedButton ! Left = 72 Top = 184 ! Width = 57 Height = 22 Caption = 'SpeedButton1' *************** *** 35,39 **** Left = 7 Top = 28 ! Width = 196 Height = 22 TabOrder = 0 --- 37,41 ---- Left = 7 Top = 28 ! Width = 122 Height = 22 TabOrder = 0 *************** *** 43,47 **** Left = 7 Top = 56 ! Width = 196 Height = 42 Ctl3D = True --- 45,49 ---- Left = 7 Top = 56 ! Width = 122 Height = 42 Ctl3D = True *************** *** 61,66 **** object CheckBox1: TCheckBox Left = 77 ! Top = 105 ! Width = 126 Height = 14 Caption = 'CheckBox1' --- 63,68 ---- object CheckBox1: TCheckBox Left = 77 ! Top = 113 ! Width = 52 Height = 14 Caption = 'CheckBox1' *************** *** 68,74 **** end object RadioButton1: TRadioButton ! Left = 209 ! Top = 161 ! Width = 162 Height = 14 Caption = 'RadioButton1' --- 70,76 ---- end object RadioButton1: TRadioButton ! Left = 137 ! Top = 169 ! Width = 120 Height = 14 Caption = 'RadioButton1' *************** *** 78,82 **** Left = 7 Top = 133 ! Width = 196 Height = 42 ItemHeight = 14 --- 80,84 ---- Left = 7 Top = 133 ! Width = 122 Height = 42 ItemHeight = 14 *************** *** 86,92 **** end object ComboBox1: TComboBox ! Left = 209 ! Top = 133 ! Width = 162 Height = 22 ItemHeight = 14 --- 88,94 ---- end object ComboBox1: TComboBox ! Left = 137 ! Top = 141 ! Width = 120 Height = 22 ItemHeight = 14 *************** *** 97,103 **** end object GroupBox1: TGroupBox ! Left = 209 ! Top = 84 ! Width = 162 Height = 42 Caption = 'GroupBox1' --- 99,105 ---- end object GroupBox1: TGroupBox ! Left = 137 ! Top = 92 ! Width = 120 Height = 42 Caption = 'GroupBox1' *************** *** 123,139 **** end object RichEdit1: TRichEdit ! Left = 209 ! Top = 0 Width = 162 Height = 77 Lines.Strings = ( ! 'RichEdit1') TabOrder = 10 end object StringGrid1: TStringGrid ! Left = 376 ! Top = 0 ! Width = 217 ! Height = 120 ColCount = 3 RowCount = 4 --- 125,143 ---- end object RichEdit1: TRichEdit ! Left = 441 ! Top = 128 Width = 162 Height = 77 Lines.Strings = ( ! 'RichEdit1' ! 'currently does not handle ' ! 'unicode') TabOrder = 10 end object StringGrid1: TStringGrid ! Left = 136 ! Top = 8 ! Width = 121 ! Height = 81 ColCount = 3 RowCount = 4 *************** *** 146,151 **** end object ListView1: TListView ! Left = 373 ! Top = 127 Width = 225 Height = 105 --- 150,155 ---- end object ListView1: TListView ! Left = 381 ! Top = 15 Width = 225 Height = 105 *************** *** 197,201 **** Left = 8 Top = 184 ! Width = 75 Height = 25 Caption = 'BitBtn1' --- 201,205 ---- Left = 8 Top = 184 ! Width = 57 Height = 25 Caption = 'BitBtn1' *************** *** 203,207 **** end object StaticText1: TStaticText ! Left = 200 Top = 184 Width = 58 --- 207,211 ---- end object StaticText1: TStaticText ! Left = 136 Top = 184 Width = 58 *************** *** 213,217 **** Left = 8 Top = 216 ! Width = 273 Height = 49 DisplayOptions = [doColumnTitles, doAutoColResize] --- 217,221 ---- Left = 8 Top = 216 ! Width = 121 Height = 49 DisplayOptions = [doColumnTitles, doAutoColResize] *************** *** 220,229 **** TabOrder = 18 ColWidths = ( ! 133 ! 134) end object Panel1: TPanel ! Left = 288 ! Top = 248 Width = 121 Height = 41 --- 224,233 ---- TabOrder = 18 ColWidths = ( ! 57 ! 58) end object Panel1: TPanel ! Left = 136 ! Top = 328 Width = 121 Height = 41 *************** *** 232,238 **** end object RadioGroup1: TRadioGroup ! Left = 280 ! Top = 176 ! Width = 89 Height = 33 Caption = 'RadioGroup1' --- 236,242 ---- end object RadioGroup1: TRadioGroup ! Left = 136 ! Top = 200 ! Width = 121 Height = 33 Caption = 'RadioGroup1' *************** *** 247,253 **** Text = 'MaskEdit1' end object MainMenu1: TMainMenu ! Left = 104 ! Top = 24 object Menu1: TMenuItem Caption = 'Menu' --- 251,278 ---- Text = 'MaskEdit1' end + object CheckListBox1: TCheckListBox + Left = 136 + Top = 240 + Width = 121 + Height = 41 + ItemHeight = 14 + Items.Strings = ( + 'CheckListBox1') + TabOrder = 22 + end + object LabeledEdit1: TLabeledEdit + Left = 136 + Top = 304 + Width = 121 + Height = 22 + EditLabel.Width = 61 + EditLabel.Height = 14 + EditLabel.Caption = 'LabeledEdit1' + TabOrder = 23 + Text = 'LabeledEdit1' + end object MainMenu1: TMainMenu ! Left = 8 ! Top = 304 object Menu1: TMenuItem Caption = 'Menu' *************** *** 267,272 **** end object ActionList1: TActionList ! Left = 152 Top = 304 end end --- 292,304 ---- end object ActionList1: TActionList ! Left = 72 Top = 304 end + object PopupMenu1: TPopupMenu + Left = 40 + Top = 304 + object PopupMenu11: TMenuItem + Caption = 'PopupMenu1' + end + end end Index: TestForm.pas =================================================================== RCS file: /cvsroot/utf8vcl/utf8vcl/TestForm.pas,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** TestForm.pas 18 Mar 2007 16:28:09 -0000 1.21 --- TestForm.pas 18 Mar 2007 21:47:34 -0000 1.22 *************** *** 12,16 **** Windows, SysUtils, Classes, Controls, Forms, Dialogs, ComCtrls, StdCtrls, Menus, Grids, ValEdit, Buttons, ExtCtrls, ! Mask, ActnList; type --- 12,16 ---- Windows, SysUtils, Classes, Controls, Forms, Dialogs, ComCtrls, StdCtrls, Menus, Grids, ValEdit, Buttons, ExtCtrls, ! Mask, ActnList, CheckLst, DBGrids, Gauges, ShellCtrls; type *************** *** 45,48 **** --- 45,52 ---- ActionList1: TActionList; MaskEdit1: TMaskEdit; + PopupMenu1: TPopupMenu; + PopupMenu11: TMenuItem; + CheckListBox1: TCheckListBox; + LabeledEdit1: TLabeledEdit; procedure Button2Click(Sender: TObject); procedure Button3Click(Sender: TObject); *************** *** 70,75 **** X, Y: Integer; ! procedure CheckTranslation(ComponentName, Content: string; Test: string = TestText); begin if Content <> Test then ShowMessageFmt('Component "%s" does not work yet "%s" vs. "%s"', [ComponentName, Test, Content]); --- 74,81 ---- X, Y: Integer; ! procedure CheckTranslation(ComponentName, Content: string; Test: string = ''); begin + if Test = '' then + Test := TestText; if Content <> Test then ShowMessageFmt('Component "%s" does not work yet "%s" vs. "%s"', [ComponentName, Test, Content]); *************** *** 77,84 **** --- 83,98 ---- begin + Hint := TestText; + + CheckListBox1.Items[0] := TestText; + CheckTranslation(CheckListBox1.Name, CheckListBox1.Items[0]); + LabeledEdit1.Text := TestText; + CheckTranslation(LabeledEdit1.Name, LabeledEdit1.Text); Menu1.Caption := TestText1 + '&' + TestText2; CheckTranslation(Menu1.Name, Menu1.Caption, TestText1 + '&' + TestText2); menuItem1.Caption := TestText; CheckTranslation(menuItem1.Name, menuItem1.Caption); + PopupMenu1.Items[0].Caption := TestText; + CheckTranslation(PopupMenu1.Name, PopupMenu1.Items[0].Caption); Label1.Caption := TestText; CheckTranslation(Label1.Name, Label1.Caption); *************** *** 284,288 **** procedure TForm1.Button4Click(Sender: TObject); begin ! FatalAppExit(0, TestText); end; --- 298,302 ---- procedure TForm1.Button4Click(Sender: TObject); begin ! FatalAppExit(0, PAnsiChar(TestText)); end; Index: MissingWindowMessages-incomplete.txt =================================================================== RCS file: /cvsroot/utf8vcl/utf8vcl/MissingWindowMessages-incomplete.txt,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** MissingWindowMessages-incomplete.txt 14 Mar 2007 10:18:09 -0000 1.3 --- MissingWindowMessages-incomplete.txt 18 Mar 2007 21:47:34 -0000 1.4 *************** *** 1,14 **** - LB_SELECTSTRING EN_MAXTEXT EM_GETLIMITTEXT EM_POSFROMCHAR EM_CHARFROMPOS ! LB_ADDSTRING ! LB_INSERTSTRING ! LB_SELECTSTRING ! LB_FINDSTRING ! LB_FINDSTRINGEXACT ! CB_ADDSTRING ! CB_INSERTSTRING ! CB_FINDSTRING ! CB_FINDSTRINGEXACT \ No newline at end of file --- 1,6 ---- EN_MAXTEXT EM_GETLIMITTEXT EM_POSFROMCHAR EM_CHARFROMPOS ! ! |