You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
UI Style Lang is a simple CSS-like language which allows for drawing and styling wxPython elements. Many UI Style Lang properties are the same as the normal (not short-hand) CSS3 properties. This provides a familiar syntax, especially for those with experience with CSS3.
8
8
9
-
Stylesheet example:
9
+
If you are looking for an easy way to:
10
10
11
-
```
12
-
@style my-element {
13
-
border-radius: 15px;
14
-
width: 20px;
15
-
height 30px;
16
-
top: 20px;
17
-
left: 500px;
18
-
border-width: 2px;
19
-
background-color: blue;
20
-
border-color: #444;
21
-
}
22
-
```
23
-
24
-
Python example:
25
-
26
-
```python
27
-
28
-
dc.InitShapeStyle("my-element")
11
+
***Draw shapes, text and/or images** in wxPython without worrying so much about ids, brushes, pens, etc.
12
+
***Style the native wxPython widgets** from a stylesheet
13
+
***Create your own custom widgets in wxPython** that can be styled with a CSS-like stylesheet
29
14
30
-
```
15
+
...then UI Style Lang is likely the module you're looking for.
* Includes the ``UIStylePDC`` UI Style Lang class which is a powerful extension of the wxPython ``wx.PseudoDC``
44
28
* Over 15 stylesheet properties already supported
45
29
* Draw circles, rectangles, squares, images, & text
46
-
* Translate & rotate objects
30
+
* Translate & rotate elements
47
31
* Load styles from inline styles and an external stylesheet
48
-
* Auto-handles IDs, with support for manual-handling of IDs
32
+
* Auto-handles wxPython IDs, with support for manual-handling of IDs
49
33
50
-
***Widget Styling API**
34
+
***Native Widget Styling API**
51
35
* Supports loading from a stylesheet for easy theming
52
-
* Support for styling app, panels, frames background color (currently)
36
+
* Support for styling app, panels, frames and static text widgets
37
+
38
+
...and more.
39
+
40
+
# Usage and Examples
41
+
42
+
See the [docs](https://github.com/Correct-Syntax/ui-style-lang/tree/master/docs) and [full demo examples](https://github.com/Correct-Syntax/ui-style-lang/tree/master/demo) for information on usage...
53
43
54
44
45
+
# What does the syntax look like?
46
+
47
+
UI Style Lang (Stylesheet API) example:
48
+
49
+
```
50
+
/* My custom button styles */
51
+
@style button {
52
+
background-color: #F4F4F4;
53
+
top: 20px;
54
+
left: 40px;
55
+
width: 115px;
56
+
height: 35px;
57
+
border-color: #D1D1D1;
58
+
border-size: 2px;
59
+
}
60
+
61
+
@style button:hover {
62
+
background-color: #FDFDFD;
63
+
top: 20px;
64
+
left: 40px;
65
+
width: 115px;
66
+
height: 35px;
67
+
border-color: #D1D1D1;
68
+
border-size: 2px;
69
+
}
70
+
```
71
+
72
+
Python API example:
73
+
74
+
```python
75
+
76
+
# Intilizing the element: <div id="button"></div>
77
+
>> dc.InitElem("button")
78
+
79
+
# Editing the style with inline styles: <div id="button" style="border-color: red; border-width: 4px;"></div>
# Update the element with the 'hover' styles: <div id="button" class="hover"></div>
83
+
>> dc.UpdateElem('button:hover')
84
+
85
+
```
86
+
55
87
# Development
56
88
57
89
Pull requests and/or feature suggestions are welcome!
58
90
59
-
# Usage
60
-
61
-
See the [docs](https://github.com/Correct-Syntax/ui-style-lang/tree/master/docs) and [full demos](https://github.com/Correct-Syntax/ui-style-lang/tree/master/demo) for information on usage...
0 commit comments