[utf8vcl-cvs] utf8vcl/Samples JVCLMainTest.dfm, NONE, 1.1 JVCLMainTest.pas, NONE, 1.1 JVCLTest.dpr,
Status: Alpha
Brought to you by:
bluelive
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. |