mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 21:59:07 +02:00
lcl: declare TExtLogPen
qt: return ExtLogPen in GetObject if pen was created by ExtCreatePen git-svn-id: trunk@17136 -
This commit is contained in:
parent
592d0ebfd3
commit
f0b96b997f
@ -627,7 +627,7 @@ begin
|
|||||||
|
|
||||||
with LogPen do
|
with LogPen do
|
||||||
begin
|
begin
|
||||||
case lopnStyle of
|
case lopnStyle and PS_STYLE_MASK of
|
||||||
PS_SOLID: QtPen.setStyle(QtSolidLine);
|
PS_SOLID: QtPen.setStyle(QtSolidLine);
|
||||||
PS_DASH: QtPen.setStyle(QtDashLine);
|
PS_DASH: QtPen.setStyle(QtDashLine);
|
||||||
PS_DOT: QtPen.setStyle(QtDotLine);
|
PS_DOT: QtPen.setStyle(QtDotLine);
|
||||||
@ -2241,6 +2241,7 @@ var
|
|||||||
BitmapSection : TDIBSECTION;
|
BitmapSection : TDIBSECTION;
|
||||||
ALogFont: PLogFont absolute Buf;
|
ALogFont: PLogFont absolute Buf;
|
||||||
ALogPen: PLogPen absolute Buf;
|
ALogPen: PLogPen absolute Buf;
|
||||||
|
AExtLogPen: PExtLogPen absolute Buf;
|
||||||
{$ifdef VerboseQtWinAPI}
|
{$ifdef VerboseQtWinAPI}
|
||||||
ObjType: string;
|
ObjType: string;
|
||||||
{$endif}
|
{$endif}
|
||||||
@ -2311,18 +2312,61 @@ begin
|
|||||||
else
|
else
|
||||||
if aObject is TQtPen then
|
if aObject is TQtPen then
|
||||||
begin
|
begin
|
||||||
if Buf = nil then
|
if not APen.IsExtPen then
|
||||||
Result := SizeOf(TLogPen)
|
|
||||||
else
|
|
||||||
if BufSize >= SizeOf(TLogPen) then
|
|
||||||
begin
|
begin
|
||||||
Result := SizeOf(TLogPen);
|
if Buf = nil then
|
||||||
TQColorToColorRef(APen.getColor, ALogPen^.lopnColor);
|
Result := SizeOf(TLogPen)
|
||||||
if APen.getCosmetic then
|
|
||||||
ALogPen^.lopnWidth := Point(0, 0)
|
|
||||||
else
|
else
|
||||||
ALogPen^.lopnWidth := Point(APen.getWidth, 0);
|
if BufSize >= SizeOf(TLogPen) then
|
||||||
ALogPen^.lopnStyle := QtPenStyleToWinStyleMap[APen.getStyle];
|
begin
|
||||||
|
Result := SizeOf(TLogPen);
|
||||||
|
TQColorToColorRef(APen.getColor, ALogPen^.lopnColor);
|
||||||
|
if APen.getCosmetic then
|
||||||
|
ALogPen^.lopnWidth := Point(1, 0)
|
||||||
|
else
|
||||||
|
ALogPen^.lopnWidth := Point(APen.getWidth, 0);
|
||||||
|
ALogPen^.lopnStyle := QtPenStyleToWinStyleMap[APen.getStyle];
|
||||||
|
end;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
if Buf = nil then
|
||||||
|
Result := SizeOf(TExtLogPen)
|
||||||
|
else
|
||||||
|
if BufSize >= SizeOf(TExtLogPen) then
|
||||||
|
begin
|
||||||
|
Result := SizeOf(TExtLogPen);
|
||||||
|
AExtLogPen^.elpPenStyle := QtPenStyleToWinStyleMap[APen.getStyle];
|
||||||
|
|
||||||
|
if not APen.getCosmetic then
|
||||||
|
begin
|
||||||
|
AExtLogPen^.elpPenStyle := AExtLogPen^.elpPenStyle or PS_GEOMETRIC;
|
||||||
|
|
||||||
|
case APen.getJoinStyle of
|
||||||
|
QtMiterJoin: AExtLogPen^.elpPenStyle := AExtLogPen^.elpPenStyle or PS_JOIN_MITER;
|
||||||
|
QtBevelJoin: AExtLogPen^.elpPenStyle := AExtLogPen^.elpPenStyle or PS_JOIN_BEVEL;
|
||||||
|
QtRoundJoin: AExtLogPen^.elpPenStyle := AExtLogPen^.elpPenStyle or PS_JOIN_ROUND;
|
||||||
|
end;
|
||||||
|
|
||||||
|
case APen.getCapStyle of
|
||||||
|
QtFlatCap: AExtLogPen^.elpPenStyle := AExtLogPen^.elpPenStyle or PS_ENDCAP_FLAT;
|
||||||
|
QtSquareCap: AExtLogPen^.elpPenStyle := AExtLogPen^.elpPenStyle or PS_ENDCAP_SQUARE;
|
||||||
|
QtRoundCap: AExtLogPen^.elpPenStyle := AExtLogPen^.elpPenStyle or PS_ENDCAP_ROUND;
|
||||||
|
end;
|
||||||
|
|
||||||
|
AExtLogPen^.elpWidth := APen.getWidth;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
AExtLogPen^.elpWidth := 1;
|
||||||
|
|
||||||
|
AExtLogPen^.elpBrushStyle := BS_SOLID;
|
||||||
|
TQColorToColorRef(APen.getColor, AExtLogPen^.elpColor);
|
||||||
|
AExtLogPen^.elpHatch := 0;
|
||||||
|
{ TODO: PS_USERSTYLE
|
||||||
|
elpNumEntries: DWORD;
|
||||||
|
elpStyleEntry: array[0..0] of DWORD;
|
||||||
|
}
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
end
|
end
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
|
@ -2037,6 +2037,20 @@ type
|
|||||||
TLogPen = tagLOGPEN;
|
TLogPen = tagLOGPEN;
|
||||||
LOGPEN = tagLOGPEN;
|
LOGPEN = tagLOGPEN;
|
||||||
|
|
||||||
|
PExtLogPen = ^TExtLogPen;
|
||||||
|
tagEXTLOGPEN = record
|
||||||
|
elpPenStyle: LongWord;
|
||||||
|
elpWidth: LongWord;
|
||||||
|
elpBrushStyle: LongWord;
|
||||||
|
elpColor: TColorRef;
|
||||||
|
elpHatch: PtrInt;
|
||||||
|
elpNumEntries: DWORD;
|
||||||
|
elpStyleEntry: array[0..0] of DWORD;
|
||||||
|
end;
|
||||||
|
TExtLogPen = tagEXTLOGPEN;
|
||||||
|
EXTLOGPEN = tagEXTLOGPEN;
|
||||||
|
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
PTextMetricA = ^TTextMetricA;
|
PTextMetricA = ^TTextMetricA;
|
||||||
|
Loading…
Reference in New Issue
Block a user