summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graemeg@gmail.com>2013-03-19 22:50:30 +0000
committerGraeme Geldenhuys <graemeg@gmail.com>2013-03-19 22:50:30 +0000
commit06f4a49c32f9d33e041e3567ef314d1fae90048a (patch)
tree8cecd6c535f6b848ea62ecb7b1a93344b6f65f4e
parent8f6832763d085801f41f37927b767e524068bbec (diff)
downloadfpGUI-06f4a49c32f9d33e041e3567ef314d1fae90048a.tar.xz
docs: adds new docs for fpg_grid.pas unit.
-rw-r--r--docs/fpgui-docs-project.xml1
-rw-r--r--docs/xml/gui/fpg_grid.xml54
2 files changed, 55 insertions, 0 deletions
diff --git a/docs/fpgui-docs-project.xml b/docs/fpgui-docs-project.xml
index 435281d6..c4758228 100644
--- a/docs/fpgui-docs-project.xml
+++ b/docs/fpgui-docs-project.xml
@@ -124,6 +124,7 @@
<description file="xml/gui/fpg_tree.xml"/>
<description file="xml/gui/fpg_basegrid.xml"/>
<description file="xml/gui/fpg_form.xml"/>
+ <description file="xml/gui/fpg_grid.xml"/>
</descriptions>
</package>
</packages>
diff --git a/docs/xml/gui/fpg_grid.xml b/docs/xml/gui/fpg_grid.xml
new file mode 100644
index 00000000..a916a544
--- /dev/null
+++ b/docs/xml/gui/fpg_grid.xml
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<fpdoc-descriptions>
+<package name="fpGUI">
+
+<module name="fpg_grid">
+<short>This unit contains higher level grid widgets</short>
+<descr><printshort id="#fpgui.fpg_grid"/>. A File Grid and a String Grid widget.</descr>
+
+<element name="TfpgStringGrid.ShowGrid">
+<short>Enable or disable grid line painting</short>
+<descr>If enabled (the default), then grid lines are drawn around each cell.</descr>
+</element>
+
+<element name="TfpgStringGrid.OnDrawCell">
+<short>This event allows you to do custom painting of grid cells</short>
+<descr><p>ARow and ACol parameters should be obvious - they point to the cell being
+drawn. ARect is the boundaries of the Cell being painted. AFlags contain some
+state information about the grid. eg: Has the grid got focus, has the cell got
+focus etc. ADefaultDrawing is set to True by default, which means the grid
+will take care of painting the cell text for you (taking into account layout
+and alignment settings of each column). If you set this to False, then you
+need to paint the text yourself.</p>
+<code>
+procedure TMainForm.StringGridDrawCell(Sender: TObject; const ARow,
+ ACol: Integer; const ARect: TfpgRect; const AFlags: TfpgGridDrawState;
+ var ADefaultDrawing: boolean);
+begin
+ // two rows with different background color
+ if (ARow = 7) or (ARow = 8) then
+ begin
+ if ((gdSelected in AFlags) and (gdFocused in AFlags)) or
+ (gdSelected in AFlags) then
+ Exit; // we want select cel to be painted as normal
+ // If we got here, we must do some painting. The background first.
+ StringGrid.Canvas.Color := clOrange;
+ StringGrid.Canvas.FillRectangle(ARect);
+ // NOTE: We want the grid to take care of the drawing of the text, which
+ // handles text layout and alignment, so we MUST NOT set the
+ // ADefaultDrawing to False. If we do, we need to handle text painting
+ // ourselves.
+ end;
+end;
+</code>
+</descr>
+<seealso>
+ <link id="#fpgui.fpg_basegrid.TfpgDrawCellEvent">fpg_basegrid.TfpgDrawCellEvent</link>
+</seealso>
+</element>
+
+
+</module>
+</package>
+</fpdoc-descriptions>
+