summaryrefslogtreecommitdiff
path: root/gfx/x11
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graemeg@users.sourceforge.net>2006-12-05 23:14:16 +0000
committerGraeme Geldenhuys <graemeg@users.sourceforge.net>2006-12-05 23:14:16 +0000
commitef70fd0f2770f0e084400373e786050f8dca6eba (patch)
treeb217e753d984541da6834bd994012b18b9c9696f /gfx/x11
parent8a4707265b7c0424e1bc50b7ed40315c7800fd3b (diff)
downloadfpGUI-ef70fd0f2770f0e084400373e786050f8dca6eba.tar.xz
One-Handle-Per-Widget
* Implemented the TX11Application Expose event handling * Implemented the TX11Window etPaint message processing * Removed the EvOnPaint event handler and replaced it by overriding ProcessEvent
Diffstat (limited to 'gfx/x11')
-rw-r--r--gfx/x11/gfx_x11.pas28
1 files changed, 19 insertions, 9 deletions
diff --git a/gfx/x11/gfx_x11.pas b/gfx/x11/gfx_x11.pas
index f4949007..f6f1ef38 100644
--- a/gfx/x11/gfx_x11.pas
+++ b/gfx/x11/gfx_x11.pas
@@ -1083,7 +1083,17 @@ begin
end;
X.Expose:
begin
- WindowEntry.Dispatch(XEvent);
+ {$Note We can do performance tuning here by looking at Count.
+ For now we are just ignoring all expose messages where Count <> 0 }
+ if XEvent.xexpose.count = 0 then
+ begin
+ Event.EventType := etPaint;
+ Event.X := XEvent.xexpose.x;
+ Event.Y := XEvent.xexpose.y;
+ Event.Width := XEvent.xexpose.width;
+ Event.Height := Xevent.xexpose.height;
+ WindowEntry.ProcessEvent(Event);
+ end;
end;
X.ConfigureNotify:
begin
@@ -1571,18 +1581,18 @@ begin
else
Sum := 1;
- // Check for other mouse wheel messages in the queue
+ // Check for other mouse wheel messages in the queue
while XCheckTypedWindowEvent(GFApplication.Handle, Handle, X.ButtonPress, @NewEvent) do
begin
- if NewEvent.xbutton.Button = 4 then
- Dec(Sum)
+ if NewEvent.xbutton.Button = 4 then
+ Dec(Sum)
else if NewEvent.xbutton.Button = 5 then
- Inc(Sum)
+ Inc(Sum)
else
- begin
- XPutBackEvent(GFApplication.Handle, @NewEvent);
+ begin
+ XPutBackEvent(GFApplication.Handle, @NewEvent);
break;
- end;
+ end;
end;
if Assigned(OnMouseWheel) then
@@ -1610,7 +1620,7 @@ begin
end;
etPaint:
begin
-
+ if Assigned(OnPaint) then OnPaint(Self, Rect(AEvent.X, AEvent.Y, AEvent.Width, AEvent.Height));
end;
etMove:
begin