diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/gfx_widget.pas | 18 | ||||
-rw-r--r-- | src/gui/gui_edit.pas | 9 | ||||
-rw-r--r-- | src/gui/gui_form.pas | 2 |
3 files changed, 15 insertions, 14 deletions
diff --git a/src/corelib/gfx_widget.pas b/src/corelib/gfx_widget.pas index 24d69381..9d569e66 100644 --- a/src/corelib/gfx_widget.pas +++ b/src/corelib/gfx_widget.pas @@ -16,8 +16,6 @@ type TFocusSearchDirection = (fsdFirst, fsdLast, fsdNext, fsdPrev); - { TfpgWidget } - TfpgWidget = class(TfpgWindow) private FAlignRect: TfpgRect; @@ -32,6 +30,7 @@ type FOnMouseUp: TMouseButtonEvent; FOnPaint: TPaintEvent; FOnKeyPress: TKeyPressEvent; + FOnResize: TNotifyEvent; FOnScreen: boolean; procedure SetActiveWidget(const AValue: TfpgWidget); protected @@ -93,17 +92,18 @@ type procedure MoveAndResize(aleft, atop, awidth, aheight: TfpgCoord); procedure RePaint; { property events } - property OnPaint: TPaintEvent read FOnPaint write FOnPaint; + property OnClick: TNotifyEvent read FOnClick write FOnClick; + property OnDoubleClick: TMouseButtonEvent read FOnDoubleClick write FOnDoubleClick; property OnEnter: TNotifyEvent read FOnEnter write FOnEnter; property OnExit: TNotifyEvent read FOnExit write FOnExit; - property OnMouseExit: TNotifyEvent read FOnMouseExit write FOnMouseExit; + property OnKeyPress: TKeyPressEvent read FOnKeyPress write FOnKeyPress; + property OnMouseDown: TMouseButtonEvent read FOnMouseDown write FOnMouseDown; property OnMouseEnter: TNotifyEvent read FOnMouseEnter write FOnMouseEnter; + property OnMouseExit: TNotifyEvent read FOnMouseExit write FOnMouseExit; property OnMouseMove: TMouseMoveEvent read FOnMouseMove write FOnMouseMove; - property OnMouseDown: TMouseButtonEvent read FOnMouseDown write FOnMouseDown; property OnMouseUp: TMouseButtonEvent read FOnMouseUp write FOnMouseUp; - property OnClick: TNotifyEvent read FOnClick write FOnClick; - property OnDoubleClick: TMouseButtonEvent read FOnDoubleClick write FOnDoubleClick; - property OnKeyPress: TKeyPressEvent read FOnKeyPress write FOnKeyPress; + property OnPaint: TPaintEvent read FOnPaint write FOnPaint; + property OnResize: TNotifyEvent read FOnResize write FOnResize; public constructor Create(AOwner: TComponent); override; destructor Destroy; override; @@ -867,6 +867,8 @@ begin begin FFormDesigner.Dispatch(msg); end; + if Assigned(FOnResize) then + FOnResize(Self); end; procedure TfpgWidget.HandleResize(awidth, aheight: TfpgCoord); diff --git a/src/gui/gui_edit.pas b/src/gui/gui_edit.pas index ccfe5418..278442ad 100644 --- a/src/gui/gui_edit.pas +++ b/src/gui/gui_edit.pas @@ -33,8 +33,6 @@ type TfpgEditBorderStyle = (bsNone, bsDefault, bsSingle); - { TfpgCustomEdit } - TfpgCustomEdit = class(TfpgWidget) private FAutoSelect: Boolean; @@ -115,6 +113,7 @@ type TfpgEdit = class(TfpgCustomEdit) public + property Font; property PopupMenu; // UI Designer doesn't fully support it yet published property AutoSelect; @@ -137,8 +136,6 @@ type end; - { TfpgBaseNumericEdit } - TfpgBaseNumericEdit = class(TfpgCustomEdit) private fOldColor: TfpgColor; @@ -237,7 +234,8 @@ begin Result := TfpgEdit.Create(AOwner); Result.Left := x; Result.Top := y; - Result.Width := w; + if w > 0 then + Result.Width := w; if h < TfpgEdit(Result).FFont.Height + 6 then Result.Height:= TfpgEdit(Result).FFont.Height + 6 else @@ -404,7 +402,6 @@ begin Canvas.SetFont(FFont); Canvas.SetTextColor(FTextColor); - // fpgStyle.DrawString(Canvas, -FTextOffset + FSideMargin, 3, dtext, Enabled); fpgStyle.DrawString(Canvas, -FDrawOffset + FSideMargin, 3, FVisibleText, Enabled); if Focused then diff --git a/src/gui/gui_form.pas b/src/gui/gui_form.pas index ea68397b..d4a1ec18 100644 --- a/src/gui/gui_form.pas +++ b/src/gui/gui_form.pas @@ -85,6 +85,7 @@ type property TextColor; property WindowPosition: TWindowPosition read FWindowPosition write FWindowPosition default wpAuto; property WindowTitle: string read FWindowTitle write SetWindowTitle; + // events property OnActivate: TNotifyEvent read FOnActivate write FOnActivate; property OnClose: TFormCloseEvent read FOnClose write FOnClose; property OnCloseQuery: TFormCloseQueryEvent read FOnCloseQuery write FOnCloseQuery; @@ -93,6 +94,7 @@ type property OnDestroy: TNotifyEvent read FOnDestroy write FOnDestroy; property OnHide: TNotifyEvent read FOnHide write FOnHide; property OnPaint; + property OnResize; property OnShow: TNotifyEvent read FOnShow write FOnShow; end; |