Skip to content

Update this branch. #221

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 29 commits into from
Jan 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
2ad32c3
Gride hack.
typesupply Dec 20, 2023
dca980f
Add alignment option.
typesupply Dec 20, 2023
06de88b
Handle wrapper being None.
typesupply Dec 20, 2023
d3e0365
Tried to fix #188. Failed. Left some notes.
typesupply Dec 20, 2023
d4c0085
Call the edit callback after a delete.
typesupply Dec 20, 2023
4ee869d
Add ComboBoxList2Cell.
typesupply Dec 20, 2023
8c8403b
Add support for separators in a PopUpButton
typemytype Jan 23, 2024
8ee74f2
add support for bordered in a PopUpButton and a list2 PopUpButton
typemytype Feb 12, 2024
7c5a803
Merge pull request #203 from robotools/popupbuttonListBorder
typesupply Feb 12, 2024
83c8c53
using super from objc
typemytype Feb 19, 2024
27b1943
Fix superclass __init__ invokation
justvanrossum Mar 22, 2024
0881768
Merge pull request #206 from robotools/issue205-radio-group
typesupply Mar 22, 2024
b9a88e1
Add support for enable in a radio StackGroup
typemytype Apr 11, 2024
3dad8f2
Add support to retrieve which cell is edited
typemytype May 8, 2024
32ce13d
Merge pull request #210 from robotools/list2EditCellIndex
typesupply May 8, 2024
7ec2205
improve sphinx docs (#209)
typemytype May 8, 2024
7101624
fixing deprecated inspect methods
typemytype Jun 24, 2024
9a9a2f4
check if the comboBox uses a dataSource to retrieve and call the chan…
typemytype Aug 2, 2024
20f48f7
Merge pull request #213 from robotools/ComboBoxWithDataSource
typesupply Aug 2, 2024
d3313b7
Correcting error messages in `_validateMinMaxSize`
colinmford Aug 28, 2024
3b568a2
Merge pull request #215 from colinmford/patch-1
benkiel Aug 29, 2024
3ef4eba
Update publish.yml
benkiel Aug 29, 2024
fd9082b
Add support for List2 appendColumn and removeColumn
typemytype Sep 14, 2024
1a1a1ab
Merge pull request #218 from robotools/append_remove_column
typesupply Sep 14, 2024
709d9ef
Set EditTextList2Cell continuous to False by default
typemytype Sep 30, 2024
d36d787
Call cell converter after edit and set the value back into the sender…
typemytype Sep 30, 2024
01bebaa
Merge pull request #219 from robotools/cellConverterFix
typesupply Sep 30, 2024
2d82b35
Add support for List2. getColumnIdentifiers
typemytype Sep 30, 2024
25ef265
Merge branch 'master' of https://github.com/typesupply/vanilla
typemytype Sep 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install wheel twine
pip install setuptools wheel twine

- name: Build distributions
run: |
Expand Down
15 changes: 14 additions & 1 deletion Documentation/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@

# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.autodoc', 'sphinx_rtd_theme']
extensions = [
'sphinx.ext.autodoc',
'sphinx_rtd_theme',
'sphinx.ext.todo'
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
Expand Down Expand Up @@ -227,6 +231,15 @@ def __call__(self, *args, **kwargs):
def __getattr__(cls, name):
if name in ('__file__', '__path__'):
return '/dev/null'
elif name == "NSObject":
return object
elif name == "python_method":
def dummyDecorator(func):
def wrapper(*args, **kwargs):
return func(*args, **kwargs)
wrapper.__doc__ = func.__doc__
return wrapper
return dummyDecorator
else:
return Mock

Expand Down
1 change: 1 addition & 0 deletions Documentation/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Windows

objects/Window
objects/FloatingWindow
objects/ModalWindow
objects/Sheet
objects/Drawer

Expand Down
188 changes: 0 additions & 188 deletions Documentation/source/objects/FloatingWindow.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,194 +9,6 @@ FloatingWindow
:inherited-members:
:members:

.. method:: FloatingWindow.assignToDocument(document)

Add this window to the list of windows associated with a document.

**document** should be a *NSDocument* instance.


.. method:: FloatingWindow.setTitle(title)

Set the title in the window's title bar.

**title** should be a string.


.. method:: FloatingWindow.setPosSize(posSize, animate=True)

Set the position and size of the FloatingWindow.

**posSize** A tuple of form *(left, top, width, height)*.


.. method:: FloatingWindow.move(x, y, animate=True)

Move the window by *x* units and *y* units.


.. method:: FloatingWindow.resize(width, height, animate=True)

Change the size of the window to *width* and *height*.


.. method:: FloatingWindow.setDefaultButton(button)

Set the default button in the FloatingWindow.

**button** will be bound to the Return and Enter keys.


.. method:: FloatingWindow.bind(event, callback)

Bind a callback to an event.

**event** A string representing the desired event. The options are:

+-------------------+----------------------------------------------------------------------+
| *"should close"* | Called when the user attempts to close the window. This must return |
| | a bool indicating if the window should be closed or not. |
+-------------------+----------------------------------------------------------------------+
| *"close"* | Called immediately before the window closes. |
+-------------------+----------------------------------------------------------------------+
| *"move"* | Called immediately after the window is moved. |
+-------------------+----------------------------------------------------------------------+
| *"resize"* | Called immediately after the window is resized. |
+-------------------+----------------------------------------------------------------------+
| *"became main"* | Called immediately after the window has become the main window. |
+-------------------+----------------------------------------------------------------------+
| *"resigned main"* | Called immediately after the window has lost its main window status. |
+-------------------+----------------------------------------------------------------------+
| *"became key"* | Called immediately after the window has become the key window. |
+-------------------+----------------------------------------------------------------------+
| *"resigned key"* | Called immediately after the window has lost its key window status. |
+-------------------+----------------------------------------------------------------------+

For more information about main and key windows, refer to the Cocoa `documentation`_ on the subject.

.. _documentation: http://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/WinPanel/Concepts/ChangingMainKeyFloatingWindow.html

**callback** The callback that will be called when the event occurs. It should accept a *sender* argument which will
be the Window that called the callback.::

from vanilla import Window

class WindowBindDemo(object):

def __init__(self):
self.w = Window((200, 200))
self.w.bind("move", self.windowMoved)
self.w.open()

def windowMoved(self, sender):
print("window moved!", sender)

WindowBindDemo()


.. method:: FloatingWindow.unbind(event, callback)

Unbind a callback from an event.

**event** A string representing the desired event.
Refer to *bind* for the options.

**callback** The callback that has been bound to the event.


.. method:: FloatingWindow.addToolbar(toolbarIdentifier, toolbarItems, addStandardItems=True)

Add a toolbar to the FloatingWindow.

**toolbarIdentifier** A string representing a unique name for the toolbar.

**toolbarItems** An ordered list of dictionaries containing the following items:

+-------------------------------+---------------------------------------------------------------------------+
| *itemIdentifier* | A unique string identifier for the item. This is only used internally. |
+-------------------------------+---------------------------------------------------------------------------+
| *label* (optional) | The text label for the item. Defaults to *None*. |
+-------------------------------+---------------------------------------------------------------------------+
| *paletteLabel* (optional) | The text label shown in the customization palette. Defaults to *label*. |
+-------------------------------+---------------------------------------------------------------------------+
| *toolTip* (optional) | The tool tip for the item. Defaults to *label*. |
+-------------------------------+---------------------------------------------------------------------------+
| *imagePath* (optional) | A file path to an image. Defaults to *None*. |
+-------------------------------+---------------------------------------------------------------------------+
| *imageNamed* (optional) | The name of an image already loaded as a `NSImage`_ by the application. |
| | Defaults to *None*. |
+-------------------------------+---------------------------------------------------------------------------+
| *imageObject* (optional) | A `NSImage`_ object. Defaults to *None*. |
+-------------------------------+---------------------------------------------------------------------------+
| *imageTemplate* (optional) | A boolean representing if the image should converted to a template image. |
+-------------------------------+---------------------------------------------------------------------------+
| *selectable* (optional) | A boolean representing if the item is selectable or not. The default |
| | value is *False*. For more information on selectable toolbar items, refer |
| | to Apple's documentation. |
+-------------------------------+---------------------------------------------------------------------------+
| *view* (optional) | A *NSView* object to be used instead of an image. Defaults to *None*. |
+-------------------------------+---------------------------------------------------------------------------+
| *visibleByDefault* (optional) | If the item should be visible by default pass *True* to this argument. |
| | If the item should be added to the toolbar only through the customization |
| | palette, use a value of *False*. Defaults to *True*. |
+-------------------------------+---------------------------------------------------------------------------+

.. _NSImage: http://developer.apple.com/documentation/appkit/nsimage?language=objc

**addStandardItems** A boolean, specifying whether the standard Cocoa toolbar items
should be added. Defaults to *True*. If you set it to *False*, you must specify any
standard items manually in *toolbarItems*, by using the constants from the AppKit module:

+-------------------------------------------+------------------------------------------------------+
| *NSToolbarSeparatorItemIdentifier* | The Separator item. |
+-------------------------------------------+------------------------------------------------------+
| *NSToolbarSpaceItemIdentifier* | The Space item. |
+-------------------------------------------+------------------------------------------------------+
| *NSToolbarFlexibleSpaceItemIdentifier* | The Flexible Space item. |
+-------------------------------------------+------------------------------------------------------+
| *NSToolbarShowColorsItemIdentifier* | The Colors item. Shows the color panel. |
+-------------------------------------------+------------------------------------------------------+
| *NSToolbarShowFontsItemIdentifier* | The Fonts item. Shows the font panel. |
+-------------------------------------------+------------------------------------------------------+
| *NSToolbarCustomizeToolbarItemIdentifier* | The Customize item. Shows the customization palette. |
+-------------------------------------------+------------------------------------------------------+
| *NSToolbarPrintItemIdentifier* | The Print item. Refer to Apple's `NSToolbarItem`_ |
| | documentation for more information. |
+-------------------------------------------+------------------------------------------------------+

.. _NSToolbarItem: https://developer.apple.com/documentation/appkit/nstoolbaritem?language=objc

**displayMode** A string representing the desired display mode for the toolbar.

+-------------+
| "default" |
+-------------+
| "iconLabel" |
+-------------+
| "icon" |
+-------------+
| "label" |
+-------------+

**sizeStyle** A string representing the desired size for the toolbar

+-----------+
| "default" |
+-----------+
| "regular" |
+-----------+
| "small" |
+-----------+

Returns a dictionary containing the created toolbar items, mapped by itemIdentifier.


.. method:: FloatingWindow.removeToolbarItem(itemIdentifier)

Remove a toolbar item by his identifier.

**itemIdentifier** A unique string identifier for the removed item.


.. autoclass:: HUDFloatingWindow
:members:
27 changes: 13 additions & 14 deletions Documentation/source/objects/List.rst
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
.. highlight:: python

=====
List2
=====
====
List
====

.. module:: vanilla2
.. module:: vanilla
.. autoclass:: List
:inherited-members:
:members:

================
List2 Item Cells
================
===============
List Item Cells
===============

.. autofunction:: EditTextList2Cell
.. autofunction:: CheckBoxList2Cell
.. autofunction:: SliderList2Cell
.. autofunction:: PopUpButtonList2Cell
.. autofunction:: ImageList2Cell
.. autofunction:: SegmentedButtonList2Cell
.. autofunction:: ColorWellList2Cell
.. autofunction:: CheckBoxListCell
.. autofunction:: SliderListCell
.. autofunction:: PopUpButtonListCell
.. autofunction:: ImageListCell
.. autofunction:: SegmentedButtonListCell
.. autofunction:: LevelIndicatorListCell
27 changes: 14 additions & 13 deletions Documentation/source/objects/List2.rst
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
.. highlight:: python

====
List
====
=====
List2
=====

.. module:: vanilla
.. autoclass:: List
.. autoclass:: List2
:inherited-members:
:members:

===============
List Item Cells
===============
================
List2 Item Cells
================

.. autofunction:: CheckBoxListCell
.. autofunction:: SliderListCell
.. autofunction:: PopUpButtonListCell
.. autofunction:: ImageListCell
.. autofunction:: SegmentedButtonListCell
.. autofunction:: LevelIndicatorListCell
.. autofunction:: EditTextList2Cell
.. autofunction:: CheckBoxList2Cell
.. autofunction:: SliderList2Cell
.. autofunction:: PopUpButtonList2Cell
.. autofunction:: ImageList2Cell
.. autofunction:: SegmentedButtonList2Cell
.. autofunction:: ColorWellList2Cell
7 changes: 7 additions & 0 deletions Documentation/source/objects/ModalWindow.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,10 @@ ModalWindow
.. autoclass:: ModalWindow
:inherited-members:
:members:


.. module:: vanilla
.. autoclass:: vanilla.vanillaWindows.VModalWindow
:inherited-members:
:members:

Loading