[Lazarus] GTK 3.0

Martin Schreiber mse00000 at gmail.com
Thu Jul 14 14:24:25 CEST 2016


On Wednesday 13 July 2016 19:22:03 Dmitry Boyarintsev wrote:
> On Wed, Jul 13, 2016 at 12:13 PM, Graeme Geldenhuys <
>
> mailinglists at geldenhuys.co.uk> wrote:
> > Because it is 100% cross-platform, custom drawn and implemented in Object
> > Pascal - it
> > can support any LCL feature on all target OSes. Whereas with other LCL
> > widgetsets, there are plenty of platform specific limitations.
>
> How does it handle an OS specific limitations?
> For example:
> * drawing outside of the paint event? Where some (Carbon, Cocoa) widgetset
> forbid that.

For MSEgui:

The signature of the widget paint procedure is
"
procedure twidget.paint(const canvas: tcanvas);
"
Where "canvas" can be a window, bitmap or printer canvas. If twidget.paint() 
is called by twindow.update() - normally automatically when the main thread 
event queue gets idle - an intermediate bitmap canvas of the size of the 
updateregion is created for paint() which will be copied to the window handle 
at the end. This eliminates flicker in a platform neutral way.
Calling paint() without a canvas is not supported.

> * platform specific mouse behavior. OSX ctrl+mouseclick should trigger
> popup menu (= right click)
>
MSEgui does not support OSX directly currently but I am sure that I'll find an 
elegant and configurable way to show the popup menu by Ctrl+LeftClick instead 
of RightClick if necessary. ;-)

Currently the code is:
"
procedure tactionwidget.clientmouseevent(var info: mouseeventinfoty);
var
 dummy: tpopupmenu;
 po1: pointty;
begin
 if canevent(tmethod(fonclientmouseevent)) then begin
  fonclientmouseevent(self,info);
 end;
 inherited;
 with info do begin
  if (eventkind = ek_buttonrelease) and (ws_rclicked in fwidgetstate) and
             not (csdesigning in componentstate) and
             (eventstate * [es_processed,es_child] = []) and
             (button = mb_right) then begin
   dummy:= nil;
   po1:= info.pos;
   dopopup(dummy,info);
   info.pos:= po1; //no mousemove by change of popup pos
  end;
 end;
end;
"

Martin


More information about the Lazarus mailing list