mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-04 04:57:41 +01:00
LazUtils: Rename unit ModalResultDef to a Delphi compatible UITypes. Add Message dialog related stuff.
git-svn-id: trunk@58227 -
This commit is contained in:
parent
ded01f7963
commit
ce916d287c
2
.gitattributes
vendored
2
.gitattributes
vendored
@ -3287,7 +3287,6 @@ components/lazutils/lcsvutils.pas svneol=native#text/pascal
|
||||
components/lazutils/lookupstringlist.pas svneol=native#text/pascal
|
||||
components/lazutils/maps.pp svneol=native#text/pascal
|
||||
components/lazutils/masks.pas svneol=native#text/pascal
|
||||
components/lazutils/modalresultdef.pas svneol=native#text/pascal
|
||||
components/lazutils/paswstring.pas svneol=native#text/pascal
|
||||
components/lazutils/stringhashlist.pas svneol=native#text/pascal
|
||||
components/lazutils/test/TestLazStorageMem.lpi svneol=native#text/plain
|
||||
@ -3316,6 +3315,7 @@ components/lazutils/ttraster.pas svneol=native#text/pascal
|
||||
components/lazutils/ttraster_sweep.inc svneol=native#text/pascal
|
||||
components/lazutils/tttables.pas svneol=native#text/pascal
|
||||
components/lazutils/tttypes.pas svneol=native#text/pascal
|
||||
components/lazutils/uitypes.pas svneol=native#text/pascal
|
||||
components/lazutils/unixfileutil.inc svneol=native#text/pascal
|
||||
components/lazutils/unixlazfileutils.inc svneol=native#text/plain
|
||||
components/lazutils/unixlazutf8.inc svneol=native#text/plain
|
||||
|
||||
@ -31,7 +31,7 @@ uses
|
||||
// LazControls
|
||||
{$IFnDEF UseOINormalCheckBox} CheckBoxThemed, {$ENDIF}
|
||||
// LazUtils
|
||||
FileUtil, StringHashList, LazMethodList, ModalResultDef,
|
||||
FileUtil, StringHashList, LazMethodList, UITypes,
|
||||
FPCAdds, // for StrToQWord in older fpc versions
|
||||
// IdeIntf
|
||||
ObjInspStrConsts, PropEditUtils, PackageDependencyIntf,
|
||||
|
||||
@ -406,8 +406,8 @@
|
||||
<UnitName Value="LazVersion"/>
|
||||
</Item97>
|
||||
<Item98>
|
||||
<Filename Value="modalresultdef.pas"/>
|
||||
<UnitName Value="ModalResultDef"/>
|
||||
<Filename Value="uitypes.pas"/>
|
||||
<UnitName Value="UITypes"/>
|
||||
</Item98>
|
||||
</Files>
|
||||
<LazDoc Paths="../../docs/xml/lazutils"/>
|
||||
|
||||
@ -21,7 +21,7 @@ uses
|
||||
StringHashList, TextStrings, Translations, TTCache, TTCalc, TTCMap, TTDebug,
|
||||
TTError, TTFile, TTGLoad, TTInterp, TTLoad, TTMemory, TTObjs, TTProfile,
|
||||
TTRASTER, TTTables, TTTypes, UTF8Process, HTML2TextRender, Laz_AVL_Tree,
|
||||
CompWriterPas, LazPasReadUtil, IntegerList, LazVersion, ModalResultDef,
|
||||
CompWriterPas, LazPasReadUtil, IntegerList, LazVersion, UITypes,
|
||||
LazarusPackageIntf;
|
||||
|
||||
implementation
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
unit ModalResultDef;
|
||||
unit UITypes;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
@ -8,6 +8,13 @@ uses
|
||||
Classes, SysUtils;
|
||||
|
||||
type
|
||||
// Message dialog related
|
||||
TMsgDlgType = (mtWarning, mtError, mtInformation, mtConfirmation, mtCustom);
|
||||
TMsgDlgBtn = (mbYes, mbNo, mbOK, mbCancel, mbAbort, mbRetry, mbIgnore,
|
||||
mbAll, mbNoToAll, mbYesToAll, mbHelp, mbClose);
|
||||
TMsgDlgButtons = set of TMsgDlgBtn;
|
||||
|
||||
// ModalResult
|
||||
TModalResult = low(Integer)..high(Integer);
|
||||
PModalResult = ^TModalResult;
|
||||
|
||||
@ -31,7 +31,7 @@ uses
|
||||
LResources, LCLType, Forms, Controls, Graphics, Dialogs,
|
||||
StdCtrls, ExtCtrls, Spin, Grids, ActnList, Buttons, EditBtn,
|
||||
// LazUtils
|
||||
ModalResultDef,
|
||||
UITypes,
|
||||
// IdeIntf
|
||||
IDECommands, MenuIntf, LazIDEIntf, SrcEditorIntf;
|
||||
|
||||
|
||||
@ -41,26 +41,31 @@ uses
|
||||
InterfaceBase, ImgList, PropertyStorage, Menus, ActnList, LCLClasses,
|
||||
LResources, LCLPlatformDef,
|
||||
// LazUtils
|
||||
LazMethodList, ModalResultDef;
|
||||
LazMethodList, UITypes;
|
||||
|
||||
{$I controlconsts.inc}
|
||||
|
||||
const
|
||||
// Used for ModalResult
|
||||
mrNone = ModalResultDef.mrNone;
|
||||
mrOK = ModalResultDef.mrOK;
|
||||
mrCancel = ModalResultDef.mrCancel;
|
||||
mrAbort = ModalResultDef.mrAbort;
|
||||
mrRetry = ModalResultDef.mrRetry;
|
||||
mrIgnore = ModalResultDef.mrIgnore;
|
||||
mrYes = ModalResultDef.mrYes;
|
||||
mrNo = ModalResultDef.mrNo;
|
||||
mrAll = ModalResultDef.mrAll;
|
||||
mrNoToAll = ModalResultDef.mrNoToAll;
|
||||
mrYesToAll= ModalResultDef.mrYesToAll;
|
||||
mrClose = ModalResultDef.mrClose;
|
||||
mrLast = ModalResultDef.mrLast;
|
||||
mrNone = UITypes.mrNone;
|
||||
mrOK = UITypes.mrOK;
|
||||
mrCancel = UITypes.mrCancel;
|
||||
mrAbort = UITypes.mrAbort;
|
||||
mrRetry = UITypes.mrRetry;
|
||||
mrIgnore = UITypes.mrIgnore;
|
||||
mrYes = UITypes.mrYes;
|
||||
mrNo = UITypes.mrNo;
|
||||
mrAll = UITypes.mrAll;
|
||||
mrNoToAll = UITypes.mrNoToAll;
|
||||
mrYesToAll= UITypes.mrYesToAll;
|
||||
mrClose = UITypes.mrClose;
|
||||
mrLast = UITypes.mrLast;
|
||||
|
||||
function GetModalResultStr(ModalResult: TModalResult): ShortString;
|
||||
deprecated 'Use the ModalResultStr array from unit UITypes directly.';
|
||||
property ModalResultStr[ModalResult: TModalResult]: shortstring read GetModalResultStr;
|
||||
|
||||
const
|
||||
// define aliases for Delphi compatibility
|
||||
fsSurface = GraphType.fsSurface;
|
||||
fsBorder = GraphType.fsBorder;
|
||||
@ -3004,6 +3009,11 @@ begin
|
||||
Result:='['+Result+']';
|
||||
end;
|
||||
|
||||
function GetModalResultStr(ModalResult: TModalResult): ShortString;
|
||||
begin
|
||||
Result := UITypes.ModalResultStr[ModalResult];
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
RecreateWnd
|
||||
This function was originally member of TWincontrol. From a VCL point of view
|
||||
|
||||
@ -28,21 +28,36 @@ uses
|
||||
Forms, Controls, Themes, GraphType, Graphics, Buttons, ButtonPanel, StdCtrls,
|
||||
ExtCtrls, LCLClasses, ClipBrd, Menus, LCLTaskDialog,
|
||||
// LazUtils
|
||||
{$ifdef DebugCommonDialogEvents}
|
||||
ModalResultDef,
|
||||
{$endif}
|
||||
FileUtil, LazFileUtils;
|
||||
|
||||
UITypes, FileUtil, LazFileUtils;
|
||||
|
||||
type
|
||||
TMsgDlgType = (mtWarning, mtError, mtInformation, mtConfirmation,
|
||||
mtCustom);
|
||||
TMsgDlgBtn = (mbYes, mbNo, mbOK, mbCancel, mbAbort, mbRetry, mbIgnore,
|
||||
mbAll, mbNoToAll, mbYesToAll, mbHelp, mbClose);
|
||||
TMsgDlgButtons = set of TMsgDlgBtn;
|
||||
// Aliases for types in UITypes.
|
||||
TMsgDlgType = UITypes.TMsgDlgType;
|
||||
TMsgDlgBtn = UITypes.TMsgDlgBtn;
|
||||
TMsgDlgButtons = UITypes.TMsgDlgButtons;
|
||||
|
||||
|
||||
const
|
||||
// Aliases for enum values in UITypes.
|
||||
mtWarning = UITypes.TMsgDlgType.mtWarning;
|
||||
mtError = UITypes.TMsgDlgType.mtError;
|
||||
mtInformation = UITypes.TMsgDlgType.mtInformation;
|
||||
mtConfirmation = UITypes.TMsgDlgType.mtConfirmation;
|
||||
mtCustom = UITypes.TMsgDlgType.mtCustom;
|
||||
|
||||
mbYes = UITypes.TMsgDlgBtn.mbYes;
|
||||
mbNo = UITypes.TMsgDlgBtn.mbNo;
|
||||
mbOK = UITypes.TMsgDlgBtn.mbOK;
|
||||
mbCancel = UITypes.TMsgDlgBtn.mbCancel;
|
||||
mbAbort = UITypes.TMsgDlgBtn.mbAbort;
|
||||
mbRetry = UITypes.TMsgDlgBtn.mbRetry;
|
||||
mbIgnore = UITypes.TMsgDlgBtn.mbIgnore;
|
||||
mbAll = UITypes.TMsgDlgBtn.mbAll;
|
||||
mbNoToAll = UITypes.TMsgDlgBtn.mbNoToAll;
|
||||
mbYesToAll = UITypes.TMsgDlgBtn.mbYesToAll;
|
||||
mbHelp = UITypes.TMsgDlgBtn.mbHelp;
|
||||
mbClose = UITypes.TMsgDlgBtn.mbClose;
|
||||
|
||||
// Combinations of buttons.
|
||||
mbYesNoCancel = [mbYes, mbNo, mbCancel];
|
||||
mbYesNo = [mbYes, mbNo];
|
||||
mbOKCancel = [mbOK, mbCancel];
|
||||
|
||||
@ -39,7 +39,7 @@ uses
|
||||
LResources, GraphType, Graphics, Menus, LMessages, CustomTimer, ActnList,
|
||||
ClipBrd, HelpIntfs, Controls, ImgList, Themes,
|
||||
// LazUtils
|
||||
LazFileUtils, LazUTF8, Maps, IntegerList, LazMethodList, ModalResultDef
|
||||
LazFileUtils, LazUTF8, Maps, IntegerList, LazMethodList, UITypes
|
||||
{$ifndef wince},gettext{$endif}// remove ifdefs when gettext is fixed and a new fpc is released
|
||||
;
|
||||
|
||||
@ -413,8 +413,8 @@ type
|
||||
);
|
||||
TFormState = set of TFormStateType;
|
||||
|
||||
TModalResult = ModalResultDef.TModalResult;
|
||||
PModalResult = ^ModalResultDef.TModalResult;
|
||||
TModalResult = UITypes.TModalResult;
|
||||
PModalResult = ^UITypes.TModalResult;
|
||||
|
||||
TFormHandlerType = (
|
||||
fhtFirstShow,
|
||||
|
||||
@ -34,7 +34,7 @@ uses
|
||||
LCLProc, LCLType, Dialogs, Controls, Graphics, Forms, Masks,
|
||||
// LazUtils
|
||||
{$ifdef DebugCommonDialogEvents}
|
||||
ModalResultDef,
|
||||
UITypes,
|
||||
{$endif}
|
||||
LazFileUtils, LazUTF8,
|
||||
// ws
|
||||
|
||||
Loading…
Reference in New Issue
Block a user