]> git.saurik.com Git - wxWidgets.git/blob - contrib/samples/ogl/studio/symbols.h
Document wxTextCtrl::XYToPosition, PositionToXY and GetLineLength change
[wxWidgets.git] / contrib / samples / ogl / studio / symbols.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: symbols.h
3 // Purpose: Symbol classes (symbol database)
4 // Author: Julian Smart
5 // Modified by:
6 // Created: 12/07/98
7 // RCS-ID: $Id$
8 // Copyright: (c) Julian Smart
9 // Licence:
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _STUDIO_SYMBOLS_H_
13 #define _STUDIO_SYMBOLS_H_
14
15 #if defined(__GNUG__) && !defined(__APPLE__)
16 // #pragma interface
17 #endif
18
19 #include <wx/docview.h>
20 #include <wx/string.h>
21
22 #include <wx/ogl/ogl.h> // base header of OGL, includes and adjusts wx/deprecated/setup.h
23
24 /*
25 * csSymbol
26 * Represents information about a symbol.
27 */
28
29 class csSymbol: public wxObject
30 {
31 public:
32 csSymbol(const wxString& name, wxShape* shape);
33 ~csSymbol();
34
35 inline void SetName(const wxString& name) { m_name = name; }
36 inline wxString GetName() const { return m_name; }
37
38 inline void SetShape(wxShape* shape) { m_shape = shape; }
39 inline wxShape* GetShape() const { return m_shape; }
40
41 inline void SetToolId(int id) { m_toolId = id; }
42 inline int GetToolId() const { return m_toolId; }
43 protected:
44 wxString m_name;
45 wxShape* m_shape;
46 int m_toolId;
47 };
48
49 /*
50 * A table of all possible shapes.
51 * We can use this to construct a palette, etc.
52 */
53 class csSymbolDatabase: public wxObject
54 {
55 public:
56 csSymbolDatabase();
57 ~csSymbolDatabase();
58
59 // Accessors
60 inline wxList& GetSymbols() const { return (wxList&) m_symbols; }
61
62 // Operations
63 void AddSymbol(csSymbol* symbol);
64 void ClearSymbols();
65 csSymbol* FindSymbol(const wxString& name) const;
66 csSymbol* FindSymbol(int toolId) const;
67 wxBitmap* CreateToolBitmap(csSymbol* symbol, const wxSize& sz);
68
69 protected:
70 wxList m_symbols;
71 int m_currentId;
72 };
73
74 #endif
75 // _STUDIO_SYMBOLS_H_