mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-25 01:49:09 +02:00
* Add some types for Delphi compatibility
This commit is contained in:
parent
24d8478650
commit
d8c7b99cdd
@ -223,6 +223,7 @@ Type
|
|||||||
SysMenuHighlight = TColor($FF00001D) platform;
|
SysMenuHighlight = TColor($FF00001D) platform;
|
||||||
SysMenuBar = TColor($FF00001E) platform;
|
SysMenuBar = TColor($FF00001E) platform;
|
||||||
SysNone = TColor($1FFFFFFF) platform;
|
SysNone = TColor($1FFFFFFF) platform;
|
||||||
|
Null = TColor($00000000);
|
||||||
SysDefault = TColor($20000000) platform;
|
SysDefault = TColor($20000000) platform;
|
||||||
var
|
var
|
||||||
case Integer of
|
case Integer of
|
||||||
@ -410,6 +411,8 @@ Type
|
|||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
TAlphaColorRec = TAlphaColors;
|
TAlphaColorRec = TAlphaColors;
|
||||||
|
PAlphaColorRec = ^TAlphaColorRec;
|
||||||
|
|
||||||
|
|
||||||
TAlphaColorF = record
|
TAlphaColorF = record
|
||||||
Public
|
Public
|
||||||
@ -466,7 +469,9 @@ const
|
|||||||
mrNoToAll = mrNone + 9;
|
mrNoToAll = mrNone + 9;
|
||||||
mrYesToAll = mrNone + 10;
|
mrYesToAll = mrNone + 10;
|
||||||
mrClose = mrNone + 11;
|
mrClose = mrNone + 11;
|
||||||
mrLast = mrClose;
|
mrContinue = mrNone + 12;
|
||||||
|
mrTryAgain = mrNone + 13;
|
||||||
|
mrLast = mrTryAgain;
|
||||||
|
|
||||||
// String representation of ModalResult values
|
// String representation of ModalResult values
|
||||||
ModalResultStr: array[mrNone..mrLast] of shortstring = (
|
ModalResultStr: array[mrNone..mrLast] of shortstring = (
|
||||||
@ -481,22 +486,43 @@ const
|
|||||||
'mrAll',
|
'mrAll',
|
||||||
'mrNoToAll',
|
'mrNoToAll',
|
||||||
'mrYesToAll',
|
'mrYesToAll',
|
||||||
'mrClose');
|
'mrClose',
|
||||||
|
'mrContinue',
|
||||||
|
'mrTryAgain');
|
||||||
|
|
||||||
// CONTROLS
|
// CONTROLS
|
||||||
type
|
type
|
||||||
TCloseAction = (caNone, caHide, caFree, caMinimize);
|
TCloseAction = (caNone, caHide, caFree, caMinimize);
|
||||||
|
TCloseActions = set of TCloseAction;
|
||||||
|
|
||||||
TMouseButton = (mbLeft, mbRight, mbMiddle, mbExtra1, mbExtra2);
|
TMouseButton = (mbLeft, mbRight, mbMiddle, mbExtra1, mbExtra2);
|
||||||
|
TMouseButtons = set of TMouseButton;
|
||||||
|
|
||||||
TTabOrder = -1..32767;
|
TTabOrder = -1..32767;
|
||||||
|
|
||||||
TDragKind = (dkDrag, dkDock);
|
TDragKind = (dkDrag, dkDock);
|
||||||
|
TDragKinds = set of TDragKind;
|
||||||
|
|
||||||
TDragMode = (dmManual , dmAutomatic);
|
TDragMode = (dmManual , dmAutomatic);
|
||||||
|
TDragModes = set of TDragMode;
|
||||||
|
|
||||||
TDragState = (dsDragEnter, dsDragLeave, dsDragMove);
|
TDragState = (dsDragEnter, dsDragLeave, dsDragMove);
|
||||||
|
TDragStates = set of TDragState;
|
||||||
|
|
||||||
TDragMessage = (dmDragEnter, dmDragLeave, dmDragMove, dmDragDrop,
|
TDragMessage = (dmDragEnter, dmDragLeave, dmDragMove, dmDragDrop,
|
||||||
dmDragCancel,dmFindTarget);
|
dmDragCancel,dmFindTarget);
|
||||||
|
TDragMessages = set of TDragMessage;
|
||||||
|
|
||||||
TAnchorKind = (akTop, akLeft, akRight, akBottom);
|
TAnchorKind = (akTop, akLeft, akRight, akBottom);
|
||||||
TAnchors = set of TAnchorKind;
|
TAnchors = set of TAnchorKind;
|
||||||
|
TAnchorKinds = TAnchors;
|
||||||
|
|
||||||
TAnchorSideReference = (asrTop, asrBottom, asrCenter);
|
TAnchorSideReference = (asrTop, asrBottom, asrCenter);
|
||||||
|
TAnchorSideReferences = set of TAnchorSideReference;
|
||||||
|
|
||||||
|
TScrollCode = (scLineUp, scLineDown, scPageUp, scPageDown, scPosition,
|
||||||
|
scTrack, scTop, scBottom, scEndScroll);
|
||||||
|
TScrollCodes = set of TScrollCode;
|
||||||
|
|
||||||
TCursor = -32768..32767;
|
TCursor = -32768..32767;
|
||||||
|
|
||||||
@ -554,9 +580,15 @@ type
|
|||||||
|
|
||||||
// PRINTERS
|
// PRINTERS
|
||||||
TPrinterOrientation = (poPortrait,poLandscape,poReverseLandscape,poReversePortrait);
|
TPrinterOrientation = (poPortrait,poLandscape,poReverseLandscape,poReversePortrait);
|
||||||
|
TPrinterOrientations = set of TPrinterOrientation;
|
||||||
|
|
||||||
TPrinterCapability = (pcCopies, pcOrientation, pcCollation);
|
TPrinterCapability = (pcCopies, pcOrientation, pcCollation);
|
||||||
TPrinterCapabilities= Set of TPrinterCapability;
|
TPrinterCapabilities= Set of TPrinterCapability;
|
||||||
|
|
||||||
|
TPrinterState = (psNoHandle, psHandleIC, psHandleDC);
|
||||||
|
TPrinterStates = set of TPrinterState;
|
||||||
|
|
||||||
|
|
||||||
// Gestures
|
// Gestures
|
||||||
const
|
const
|
||||||
sgiNoGesture = 0;
|
sgiNoGesture = 0;
|
||||||
@ -628,8 +660,96 @@ const
|
|||||||
Type
|
Type
|
||||||
TEditCharCase = (ecNormal, ecUpperCase, ecLowerCase);
|
TEditCharCase = (ecNormal, ecUpperCase, ecLowerCase);
|
||||||
|
|
||||||
|
// Forms
|
||||||
|
|
||||||
|
TWindowState = (wsNormal, wsMinimized, wsMaximized);
|
||||||
|
TWindowStates = Set of TWindowState;
|
||||||
|
|
||||||
|
TBorderIcon = (biSystemMenu, biMinimize, biMaximize, biHelp);
|
||||||
|
TBorderIcons = set of TBorderIcon;
|
||||||
|
|
||||||
|
// Dialogs
|
||||||
|
TOpenOption = (ofReadOnly, ofOverwritePrompt, ofHideReadOnly,
|
||||||
|
ofNoChangeDir, ofShowHelp, ofNoValidate, ofAllowMultiSelect,
|
||||||
|
ofExtensionDifferent, ofPathMustExist, ofFileMustExist, ofCreatePrompt,
|
||||||
|
ofShareAware, ofNoReadOnlyReturn, ofNoTestFileCreate, ofNoNetworkButton,
|
||||||
|
ofNoLongNames, ofOldStyleDialog, ofNoDereferenceLinks, ofEnableIncludeNotify,
|
||||||
|
ofEnableSizing, ofDontAddToRecent, ofForceShowHidden);
|
||||||
|
TOpenOptions = set of TOpenOption;
|
||||||
|
|
||||||
|
TOpenOptionEx = (ofExNoPlacesBar);
|
||||||
|
TOpenOptionsEx = set of TOpenOptionEx;
|
||||||
|
|
||||||
|
TDialogType = (Standard, Directory);
|
||||||
|
|
||||||
|
TPrintRange = (prAllPages, prSelection, prPageNums);
|
||||||
|
TPrintDialogOption = (poPrintToFile, poPageNums, poSelection, poWarning,
|
||||||
|
poHelp, poDisablePrintToFile);
|
||||||
|
TPrintDialogOptions = set of TPrintDialogOption;
|
||||||
|
|
||||||
|
TPageSetupDialogOption = (psoDefaultMinMargins, psoDisableMargins,
|
||||||
|
psoDisableOrientation, psoDisablePagePainting, psoDisablePaper, psoDisablePrinter,
|
||||||
|
psoMargins, psoMinMargins, psoShowHelp, psoWarning, psoNoNetworkButton);
|
||||||
|
TPageSetupDialogOptions = set of TPageSetupDialogOption;
|
||||||
|
|
||||||
|
TPageMeasureUnits = (pmDefault, pmMillimeters, pmInches);
|
||||||
|
|
||||||
|
TCalDayOfWeek = (dowMonday, dowTuesday, dowWednesday, dowThursday,
|
||||||
|
dowFriday, dowSaturday, dowSunday, dowLocaleDefault);
|
||||||
|
|
||||||
|
function IsPositiveResult(const AModalResult: TModalResult): Boolean;
|
||||||
|
function IsNegativeResult(const AModalResult: TModalResult): Boolean;
|
||||||
|
function IsAbortResult(const AModalResult: TModalResult): Boolean;
|
||||||
|
function IsAnAllResult(const AModalResult: TModalResult): Boolean;
|
||||||
|
function StripAllFromResult(const AModalResult: TModalResult): TModalResult;
|
||||||
|
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
|
function IsPositiveResult(const AModalResult: TModalResult): Boolean;
|
||||||
|
|
||||||
|
begin
|
||||||
|
Result:=aModalResult in [mrOk,mrYes,mrAll,mrYesToAll,mrContinue]
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function IsNegativeResult(const AModalResult: TModalResult): Boolean;
|
||||||
|
|
||||||
|
begin
|
||||||
|
Result:=aModalResult in [mrNo,mrNoToAll,mrTryAgain]
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function IsAbortResult(const AModalResult: TModalResult): Boolean;
|
||||||
|
|
||||||
|
begin
|
||||||
|
Result:=aModalResult in [mrCancel,mrAbort]
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function IsAnAllResult(const AModalResult: TModalResult): Boolean;
|
||||||
|
|
||||||
|
begin
|
||||||
|
Result:=aModalResult in [mrAll,mrNoToAll,mrYesToAll]
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function StripAllFromResult(const AModalResult: TModalResult): TModalResult;
|
||||||
|
|
||||||
|
begin
|
||||||
|
case aModalResult of
|
||||||
|
mrAll:
|
||||||
|
Result:=mrOk;
|
||||||
|
mrNoToAll:
|
||||||
|
Result:=mrNo;
|
||||||
|
mrYesToAll:
|
||||||
|
Result:=mrYes;
|
||||||
|
else
|
||||||
|
Result:=aModalResult;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
class operator TColorRec.:= (AColor : TColor): TColorRec;
|
class operator TColorRec.:= (AColor : TColor): TColorRec;
|
||||||
begin
|
begin
|
||||||
result.Color:=AColor;
|
result.Color:=AColor;
|
||||||
|
Loading…
Reference in New Issue
Block a user