mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-15 20:39:14 +02:00
Qt,Qt5,Qt6: Implemented TComboBox.AdjustDropDown - TQtWidgetSet.SetComboMinDropDownSize.
This commit is contained in:
parent
05fbbfe042
commit
a7e90edd46
@ -887,6 +887,25 @@ begin
|
|||||||
QSocketNotifier_setEnabled(wheh^.qsn[QSocketNotifierException], do_error);
|
QSocketNotifier_setEnabled(wheh^.qsn[QSocketNotifierException], do_error);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TQtWidgetSet.SetComboMinDropDownSize(Handle: HWND; MinItemsWidth, MinItemsHeight, MinItemCount: integer): boolean;
|
||||||
|
var
|
||||||
|
ACombo: QComboBoxH;
|
||||||
|
AView: QAbstractItemViewH;
|
||||||
|
begin
|
||||||
|
Result := False;
|
||||||
|
if not IsValidHandle(Handle) then
|
||||||
|
exit;
|
||||||
|
ACombo := QComboBoxH(TQtComboBox(Handle).Widget);
|
||||||
|
AView := QListWidgetH(QComboBox_view(ACombo));
|
||||||
|
if Assigned(AView) then
|
||||||
|
begin
|
||||||
|
QWidget_setMinimumWidth(AView, MinItemsWidth);
|
||||||
|
QWidget_setMinimumHeight(AView, MinItemsHeight);
|
||||||
|
QComboBox_setMaxVisibleItems(ACombo, MinItemCount);
|
||||||
|
Result := True;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TQtWidgetSet.SetRubberBandRect(const ARubberBand: HWND; const ARect: TRect);
|
procedure TQtWidgetSet.SetRubberBandRect(const ARubberBand: HWND; const ARect: TRect);
|
||||||
begin
|
begin
|
||||||
if ARubberBand = 0 then
|
if ARubberBand = 0 then
|
||||||
|
@ -74,6 +74,7 @@ procedure RemovePipeEventHandler(var AHandler: PPipeEventHandler); override;
|
|||||||
procedure RemoveProcessEventHandler(var AHandler: PProcessEventHandler); override;
|
procedure RemoveProcessEventHandler(var AHandler: PProcessEventHandler); override;
|
||||||
|
|
||||||
procedure SetEventHandlerFlags(AHandler: PEventHandler; NewFlags: dword); override;
|
procedure SetEventHandlerFlags(AHandler: PEventHandler; NewFlags: dword); override;
|
||||||
|
function SetComboMinDropDownSize(Handle: HWND; MinItemsWidth, MinItemsHeight, MinItemCount: integer): boolean; override;
|
||||||
procedure SetRubberBandRect(const ARubberBand: HWND; const ARect: TRect); override;
|
procedure SetRubberBandRect(const ARubberBand: HWND; const ARect: TRect); override;
|
||||||
|
|
||||||
function TextUTF8Out(DC: HDC; X, Y: Integer; Str: PChar; Count: Longint): Boolean; override;
|
function TextUTF8Out(DC: HDC; X, Y: Integer; Str: PChar; Count: Longint): Boolean; override;
|
||||||
|
@ -884,6 +884,25 @@ begin
|
|||||||
QSocketNotifier_setEnabled(wheh^.qsn[QSocketNotifierException], do_error);
|
QSocketNotifier_setEnabled(wheh^.qsn[QSocketNotifierException], do_error);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TQtWidgetSet.SetComboMinDropDownSize(Handle: HWND; MinItemsWidth, MinItemsHeight, MinItemCount: integer): boolean;
|
||||||
|
var
|
||||||
|
ACombo: QComboBoxH;
|
||||||
|
AView: QAbstractItemViewH;
|
||||||
|
begin
|
||||||
|
Result := False;
|
||||||
|
if not IsValidHandle(Handle) then
|
||||||
|
exit;
|
||||||
|
ACombo := QComboBoxH(TQtComboBox(Handle).Widget);
|
||||||
|
AView := QListWidgetH(QComboBox_view(ACombo));
|
||||||
|
if Assigned(AView) then
|
||||||
|
begin
|
||||||
|
QWidget_setMinimumWidth(AView, MinItemsWidth);
|
||||||
|
QWidget_setMinimumHeight(AView, MinItemsHeight);
|
||||||
|
QComboBox_setMaxVisibleItems(ACombo, MinItemCount);
|
||||||
|
Result := True;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TQtWidgetSet.SetRubberBandRect(const ARubberBand: HWND; const ARect: TRect);
|
procedure TQtWidgetSet.SetRubberBandRect(const ARubberBand: HWND; const ARect: TRect);
|
||||||
begin
|
begin
|
||||||
if ARubberBand = 0 then
|
if ARubberBand = 0 then
|
||||||
|
@ -73,6 +73,7 @@ procedure RemovePipeEventHandler(var AHandler: PPipeEventHandler); override;
|
|||||||
procedure RemoveProcessEventHandler(var AHandler: PProcessEventHandler); override;
|
procedure RemoveProcessEventHandler(var AHandler: PProcessEventHandler); override;
|
||||||
|
|
||||||
procedure SetEventHandlerFlags(AHandler: PEventHandler; NewFlags: dword); override;
|
procedure SetEventHandlerFlags(AHandler: PEventHandler; NewFlags: dword); override;
|
||||||
|
function SetComboMinDropDownSize(Handle: HWND; MinItemsWidth, MinItemsHeight, MinItemCount: integer): boolean; override;
|
||||||
procedure SetRubberBandRect(const ARubberBand: HWND; const ARect: TRect); override;
|
procedure SetRubberBandRect(const ARubberBand: HWND; const ARect: TRect); override;
|
||||||
|
|
||||||
function TextUTF8Out(DC: HDC; X, Y: Integer; Str: PChar; Count: Longint): Boolean; override;
|
function TextUTF8Out(DC: HDC; X, Y: Integer; Str: PChar; Count: Longint): Boolean; override;
|
||||||
|
@ -905,6 +905,25 @@ begin
|
|||||||
QSocketNotifier_setEnabled(wheh^.qsn[QSocketNotifierException], do_error);
|
QSocketNotifier_setEnabled(wheh^.qsn[QSocketNotifierException], do_error);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TQtWidgetSet.SetComboMinDropDownSize(Handle: HWND; MinItemsWidth, MinItemsHeight, MinItemCount: integer): boolean;
|
||||||
|
var
|
||||||
|
ACombo: QComboBoxH;
|
||||||
|
AView: QAbstractItemViewH;
|
||||||
|
begin
|
||||||
|
Result := False;
|
||||||
|
if not IsValidHandle(Handle) then
|
||||||
|
exit;
|
||||||
|
ACombo := QComboBoxH(TQtComboBox(Handle).Widget);
|
||||||
|
AView := QListWidgetH(QComboBox_view(ACombo));
|
||||||
|
if Assigned(AView) then
|
||||||
|
begin
|
||||||
|
QWidget_setMinimumWidth(AView, MinItemsWidth);
|
||||||
|
QWidget_setMinimumHeight(AView, MinItemsHeight);
|
||||||
|
QComboBox_setMaxVisibleItems(ACombo, MinItemCount);
|
||||||
|
Result := True;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TQtWidgetSet.SetRubberBandRect(const ARubberBand: HWND; const ARect: TRect);
|
procedure TQtWidgetSet.SetRubberBandRect(const ARubberBand: HWND; const ARect: TRect);
|
||||||
begin
|
begin
|
||||||
if ARubberBand = 0 then
|
if ARubberBand = 0 then
|
||||||
|
@ -73,6 +73,7 @@ procedure RemovePipeEventHandler(var AHandler: PPipeEventHandler); override;
|
|||||||
procedure RemoveProcessEventHandler(var AHandler: PProcessEventHandler); override;
|
procedure RemoveProcessEventHandler(var AHandler: PProcessEventHandler); override;
|
||||||
|
|
||||||
procedure SetEventHandlerFlags(AHandler: PEventHandler; NewFlags: dword); override;
|
procedure SetEventHandlerFlags(AHandler: PEventHandler; NewFlags: dword); override;
|
||||||
|
function SetComboMinDropDownSize(Handle: HWND; MinItemsWidth, MinItemsHeight, MinItemCount: integer): boolean; override;
|
||||||
procedure SetRubberBandRect(const ARubberBand: HWND; const ARect: TRect); override;
|
procedure SetRubberBandRect(const ARubberBand: HWND; const ARect: TRect); override;
|
||||||
|
|
||||||
function TextUTF8Out(DC: HDC; X, Y: Integer; Str: PChar; Count: Longint): Boolean; override;
|
function TextUTF8Out(DC: HDC; X, Y: Integer; Str: PChar; Count: Longint): Boolean; override;
|
||||||
|
Loading…
Reference in New Issue
Block a user