]> git.saurik.com Git - wxWidgets.git/blame - utils/dialoged/src/winstyle.h
don't crash when invalid colour is set as fg/bg colour
[wxWidgets.git] / utils / dialoged / src / winstyle.h
CommitLineData
7c23a0b0
JS
1/////////////////////////////////////////////////////////////////////////////
2// Name: winstyle.h
3// Purpose: Window styles
4// Author: Julian Smart
5// Modified by:
6// Created: 04/01/98
7// RCS-ID: $Id$
8// Copyright: (c) Julian Smart
9// Licence: wxWindows licence
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _DE_WINSTYLE_H_
13#define _DE_WINSTYLE_H_
14
15#ifdef __GNUG__
16#pragma interface "winstyle.h"
17#endif
18
19#include "wx/wx.h"
20
21/*
f6bcfd97
BP
22* A class for storing/generating window styles.
23*/
7c23a0b0
JS
24
25class wxWindowStyleClass;
26
27class wxWindowStylePair
28{
29 friend class wxWindowStyleClass;
30public:
31 char* m_styleName;
32 long m_styleId;
33};
34
35class wxWindowStyleTable: public wxObject
36{
37public:
38 wxWindowStyleTable();
39 ~wxWindowStyleTable();
f6bcfd97
BP
40
41 // Operations
7c23a0b0
JS
42 void ClearTable();
43 void AddStyles(const wxString& className, int n, wxWindowStylePair *styles);
44 wxWindowStyleClass* FindClass(const wxString& className) ;
45 bool GenerateStyleStrings(const wxString& className, long windowStyle, char *buf);
f6bcfd97 46
7c23a0b0
JS
47 // Initialise with all possible styles
48 void Init();
f6bcfd97
BP
49
50 // Members
7c23a0b0
JS
51protected:
52 wxList m_classes; // A list of wxWindowStyleClass objects, indexed by class name
f6bcfd97 53
7c23a0b0
JS
54};
55
56/*
f6bcfd97
BP
57* Classes for storing all the window style identifiers associated with a particular class
58*/
7c23a0b0
JS
59
60class wxWindowStyleClass: public wxObject
61{
62public:
63 wxWindowStyleClass(int n, wxWindowStylePair *styles);
64 ~wxWindowStyleClass();
f6bcfd97
BP
65
66 // Operations
7c23a0b0
JS
67 void GenerateStyleStrings(long windowStyle, char *buf);
68 bool GenerateStyle(char *buf, long windowStyle, long flag, const wxString& strStyle);
f6bcfd97
BP
69
70 // Members
7c23a0b0
JS
71protected:
72 wxWindowStylePair* m_styles; // An array of wxWindowStylePair objects
73 int m_styleCount;
74};
75
76#endif
f6bcfd97 77// _DE_WINSTYLE_H_