Skip to content

Commit 07cb872

Browse files
authored
Merge pull request #221 from robotools/master
Update this branch.
2 parents 9f22491 + 25ef265 commit 07cb872

20 files changed

+463
-499
lines changed

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- name: Install dependencies
3232
run: |
3333
python -m pip install --upgrade pip
34-
pip install wheel twine
34+
pip install setuptools wheel twine
3535
3636
- name: Build distributions
3737
run: |

Documentation/source/conf.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@
3030

3131
# Add any Sphinx extension module names here, as strings. They can be extensions
3232
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
33-
extensions = ['sphinx.ext.autodoc', 'sphinx_rtd_theme']
33+
extensions = [
34+
'sphinx.ext.autodoc',
35+
'sphinx_rtd_theme',
36+
'sphinx.ext.todo'
37+
]
3438

3539
# Add any paths that contain templates here, relative to this directory.
3640
templates_path = ['_templates']
@@ -227,6 +231,15 @@ def __call__(self, *args, **kwargs):
227231
def __getattr__(cls, name):
228232
if name in ('__file__', '__path__'):
229233
return '/dev/null'
234+
elif name == "NSObject":
235+
return object
236+
elif name == "python_method":
237+
def dummyDecorator(func):
238+
def wrapper(*args, **kwargs):
239+
return func(*args, **kwargs)
240+
wrapper.__doc__ = func.__doc__
241+
return wrapper
242+
return dummyDecorator
230243
else:
231244
return Mock
232245

Documentation/source/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Windows
2121

2222
objects/Window
2323
objects/FloatingWindow
24+
objects/ModalWindow
2425
objects/Sheet
2526
objects/Drawer
2627

Documentation/source/objects/FloatingWindow.rst

Lines changed: 0 additions & 188 deletions
Original file line numberDiff line numberDiff line change
@@ -9,194 +9,6 @@ FloatingWindow
99
:inherited-members:
1010
:members:
1111

12-
.. method:: FloatingWindow.assignToDocument(document)
13-
14-
Add this window to the list of windows associated with a document.
15-
16-
**document** should be a *NSDocument* instance.
17-
18-
19-
.. method:: FloatingWindow.setTitle(title)
20-
21-
Set the title in the window's title bar.
22-
23-
**title** should be a string.
24-
25-
26-
.. method:: FloatingWindow.setPosSize(posSize, animate=True)
27-
28-
Set the position and size of the FloatingWindow.
29-
30-
**posSize** A tuple of form *(left, top, width, height)*.
31-
32-
33-
.. method:: FloatingWindow.move(x, y, animate=True)
34-
35-
Move the window by *x* units and *y* units.
36-
37-
38-
.. method:: FloatingWindow.resize(width, height, animate=True)
39-
40-
Change the size of the window to *width* and *height*.
41-
42-
43-
.. method:: FloatingWindow.setDefaultButton(button)
44-
45-
Set the default button in the FloatingWindow.
46-
47-
**button** will be bound to the Return and Enter keys.
48-
49-
50-
.. method:: FloatingWindow.bind(event, callback)
51-
52-
Bind a callback to an event.
53-
54-
**event** A string representing the desired event. The options are:
55-
56-
+-------------------+----------------------------------------------------------------------+
57-
| *"should close"* | Called when the user attempts to close the window. This must return |
58-
| | a bool indicating if the window should be closed or not. |
59-
+-------------------+----------------------------------------------------------------------+
60-
| *"close"* | Called immediately before the window closes. |
61-
+-------------------+----------------------------------------------------------------------+
62-
| *"move"* | Called immediately after the window is moved. |
63-
+-------------------+----------------------------------------------------------------------+
64-
| *"resize"* | Called immediately after the window is resized. |
65-
+-------------------+----------------------------------------------------------------------+
66-
| *"became main"* | Called immediately after the window has become the main window. |
67-
+-------------------+----------------------------------------------------------------------+
68-
| *"resigned main"* | Called immediately after the window has lost its main window status. |
69-
+-------------------+----------------------------------------------------------------------+
70-
| *"became key"* | Called immediately after the window has become the key window. |
71-
+-------------------+----------------------------------------------------------------------+
72-
| *"resigned key"* | Called immediately after the window has lost its key window status. |
73-
+-------------------+----------------------------------------------------------------------+
74-
75-
For more information about main and key windows, refer to the Cocoa `documentation`_ on the subject.
76-
77-
.. _documentation: http://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/WinPanel/Concepts/ChangingMainKeyFloatingWindow.html
78-
79-
**callback** The callback that will be called when the event occurs. It should accept a *sender* argument which will
80-
be the Window that called the callback.::
81-
82-
from vanilla import Window
83-
84-
class WindowBindDemo(object):
85-
86-
def __init__(self):
87-
self.w = Window((200, 200))
88-
self.w.bind("move", self.windowMoved)
89-
self.w.open()
90-
91-
def windowMoved(self, sender):
92-
print("window moved!", sender)
93-
94-
WindowBindDemo()
95-
96-
97-
.. method:: FloatingWindow.unbind(event, callback)
98-
99-
Unbind a callback from an event.
100-
101-
**event** A string representing the desired event.
102-
Refer to *bind* for the options.
103-
104-
**callback** The callback that has been bound to the event.
105-
106-
107-
.. method:: FloatingWindow.addToolbar(toolbarIdentifier, toolbarItems, addStandardItems=True)
108-
109-
Add a toolbar to the FloatingWindow.
110-
111-
**toolbarIdentifier** A string representing a unique name for the toolbar.
112-
113-
**toolbarItems** An ordered list of dictionaries containing the following items:
114-
115-
+-------------------------------+---------------------------------------------------------------------------+
116-
| *itemIdentifier* | A unique string identifier for the item. This is only used internally. |
117-
+-------------------------------+---------------------------------------------------------------------------+
118-
| *label* (optional) | The text label for the item. Defaults to *None*. |
119-
+-------------------------------+---------------------------------------------------------------------------+
120-
| *paletteLabel* (optional) | The text label shown in the customization palette. Defaults to *label*. |
121-
+-------------------------------+---------------------------------------------------------------------------+
122-
| *toolTip* (optional) | The tool tip for the item. Defaults to *label*. |
123-
+-------------------------------+---------------------------------------------------------------------------+
124-
| *imagePath* (optional) | A file path to an image. Defaults to *None*. |
125-
+-------------------------------+---------------------------------------------------------------------------+
126-
| *imageNamed* (optional) | The name of an image already loaded as a `NSImage`_ by the application. |
127-
| | Defaults to *None*. |
128-
+-------------------------------+---------------------------------------------------------------------------+
129-
| *imageObject* (optional) | A `NSImage`_ object. Defaults to *None*. |
130-
+-------------------------------+---------------------------------------------------------------------------+
131-
| *imageTemplate* (optional) | A boolean representing if the image should converted to a template image. |
132-
+-------------------------------+---------------------------------------------------------------------------+
133-
| *selectable* (optional) | A boolean representing if the item is selectable or not. The default |
134-
| | value is *False*. For more information on selectable toolbar items, refer |
135-
| | to Apple's documentation. |
136-
+-------------------------------+---------------------------------------------------------------------------+
137-
| *view* (optional) | A *NSView* object to be used instead of an image. Defaults to *None*. |
138-
+-------------------------------+---------------------------------------------------------------------------+
139-
| *visibleByDefault* (optional) | If the item should be visible by default pass *True* to this argument. |
140-
| | If the item should be added to the toolbar only through the customization |
141-
| | palette, use a value of *False*. Defaults to *True*. |
142-
+-------------------------------+---------------------------------------------------------------------------+
143-
144-
.. _NSImage: http://developer.apple.com/documentation/appkit/nsimage?language=objc
145-
146-
**addStandardItems** A boolean, specifying whether the standard Cocoa toolbar items
147-
should be added. Defaults to *True*. If you set it to *False*, you must specify any
148-
standard items manually in *toolbarItems*, by using the constants from the AppKit module:
149-
150-
+-------------------------------------------+------------------------------------------------------+
151-
| *NSToolbarSeparatorItemIdentifier* | The Separator item. |
152-
+-------------------------------------------+------------------------------------------------------+
153-
| *NSToolbarSpaceItemIdentifier* | The Space item. |
154-
+-------------------------------------------+------------------------------------------------------+
155-
| *NSToolbarFlexibleSpaceItemIdentifier* | The Flexible Space item. |
156-
+-------------------------------------------+------------------------------------------------------+
157-
| *NSToolbarShowColorsItemIdentifier* | The Colors item. Shows the color panel. |
158-
+-------------------------------------------+------------------------------------------------------+
159-
| *NSToolbarShowFontsItemIdentifier* | The Fonts item. Shows the font panel. |
160-
+-------------------------------------------+------------------------------------------------------+
161-
| *NSToolbarCustomizeToolbarItemIdentifier* | The Customize item. Shows the customization palette. |
162-
+-------------------------------------------+------------------------------------------------------+
163-
| *NSToolbarPrintItemIdentifier* | The Print item. Refer to Apple's `NSToolbarItem`_ |
164-
| | documentation for more information. |
165-
+-------------------------------------------+------------------------------------------------------+
166-
167-
.. _NSToolbarItem: https://developer.apple.com/documentation/appkit/nstoolbaritem?language=objc
168-
169-
**displayMode** A string representing the desired display mode for the toolbar.
170-
171-
+-------------+
172-
| "default" |
173-
+-------------+
174-
| "iconLabel" |
175-
+-------------+
176-
| "icon" |
177-
+-------------+
178-
| "label" |
179-
+-------------+
180-
181-
**sizeStyle** A string representing the desired size for the toolbar
182-
183-
+-----------+
184-
| "default" |
185-
+-----------+
186-
| "regular" |
187-
+-----------+
188-
| "small" |
189-
+-----------+
190-
191-
Returns a dictionary containing the created toolbar items, mapped by itemIdentifier.
192-
193-
194-
.. method:: FloatingWindow.removeToolbarItem(itemIdentifier)
195-
196-
Remove a toolbar item by his identifier.
197-
198-
**itemIdentifier** A unique string identifier for the removed item.
199-
20012

20113
.. autoclass:: HUDFloatingWindow
20214
:members:
Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
11
.. highlight:: python
22

3-
=====
4-
List2
5-
=====
3+
====
4+
List
5+
====
66

7-
.. module:: vanilla2
7+
.. module:: vanilla
88
.. autoclass:: List
99
:inherited-members:
1010
:members:
1111

12-
================
13-
List2 Item Cells
14-
================
12+
===============
13+
List Item Cells
14+
===============
1515

16-
.. autofunction:: EditTextList2Cell
17-
.. autofunction:: CheckBoxList2Cell
18-
.. autofunction:: SliderList2Cell
19-
.. autofunction:: PopUpButtonList2Cell
20-
.. autofunction:: ImageList2Cell
21-
.. autofunction:: SegmentedButtonList2Cell
22-
.. autofunction:: ColorWellList2Cell
16+
.. autofunction:: CheckBoxListCell
17+
.. autofunction:: SliderListCell
18+
.. autofunction:: PopUpButtonListCell
19+
.. autofunction:: ImageListCell
20+
.. autofunction:: SegmentedButtonListCell
21+
.. autofunction:: LevelIndicatorListCell
Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
.. highlight:: python
22

3-
====
4-
List
5-
====
3+
=====
4+
List2
5+
=====
66

77
.. module:: vanilla
8-
.. autoclass:: List
8+
.. autoclass:: List2
99
:inherited-members:
1010
:members:
1111

12-
===============
13-
List Item Cells
14-
===============
12+
================
13+
List2 Item Cells
14+
================
1515

16-
.. autofunction:: CheckBoxListCell
17-
.. autofunction:: SliderListCell
18-
.. autofunction:: PopUpButtonListCell
19-
.. autofunction:: ImageListCell
20-
.. autofunction:: SegmentedButtonListCell
21-
.. autofunction:: LevelIndicatorListCell
16+
.. autofunction:: EditTextList2Cell
17+
.. autofunction:: CheckBoxList2Cell
18+
.. autofunction:: SliderList2Cell
19+
.. autofunction:: PopUpButtonList2Cell
20+
.. autofunction:: ImageList2Cell
21+
.. autofunction:: SegmentedButtonList2Cell
22+
.. autofunction:: ColorWellList2Cell

Documentation/source/objects/ModalWindow.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,10 @@ ModalWindow
88
.. autoclass:: ModalWindow
99
:inherited-members:
1010
:members:
11+
12+
13+
.. module:: vanilla
14+
.. autoclass:: vanilla.vanillaWindows.VModalWindow
15+
:inherited-members:
16+
:members:
17+

0 commit comments

Comments
 (0)