Skip to content

Commit a1949b2

Browse files
DOC: add example and documentation for PyDMWindow
1 parent 2b532d6 commit a1949b2

File tree

4 files changed

+87
-0
lines changed

4 files changed

+87
-0
lines changed

docs/source/widgets/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ Container Widgets
5858
frame.rst
5959
tab_widget.rst
6060
template_repeater.rst
61+
window.rst
6162

6263
Drawing Widgets
6364
---------------

docs/source/widgets/window.rst

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#######################
2+
PyDMWindow
3+
#######################
4+
5+
The PyDM Window Widget is a container widget that allows the display creator to set certain global display
6+
properties. It is currently used to hide specific UI elements when the display is the first loaded display
7+
in the running PyDM instance.
8+
9+
Using the PyDM Window Widget in Designer
10+
========================================
11+
12+
In designer, when creating a new display, select PyDMWindow as the base widget.
13+
14+
15+
Widget Properties
16+
=================
17+
18+
============= ==== ===========
19+
Property Type Description
20+
============= ==== ===========
21+
hideMenuBar bool Hide the menu bar if this is the first loaded display.
22+
hideNavBar bool Hide the nav bar if this is the first loaded display.
23+
hideStatusBar bool Hide the status bar if this is the first loaded display.
24+
============= ==== ===========
25+
26+
27+
API Documentation
28+
=================
29+
30+
.. autoclass:: pydm.widgets.window.PyDMWindow
31+
:members:
32+
:show-inheritance:

examples/window/window.ui

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ui version="4.0">
3+
<class>Display</class>
4+
<widget class="PyDMWindow" name="Display">
5+
<property name="geometry">
6+
<rect>
7+
<x>0</x>
8+
<y>0</y>
9+
<width>400</width>
10+
<height>300</height>
11+
</rect>
12+
</property>
13+
<property name="windowTitle">
14+
<string>PyDMWindow</string>
15+
</property>
16+
<property name="hideMenuBar" stdset="0">
17+
<bool>true</bool>
18+
</property>
19+
<property name="hideNavBar" stdset="0">
20+
<bool>true</bool>
21+
</property>
22+
<property name="hideStatusBar" stdset="0">
23+
<bool>true</bool>
24+
</property>
25+
<widget class="QLabel" name="Label">
26+
<property name="geometry">
27+
<rect>
28+
<x>10</x>
29+
<y>10</y>
30+
<width>380</width>
31+
<height>280</height>
32+
</rect>
33+
</property>
34+
<property name="text">
35+
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;This display is using a PyDMWindow widget as the root widget. This allows it to customize some otherwise unavailable properties.&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;Currently it is used for hiding specific parts of the PyDM interface, including the menu bar, nav bar, and status bar. Disabling these elements can make your popup displays look nicer!&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
36+
</property>
37+
<property name="wordWrap">
38+
<bool>true</bool>
39+
</property>
40+
</widget>
41+
</widget>
42+
<customwidgets>
43+
<customwidget>
44+
<class>PyDMWindow</class>
45+
<extends>QWidget</extends>
46+
<header>pydm.widgets.window</header>
47+
<container>1</container>
48+
</customwidget>
49+
</customwidgets>
50+
<resources/>
51+
<connections/>
52+
</ui>

pydm/widgets/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"PyDMTabWidget",
3636
"PyDMTemplateRepeater",
3737
"PyDMNTTable",
38+
"PyDMWindow",
3839
]
3940

4041
from .channel import PyDMChannel
@@ -75,3 +76,4 @@
7576
from .tab_bar import PyDMTabWidget
7677
from .template_repeater import PyDMTemplateRepeater
7778
from .nt_table import PyDMNTTable
79+
from .window import PyDMWindow

0 commit comments

Comments
 (0)