mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-20 07:29:29 +02:00
Allow query of LCLWidgetTypeName without LCL. Turn BuildLCLWidgetType into const and fix comment.
This commit is contained in:
parent
40e7dd7854
commit
b0a3e49dc0
components/lazutils
ide
lcl
@ -19,6 +19,9 @@ unit LazVersion;
|
||||
|
||||
interface
|
||||
|
||||
type
|
||||
TLCLWidgetTypeNameEvent = function(): string;
|
||||
|
||||
const
|
||||
laz_major = 2;
|
||||
laz_minor = 3;
|
||||
@ -27,7 +30,20 @@ const
|
||||
laz_fullversion = ((laz_major * 100 + laz_minor) * 100 + laz_release) * 100 + laz_patch;
|
||||
laz_version = '2.3.0.0';
|
||||
|
||||
var
|
||||
OnLCLWidgetTypeName: TLCLWidgetTypeNameEvent; // Set by LCL
|
||||
|
||||
function GetLCLWidgetTypeName: string;
|
||||
|
||||
implementation
|
||||
|
||||
function GetLCLWidgetTypeName: string;
|
||||
begin
|
||||
if Assigned(OnLCLWidgetTypeName) then
|
||||
Result := OnLCLWidgetTypeName()
|
||||
else
|
||||
Result := '';
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
|
@ -38,13 +38,12 @@ unit Compiler;
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, contnrs, strutils,
|
||||
Classes, SysUtils, Contnrs, StrUtils,
|
||||
{$IF FPC_FULLVERSION >= 30200}System.{$ENDIF}UITypes,
|
||||
// LazUtils
|
||||
FPCAdds, LazUTF8, LazFileUtils, LazUtilities, LazLoggerBase,
|
||||
// Codetools
|
||||
DefineTemplates, LinkScanner, CodeToolManager, TransferMacros,
|
||||
// LCL
|
||||
Forms, Controls,
|
||||
// BuildIntf
|
||||
IDEExternToolIntf,
|
||||
// IdeIntf
|
||||
|
@ -44,11 +44,9 @@ interface
|
||||
uses
|
||||
Classes, SysUtils, Laz_AVL_Tree,
|
||||
{$IF FPC_FULLVERSION >= 30200}System.{$ENDIF}UITypes,
|
||||
// LCL
|
||||
InterfaceBase,
|
||||
// LazUtils
|
||||
FileUtil, LazFileUtils, LazUTF8, Laz2_XMLCfg, Laz2_DOM, LazUtilities, LazTracer,
|
||||
LazStringUtils, FPCAdds,
|
||||
LazStringUtils, FPCAdds, LazVersion,
|
||||
// CodeTools
|
||||
FileProcs, DefineTemplates, CodeToolsCfgScript, CodeToolManager,
|
||||
KeywordFuncLists, BasicCodeTools, LinkScanner,
|
||||
@ -57,10 +55,9 @@ uses
|
||||
// IDEIntf
|
||||
SrcEditorIntf,
|
||||
// IdeConfig
|
||||
LazConf, EnvironmentOpts, SearchPathProcs, IdeXmlConfigProcs,
|
||||
LazConf, EnvironmentOpts, SearchPathProcs, IdeXmlConfigProcs, TransferMacros,
|
||||
// IDE
|
||||
LazarusIDEStrConsts, IDEProcs, TransferMacros, etFPCMsgParser,
|
||||
IDECmdLine, ModeMatrixOpts, CompOptsModes;
|
||||
LazarusIDEStrConsts, IDEProcs, etFPCMsgParser, ModeMatrixOpts, CompOptsModes;
|
||||
|
||||
const
|
||||
DefaultCompilerPath = '$(CompPath)';
|
||||
|
@ -31,7 +31,7 @@ uses
|
||||
// LCL
|
||||
LCLProc, LCLType, LMessages, LCLPlatformDef, IntfGraphics, Themes,
|
||||
// LazUtils
|
||||
LazUTF8, IntegerList, LazUtilities, LazLoggerBase, GraphType, GraphMath;
|
||||
LazUTF8, IntegerList, LazUtilities, LazLoggerBase, GraphType, GraphMath, LazVersion;
|
||||
|
||||
type
|
||||
PEventHandler = type Pointer;
|
||||
@ -217,12 +217,6 @@ var
|
||||
|
||||
implementation
|
||||
|
||||
{function GetDefaultLCLWidgetType: TLCLPlatform;
|
||||
begin
|
||||
Assert(Assigned(WidgetSet), 'GetDefaultLCLWidgetType: WidgetSet is not assigned.');
|
||||
if WidgetSet.LCLPlatform<>lpNoGUI then
|
||||
Result:=WidgetSet.LCLPlatform
|
||||
end; }
|
||||
function GetDefaultLCLWidgetType: TLCLPlatform;
|
||||
begin
|
||||
if (WidgetSet<>nil) and (WidgetSet.LCLPlatform<>lpNoGUI) then
|
||||
@ -345,4 +339,7 @@ end;
|
||||
{$I intfbasewinapi.inc}
|
||||
{$I intfbaselcl.inc}
|
||||
|
||||
initialization
|
||||
LazVersion.OnLCLWidgetTypeName := @GetLCLWidgetTypeName;
|
||||
|
||||
end.
|
||||
|
@ -78,8 +78,7 @@ const
|
||||
'MUI'
|
||||
);
|
||||
|
||||
var
|
||||
// set by lazbuild.lpr and used by GetDefaultLCLWidgetType
|
||||
// Used by GetDefaultLCLWidgetType
|
||||
BuildLCLWidgetType: TLCLPlatform =
|
||||
{$IFDEF MSWindows}{$DEFINE WidgetSetDefined}
|
||||
lpWin32;
|
||||
|
Loading…
Reference in New Issue
Block a user