Fix unicode table names and comments in alter table dialog

This commit is contained in:
Ansgar Becker
2008-08-19 23:01:31 +00:00
parent dedc3d92b1
commit 3517253af7
3 changed files with 16 additions and 18 deletions

View File

@ -73,7 +73,7 @@ type
{$I const.inc}
function trimc(s: String; c: Char) : String;
function implodestr(seperator: String; a: TWideStringList) :WideString;
function implodestr(seperator: WideString; a: TWideStringList) :WideString;
function explode(separator, a: WideString) :TWideStringList;
procedure ensureValidIdentifier(name: String);
function getEnumValues(str: WideString): WideString;
@ -228,19 +228,17 @@ end;
@param a TStringList Containing strings
@return string
}
function implodestr(seperator: String; a: TWideStringList) :WideString;
function implodestr(seperator: WideString; a: TWideStringList) :WideString;
var
i : Integer;
text : String;
begin
result := '';
Result := '';
for i:=0 to a.Count-1 do
begin
text := text + a[i];
Result := Result + a[i];
if i < a.Count-1 then
text := text + seperator;
Result := Result + seperator;
end;
result := text;
end;

View File

@ -111,7 +111,7 @@ object tbl_properties_form: Ttbl_properties_form
ModalResult = 2
TabOrder = 7
end
object editName: TEdit
object editName: TTntEdit
Left = 88
Top = 17
Width = 216
@ -121,7 +121,7 @@ object tbl_properties_form: Ttbl_properties_form
Text = 'editName'
OnChange = editNameChange
end
object editComment: TEdit
object editComment: TTntEdit
Left = 88
Top = 42
Width = 216

View File

@ -10,14 +10,14 @@ interface
uses
Windows, Messages, SysUtils, Classes, Controls, Forms, Graphics,
Dialogs, StdCtrls, Db, Menus, SynMemo, SynEdit, WideStrings;
Dialogs, StdCtrls, Db, Menus, SynMemo, SynEdit, WideStrings, TntStdCtrls;
type
Ttbl_properties_form = class(TForm)
lblName: TLabel;
editName: TEdit;
editName: TTntEdit;
lblComment: TLabel;
editComment: TEdit;
editComment: TTntEdit;
lblEngine: TLabel;
comboEngine: TComboBox;
lblCharset: TLabel;
@ -50,9 +50,9 @@ type
currentEngine,
currentCharset,
currentCollation,
currentAutoincrement : String;
currentAutoincrement : WideString;
public
TableName : String;
TableName : WideString;
end;
implementation
@ -123,7 +123,7 @@ end;
procedure Ttbl_properties_form.FormShow(Sender: TObject);
var
ds: TDataSet;
sql : String;
sql : WideString;
begin
// Fetch table properties
sql := 'SHOW TABLE STATUS ';
@ -131,11 +131,11 @@ begin
ds := Mainform.Childwin.GetResults(sql);
// Table name
currentName := ds.FieldByName('Name').AsString;
currentName := ds.FieldByName('Name').AsWideString;
editName.Text := currentName;
// Comment
currentComment := ds.FieldByName('Comment').AsString;
currentComment := ds.FieldByName('Comment').AsWideString;
editComment.Text := currentComment;
// Engine
@ -262,7 +262,7 @@ end;
procedure Ttbl_properties_form.FormClose(Sender: TObject; var Action:
TCloseAction);
var
sql, tmp : String;
sql, tmp : WideString;
AlterSpecs : TWideStringList;
begin
if ModalResult = mrOK then