mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 06:56:10 +02:00
win32: don't add tab is Notebook.ShowTabs = False (bug #0012775)
git-svn-id: trunk@18183 -
This commit is contained in:
parent
e65435e6ab
commit
75f25dfbab
@ -424,28 +424,31 @@ var
|
||||
begin
|
||||
with ANotebook do
|
||||
begin
|
||||
TCI.Mask := TCIF_TEXT or TCIF_PARAM or TCIF_IMAGE;
|
||||
// store object as extra, so we can verify we got the right page later
|
||||
TCI.lParam := PtrUInt(AChild);
|
||||
TCI.iImage := ANotebook.GetImageIndex(AIndex);
|
||||
{$ifdef WindowsUnicodeSupport}
|
||||
if UnicodeEnabledOS then
|
||||
if ShowTabs 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));
|
||||
TCI.Mask := TCIF_TEXT or TCIF_PARAM or TCIF_IMAGE;
|
||||
// store object as extra, so we can verify we got the right page later
|
||||
TCI.lParam := PtrUInt(AChild);
|
||||
TCI.iImage := ANotebook.GetImageIndex(AIndex);
|
||||
{$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));
|
||||
{$endif}
|
||||
// clientrect possible changed, adding first tab, or deleting last
|
||||
// windows should send a WM_SIZE message because of this, but it doesn't
|
||||
// send it ourselves
|
||||
end;
|
||||
{$else}
|
||||
TCI.pszText := PChar(AChild.Caption);
|
||||
Windows.SendMessage(Handle, TCM_INSERTITEM, AIndex, LPARAM(@TCI));
|
||||
{$endif}
|
||||
// clientrect possible changed, adding first tab, or deleting last
|
||||
// windows should send a WM_SIZE message because of this, but it doesn't
|
||||
// send it ourselves
|
||||
LCLControlSizeNeedsUpdate(ANotebook, true);
|
||||
end;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user