mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-19 05:19:25 +02:00
Qt: Implemented GetControlConstraints() && TextUTF8Out()
git-svn-id: trunk@12421 -
This commit is contained in:
parent
99dd765724
commit
0284accc31
@ -154,6 +154,63 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
Function: GetControlConstraints
|
||||
Params: Constraints: TObject
|
||||
Returns: true on success
|
||||
|
||||
Updates the constraints object (e.g. TSizeConstraints) with interface specific
|
||||
bounds.
|
||||
------------------------------------------------------------------------------}
|
||||
function TQtWidgetSet.GetControlConstraints(Constraints: TObject): boolean;
|
||||
var
|
||||
SizeConstraints: TSizeConstraints;
|
||||
MinWidth: Integer;
|
||||
MinHeight: Integer;
|
||||
MaxWidth: Integer;
|
||||
MaxHeight: Integer;
|
||||
SizeHint: TSize;
|
||||
Ct: TWinControl;
|
||||
begin
|
||||
Result := True;
|
||||
if Constraints is TSizeConstraints then
|
||||
begin
|
||||
|
||||
MinWidth := 0;
|
||||
MinHeight := 0;
|
||||
MaxWidth:=0;
|
||||
MaxHeight:=0;
|
||||
|
||||
SizeConstraints := TSizeConstraints(Constraints);
|
||||
|
||||
if (SizeConstraints.Control=nil) then exit;
|
||||
|
||||
if SizeConstraints.Control is TWinControl then
|
||||
Ct := TWinControl(SizeConstraints.Control);
|
||||
|
||||
if Assigned(Ct) and ct.HandleAllocated then
|
||||
begin
|
||||
QWidget_minimumSize(TQtWidget(Ct.Handle).Widget, @SizeHint);
|
||||
|
||||
MinWidth := SizeHint.cx;
|
||||
MinHeight := SizeHint.cy;
|
||||
|
||||
if MinWidth < 0 then
|
||||
MinWidth := 0;
|
||||
if MinHeight < 0 then
|
||||
MinHeight := 0;
|
||||
|
||||
QWidget_maximumSize(TQtWidget(Ct.Handle).Widget, @SizeHint);
|
||||
|
||||
MaxWidth := SizeHint.cx;
|
||||
MaxHeight := SizeHint.cy;
|
||||
|
||||
SizeConstraints.SetInterfaceConstraints(MinWidth,MinHeight,
|
||||
MinWidth,MinHeight);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
Function: IntfSendsUTF8KeyPress
|
||||
Params:
|
||||
@ -491,4 +548,11 @@ begin
|
||||
{$endif}
|
||||
end;
|
||||
|
||||
function TQtWidgetSet.TextUTF8Out(DC: HDC; X, Y: Integer; Str: PChar; Count: Longint): Boolean;
|
||||
begin
|
||||
Result := False;
|
||||
if IsValidDC(DC) then
|
||||
Result := TextOut(DC, X, Y, Str, Count);
|
||||
end;
|
||||
|
||||
//##apiwiz##eps## // Do not remove, no wizard declaration after this line
|
||||
|
@ -36,6 +36,8 @@ procedure DrawArrow(Arrow: TComponent; Canvas: TPersistent); override;
|
||||
function FontCanUTF8(Font: HFont): boolean; override;
|
||||
function FontIsMonoSpace(Font: HFont): boolean; override;
|
||||
|
||||
function GetControlConstraints(Constraints: TObject): boolean; override;
|
||||
|
||||
function IntfSendsUTF8KeyPress: boolean; override;
|
||||
|
||||
function PromptUser(const DialogCaption : string;
|
||||
@ -54,4 +56,7 @@ function RawImage_DescriptionFromDevice(ADC: HDC; out ADesc: TRawImageDescriptio
|
||||
|
||||
function RawImage_FromBitmap(out ARawImage: TRawImage; ABitmap, AMask: HBITMAP; const ARect: TRect): Boolean; override;
|
||||
function RawImage_FromDevice(out ARawImage: TRawImage; ADC: HDC; const ARect: TRect): Boolean; override;
|
||||
|
||||
function TextUTF8Out(DC: HDC; X, Y: Integer; Str: PChar; Count: Longint): Boolean; override;
|
||||
|
||||
//##apiwiz##eps## // Do not remove, no wizard declaration after this line
|
||||
|
Loading…
Reference in New Issue
Block a user