mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-31 17:01:38 +02:00
lcl: fonts:
- add TScreen.IconFont, TScreen.MenuFont, TScreen.SystemFont - replace TWidgetset.InitHintFont with TWidgetset.InitStockFont win32, wince: retrieve default font from SystemParametersInfo as described in issue #0013848 git-svn-id: trunk@20275 -
This commit is contained in:
parent
faabdd53fd
commit
077b9c0616
16
lcl/forms.pp
16
lcl/forms.pp
@ -852,6 +852,8 @@ type
|
|||||||
FFonts : TStrings;
|
FFonts : TStrings;
|
||||||
FFormList: TList;
|
FFormList: TList;
|
||||||
FDataModuleList: TList;
|
FDataModuleList: TList;
|
||||||
|
FIconFont: TFont;
|
||||||
|
FMenuFont: TFont;
|
||||||
FScreenHandlers: array[TScreenNotification] of TMethodList;
|
FScreenHandlers: array[TScreenNotification] of TMethodList;
|
||||||
FLastActiveControl: TWinControl;
|
FLastActiveControl: TWinControl;
|
||||||
FLastActiveCustomForm: TCustomForm;
|
FLastActiveCustomForm: TCustomForm;
|
||||||
@ -860,6 +862,7 @@ type
|
|||||||
FOnActiveFormChange: TNotifyEvent;
|
FOnActiveFormChange: TNotifyEvent;
|
||||||
FPixelsPerInch : integer;
|
FPixelsPerInch : integer;
|
||||||
FSaveFocusedList: TList;
|
FSaveFocusedList: TList;
|
||||||
|
FSystemFont: TFont;
|
||||||
procedure DeleteCursor(AIndex: Integer);
|
procedure DeleteCursor(AIndex: Integer);
|
||||||
procedure DestroyCursors;
|
procedure DestroyCursors;
|
||||||
procedure DestroyMonitors;
|
procedure DestroyMonitors;
|
||||||
@ -884,6 +887,10 @@ type
|
|||||||
procedure RemoveForm(AForm: TCustomForm);
|
procedure RemoveForm(AForm: TCustomForm);
|
||||||
procedure SetCursor(const AValue: TCursor);
|
procedure SetCursor(const AValue: TCursor);
|
||||||
procedure SetCursors(AIndex: Integer; const AValue: HCURSOR);
|
procedure SetCursors(AIndex: Integer; const AValue: HCURSOR);
|
||||||
|
procedure SetHintFont(const AValue: TFont);
|
||||||
|
procedure SetIconFont(const AValue: TFont);
|
||||||
|
procedure SetMenuFont(const AValue: TFont);
|
||||||
|
procedure SetSystemFont(const AValue: TFont);
|
||||||
procedure UpdateLastActive;
|
procedure UpdateLastActive;
|
||||||
procedure UpdateMonitors;
|
procedure UpdateMonitors;
|
||||||
procedure RestoreLastActive;
|
procedure RestoreLastActive;
|
||||||
@ -895,6 +902,9 @@ type
|
|||||||
procedure DoRemoveDataModule(DataModule: TDataModule);
|
procedure DoRemoveDataModule(DataModule: TDataModule);
|
||||||
protected
|
protected
|
||||||
function GetHintFont: TFont; virtual;
|
function GetHintFont: TFont; virtual;
|
||||||
|
function GetIconFont: TFont; virtual;
|
||||||
|
function GetMenuFont: TFont; virtual;
|
||||||
|
function GetSystemFont: TFont; virtual;
|
||||||
public
|
public
|
||||||
constructor Create(AOwner : TComponent); override;
|
constructor Create(AOwner : TComponent); override;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
@ -955,9 +965,13 @@ type
|
|||||||
property DataModuleCount: Integer read GetDataModuleCount;
|
property DataModuleCount: Integer read GetDataModuleCount;
|
||||||
property DataModules[Index: Integer]: TDataModule read GetDataModules;
|
property DataModules[Index: Integer]: TDataModule read GetDataModules;
|
||||||
|
|
||||||
|
property HintFont: TFont read GetHintFont write SetHintFont;
|
||||||
|
property IconFont: TFont read GetIconFont write SetIconFont;
|
||||||
|
property MenuFont: TFont read GetMenuFont write SetMenuFont;
|
||||||
|
property SystemFont: TFont read GetSystemFont write SetSystemFont;
|
||||||
property Fonts: TStrings read GetFonts;
|
property Fonts: TStrings read GetFonts;
|
||||||
|
|
||||||
property Height: Integer read Getheight;
|
property Height: Integer read Getheight;
|
||||||
property HintFont: TFont read GetHintFont;
|
|
||||||
property MonitorCount: Integer read GetMonitorCount;
|
property MonitorCount: Integer read GetMonitorCount;
|
||||||
property Monitors[Index: Integer]: TMonitor read GetMonitor;
|
property Monitors[Index: Integer]: TMonitor read GetMonitor;
|
||||||
property PixelsPerInch: integer read FPixelsPerInch;
|
property PixelsPerInch: integer read FPixelsPerInch;
|
||||||
|
@ -491,7 +491,7 @@ type
|
|||||||
procedure FreeReference;
|
procedure FreeReference;
|
||||||
function GetCanUTF8: boolean;
|
function GetCanUTF8: boolean;
|
||||||
function GetHandle: HFONT;
|
function GetHandle: HFONT;
|
||||||
procedure GetData(var FontData: TFontData);
|
function GetData: TFontData;
|
||||||
function GetIsMonoSpace: boolean;
|
function GetIsMonoSpace: boolean;
|
||||||
function GetReference: TWSFontReference;
|
function GetReference: TWSFontReference;
|
||||||
function IsHeightStored: boolean;
|
function IsHeightStored: boolean;
|
||||||
@ -530,6 +530,7 @@ type
|
|||||||
procedure Assign(const ALogFont: TLogFont);
|
procedure Assign(const ALogFont: TLogFont);
|
||||||
procedure BeginUpdate;
|
procedure BeginUpdate;
|
||||||
procedure EndUpdate;
|
procedure EndUpdate;
|
||||||
|
property FontData: TFontData read GetData write SetData;
|
||||||
function HandleAllocated: boolean;
|
function HandleAllocated: boolean;
|
||||||
property Handle: HFONT read GetHandle write SetHandle; deprecated;
|
property Handle: HFONT read GetHandle write SetHandle; deprecated;
|
||||||
function IsDefault: boolean;
|
function IsDefault: boolean;
|
||||||
@ -1774,6 +1775,7 @@ function TColorToFPColor(const c: TColor): TFPColor;
|
|||||||
procedure GetCharsetValues(Proc: TGetStrProc);
|
procedure GetCharsetValues(Proc: TGetStrProc);
|
||||||
function CharsetToIdent(Charset: Longint; var Ident: string): Boolean;
|
function CharsetToIdent(Charset: Longint; var Ident: string): Boolean;
|
||||||
function IdentToCharset(const Ident: string; var Charset: Longint): Boolean;
|
function IdentToCharset(const Ident: string; var Charset: Longint): Boolean;
|
||||||
|
function GetFontData(Font: HFont): TFontData;
|
||||||
|
|
||||||
function GetDefFontCharSet: TFontCharSet;
|
function GetDefFontCharSet: TFontCharSet;
|
||||||
function IsFontNameXLogicalFontDesc(const LongFontName: string): boolean;
|
function IsFontNameXLogicalFontDesc(const LongFontName: string): boolean;
|
||||||
|
@ -1199,16 +1199,19 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TFont.GetData(var FontData: TFontData);
|
function TFont.GetData: TFontData;
|
||||||
begin
|
begin
|
||||||
FontData := DefFontData;
|
Result := DefFontData;
|
||||||
FontData.Handle := 0;
|
if HandleAllocated then
|
||||||
FontData.Height := Height;
|
Result.Handle := Reference.Handle
|
||||||
FontData.Pitch := Pitch;
|
else
|
||||||
FontData.Style := Style;
|
Result.Handle := 0;
|
||||||
FontData.CharSet := CharSet;
|
Result.Height := Height;
|
||||||
FontData.Quality := Quality;
|
Result.Pitch := Pitch;
|
||||||
FontData.Name := LeftStr(Name, SizeOf(FontData.Name) - 1);
|
Result.Style := Style;
|
||||||
|
Result.CharSet := CharSet;
|
||||||
|
Result.Quality := Quality;
|
||||||
|
Result.Name := LeftStr(Name, SizeOf(Result.Name) - 1);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TFont.GetIsMonoSpace: boolean;
|
function TFont.GetIsMonoSpace: boolean;
|
||||||
|
@ -1052,9 +1052,9 @@ begin
|
|||||||
Result := False;
|
Result := False;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TWidgetSet.InitHintFont(HintFont: TObject): Boolean;
|
function TWidgetSet.InitStockFont(AFont: TObject; AStockFont: TStockFont): Boolean;
|
||||||
begin
|
begin
|
||||||
Result := false;
|
Result := False;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TWidgetSet.IsHelpKey(Key: Word; Shift: TShiftState): Boolean;
|
function TWidgetSet.IsHelpKey(Key: Word; Shift: TShiftState): Boolean;
|
||||||
|
@ -91,6 +91,9 @@ begin
|
|||||||
for HandlerType := Low(FScreenHandlers) to High(FScreenHandlers) do
|
for HandlerType := Low(FScreenHandlers) to High(FScreenHandlers) do
|
||||||
FreeThenNil(FScreenHandlers[HandlerType]);
|
FreeThenNil(FScreenHandlers[HandlerType]);
|
||||||
FreeThenNil(FHintFont);
|
FreeThenNil(FHintFont);
|
||||||
|
FreeThenNil(FIconFont);
|
||||||
|
FreeThenNil(FMenuFont);
|
||||||
|
FreeThenNil(FSystemFont);
|
||||||
FreeThenNil(FDataModuleList);
|
FreeThenNil(FDataModuleList);
|
||||||
FreeThenNil(FFormList);
|
FreeThenNil(FFormList);
|
||||||
FreeThenNil(FCustomForms);
|
FreeThenNil(FCustomForms);
|
||||||
@ -663,22 +666,54 @@ begin
|
|||||||
Result := nil;
|
Result := nil;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TScreen.GetSystemFont: TFont;
|
||||||
|
begin
|
||||||
|
if (FSystemFont = nil) then
|
||||||
|
FSystemFont := TFont.Create;
|
||||||
|
if not WidgetSet.InitStockFont(FSystemFont, sfSystem) then
|
||||||
|
begin
|
||||||
|
FSystemFont.FontData := DefFontData;
|
||||||
|
FSystemFont.Color := clWindowText;
|
||||||
|
end;
|
||||||
|
Result := FSystemFont;
|
||||||
|
end;
|
||||||
|
|
||||||
function TScreen.GetHintFont: TFont;
|
function TScreen.GetHintFont: TFont;
|
||||||
begin
|
begin
|
||||||
if (FHintFont = nil) then
|
if (FHintFont = nil) then
|
||||||
FHintFont := TFont.Create;
|
FHintFont := TFont.Create;
|
||||||
if not WidgetSet.InitHintFont(FHintFont) then
|
if not WidgetSet.InitStockFont(FHintFont, sfHint) then
|
||||||
begin
|
begin
|
||||||
// FHintFont.Name := 'courier';
|
FHintFont.FontData := DefFontData;
|
||||||
FHintFont.Name:=DefFontData.Name;
|
|
||||||
FHintFont.Style := [];
|
|
||||||
FHintFont.Size := DefFontData.Height;
|
|
||||||
FHintFont.Color := clInfoText;
|
FHintFont.Color := clInfoText;
|
||||||
FHintFont.Pitch := fpDefault;
|
|
||||||
end;
|
end;
|
||||||
Result := FHintFont;
|
Result := FHintFont;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TScreen.GetIconFont: TFont;
|
||||||
|
begin
|
||||||
|
if (FIconFont = nil) then
|
||||||
|
FIconFont := TFont.Create;
|
||||||
|
if not WidgetSet.InitStockFont(FIconFont, sfIcon) then
|
||||||
|
begin
|
||||||
|
FIconFont.FontData := DefFontData;
|
||||||
|
FIconFont.Color := clWindowText;
|
||||||
|
end;
|
||||||
|
Result := FIconFont;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TScreen.GetMenuFont: TFont;
|
||||||
|
begin
|
||||||
|
if (FMenuFont = nil) then
|
||||||
|
FMenuFont := TFont.Create;
|
||||||
|
if not WidgetSet.InitStockFont(FMenuFont, sfMenu) then
|
||||||
|
begin
|
||||||
|
FMenuFont.FontData := DefFontData;
|
||||||
|
FMenuFont.Color := clMenuText;
|
||||||
|
end;
|
||||||
|
Result := FMenuFont;
|
||||||
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
|
|
||||||
Function: TScreen.RemoveForm
|
Function: TScreen.RemoveForm
|
||||||
@ -733,6 +768,26 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TScreen.SetHintFont(const AValue: TFont);
|
||||||
|
begin
|
||||||
|
FHintFont.Assign(AValue);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TScreen.SetIconFont(const AValue: TFont);
|
||||||
|
begin
|
||||||
|
FIconFont.Assign(AValue);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TScreen.SetMenuFont(const AValue: TFont);
|
||||||
|
begin
|
||||||
|
FMenuFont.Assign(AValue);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TScreen.SetSystemFont(const AValue: TFont);
|
||||||
|
begin
|
||||||
|
FSystemFont.Assign(AValue);
|
||||||
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
procedure TScreen.UpdateLastActive;
|
procedure TScreen.UpdateLastActive;
|
||||||
------------------------------------------------------------------------------}
|
------------------------------------------------------------------------------}
|
||||||
|
@ -111,7 +111,7 @@ type
|
|||||||
procedure DCSetAntialiasing(CanvasHandle: HDC; AEnabled: Boolean); virtual;
|
procedure DCSetAntialiasing(CanvasHandle: HDC; AEnabled: Boolean); virtual;
|
||||||
procedure SetDesigning(AComponent: TComponent); virtual; abstract;
|
procedure SetDesigning(AComponent: TComponent); virtual; abstract;
|
||||||
|
|
||||||
function InitHintFont(HintFont: TObject): Boolean; virtual;
|
function InitStockFont(AFont: TObject; AStockFont: TStockFont): Boolean; virtual;
|
||||||
function IsHelpKey(Key: Word; Shift: TShiftState): Boolean; virtual;
|
function IsHelpKey(Key: Word; Shift: TShiftState): Boolean; virtual;
|
||||||
|
|
||||||
// create and destroy
|
// create and destroy
|
||||||
|
@ -72,9 +72,6 @@ type
|
|||||||
procedure DCRedraw(CanvasHandle: HDC); override;
|
procedure DCRedraw(CanvasHandle: HDC); override;
|
||||||
procedure SetDesigning(AComponent: TComponent); override;
|
procedure SetDesigning(AComponent: TComponent); override;
|
||||||
|
|
||||||
function InitHintFont(HintFont: TObject): Boolean; override;
|
|
||||||
|
|
||||||
|
|
||||||
// create and destroy
|
// create and destroy
|
||||||
function CreateTimer(Interval: integer; TimerFunc: TFNTimerProc): THandle; override;
|
function CreateTimer(Interval: integer; TimerFunc: TFNTimerProc): THandle; override;
|
||||||
function DestroyTimer(TimerHandle: THandle): boolean; override;
|
function DestroyTimer(TimerHandle: THandle): boolean; override;
|
||||||
|
@ -193,11 +193,6 @@ begin
|
|||||||
// Include(AComponent.ComponentState, csDesigning);
|
// Include(AComponent.ComponentState, csDesigning);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TFpGuiWidgetSet.InitHintFont(HintFont: TObject): Boolean;
|
|
||||||
begin
|
|
||||||
Result:=false;
|
|
||||||
end;
|
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
Function: TFpGuiWidgetSet.IsValidDC
|
Function: TFpGuiWidgetSet.IsValidDC
|
||||||
Params: DC - handle to a device context (TFpGuiDeviceContext)
|
Params: DC - handle to a device context (TFpGuiDeviceContext)
|
||||||
|
@ -113,8 +113,6 @@ type
|
|||||||
procedure DCSetAntialiasing(CanvasHandle: HDC; AEnabled: Boolean); override;
|
procedure DCSetAntialiasing(CanvasHandle: HDC; AEnabled: Boolean); override;
|
||||||
procedure SetDesigning(AComponent: TComponent); override;
|
procedure SetDesigning(AComponent: TComponent); override;
|
||||||
|
|
||||||
function InitHintFont(HintFont: TObject): Boolean; override;
|
|
||||||
|
|
||||||
// create and destroy
|
// create and destroy
|
||||||
function CreateTimer(Interval: integer; TimerFunc: TFNTimerProc): THandle; override;
|
function CreateTimer(Interval: integer; TimerFunc: TFNTimerProc): THandle; override;
|
||||||
function DestroyTimer(TimerHandle: THandle): boolean; override;
|
function DestroyTimer(TimerHandle: THandle): boolean; override;
|
||||||
|
@ -433,11 +433,6 @@ begin
|
|||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TQtWidgetSet.InitHintFont(HintFont: TObject): Boolean;
|
|
||||||
begin
|
|
||||||
Result := False;
|
|
||||||
end;
|
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
Function: TQtWidgetSet.IsValidDC
|
Function: TQtWidgetSet.IsValidDC
|
||||||
Params: DC - handle to a device context (TQtDeviceContext)
|
Params: DC - handle to a device context (TQtDeviceContext)
|
||||||
|
@ -127,6 +127,7 @@ type
|
|||||||
|
|
||||||
FMetrics: TNonClientMetrics;
|
FMetrics: TNonClientMetrics;
|
||||||
FMetricsFailed: Boolean;
|
FMetricsFailed: Boolean;
|
||||||
|
FDefaultFont: HFONT;
|
||||||
|
|
||||||
FWaitHandleCount: dword;
|
FWaitHandleCount: dword;
|
||||||
FWaitHandles: array of HANDLE;
|
FWaitHandles: array of HANDLE;
|
||||||
@ -175,8 +176,8 @@ type
|
|||||||
procedure AppSetTitle(const ATitle: string); override;
|
procedure AppSetTitle(const ATitle: string); override;
|
||||||
procedure AppSetVisible(const AVisible: Boolean); override;
|
procedure AppSetVisible(const AVisible: Boolean); override;
|
||||||
|
|
||||||
function InitHintFont(HintFont: TObject): Boolean; Override;
|
function InitStockFont(AFont: TObject; AStockFont: TStockFont): Boolean; override;
|
||||||
procedure AttachMenuToWindow(AMenuObject: TComponent); Override;
|
procedure AttachMenuToWindow(AMenuObject: TComponent); override;
|
||||||
|
|
||||||
procedure DCSetPixel(CanvasHandle: HDC; X, Y: integer; AColor: TGraphicsColor); override;
|
procedure DCSetPixel(CanvasHandle: HDC; X, Y: integer; AColor: TGraphicsColor); override;
|
||||||
function DCGetPixel(CanvasHandle: HDC; X, Y: integer): TGraphicsColor; override;
|
function DCGetPixel(CanvasHandle: HDC; X, Y: integer): TGraphicsColor; override;
|
||||||
@ -192,6 +193,7 @@ type
|
|||||||
// thread synchronize support
|
// thread synchronize support
|
||||||
procedure HandleWakeMainThread(Sender: TObject);
|
procedure HandleWakeMainThread(Sender: TObject);
|
||||||
function AppHandle: THandle; override;
|
function AppHandle: THandle; override;
|
||||||
|
property DefaultFont: HFONT read FDefaultFont;
|
||||||
|
|
||||||
{$I win32winapih.inc}
|
{$I win32winapih.inc}
|
||||||
{$I win32lclintfh.inc}
|
{$I win32lclintfh.inc}
|
||||||
|
@ -39,6 +39,11 @@ begin
|
|||||||
if FMetricsFailed then
|
if FMetricsFailed then
|
||||||
begin
|
begin
|
||||||
FMetrics.iMenuHeight := GetSystemMetrics(SM_CYMENU);
|
FMetrics.iMenuHeight := GetSystemMetrics(SM_CYMENU);
|
||||||
|
FDefaultFont := GetStockObject(DEFAULT_GUI_FONT);
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
FDefaultFont := Windows.CreateFontIndirect(FMetrics.lfMessageFont);
|
||||||
end;
|
end;
|
||||||
OnClipBoardRequest := nil;
|
OnClipBoardRequest := nil;
|
||||||
Pointer(InitCommonControlsEx) := GetProcAddress(GetModuleHandle(comctl32), 'InitCommonControlsEx');
|
Pointer(InitCommonControlsEx) := GetProcAddress(GetModuleHandle(comctl32), 'InitCommonControlsEx');
|
||||||
@ -91,6 +96,9 @@ begin
|
|||||||
Windows.UnregisterClass(@ClsName, System.HInstance);
|
Windows.UnregisterClass(@ClsName, System.HInstance);
|
||||||
Windows.UnregisterClass(@ClsHintName, System.HInstance);
|
Windows.UnregisterClass(@ClsHintName, System.HInstance);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
if FDefaultFont <> 0 then
|
||||||
|
Windows.DeleteObject(FDefaultFont);
|
||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -270,14 +278,48 @@ begin
|
|||||||
if Window = 0 then Exit;
|
if Window = 0 then Exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TWin32WidgetSet.InitHintFont(HintFont: TObject): Boolean;
|
function TWin32WidgetSet.InitStockFont(AFont: TObject; AStockFont: TStockFont): Boolean;
|
||||||
|
var
|
||||||
|
Font: TFont absolute AFont;
|
||||||
|
LogFont: TLogFont;
|
||||||
|
|
||||||
|
procedure AssignDefault;
|
||||||
|
var
|
||||||
|
LogFont: TLogFont;
|
||||||
begin
|
begin
|
||||||
TFont(HintFont).Name := FMetrics.lfStatusFont.lfFaceName;
|
GetObject(DefaultFont, SizeOf(LogFont), @LogFont);
|
||||||
TFont(HintFont).Style := [];
|
Font.Assign(LogFont);
|
||||||
TFont(HintFont).Height := FMetrics.lfStatusFont.lfHeight;
|
end;
|
||||||
TFont(HintFont).Color := clInfoText;
|
|
||||||
TFont(HintFont).Pitch := fpDefault;
|
begin
|
||||||
Result := true;
|
case AStockFont of
|
||||||
|
sfSystem:
|
||||||
|
Font.FontData := GetFontData(DefaultFont);
|
||||||
|
sfHint:
|
||||||
|
begin
|
||||||
|
if FMetricsFailed then
|
||||||
|
AssignDefault
|
||||||
|
else
|
||||||
|
Font.Assign(FMetrics.lfStatusFont);
|
||||||
|
Font.Color := clInfoText;
|
||||||
|
end;
|
||||||
|
sfIcon:
|
||||||
|
begin
|
||||||
|
if SystemParametersInfo(SPI_GETICONTITLELOGFONT, SizeOf(LogFont), @LogFont, 0) then
|
||||||
|
Font.Assign(LogFont)
|
||||||
|
else
|
||||||
|
AssignDefault
|
||||||
|
end;
|
||||||
|
sfMenu:
|
||||||
|
begin
|
||||||
|
if FMetricsFailed then
|
||||||
|
AssignDefault
|
||||||
|
else
|
||||||
|
Font.Assign(FMetrics.lfMenuFont);
|
||||||
|
Font.Color := clMenuText;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
Result := True;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
|
@ -248,7 +248,7 @@ begin
|
|||||||
WindowInfo^.DefWndProc := Windows.WNDPROC(SetWindowLong(
|
WindowInfo^.DefWndProc := Windows.WNDPROC(SetWindowLong(
|
||||||
Window, GWL_WNDPROC, PtrInt(SubClassWndProc)));
|
Window, GWL_WNDPROC, PtrInt(SubClassWndProc)));
|
||||||
if AWinControl.Font.IsDefault then
|
if AWinControl.Font.IsDefault then
|
||||||
lhFont := GetStockObject(DEFAULT_GUI_FONT)
|
lhFont := Win32WidgetSet.DefaultFont
|
||||||
else
|
else
|
||||||
lhFont := AWinControl.Font.Reference.Handle;
|
lhFont := AWinControl.Font.Reference.Handle;
|
||||||
Windows.SendMessage(Window, WM_SETFONT, WPARAM(lhFont), 0);
|
Windows.SendMessage(Window, WM_SETFONT, WPARAM(lhFont), 0);
|
||||||
@ -277,7 +277,7 @@ begin
|
|||||||
BuddyWindowInfo^.DefWndProc := Windows.WNDPROC(SetWindowLong(
|
BuddyWindowInfo^.DefWndProc := Windows.WNDPROC(SetWindowLong(
|
||||||
Buddy, GWL_WNDPROC, PtrInt(SubClassWndProc)));
|
Buddy, GWL_WNDPROC, PtrInt(SubClassWndProc)));
|
||||||
if AWinControl.Font.IsDefault then
|
if AWinControl.Font.IsDefault then
|
||||||
lhFont := GetStockObject(DEFAULT_GUI_FONT)
|
lhFont := Win32Widgetset.DefaultFont
|
||||||
else
|
else
|
||||||
lhFont := AWinControl.Font.Reference.Handle;
|
lhFont := AWinControl.Font.Reference.Handle;
|
||||||
Windows.SendMessage(Buddy, WM_SETFONT, WPARAM(lhFont), 0);
|
Windows.SendMessage(Buddy, WM_SETFONT, WPARAM(lhFont), 0);
|
||||||
|
@ -179,7 +179,7 @@ class function TWin32WSScrollBox.CreateHandle(const AWinControl: TWinControl;
|
|||||||
if SubClassWndProc <> nil then
|
if SubClassWndProc <> nil then
|
||||||
WindowInfo^.DefWndProc := Windows.WNDPROC(SetWindowLong(
|
WindowInfo^.DefWndProc := Windows.WNDPROC(SetWindowLong(
|
||||||
Window, GWL_WNDPROC, PtrInt(SubClassWndProc)));
|
Window, GWL_WNDPROC, PtrInt(SubClassWndProc)));
|
||||||
lhFont := GetStockObject(DEFAULT_GUI_FONT)
|
lhFont := FDefaultFont;
|
||||||
Windows.SendMessage(Window, WM_SETFONT, WPARAM(lhFont), 0);}
|
Windows.SendMessage(Window, WM_SETFONT, WPARAM(lhFont), 0);}
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
@ -194,7 +194,6 @@ type
|
|||||||
procedure AppWaitMessage; override;
|
procedure AppWaitMessage; override;
|
||||||
procedure AppTerminate; override;
|
procedure AppTerminate; override;
|
||||||
procedure AppSetTitle(const ATitle: string); override;
|
procedure AppSetTitle(const ATitle: string); override;
|
||||||
//function InitHintFont(HintFont: TObject): Boolean; override;
|
|
||||||
procedure AttachMenuToWindow(AMenuObject: TComponent); override;
|
procedure AttachMenuToWindow(AMenuObject: TComponent); override;
|
||||||
procedure DCSetPixel(CanvasHandle: HDC; X, Y: integer; AColor: TGraphicsColor); override;
|
procedure DCSetPixel(CanvasHandle: HDC; X, Y: integer; AColor: TGraphicsColor); override;
|
||||||
function DCGetPixel(CanvasHandle: HDC; X, Y: integer): TGraphicsColor; override;
|
function DCGetPixel(CanvasHandle: HDC; X, Y: integer): TGraphicsColor; override;
|
||||||
|
@ -272,18 +272,6 @@ begin
|
|||||||
if Window=0 then exit;
|
if Window=0 then exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
//roozbeh : how can we have hints on ce?
|
|
||||||
{
|
|
||||||
function TWinCEWidgetSet.InitHintFont(HintFont: TObject): Boolean;
|
|
||||||
begin
|
|
||||||
TFont(HintFont).Name := FMetrics.lfStatusFont.lfFaceName;
|
|
||||||
TFont(HintFont).Style := [];
|
|
||||||
TFont(HintFont).Height := FMetrics.lfStatusFont.lfHeight;
|
|
||||||
TFont(HintFont).Color := clInfoText;
|
|
||||||
TFont(HintFont).Pitch := fpDefault;
|
|
||||||
Result := true;
|
|
||||||
end;
|
|
||||||
}
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
Method: TWinCEWidgetSet.AppProcessMessages
|
Method: TWinCEWidgetSet.AppProcessMessages
|
||||||
Params: None
|
Params: None
|
||||||
|
@ -249,7 +249,7 @@ begin
|
|||||||
WindowInfo^.DefWndProc := Windows.WNDPROC(Windows.SetWindowLong(
|
WindowInfo^.DefWndProc := Windows.WNDPROC(Windows.SetWindowLong(
|
||||||
Window, GWL_WNDPROC, LongInt(SubClassWndProc)));
|
Window, GWL_WNDPROC, LongInt(SubClassWndProc)));
|
||||||
if AWinControl.Font.IsDefault then
|
if AWinControl.Font.IsDefault then
|
||||||
lhFont := GetStockObject(DEFAULT_GUI_FONT)
|
lhFont := WinCEWidgetset.MessageFont
|
||||||
else
|
else
|
||||||
lhFont := AWinControl.Font.Reference.Handle;
|
lhFont := AWinControl.Font.Reference.Handle;
|
||||||
Windows.SendMessage(Window, WM_SETFONT, lhFont, 0)
|
Windows.SendMessage(Window, WM_SETFONT, lhFont, 0)
|
||||||
@ -269,7 +269,7 @@ begin
|
|||||||
Params.BuddyWindowInfo^.DefWndProc := Windows.WNDPROC(Windows.SetWindowLong(
|
Params.BuddyWindowInfo^.DefWndProc := Windows.WNDPROC(Windows.SetWindowLong(
|
||||||
Params.Buddy, GWL_WNDPROC, LongInt(Params.SubClassWndProc)));
|
Params.Buddy, GWL_WNDPROC, LongInt(Params.SubClassWndProc)));
|
||||||
if AWinControl.Font.IsDefault then
|
if AWinControl.Font.IsDefault then
|
||||||
lhFont := GetStockObject(DEFAULT_GUI_FONT)
|
lhFont := WinCEWidgetset.MessageFont
|
||||||
else
|
else
|
||||||
lhFont := AWinControl.Font.Reference.Handle;
|
lhFont := AWinControl.Font.Reference.Handle;
|
||||||
Windows.SendMessage(Params.Buddy, WM_SETFONT, lhFont, 0);
|
Windows.SendMessage(Params.Buddy, WM_SETFONT, lhFont, 0);
|
||||||
|
@ -1584,7 +1584,6 @@ const
|
|||||||
DC_PEN = 19;
|
DC_PEN = 19;
|
||||||
STOCK_LAST = 19;
|
STOCK_LAST = 19;
|
||||||
|
|
||||||
|
|
||||||
//==============================================
|
//==============================================
|
||||||
// Stock Pixmap Types
|
// Stock Pixmap Types
|
||||||
//==============================================
|
//==============================================
|
||||||
@ -2655,6 +2654,13 @@ type
|
|||||||
NM_LISTVIEW = TNMListView;
|
NM_LISTVIEW = TNMListView;
|
||||||
tagNMLISTVIEW = TNMListView;
|
tagNMLISTVIEW = TNMListView;
|
||||||
|
|
||||||
|
// enum to use with InitStockFont
|
||||||
|
TStockFont = (
|
||||||
|
sfSystem, // stock system font
|
||||||
|
sfHint, // stock hint font
|
||||||
|
sfIcon, // stock icon font
|
||||||
|
sfMenu // stock menu font
|
||||||
|
);
|
||||||
|
|
||||||
function CS_To_String(CompStyle: Integer): String;
|
function CS_To_String(CompStyle: Integer): String;
|
||||||
// key mapping
|
// key mapping
|
||||||
|
Loading…
Reference in New Issue
Block a user