Skip to content

Commit 5bc75c2

Browse files
updated README with examples, etc
1 parent e62fd60 commit 5bc75c2

File tree

1 file changed

+59
-30
lines changed

1 file changed

+59
-30
lines changed

README.md

Lines changed: 59 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,23 @@
11
UI Style Lang (Language)
22
========================
33

4-
!["UI Style Lang"](https://github.com/Correct-Syntax/ui-style-lang/blob/master/logo.png?raw=true "UI Style Lang")
4+
!["UI Style Lang"](https://github.com/Correct-Syntax/ui-style-lang/blob/master/assets/logo.png?raw=true "UI Style Lang")
55

66

77
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.
88

9-
Stylesheet example:
9+
If you are looking for an easy way to:
1010

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
2914

30-
```
15+
...then UI Style Lang is likely the module you're looking for.
3116

3217

3318
# WIP/ TODO
3419

35-
* SVG support(?).
36-
* More widget styling support
20+
* SVG support(?)
3721

3822
# Features
3923

@@ -43,22 +27,67 @@ dc.InitShapeStyle("my-element")
4327
* Includes the ``UIStylePDC`` UI Style Lang class which is a powerful extension of the wxPython ``wx.PseudoDC``
4428
* Over 15 stylesheet properties already supported
4529
* Draw circles, rectangles, squares, images, & text
46-
* Translate & rotate objects
30+
* Translate & rotate elements
4731
* 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
4933

50-
* **Widget Styling API**
34+
* **Native Widget Styling API**
5135
* 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...
5343

5444

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>
80+
>> dc.UpdateElem('button', styles="border-color: red; border-width: 4px;")
81+
82+
# Update the element with the 'hover' styles: <div id="button" class="hover"></div>
83+
>> dc.UpdateElem('button:hover')
84+
85+
```
86+
5587
# Development
5688

5789
Pull requests and/or feature suggestions are welcome!
5890

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...
6291

6392
# License
6493

0 commit comments

Comments
 (0)