diff options
Diffstat (limited to 'apps/X11/VCL/TControl.h')
-rw-r--r-- | apps/X11/VCL/TControl.h | 331 |
1 files changed, 331 insertions, 0 deletions
diff --git a/apps/X11/VCL/TControl.h b/apps/X11/VCL/TControl.h new file mode 100644 index 0000000..0969339 --- /dev/null +++ b/apps/X11/VCL/TControl.h @@ -0,0 +1,331 @@ +#ifndef TCONTROL_H +#define TCONTROL_H + +#include <TComponent.h> + +class TControl : public TComponent { +private: +/* + FParent: TWinControl; + FWindowProc: TWndMethod; + FLeft: Integer; + FTop: Integer; + FWidth: Integer; + FHeight: Integer; + FControlStyle: TControlStyle; + FControlState: TControlState; + FDesktopFont: Boolean; + FVisible: Boolean; + FEnabled: Boolean; + FParentFont: Boolean; + FParentColor: Boolean; + FAlign: TAlign; + FAutoSize: Boolean; + FDragMode: TDragMode; + FIsControl: Boolean; + FBiDiMode: TBiDiMode; + FParentBiDiMode: Boolean; + FText: PChar; + FFont: TFont; + FActionLink: TControlActionLink; + FAnchors: TAnchors; + FColor: TColor; + FConstraints: TSizeConstraints; + FCursor: TCursor; + FDragCursor: TCursor; + FPopupMenu: TPopupMenu; + FHint: string; + FFontHeight: Integer; + FLastHeight: Integer; + FLastWidth: Integer; + FScalingFlags: TScalingFlags; + FShowHint: Boolean; + FParentShowHint: Boolean; + FDragKind: TDragKind; + FDockOrientation: TDockOrientation; + FHostDockSite: TWinControl; + FUndockWidth: Integer; + FUndockHeight: Integer; + FLRDockWidth: Integer; + FTBDockHeight: Integer; + FFloatingDockSiteClass: TWinControlClass; + FOnCanResize: TCanResizeEvent; + FOnConstrainedResize: TConstrainedResizeEvent; + FOnMouseDown: TMouseEvent; + FOnMouseMove: TMouseMoveEvent; + FOnMouseUp: TMouseEvent; + FOnDragDrop: TDragDropEvent; + FOnDragOver: TDragOverEvent; + FOnResize: TNotifyEvent; + FOnStartDock: TStartDockEvent; + FOnEndDock: TEndDragEvent; + FOnStartDrag: TStartDragEvent; + FOnEndDrag: TEndDragEvent; + FOnClick: TNotifyEvent; + FOnDblClick: TNotifyEvent; + procedure CalcDockSizes; + procedure CheckMenuPopup(const Pos: TSmallPoint); + function CheckNewSize(var NewWidth, NewHeight: Integer): Boolean; + function CreateFloatingDockSite(Bounds: TRect): TWinControl; + procedure DoActionChange(Sender: TObject); + function DoCanAutoSize(var NewWidth, NewHeight: Integer): Boolean; + function DoCanResize(var NewWidth, NewHeight: Integer): Boolean; + procedure DoConstraintsChange(Sender: TObject); + procedure DoConstrainedResize(var NewWidth, NewHeight: Integer); + procedure DoDragMsg(var DragMsg: TCMDrag); + procedure DoMouseDown(var Message: TWMMouse; Button: TMouseButton; + Shift: TShiftState); + procedure DoMouseUp(var Message: TWMMouse; Button: TMouseButton); + procedure FontChanged(Sender: TObject); + function GetAction: TBasicAction; + function GetBoundsRect: TRect; + function GetClientHeight: Integer; + function GetClientWidth: Integer; + function GetLRDockWidth: Integer; + function GetMouseCapture: Boolean; + function GetText: TCaption; + function GetTBDockHeight: Integer; + function GetUndockWidth: Integer; + function GetUndockHeight: Integer; + procedure InvalidateControl(IsVisible, IsOpaque: Boolean); + function IsAnchorsStored: Boolean; + function IsBiDiModeStored: Boolean; + function IsCaptionStored: Boolean; + function IsColorStored: Boolean; + function IsEnabledStored: Boolean; + function IsFontStored: Boolean; + function IsHintStored: Boolean; + function IsOnClickStored: Boolean; + function IsShowHintStored: Boolean; + function IsVisibleStored: Boolean; + procedure ReadIsControl(Reader: TReader); + procedure SetAction(Value: TBasicAction); + procedure SetAlign(Value: TAlign); + procedure SetAutoSize(Value: Boolean); + procedure SetBoundsRect(const Rect: TRect); + procedure SetClientHeight(Value: Integer); + procedure SetClientSize(Value: TPoint); + procedure SetClientWidth(Value: Integer); + procedure SetColor(Value: TColor); + procedure SetCursor(Value: TCursor); + procedure SetDesktopFont(Value: Boolean); + procedure SetFont(Value: TFont); + procedure SetHeight(Value: Integer); + procedure SetHostDockSite(Value: TWinControl); + procedure SetLeft(Value: Integer); + procedure SetMouseCapture(Value: Boolean); + procedure SetParentColor(Value: Boolean); + procedure SetParentFont(Value: Boolean); + procedure SetShowHint(Value: Boolean); + procedure SetParentShowHint(Value: Boolean); + procedure SetPopupMenu(Value: TPopupMenu); + procedure SetText(const Value: TCaption); + procedure SetTop(Value: Integer); + procedure SetVisible(Value: Boolean); + procedure SetWidth(Value: Integer); + procedure SetZOrderPosition(Position: Integer); + procedure UpdateLastResize(NewWidth, NewHeight: Integer); virtual; + procedure WriteIsControl(Writer: TWriter); + procedure WMLButtonDown(var Message: TWMLButtonDown); message WM_LBUTTONDOWN; + procedure WMNCLButtonDown(var Message: TWMNCLButtonDown); message WM_NCLBUTTONDOWN; + procedure WMRButtonDown(var Message: TWMRButtonDown); message WM_RBUTTONDOWN; + procedure WMMButtonDown(var Message: TWMMButtonDown); message WM_MBUTTONDOWN; + procedure WMLButtonDblClk(var Message: TWMLButtonDblClk); message WM_LBUTTONDBLCLK; + procedure WMRButtonDblClk(var Message: TWMRButtonDblClk); message WM_RBUTTONDBLCLK; + procedure WMMButtonDblClk(var Message: TWMMButtonDblClk); message WM_MBUTTONDBLCLK; + procedure WMMouseMove(var Message: TWMMouseMove); message WM_MOUSEMOVE; + procedure WMLButtonUp(var Message: TWMLButtonUp); message WM_LBUTTONUP; + procedure WMRButtonUp(var Message: TWMRButtonUp); message WM_RBUTTONUP; + procedure WMMButtonUp(var Message: TWMMButtonUp); message WM_MBUTTONUP; + procedure WMCancelMode(var Message: TWMCancelMode); message WM_CANCELMODE; + procedure WMWindowPosChanged(var Message: TWMWindowPosChanged); message WM_WINDOWPOSCHANGED; + procedure CMVisibleChanged(var Message: TMessage); message CM_VISIBLECHANGED; + procedure CMEnabledChanged(var Message: TMessage); message CM_ENABLEDCHANGED; + procedure CMFontChanged(var Message: TMessage); message CM_FONTCHANGED; + procedure CMColorChanged(var Message: TMessage); message CM_COLORCHANGED; + procedure CMParentFontChanged(var Message: TMessage); message CM_PARENTFONTCHANGED; + procedure CMSysFontChanged(var Message: TMessage); message CM_SYSFONTCHANGED; + procedure CMParentColorChanged(var Message: TMessage); message CM_PARENTCOLORCHANGED; + procedure CMParentShowHintChanged(var Message: TMessage); message CM_PARENTSHOWHINTCHANGED; + procedure CMHintShow(var Message: TMessage); message CM_HINTSHOW; + procedure CMHitTest(var Message: TCMHitTest); message CM_HITTEST; + procedure CMMouseEnter(var Message: TMessage); message CM_MOUSEENTER; + procedure CMMouseLeave(var Message: TMessage); message CM_MOUSELEAVE; + procedure CMDesignHitTest(var Message: TCMDesignHitTest); message CM_DESIGNHITTEST; + procedure CMFloat(var Message: TCMFloat); message CM_FLOAT; + procedure CMBiDiModeChanged(var Message: TMessage); message CM_BIDIMODECHANGED; + procedure CMParentBiDiModeChanged(var Message: TMessage); message CM_PARENTBIDIMODECHANGED; + protected + procedure ActionChange(Sender: TObject; CheckDefaults: Boolean); dynamic; + procedure AdjustSize; dynamic; + procedure AssignTo(Dest: TPersistent); override; + procedure BeginAutoDrag; dynamic; + function CanResize(var NewWidth, NewHeight: Integer): Boolean; virtual; + function CanAutoSize(var NewWidth, NewHeight: Integer): Boolean; virtual; + procedure Changed; + procedure ChangeScale(M, D: Integer); dynamic; + procedure Click; dynamic; + procedure ConstrainedResize(var MinWidth, MinHeight, MaxWidth, MaxHeight: Integer); virtual; + procedure DblClick; dynamic; + procedure DefaultDockImage(DragDockObject: TDragDockObject; Erase: Boolean); dynamic; + procedure DefineProperties(Filer: TFiler); override; + procedure DockTrackNoTarget(Source: TDragDockObject; X, Y: Integer); dynamic; + procedure DoEndDock(Target: TObject; X, Y: Integer); dynamic; + procedure DoDock(NewDockSite: TWinControl; var ARect: TRect); dynamic; + procedure DoStartDock(var DragObject: TDragObject); dynamic; + procedure DragCanceled; dynamic; + procedure DragOver(Source: TObject; X, Y: Integer; State: TDragState; + var Accept: Boolean); dynamic; + procedure DoEndDrag(Target: TObject; X, Y: Integer); dynamic; + procedure DoStartDrag(var DragObject: TDragObject); dynamic; + procedure DrawDragDockImage(DragDockObject: TDragDockObject); dynamic; + procedure EraseDragDockImage(DragDockObject: TDragDockObject); dynamic; + function GetActionLinkClass: TControlActionLinkClass; dynamic; + function GetClientOrigin: TPoint; virtual; + function GetClientRect: TRect; virtual; + function GetDeviceContext(var WindowHandle: HWnd): HDC; virtual; + function GetDockEdge(MousePos: TPoint): TAlign; dynamic; + function GetDragImages: TDragImageList; virtual; + function GetEnabled: Boolean; virtual; + function GetFloating: Boolean; virtual; + function GetFloatingDockSiteClass: TWinControlClass; virtual; + function GetPalette: HPALETTE; dynamic; + function GetPopupMenu: TPopupMenu; dynamic; + procedure Loaded; override; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); dynamic; + procedure MouseMove(Shift: TShiftState; X, Y: Integer); dynamic; + procedure MouseUp(Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); dynamic; + procedure Notification(AComponent: TComponent; + Operation: TOperation); override; + procedure PositionDockRect(DragDockObject: TDragDockObject); dynamic; + function PaletteChanged(Foreground: Boolean): Boolean; dynamic; + procedure ReadState(Reader: TReader); override; + procedure RequestAlign; dynamic; + procedure Resize; dynamic; + procedure SendCancelMode(Sender: TControl); + procedure SendDockNotification(Msg: Cardinal; WParam, LParam: Integer); + procedure SetDragMode(Value: TDragMode); virtual; + procedure SetEnabled(Value: Boolean); virtual; + procedure SetName(const Value: TComponentName); override; + procedure SetParent(AParent: TWinControl); virtual; + procedure SetParentComponent(Value: TComponent); override; + procedure SetParentBiDiMode(Value: Boolean); virtual; + procedure SetBiDiMode(Value: TBiDiMode); virtual; + procedure SetZOrder(TopMost: Boolean); dynamic; + procedure UpdateBoundsRect(const R: TRect); + procedure VisibleChanging; dynamic; + procedure WndProc(var Message: TMessage); virtual; + property ActionLink: TControlActionLink read FActionLink write FActionLink; + property AutoSize: Boolean read FAutoSize write SetAutoSize default False; + property Caption: TCaption read GetText write SetText stored IsCaptionStored; + property Color: TColor read FColor write SetColor stored IsColorStored default clWindow; + property DesktopFont: Boolean read FDesktopFont write SetDesktopFont default False; + property DragKind: TDragKind read FDragKind write FDragKind default dkDrag; + property DragCursor: TCursor read FDragCursor write FDragCursor default crDrag; + property DragMode: TDragMode read FDragMode write SetDragMode default dmManual; + property Font: TFont read FFont write SetFont stored IsFontStored; + property IsControl: Boolean read FIsControl write FIsControl; + property MouseCapture: Boolean read GetMouseCapture write SetMouseCapture; + property ParentBiDiMode: Boolean read FParentBiDiMode write SetParentBiDiMode default True; + property ParentColor: Boolean read FParentColor write SetParentColor default True; + property ParentFont: Boolean read FParentFont write SetParentFont default True; + property ParentShowHint: Boolean read FParentShowHint write SetParentShowHint default True; + property PopupMenu: TPopupMenu read FPopupMenu write SetPopupMenu; + property ScalingFlags: TScalingFlags read FScalingFlags write FScalingFlags; + property Text: TCaption read GetText write SetText; + property WindowText: PChar read FText write FText; + property OnCanResize: TCanResizeEvent read FOnCanResize write FOnCanResize; + property OnConstrainedResize: TConstrainedResizeEvent read FOnConstrainedResize write FOnConstrainedResize; + property OnClick: TNotifyEvent read FOnClick write FOnClick stored IsOnClickStored; + property OnDblClick: TNotifyEvent read FOnDblClick write FOnDblClick; + property OnDragDrop: TDragDropEvent read FOnDragDrop write FOnDragDrop; + property OnDragOver: TDragOverEvent read FOnDragOver write FOnDragOver; + property OnEndDock: TEndDragEvent read FOnEndDock write FOnEndDock; + property OnEndDrag: TEndDragEvent read FOnEndDrag write FOnEndDrag; + property OnMouseDown: TMouseEvent read FOnMouseDown write FOnMouseDown; + property OnMouseMove: TMouseMoveEvent read FOnMouseMove write FOnMouseMove; + property OnMouseUp: TMouseEvent read FOnMouseUp write FOnMouseUp; + property OnResize: TNotifyEvent read FOnResize write FOnResize; + property OnStartDock: TStartDockEvent read FOnStartDock write FOnStartDock; + property OnStartDrag: TStartDragEvent read FOnStartDrag write FOnStartDrag; +*/ +public: + TControl(TComponent *AOwner); + ~TControl(); + +// procedure Repaint; virtual; + void Repaint(); +/* + procedure BeginDrag(Immediate: Boolean; Threshold: Integer = -1); + procedure BringToFront; + function ClientToScreen(const Point: TPoint): TPoint; + procedure Dock(NewDockSite: TWinControl; ARect: TRect); dynamic; + procedure DefaultHandler(var Message); override; + function Dragging: Boolean; + procedure DragDrop(Source: TObject; X, Y: Integer); dynamic; + function DrawTextBiDiModeFlags(Flags: Longint): Longint; + function DrawTextBiDiModeFlagsReadingOnly: Longint; + property Enabled: Boolean read GetEnabled write SetEnabled stored IsEnabledStored default True; + procedure EndDrag(Drop: Boolean); + function GetControlsAlignment: TAlignment; dynamic; + function GetParentComponent: TComponent; override; + function GetTextBuf(Buffer: PChar; BufSize: Integer): Integer; + function GetTextLen: Integer; + function HasParent: Boolean; override; + procedure Hide; + procedure InitiateAction; virtual; + procedure Invalidate; virtual; + function IsRightToLeft: Boolean; + function ManualDock(NewDockSite: TWinControl; DropControl: TControl = nil; + ControlSide: TAlign = alNone): Boolean; + function ManualFloat(ScreenPos: TRect): Boolean; + function Perform(Msg: Cardinal; WParam, LParam: Longint): Longint; + procedure Refresh; + function ReplaceDockedControl(Control: TControl; NewDockSite: TWinControl; + DropControl: TControl; ControlSide: TAlign): Boolean; + function ScreenToClient(const Point: TPoint): TPoint; + procedure SendToBack; + procedure SetBounds(ALeft, ATop, AWidth, AHeight: Integer); virtual; + procedure SetTextBuf(Buffer: PChar); + procedure Show; + procedure Update; virtual; + function UseRightToLeftAlignment: Boolean; dynamic; + function UseRightToLeftReading: Boolean; + function UseRightToLeftScrollBar: Boolean; + property Action: TBasicAction read GetAction write SetAction; + property Align: TAlign read FAlign write SetAlign default alNone; + property Anchors: TAnchors read FAnchors write FAnchors stored IsAnchorsStored default [akLeft, akTop]; + property BiDiMode: TBiDiMode read FBiDiMode write SetBiDiMode stored IsBiDiModeStored; + property BoundsRect: TRect read GetBoundsRect write SetBoundsRect; + property ClientHeight: Integer read GetClientHeight write SetClientHeight stored False; + property ClientOrigin: TPoint read GetClientOrigin; + property ClientRect: TRect read GetClientRect; + property ClientWidth: Integer read GetClientWidth write SetClientWidth stored False; + property Constraints: TSizeConstraints read FConstraints write FConstraints; + property ControlState: TControlState read FControlState write FControlState; + property ControlStyle: TControlStyle read FControlStyle write FControlStyle; + property DockOrientation: TDockOrientation read FDockOrientation write FDockOrientation; + property Floating: Boolean read GetFloating; + property FloatingDockSiteClass: TWinControlClass read GetFloatingDockSiteClass write FFloatingDockSiteClass; + property HostDockSite: TWinControl read FHostDockSite write SetHostDockSite; + property LRDockWidth: Integer read GetLRDockWidth write FLRDockWidth; + property Parent: TWinControl read FParent write SetParent; + property ShowHint: Boolean read FShowHint write SetShowHint stored IsShowHintStored; + property TBDockHeight: Integer read GetTBDockHeight write FTBDockHeight; + property UndockHeight: Integer read GetUndockHeight write FUndockHeight; + property UndockWidth: Integer read GetUndockWidth write FUndockWidth; + property Visible: Boolean read FVisible write SetVisible stored IsVisibleStored default True; + property WindowProc: TWndMethod read FWindowProc write FWindowProc; + published + property Left: Integer read FLeft write SetLeft; + property Top: Integer read FTop write SetTop; + property Width: Integer read FWidth write SetWidth; + property Height: Integer read FHeight write SetHeight; + property Cursor: TCursor read FCursor write SetCursor default crDefault; + property Hint: string read FHint write FHint stored IsHintStored; +*/ +}; + +#endif |