@@ -207,6 +207,78 @@ drawing(bool testMode)
207207 pdf.SetFillColour (wxColour (200 , 200 , 200 ));
208208 pdf.RoundedRect (140 , 255 , 40 , 30 , 8.0 , wxPDF_CORNER_TOP_RIGHT | wxPDF_CORNER_BOTTOM_RIGHT, wxPDF_STYLE_FILLDRAW);
209209
210+ // Examples of various fill patterns
211+ pdf.AddPage ();
212+
213+ pdf.Text (10 , 15 , wxS (" Fill pattern examples" ));
214+ pdf.SetDrawColour (wxColour (0 , 0 , 0 ));
215+
216+ int tplHatch = pdf.BeginTemplate (0 , 0 , 4 , 4 );
217+ pdf.SetTextColour (0 );
218+ pdf.SetDrawColour (wxColour (0 , 0 , 0 ));
219+ pdf.SetFillColour (wxColour (128 , 128 , 255 ));
220+ pdf.Circle (2 , 2 , 1.5 , 0 , 360 , wxPDF_STYLE_FILLDRAW);
221+ pdf.SetFillColour (wxColour (128 , 255 , 128 ));
222+ pdf.Rect (2 , 2 , 1.75 , 1.75 , wxPDF_STYLE_FILLDRAW);
223+ pdf.EndTemplate ();
224+
225+ pdf.AddPattern (wxS (" hatch1" ), wxPDF_PATTERNSTYLE_BDIAGONAL_HATCH, 1 , 1 , wxColour (224 , 0 , 0 ));
226+ pdf.AddPattern (wxS (" hatch2" ), wxPDF_PATTERNSTYLE_FDIAGONAL_HATCH, 2 , 2 , wxColour (160 , 160 , 0 ));
227+ pdf.AddPattern (wxS (" hatch3" ), wxPDF_PATTERNSTYLE_CROSSDIAG_HATCH, 4 , 4 , wxColour (224 , 0 , 224 ));
228+ pdf.AddPattern (wxS (" hatch4" ), wxPDF_PATTERNSTYLE_HORIZONTAL_HATCH, 1 , 1 , wxColour (255 , 0 , 0 ));
229+ pdf.AddPattern (wxS (" hatch5" ), wxPDF_PATTERNSTYLE_VERTICAL_HATCH, 2 , 2 , wxColour (0 , 0 , 255 ));
230+ pdf.AddPattern (wxS (" hatch6" ), wxPDF_PATTERNSTYLE_CROSS_HATCH, 4 , 4 , wxColour (0 , 96 , 0 ));
231+ pdf.AddPattern (wxS (" hatch7" ), wxPDF_PATTERNSTYLE_BRICK_HATCH, 2 , 2 , wxColour (96 , 96 , 96 ), wxColour (255 , 192 , 128 ));
232+ pdf.AddPattern (wxS (" hatch8" ), wxPDF_PATTERNSTYLE_HERRINGBONE_HATCH, 2 , 2 , wxColour (128 , 128 , 128 ));
233+ pdf.AddPattern (wxS (" hatch9" ), wxPDF_PATTERNSTYLE_BASKETWEAVE_HATCH, 2 , 2 , wxColour (224 , 160 , 96 ));
234+
235+ pdf.AddPattern (wxS (" hatch10" ), tplHatch, 4 , 4 );
236+ pdf.AddPattern (wxS (" hatch11" ), tplHatch, 6 , 6 );
237+
238+ pdf.Text (25 , 25 , wxS (" BDiagonal" ));
239+ pdf.SetFillPattern (wxS (" hatch1" ));
240+ pdf.Rect (25 , 30 , 25 , 25 , wxPDF_STYLE_FILLDRAW);
241+
242+ pdf.Text (75 , 25 , wxS (" FDiagonal" ));
243+ pdf.SetFillPattern (wxS (" hatch2" ));
244+ pdf.Rect (75 , 30 , 25 , 25 , wxPDF_STYLE_FILLDRAW);
245+
246+ pdf.Text (125 , 25 , wxS (" CrossDiag" ));
247+ pdf.SetFillPattern (wxS (" hatch3" ));
248+ pdf.Rect (125 , 30 , 25 , 25 , wxPDF_STYLE_FILLDRAW);
249+
250+ pdf.Text (25 , 65 , wxS (" Horizontal" ));
251+ pdf.SetFillPattern (wxS (" hatch4" ));
252+ pdf.Rect (25 , 70 , 25 , 25 , wxPDF_STYLE_FILLDRAW);
253+
254+ pdf.Text (75 , 65 , wxS (" Vertical" ));
255+ pdf.SetFillPattern (wxS (" hatch5" ));
256+ pdf.Rect (75 , 70 , 25 , 25 , wxPDF_STYLE_FILLDRAW);
257+
258+ pdf.Text (125 , 65 , wxS (" Cross" ));
259+ pdf.SetFillPattern (wxS (" hatch6" ));
260+ pdf.Rect (125 , 70 , 25 , 25 , wxPDF_STYLE_FILLDRAW);
261+
262+ pdf.Text (25 , 105 , wxS (" Brick" ));
263+ pdf.SetFillPattern (wxS (" hatch7" ));
264+ pdf.Rect (25 , 110 , 25 , 25 , wxPDF_STYLE_FILLDRAW);
265+
266+ pdf.Text (75 , 105 , wxS (" HerringBone" ));
267+ pdf.SetFillPattern (wxS (" hatch8" ));
268+ pdf.Rect (75 , 110 , 25 , 25 , wxPDF_STYLE_FILLDRAW);
269+
270+ pdf.Text (125 , 105 , wxS (" BasketWeave" ));
271+ pdf.SetFillPattern (wxS (" hatch9" ));
272+ pdf.Rect (125 , 110 , 25 , 25 , wxPDF_STYLE_FILLDRAW);
273+
274+ pdf.Text (25 , 145 , wxS (" Template 1x" ));
275+ pdf.SetFillPattern (wxS (" hatch10" ));
276+ pdf.Rect (25 , 150 , 40 , 40 , wxPDF_STYLE_FILLDRAW);
277+
278+ pdf.Text (75 , 145 , wxS (" Template 2x" ));
279+ pdf.SetFillPattern (wxS (" hatch11" ));
280+ pdf.Rect (75 , 150 , 40 , 40 , wxPDF_STYLE_FILLDRAW);
281+
210282 pdf.AddPage ();
211283
212284 pdf.SetFont (wxS (" Helvetica" ), wxS (" B" ), 20 );
@@ -275,6 +347,7 @@ drawing(bool testMode)
275347 pdf.SetTextColour (0 );
276348
277349 pdf.AddPage ();
350+ pdf.SetAutoPageBreak (false );
278351 pdf.SetFont (wxS (" Helvetica" ), wxS (" " ), 10 );
279352 pdf.SetLineWidth (0.2 );
280353 pdf.SetDrawColour (0 );
0 commit comments