summaryrefslogtreecommitdiff
path: root/prototypes
diff options
context:
space:
mode:
authorsekelsenmat <sekelsenmat@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2007-07-12 21:56:22 +0000
committersekelsenmat <sekelsenmat@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2007-07-12 21:56:22 +0000
commit81524e9b9ca043909ec2a65a2b5624395d851bd8 (patch)
tree7a496d63e39be5e707de412387706c59184156cd /prototypes
parent472fef946bd1a41845ee2e471cb42e895ead77b6 (diff)
downloadfpGUI-81524e9b9ca043909ec2a65a2b5624395d851bd8.tar.xz
Small improvement to newmultihandle
Diffstat (limited to 'prototypes')
-rw-r--r--prototypes/newmultihandle/gui_edit.inc14
-rw-r--r--prototypes/newmultihandle/gui_style.inc8
2 files changed, 18 insertions, 4 deletions
diff --git a/prototypes/newmultihandle/gui_edit.inc b/prototypes/newmultihandle/gui_edit.inc
index ab23f13d..3e3deb56 100644
--- a/prototypes/newmultihandle/gui_edit.inc
+++ b/prototypes/newmultihandle/gui_edit.inc
@@ -15,6 +15,7 @@ type
procedure EvFocusOut; override;
procedure EvKeyPressed(AKey: Word); override;
procedure EvKeyReleased(AKey: Word); override;
+ procedure EvKeyChar(AKeyChar: Char); override;
procedure EvMousePressed(AButton: TMouseButton; const AMousePos: TPoint); override;
procedure EvMouseReleased(AButton: TMouseButton; const AMousePos: TPoint); override;
procedure EvPaint; override;
@@ -66,9 +67,18 @@ begin
inherited EvKeyReleased(AKey);
end;
+procedure TFEdit.EvKeyChar(AKeyChar: Char);
+begin
+ WriteLn('KeyChar');
+
+ FText := FText + AKeyChar;
+
+ Invalidate;
+end;
+
procedure TFEdit.EvMousePressed(AButton: TMouseButton; const AMousePos: TPoint);
begin
- inherited EvMousePressed(AButton, AMousePos);
+ Self.CaptureMouse;
end;
procedure TFEdit.EvMouseReleased(AButton: TMouseButton;
@@ -81,7 +91,7 @@ procedure TFEdit.EvPaint;
begin
{ Draw the edit }
- GFDefaultStyle.DrawEdit(Canvas, Bounds(0, 0, Width, Height));
+ GFDefaultStyle.DrawEdit(Canvas, Bounds(0, 0, Width, Height), FText);
inherited EvPaint();
end;
diff --git a/prototypes/newmultihandle/gui_style.inc b/prototypes/newmultihandle/gui_style.inc
index f6aa7de1..0c11bf0b 100644
--- a/prototypes/newmultihandle/gui_style.inc
+++ b/prototypes/newmultihandle/gui_style.inc
@@ -15,7 +15,7 @@ type
procedure DrawButtonFace(ACanvas: TFCustomCanvas; ARect: TRect; AFlags: TFButtonFlags); virtual;
procedure DrawControlFrame(ACanvas: TFCustomCanvas; ARect: TRect); virtual;
procedure DrawDirectionArrow(ACanvas: TFCustomCanvas; ARect: TRect; direction: Integer); virtual;
- procedure DrawEdit(ACanvas: TFCustomCanvas; ARect: TRect); virtual;
+ procedure DrawEdit(ACanvas: TFCustomCanvas; ARect: TRect; AText: string); virtual;
end;
const
@@ -88,12 +88,16 @@ procedure TFStyle.DrawDirectionArrow(ACanvas: TFCustomCanvas; ARect: TRect; dire
begin
end;
-procedure TFStyle.DrawEdit(ACanvas: TFCustomCanvas; ARect: TRect);
+procedure TFStyle.DrawEdit(ACanvas: TFCustomCanvas; ARect: TRect; AText: string);
begin
{ Inner area }
ACanvas.SetColor(colWhite);
ACanvas.FillRect(ARect);
+ { The text }
+
+ ACanvas.TextOut(Point(5, 0), AText);
+
{ Outer border }
ACanvas.SetColor(colGrayBlue);
ACanvas.DrawRect(ARect);