utf8vcl-cvs Mailing List for UTF-8 VCL
Status: Alpha
Brought to you by:
bluelive
You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
(30) |
Apr
(7) |
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
---|
From: David Z. <dz...@us...> - 2007-08-17 14:40:07
|
Update of /cvsroot/utf8vcl/utf8vcl In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv9589 Modified Files: UTF8VCLCommDlg.pas Log Message: Convert lpTemplateName only when CC_ENABLETEMPLATE Index: UTF8VCLCommDlg.pas =================================================================== RCS file: /cvsroot/utf8vcl/utf8vcl/UTF8VCLCommDlg.pas,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** UTF8VCLCommDlg.pas 28 Mar 2007 14:22:33 -0000 1.2 --- UTF8VCLCommDlg.pas 17 Aug 2007 14:39:24 -0000 1.3 *************** *** 268,272 **** end; try ! CCW.lpTemplateName := ConvertFromUTF8(CC.lpTemplateName); CCW.lpfnHook := WndProcConvertW2U(Pointer(@CC.lpfnHook), Pointer(@StdWndProcInterceptU2W), Pointer(@StdWndProcInterceptW2U)); --- 268,273 ---- end; try ! if CC.Flags and CC_ENABLETEMPLATE <> 0 then ! CCW.lpTemplateName := ConvertFromUTF8(CC.lpTemplateName); CCW.lpfnHook := WndProcConvertW2U(Pointer(@CC.lpfnHook), Pointer(@StdWndProcInterceptU2W), Pointer(@StdWndProcInterceptW2U)); |
From: Robert M. <mar...@us...> - 2007-04-16 09:48:27
|
Update of /cvsroot/utf8vcl/utf8vcl/Samples In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv19497/Samples Modified Files: JVCLTest.dpr Log Message: utf8VCLPkg use Index: JVCLTest.dpr =================================================================== RCS file: /cvsroot/utf8vcl/utf8vcl/Samples/JVCLTest.dpr,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** JVCLTest.dpr 16 Apr 2007 09:43:05 -0000 1.2 --- JVCLTest.dpr 16 Apr 2007 09:48:23 -0000 1.3 *************** *** 2,6 **** uses ! utf8VCL, Forms, JVCLMainTest in 'JVCLMainTest.pas' {Form1}; --- 2,6 ---- uses ! Utf8VCL, Forms, JVCLMainTest in 'JVCLMainTest.pas' {Form1}; |
From: Robert M. <mar...@us...> - 2007-04-16 09:43:59
|
Update of /cvsroot/utf8vcl/utf8vcl/Samples In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv16113/Samples Modified Files: JVCLTest.dpr Log Message: utf8VCLPkg use Index: JVCLTest.dpr =================================================================== RCS file: /cvsroot/utf8vcl/utf8vcl/Samples/JVCLTest.dpr,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** JVCLTest.dpr 16 Apr 2007 09:35:01 -0000 1.1 --- JVCLTest.dpr 16 Apr 2007 09:43:05 -0000 1.2 *************** *** 2,12 **** uses ! ShareMem, Forms, ! JVCLMainTest in 'JVCLMainTest.pas' {Form1}, ! UTF8VCLUtils in 'UTF8VCLUtils.pas', ! UTF8VCL in 'UTF8VCL.pas', ! UTF8VCLControls in 'UTF8VCLControls.pas', ! UTF8VCLMessages in 'UTF8VCLMessages.pas'; {$R *.res} --- 2,8 ---- uses ! utf8VCL, Forms, ! JVCLMainTest in 'JVCLMainTest.pas' {Form1}; {$R *.res} |
From: Robert M. <mar...@us...> - 2007-04-16 09:37:36
|
Update of /cvsroot/utf8vcl/utf8vcl In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv13722 Added Files: utf8VCLPkg.dpk Log Message: utf8VCL as package (still needs compile without packages though) --- NEW FILE: utf8VCLPkg.dpk --- package utf8VCLPkg; {$R *.res} {$ALIGN 8} {$ASSERTIONS OFF} {$BOOLEVAL OFF} {$DEBUGINFO OFF} {$EXTENDEDSYNTAX ON} {$IMPORTEDDATA ON} {$IOCHECKS ON} {$LOCALSYMBOLS OFF} {$LONGSTRINGS ON} {$OPENSTRINGS ON} {$OPTIMIZATION ON} {$OVERFLOWCHECKS OFF} {$RANGECHECKS OFF} {$REFERENCEINFO OFF} {$SAFEDIVIDE OFF} {$STACKFRAMES OFF} {$TYPEDADDRESS OFF} {$VARSTRINGCHECKS ON} {$WRITEABLECONST OFF} {$MINENUMSIZE 1} {$IMAGEBASE $400000} {$RUNONLY} {$IMPLICITBUILD OFF} requires rtl, vcl; contains UTF8VCLUtils in 'UTF8VCLUtils.pas', UTF8VCL in 'UTF8VCL.pas', UTF8VCLCommDlg in 'UTF8VCLCommDlg.pas', UTF8VCLControls in 'UTF8VCLControls.pas', UTF8VCLMessages in 'UTF8VCLMessages.pas'; end. |
From: Robert M. <mar...@us...> - 2007-04-16 09:35:09
|
Update of /cvsroot/utf8vcl/utf8vcl/Samples In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv12248/Samples Added Files: JVCLMainTest.dfm JVCLMainTest.pas JVCLTest.dpr TestForm.dfm TestForm.pas UTF8Test.dpr Log Message: separate samples directory --- NEW FILE: JVCLMainTest.pas --- unit JVCLMainTest; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, Menus, StdCtrls, Buttons, JvMenus, JvArrowButton, JvExControls, JvButton, JvTransparentButton, JvColorBox, JvColorButton, ExtCtrls, JvExExtCtrls, JvExtComponent, JvOfficeColorButton, JvExButtons, JvButtons, JvFullColorSpaces, JvLabel, JvStaticText, JvFullColorCtrls, JvLinkLabel, JvHtControls, JvInstallLabel, JvExStdCtrls, JvBehaviorLabel, JvCombobox, JvListComb; type TForm1 = class(TForm) JvMainMenu1: TJvMainMenu; MainMenu1: TMenuItem; MainMenuItem1: TMenuItem; JvXPMenuItemPainter1: TJvXPMenuItemPainter; JvTransparentButton1: TJvTransparentButton; JvArrowButton1: TJvArrowButton; JvPopupMenu1: TJvPopupMenu; PopupItem11: TMenuItem; Popupitem21: TMenuItem; Exit1: TMenuItem; JvColorButton1: TJvColorButton; JvOfficeColorButton1: TJvOfficeColorButton; JvHTButton1: TJvHTButton; JvBehaviorLabel1: TJvBehaviorLabel; JvInstallLabel1: TJvInstallLabel; JvHTLabel1: TJvHTLabel; JvLinkLabel1: TJvLinkLabel; JvStaticText1: TJvStaticText; JvLabel1: TJvLabel; JvFullColorLabel1: TJvFullColorLabel; JvImageComboBox1: TJvImageComboBox; JvImageListBox1: TJvImageListBox; procedure MainMenuItem1Click(Sender: TObject); procedure Exit1Click(Sender: TObject); public end; var Form1: TForm1; implementation {$R *.dfm} const TestText1 = 'I'#$C3#$B1#$DB#$B3#$C3#$AB#$72#$D7#$90#$C3#$A2; TestText2 = 't'#$D1#$96#$C3#$B4#$EF#$A7#$A7#$C3#$A0#$6C#$D1#$96#$7A#$C3#$A6#$74#$E2#$98#$BA#$6E; TestText = TestText1 + TestText2; procedure TForm1.MainMenuItem1Click(Sender: TObject); begin JvMainMenu1.Items[0].Caption := TestText; MainMenuItem1.Caption := TestText; JvTransparentButton1.Caption := TestText; JvArrowButton1.Caption := TestText; JvPopupMenu1.Items[0].Caption := TestText; JvPopupMenu1.Items[1].Caption := TestText; JvColorButton1.OtherCaption := TestText; JvOfficeColorButton1.Properties.CustomColorCaption := TestText; JvOfficeColorButton1.Properties.CustomColorHint := TestText; JvHTButton1.Caption := TestText; JvBehaviorLabel1.Caption := TestText + ' ' + TestText; JvBehaviorLabel1.BehaviorOptions.Active := True; JvInstallLabel1.Lines[0] := TestText; JvInstallLabel1.Lines[1] := TestText; JvHTLabel1.Caption := TestText + #13#10 + TestText; JvLinkLabel1.Caption := TestText; JvFullColorLabel1.Caption := TestText; JvStaticText1.Caption := TestText; JvLabel1.Caption := TestText; JvImageComboBox1.Items[0].Text := TestText; JvImageComboBox1.Items[1].Text := TestText; JvImageCombobox1.ItemIndex := 0; JvImageListBox1.Items[0].Text := TestText; JvImageListBox1.Items[1].Text := TestText; end; procedure TForm1.Exit1Click(Sender: TObject); begin Close; end; end. --- NEW FILE: TestForm.dfm --- object Form1: TForm1 Left = 438 Top = 135 BorderIcons = [biSystemMenu, biMinimize] BorderStyle = bsSingle Caption = 'Form1' ClientHeight = 435 ClientWidth = 657 Color = clBtnFace Font.Charset = ANSI_CHARSET Font.Color = clWindowText Font.Height = -11 Font.Name = 'Arial Unicode MS' Font.Style = [] Menu = MainMenu1 OldCreateOrder = False PopupMenu = PopupMenu1 Position = poScreenCenter ShowHint = True PixelsPerInch = 96 TextHeight = 15 object Label1: TLabel Left = 8 Top = 8 Width = 32 Height = 15 Caption = 'Label1' end object SpeedButton1: TSpeedButton Left = 77 Top = 197 Width = 61 Height = 24 Caption = 'SpeedButton1' end object Edit1: TEdit Left = 8 Top = 30 Width = 130 Height = 23 TabOrder = 0 Text = 'Edit1' end object Memo1: TMemo Left = 8 Top = 60 Width = 130 Height = 45 Ctl3D = True Lines.Strings = ( 'Memo1') ParentCtl3D = False TabOrder = 1 end object Button1: TButton Left = 8 Top = 113 Width = 69 Height = 22 Caption = 'Button1' TabOrder = 2 end object CheckBox1: TCheckBox Left = 83 Top = 121 Width = 55 Height = 15 Caption = 'CheckBox1' TabOrder = 3 end object RadioButton1: TRadioButton Left = 147 Top = 181 Width = 128 Height = 15 Caption = 'RadioButton1' TabOrder = 4 end object ListBox1: TListBox Left = 8 Top = 143 Width = 130 Height = 45 ItemHeight = 15 Items.Strings = ( 'ListBox1') TabOrder = 5 end object ComboBox1: TComboBox Left = 147 Top = 151 Width = 128 Height = 23 ItemHeight = 15 TabOrder = 6 Text = 'ComboBox1' Items.Strings = ( 'ComboBox1') end object GroupBox1: TGroupBox Left = 147 Top = 99 Width = 128 Height = 45 Caption = 'GroupBox1' TabOrder = 7 end object Button2: TButton Left = 567 Top = 399 Width = 71 Height = 24 Caption = 'Translate' TabOrder = 8 OnClick = Button2Click end object Button3: TButton Left = 473 Top = 398 Width = 70 Height = 24 Caption = 'SomeTests' TabOrder = 9 OnClick = Button3Click end object RichEdit1: TRichEdit Left = 473 Top = 137 Width = 173 Height = 83 Lines.Strings = ( 'RichEdit1' 'currently does not handle ' 'unicode') TabOrder = 10 end object StringGrid1: TStringGrid Left = 146 Top = 9 Width = 129 Height = 86 ColCount = 3 RowCount = 4 Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goColSizing] TabOrder = 11 ColWidths = ( 64 99 80) end object ListView1: TListView Left = 408 Top = 16 Width = 241 Height = 113 Columns = < item Caption = 'Column1' end item Caption = 'Column2' end> GridLines = True Items.Data = { 540000000200000000000000FFFFFFFFFFFFFFFF010000000000000005497465 6D3109537562314974656D3100000000FFFFFFFFFFFFFFFF0100000000000000 054974656D3209537562324974656D31FFFFFFFF} TabOrder = 12 ViewStyle = vsReport end object Activate: TButton Left = 8 Top = 400 Width = 137 Height = 25 Caption = 'Activate UTF8 support' Enabled = False TabOrder = 13 end object Deactivate: TButton Left = 152 Top = 400 Width = 137 Height = 25 Caption = 'Deactivate UTF8 support' Enabled = False TabOrder = 14 end object Button4: TButton Left = 385 Top = 398 Width = 70 Height = 24 Caption = 'FatalAppExit' TabOrder = 15 OnClick = Button4Click end object BitBtn1: TBitBtn Left = 9 Top = 197 Width = 61 Height = 27 Caption = 'BitBtn1' TabOrder = 16 end object StaticText1: TStaticText Left = 146 Top = 197 Width = 59 Height = 19 Caption = 'StaticText1' TabOrder = 17 end object ValueListEditor1: TValueListEditor Left = 9 Top = 231 Width = 129 Height = 53 DisplayOptions = [doColumnTitles, doAutoColResize] Strings.Strings = ( 'KeyItem=ValueItem') TabOrder = 18 ColWidths = ( 61 62) end object Panel1: TPanel Left = 146 Top = 351 Width = 129 Height = 44 Caption = 'Panel1' TabOrder = 19 end object RadioGroup1: TRadioGroup Left = 146 Top = 214 Width = 129 Height = 36 Caption = 'RadioGroup1' TabOrder = 20 end object MaskEdit1: TMaskEdit Left = 9 Top = 291 Width = 129 Height = 23 TabOrder = 21 Text = 'MaskEdit1' end object CheckListBox1: TCheckListBox Left = 146 Top = 257 Width = 129 Height = 44 ItemHeight = 15 Items.Strings = ( 'CheckListBox1') TabOrder = 22 end object LabeledEdit1: TLabeledEdit Left = 146 Top = 326 Width = 129 Height = 23 EditLabel.Width = 62 EditLabel.Height = 15 EditLabel.Caption = 'LabeledEdit1' LabelPosition = lpAbove LabelSpacing = 3 TabOrder = 23 Text = 'LabeledEdit1' end object MainMenu1: TMainMenu Left = 8 Top = 304 object Menu1: TMenuItem Caption = 'Menu' object menuItem1: TMenuItem Caption = 'MenuItem' end end end object OpenDialog1: TOpenDialog DefaultExt = 'OpenDialog1' FileName = 'OpenDialog1' Filter = 'StrangeFiles|*.*' InitialDir = 'OpenDialog1' Title = 'OpenDialog1' Left = 8 Top = 336 end object ActionList1: TActionList Left = 72 Top = 304 end object PopupMenu1: TPopupMenu Left = 40 Top = 304 object PopupMenu11: TMenuItem Caption = 'PopupMenu1' end end object SaveDialog1: TSaveDialog Left = 40 Top = 336 end object ColorDialog1: TColorDialog Ctl3D = True Color = 6334590 CustomColors.Strings = ( 'ColorA=000000' 'ColorB=000000' 'ColorC=60A87E' 'ColorD=60A87E' 'ColorE=60A87E' 'ColorF=FFFFFFFF' 'ColorG=FFFFFFFF' 'ColorH=FFFFFFFF' 'ColorI=000000' 'ColorJ=000000' 'ColorK=60A87E' 'ColorL=60A87E' 'ColorM=FFFFFFFF' 'ColorN=FFFFFFFF' 'ColorO=FFFFFFFF' 'ColorP=FFFFFFFF') Left = 72 Top = 336 end end --- NEW FILE: JVCLTest.dpr --- program JVCLTest; uses ShareMem, Forms, JVCLMainTest in 'JVCLMainTest.pas' {Form1}, UTF8VCLUtils in 'UTF8VCLUtils.pas', UTF8VCL in 'UTF8VCL.pas', UTF8VCLControls in 'UTF8VCLControls.pas', UTF8VCLMessages in 'UTF8VCLMessages.pas'; {$R *.res} begin Application.Initialize; Application.CreateForm(TForm1, Form1); Application.Run; end. --- NEW FILE: JVCLMainTest.dfm --- object Form1: TForm1 Left = 192 Top = 123 Width = 1088 Height = 750 Caption = 'Form1' Color = clBtnFace Font.Charset = ANSI_CHARSET Font.Color = clWindowText Font.Height = -11 Font.Name = 'Arial Unicode MS' Font.Style = [] Menu = JvMainMenu1 OldCreateOrder = False PixelsPerInch = 96 TextHeight = 15 object JvTransparentButton1: TJvTransparentButton Left = 8 Top = 8 Width = 113 Height = 32 Caption = 'JvTransparentButton1' HotTrackFont.Charset = ANSI_CHARSET HotTrackFont.Color = clWindowText HotTrackFont.Height = -11 HotTrackFont.Name = 'Arial Unicode MS' HotTrackFont.Style = [] end object JvArrowButton1: TJvArrowButton Left = 8 Top = 56 Width = 113 Height = 25 DropDown = JvPopupMenu1 Caption = 'JvArrowButton1' FillFont.Charset = DEFAULT_CHARSET FillFont.Color = clWindowText FillFont.Height = -11 FillFont.Name = 'MS Sans Serif' FillFont.Style = [] end object JvBehaviorLabel1: TJvBehaviorLabel Left = 280 Top = 16 Width = 87 Height = 15 Behavior = 'Typing' Caption = 'JvBehaviorLabel1' end object JvInstallLabel1: TJvInstallLabel Left = 280 Top = 48 Width = 180 Height = 65 Lines.Strings = ( 'InstallLabelLine1' 'InstallLabelLine2') end object JvHTLabel1: TJvHTLabel Left = 280 Top = 128 Width = 185 Height = 33 AutoSize = False Caption = 'JvHTLabel1'#13#10'JvHTLabel1' WordWrap = True end object JvLinkLabel1: TJvLinkLabel Left = 280 Top = 176 Height = 15 Caption = 'JvLinkLabel1' Text.Strings = ( 'JvLinkLabel1') end object JvLabel1: TJvLabel Left = 280 Top = 256 Width = 46 Height = 15 Caption = 'JvLabel1' HotTrackFont.Charset = ANSI_CHARSET HotTrackFont.Color = clWindowText HotTrackFont.Height = -11 HotTrackFont.Name = 'Arial Unicode MS' HotTrackFont.Style = [] end object JvFullColorLabel1: TJvFullColorLabel Left = 280 Top = 200 Width = 109 Height = 17 Caption = 'JvFullColorLabel1' AutoSize = True end object JvColorButton1: TJvColorButton Left = 136 Top = 16 Width = 105 OtherCaption = '&Other...' Options = [] CustomColors.Strings = ( '') TabOrder = 0 TabStop = False end object JvOfficeColorButton1: TJvOfficeColorButton Left = 136 Top = 56 Width = 105 Height = 22 TabOrder = 1 SelectedColor = clDefault HotTrackFont.Charset = DEFAULT_CHARSET HotTrackFont.Color = clWindowText HotTrackFont.Height = -11 HotTrackFont.Name = 'MS Sans Serif' HotTrackFont.Style = [] Properties.NoneColorCaption = 'No Color' Properties.DefaultColorCaption = 'Automatic' Properties.CustomColorCaption = 'Other Colors...' Properties.NoneColorHint = 'No Color' Properties.DefaultColorHint = 'Automatic' Properties.CustomColorHint = 'Other Colors...' Properties.NoneColorFont.Charset = DEFAULT_CHARSET Properties.NoneColorFont.Color = clWindowText Properties.NoneColorFont.Height = -11 Properties.NoneColorFont.Name = 'MS Sans Serif' Properties.NoneColorFont.Style = [] Properties.DefaultColorFont.Charset = DEFAULT_CHARSET Properties.DefaultColorFont.Color = clWindowText Properties.DefaultColorFont.Height = -11 Properties.DefaultColorFont.Name = 'MS Sans Serif' Properties.DefaultColorFont.Style = [] Properties.CustomColorFont.Charset = DEFAULT_CHARSET Properties.CustomColorFont.Color = clWindowText Properties.CustomColorFont.Height = -11 Properties.CustomColorFont.Name = 'MS Sans Serif' Properties.CustomColorFont.Style = [] Properties.FloatWindowCaption = 'Color Window' Properties.DragBarHint = 'Drag to float' end object JvHTButton1: TJvHTButton Left = 8 Top = 96 Width = 113 Height = 25 Caption = 'JvHTButton1' TabOrder = 2 end object JvStaticText1: TJvStaticText Left = 280 Top = 232 Width = 71 Height = 19 Caption = 'JvStaticText1' HotTrackFont.Charset = ANSI_CHARSET HotTrackFont.Color = clWindowText HotTrackFont.Height = -11 HotTrackFont.Name = 'Arial Unicode MS' HotTrackFont.Style = [] Layout = tlTop TabOrder = 3 TextMargins.X = 0 TextMargins.Y = 0 WordWrap = False end object JvImageComboBox1: TJvImageComboBox Left = 512 Top = 8 Width = 145 Height = 25 Style = csOwnerDrawVariable ButtonStyle = fsLighter DroppedWidth = 145 ImageHeight = 0 ImageWidth = 0 ItemHeight = 19 ItemIndex = 0 TabOrder = 4 Items = < item Brush.Style = bsClear Indent = 0 Text = 'Item0' end item Brush.Style = bsClear Indent = 0 Text = 'Item1' end> end object JvImageListBox1: TJvImageListBox Left = 512 Top = 48 Width = 121 Height = 57 Items = < item Brush.Style = bsClear Indent = 0 Text = 'Item0' end item Brush.Style = bsClear Indent = 0 Text = 'Item1' end> ImageHeight = 0 ImageWidth = 0 ButtonStyle = fsLighter ItemHeight = 19 TabOrder = 5 end object JvMainMenu1: TJvMainMenu Style = msItemPainter ImageMargin.Left = 0 ImageMargin.Top = 0 ImageMargin.Right = 0 ImageMargin.Bottom = 0 ImageSize.Height = 0 ImageSize.Width = 0 ItemPainter = JvXPMenuItemPainter1 Left = 72 Top = 65528 object MainMenu1: TMenuItem Caption = 'MainMenu' object MainMenuItem1: TMenuItem Caption = 'Translate' OnClick = MainMenuItem1Click end object Exit1: TMenuItem Caption = 'Exit' OnClick = Exit1Click end end end object JvXPMenuItemPainter1: TJvXPMenuItemPainter SelectionFrameBrush.Color = 13811126 SelectionFramePen.Color = 6956042 Left = 104 Top = 65528 end object JvPopupMenu1: TJvPopupMenu Style = msItemPainter ImageMargin.Left = 0 ImageMargin.Top = 0 ImageMargin.Right = 0 ImageMargin.Bottom = 0 ImageSize.Height = 0 ImageSize.Width = 0 ItemPainter = JvXPMenuItemPainter1 Left = 16 Top = 64 object PopupItem11: TMenuItem Caption = 'PopupItem1' end object Popupitem21: TMenuItem Caption = 'Popupitem2' end end end --- NEW FILE: UTF8Test.dpr --- program UTF8Test; uses UTF8VCL, Forms, TestForm in 'TestForm.pas' {Form1}; {$R *.res} begin Application.Initialize; Application.CreateForm(TForm1, Form1); Application.Run; end. --- NEW FILE: TestForm.pas --- // If you see three strange characters in front of this line you can remove them // These are part of how BDS and notepad mark documents that use UTF8 // // If you use one of the newer Delphi compilers make sure you set the // codepage to 65001 in the compiler options and rebuild unit TestForm; interface uses Windows, SysUtils, Classes, Controls, Forms, Dialogs, ComCtrls, StdCtrls, Menus, Grids, ValEdit, Buttons, ExtCtrls, Mask, ActnList, CheckLst, DBGrids, ShellCtrls; type TForm1 = class(TForm) MainMenu1: TMainMenu; Menu1: TMenuItem; menuItem1: TMenuItem; Label1: TLabel; Edit1: TEdit; Memo1: TMemo; Button1: TButton; CheckBox1: TCheckBox; RadioButton1: TRadioButton; ListBox1: TListBox; ComboBox1: TComboBox; GroupBox1: TGroupBox; Button2: TButton; Button3: TButton; RichEdit1: TRichEdit; StringGrid1: TStringGrid; ListView1: TListView; Activate: TButton; Deactivate: TButton; Button4: TButton; BitBtn1: TBitBtn; SpeedButton1: TSpeedButton; StaticText1: TStaticText; ValueListEditor1: TValueListEditor; Panel1: TPanel; OpenDialog1: TOpenDialog; RadioGroup1: TRadioGroup; ActionList1: TActionList; MaskEdit1: TMaskEdit; PopupMenu1: TPopupMenu; PopupMenu11: TMenuItem; CheckListBox1: TCheckListBox; LabeledEdit1: TLabeledEdit; SaveDialog1: TSaveDialog; ColorDialog1: TColorDialog; procedure Button2Click(Sender: TObject); procedure Button3Click(Sender: TObject); procedure Button4Click(Sender: TObject); public end; var Form1: TForm1; implementation {$R *.dfm} const TestText1 = 'I'#$C3#$B1#$DB#$B3#$C3#$AB#$72#$D7#$90#$C3#$A2; TestText2 = 't'#$D1#$96#$C3#$B4#$EF#$A7#$A7#$C3#$A0#$6C#$D1#$96#$7A#$C3#$A6#$74#$E2#$98#$BA#$6E; TestText = TestText1 + TestText2; 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]); end; procedure TForm1.Button2Click(Sender: TObject); var X, Y: Integer; 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); Edit1.Text := TestText; CheckTranslation(Edit1.Name, Edit1.Text); Memo1.Text := TestText; CheckTranslation(Memo1.Name, Memo1.Text); Button1.Caption := TestText; CheckTranslation(Button1.Name, Button1.Caption); CheckBox1.Caption := TestText; CheckTranslation(CheckBox1.Name, CheckBox1.Caption); RadioButton1.Caption := TestText; CheckTranslation(RadioButton1.Name, RadioButton1.Caption); ListBox1.Items.Clear; ListBox1.Items.Add(TestText); CheckTranslation(ListBox1.Name, ListBox1.Items[0]); ComboBox1.Items.Clear; ComboBox1.Items.Add(TestText); CheckTranslation(ComboBox1.Name, ComboBox1.Items[0]); ComboBox1.Text := TestText; CheckTranslation(ComboBox1.Name, ComboBox1.Text); GroupBox1.Caption := TestText; CheckTranslation(GroupBox1.Name, GroupBox1.Caption); RadioGroup1.Caption := TestText; CheckTranslation(RadioGroup1.Name, RadioGroup1.Caption); Button2.Caption := TestText; CheckTranslation(Button2.Name, Button2.Caption); RichEdit1.Text := TestText; // known to be broken, very hard to fix // CheckTranslation(RichEdit1.Name, RichEdit1.Text); MaskEdit1.Text := TestText; CheckTranslation(MaskEdit1.Name, MaskEdit1.Text); Application.Title := TestText; CheckTranslation('Application.Title', Application.Title); Self.Caption := TestText; CheckTranslation(Self.Name, Self.Caption); Self.Text := TestText; CheckTranslation(Self.Name, Self.Text); for Y := 0 to StringGrid1.RowCount -1 do for X := 0 to StringGrid1.ColCount -1 do begin StringGrid1.Rows[Y][X] := TestText; CheckTranslation(StringGrid1.Name, StringGrid1.Rows[Y][X]); end; ListView1.Columns[0].Caption := TestText; CheckTranslation(ListView1.Name, ListView1.Columns[0].Caption); ListView1.Columns[1].Caption := TestText; ListView1.Items[0].Caption := TestText; CheckTranslation(ListView1.Name, ListView1.Items[0].Caption); ListView1.Items[1].Caption := TestText; ListView1.Items[0].SubItems[0] := TestText; CheckTranslation(ListView1.Name, ListView1.Items[0].SubItems[0]); ListView1.Items[1].SubItems[0] := TestText; BitBtn1.Caption := TestText; CheckTranslation(BitBtn1.Name, BitBtn1.Caption); SpeedButton1.Caption := TestText; CheckTranslation(SpeedButton1.Name, SpeedButton1.Caption); StaticText1.Caption := TestText; CheckTranslation(StaticText1.Name, StaticText1.Caption); Panel1.Caption := TestText; CheckTranslation(StaticText1.Name, Panel1.Caption); ValueListEditor1.TitleCaptions[0] := TestText; CheckTranslation(ValueListEditor1.Name, ValueListEditor1.TitleCaptions[0]); ValueListEditor1.TitleCaptions[1] := TestText; CheckTranslation(ValueListEditor1.Name, ValueListEditor1.TitleCaptions[1]); ValueListEditor1.Keys[1] := TestText; CheckTranslation(ValueListEditor1.Name, ValueListEditor1.Keys[1]); ValueListEditor1.Values[TestText] := TestText; CheckTranslation(ValueListEditor1.Name, ValueListEditor1.Values[TestText]); end; procedure TForm1.Button3Click(Sender: TObject); var X, Y: Integer; Content: string; S: string; Wide: WideString; begin OpenDialog1.Filter := TestText + '|*.*'; OpenDialog1.FileName := TestText; OpenDialog1.Execute; CheckTranslation(OpenDialog1.Name, OpenDialog1.FileName); SaveDialog1.Filter := TestText + '|*.*'; SaveDialog1.FileName := TestText; SaveDialog1.Execute; CheckTranslation(SaveDialog1.Name, SaveDialog1.FileName); Wide := TestText; // fails on D7, should work on bds, delphi converts it on compiletime S := TestText; Wide := S; S := Wide; Assert(S = TestText); //FatalAppExitW(0, PWideChar(Wide)); ShowMessage(Wide); Content := Menu1.Caption; Content := menuItem1.Caption; Content := Label1.Caption; Content := Edit1.Text; Content := Memo1.Text; Content := Button1.Caption; Content := CheckBox1.Caption; Content := RadioButton1.Caption; if ListBox1.Items.Count > 0 then Content := ListBox1.Items[0]; if ComboBox1.Items.Count > 0 then Content := ComboBox1.Items[0]; Content := ComboBox1.Text; Content := GroupBox1.Caption; Content := RadioGroup1.Caption; Content := Button2.Caption; Content := RichEdit1.Text; Content := Application.Title; Content := Self.Caption; Content := Self.Text; for Y := 0 to StringGrid1.RowCount -1 do for X := 0 to StringGrid1.ColCount -1 do Content := StringGrid1.Rows[Y][X]; ShowMessageFmt('%s', [TestText]); OutputDebugString(PChar(TestText)); Content := Menu1.Caption; Menu1.Caption := Content; Assert(Menu1.Caption = Content); Content := menuItem1.Caption; menuItem1.Caption := Content; Assert(menuItem1.Caption = Content); Content := Label1.Caption; Label1.Caption := Content; Assert(Label1.Caption = Content); Content := Edit1.Text; Edit1.Text := Content; Assert(Edit1.Text = Content); Content := Memo1.Text; Memo1.Text := Content; Assert(Memo1.Text = Content); Content := Button1.Caption; Button1.Caption := Content; Assert(Button1.Caption = Content); Content := CheckBox1.Caption; CheckBox1.Caption := Content; Assert(CheckBox1.Caption = Content); Content := RadioButton1.Caption; RadioButton1.Caption := Content; Assert(RadioButton1.Caption = Content); if ListBox1.Items.Count > 0 then begin Content := ListBox1.Items[0]; ListBox1.Items[0] := Content; Assert(ListBox1.Items[0] = Content); end; if ComboBox1.Items.Count > 0 then begin Content := ComboBox1.Items[0]; ComboBox1.Items[0] := Content; Assert(ComboBox1.Items[0] = Content); end; Content := ComboBox1.Text; ComboBox1.Text := Content; Assert(ComboBox1.Text = Content); Content := GroupBox1.Caption; GroupBox1.Caption := Content; Assert(GroupBox1.Caption = Content); Content := RadioGroup1.Caption; RadioGroup1.Caption := Content; Assert(RadioGroup1.Caption = Content); Content := Button2.Caption; Button2.Caption := Content; Assert(Button2.Caption = Content); Content := RichEdit1.Text; RichEdit1.Text := Content; Assert(RichEdit1.Text = Content); Content := Application.Title; Application.Title := Content; Assert(Application.Title = Content); Content := Self.Caption; Self.Caption := Content; Assert(Self.Caption = Content); Content := Self.Text; Self.Text := Content; Assert(Self.Text = Content); for Y := 0 to StringGrid1.RowCount - 1 do for X := 0 to StringGrid1.ColCount - 1 do begin Content := StringGrid1.Rows[Y][X]; StringGrid1.Rows[Y][X] := Content; Assert(StringGrid1.Rows[Y][X] = Content); end; end; procedure TForm1.Button4Click(Sender: TObject); begin FatalAppExit(0, PAnsiChar(TestText)); end; end. |
From: Robert M. <mar...@us...> - 2007-04-16 09:33:11
|
Update of /cvsroot/utf8vcl/utf8vcl/Samples In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv12105/Samples Log Message: Directory /cvsroot/utf8vcl/utf8vcl/Samples added to the repository |
Update of /cvsroot/utf8vcl/utf8vcl In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv11151 Removed Files: JVCLMainTest.dfm JVCLMainTest.pas JVCLTest.cfg JVCLTest.dpr TestForm.dfm TestForm.pas UTF8Test.cfg UTF8Test.dpr Log Message: separate samples directory --- JVCLMainTest.pas DELETED --- --- TestForm.dfm DELETED --- --- JVCLTest.cfg DELETED --- --- UTF8Test.cfg DELETED --- --- JVCLMainTest.dfm DELETED --- --- UTF8Test.dpr DELETED --- --- TestForm.pas DELETED --- --- JVCLTest.dpr DELETED --- |
From: Robert M. <mar...@us...> - 2007-04-03 12:23:36
|
Update of /cvsroot/utf8vcl/utf8vcl In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv20389 Modified Files: UTF8VCL.pas Log Message: made NonUTF8DefaultSystemCodePage available Index: UTF8VCL.pas =================================================================== RCS file: /cvsroot/utf8vcl/utf8vcl/UTF8VCL.pas,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** UTF8VCL.pas 31 Mar 2007 17:03:48 -0000 1.27 --- UTF8VCL.pas 3 Apr 2007 12:23:20 -0000 1.28 *************** *** 139,142 **** --- 139,144 ---- NonUTF8DefFrameProc: TDefFrameProcA; + NonUTF8DefaultSystemCodePage: Integer; + implementation *************** *** 684,687 **** --- 686,690 ---- NonUTF8DefMDIChildProc := HookUser32Func('DefMDIChildProcA', @DefMDIChildProcAIntercept); // do not localize NonUTF8DefDlgProc := HookUser32Func('DefDlgProcA', @DefDlgProcAIntercept); // do not localize + NonUTF8DefFrameProc := HookUser32Func('DefFrameProcA', @DefFrameProcAIntercept); // do not localize NonUTF8GetWindowText := HookUser32Func('GetWindowTextA', @GetWindowTextAIntercept); // do not localize *************** *** 703,709 **** NonUTF8GetFileTitle := HookCommdlg32Func('GetFileTitleA', @GetFileTitleAIntercept); // do not localize NonUTF8ChooseColor := HookCommdlg32Func('ChooseColorA', @ChooseColorAIntercept); // do not localize - - NonUTF8DefFrameProc := HookUser32Func('DefFrameProcA', @DefFrameProcAIntercept); // do not localize - end else --- 706,709 ---- *************** *** 714,717 **** --- 714,718 ---- initialization + NonUTF8DefaultSystemCodePage := GetACP; ActivateUtf8VCL(True); {$IF CompilerVersion >= 18.0} |
From: Bart v. d. W. <blu...@us...> - 2007-03-31 17:03:56
|
Update of /cvsroot/utf8vcl/utf8vcl In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv1136 Modified Files: UTF8VCL.pas UTF8VCLMessages.pas UTF8VCLUtils.pas Log Message: Support for inner frames and MDI was missing, added. Index: UTF8VCLUtils.pas =================================================================== RCS file: /cvsroot/utf8vcl/utf8vcl/UTF8VCLUtils.pas,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** UTF8VCLUtils.pas 25 Mar 2007 11:46:22 -0000 1.15 --- UTF8VCLUtils.pas 31 Mar 2007 17:03:48 -0000 1.16 *************** *** 41,44 **** --- 41,45 ---- type TStdWndProcDef = function(Window: HWND; Msg, WParam: Longint; LParam: Longint): Longint; stdcall; + TStdFrameWndProcDef = function(Window, ChildWindow: HWND; Msg, WParam: Longint; LParam: Longint): Longint; stdcall; TStdWndProcInterceptDef = function(Original: TStdWndProcDef; Window: HWND; Msg, WParam: Longint; LParam: Longint): Longint; Index: UTF8VCL.pas =================================================================== RCS file: /cvsroot/utf8vcl/utf8vcl/UTF8VCL.pas,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** UTF8VCL.pas 28 Mar 2007 20:19:30 -0000 1.26 --- UTF8VCL.pas 31 Mar 2007 17:03:48 -0000 1.27 *************** *** 91,94 **** --- 91,95 ---- TGetFileTitleA = function(FileName: PAnsiChar; Title: PAnsiChar; TitleSize: Word): Smallint; stdcall; TChooseColorAProc = function(var CC: TChooseColorA): Bool; stdcall; + TDefFrameProcA = function(hWnd: HWND; hChldWnd: HWND; Msg: UINT; wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall; var *************** *** 136,139 **** --- 137,142 ---- NonUTF8ChooseColor: TChooseColorAProc; + NonUTF8DefFrameProc: TDefFrameProcA; + implementation *************** *** 155,161 **** TempWParam, TempLParam: Longint; begin ! MessageU2WBefore(hWnd, Msg, WParam, LParam, TempWParam, TempLParam, Pointer(@SendMessageW)); Result := SendMessageW(hWnd, Msg, TempWParam, TempLParam); ! Result := MessageU2WAfter(hWnd, Msg, WParam, LParam, TempWParam, TempLParam, Result, Pointer(@SendMessageW)); end; --- 158,164 ---- TempWParam, TempLParam: Longint; begin ! MessageU2WBefore(hWnd, 0, Msg, WParam, LParam, TempWParam, TempLParam, Pointer(@SendMessageW), nil); Result := SendMessageW(hWnd, Msg, TempWParam, TempLParam); ! Result := MessageU2WAfter(hWnd, 0, Msg, WParam, LParam, TempWParam, TempLParam, Result, Pointer(@SendMessageW), nil); end; *************** *** 164,170 **** TempWParam, TempLParam: Longint; begin ! MessageU2WBefore(hWnd, Msg, WParam, LParam, TempWParam, TempLParam, Pointer(@PostMessageW)); Result := PostMessageW(hWnd, Msg, TempWParam, TempLParam); ! MessageU2WAfter(hWnd, Msg, WParam, LParam, TempWParam, TempLParam, 0, Pointer(@PostMessageW)); end; --- 167,173 ---- TempWParam, TempLParam: Longint; begin ! MessageU2WBefore(hWnd, 0, Msg, WParam, LParam, TempWParam, TempLParam, Pointer(@PostMessageW), nil); Result := PostMessageW(hWnd, Msg, TempWParam, TempLParam); ! MessageU2WAfter(hWnd, 0, Msg, WParam, LParam, TempWParam, TempLParam, 0, Pointer(@PostMessageW), nil); end; *************** *** 179,185 **** TStdWndProcDef(Proc) := WndProcConvertW2U(lpPrevWndFunc, StdWndProcInterceptU2W, StdWndProcInterceptW2U); ! MessageU2WBefore(hWnd, Msg, WParam, LParam, TempWParam, TempLParam, TStdWndProcDef(Proc)); Result := CallWindowProcW(Proc, hWnd, Msg, TempWParam, TempLParam); ! Result := MessageU2WAfter(hWnd, Msg, WParam, LParam, TempWParam, TempLParam, Result, TStdWndProcDef(Proc)); end; --- 182,188 ---- TStdWndProcDef(Proc) := WndProcConvertW2U(lpPrevWndFunc, StdWndProcInterceptU2W, StdWndProcInterceptW2U); ! MessageU2WBefore(hWnd, 0, Msg, WParam, LParam, TempWParam, TempLParam, TStdWndProcDef(Proc), nil); Result := CallWindowProcW(Proc, hWnd, Msg, TempWParam, TempLParam); ! Result := MessageU2WAfter(hWnd, 0, Msg, WParam, LParam, TempWParam, TempLParam, Result, TStdWndProcDef(Proc), nil); end; *************** *** 452,458 **** TempWParam, TempLParam: Longint; begin ! MessageU2WBefore(hWnd, Msg, WParam, LParam, TempWParam, TempLParam, Pointer(@DefWindowProcW)); Result := DefWindowProcW(hWnd, Msg, TempWParam, TempLParam); ! Result := MessageU2WAfter(hWnd, Msg, WParam, LParam, TempWParam, TempLParam, Result, Pointer(@DefWindowProcW)); end; --- 455,461 ---- TempWParam, TempLParam: Longint; begin ! MessageU2WBefore(hWnd, 0, Msg, WParam, LParam, TempWParam, TempLParam, Pointer(@DefWindowProcW), nil); Result := DefWindowProcW(hWnd, Msg, TempWParam, TempLParam); ! Result := MessageU2WAfter(hWnd, 0, Msg, WParam, LParam, TempWParam, TempLParam, Result, Pointer(@DefWindowProcW), nil); end; *************** *** 461,467 **** TempWParam, TempLParam: Longint; begin ! MessageU2WBefore(hWnd, Msg, WParam, LParam, TempWParam, TempLParam, Pointer(nil)); Result := DefMDIChildProcW(hWnd, Msg, TempWParam, TempLParam); ! Result := MessageU2WAfter(hWnd, Msg, WParam, LParam, TempWParam, TempLParam, Result, Pointer(nil)); end; --- 464,470 ---- TempWParam, TempLParam: Longint; begin ! MessageU2WBefore(hWnd, 0, Msg, WParam, LParam, TempWParam, TempLParam, Pointer(@DefMDIChildProcW), nil); Result := DefMDIChildProcW(hWnd, Msg, TempWParam, TempLParam); ! Result := MessageU2WAfter(hWnd, 0, Msg, WParam, LParam, TempWParam, TempLParam, Result, Pointer(@DefMDIChildProcW), nil); end; *************** *** 470,476 **** TempWParam, TempLParam: Longint; begin ! MessageU2WBefore(hWnd, Msg, WParam, LParam, TempWParam, TempLParam, Pointer(@DefDlgProcW)); Result := DefDlgProcW(hWnd, Msg, TempWParam, TempLParam); ! Result := MessageU2WAfter(hWnd, Msg, WParam, LParam, TempWParam, TempLParam, Result, Pointer(@DefDlgProcW)); end; --- 473,479 ---- TempWParam, TempLParam: Longint; begin ! MessageU2WBefore(hWnd, 0, Msg, WParam, LParam, TempWParam, TempLParam, Pointer(@DefDlgProcW), nil); Result := DefDlgProcW(hWnd, Msg, TempWParam, TempLParam); ! Result := MessageU2WAfter(hWnd, 0, Msg, WParam, LParam, TempWParam, TempLParam, Result, Pointer(@DefDlgProcW), nil); end; *************** *** 599,602 **** --- 602,614 ---- end; + function DefFrameProcAIntercept(hWnd: HWND; hChildWnd: HWND; Msg: UINT; WParam: WPARAM; LParam: LPARAM): LRESULT; stdcall; + var + TempWParam, TempLParam: Longint; + begin + MessageU2WBefore(hWnd, hChildWnd, Msg, WParam, LParam, TempWParam, TempLParam, nil, Pointer(@DefFrameProcW)); + Result := DefFrameProcW(hWnd, hChildWnd, Msg, TempWParam, TempLParam); + Result := MessageU2WAfter(hWnd, hChildWnd, Msg, WParam, LParam, TempWParam, TempLParam, Result, nil, Pointer(@DefFrameProcW)); + end; + //============================================================================ *************** *** 691,694 **** --- 703,709 ---- NonUTF8GetFileTitle := HookCommdlg32Func('GetFileTitleA', @GetFileTitleAIntercept); // do not localize NonUTF8ChooseColor := HookCommdlg32Func('ChooseColorA', @ChooseColorAIntercept); // do not localize + + NonUTF8DefFrameProc := HookUser32Func('DefFrameProcA', @DefFrameProcAIntercept); // do not localize + end else Index: UTF8VCLMessages.pas =================================================================== RCS file: /cvsroot/utf8vcl/utf8vcl/UTF8VCLMessages.pas,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** UTF8VCLMessages.pas 31 Mar 2007 13:58:32 -0000 1.26 --- UTF8VCLMessages.pas 31 Mar 2007 17:03:48 -0000 1.27 *************** *** 42,53 **** function StdWndProcInterceptW2U(Original: TStdWndProcDef; hWnd: HWND; Msg, WParam: Longint; LParam: Longint): Longint; ! procedure MessageW2UBefore(hWnd: HWND; Msg: UINT; InWParam: WPARAM; InLParam: LPARAM; ! out OutWParam: WPARAM; out OutLParam: LPARAM; Proc: TStdWndProcDef); ! function MessageW2UAfter(hWnd: HWND; Msg: UINT; InWParam: WPARAM; InLParam: LPARAM; ! TempWParam: WPARAM; TempLParam: LPARAM; TempResult: LRESULT; Proc: TStdWndProcDef): LRESULT; ! procedure MessageU2WBefore(hWnd: HWND; Msg: UINT; InWParam: WPARAM; InLParam: LPARAM; ! out OutWParam: WPARAM; out OutLParam: LPARAM; Proc: TStdWndProcDef); ! function MessageU2WAfter(hWnd: HWND; Msg: UINT; InWParam: WPARAM; InLParam: LPARAM; ! TempWParam: WPARAM; TempLParam: LPARAM; TempResult: LRESULT; Proc: TStdWndProcDef): LRESULT; implementation --- 42,53 ---- function StdWndProcInterceptW2U(Original: TStdWndProcDef; hWnd: HWND; Msg, WParam: Longint; LParam: Longint): Longint; ! procedure MessageW2UBefore(hWnd, hChildWnd: HWND; Msg: UINT; InWParam: WPARAM; InLParam: LPARAM; ! out OutWParam: WPARAM; out OutLParam: LPARAM; Proc: TStdWndProcDef; FrameProc: TStdFrameWndProcDef); ! function MessageW2UAfter(hWnd, hChildWnd: HWND; Msg: UINT; InWParam: WPARAM; InLParam: LPARAM; ! TempWParam: WPARAM; TempLParam: LPARAM; TempResult: LRESULT; Proc: TStdWndProcDef; FrameProc: TStdFrameWndProcDef): LRESULT; ! procedure MessageU2WBefore(hWnd, hChildWnd: HWND; Msg: UINT; InWParam: WPARAM; InLParam: LPARAM; ! out OutWParam: WPARAM; out OutLParam: LPARAM; Proc: TStdWndProcDef; FrameProc: TStdFrameWndProcDef); ! function MessageU2WAfter(hWnd, hChildWnd: HWND; Msg: UINT; InWParam: WPARAM; InLParam: LPARAM; ! TempWParam: WPARAM; TempLParam: LPARAM; TempResult: LRESULT; Proc: TStdWndProcDef; FrameProc: TStdFrameWndProcDef): LRESULT; implementation *************** *** 77,83 **** else begin ! MessageW2UBefore(hWnd, Msg, WParam, LParam, TempWParam, TempLParam, Original); Result := Original(hWnd, Msg, TempWParam, TempLParam); ! Result := MessageW2UAfter(hWnd, Msg, WParam, LParam, TempWParam, TempLParam, Result, Original); end; end; --- 77,83 ---- else begin ! MessageW2UBefore(hWnd, 0, Msg, WParam, LParam, TempWParam, TempLParam, Original, nil); Result := Original(hWnd, Msg, TempWParam, TempLParam); ! Result := MessageW2UAfter(hWnd, 0, Msg, WParam, LParam, TempWParam, TempLParam, Result, Original, nil); end; end; *************** *** 87,97 **** TempWParam, TempLParam: Longint; begin ! MessageU2WBefore(hWnd, Msg, WParam, LParam, TempWParam, TempLParam, Pointer(@CallWindowProcW)); Result := CallWindowProcW(@Original, hWnd, Msg, WParam, LParam); ! Result := MessageU2WAfter(hWnd, Msg, WParam, LParam, TempWParam, TempLParam, Result, Pointer(@CallWindowProcW)); end; ! procedure MessageW2UBefore(hWnd: HWND; Msg: UINT; InWParam: WPARAM; InLParam: LPARAM; ! out OutWParam: WPARAM; out OutLParam: LPARAM; Proc: TStdWndProcDef); var L: Integer; --- 87,97 ---- TempWParam, TempLParam: Longint; begin ! MessageU2WBefore(hWnd, 0, Msg, WParam, LParam, TempWParam, TempLParam, Pointer(@CallWindowProcW), nil); Result := CallWindowProcW(@Original, hWnd, Msg, WParam, LParam); ! Result := MessageU2WAfter(hWnd, 0, Msg, WParam, LParam, TempWParam, TempLParam, Result, Pointer(@CallWindowProcW), nil); end; ! procedure MessageW2UBefore(hWnd, hChildWnd: HWND; Msg: UINT; InWParam: WPARAM; InLParam: LPARAM; ! out OutWParam: WPARAM; out OutLParam: LPARAM; Proc: TStdWndProcDef; FrameProc: TStdFrameWndProcDef); var L: Integer; *************** *** 103,108 **** WM_GETTEXT: begin ! Assert(not SpecialWndProc(Cardinal(@Proc))); ! L := Proc(hWnd, WM_GETTEXTLENGTH, UnusedWParam, UnusedLParam); if L > 0 then begin --- 103,110 ---- WM_GETTEXT: begin ! if Assigned(Proc) then ! L := Proc(hWnd, WM_GETTEXTLENGTH, UnusedWParam, UnusedLParam) ! else ! L := FrameProc(hWnd, hChildWnd, WM_GETTEXTLENGTH, UnusedWParam, UnusedLParam); if L > 0 then begin *************** *** 116,121 **** LB_GETTEXT: begin ! Assert(not SpecialWndProc(Cardinal(@Proc))); ! L := Proc(hWnd, LB_GETTEXTLEN, InWParam, UnusedLParam); if L > 0 then GetMem(Pointer(OutLParam), SizeOf(Utf8Byte) * (L + 1)) --- 118,125 ---- LB_GETTEXT: begin ! if Assigned(Proc) then ! L := Proc(hWnd, LB_GETTEXTLEN, InWParam, UnusedLParam) ! else ! L := FrameProc(hWnd, hChildWnd, LB_GETTEXTLEN, InWParam, UnusedLParam); if L > 0 then GetMem(Pointer(OutLParam), SizeOf(Utf8Byte) * (L + 1)) *************** *** 125,130 **** CB_GETLBTEXT: begin ! Assert(not SpecialWndProc(Cardinal(@Proc))); ! L := Proc(hWnd, CB_GETLBTEXTLEN, InWParam, UnusedLParam); GetMem(Pointer(OutLParam), SizeOf(Utf8Byte) * (L + 1)) end; --- 129,136 ---- CB_GETLBTEXT: begin ! if Assigned(Proc) then ! L := Proc(hWnd, CB_GETLBTEXTLEN, InWParam, UnusedLParam) ! else ! L := FrameProc(hWnd, hChildWnd, CB_GETLBTEXTLEN, InWParam, UnusedLParam); GetMem(Pointer(OutLParam), SizeOf(Utf8Byte) * (L + 1)) end; *************** *** 166,171 **** end; ! function MessageW2UAfter(hWnd: HWND; Msg: UINT; InWParam: WPARAM; InLParam: LPARAM; ! TempWParam: WPARAM; TempLParam: LPARAM; TempResult: LRESULT; Proc: TStdWndProcDef): LRESULT; var Len: Integer; --- 172,177 ---- end; ! function MessageW2UAfter(hWnd, hChildWnd: HWND; Msg: UINT; InWParam: WPARAM; InLParam: LPARAM; ! TempWParam: WPARAM; TempLParam: LPARAM; TempResult: LRESULT; Proc: TStdWndProcDef; FrameProc: TStdFrameWndProcDef): LRESULT; var Len: Integer; *************** *** 227,232 **** GetMem(X, SizeOf(Utf8Byte) * (TempResult + 1)); try ! Assert(not SpecialWndProc(Cardinal(@Proc))); ! Len := Proc(hWnd, WM_GETTEXT, TempResult + 1, LParam(X)); // Len is exclusive #0 TempResult := ConvertFromUTF8Len(X, Len); --- 233,240 ---- GetMem(X, SizeOf(Utf8Byte) * (TempResult + 1)); try ! if Assigned(Proc) then ! Len := Proc(hWnd, WM_GETTEXT, TempResult + 1, LParam(X)) ! else ! Len := FrameProc(hWnd, hChildWnd, WM_GETTEXT, TempResult + 1, LParam(X)); // Len is exclusive #0 TempResult := ConvertFromUTF8Len(X, Len); *************** *** 242,247 **** GetMem(X, SizeOf(Utf8Byte) * (TempResult + 1)); try ! Assert(not SpecialWndProc(Cardinal(@Proc))); ! Len := Proc(hWnd, LB_GETTEXT, InWParam, LParam(X)); TempResult := ConvertFromUTF8Len(X, Len); finally --- 250,257 ---- GetMem(X, SizeOf(Utf8Byte) * (TempResult + 1)); try ! if Assigned(Proc) then ! Len := Proc(hWnd, LB_GETTEXT, InWParam, LParam(X)) ! else ! Len := FrameProc(hWnd, hChildWnd, LB_GETTEXT, InWParam, LParam(X)); TempResult := ConvertFromUTF8Len(X, Len); finally *************** *** 256,261 **** GetMem(X, SizeOf(Utf8Byte) * (TempResult + 1)); try ! Assert(not SpecialWndProc(Cardinal(@Proc))); ! Len := Proc(hWnd, CB_GETLBTEXT, InWParam, LParam(X)); TempResult := ConvertFromUTF8Len(X, Len); finally --- 266,273 ---- GetMem(X, SizeOf(Utf8Byte) * (TempResult + 1)); try ! if Assigned(Proc) then ! Len := Proc(hWnd, CB_GETLBTEXT, InWParam, LParam(X)) ! else ! Len := FrameProc(hWnd, hChildWnd, CB_GETLBTEXT, InWParam, LParam(X)); TempResult := ConvertFromUTF8Len(X, Len); finally *************** *** 268,273 **** end; ! procedure MessageU2WBefore(hWnd: HWND; Msg: UINT; InWParam: WPARAM; InLParam: LPARAM; ! out OutWParam: WPARAM; out OutLParam: LPARAM; Proc: TStdWndProcDef); var L: Integer; --- 280,285 ---- end; ! procedure MessageU2WBefore(hWnd, hChildWnd: HWND; Msg: UINT; InWParam: WPARAM; InLParam: LPARAM; ! out OutWParam: WPARAM; out OutLParam: LPARAM; Proc: TStdWndProcDef; FrameProc: TStdFrameWndProcDef); var L: Integer; *************** *** 282,286 **** WM_GETTEXT: begin ! L := CallWindowProcW(@Proc, hWnd, WM_GETTEXTLENGTH, UnusedWParam, UnusedLParam); if L > 0 then begin --- 294,301 ---- WM_GETTEXT: begin ! if Assigned(FrameProc) then ! L := FrameProc(hWnd, hChildWnd, WM_GETTEXTLENGTH, UnusedWParam, UnusedLParam) ! else ! L := CallWindowProcW(@Proc, hWnd, WM_GETTEXTLENGTH, UnusedWParam, UnusedLParam); if L > 0 then begin *************** *** 294,298 **** LB_GETTEXT: begin ! L := CallWindowProcW(@Proc, hWnd, LB_GETTEXTLEN, InWParam, UnusedLParam); if L > 0 then GetMem(Pointer(OutLParam), SizeOf(WideChar) * (L + 1)) --- 309,316 ---- LB_GETTEXT: begin ! if Assigned(FrameProc) then ! L := FrameProc(hWnd, hChildWnd, LB_GETTEXTLEN, InWParam, UnusedLParam) ! else ! L := CallWindowProcW(@Proc, hWnd, LB_GETTEXTLEN, InWParam, UnusedLParam); if L > 0 then GetMem(Pointer(OutLParam), SizeOf(WideChar) * (L + 1)) *************** *** 302,306 **** CB_GETLBTEXT: begin ! L := CallWindowProcW(@Proc, hWnd, CB_GETLBTEXTLEN, InWParam, UnusedLParam); GetMem(Pointer(OutLParam), SizeOf(WideChar) * (L + 1)) end; --- 320,327 ---- CB_GETLBTEXT: begin ! if Assigned(FrameProc) then ! L := FrameProc(hWnd, hChildWnd, CB_GETLBTEXTLEN, InWParam, UnusedLParam) ! else ! L := CallWindowProcW(@Proc, hWnd, CB_GETLBTEXTLEN, InWParam, UnusedLParam); GetMem(Pointer(OutLParam), SizeOf(WideChar) * (L + 1)) end; *************** *** 341,346 **** end; ! function MessageU2WAfter(hWnd: HWND; Msg: UINT; InWParam: WPARAM; InLParam: LPARAM; ! TempWParam: WPARAM; TempLParam: LPARAM; TempResult: LRESULT; Proc: TStdWndProcDef): LRESULT; var Len: Integer; --- 362,367 ---- end; ! function MessageU2WAfter(hWnd, hChildWnd: HWND; Msg: UINT; InWParam: WPARAM; InLParam: LPARAM; ! TempWParam: WPARAM; TempLParam: LPARAM; TempResult: LRESULT; Proc: TStdWndProcDef; FrameProc: TStdFrameWndProcDef): LRESULT; var Len: Integer; *************** *** 400,404 **** GetMem(X, SizeOf(WideChar) * (TempResult + 1)); try ! Len := CallWindowProcW(@Proc, hWnd, WM_GETTEXT, TempResult + 1, LParam(X)); TempResult := ConvertToUTF8Len(X, Len) finally --- 421,428 ---- GetMem(X, SizeOf(WideChar) * (TempResult + 1)); try ! if Assigned(FrameProc) then ! Len := FrameProc(hWnd, hChildWnd, WM_GETTEXT, TempResult + 1, LParam(X)) ! else ! Len := CallWindowProcW(@Proc, hWnd, WM_GETTEXT, TempResult + 1, LParam(X)); TempResult := ConvertToUTF8Len(X, Len) finally *************** *** 413,417 **** GetMem(X, SizeOf(WideChar) * (TempResult + 1)); try ! Len := CallWindowProcW(@Proc, hWnd, LB_GETTEXT, InWParam, LParam(X)); TempResult := ConvertToUTF8Len(X, Len) finally --- 437,444 ---- GetMem(X, SizeOf(WideChar) * (TempResult + 1)); try ! if Assigned(FrameProc) then ! Len := FrameProc(hWnd, hChildWnd, LB_GETTEXT, InWParam, LParam(X)) ! else ! Len := CallWindowProcW(@Proc, hWnd, LB_GETTEXT, InWParam, LParam(X)); TempResult := ConvertToUTF8Len(X, Len) finally *************** *** 426,430 **** GetMem(X, SizeOf(WideChar) * (TempResult + 1)); try ! Len := CallWindowProcW(@Proc, hWnd, CB_GETLBTEXT, InWParam, LParam(X)); TempResult := ConvertToUTF8Len(X, Len); finally --- 453,460 ---- GetMem(X, SizeOf(WideChar) * (TempResult + 1)); try ! if Assigned(FrameProc) then ! Len := FrameProc(hWnd, hChildWnd, CB_GETLBTEXT, InWParam, LParam(X)) ! else ! Len := CallWindowProcW(@Proc, hWnd, CB_GETLBTEXT, InWParam, LParam(X)); TempResult := ConvertToUTF8Len(X, Len); finally |
From: Robert M. <mar...@us...> - 2007-03-31 13:58:36
|
Update of /cvsroot/utf8vcl/utf8vcl In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv17027 Modified Files: UTF8VCLMessages.pas Log Message: only some ordering for the case labels Index: UTF8VCLMessages.pas =================================================================== RCS file: /cvsroot/utf8vcl/utf8vcl/UTF8VCLMessages.pas,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** UTF8VCLMessages.pas 30 Mar 2007 22:27:22 -0000 1.25 --- UTF8VCLMessages.pas 31 Mar 2007 13:58:32 -0000 1.26 *************** *** 152,159 **** PMDICreateStructA(OutLParam).szTitle := ConvertToUTF8(PMDICreateStructW(InLParam).szTitle); 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 --- 152,159 ---- PMDICreateStructA(OutLParam).szTitle := ConvertToUTF8(PMDICreateStructW(InLParam).szTitle); end; ! WM_SETTEXT, WM_WININICHANGE, WM_DEVMODECHANGE, ! EM_REPLACESEL, ! LB_ADDSTRING, LB_DIR, LB_INSERTSTRING, LB_ADDFILE, LB_FINDSTRING, LB_FINDSTRINGEXACT, LB_SELECTSTRING, ! CB_ADDSTRING, CB_INSERTSTRING, CB_FINDSTRING, CB_DIR, CB_FINDSTRINGEXACT: OutLParam := LPARAM(ConvertToUTF8(PWideChar(InLParam))); // character fiddling, TODO *************** *** 213,219 **** FreeMemory(PMDICreateStructA(TempLParam)); 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)); --- 213,220 ---- FreeMemory(PMDICreateStructA(TempLParam)); end; ! WM_SETTEXT, WM_WININICHANGE, WM_DEVMODECHANGE, ! EM_REPLACESEL, ! LB_DIR, LB_ADDFILE, LB_ADDSTRING, LB_INSERTSTRING, LB_FINDSTRING, LB_FINDSTRINGEXACT, LB_SELECTSTRING, ! CB_DIR, CB_ADDSTRING, CB_INSERTSTRING, CB_FINDSTRING, CB_FINDSTRINGEXACT: FreeMem(PChar(TempLParam)); *************** *** 327,333 **** PMDICreateStructW(OutLParam).szTitle := ConvertFromUTF8(PMDICreateStructA(InLParam).szTitle); 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 --- 328,335 ---- PMDICreateStructW(OutLParam).szTitle := ConvertFromUTF8(PMDICreateStructA(InLParam).szTitle); end; ! WM_SETTEXT, WM_WININICHANGE, WM_DEVMODECHANGE, ! EM_REPLACESEL, ! LB_DIR, LB_ADDFILE, LB_ADDSTRING, LB_INSERTSTRING, LB_FINDSTRING, LB_FINDSTRINGEXACT, LB_SELECTSTRING, ! CB_DIR, CB_ADDSTRING, CB_INSERTSTRING, CB_FINDSTRING, CB_FINDSTRINGEXACT: OutLParam := LPARAM(ConvertFromUTF8(PChar(InLParam))); //character fiddling, TODO *************** *** 386,392 **** FreeMemory(PMDICreateStructW(TempLParam)); 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: --- 388,395 ---- FreeMemory(PMDICreateStructW(TempLParam)); end; ! WM_SETTEXT, WM_WININICHANGE, WM_DEVMODECHANGE, ! EM_REPLACESEL, ! LB_DIR, LB_ADDFILE, LB_ADDSTRING, LB_INSERTSTRING, LB_FINDSTRING, LB_FINDSTRINGEXACT, LB_SELECTSTRING, ! CB_DIR, CB_ADDSTRING, CB_INSERTSTRING, CB_FINDSTRING, CB_FINDSTRINGEXACT: FreeMem(PWideChar(TempLParam)); WM_GETTEXTLENGTH: |
From: Robert M. <mar...@us...> - 2007-03-31 06:32:19
|
Update of /cvsroot/utf8vcl/utf8vcl In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv13199 Modified Files: JVCLMainTest.pas Log Message: combos now translated Index: JVCLMainTest.pas =================================================================== RCS file: /cvsroot/utf8vcl/utf8vcl/JVCLMainTest.pas,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** JVCLMainTest.pas 29 Mar 2007 14:21:12 -0000 1.2 --- JVCLMainTest.pas 31 Mar 2007 06:32:11 -0000 1.3 *************** *** 65,69 **** JvOfficeColorButton1.Properties.CustomColorHint := TestText; JvHTButton1.Caption := TestText; ! JvBehaviorLabel1.Caption := TestText + ' ' + TestText + ' ' + TestText; JvBehaviorLabel1.BehaviorOptions.Active := True; JvInstallLabel1.Lines[0] := TestText; --- 65,69 ---- JvOfficeColorButton1.Properties.CustomColorHint := TestText; JvHTButton1.Caption := TestText; ! JvBehaviorLabel1.Caption := TestText + ' ' + TestText; JvBehaviorLabel1.BehaviorOptions.Active := True; JvInstallLabel1.Lines[0] := TestText; *************** *** 74,77 **** --- 74,82 ---- JvStaticText1.Caption := TestText; JvLabel1.Caption := TestText; + JvImageComboBox1.Items[0].Text := TestText; + JvImageComboBox1.Items[1].Text := TestText; + JvImageCombobox1.ItemIndex := 0; + JvImageListBox1.Items[0].Text := TestText; + JvImageListBox1.Items[1].Text := TestText; end; |
From: Bart v. d. W. <blu...@us...> - 2007-03-30 22:27:32
|
Update of /cvsroot/utf8vcl/utf8vcl In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv21513 Modified Files: JVCLTest.dpr TestForm.pas UTF8VCLMessages.pas Log Message: remove unused dependecy on gauges. allways pass a buffer for some gettext stuff. Index: JVCLTest.dpr =================================================================== RCS file: /cvsroot/utf8vcl/utf8vcl/JVCLTest.dpr,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** JVCLTest.dpr 29 Mar 2007 11:59:37 -0000 1.1 --- JVCLTest.dpr 30 Mar 2007 22:27:22 -0000 1.2 *************** *** 2,5 **** --- 2,6 ---- uses + ShareMem, Forms, JVCLMainTest in 'JVCLMainTest.pas' {Form1}, Index: UTF8VCLMessages.pas =================================================================== RCS file: /cvsroot/utf8vcl/utf8vcl/UTF8VCLMessages.pas,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** UTF8VCLMessages.pas 28 Mar 2007 18:36:04 -0000 1.24 --- UTF8VCLMessages.pas 30 Mar 2007 22:27:22 -0000 1.25 *************** *** 127,134 **** Assert(not SpecialWndProc(Cardinal(@Proc))); L := Proc(hWnd, CB_GETLBTEXTLEN, InWParam, UnusedLParam); ! if L > 0 then ! GetMem(Pointer(OutLParam), SizeOf(Utf8Byte) * (L + 1)) ! else ! OutLParam := LPARAM(nil); end; EM_GETLINE: --- 127,131 ---- Assert(not SpecialWndProc(Cardinal(@Proc))); L := Proc(hWnd, CB_GETLBTEXTLEN, InWParam, UnusedLParam); ! GetMem(Pointer(OutLParam), SizeOf(Utf8Byte) * (L + 1)) end; EM_GETLINE: *************** *** 305,312 **** begin L := CallWindowProcW(@Proc, hWnd, CB_GETLBTEXTLEN, InWParam, UnusedLParam); ! if L > 0 then ! GetMem(Pointer(OutLParam), SizeOf(WideChar) * (L + 1)) ! else ! OutLParam := LPARAM(nil); end; EM_GETLINE: --- 302,306 ---- begin L := CallWindowProcW(@Proc, hWnd, CB_GETLBTEXTLEN, InWParam, UnusedLParam); ! GetMem(Pointer(OutLParam), SizeOf(WideChar) * (L + 1)) end; EM_GETLINE: Index: TestForm.pas =================================================================== RCS file: /cvsroot/utf8vcl/utf8vcl/TestForm.pas,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** TestForm.pas 25 Mar 2007 15:55:16 -0000 1.25 --- TestForm.pas 30 Mar 2007 22:27:22 -0000 1.26 *************** *** 12,16 **** Windows, SysUtils, Classes, Controls, Forms, Dialogs, ComCtrls, StdCtrls, Menus, Grids, ValEdit, Buttons, ExtCtrls, ! Mask, ActnList, CheckLst, DBGrids, Gauges, ShellCtrls; type --- 12,16 ---- Windows, SysUtils, Classes, Controls, Forms, Dialogs, ComCtrls, StdCtrls, Menus, Grids, ValEdit, Buttons, ExtCtrls, ! Mask, ActnList, CheckLst, DBGrids, ShellCtrls; type |
From: Robert M. <mar...@us...> - 2007-03-29 14:21:17
|
Update of /cvsroot/utf8vcl/utf8vcl In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv21460 Modified Files: JVCLMainTest.dfm JVCLMainTest.pas Log Message: more components added, now crashes instantly Index: JVCLMainTest.pas =================================================================== RCS file: /cvsroot/utf8vcl/utf8vcl/JVCLMainTest.pas,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** JVCLMainTest.pas 29 Mar 2007 11:59:37 -0000 1.1 --- JVCLMainTest.pas 29 Mar 2007 14:21:12 -0000 1.2 *************** *** 10,14 **** JvExButtons, JvButtons, JvFullColorSpaces, JvLabel, JvStaticText, JvFullColorCtrls, JvLinkLabel, JvHtControls, ! JvInstallLabel, JvExStdCtrls, JvBehaviorLabel; type --- 10,14 ---- JvExButtons, JvButtons, JvFullColorSpaces, JvLabel, JvStaticText, JvFullColorCtrls, JvLinkLabel, JvHtControls, ! JvInstallLabel, JvExStdCtrls, JvBehaviorLabel, JvCombobox, JvListComb; type *************** *** 34,37 **** --- 34,39 ---- JvLabel1: TJvLabel; JvFullColorLabel1: TJvFullColorLabel; + JvImageComboBox1: TJvImageComboBox; + JvImageListBox1: TJvImageListBox; procedure MainMenuItem1Click(Sender: TObject); procedure Exit1Click(Sender: TObject); Index: JVCLMainTest.dfm =================================================================== RCS file: /cvsroot/utf8vcl/utf8vcl/JVCLMainTest.dfm,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** JVCLMainTest.dfm 29 Mar 2007 11:59:37 -0000 1.1 --- JVCLMainTest.dfm 29 Mar 2007 14:21:12 -0000 1.2 *************** *** 89,95 **** Left = 280 Top = 200 ! Width = 185 ! Height = 25 Caption = 'JvFullColorLabel1' end object JvColorButton1: TJvColorButton --- 89,96 ---- Left = 280 Top = 200 ! Width = 109 ! Height = 17 Caption = 'JvFullColorLabel1' + AutoSize = True end object JvColorButton1: TJvColorButton *************** *** 165,168 **** --- 166,216 ---- WordWrap = False end + object JvImageComboBox1: TJvImageComboBox + Left = 512 + Top = 8 + Width = 145 + Height = 25 + Style = csOwnerDrawVariable + ButtonStyle = fsLighter + DroppedWidth = 145 + ImageHeight = 0 + ImageWidth = 0 + ItemHeight = 19 + ItemIndex = 0 + TabOrder = 4 + Items = < + item + Brush.Style = bsClear + Indent = 0 + Text = 'Item0' + end + item + Brush.Style = bsClear + Indent = 0 + Text = 'Item1' + end> + end + object JvImageListBox1: TJvImageListBox + Left = 512 + Top = 48 + Width = 121 + Height = 57 + Items = < + item + Brush.Style = bsClear + Indent = 0 + Text = 'Item0' + end + item + Brush.Style = bsClear + Indent = 0 + Text = 'Item1' + end> + ImageHeight = 0 + ImageWidth = 0 + ButtonStyle = fsLighter + ItemHeight = 19 + TabOrder = 5 + end object JvMainMenu1: TJvMainMenu Style = msItemPainter |
From: Robert M. <mar...@us...> - 2007-03-29 11:59:42
|
Update of /cvsroot/utf8vcl/utf8vcl In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv29562 Added Files: JVCLMainTest.dfm JVCLMainTest.pas JVCLTest.cfg JVCLTest.dpr Log Message: test program for JVCL --- NEW FILE: JVCLMainTest.pas --- unit JVCLMainTest; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, Menus, StdCtrls, Buttons, JvMenus, JvArrowButton, JvExControls, JvButton, JvTransparentButton, JvColorBox, JvColorButton, ExtCtrls, JvExExtCtrls, JvExtComponent, JvOfficeColorButton, JvExButtons, JvButtons, JvFullColorSpaces, JvLabel, JvStaticText, JvFullColorCtrls, JvLinkLabel, JvHtControls, JvInstallLabel, JvExStdCtrls, JvBehaviorLabel; type TForm1 = class(TForm) JvMainMenu1: TJvMainMenu; MainMenu1: TMenuItem; MainMenuItem1: TMenuItem; JvXPMenuItemPainter1: TJvXPMenuItemPainter; JvTransparentButton1: TJvTransparentButton; JvArrowButton1: TJvArrowButton; JvPopupMenu1: TJvPopupMenu; PopupItem11: TMenuItem; Popupitem21: TMenuItem; Exit1: TMenuItem; JvColorButton1: TJvColorButton; JvOfficeColorButton1: TJvOfficeColorButton; JvHTButton1: TJvHTButton; JvBehaviorLabel1: TJvBehaviorLabel; JvInstallLabel1: TJvInstallLabel; JvHTLabel1: TJvHTLabel; JvLinkLabel1: TJvLinkLabel; JvStaticText1: TJvStaticText; JvLabel1: TJvLabel; JvFullColorLabel1: TJvFullColorLabel; procedure MainMenuItem1Click(Sender: TObject); procedure Exit1Click(Sender: TObject); public end; var Form1: TForm1; implementation {$R *.dfm} const TestText1 = 'I'#$C3#$B1#$DB#$B3#$C3#$AB#$72#$D7#$90#$C3#$A2; TestText2 = 't'#$D1#$96#$C3#$B4#$EF#$A7#$A7#$C3#$A0#$6C#$D1#$96#$7A#$C3#$A6#$74#$E2#$98#$BA#$6E; TestText = TestText1 + TestText2; procedure TForm1.MainMenuItem1Click(Sender: TObject); begin JvMainMenu1.Items[0].Caption := TestText; MainMenuItem1.Caption := TestText; JvTransparentButton1.Caption := TestText; JvArrowButton1.Caption := TestText; JvPopupMenu1.Items[0].Caption := TestText; JvPopupMenu1.Items[1].Caption := TestText; JvColorButton1.OtherCaption := TestText; JvOfficeColorButton1.Properties.CustomColorCaption := TestText; JvOfficeColorButton1.Properties.CustomColorHint := TestText; JvHTButton1.Caption := TestText; JvBehaviorLabel1.Caption := TestText + ' ' + TestText + ' ' + TestText; JvBehaviorLabel1.BehaviorOptions.Active := True; JvInstallLabel1.Lines[0] := TestText; JvInstallLabel1.Lines[1] := TestText; JvHTLabel1.Caption := TestText + #13#10 + TestText; JvLinkLabel1.Caption := TestText; JvFullColorLabel1.Caption := TestText; JvStaticText1.Caption := TestText; JvLabel1.Caption := TestText; end; procedure TForm1.Exit1Click(Sender: TObject); begin Close; end; end. --- NEW FILE: JVCLMainTest.dfm --- object Form1: TForm1 Left = 192 Top = 123 Width = 1088 Height = 750 Caption = 'Form1' Color = clBtnFace Font.Charset = ANSI_CHARSET Font.Color = clWindowText Font.Height = -11 Font.Name = 'Arial Unicode MS' Font.Style = [] Menu = JvMainMenu1 OldCreateOrder = False PixelsPerInch = 96 TextHeight = 15 object JvTransparentButton1: TJvTransparentButton Left = 8 Top = 8 Width = 113 Height = 32 Caption = 'JvTransparentButton1' HotTrackFont.Charset = ANSI_CHARSET HotTrackFont.Color = clWindowText HotTrackFont.Height = -11 HotTrackFont.Name = 'Arial Unicode MS' HotTrackFont.Style = [] end object JvArrowButton1: TJvArrowButton Left = 8 Top = 56 Width = 113 Height = 25 DropDown = JvPopupMenu1 Caption = 'JvArrowButton1' FillFont.Charset = DEFAULT_CHARSET FillFont.Color = clWindowText FillFont.Height = -11 FillFont.Name = 'MS Sans Serif' FillFont.Style = [] end object JvBehaviorLabel1: TJvBehaviorLabel Left = 280 Top = 16 Width = 87 Height = 15 Behavior = 'Typing' Caption = 'JvBehaviorLabel1' end object JvInstallLabel1: TJvInstallLabel Left = 280 Top = 48 Width = 180 Height = 65 Lines.Strings = ( 'InstallLabelLine1' 'InstallLabelLine2') end object JvHTLabel1: TJvHTLabel Left = 280 Top = 128 Width = 185 Height = 33 AutoSize = False Caption = 'JvHTLabel1'#13#10'JvHTLabel1' WordWrap = True end object JvLinkLabel1: TJvLinkLabel Left = 280 Top = 176 Height = 15 Caption = 'JvLinkLabel1' Text.Strings = ( 'JvLinkLabel1') end object JvLabel1: TJvLabel Left = 280 Top = 256 Width = 46 Height = 15 Caption = 'JvLabel1' HotTrackFont.Charset = ANSI_CHARSET HotTrackFont.Color = clWindowText HotTrackFont.Height = -11 HotTrackFont.Name = 'Arial Unicode MS' HotTrackFont.Style = [] end object JvFullColorLabel1: TJvFullColorLabel Left = 280 Top = 200 Width = 185 Height = 25 Caption = 'JvFullColorLabel1' end object JvColorButton1: TJvColorButton Left = 136 Top = 16 Width = 105 OtherCaption = '&Other...' Options = [] CustomColors.Strings = ( '') TabOrder = 0 TabStop = False end object JvOfficeColorButton1: TJvOfficeColorButton Left = 136 Top = 56 Width = 105 Height = 22 TabOrder = 1 SelectedColor = clDefault HotTrackFont.Charset = DEFAULT_CHARSET HotTrackFont.Color = clWindowText HotTrackFont.Height = -11 HotTrackFont.Name = 'MS Sans Serif' HotTrackFont.Style = [] Properties.NoneColorCaption = 'No Color' Properties.DefaultColorCaption = 'Automatic' Properties.CustomColorCaption = 'Other Colors...' Properties.NoneColorHint = 'No Color' Properties.DefaultColorHint = 'Automatic' Properties.CustomColorHint = 'Other Colors...' Properties.NoneColorFont.Charset = DEFAULT_CHARSET Properties.NoneColorFont.Color = clWindowText Properties.NoneColorFont.Height = -11 Properties.NoneColorFont.Name = 'MS Sans Serif' Properties.NoneColorFont.Style = [] Properties.DefaultColorFont.Charset = DEFAULT_CHARSET Properties.DefaultColorFont.Color = clWindowText Properties.DefaultColorFont.Height = -11 Properties.DefaultColorFont.Name = 'MS Sans Serif' Properties.DefaultColorFont.Style = [] Properties.CustomColorFont.Charset = DEFAULT_CHARSET Properties.CustomColorFont.Color = clWindowText Properties.CustomColorFont.Height = -11 Properties.CustomColorFont.Name = 'MS Sans Serif' Properties.CustomColorFont.Style = [] Properties.FloatWindowCaption = 'Color Window' Properties.DragBarHint = 'Drag to float' end object JvHTButton1: TJvHTButton Left = 8 Top = 96 Width = 113 Height = 25 Caption = 'JvHTButton1' TabOrder = 2 end object JvStaticText1: TJvStaticText Left = 280 Top = 232 Width = 71 Height = 19 Caption = 'JvStaticText1' HotTrackFont.Charset = ANSI_CHARSET HotTrackFont.Color = clWindowText HotTrackFont.Height = -11 HotTrackFont.Name = 'Arial Unicode MS' HotTrackFont.Style = [] Layout = tlTop TabOrder = 3 TextMargins.X = 0 TextMargins.Y = 0 WordWrap = False end object JvMainMenu1: TJvMainMenu Style = msItemPainter ImageMargin.Left = 0 ImageMargin.Top = 0 ImageMargin.Right = 0 ImageMargin.Bottom = 0 ImageSize.Height = 0 ImageSize.Width = 0 ItemPainter = JvXPMenuItemPainter1 Left = 72 Top = 65528 object MainMenu1: TMenuItem Caption = 'MainMenu' object MainMenuItem1: TMenuItem Caption = 'Translate' OnClick = MainMenuItem1Click end object Exit1: TMenuItem Caption = 'Exit' OnClick = Exit1Click end end end object JvXPMenuItemPainter1: TJvXPMenuItemPainter SelectionFrameBrush.Color = 13811126 SelectionFramePen.Color = 6956042 Left = 104 Top = 65528 end object JvPopupMenu1: TJvPopupMenu Style = msItemPainter ImageMargin.Left = 0 ImageMargin.Top = 0 ImageMargin.Right = 0 ImageMargin.Bottom = 0 ImageSize.Height = 0 ImageSize.Width = 0 ItemPainter = JvXPMenuItemPainter1 Left = 16 Top = 64 object PopupItem11: TMenuItem Caption = 'PopupItem1' end object Popupitem21: TMenuItem Caption = 'Popupitem2' end end end --- NEW FILE: JVCLTest.dpr --- program JVCLTest; uses Forms, JVCLMainTest in 'JVCLMainTest.pas' {Form1}, UTF8VCLUtils in 'UTF8VCLUtils.pas', UTF8VCL in 'UTF8VCL.pas', UTF8VCLControls in 'UTF8VCLControls.pas', UTF8VCLMessages in 'UTF8VCLMessages.pas'; {$R *.res} begin Application.Initialize; Application.CreateForm(TForm1, Form1); Application.Run; end. --- NEW FILE: JVCLTest.cfg --- -$A8 -$B- -$C+ -$D+ -$E- -$F- -$G+ -$H+ -$I+ -$J- -$K- -$L+ -$M- -$N+ -$O+ -$P+ -$Q- -$R- -$S- -$T- -$U- -$V+ -$W- -$X+ -$YD -$Z1 -cg -AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; -H+ -W+ -M -$M16384,1048576 -K$00400000 -LE"c:\programme\borland\delphi6\Projects\Bpl" -LN"c:\programme\borland\delphi6\Projects\Bpl" |
From: Bart v. d. W. <blu...@us...> - 2007-03-28 20:19:33
|
Update of /cvsroot/utf8vcl/utf8vcl In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv27716 Modified Files: UTF8VCL.pas Log Message: Fixup the GetACP that System.pas does from bds2006, so that widestring <-> string conversions work correctly. Index: UTF8VCL.pas =================================================================== RCS file: /cvsroot/utf8vcl/utf8vcl/UTF8VCL.pas,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** UTF8VCL.pas 28 Mar 2007 14:22:32 -0000 1.25 --- UTF8VCL.pas 28 Mar 2007 20:19:30 -0000 1.26 *************** *** 700,704 **** initialization ActivateUtf8VCL(True); ! end. --- 700,707 ---- initialization ActivateUtf8VCL(True); ! {$IF CompilerVersion >= 18.0} ! // System does this GetACP before we can do the patching, so we fix this now. introduced in bds2006 ! SetMultiByteConversionCodePage(GetACP); ! {$IFEND} end. |
From: Bart v. d. W. <blu...@us...> - 2007-03-28 18:36:14
|
Update of /cvsroot/utf8vcl/utf8vcl In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv2978 Modified Files: UTF8VCLMessages.pas Log Message: Add support for MDI forms. Index: UTF8VCLMessages.pas =================================================================== RCS file: /cvsroot/utf8vcl/utf8vcl/UTF8VCLMessages.pas,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** UTF8VCLMessages.pas 25 Mar 2007 15:55:21 -0000 1.23 --- UTF8VCLMessages.pas 28 Mar 2007 18:36:04 -0000 1.24 *************** *** 148,151 **** --- 148,158 ---- OutLParam := LPARAM(nil); end; + WM_MDICREATE: + begin + GetMem(Pointer(OutLParam), SizeOf(TMDICreateStructA)); + CopyMemory(Pointer(OutLParam), Pointer(InLParam), SizeOf(TMDICreateStructA)); + PMDICreateStructA(OutLParam).szClass := ConvertToUTF8(PMDICreateStructW(InLParam).szClass); + PMDICreateStructA(OutLParam).szTitle := ConvertToUTF8(PMDICreateStructW(InLParam).szTitle); + end; WM_SETTEXT, WM_WININICHANGE, WM_DEVMODECHANGE, CB_DIR, LB_DIR, LB_ADDFILE, EM_REPLACESEL, LB_ADDSTRING, LB_INSERTSTRING, CB_ADDSTRING, CB_INSERTSTRING, *************** *** 203,206 **** --- 210,219 ---- FreeMem(PChar(TempLParam)); end; + WM_MDICREATE: + begin + FreeMemory(PMDICreateStructA(TempLParam).szClass); + FreeMemory(PMDICreateStructA(TempLParam).szTitle); + FreeMemory(PMDICreateStructA(TempLParam)); + 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, *************** *** 261,264 **** --- 274,280 ---- var L: Integer; + type + PMDICreateStructA = ^TMDICreateStructA; + PMDICreateStructW = ^TMDICreateStructW; begin OutWParam := InWParam; *************** *** 310,313 **** --- 326,336 ---- OutLParam := LPARAM(nil); end; + WM_MDICREATE: + begin + GetMem(Pointer(OutLParam), SizeOf(TMDICreateStructW)); + CopyMemory(Pointer(OutLParam), Pointer(InLParam), SizeOf(TMDICreateStructW)); + PMDICreateStructW(OutLParam).szClass := ConvertFromUTF8(PMDICreateStructA(InLParam).szClass); + PMDICreateStructW(OutLParam).szTitle := ConvertFromUTF8(PMDICreateStructA(InLParam).szTitle); + 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, *************** *** 363,366 **** --- 386,395 ---- FreeMem(PWideChar(TempLParam)); end; + WM_MDICREATE: + begin + FreeMemory(PMDICreateStructW(TempLParam).szClass); + FreeMemory(PMDICreateStructW(TempLParam).szTitle); + FreeMemory(PMDICreateStructW(TempLParam)); + 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, |
From: Robert M. <mar...@us...> - 2007-03-28 14:22:42
|
Update of /cvsroot/utf8vcl/utf8vcl In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv1009 Modified Files: UTF8VCL.pas UTF8VCLCommDlg.pas UTF8VCLControls.pas Log Message: nitpicky cleanup Index: UTF8VCL.pas =================================================================== RCS file: /cvsroot/utf8vcl/utf8vcl/UTF8VCL.pas,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** UTF8VCL.pas 25 Mar 2007 15:55:18 -0000 1.24 --- UTF8VCL.pas 28 Mar 2007 14:22:32 -0000 1.25 *************** *** 308,313 **** end; ! function GetTextExtentPoint32AIntercept(DC: HDC; Str: PAnsiChar; Count: Integer; ! var Size: TSize): BOOL; stdcall; var C: PWideChar; --- 308,312 ---- end; ! function GetTextExtentPoint32AIntercept(DC: HDC; Str: PAnsiChar; Count: Integer; var Size: TSize): BOOL; stdcall; var C: PWideChar; *************** *** 396,402 **** begin if (Cardinal(lpClassName) and $FFFF0000) <> 0 then - begin C := ConvertFromUTF8(lpClassName) - end else // This isn't a string but a special id --- 395,399 ---- *************** *** 564,568 **** end; - function MultiByteToWideCharIntercept(CodePage: UINT; dwFlags: DWORD; const lpMultiByteStr: LPCSTR; cchMultiByte: Integer; --- 561,564 ---- *************** *** 603,608 **** --- 599,607 ---- end; + //============================================================================ var + ActiveState: Boolean = False; + LibUser32: HMODULE = 0; LibGdi32: HMODULE = 0; *************** *** 644,650 **** end; - var - ActiveState: Boolean = False; - procedure ActivateUtf8VCL(Active: Boolean); begin --- 643,646 ---- *************** *** 693,698 **** NonUTF8GetOpenFileName := HookCommdlg32Func('GetOpenFileNameA', @GetOpenFileNameAIntercept); // do not localize NonUTF8GetSaveFileName := HookCommdlg32Func('GetSaveFileNameA', @GetSaveFileNameAIntercept); // do not localize ! NonUTF8GetFileTitle := HookCommdlg32Func('GetFileTitleA', @GetFileTitleAIntercept); // do not localize ! NonUTF8ChooseColor := HookCommdlg32Func('ChooseColorA', @ChooseColorAIntercept); // do not localize end else --- 689,694 ---- NonUTF8GetOpenFileName := HookCommdlg32Func('GetOpenFileNameA', @GetOpenFileNameAIntercept); // do not localize NonUTF8GetSaveFileName := HookCommdlg32Func('GetSaveFileNameA', @GetSaveFileNameAIntercept); // do not localize ! NonUTF8GetFileTitle := HookCommdlg32Func('GetFileTitleA', @GetFileTitleAIntercept); // do not localize ! NonUTF8ChooseColor := HookCommdlg32Func('ChooseColorA', @ChooseColorAIntercept); // do not localize end else Index: UTF8VCLControls.pas =================================================================== RCS file: /cvsroot/utf8vcl/utf8vcl/UTF8VCLControls.pas,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** UTF8VCLControls.pas 25 Mar 2007 11:46:17 -0000 1.4 --- UTF8VCLControls.pas 28 Mar 2007 14:22:33 -0000 1.5 *************** *** 31,41 **** Forms, Controls, Messages; - type - TWinControlPatch = class(TWinControl) - private - procedure HookTWinControlDoKeyPress; - function DoKeyPressPatch(var Mesg: TWMKey): Boolean; - end; - procedure HookTWinControlDoKeyPress; --- 31,34 ---- *************** *** 46,50 **** type ! TProc = function(var Message: TWMKey): Boolean of object; procedure HookTWinControlDoKeyPress; --- 39,47 ---- type ! TWinControlPatch = class(TWinControl) ! private ! procedure HookTWinControlDoKeyPress; ! function DoKeyPressPatch(var Mesg: TWMKey): Boolean; ! end; procedure HookTWinControlDoKeyPress; *************** *** 79,84 **** procedure TWinControlPatch.HookTWinControlDoKeyPress; var ! A, B: TProc; begin A := DoKeyPress; --- 76,83 ---- procedure TWinControlPatch.HookTWinControlDoKeyPress; + type + TWMKeyProc = function(var Message: TWMKey): Boolean of object; var ! A, B: TWMKeyProc; begin A := DoKeyPress; Index: UTF8VCLCommDlg.pas =================================================================== RCS file: /cvsroot/utf8vcl/utf8vcl/UTF8VCLCommDlg.pas,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** UTF8VCLCommDlg.pas 25 Mar 2007 15:55:19 -0000 1.1 --- UTF8VCLCommDlg.pas 28 Mar 2007 14:22:33 -0000 1.2 *************** *** 94,98 **** with OpenFileW do begin - lpstrFilter := nil; lpstrInitialDir := nil; --- 94,97 ---- *************** *** 168,172 **** with OpenFileW do begin - lpstrFilter := nil; lpstrInitialDir := nil; --- 167,170 ---- *************** *** 233,259 **** function GetFileTitleAIntercept(FileName: PAnsiChar; Title: PAnsiChar; TitleSize: Word): Smallint; stdcall; var ! fnw, titlebuf: PWideChar; ! x: PChar; begin ! fnw := nil; ! titlebuf := nil; try ! titlebuf := GetMemory(TitleSize * SizeOf(WideChar)); //utf16 won't ever take more then 2* as much space for a string then utf8 ! fnw := ConvertFromUTF8(FileName); ! Result := GetFileTitleW(fnw, titlebuf, TitleSize); if Result > 0 then Result := Result * 4; // ensure enough size is available if Result = 0 then begin ! x := ConvertToUTF8(titlebuf); try ! CopyMemory(Title, x, TitleSize); finally ! FreeMem(x); end; end; finally ! FreeMem(titlebuf); ! FreeMem(fnw); end; end; --- 231,257 ---- function GetFileTitleAIntercept(FileName: PAnsiChar; Title: PAnsiChar; TitleSize: Word): Smallint; stdcall; var ! WideFileName, TitleBuf: PWideChar; ! X: PChar; begin ! WideFileName := nil; ! TitleBuf := nil; try ! TitleBuf := GetMemory(TitleSize * SizeOf(WideChar)); //utf16 won't ever take more then 2* as much space for a string then utf8 ! WideFileName := ConvertFromUTF8(FileName); ! Result := GetFileTitleW(WideFileName, TitleBuf, TitleSize); if Result > 0 then Result := Result * 4; // ensure enough size is available if Result = 0 then begin ! X := ConvertToUTF8(TitleBuf); try ! CopyMemory(Title, X, TitleSize); finally ! FreeMem(X); end; end; finally ! FreeMem(TitleBuf); ! FreeMem(WideFileName); end; end; *************** *** 271,275 **** try CCW.lpTemplateName := ConvertFromUTF8(CC.lpTemplateName); ! CCW.lpfnHook := WndProcConvertW2U(Pointer(@CC.lpfnHook), Pointer(@StdWndProcInterceptU2W), Pointer(@StdWndProcInterceptW2U)); Result := ChooseColorW(CCW); CC.rgbResult := CCW.rgbResult; --- 269,274 ---- try CCW.lpTemplateName := ConvertFromUTF8(CC.lpTemplateName); ! CCW.lpfnHook := WndProcConvertW2U(Pointer(@CC.lpfnHook), ! Pointer(@StdWndProcInterceptU2W), Pointer(@StdWndProcInterceptW2U)); Result := ChooseColorW(CCW); CC.rgbResult := CCW.rgbResult; |
From: Bart v. d. W. <blu...@us...> - 2007-03-25 15:56:02
|
Update of /cvsroot/utf8vcl/utf8vcl In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv4861 Modified Files: TestForm.dfm TestForm.pas UTF8Test.dpr UTF8VCL.pas UTF8VCLMessages.pas Added Files: UTF8VCLCommDlg.pas Log Message: Split out CommDlg stuff Index: TestForm.dfm =================================================================== RCS file: /cvsroot/utf8vcl/utf8vcl/TestForm.dfm,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** TestForm.dfm 20 Mar 2007 07:51:45 -0000 1.17 --- TestForm.dfm 25 Mar 2007 15:55:15 -0000 1.18 *************** *** 222,227 **** TabOrder = 18 ColWidths = ( ! 57 ! 58) end object Panel1: TPanel --- 222,227 ---- TabOrder = 18 ColWidths = ( ! 61 ! 62) end object Panel1: TPanel *************** *** 264,272 **** Width = 129 Height = 23 ! EditLabel.Width = 65 EditLabel.Height = 15 EditLabel.Caption = 'LabeledEdit1' - LabelPosition = lpAbove - LabelSpacing = 3 TabOrder = 23 Text = 'LabeledEdit1' --- 264,270 ---- Width = 129 Height = 23 ! EditLabel.Width = 62 EditLabel.Height = 15 EditLabel.Caption = 'LabeledEdit1' TabOrder = 23 Text = 'LabeledEdit1' *************** *** 302,304 **** --- 300,328 ---- end end + object SaveDialog1: TSaveDialog + Left = 40 + Top = 336 + end + object ColorDialog1: TColorDialog + Color = 6334590 + CustomColors.Strings = ( + 'ColorA=000000' + 'ColorB=000000' + 'ColorC=60A87E' + 'ColorD=60A87E' + 'ColorE=60A87E' + 'ColorF=FFFFFFFF' + 'ColorG=FFFFFFFF' + 'ColorH=FFFFFFFF' + 'ColorI=000000' + 'ColorJ=000000' + 'ColorK=60A87E' + 'ColorL=60A87E' + 'ColorM=FFFFFFFF' + 'ColorN=FFFFFFFF' + 'ColorO=FFFFFFFF' + 'ColorP=FFFFFFFF') + Left = 72 + Top = 336 + end end Index: UTF8VCL.pas =================================================================== RCS file: /cvsroot/utf8vcl/utf8vcl/UTF8VCL.pas,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** UTF8VCL.pas 25 Mar 2007 12:33:10 -0000 1.23 --- UTF8VCL.pas 25 Mar 2007 15:55:18 -0000 1.24 *************** *** 88,91 **** --- 88,94 ---- TFatalAppExitA = procedure(uAction: UINT; lpMessageText: PAnsiChar); stdcall; TGetOpenFileNameA = function(var OpenFile: TOpenFilenameA): Bool; stdcall; + TGetSaveFileNameA = function(var OpenFile: TOpenFilenameA): Bool; stdcall; + TGetFileTitleA = function(FileName: PAnsiChar; Title: PAnsiChar; TitleSize: Word): Smallint; stdcall; + TChooseColorAProc = function(var CC: TChooseColorA): Bool; stdcall; var *************** *** 129,132 **** --- 132,138 ---- NonUTF8GetOpenFileName: TGetOpenFileNameA; + NonUTF8GetSaveFileName: TGetSaveFileNameA; + NonUTF8GetFileTitle: TGetFileTitleA; + NonUTF8ChooseColor: TChooseColorAProc; implementation *************** *** 134,138 **** uses Messages, SysUtils, Classes, ! UTF8VCLUtils, UTF8VCLMessages; const --- 140,144 ---- uses Messages, SysUtils, Classes, ! UTF8VCLUtils, UTF8VCLMessages, UTF8VCLCommDlg; const *************** *** 145,184 **** stdcall; external user32 name 'CreateWindowExW'; - {FromWindows} - - function StdWndProcInterceptW2U(Original: TStdWndProcDef; hWnd: HWND; Msg, WParam: Longint; LParam: Longint): Longint; - var - TempWParam, TempLParam: Longint; - begin - if SpecialWndProc(Cardinal(@Original)) then - Result := CallWindowProcW(@Original, hWnd, Msg, WParam, LParam) - else - if (@DefWindowProcA = @Original) or (@DefWindowProc = @Original) then - Result := CallWindowProcW(@DefWindowProcW, hWnd, Msg, WParam, LParam) - else - if (@DefMDIChildProcA = @Original) or (@DefMDIChildProc = @Original) then - Result := CallWindowProcW(@DefMDIChildProcW, hWnd, Msg, WParam, LParam) - else - if (@DefDlgProcA = @Original) or (@DefDlgProc = @Original) then - Result := CallWindowProcW(@DefDlgProcW, hWnd, Msg, WParam, LParam) - else - begin - MessageW2UBefore(hWnd, Msg, WParam, LParam, TempWParam, TempLParam, Original); - Result := Original(hWnd, Msg, TempWParam, TempLParam); - Result := MessageW2UAfter(hWnd, Msg, WParam, LParam, TempWParam, TempLParam, Result, Original); - end; - end; - - function StdWndProcInterceptU2W(Original: TStdWndProcDef; hWnd: HWND; Msg, WParam: Longint; LParam: Longint): Longint; - var - TempWParam, TempLParam: Longint; - begin - MessageU2WBefore(hWnd, Msg, WParam, LParam, TempWParam, TempLParam, Pointer(@CallWindowProcW)); - Result := CallWindowProcW(@Original, hWnd, Msg, WParam, LParam); - Result := MessageU2WAfter(hWnd, Msg, WParam, LParam, TempWParam, TempLParam, Result, Pointer(@CallWindowProcW)); - end; - - {ToWindows} - function SendMessageAIntercept(hWnd: HWND; Msg: UINT; WParam: WPARAM; LParam: LPARAM): LRESULT; stdcall; var --- 151,154 ---- *************** *** 594,715 **** end; - function GetOpenFileNameAIntercept(var OpenFileA: TOpenFilenameA): Bool; stdcall; - var - OpenFileW: TOpenFilenameW; - X: PChar; - S: PChar; - L: Integer; - - function ConvertFilterStringFrom(const S: PChar): PChar; - var - I, L: Integer; - P: Boolean; - begin - L := 0; - P := False; - while Assigned(S) and not (P and (S[L] = #0)) do - begin - P := S[L] = #0; - Inc(L); - end; - if L = 0 then - begin - Result := nil; - Exit; - end - else - begin - Inc(L); - GetMem(Result, L); - for I := 0 to L - 2 do - begin - if S[I] = #0 then - Result[I] := #1 - else - Result[I] := S[I]; - end; - Result[L-1] := #0; - end; - end; - - procedure ConvertFilterStringTo(S: PWideChar); - var - I: Integer; - begin - I := 0; - while Assigned(S) and (S[I] <> #0) do - begin - if S[I] = #1 then - S[I] := #0; - Inc(I); - end; - end; - - begin - Move(OpenFileA, OpenFileW, SizeOf(TOpenFilenameA)); - with OpenFileW do - begin - - lpstrFilter := nil; - lpstrInitialDir := nil; - lpstrTitle := nil; - lpstrDefExt := nil; - lpstrCustomFilter := nil; - lpstrFile := nil; - lpstrFileTitle := nil; - lpTemplateName := nil; - end; - X := nil; - S := nil; - - try - S := ConvertFilterStringFrom(OpenFileA.lpstrFilter); - OpenFileW.lpstrFilter := ConvertFromUTF8(S); - ConvertFilterStringTo(OpenFileW.lpstrFilter); - - OpenFileW.lpstrInitialDir := ConvertFromUTF8(OpenFileA.lpstrInitialDir); - OpenFileW.lpstrTitle := ConvertFromUTF8(OpenFileA.lpstrTitle); - OpenFileW.lpstrDefExt := ConvertFromUTF8(OpenFileA.lpstrDefExt); - OpenFileW.lpTemplateName := ConvertFromUTF8(OpenFileA.lpTemplateName); - - OpenFileW.lpstrFile := ConvertFromUTF8(OpenFileA.lpstrFile); - if OpenFileA.nMaxFile <> 0 then - ReallocMem(OpenFileW.lpstrFile, OpenFileA.nMaxFile*2 + 4); - OpenFileW.lpstrCustomFilter := ConvertFromUTF8(OpenFileA.lpstrCustomFilter); - if OpenFileA.nMaxCustFilter <> 0 then - ReallocMem(OpenFileW.lpstrCustomFilter, OpenFileA.nMaxCustFilter*2 + 4); - OpenFileW.lpstrFileTitle := ConvertFromUTF8(OpenFileA.lpstrFileTitle); - if OpenFileA.nMaxFileTitle <> 0 then - ReallocMem(OpenFileW.lpstrFileTitle, OpenFileA.nMaxFileTitle*2 + 4); - - OpenFileW.lpfnHook := WndProcConvertW2U(Pointer(@OpenFileA.lpfnHook), - Pointer(@StdWndProcInterceptU2W), Pointer(@StdWndProcInterceptW2U)); - - Result := GetOpenFileNameW(OpenFileW); - - X := ConvertToUTF8(OpenFileW.lpstrFile, -1, L); - CopyMemory(OpenFileA.lpstrFile, X, L+1); - FreeMem(X); - X := ConvertToUTF8(OpenFileW.lpstrCustomFilter, -1, L); - CopyMemory(OpenFileA.lpstrCustomFilter, X, L+1); - FreeMem(X); - X := ConvertToUTF8(OpenFileW.lpstrFileTitle, -1, L); - CopyMemory(OpenFileA.lpstrFileTitle, X, L+1); - finally - FreeMem(S); - FreeMem(X); - with OpenFileW do - begin - FreeMem(lpstrFilter); - FreeMem(lpstrInitialDir); - FreeMem(lpstrTitle); - FreeMem(lpstrDefExt); - FreeMem(lpstrFile); - FreeMem(lpstrCustomFilter); - FreeMem(lpstrFileTitle); - FreeMem(lpTemplateName); - end; - end; - end; function MultiByteToWideCharIntercept(CodePage: UINT; dwFlags: DWORD; --- 564,567 ---- *************** *** 840,843 **** --- 692,698 ---- NonUTF8GetOpenFileName := HookCommdlg32Func('GetOpenFileNameA', @GetOpenFileNameAIntercept); // do not localize + NonUTF8GetSaveFileName := HookCommdlg32Func('GetSaveFileNameA', @GetSaveFileNameAIntercept); // do not localize + NonUTF8GetFileTitle := HookCommdlg32Func('GetFileTitleA', @GetFileTitleAIntercept); // do not localize + NonUTF8ChooseColor := HookCommdlg32Func('ChooseColorA', @ChooseColorAIntercept); // do not localize end else Index: UTF8VCLMessages.pas =================================================================== RCS file: /cvsroot/utf8vcl/utf8vcl/UTF8VCLMessages.pas,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** UTF8VCLMessages.pas 25 Mar 2007 11:46:20 -0000 1.22 --- UTF8VCLMessages.pas 25 Mar 2007 15:55:21 -0000 1.23 *************** *** 39,42 **** --- 39,45 ---- Windows, UTF8VCLUtils; + function StdWndProcInterceptU2W(Original: TStdWndProcDef; hWnd: HWND; Msg, WParam: Longint; LParam: Longint): Longint; + function StdWndProcInterceptW2U(Original: TStdWndProcDef; hWnd: HWND; Msg, WParam: Longint; LParam: Longint): Longint; + procedure MessageW2UBefore(hWnd: HWND; Msg: UINT; InWParam: WPARAM; InLParam: LPARAM; out OutWParam: WPARAM; out OutLParam: LPARAM; Proc: TStdWndProcDef); *************** *** 57,60 **** --- 60,95 ---- UnusedLParam = LPARAM(0); + function StdWndProcInterceptW2U(Original: TStdWndProcDef; hWnd: HWND; Msg, WParam: Longint; LParam: Longint): Longint; + var + TempWParam, TempLParam: Longint; + begin + if SpecialWndProc(Cardinal(@Original)) then + Result := CallWindowProcW(@Original, hWnd, Msg, WParam, LParam) + else + if (@DefWindowProcA = @Original) or (@DefWindowProc = @Original) then + Result := CallWindowProcW(@DefWindowProcW, hWnd, Msg, WParam, LParam) + else + if (@DefMDIChildProcA = @Original) or (@DefMDIChildProc = @Original) then + Result := CallWindowProcW(@DefMDIChildProcW, hWnd, Msg, WParam, LParam) + else + if (@DefDlgProcA = @Original) or (@DefDlgProc = @Original) then + Result := CallWindowProcW(@DefDlgProcW, hWnd, Msg, WParam, LParam) + else + begin + MessageW2UBefore(hWnd, Msg, WParam, LParam, TempWParam, TempLParam, Original); + Result := Original(hWnd, Msg, TempWParam, TempLParam); + Result := MessageW2UAfter(hWnd, Msg, WParam, LParam, TempWParam, TempLParam, Result, Original); + end; + end; + + function StdWndProcInterceptU2W(Original: TStdWndProcDef; hWnd: HWND; Msg, WParam: Longint; LParam: Longint): Longint; + var + TempWParam, TempLParam: Longint; + begin + MessageU2WBefore(hWnd, Msg, WParam, LParam, TempWParam, TempLParam, Pointer(@CallWindowProcW)); + Result := CallWindowProcW(@Original, hWnd, Msg, WParam, LParam); + Result := MessageU2WAfter(hWnd, Msg, WParam, LParam, TempWParam, TempLParam, Result, Pointer(@CallWindowProcW)); + end; + procedure MessageW2UBefore(hWnd: HWND; Msg: UINT; InWParam: WPARAM; InLParam: LPARAM; out OutWParam: WPARAM; out OutLParam: LPARAM; Proc: TStdWndProcDef); --- NEW FILE: UTF8VCLCommDlg.pas --- {**************************************************************************************************} { } { UTF-8 VCL } { } { The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); } { you may not use this file except in compliance with the License. You may obtain a copy of the } { License at http://www.mozilla.org/MPL/ } { } { Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF } { ANY KIND, either express or implied. See the License for the specific language governing rights } { and limitations under the License. } { } { The Original Code is UTF8VCLCommDlg.pas } { } { The Initial Developer of the Original Code is Bart van der Werf (bwerf, bluelive) } { Portions created by Bart van der Werf are Copyright (C) Bart van der Werf. All rights reserved. } { } { Contributor(s): } { Andreas Hausladen (ahuser) } { Robert Marquardt (rom, marquardt) } { } {**************************************************************************************************} // Last modified: $Date: 2007/03/25 15:55:19 $ unit UTF8VCLCommDlg; interface uses Windows, CommDlg, Messages, SysUtils, Classes, UTF8VCLUtils, UTF8VCLMessages; function GetOpenFileNameAIntercept(var OpenFileA: TOpenFilenameA): Bool; stdcall; function GetSaveFileNameAIntercept(var OpenFileA: TOpenFilenameA): Bool; stdcall; function GetFileTitleAIntercept(FileName: PAnsiChar; Title: PAnsiChar; TitleSize: Word): Smallint; stdcall; function ChooseColorAIntercept(var CC: TChooseColorA): Bool; stdcall; implementation function ConvertFilterStringFrom(const S: PChar): PChar; var I, L: Integer; P: Boolean; begin L := 0; P := False; while Assigned(S) and not (P and (S[L] = #0)) do begin P := S[L] = #0; Inc(L); end; if L = 0 then begin Result := nil; Exit; end else begin Inc(L); GetMem(Result, L); for I := 0 to L - 2 do begin if S[I] = #0 then Result[I] := #1 else Result[I] := S[I]; end; Result[L-1] := #0; end; end; procedure ConvertFilterStringTo(S: PWideChar); var I: Integer; begin I := 0; while Assigned(S) and (S[I] <> #0) do begin if S[I] = #1 then S[I] := #0; Inc(I); end; end; function GetOpenFileNameAIntercept(var OpenFileA: TOpenFilenameA): Bool; stdcall; var OpenFileW: TOpenFilenameW; X: PChar; S: PChar; L: Integer; begin Move(OpenFileA, OpenFileW, SizeOf(TOpenFilenameA)); with OpenFileW do begin lpstrFilter := nil; lpstrInitialDir := nil; lpstrTitle := nil; lpstrDefExt := nil; lpstrCustomFilter := nil; lpstrFile := nil; lpstrFileTitle := nil; lpTemplateName := nil; end; X := nil; S := nil; try S := ConvertFilterStringFrom(OpenFileA.lpstrFilter); OpenFileW.lpstrFilter := ConvertFromUTF8(S); ConvertFilterStringTo(OpenFileW.lpstrFilter); OpenFileW.lpstrInitialDir := ConvertFromUTF8(OpenFileA.lpstrInitialDir); OpenFileW.lpstrTitle := ConvertFromUTF8(OpenFileA.lpstrTitle); OpenFileW.lpstrDefExt := ConvertFromUTF8(OpenFileA.lpstrDefExt); OpenFileW.lpTemplateName := ConvertFromUTF8(OpenFileA.lpTemplateName); OpenFileW.lpstrFile := ConvertFromUTF8(OpenFileA.lpstrFile); if OpenFileA.nMaxFile <> 0 then ReallocMem(OpenFileW.lpstrFile, OpenFileA.nMaxFile*2 + 4); OpenFileW.lpstrCustomFilter := ConvertFromUTF8(OpenFileA.lpstrCustomFilter); if OpenFileA.nMaxCustFilter <> 0 then ReallocMem(OpenFileW.lpstrCustomFilter, OpenFileA.nMaxCustFilter*2 + 4); OpenFileW.lpstrFileTitle := ConvertFromUTF8(OpenFileA.lpstrFileTitle); if OpenFileA.nMaxFileTitle <> 0 then ReallocMem(OpenFileW.lpstrFileTitle, OpenFileA.nMaxFileTitle*2 + 4); OpenFileW.lpfnHook := WndProcConvertW2U(Pointer(@OpenFileA.lpfnHook), Pointer(@StdWndProcInterceptU2W), Pointer(@StdWndProcInterceptW2U)); Result := GetOpenFileNameW(OpenFileW); X := ConvertToUTF8(OpenFileW.lpstrFile, -1, L); CopyMemory(OpenFileA.lpstrFile, X, L+1); FreeMem(X); X := ConvertToUTF8(OpenFileW.lpstrCustomFilter, -1, L); CopyMemory(OpenFileA.lpstrCustomFilter, X, L+1); FreeMem(X); X := ConvertToUTF8(OpenFileW.lpstrFileTitle, -1, L); CopyMemory(OpenFileA.lpstrFileTitle, X, L+1); finally FreeMem(S); FreeMem(X); with OpenFileW do begin FreeMem(lpstrFilter); FreeMem(lpstrInitialDir); FreeMem(lpstrTitle); FreeMem(lpstrDefExt); FreeMem(lpstrFile); FreeMem(lpstrCustomFilter); FreeMem(lpstrFileTitle); FreeMem(lpTemplateName); end; end; end; // /!\ copypaste form getopenfilenameaintercept function GetSaveFileNameAIntercept(var OpenFileA: TOpenFilenameA): Bool; stdcall; var OpenFileW: TOpenFilenameW; X: PChar; S: PChar; L: Integer; begin Move(OpenFileA, OpenFileW, SizeOf(TOpenFilenameA)); with OpenFileW do begin lpstrFilter := nil; lpstrInitialDir := nil; lpstrTitle := nil; lpstrDefExt := nil; lpstrCustomFilter := nil; lpstrFile := nil; lpstrFileTitle := nil; lpTemplateName := nil; end; X := nil; S := nil; try S := ConvertFilterStringFrom(OpenFileA.lpstrFilter); OpenFileW.lpstrFilter := ConvertFromUTF8(S); ConvertFilterStringTo(OpenFileW.lpstrFilter); OpenFileW.lpstrInitialDir := ConvertFromUTF8(OpenFileA.lpstrInitialDir); OpenFileW.lpstrTitle := ConvertFromUTF8(OpenFileA.lpstrTitle); OpenFileW.lpstrDefExt := ConvertFromUTF8(OpenFileA.lpstrDefExt); OpenFileW.lpTemplateName := ConvertFromUTF8(OpenFileA.lpTemplateName); OpenFileW.lpstrFile := ConvertFromUTF8(OpenFileA.lpstrFile); if OpenFileA.nMaxFile <> 0 then ReallocMem(OpenFileW.lpstrFile, OpenFileA.nMaxFile*2 + 4); OpenFileW.lpstrCustomFilter := ConvertFromUTF8(OpenFileA.lpstrCustomFilter); if OpenFileA.nMaxCustFilter <> 0 then ReallocMem(OpenFileW.lpstrCustomFilter, OpenFileA.nMaxCustFilter*2 + 4); OpenFileW.lpstrFileTitle := ConvertFromUTF8(OpenFileA.lpstrFileTitle); if OpenFileA.nMaxFileTitle <> 0 then ReallocMem(OpenFileW.lpstrFileTitle, OpenFileA.nMaxFileTitle*2 + 4); OpenFileW.lpfnHook := WndProcConvertW2U(Pointer(@OpenFileA.lpfnHook), Pointer(@StdWndProcInterceptU2W), Pointer(@StdWndProcInterceptW2U)); Result := GetSaveFileNameW(OpenFileW); X := ConvertToUTF8(OpenFileW.lpstrFile, -1, L); CopyMemory(OpenFileA.lpstrFile, X, L+1); FreeMem(X); X := ConvertToUTF8(OpenFileW.lpstrCustomFilter, -1, L); CopyMemory(OpenFileA.lpstrCustomFilter, X, L+1); FreeMem(X); X := ConvertToUTF8(OpenFileW.lpstrFileTitle, -1, L); CopyMemory(OpenFileA.lpstrFileTitle, X, L+1); finally FreeMem(S); FreeMem(X); with OpenFileW do begin FreeMem(lpstrFilter); FreeMem(lpstrInitialDir); FreeMem(lpstrTitle); FreeMem(lpstrDefExt); FreeMem(lpstrFile); FreeMem(lpstrCustomFilter); FreeMem(lpstrFileTitle); FreeMem(lpTemplateName); end; end; end; function GetFileTitleAIntercept(FileName: PAnsiChar; Title: PAnsiChar; TitleSize: Word): Smallint; stdcall; var fnw, titlebuf: PWideChar; x: PChar; begin fnw := nil; titlebuf := nil; try titlebuf := GetMemory(TitleSize * SizeOf(WideChar)); //utf16 won't ever take more then 2* as much space for a string then utf8 fnw := ConvertFromUTF8(FileName); Result := GetFileTitleW(fnw, titlebuf, TitleSize); if Result > 0 then Result := Result * 4; // ensure enough size is available if Result = 0 then begin x := ConvertToUTF8(titlebuf); try CopyMemory(Title, x, TitleSize); finally FreeMem(x); end; end; finally FreeMem(titlebuf); FreeMem(fnw); end; end; function ChooseColorAIntercept(var CC: TChooseColorA): Bool; stdcall; var CCW: TChooseColorW; begin Move(CC, CCW, SizeOf(TChooseColorA)); with CCW do begin lpfnHook := nil; lpTemplateName := nil; end; try CCW.lpTemplateName := ConvertFromUTF8(CC.lpTemplateName); CCW.lpfnHook := WndProcConvertW2U(Pointer(@CC.lpfnHook), Pointer(@StdWndProcInterceptU2W), Pointer(@StdWndProcInterceptW2U)); Result := ChooseColorW(CCW); CC.rgbResult := CCW.rgbResult; finally FreeMem(CCW.lpTemplateName); end; end; { function FindTextAIntercept(var FindReplaceA: TFindReplaceA): HWND; stdcall; function ReplaceTextAIntercept(var FindReplace: TFindReplaceA): HWND; stdcall; function ChooseFontAIntercept(var ChooseFont: TChooseFontA): Bool; stdcall; function PrintDlgAIntercept(var PrintDlg: TPrintDlgA): Bool; stdcall; function PageSetupDlgAIntercept(var PgSetupDialog: TPageSetupDlgA): BOOL; stdcall; } end. Index: UTF8Test.dpr =================================================================== RCS file: /cvsroot/utf8vcl/utf8vcl/UTF8Test.dpr,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** UTF8Test.dpr 18 Mar 2007 13:25:36 -0000 1.4 --- UTF8Test.dpr 25 Mar 2007 15:55:17 -0000 1.5 *************** *** 11,15 **** UTF8VCLControls in 'UTF8VCLControls.pas', Forms, ! TestForm in 'TestForm.pas' {Form1}; {$R *.res} --- 11,16 ---- UTF8VCLControls in 'UTF8VCLControls.pas', Forms, ! TestForm in 'TestForm.pas' {Form1}, ! UTF8VCLCommDlg in 'UTF8VCLCommDlg.pas'; {$R *.res} Index: TestForm.pas =================================================================== RCS file: /cvsroot/utf8vcl/utf8vcl/TestForm.pas,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** TestForm.pas 20 Mar 2007 07:51:46 -0000 1.24 --- TestForm.pas 25 Mar 2007 15:55:16 -0000 1.25 *************** *** 49,52 **** --- 49,54 ---- CheckListBox1: TCheckListBox; LabeledEdit1: TLabeledEdit; + SaveDialog1: TSaveDialog; + ColorDialog1: TColorDialog; procedure Button2Click(Sender: TObject); procedure Button3Click(Sender: TObject); *************** *** 70,85 **** TestText = TestText1 + TestText2; procedure TForm1.Button2Click(Sender: TObject); var 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]); - end; - begin Hint := TestText; --- 72,87 ---- TestText = TestText1 + TestText2; + + 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]); + end; + procedure TForm1.Button2Click(Sender: TObject); var X, Y: Integer; begin Hint := TestText; *************** *** 122,126 **** CheckTranslation(Button2.Name, Button2.Caption); RichEdit1.Text := TestText; ! CheckTranslation(RichEdit1.Name, RichEdit1.Text); MaskEdit1.Text := TestText; CheckTranslation(MaskEdit1.Name, MaskEdit1.Text); --- 124,129 ---- CheckTranslation(Button2.Name, Button2.Caption); RichEdit1.Text := TestText; ! // known to be broken, very hard to fix ! // CheckTranslation(RichEdit1.Name, RichEdit1.Text); MaskEdit1.Text := TestText; CheckTranslation(MaskEdit1.Name, MaskEdit1.Text); *************** *** 171,177 **** --- 174,188 ---- Wide: WideString; begin + OpenDialog1.Filter := TestText + '|*.*'; OpenDialog1.FileName := TestText; OpenDialog1.Execute; + CheckTranslation(OpenDialog1.Name, OpenDialog1.FileName); + + SaveDialog1.Filter := TestText + '|*.*'; + SaveDialog1.FileName := TestText; + SaveDialog1.Execute; + CheckTranslation(SaveDialog1.Name, SaveDialog1.FileName); + Wide := TestText; // fails on D7, should work on bds, delphi converts it on compiletime |
From: Robert M. <mar...@us...> - 2007-03-25 12:33:17
|
Update of /cvsroot/utf8vcl/utf8vcl In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv4796 Modified Files: UTF8VCL.pas Log Message: made the unpatched functions available under new name Index: UTF8VCL.pas =================================================================== RCS file: /cvsroot/utf8vcl/utf8vcl/UTF8VCL.pas,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** UTF8VCL.pas 25 Mar 2007 11:46:16 -0000 1.22 --- UTF8VCL.pas 25 Mar 2007 12:33:10 -0000 1.23 *************** *** 36,45 **** interface procedure ActivateUtf8VCL(Active: Boolean); implementation uses ! Windows, Messages, SysUtils, Classes, CommDlg, UTF8VCLUtils, UTF8VCLMessages; --- 36,137 ---- interface + uses + Windows, CommDlg; + procedure ActivateUtf8VCL(Active: Boolean); + type + TMultiByteToWideChar = function(CodePage: UINT; dwFlags: DWORD; + const lpMultiByteStr: LPCSTR; cchMultiByte: Integer; + lpWideCharStr: LPWSTR; cchWideChar: Integer): Integer; stdcall; + TWideCharToMultiByte = function(CodePage: UINT; dwFlags: DWORD; + lpWideCharStr: LPWSTR; cchWideChar: Integer; lpMultiByteStr: LPSTR; + cchMultiByte: Integer; lpDefaultChar: LPCSTR; lpUsedDefaultChar: PBOOL): Integer; stdcall; + TGetACP = function: UINT; stdcall; + TSendMessageA = function(hWnd: HWND; Msg: UINT; wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall; + TPostMessageA = function(hWnd: HWND; Msg: UINT; wParam: WPARAM; lParam: LPARAM): BOOL; stdcall; + TCreateWindowExA = function(dwExStyle: DWORD; lpClassName: PAnsiChar; + lpWindowName: PAnsiChar; dwStyle: DWORD; X, Y, nWidth, nHeight: Integer; + hWndParent: HWND; hMenu: HMENU; hInstance: HINST; lpParam: Pointer): HWND; stdcall; + TUnregisterClassA = function(lpClassName: PAnsiChar; hInstance: HINST): BOOL; stdcall; + TRegisterClassA = function(const lpWndClass: TWndClassA): ATOM; stdcall; + TRegisterClassExA = function(const WndClass: TWndClassExA): ATOM; stdcall; + TDrawTextA = function(hDC: HDC; lpString: PAnsiChar; nCount: Integer; + var lpRect: TRect; uFormat: UINT): Integer; stdcall; + TDrawTextExA = function(DC: HDC; lpchText: PAnsiChar; cchText: Integer; var p4: TRect; + dwDTFormat: UINT; DTParams: PDrawTextParams): Integer; stdcall; + TSetWindowLongA = function(hWnd: HWND; nIndex: Integer; dwNewLong: Longint): Longint; stdcall; + TSetWindowTextA = function(hWnd: HWND; lpString: PAnsiChar): BOOL; stdcall; + TGetClassInfoA = function(hInstance: HINST; lpClassName: PAnsiChar; + var lpWndClass: TWndClassA): BOOL; stdcall; + TGetClassInfoExA = function(Instance: HINST; Classname: PAnsiChar; var WndClass: TWndClassExA): BOOL; stdcall; + TCallWindowProcA = function(lpPrevWndFunc: TFNWndProc; hWnd: HWND; Msg: UINT; wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall; + TIsWindowUnicode = function(hWnd: HWND): BOOL; stdcall; + TGetWindowLongA = function(hWnd: HWND; nIndex: Integer): Longint; stdcall; + TDefWindowProcA = function(hWnd: HWND; Msg: UINT; wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall; + TDefMDIChildProcA = function(hWnd: HWND; uMsg: UINT; wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall; + TDefDlgProcA = function(hDlg: HWND; Msg: UINT; wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall; + TGetWindowTextA = function(hWnd: HWND; lpString: PAnsiChar; nMaxCount: Integer): Integer; stdcall; + TInsertMenuA = function(hMenu: HMENU; uPosition, uFlags, uIDNewItem: UINT; + lpNewItem: PAnsiChar): BOOL; stdcall; + TInsertMenuItemA = function(p1: HMENU; p2: UINT; p3: BOOL; const p4: TMenuItemInfoA): BOOL; stdcall; + TMessageBoxA = function(hWnd: HWND; lpText, lpCaption: PAnsiChar; uType: UINT): Integer; stdcall; + TTextOutA = function(DC: HDC; X, Y: Integer; Str: PAnsiChar; Count: Integer): BOOL; stdcall; + TExtTextOutA = function(DC: HDC; X, Y: Integer; Options: Longint; + Rect: PRect; Str: PAnsiChar; Count: Longint; Dx: PInteger): BOOL; stdcall; + TGetTextExtentPoint32A = function(DC: HDC; Str: PAnsiChar; Count: Integer; + var Size: TSize): BOOL; stdcall; + TGetTextExtentPointA = function(DC: HDC; Str: PAnsiChar; Count: Integer; var Size: TSize): BOOL; stdcall; + TGetTextExtentExPointA = function(DC: HDC; p2: PAnsiChar; + p3, p4: Integer; p5, p6: PInteger; var p7: TSize): BOOL; stdcall; + TOutputDebugStringA = procedure(lpOutputString: PAnsiChar); stdcall; + TFatalAppExitA = procedure(uAction: UINT; lpMessageText: PAnsiChar); stdcall; + TGetOpenFileNameA = function(var OpenFile: TOpenFilenameA): Bool; stdcall; + + var + NonUTF8MultiByteToWideChar: TMultiByteToWideChar; + NonUTF8WideCharToMultiByte: TWideCharToMultiByte; + NonUTF8GetACP: TGetACP; + + NonUTF8SendMessage: TSendMessageA; + NonUTF8PostMessage: TPostMessageA; + NonUTF8CreateWindowEx: TCreateWindowExA; + NonUTF8UnregisterClass: TUnregisterClassA; + NonUTF8RegisterClass: TRegisterClassA; + NonUTF8RegisterClassEx: TRegisterClassExA; + NonUTF8DrawText: TDrawTextA; + NonUTF8DrawTextEx: TDrawTextExA; + NonUTF8SetWindowLong: TSetWindowLongA; + NonUTF8SetWindowText: TSetWindowTextA; + NonUTF8GetClassInfo: TGetClassInfoA; + NonUTF8GetClassInfoEx: TGetClassInfoExA; + NonUTF8CallWindowProc: TCallWindowProcA; + NonUTF8IsWindowUnicode: TIsWindowUnicode; + NonUTF8GetWindowLong: TGetWindowLongA; + + NonUTF8DefWindowProc: TDefWindowProcA; + NonUTF8DefMDIChildProc: TDefMDIChildProcA; + NonUTF8DefDlgProc: TDefDlgProcA; + + NonUTF8GetWindowText: TGetWindowTextA; + NonUTF8InsertMenu: TInsertMenuA; + NonUTF8InsertMenuItem: TInsertMenuItemA; + NonUTF8MessageBox: TMessageBoxA; + + NonUTF8TextOut: TTextOutA; + NonUTF8ExtTextOut: TExtTextOutA; + NonUTF8GetTextExtentPoint32: TGetTextExtentPoint32A; + NonUTF8GetTextExtentPoint: TGetTextExtentPointA; + NonUTF8GetTextExtentExPoint: TGetTextExtentExPointA; + + NonUTF8OutputDebugString: TOutputDebugStringA; + NonUTF8FatalAppExit: TFatalAppExitA; + + NonUTF8GetOpenFileName: TGetOpenFileNameA; + implementation uses ! Messages, SysUtils, Classes, UTF8VCLUtils, UTF8VCLMessages; *************** *** 48,59 **** CP_THREAD_ACP = 3; // current thread's ANSI code page - type - TMultiByteToWideCharProc = function(CodePage: UINT; dwFlags: DWORD; - const lpMultiByteStr: LPCSTR; cchMultiByte: Integer; - lpWideCharStr: LPWSTR; cchWideChar: Integer): Integer; stdcall; - TWideCharToMultiByteProc = function(CodePage: UINT; dwFlags: DWORD; - lpWideCharStr: LPWSTR; cchWideChar: Integer; lpMultiByteStr: LPSTR; - cchMultiByte: Integer; lpDefaultChar: LPCSTR; lpUsedDefaultChar: PBOOL): Integer; stdcall; - function _CreateWindowExW(dwExStyle: DWORD; lpClassName: PWideChar; lpWindowName: PWideChar; dwStyle: DWORD; X, Y, nWidth, nHeight: Integer; --- 140,143 ---- *************** *** 61,68 **** stdcall; external user32 name 'CreateWindowExW'; - var - OriginalMultiByteToWideCharProc: TMultiByteToWideCharProc; - OriginalWideCharToMultiByteProc: TWideCharToMultiByteProc; - {FromWindows} --- 145,148 ---- *************** *** 272,275 **** --- 352,368 ---- end; + function GetTextExtentPointAIntercept(DC: HDC; Str: PAnsiChar; Count: Integer; var Size: TSize): BOOL; stdcall; + var + C: PWideChar; + L: Integer; + begin + C := ConvertFromUTF8(Str, Count, L); + try + Result := GetTextExtentPointW(DC, C, L, Size); + finally + FreeMem(C); + end; + end; + function GetTextExtentExPointAIntercept(DC: HDC; Str: PAnsiChar; Count, nMaxExtent: Integer; lpnFit, alpDx: PInteger; var lpSize: TSize): BOOL; stdcall; *************** *** 626,630 **** if (CodePage = CP_ACP) or (CodePage = CP_THREAD_ACP) then CodePage := CP_UTF8; ! Result := OriginalMultiByteToWideCharProc(CodePage, dwFlags, lpMultiByteStr, cchMultiByte, lpWideCharStr, cchWideChar); end; --- 719,723 ---- if (CodePage = CP_ACP) or (CodePage = CP_THREAD_ACP) then CodePage := CP_UTF8; ! Result := NonUTF8MultiByteToWideChar(CodePage, dwFlags, lpMultiByteStr, cchMultiByte, lpWideCharStr, cchWideChar); end; *************** *** 636,640 **** if (CodePage = CP_ACP) or (CodePage = CP_THREAD_ACP) then CodePage := CP_UTF8; ! Result := OriginalWideCharToMultiByteProc(CodePage, dwFlags, lpWideCharStr, cchWideChar, lpMultiByteStr, cchMultiByte, lpDefaultChar, lpUsedDefaultChar); end; --- 729,733 ---- if (CodePage = CP_ACP) or (CodePage = CP_THREAD_ACP) then CodePage := CP_UTF8; ! Result := NonUTF8WideCharToMultiByte(CodePage, dwFlags, lpWideCharStr, cchWideChar, lpMultiByteStr, cchMultiByte, lpDefaultChar, lpUsedDefaultChar); end; *************** *** 708,753 **** if Active then begin ! OriginalMultiByteToWideCharProc := GetProcAddress(GetModuleHandle(kernel32), 'MultiByteToWideChar'); ! OriginalWideCharToMultiByteProc := GetProcAddress(GetModuleHandle(kernel32), 'WideCharToMultiByte'); ! ! HookKernel32Func('MultiByteToWideChar', @MultiByteToWideCharIntercept); // do not localize ! HookKernel32Func('WideCharToMultiByte', @WideCharToMultiByteIntercept); // do not localize ! HookKernel32Func('GetACP', @GetACPIntercept); // do not localize ! ! HookUser32Func('SendMessageA', @SendMessageAIntercept); // do not localize ! HookUser32Func('PostMessageA', @PostMessageAIntercept); // do not localize ! HookUser32Func('CreateWindowExA', @CreateWindowExAIntercept); // do not localize ! HookUser32Func('UnregisterClassA', @UnregisterClassAIntercept); // do not localize ! HookUser32Func('RegisterClassA', @RegisterClassAIntercept); // do not localize ! HookUser32Func('RegisterClassExA', @RegisterClassExAIntercept); // do not localize ! HookUser32Func('DrawTextA', @DrawTextAIntercept); // do not localize ! HookUser32Func('DrawTextExA', @DrawTextExAIntercept); // do not localize ! HookUser32Func('SetWindowLongA', @SetWindowLongAIntercept); // do not localize ! HookUser32Func('SetWindowTextA', @SetWindowTextAIntercept); // do not localize ! HookUser32Func('GetClassInfoA', @GetClassInfoAIntercept); // do not localize ! HookUser32Func('GetClassInfoExA', @GetClassInfoExAIntercept); // do not localize ! HookUser32Func('CallWindowProcA', @CallWindowProcAIntercept); // do not localize ! HookUser32Func('IsWindowUnicode', @IsWindowUnicodeIntercept); // do not localize ! HookUser32Func('GetWindowLongA', @GetWindowLongAIntercept); // do not localize ! HookUser32Func('DefWindowProcA', @DefWindowProcAIntercept); // do not localize ! HookUser32Func('DefMDIChildProcA', @DefMDIChildProcAIntercept); // do not localize ! HookUser32Func('DefDlgProcA', @DefDlgProcAIntercept); // do not localize ! HookUser32Func('GetWindowTextA', @GetWindowTextAIntercept); // do not localize ! HookUser32Func('InsertMenuA', @InsertMenuAIntercept); // do not localize ! HookUser32Func('InsertMenuItemA', @InsertMenuItemAIntercept); // do not localize ! HookUser32Func('MessageBoxA', @MessageBoxAIntercept); // do not localize ! HookGdi32Func('TextOutA', @TextOutAIntercept); // do not localize ! HookGdi32Func('ExtTextOutA', @ExtTextOutAIntercept); // do not localize ! HookGdi32Func('GetTextExtentPoint32A', @GetTextExtentPoint32AIntercept); // do not localize ! HookGdi32Func('GetTextExtentExPointA', @GetTextExtentExPointAIntercept); // do not localize ! HookKernel32Func('OutputDebugStringA', @OutputDebugStringAIntercept); // do not localize ! HookKernel32Func('FatalAppExitA', @FatalAppExitAIntercept); // do not localize ! HookCommdlg32Func('GetOpenFileNameA', @GetOpenFileNameAIntercept); // do not localize end else --- 801,843 ---- if Active then begin ! NonUTF8MultiByteToWideChar := HookKernel32Func('MultiByteToWideChar', @MultiByteToWideCharIntercept); // do not localize ! NonUTF8WideCharToMultiByte := HookKernel32Func('WideCharToMultiByte', @WideCharToMultiByteIntercept); // do not localize ! NonUTF8GetACP := HookKernel32Func('GetACP', @GetACPIntercept); // do not localize ! NonUTF8SendMessage := HookUser32Func('SendMessageA', @SendMessageAIntercept); // do not localize ! NonUTF8PostMessage := HookUser32Func('PostMessageA', @PostMessageAIntercept); // do not localize ! NonUTF8CreateWindowEx := HookUser32Func('CreateWindowExA', @CreateWindowExAIntercept); // do not localize ! NonUTF8UnregisterClass := HookUser32Func('UnregisterClassA', @UnregisterClassAIntercept); // do not localize ! NonUTF8RegisterClass := HookUser32Func('RegisterClassA', @RegisterClassAIntercept); // do not localize ! NonUTF8RegisterClassEx := HookUser32Func('RegisterClassExA', @RegisterClassExAIntercept); // do not localize ! NonUTF8DrawText := HookUser32Func('DrawTextA', @DrawTextAIntercept); // do not localize ! NonUTF8DrawTextEx := HookUser32Func('DrawTextExA', @DrawTextExAIntercept); // do not localize ! NonUTF8SetWindowLong := HookUser32Func('SetWindowLongA', @SetWindowLongAIntercept); // do not localize ! NonUTF8SetWindowText := HookUser32Func('SetWindowTextA', @SetWindowTextAIntercept); // do not localize ! NonUTF8GetClassInfo := HookUser32Func('GetClassInfoA', @GetClassInfoAIntercept); // do not localize ! NonUTF8GetClassInfoEx := HookUser32Func('GetClassInfoExA', @GetClassInfoExAIntercept); // do not localize ! NonUTF8CallWindowProc := HookUser32Func('CallWindowProcA', @CallWindowProcAIntercept); // do not localize ! NonUTF8IsWindowUnicode := HookUser32Func('IsWindowUnicode', @IsWindowUnicodeIntercept); // do not localize ! NonUTF8GetWindowLong := HookUser32Func('GetWindowLongA', @GetWindowLongAIntercept); // do not localize ! NonUTF8DefWindowProc := HookUser32Func('DefWindowProcA', @DefWindowProcAIntercept); // do not localize ! NonUTF8DefMDIChildProc := HookUser32Func('DefMDIChildProcA', @DefMDIChildProcAIntercept); // do not localize ! NonUTF8DefDlgProc := HookUser32Func('DefDlgProcA', @DefDlgProcAIntercept); // do not localize ! NonUTF8GetWindowText := HookUser32Func('GetWindowTextA', @GetWindowTextAIntercept); // do not localize ! NonUTF8InsertMenu := HookUser32Func('InsertMenuA', @InsertMenuAIntercept); // do not localize ! NonUTF8InsertMenuItem := HookUser32Func('InsertMenuItemA', @InsertMenuItemAIntercept); // do not localize ! NonUTF8MessageBox := HookUser32Func('MessageBoxA', @MessageBoxAIntercept); // do not localize ! NonUTF8TextOut := HookGdi32Func('TextOutA', @TextOutAIntercept); // do not localize ! NonUTF8ExtTextOut := HookGdi32Func('ExtTextOutA', @ExtTextOutAIntercept); // do not localize ! NonUTF8GetTextExtentPoint32 := HookGdi32Func('GetTextExtentPoint32A', @GetTextExtentPoint32AIntercept); // do not localize ! NonUTF8GetTextExtentPoint := HookGdi32Func('GetTextExtentPointA', @GetTextExtentPointAIntercept); // do not localize ! NonUTF8GetTextExtentExPoint := HookGdi32Func('GetTextExtentExPointA', @GetTextExtentExPointAIntercept); // do not localize ! NonUTF8OutputDebugString := HookKernel32Func('OutputDebugStringA', @OutputDebugStringAIntercept); // do not localize ! NonUTF8FatalAppExit := HookKernel32Func('FatalAppExitA', @FatalAppExitAIntercept); // do not localize ! NonUTF8GetOpenFileName := HookCommdlg32Func('GetOpenFileNameA', @GetOpenFileNameAIntercept); // do not localize end else |
From: Bart v. d. W. <blu...@us...> - 2007-03-25 11:46:38
|
Update of /cvsroot/utf8vcl/utf8vcl In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv25565 Modified Files: UTF8VCL.pas UTF8VCLControls.pas UTF8VCLMessages.pas UTF8VCLUtils.pas Log Message: Add MPL license headers. Index: UTF8VCLUtils.pas =================================================================== RCS file: /cvsroot/utf8vcl/utf8vcl/UTF8VCLUtils.pas,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** UTF8VCLUtils.pas 18 Mar 2007 21:47:34 -0000 1.14 --- UTF8VCLUtils.pas 25 Mar 2007 11:46:22 -0000 1.15 *************** *** 1,2 **** --- 1,26 ---- + {**************************************************************************************************} + { } + { UTF-8 VCL } + { } + { The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); } + { you may not use this file except in compliance with the License. You may obtain a copy of the } + { License at http://www.mozilla.org/MPL/ } + { } + { Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF } + { ANY KIND, either express or implied. See the License for the specific language governing rights } + { and limitations under the License. } + { } + { The Original Code is UTF8VCLUtils.pas } + { } + { The Initial Developer of the Original Code is Bart van der Werf (bwerf, bluelive) } + { Portions created by Bart van der Werf are Copyright (C) Bart van der Werf. All rights reserved. } + { } + { Contributor(s): } + { Andreas Hausladen (ahuser) } + { Robert Marquardt (rom, marquardt) } + { } + {**************************************************************************************************} + + // Last modified: $Date$ unit UTF8VCLUtils; Index: UTF8VCLControls.pas =================================================================== RCS file: /cvsroot/utf8vcl/utf8vcl/UTF8VCLControls.pas,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** UTF8VCLControls.pas 18 Mar 2007 13:25:37 -0000 1.3 --- UTF8VCLControls.pas 25 Mar 2007 11:46:17 -0000 1.4 *************** *** 1,2 **** --- 1,27 ---- + {**************************************************************************************************} + { } + { UTF-8 VCL } + { } + { The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); } + { you may not use this file except in compliance with the License. You may obtain a copy of the } + { License at http://www.mozilla.org/MPL/ } + { } + { Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF } + { ANY KIND, either express or implied. See the License for the specific language governing rights } + { and limitations under the License. } + { } + { The Original Code is UTF8VCLControls.pas } + { } + { The Initial Developer of the Original Code is Bart van der Werf (bwerf, bluelive) } + { Portions created by Bart van der Werf are Copyright (C) Bart van der Werf. All rights reserved. } + { } + { Contributor(s): } + { Andreas Hausladen (ahuser) } + { Robert Marquardt (rom, marquardt) } + { } + {**************************************************************************************************} + + // Last modified: $Date$ + unit UTF8VCLControls; Index: UTF8VCLMessages.pas =================================================================== RCS file: /cvsroot/utf8vcl/utf8vcl/UTF8VCLMessages.pas,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** UTF8VCLMessages.pas 18 Mar 2007 21:47:34 -0000 1.21 --- UTF8VCLMessages.pas 25 Mar 2007 11:46:20 -0000 1.22 *************** *** 1,2 **** --- 1,27 ---- + {**************************************************************************************************} + { } + { UTF-8 VCL } + { } + { The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); } + { you may not use this file except in compliance with the License. You may obtain a copy of the } + { License at http://www.mozilla.org/MPL/ } + { } + { Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF } + { ANY KIND, either express or implied. See the License for the specific language governing rights } + { and limitations under the License. } + { } + { The Original Code is UTF8VCLMessages.pas } + { } + { The Initial Developer of the Original Code is Bart van der Werf (bwerf, bluelive) } + { Portions created by Bart van der Werf are Copyright (C) Bart van der Werf. All rights reserved. } + { } + { Contributor(s): } + { Andreas Hausladen (ahuser) } + { Robert Marquardt (rom, marquardt) } + { } + {**************************************************************************************************} + + // Last modified: $Date$ + unit UTF8VCLMessages; Index: UTF8VCL.pas =================================================================== RCS file: /cvsroot/utf8vcl/utf8vcl/UTF8VCL.pas,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** UTF8VCL.pas 18 Mar 2007 21:47:34 -0000 1.21 --- UTF8VCL.pas 25 Mar 2007 11:46:16 -0000 1.22 *************** *** 1,2 **** --- 1,27 ---- + {**************************************************************************************************} + { } + { UTF-8 VCL } + { } + { The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); } + { you may not use this file except in compliance with the License. You may obtain a copy of the } + { License at http://www.mozilla.org/MPL/ } + { } + { Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF } + { ANY KIND, either express or implied. See the License for the specific language governing rights } + { and limitations under the License. } + { } + { The Original Code is UTF8VCL.pas } + { } + { The Initial Developer of the Original Code is Bart van der Werf (bwerf, bluelive) } + { Portions created by Bart van der Werf are Copyright (C) Bart van der Werf. All rights reserved. } + { } + { Contributor(s): } + { Andreas Hausladen (ahuser) } + { Robert Marquardt (rom, marquardt) } + { } + {**************************************************************************************************} + + // Last modified: $Date$ + unit UTF8VCL; |
From: Robert M. <mar...@us...> - 2007-03-20 09:36:55
|
Update of /cvsroot/utf8vcl/utf8vcl In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv12137 Modified Files: TestForm.dfm TestForm.pas Log Message: just changing the experiments Index: TestForm.pas =================================================================== RCS file: /cvsroot/utf8vcl/utf8vcl/TestForm.pas,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** TestForm.pas 19 Mar 2007 20:23:53 -0000 1.23 --- TestForm.pas 20 Mar 2007 07:51:46 -0000 1.24 *************** *** 173,177 **** OpenDialog1.Filter := TestText + '|*.*'; OpenDialog1.FileName := TestText; ! // OpenDialog1.Execute; Wide := TestText; // fails on D7, should work on bds, delphi converts it on compiletime --- 173,177 ---- OpenDialog1.Filter := TestText + '|*.*'; OpenDialog1.FileName := TestText; ! OpenDialog1.Execute; Wide := TestText; // fails on D7, should work on bds, delphi converts it on compiletime *************** *** 179,185 **** Wide := S; S := Wide; ! Assert( S = TestText); ! FatalAppExitW(0, PWideChar(Wide)); ShowMessage(Wide); --- 179,185 ---- Wide := S; S := Wide; ! Assert(S = TestText); ! //FatalAppExitW(0, PWideChar(Wide)); ShowMessage(Wide); *************** *** 210,214 **** Content := StringGrid1.Rows[Y][X]; ! ShowMessageFmt('Strange text: %s', [TestText]); OutputDebugString(PChar(TestText)); --- 210,214 ---- Content := StringGrid1.Rows[Y][X]; ! ShowMessageFmt('%s', [TestText]); OutputDebugString(PChar(TestText)); Index: TestForm.dfm =================================================================== RCS file: /cvsroot/utf8vcl/utf8vcl/TestForm.dfm,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** TestForm.dfm 18 Mar 2007 21:47:34 -0000 1.16 --- TestForm.dfm 20 Mar 2007 07:51:45 -0000 1.17 *************** *** 5,10 **** BorderStyle = bsSingle Caption = 'Form1' ! ClientHeight = 406 ! ClientWidth = 613 Color = clBtnFace Font.Charset = ANSI_CHARSET --- 5,10 ---- BorderStyle = bsSingle Caption = 'Form1' ! ClientHeight = 435 ! ClientWidth = 657 Color = clBtnFace Font.Charset = ANSI_CHARSET *************** *** 19,50 **** ShowHint = True PixelsPerInch = 96 ! TextHeight = 14 object Label1: TLabel ! Left = 7 ! Top = 7 Width = 32 ! Height = 14 Caption = 'Label1' end object SpeedButton1: TSpeedButton ! Left = 72 ! Top = 184 ! Width = 57 ! Height = 22 Caption = 'SpeedButton1' end object Edit1: TEdit ! Left = 7 ! Top = 28 ! Width = 122 ! Height = 22 TabOrder = 0 Text = 'Edit1' end object Memo1: TMemo ! Left = 7 ! Top = 56 ! Width = 122 ! Height = 42 Ctl3D = True Lines.Strings = ( --- 19,50 ---- ShowHint = True PixelsPerInch = 96 ! TextHeight = 15 object Label1: TLabel ! Left = 8 ! Top = 8 Width = 32 ! Height = 15 Caption = 'Label1' end object SpeedButton1: TSpeedButton ! Left = 77 ! Top = 197 ! Width = 61 ! Height = 24 Caption = 'SpeedButton1' end object Edit1: TEdit ! Left = 8 ! Top = 30 ! Width = 130 ! Height = 23 TabOrder = 0 Text = 'Edit1' end object Memo1: TMemo ! Left = 8 ! Top = 60 ! Width = 130 ! Height = 45 Ctl3D = True Lines.Strings = ( *************** *** 54,86 **** end object Button1: TButton ! Left = 7 ! Top = 105 ! Width = 65 ! Height = 21 Caption = 'Button1' TabOrder = 2 end object CheckBox1: TCheckBox ! Left = 77 ! Top = 113 ! Width = 52 ! Height = 14 Caption = 'CheckBox1' TabOrder = 3 end object RadioButton1: TRadioButton ! Left = 137 ! Top = 169 ! Width = 120 ! Height = 14 Caption = 'RadioButton1' TabOrder = 4 end object ListBox1: TListBox ! Left = 7 ! Top = 133 ! Width = 122 ! Height = 42 ! ItemHeight = 14 Items.Strings = ( 'ListBox1') --- 54,86 ---- end object Button1: TButton ! Left = 8 ! Top = 113 ! Width = 69 ! Height = 22 Caption = 'Button1' TabOrder = 2 end object CheckBox1: TCheckBox ! Left = 83 ! Top = 121 ! Width = 55 ! Height = 15 Caption = 'CheckBox1' TabOrder = 3 end object RadioButton1: TRadioButton ! Left = 147 ! Top = 181 ! Width = 128 ! Height = 15 Caption = 'RadioButton1' TabOrder = 4 end object ListBox1: TListBox ! Left = 8 ! Top = 143 ! Width = 130 ! Height = 45 ! ItemHeight = 15 Items.Strings = ( 'ListBox1') *************** *** 88,96 **** end object ComboBox1: TComboBox ! Left = 137 ! Top = 141 ! Width = 120 ! Height = 22 ! ItemHeight = 14 TabOrder = 6 Text = 'ComboBox1' --- 88,96 ---- end object ComboBox1: TComboBox ! Left = 147 ! Top = 151 ! Width = 128 ! Height = 23 ! ItemHeight = 15 TabOrder = 6 Text = 'ComboBox1' *************** *** 99,114 **** end object GroupBox1: TGroupBox ! Left = 137 ! Top = 92 ! Width = 120 ! Height = 42 Caption = 'GroupBox1' TabOrder = 7 end object Button2: TButton ! Left = 529 ! Top = 372 ! Width = 66 ! Height = 23 Caption = 'Translate' TabOrder = 8 --- 99,114 ---- end object GroupBox1: TGroupBox ! Left = 147 ! Top = 99 ! Width = 128 ! Height = 45 Caption = 'GroupBox1' TabOrder = 7 end object Button2: TButton ! Left = 567 ! Top = 399 ! Width = 71 ! Height = 24 Caption = 'Translate' TabOrder = 8 *************** *** 116,123 **** end object Button3: TButton ! Left = 441 ! Top = 371 ! Width = 66 ! Height = 23 Caption = 'SomeTests' TabOrder = 9 --- 116,123 ---- end object Button3: TButton ! Left = 473 ! Top = 398 ! Width = 70 ! Height = 24 Caption = 'SomeTests' TabOrder = 9 *************** *** 125,132 **** end object RichEdit1: TRichEdit ! Left = 441 ! Top = 128 ! Width = 162 ! Height = 77 Lines.Strings = ( 'RichEdit1' --- 125,132 ---- end object RichEdit1: TRichEdit ! Left = 473 ! Top = 137 ! Width = 173 ! Height = 83 Lines.Strings = ( 'RichEdit1' *************** *** 136,143 **** end object StringGrid1: TStringGrid ! Left = 136 ! Top = 8 ! Width = 121 ! Height = 81 ColCount = 3 RowCount = 4 --- 136,143 ---- end object StringGrid1: TStringGrid ! Left = 146 ! Top = 9 ! Width = 129 ! Height = 86 ColCount = 3 RowCount = 4 *************** *** 150,165 **** end object ListView1: TListView ! Left = 381 ! Top = 15 ! Width = 225 ! Height = 105 Columns = < item Caption = 'Column1' - Width = 47 end item Caption = 'Column2' - Width = 47 end> GridLines = True --- 150,163 ---- end object ListView1: TListView ! Left = 408 ! Top = 16 ! Width = 241 ! Height = 113 Columns = < item Caption = 'Column1' end item Caption = 'Column2' end> GridLines = True *************** *** 172,179 **** end object Activate: TButton ! Left = 7 ! Top = 373 ! Width = 128 ! Height = 24 Caption = 'Activate UTF8 support' Enabled = False --- 170,177 ---- end object Activate: TButton ! Left = 8 ! Top = 400 ! Width = 137 ! Height = 25 Caption = 'Activate UTF8 support' Enabled = False *************** *** 181,188 **** end object Deactivate: TButton ! Left = 142 ! Top = 373 ! Width = 128 ! Height = 24 Caption = 'Deactivate UTF8 support' Enabled = False --- 179,186 ---- end object Deactivate: TButton ! Left = 152 ! Top = 400 ! Width = 137 ! Height = 25 Caption = 'Deactivate UTF8 support' Enabled = False *************** *** 190,197 **** end object Button4: TButton ! Left = 359 ! Top = 371 ! Width = 66 ! Height = 23 Caption = 'FatalAppExit' TabOrder = 15 --- 188,195 ---- end object Button4: TButton ! Left = 385 ! Top = 398 ! Width = 70 ! Height = 24 Caption = 'FatalAppExit' TabOrder = 15 *************** *** 199,222 **** end object BitBtn1: TBitBtn ! Left = 8 ! Top = 184 ! Width = 57 ! Height = 25 Caption = 'BitBtn1' TabOrder = 16 end object StaticText1: TStaticText ! Left = 136 ! Top = 184 ! Width = 58 ! Height = 18 Caption = 'StaticText1' TabOrder = 17 end object ValueListEditor1: TValueListEditor ! Left = 8 ! Top = 216 ! Width = 121 ! Height = 49 DisplayOptions = [doColumnTitles, doAutoColResize] Strings.Strings = ( --- 197,220 ---- end object BitBtn1: TBitBtn ! Left = 9 ! Top = 197 ! Width = 61 ! Height = 27 Caption = 'BitBtn1' TabOrder = 16 end object StaticText1: TStaticText ! Left = 146 ! Top = 197 ! Width = 59 ! Height = 19 Caption = 'StaticText1' TabOrder = 17 end object ValueListEditor1: TValueListEditor ! Left = 9 ! Top = 231 ! Width = 129 ! Height = 53 DisplayOptions = [doColumnTitles, doAutoColResize] Strings.Strings = ( *************** *** 228,260 **** end object Panel1: TPanel ! Left = 136 ! Top = 328 ! Width = 121 ! Height = 41 Caption = 'Panel1' TabOrder = 19 end object RadioGroup1: TRadioGroup ! Left = 136 ! Top = 200 ! Width = 121 ! Height = 33 Caption = 'RadioGroup1' TabOrder = 20 end object MaskEdit1: TMaskEdit ! Left = 8 ! Top = 272 ! Width = 121 ! Height = 22 TabOrder = 21 Text = 'MaskEdit1' end object CheckListBox1: TCheckListBox ! Left = 136 ! Top = 240 ! Width = 121 ! Height = 41 ! ItemHeight = 14 Items.Strings = ( 'CheckListBox1') --- 226,258 ---- end object Panel1: TPanel ! Left = 146 ! Top = 351 ! Width = 129 ! Height = 44 Caption = 'Panel1' TabOrder = 19 end object RadioGroup1: TRadioGroup ! Left = 146 ! Top = 214 ! Width = 129 ! Height = 36 Caption = 'RadioGroup1' TabOrder = 20 end object MaskEdit1: TMaskEdit ! Left = 9 ! Top = 291 ! Width = 129 ! Height = 23 TabOrder = 21 Text = 'MaskEdit1' end object CheckListBox1: TCheckListBox ! Left = 146 ! Top = 257 ! Width = 129 ! Height = 44 ! ItemHeight = 15 Items.Strings = ( 'CheckListBox1') *************** *** 262,272 **** 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' --- 260,272 ---- end object LabeledEdit1: TLabeledEdit ! Left = 146 ! Top = 326 ! Width = 129 ! Height = 23 ! EditLabel.Width = 65 ! EditLabel.Height = 15 EditLabel.Caption = 'LabeledEdit1' + LabelPosition = lpAbove + LabelSpacing = 3 TabOrder = 23 Text = 'LabeledEdit1' |
From: Bart v. d. W. <blu...@us...> - 2007-03-19 20:58:11
|
Update of /cvsroot/utf8vcl/utf8vcl In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv32314 Modified Files: TestForm.pas Log Message: Extend teststring to contain much more diverse charactersets. Index: TestForm.pas =================================================================== RCS file: /cvsroot/utf8vcl/utf8vcl/TestForm.pas,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** TestForm.pas 18 Mar 2007 21:47:34 -0000 1.22 --- TestForm.pas 19 Mar 2007 20:23:53 -0000 1.23 *************** *** 66,71 **** const ! TestText1 = 'I'#$C3#$B1#$74#$C3#$AB#$72#$6E#$C3#$A2; ! TestText2 = 't'#$D1#$96#$C3#$B4#$6E#$C3#$A0#$6C#$D1#$96#$7A#$C3#$A6#$74#$D1#$96#$C3#$B8#$6E; TestText = TestText1 + TestText2; --- 66,71 ---- const ! TestText1 = 'I'#$C3#$B1#$DB#$B3#$C3#$AB#$72#$D7#$90#$C3#$A2; ! TestText2 = 't'#$D1#$96#$C3#$B4#$EF#$A7#$A7#$C3#$A0#$6C#$D1#$96#$7A#$C3#$A6#$74#$E2#$98#$BA#$6E; TestText = TestText1 + TestText2; *************** *** 178,181 **** --- 178,185 ---- S := TestText; Wide := S; + S := Wide; + Assert( S = TestText); + + FatalAppExitW(0, PWideChar(Wide)); ShowMessage(Wide); |
From: Bart v. d. W. <blu...@us...> - 2007-03-19 04:06:54
|
Update of /cvsroot/utf8vcl/utf8vcl In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv26183 Modified Files: TestForm.dfm TestForm.pas UTF8Test.dpr UTF8VCL.pas UTF8VCLControls.pas Log Message: Make FileOpenDialog work, the filter string was invalid in the dfm. Fix application title, the initialization order was fubarred, implementation sections are also regarded when determining the order :( Index: UTF8VCLControls.pas =================================================================== RCS file: /cvsroot/utf8vcl/utf8vcl/UTF8VCLControls.pas,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** UTF8VCLControls.pas 17 Mar 2007 18:36:43 -0000 1.2 --- UTF8VCLControls.pas 18 Mar 2007 13:25:37 -0000 1.3 *************** *** 62,65 **** --- 62,68 ---- end; + initialization + HookTWinControlDoKeyPress; + end. Index: UTF8VCL.pas =================================================================== RCS file: /cvsroot/utf8vcl/utf8vcl/UTF8VCL.pas,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** UTF8VCL.pas 18 Mar 2007 11:26:40 -0000 1.17 --- UTF8VCL.pas 18 Mar 2007 13:25:37 -0000 1.18 *************** *** 17,21 **** uses Windows, Messages, SysUtils, Classes, CommDlg, ! UTF8VCLUtils, UTF8VCLMessages, UTF8VCLControls; function _CreateWindowExW(dwExStyle: DWORD; lpClassName: PWideChar; --- 17,21 ---- uses Windows, Messages, SysUtils, Classes, CommDlg, ! UTF8VCLUtils, UTF8VCLMessages; function _CreateWindowExW(dwExStyle: DWORD; lpClassName: PWideChar; *************** *** 390,393 **** --- 390,394 ---- finally FreeMem(C); + FreeMem(X); end; end *************** *** 626,631 **** if Active then begin - HookTWinControlDoKeyPress; - HookUser32Func('SendMessageA', @SendMessageAIntercept); // do not localize HookUser32Func('PostMessageA', @PostMessageAIntercept); // do not localize --- 627,630 ---- Index: TestForm.dfm =================================================================== RCS file: /cvsroot/utf8vcl/utf8vcl/TestForm.dfm,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** TestForm.dfm 18 Mar 2007 11:26:40 -0000 1.13 --- TestForm.dfm 18 Mar 2007 13:25:36 -0000 1.14 *************** *** 244,248 **** DefaultExt = 'OpenDialog1' FileName = 'OpenDialog1' ! Filter = 'OpenDialog1' InitialDir = 'OpenDialog1' Title = 'OpenDialog1' --- 244,248 ---- DefaultExt = 'OpenDialog1' FileName = 'OpenDialog1' ! Filter = 'StrangeFiles|*.*' InitialDir = 'OpenDialog1' Title = 'OpenDialog1' Index: UTF8Test.dpr =================================================================== RCS file: /cvsroot/utf8vcl/utf8vcl/UTF8Test.dpr,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** UTF8Test.dpr 16 Mar 2007 23:39:11 -0000 1.3 --- UTF8Test.dpr 18 Mar 2007 13:25:36 -0000 1.4 *************** *** 9,15 **** UTF8VCL in 'UTF8VCL.pas', UTF8VCLUtils in 'UTF8VCLUtils.pas', Forms, ! TestForm in 'TestForm.pas' {Form1}, ! UTF8VCLControls in 'UTF8VCLControls.pas'; {$R *.res} --- 9,15 ---- UTF8VCL in 'UTF8VCL.pas', UTF8VCLUtils in 'UTF8VCLUtils.pas', + UTF8VCLControls in 'UTF8VCLControls.pas', Forms, ! TestForm in 'TestForm.pas' {Form1}; {$R *.res} Index: TestForm.pas =================================================================== RCS file: /cvsroot/utf8vcl/utf8vcl/TestForm.pas,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** TestForm.pas 18 Mar 2007 11:26:40 -0000 1.18 --- TestForm.pas 18 Mar 2007 13:25:36 -0000 1.19 *************** *** 103,107 **** CheckTranslation(RichEdit1.Name, RichEdit1.Text); Application.Title := TestText; ! CheckTranslation(Application.Name, Application.Title); Self.Caption := TestText; CheckTranslation(Self.Name, Self.Caption); --- 103,107 ---- CheckTranslation(RichEdit1.Name, RichEdit1.Text); Application.Title := TestText; ! CheckTranslation('Application.Title', Application.Title); Self.Caption := TestText; CheckTranslation(Self.Name, Self.Caption); *************** *** 146,149 **** --- 146,151 ---- Content: string; begin + OpenDialog1.Filter := TestText +'|*.*'; + OpenDialog1.FileName := TestText; OpenDialog1.Execute; |
From: Bart v. d. W. <blu...@us...> - 2007-03-19 00:48:46
|
Update of /cvsroot/utf8vcl/utf8vcl In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv21058 Modified Files: TestForm.dfm TestForm.pas UTF8VCL.pas Log Message: Add support for having the correct conversion when assinging to and from widestrings. Index: UTF8VCL.pas =================================================================== RCS file: /cvsroot/utf8vcl/utf8vcl/UTF8VCL.pas,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** UTF8VCL.pas 18 Mar 2007 13:25:37 -0000 1.18 --- UTF8VCL.pas 18 Mar 2007 15:12:57 -0000 1.19 *************** *** 24,27 **** --- 24,39 ---- stdcall; external user32 name 'CreateWindowExW'; + type + TMultiByteToWideCharProc = function(CodePage: UINT; dwFlags: DWORD; + const lpMultiByteStr: LPCSTR; cchMultiByte: Integer; + lpWideCharStr: LPWSTR; cchWideChar: Integer): Integer; stdcall; + TWideCharToMultiByteProc = function(CodePage: UINT; dwFlags: DWORD; + lpWideCharStr: LPWSTR; cchWideChar: Integer; lpMultiByteStr: LPSTR; + cchMultiByte: Integer; lpDefaultChar: LPCSTR; lpUsedDefaultChar: PBOOL): Integer; stdcall; + + var + OriginalMultiByteToWideCharProc: TMultiByteToWideCharProc; + OriginalWideCharToMultiByteProc: TWideCharToMultiByteProc; + {FromWindows} *************** *** 565,568 **** --- 577,598 ---- end; + function MultiByteToWideCharIntercept(CodePage: UINT; dwFlags: DWORD; + const lpMultiByteStr: LPCSTR; cchMultiByte: Integer; + lpWideCharStr: LPWSTR; cchWideChar: Integer): Integer; stdcall; + begin + if (CodePage = CP_ACP) or (CodePage = CP_THREAD_ACP) then + CodePage := CP_UTF8; + Result := OriginalMultiByteToWideCharProc(CodePage, dwFlags, lpMultiByteStr, cchMultiByte, lpWideCharStr, cchWideChar); + end; + + function WideCharToMultiByteIntercept(CodePage: UINT; dwFlags: DWORD; + lpWideCharStr: LPWSTR; cchWideChar: Integer; lpMultiByteStr: LPSTR; + cchMultiByte: Integer; lpDefaultChar: LPCSTR; lpUsedDefaultChar: PBOOL): Integer; stdcall; + begin + if (CodePage = CP_ACP) or (CodePage = CP_THREAD_ACP) then + CodePage := CP_UTF8; + Result := OriginalWideCharToMultiByteProc(CodePage, dwFlags, lpWideCharStr, cchWideChar, lpMultiByteStr, cchMultiByte, lpDefaultChar, lpUsedDefaultChar); + end; + procedure FatalAppExitAIntercept(uAction: UINT; lpMessageText: PAnsiChar); stdcall; var *************** *** 627,630 **** --- 657,666 ---- if Active then begin + OriginalMultiByteToWideCharProc := GetProcAddress(GetModuleHandle(kernel32), 'MultiByteToWideChar'); + OriginalWideCharToMultiByteProc := GetProcAddress(GetModuleHandle(kernel32), 'WideCharToMultiByte'); + + HookKernel32Func('MultiByteToWideChar', @MultiByteToWideCharIntercept); // do not localize + HookKernel32Func('WideCharToMultiByte', @WideCharToMultiByteIntercept); // do not localize + HookUser32Func('SendMessageA', @SendMessageAIntercept); // do not localize HookUser32Func('PostMessageA', @PostMessageAIntercept); // do not localize Index: TestForm.dfm =================================================================== RCS file: /cvsroot/utf8vcl/utf8vcl/TestForm.dfm,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** TestForm.dfm 18 Mar 2007 13:25:36 -0000 1.14 --- TestForm.dfm 18 Mar 2007 15:12:56 -0000 1.15 *************** *** 225,229 **** object Panel1: TPanel Left = 288 ! Top = 240 Width = 121 Height = 41 --- 225,229 ---- object Panel1: TPanel Left = 288 ! Top = 248 Width = 121 Height = 41 *************** *** 231,234 **** --- 231,250 ---- TabOrder = 19 end + object RadioGroup1: TRadioGroup + Left = 280 + Top = 176 + Width = 89 + Height = 33 + Caption = 'RadioGroup1' + TabOrder = 20 + end + object MaskEdit1: TMaskEdit + Left = 8 + Top = 272 + Width = 121 + Height = 22 + TabOrder = 21 + Text = 'MaskEdit1' + end object MainMenu1: TMainMenu Left = 104 *************** *** 250,252 **** --- 266,272 ---- Top = 336 end + object ActionList1: TActionList + Left = 152 + Top = 304 + end end Index: TestForm.pas =================================================================== RCS file: /cvsroot/utf8vcl/utf8vcl/TestForm.pas,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** TestForm.pas 18 Mar 2007 13:25:36 -0000 1.19 --- TestForm.pas 18 Mar 2007 15:12:56 -0000 1.20 *************** *** 11,15 **** uses Windows, SysUtils, Classes, Controls, Forms, ! Dialogs, ComCtrls, StdCtrls, Menus, Grids, ValEdit, Buttons, ExtCtrls; type --- 11,16 ---- uses Windows, SysUtils, Classes, Controls, Forms, ! Dialogs, ComCtrls, StdCtrls, Menus, Grids, ValEdit, Buttons, ExtCtrls, ! Mask, ActnList; type *************** *** 41,44 **** --- 42,48 ---- Panel1: TPanel; OpenDialog1: TOpenDialog; + RadioGroup1: TRadioGroup; + ActionList1: TActionList; + MaskEdit1: TMaskEdit; procedure Button2Click(Sender: TObject); procedure Button3Click(Sender: TObject); *************** *** 98,105 **** --- 102,113 ---- GroupBox1.Caption := TestText; CheckTranslation(GroupBox1.Name, GroupBox1.Caption); + RadioGroup1.Caption := TestText; + CheckTranslation(RadioGroup1.Name, RadioGroup1.Caption); Button2.Caption := TestText; CheckTranslation(Button2.Name, Button2.Caption); RichEdit1.Text := TestText; CheckTranslation(RichEdit1.Name, RichEdit1.Text); + MaskEdit1.Text := TestText; + CheckTranslation(MaskEdit1.Name, MaskEdit1.Text); Application.Title := TestText; CheckTranslation('Application.Title', Application.Title); *************** *** 145,152 **** X, Y: Integer; Content: string; begin OpenDialog1.Filter := TestText +'|*.*'; OpenDialog1.FileName := TestText; ! OpenDialog1.Execute; Content := Menu1.Caption; --- 153,168 ---- X, Y: Integer; Content: string; + S: String; + Wide: WideString; begin OpenDialog1.Filter := TestText +'|*.*'; OpenDialog1.FileName := TestText; ! // OpenDialog1.Execute; ! ! Wide := TestText; // fails on D7, should work on bds, delphi converts it on compiletime ! S := TestText; ! Wide := S; ! ! ShowMessage(Wide); Content := Menu1.Caption; *************** *** 164,167 **** --- 180,184 ---- Content := ComboBox1.Text; Content := GroupBox1.Caption; + Content := RadioGroup1.Caption; Content := Button2.Caption; Content := RichEdit1.Text; *************** *** 231,234 **** --- 248,255 ---- Assert(GroupBox1.Caption = Content); + Content := RadioGroup1.Caption; + RadioGroup1.Caption := Content; + Assert(RadioGroup1.Caption = Content); + Content := Button2.Caption; Button2.Caption := Content; |
From: Robert M. <mar...@us...> - 2007-03-19 00:16:20
|
Update of /cvsroot/utf8vcl/utf8vcl In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv22158 Modified Files: UTF8VCLControls.pas Log Message: style cleanup, TMethod used instead of custom record Index: UTF8VCLControls.pas =================================================================== RCS file: /cvsroot/utf8vcl/utf8vcl/UTF8VCLControls.pas,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** UTF8VCLControls.pas 16 Mar 2007 23:39:11 -0000 1.1 --- UTF8VCLControls.pas 17 Mar 2007 18:36:43 -0000 1.2 *************** *** 10,14 **** private procedure HookTWinControlDoKeyPress; ! function DoKeyPressPatch(var Message: TWMKey): Boolean; end; --- 10,14 ---- private procedure HookTWinControlDoKeyPress; ! function DoKeyPressPatch(var Mesg: TWMKey): Boolean; end; *************** *** 21,28 **** type ! TProc = function(var Message: TWMKey): Boolean of Object; ! TProcBreaker = packed record ! Proc, Self: Pointer; ! end; procedure HookTWinControlDoKeyPress; --- 21,25 ---- type ! TProc = function(var Message: TWMKey): Boolean of object; procedure HookTWinControlDoKeyPress; *************** *** 31,35 **** end; ! function TWinControlPatch.DoKeyPressPatch(var Message: TWMKey): Boolean; var Form: TCustomForm; --- 28,32 ---- end; ! function TWinControlPatch.DoKeyPressPatch(var Mesg: TWMKey): Boolean; var Form: TCustomForm; *************** *** 39,45 **** Form := GetParentForm(Self); if (Form <> nil) and (Form <> TWinControl(Self)) and Form.KeyPreview and ! TWinControlPatch(Form).DoKeyPress(Message) then Exit; if not (csNoStdEvents in ControlStyle) then ! with Message do begin if CharCode < 256 then --- 36,43 ---- Form := GetParentForm(Self); if (Form <> nil) and (Form <> TWinControl(Self)) and Form.KeyPreview and ! TWinControlPatch(Form).DoKeyPress(Mesg) then ! Exit; if not (csNoStdEvents in ControlStyle) then ! with Mesg do begin if CharCode < 256 then *************** *** 48,52 **** KeyPress(Ch); CharCode := Word(Ch); ! if Char(CharCode) = #0 then Exit; end; end; --- 46,51 ---- KeyPress(Ch); CharCode := Word(Ch); ! if Char(CharCode) = #0 then ! Exit; end; end; *************** *** 56,66 **** procedure TWinControlPatch.HookTWinControlDoKeyPress; var ! a, b: TProc; ! m: TWMKey; begin ! a := DoKeyPress; ! b := DoKeyPressPatch; ! InjectJumpHook(TProcBreaker(a).Proc, TProcBreaker(b).Proc); end; end. --- 55,65 ---- procedure TWinControlPatch.HookTWinControlDoKeyPress; var ! A, B: TProc; begin ! A := DoKeyPress; ! B := DoKeyPressPatch; ! InjectJumpHook(TMethod(A).Code, TMethod(B).Code); end; end. + |