Class tpaintbox

Unit

Declaration

type tpaintbox = class(tscrollbox)

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;

image

Hierarchy

Overview

Properties

Published property font: twidgetfont read getfont write setfont stored isfontstored;
Published property onbeforepaint;
Published property onpaintbackground;
Published property onpaint;
Published property onafterpaint;
Published property onmouseevent;
Published property onchildmouseevent;
Published property onclientmouseevent;
Published property onmousewheelevent;
Published property onkeydown;
Published property onkeyup;
Published property onshortcut;
Published property onresize;
Published property onmove;

Description

Properties

Published property font: twidgetfont read getfont write setfont stored isfontstored;

This item has no description.

Published property onbeforepaint;

This item has no description.

Published property onpaintbackground;

This item has no description.

Published property onpaint;

This item has no description.

Published property onafterpaint;

This item has no description.

Published property onmouseevent;

This item has no description.

Published property onchildmouseevent;

This item has no description.

Published property onclientmouseevent;

This item has no description.

Published property onmousewheelevent;

This item has no description.

Published property onkeydown;

This item has no description.

Published property onkeyup;

This item has no description.

Published property onshortcut;

This item has no description.

Published property onresize;

This item has no description.

Published property onmove;

This item has no description. Showing description inherited from tcustomscalingwidget.onmove.

Fires once the widget has actually been moved, i.e. only if its x or y position really changed (not on every call that sets the widget's bounds).


Generated by PasDoc 1.0.4.