Unit 'msesimplewidgets' Package
[Overview][Constants][Types][Classes][Index] [#msegui]

tpaintbox

[Properties (by Name)] [Methods (by Name)]

Widget dedicated to custom drawing

Declaration

Source position: msesimplewidgets.pas line 746

type tpaintbox = class(tscrollbox)

published

  property font: twidgetfont; [rws]

  property onbeforepaint: painteventty;

  property onpaintbackground: painteventty;

  property onpaint: painteventty;

  property onafterpaint: painteventty;

  property onmouseevent: mouseeventty;

  property onchildmouseevent: mouseeventty;

  property onclientmouseevent: mouseeventty;

  property onmousewheelevent: mousewheeleventty;

  property onkeydown: keyeventty;

  property onkeyup: keyeventty;

  property onshortcut: shortcuteventty;

  property onresize: notifyeventty;

  property onmove: notifyeventty;

end;

Inheritance

tpaintbox

  

Widget dedicated to custom drawing

|

tscrollbox

|

tscalingwidget

|

tcustomscalingwidget

|

tpublishedwidget

|

tpublishedwidgetnwr

|

tactionpublishedwidgetnwr

|

tactionwidget

|

twidget

|

tactcomponent,iscrollframe,iface,iassistiveclient

|

tmsecomponent,iactivatorclient

  

Extends the FPC tcomponent with object linking facilities and the like; base of every MSEgui component

|

tcomponent,ievent,iificommand,iificlient

|

tpersistent

|

TObject

Description

Widget dedicated to custom drawing: fill its onpaint event with drawing instructions on the acanvas: tcanvas parameter, as in the following example, which fills the background, draws a shaded ellipse, a diagonal line and a few points.

uses
  main_mfm;

procedure tmainfo.paintbox1_paint(const sender: twidget;
               const acanvas: tcanvas);
var
  x: integer;
begin
  acanvas.fillrect(makerect(0, 0, sender.bounds_cx, sender.bounds_cy), cl_ltgray);

  acanvas.fillellipse(makerect(sender.bounds_cx div 2, sender.bounds_cy div 2, 100, 100), cl_gray, cl_dkgray);

  acanvas.drawline(
    makepoint(0, 0),
    makepoint(sender.bounds_cx, sender.bounds_cy),
    cl_yellow
  );

  for x := 0 to 9 do
    acanvas.drawpoint(makepoint(x, 0), cl_magenta);
end;

Documentation generated on: 2026-10-03