mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-28 11:22:38 +02:00
Implemented unicode support for tab controls under windows.
git-svn-id: trunk@11586 -
This commit is contained in:
parent
146cc33de1
commit
04f56784d8
@ -333,8 +333,21 @@ begin
|
|||||||
begin
|
begin
|
||||||
Assert(False, Format('Trace:TWin32WSCustomPage.SetText --> %S', [AText]));
|
Assert(False, Format('Trace:TWin32WSCustomPage.SetText --> %S', [AText]));
|
||||||
TCI.mask := TCIF_TEXT;
|
TCI.mask := TCIF_TEXT;
|
||||||
|
{$ifdef WindowsUnicodeSupport}
|
||||||
|
if UnicodeEnabledOS then
|
||||||
|
begin
|
||||||
|
TCI.pszText := PChar(PWideChar(Utf8Decode(AText)));
|
||||||
|
Windows.SendMessage(NotebookHandle, TCM_SETITEMW, PageIndex, LPARAM(@TCI));
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
TCI.pszText := PChar(UTF8ToAnsi(AText));
|
||||||
|
Windows.SendMessage(NotebookHandle, TCM_SETITEM, PageIndex, LPARAM(@TCI));
|
||||||
|
end;
|
||||||
|
{$else}
|
||||||
TCI.pszText := PChar(AText);
|
TCI.pszText := PChar(AText);
|
||||||
Windows.SendMessage(NotebookHandle, TCM_SETITEM, PageIndex, LPARAM(@TCI));
|
Windows.SendMessage(NotebookHandle, TCM_SETITEM, PageIndex, LPARAM(@TCI));
|
||||||
|
{$endif}
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -384,10 +397,23 @@ begin
|
|||||||
with ANotebook do
|
with ANotebook do
|
||||||
begin
|
begin
|
||||||
TCI.Mask := TCIF_TEXT or TCIF_PARAM;
|
TCI.Mask := TCIF_TEXT or TCIF_PARAM;
|
||||||
TCI.pszText := PChar(AChild.Caption);
|
|
||||||
// store object as extra, so we can verify we got the right page later
|
// store object as extra, so we can verify we got the right page later
|
||||||
TCI.lParam := PtrUInt(AChild);
|
TCI.lParam := PtrUInt(AChild);
|
||||||
|
{$ifdef WindowsUnicodeSupport}
|
||||||
|
if UnicodeEnabledOS then
|
||||||
|
begin
|
||||||
|
TCI.pszText := PChar(PWideChar(Utf8Decode(AChild.Caption)));
|
||||||
|
Windows.SendMessage(Handle, TCM_INSERTITEMW, AIndex, LPARAM(@TCI));
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
TCI.pszText := PChar(Utf8ToAnsi(AChild.Caption));
|
||||||
|
Windows.SendMessage(Handle, TCM_INSERTITEM, AIndex, LPARAM(@TCI));
|
||||||
|
end;
|
||||||
|
{$else}
|
||||||
|
TCI.pszText := PChar(AChild.Caption);
|
||||||
Windows.SendMessage(Handle, TCM_INSERTITEM, AIndex, LPARAM(@TCI));
|
Windows.SendMessage(Handle, TCM_INSERTITEM, AIndex, LPARAM(@TCI));
|
||||||
|
{$endif}
|
||||||
// clientrect possible changed, adding first tab, or deleting last
|
// clientrect possible changed, adding first tab, or deleting last
|
||||||
// windows should send a WM_SIZE message because of this, but it doesn't
|
// windows should send a WM_SIZE message because of this, but it doesn't
|
||||||
// send it ourselves
|
// send it ourselves
|
||||||
@ -435,9 +461,22 @@ begin
|
|||||||
if (Res = 0) or (PtrUInt(TCI.lParam) <> PtrUInt(lPage)) then
|
if (Res = 0) or (PtrUInt(TCI.lParam) <> PtrUInt(lPage)) then
|
||||||
begin
|
begin
|
||||||
TCI.Mask := TCIF_TEXT or TCIF_PARAM;
|
TCI.Mask := TCIF_TEXT or TCIF_PARAM;
|
||||||
TCI.pszText := PChar(lPage.Caption);
|
|
||||||
TCI.lParam := PtrUInt(lPage);
|
TCI.lParam := PtrUInt(lPage);
|
||||||
|
{$ifdef WindowsUnicodeSupport}
|
||||||
|
if UnicodeEnabledOS then
|
||||||
|
begin
|
||||||
|
TCI.pszText := PChar(PWideChar(Utf8Decode(lPage.Caption)));
|
||||||
|
Windows.SendMessage(WinHandle, TCM_INSERTITEMW, RealIndex, LPARAM(@TCI));
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
TCI.pszText := PChar(Utf8ToAnsi(lPage.Caption));
|
||||||
|
Windows.SendMessage(WinHandle, TCM_INSERTITEM, RealIndex, LPARAM(@TCI));
|
||||||
|
end;
|
||||||
|
{$else}
|
||||||
|
TCI.pszText := PChar(lPage.Caption);
|
||||||
Windows.SendMessage(WinHandle, TCM_INSERTITEM, RealIndex, LPARAM(@TCI));
|
Windows.SendMessage(WinHandle, TCM_INSERTITEM, RealIndex, LPARAM(@TCI));
|
||||||
|
{$endif}
|
||||||
end;
|
end;
|
||||||
Inc(RealIndex);
|
Inc(RealIndex);
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user