LXRAD 0.7
ccanvas.h
Go to the documentation of this file.
1/* ########################################################################
2
3 LXRAD - GUI for X programing
4
5 ########################################################################
6
7 Copyright (c) : 2001-2021 Luis Claudio Gamboa Lopes
8
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2, or (at your option)
12 any later version.
13
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22
23 For e-mail suggestions : lcgamboa@yahoo.com
24 ######################################################################## */
25
32#ifndef CCANVAS
33#define CCANVAS
34
35#include"cobject.h"
36#include"cwindow.h"
37
38
43class CCanvas:public CObject
44{
45private:
46 uint LWidth;
47 wxWindow *Drawable;
48 wxBitmap *Bitmap;
49 wxColor FgColor, BgColor;
50 wxClientDC* WDC;
51 wxDC* DC;
52 wxGraphicsContext * GC;
53 wxBitmap * BitmapBuffer;
54 wxPen *Pen;
55 wxBrush *Brush;
56 wxFont Font;
57 int Width;
58 int Height;
59 int DirectDraw;
60 int orientation;
61 void Rotate(float *x, float *y);
62 double Scalex;
63 double Scaley;
64public:
65 CCanvas (void);
66 ~CCanvas (void);
67 int Create (wxWindow * drawable,int directdraw);
68 int Create (wxWindow *drawable, wxBitmap * bitmap);
69 void Destroy(void);
70 void Init(void);
71 void Init(double sx, double sy, int angle=0);
72 void ChangeScale(double sx,double sy);
73 void End(void);
74 wxDC* GetDC (void);
75 wxClientDC* GetWDC (void);
76 wxBitmap * GetBitmapBuffer(void);
77 wxWindow * GetDrawable(void);
78 void SetBitmap(wxBitmap * bitmap,double xs, double ys);
79 void SetFunction (wxRasterOperationMode function);
80 void SetColor (wxColor color);
81 void SetColor (lxString color);
82 void SetColor (uint r, uint g, uint b);
83 void SetFgColor (wxColor color);
84 void SetFgColor (lxString color);
85 void SetFgColor (uint r, uint g, uint b);
86 void SetFont (wxFont font);
87 wxColor GetFgColor (void);
94 void SetBgColor (wxColor color);
101 void SetBgColor (lxString color);
110 void SetBgColor (uint r, uint g, uint b);
116 wxColor GetBgColor (void);
117 void SetLineWidth (uint lwidth);
118 uint GetLineWidth (void);
119 void Point (float x, float y);
120 void Points (wxPoint * points, int npoints);
121 void Line (float x1_, float y1_, float x2_, float y2_);
122 void Lines (wxPoint * points, int npoints);
123 void Spline (wxPoint * points, int npoints);
124 //void Segments (wxSegment * segs, int nsegs);
125 void Rectangle (bool filled, float x, float y, float width, float height);
126 void Arc (bool filled, int x, int y, int x1, int y1, int x2, int y2);
127 void Circle (bool filled, float x, float y, float radius);
128 void Text (lxString str, float x, float y);
129 void RotatedText (lxString str, float x, float y, float angle);
130 void TextOnRect (lxString str, wxRect, unsigned int align );
131 void Polygon (bool filled, wxPoint * points, int npoints);
132 void Ellipse(bool filled,int x, int y, int width, int height);
133 void EllipticArc(bool filled,int x, int y, int width, int height, double start, double end);
134 void PutBitmap(wxBitmap * bitmap,float x, float y);
135
136 void FloodFill(int x, int y,wxColor color, wxFloodFillStyle style);
137//events
138};
139#endif
Canvas Control.
Definition: ccanvas.h:44
void SetBgColor(wxColor color)
void SetBgColor(uint r, uint g, uint b)
wxColor GetBgColor(void)
void SetBgColor(lxString color)
Generic Object.
Definition: cobject.h:43