mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-03 17:47:12 +01:00
Implemented UTF-8 support. Fixed mouse messages. Other small fixes. Removed deprecated file.
git-svn-id: trunk@10059 -
This commit is contained in:
parent
1806819c79
commit
a284a1aea3
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -2389,7 +2389,6 @@ lcl/interfaces/gtk2/gtk2wstoolwin.pp svneol=native#text/pascal
|
|||||||
lcl/interfaces/gtk2/interfaces.pas svneol=native#text/pascal
|
lcl/interfaces/gtk2/interfaces.pas svneol=native#text/pascal
|
||||||
lcl/interfaces/qt/README.txt svneol=native#text/plain
|
lcl/interfaces/qt/README.txt svneol=native#text/plain
|
||||||
lcl/interfaces/qt/interfaces.pp svneol=native#text/pascal
|
lcl/interfaces/qt/interfaces.pp svneol=native#text/pascal
|
||||||
lcl/interfaces/qt/qt.pp svneol=native#text/pascal
|
|
||||||
lcl/interfaces/qt/qt4.pas svneol=native#text/plain
|
lcl/interfaces/qt/qt4.pas svneol=native#text/plain
|
||||||
lcl/interfaces/qt/qtcallback.inc svneol=native#text/pascal
|
lcl/interfaces/qt/qtcallback.inc svneol=native#text/pascal
|
||||||
lcl/interfaces/qt/qtint.pp svneol=native#text/pascal
|
lcl/interfaces/qt/qtint.pp svneol=native#text/pascal
|
||||||
|
|||||||
@ -1,66 +0,0 @@
|
|||||||
{
|
|
||||||
*****************************************************************************
|
|
||||||
* *
|
|
||||||
* This file is part of the Lazarus Component Library (LCL) *
|
|
||||||
* *
|
|
||||||
* See the file COPYING.modifiedLGPL, included in this distribution, *
|
|
||||||
* for details about the copyright. *
|
|
||||||
* *
|
|
||||||
* This program is distributed in the hope that it will be useful, *
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
|
|
||||||
* *
|
|
||||||
*****************************************************************************
|
|
||||||
}
|
|
||||||
unit qt;
|
|
||||||
|
|
||||||
interface
|
|
||||||
|
|
||||||
{$linklib lzqt}
|
|
||||||
{$linklib c}
|
|
||||||
|
|
||||||
const
|
|
||||||
WIDGET = 1;
|
|
||||||
WIDGET_BUTTON = 2;
|
|
||||||
WIDGET_PUSH_BUTTON = 3;
|
|
||||||
WIDGET_CHECK_BOX = 4;
|
|
||||||
WIDGET_RADIO_BUTTON = 5;
|
|
||||||
WIDGET_DIALOG = 6;
|
|
||||||
WIDGET_DIALOG_FILE = 7;
|
|
||||||
WIDGET_MESSAGE_BOX = 8;
|
|
||||||
WIDGET_TAB_DIALOG = 9;
|
|
||||||
WIDGET_FRAME = 10;
|
|
||||||
WIDGET_GROUP_BOX = 11;
|
|
||||||
WIDGET_BUTTON_GROUP = 12;
|
|
||||||
WIDGET_LCD_NUMBER = 13;
|
|
||||||
WIDGET_LABEL = 14;
|
|
||||||
WIDGET_MENU_BAR = 15;
|
|
||||||
WIDGET_LISTBOX = 16;
|
|
||||||
WIDGET_MULTI_LINE_EDIT = 17;
|
|
||||||
WIDGET_POPUP_MENU = 18;
|
|
||||||
WIDGET_LINE_EDIT = 19;
|
|
||||||
WIDGET_SCROLL_BAR = 20;
|
|
||||||
WIDGET_TAB_BAR = 21;
|
|
||||||
WIDGET_WINDOW = 22;
|
|
||||||
|
|
||||||
{
|
|
||||||
//event callback definitions
|
|
||||||
MousePressedEvent(qwid,button,x,y,state)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
procedure InitializeEngine;cdecl;external;
|
|
||||||
function CreateWidget(wtype: longint):longint;cdecl;external;
|
|
||||||
procedure MainLoop;cdecl;external;
|
|
||||||
procedure ReparentWidget(qwidparent: longint; qwidchild: longint);cdecl;external;
|
|
||||||
procedure SetMainWidget(qwid:longint);cdecl;external;
|
|
||||||
procedure ShowWidget(wid: longint);cdecl;external;
|
|
||||||
procedure MoveWidget(qwid: longint; x: longint; y: longint);cdecl;external;
|
|
||||||
procedure ResizeWidget(qwid: longint; h: longint; w: longint);cdecl;external;
|
|
||||||
procedure SetWidgetText(qwid: longint; wtext: pchar);cdecl;external;
|
|
||||||
procedure HookMousePressedEvent(qwid: longint; ptrcall: pointer);cdecl;external;
|
|
||||||
procedure SetData(qwid: longint; data: pointer);cdecl;external;
|
|
||||||
function GetData(qwid:longint):pointer;cdecl;external;
|
|
||||||
procedure Shutdown;cdecl;external;
|
|
||||||
implementation
|
|
||||||
end.
|
|
||||||
@ -340,7 +340,7 @@ procedure TQtFont.setRawName(p1: string);
|
|||||||
var
|
var
|
||||||
Str: WideString;
|
Str: WideString;
|
||||||
begin
|
begin
|
||||||
Str := WideString(p1);
|
Str := UTF8Decode(p1);
|
||||||
|
|
||||||
QFont_setRawName(Widget, @Str);
|
QFont_setRawName(Widget, @Str);
|
||||||
end;
|
end;
|
||||||
@ -349,7 +349,7 @@ procedure TQtFont.setFamily(p1: string);
|
|||||||
var
|
var
|
||||||
Str: WideString;
|
Str: WideString;
|
||||||
begin
|
begin
|
||||||
Str := WideString(p1);
|
Str := UTF8Decode(p1);
|
||||||
|
|
||||||
QFont_setFamily(Widget, @Str);
|
QFont_setFamily(Widget, @Str);
|
||||||
end;
|
end;
|
||||||
|
|||||||
@ -142,12 +142,16 @@ end;
|
|||||||
procedure TQtListStrings.ExternalUpdate(var Astr: TStringList; Clear: Boolean);
|
procedure TQtListStrings.ExternalUpdate(var Astr: TStringList; Clear: Boolean);
|
||||||
var
|
var
|
||||||
i: Integer;
|
i: Integer;
|
||||||
|
TmpStr: WideString;
|
||||||
begin
|
begin
|
||||||
FUpdating := True;
|
FUpdating := True;
|
||||||
if Clear then
|
if Clear then
|
||||||
QListWidget_clear(FQtListWidget);
|
QListWidget_clear(FQtListWidget);
|
||||||
for i := 0 to AStr.Count -1 do
|
for i := 0 to AStr.Count -1 do
|
||||||
QListWidget_additem(FQtListWidget, @WideString(Astr[i]));
|
begin
|
||||||
|
TmpStr := UTF8Decode(Astr[i]);
|
||||||
|
QListWidget_additem(FQtListWidget, @TmpStr);
|
||||||
|
end;
|
||||||
FUpdating := False;
|
FUpdating := False;
|
||||||
IsChanged;
|
IsChanged;
|
||||||
FUpdating := False;
|
FUpdating := False;
|
||||||
@ -550,6 +554,7 @@ procedure TQtComboStrings.ExternalUpdate(var Astr: TStringList; Clear: Boolean);
|
|||||||
var
|
var
|
||||||
i: Integer;
|
i: Integer;
|
||||||
data: QVariantH;
|
data: QVariantH;
|
||||||
|
TmpStr: WideString;
|
||||||
begin
|
begin
|
||||||
|
|
||||||
data := QVariant_create(10); //Creates dummy data
|
data := QVariant_create(10); //Creates dummy data
|
||||||
@ -558,7 +563,10 @@ begin
|
|||||||
if Clear then
|
if Clear then
|
||||||
QComboBox_clear(FQtComboBox);
|
QComboBox_clear(FQtComboBox);
|
||||||
for i := 0 to AStr.Count -1 do
|
for i := 0 to AStr.Count -1 do
|
||||||
QComboBox_additem(FQtComboBox, @WideString(Astr[i]), data);
|
begin
|
||||||
|
TmpStr := UTF8Decode(Astr[i]);
|
||||||
|
QComboBox_additem(FQtComboBox, @TmpStr, data);
|
||||||
|
end;
|
||||||
FUpdating := False;
|
FUpdating := False;
|
||||||
IsChanged;
|
IsChanged;
|
||||||
FUpdating := False;
|
FUpdating := False;
|
||||||
|
|||||||
@ -508,7 +508,7 @@ begin
|
|||||||
else Msg.Msg := LM_KEYDOWN;
|
else Msg.Msg := LM_KEYDOWN;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
Translates a Qt4 Key to a LCL VK_ key
|
Translates a Qt4 Key to a LCL VK_* key
|
||||||
------------------------------------------------------------------------------}
|
------------------------------------------------------------------------------}
|
||||||
Msg.CharCode := QtKeyToLCLKey(QKeyEvent_key(QKeyEventH(Event)));
|
Msg.CharCode := QtKeyToLCLKey(QKeyEvent_key(QKeyEventH(Event)));
|
||||||
|
|
||||||
@ -531,6 +531,7 @@ end;
|
|||||||
procedure TQtWidget.SlotMouse(Event: QEventH); cdecl;
|
procedure TQtWidget.SlotMouse(Event: QEventH); cdecl;
|
||||||
var
|
var
|
||||||
Msg: TLMMouse;
|
Msg: TLMMouse;
|
||||||
|
MousePos: TPoint;
|
||||||
begin
|
begin
|
||||||
{$ifdef VerboseQt}
|
{$ifdef VerboseQt}
|
||||||
WriteLn('TQtWidget.SlotMouse');
|
WriteLn('TQtWidget.SlotMouse');
|
||||||
@ -538,12 +539,26 @@ begin
|
|||||||
|
|
||||||
FillChar(Msg, SizeOf(Msg), #0);
|
FillChar(Msg, SizeOf(Msg), #0);
|
||||||
|
|
||||||
|
QCursor_pos(@MousePos);
|
||||||
|
|
||||||
|
Msg.XPos := SmallInt(MousePos.X);
|
||||||
|
Msg.YPos := SmallInt(MousePos.Y);
|
||||||
|
|
||||||
case QEvent_type(Event) of
|
case QEvent_type(Event) of
|
||||||
QEventMouseButtonPress: Exit; //Msg.Msg := LM_CLICKED;
|
QEventMouseButtonPress: Msg.Msg := LM_PRESSED;
|
||||||
QEventMouseButtonRelease: Msg.Msg := LM_CLICKED;
|
QEventMouseButtonRelease:
|
||||||
|
begin
|
||||||
|
Msg.Msg := LM_CLICKED;
|
||||||
|
|
||||||
|
try
|
||||||
|
LCLObject.WindowProc(TLMessage(Msg));
|
||||||
|
except
|
||||||
|
Application.HandleException(nil);
|
||||||
|
end;
|
||||||
|
|
||||||
|
Msg.Msg := LM_RELEASED;
|
||||||
|
end;
|
||||||
QEventMouseButtonDblClick: Msg.Msg := LM_CLICKED;
|
QEventMouseButtonDblClick: Msg.Msg := LM_CLICKED;
|
||||||
else
|
|
||||||
Msg.Msg := LM_CLICKED;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
try
|
try
|
||||||
@ -561,8 +576,22 @@ end;
|
|||||||
procedure TQtWidget.SlotMouseMove(Event: QEventH); cdecl;
|
procedure TQtWidget.SlotMouseMove(Event: QEventH); cdecl;
|
||||||
var
|
var
|
||||||
Msg: TLMMouseMove;
|
Msg: TLMMouseMove;
|
||||||
|
MousePos: TPoint;
|
||||||
begin
|
begin
|
||||||
FillChar(Msg, SizeOf(Msg), #0);
|
FillChar(Msg, SizeOf(Msg), #0);
|
||||||
|
|
||||||
|
QCursor_pos(@MousePos);
|
||||||
|
|
||||||
|
Msg.XPos := SmallInt(MousePos.X);
|
||||||
|
Msg.YPos := SmallInt(MousePos.Y);
|
||||||
|
|
||||||
|
Msg.Msg := LM_MOUSEMOVE;
|
||||||
|
|
||||||
|
try
|
||||||
|
LCLObject.WindowProc(TLMessage(Msg));
|
||||||
|
except
|
||||||
|
Application.HandleException(nil);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
@ -1110,7 +1139,7 @@ begin
|
|||||||
WriteLn('TQtPushButton.Create');
|
WriteLn('TQtPushButton.Create');
|
||||||
{$endif}
|
{$endif}
|
||||||
|
|
||||||
Str := WideString(AWinControl.Caption);
|
Str := UTF8Decode(AWinControl.Caption);
|
||||||
Parent := TQtWidget(AWinControl.Parent.Handle).Widget;
|
Parent := TQtWidget(AWinControl.Parent.Handle).Widget;
|
||||||
Widget := QPushButton_create(@Str, Parent);
|
Widget := QPushButton_create(@Str, Parent);
|
||||||
|
|
||||||
@ -1305,7 +1334,7 @@ begin
|
|||||||
QWidget_setGeometry(Widget, AWinControl.Left, AWinControl.Top,
|
QWidget_setGeometry(Widget, AWinControl.Left, AWinControl.Top,
|
||||||
AWinControl.Width, AWinControl.Height);
|
AWinControl.Width, AWinControl.Height);
|
||||||
|
|
||||||
Str := WideString(AWinControl.Caption);
|
Str := UTF8Decode(AWinControl.Caption);
|
||||||
SetText(@Str);
|
SetText(@Str);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1436,7 +1465,7 @@ begin
|
|||||||
AWinControl.Width, AWinControl.Height);
|
AWinControl.Width, AWinControl.Height);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Str := WideString(AWinControl.Caption);
|
Str := UTF8Decode(AWinControl.Caption);
|
||||||
SetText(@Str);
|
SetText(@Str);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1524,7 +1553,7 @@ begin
|
|||||||
AWinControl.Width, AWinControl.Height);
|
AWinControl.Width, AWinControl.Height);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Str := WideString(AWinControl.Caption);
|
Str := UTF8Decode(AWinControl.Caption);
|
||||||
SetText(@Str);
|
SetText(@Str);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1704,7 +1733,7 @@ begin
|
|||||||
WriteLn('TQtLineEdit.Create');
|
WriteLn('TQtLineEdit.Create');
|
||||||
{$endif}
|
{$endif}
|
||||||
Parent := TQtWidget(AWinControl.Parent.Handle).Widget;
|
Parent := TQtWidget(AWinControl.Parent.Handle).Widget;
|
||||||
Str := WideString((AWinControl as TCustomEdit).Text);
|
Str := UTF8Decode((AWinControl as TCustomEdit).Text);
|
||||||
Widget := QLineEdit_create(@Str, Parent);
|
Widget := QLineEdit_create(@Str, Parent);
|
||||||
|
|
||||||
// Sets it´ s initial properties
|
// Sets it´ s initial properties
|
||||||
@ -1868,7 +1897,7 @@ begin
|
|||||||
// Add the items to the combo box
|
// Add the items to the combo box
|
||||||
for i := 0 to (AWinControl as TCustomComboBox).Items.Count - 1 do
|
for i := 0 to (AWinControl as TCustomComboBox).Items.Count - 1 do
|
||||||
begin
|
begin
|
||||||
Str := WideString((AWinControl as TCustomComboBox).Items.Strings[i]);
|
Str := UTF8Decode((AWinControl as TCustomComboBox).Items.Strings[i]);
|
||||||
QComboBox_addItem(QComboBoxH(Widget), @Str, data);
|
QComboBox_addItem(QComboBoxH(Widget), @Str, data);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -2014,7 +2043,7 @@ begin
|
|||||||
// Sets the initial items
|
// Sets the initial items
|
||||||
for I := 0 to TCustomListBox(AWinControl).Items.Count - 1 do
|
for I := 0 to TCustomListBox(AWinControl).Items.Count - 1 do
|
||||||
begin
|
begin
|
||||||
Text := WideString(TCustomListBox(AWinControl).Items.Strings[i]);
|
Text := UTF8Decode(TCustomListBox(AWinControl).Items.Strings[i]);
|
||||||
QListWidget_addItem(QListWidgetH(Widget), @Text);
|
QListWidget_addItem(QListWidgetH(Widget), @Text);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -2244,7 +2273,7 @@ begin
|
|||||||
Parent := TQtWidget(AWinControl.Parent.Handle).Widget;
|
Parent := TQtWidget(AWinControl.Parent.Handle).Widget;
|
||||||
Widget := QStatusBar_create(Parent);
|
Widget := QStatusBar_create(Parent);
|
||||||
|
|
||||||
Text := WideString(AWinControl.Caption);
|
Text := UTF8Decode(AWinControl.Caption);
|
||||||
showMessage(@Text);
|
showMessage(@Text);
|
||||||
|
|
||||||
// Sets it´ s initial properties
|
// Sets it´ s initial properties
|
||||||
|
|||||||
@ -426,7 +426,7 @@ begin
|
|||||||
Exit;
|
Exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
WideStr := WideString(Str);
|
WideStr := UTF8Decode(Str);
|
||||||
|
|
||||||
TQtDeviceContext(DC).drawText(Rect.Left, Rect.Top, @WideStr);
|
TQtDeviceContext(DC).drawText(Rect.Left, Rect.Top, @WideStr);
|
||||||
|
|
||||||
@ -496,7 +496,7 @@ begin
|
|||||||
|
|
||||||
if not IsValidDC(DC) then Exit;
|
if not IsValidDC(DC) then Exit;
|
||||||
|
|
||||||
WideStr := WideString(Str);
|
WideStr := UTF8Decode(Str);
|
||||||
|
|
||||||
// if TQtDeviceContext(DC).isDrawing then TQtDeviceContext(DC).drawText(X, Y, @WideStr)
|
// if TQtDeviceContext(DC).isDrawing then TQtDeviceContext(DC).drawText(X, Y, @WideStr)
|
||||||
// else TQtDeviceContext(DC).AddObject(dcTextOut, @WideStr, X, Y);
|
// else TQtDeviceContext(DC).AddObject(dcTextOut, @WideStr, X, Y);
|
||||||
@ -1839,7 +1839,7 @@ begin
|
|||||||
|
|
||||||
if not IsValidDC(DC) then Exit;
|
if not IsValidDC(DC) then Exit;
|
||||||
|
|
||||||
WideStr := WideString(Str);
|
WideStr := UTF8Decode(Str);
|
||||||
|
|
||||||
// if TQtDeviceContext(DC).isDrawing then TQtDeviceContext(DC).drawText(X, Y, @WideStr)
|
// if TQtDeviceContext(DC).isDrawing then TQtDeviceContext(DC).drawText(X, Y, @WideStr)
|
||||||
// else TQtDeviceContext(DC).AddObject(dcTextOut, @WideStr, X, Y);
|
// else TQtDeviceContext(DC).AddObject(dcTextOut, @WideStr, X, Y);
|
||||||
|
|||||||
@ -139,7 +139,7 @@ var
|
|||||||
begin
|
begin
|
||||||
TQtAbstractButton(AWinControl.Handle).Text(@Str);
|
TQtAbstractButton(AWinControl.Handle).Text(@Str);
|
||||||
|
|
||||||
AText := string(Str);
|
AText := UTF8Encode(Str);
|
||||||
|
|
||||||
Result := True;
|
Result := True;
|
||||||
end;
|
end;
|
||||||
@ -153,7 +153,7 @@ class procedure TQtWSButton.SetText(const AWinControl: TWinControl; const AText:
|
|||||||
var
|
var
|
||||||
Str: WideString;
|
Str: WideString;
|
||||||
begin
|
begin
|
||||||
Str := WideString(AText);
|
Str := UTF8Decode(AText);
|
||||||
|
|
||||||
TQtAbstractButton(AWinControl.Handle).SetText(@Str);
|
TQtAbstractButton(AWinControl.Handle).SetText(@Str);
|
||||||
end;
|
end;
|
||||||
@ -217,7 +217,7 @@ var
|
|||||||
begin
|
begin
|
||||||
TQtAbstractButton(AWinControl.Handle).Text(@Str);
|
TQtAbstractButton(AWinControl.Handle).Text(@Str);
|
||||||
|
|
||||||
AText := string(Str);
|
AText := UTF8Encode(Str);
|
||||||
|
|
||||||
Result := True;
|
Result := True;
|
||||||
end;
|
end;
|
||||||
@ -232,7 +232,7 @@ class procedure TQtWSBitBtn.SetText(const AWinControl: TWinControl;
|
|||||||
var
|
var
|
||||||
Str: WideString;
|
Str: WideString;
|
||||||
begin
|
begin
|
||||||
Str := WideString(AText);
|
Str := UTF8Decode(AText);
|
||||||
|
|
||||||
TQtAbstractButton(AWinControl.Handle).SetText(@Str);
|
TQtAbstractButton(AWinControl.Handle).SetText(@Str);
|
||||||
end;
|
end;
|
||||||
|
|||||||
@ -133,15 +133,15 @@ begin
|
|||||||
|
|
||||||
ReturnText := '';
|
ReturnText := '';
|
||||||
|
|
||||||
Caption := WideString(ACommonDialog.Title);
|
Caption := UTF8Decode(ACommonDialog.Title);
|
||||||
|
|
||||||
if ACommonDialog is TFileDialog then
|
if ACommonDialog is TFileDialog then
|
||||||
begin
|
begin
|
||||||
FileDialog := TFileDialog(ACommonDialog);
|
FileDialog := TFileDialog(ACommonDialog);
|
||||||
|
|
||||||
Dir := WideString(FileDialog.InitialDir);
|
Dir := UTF8Decode(FileDialog.InitialDir);
|
||||||
|
|
||||||
Filter := WideString(FileDialog.Filter);
|
Filter := UTF8Decode(FileDialog.Filter);
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
This is a parser that converts LCL filter strings to Qt filter strings
|
This is a parser that converts LCL filter strings to Qt filter strings
|
||||||
@ -210,7 +210,7 @@ begin
|
|||||||
else
|
else
|
||||||
QFileDialog_getOpenFileName(@ReturnText, Parent, @Caption, @Dir, @Filter, @selectedFilter, options);
|
QFileDialog_getOpenFileName(@ReturnText, Parent, @Caption, @Dir, @Filter, @selectedFilter, options);
|
||||||
|
|
||||||
FileDialog.FileName := string(ReturnText);
|
FileDialog.FileName := UTF8Encode(ReturnText);
|
||||||
|
|
||||||
if ReturnText = '' then ACommonDialog.UserChoice := mrCancel
|
if ReturnText = '' then ACommonDialog.UserChoice := mrCancel
|
||||||
else ACommonDialog.UserChoice := mrOK;
|
else ACommonDialog.UserChoice := mrOK;
|
||||||
|
|||||||
@ -340,7 +340,7 @@ class procedure TQtWSCustomNotebook.AddPage(const ANotebook: TCustomNotebook;
|
|||||||
var
|
var
|
||||||
Str: WideString;
|
Str: WideString;
|
||||||
begin
|
begin
|
||||||
Str := WideString(AChild.Caption);
|
Str := UTF8Decode(AChild.Caption);
|
||||||
|
|
||||||
TQtTabWidget(ANotebook.Handle).insertTab(AIndex, TQtWidget(AChild.Handle).Widget, @Str);
|
TQtTabWidget(ANotebook.Handle).insertTab(AIndex, TQtWidget(AChild.Handle).Widget, @Str);
|
||||||
end;
|
end;
|
||||||
|
|||||||
@ -148,7 +148,7 @@ begin
|
|||||||
|
|
||||||
// Set´s initial properties
|
// Set´s initial properties
|
||||||
|
|
||||||
Str := WideString(AWinControl.Caption);
|
Str := UTF8Decode(AWinControl.Caption);
|
||||||
|
|
||||||
QtMainWindow.SetWindowTitle(@Str);
|
QtMainWindow.SetWindowTitle(@Str);
|
||||||
|
|
||||||
@ -194,7 +194,7 @@ var
|
|||||||
begin
|
begin
|
||||||
TQtWidget(AWinControl.Handle).WindowTitle(@Str);
|
TQtWidget(AWinControl.Handle).WindowTitle(@Str);
|
||||||
|
|
||||||
AText := String(Str);
|
AText := UTF8Encode(Str);
|
||||||
|
|
||||||
Result := True;
|
Result := True;
|
||||||
end;
|
end;
|
||||||
@ -210,7 +210,7 @@ class procedure TQtWSCustomForm.SetText(const AWinControl: TWinControl; const AT
|
|||||||
var
|
var
|
||||||
Str: WideString;
|
Str: WideString;
|
||||||
begin
|
begin
|
||||||
Str := WideString(AText);
|
Str := UTF8Decode(AText);
|
||||||
|
|
||||||
TQtWidget(AWinControl.Handle).SetWindowTitle(@Str);
|
TQtWidget(AWinControl.Handle).SetWindowTitle(@Str);
|
||||||
end;
|
end;
|
||||||
|
|||||||
@ -140,7 +140,7 @@ begin
|
|||||||
{ Count indicates the number of subitems this item has }
|
{ Count indicates the number of subitems this item has }
|
||||||
else if AMenuItem.Count > 0 then
|
else if AMenuItem.Count > 0 then
|
||||||
begin
|
begin
|
||||||
Text := WideString(AMenuItem.Caption);
|
Text := UTF8Decode(AMenuItem.Caption);
|
||||||
|
|
||||||
Menu := MenuBar.addMenu(@Text);
|
Menu := MenuBar.addMenu(@Text);
|
||||||
|
|
||||||
@ -150,7 +150,7 @@ begin
|
|||||||
begin
|
begin
|
||||||
ActionHandle := True;
|
ActionHandle := True;
|
||||||
|
|
||||||
Text := WideString(AMenuItem.Caption);
|
Text := UTF8Decode(AMenuItem.Caption);
|
||||||
|
|
||||||
Action := MenuBar.addAction(@Text);
|
Action := MenuBar.addAction(@Text);
|
||||||
|
|
||||||
@ -178,7 +178,7 @@ begin
|
|||||||
{ Count indicates the number of subitems this item has }
|
{ Count indicates the number of subitems this item has }
|
||||||
else if AMenuItem.Count > 0 then
|
else if AMenuItem.Count > 0 then
|
||||||
begin
|
begin
|
||||||
Text := WideString(AMenuItem.Caption);
|
Text := UTF8Decode(AMenuItem.Caption);
|
||||||
|
|
||||||
Menu := ParentMenu.addMenu(@Text);
|
Menu := ParentMenu.addMenu(@Text);
|
||||||
|
|
||||||
@ -188,7 +188,7 @@ begin
|
|||||||
begin
|
begin
|
||||||
ActionHandle := True;
|
ActionHandle := True;
|
||||||
|
|
||||||
Text := WideString(AMenuItem.Caption);
|
Text := UTF8Decode(AMenuItem.Caption);
|
||||||
|
|
||||||
Action := ParentMenu.addAction(@Text);
|
Action := ParentMenu.addAction(@Text);
|
||||||
|
|
||||||
|
|||||||
@ -496,7 +496,7 @@ var
|
|||||||
begin
|
begin
|
||||||
if Length(AText) = 0 then
|
if Length(AText) = 0 then
|
||||||
exit;
|
exit;
|
||||||
Astr := WideString(AText);
|
Astr := UTF8Decode(AText);
|
||||||
//QTextEdit_append(QTextEditH(ACustomMemo.Handle),@Astr);
|
//QTextEdit_append(QTextEditH(ACustomMemo.Handle),@Astr);
|
||||||
QTextEdit_append(QTextEditH(TQtWidget(ACustomMemo.Handle).Widget),@Astr);
|
QTextEdit_append(QTextEditH(TQtWidget(ACustomMemo.Handle).Widget),@Astr);
|
||||||
|
|
||||||
@ -544,7 +544,7 @@ var
|
|||||||
begin
|
begin
|
||||||
QTextEdit_toPlainText(QTextEditH(TQtWidget(AWinControl.Handle).Widget), @Str);
|
QTextEdit_toPlainText(QTextEditH(TQtWidget(AWinControl.Handle).Widget), @Str);
|
||||||
|
|
||||||
AText := String(Str);
|
AText := UTF8Encode(Str);
|
||||||
|
|
||||||
Result := True;
|
Result := True;
|
||||||
end;
|
end;
|
||||||
@ -558,7 +558,7 @@ class procedure TQtWSCustomMemo.SetText(const AWinControl: TWinControl; const AT
|
|||||||
var
|
var
|
||||||
AString: WideString;
|
AString: WideString;
|
||||||
begin
|
begin
|
||||||
AString := WideString(AText);
|
AString := UTF8Decode(AText);
|
||||||
|
|
||||||
QTextEdit_append(QTextEditH(TQtWidget(AWinControl.Handle).Widget), @AString);
|
QTextEdit_append(QTextEditH(TQtWidget(AWinControl.Handle).Widget), @AString);
|
||||||
end;
|
end;
|
||||||
@ -614,7 +614,7 @@ var
|
|||||||
begin
|
begin
|
||||||
QLineEdit_text(QLineEditH(TQtWidget(AWinControl.Handle).Widget), @Str);
|
QLineEdit_text(QLineEditH(TQtWidget(AWinControl.Handle).Widget), @Str);
|
||||||
|
|
||||||
AText := String(Str);
|
AText := UTF8Encode(Str);
|
||||||
|
|
||||||
Result := True;
|
Result := True;
|
||||||
end;
|
end;
|
||||||
@ -628,7 +628,7 @@ class procedure TQtWSCustomEdit.SetText(const AWinControl: TWinControl; const AT
|
|||||||
var
|
var
|
||||||
AString: WideString;
|
AString: WideString;
|
||||||
begin
|
begin
|
||||||
AString := WideString(AText);
|
AString := UTF8Decode(AText);
|
||||||
|
|
||||||
QLineEdit_setText(QLineEditH(TQtWidget(AWinControl.Handle).Widget), @AString);
|
QLineEdit_setText(QLineEditH(TQtWidget(AWinControl.Handle).Widget), @AString);
|
||||||
end;
|
end;
|
||||||
@ -687,7 +687,7 @@ var
|
|||||||
begin
|
begin
|
||||||
TQtStaticText(AWinControl.Handle).Text(@Str);
|
TQtStaticText(AWinControl.Handle).Text(@Str);
|
||||||
|
|
||||||
AText := string(Str);
|
AText := UTF8Encode(Str);
|
||||||
|
|
||||||
Result := True;
|
Result := True;
|
||||||
end;
|
end;
|
||||||
@ -701,7 +701,7 @@ class procedure TQtWSCustomStaticText.SetText(const AWinControl: TWinControl; co
|
|||||||
var
|
var
|
||||||
Str: WideString;
|
Str: WideString;
|
||||||
begin
|
begin
|
||||||
Str := WideString(AText);
|
Str := UTF8Decode(AText);
|
||||||
|
|
||||||
TQtStaticText(AWinControl.Handle).SetText(@Str);
|
TQtStaticText(AWinControl.Handle).SetText(@Str);
|
||||||
end;
|
end;
|
||||||
@ -760,7 +760,7 @@ var
|
|||||||
begin
|
begin
|
||||||
TQtAbstractButton(AWinControl.Handle).Text(@Str);
|
TQtAbstractButton(AWinControl.Handle).Text(@Str);
|
||||||
|
|
||||||
AText := string(Str);
|
AText := UTF8Encode(Str);
|
||||||
|
|
||||||
Result := True;
|
Result := True;
|
||||||
end;
|
end;
|
||||||
@ -774,7 +774,7 @@ class procedure TQtWSCustomCheckBox.SetText(const AWinControl: TWinControl; cons
|
|||||||
var
|
var
|
||||||
Str: WideString;
|
Str: WideString;
|
||||||
begin
|
begin
|
||||||
Str := WideString(AText);
|
Str := UTF8Decode(AText);
|
||||||
|
|
||||||
TQtAbstractButton(AWinControl.Handle).SetText(@Str);
|
TQtAbstractButton(AWinControl.Handle).SetText(@Str);
|
||||||
end;
|
end;
|
||||||
@ -865,7 +865,7 @@ var
|
|||||||
begin
|
begin
|
||||||
TQtAbstractButton(AWinControl.Handle).Text(@Str);
|
TQtAbstractButton(AWinControl.Handle).Text(@Str);
|
||||||
|
|
||||||
AText := string(Str);
|
AText := UTF8Encode(Str);
|
||||||
|
|
||||||
Result := True;
|
Result := True;
|
||||||
end;
|
end;
|
||||||
@ -881,7 +881,7 @@ class procedure TQtWSRadioButton.SetText(const AWinControl: TWinControl; const A
|
|||||||
var
|
var
|
||||||
Str: WideString;
|
Str: WideString;
|
||||||
begin
|
begin
|
||||||
Str := WideString(AText);
|
Str := UTF8Decode(AText);
|
||||||
|
|
||||||
TQtAbstractButton(AWinControl.Handle).SetText(@Str);
|
TQtAbstractButton(AWinControl.Handle).SetText(@Str);
|
||||||
end;
|
end;
|
||||||
@ -956,7 +956,7 @@ begin
|
|||||||
|
|
||||||
Result := THandle(QtGroupBox);
|
Result := THandle(QtGroupBox);
|
||||||
|
|
||||||
Str := WideString(AWinControl.Caption);
|
Str := UTF8Decode(AWinControl.Caption);
|
||||||
QGroupBox_setTitle(QGroupBoxH(QtGroupBox.Widget), @Str);
|
QGroupBox_setTitle(QGroupBoxH(QtGroupBox.Widget), @Str);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user