You've already forked lazarus-ccr
spktoolbar: Make toolbar dpi aware (patch by "regs" with modifications, issue #0030446).
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5073 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
interface
|
interface
|
||||||
|
|
||||||
{$MESSAGE HINT 'W tym module konsekwentnie ka¿dy rect opisuje dok³adny prostok¹t (a nie, jak w przypadku WINAPI - bez dolnej i prawej krawêdzi)'}
|
{$MESSAGE HINT 'Every rect in this module are exact rectanges (not like in WINAPI without right and bottom)'}
|
||||||
|
|
||||||
uses
|
uses
|
||||||
LCLType, Graphics, SysUtils, Classes, Controls, StdCtrls, SpkGraphTools, SpkMath;
|
LCLType, Graphics, SysUtils, Classes, Controls, StdCtrls, SpkGraphTools, SpkMath;
|
||||||
@ -1905,9 +1905,11 @@ class procedure TGUITools.DrawImage(ACanvas: TCanvas; Imagelist: TImageList;
|
|||||||
var UseOrgClipRgn: Boolean;
|
var UseOrgClipRgn: Boolean;
|
||||||
OrgRgn: HRGN;
|
OrgRgn: HRGN;
|
||||||
ClipRgn: HRGN;
|
ClipRgn: HRGN;
|
||||||
|
ImageIcon: TIcon;
|
||||||
|
ImageBitmap: TBitmap;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
// Zapamiêtywanie oryginalnego ClipRgn i ustawianie nowego
|
// Storing original ClipRgn and applying a new one
|
||||||
SaveClipRgn(ACanvas.Handle, UseOrgClipRgn, OrgRgn);
|
SaveClipRgn(ACanvas.Handle, UseOrgClipRgn, OrgRgn);
|
||||||
|
|
||||||
ClipRgn:=CreateRectRgn(ClipRect.left, ClipRect.Top, ClipRect.Right+1, ClipRect.Bottom+1);
|
ClipRgn:=CreateRectRgn(ClipRect.left, ClipRect.Top, ClipRect.Right+1, ClipRect.Bottom+1);
|
||||||
@ -1916,7 +1918,19 @@ if UseOrgClipRgn then
|
|||||||
|
|
||||||
SelectClipRgn(ACanvas.Handle, ClipRgn);
|
SelectClipRgn(ACanvas.Handle, ClipRgn);
|
||||||
|
|
||||||
ImageList.Draw(ACanvas, Point.x, Point.y, ImageIndex);
|
// avoid exclusive draw. draw with local canvas itself.
|
||||||
|
//ImageList.Draw(ACanvas, Point.x, Point.y, ImageIndex);
|
||||||
|
{$IfDef LCLWin32}
|
||||||
|
ImageIcon := TIcon.Create;
|
||||||
|
ImageList.GetIcon(ImageIndex, ImageIcon);
|
||||||
|
ACanvas.Draw(Point.x, Point.y, ImageIcon);
|
||||||
|
ImageIcon.Free;
|
||||||
|
{$Else}
|
||||||
|
ImageBitmap := TBitmap.Create;
|
||||||
|
ImageList.GetBitmap(ImageIndex, ImageBitmap);
|
||||||
|
ACanvas.Draw(Point.x, Point.y, ImageBitmap);
|
||||||
|
ImageBitmap.Free;
|
||||||
|
{$EndIf}
|
||||||
|
|
||||||
RestoreClipRgn(ACanvas.Handle, UseOrgClipRgn, OrgRgn);
|
RestoreClipRgn(ACanvas.Handle, UseOrgClipRgn, OrgRgn);
|
||||||
DeleteObject(ClipRgn);
|
DeleteObject(ClipRgn);
|
||||||
|
@ -19,7 +19,7 @@ interface
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
LCLType, LMessages, Graphics, SysUtils, Controls, Classes, Math, Dialogs,
|
LCLType, LMessages, Graphics, SysUtils, Controls, Classes, Math, Dialogs,
|
||||||
Types, SpkGraphTools, SpkGUITools, SpkMath, ExtCtrls,
|
Forms, Types, SpkGraphTools, SpkGUITools, SpkMath, ExtCtrls,
|
||||||
spkt_Appearance, spkt_BaseItem, spkt_Const, spkt_Dispatch, spkt_Tab,
|
spkt_Appearance, spkt_BaseItem, spkt_Const, spkt_Dispatch, spkt_Tab,
|
||||||
spkt_Pane, spkt_Types;
|
spkt_Pane, spkt_Types;
|
||||||
|
|
||||||
@ -453,6 +453,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
constructor TSpkToolbar.Create(AOwner: TComponent);
|
constructor TSpkToolbar.Create(AOwner: TComponent);
|
||||||
|
var
|
||||||
|
DesignDPI: Integer;
|
||||||
begin
|
begin
|
||||||
inherited Create(AOwner);
|
inherited Create(AOwner);
|
||||||
|
|
||||||
@ -460,7 +462,15 @@ begin
|
|||||||
inherited Align := alTop;
|
inherited Align := alTop;
|
||||||
//todo: not found in lcl
|
//todo: not found in lcl
|
||||||
//inherited AlignWithMargins:=true;
|
//inherited AlignWithMargins:=true;
|
||||||
inherited Height := TOOLBAR_HEIGHT;
|
|
||||||
|
if AOwner is TForm then
|
||||||
|
DesignDPI := TForm(AOwner).DesignTimeDPI
|
||||||
|
else
|
||||||
|
DesignDPI := ScreenInfo.PixelsPerInchX;
|
||||||
|
|
||||||
|
SpkInitLayoutConsts(DesignDPI);
|
||||||
|
inherited Height := ToolbarHeight;
|
||||||
|
|
||||||
//inherited Doublebuffered:=true;
|
//inherited Doublebuffered:=true;
|
||||||
|
|
||||||
// Inicjacja wewnêtrznych pól danych
|
// Inicjacja wewnêtrznych pól danych
|
||||||
@ -990,7 +1000,7 @@ end;
|
|||||||
|
|
||||||
procedure TSpkToolbar.DoOnResize;
|
procedure TSpkToolbar.DoOnResize;
|
||||||
begin
|
begin
|
||||||
inherited Height := TOOLBAR_HEIGHT;
|
inherited Height := ToolbarHeight;
|
||||||
|
|
||||||
{$IFDEF DELAYRUNTIMER}
|
{$IFDEF DELAYRUNTIMER}
|
||||||
FDelayRunTimer.Enabled := False;
|
FDelayRunTimer.Enabled := False;
|
||||||
@ -1252,74 +1262,64 @@ procedure TSpkToolbar.ValidateBuffer;
|
|||||||
|
|
||||||
TGuiTools.DrawRoundRect(FBuffer.Canvas,
|
TGuiTools.DrawRoundRect(FBuffer.Canvas,
|
||||||
{$IFDEF EnhancedRecordSupport}
|
{$IFDEF EnhancedRecordSupport}
|
||||||
T2DIntRect.Create(0,
|
T2DIntRect.Create(0, ToolbarTabCaptionsHeight, self.Width - 1, self.Height - 1),
|
||||||
TOOLBAR_TAB_CAPTIONS_HEIGHT,
|
|
||||||
self.Width - 1,
|
|
||||||
self.Height - 1),
|
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
Create2DIntRect(0,
|
Create2DIntRect(0, ToolbarTabCaptionsHeight, self.Width - 1, self.Height - 1),
|
||||||
TOOLBAR_TAB_CAPTIONS_HEIGHT,
|
|
||||||
self.Width - 1,
|
|
||||||
self.Height - 1),
|
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
TOOLBAR_CORNER_RADIUS,
|
ToolbarCornerRadius,
|
||||||
FocusedAppearance.Tab.GradientFromColor,
|
FocusedAppearance.Tab.GradientFromColor,
|
||||||
FocusedAppearance.Tab.GradientToColor,
|
FocusedAppearance.Tab.GradientToColor,
|
||||||
FocusedAppearance.Tab.GradientType);
|
FocusedAppearance.Tab.GradientType);
|
||||||
TGuiTools.DrawAARoundCorner(FBuffer,
|
TGuiTools.DrawAARoundCorner(FBuffer,
|
||||||
{$IFDEF EnhancedRecordSupport}
|
{$IFDEF EnhancedRecordSupport}
|
||||||
T2DIntPoint.Create(0, TOOLBAR_TAB_CAPTIONS_HEIGHT),
|
T2DIntPoint.Create(0, ToolbarTabCaptionsHeight),
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
Create2DIntPoint(0, TOOLBAR_TAB_CAPTIONS_HEIGHT),
|
Create2DIntPoint(0, ToolbarTabCaptionsHeight),
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
TOOLBAR_CORNER_RADIUS,
|
ToolbarCornerRadius,
|
||||||
cpLeftTop,
|
cpLeftTop,
|
||||||
FocusedAppearance.Tab.BorderColor);
|
FocusedAppearance.Tab.BorderColor);
|
||||||
TGuiTools.DrawAARoundCorner(FBuffer,
|
TGuiTools.DrawAARoundCorner(FBuffer,
|
||||||
{$IFDEF EnhancedRecordSupport}
|
{$IFDEF EnhancedRecordSupport}
|
||||||
T2DIntPoint.Create(self.Width -
|
T2DIntPoint.Create(self.Width - ToolbarCornerRadius, ToolbarTabCaptionsHeight),
|
||||||
TOOLBAR_CORNER_RADIUS, TOOLBAR_TAB_CAPTIONS_HEIGHT),
|
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
Create2DIntPoint(self.Width -
|
Create2DIntPoint(self.Width - ToolbarCornerRadius, ToolbarTabCaptionsHeight),
|
||||||
TOOLBAR_CORNER_RADIUS, TOOLBAR_TAB_CAPTIONS_HEIGHT),
|
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
TOOLBAR_CORNER_RADIUS,
|
ToolbarCornerRadius,
|
||||||
cpRightTop,
|
cpRightTop,
|
||||||
FocusedAppearance.Tab.BorderColor);
|
FocusedAppearance.Tab.BorderColor);
|
||||||
TGuiTools.DrawAARoundCorner(FBuffer,
|
TGuiTools.DrawAARoundCorner(FBuffer,
|
||||||
{$IFDEF EnhancedRecordSupport}
|
{$IFDEF EnhancedRecordSupport}
|
||||||
T2DIntPoint.Create(0, self.Height - TOOLBAR_CORNER_RADIUS),
|
T2DIntPoint.Create(0, self.Height - ToolbarCornerRadius),
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
Create2DIntPoint(0, self.Height - TOOLBAR_CORNER_RADIUS),
|
Create2DIntPoint(0, self.Height - ToolbarCornerRadius),
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
TOOLBAR_CORNER_RADIUS,
|
ToolbarCornerRadius,
|
||||||
cpLeftBottom,
|
cpLeftBottom,
|
||||||
FocusedAppearance.Tab.BorderColor);
|
FocusedAppearance.Tab.BorderColor);
|
||||||
TGuiTools.DrawAARoundCorner(FBuffer,
|
TGuiTools.DrawAARoundCorner(FBuffer,
|
||||||
{$IFDEF EnhancedRecordSupport}
|
{$IFDEF EnhancedRecordSupport}
|
||||||
T2DIntPoint.Create(self.Width -
|
T2DIntPoint.Create(self.Width - ToolbarCornerRadius, self.Height - ToolbarCornerRadius),
|
||||||
TOOLBAR_CORNER_RADIUS, self.Height - TOOLBAR_CORNER_RADIUS),
|
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
Create2DIntPoint(self.Width -
|
Create2DIntPoint(self.Width - ToolbarCornerRadius, self.Height - ToolbarCornerRadius),
|
||||||
TOOLBAR_CORNER_RADIUS, self.Height - TOOLBAR_CORNER_RADIUS),
|
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
TOOLBAR_CORNER_RADIUS,
|
ToolbarCornerRadius,
|
||||||
cpRightBottom,
|
cpRightBottom,
|
||||||
FocusedAppearance.Tab.BorderColor);
|
FocusedAppearance.Tab.BorderColor);
|
||||||
TGuiTools.DrawVLine(FBuffer, 0, TOOLBAR_TAB_CAPTIONS_HEIGHT +
|
TGuiTools.DrawVLine(FBuffer, 0, ToolbarTabCaptionsHeight +
|
||||||
TOOLBAR_CORNER_RADIUS, self.Height - TOOLBAR_CORNER_RADIUS,
|
ToolbarCornerRadius, self.Height - ToolbarCornerRadius,
|
||||||
FocusedAppearance.Tab.BorderColor);
|
FocusedAppearance.Tab.BorderColor);
|
||||||
TGuiTools.DrawHLine(FBuffer, TOOLBAR_CORNER_RADIUS, self.Width - TOOLBAR_CORNER_RADIUS,
|
TGuiTools.DrawHLine(FBuffer, ToolbarCornerRadius, self.Width - ToolbarCornerRadius,
|
||||||
self.Height - 1, FocusedAppearance.Tab.BorderColor);
|
self.Height - 1, FocusedAppearance.Tab.BorderColor);
|
||||||
TGuiTools.DrawVLine(FBuffer, self.Width - 1, TOOLBAR_TAB_CAPTIONS_HEIGHT +
|
TGuiTools.DrawVLine(FBuffer, self.Width - 1, ToolbarTabCaptionsHeight +
|
||||||
TOOLBAR_CORNER_RADIUS, self.Height - TOOLBAR_CORNER_RADIUS,
|
ToolbarCornerRadius, self.Height - ToolbarCornerRadius,
|
||||||
FocusedAppearance.Tab.BorderColor);
|
FocusedAppearance.Tab.BorderColor);
|
||||||
|
|
||||||
if not (AtLeastOneTabVisible) then
|
if not (AtLeastOneTabVisible) then
|
||||||
begin
|
begin
|
||||||
// Jeœli nie ma zak³adek, rysujemy poziom¹ liniê
|
// Jeœli nie ma zak³adek, rysujemy poziom¹ liniê
|
||||||
TGuiTools.DrawHLine(FBuffer, TOOLBAR_CORNER_RADIUS, self.Width -
|
TGuiTools.DrawHLine(FBuffer, ToolbarCornerRadius, self.Width -
|
||||||
TOOLBAR_CORNER_RADIUS, TOOLBAR_TAB_CAPTIONS_HEIGHT, FocusedAppearance.Tab.BorderColor);
|
ToolbarCornerRadius, ToolbarTabCaptionsHeight, FocusedAppearance.Tab.BorderColor);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
@ -1330,9 +1330,9 @@ procedure TSpkToolbar.ValidateBuffer;
|
|||||||
Dec(i);
|
Dec(i);
|
||||||
|
|
||||||
// Tylko prawa czêœæ, reszta bêdzie narysowana wraz z zak³adkami
|
// Tylko prawa czêœæ, reszta bêdzie narysowana wraz z zak³adkami
|
||||||
if FTabRects[i].Right < self.Width - TOOLBAR_CORNER_RADIUS - 1 then
|
if FTabRects[i].Right < self.Width - ToolbarCornerRadius - 1 then
|
||||||
TGuiTools.DrawHLine(FBuffer, FTabRects[i].Right + 1, self.Width -
|
TGuiTools.DrawHLine(FBuffer, FTabRects[i].Right + 1, self.Width -
|
||||||
TOOLBAR_CORNER_RADIUS, TOOLBAR_TAB_CAPTIONS_HEIGHT, FocusedAppearance.Tab.BorderColor);
|
ToolbarCornerRadius, ToolbarTabCaptionsHeight, FocusedAppearance.Tab.BorderColor);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1380,49 +1380,49 @@ procedure TSpkToolbar.ValidateBuffer;
|
|||||||
TabRect := FTabRects[index];
|
TabRect := FTabRects[index];
|
||||||
|
|
||||||
// Œrodkowy prostok¹t
|
// Œrodkowy prostok¹t
|
||||||
TabRegion := CreateRectRgn(TabRect.Left + TAB_CORNER_RADIUS - 1,
|
TabRegion := CreateRectRgn(TabRect.Left + TabCornerRadius - 1,
|
||||||
TabRect.Top + TAB_CORNER_RADIUS,
|
TabRect.Top + TabCornerRadius,
|
||||||
TabRect.Right - TAB_CORNER_RADIUS + 1 +
|
TabRect.Right - TabCornerRadius + 1 +
|
||||||
1, TabRect.Bottom + 1);
|
1, TabRect.Bottom + 1);
|
||||||
|
|
||||||
// Górna czêœæ z górnymi zaokr¹gleniami wypuk³ymi
|
// Górna czêœæ z górnymi zaokr¹gleniami wypuk³ymi
|
||||||
TmpRegion := CreateRectRgn(TabRect.Left + 2 * TAB_CORNER_RADIUS - 1,
|
TmpRegion := CreateRectRgn(TabRect.Left + 2 * TabCornerRadius - 1,
|
||||||
TabRect.Top, TabRect.Right -
|
TabRect.Top, TabRect.Right -
|
||||||
2 * TAB_CORNER_RADIUS + 1 + 1, TabRect.Top +
|
2 * TabCornerRadius + 1 + 1, TabRect.Top +
|
||||||
TAB_CORNER_RADIUS);
|
TabCornerRadius);
|
||||||
CombineRgn(TabRegion, TabRegion, TmpRegion, RGN_OR);
|
CombineRgn(TabRegion, TabRegion, TmpRegion, RGN_OR);
|
||||||
DeleteObject(TmpRegion);
|
DeleteObject(TmpRegion);
|
||||||
|
|
||||||
TmpRegion := CreateEllipticRgn(TabRect.Left + TAB_CORNER_RADIUS -
|
TmpRegion := CreateEllipticRgn(TabRect.Left + TabCornerRadius -
|
||||||
1, TabRect.Top,
|
1, TabRect.Top,
|
||||||
TabRect.Left + 3 * TAB_CORNER_RADIUS,
|
TabRect.Left + 3 * TabCornerRadius,
|
||||||
TabRect.Top + 2 * TAB_CORNER_RADIUS + 1);
|
TabRect.Top + 2 * TabCornerRadius + 1);
|
||||||
CombineRgn(TabRegion, TabRegion, TmpRegion, RGN_OR);
|
CombineRgn(TabRegion, TabRegion, TmpRegion, RGN_OR);
|
||||||
DeleteObject(TmpRegion);
|
DeleteObject(TmpRegion);
|
||||||
|
|
||||||
TmpRegion := CreateEllipticRgn(TabRect.Right - 3 * TAB_CORNER_RADIUS + 2,
|
TmpRegion := CreateEllipticRgn(TabRect.Right - 3 * TabCornerRadius + 2,
|
||||||
TabRect.Top,
|
TabRect.Top,
|
||||||
TabRect.Right - TAB_CORNER_RADIUS +
|
TabRect.Right - TabCornerRadius +
|
||||||
3, TabRect.Top + 2 * TAB_CORNER_RADIUS + 1);
|
3, TabRect.Top + 2 * TabCornerRadius + 1);
|
||||||
CombineRgn(TabRegion, TabRegion, TmpRegion, RGN_OR);
|
CombineRgn(TabRegion, TabRegion, TmpRegion, RGN_OR);
|
||||||
DeleteObject(TmpRegion);
|
DeleteObject(TmpRegion);
|
||||||
|
|
||||||
// Dolna czêœæ z dolnymi zaokr¹gleniami wklês³ymi
|
// Dolna czêœæ z dolnymi zaokr¹gleniami wklês³ymi
|
||||||
|
|
||||||
TmpRegion := CreateRectRgn(TabRect.Left, TabRect.Bottom -
|
TmpRegion := CreateRectRgn(TabRect.Left, TabRect.Bottom -
|
||||||
TAB_CORNER_RADIUS, TabRect.Right + 1,
|
TabCornerRadius, TabRect.Right + 1,
|
||||||
TabRect.Bottom + 1);
|
TabRect.Bottom + 1);
|
||||||
|
|
||||||
TmpRegion2 := CreateEllipticRgn(TabRect.Left - TAB_CORNER_RADIUS,
|
TmpRegion2 := CreateEllipticRgn(TabRect.Left - TabCornerRadius,
|
||||||
TabRect.Bottom - 2 * TAB_CORNER_RADIUS + 1,
|
TabRect.Bottom - 2 * TabCornerRadius + 1,
|
||||||
TabRect.Left + TAB_CORNER_RADIUS +
|
TabRect.Left + TabCornerRadius +
|
||||||
1, TabRect.Bottom + 2);
|
1, TabRect.Bottom + 2);
|
||||||
CombineRgn(TmpRegion, TmpRegion, TmpRegion2, RGN_DIFF);
|
CombineRgn(TmpRegion, TmpRegion, TmpRegion2, RGN_DIFF);
|
||||||
DeleteObject(TmpRegion2);
|
DeleteObject(TmpRegion2);
|
||||||
|
|
||||||
TmpRegion2 := CreateEllipticRgn(TabRect.Right - TAB_CORNER_RADIUS +
|
TmpRegion2 := CreateEllipticRgn(TabRect.Right - TabCornerRadius +
|
||||||
1, TabRect.Bottom - 2 * TAB_CORNER_RADIUS +
|
1, TabRect.Bottom - 2 * TabCornerRadius +
|
||||||
1, TabRect.Right + TAB_CORNER_RADIUS + 2,
|
1, TabRect.Right + TabCornerRadius + 2,
|
||||||
TabRect.Bottom + 2);
|
TabRect.Bottom + 2);
|
||||||
CombineRgn(TmpRegion, TmpRegion, TmpRegion2, RGN_DIFF);
|
CombineRgn(TmpRegion, TmpRegion, TmpRegion2, RGN_DIFF);
|
||||||
DeleteObject(TmpRegion2);
|
DeleteObject(TmpRegion2);
|
||||||
@ -1442,70 +1442,62 @@ procedure TSpkToolbar.ValidateBuffer;
|
|||||||
// Ramka
|
// Ramka
|
||||||
TGuiTools.DrawAARoundCorner(FBuffer,
|
TGuiTools.DrawAARoundCorner(FBuffer,
|
||||||
{$IFDEF EnhancedRecordSupport}
|
{$IFDEF EnhancedRecordSupport}
|
||||||
T2DIntPoint.Create(TabRect.left,
|
T2DIntPoint.Create(TabRect.left, TabRect.bottom - TabCornerRadius + 1),
|
||||||
TabRect.bottom - TAB_CORNER_RADIUS + 1),
|
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
Create2DIntPoint(TabRect.left,
|
Create2DIntPoint(TabRect.left, TabRect.bottom - TabCornerRadius + 1),
|
||||||
TabRect.bottom - TAB_CORNER_RADIUS + 1),
|
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
TAB_CORNER_RADIUS,
|
TabCornerRadius,
|
||||||
cpRightBottom,
|
cpRightBottom,
|
||||||
Border,
|
Border,
|
||||||
FTabClipRect);
|
FTabClipRect);
|
||||||
TGuiTools.DrawAARoundCorner(FBuffer,
|
TGuiTools.DrawAARoundCorner(FBuffer,
|
||||||
{$IFDEF EnhancedRecordSupport}
|
{$IFDEF EnhancedRecordSupport}
|
||||||
T2DIntPoint.Create(TabRect.right -
|
T2DIntPoint.Create(TabRect.right - TabCornerRadius + 1, TabRect.bottom - TabCornerRadius + 1),
|
||||||
TAB_CORNER_RADIUS + 1, TabRect.bottom - TAB_CORNER_RADIUS + 1),
|
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
Create2DIntPoint(TabRect.right -
|
Create2DIntPoint(TabRect.right - TabCornerRadius + 1, TabRect.bottom - TabCornerRadius + 1),
|
||||||
TAB_CORNER_RADIUS + 1, TabRect.bottom - TAB_CORNER_RADIUS + 1),
|
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
TAB_CORNER_RADIUS,
|
TabCornerRadius,
|
||||||
cpLeftBottom,
|
cpLeftBottom,
|
||||||
Border,
|
Border,
|
||||||
FTabClipRect);
|
FTabClipRect);
|
||||||
|
|
||||||
TGuiTools.DrawVLine(FBuffer,
|
TGuiTools.DrawVLine(FBuffer,
|
||||||
TabRect.left + TAB_CORNER_RADIUS - 1,
|
TabRect.left + TabCornerRadius - 1,
|
||||||
TabRect.top + TAB_CORNER_RADIUS,
|
TabRect.top + TabCornerRadius,
|
||||||
TabRect.Bottom - TAB_CORNER_RADIUS + 1,
|
TabRect.Bottom - TabCornerRadius + 1,
|
||||||
Border,
|
Border,
|
||||||
FTabClipRect);
|
FTabClipRect);
|
||||||
TGuiTools.DrawVLine(FBuffer,
|
TGuiTools.DrawVLine(FBuffer,
|
||||||
TabRect.Right - TAB_CORNER_RADIUS + 1,
|
TabRect.Right - TabCornerRadius + 1,
|
||||||
TabRect.top + TAB_CORNER_RADIUS,
|
TabRect.top + TabCornerRadius,
|
||||||
TabRect.Bottom - TAB_CORNER_RADIUS + 1,
|
TabRect.Bottom - TabCornerRadius + 1,
|
||||||
Border,
|
Border,
|
||||||
FTabClipRect);
|
FTabClipRect);
|
||||||
|
|
||||||
TGuiTools.DrawAARoundCorner(FBuffer,
|
TGuiTools.DrawAARoundCorner(FBuffer,
|
||||||
{$IFDEF EnhancedRecordSupport}
|
{$IFDEF EnhancedRecordSupport}
|
||||||
T2DIntPoint.Create(TabRect.left +
|
T2DIntPoint.Create(TabRect.left + TabCornerRadius - 1, 0),
|
||||||
TAB_CORNER_RADIUS - 1, 0),
|
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
Create2DIntPoint(TabRect.left +
|
Create2DIntPoint(TabRect.left + TabCornerRadius - 1, 0),
|
||||||
TAB_CORNER_RADIUS - 1, 0),
|
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
TAB_CORNER_RADIUS,
|
TabCornerRadius,
|
||||||
cpLeftTop,
|
cpLeftTop,
|
||||||
Border,
|
Border,
|
||||||
FTabClipRect);
|
FTabClipRect);
|
||||||
TGuiTools.DrawAARoundCorner(FBuffer,
|
TGuiTools.DrawAARoundCorner(FBuffer,
|
||||||
{$IFDEF EnhancedRecordSupport}
|
{$IFDEF EnhancedRecordSupport}
|
||||||
T2DIntPoint.Create(TabRect.right -
|
T2DIntPoint.Create(TabRect.right - 2 * TabCornerRadius + 2, 0),
|
||||||
2 * TAB_CORNER_RADIUS + 2, 0),
|
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
Create2DIntPoint(TabRect.right -
|
Create2DIntPoint(TabRect.right - 2 * TabCornerRadius + 2, 0),
|
||||||
2 * TAB_CORNER_RADIUS + 2, 0),
|
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
TAB_CORNER_RADIUS,
|
TabCornerRadius,
|
||||||
cpRightTop,
|
cpRightTop,
|
||||||
Border,
|
Border,
|
||||||
FTabClipRect);
|
FTabClipRect);
|
||||||
|
|
||||||
TGuiTools.DrawHLine(FBuffer,
|
TGuiTools.DrawHLine(FBuffer,
|
||||||
TabRect.left + 2 * TAB_CORNER_RADIUS - 1,
|
TabRect.left + 2 * TabCornerRadius - 1,
|
||||||
TabRect.right - 2 * TAB_CORNER_RADIUS + 2,
|
TabRect.right - 2 * TabCornerRadius + 2,
|
||||||
0,
|
0,
|
||||||
Border,
|
Border,
|
||||||
FTabClipRect);
|
FTabClipRect);
|
||||||
@ -1660,21 +1652,24 @@ begin
|
|||||||
|
|
||||||
// Cliprect zak³adek (zawgórn¹ ramkê komponentu)
|
// Cliprect zak³adek (zawgórn¹ ramkê komponentu)
|
||||||
{$IFDEF EnhancedRecordSupport}
|
{$IFDEF EnhancedRecordSupport}
|
||||||
FTabClipRect := T2DIntRect.Create(TOOLBAR_CORNER_RADIUS,
|
FTabClipRect := T2DIntRect.Create(
|
||||||
0, self.Width -
|
ToolbarCornerRadius,
|
||||||
TOOLBAR_CORNER_RADIUS - 1, TOOLBAR_TAB_CAPTIONS_HEIGHT);
|
|
||||||
{$ELSE}
|
|
||||||
FTabClipRect.Create(TOOLBAR_CORNER_RADIUS,
|
|
||||||
0,
|
0,
|
||||||
self.Width - TOOLBAR_CORNER_RADIUS - 1,
|
self.Width - ToolbarCornerRadius - 1,
|
||||||
TOOLBAR_TAB_CAPTIONS_HEIGHT);
|
ToolbarTabCaptionsHeight);
|
||||||
|
{$ELSE}
|
||||||
|
FTabClipRect.Create(
|
||||||
|
ToolbarCornerRadius,
|
||||||
|
0,
|
||||||
|
self.Width - ToolbarCornerRadius - 1,
|
||||||
|
ToolbarTabCaptionsHeight);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
// Recty nag³ówków zak³adek (zawieraj¹ górn¹ ramkê komponentu)
|
// Recty nag³ówków zak³adek (zawieraj¹ górn¹ ramkê komponentu)
|
||||||
setlength(FTabRects, FTabs.Count);
|
setlength(FTabRects, FTabs.Count);
|
||||||
if FTabs.Count > 0 then
|
if FTabs.Count > 0 then
|
||||||
begin
|
begin
|
||||||
x := TOOLBAR_CORNER_RADIUS;
|
x := ToolbarCornerRadius;
|
||||||
for i := 0 to FTabs.Count - 1 do
|
for i := 0 to FTabs.Count - 1 do
|
||||||
if FTabs[i].Visible then
|
if FTabs[i].Visible then
|
||||||
begin
|
begin
|
||||||
@ -1686,18 +1681,18 @@ begin
|
|||||||
FBuffer.Canvas.font.Assign(TabAppearance.Tab.TabHeaderFont);
|
FBuffer.Canvas.font.Assign(TabAppearance.Tab.TabHeaderFont);
|
||||||
|
|
||||||
TabWidth := 2 + // Ramka
|
TabWidth := 2 + // Ramka
|
||||||
2 * TAB_CORNER_RADIUS +
|
2 * TabCornerRadius +
|
||||||
// Zaokr¹glenia
|
// Zaokr¹glenia
|
||||||
2 * TOOLBAR_TAB_CAPTIONS_TEXT_HPADDING +
|
2 * ToolbarTabCaptionsTextHPadding +
|
||||||
// Wewnêtrzne marginesy
|
// Wewnêtrzne marginesy
|
||||||
max(TOOLBAR_MIN_TAB_CAPTION_WIDTH,
|
max(ToolbarMinTabCaptionWidth,
|
||||||
FBuffer.Canvas.TextWidth(FTabs.Items[i].Caption));
|
FBuffer.Canvas.TextWidth(FTabs.Items[i].Caption));
|
||||||
// SzerokoϾ tekstu
|
// SzerokoϾ tekstu
|
||||||
|
|
||||||
FTabRects[i].Left := x;
|
FTabRects[i].Left := x;
|
||||||
FTabRects[i].Right := x + TabWidth - 1;
|
FTabRects[i].Right := x + TabWidth - 1;
|
||||||
FTabRects[i].Top := 0;
|
FTabRects[i].Top := 0;
|
||||||
FTabRects[i].Bottom := TOOLBAR_TAB_CAPTIONS_HEIGHT;
|
FTabRects[i].Bottom := ToolbarTabCaptionsHeight;
|
||||||
|
|
||||||
x := FTabRects[i].right + 1;
|
x := FTabRects[i].right + 1;
|
||||||
end
|
end
|
||||||
@ -1717,20 +1712,15 @@ begin
|
|||||||
begin
|
begin
|
||||||
// Rect obszaru zak³adki
|
// Rect obszaru zak³adki
|
||||||
{$IFDEF EnhancedRecordSupport}
|
{$IFDEF EnhancedRecordSupport}
|
||||||
FTabContentsClipRect := T2DIntRect.Create(TOOLBAR_BORDER_WIDTH +
|
FTabContentsClipRect := T2DIntRect.Create(ToolbarBorderWidth + TabPaneLeftPadding,
|
||||||
TAB_PANE_LEFTPADDING, TOOLBAR_TAB_CAPTIONS_HEIGHT +
|
ToolbarTabCaptionsHeight + ToolbarBorderWidth + TabPaneTopPadding,
|
||||||
TOOLBAR_BORDER_WIDTH + TAB_PANE_TOPPADDING,
|
self.Width - 1 - ToolbarBorderWidth - TabPaneRightPadding,
|
||||||
self.Width - 1 - TOOLBAR_BORDER_WIDTH -
|
self.Height - 1 - ToolbarBorderWidth - TabPaneBottomPadding);
|
||||||
TAB_PANE_RIGHTPADDING, self.Height -
|
|
||||||
1 - TOOLBAR_BORDER_WIDTH - TAB_PANE_BOTTOMPADDING);
|
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
FTabContentsClipRect.Create(TOOLBAR_BORDER_WIDTH + TAB_PANE_LEFTPADDING,
|
FTabContentsClipRect.Create(ToolbarBorderWidth + TabPaneLeftPadding,
|
||||||
TOOLBAR_TAB_CAPTIONS_HEIGHT +
|
ToolbarTabCaptionsHeight + ToolbarBorderWidth + TabPaneTopPadding,
|
||||||
TOOLBAR_BORDER_WIDTH + TAB_PANE_TOPPADDING,
|
self.Width - 1 - ToolbarBorderWidth - TabPaneRightPadding,
|
||||||
self.Width - 1 - TOOLBAR_BORDER_WIDTH -
|
self.Height - 1 - ToolbarBorderWidth - TabPaneBottomPadding);
|
||||||
TAB_PANE_RIGHTPADDING,
|
|
||||||
self.Height - 1 - TOOLBAR_BORDER_WIDTH -
|
|
||||||
TAB_PANE_BOTTOMPADDING);
|
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
FTabs[FTabIndex].Rect := FTabContentsClipRect;
|
FTabs[FTabIndex].Rect := FTabContentsClipRect;
|
||||||
|
@ -16,7 +16,7 @@ interface
|
|||||||
|
|
||||||
uses Graphics, Classes, Forms, SysUtils,
|
uses Graphics, Classes, Forms, SysUtils,
|
||||||
SpkGUITools, SpkXMLParser, SpkXMLTools,
|
SpkGUITools, SpkXMLParser, SpkXMLTools,
|
||||||
spkt_Dispatch, spkt_Exceptions;
|
spkt_Dispatch, spkt_Exceptions, spkt_Const;
|
||||||
|
|
||||||
type TSpkTabAppearance = class(TPersistent)
|
type TSpkTabAppearance = class(TPersistent)
|
||||||
private
|
private
|
||||||
@ -31,6 +31,7 @@ type TSpkTabAppearance = class(TPersistent)
|
|||||||
// *** Gettery i settery ***
|
// *** Gettery i settery ***
|
||||||
|
|
||||||
procedure SetHeaderFont(const Value: TFont);
|
procedure SetHeaderFont(const Value: TFont);
|
||||||
|
function GetTabHeaderFont: TFont;
|
||||||
procedure SetBorderColor(const Value: TColor);
|
procedure SetBorderColor(const Value: TColor);
|
||||||
procedure SetGradientFromColor(const Value: TColor);
|
procedure SetGradientFromColor(const Value: TColor);
|
||||||
procedure SetGradientToColor(const Value: TColor);
|
procedure SetGradientToColor(const Value: TColor);
|
||||||
@ -46,7 +47,7 @@ type TSpkTabAppearance = class(TPersistent)
|
|||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
procedure Reset;
|
procedure Reset;
|
||||||
published
|
published
|
||||||
property TabHeaderFont : TFont read FTabHeaderFont write SetHeaderFont;
|
property TabHeaderFont : TFont read GetTabHeaderFont write SetHeaderFont;
|
||||||
property BorderColor : TColor read FBorderColor write SetBorderColor;
|
property BorderColor : TColor read FBorderColor write SetBorderColor;
|
||||||
property GradientFromColor : TColor read FGradientFromColor write SetGradientFromColor;
|
property GradientFromColor : TColor read FGradientFromColor write SetGradientFromColor;
|
||||||
property GradientToColor : TColor read FGradientToColor write SetGradientToColor;
|
property GradientToColor : TColor read FGradientToColor write SetGradientToColor;
|
||||||
@ -66,6 +67,7 @@ type TSpkPaneAppearance = class(TPersistent)
|
|||||||
FGradientType : TBackgroundKind;
|
FGradientType : TBackgroundKind;
|
||||||
|
|
||||||
procedure SetCaptionFont(const Value: TFont);
|
procedure SetCaptionFont(const Value: TFont);
|
||||||
|
function GetCaptionFont: TFont;
|
||||||
procedure SetBorderDarkColor(const Value: TColor);
|
procedure SetBorderDarkColor(const Value: TColor);
|
||||||
procedure SetBorderLightColor(const Value: TColor);
|
procedure SetBorderLightColor(const Value: TColor);
|
||||||
procedure SetGradientFromColor(const Value: TColor);
|
procedure SetGradientFromColor(const Value: TColor);
|
||||||
@ -80,7 +82,7 @@ type TSpkPaneAppearance = class(TPersistent)
|
|||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
procedure Reset;
|
procedure Reset;
|
||||||
published
|
published
|
||||||
property CaptionFont : TFont read FCaptionFont write SetCaptionFont;
|
property CaptionFont : TFont read GetCaptionFont write SetCaptionFont;
|
||||||
property BorderDarkColor : TColor read FBorderDarkColor write SetBorderDarkColor;
|
property BorderDarkColor : TColor read FBorderDarkColor write SetBorderDarkColor;
|
||||||
property BorderLightColor : TColor read FBorderLightColor write SetBorderLightColor;
|
property BorderLightColor : TColor read FBorderLightColor write SetBorderLightColor;
|
||||||
property GradientFromColor : TColor read FGradientFromColor write SetGradientFromColor;
|
property GradientFromColor : TColor read FGradientFromColor write SetGradientFromColor;
|
||||||
@ -124,6 +126,7 @@ type TSpkElementAppearance = class(TPersistent)
|
|||||||
procedure SetActiveInnerDarkColor(const Value: TColor);
|
procedure SetActiveInnerDarkColor(const Value: TColor);
|
||||||
procedure SetActiveInnerLightColor(const Value: TColor);
|
procedure SetActiveInnerLightColor(const Value: TColor);
|
||||||
procedure SetCaptionFont(const Value: TFont);
|
procedure SetCaptionFont(const Value: TFont);
|
||||||
|
function GetCaptionFont: TFont;
|
||||||
procedure SetHotTrackCaptionColor(const Value: TColor);
|
procedure SetHotTrackCaptionColor(const Value: TColor);
|
||||||
procedure SetHotTrackFrameColor(const Value: TColor);
|
procedure SetHotTrackFrameColor(const Value: TColor);
|
||||||
procedure SetHotTrackGradientFromColor(const Value: TColor);
|
procedure SetHotTrackGradientFromColor(const Value: TColor);
|
||||||
@ -146,7 +149,7 @@ type TSpkElementAppearance = class(TPersistent)
|
|||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
procedure Reset;
|
procedure Reset;
|
||||||
published
|
published
|
||||||
property CaptionFont : TFont read FCaptionFont write SetCaptionFont;
|
property CaptionFont : TFont read GetCaptionFont write SetCaptionFont;
|
||||||
property IdleFrameColor : TColor read FIdleFrameColor write SetIdleFrameColor;
|
property IdleFrameColor : TColor read FIdleFrameColor write SetIdleFrameColor;
|
||||||
property IdleGradientFromColor : TColor read FIdleGradientFromColor write SetIdleGradientFromColor;
|
property IdleGradientFromColor : TColor read FIdleGradientFromColor write SetIdleGradientFromColor;
|
||||||
property IdleGradientToColor : TColor read FIdleGradientToColor write SetIdleGradientToColor;
|
property IdleGradientToColor : TColor read FIdleGradientToColor write SetIdleGradientToColor;
|
||||||
@ -380,6 +383,23 @@ begin
|
|||||||
FDispatch.NotifyAppearanceChanged;
|
FDispatch.NotifyAppearanceChanged;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TSpkTabAppearance.GetTabHeaderFont: TFont;
|
||||||
|
var
|
||||||
|
ScaledFont: TFont;
|
||||||
|
begin
|
||||||
|
if DPI_AWARE then
|
||||||
|
begin
|
||||||
|
ScaledFont := TFont.Create;
|
||||||
|
ScaledFont.Assign(FTabHeaderFont);
|
||||||
|
//ScaledFont.Height := SpkScaleY(ScaledFont.Height, 96); // leave it to uscaledpi
|
||||||
|
Result := ScaledFont;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
Result := FTabHeaderFont;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{ TSpkPaneAppearance }
|
{ TSpkPaneAppearance }
|
||||||
|
|
||||||
procedure TSpkPaneAppearance.Assign(Source: TPersistent);
|
procedure TSpkPaneAppearance.Assign(Source: TPersistent);
|
||||||
@ -578,6 +598,23 @@ begin
|
|||||||
FDispatch.NotifyAppearanceChanged;
|
FDispatch.NotifyAppearanceChanged;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TSpkPaneAppearance.GetCaptionFont: TFont;
|
||||||
|
var
|
||||||
|
ScaledFont: TFont;
|
||||||
|
begin
|
||||||
|
if DPI_AWARE then
|
||||||
|
begin
|
||||||
|
ScaledFont := TFont.Create;
|
||||||
|
ScaledFont.Assign(FCaptionFont);
|
||||||
|
//ScaledFont.Height := SpkScaleY(ScaledFont.Height, 96); // leave it to uscaledpi
|
||||||
|
Result := ScaledFont;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
Result := FCaptionFont;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{ TSpkElementAppearance }
|
{ TSpkElementAppearance }
|
||||||
|
|
||||||
procedure TSpkElementAppearance.Assign(Source: TPersistent);
|
procedure TSpkElementAppearance.Assign(Source: TPersistent);
|
||||||
@ -937,6 +974,21 @@ begin
|
|||||||
FDispatch.NotifyAppearanceChanged;
|
FDispatch.NotifyAppearanceChanged;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TSpkElementAppearance.GetCaptionFont: TFont;
|
||||||
|
var
|
||||||
|
ScaledFont: TFont;
|
||||||
|
begin
|
||||||
|
if DPI_AWARE then
|
||||||
|
begin
|
||||||
|
ScaledFont := TFont.Create;
|
||||||
|
ScaledFont.Assign(FCaptionFont);
|
||||||
|
//ScaledFont.Height := SpkScaleY(ScaledFont.Height, 96); // leave it to uscaledpi
|
||||||
|
Result := ScaledFont;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
Result := FCaptionFont;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TSpkElementAppearance.SetHotTrackCaptionColor(
|
procedure TSpkElementAppearance.SetHotTrackCaptionColor(
|
||||||
const Value: TColor);
|
const Value: TColor);
|
||||||
begin
|
begin
|
||||||
|
@ -727,8 +727,8 @@ begin
|
|||||||
{$IFDEF EnhancedRecordSupport}
|
{$IFDEF EnhancedRecordSupport}
|
||||||
if FButtonKind = bkButtonDropdown then
|
if FButtonKind = bkButtonDropdown then
|
||||||
begin
|
begin
|
||||||
FButtonRect:=T2DIntRect.Create(FRect.Left, FRect.Top, FRect.Right, FRect.Bottom - LARGEBUTTON_DROPDOWN_FIELD_SIZE);
|
FButtonRect:=T2DIntRect.Create(FRect.Left, FRect.Top, FRect.Right, FRect.Bottom - SpkLayoutSizes.LARGEBUTTON_DROPDOWN_FIELD_SIZE);
|
||||||
FDropdownRect:=T2DIntRect.Create(FRect.Left, FRect.Bottom - LARGEBUTTON_DROPDOWN_FIELD_SIZE + 1, FRect.Right, FRect.Bottom);
|
FDropdownRect:=T2DIntRect.Create(FRect.Left, FRect.Bottom - SpkLayoutSizes.LARGEBUTTON_DROPDOWN_FIELD_SIZE + 1, FRect.Right, FRect.Bottom);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
@ -738,8 +738,8 @@ else
|
|||||||
{$ELSE}
|
{$ELSE}
|
||||||
if FButtonKind = bkButtonDropdown then
|
if FButtonKind = bkButtonDropdown then
|
||||||
begin
|
begin
|
||||||
FButtonRect.Create(FRect.Left, FRect.Top, FRect.Right, FRect.Bottom - LARGEBUTTON_DROPDOWN_FIELD_SIZE);
|
FButtonRect.Create(FRect.Left, FRect.Top, FRect.Right, FRect.Bottom - LargeButtonDropdownFieldSize);
|
||||||
FDropdownRect.Create(FRect.Left, FRect.Bottom - LARGEBUTTON_DROPDOWN_FIELD_SIZE + 1, FRect.Right, FRect.Bottom);
|
FDropdownRect.Create(FRect.Left, FRect.Bottom - LargeButtonDropdownFieldSize + 1, FRect.Right, FRect.Bottom);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
@ -779,7 +779,7 @@ if FToolbarDispatch=nil then
|
|||||||
if FAppearance=nil then
|
if FAppearance=nil then
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
if (FRect.width<2*LARGEBUTTON_RADIUS) or (FRect.Height<2*LARGEBUTTON_RADIUS) then
|
if (FRect.width<2*LargeButtonRadius) or (FRect.Height<2*LargeButtonRadius) then
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
if FButtonKind in [bkButton, bkDropdown] then
|
if FButtonKind in [bkButton, bkDropdown] then
|
||||||
@ -813,7 +813,7 @@ if FButtonKind in [bkButton, bkDropdown] then
|
|||||||
FButtonRect.Right,
|
FButtonRect.Right,
|
||||||
FButtonRect.Bottom),
|
FButtonRect.Bottom),
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
LARGEBUTTON_RADIUS,
|
LargeButtonRadius,
|
||||||
FAppearance.Element.HotTrackGradientFromColor,
|
FAppearance.Element.HotTrackGradientFromColor,
|
||||||
FAppearance.Element.HotTrackGradientToColor,
|
FAppearance.Element.HotTrackGradientToColor,
|
||||||
FAppearance.Element.HotTrackGradientType,
|
FAppearance.Element.HotTrackGradientType,
|
||||||
@ -831,12 +831,12 @@ if FButtonKind in [bkButton, bkDropdown] then
|
|||||||
FButtonRect.right-1,
|
FButtonRect.right-1,
|
||||||
FButtonRect.Bottom-1),
|
FButtonRect.Bottom-1),
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
LARGEBUTTON_RADIUS,
|
LargeButtonRadius,
|
||||||
FAppearance.Element.HotTrackInnerLightColor,
|
FAppearance.Element.HotTrackInnerLightColor,
|
||||||
ClipRect);
|
ClipRect);
|
||||||
TGuiTools.DrawAARoundFrame(ABuffer,
|
TGuiTools.DrawAARoundFrame(ABuffer,
|
||||||
FButtonRect,
|
FButtonRect,
|
||||||
LARGEBUTTON_RADIUS,
|
LargeButtonRadius,
|
||||||
FAppearance.Element.HotTrackFrameColor,
|
FAppearance.Element.HotTrackFrameColor,
|
||||||
ClipRect);
|
ClipRect);
|
||||||
{$ENDREGION}
|
{$ENDREGION}
|
||||||
@ -856,7 +856,7 @@ if FButtonKind in [bkButton, bkDropdown] then
|
|||||||
FButtonRect.Right,
|
FButtonRect.Right,
|
||||||
FButtonRect.Bottom),
|
FButtonRect.Bottom),
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
LARGEBUTTON_RADIUS,
|
LargeButtonRadius,
|
||||||
FAppearance.Element.ActiveGradientFromColor,
|
FAppearance.Element.ActiveGradientFromColor,
|
||||||
FAppearance.Element.ActiveGradientToColor,
|
FAppearance.Element.ActiveGradientToColor,
|
||||||
FAppearance.Element.ActiveGradientType,
|
FAppearance.Element.ActiveGradientType,
|
||||||
@ -875,12 +875,12 @@ if FButtonKind in [bkButton, bkDropdown] then
|
|||||||
FButtonRect.right-1,
|
FButtonRect.right-1,
|
||||||
FButtonRect.Bottom-1),
|
FButtonRect.Bottom-1),
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
LARGEBUTTON_RADIUS,
|
LargeButtonRadius,
|
||||||
FAppearance.Element.ActiveInnerLightColor,
|
FAppearance.Element.ActiveInnerLightColor,
|
||||||
ClipRect);
|
ClipRect);
|
||||||
TGuiTools.DrawAARoundFrame(ABuffer,
|
TGuiTools.DrawAARoundFrame(ABuffer,
|
||||||
FButtonRect,
|
FButtonRect,
|
||||||
LARGEBUTTON_RADIUS,
|
LargeButtonRadius,
|
||||||
FAppearance.Element.ActiveFrameColor,
|
FAppearance.Element.ActiveFrameColor,
|
||||||
ClipRect);
|
ClipRect);
|
||||||
{$ENDREGION}
|
{$ENDREGION}
|
||||||
@ -896,7 +896,7 @@ if FButtonKind in [bkButton, bkDropdown] then
|
|||||||
(FLargeImageIndex<FDisabledLargeImages.Count) then
|
(FLargeImageIndex<FDisabledLargeImages.Count) then
|
||||||
begin
|
begin
|
||||||
x:=FRect.left + (FRect.Width - FLargeImages.Width) div 2;
|
x:=FRect.left + (FRect.Width - FLargeImages.Width) div 2;
|
||||||
y:=FRect.top + LARGEBUTTON_BORDER_SIZE + LARGEBUTTON_GLYPH_MARGIN;
|
y:=FRect.top + LargeButtonBorderSize + LargeButtonGlyphMargin;
|
||||||
|
|
||||||
TGuiTools.DrawImage(ABuffer.Canvas,
|
TGuiTools.DrawImage(ABuffer.Canvas,
|
||||||
FDisabledLargeImages,
|
FDisabledLargeImages,
|
||||||
@ -913,7 +913,7 @@ if FButtonKind in [bkButton, bkDropdown] then
|
|||||||
(FLargeImageIndex<FLargeImages.Count) then
|
(FLargeImageIndex<FLargeImages.Count) then
|
||||||
begin
|
begin
|
||||||
x:=FRect.left + (FRect.Width - FLargeImages.Width) div 2;
|
x:=FRect.left + (FRect.Width - FLargeImages.Width) div 2;
|
||||||
y:=FRect.top + LARGEBUTTON_BORDER_SIZE + LARGEBUTTON_GLYPH_MARGIN;
|
y:=FRect.top + LargeButtonBorderSize + LargeButtonGlyphMargin;
|
||||||
|
|
||||||
TGuiTools.DrawDisabledImage(ABuffer.Canvas,
|
TGuiTools.DrawDisabledImage(ABuffer.Canvas,
|
||||||
FLargeImages,
|
FLargeImages,
|
||||||
@ -935,7 +935,7 @@ if FButtonKind in [bkButton, bkDropdown] then
|
|||||||
(FLargeImageIndex<FLargeImages.Count) then
|
(FLargeImageIndex<FLargeImages.Count) then
|
||||||
begin
|
begin
|
||||||
x:=FRect.left + (FRect.Width - FLargeImages.Width) div 2;
|
x:=FRect.left + (FRect.Width - FLargeImages.Width) div 2;
|
||||||
y:=FRect.top + LARGEBUTTON_BORDER_SIZE + LARGEBUTTON_GLYPH_MARGIN;
|
y:=FRect.top + LargeButtonBorderSize + LargeButtonGlyphMargin;
|
||||||
|
|
||||||
TGUITools.DrawImage(ABuffer.Canvas,
|
TGUITools.DrawImage(ABuffer.Canvas,
|
||||||
FLargeImages,
|
FLargeImages,
|
||||||
@ -989,12 +989,12 @@ if FButtonKind in [bkButton, bkDropdown] then
|
|||||||
|
|
||||||
s:=copy(FCaption, 1, BreakPos-1);
|
s:=copy(FCaption, 1, BreakPos-1);
|
||||||
x:=FRect.Left + (FRect.width - ABuffer.Canvas.Textwidth(s)) div 2;
|
x:=FRect.Left + (FRect.width - ABuffer.Canvas.Textwidth(s)) div 2;
|
||||||
y:=FRect.Top + LARGEBUTTON_CAPTION_TOP_RAIL - TextHeight div 2;
|
y:=FRect.Top + LargeButtonCaptionTopRail - TextHeight div 2;
|
||||||
TGUITools.DrawText(ABuffer.Canvas, x, y, s, FontColor, ClipRect);
|
TGUITools.DrawText(ABuffer.Canvas, x, y, s, FontColor, ClipRect);
|
||||||
|
|
||||||
s:=copy(FCaption, BreakPos+1, length(FCaption) - BreakPos);
|
s:=copy(FCaption, BreakPos+1, length(FCaption) - BreakPos);
|
||||||
x:=FRect.Left + (FRect.width - ABuffer.Canvas.Textwidth(s)) div 2;
|
x:=FRect.Left + (FRect.width - ABuffer.Canvas.Textwidth(s)) div 2;
|
||||||
y:=FRect.Top + LARGEBUTTON_CAPTION_BOTTOM_RAIL - TextHeight div 2;
|
y:=FRect.Top + LargeButtonCaptionButtomRail - TextHeight div 2;
|
||||||
TGUITools.DrawText(ABuffer.Canvas, x, y, s, FontColor, ClipRect);
|
TGUITools.DrawText(ABuffer.Canvas, x, y, s, FontColor, ClipRect);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@ -1003,7 +1003,7 @@ if FButtonKind in [bkButton, bkDropdown] then
|
|||||||
TextHeight:=ABuffer.Canvas.Textheight('Wy');
|
TextHeight:=ABuffer.Canvas.Textheight('Wy');
|
||||||
|
|
||||||
x:=FButtonRect.Left + (FButtonRect.width - ABuffer.Canvas.Textwidth(FCaption)) div 2;
|
x:=FButtonRect.Left + (FButtonRect.width - ABuffer.Canvas.Textwidth(FCaption)) div 2;
|
||||||
y:=FRect.Top + LARGEBUTTON_CAPTION_TOP_RAIL - TextHeight div 2;
|
y:=FRect.Top + LargeButtonCaptionTopRail - TextHeight div 2;
|
||||||
TGUITools.DrawText(ABuffer.Canvas, x, y, FCaption, FontColor, ClipRect);
|
TGUITools.DrawText(ABuffer.Canvas, x, y, FCaption, FontColor, ClipRect);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1039,7 +1039,7 @@ if FButtonKind in [bkButton, bkDropdown] then
|
|||||||
ABuffer.Canvas.Font.Orientation:=0;
|
ABuffer.Canvas.Font.Orientation:=0;
|
||||||
|
|
||||||
x:=FButtonRect.Left + (FButtonRect.width - ABuffer.Canvas.Textwidth('u')) div 2;
|
x:=FButtonRect.Left + (FButtonRect.width - ABuffer.Canvas.Textwidth('u')) div 2;
|
||||||
y:=FButtonRect.bottom - ABuffer.Canvas.Textheight('u') - LARGEBUTTON_CHEVRON_HMARGIN;
|
y:=FButtonRect.bottom - ABuffer.Canvas.Textheight('u') - LargeButtonChevronHMargin;
|
||||||
TGUITools.DrawText(ABuffer.Canvas, x, y, 'u', FontColor, ClipRect);
|
TGUITools.DrawText(ABuffer.Canvas, x, y, 'u', FontColor, ClipRect);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1097,28 +1097,28 @@ else
|
|||||||
|
|
||||||
{$REGION 'T³o przycisku'}
|
{$REGION 'T³o przycisku'}
|
||||||
DrawRgn:=CreateRectRgn(FButtonRect.Left,
|
DrawRgn:=CreateRectRgn(FButtonRect.Left,
|
||||||
FButtonRect.Top + LARGEBUTTON_RADIUS,
|
FButtonRect.Top + LargeButtonRadius,
|
||||||
FButtonRect.Right + 1,
|
FButtonRect.Right + 1,
|
||||||
FButtonRect.Bottom);
|
FButtonRect.Bottom);
|
||||||
|
|
||||||
TmpRgn:=CreateRectRgn(FButtonRect.left + LARGEBUTTON_RADIUS,
|
TmpRgn:=CreateRectRgn(FButtonRect.left + LargeButtonRadius,
|
||||||
FButtonRect.Top,
|
FButtonRect.Top,
|
||||||
FButtonRect.right - LARGEBUTTON_RADIUS + 1,
|
FButtonRect.right - LargeButtonRadius + 1,
|
||||||
FButtonRect.Top + LARGEBUTTON_RADIUS);
|
FButtonRect.Top + LargeButtonRadius);
|
||||||
CombineRgn(DrawRgn, DrawRgn, TmpRgn, RGN_OR);
|
CombineRgn(DrawRgn, DrawRgn, TmpRgn, RGN_OR);
|
||||||
DeleteObject(TmpRgn);
|
DeleteObject(TmpRgn);
|
||||||
|
|
||||||
TmpRgn:=CreateEllipticRgn(FButtonRect.Left,
|
TmpRgn:=CreateEllipticRgn(FButtonRect.Left,
|
||||||
FButtonRect.Top,
|
FButtonRect.Top,
|
||||||
FButtonRect.Left + 2 * LARGEBUTTON_RADIUS + 1,
|
FButtonRect.Left + 2 * LargeButtonRadius + 1,
|
||||||
FButtonRect.Top + 2 * LARGEBUTTON_RADIUS + 1);
|
FButtonRect.Top + 2 * LargeButtonRadius + 1);
|
||||||
CombineRgn(DrawRgn, DrawRgn, TmpRgn, RGN_OR);
|
CombineRgn(DrawRgn, DrawRgn, TmpRgn, RGN_OR);
|
||||||
DeleteObject(TmpRgn);
|
DeleteObject(TmpRgn);
|
||||||
|
|
||||||
TmpRgn:=CreateEllipticRgn(FButtonRect.Right - 2 * LARGEBUTTON_RADIUS + 1,
|
TmpRgn:=CreateEllipticRgn(FButtonRect.Right - 2 * LargeButtonRadius + 1,
|
||||||
FButtonRect.Top,
|
FButtonRect.Top,
|
||||||
FButtonRect.Right + 2,
|
FButtonRect.Right + 2,
|
||||||
FButtonRect.Top + 2 * LARGEBUTTON_RADIUS + 1);
|
FButtonRect.Top + 2 * LargeButtonRadius + 1);
|
||||||
CombineRgn(DrawRgn, DrawRgn, TmpRgn, RGN_OR);
|
CombineRgn(DrawRgn, DrawRgn, TmpRgn, RGN_OR);
|
||||||
DeleteObject(TmpRgn);
|
DeleteObject(TmpRgn);
|
||||||
|
|
||||||
@ -1140,35 +1140,35 @@ else
|
|||||||
{$ELSE}
|
{$ELSE}
|
||||||
Create2DIntPoint(FButtonRect.Left + 1, FButtonRect.Top + 1),
|
Create2DIntPoint(FButtonRect.Left + 1, FButtonRect.Top + 1),
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
LARGEBUTTON_RADIUS,
|
LargeButtonRadius,
|
||||||
cpLeftTop,
|
cpLeftTop,
|
||||||
InnerLightColor,
|
InnerLightColor,
|
||||||
ClipRect);
|
ClipRect);
|
||||||
TGuiTools.DrawAARoundCorner(ABuffer,
|
TGuiTools.DrawAARoundCorner(ABuffer,
|
||||||
{$IFDEF EnhancedRecordSupport}
|
{$IFDEF EnhancedRecordSupport}
|
||||||
T2DIntPoint.Create(FButtonRect.Right - LARGEBUTTON_RADIUS, FButtonRect.Top + 1),
|
T2DIntPoint.Create(FButtonRect.Right - SpkLayoutSizes.LARGEBUTTON_RADIUS, FButtonRect.Top + 1),
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
Create2DIntPoint(FButtonRect.Right - LARGEBUTTON_RADIUS, FButtonRect.Top + 1),
|
Create2DIntPoint(FButtonRect.Right - LargeButtonRadius, FButtonRect.Top + 1),
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
LARGEBUTTON_RADIUS,
|
LargeButtonRadius,
|
||||||
cpRightTop,
|
cpRightTop,
|
||||||
InnerLightColor,
|
InnerLightColor,
|
||||||
ClipRect);
|
ClipRect);
|
||||||
TGuiTools.DrawHLine(ABuffer,
|
TGuiTools.DrawHLine(ABuffer,
|
||||||
FButtonRect.Left + LARGEBUTTON_RADIUS + 1,
|
FButtonRect.Left + LargeButtonRadius + 1,
|
||||||
FButtonRect.Right - LARGEBUTTON_RADIUS - 1,
|
FButtonRect.Right - LargeButtonRadius - 1,
|
||||||
FButtonRect.Top + 1,
|
FButtonRect.Top + 1,
|
||||||
InnerLightColor,
|
InnerLightColor,
|
||||||
ClipRect);
|
ClipRect);
|
||||||
TGuiTools.DrawVLine(ABuffer,
|
TGuiTools.DrawVLine(ABuffer,
|
||||||
FButtonRect.Left + 1,
|
FButtonRect.Left + 1,
|
||||||
FButtonRect.Top + LARGEBUTTON_RADIUS + 1,
|
FButtonRect.Top + LargeButtonRadius + 1,
|
||||||
FButtonRect.Bottom,
|
FButtonRect.Bottom,
|
||||||
InnerLightColor,
|
InnerLightColor,
|
||||||
ClipRect);
|
ClipRect);
|
||||||
TGuiTools.DrawVLine(ABuffer,
|
TGuiTools.DrawVLine(ABuffer,
|
||||||
FButtonRect.Right - 1,
|
FButtonRect.Right - 1,
|
||||||
FButtonRect.Top + LARGEBUTTON_RADIUS + 1,
|
FButtonRect.Top + LargeButtonRadius + 1,
|
||||||
FButtonRect.Bottom,
|
FButtonRect.Bottom,
|
||||||
InnerLightColor,
|
InnerLightColor,
|
||||||
ClipRect);
|
ClipRect);
|
||||||
@ -1194,35 +1194,35 @@ else
|
|||||||
{$ELSE}
|
{$ELSE}
|
||||||
Create2DIntPoint(FButtonRect.Left, FButtonRect.Top),
|
Create2DIntPoint(FButtonRect.Left, FButtonRect.Top),
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
LARGEBUTTON_RADIUS,
|
LargeButtonRadius,
|
||||||
cpLeftTop,
|
cpLeftTop,
|
||||||
FrameColor,
|
FrameColor,
|
||||||
ClipRect);
|
ClipRect);
|
||||||
TGuiTools.DrawAARoundCorner(ABuffer,
|
TGuiTools.DrawAARoundCorner(ABuffer,
|
||||||
{$IFDEF EnhancedRecordSupport}
|
{$IFDEF EnhancedRecordSupport}
|
||||||
T2DIntPoint.Create(FButtonRect.Right - LARGEBUTTON_RADIUS + 1, FButtonRect.Top),
|
T2DIntPoint.Create(FButtonRect.Right - LargeButtonRadius + 1, FButtonRect.Top),
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
Create2DIntPoint(FButtonRect.Right - LARGEBUTTON_RADIUS + 1, FButtonRect.Top),
|
Create2DIntPoint(FButtonRect.Right - LargeButtonRadius + 1, FButtonRect.Top),
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
LARGEBUTTON_RADIUS,
|
LargeButtonRadius,
|
||||||
cpRightTop,
|
cpRightTop,
|
||||||
FrameColor,
|
FrameColor,
|
||||||
ClipRect);
|
ClipRect);
|
||||||
TGuiTools.DrawHLine(ABuffer,
|
TGuiTools.DrawHLine(ABuffer,
|
||||||
FButtonRect.Left + LARGEBUTTON_RADIUS,
|
FButtonRect.Left + LargeButtonRadius,
|
||||||
FButtonRect.Right - LARGEBUTTON_RADIUS,
|
FButtonRect.Right - LargeButtonRadius,
|
||||||
FButtonRect.Top,
|
FButtonRect.Top,
|
||||||
FrameColor,
|
FrameColor,
|
||||||
ClipRect);
|
ClipRect);
|
||||||
TGuiTools.DrawVLine(ABuffer,
|
TGuiTools.DrawVLine(ABuffer,
|
||||||
FButtonRect.Left,
|
FButtonRect.Left,
|
||||||
FButtonRect.Top + LARGEBUTTON_RADIUS,
|
FButtonRect.Top + LargeButtonRadius,
|
||||||
FButtonRect.Bottom,
|
FButtonRect.Bottom,
|
||||||
FrameColor,
|
FrameColor,
|
||||||
ClipRect);
|
ClipRect);
|
||||||
TGuiTools.DrawVLine(ABuffer,
|
TGuiTools.DrawVLine(ABuffer,
|
||||||
FButtonRect.Right,
|
FButtonRect.Right,
|
||||||
FButtonRect.Top + LARGEBUTTON_RADIUS,
|
FButtonRect.Top + LargeButtonRadius,
|
||||||
FButtonRect.Bottom,
|
FButtonRect.Bottom,
|
||||||
FrameColor,
|
FrameColor,
|
||||||
ClipRect);
|
ClipRect);
|
||||||
@ -1264,24 +1264,24 @@ else
|
|||||||
DrawRgn:=CreateRectRgn(FDropdownRect.left,
|
DrawRgn:=CreateRectRgn(FDropdownRect.left,
|
||||||
FDropdownRect.Top,
|
FDropdownRect.Top,
|
||||||
FDropdownRect.Right + 1,
|
FDropdownRect.Right + 1,
|
||||||
FDropdownRect.Bottom - LARGEBUTTON_RADIUS + 1);
|
FDropdownRect.Bottom - LargeButtonRadius + 1);
|
||||||
|
|
||||||
TmpRgn:=CreateRectRgn(FDropdownRect.left + LARGEBUTTON_RADIUS,
|
TmpRgn:=CreateRectRgn(FDropdownRect.left + LargeButtonRadius,
|
||||||
FDropdownRect.Bottom - LARGEBUTTON_RADIUS + 1,
|
FDropdownRect.Bottom - LargeButtonRadius + 1,
|
||||||
FDropdownRect.Right - LARGEBUTTON_RADIUS + 1,
|
FDropdownRect.Right - LargeButtonRadius + 1,
|
||||||
FDropdownRect.Bottom + 1);
|
FDropdownRect.Bottom + 1);
|
||||||
CombineRgn(DrawRgn, DrawRgn, TmpRgn, RGN_OR);
|
CombineRgn(DrawRgn, DrawRgn, TmpRgn, RGN_OR);
|
||||||
DeleteObject(TmpRgn);
|
DeleteObject(TmpRgn);
|
||||||
|
|
||||||
TmpRgn:=CreateEllipticRgn(FDropdownRect.Left,
|
TmpRgn:=CreateEllipticRgn(FDropdownRect.Left,
|
||||||
FDropdownRect.bottom - 2 * LARGEBUTTON_RADIUS + 1,
|
FDropdownRect.bottom - 2 * LargeButtonRadius + 1,
|
||||||
FDropdownRect.left + 2 * LARGEBUTTON_RADIUS + 1,
|
FDropdownRect.left + 2 * LargeButtonRadius + 1,
|
||||||
FDropdownRect.Bottom + 2);
|
FDropdownRect.Bottom + 2);
|
||||||
CombineRgn(DrawRgn, DrawRgn, TmpRgn, RGN_OR);
|
CombineRgn(DrawRgn, DrawRgn, TmpRgn, RGN_OR);
|
||||||
DeleteObject(TmpRgn);
|
DeleteObject(TmpRgn);
|
||||||
|
|
||||||
TmpRgn:=CreateEllipticRgn(FDropdownRect.Right - 2 * LARGEBUTTON_RADIUS + 1,
|
TmpRgn:=CreateEllipticRgn(FDropdownRect.Right - 2 * LargeButtonRadius + 1,
|
||||||
FDropdownRect.Bottom - 2 * LARGEBUTTON_RADIUS + 1,
|
FDropdownRect.Bottom - 2 * LargeButtonRadius + 1,
|
||||||
FDropdownRect.Right + 2,
|
FDropdownRect.Right + 2,
|
||||||
FDropdownRect.Bottom + 2);
|
FDropdownRect.Bottom + 2);
|
||||||
CombineRgn(DrawRgn, DrawRgn, TmpRgn, RGN_OR);
|
CombineRgn(DrawRgn, DrawRgn, TmpRgn, RGN_OR);
|
||||||
@ -1302,38 +1302,38 @@ else
|
|||||||
|
|
||||||
TGuiTools.DrawAARoundCorner(ABuffer,
|
TGuiTools.DrawAARoundCorner(ABuffer,
|
||||||
{$IFDEF EnhancedRecordSupport}
|
{$IFDEF EnhancedRecordSupport}
|
||||||
T2DIntPoint.Create(FDropdownRect.Left + 1, FDropdownRect.Bottom - LARGEBUTTON_RADIUS),
|
T2DIntPoint.Create(FDropdownRect.Left + 1, FDropdownRect.Bottom - SpkLayoutSizes.LARGEBUTTON_RADIUS),
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
Create2DIntPoint(FDropdownRect.Left + 1, FDropdownRect.Bottom - LARGEBUTTON_RADIUS),
|
Create2DIntPoint(FDropdownRect.Left + 1, FDropdownRect.Bottom - LargeButtonRadius),
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
LARGEBUTTON_RADIUS,
|
LargeButtonRadius,
|
||||||
cpLeftBottom,
|
cpLeftBottom,
|
||||||
InnerLightColor);
|
InnerLightColor);
|
||||||
TGuiTools.DrawAARoundCorner(ABuffer,
|
TGuiTools.DrawAARoundCorner(ABuffer,
|
||||||
{$IFDEF EnhancedRecordSupport}
|
{$IFDEF EnhancedRecordSupport}
|
||||||
T2DIntPoint.Create(FDropdownRect.right - LARGEBUTTON_RADIUS, FDropdownRect.Bottom - LARGEBUTTON_RADIUS),
|
T2DIntPoint.Create(FDropdownRect.right - LargeButtonRadius, FDropdownRect.Bottom - LargeButtonRadius),
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
Create2DIntPoint(FDropdownRect.right - LARGEBUTTON_RADIUS, FDropdownRect.Bottom - LARGEBUTTON_RADIUS),
|
Create2DIntPoint(FDropdownRect.right - LargeButtonRadius, FDropdownRect.Bottom - LargeButtonRadius),
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
LARGEBUTTON_RADIUS,
|
LargeButtonRadius,
|
||||||
cpRightBottom,
|
cpRightBottom,
|
||||||
InnerLightColor);
|
InnerLightColor);
|
||||||
TGuiTools.DrawHLine(ABuffer,
|
TGuiTools.DrawHLine(ABuffer,
|
||||||
FDropdownRect.Left + LARGEBUTTON_RADIUS + 1,
|
FDropdownRect.Left + LargeButtonRadius + 1,
|
||||||
FDropdownRect.Right - LARGEBUTTON_RADIUS - 1,
|
FDropdownRect.Right - LargeButtonRadius - 1,
|
||||||
FDropdownRect.Bottom - 1,
|
FDropdownRect.Bottom - 1,
|
||||||
InnerLightColor,
|
InnerLightColor,
|
||||||
ClipRect);
|
ClipRect);
|
||||||
TGuiTools.DrawVLine(ABuffer,
|
TGuiTools.DrawVLine(ABuffer,
|
||||||
FDropdownRect.Left + 1,
|
FDropdownRect.Left + 1,
|
||||||
FDropDownRect.Top + 1,
|
FDropDownRect.Top + 1,
|
||||||
FDropDownRect.Bottom - LARGEBUTTON_RADIUS - 1,
|
FDropDownRect.Bottom - LargeButtonRadius - 1,
|
||||||
InnerLightColor,
|
InnerLightColor,
|
||||||
ClipRect);
|
ClipRect);
|
||||||
TGuiTools.DrawVLine(ABuffer,
|
TGuiTools.DrawVLine(ABuffer,
|
||||||
FDropdownRect.Right - 1,
|
FDropdownRect.Right - 1,
|
||||||
FDropDownRect.Top + 1,
|
FDropDownRect.Top + 1,
|
||||||
FDropDownRect.Bottom - LARGEBUTTON_RADIUS - 1,
|
FDropDownRect.Bottom - LargeButtonRadius - 1,
|
||||||
InnerLightColor,
|
InnerLightColor,
|
||||||
ClipRect);
|
ClipRect);
|
||||||
|
|
||||||
@ -1356,38 +1356,38 @@ else
|
|||||||
// Zewnêtrzna ramka
|
// Zewnêtrzna ramka
|
||||||
TGuiTools.DrawAARoundCorner(ABuffer,
|
TGuiTools.DrawAARoundCorner(ABuffer,
|
||||||
{$IFDEF EnhancedRecordSupport}
|
{$IFDEF EnhancedRecordSupport}
|
||||||
T2DIntPoint.Create(FDropdownRect.Left, FDropdownRect.Bottom - LARGEBUTTON_RADIUS + 1),
|
T2DIntPoint.Create(FDropdownRect.Left, FDropdownRect.Bottom - LargeButtonRadius + 1),
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
Create2DIntPoint(FDropdownRect.Left, FDropdownRect.Bottom - LARGEBUTTON_RADIUS + 1),
|
Create2DIntPoint(FDropdownRect.Left, FDropdownRect.Bottom - LargeButtonRadius + 1),
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
LARGEBUTTON_RADIUS,
|
LargeButtonRadius,
|
||||||
cpLeftBottom,
|
cpLeftBottom,
|
||||||
FrameColor);
|
FrameColor);
|
||||||
TGuiTools.DrawAARoundCorner(ABuffer,
|
TGuiTools.DrawAARoundCorner(ABuffer,
|
||||||
{$IFDEF EnhancedRecordSupport}
|
{$IFDEF EnhancedRecordSupport}
|
||||||
T2DIntPoint.Create(FDropdownRect.right - LARGEBUTTON_RADIUS + 1, FDropdownRect.Bottom - LARGEBUTTON_RADIUS + 1),
|
T2DIntPoint.Create(FDropdownRect.right - LargeButtonRadius + 1, FDropdownRect.Bottom - LargeButtonRadius + 1),
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
Create2DIntPoint(FDropdownRect.right - LARGEBUTTON_RADIUS + 1, FDropdownRect.Bottom - LARGEBUTTON_RADIUS + 1),
|
Create2DIntPoint(FDropdownRect.right - LargeButtonRadius + 1, FDropdownRect.Bottom - LargeButtonRadius + 1),
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
LARGEBUTTON_RADIUS,
|
LargeButtonRadius,
|
||||||
cpRightBottom,
|
cpRightBottom,
|
||||||
FrameColor);
|
FrameColor);
|
||||||
TGuiTools.DrawHLine(ABuffer,
|
TGuiTools.DrawHLine(ABuffer,
|
||||||
FDropdownRect.Left + LARGEBUTTON_RADIUS,
|
FDropdownRect.Left + LargeButtonRadius,
|
||||||
FDropdownRect.Right - LARGEBUTTON_RADIUS,
|
FDropdownRect.Right - LargeButtonRadius,
|
||||||
FDropdownRect.Bottom,
|
FDropdownRect.Bottom,
|
||||||
FrameColor,
|
FrameColor,
|
||||||
ClipRect);
|
ClipRect);
|
||||||
TGuiTools.DrawVLine(ABuffer,
|
TGuiTools.DrawVLine(ABuffer,
|
||||||
FDropdownRect.Left,
|
FDropdownRect.Left,
|
||||||
FDropDownRect.Top,
|
FDropDownRect.Top,
|
||||||
FDropDownRect.Bottom - LARGEBUTTON_RADIUS,
|
FDropDownRect.Bottom - LargeButtonRadius,
|
||||||
FrameColor,
|
FrameColor,
|
||||||
ClipRect);
|
ClipRect);
|
||||||
TGuiTools.DrawVLine(ABuffer,
|
TGuiTools.DrawVLine(ABuffer,
|
||||||
FDropdownRect.Right,
|
FDropdownRect.Right,
|
||||||
FDropDownRect.Top,
|
FDropDownRect.Top,
|
||||||
FDropDownRect.Bottom - LARGEBUTTON_RADIUS,
|
FDropDownRect.Bottom - LargeButtonRadius,
|
||||||
FrameColor,
|
FrameColor,
|
||||||
ClipRect);
|
ClipRect);
|
||||||
{$ENDREGION}
|
{$ENDREGION}
|
||||||
@ -1405,7 +1405,7 @@ else
|
|||||||
(FLargeImageIndex<FDisabledLargeImages.Count) then
|
(FLargeImageIndex<FDisabledLargeImages.Count) then
|
||||||
begin
|
begin
|
||||||
x:=FRect.left + (FRect.Width - FLargeImages.Width) div 2;
|
x:=FRect.left + (FRect.Width - FLargeImages.Width) div 2;
|
||||||
y:=FRect.top + LARGEBUTTON_BORDER_SIZE + LARGEBUTTON_GLYPH_MARGIN;
|
y:=FRect.top + LargeButtonBorderSize + LargeButtonGlyphMargin;
|
||||||
|
|
||||||
TGuiTools.DrawImage(ABuffer.Canvas,
|
TGuiTools.DrawImage(ABuffer.Canvas,
|
||||||
FDisabledLargeImages,
|
FDisabledLargeImages,
|
||||||
@ -1422,7 +1422,7 @@ else
|
|||||||
(FLargeImageIndex<FLargeImages.Count) then
|
(FLargeImageIndex<FLargeImages.Count) then
|
||||||
begin
|
begin
|
||||||
x:=FRect.left + (FRect.Width - FLargeImages.Width) div 2;
|
x:=FRect.left + (FRect.Width - FLargeImages.Width) div 2;
|
||||||
y:=FRect.top + LARGEBUTTON_BORDER_SIZE + LARGEBUTTON_GLYPH_MARGIN;
|
y:=FRect.top + LargeButtonBorderSize + LargeButtonGlyphMargin;
|
||||||
|
|
||||||
TGuiTools.DrawDisabledImage(ABuffer.Canvas,
|
TGuiTools.DrawDisabledImage(ABuffer.Canvas,
|
||||||
FLargeImages,
|
FLargeImages,
|
||||||
@ -1444,7 +1444,7 @@ else
|
|||||||
(FLargeImageIndex<FLargeImages.Count) then
|
(FLargeImageIndex<FLargeImages.Count) then
|
||||||
begin
|
begin
|
||||||
x:=FRect.left + (FRect.Width - FLargeImages.Width) div 2;
|
x:=FRect.left + (FRect.Width - FLargeImages.Width) div 2;
|
||||||
y:=FRect.top + LARGEBUTTON_BORDER_SIZE + LARGEBUTTON_GLYPH_MARGIN;
|
y:=FRect.top + LargeButtonBorderSize + LargeButtonGlyphMargin;
|
||||||
|
|
||||||
TGUITools.DrawImage(ABuffer.Canvas,
|
TGUITools.DrawImage(ABuffer.Canvas,
|
||||||
FLargeImages,
|
FLargeImages,
|
||||||
@ -1489,7 +1489,7 @@ else
|
|||||||
TextHeight:=ABuffer.Canvas.Textheight('Wy');
|
TextHeight:=ABuffer.Canvas.Textheight('Wy');
|
||||||
|
|
||||||
x:=FRect.Left + (FRect.width - ABuffer.Canvas.Textwidth(FCaption)) div 2;
|
x:=FRect.Left + (FRect.width - ABuffer.Canvas.Textwidth(FCaption)) div 2;
|
||||||
y:=FRect.Top + LARGEBUTTON_CAPTION_TOP_RAIL - TextHeight div 2;
|
y:=FRect.Top + LargeButtonCaptionTopRail - TextHeight div 2;
|
||||||
TGUITools.DrawText(ABuffer.Canvas, x, y, FCaption, FontColor, ClipRect);
|
TGUITools.DrawText(ABuffer.Canvas, x, y, FCaption, FontColor, ClipRect);
|
||||||
|
|
||||||
// *** Chevron dropdown ***
|
// *** Chevron dropdown ***
|
||||||
@ -1522,7 +1522,7 @@ else
|
|||||||
ABuffer.Canvas.Font.Orientation:=0;
|
ABuffer.Canvas.Font.Orientation:=0;
|
||||||
|
|
||||||
x:=FDropdownRect.Left + (FDropdownRect.width - ABuffer.Canvas.Textwidth('u')) div 2;
|
x:=FDropdownRect.Left + (FDropdownRect.width - ABuffer.Canvas.Textwidth('u')) div 2;
|
||||||
y:=FDropdownRect.bottom - ABuffer.Canvas.Textheight('u') - LARGEBUTTON_CHEVRON_HMARGIN;
|
y:=FDropdownRect.bottom - ABuffer.Canvas.Textheight('u') - LargeButtonChevronHMargin;
|
||||||
TGUITools.DrawText(ABuffer.Canvas, x, y, 'u', FontColor, ClipRect);
|
TGUITools.DrawText(ABuffer.Canvas, x, y, 'u', FontColor, ClipRect);
|
||||||
|
|
||||||
{$ENDREGION}
|
{$ENDREGION}
|
||||||
@ -1627,7 +1627,7 @@ if Bitmap=nil then
|
|||||||
|
|
||||||
// *** Glyph ***
|
// *** Glyph ***
|
||||||
if FLargeImages<>nil then
|
if FLargeImages<>nil then
|
||||||
GlyphWidth:=2 * LARGEBUTTON_GLYPH_MARGIN + FLargeImages.Width else
|
GlyphWidth:=2 * LargeButtonGlyphMargin + FLargeImages.Width else
|
||||||
GlyphWidth:=0;
|
GlyphWidth:=0;
|
||||||
|
|
||||||
// *** Tekst ***
|
// *** Tekst ***
|
||||||
@ -1635,16 +1635,16 @@ if FButtonKind = bkButton then
|
|||||||
begin
|
begin
|
||||||
// £amiemy etykietê
|
// £amiemy etykietê
|
||||||
FindBreakPlace(FCaption,BreakPos,RowWidth);
|
FindBreakPlace(FCaption,BreakPos,RowWidth);
|
||||||
TextWidth:=2 * LARGEBUTTON_CAPTION_HMARGIN + RowWidth;
|
TextWidth:=2 * LargeButtonCaptionHMargin + RowWidth;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
// Nie ³amiemy etykiety
|
// Nie ³amiemy etykiety
|
||||||
Bitmap.canvas.font.assign(FAppearance.Element.CaptionFont);
|
Bitmap.canvas.font.assign(FAppearance.Element.CaptionFont);
|
||||||
TextWidth:=2 * LARGEBUTTON_CAPTION_HMARGIN + Bitmap.Canvas.TextWidth(FCaption);
|
TextWidth:=2 * LargeButtonCaptionHMargin + Bitmap.Canvas.TextWidth(FCaption);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
result:=max(LARGEBUTTON_MIN_WIDTH, max(GlyphWidth, TextWidth));
|
result := Max(LargeButtonMinWidth, max(GlyphWidth, TextWidth));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TSpkLargeButton.SetLargeImageIndex(const Value: TImageIndex);
|
procedure TSpkLargeButton.SetLargeImageIndex(const Value: TImageIndex);
|
||||||
@ -1706,7 +1706,7 @@ AdditionalPadding:=false;
|
|||||||
// Ikona
|
// Ikona
|
||||||
if FImageIndex<>-1 then
|
if FImageIndex<>-1 then
|
||||||
begin
|
begin
|
||||||
BtnWidth:=BtnWidth + SMALLBUTTON_PADDING + SMALLBUTTON_GLYPH_WIDTH;
|
BtnWidth:=BtnWidth + SmallButtonPadding + SmallButtonGlyphWidth;
|
||||||
AdditionalPadding:=true;
|
AdditionalPadding:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1716,87 +1716,87 @@ if FShowCaption then
|
|||||||
Bitmap.Canvas.Font.assign(FAppearance.Element.CaptionFont);
|
Bitmap.Canvas.Font.assign(FAppearance.Element.CaptionFont);
|
||||||
TextWidth:=Bitmap.Canvas.TextWidth(FCaption);
|
TextWidth:=Bitmap.Canvas.TextWidth(FCaption);
|
||||||
|
|
||||||
BtnWidth:=BtnWidth + SMALLBUTTON_PADDING + TextWidth;
|
BtnWidth:=BtnWidth + SmallButtonPadding + TextWidth;
|
||||||
AdditionalPadding:=true;
|
AdditionalPadding:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// Padding za tekstem lub ikon¹
|
// Padding za tekstem lub ikon¹
|
||||||
if AdditionalPadding then
|
if AdditionalPadding then
|
||||||
BtnWidth:=BtnWidth + SMALLBUTTON_PADDING;
|
BtnWidth:=BtnWidth + SmallButtonPadding;
|
||||||
|
|
||||||
// Szerokoœæ zawartoœci przycisku musi wynosiæ co najmniej SMALLBUTTON_MIN_WIDTH
|
// Szerokoœæ zawartoœci przycisku musi wynosiæ co najmniej SMALLBUTTON_MIN_WIDTH
|
||||||
BtnWidth:=max(SMALLBUTTON_MIN_WIDTH, BtnWidth);
|
BtnWidth := Max(SmallButtonMinWidth, BtnWidth);
|
||||||
|
|
||||||
// *** Dropdown ***
|
// *** Dropdown ***
|
||||||
case FButtonKind of
|
case FButtonKind of
|
||||||
bkButton: begin
|
bkButton: begin
|
||||||
// Lewa krawêdŸ przycisku
|
// Lewa krawêdŸ przycisku
|
||||||
if FGroupBehaviour in [gbContinuesGroup, gbEndsGroup] then
|
if FGroupBehaviour in [gbContinuesGroup, gbEndsGroup] then
|
||||||
BtnWidth:=BtnWidth + SMALLBUTTON_HALF_BORDER_WIDTH else
|
BtnWidth:=BtnWidth + SmallButtonHalfBorderWidth else
|
||||||
BtnWidth:=BtnWidth + SMALLBUTTON_BORDER_WIDTH;
|
BtnWidth:=BtnWidth + SmallButtonBorderWidth;
|
||||||
|
|
||||||
// Prawa krawêdŸ przycisku
|
// Prawa krawêdŸ przycisku
|
||||||
if (FGroupBehaviour in [gbBeginsGroup, gbContinuesGroup]) then
|
if (FGroupBehaviour in [gbBeginsGroup, gbContinuesGroup]) then
|
||||||
BtnWidth:=BtnWidth + SMALLBUTTON_HALF_BORDER_WIDTH else
|
BtnWidth:=BtnWidth + SmallButtonHalfBorderWidth else
|
||||||
BtnWidth:=BtnWidth + SMALLBUTTON_BORDER_WIDTH;
|
BtnWidth:=BtnWidth + SmallButtonBorderWidth;
|
||||||
|
|
||||||
{$IFDEF EnhancedRecordSupport}
|
{$IFDEF EnhancedRecordSupport}
|
||||||
BtnRect:=T2DIntRect.Create(0, 0, BtnWidth - 1, PANE_ROW_HEIGHT - 1);
|
BtnRect:=T2DIntRect.Create(0, 0, BtnWidth - 1, SpkLayoutSizes.PANE_ROW_HEIGHT - 1);
|
||||||
DropRect:=T2DIntRect.Create(0, 0, 0, 0);
|
DropRect:=T2DIntRect.Create(0, 0, 0, 0);
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
BtnRect.Create(0, 0, BtnWidth - 1, PANE_ROW_HEIGHT - 1);
|
BtnRect.Create(0, 0, BtnWidth - 1, PaneRowHeight - 1);
|
||||||
DropRect.Create(0, 0, 0, 0);
|
DropRect.Create(0, 0, 0, 0);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
bkButtonDropdown: begin
|
bkButtonDropdown: begin
|
||||||
// Lewa krawêdŸ przycisku
|
// Lewa krawêdŸ przycisku
|
||||||
if FGroupBehaviour in [gbContinuesGroup, gbEndsGroup] then
|
if FGroupBehaviour in [gbContinuesGroup, gbEndsGroup] then
|
||||||
BtnWidth:=BtnWidth + SMALLBUTTON_HALF_BORDER_WIDTH else
|
BtnWidth:=BtnWidth + SmallButtonHalfBorderWidth else
|
||||||
BtnWidth:=BtnWidth + SMALLBUTTON_BORDER_WIDTH;
|
BtnWidth:=BtnWidth + SmallButtonBorderWidth;
|
||||||
|
|
||||||
// Prawa krawêdŸ przycisku
|
// Prawa krawêdŸ przycisku
|
||||||
BtnWidth:=BtnWidth + SMALLBUTTON_HALF_BORDER_WIDTH;
|
BtnWidth:=BtnWidth + SmallButtonHalfBorderWidth;
|
||||||
|
|
||||||
// Lewa krawêdŸ i zawartoœæ pola dropdown
|
// Lewa krawêdŸ i zawartoœæ pola dropdown
|
||||||
DropdownWidth:=SMALLBUTTON_HALF_BORDER_WIDTH + SMALLBUTTON_DROPDOWN_WIDTH;
|
DropdownWidth := SmallButtonHalfBorderWidth + SmallButtonDropdownWidth;
|
||||||
|
|
||||||
// Prawa krawêdŸ pola dropdown
|
// Prawa krawêdŸ pola dropdown
|
||||||
if (FGroupBehaviour in [gbBeginsGroup, gbContinuesGroup]) then
|
if (FGroupBehaviour in [gbBeginsGroup, gbContinuesGroup]) then
|
||||||
DropdownWidth:=DropdownWidth + SMALLBUTTON_HALF_BORDER_WIDTH else
|
DropdownWidth:=DropdownWidth + SmallButtonHalfBorderWidth else
|
||||||
DropdownWidth:=DropdownWidth + SMALLBUTTON_BORDER_WIDTH;
|
DropdownWidth:=DropdownWidth + SmallButtonBorderWidth;
|
||||||
|
|
||||||
{$IFDEF EnhancedRecordSupport}
|
{$IFDEF EnhancedRecordSupport}
|
||||||
BtnRect:=T2DIntRect.Create(0, 0, BtnWidth - 1, PANE_ROW_HEIGHT - 1);
|
BtnRect:=T2DIntRect.Create(0, 0, BtnWidth - 1, PaneRowHeightT - 1);
|
||||||
DropRect:=T2DIntRect.Create(BtnRect.right+1,
|
DropRect:=T2DIntRect.Create(BtnRect.right+1,
|
||||||
0,
|
0,
|
||||||
BtnRect.right+DropdownWidth,
|
BtnRect.right+DropdownWidth,
|
||||||
PANE_ROW_HEIGHT - 1);
|
PaneRowHeight - 1);
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
BtnRect.Create(0, 0, BtnWidth - 1, PANE_ROW_HEIGHT - 1);
|
BtnRect.Create(0, 0, BtnWidth - 1, PaneRowHeight - 1);
|
||||||
DropRect.Create(BtnRect.right+1, 0,
|
DropRect.Create(BtnRect.right+1, 0,
|
||||||
BtnRect.right+DropdownWidth, PANE_ROW_HEIGHT - 1);
|
BtnRect.right+DropdownWidth, PaneRowHeight - 1);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
bkDropdown: begin
|
bkDropdown: begin
|
||||||
// Lewa krawêdŸ przycisku
|
// Lewa krawêdŸ przycisku
|
||||||
if FGroupBehaviour in [gbContinuesGroup, gbEndsGroup] then
|
if FGroupBehaviour in [gbContinuesGroup, gbEndsGroup] then
|
||||||
BtnWidth:=BtnWidth + SMALLBUTTON_HALF_BORDER_WIDTH else
|
BtnWidth:=BtnWidth + SmallButtonHalfBorderWidth else
|
||||||
BtnWidth:=BtnWidth + SMALLBUTTON_BORDER_WIDTH;
|
BtnWidth:=BtnWidth + SmallButtonBorderWidth;
|
||||||
|
|
||||||
// Prawa krawêdŸ przycisku
|
// Prawa krawêdŸ przycisku
|
||||||
if (FGroupBehaviour in [gbBeginsGroup, gbContinuesGroup]) then
|
if (FGroupBehaviour in [gbBeginsGroup, gbContinuesGroup]) then
|
||||||
BtnWidth:=BtnWidth + SMALLBUTTON_HALF_BORDER_WIDTH else
|
BtnWidth:=BtnWidth + SmallButtonHalfBorderWidth else
|
||||||
BtnWidth:=BtnWidth + SMALLBUTTON_BORDER_WIDTH;
|
BtnWidth:=BtnWidth + SmallButtonBorderWidth;
|
||||||
|
|
||||||
// Dodatkowy obszar na dropdown + miejsce na œrodkow¹ krawêdŸ,
|
// Dodatkowy obszar na dropdown + miejsce na œrodkow¹ krawêdŸ,
|
||||||
// dla kompatybilnoœci wymiarów z dkButtonDropdown
|
// dla kompatybilnoœci wymiarów z dkButtonDropdown
|
||||||
BtnWidth:=BtnWidth + SMALLBUTTON_BORDER_WIDTH + SMALLBUTTON_DROPDOWN_WIDTH;
|
BtnWidth:=BtnWidth + SmallButtonBorderWidth + SmallButtonDropdownWidth;
|
||||||
|
|
||||||
{$IFDEF EnhancedRecordSupport}
|
{$IFDEF EnhancedRecordSupport}
|
||||||
BtnRect:=T2DIntRect.Create(0, 0, BtnWidth - 1, PANE_ROW_HEIGHT - 1);
|
BtnRect:=T2DIntRect.Create(0, 0, BtnWidth - 1, PaneRowHeight - 1);
|
||||||
DropRect:=T2DIntRect.Create(0, 0, 0, 0);
|
DropRect:=T2DIntRect.Create(0, 0, 0, 0);
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
BtnRect.Create(0, 0, BtnWidth - 1, PANE_ROW_HEIGHT - 1);
|
BtnRect.Create(0, 0, BtnWidth - 1, PaneRowHeight - 1);
|
||||||
DropRect.Create(0, 0, 0, 0);
|
DropRect.Create(0, 0, 0, 0);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
@ -1824,7 +1824,7 @@ if FToolbarDispatch=nil then
|
|||||||
if FAppearance=nil then
|
if FAppearance=nil then
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
if (FRect.width<2*LARGEBUTTON_RADIUS) or (FRect.Height<2*LARGEBUTTON_RADIUS) then
|
if (FRect.width < 2*LargeButtonRadius) or (FRect.Height < 2*LargeButtonRadius) then
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
// *** Przycisk ***
|
// *** Przycisk ***
|
||||||
@ -1846,7 +1846,7 @@ if (FButtonState = bsIdle) and (not(FHideFrameWhenIdle)) then
|
|||||||
(FGroupBehaviour in [gbBeginsGroup, gbContinuesGroup]) or (FButtonKind = bkButtonDropdown),
|
(FGroupBehaviour in [gbBeginsGroup, gbContinuesGroup]) or (FButtonKind = bkButtonDropdown),
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
SMALLBUTTON_RADIUS,
|
SmallButtonRadius,
|
||||||
ClipRect);
|
ClipRect);
|
||||||
end else
|
end else
|
||||||
if (FButtonState=bsBtnHottrack) then
|
if (FButtonState=bsBtnHottrack) then
|
||||||
@ -1864,7 +1864,7 @@ if (FButtonState=bsBtnHottrack) then
|
|||||||
(FGroupBehaviour in [gbBeginsGroup, gbContinuesGroup]) or (FButtonKind = bkButtonDropdown),
|
(FGroupBehaviour in [gbBeginsGroup, gbContinuesGroup]) or (FButtonKind = bkButtonDropdown),
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
SMALLBUTTON_RADIUS,
|
SmallButtonRadius,
|
||||||
ClipRect);
|
ClipRect);
|
||||||
end else
|
end else
|
||||||
if (FButtonState = bsBtnPressed) then
|
if (FButtonState = bsBtnPressed) then
|
||||||
@ -1882,7 +1882,7 @@ if (FButtonState = bsBtnPressed) then
|
|||||||
(FGroupBehaviour in [gbBeginsGroup, gbContinuesGroup]) or (FButtonKind = bkButtonDropdown),
|
(FGroupBehaviour in [gbBeginsGroup, gbContinuesGroup]) or (FButtonKind = bkButtonDropdown),
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
SMALLBUTTON_RADIUS,
|
SmallButtonRadius,
|
||||||
ClipRect);
|
ClipRect);
|
||||||
end else
|
end else
|
||||||
if (FButtonState in [bsDropdownHottrack, bsDropdownPressed]) then
|
if (FButtonState in [bsDropdownHottrack, bsDropdownPressed]) then
|
||||||
@ -1900,7 +1900,7 @@ if (FButtonState in [bsDropdownHottrack, bsDropdownPressed]) then
|
|||||||
(FGroupBehaviour in [gbBeginsGroup, gbContinuesGroup]) or (FButtonKind = bkButtonDropdown),
|
(FGroupBehaviour in [gbBeginsGroup, gbContinuesGroup]) or (FButtonKind = bkButtonDropdown),
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
SMALLBUTTON_RADIUS,
|
SmallButtonRadius,
|
||||||
ClipRect);
|
ClipRect);
|
||||||
end;
|
end;
|
||||||
{$ENDREGION}
|
{$ENDREGION}
|
||||||
@ -1914,8 +1914,8 @@ if not(FEnabled) then
|
|||||||
(FImageIndex<FDisabledImages.Count) then
|
(FImageIndex<FDisabledImages.Count) then
|
||||||
begin
|
begin
|
||||||
if (FGroupBehaviour in [gbContinuesGroup, gbEndsGroup]) then
|
if (FGroupBehaviour in [gbContinuesGroup, gbEndsGroup]) then
|
||||||
x:=FButtonRect.Left + SMALLBUTTON_HALF_BORDER_WIDTH + SMALLBUTTON_PADDING else
|
x:=FButtonRect.Left + SmallButtonHalfBorderWidth + SmallButtonPadding else
|
||||||
x:=FButtonRect.Left + SMALLBUTTON_BORDER_WIDTH + SMALLBUTTON_PADDING;
|
x:=FButtonRect.Left + SmallButtonBorderWidth + SmallButtonPadding;
|
||||||
y:=FButtonRect.top + (FButtonRect.height - FDisabledImages.Height) div 2;
|
y:=FButtonRect.top + (FButtonRect.height - FDisabledImages.Height) div 2;
|
||||||
|
|
||||||
TGuiTools.DrawImage(ABuffer.Canvas,
|
TGuiTools.DrawImage(ABuffer.Canvas,
|
||||||
@ -1933,8 +1933,8 @@ if not(FEnabled) then
|
|||||||
(FImageIndex<FImages.Count) then
|
(FImageIndex<FImages.Count) then
|
||||||
begin
|
begin
|
||||||
if (FGroupBehaviour in [gbContinuesGroup, gbEndsGroup]) then
|
if (FGroupBehaviour in [gbContinuesGroup, gbEndsGroup]) then
|
||||||
x:=FButtonRect.Left + SMALLBUTTON_HALF_BORDER_WIDTH + SMALLBUTTON_PADDING else
|
x:=FButtonRect.Left + SmallButtonHalfBorderWidth + SmallButtonPadding else
|
||||||
x:=FButtonRect.Left + SMALLBUTTON_BORDER_WIDTH + SMALLBUTTON_PADDING;
|
x:=FButtonRect.Left + SmallButtonBorderWidth + SmallButtonPadding;
|
||||||
y:=FButtonRect.top + (FButtonRect.height - FImages.Height) div 2;
|
y:=FButtonRect.top + (FButtonRect.height - FImages.Height) div 2;
|
||||||
|
|
||||||
TGuiTools.DrawDisabledImage(ABuffer.Canvas,
|
TGuiTools.DrawDisabledImage(ABuffer.Canvas,
|
||||||
@ -1957,8 +1957,8 @@ else
|
|||||||
(FImageIndex<FImages.Count) then
|
(FImageIndex<FImages.Count) then
|
||||||
begin
|
begin
|
||||||
if (FGroupBehaviour in [gbContinuesGroup, gbEndsGroup]) then
|
if (FGroupBehaviour in [gbContinuesGroup, gbEndsGroup]) then
|
||||||
x:=FButtonRect.Left + SMALLBUTTON_HALF_BORDER_WIDTH + SMALLBUTTON_PADDING else
|
x:=FButtonRect.Left + SmallButtonHalfBorderWidth + SmallButtonPadding else
|
||||||
x:=FButtonRect.Left + SMALLBUTTON_BORDER_WIDTH + SMALLBUTTON_PADDING;
|
x:=FButtonRect.Left + SmallButtonBorderWidth + SmallButtonPadding;
|
||||||
y:=FButtonRect.top + (FButtonRect.height - FImages.Height) div 2;
|
y:=FButtonRect.top + (FButtonRect.height - FImages.Height) div 2;
|
||||||
|
|
||||||
TGUITools.DrawImage(ABuffer.Canvas,
|
TGUITools.DrawImage(ABuffer.Canvas,
|
||||||
@ -2003,12 +2003,12 @@ if FShowCaption then
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
if (FGroupBehaviour in [gbContinuesGroup, gbEndsGroup]) then
|
if (FGroupBehaviour in [gbContinuesGroup, gbEndsGroup]) then
|
||||||
x:=FButtonRect.Left + SMALLBUTTON_HALF_BORDER_WIDTH else
|
x:=FButtonRect.Left + SmallButtonHalfBorderWidth else
|
||||||
x:=FButtonRect.Left + SMALLBUTTON_BORDER_WIDTH;
|
x:=FButtonRect.Left + SmallButtonBorderWidth;
|
||||||
|
|
||||||
if FImageIndex<>-1 then
|
if FImageIndex<>-1 then
|
||||||
x:=x + 2 * SMALLBUTTON_PADDING + SMALLBUTTON_GLYPH_WIDTH else
|
x:=x + 2 * SmallButtonPadding + SmallButtonGlyphWidth else
|
||||||
x:=x + SMALLBUTTON_PADDING;
|
x:=x + SmallButtonPadding;
|
||||||
y:=FButtonRect.Top + (FButtonRect.Height - ABuffer.Canvas.TextHeight('Wy')) div 2;
|
y:=FButtonRect.Top + (FButtonRect.Height - ABuffer.Canvas.TextHeight('Wy')) div 2;
|
||||||
|
|
||||||
TGUITools.DrawText(ABuffer.Canvas,
|
TGUITools.DrawText(ABuffer.Canvas,
|
||||||
@ -2043,7 +2043,7 @@ if FButtonKind = bkButtonDropdown then
|
|||||||
(FGroupBehaviour in [gbBeginsGroup, gbContinuesGroup]),
|
(FGroupBehaviour in [gbBeginsGroup, gbContinuesGroup]),
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
SMALLBUTTON_RADIUS,
|
SmallButtonRadius,
|
||||||
ClipRect);
|
ClipRect);
|
||||||
end else
|
end else
|
||||||
if (FButtonState in [bsBtnHottrack, bsBtnPressed]) then
|
if (FButtonState in [bsBtnHottrack, bsBtnPressed]) then
|
||||||
@ -2061,7 +2061,7 @@ if FButtonKind = bkButtonDropdown then
|
|||||||
(FGroupBehaviour in [gbBeginsGroup, gbContinuesGroup]),
|
(FGroupBehaviour in [gbBeginsGroup, gbContinuesGroup]),
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
SMALLBUTTON_RADIUS,
|
SmallButtonRadius,
|
||||||
ClipRect);
|
ClipRect);
|
||||||
|
|
||||||
end else
|
end else
|
||||||
@ -2080,7 +2080,7 @@ if FButtonKind = bkButtonDropdown then
|
|||||||
(FGroupBehaviour in [gbBeginsGroup, gbContinuesGroup]),
|
(FGroupBehaviour in [gbBeginsGroup, gbContinuesGroup]),
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
SMALLBUTTON_RADIUS,
|
SmallButtonRadius,
|
||||||
ClipRect);
|
ClipRect);
|
||||||
end else
|
end else
|
||||||
if (FButtonState = bsDropdownPressed) then
|
if (FButtonState = bsDropdownPressed) then
|
||||||
@ -2098,7 +2098,7 @@ if FButtonKind = bkButtonDropdown then
|
|||||||
(FGroupBehaviour in [gbBeginsGroup, gbContinuesGroup]),
|
(FGroupBehaviour in [gbBeginsGroup, gbContinuesGroup]),
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
SMALLBUTTON_RADIUS,
|
SmallButtonRadius,
|
||||||
ClipRect);
|
ClipRect);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -2133,8 +2133,8 @@ if FButtonKind = bkButtonDropdown then
|
|||||||
ABuffer.Canvas.Font.Orientation:=0;
|
ABuffer.Canvas.Font.Orientation:=0;
|
||||||
|
|
||||||
if FGroupBehaviour in [gbBeginsGroup, gbContinuesGroup] then
|
if FGroupBehaviour in [gbBeginsGroup, gbContinuesGroup] then
|
||||||
x:=FDropdownRect.Right - SMALLBUTTON_HALF_BORDER_WIDTH - (SMALLBUTTON_DROPDOWN_WIDTH + ABuffer.Canvas.Textwidth('u')) div 2 + 1 else
|
x:=FDropdownRect.Right - SmallButtonHalfBorderWidth - (SmallButtonDropdownWidth + ABuffer.Canvas.Textwidth('u')) div 2 + 1 else
|
||||||
x:=FDropdownRect.Right - SMALLBUTTON_BORDER_WIDTH - (SMALLBUTTON_DROPDOWN_WIDTH + ABuffer.Canvas.Textwidth('u')) div 2 + 1;
|
x:=FDropdownRect.Right - SmallButtonBorderWidth - (SmallButtonDropdownWidth + ABuffer.Canvas.Textwidth('u')) div 2 + 1;
|
||||||
y:=FDropdownRect.top + (FDropdownRect.height - ABuffer.Canvas.Textheight('u')) div 2;
|
y:=FDropdownRect.top + (FDropdownRect.height - ABuffer.Canvas.Textheight('u')) div 2;
|
||||||
TGUITools.DrawText(ABuffer.Canvas, x, y, 'u', FontColor, ClipRect);
|
TGUITools.DrawText(ABuffer.Canvas, x, y, 'u', FontColor, ClipRect);
|
||||||
{$ENDREGION}
|
{$ENDREGION}
|
||||||
@ -2173,8 +2173,8 @@ if FButtonKind = bkDropdown then
|
|||||||
ABuffer.Canvas.Font.Orientation:=0;
|
ABuffer.Canvas.Font.Orientation:=0;
|
||||||
|
|
||||||
if FGroupBehaviour in [gbBeginsGroup, gbContinuesGroup] then
|
if FGroupBehaviour in [gbBeginsGroup, gbContinuesGroup] then
|
||||||
x:=FButtonRect.Right - SMALLBUTTON_HALF_BORDER_WIDTH - (SMALLBUTTON_DROPDOWN_WIDTH + ABuffer.Canvas.Textwidth('u')) div 2 + 1 else
|
x:=FButtonRect.Right - SmallButtonHalfBorderWidth - (SmallButtonDropdownWidth + ABuffer.Canvas.Textwidth('u')) div 2 + 1 else
|
||||||
x:=FButtonRect.Right - SMALLBUTTON_BORDER_WIDTH - (SMALLBUTTON_DROPDOWN_WIDTH + ABuffer.Canvas.Textwidth('u')) div 2 + 1;
|
x:=FButtonRect.Right - SmallButtonBorderWidth - (SmallButtonDropdownWidth + ABuffer.Canvas.Textwidth('u')) div 2 + 1;
|
||||||
y:=FButtonRect.top + (FButtonRect.height - ABuffer.Canvas.Textheight('u')) div 2;
|
y:=FButtonRect.top + (FButtonRect.height - ABuffer.Canvas.Textheight('u')) div 2;
|
||||||
TGUITools.DrawText(ABuffer.Canvas, x, y, 'u', FontColor, ClipRect);
|
TGUITools.DrawText(ABuffer.Canvas, x, y, 'u', FontColor, ClipRect);
|
||||||
end;
|
end;
|
||||||
|
@ -201,25 +201,25 @@ begin
|
|||||||
Bitmap.Canvas.Font.Assign(FAppearance.Element.CaptionFont);
|
Bitmap.Canvas.Font.Assign(FAppearance.Element.CaptionFont);
|
||||||
TextWidth := Bitmap.Canvas.TextWidth(FCaption);
|
TextWidth := Bitmap.Canvas.TextWidth(FCaption);
|
||||||
|
|
||||||
BtnWidth := SMALLBUTTON_PADDING + SMALLBUTTON_GLYPH_WIDTH +
|
BtnWidth := SmallButtonPadding + SmallButtonGlyphWidth +
|
||||||
SMALLBUTTON_PADDING + TextWidth + SMALLBUTTON_PADDING;
|
SmallButtonPadding + TextWidth + SmallButtonPadding;
|
||||||
BtnWidth := Max(SMALLBUTTON_MIN_WIDTH, BtnWidth);
|
BtnWidth := Max(SmallButtonMinWidth, BtnWidth);
|
||||||
|
|
||||||
if FGroupBehaviour in [gbContinuesGroup, gbEndsGroup] then
|
if FGroupBehaviour in [gbContinuesGroup, gbEndsGroup] then
|
||||||
BtnWidth := BtnWidth + SMALLBUTTON_HALF_BORDER_WIDTH
|
BtnWidth := BtnWidth + SmallButtonHalfBorderWidth
|
||||||
else
|
else
|
||||||
BtnWidth := BtnWidth + SMALLBUTTON_BORDER_WIDTH;
|
BtnWidth := BtnWidth + SmallButtonBorderWidth;
|
||||||
|
|
||||||
// Prawa krawêdŸ przycisku
|
// Prawa krawêdŸ przycisku
|
||||||
if (FGroupBehaviour in [gbBeginsGroup, gbContinuesGroup]) then
|
if (FGroupBehaviour in [gbBeginsGroup, gbContinuesGroup]) then
|
||||||
BtnWidth := BtnWidth + SMALLBUTTON_HALF_BORDER_WIDTH
|
BtnWidth := BtnWidth + SmallButtonHalfBorderWidth
|
||||||
else
|
else
|
||||||
BtnWidth := BtnWidth + SMALLBUTTON_BORDER_WIDTH;
|
BtnWidth := BtnWidth + SmallButtonBorderWidth;
|
||||||
|
|
||||||
{$IFDEF EnhancedRecordSupport}
|
{$IFDEF EnhancedRecordSupport}
|
||||||
BtnRect := T2DIntRect.Create(0, 0, BtnWidth - 1, PANE_ROW_HEIGHT - 1);
|
BtnRect := T2DIntRect.Create(0, 0, BtnWidth - 1, PaneRowHeight - 1);
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
BtnRect.Create(0, 0, BtnWidth - 1, PANE_ROW_HEIGHT - 1);
|
BtnRect.Create(0, 0, BtnWidth - 1, PaneRowHeight - 1);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -234,7 +234,7 @@ begin
|
|||||||
exit;
|
exit;
|
||||||
if FAppearance = nil then
|
if FAppearance = nil then
|
||||||
exit;
|
exit;
|
||||||
if (FRect.Width < 2*LARGEBUTTON_RADIUS) or (FRect.Height < 2*LARGEBUTTON_RADIUS) then
|
if (FRect.Width < 2*LargeButtonRadius) or (FRect.Height < 2*LargeButtonRadius) then
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
// Border
|
// Border
|
||||||
@ -253,7 +253,7 @@ begin
|
|||||||
(FGroupBehaviour in [gbBeginsGroup, gbContinuesGroup]) or (FButtonKind = bkButtonDropdown),
|
(FGroupBehaviour in [gbBeginsGroup, gbContinuesGroup]) or (FButtonKind = bkButtonDropdown),
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
SMALLBUTTON_RADIUS,
|
SmallButtonRadius,
|
||||||
ClipRect
|
ClipRect
|
||||||
);
|
);
|
||||||
end else
|
end else
|
||||||
@ -272,7 +272,7 @@ begin
|
|||||||
(FGroupBehaviour in [gbBeginsGroup, gbContinuesGroup]) or (FButtonKind = bkButtonDropdown),
|
(FGroupBehaviour in [gbBeginsGroup, gbContinuesGroup]) or (FButtonKind = bkButtonDropdown),
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
SMALLBUTTON_RADIUS,
|
SmallButtonRadius,
|
||||||
ClipRect
|
ClipRect
|
||||||
);
|
);
|
||||||
end else
|
end else
|
||||||
@ -291,7 +291,7 @@ begin
|
|||||||
(FGroupBehaviour in [gbBeginsGroup, gbContinuesGroup]) or (FButtonKind = bkButtonDropdown),
|
(FGroupBehaviour in [gbBeginsGroup, gbContinuesGroup]) or (FButtonKind = bkButtonDropdown),
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
SMALLBUTTON_RADIUS,
|
SmallButtonRadius,
|
||||||
ClipRect
|
ClipRect
|
||||||
);
|
);
|
||||||
end;
|
end;
|
||||||
@ -303,9 +303,9 @@ begin
|
|||||||
end else
|
end else
|
||||||
h := GetSystemMetrics(SM_CYMENUCHECK);
|
h := GetSystemMetrics(SM_CYMENUCHECK);
|
||||||
if (FGroupBehaviour in [gbContinuesGroup, gbEndsGroup]) then
|
if (FGroupBehaviour in [gbContinuesGroup, gbEndsGroup]) then
|
||||||
x := FButtonRect.Left + SMALLBUTTON_HALF_BORDER_WIDTH + SMALLBUTTON_PADDING
|
x := FButtonRect.Left + SmallButtonHalfBorderWidth + SmallButtonPadding
|
||||||
else
|
else
|
||||||
x := FButtonRect.Left + SMALLBUTTON_BORDER_WIDTH + SMALLBUTTON_PADDING;
|
x := FButtonRect.Left + SmallButtonBorderWidth + SmallButtonPadding;
|
||||||
y := FButtonRect.Top + (FButtonRect.Height - h) div 2;
|
y := FButtonRect.Top + (FButtonRect.Height - h) div 2;
|
||||||
|
|
||||||
TGUITools.DrawCheckbox(
|
TGUITools.DrawCheckbox(
|
||||||
@ -339,10 +339,10 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
if (FGroupBehaviour in [gbContinuesGroup, gbEndsGroup]) then
|
if (FGroupBehaviour in [gbContinuesGroup, gbEndsGroup]) then
|
||||||
x := FButtonRect.Left + SMALLBUTTON_HALF_BORDER_WIDTH
|
x := FButtonRect.Left + SmallButtonHalfBorderWidth
|
||||||
else
|
else
|
||||||
x := FButtonRect.Left + SMALLBUTTON_BORDER_WIDTH;
|
x := FButtonRect.Left + SmallButtonBorderWidth;
|
||||||
x := x + 2 * SMALLBUTTON_PADDING + SMALLBUTTON_GLYPH_WIDTH;
|
x := x + 2 * SmallButtonPadding + SmallButtonGlyphWidth;
|
||||||
y := FButtonRect.Top + (FButtonRect.Height - ABuffer.Canvas.TextHeight('Wy')) div 2;
|
y := FButtonRect.Top + (FButtonRect.Height - ABuffer.Canvas.TextHeight('Wy')) div 2;
|
||||||
|
|
||||||
TGUITools.DrawText(
|
TGUITools.DrawText(
|
||||||
|
@ -14,155 +14,377 @@ unit spkt_Const;
|
|||||||
|
|
||||||
interface
|
interface
|
||||||
|
|
||||||
const // ****************
|
procedure SpkInitLayoutConsts(FromDPI: Integer; ToDPI: Integer = 0);
|
||||||
// *** Elementy ***
|
function SpkScaleX(Size: Integer; FromDPI: Integer; ToDPI: Integer = 0): integer;
|
||||||
// ****************
|
function SpkScaleY(Size: Integer; FromDPI: Integer; ToDPI: Integer = 0): integer;
|
||||||
|
|
||||||
LARGEBUTTON_DROPDOWN_FIELD_SIZE = 29;
|
const
|
||||||
LARGEBUTTON_GLYPH_MARGIN = 1;
|
// ****************
|
||||||
LARGEBUTTON_CAPTION_HMARGIN = 3;
|
// *** Elements ***
|
||||||
LARGEBUTTON_MIN_WIDTH = 24;
|
// ****************
|
||||||
LARGEBUTTON_RADIUS = 4;
|
|
||||||
LARGEBUTTON_BORDER_SIZE = 2;
|
|
||||||
LARGEBUTTON_CHEVRON_HMARGIN = 4;
|
|
||||||
LARGEBUTTON_CAPTION_TOP_RAIL = 45;
|
|
||||||
LARGEBUTTON_CAPTION_BOTTOM_RAIL = 58;
|
|
||||||
|
|
||||||
SMALLBUTTON_GLYPH_WIDTH = 20; //16;
|
LARGEBUTTON_DROPDOWN_FIELD_SIZE = 29;
|
||||||
SMALLBUTTON_BORDER_WIDTH = 2;
|
LARGEBUTTON_GLYPH_MARGIN = 1;
|
||||||
SMALLBUTTON_HALF_BORDER_WIDTH = 1;
|
LARGEBUTTON_CAPTION_HMARGIN = 3;
|
||||||
SMALLBUTTON_PADDING = 2;
|
LARGEBUTTON_MIN_WIDTH = 24;
|
||||||
SMALLBUTTON_DROPDOWN_WIDTH = 11;
|
LARGEBUTTON_RADIUS = 4;
|
||||||
SMALLBUTTON_RADIUS = 4;
|
LARGEBUTTON_BORDER_SIZE = 2;
|
||||||
SMALLBUTTON_MIN_WIDTH = 2 * SMALLBUTTON_PADDING + SMALLBUTTON_GLYPH_WIDTH;
|
LARGEBUTTON_CHEVRON_HMARGIN = 4;
|
||||||
|
LARGEBUTTON_CAPTION_TOP_RAIL = 45;
|
||||||
|
LARGEBUTTON_CAPTION_BOTTOM_RAIL = 58;
|
||||||
|
|
||||||
// ********************
|
SMALLBUTTON_GLYPH_WIDTH = 16; //was: 20; //16;
|
||||||
// *** Obszar tafli ***
|
SMALLBUTTON_BORDER_WIDTH = 2;
|
||||||
// ********************
|
SMALLBUTTON_HALF_BORDER_WIDTH = 1;
|
||||||
|
SMALLBUTTON_PADDING = 2;
|
||||||
|
SMALLBUTTON_DROPDOWN_WIDTH = 11;
|
||||||
|
SMALLBUTTON_RADIUS = 4;
|
||||||
|
|
||||||
/// <summary>Maksymalna wysokoœæ obszaru, który mo¿e zaj¹æ zawartoœæ
|
// ***********************
|
||||||
/// tafli z elementami</summary>
|
// *** Tab page layout ***
|
||||||
MAX_ELEMENT_HEIGHT = 67;
|
// ***********************
|
||||||
|
|
||||||
/// <summary>Wysokoœæ pojedynczego wiersza elementów tafli</summary>
|
/// <summary>Maximum area height that can be used by an element</summary>
|
||||||
PANE_ROW_HEIGHT = 22;
|
MAX_ELEMENT_HEIGHT = 67;
|
||||||
|
|
||||||
PANE_FULL_ROW_HEIGHT = 3 * PANE_ROW_HEIGHT;
|
/// <summary>Maximum row height</summary>
|
||||||
|
PANE_ROW_HEIGHT = 22;
|
||||||
|
|
||||||
/// <summary>Wewnêtrzny pionowy margines pomiêdzy pierwszym elementem a
|
/// <summary>Single row top margin</summary>
|
||||||
/// tafl¹ w przypadku wersji jednowierszowej</summary>
|
PANE_ONE_ROW_TOPPADDING = 22;
|
||||||
PANE_ONE_ROW_TOPPADDING = 22;
|
/// <summary>Single row bottom margin</summary>
|
||||||
/// <summary>Wewnêtrzny pionowy margines pomiêdzy ostatnim elementem
|
PANE_ONE_ROW_BOTTOMPADDING = 23;
|
||||||
/// a tafl¹ w przypadku wersji jednowierszowej</summary>
|
|
||||||
PANE_ONE_ROW_BOTTOMPADDING = 23;
|
|
||||||
|
|
||||||
/// <summary>Odleg³oœæ pomiêdzy wierszami w przypadku wersji dwuwierszowej
|
/// <summary>Space between rows in a double row layout</summary>
|
||||||
/// </summary>
|
PANE_TWO_ROWS_VSPACER = 7;
|
||||||
PANE_TWO_ROWS_VSPACER = 7;
|
/// <summary>Double row layout top margin</summary>
|
||||||
/// <summary>Wewnêtrzny pionowy margines pomiêdzy pierwszym elementem a
|
PANE_TWO_ROWS_TOPPADDING = 8;
|
||||||
/// tafl¹ w przypadku wersji dwuwierszowej</summary>
|
/// <summary>Double row layout bottom margin</summary>
|
||||||
PANE_TWO_ROWS_TOPPADDING = 8;
|
PANE_TWO_ROWS_BOTTOMPADDING = 8;
|
||||||
/// <summary>Wewnêtrzny pionowy margines pomiêdzy ostatnim elementem
|
|
||||||
/// a tafl¹ w przypadku wersji dwuwierszowej</summary>
|
|
||||||
PANE_TWO_ROWS_BOTTOMPADDING = 8;
|
|
||||||
|
|
||||||
/// <summary>Odleg³oœæ pomiêdzy wierszami w przypadku wersji
|
/// <summary>Space between rows in triple row layout</summary>
|
||||||
/// trzywierszowej</summary>
|
PANE_THREE_ROWS_VSPACER = 0;
|
||||||
PANE_THREE_ROWS_VSPACER = 0;
|
/// <summary>Triple row layout top margin</summary>
|
||||||
/// <summary>Wewnêtrzny pionowy margines pomiêdzy pierwszym elementem a
|
PANE_THREE_ROWS_TOPPADDING = 0;
|
||||||
/// tafl¹ w przypadku wersji trzywierszowej</summary>
|
/// <summary>Triple row layout bottom margin</summary>
|
||||||
PANE_THREE_ROWS_TOPPADDING = 0;
|
PANE_THREE_ROWS_BOTTOMPADDING = 1;
|
||||||
/// <summary>Wewnêtrzny pionowy margines pomiêdzy ostatnim elementem
|
|
||||||
/// a tafl¹ w przypadku wersji trzywierszowej</summary>
|
|
||||||
PANE_THREE_ROWS_BOTTOMPADDING = 1;
|
|
||||||
|
|
||||||
PANE_FULL_ROW_TOPPADDING = PANE_THREE_ROWS_TOPPADDING;
|
/// <summary>Pane left padding, space between left pane border and left element border</summary>
|
||||||
|
PANE_LEFT_PADDING = 2;
|
||||||
|
/// <summary>Pane right padding, space between right pane border and right element border</summary>
|
||||||
|
PANE_RIGHT_PADDING = 2;
|
||||||
|
/// <summary>Space between two columns inside the pane</summary>
|
||||||
|
PANE_COLUMN_SPACER = 4;
|
||||||
|
/// <summary>Space between groups on a row in pane</summary>
|
||||||
|
PANE_GROUP_SPACER = 4;
|
||||||
|
|
||||||
PANE_FULL_ROW_BOTTOMPADDING = PANE_THREE_ROWS_BOTTOMPADDING;
|
|
||||||
|
|
||||||
/// <summary>Odleg³oœæ pomiêdzy lew¹ krawêdzi¹ a pierwszym elementem
|
// *******************
|
||||||
/// tafli</summary>
|
// *** Pane layout ***
|
||||||
PANE_LEFT_PADDING = 2;
|
// *******************
|
||||||
|
|
||||||
/// <summary>Odleg³oœæ pomiêdzy ostatnim elementem tafli a praw¹ krawêdzi¹
|
/// <summary>Pane caption height</summary>
|
||||||
/// </summary>
|
PANE_CAPTION_HEIGHT = 15;
|
||||||
PANE_RIGHT_PADDING = 2;
|
/// <summary>Pane corner radius</summary>
|
||||||
|
PANE_CORNER_RADIUS = 3;
|
||||||
|
/// <summary>Pane border size.</summary>
|
||||||
|
/// <remarks>Do not change?</remarks>
|
||||||
|
PANE_BORDER_SIZE = 2;
|
||||||
|
/// <summary>Half width of pane border?</summary>
|
||||||
|
/// <remarks>Do not change?</remarks>
|
||||||
|
PANE_BORDER_HALF_SIZE = 1;
|
||||||
|
/// <summary>Pane caption horizontal padding</summary>
|
||||||
|
PANE_CAPTION_HMARGIN = 6;
|
||||||
|
|
||||||
/// <summary>Odleg³oœæ pomiêdzy dwoma kolumnami wewn¹trz tafli</summary>
|
|
||||||
PANE_COLUMN_SPACER = 4;
|
|
||||||
|
|
||||||
/// <summary>Odleg³oœæ pomiêdzy dwoma osobnymi grupami wewnêtrz wiersza
|
// ************
|
||||||
/// w tafli</summary>
|
// *** Tabs ***
|
||||||
PANE_GROUP_SPACER = 4;
|
// ************
|
||||||
|
|
||||||
// *************
|
/// <summary>Tab corner radius</summary>
|
||||||
// *** Tafla ***
|
TAB_CORNER_RADIUS = 4;
|
||||||
// *************
|
/// <summary>Tab page left margin</summary>
|
||||||
|
TAB_PANE_LEFTPADDING = 2;
|
||||||
|
/// <summary>Tab page right margin</summary>
|
||||||
|
TAB_PANE_RIGHTPADDING = 2;
|
||||||
|
/// <summary>Tab page top margin</summary>
|
||||||
|
TAB_PANE_TOPPADDING = 2;
|
||||||
|
/// <summary>Tab page bottom margin</summary>
|
||||||
|
TAB_PANE_BOTTOMPADDING = 1;
|
||||||
|
/// <summary>Space between panes</summary>
|
||||||
|
TAB_PANE_HSPACING = 3;
|
||||||
|
/// <summary>Tab border size</summary>
|
||||||
|
TAB_BORDER_SIZE = 1;
|
||||||
|
|
||||||
/// <summary>Wysokoœæ obszaru tytu³u tafli</summary>
|
|
||||||
PANE_CAPTION_HEIGHT = 15;
|
|
||||||
|
|
||||||
PANE_CORNER_RADIUS = 3;
|
// ***************
|
||||||
|
// *** Toolbar ***
|
||||||
|
// ***************
|
||||||
|
|
||||||
/// <summary>SzerokoϾ/wysokoϾ ramki tafli</summary>
|
/// <summary>Pane padding?</summary>
|
||||||
/// <remarks>Nie nale¿y zmieniaæ tej sta³ej!</remarks>
|
TOOLBAR_BORDER_WIDTH = 1;
|
||||||
PANE_BORDER_SIZE = 2;
|
TOOLBAR_CORNER_RADIUS = 3;
|
||||||
|
/// <summary>Tab caption height</summary>
|
||||||
|
TOOLBAR_TAB_CAPTIONS_HEIGHT = 22;
|
||||||
|
/// <summary>Tab caption horizontal padding</summary>
|
||||||
|
TOOLBAR_TAB_CAPTIONS_TEXT_HPADDING = 4;
|
||||||
|
/// <summary>Min tab caption width</summary>
|
||||||
|
TOOLBAR_MIN_TAB_CAPTION_WIDTH = 32;
|
||||||
|
|
||||||
/// <summary>Po³owa szerokoœci ramki tafli</summary>
|
var
|
||||||
/// <remarks>Nie nale¿y zmieniaæ tej sta³ej!</remarks>
|
// ****************
|
||||||
PANE_BORDER_HALF_SIZE = 1;
|
// *** Elements ***
|
||||||
|
// ****************
|
||||||
|
LargeButtonDropdownFieldSize: Integer;
|
||||||
|
LargeButtonGlyphMargin: Integer;
|
||||||
|
LargeButtonCaptionHMargin: Integer;
|
||||||
|
LargeButtonMinWidth: Integer;
|
||||||
|
LargeButtonRadius: Integer;
|
||||||
|
LargeButtonBorderSize: Integer;
|
||||||
|
LargeButtonChevronHMargin: Integer;
|
||||||
|
LargeButtonCaptionTopRail: Integer;
|
||||||
|
LargeButtonCaptionButtomRail: Integer;
|
||||||
|
|
||||||
/// <summary>Wysokoœæ ca³ej tafli (uwzglêdniaj¹c ramkê)</summary>
|
SmallButtonGlyphWidth: Integer;
|
||||||
PANE_HEIGHT = MAX_ELEMENT_HEIGHT + PANE_CAPTION_HEIGHT + 2 * PANE_BORDER_SIZE;
|
SmallButtonBorderWidth: Integer;
|
||||||
|
SmallButtonHalfBorderWidth: Integer;
|
||||||
|
SmallButtonPadding: Integer;
|
||||||
|
SmallButtonDropdownWidth: Integer;
|
||||||
|
SmallButtonRadius: Integer;
|
||||||
|
SmallButtonMinWidth: Integer;
|
||||||
|
|
||||||
/// <summary>Poziomy margines etykiety zak³adki</summary>
|
|
||||||
PANE_CAPTION_HMARGIN = 6;
|
|
||||||
|
|
||||||
// ***********************
|
// ***********************
|
||||||
// *** Obszar zak³adki ***
|
// *** Tab page layout ***
|
||||||
// ***********************
|
// ***********************
|
||||||
|
|
||||||
/// <summary>Promieñ zaokr¹glenia zak³adki</summary>
|
/// <summary>Maximum area height that can be used by an element</summary>
|
||||||
TAB_CORNER_RADIUS = 4;
|
MaxElementHeight: Integer;
|
||||||
|
|
||||||
/// <summary>Lewy wewnêtrzny margines zak³adki</summary>
|
/// <summary>Maximum row height</summary>
|
||||||
TAB_PANE_LEFTPADDING = 2;
|
PaneRowHeight: Integer;
|
||||||
/// <summary>Prawy wewnêtrzny margines zak³adki</summary>
|
PaneFullRowHeight: Integer;
|
||||||
TAB_PANE_RIGHTPADDING = 2;
|
|
||||||
/// <summary>Górny wewnêtrzny margines zak³adki</summary>
|
|
||||||
TAB_PANE_TOPPADDING = 2;
|
|
||||||
/// <summary>Dolny wewnêtrzny margines zak³adki</summary>
|
|
||||||
TAB_PANE_BOTTOMPADDING = 1;
|
|
||||||
/// <summary>Odleg³oœæ pomiêdzy taflami</summary>
|
|
||||||
TAB_PANE_HSPACING = 3;
|
|
||||||
|
|
||||||
/// <summary>Szerokoœæ/wysokoœæ ramki zak³adki (nie nale¿y zmieniaæ!)
|
/// <summary>Single row top margin</summary>
|
||||||
/// </summary>
|
PaneOneRowTopPadding: Integer;
|
||||||
TAB_BORDER_SIZE = 1;
|
/// <summary>Single row bottom margin</summary>
|
||||||
/// <summary>Wysokoœæ zak³adki</summary>
|
PaneOneRowBottomPadding: Integer;
|
||||||
TAB_HEIGHT = PANE_HEIGHT + TAB_PANE_TOPPADDING + TAB_PANE_BOTTOMPADDING + TAB_BORDER_SIZE;
|
|
||||||
|
|
||||||
// ***************
|
/// <summary>Space between rows in a double row layout</summary>
|
||||||
// *** Toolbar ***
|
PaneTwoRowsVSpacer: Integer;
|
||||||
// ***************
|
/// <summary>Double row layout top margin</summary>
|
||||||
|
PaneTwoRowsTopPadding: Integer;
|
||||||
|
/// <summary>Double row layout bottom margin</summary>
|
||||||
|
PaneTwoRowsBottomPadding: Integer;
|
||||||
|
|
||||||
TOOLBAR_BORDER_WIDTH = 1;
|
/// <summary>Space between rows in triple row layout</summary>
|
||||||
|
PaneThreeRowsVSpacer: Integer;
|
||||||
|
/// <summary>Triple row layout top margin</summary>
|
||||||
|
PaneThreeRowsTopPadding: Integer;
|
||||||
|
/// <summary>Triple row layout bottom margin</summary>
|
||||||
|
PaneThreeRowsBottomPadding: Integer;
|
||||||
|
|
||||||
TOOLBAR_CORNER_RADIUS = 3;
|
PaneFullRowTopPadding: Integer;
|
||||||
|
PaneFullRowBottomPadding: Integer;
|
||||||
|
|
||||||
/// <summary>Wysokoœæ etykiet z nazwami zak³adek</summary>
|
/// <summary>Pane left padding, space between left pane border and left element border</summary>
|
||||||
TOOLBAR_TAB_CAPTIONS_HEIGHT = 22;
|
PaneLeftPadding: Integer;
|
||||||
/// <summary>Poziomy margines wewnêtrznego tytu³u zak³adki</summary>
|
/// <summary>Pane right padding, space between right pane border and right element border</summary>
|
||||||
TOOLBAR_TAB_CAPTIONS_TEXT_HPADDING = 4;
|
PaneRightPadding: Integer;
|
||||||
|
/// <summary>Space between two columns inside the pane</summary>
|
||||||
|
PaneColumnSpacer: Integer;
|
||||||
|
/// <summary>Space between groups on a row in pane</summary>
|
||||||
|
PaneGroupSpacer: Integer;
|
||||||
|
|
||||||
TOOLBAR_MIN_TAB_CAPTION_WIDTH = 32;
|
|
||||||
|
|
||||||
/// <summary>Sumaryczna wysokoϾ toolbara</summary>
|
// *******************
|
||||||
TOOLBAR_HEIGHT = TOOLBAR_TAB_CAPTIONS_HEIGHT +
|
// *** Pane layout ***
|
||||||
TAB_HEIGHT;
|
// *******************
|
||||||
|
|
||||||
|
/// <summary>Pane caption height</summary>
|
||||||
|
PaneCaptionHeight: Integer;
|
||||||
|
/// <summary>Pane corner radius</summary>
|
||||||
|
PaneCornerRadius: Integer;
|
||||||
|
/// <summary>Pane border size</summary>
|
||||||
|
/// <remarks>Do not change?</remarks>
|
||||||
|
PaneBorderSize: Integer;
|
||||||
|
/// <summary>Half width of pane border?</summary>
|
||||||
|
/// <remarks>Do not change?</remarks>
|
||||||
|
PaneBorderHalfSize: Integer;
|
||||||
|
/// <summary>Height of pane</summary>
|
||||||
|
PaneHeight: Integer;
|
||||||
|
/// <summary>Pane caption horizontal padding</summary>
|
||||||
|
PaneCaptionHMargin: Integer;
|
||||||
|
|
||||||
|
|
||||||
|
// ************
|
||||||
|
// *** Tabs ***
|
||||||
|
// ************
|
||||||
|
|
||||||
|
/// <summary>Tab corner radius</summary>
|
||||||
|
TabCornerRadius: Integer;
|
||||||
|
/// <summary>Tab page left margin</summary>
|
||||||
|
TabPaneLeftPadding: Integer;
|
||||||
|
/// <summary>Tab page right margin/summary>
|
||||||
|
TabPaneRightPadding: Integer;
|
||||||
|
/// <summary>Tab page top margin</summary>
|
||||||
|
TabPaneTopPadding: Integer;
|
||||||
|
/// <summary>Tab page bottom margin</summary>
|
||||||
|
TabPaneBottomPadding: Integer;
|
||||||
|
/// <summary>Space between panes</summary>
|
||||||
|
TabPaneHSpacing: Integer;
|
||||||
|
/// <summary>Tab border size</summary>
|
||||||
|
TabBorderSize: Integer;
|
||||||
|
/// <summary>Tab height</summary>
|
||||||
|
TabHeight: Integer;
|
||||||
|
|
||||||
|
|
||||||
|
// ***************
|
||||||
|
// *** Toolbar ***
|
||||||
|
// ***************
|
||||||
|
|
||||||
|
/// <summary>Pane padding?</summary>
|
||||||
|
ToolbarBorderWidth: Integer;
|
||||||
|
ToolbarCornerRadius: Integer;
|
||||||
|
/// <summary>Tab caption height</summary>
|
||||||
|
ToolbarTabCaptionsHeight: Integer;
|
||||||
|
/// <summary>Tab caption horizontal padding</summary>
|
||||||
|
ToolbarTabCaptionsTextHPadding: Integer;
|
||||||
|
ToolbarMinTabCaptionWidth: Integer;
|
||||||
|
/// <summary>Toolbar total height</summary>
|
||||||
|
ToolbarHeight: Integer;
|
||||||
|
|
||||||
|
|
||||||
|
const
|
||||||
|
DPI_AWARE = true;
|
||||||
|
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
|
uses
|
||||||
|
Graphics, LCLType;
|
||||||
|
|
||||||
|
procedure SpkInitLayoutConsts(FromDPI: Integer; ToDPI: Integer = 0);
|
||||||
|
begin
|
||||||
|
|
||||||
|
if not(DPI_AWARE) then
|
||||||
|
ToDPI := FromDPI;
|
||||||
|
|
||||||
|
{$IfDef Darwin}
|
||||||
|
ToDPI := FromDPI; //macOS raster scales by itself
|
||||||
|
{$EndIf}
|
||||||
|
|
||||||
|
LargeButtonDropdownFieldSize := SpkScaleX(LARGEBUTTON_DROPDOWN_FIELD_SIZE, FromDPI, ToDPI);
|
||||||
|
LargeButtonGlyphMargin := SpkScaleX(LARGEBUTTON_GLYPH_MARGIN, FromDPI, ToDPI);
|
||||||
|
LargeButtonCaptionHMargin := SpkScaleX(LARGEBUTTON_CAPTION_HMARGIN, FromDPI, ToDPI);
|
||||||
|
LargeButtonMinWidth := SpkScaleX(LARGEBUTTON_MIN_WIDTH, FromDPI, ToDPI);
|
||||||
|
LargeButtonRadius := LARGEBUTTON_RADIUS;
|
||||||
|
LargeButtonBorderSize := SpkScaleX(LARGEBUTTON_BORDER_SIZE, FromDPI, ToDPI);
|
||||||
|
LargeButtonChevronHMargin := SpkScaleX(LARGEBUTTON_CHEVRON_HMARGIN, FromDPI, ToDPI);
|
||||||
|
LargeButtonCaptionTopRail := SpkScaleY(LARGEBUTTON_CAPTION_TOP_RAIL, FromDPI, ToDPI);
|
||||||
|
LargeButtonCaptionButtomRail := SpkScaleY(LARGEBUTTON_CAPTION_BOTTOM_RAIL, FromDPI, ToDPI);
|
||||||
|
|
||||||
|
SmallButtonGlyphWidth := SpkScaleX(SMALLBUTTON_GLYPH_WIDTH, FromDPI, ToDPI);
|
||||||
|
SmallButtonBorderWidth := SpkScaleX(SMALLBUTTON_BORDER_WIDTH, FromDPI, ToDPI);
|
||||||
|
SmallButtonHalfBorderWidth := SpkScaleX(SMALLBUTTON_HALF_BORDER_WIDTH, FromDPI, ToDPI);
|
||||||
|
SmallButtonPadding := SpkScaleX(SMALLBUTTON_PADDING, FromDPI, ToDPI);
|
||||||
|
SmallButtonDropdownWidth := SpkScaleX(SMALLBUTTON_DROPDOWN_WIDTH, FromDPI, ToDPI);
|
||||||
|
SmallButtonRadius := SMALLBUTTON_RADIUS;
|
||||||
|
SmallButtonMinWidth := 2 * SmallButtonPadding + SmallButtonGlyphWidth;
|
||||||
|
|
||||||
|
MaxElementHeight := SpkScaleY(MAX_ELEMENT_HEIGHT, FromDPI, ToDPI);
|
||||||
|
PaneRowHeight := SpkScaleY(PANE_ROW_HEIGHT, FromDPI, ToDPI);
|
||||||
|
PaneFullRowHeight := 3 * PaneRowHeight;
|
||||||
|
PaneOneRowTopPadding := SpkScaleY(PANE_ONE_ROW_TOPPADDING, FromDPI, ToDPI);
|
||||||
|
PaneOneRowBottomPadding := SpkScaleY(PANE_ONE_ROW_BOTTOMPADDING, FromDPI, ToDPI);
|
||||||
|
PaneTwoRowsVSpacer := SpkScaleY(PANE_TWO_ROWS_VSPACER, FromDPI, ToDPI);
|
||||||
|
PaneTwoRowsTopPadding := SpkScaleY(PANE_TWO_ROWS_TOPPADDING, FromDPI, ToDPI);
|
||||||
|
PaneTwoRowsBottomPadding := SpkScaleY(PANE_TWO_ROWS_BOTTOMPADDING, FromDPI, ToDPI);
|
||||||
|
PaneThreeRowsVSpacer := SpkScaleY(PANE_THREE_ROWS_VSPACER, FromDPI, ToDPI);
|
||||||
|
PaneThreeRowsTopPadding := SpkScaleY(PANE_THREE_ROWS_TOPPADDING, FromDPI, ToDPI);
|
||||||
|
PaneThreeRowsBottomPadding := SpkScaleY(PANE_THREE_ROWS_BOTTOMPADDING, FromDPI, ToDPI);
|
||||||
|
PaneFullRowTopPadding := PaneThreeRowsTopPadding;
|
||||||
|
PaneFullRowBottomPadding := PaneThreeRowsBottomPadding;
|
||||||
|
PaneLeftPadding := SpkScaleX(PANE_LEFT_PADDING, FromDPI, ToDPI);
|
||||||
|
PaneRightPadding := SpkScaleX(PANE_RIGHT_PADDING, FromDPI, ToDPI);
|
||||||
|
PaneColumnSpacer := SpkScaleX(PANE_COLUMN_SPACER, FromDPI, ToDPI);
|
||||||
|
PaneGroupSpacer := SpkScaleX(PANE_GROUP_SPACER, FromDPI, ToDPI);
|
||||||
|
|
||||||
|
PaneCaptionHeight := SpkScaleY(PANE_CAPTION_HEIGHT, FromDPI, ToDPI);
|
||||||
|
PaneCornerRadius := PANE_CORNER_RADIUS;
|
||||||
|
PaneBorderSize := SpkScaleX(PANE_BORDER_SIZE, FromDPI, ToDPI);
|
||||||
|
PaneBorderHalfSize := SpkScaleX(PANE_BORDER_HALF_SIZE, FromDPI, ToDPI);
|
||||||
|
PaneHeight := MaxElementHeight + PaneCaptionHeight + 2 * PaneBorderSize;
|
||||||
|
PaneCaptionHMargin := SpkScaleX(PANE_CAPTION_HMARGIN, FromDPI, ToDPI);
|
||||||
|
|
||||||
|
TabCornerRadius := TAB_CORNER_RADIUS;
|
||||||
|
TabPaneLeftPadding := SpkScaleX(TAB_PANE_LEFTPADDING, FromDPI, ToDPI);
|
||||||
|
TabPaneRightPadding := SpkScaleX(TAB_PANE_RIGHTPADDING, FromDPI, ToDPI);
|
||||||
|
TabPaneTopPadding := SpkScaleY(TAB_PANE_TOPPADDING, FromDPI, ToDPI);
|
||||||
|
TabPaneBottomPadding := SpkScaleY(TAB_PANE_BOTTOMPADDING, FromDPI, ToDPI);
|
||||||
|
TabPaneHSpacing := SpkScaleX(TAB_PANE_HSPACING, FromDPI, ToDPI);
|
||||||
|
TabBorderSize := SpkScaleX(TAB_BORDER_SIZE, FromDPI, ToDPI);
|
||||||
|
TabHeight := PaneHeight + TabPaneTopPadding + TabPaneBottomPadding + TabBorderSize;
|
||||||
|
|
||||||
|
ToolbarBorderWidth := SpkScaleX(TOOLBAR_BORDER_WIDTH, FromDPI, ToDPI);
|
||||||
|
ToolbarCornerRadius := TOOLBAR_CORNER_RADIUS;
|
||||||
|
ToolbarTabCaptionsHeight := SpkScaleY(TOOLBAR_TAB_CAPTIONS_HEIGHT, FromDPI, ToDPI);
|
||||||
|
ToolbarTabCaptionsTextHPadding := SpkScaleX(TOOLBAR_TAB_CAPTIONS_TEXT_HPADDING, FromDPI, ToDPI);
|
||||||
|
ToolbarMinTabCaptionWidth := SpkScaleX(TOOLBAR_MIN_TAB_CAPTION_WIDTH, FromDPI, ToDPI);
|
||||||
|
ToolbarHeight := ToolbarTabCaptionsHeight + TabHeight;
|
||||||
|
|
||||||
|
// scaling radius if not square
|
||||||
|
if LargeButtonRadius > 1 then
|
||||||
|
LargeButtonRadius := SpkScaleX(LargeButtonRadius, FromDPI, ToDPI);
|
||||||
|
|
||||||
|
if SmallButtonRadius > 1 then
|
||||||
|
SmallButtonRadius := SpkScaleX(SmallButtonRadius, FromDPI, ToDPI);
|
||||||
|
|
||||||
|
if PaneCornerRadius > 1 then
|
||||||
|
PaneCornerRadius := SpkScaleX(PaneCornerRadius, FromDPI, ToDPI);
|
||||||
|
|
||||||
|
if TabCornerRadius > 1 then
|
||||||
|
TabCornerRadius := SpkScaleX(TabCornerRadius, FromDPI, ToDPI);
|
||||||
|
|
||||||
|
if ToolbarCornerRadius > 1 then
|
||||||
|
ToolbarCornerRadius := SpkScaleX(ToolbarCornerRadius, FromDPI, ToDPI);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function SpkScaleX(Size: Integer; FromDPI: Integer; ToDPI: Integer): integer;
|
||||||
|
begin
|
||||||
|
if ToDPI = 0 then
|
||||||
|
ToDPI := ScreenInfo.PixelsPerInchX;
|
||||||
|
|
||||||
|
if not(DPI_AWARE) or (ToDPI = FromDPI) then
|
||||||
|
Result := Size
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
if (ToDPI/FromDPI <= 1.5) and (Size = 1) then
|
||||||
|
Result := 1 //maintaining 1px on 150% scale for crispness
|
||||||
|
else
|
||||||
|
Result := MulDiv(Size, ToDPI, FromDPI);
|
||||||
|
end;
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
function SpkScaleY(Size: Integer; FromDPI: Integer; ToDPI: Integer): integer;
|
||||||
|
begin
|
||||||
|
if ToDPI = 0 then
|
||||||
|
ToDPI := ScreenInfo.PixelsPerInchY;
|
||||||
|
|
||||||
|
if not(DPI_AWARE) or (ToDPI = FromDPI) then
|
||||||
|
Result := Size
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
if (ToDPI/FromDPI <= 1.5) and (Size = 1) then
|
||||||
|
Result := 1 //maintaining 1px on 150% scale for crispness
|
||||||
|
else
|
||||||
|
Result := MulDiv(Size, ToDPI, FromDPI);
|
||||||
|
end;
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
|
|
||||||
{$IFDEF DEBUG}
|
{$IFDEF DEBUG}
|
||||||
|
@ -160,9 +160,9 @@ FRect:=ARect;
|
|||||||
Layout:=GenerateLayout;
|
Layout:=GenerateLayout;
|
||||||
|
|
||||||
{$IFDEF EnhancedRecordSupport}
|
{$IFDEF EnhancedRecordSupport}
|
||||||
Pt:=T2DIntPoint.create(ARect.left + PANE_BORDER_SIZE + PANE_LEFT_PADDING, ARect.top + PANE_BORDER_SIZE);
|
Pt:=T2DIntPoint.create(ARect.left + SpkLayoutSizes.PANE_BORDER_SIZE + SpkLayoutSizes.PANE_LEFT_PADDING, ARect.top + SpkLayoutSizes.PANE_BORDER_SIZE);
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
Pt.create(ARect.left + PANE_BORDER_SIZE + PANE_LEFT_PADDING, ARect.top + PANE_BORDER_SIZE);
|
Pt.create(ARect.left + PaneBorderSize + PaneLeftPadding, ARect.top + PaneBorderSize);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
if length(Layout.Rects)>0 then
|
if length(Layout.Rects)>0 then
|
||||||
@ -265,15 +265,15 @@ TGuiTools.DrawRoundRect(ABuffer.Canvas,
|
|||||||
{$IFDEF EnhancedRecordSupport}
|
{$IFDEF EnhancedRecordSupport}
|
||||||
T2DIntRect.Create(FRect.left,
|
T2DIntRect.Create(FRect.left,
|
||||||
FRect.top,
|
FRect.top,
|
||||||
FRect.right - PANE_BORDER_HALF_SIZE,
|
FRect.right - PaneBorderHalfSize,
|
||||||
FRect.Bottom - PANE_BORDER_HALF_SIZE),
|
FRect.Bottom - PaneBorderHalfSize),
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
Create2DIntRect(FRect.left,
|
Create2DIntRect(FRect.left,
|
||||||
FRect.top,
|
FRect.top,
|
||||||
FRect.right - PANE_BORDER_HALF_SIZE,
|
FRect.right - PaneBorderHalfSize,
|
||||||
FRect.Bottom - PANE_BORDER_HALF_SIZE),
|
FRect.Bottom - PaneBorderHalfSize),
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
PANE_CORNER_RADIUS,
|
PaneCornerRadius,
|
||||||
BgFromColor,
|
BgFromColor,
|
||||||
BgToColor,
|
BgToColor,
|
||||||
FAppearance.Pane.GradientType,
|
FAppearance.Pane.GradientType,
|
||||||
@ -283,16 +283,16 @@ TGuiTools.DrawRoundRect(ABuffer.Canvas,
|
|||||||
TGuiTools.DrawRoundRect(ABuffer.Canvas,
|
TGuiTools.DrawRoundRect(ABuffer.Canvas,
|
||||||
{$IFDEF EnhancedRecordSupport}
|
{$IFDEF EnhancedRecordSupport}
|
||||||
T2DIntRect.Create(FRect.Left,
|
T2DIntRect.Create(FRect.Left,
|
||||||
FRect.Bottom - PANE_CAPTION_HEIGHT - PANE_BORDER_HALF_SIZE,
|
FRect.Bottom - PaneCaptionHeight - PaneBorderHalfSize,
|
||||||
FRect.right - PANE_BORDER_HALF_SIZE,
|
FRect.right - PaneBorderHalfSize,
|
||||||
FRect.bottom - PANE_BORDER_HALF_SIZE),
|
FRect.bottom - PaneBorderHalfSize),
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
Create2DIntRect(FRect.Left,
|
Create2DIntRect(FRect.Left,
|
||||||
FRect.Bottom - PANE_CAPTION_HEIGHT - PANE_BORDER_HALF_SIZE,
|
FRect.Bottom - PaneCaptionHeight - PaneBorderHalfSize,
|
||||||
FRect.right - PANE_BORDER_HALF_SIZE,
|
FRect.Right - PaneBorderHalfSize,
|
||||||
FRect.bottom - PANE_BORDER_HALF_SIZE),
|
FRect.Bottom - PaneBorderHalfSize),
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
PANE_CORNER_RADIUS,
|
PaneCornerRadius,
|
||||||
CaptionColor,
|
CaptionColor,
|
||||||
clNone,
|
clNone,
|
||||||
bkSolid,
|
bkSolid,
|
||||||
@ -305,8 +305,8 @@ TGuiTools.DrawRoundRect(ABuffer.Canvas,
|
|||||||
// Etykieta tafli
|
// Etykieta tafli
|
||||||
ABuffer.Canvas.Font.assign(FAppearance.Pane.CaptionFont);
|
ABuffer.Canvas.Font.assign(FAppearance.Pane.CaptionFont);
|
||||||
x:=FRect.left + (FRect.width - ABuffer.Canvas.TextWidth(FCaption)) div 2;
|
x:=FRect.left + (FRect.width - ABuffer.Canvas.TextWidth(FCaption)) div 2;
|
||||||
y:=FRect.Bottom - PANE_BORDER_SIZE - PANE_CAPTION_HEIGHT + 1 +
|
y:=FRect.Bottom - PaneBorderSize - PaneCaptionHeight + 1 +
|
||||||
(PANE_CAPTION_HEIGHT - ABuffer.Canvas.TextHeight('Wy')) div 2;
|
(PaneCaptionHeight - ABuffer.Canvas.TextHeight('Wy')) div 2;
|
||||||
|
|
||||||
TGUITools.DrawText(ABuffer.Canvas,
|
TGUITools.DrawText(ABuffer.Canvas,
|
||||||
x,
|
x,
|
||||||
@ -328,7 +328,7 @@ TGUITools.DrawAARoundFrame(ABuffer,
|
|||||||
FRect.Right,
|
FRect.Right,
|
||||||
FRect.bottom),
|
FRect.bottom),
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
PANE_CORNER_RADIUS,
|
PaneCornerRadius,
|
||||||
BorderLightColor,
|
BorderLightColor,
|
||||||
ClipRect);
|
ClipRect);
|
||||||
TGUITools.DrawAARoundFrame(ABuffer,
|
TGUITools.DrawAARoundFrame(ABuffer,
|
||||||
@ -343,7 +343,7 @@ TGUITools.DrawAARoundFrame(ABuffer,
|
|||||||
FRect.Right-1,
|
FRect.Right-1,
|
||||||
FRect.bottom-1),
|
FRect.bottom-1),
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
PANE_CORNER_RADIUS,
|
PaneCornerRadius,
|
||||||
BorderDarkColor,
|
BorderDarkColor,
|
||||||
ClipRect);
|
ClipRect);
|
||||||
|
|
||||||
@ -498,7 +498,7 @@ if length(Layout)>0 then
|
|||||||
begin
|
begin
|
||||||
if c>0 then
|
if c>0 then
|
||||||
begin
|
begin
|
||||||
LastX:=MaxRowX + PANE_COLUMN_SPACER;
|
LastX:=MaxRowX + PaneColumnSpacer;
|
||||||
MaxRowX:=LastX;
|
MaxRowX:=LastX;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@ -523,8 +523,8 @@ if length(Layout)>0 then
|
|||||||
|
|
||||||
if ItemSize = isLarge then
|
if ItemSize = isLarge then
|
||||||
begin
|
begin
|
||||||
tmpRect.top:=PANE_FULL_ROW_TOPPADDING;
|
tmpRect.top:=PaneFullRowTopPadding;
|
||||||
tmpRect.bottom:=tmpRect.top + PANE_FULL_ROW_HEIGHT - 1;
|
tmpRect.bottom:=tmpRect.top + PaneFullRowHeight - 1;
|
||||||
tmpRect.left:=LastX;
|
tmpRect.left:=LastX;
|
||||||
tmpRect.right:=LastX + ItemWidth - 1;
|
tmpRect.right:=LastX + ItemWidth - 1;
|
||||||
|
|
||||||
@ -544,7 +544,7 @@ if length(Layout)>0 then
|
|||||||
// Jeœli element nie jest pierwszy, musi zostaæ
|
// Jeœli element nie jest pierwszy, musi zostaæ
|
||||||
// odsuniêty marginesem od poprzedniego
|
// odsuniêty marginesem od poprzedniego
|
||||||
if i>0 then
|
if i>0 then
|
||||||
tmpRect.Left:=LastX + PANE_GROUP_SPACER else
|
tmpRect.Left:=LastX + PaneGroupSpacer else
|
||||||
tmpRect.Left:=LastX;
|
tmpRect.Left:=LastX;
|
||||||
tmpRect.right:=tmpRect.Left + ItemWidth - 1;
|
tmpRect.right:=tmpRect.Left + ItemWidth - 1;
|
||||||
end;
|
end;
|
||||||
@ -552,34 +552,34 @@ if length(Layout)>0 then
|
|||||||
{$REGION 'Obliczanie tmpRect.top i bottom'}
|
{$REGION 'Obliczanie tmpRect.top i bottom'}
|
||||||
case rows of
|
case rows of
|
||||||
1 : begin
|
1 : begin
|
||||||
tmpRect.top:=PANE_ONE_ROW_TOPPADDING;
|
tmpRect.top:=PaneOneRowTopPadding;
|
||||||
tmpRect.bottom:=tmpRect.top + PANE_ROW_HEIGHT - 1;
|
tmpRect.bottom:=tmpRect.top + PaneRowHeight - 1;
|
||||||
end;
|
end;
|
||||||
2 : begin
|
2 : begin
|
||||||
case r of
|
case r of
|
||||||
0 : begin
|
0 : begin
|
||||||
tmpRect.top:=PANE_TWO_ROWS_TOPPADDING;
|
tmpRect.top:=PaneTwoRowsTopPadding;
|
||||||
tmpRect.bottom:=tmpRect.top + PANE_ROW_HEIGHT - 1;
|
tmpRect.bottom:=tmpRect.top + PaneRowHeight - 1;
|
||||||
end;
|
end;
|
||||||
1 : begin
|
1 : begin
|
||||||
tmpRect.top:=PANE_TWO_ROWS_TOPPADDING + PANE_ROW_HEIGHT + PANE_TWO_ROWS_VSPACER;
|
tmpRect.top:=PaneTwoRowsTopPadding + PaneRowHeight + PaneTwoRowsVSpacer;
|
||||||
tmpRect.bottom:=tmpRect.top + PANE_ROW_HEIGHT - 1;
|
tmpRect.bottom:=tmpRect.top + PaneRowHeight - 1;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
3 : begin
|
3 : begin
|
||||||
case r of
|
case r of
|
||||||
0 : begin
|
0 : begin
|
||||||
tmpRect.top:=PANE_THREE_ROWS_TOPPADDING;
|
tmpRect.top:=PaneThreeRowsTopPadding;
|
||||||
tmpRect.bottom:=tmpRect.top + PANE_ROW_HEIGHT - 1;
|
tmpRect.bottom:=tmpRect.top + PaneRowHeight - 1;
|
||||||
end;
|
end;
|
||||||
1 : begin
|
1 : begin
|
||||||
tmpRect.top:=PANE_THREE_ROWS_TOPPADDING + PANE_ROW_HEIGHT + PANE_THREE_ROWS_VSPACER;
|
tmpRect.top:=PaneThreeRowsTopPadding + PaneRowHeight + PaneThreeRowsVSpacer;
|
||||||
tmpRect.bottom:=tmpRect.top + PANE_ROW_HEIGHT - 1;
|
tmpRect.bottom:=tmpRect.top + PaneRowHeight - 1;
|
||||||
end;
|
end;
|
||||||
2 : begin
|
2 : begin
|
||||||
tmpRect.top:=PANE_THREE_ROWS_TOPPADDING + 2 * PANE_ROW_HEIGHT + 2 * PANE_THREE_ROWS_VSPACER;
|
tmpRect.top:=PaneThreeRowsTopPadding + 2 * PaneRowHeight + 2 * PaneThreeRowsVSpacer;
|
||||||
tmpRect.bottom:=tmpRect.top + PANE_ROW_HEIGHT - 1;
|
tmpRect.bottom:=tmpRect.top + PaneRowHeight - 1;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -634,14 +634,12 @@ tmpBitmap.Canvas.font.assign(FAppearance.Pane.CaptionFont);
|
|||||||
|
|
||||||
// *** Minimalna szerokoϾ tafli (tekstu) ***
|
// *** Minimalna szerokoϾ tafli (tekstu) ***
|
||||||
TextW:=tmpBitmap.Canvas.TextWidth(FCaption);
|
TextW:=tmpBitmap.Canvas.TextWidth(FCaption);
|
||||||
PaneCaptionWidth:=2*PANE_BORDER_SIZE +
|
PaneCaptionWidth := 2*PaneBorderSize + 2*PaneCaptionHMargin + TextW;
|
||||||
2*PANE_CAPTION_HMARGIN +
|
|
||||||
TextW;
|
|
||||||
|
|
||||||
// *** Szerokoœæ elementów tafli ***
|
// *** Szerokoœæ elementów tafli ***
|
||||||
Layout:=GenerateLayout;
|
Layout:=GenerateLayout;
|
||||||
ElementsW:=Layout.Width;
|
ElementsW:=Layout.Width;
|
||||||
PaneElementsWidth:=PANE_BORDER_SIZE + PANE_LEFT_PADDING + ElementsW + PANE_RIGHT_PADDING + PANE_BORDER_SIZE;
|
PaneElementsWidth:=PaneBorderSize + PaneLeftPadding + ElementsW + PaneRightPadding + PaneBorderSize;
|
||||||
|
|
||||||
// *** Ustawianie szerokoœci tafli ***
|
// *** Ustawianie szerokoœci tafli ***
|
||||||
result:=max(PaneCaptionWidth, PaneElementsWidth);
|
result:=max(PaneCaptionWidth, PaneElementsWidth);
|
||||||
|
@ -226,7 +226,7 @@ if AtLeastOnePaneVisible then
|
|||||||
|
|
||||||
FPanes[i].Rect:=tmpRect;
|
FPanes[i].Rect:=tmpRect;
|
||||||
|
|
||||||
x:=x + tw + TAB_PANE_HSPACING;
|
x:=x + tw + TabPaneHSpacing;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
|
Reference in New Issue
Block a user