├── __init__.py ├── pyforms_gui ├── dialogs │ └── __init__.py ├── utils │ ├── __init__.py │ ├── make_lambda.py │ ├── timeit.py │ ├── BioradWriter.py │ ├── plugins_finder.py │ └── ImageBlobTools.py ├── controls │ ├── control_player │ │ ├── __init__.py │ │ ├── VideoGLWidget.py │ │ └── VideoQt5GLWidget.py │ ├── control_event_timeline │ │ ├── events │ │ │ └── __init__.py │ │ ├── graphs │ │ │ └── __init__.py │ │ ├── utils │ │ │ └── __init__.py │ │ └── __init__.py │ ├── uipics │ │ ├── add.png │ │ ├── film.png │ │ ├── graph.png │ │ ├── refresh.png │ │ ├── remove.png │ │ ├── zoom_in.png │ │ ├── film_edit.png │ │ ├── timeline.png │ │ ├── zoom_out.png │ │ ├── page_white_get.png │ │ └── page_white_put.png │ ├── __init__.py │ ├── control_password.py │ ├── control_events_graph │ │ ├── __init__.py │ │ ├── Pointer.py │ │ └── Track.py │ ├── label.ui │ ├── control_filestree.py │ ├── image.ui │ ├── checkbox.ui │ ├── button.ui │ ├── progressInput.ui │ ├── textInput.ui │ ├── number.ui │ ├── textArea.ui │ ├── tree.ui │ ├── control_dockwidget.py │ ├── control_checkbox.py │ ├── fileInput.ui │ ├── control_dir.py │ ├── control_label.py │ ├── sliderInput.ui │ ├── control_tableview.py │ ├── control_textarea.py │ ├── control_web.py │ ├── control_progress.py │ ├── control_text.py │ ├── control_slider.py │ ├── control_toolbox.py │ ├── control_file.py │ └── control_matplotlib.py ├── __init__.py ├── settings.py ├── resources_settings.py └── organizers.py ├── tutorials ├── 4.MdiApplication │ ├── __init__.py │ ├── Core │ │ ├── __init__.py │ │ ├── Controllers │ │ │ ├── __init__.py │ │ │ └── ProjectTree.py │ │ ├── MainWindow.py │ │ ├── SimpleExample1.py │ │ └── BaseWindow.py │ ├── style.css │ ├── teste.txt │ └── main.py ├── 1.SimpleExamples │ ├── ComputerVisionAlgorithmExample │ │ ├── __init__.py │ │ ├── screenshot.png │ │ └── Example.py │ ├── SimpleExample1 │ │ ├── screenshot.png │ │ ├── __init__.py │ │ ├── README.md │ │ └── SimpleExample1.py │ ├── SimpleExample2 │ │ ├── screenshot.png │ │ ├── __init__.py │ │ ├── README.md │ │ └── SimpleExample2.py │ ├── SimpleExample3 │ │ ├── screenshot.png │ │ ├── __init__.py │ │ ├── README.md │ │ └── SimpleExample3.py │ ├── SimpleExample4 │ │ ├── screenshot.png │ │ ├── __init__.py │ │ ├── README.md │ │ └── SimpleExample4.py │ ├── SimpleExample5 │ │ ├── screenshot.png │ │ ├── __init__.py │ │ ├── README.md │ │ └── SimpleExample5.py │ ├── SimpleExample6 │ │ ├── screenshot.png │ │ ├── __init__.py │ │ ├── README.md │ │ └── SimpleExample6.py │ └── README.md ├── Controls4Docs │ ├── settings.py │ ├── ControlDir.png │ ├── ControlFile.png │ ├── ControlList.png │ ├── ControlText.png │ ├── ControlTree.png │ ├── ControlWeb.png │ ├── ControlButton.png │ ├── ControlCombo.png │ ├── ControlImage.png │ ├── ControlLabel.png │ ├── ControlMdiArea.png │ ├── ControlNumber.png │ ├── ControlOpenGL.png │ ├── ControlPlayer.png │ ├── ControlSlider.png │ ├── ControlToolBox.png │ ├── ControlVisVis.png │ ├── ControlCheckBox.png │ ├── ControlFilesTree.png │ ├── ControlProgress.png │ ├── ControlTextArea.png │ ├── ControlTreeView.png │ ├── ControlCheckBoxList.png │ ├── ControlCodeEditor.png │ ├── ControlDockWidget.png │ ├── ControlVisVisVolume.png │ ├── ControlBoundingSlider.png │ ├── ControlEventTimeline.png │ ├── __init__.py │ ├── ControlHBarsGraph.py │ ├── ControlText.py │ ├── ControlButton.py │ ├── ControlEventTimeline.py │ ├── ControlTextArea.py │ ├── ControlFile.py │ ├── ControlLabel.py │ ├── ControlNumber.py │ ├── ControlSlider.py │ ├── ControlFilesTree.py │ ├── ControlProgress.py │ ├── ControlCheckBoxList.py │ ├── ControlVisVis.py │ ├── ControlToolBox.py │ ├── ControlWeb.py │ ├── ControlCodeEditor.py │ ├── ControlCheckBox.py │ ├── ControlDir.py │ ├── ControlList.py │ ├── ControlImage.py │ ├── ControlCombo.py │ ├── ControlEventsGraph_Simple.py │ └── ControlBoundingSlider.py ├── 2.ControlsExamples │ ├── lena.png │ ├── Example1.png │ ├── Example2.png │ ├── Example3.png │ ├── README.md │ ├── Example4.py │ ├── __init__.py │ ├── Example1.py │ ├── Example2.py │ └── Example3.py └── 3.CodeOrganization │ ├── settings.py │ ├── people.dat │ ├── Person.py │ ├── __init__.py │ ├── style.css │ ├── People.py │ ├── README.md │ ├── AddMenuFuntionality.py │ ├── PersonWindow.py │ └── PeopleWindow.py ├── docs ├── example.png ├── imgs │ ├── rtd.png │ ├── start.png │ ├── demo-app.png │ ├── pyforms.jpg │ ├── basewidget.png │ ├── db-apps-1.png │ ├── db-apps-2.png │ ├── first-app.png │ ├── model-edit.png │ ├── model-view.png │ ├── orquestra.jpg │ ├── model-admin.png │ ├── pyforms-gui.jpg │ ├── pyforms-web.jpg │ ├── pyforms-web-com.png │ ├── getting-started-1.png │ ├── getting-started-10.png │ ├── getting-started-11.png │ ├── getting-started-2.png │ ├── getting-started-3.png │ ├── getting-started-4.png │ ├── getting-started-5.png │ ├── getting-started-6.png │ ├── getting-started-7.png │ ├── getting-started-8.png │ ├── getting-started-9.png │ ├── pyforms-layers-gui.png │ ├── pyforms-terminal.jpg │ ├── pyforms-web-small.jpg │ ├── terminal-example.png │ ├── pyforms-layers-terminal.png │ ├── pyforms-terminal-small.jpg │ ├── formsets-segment-sidebyside.png │ ├── gui-example-computervisionalgorithm.png │ └── terminal-example-computervisionalgorithm.png ├── pyforms.png ├── gui-example.png ├── web-example.png ├── terminal-example.png ├── source │ ├── _static │ │ └── imgs │ │ │ ├── rtd.png │ │ │ ├── start.png │ │ │ ├── Example1.png │ │ │ ├── Example2.png │ │ │ ├── Example3.png │ │ │ ├── demo-app.png │ │ │ ├── pyforms.jpg │ │ │ ├── basewidget.png │ │ │ ├── db-apps-1.png │ │ │ ├── db-apps-2.png │ │ │ ├── first-app.png │ │ │ ├── model-edit.png │ │ │ ├── model-view.png │ │ │ ├── orquestra.jpg │ │ │ ├── controls │ │ │ ├── date.png │ │ │ ├── file.png │ │ │ ├── text.png │ │ │ ├── button.png │ │ │ ├── image.png │ │ │ ├── label.png │ │ │ ├── player.png │ │ │ ├── slider.png │ │ │ ├── calendar.png │ │ │ ├── checkbox.png │ │ │ ├── combobox.png │ │ │ ├── datetime.png │ │ │ ├── integer.png │ │ │ ├── password.png │ │ │ ├── textarea.png │ │ │ ├── fileupload.png │ │ │ ├── boundingslider.png │ │ │ └── multiselection.png │ │ │ ├── model-admin.png │ │ │ ├── pyforms-gui.jpg │ │ │ ├── pyforms-web.jpg │ │ │ ├── pyforms-web-com.png │ │ │ ├── getting-started-1.png │ │ │ ├── getting-started-10.png │ │ │ ├── getting-started-11.png │ │ │ ├── getting-started-2.png │ │ │ ├── getting-started-3.png │ │ │ ├── getting-started-4.png │ │ │ ├── getting-started-5.png │ │ │ ├── getting-started-6.png │ │ │ ├── getting-started-7.png │ │ │ ├── getting-started-8.png │ │ │ ├── getting-started-9.png │ │ │ ├── pyforms-gui-small.jpg │ │ │ ├── pyforms-layers-gui.png │ │ │ ├── pyforms-terminal.jpg │ │ │ ├── pyforms-web-small.jpg │ │ │ ├── terminal-example.png │ │ │ ├── pyforms-layers-terminal.png │ │ │ ├── pyforms-terminal-small.jpg │ │ │ ├── formsets-segment-sidebyside.png │ │ │ ├── gui-example-computervisionalgorithm.png │ │ │ └── terminal-example-computervisionalgorithm.png │ ├── getting-started │ │ ├── installing.rst │ │ ├── mdi-applications.rst │ │ └── style-layout.rst │ ├── api-reference │ │ ├── index.rst │ │ ├── basewidget.rst │ │ └── settings.rst │ ├── index.rst │ └── overview.rst ├── Makefile ├── make.bat ├── api-documentation │ └── settings.md ├── index.md └── about │ └── about.md ├── readthedocs.yml ├── pyforms ├── dialogs.py ├── settings.py ├── controls.py ├── __init__.py └── basewidget.py ├── environment.yml ├── mkdocs.yml ├── .github └── workflows │ └── python-publish.yml └── .gitignore /__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pyforms_gui/dialogs/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pyforms_gui/utils/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tutorials/4.MdiApplication/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tutorials/4.MdiApplication/Core/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pyforms_gui/controls/control_player/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tutorials/4.MdiApplication/Core/Controllers/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pyforms_gui/controls/control_event_timeline/events/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pyforms_gui/controls/control_event_timeline/graphs/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pyforms_gui/controls/control_event_timeline/utils/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tutorials/1.SimpleExamples/ComputerVisionAlgorithmExample/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tutorials/4.MdiApplication/style.css: -------------------------------------------------------------------------------- 1 | #_projectTree{ 2 | background-color: #999; 3 | } -------------------------------------------------------------------------------- /docs/example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/example.png -------------------------------------------------------------------------------- /docs/imgs/rtd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/imgs/rtd.png -------------------------------------------------------------------------------- /docs/pyforms.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/pyforms.png -------------------------------------------------------------------------------- /docs/imgs/start.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/imgs/start.png -------------------------------------------------------------------------------- /docs/gui-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/gui-example.png -------------------------------------------------------------------------------- /docs/imgs/demo-app.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/imgs/demo-app.png -------------------------------------------------------------------------------- /docs/imgs/pyforms.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/imgs/pyforms.jpg -------------------------------------------------------------------------------- /docs/web-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/web-example.png -------------------------------------------------------------------------------- /docs/imgs/basewidget.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/imgs/basewidget.png -------------------------------------------------------------------------------- /docs/imgs/db-apps-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/imgs/db-apps-1.png -------------------------------------------------------------------------------- /docs/imgs/db-apps-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/imgs/db-apps-2.png -------------------------------------------------------------------------------- /docs/imgs/first-app.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/imgs/first-app.png -------------------------------------------------------------------------------- /docs/imgs/model-edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/imgs/model-edit.png -------------------------------------------------------------------------------- /docs/imgs/model-view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/imgs/model-view.png -------------------------------------------------------------------------------- /docs/imgs/orquestra.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/imgs/orquestra.jpg -------------------------------------------------------------------------------- /docs/imgs/model-admin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/imgs/model-admin.png -------------------------------------------------------------------------------- /docs/imgs/pyforms-gui.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/imgs/pyforms-gui.jpg -------------------------------------------------------------------------------- /docs/imgs/pyforms-web.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/imgs/pyforms-web.jpg -------------------------------------------------------------------------------- /docs/terminal-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/terminal-example.png -------------------------------------------------------------------------------- /docs/imgs/pyforms-web-com.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/imgs/pyforms-web-com.png -------------------------------------------------------------------------------- /docs/imgs/getting-started-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/imgs/getting-started-1.png -------------------------------------------------------------------------------- /docs/imgs/getting-started-10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/imgs/getting-started-10.png -------------------------------------------------------------------------------- /docs/imgs/getting-started-11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/imgs/getting-started-11.png -------------------------------------------------------------------------------- /docs/imgs/getting-started-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/imgs/getting-started-2.png -------------------------------------------------------------------------------- /docs/imgs/getting-started-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/imgs/getting-started-3.png -------------------------------------------------------------------------------- /docs/imgs/getting-started-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/imgs/getting-started-4.png -------------------------------------------------------------------------------- /docs/imgs/getting-started-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/imgs/getting-started-5.png -------------------------------------------------------------------------------- /docs/imgs/getting-started-6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/imgs/getting-started-6.png -------------------------------------------------------------------------------- /docs/imgs/getting-started-7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/imgs/getting-started-7.png -------------------------------------------------------------------------------- /docs/imgs/getting-started-8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/imgs/getting-started-8.png -------------------------------------------------------------------------------- /docs/imgs/getting-started-9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/imgs/getting-started-9.png -------------------------------------------------------------------------------- /docs/imgs/pyforms-layers-gui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/imgs/pyforms-layers-gui.png -------------------------------------------------------------------------------- /docs/imgs/pyforms-terminal.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/imgs/pyforms-terminal.jpg -------------------------------------------------------------------------------- /docs/imgs/pyforms-web-small.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/imgs/pyforms-web-small.jpg -------------------------------------------------------------------------------- /docs/imgs/terminal-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/imgs/terminal-example.png -------------------------------------------------------------------------------- /docs/source/_static/imgs/rtd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/source/_static/imgs/rtd.png -------------------------------------------------------------------------------- /tutorials/Controls4Docs/settings.py: -------------------------------------------------------------------------------- 1 | CONTROL_CODE_EDITOR_DEFAULT_FONT_SIZE = '24' 2 | 3 | CONTROL_EVENTS_GRAPH_DEFAULT_SCALE = 8 -------------------------------------------------------------------------------- /docs/source/_static/imgs/start.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/source/_static/imgs/start.png -------------------------------------------------------------------------------- /docs/imgs/pyforms-layers-terminal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/imgs/pyforms-layers-terminal.png -------------------------------------------------------------------------------- /docs/imgs/pyforms-terminal-small.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/imgs/pyforms-terminal-small.jpg -------------------------------------------------------------------------------- /docs/source/_static/imgs/Example1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/source/_static/imgs/Example1.png -------------------------------------------------------------------------------- /docs/source/_static/imgs/Example2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/source/_static/imgs/Example2.png -------------------------------------------------------------------------------- /docs/source/_static/imgs/Example3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/source/_static/imgs/Example3.png -------------------------------------------------------------------------------- /docs/source/_static/imgs/demo-app.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/source/_static/imgs/demo-app.png -------------------------------------------------------------------------------- /docs/source/_static/imgs/pyforms.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/source/_static/imgs/pyforms.jpg -------------------------------------------------------------------------------- /pyforms_gui/controls/uipics/add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/pyforms_gui/controls/uipics/add.png -------------------------------------------------------------------------------- /pyforms_gui/controls/uipics/film.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/pyforms_gui/controls/uipics/film.png -------------------------------------------------------------------------------- /pyforms_gui/controls/uipics/graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/pyforms_gui/controls/uipics/graph.png -------------------------------------------------------------------------------- /tutorials/2.ControlsExamples/lena.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/tutorials/2.ControlsExamples/lena.png -------------------------------------------------------------------------------- /docs/source/_static/imgs/basewidget.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/source/_static/imgs/basewidget.png -------------------------------------------------------------------------------- /docs/source/_static/imgs/db-apps-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/source/_static/imgs/db-apps-1.png -------------------------------------------------------------------------------- /docs/source/_static/imgs/db-apps-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/source/_static/imgs/db-apps-2.png -------------------------------------------------------------------------------- /docs/source/_static/imgs/first-app.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/source/_static/imgs/first-app.png -------------------------------------------------------------------------------- /docs/source/_static/imgs/model-edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/source/_static/imgs/model-edit.png -------------------------------------------------------------------------------- /docs/source/_static/imgs/model-view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/source/_static/imgs/model-view.png -------------------------------------------------------------------------------- /docs/source/_static/imgs/orquestra.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/source/_static/imgs/orquestra.jpg -------------------------------------------------------------------------------- /pyforms_gui/controls/uipics/refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/pyforms_gui/controls/uipics/refresh.png -------------------------------------------------------------------------------- /pyforms_gui/controls/uipics/remove.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/pyforms_gui/controls/uipics/remove.png -------------------------------------------------------------------------------- /pyforms_gui/controls/uipics/zoom_in.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/pyforms_gui/controls/uipics/zoom_in.png -------------------------------------------------------------------------------- /tutorials/Controls4Docs/ControlDir.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/tutorials/Controls4Docs/ControlDir.png -------------------------------------------------------------------------------- /tutorials/Controls4Docs/ControlFile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/tutorials/Controls4Docs/ControlFile.png -------------------------------------------------------------------------------- /tutorials/Controls4Docs/ControlList.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/tutorials/Controls4Docs/ControlList.png -------------------------------------------------------------------------------- /tutorials/Controls4Docs/ControlText.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/tutorials/Controls4Docs/ControlText.png -------------------------------------------------------------------------------- /tutorials/Controls4Docs/ControlTree.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/tutorials/Controls4Docs/ControlTree.png -------------------------------------------------------------------------------- /tutorials/Controls4Docs/ControlWeb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/tutorials/Controls4Docs/ControlWeb.png -------------------------------------------------------------------------------- /docs/imgs/formsets-segment-sidebyside.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/imgs/formsets-segment-sidebyside.png -------------------------------------------------------------------------------- /docs/source/_static/imgs/controls/date.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/source/_static/imgs/controls/date.png -------------------------------------------------------------------------------- /docs/source/_static/imgs/controls/file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/source/_static/imgs/controls/file.png -------------------------------------------------------------------------------- /docs/source/_static/imgs/controls/text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/source/_static/imgs/controls/text.png -------------------------------------------------------------------------------- /docs/source/_static/imgs/model-admin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/source/_static/imgs/model-admin.png -------------------------------------------------------------------------------- /docs/source/_static/imgs/pyforms-gui.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/source/_static/imgs/pyforms-gui.jpg -------------------------------------------------------------------------------- /docs/source/_static/imgs/pyforms-web.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/source/_static/imgs/pyforms-web.jpg -------------------------------------------------------------------------------- /pyforms_gui/controls/uipics/film_edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/pyforms_gui/controls/uipics/film_edit.png -------------------------------------------------------------------------------- /pyforms_gui/controls/uipics/timeline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/pyforms_gui/controls/uipics/timeline.png -------------------------------------------------------------------------------- /pyforms_gui/controls/uipics/zoom_out.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/pyforms_gui/controls/uipics/zoom_out.png -------------------------------------------------------------------------------- /tutorials/2.ControlsExamples/Example1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/tutorials/2.ControlsExamples/Example1.png -------------------------------------------------------------------------------- /tutorials/2.ControlsExamples/Example2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/tutorials/2.ControlsExamples/Example2.png -------------------------------------------------------------------------------- /tutorials/2.ControlsExamples/Example3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/tutorials/2.ControlsExamples/Example3.png -------------------------------------------------------------------------------- /tutorials/Controls4Docs/ControlButton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/tutorials/Controls4Docs/ControlButton.png -------------------------------------------------------------------------------- /tutorials/Controls4Docs/ControlCombo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/tutorials/Controls4Docs/ControlCombo.png -------------------------------------------------------------------------------- /tutorials/Controls4Docs/ControlImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/tutorials/Controls4Docs/ControlImage.png -------------------------------------------------------------------------------- /tutorials/Controls4Docs/ControlLabel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/tutorials/Controls4Docs/ControlLabel.png -------------------------------------------------------------------------------- /tutorials/Controls4Docs/ControlMdiArea.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/tutorials/Controls4Docs/ControlMdiArea.png -------------------------------------------------------------------------------- /tutorials/Controls4Docs/ControlNumber.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/tutorials/Controls4Docs/ControlNumber.png -------------------------------------------------------------------------------- /tutorials/Controls4Docs/ControlOpenGL.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/tutorials/Controls4Docs/ControlOpenGL.png -------------------------------------------------------------------------------- /tutorials/Controls4Docs/ControlPlayer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/tutorials/Controls4Docs/ControlPlayer.png -------------------------------------------------------------------------------- /tutorials/Controls4Docs/ControlSlider.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/tutorials/Controls4Docs/ControlSlider.png -------------------------------------------------------------------------------- /tutorials/Controls4Docs/ControlToolBox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/tutorials/Controls4Docs/ControlToolBox.png -------------------------------------------------------------------------------- /tutorials/Controls4Docs/ControlVisVis.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/tutorials/Controls4Docs/ControlVisVis.png -------------------------------------------------------------------------------- /docs/source/_static/imgs/controls/button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/source/_static/imgs/controls/button.png -------------------------------------------------------------------------------- /docs/source/_static/imgs/controls/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/source/_static/imgs/controls/image.png -------------------------------------------------------------------------------- /docs/source/_static/imgs/controls/label.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/source/_static/imgs/controls/label.png -------------------------------------------------------------------------------- /docs/source/_static/imgs/controls/player.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/source/_static/imgs/controls/player.png -------------------------------------------------------------------------------- /docs/source/_static/imgs/controls/slider.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/source/_static/imgs/controls/slider.png -------------------------------------------------------------------------------- /docs/source/_static/imgs/pyforms-web-com.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/source/_static/imgs/pyforms-web-com.png -------------------------------------------------------------------------------- /tutorials/Controls4Docs/ControlCheckBox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/tutorials/Controls4Docs/ControlCheckBox.png -------------------------------------------------------------------------------- /tutorials/Controls4Docs/ControlFilesTree.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/tutorials/Controls4Docs/ControlFilesTree.png -------------------------------------------------------------------------------- /tutorials/Controls4Docs/ControlProgress.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/tutorials/Controls4Docs/ControlProgress.png -------------------------------------------------------------------------------- /tutorials/Controls4Docs/ControlTextArea.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/tutorials/Controls4Docs/ControlTextArea.png -------------------------------------------------------------------------------- /tutorials/Controls4Docs/ControlTreeView.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/tutorials/Controls4Docs/ControlTreeView.png -------------------------------------------------------------------------------- /docs/source/_static/imgs/controls/calendar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/source/_static/imgs/controls/calendar.png -------------------------------------------------------------------------------- /docs/source/_static/imgs/controls/checkbox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/source/_static/imgs/controls/checkbox.png -------------------------------------------------------------------------------- /docs/source/_static/imgs/controls/combobox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/source/_static/imgs/controls/combobox.png -------------------------------------------------------------------------------- /docs/source/_static/imgs/controls/datetime.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/source/_static/imgs/controls/datetime.png -------------------------------------------------------------------------------- /docs/source/_static/imgs/controls/integer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/source/_static/imgs/controls/integer.png -------------------------------------------------------------------------------- /docs/source/_static/imgs/controls/password.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/source/_static/imgs/controls/password.png -------------------------------------------------------------------------------- /docs/source/_static/imgs/controls/textarea.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/source/_static/imgs/controls/textarea.png -------------------------------------------------------------------------------- /docs/source/_static/imgs/getting-started-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/source/_static/imgs/getting-started-1.png -------------------------------------------------------------------------------- /docs/source/_static/imgs/getting-started-10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/source/_static/imgs/getting-started-10.png -------------------------------------------------------------------------------- /docs/source/_static/imgs/getting-started-11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/source/_static/imgs/getting-started-11.png -------------------------------------------------------------------------------- /docs/source/_static/imgs/getting-started-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/source/_static/imgs/getting-started-2.png -------------------------------------------------------------------------------- /docs/source/_static/imgs/getting-started-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/source/_static/imgs/getting-started-3.png -------------------------------------------------------------------------------- /docs/source/_static/imgs/getting-started-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/source/_static/imgs/getting-started-4.png -------------------------------------------------------------------------------- /docs/source/_static/imgs/getting-started-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/source/_static/imgs/getting-started-5.png -------------------------------------------------------------------------------- /docs/source/_static/imgs/getting-started-6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/source/_static/imgs/getting-started-6.png -------------------------------------------------------------------------------- /docs/source/_static/imgs/getting-started-7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/source/_static/imgs/getting-started-7.png -------------------------------------------------------------------------------- /docs/source/_static/imgs/getting-started-8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/source/_static/imgs/getting-started-8.png -------------------------------------------------------------------------------- /docs/source/_static/imgs/getting-started-9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/source/_static/imgs/getting-started-9.png -------------------------------------------------------------------------------- /docs/source/_static/imgs/pyforms-gui-small.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/source/_static/imgs/pyforms-gui-small.jpg -------------------------------------------------------------------------------- /docs/source/_static/imgs/pyforms-layers-gui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/source/_static/imgs/pyforms-layers-gui.png -------------------------------------------------------------------------------- /docs/source/_static/imgs/pyforms-terminal.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/source/_static/imgs/pyforms-terminal.jpg -------------------------------------------------------------------------------- /docs/source/_static/imgs/pyforms-web-small.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/source/_static/imgs/pyforms-web-small.jpg -------------------------------------------------------------------------------- /docs/source/_static/imgs/terminal-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/source/_static/imgs/terminal-example.png -------------------------------------------------------------------------------- /pyforms_gui/controls/uipics/page_white_get.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/pyforms_gui/controls/uipics/page_white_get.png -------------------------------------------------------------------------------- /pyforms_gui/controls/uipics/page_white_put.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/pyforms_gui/controls/uipics/page_white_put.png -------------------------------------------------------------------------------- /tutorials/Controls4Docs/ControlCheckBoxList.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/tutorials/Controls4Docs/ControlCheckBoxList.png -------------------------------------------------------------------------------- /tutorials/Controls4Docs/ControlCodeEditor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/tutorials/Controls4Docs/ControlCodeEditor.png -------------------------------------------------------------------------------- /tutorials/Controls4Docs/ControlDockWidget.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/tutorials/Controls4Docs/ControlDockWidget.png -------------------------------------------------------------------------------- /tutorials/Controls4Docs/ControlVisVisVolume.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/tutorials/Controls4Docs/ControlVisVisVolume.png -------------------------------------------------------------------------------- /docs/imgs/gui-example-computervisionalgorithm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/imgs/gui-example-computervisionalgorithm.png -------------------------------------------------------------------------------- /docs/source/_static/imgs/controls/fileupload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/source/_static/imgs/controls/fileupload.png -------------------------------------------------------------------------------- /tutorials/Controls4Docs/ControlBoundingSlider.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/tutorials/Controls4Docs/ControlBoundingSlider.png -------------------------------------------------------------------------------- /tutorials/Controls4Docs/ControlEventTimeline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/tutorials/Controls4Docs/ControlEventTimeline.png -------------------------------------------------------------------------------- /docs/source/_static/imgs/controls/boundingslider.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/source/_static/imgs/controls/boundingslider.png -------------------------------------------------------------------------------- /docs/source/_static/imgs/controls/multiselection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/source/_static/imgs/controls/multiselection.png -------------------------------------------------------------------------------- /docs/source/_static/imgs/pyforms-layers-terminal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/source/_static/imgs/pyforms-layers-terminal.png -------------------------------------------------------------------------------- /docs/source/_static/imgs/pyforms-terminal-small.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/source/_static/imgs/pyforms-terminal-small.jpg -------------------------------------------------------------------------------- /docs/imgs/terminal-example-computervisionalgorithm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/imgs/terminal-example-computervisionalgorithm.png -------------------------------------------------------------------------------- /docs/source/_static/imgs/formsets-segment-sidebyside.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/source/_static/imgs/formsets-segment-sidebyside.png -------------------------------------------------------------------------------- /tutorials/1.SimpleExamples/SimpleExample1/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/tutorials/1.SimpleExamples/SimpleExample1/screenshot.png -------------------------------------------------------------------------------- /tutorials/1.SimpleExamples/SimpleExample2/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/tutorials/1.SimpleExamples/SimpleExample2/screenshot.png -------------------------------------------------------------------------------- /tutorials/1.SimpleExamples/SimpleExample3/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/tutorials/1.SimpleExamples/SimpleExample3/screenshot.png -------------------------------------------------------------------------------- /tutorials/1.SimpleExamples/SimpleExample4/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/tutorials/1.SimpleExamples/SimpleExample4/screenshot.png -------------------------------------------------------------------------------- /tutorials/1.SimpleExamples/SimpleExample5/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/tutorials/1.SimpleExamples/SimpleExample5/screenshot.png -------------------------------------------------------------------------------- /tutorials/1.SimpleExamples/SimpleExample6/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/tutorials/1.SimpleExamples/SimpleExample6/screenshot.png -------------------------------------------------------------------------------- /tutorials/3.CodeOrganization/settings.py: -------------------------------------------------------------------------------- 1 | SETTINGS_PRIORITY = 1 2 | 3 | #PYFORMS_MODE = 'TERMINAL' 4 | 5 | PYFORMS_STYLESHEET = 'style.css' 6 | PYFORMS_STYLESHEET_LINUX = 'style.css' -------------------------------------------------------------------------------- /pyforms_gui/utils/make_lambda.py: -------------------------------------------------------------------------------- 1 | 2 | 3 | def make_lambda_func(func, **kwargs): 4 | """ Auxiliar function for passing parameters to functions """ 5 | return lambda: func(**kwargs) -------------------------------------------------------------------------------- /docs/source/_static/imgs/gui-example-computervisionalgorithm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/source/_static/imgs/gui-example-computervisionalgorithm.png -------------------------------------------------------------------------------- /docs/source/_static/imgs/terminal-example-computervisionalgorithm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/docs/source/_static/imgs/terminal-example-computervisionalgorithm.png -------------------------------------------------------------------------------- /tutorials/1.SimpleExamples/ComputerVisionAlgorithmExample/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UmSenhorQualquer/pyforms-gui/HEAD/tutorials/1.SimpleExamples/ComputerVisionAlgorithmExample/screenshot.png -------------------------------------------------------------------------------- /readthedocs.yml: -------------------------------------------------------------------------------- 1 | # .readthedocs.yml 2 | 3 | build: 4 | image: latest 5 | 6 | python: 7 | version: 3.6 8 | 9 | formats: 10 | - epub 11 | - pdf 12 | 13 | conda: 14 | file: environment.yml 15 | -------------------------------------------------------------------------------- /tutorials/1.SimpleExamples/SimpleExample3/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | from pyforms.basewidget import BaseWidget 3 | from pyforms.controls import ControlText 4 | from pyforms.controls import ControlButton 5 | 6 | import pyforms -------------------------------------------------------------------------------- /tutorials/1.SimpleExamples/SimpleExample4/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | from pyforms.basewidget import BaseWidget 3 | from pyforms.controls import ControlText 4 | from pyforms.controls import ControlButton 5 | 6 | import pyforms -------------------------------------------------------------------------------- /tutorials/1.SimpleExamples/SimpleExample5/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | from pyforms.basewidget import BaseWidget 3 | from pyforms.controls import ControlText 4 | from pyforms.controls import ControlButton 5 | 6 | import pyforms -------------------------------------------------------------------------------- /tutorials/1.SimpleExamples/SimpleExample6/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | from pyforms.basewidget import BaseWidget 3 | from pyforms.controls import ControlText 4 | from pyforms.controls import ControlButton 5 | 6 | import pyforms -------------------------------------------------------------------------------- /docs/source/getting-started/installing.rst: -------------------------------------------------------------------------------- 1 | ******************** 2 | Install & configure 3 | ******************** 4 | 5 | * Install Pyforms using **pip**. 6 | 7 | .. code:: bash 8 | 9 | pip install pyforms-gui 10 | -------------------------------------------------------------------------------- /pyforms/dialogs.py: -------------------------------------------------------------------------------- 1 | from confapp import conf 2 | 3 | 4 | if conf.PYFORMS_MODE=='GUI': 5 | from pyforms_gui.dialogs.csv_parser import CsvParserDialog 6 | 7 | 8 | elif conf.PYFORMS_MODE=='TERMINAL': 9 | class CsvParserDialog(object): pass -------------------------------------------------------------------------------- /pyforms/settings.py: -------------------------------------------------------------------------------- 1 | # !/usr/bin/python3 2 | # -*- coding: utf-8 -*- 3 | 4 | 5 | import os, sys 6 | 7 | if 'terminal_mode' in sys.argv: 8 | PYFORMS_MODE = 'TERMINAL' 9 | else: 10 | PYFORMS_MODE = os.environ.get('PYFORMS_MODE', 'GUI') 11 | -------------------------------------------------------------------------------- /docs/source/api-reference/index.rst: -------------------------------------------------------------------------------- 1 | ******* 2 | Python 3 | ******* 4 | 5 | .. module:: pybpod_web.basewidget.BaseWidget 6 | :synopsis: entities 7 | 8 | .. toctree:: 9 | :titlesonly: 10 | 11 | basewidget 12 | controls 13 | settings -------------------------------------------------------------------------------- /docs/source/getting-started/mdi-applications.rst: -------------------------------------------------------------------------------- 1 | ****************** 2 | Mdi Applications 3 | ****************** 4 | 5 | This page was based in the examples available on the github folder: `Tutorial - Mdi Application `_ 6 | 7 | -------------------------------------------------------------------------------- /tutorials/4.MdiApplication/teste.txt: -------------------------------------------------------------------------------- 1 | {"_projectTree": {"side": "right"}, "_textField": {"value": "Alguma coisa"}, "_mdiArea": {}, "_details": {"side": "left", "value": {"_button": {}, "_middlename": {"value": "aaaa"}, "_lastname": {"value": "dddd"}, "_fullname": {"value": "qqq"}, "_firstname": {"value": "Default value"}}}} -------------------------------------------------------------------------------- /tutorials/3.CodeOrganization/people.dat: -------------------------------------------------------------------------------- 1 | (lp0 2 | ccopy_reg 3 | _reconstructor 4 | p1 5 | (cPerson 6 | Person 7 | p2 8 | c__builtin__ 9 | object 10 | p3 11 | Ntp4 12 | Rp5 13 | (dp6 14 | S'_middleName' 15 | p7 16 | S'' 17 | p8 18 | sS'_firstName' 19 | p9 20 | S'Jack' 21 | p10 22 | sS'_lastName' 23 | p11 24 | S'Barrow' 25 | p12 26 | sba. -------------------------------------------------------------------------------- /pyforms/controls.py: -------------------------------------------------------------------------------- 1 | from confapp import conf 2 | 3 | 4 | 5 | if conf.PYFORMS_MODE in ['GUI']: 6 | 7 | from pyforms_gui.allcontrols import * 8 | 9 | elif conf.PYFORMS_MODE in ['TERMINAL']: 10 | 11 | from pyforms_terminal.allcontrols import * 12 | 13 | elif conf.PYFORMS_MODE in ['WEB']: 14 | 15 | from pyforms_web.allcontrols import * -------------------------------------------------------------------------------- /pyforms_gui/controls/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | __author__ = "Ricardo Ribeiro" 5 | __credits__ = ["Ricardo Ribeiro"] 6 | __license__ = "MIT" 7 | __version__ = "0.0" 8 | __maintainer__ = "Ricardo Ribeiro" 9 | __email__ = "ricardojvr@gmail.com" 10 | __status__ = "Development" 11 | 12 | 13 | -------------------------------------------------------------------------------- /pyforms_gui/controls/control_player/VideoGLWidget.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | """ pyforms_gui.controls.ControlPlayer.VideoGLWidget 5 | 6 | """ 7 | 8 | from pyforms_gui.controls.control_player.AbstractGLWidget import AbstractGLWidget 9 | from AnyQt.QtOpenGL import QGLWidget 10 | 11 | class VideoGLWidget(AbstractGLWidget, QGLWidget): pass -------------------------------------------------------------------------------- /tutorials/3.CodeOrganization/Person.py: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | class Person(object): 5 | 6 | def __init__(self, firstName, middleName, lastName): 7 | self._firstName = firstName 8 | self._middleName = middleName 9 | self._lastName = lastName 10 | 11 | 12 | @property 13 | def fullName(self): 14 | return "{0} {1} {2}".format(self._firstName, self._middleName, self._lastName) -------------------------------------------------------------------------------- /tutorials/1.SimpleExamples/SimpleExample6/README.md: -------------------------------------------------------------------------------- 1 | # Simple example 6 2 | 3 | This example shows you how to implement a Popup Menu for a Control. 4 | 5 | ```python 6 | self._fullname.addPopupSubMenuOption('Path', 7 | { 8 | 'Delete': self.__dummyEvent, 9 | 'Edit': self.__dummyEvent, 10 | 'Interpolate': self.__dummyEvent 11 | }) 12 | ``` 13 | 14 | 15 | ![Simple example 6](screenshot.png?raw=true "Screen") 16 | -------------------------------------------------------------------------------- /tutorials/Controls4Docs/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | __author__ = "Ricardo Ribeiro" 5 | __credits__ = ["Ricardo Ribeiro"] 6 | __license__ = "MIT" 7 | __version__ = "0.0" 8 | __maintainer__ = "Ricardo Ribeiro" 9 | __email__ = "ricardojvr@gmail.com" 10 | __status__ = "Development" 11 | 12 | 13 | from pyforms.basewidget import BaseWidget 14 | from pyforms.controls import * 15 | import pyforms -------------------------------------------------------------------------------- /pyforms_gui/controls/control_event_timeline/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | """ pyforms_gui.controls.ControlEventTimeline.__init__ 5 | 6 | """ 7 | 8 | 9 | __author__ = ["Ricardo Ribeiro", "Hugo Cachitas"] 10 | __credits__ = ["Ricardo Ribeiro", "Hugo Cachitas"] 11 | __license__ = "MIT" 12 | __version__ = "0.0" 13 | __maintainer__ = "Ricardo Ribeiro" 14 | __email__ = "ricardojvr@gmail.com" 15 | __status__ = "Development" 16 | -------------------------------------------------------------------------------- /pyforms_gui/controls/control_password.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | from pyforms_gui.controls.control_text import ControlText 5 | from AnyQt.QtWidgets import QLineEdit 6 | 7 | class ControlPassword(ControlText): 8 | 9 | def init_form(self): 10 | super(ControlPassword, self).init_form() 11 | 12 | self.form.label.setAccessibleName('ControlPassword-label') 13 | self.form.lineEdit.setEchoMode(QLineEdit.Password) -------------------------------------------------------------------------------- /environment.yml: -------------------------------------------------------------------------------- 1 | name: pyforms-web-environment 2 | channels: 3 | - defaults 4 | dependencies: 5 | - python=3.6 6 | - pip: 7 | - sphinx 8 | - sphinx-autobuild 9 | - sphinx-rtd-theme 10 | - requests 11 | - idna 12 | - simplejson 13 | - opencv-python 14 | - numpy 15 | - confapp 16 | - urllib3 17 | - Pillow 18 | - anyqt 19 | - pyqt5 20 | - PyQtWebEngine 21 | - QScintilla 22 | - visvis 23 | - matplotlib 24 | - python-dateutil 25 | - numpy -------------------------------------------------------------------------------- /tutorials/1.SimpleExamples/SimpleExample2/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | __author__ = "Ricardo Ribeiro" 5 | __credits__ = ["Ricardo Ribeiro"] 6 | __license__ = "MIT" 7 | __version__ = "0.0" 8 | __maintainer__ = "Ricardo Ribeiro" 9 | __email__ = "ricardojvr@gmail.com" 10 | __status__ = "Development" 11 | 12 | from pyforms.basewidget import BaseWidget 13 | from pyforms.controls import ControlText 14 | from pyforms.controls import ControlButton 15 | 16 | import pyforms -------------------------------------------------------------------------------- /tutorials/4.MdiApplication/main.py: -------------------------------------------------------------------------------- 1 | import pyforms 2 | from Core.MainWindow import MainWindow 3 | 4 | 5 | ################################################################################################################## 6 | ################################################################################################################## 7 | ################################################################################################################## 8 | 9 | #Execute the application 10 | if __name__ == "__main__": pyforms.start_app( MainWindow ) -------------------------------------------------------------------------------- /mkdocs.yml: -------------------------------------------------------------------------------- 1 | site_name: PyForms 2 | pages: 3 | - Home: 'index.md' 4 | - Getting started: 5 | - 'The basic': 'getting-started/the-basic.md' 6 | - 'Multiple windows': 'getting-started/multiple-windows.md' 7 | - 'Style and layout with CSS': 'getting-started/style-layout.md' 8 | - 'Run the App in the Terminal': 'getting-started/run-terminal.md' 9 | - API: 10 | - 'BaseWidget': 'api-documentation/basewidget.md' 11 | - 'Controls': 'api-documentation/controls.md' 12 | - 'Settings': 'api-documentation/settings.md' 13 | - About: 'about/about.md' -------------------------------------------------------------------------------- /tutorials/1.SimpleExamples/SimpleExample1/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | __author__ = "Ricardo Ribeiro" 5 | __credits__ = ["Ricardo Ribeiro"] 6 | __license__ = "MIT" 7 | __version__ = "0.0" 8 | __maintainer__ = "Ricardo Ribeiro" 9 | __email__ = "ricardojvr@gmail.com" 10 | __status__ = "Development" 11 | 12 | 13 | from pyforms.basewidget import BaseWidget 14 | from pyforms.controls import ControlText 15 | from pyforms.controls import ControlButton 16 | from pyforms.controls import ControlMatplotlib 17 | import pyforms -------------------------------------------------------------------------------- /tutorials/1.SimpleExamples/SimpleExample5/README.md: -------------------------------------------------------------------------------- 1 | # Simple example 5 2 | 3 | This example shows you how to define the application Main menu using the BaseWidget.mainmenu property. 4 | 5 | ```python 6 | self.mainmenu = [ 7 | { 'File': [ 8 | {'Open': self.__dummyEvent}, 9 | '-', 10 | {'Save': self.__dummyEvent}, 11 | {'Save as': self.__dummyEvent} 12 | ] 13 | }, 14 | { 'Edit': [ 15 | {'Copy': self.__dummyEvent}, 16 | {'Past': self.__dummyEvent} 17 | ] 18 | } 19 | ] 20 | ``` 21 | 22 | 23 | ![Simple example 5](screenshot.png?raw=true "Screen") -------------------------------------------------------------------------------- /tutorials/3.CodeOrganization/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | __author__ = "Ricardo Ribeiro" 5 | __credits__ = ["Ricardo Ribeiro"] 6 | __license__ = "MIT" 7 | __version__ = "0.0" 8 | __maintainer__ = "Ricardo Ribeiro" 9 | __email__ = "ricardojvr@gmail.com" 10 | __status__ = "Development" 11 | 12 | 13 | from pyforms.basewidget import BaseWidget 14 | from pyforms.controls import ControlText 15 | from pyforms.controls import ControlButton 16 | from pyforms.controls import ControlList 17 | 18 | import pyforms 19 | 20 | -------------------------------------------------------------------------------- /tutorials/1.SimpleExamples/SimpleExample3/README.md: -------------------------------------------------------------------------------- 1 | # Simple example 3 2 | 3 | This example shows you how to organize the forms side by side using the variable "self.formset". 4 | 5 | ```python 6 | #Add the name of the forms variables inside tuples organize these forms side by side 7 | self.formset = [ ('_firstname','_middlename', '_lastname'), 8 | '_fullname', (' ' ,'_button', ' '), ' '] 9 | ``` 10 | 11 | 12 | 13 | **Notes:** 14 | - Forms vertically organized - use list. 15 | - Forms horizontally organized - use a tuple. 16 | 17 | 18 | 19 | ![Simple example 3](screenshot.png?raw=true "Screen") -------------------------------------------------------------------------------- /tutorials/3.CodeOrganization/style.css: -------------------------------------------------------------------------------- 1 | QMainWindow{ 2 | background-color: white; 3 | } 4 | 5 | QLabel{ 6 | min-width: 110px; 7 | } 8 | 9 | QLineEdit{ 10 | min-width: 200px; 11 | border: 1px solid #CCC; 12 | height: 30px; 13 | padding-left: 10px; 14 | } 15 | 16 | QPushButton{ 17 | background: #3498db; 18 | color: #ffffff; 19 | padding: 10px 20px 10px 20px; 20 | 21 | border-radius: 6px; 22 | } 23 | 24 | QPushButton:hover { 25 | background: #3cb0fd; 26 | } 27 | 28 | /*Use the # and the name of the variable to access to a specific the Control*/ 29 | #_firstnameField QLineEdit{ 30 | color:red; 31 | } -------------------------------------------------------------------------------- /pyforms_gui/controls/control_events_graph/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | """ pyforms_gui.controls.ControlEventTimeline.__init__ 5 | 6 | """ 7 | 8 | 9 | __author__ = ["Ricardo Ribeiro", "Hugo Cachitas"] 10 | __credits__ = ["Ricardo Ribeiro", "Hugo Cachitas"] 11 | __license__ = "MIT" 12 | __version__ = "0.0" 13 | __maintainer__ = "Ricardo Ribeiro" 14 | __email__ = "ricardojvr@gmail.com" 15 | __status__ = "Development" 16 | 17 | __all__ = ['ControlEventTimeline', 18 | 'TimelineWidget', 19 | 'Event', 20 | 'Pointer', 21 | 'TimelinePopupWindow'] 22 | -------------------------------------------------------------------------------- /tutorials/1.SimpleExamples/SimpleExample2/README.md: -------------------------------------------------------------------------------- 1 | # Simple example 2 2 | 3 | In the previous example the forms were not properly ordered. 4 | This example shows you how to organize the forms using the variable "self.formset". 5 | 6 | ```python 7 | #Add this line to the constructor and you will be able to organize the forms. 8 | self.formset = ['_firstname','_middlename','_lastname', '_fullname', '_button', ' '] 9 | ``` 10 | 11 | 12 | 13 | **Notes:** 14 | You can you use the value ' ' in the self.formset to force the Windows Form to give a blank space on the window. 15 | 16 | 17 | 18 | 19 | ![Simple example 2](screenshot.png?raw=true "Screen") -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line. 5 | SPHINXOPTS = 6 | SPHINXBUILD = sphinx-build 7 | SPHINXPROJ = PyformsWeb 8 | SOURCEDIR = source 9 | BUILDDIR = build 10 | 11 | # Put it first so that "make" without argument is like "make help". 12 | help: 13 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 14 | 15 | .PHONY: help Makefile 16 | 17 | # Catch-all target: route all unknown targets to Sphinx using the new 18 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 19 | %: Makefile 20 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) -------------------------------------------------------------------------------- /docs/source/api-reference/basewidget.rst: -------------------------------------------------------------------------------- 1 | *************************** 2 | :mod:`BaseWidget` 3 | *************************** 4 | 5 | .. module:: pyforms_gui.basewidget 6 | :synopsis: Bpod board 7 | 8 | 9 | -------- 10 | Overview 11 | -------- 12 | 13 | The BaseWidget class is the base class of all pyforms applications. 14 | 15 | -------------- 16 | API 17 | -------------- 18 | 19 | .. autoclass:: pyforms_gui.basewidget.BaseWidget 20 | :members: 21 | :undoc-members: 22 | :show-inheritance: 23 | :exclude-members: generate_segment,generate_segments,generate_tabs,generate_control,save_form,load_form,save_window,load_window,load_form_filename,before_close_event,mainmenu,visible,js 24 | 25 | -------------------------------------------------------------------------------- /tutorials/4.MdiApplication/Core/MainWindow.py: -------------------------------------------------------------------------------- 1 | from Core.BaseWindow import BaseWindow 2 | 3 | class MainWindow(BaseWindow): 4 | 5 | 6 | def __init__(self): 7 | super(MainWindow, self).__init__() 8 | 9 | #self.loadWindowData('teste.txt') 10 | 11 | 12 | ################################################################################################################## 13 | ################################################################################################################## 14 | ################################################################################################################## 15 | 16 | #Execute the application 17 | if __name__ == "__main__": 18 | import pyforms 19 | pyforms.start_app( MainWindow ) -------------------------------------------------------------------------------- /pyforms/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | __author__ = "Ricardo Ribeiro" 5 | __credits__ = ["Ricardo Ribeiro"] 6 | __license__ = "MIT" 7 | __version__ = '4.0' 8 | __maintainer__ = ["Ricardo Ribeiro"] 9 | __email__ = ["ricardojvr@gmail.com"] 10 | __status__ = "Production" 11 | 12 | 13 | from confapp import conf 14 | 15 | try: 16 | import local_settings 17 | conf += local_settings 18 | except: 19 | pass 20 | 21 | conf += 'pyforms.settings' 22 | 23 | 24 | 25 | 26 | if conf.PYFORMS_MODE == 'GUI': 27 | 28 | from pyforms_gui.appmanager import start_app 29 | 30 | elif conf.PYFORMS_MODE == 'TERMINAL': 31 | 32 | from pyforms_terminal.appmanager import start_app -------------------------------------------------------------------------------- /pyforms/basewidget.py: -------------------------------------------------------------------------------- 1 | from confapp import conf 2 | 3 | 4 | if conf.PYFORMS_MODE in ['GUI']: 5 | 6 | from pyforms_gui.basewidget import BaseWidget 7 | from pyforms_gui.organizers import vsplitter, hsplitter, segment, no_columns 8 | 9 | elif conf.PYFORMS_MODE in ['TERMINAL']: 10 | 11 | from pyforms_terminal.basewidget import BaseWidget 12 | no_columns = tuple 13 | segment = list 14 | 15 | elif conf.PYFORMS_MODE in ['WEB']: 16 | 17 | from pyforms_web.basewidget import BaseWidget 18 | from pyforms_web.organizers import no_columns, segment 19 | 20 | from pyforms_web.modeladmin import ModelAdmin 21 | from pyforms_web.modeladmin import ViewFormAdmin 22 | from pyforms_web.modeladmin import EditFormAdmin 23 | -------------------------------------------------------------------------------- /pyforms_gui/controls/label.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Form 4 | 5 | 6 | 7 | 0 8 | 0 9 | 111 10 | 39 11 | 12 | 13 | 14 | Form 15 | 16 | 17 | 18 | 19 | 20 | TextLabel 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /tutorials/3.CodeOrganization/People.py: -------------------------------------------------------------------------------- 1 | import pickle 2 | 3 | 4 | class People(object): 5 | 6 | 7 | def __init__(self): 8 | self._people = [] 9 | 10 | 11 | def addPerson(self, person): 12 | self._people.append(person) 13 | 14 | def removePerson(self, index): 15 | return self._people.pop(index) 16 | 17 | def save(self, filename): 18 | output = open(filename, 'wb') 19 | pickle.dump(self._people, output) 20 | 21 | def load(self, filename): 22 | pkl_file = open(filename, 'rb') 23 | self._people = pickle.load(pkl_file) 24 | 25 | 26 | 27 | 28 | if __name__ == "__main__": 29 | from Person import Person 30 | 31 | people = People() 32 | person = Person('Jack', '', 'Barrow') 33 | people.addPerson(person) 34 | people.save('people.dat') -------------------------------------------------------------------------------- /tutorials/1.SimpleExamples/SimpleExample4/README.md: -------------------------------------------------------------------------------- 1 | # Simple example 4 2 | 3 | This example shows you how to define tabs using dictionaries in the variable "self.formset". 4 | 5 | ```python 6 | #Use dictionaries for tabs 7 | self.formset = [ { 8 | 'Tab1':['_firstname','||','_middlename','||','_lastname'], 9 | 'Tab2': ['_fullname'] 10 | }, 11 | '=',(' ','_button', ' ') ] 12 | ``` 13 | 14 | 15 | 16 | **Notes:** 17 | Take a look between the First name, Middle name, and Last name controls, you will find a splitter which you can move. 18 | The same between the Tabs and the Button. 19 | - Use the sign '=' for a vertical splitter 20 | - Use the signs '||' for a horizontal splitter 21 | 22 | 23 | 24 | ![Simple example 4](screenshot.png?raw=true "Screen") -------------------------------------------------------------------------------- /pyforms_gui/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | __author__ = "Ricardo Ribeiro" 5 | __credits__ = ["Ricardo Ribeiro"] 6 | __license__ = "MIT" 7 | __version__ = "4.904.152" 8 | __maintainer__ = "Ricardo Ribeiro" 9 | __email__ = "ricardojvr@gmail.com" 10 | __status__ = "Development" 11 | 12 | from confapp import conf 13 | 14 | try: 15 | import local_settings 16 | conf += local_settings 17 | except: 18 | pass 19 | 20 | from . import settings as pyforms_settings 21 | conf += pyforms_settings 22 | 23 | import coloredlogs, logging 24 | 25 | logging.basicConfig( 26 | level=conf.PYFORMS_LOG_HANDLER_LEVEL, 27 | format=conf.PYFORMS_LOG_FORMAT, 28 | handlers=[logging.StreamHandler()] 29 | ) 30 | 31 | coloredlogs.install(level=conf.PYFORMS_LOG_HANDLER_LEVEL) -------------------------------------------------------------------------------- /pyforms_gui/utils/timeit.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | __author__ = "Ricardo Ribeiro" 5 | __credits__ = ["Ricardo Ribeiro"] 6 | __license__ = "MIT" 7 | __version__ = "0.0" 8 | __maintainer__ = "Ricardo Ribeiro" 9 | __email__ = "ricardojvr@gmail.com" 10 | __status__ = "Development" 11 | 12 | 13 | 14 | import time 15 | from datetime import datetime as datetime_dt, timedelta 16 | 17 | def timeit(method): 18 | def timed(*args, **kw): 19 | ts = time.time() 20 | result = method(*args, **kw) 21 | te = time.time() 22 | time_elapsed = datetime_dt(1,1,1) + timedelta(seconds=(te-ts) ) 23 | print("%s: %d:%d:%d:%d;%d" % (method.__name__, time_elapsed.day-1, time_elapsed.hour, time_elapsed.minute, time_elapsed.second, time_elapsed.microsecond)) 24 | return result 25 | return timed -------------------------------------------------------------------------------- /pyforms_gui/controls/control_filestree.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | 5 | from confapp import conf 6 | 7 | from pyforms_gui.controls.control_base import ControlBase 8 | 9 | from AnyQt import QtCore 10 | from AnyQt.QtWidgets import QTreeView, QFileSystemModel 11 | 12 | class ControlFilesTree(ControlBase): 13 | def init_form(self): 14 | self._form = QTreeView() 15 | super(ControlFilesTree, self).init_form() 16 | 17 | @property 18 | def value(self): return self._value 19 | 20 | @value.setter 21 | def value(self, value): 22 | ControlBase.value.fset(self, value) 23 | model = QFileSystemModel(parent=None) 24 | self._form.setModel(model) 25 | model.setRootPath(QtCore.QDir.currentPath()) 26 | 27 | self._form.setRootIndex(model.setRootPath(value)) 28 | 29 | self._form.setIconSize(QtCore.QSize(32, 32)) 30 | -------------------------------------------------------------------------------- /docs/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | pushd %~dp0 4 | 5 | REM Command file for Sphinx documentation 6 | 7 | if "%SPHINXBUILD%" == "" ( 8 | set SPHINXBUILD=sphinx-build 9 | ) 10 | set SOURCEDIR=source 11 | set BUILDDIR=build 12 | set SPHINXPROJ=PyformsWeb 13 | 14 | if "%1" == "" goto help 15 | 16 | %SPHINXBUILD% >NUL 2>NUL 17 | if errorlevel 9009 ( 18 | echo. 19 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 20 | echo.installed, then set the SPHINXBUILD environment variable to point 21 | echo.to the full path of the 'sphinx-build' executable. Alternatively you 22 | echo.may add the Sphinx directory to PATH. 23 | echo. 24 | echo.If you don't have Sphinx installed, grab it from 25 | echo.http://sphinx-doc.org/ 26 | exit /b 1 27 | ) 28 | 29 | %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% 30 | goto end 31 | 32 | :help 33 | %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% 34 | 35 | :end 36 | popd 37 | -------------------------------------------------------------------------------- /tutorials/1.SimpleExamples/SimpleExample1/README.md: -------------------------------------------------------------------------------- 1 | # Simple example 1 2 | 3 | This example shows the most simple way to create windows form application using pyforms.. 4 | 5 | 6 | ```python 7 | class SimpleExample1(BaseWidget): 8 | 9 | def __init__(self): 10 | super(SimpleExample1,self).__init__('Simple example 1') 11 | 12 | #Definition of the forms fields 13 | self._firstname = ControlText('First name', 'Default value') 14 | self._middlename = ControlText('Middle name') 15 | self._lastname = ControlText('Lastname name') 16 | self._fullname = ControlText('Full name') 17 | self._button = ControlButton('Press this button') 18 | 19 | #Define the button action 20 | self._button.value = self.__buttonAction 21 | 22 | 23 | def __buttonAction(self): 24 | """Button action event""" 25 | self._fullname.value = self._firstname.value +" "+ self._middlename.value + \ 26 | " "+ self._lastname.value 27 | ``` 28 | 29 | 30 | 31 | **Notes:** 32 | To simplify the code in the SimpleExample1.py file, I did import the Control classes in the file __init__.py 33 | 34 | 35 | 36 | 37 | ![Simple example 1](screenshot.png?raw=true "Screen") -------------------------------------------------------------------------------- /tutorials/2.ControlsExamples/README.md: -------------------------------------------------------------------------------- 1 | # Controls examples 2 | 3 | Here we can find examples of some of the available controllers. 4 | 5 | ## Example 1 6 | 7 | ```python 8 | self._directory = ControlDir('Choose a directory') 9 | self._file = ControlFile('Choose a file') 10 | self._filetree = ControlFilesTree('Choose a file') 11 | self._boundaries = ControlBoundingSlider('Bounding', horizontal=True) 12 | ``` 13 | 14 | ![Example 1](Example1.png?raw=true "Screen") 15 | 16 | ## Example 2 17 | 18 | ```python 19 | self._checkbox = ControlCheckBox('Choose a directory') 20 | self._checkboxList = ControlCheckBoxList('Choose a file') 21 | self._player = ControlPlayer('Choose a file') 22 | self._slider = ControlSlider('Slider') 23 | ``` 24 | 25 | ![Example 2](Example2.png?raw=true "Screen") 26 | 27 | ## Example 3 28 | 29 | ```python 30 | self._combobox = ControlCombo('Choose a item') 31 | self._list = ControlList('List label') 32 | self._progress = ControlProgress('Progress bar') 33 | self._visvisVolume = ControlVisVisVolume('Visvis') 34 | self._timeline = ControlEventTimeline('Timeline') 35 | ``` 36 | 37 | ![Example 3](Example3.png?raw=true "Screen") -------------------------------------------------------------------------------- /tutorials/Controls4Docs/ControlHBarsGraph.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | __author__ = "Ricardo Ribeiro" 5 | __credits__ = ["Ricardo Ribeiro"] 6 | __license__ = "MIT" 7 | __version__ = "0.0" 8 | __maintainer__ = "Ricardo Ribeiro" 9 | __email__ = "ricardojvr@gmail.com" 10 | __status__ = "Development" 11 | 12 | 13 | from __init__ import * 14 | 15 | 16 | class SimpleExample(BaseWidget): 17 | 18 | 19 | def __init__(self): 20 | super(SimpleExample,self).__init__('Simple example') 21 | 22 | #Definition of the forms fields 23 | self._control = ControlEventTimeline('Graph') 24 | 25 | self.formset = [' ',(' ','_control', ' '),' '] 26 | 27 | 28 | 29 | 30 | ################################################################################################################## 31 | ################################################################################################################## 32 | ################################################################################################################## 33 | 34 | #Execute the application 35 | if __name__ == "__main__": pyforms.start_app( SimpleExample ) 36 | -------------------------------------------------------------------------------- /tutorials/Controls4Docs/ControlText.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | __author__ = "Ricardo Ribeiro" 5 | __credits__ = ["Ricardo Ribeiro"] 6 | __license__ = "MIT" 7 | __version__ = "0.0" 8 | __maintainer__ = "Ricardo Ribeiro" 9 | __email__ = "ricardojvr@gmail.com" 10 | __status__ = "Development" 11 | 12 | 13 | from __init__ import * 14 | 15 | 16 | class SimpleExample(BaseWidget): 17 | 18 | 19 | def __init__(self): 20 | super(SimpleExample,self).__init__('Simple example') 21 | 22 | #Definition of the forms fields 23 | self._control = ControlText('Text') 24 | 25 | self.formset = [' ',(' ', '_control', ' '),' '] 26 | 27 | 28 | 29 | 30 | 31 | 32 | ################################################################################################################## 33 | ################################################################################################################## 34 | ################################################################################################################## 35 | 36 | #Execute the application 37 | if __name__ == "__main__": pyforms.start_app( SimpleExample ) 38 | -------------------------------------------------------------------------------- /tutorials/Controls4Docs/ControlButton.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | __author__ = "Ricardo Ribeiro" 5 | __credits__ = ["Ricardo Ribeiro"] 6 | __license__ = "MIT" 7 | __version__ = "0.0" 8 | __maintainer__ = "Ricardo Ribeiro" 9 | __email__ = "ricardojvr@gmail.com" 10 | __status__ = "Development" 11 | 12 | 13 | from __init__ import * 14 | 15 | 16 | 17 | 18 | class SimpleExample(BaseWidget): 19 | 20 | 21 | def __init__(self): 22 | super(SimpleExample,self).__init__('Simple example') 23 | 24 | #Definition of the forms fields 25 | self._control = ControlButton('Click me') 26 | 27 | self.formset = [' ',(' ','_control', ' '),' '] 28 | 29 | 30 | 31 | 32 | ################################################################################################################## 33 | ################################################################################################################## 34 | ################################################################################################################## 35 | 36 | #Execute the application 37 | if __name__ == "__main__": pyforms.start_app( SimpleExample ) 38 | -------------------------------------------------------------------------------- /tutorials/Controls4Docs/ControlEventTimeline.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | __author__ = "Ricardo Ribeiro" 5 | __credits__ = ["Ricardo Ribeiro"] 6 | __license__ = "MIT" 7 | __version__ = "0.0" 8 | __maintainer__ = "Ricardo Ribeiro" 9 | __email__ = "ricardojvr@gmail.com" 10 | __status__ = "Development" 11 | 12 | 13 | from __init__ import * 14 | 15 | 16 | class SimpleExample(BaseWidget): 17 | 18 | 19 | def __init__(self): 20 | super(SimpleExample,self).__init__('Simple example') 21 | 22 | #Definition of the forms fields 23 | self._control = ControlEventTimeline('Check me') 24 | 25 | self.formset = [' ',(' ','_control', ' '),' '] 26 | 27 | 28 | 29 | 30 | ################################################################################################################## 31 | ################################################################################################################## 32 | ################################################################################################################## 33 | 34 | #Execute the application 35 | if __name__ == "__main__": pyforms.start_app( SimpleExample ) 36 | -------------------------------------------------------------------------------- /tutorials/Controls4Docs/ControlTextArea.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | __author__ = "Ricardo Ribeiro" 5 | __credits__ = ["Ricardo Ribeiro"] 6 | __license__ = "MIT" 7 | __version__ = "0.0" 8 | __maintainer__ = "Ricardo Ribeiro" 9 | __email__ = "ricardojvr@gmail.com" 10 | __status__ = "Development" 11 | 12 | 13 | from __init__ import * 14 | 15 | 16 | class SimpleExample(BaseWidget): 17 | 18 | 19 | def __init__(self): 20 | super(SimpleExample,self).__init__('Simple example') 21 | 22 | #Definition of the forms fields 23 | self._control = ControlTextArea('Text') 24 | 25 | self.formset = [' ',(' ', '_control', ' '),' '] 26 | 27 | 28 | 29 | 30 | 31 | 32 | ################################################################################################################## 33 | ################################################################################################################## 34 | ################################################################################################################## 35 | 36 | #Execute the application 37 | if __name__ == "__main__": pyforms.start_app( SimpleExample ) 38 | -------------------------------------------------------------------------------- /tutorials/Controls4Docs/ControlFile.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | __author__ = "Ricardo Ribeiro" 5 | __credits__ = ["Ricardo Ribeiro"] 6 | __license__ = "MIT" 7 | __version__ = "0.0" 8 | __maintainer__ = "Ricardo Ribeiro" 9 | __email__ = "ricardojvr@gmail.com" 10 | __status__ = "Development" 11 | 12 | 13 | from __init__ import * 14 | 15 | 16 | class SimpleExample(BaseWidget): 17 | 18 | 19 | def __init__(self): 20 | super(SimpleExample,self).__init__('Simple example') 21 | 22 | #Definition of the forms fields 23 | self._control = ControlFile('Select a file') 24 | 25 | self.formset = [' ',(' ', '_control', ' '),' '] 26 | 27 | 28 | 29 | 30 | 31 | 32 | ################################################################################################################## 33 | ################################################################################################################## 34 | ################################################################################################################## 35 | 36 | #Execute the application 37 | if __name__ == "__main__": pyforms.start_app( SimpleExample ) 38 | -------------------------------------------------------------------------------- /tutorials/Controls4Docs/ControlLabel.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | __author__ = "Ricardo Ribeiro" 5 | __credits__ = ["Ricardo Ribeiro"] 6 | __license__ = "MIT" 7 | __version__ = "0.0" 8 | __maintainer__ = "Ricardo Ribeiro" 9 | __email__ = "ricardojvr@gmail.com" 10 | __status__ = "Development" 11 | 12 | 13 | from __init__ import * 14 | 15 | 16 | class SimpleExample(BaseWidget): 17 | 18 | 19 | def __init__(self): 20 | super(SimpleExample,self).__init__('Simple example') 21 | 22 | #Definition of the forms fields 23 | self._control = ControlLabel('Simple label') 24 | 25 | self.formset = [' ',(' ', '_control', ' '),' '] 26 | 27 | 28 | 29 | 30 | 31 | 32 | ################################################################################################################## 33 | ################################################################################################################## 34 | ################################################################################################################## 35 | 36 | #Execute the application 37 | if __name__ == "__main__": pyforms.start_app( SimpleExample ) 38 | -------------------------------------------------------------------------------- /pyforms_gui/controls/image.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Frame 4 | 5 | 6 | 7 | 0 8 | 0 9 | 604 10 | 403 11 | 12 | 13 | 14 | 15 | 0 16 | 0 17 | 18 | 19 | 20 | Frame 21 | 22 | 23 | QFrame::NoFrame 24 | 25 | 26 | QFrame::Raised 27 | 28 | 29 | 30 | 0 31 | 32 | 33 | 0 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /tutorials/Controls4Docs/ControlNumber.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | __author__ = "Ricardo Ribeiro" 5 | __credits__ = ["Ricardo Ribeiro"] 6 | __license__ = "MIT" 7 | __version__ = "0.0" 8 | __maintainer__ = "Ricardo Ribeiro" 9 | __email__ = "ricardojvr@gmail.com" 10 | __status__ = "Development" 11 | 12 | 13 | from __init__ import * 14 | 15 | 16 | class SimpleExample(BaseWidget): 17 | 18 | 19 | def __init__(self): 20 | super(SimpleExample,self).__init__('Simple example') 21 | 22 | #Definition of the forms fields 23 | self._control = ControlNumber('Select a number') 24 | 25 | self.formset = [' ',(' ', '_control', ' '),' '] 26 | 27 | 28 | 29 | 30 | 31 | 32 | ################################################################################################################## 33 | ################################################################################################################## 34 | ################################################################################################################## 35 | 36 | #Execute the application 37 | if __name__ == "__main__": pyforms.start_app( SimpleExample ) 38 | -------------------------------------------------------------------------------- /tutorials/Controls4Docs/ControlSlider.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | __author__ = "Ricardo Ribeiro" 5 | __credits__ = ["Ricardo Ribeiro"] 6 | __license__ = "MIT" 7 | __version__ = "0.0" 8 | __maintainer__ = "Ricardo Ribeiro" 9 | __email__ = "ricardojvr@gmail.com" 10 | __status__ = "Development" 11 | 12 | 13 | from __init__ import * 14 | 15 | 16 | class SimpleExample(BaseWidget): 17 | 18 | 19 | def __init__(self): 20 | super(SimpleExample,self).__init__('Simple example') 21 | 22 | #Definition of the forms fields 23 | self._control = ControlSlider('Select a value') 24 | 25 | self.formset = [' ',(' ', '_control', ' '),' '] 26 | 27 | 28 | 29 | 30 | 31 | 32 | ################################################################################################################## 33 | ################################################################################################################## 34 | ################################################################################################################## 35 | 36 | #Execute the application 37 | if __name__ == "__main__": pyforms.start_app( SimpleExample ) 38 | -------------------------------------------------------------------------------- /tutorials/3.CodeOrganization/README.md: -------------------------------------------------------------------------------- 1 | # Code organization example 2 | 3 | On this example it will be shown how to modularize your code, in a in MVC way. 4 | 5 | ## 1. Implement the model. 6 | 7 | Person.py 8 | ```python 9 | class Person(object): 10 | ... 11 | ``` 12 | 13 | People.py 14 | ```python 15 | class People(object): 16 | ... 17 | ``` 18 | 19 | ## 2. Implement the GUI to manage ther Person model. 20 | 21 | PersonWindow.py 22 | ```python 23 | class PersonWindow(Person, BaseWidget): 24 | ... 25 | ``` 26 | 27 | **Note**: *Test the window by executing the file.* 28 | 29 | ## 3. Implement the GUI to manage ther People model. 30 | 31 | PeopleWindow.py 32 | ```python 33 | class PeopleWindow(People, BaseWidget): 34 | ... 35 | ``` 36 | 37 | ## 4. Implement the module that will give the Main Menu and the options save and load to the application. 38 | 39 | AddMenuFuntionality.py 40 | ```python 41 | class AddMenuFuntionality(object): 42 | ... 43 | ``` 44 | 45 | ## 5. Add the AddMenuFuntionality module to the PeopleWindow application, and the new functionalities will be added. 46 | 47 | PeopleWindow.py 48 | ```python 49 | class PeopleWindow(AddMenuFuntionality, People, BaseWidget): 50 | ... 51 | ``` 52 | -------------------------------------------------------------------------------- /tutorials/Controls4Docs/ControlFilesTree.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | __author__ = "Ricardo Ribeiro" 5 | __credits__ = ["Ricardo Ribeiro"] 6 | __license__ = "MIT" 7 | __version__ = "0.0" 8 | __maintainer__ = "Ricardo Ribeiro" 9 | __email__ = "ricardojvr@gmail.com" 10 | __status__ = "Development" 11 | 12 | 13 | from __init__ import * 14 | 15 | 16 | class SimpleExample(BaseWidget): 17 | 18 | 19 | def __init__(self): 20 | super(SimpleExample,self).__init__('Simple example') 21 | 22 | #Definition of the forms fields 23 | self._control = ControlFilesTree('Files') 24 | 25 | self.formset = [' ',(' ', '_control', ' '),' '] 26 | 27 | 28 | self._control.value = '.' 29 | 30 | 31 | 32 | ################################################################################################################## 33 | ################################################################################################################## 34 | ################################################################################################################## 35 | 36 | #Execute the application 37 | if __name__ == "__main__": pyforms.start_app( SimpleExample ) 38 | -------------------------------------------------------------------------------- /tutorials/Controls4Docs/ControlProgress.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | __author__ = "Ricardo Ribeiro" 5 | __credits__ = ["Ricardo Ribeiro"] 6 | __license__ = "MIT" 7 | __version__ = "0.0" 8 | __maintainer__ = "Ricardo Ribeiro" 9 | __email__ = "ricardojvr@gmail.com" 10 | __status__ = "Development" 11 | 12 | 13 | from __init__ import * 14 | 15 | 16 | class SimpleExample(BaseWidget): 17 | 18 | 19 | def __init__(self): 20 | super(SimpleExample,self).__init__('Simple example') 21 | 22 | #Definition of the forms fields 23 | self._control = ControlProgress() 24 | 25 | self.formset = [' ',(' ', '_control', ' '),' '] 26 | 27 | self._control.value = 40 28 | 29 | 30 | 31 | 32 | 33 | 34 | ################################################################################################################## 35 | ################################################################################################################## 36 | ################################################################################################################## 37 | 38 | #Execute the application 39 | if __name__ == "__main__": pyforms.start_app( SimpleExample ) 40 | -------------------------------------------------------------------------------- /.github/workflows/python-publish.yml: -------------------------------------------------------------------------------- 1 | # This workflow will upload a Python Package using Twine when a release is created 2 | # For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries 3 | 4 | # This workflow uses actions that are not certified by GitHub. 5 | # They are provided by a third-party and are governed by 6 | # separate terms of service, privacy policy, and support 7 | # documentation. 8 | 9 | name: Upload Python Package 10 | 11 | on: 12 | release: 13 | types: [published] 14 | 15 | jobs: 16 | deploy: 17 | 18 | runs-on: ubuntu-latest 19 | 20 | steps: 21 | - uses: actions/checkout@v2 22 | - name: Set up Python 23 | uses: actions/setup-python@v2 24 | with: 25 | python-version: '3.x' 26 | - name: Install dependencies 27 | run: | 28 | python -m pip install --upgrade pip 29 | pip install build 30 | - name: Build package 31 | run: python -m build 32 | - name: Publish package 33 | uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 34 | with: 35 | user: __token__ 36 | password: ${{ secrets.PYPI_API_TOKEN }} 37 | -------------------------------------------------------------------------------- /tutorials/Controls4Docs/ControlCheckBoxList.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | __author__ = "Ricardo Ribeiro" 5 | __credits__ = ["Ricardo Ribeiro"] 6 | __license__ = "MIT" 7 | __version__ = "0.0" 8 | __maintainer__ = "Ricardo Ribeiro" 9 | __email__ = "ricardojvr@gmail.com" 10 | __status__ = "Development" 11 | 12 | 13 | from __init__ import * 14 | 15 | 16 | class SimpleExample(BaseWidget): 17 | 18 | 19 | def __init__(self): 20 | super(SimpleExample,self).__init__('Simple example') 21 | 22 | #Definition of the forms fields 23 | self._control = ControlCheckBoxList('Check list') 24 | 25 | self.formset = [' ',(' ', '_control', ' '),' '] 26 | 27 | self._control.value = [('item1',True), ('item2',False), 'item3'] 28 | 29 | ################################################################################################################## 30 | ################################################################################################################## 31 | ################################################################################################################## 32 | 33 | #Execute the application 34 | if __name__ == "__main__": pyforms.start_app( SimpleExample ) 35 | -------------------------------------------------------------------------------- /tutorials/1.SimpleExamples/README.md: -------------------------------------------------------------------------------- 1 | # Simple examples 2 | 3 | ## Example 1 4 | 5 | Shows the most simple way to create windows forms application using pyforms. 6 | 7 | ![Simple example ](SimpleExample1/screenshot.png?raw=true "Screen") 8 | 9 | 10 | 11 | ## Example 2 12 | 13 | Shows you how to organize the forms using the variable "self.formset". 14 | 15 | ![Simple example ](SimpleExample2/screenshot.png?raw=true "Screen") 16 | 17 | 18 | 19 | ## Example 3 20 | 21 | Shows you how to organize the forms **side by side** using the variable "self.formset". 22 | 23 | ![Simple example ](SimpleExample3/screenshot.png?raw=true "Screen") 24 | 25 | 26 | 27 | ## Example 4 28 | 29 | Shows you how to **define tabs** using dictionaries in the variable "self.formset". 30 | 31 | ![Simple example ](SimpleExample4/screenshot.png?raw=true "Screen") 32 | 33 | 34 | 35 | ## Example 5 36 | 37 | Shows you how to define the **application main menu** using the BaseWidget.mainmenu property. 38 | 39 | ![Simple example ](SimpleExample5/screenshot.png?raw=true "Screen") 40 | 41 | 42 | 43 | ## Example 6 44 | 45 | This example shows you how to implement a **popup menu** for a Control. 46 | 47 | ![Simple example ](SimpleExample6/screenshot.png?raw=true "Screen") -------------------------------------------------------------------------------- /tutorials/Controls4Docs/ControlVisVis.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | __author__ = "Ricardo Ribeiro" 5 | __credits__ = ["Ricardo Ribeiro"] 6 | __license__ = "MIT" 7 | __version__ = "0.0" 8 | __maintainer__ = "Ricardo Ribeiro" 9 | __email__ = "ricardojvr@gmail.com" 10 | __status__ = "Development" 11 | 12 | 13 | from __init__ import * 14 | 15 | 16 | class SimpleExample(BaseWidget): 17 | 18 | 19 | def __init__(self): 20 | super(SimpleExample,self).__init__('Simple example') 21 | 22 | #Definition of the forms fields 23 | self._control = ControlVisVis('VisVis') 24 | 25 | self.formset = [' ',(' ', '_control', ' '),' '] 26 | 27 | self._control.value = [ [(10,20,10), (30,40,10)], [(10,20,3)] ] 28 | 29 | 30 | 31 | 32 | 33 | 34 | ################################################################################################################## 35 | ################################################################################################################## 36 | ################################################################################################################## 37 | 38 | #Execute the application 39 | if __name__ == "__main__": pyforms.start_app( SimpleExample ) 40 | -------------------------------------------------------------------------------- /tutorials/Controls4Docs/ControlToolBox.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | __author__ = "Ricardo Ribeiro" 5 | __credits__ = ["Ricardo Ribeiro"] 6 | __license__ = "MIT" 7 | __version__ = "0.0" 8 | __maintainer__ = "Ricardo Ribeiro" 9 | __email__ = "ricardojvr@gmail.com" 10 | __status__ = "Development" 11 | 12 | 13 | from __init__ import * 14 | 15 | 16 | class SimpleExample(BaseWidget): 17 | 18 | 19 | def __init__(self): 20 | super(SimpleExample,self).__init__('Simple example') 21 | 22 | #Definition of the forms fields 23 | self._control = ControlToolBox('Select a file') 24 | 25 | self.formset = [' ',(' ', '_control', ' '),' '] 26 | 27 | 28 | 29 | self._control.value = [ControlButton('Click me'), ControlText('Text')] 30 | 31 | 32 | ################################################################################################################## 33 | ################################################################################################################## 34 | ################################################################################################################## 35 | 36 | #Execute the application 37 | if __name__ == "__main__": pyforms.start_app( SimpleExample ) 38 | -------------------------------------------------------------------------------- /tutorials/Controls4Docs/ControlWeb.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | __author__ = "Ricardo Ribeiro" 5 | __credits__ = ["Ricardo Ribeiro"] 6 | __license__ = "MIT" 7 | __version__ = "0.0" 8 | __maintainer__ = "Ricardo Ribeiro" 9 | __email__ = "ricardojvr@gmail.com" 10 | __status__ = "Development" 11 | 12 | 13 | from __init__ import * 14 | 15 | 16 | class SimpleExample(BaseWidget): 17 | 18 | 19 | def __init__(self): 20 | super(SimpleExample,self).__init__('Simple example') 21 | 22 | #Definition of the forms fields 23 | self._control = ControlWeb('Web browser') 24 | 25 | self.formset = [' ',(' ', '_control', ' '),' '] 26 | 27 | self._control.value = 'https://github.com/UmSenhorQualquer/pyforms' 28 | 29 | 30 | 31 | 32 | 33 | 34 | ################################################################################################################## 35 | ################################################################################################################## 36 | ################################################################################################################## 37 | 38 | #Execute the application 39 | if __name__ == "__main__": pyforms.start_app( SimpleExample ) 40 | -------------------------------------------------------------------------------- /tutorials/Controls4Docs/ControlCodeEditor.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | __author__ = "Ricardo Ribeiro" 5 | __credits__ = ["Ricardo Ribeiro"] 6 | __license__ = "MIT" 7 | __version__ = "0.0" 8 | __maintainer__ = "Ricardo Ribeiro" 9 | __email__ = "ricardojvr@gmail.com" 10 | __status__ = "Development" 11 | 12 | 13 | from __init__ import * 14 | 15 | 16 | class SimpleExample(BaseWidget): 17 | 18 | 19 | def __init__(self): 20 | super(SimpleExample,self).__init__('Simple example') 21 | 22 | #Definition of the forms fields 23 | self._control = ControlCodeEditor('Code editor') 24 | 25 | self.formset = [ '_control'] 26 | 27 | self._control.changed_event = self.__print_value 28 | 29 | def __print_value(self): 30 | print self._control.value 31 | 32 | return True 33 | 34 | ################################################################################################################## 35 | ################################################################################################################## 36 | ################################################################################################################## 37 | 38 | #Execute the application 39 | if __name__ == "__main__": pyforms.start_app( SimpleExample ) 40 | -------------------------------------------------------------------------------- /tutorials/3.CodeOrganization/AddMenuFuntionality.py: -------------------------------------------------------------------------------- 1 | from PyQt4 import QtGui 2 | 3 | class AddMenuFuntionality(object): 4 | """ 5 | This class is a module of the application PeopleWindow.py 6 | It is a simple a example of how applications can be devided in modules with pyforms. 7 | It adds the Open and Save functionality 8 | """ 9 | 10 | def __init__(self): 11 | #It adds the next options to the main menu 12 | self.mainmenu.append( 13 | { 'File': [ 14 | {'Save as': self.__savePeople}, 15 | {'Open as': self.__loadPeople}, 16 | '-', 17 | {'Exit': self.__exit}, 18 | ] 19 | } 20 | ) 21 | 22 | 23 | 24 | 25 | def __savePeople(self): 26 | filename, _ = QtGui.QFileDialog.getSaveFileName(parent=self, 27 | caption="Save file", 28 | directory=".", 29 | filter="*.dat") 30 | 31 | if filename!=None and filename!='': self.save(filename) 32 | 33 | def __loadPeople(self): 34 | filename, _ = QtGui.QFileDialog.getOpenFileName(parent=self, 35 | caption="Import file", 36 | directory=".", 37 | filter="*.dat") 38 | 39 | if filename!=None and filename!='': 40 | self.load(filename) 41 | for person in self._people: 42 | self._peopleList += [person._firstName, person._middleName, person._lastName] 43 | 44 | 45 | def __exit(self): 46 | exit() -------------------------------------------------------------------------------- /tutorials/Controls4Docs/ControlCheckBox.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | __author__ = "Ricardo Ribeiro" 5 | __credits__ = ["Ricardo Ribeiro"] 6 | __license__ = "MIT" 7 | __version__ = "0.0" 8 | __maintainer__ = "Ricardo Ribeiro" 9 | __email__ = "ricardojvr@gmail.com" 10 | __status__ = "Development" 11 | 12 | 13 | from __init__ import * 14 | 15 | class SimpleExample(BaseWidget): 16 | 17 | 18 | def __init__(self): 19 | super(SimpleExample,self).__init__('Simple example') 20 | 21 | #Definition of the forms fields 22 | self._control = ControlCheckBox('Check me') 23 | 24 | self.formset = [' ',(' ','_control', ' '),' '] 25 | 26 | self._control.changed_event = self.__control_changed_event 27 | 28 | def __control_changed_event(self): 29 | print self._control.value 30 | 31 | ################################################################################################################## 32 | ################################################################################################################## 33 | ################################################################################################################## 34 | 35 | #Execute the application 36 | if __name__ == "__main__": pyforms.start_app( SimpleExample ) 37 | -------------------------------------------------------------------------------- /pyforms_gui/controls/checkbox.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Form 4 | 5 | 6 | 7 | 0 8 | 0 9 | 98 10 | 38 11 | 12 | 13 | 14 | 15 | 0 16 | 0 17 | 18 | 19 | 20 | 21 | 0 22 | 38 23 | 24 | 25 | 26 | 27 | 16777215 28 | 38 29 | 30 | 31 | 32 | Form 33 | 34 | 35 | 36 | 0 37 | 38 | 39 | 40 | 41 | CheckBox 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /pyforms_gui/controls/button.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Form 4 | 5 | 6 | 7 | 0 8 | 0 9 | 98 10 | 38 11 | 12 | 13 | 14 | 15 | 0 16 | 0 17 | 18 | 19 | 20 | 21 | 0 22 | 38 23 | 24 | 25 | 26 | 27 | 16777215 28 | 38 29 | 30 | 31 | 32 | Form 33 | 34 | 35 | 36 | 0 37 | 38 | 39 | 40 | 41 | PushButton 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /docs/api-documentation/settings.md: -------------------------------------------------------------------------------- 1 | # Settings 2 | 3 | Pyforms is using the confapp library to manage it settings. 4 | Here it is described some of the settings of the library. 5 | 6 | 7 | 8 | 9 | 10 | 11 | ## General configurations 12 | 13 | #### PYFORMS_MODE = os.environ.get('PYFORMS_MODE', 'GUI') 14 | 15 | It defines the mode that the pyforms should run. Currently pyforms can run as **GUI** or **TERMINAL** mode. 16 | 17 | #### PYFORMS_LOG_HANDLER_FILE_LEVEL = logging.DEBUG 18 | 19 | Logging level. 20 | 21 | #### PYFORMS_LOG_HANDLER_CONSOLE_LEVEL = logging.INFO 22 | 23 | Logging level. 24 | 25 | ## GUI layout 26 | 27 | #### PYFORMS_STYLESHEET = None 28 | 29 | Path to the stylesheet file of the application. 30 | 31 | #### PYFORMS_STYLESHEET_DARWIN = None 32 | #### PYFORMS_STYLESHEET_LINUX = None 33 | #### PYFORMS_STYLESHEET_WINDOWS = None 34 | 35 | Frequently it is necessary to adapt the layout of an application for each operating system. These variables allow you to do just that. 36 | For each operating system you can define a stylesheet that will complement the default stylesheet for a specific OS. 37 | 38 | 39 | 40 | ## Controls 41 | 42 | #### PYFORMS_CONTROL_CODE_EDITOR_DEFAULT_FONT_SIZE = '12' 43 | #### PYFORMS_CONTROL_EVENTS_GRAPH_DEFAULT_SCALE = 1 44 | #### PYFORMS_CONTROLPLAYER_FONT = 9 45 | 46 | 47 | -------------------------------------------------------------------------------- /pyforms_gui/controls/progressInput.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Form 4 | 5 | 6 | 7 | 0 8 | 0 9 | 344 10 | 38 11 | 12 | 13 | 14 | 15 | 0 16 | 0 17 | 18 | 19 | 20 | 21 | 0 22 | 38 23 | 24 | 25 | 26 | 27 | 16777215 28 | 38 29 | 30 | 31 | 32 | Form 33 | 34 | 35 | 36 | 0 37 | 38 | 39 | 40 | 41 | 24 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /tutorials/4.MdiApplication/Core/Controllers/ProjectTree.py: -------------------------------------------------------------------------------- 1 | import pyforms 2 | from pyforms.basewidget import BaseWidget 3 | 4 | 5 | from PyQt4 import QtGui, QtCore 6 | from pyforms.controls import ControlText 7 | from pyforms.controls import ControlButton 8 | from pyforms.controls import ControlTree 9 | 10 | 11 | class ProjectTree(BaseWidget): 12 | 13 | 14 | def __init__(self): 15 | super(ProjectTree, self).__init__('Project') 16 | 17 | self._addButton = ControlButton('Add') 18 | self._projectTree = ControlTree('Project tree') 19 | 20 | root = QtGui.QTreeWidgetItem(self._projectTree, ["root"]) 21 | A = QtGui.QTreeWidgetItem(root, ["A"]) 22 | barA = QtGui.QTreeWidgetItem(A, ["bar", "i", "ii"]) 23 | bazA = QtGui.QTreeWidgetItem(A, ["baz", "a", "b"]) 24 | 25 | self._projectTree.showHeader = False 26 | 27 | 28 | self.formset = [ (' ','_addButton'), '_projectTree'] 29 | 30 | 31 | ################################################################################################################## 32 | ################################################################################################################## 33 | ################################################################################################################## 34 | 35 | #Execute the application 36 | if __name__ == "__main__": pyforms.start_app( ProjectTree ) -------------------------------------------------------------------------------- /tutorials/2.ControlsExamples/Example4.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | __author__ = "Ricardo Ribeiro" 5 | __credits__ = ["Ricardo Ribeiro"] 6 | __license__ = "MIT" 7 | __version__ = "0.0" 8 | __maintainer__ = "Ricardo Ribeiro" 9 | __email__ = "ricardojvr@gmail.com" 10 | __status__ = "Development" 11 | 12 | 13 | from __init__ import * 14 | import numpy as np 15 | 16 | import random 17 | 18 | class Example4(BaseWidget): 19 | 20 | def __init__(self): 21 | super(Example4,self).__init__('Simple example 4') 22 | 23 | #Definition of the forms fields 24 | self._visvis = ControlVisVis('Visvis') 25 | 26 | 27 | self.formset = [ '_visvis' ] 28 | 29 | values1 = [ (i, random.random(), random.random()) for i in range(130) ] 30 | values2 = [ (i, random.random(), random.random()) for i in range(130) ] 31 | 32 | self._visvis.value = [values1, values2] 33 | 34 | ################################################################################################################## 35 | ################################################################################################################## 36 | ################################################################################################################## 37 | 38 | #Execute the application 39 | if __name__ == "__main__": pyforms.start_app( Example4 ) -------------------------------------------------------------------------------- /pyforms_gui/controls/textInput.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Form 4 | 5 | 6 | 7 | 0 8 | 0 9 | 130 10 | 38 11 | 12 | 13 | 14 | 15 | 0 16 | 0 17 | 18 | 19 | 20 | 21 | 0 22 | 38 23 | 24 | 25 | 26 | 27 | 16777215 28 | 38 29 | 30 | 31 | 32 | Form 33 | 34 | 35 | 36 | 0 37 | 38 | 39 | 40 | 41 | TextLabel 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /pyforms_gui/controls/number.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Form 4 | 5 | 6 | 7 | 0 8 | 0 9 | 141 10 | 38 11 | 12 | 13 | 14 | 15 | 0 16 | 0 17 | 18 | 19 | 20 | 21 | 0 22 | 38 23 | 24 | 25 | 26 | 27 | 16777215 28 | 38 29 | 30 | 31 | 32 | Form 33 | 34 | 35 | 36 | 0 37 | 38 | 39 | 40 | 41 | TextLabel 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /pyforms_gui/controls/textArea.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Form 4 | 5 | 6 | 7 | 0 8 | 0 9 | 274 10 | 38 11 | 12 | 13 | 14 | 15 | 0 16 | 0 17 | 18 | 19 | 20 | 21 | 0 22 | 38 23 | 24 | 25 | 26 | 27 | 16777215 28 | 16777215 29 | 30 | 31 | 32 | Form 33 | 34 | 35 | 36 | 0 37 | 38 | 39 | 40 | 41 | TextLabel 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /tutorials/2.ControlsExamples/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | __author__ = "Ricardo Ribeiro" 5 | __credits__ = ["Ricardo Ribeiro"] 6 | __license__ = "MIT" 7 | __version__ = "0.0" 8 | __maintainer__ = "Ricardo Ribeiro" 9 | __email__ = "ricardojvr@gmail.com" 10 | __status__ = "Development" 11 | 12 | from pyforms.basewidget import BaseWidget 13 | from pyforms.controls import ControlBoundingSlider 14 | from pyforms.controls import ControlText 15 | from pyforms.controls import ControlButton 16 | from pyforms.controls import ControlCheckBox 17 | from pyforms.controls import ControlCheckBoxList 18 | from pyforms.controls import ControlCombo 19 | from pyforms.controls import ControlDir 20 | from pyforms.controls import ControlDockWidget 21 | from pyforms.controls import ControlEmptyWidget 22 | from pyforms.controls import ControlFile 23 | from pyforms.controls import ControlFilesTree 24 | from pyforms.controls import ControlImage 25 | from pyforms.controls import ControlList 26 | from pyforms.controls import ControlPlayer 27 | from pyforms.controls import ControlProgress 28 | from pyforms.controls import ControlSlider 29 | from pyforms.controls import ControlVisVis 30 | from pyforms.controls import ControlVisVisVolume 31 | from pyforms.controls import ControlEventTimeline 32 | from pyforms.controls import ControlCodeEditor 33 | 34 | import pyforms -------------------------------------------------------------------------------- /tutorials/Controls4Docs/ControlDir.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | import pyforms 4 | from pyforms_gui.basewidget import BaseWidget 5 | from pyforms_gui.controls.control_dir import ControlDir 6 | 7 | __author__ = "Ricardo Ribeiro" 8 | __credits__ = ["Ricardo Ribeiro"] 9 | __license__ = "MIT" 10 | __version__ = "0.0" 11 | __maintainer__ = "Ricardo Ribeiro" 12 | __email__ = "ricardojvr@gmail.com" 13 | __status__ = "Development" 14 | 15 | 16 | from __init__ import * 17 | 18 | 19 | class SimpleExample(BaseWidget): 20 | 21 | 22 | def __init__(self): 23 | super(SimpleExample,self).__init__('Simple example') 24 | 25 | #Definition of the forms fields 26 | self._control = ControlDir('Files') 27 | 28 | self.formset = [' ',(' ', '_control', ' '),' '] 29 | 30 | self._control.changed_event = self.__print_value 31 | 32 | 33 | def __print_value(self): 34 | print(self._control.value) 35 | 36 | 37 | 38 | ################################################################################################################## 39 | ################################################################################################################## 40 | ################################################################################################################## 41 | 42 | #Execute the application 43 | if __name__ == "__main__": pyforms.start_app( SimpleExample ) 44 | -------------------------------------------------------------------------------- /tutorials/Controls4Docs/ControlList.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | __author__ = "Ricardo Ribeiro" 5 | __credits__ = ["Ricardo Ribeiro"] 6 | __license__ = "MIT" 7 | __version__ = "0.0" 8 | __maintainer__ = "Ricardo Ribeiro" 9 | __email__ = "ricardojvr@gmail.com" 10 | __status__ = "Development" 11 | 12 | 13 | from __init__ import * 14 | 15 | 16 | class SimpleExample(BaseWidget): 17 | 18 | 19 | def __init__(self): 20 | super(SimpleExample,self).__init__('Simple example') 21 | 22 | #Definition of the forms fields 23 | self._control = ControlList('List',horizontal_headers=[] ) 24 | 25 | self.formset = [' ',(' ', '_control', ' '),' '] 26 | 27 | self._control.value = [('Elem1', 'Elem2'), ('Elem3', 'Elem4')] 28 | 29 | self._control += ('Elem5', 'Elem6') 30 | 31 | self._control.horizontal_headers = ['col1','col2','col3'] 32 | self._control.horizontal_headers = ['col4',] 33 | 34 | 35 | 36 | 37 | 38 | ################################################################################################################## 39 | ################################################################################################################## 40 | ################################################################################################################## 41 | 42 | #Execute the application 43 | if __name__ == "__main__": pyforms.start_app( SimpleExample ) 44 | -------------------------------------------------------------------------------- /docs/index.md: -------------------------------------------------------------------------------- 1 | # Pyforms 2 | 3 | **[ Checkout Github for the source code ](https://github.com/UmSenhorQualquer/pyforms)** 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | Pyforms is a Python 2.7.x and 3.x cross-enviroment framework to develop GUI applications, which promotes modular software design and code reusability with minimal effort. 13 | 14 | ### It offers 15 | * A Python layer of Desktop forms, based on PyQt, OpenGL and other libraries. 16 | * A Python layer that allow applications to run on Desktop GUI, Web and terminal without requiring code modifications. 17 | * A group of rules and methodologies that help the developer maintain short, clean, reusable and readable. 18 | 19 | ![Diagram](https://raw.githubusercontent.com/UmSenhorQualquer/pyforms/v3.0/docs/pyforms.png?raw=true "Screen") 20 | 21 | Example of an application running in the Desktop, Web and Terminal enviroments: 22 | 23 | ![Application-Example](https://raw.githubusercontent.com/UmSenhorQualquer/pyforms/v1.0.beta/docs/example.png?raw=true "Screen") 24 | 25 | 26 | ## Installation 27 | 28 | Run in the terminal: 29 | ```bash 30 | pip install pyforms 31 | ``` -------------------------------------------------------------------------------- /tutorials/Controls4Docs/ControlImage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | __author__ = "Ricardo Ribeiro" 5 | __credits__ = ["Ricardo Ribeiro"] 6 | __license__ = "MIT" 7 | __version__ = "0.0" 8 | __maintainer__ = "Ricardo Ribeiro" 9 | __email__ = "ricardojvr@gmail.com" 10 | __status__ = "Development" 11 | 12 | 13 | from __init__ import * 14 | import cv2 15 | import os 16 | 17 | class SimpleExample(BaseWidget): 18 | 19 | 20 | def __init__(self): 21 | super(SimpleExample,self).__init__('Simple example') 22 | 23 | #Definition of the forms fields 24 | self._control = ControlImage('Image') 25 | self._open = ControlButton('Open') 26 | 27 | self.formset = [' ',(' ', '_control', ' '),'_open'] 28 | 29 | self._open.value = self.__open 30 | 31 | def __open(self): 32 | file_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), '2.ControlsExamples', 'lena.png') 33 | self._control.value = cv2.imread(file_path) 34 | 35 | 36 | 37 | ################################################################################################################## 38 | ################################################################################################################## 39 | ################################################################################################################## 40 | 41 | #Execute the application 42 | if __name__ == "__main__": pyforms.start_app( SimpleExample ) 43 | -------------------------------------------------------------------------------- /tutorials/1.SimpleExamples/SimpleExample3/SimpleExample3.py: -------------------------------------------------------------------------------- 1 | from __init__ import * 2 | 3 | 4 | 5 | class SimpleExample3(BaseWidget): 6 | 7 | def __init__(self): 8 | super(SimpleExample3,self).__init__('Simple example 3') 9 | 10 | #Definition of the forms fields 11 | self._firstname = ControlText('First name', 'Default value') 12 | self._middlename = ControlText('Middle name') 13 | self._lastname = ControlText('Lastname name') 14 | self._fullname = ControlText('Full name') 15 | self._button = ControlButton('Press this button') 16 | 17 | #Define the organization of the forms 18 | self.formset = [ ('_firstname','_middlename', '_lastname'), 19 | '_fullname', (' ' ,'_button', ' '), ' '] 20 | 21 | #Define the button action 22 | self._button.value = self.__buttonAction 23 | 24 | 25 | def __buttonAction(self): 26 | """Button action event""" 27 | self._fullname.value = self._firstname.value +" "+ self._middlename.value + \ 28 | " "+ self._lastname.value 29 | 30 | 31 | 32 | 33 | ################################################################################################################## 34 | ################################################################################################################## 35 | ################################################################################################################## 36 | 37 | #Execute the application 38 | if __name__ == "__main__": pyforms.start_app( SimpleExample3 ) 39 | -------------------------------------------------------------------------------- /docs/source/api-reference/settings.rst: -------------------------------------------------------------------------------- 1 | *************************** 2 | Settings 3 | *************************** 4 | 5 | Pyforms is using the confapp library to manage it settings. 6 | Here it is described some of the settings of the library. 7 | 8 | 9 | General configurations 10 | ---------------------------- 11 | 12 | **PYFORMS_MODE = os.environ.get('PYFORMS_MODE', 'GUI')** 13 | 14 | It defines the mode that the pyforms should run. Currently pyforms can run as **GUI** or **TERMINAL** mode. 15 | 16 | **PYFORMS_LOG_HANDLER_FILE_LEVEL = logging.DEBUG** 17 | 18 | Logging level. 19 | 20 | **PYFORMS_LOG_HANDLER_CONSOLE_LEVEL = logging.INFO** 21 | 22 | Logging level. 23 | 24 | GUI layout 25 | ---------------------------- 26 | 27 | **PYFORMS_STYLESHEET = None** 28 | 29 | Path to the stylesheet file of the application. 30 | 31 | **PYFORMS_STYLESHEET_DARWIN = None** 32 | 33 | **PYFORMS_STYLESHEET_LINUX = None** 34 | 35 | **PYFORMS_STYLESHEET_WINDOWS = None** 36 | 37 | Frequently it is necessary to adapt the layout of an application for each operating system. These variables allow you to do just that. 38 | For each operating system you can define a stylesheet that will complement the default stylesheet for a specific OS. 39 | 40 | Controls 41 | ---------------------------- 42 | 43 | **PYFORMS_CONTROL_CODE_EDITOR_DEFAULT_FONT_SIZE = '12'** 44 | 45 | **PYFORMS_CONTROL_EVENTS_GRAPH_DEFAULT_SCALE = 1** 46 | 47 | **PYFORMS_CONTROLPLAYER_FONT = 9** 48 | 49 | 50 | -------------------------------------------------------------------------------- /pyforms_gui/controls/tree.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Form 4 | 5 | 6 | 7 | 0 8 | 0 9 | 173 10 | 168 11 | 12 | 13 | 14 | 15 | 0 16 | 0 17 | 18 | 19 | 20 | 21 | 0 22 | 0 23 | 24 | 25 | 26 | 27 | 16777215 28 | 16777215 29 | 30 | 31 | 32 | Form 33 | 34 | 35 | 36 | 6 37 | 38 | 39 | 0 40 | 41 | 42 | 43 | 44 | TextLabel 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /tutorials/2.ControlsExamples/Example1.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | __author__ = "Ricardo Ribeiro" 5 | __credits__ = ["Ricardo Ribeiro"] 6 | __license__ = "MIT" 7 | __version__ = "0.0" 8 | __maintainer__ = "Ricardo Ribeiro" 9 | __email__ = "ricardojvr@gmail.com" 10 | __status__ = "Development" 11 | 12 | 13 | from __init__ import * 14 | 15 | 16 | 17 | class Example1(BaseWidget): 18 | 19 | def __init__(self): 20 | super(Example1,self).__init__('Simple example 1') 21 | 22 | #Definition of the forms fields 23 | self._directory = ControlDir('Choose a directory') 24 | self._file = ControlFile('Choose a file') 25 | self._filetree = ControlFilesTree('Choose a file') 26 | self._image = ControlImage('Image') 27 | self._boundaries = ControlBoundingSlider('Bounding', horizontal=True) 28 | 29 | self.formset = ['_directory', '_file', '_boundaries', '_filetree', '_image' ] 30 | 31 | 32 | self._filetree.value = '/' 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | ################################################################################################################## 42 | ################################################################################################################## 43 | ################################################################################################################## 44 | 45 | #Execute the application 46 | if __name__ == "__main__": pyforms.start_app( Example1 ) -------------------------------------------------------------------------------- /tutorials/2.ControlsExamples/Example2.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | __author__ = "Ricardo Ribeiro" 5 | __credits__ = ["Ricardo Ribeiro"] 6 | __license__ = "MIT" 7 | __version__ = "0.0" 8 | __maintainer__ = "Ricardo Ribeiro" 9 | __email__ = "ricardojvr@gmail.com" 10 | __status__ = "Development" 11 | 12 | 13 | from __init__ import * 14 | 15 | 16 | 17 | class Example1(BaseWidget): 18 | 19 | def __init__(self): 20 | super(Example1,self).__init__('Simple example 1') 21 | 22 | #Definition of the forms fields 23 | self._checkbox = ControlCheckBox('Choose a directory') 24 | self._checkboxList = ControlCheckBoxList('Choose a file') 25 | self._player = ControlPlayer('Choose a file') 26 | self._slider = ControlSlider('Slider') 27 | 28 | self._player.show() 29 | self.formset = [ '_slider', ('_checkboxList', '_player'), ('_checkbox',' ') ] 30 | 31 | 32 | self._checkboxList.value = [ ('Item 1', True), ('Item 2', False), ('Item 3', True)] 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | ################################################################################################################## 41 | ################################################################################################################## 42 | ################################################################################################################## 43 | 44 | #Execute the application 45 | if __name__ == "__main__": pyforms.start_app( Example1 ) -------------------------------------------------------------------------------- /pyforms_gui/controls/control_dockwidget.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | from pyforms_gui.controls.control_emptywidget import ControlEmptyWidget 5 | 6 | 7 | class ControlDockWidget(ControlEmptyWidget): 8 | SIDE_LEFT = 'left' 9 | SIDE_RIGHT = 'right' 10 | SIDE_TOP = 'top' 11 | SIDE_BOTTOM = 'bottom' 12 | SIDE_DETACHED = 'detached' 13 | 14 | def __init__(self, *args, **kwargs): 15 | ControlEmptyWidget.__init__(self, *args, **kwargs) 16 | self.side = kwargs.get('side', 'left') 17 | self.order = kwargs.get('order',0) 18 | self.margin = kwargs.get('margin', 0) 19 | 20 | default = kwargs.get('default', None) 21 | if default is not None: self.value = default 22 | self._show = True 23 | 24 | @property 25 | def label(self): 26 | return self._label 27 | 28 | @label.setter 29 | def label(self, value): 30 | self._label = value 31 | if hasattr(self, 'dock'): self.dock.setWindowTitle(value) 32 | 33 | def save_form(self, data, path=None): 34 | data['side'] = self.side 35 | super(ControlDockWidget, self).save_form(data, path=None) 36 | 37 | def load_form(self, data): 38 | self.side = data['side'] 39 | super(ControlDockWidget, self).load_form(data, path=None) 40 | 41 | def show(self): 42 | """ 43 | Show the control 44 | """ 45 | self._show = True 46 | if hasattr(self, 'dock'): self.dock.show() 47 | 48 | def hide(self): 49 | """ 50 | Hide the control 51 | """ 52 | self._show = False 53 | if hasattr(self, 'dock'): self.dock.hide() 54 | -------------------------------------------------------------------------------- /pyforms_gui/settings.py: -------------------------------------------------------------------------------- 1 | # !/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | import os 5 | 6 | PYFORMS_MAIN_WINDOW_ICON_PATH = None 7 | 8 | PYFORMS_MAINWINDOW_MARGIN = 7 9 | 10 | PYFORMS_CONTROL_CODE_EDITOR_DEFAULT_FONT_SIZE = '12' 11 | PYFORMS_CONTROL_EVENTS_GRAPH_DEFAULT_SCALE = 1 12 | 13 | PYFORMS_QUALITY_TESTS_PATH = None 14 | 15 | PYFORMS_STYLESHEET = None 16 | PYFORMS_STYLESHEET_DARWIN = None 17 | PYFORMS_STYLESHEET_LINUX = None 18 | PYFORMS_STYLESHEET_WINDOWS = None 19 | 20 | PYFORMS_CONTROLPLAYER_FONT = 9 21 | 22 | # In a normal loading, there may be errors that show up which are not important. 23 | # This happens because plugins_finder will search for classes on plugins which are not present because they are not needed. 24 | # However, if plugin is not loaded at all, this will show all related errors. 25 | # See pyforms_gui.utils.plugins_finder.find_class() 26 | PYFORMS_SILENT_PLUGINS_FINDER = True 27 | 28 | PYFORMS_QSCINTILLA_ENABLED = True 29 | PYFORMS_MATPLOTLIB_ENABLED = True 30 | PYFORMS_WEB_ENABLED = True 31 | PYFORMS_GL_ENABLED = True 32 | PYFORMS_VISVIS_ENABLED = True 33 | 34 | 35 | PYFORMS_DIALOGS_OPTIONS = None 36 | PYFORMS_COLORDIALOGS_OPTIONS = None 37 | 38 | #from AnyQt.QtWidgets import QColorDialog, QFileDialog 39 | #PYFORMS_DIALOGS_OPTIONS = QFileDialog.DontUseNativeDialog 40 | #PYFORMS_COLORDIALOGS_OPTIONS = QColorDialog.DontUseNativeDialog 41 | 42 | import logging 43 | PYFORMS_LOG_HANDLER_LEVEL = logging.INFO 44 | PYFORMS_LOG_FORMAT = '[%(levelname)-7s] %(name)-60s %(message)s' -------------------------------------------------------------------------------- /pyforms_gui/controls/control_player/VideoQt5GLWidget.py: -------------------------------------------------------------------------------- 1 | from pyforms_gui.controls.control_player.AbstractGLWidget import AbstractGLWidget 2 | 3 | import math 4 | from AnyQt import QtGui 5 | from AnyQt.QtWidgets import QOpenGLWidget 6 | from AnyQt import QtCore 7 | 8 | 9 | class VideoQt5GLWidget(AbstractGLWidget, QOpenGLWidget): 10 | 11 | def initializeGL(self): 12 | self.gl = self.context().versionFunctions() 13 | self.gl.initializeOpenGLFunctions() 14 | 15 | ''' 16 | Sets up the OpenGL rendering context, defines display lists, etc. 17 | Gets called once before the first time resizeGL() or paintGL() is called. 18 | ''' 19 | self.gl.glClearDepth(1.0) 20 | self.gl.glClearColor(0, 0, 0, 1.0) 21 | self.gl.glEnable(self.gl.GL_DEPTH_TEST) 22 | 23 | def perspective(self, fovy, aspect, zNear, zFar): 24 | ymax = zNear * math.tan( fovy * math.pi / 360.0 ); 25 | ymin = -ymax; 26 | xmin = ymin * aspect; 27 | xmax = ymax * aspect; 28 | 29 | self.gl.glFrustum( xmin, xmax, ymin, ymax, zNear, zFar ) 30 | 31 | def resizeGL(self, width, height): 32 | self.setupViewport(width, height) 33 | 34 | def setupViewport(self, width, height): 35 | side = min(width, height) 36 | self.gl.glViewport((width - side) // 2, (height - side) // 2, side, 37 | side) 38 | 39 | self.gl.glMatrixMode(self.gl.GL_PROJECTION) 40 | self.gl.glLoadIdentity() 41 | self.perspective(40.0, float(width) / float(height), 0.01, 10.0) 42 | self.gl.glMatrixMode(self.gl.GL_MODELVIEW) 43 | 44 | def draw_helptext(self): 45 | pass 46 | 47 | def draw_message(self): 48 | pass -------------------------------------------------------------------------------- /tutorials/Controls4Docs/ControlCombo.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | __author__ = "Ricardo Ribeiro" 5 | __credits__ = ["Ricardo Ribeiro"] 6 | __license__ = "MIT" 7 | __version__ = "0.0" 8 | __maintainer__ = "Ricardo Ribeiro" 9 | __email__ = "ricardojvr@gmail.com" 10 | __status__ = "Development" 11 | 12 | 13 | from __init__ import * 14 | 15 | 16 | class SimpleExample(BaseWidget): 17 | 18 | 19 | def __init__(self): 20 | super(SimpleExample,self).__init__('Simple example') 21 | 22 | #Definition of the forms fields 23 | self._control = ControlCombo('Countries') 24 | 25 | self.formset = [' ',(' ', '_control', ' '),' '] 26 | 27 | self._control.add_item('Portugal', 'pt') 28 | self._control.add_item('Angola', 'ao') 29 | self._control.add_item('Mocambique', 'mz') 30 | self._control.add_item('Brazil', 'br') 31 | self._control.add_item('Cabo Verde', 'cv') 32 | 33 | 34 | self._control.text = 'Brazil' 35 | 36 | self._control.changed_event = self.__print_value 37 | 38 | def __print_value(self): 39 | print self._control.value 40 | 41 | ################################################################################################################## 42 | ################################################################################################################## 43 | ################################################################################################################## 44 | 45 | #Execute the application 46 | if __name__ == "__main__": pyforms.start_app( SimpleExample ) 47 | -------------------------------------------------------------------------------- /pyforms_gui/controls/control_checkbox.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | from confapp import conf 5 | 6 | from AnyQt import uic, QtCore 7 | 8 | 9 | import pyforms_gui.utils.tools as tools 10 | from pyforms_gui.controls.control_base import ControlBase 11 | 12 | 13 | class ControlCheckBox(ControlBase): 14 | def init_form(self): 15 | control_path = tools.getFileInSameDirectory(__file__, "checkbox.ui") 16 | self._form = uic.loadUi(control_path) 17 | self._form.checkBox.setText(self._label) 18 | self._form.checkBox.stateChanged.connect(self.__checkedToggle) 19 | 20 | if self._value and self._value != '': 21 | self._form.checkBox.setCheckState(QtCore.Qt.Checked) 22 | else: 23 | self._form.checkBox.setCheckState(QtCore.Qt.Unchecked) 24 | 25 | if self.help: self.form.setToolTip(self.help) 26 | super(ControlCheckBox, self).init_form() 27 | 28 | def __checkedToggle(self): 29 | self.changed_event() 30 | 31 | def load_form(self, data, path=None): 32 | if 'value' in data: 33 | self._form.checkBox.setChecked(data['value'] == 'True' or data['value'] == True) 34 | 35 | def save_form(self, data, path=None): 36 | data['value'] = str(self._form.checkBox.isChecked()) 37 | 38 | @property 39 | def value(self): 40 | return self._form.checkBox.isChecked() 41 | 42 | @value.setter 43 | def value(self, value): 44 | ControlBase.value.fset(self, value) 45 | self._form.checkBox.setChecked(value) 46 | -------------------------------------------------------------------------------- /pyforms_gui/controls/fileInput.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Form 4 | 5 | 6 | 7 | 0 8 | 0 9 | 344 10 | 38 11 | 12 | 13 | 14 | 15 | 0 16 | 0 17 | 18 | 19 | 20 | 21 | 0 22 | 38 23 | 24 | 25 | 26 | 27 | 16777215 28 | 38 29 | 30 | 31 | 32 | Form 33 | 34 | 35 | 36 | 0 37 | 38 | 39 | 40 | 41 | TextLabel 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 16777215 53 | 16777215 54 | 55 | 56 | 57 | Open 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | *.egg-info/ 24 | .installed.cfg 25 | *.egg 26 | MANIFEST 27 | 28 | # PyInstaller 29 | # Usually these files are written by a python script from a template 30 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 31 | *.manifest 32 | *.spec 33 | 34 | # Installer logs 35 | pip-log.txt 36 | pip-delete-this-directory.txt 37 | 38 | # Unit test / coverage reports 39 | htmlcov/ 40 | .tox/ 41 | .coverage 42 | .coverage.* 43 | .cache 44 | nosetests.xml 45 | coverage.xml 46 | *.cover 47 | .hypothesis/ 48 | .pytest_cache/ 49 | 50 | # Translations 51 | *.mo 52 | *.pot 53 | 54 | # Django stuff: 55 | *.log 56 | local_settings.py 57 | db.sqlite3 58 | 59 | # Flask stuff: 60 | instance/ 61 | .webassets-cache 62 | 63 | # Scrapy stuff: 64 | .scrapy 65 | 66 | # Sphinx documentation 67 | docs/_build/ 68 | 69 | # PyBuilder 70 | target/ 71 | 72 | # Jupyter Notebook 73 | .ipynb_checkpoints 74 | 75 | # pyenv 76 | .python-version 77 | 78 | # celery beat schedule file 79 | celerybeat-schedule 80 | 81 | # SageMath parsed files 82 | *.sage.py 83 | 84 | # Environments 85 | .env 86 | .venv 87 | env/ 88 | venv/ 89 | ENV/ 90 | env.bak/ 91 | venv.bak/ 92 | 93 | # Spyder project settings 94 | .spyderproject 95 | .spyproject 96 | 97 | # Rope project settings 98 | .ropeproject 99 | 100 | # mkdocs documentation 101 | /site 102 | 103 | # mypy 104 | .mypy_cache/ 105 | 106 | \.DS_Store 107 | -------------------------------------------------------------------------------- /tutorials/4.MdiApplication/Core/SimpleExample1.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | __author__ = "Ricardo Ribeiro" 5 | __credits__ = ["Ricardo Ribeiro"] 6 | __license__ = "MIT" 7 | __version__ = "0.0" 8 | __maintainer__ = "Ricardo Ribeiro" 9 | __email__ = "ricardojvr@gmail.com" 10 | __status__ = "Development" 11 | 12 | 13 | 14 | from pyforms.basewidget import BaseWidget 15 | from pyforms.controls import ControlText 16 | from pyforms.controls import ControlButton 17 | 18 | 19 | 20 | 21 | 22 | class SimpleExample1(BaseWidget): 23 | 24 | def __init__(self): 25 | super(SimpleExample1,self).__init__('Simple example 1') 26 | 27 | #Definition of the forms fields 28 | self._firstname = ControlText('First name', 'Default value') 29 | self._middlename = ControlText('Middle name') 30 | self._lastname = ControlText('Lastname name') 31 | self._fullname = ControlText('Full name') 32 | self._button = ControlButton('Press this button') 33 | 34 | #Define the button action 35 | self._button.value = self.__buttonAction 36 | 37 | 38 | 39 | 40 | def __buttonAction(self): 41 | """Button action event""" 42 | self._fullname.value = self._firstname.value +" "+ self._middlename.value + \ 43 | " "+ self._lastname.value 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | ################################################################################################################## 52 | ################################################################################################################## 53 | ################################################################################################################## 54 | 55 | #Execute the application 56 | if __name__ == "__main__": 57 | import pyforms 58 | pyforms.start_app( SimpleExample1 ) 59 | -------------------------------------------------------------------------------- /pyforms_gui/utils/BioradWriter.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | __author__ = "Ricardo Ribeiro" 5 | __credits__ = ["Ricardo Ribeiro"] 6 | __license__ = "MIT" 7 | __version__ = "0.0" 8 | __maintainer__ = "Ricardo Ribeiro" 9 | __email__ = "ricardojvr@gmail.com" 10 | __status__ = "Development" 11 | 12 | 13 | import os 14 | import subprocess 15 | 16 | 17 | 18 | class BioradWriter: 19 | 20 | """ 21 | Encapsulation of ImageJ's (http://rsb.info.nih.gov/ij/) 'Biorad Writer' plugin to enable 22 | the transformation of TIFF images into PIC format directly from the command line. 23 | """ 24 | 25 | # Configuration parameters 26 | # NB: Keep the trailing slashes 27 | imageJDir = '/home/admin/imagej/' 28 | javaDir = imageJDir + 'jdk/bin/' 29 | bioradWriterConfigFile = 'biorad_writer_config.txt' 30 | 31 | @staticmethod 32 | def __update_config_file(outputFileName): 33 | try: 34 | with open(BioradWriter.imageJDir + BioradWriter.bioradWriterConfigFile, 'w') as f: 35 | f.write(os.getcwd() + "/output/\n"); 36 | f.write(outputFileName); 37 | except (IOError) as e: 38 | raise e 39 | 40 | @staticmethod 41 | def convert(inputFileName, outputFileName='', 42 | imageJDir='/home/admin/imagej/', 43 | javaDir='/home/admin/imagej/jdk/bin/', 44 | bioradWriterConfigFile='biorad_writer_config.txt' ): 45 | 46 | if not outputFileName: 47 | outputFileName = os.path.splitext(inputFileName)[0] + '.PIC' 48 | 49 | BioradWriter.__update_config_file(outputFileName) 50 | execStr = 'cd ' + BioradWriter.imageJDir + ";" 51 | execStr += BioradWriter.javaDir + 'java -cp ' + BioradWriter.imageJDir + 'ij.jar ij.ImageJ -batch ' + BioradWriter.imageJDir + 'macro.ijm ' + inputFileName + ';' 52 | execStr += 'cd -' 53 | subprocess.call(execStr, shell=True) 54 | -------------------------------------------------------------------------------- /tutorials/Controls4Docs/ControlEventsGraph_Simple.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | __author__ = "Ricardo Ribeiro" 5 | __credits__ = ["Ricardo Ribeiro"] 6 | __license__ = "MIT" 7 | __version__ = "0.0" 8 | __maintainer__ = "Ricardo Ribeiro" 9 | __email__ = "ricardojvr@gmail.com" 10 | __status__ = "Development" 11 | 12 | 13 | from __init__ import * 14 | import random, time 15 | from PyQt4 import QtCore 16 | 17 | class SimpleExample(BaseWidget): 18 | 19 | def __init__(self): 20 | super(SimpleExample,self).__init__('Simple example') 21 | 22 | #Definition of the forms fields 23 | self._control = ControlEventsGraph('Check me') 24 | 25 | self._txt = ControlText('Time') 26 | 27 | self._btn = ControlButton('Click') 28 | self._btn1 = ControlButton('Click 1') 29 | 30 | self.formset = [ 31 | '_btn', 32 | '_control', 33 | '_txt'] 34 | 35 | self._btn.value = self.__btn 36 | 37 | self._control.scale = 4 38 | 39 | self._control.add_event( 100, 200, track=0 ) 40 | 41 | def __btn(self): 42 | #self._control.value = 10 43 | 44 | for i in range(1): 45 | s = random.randint( 100, 1000 ) 46 | o = random.randint( 1000, 10000 ) 47 | self._control.add_event( s, s+o, track=random.randint(0,4) ) 48 | self._control.value = s+o 49 | 50 | self._control.repaint() 51 | #self._control.value = 5013 52 | 53 | 54 | 55 | ################################################################################################################## 56 | ################################################################################################################## 57 | ################################################################################################################## 58 | 59 | #Execute the application 60 | if __name__ == "__main__": pyforms.start_app( SimpleExample ) 61 | -------------------------------------------------------------------------------- /pyforms_gui/controls/control_dir.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | from confapp import conf 5 | 6 | from pyforms_gui.controls.control_base import ControlBase 7 | 8 | import pyforms_gui.utils.tools as tools 9 | 10 | 11 | from AnyQt import uic, _api 12 | from AnyQt.QtWidgets import QFileDialog 13 | 14 | 15 | class ControlDir(ControlBase): 16 | 17 | def init_form(self): 18 | control_path = tools.getFileInSameDirectory(__file__, "fileInput.ui") 19 | self._form = uic.loadUi(control_path) 20 | self._form.pushButton.clicked.connect(self.click) 21 | self.form.label.setText(self._label) 22 | self.form.lineEdit.editingFinished.connect(self.finishEditing) 23 | self._form.pushButton.setIcon(conf.PYFORMS_ICON_FILE_OPEN) 24 | super(ControlDir, self).init_form() 25 | 26 | 27 | def click(self): 28 | if conf.PYFORMS_DIALOGS_OPTIONS: 29 | value = QFileDialog.getExistingDirectory(self.parent, self._label, options=conf.PYFORMS_DIALOGS_OPTIONS) 30 | else: 31 | value = QFileDialog.getExistingDirectory(self.parent, self._label) 32 | 33 | if value and len(value)>0: 34 | self.value = value 35 | 36 | def finishEditing(self): 37 | """Function called when the lineEdit widget is edited""" 38 | self.changed_event() 39 | 40 | 41 | @property 42 | def value(self): 43 | self._value = str(self._form.lineEdit.text()) 44 | return self._value 45 | 46 | @value.setter 47 | def value(self, value): 48 | self._form.lineEdit.setText(value) 49 | ControlBase.value.fset(self, value) 50 | 51 | @property 52 | def label(self): return self.form.label.text() 53 | 54 | @label.setter 55 | def label(self, value): 56 | self.form.label.setText(value) 57 | ControlBase.label.fset(self, value) 58 | -------------------------------------------------------------------------------- /docs/source/index.rst: -------------------------------------------------------------------------------- 1 | .. Pyforms Web documentation master file, created by 2 | sphinx-quickstart on Thu Dec 14 16:30:21 2017. 3 | You can adapt this file completely to your liking, but it should at least 4 | contain the root `toctree` directive. 5 | 6 | Pyforms GUI documentation! 7 | ===================================== 8 | 9 | **Pyforms GUI** is Python 3 framework to allow pyforms applications to execute in Windows GUI mode. 10 | 11 | The framework aims the boost the development productivity by providing an API in Python to allow the execution of applications developed for GUI and Web mode in terminal mode. 12 | 13 | 14 | Source code 15 | https://github.com/UmSenhorQualquer/pyforms-gui 16 | 17 | .. image:: /_static/imgs/gui-example-computervisionalgorithm.png 18 | 19 | .. note:: 20 | 21 | This framework is a software layer part of the Pyforms framework. 22 | 23 | Pyforms 24 | https://pyforms.readthedocs.io 25 | 26 | .. image:: /_static/imgs/pyforms-layers-gui.svg 27 | 28 | 29 | 30 | 31 | 32 | 33 | .. toctree:: 34 | :maxdepth: 4 35 | :caption: PyForms GUI 36 | 37 | overview 38 | getting-started/installing 39 | 40 | .. toctree:: 41 | :maxdepth: 4 42 | :caption: Getting started 43 | 44 | getting-started/first-app 45 | getting-started/the-basic 46 | getting-started/multiple-windows 47 | getting-started/mdi-applications 48 | getting-started/style-layout 49 | 50 | .. toctree:: 51 | :maxdepth: 4 52 | :caption: API 53 | 54 | api-reference/index 55 | 56 | .. toctree:: 57 | :maxdepth: 4 58 | :caption: More docs 59 | 60 | Pyforms 61 | Pyforms-WEB 62 | Pyforms-TERMINAL 63 | 64 | Indices and tables 65 | ================== 66 | 67 | * :ref:`genindex` 68 | * :ref:`modindex` 69 | * :ref:`search` 70 | 71 | -------------------------------------------------------------------------------- /docs/source/overview.rst: -------------------------------------------------------------------------------- 1 | ********** 2 | Overview 3 | ********** 4 | 5 | Pyforms GUI 6 | ================ 7 | 8 | .. image:: /_static/imgs/pyforms-gui.jpg 9 | :width: 80px 10 | :align: right 11 | 12 | Pyforms GUI is part the Pyforms framework. 13 | It implements a software layer that handles the execution of pyforms applications in Windows GUI mode. 14 | 15 | 16 | Pyforms 17 | ======== 18 | 19 | .. image:: /_static/imgs/pyforms.jpg 20 | :width: 80px 21 | :align: right 22 | 23 | `Pyforms `_ is a Python 3 framework to develop applications capable of executing in 3 diferent environments, Desktop GUI, Terminal and Web. 24 | 25 | .. image:: /_static/imgs/pyforms-layers.svg 26 | :width: 50% 27 | :align: center 28 | 29 | | 30 | 31 | 32 | Developer 33 | ============= 34 | 35 | ============================================================================================ ===================================================================================================================== 36 | `Ricardo Ribeiro `_ `Champalimaud Scientific Software Platform `_ 37 | 38 | ricardo.ribeiro@research.fchampalimaud.org 39 | 40 | ricardojvr@gmail.com 41 | ============================================================================================ ===================================================================================================================== 42 | 43 | 44 | .. note:: 45 | 46 | Please **star** the project at the `Github repository `_ to support the project. 47 | 48 | | 49 | | 50 | -------------------------------------------------------------------------------- /tutorials/1.SimpleExamples/SimpleExample2/SimpleExample2.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | __author__ = "Ricardo Ribeiro" 5 | __credits__ = ["Ricardo Ribeiro"] 6 | __license__ = "MIT" 7 | __version__ = "0.0" 8 | __maintainer__ = "Ricardo Ribeiro" 9 | __email__ = "ricardojvr@gmail.com" 10 | __status__ = "Development" 11 | 12 | 13 | from __init__ import * 14 | 15 | 16 | 17 | class SimpleExample2(BaseWidget): 18 | 19 | def __init__(self): 20 | super(SimpleExample2,self).__init__('Simple example 2') 21 | 22 | #Definition of the forms fields 23 | self._firstname = ControlText('First name', 'Default value') 24 | self._middlename = ControlText('Middle name') 25 | self._lastname = ControlText('Lastname name') 26 | self._fullname = ControlText('Full name') 27 | self._button = ControlButton('Press this button') 28 | 29 | #Define the organization of the forms 30 | self.formset = ['_firstname','_middlename','_lastname', '_fullname', '_button', ' '] 31 | #The ' ' is used to indicate that a empty space should be placed at the bottom of the window 32 | #If you remove the ' ' the forms will occupy the entire window 33 | 34 | #Define the button action 35 | self._button.value = self.__buttonAction 36 | 37 | 38 | def __buttonAction(self): 39 | """Button action event""" 40 | self._fullname.value = self._firstname.value +" "+ self._middlename.value + \ 41 | " "+ self._lastname.value 42 | 43 | 44 | 45 | 46 | ################################################################################################################## 47 | ################################################################################################################## 48 | ################################################################################################################## 49 | 50 | #Execute the application 51 | if __name__ == "__main__": pyforms.start_app( SimpleExample2 ) 52 | -------------------------------------------------------------------------------- /pyforms_gui/controls/control_label.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | """ pyforms_gui.controls.ControlLabel""" 5 | 6 | import pyforms_gui.utils.tools as tools 7 | from confapp import conf 8 | 9 | from AnyQt import uic, QtCore, QtGui 10 | 11 | from pyforms_gui.controls.control_base import ControlBase 12 | 13 | __author__ = "Carlos Mão de Ferro" 14 | __copyright__ = "" 15 | __credits__ = "Carlos Mão de Ferro" 16 | __license__ = "MIT" 17 | __version__ = "0.0" 18 | __maintainer__ = ["Ricardo Ribeiro", "Carlos Mão de Ferro"] 19 | __email__ = ["ricardojvr at gmail.com", "cajomferro at gmail.com"] 20 | __status__ = "Development" 21 | 22 | 23 | class ControlLabel(ControlBase): 24 | 25 | def init_form(self): 26 | control_path = tools.getFileInSameDirectory(__file__, "label.ui") 27 | self._form = uic.loadUi(control_path) 28 | self._form.label.setText(self._label) 29 | self._selectable = False 30 | super(ControlLabel, self).init_form() 31 | 32 | def load_form(self, data, path=None): pass 33 | 34 | def save_form(self, data, path=None): pass 35 | 36 | @property 37 | def selectable(self): return self._selectable 38 | 39 | @selectable.setter 40 | def selectable(self, value): 41 | if value: 42 | self._form.label.setTextInteractionFlags(QtCore.Qt.TextSelectableByMouse) 43 | self._form.label.setCursor(QtGui.QCursor(QtCore.Qt.IBeamCursor)) 44 | else: 45 | self._form.label.setTextInteractionFlags(QtCore.Qt.NoTextInteraction) 46 | self._form.label.setCursor(QtGui.QCursor(QtCore.Qt.ArrowCursor)) 47 | 48 | @property 49 | def form(self): return self._form 50 | 51 | 52 | @property 53 | def value(self): return ControlBase.value.fget(self) 54 | 55 | @value.setter 56 | def value(self, value): 57 | self._form.label.setText(value) 58 | ControlBase.value.fset(self, value) 59 | 60 | -------------------------------------------------------------------------------- /docs/source/getting-started/style-layout.rst: -------------------------------------------------------------------------------- 1 | *************************** 2 | Style and layout with CSS 3 | *************************** 4 | 5 | This page was based on the examples available at the github folder: `Tutorial - Code Organization `_ 6 | 7 | 8 | PyForms takes advantage of the Qt framework to split the layout from the implementation of the functionalities. 9 | It is possible to configure the settings to import a stylesheet file which will change the application layout. 10 | 11 | To do it, you need to add to your settings file the variable PYFORMS_STYLESHEET with the path to the css file you want to use: 12 | 13 | 14 | .. code:: python 15 | 16 | PYFORMS_STYLESHEET = 'style.css' 17 | 18 | 19 | You may would like also to adapt the layout for a specific operating system. 20 | 21 | The next variables will allow to do this. You can complement the style configured in PYFORMS_STYLESHEET with a stylesheet for a specific operating system. 22 | 23 | 24 | .. code:: python 25 | 26 | PYFORMS_STYLESHEET_DARWIN = 'style_darwin.css' 27 | PYFORMS_STYLESHEET_LINUX = 'style_linux.css' 28 | PYFORMS_STYLESHEET_WINDOWS = 'style_window.css' 29 | 30 | 31 | **Check the example:** style.css 32 | 33 | 34 | .. code:: css 35 | 36 | QMainWindow{ 37 | background-color: white; 38 | } 39 | 40 | QLabel{ 41 | min-width: 110px; 42 | } 43 | 44 | QLineEdit{ 45 | min-width: 200px; 46 | border: 1px solid #CCC; 47 | height: 30px; 48 | padding-left: 10px; 49 | } 50 | 51 | QPushButton{ 52 | background: #3498db; 53 | color: #ffffff; 54 | padding: 10px 20px 10px 20px; 55 | 56 | border-radius: 6px; 57 | } 58 | 59 | QPushButton:hover { 60 | background: #3cb0fd; 61 | } 62 | 63 | /*Use the # and the name of the variable to access to a specific the Control*/ 64 | #_firstnameField QLineEdit{ 65 | color:red; 66 | } 67 | 68 | .. image:: /_static/imgs/getting-started-8.png -------------------------------------------------------------------------------- /tutorials/3.CodeOrganization/PersonWindow.py: -------------------------------------------------------------------------------- 1 | from confapp import conf; 2 | import settings 3 | conf+=settings 4 | 5 | import pyforms 6 | from pyforms.basewidget import BaseWidget 7 | from pyforms.controls import ControlText 8 | from pyforms.controls import ControlButton 9 | from Person import Person 10 | 11 | 12 | 13 | 14 | class PersonWindow(Person, BaseWidget): 15 | 16 | 17 | def __init__(self): 18 | Person.__init__(self, '', '', '') 19 | BaseWidget.__init__(self,'Person window') 20 | self.parent = None 21 | 22 | 23 | #Definition of the forms fields 24 | self._firstnameField = ControlText('First name') 25 | self._middlenameField = ControlText('Middle name') 26 | self._lastnameField = ControlText('Lastname name') 27 | self._fullnameField = ControlText('Full name') 28 | self._buttonField = ControlButton('Press this button') 29 | 30 | #Define the button action 31 | self._buttonField.value = self.buttonAction 32 | 33 | self.formset = ['_firstnameField', '_middlenameField', '_lastnameField', 34 | '_fullnameField', 35 | (' ','_buttonField', ' '), ' '] 36 | 37 | 38 | def buttonAction(self): 39 | self._firstName = self._firstnameField.value 40 | self._middleName = self._middlenameField.value 41 | self._lastName = self._lastnameField.value 42 | self._fullnameField.value = self.fullName 43 | 44 | #In case the window has a parent 45 | if self.parent!=None: self.parent.addPerson(self) 46 | 47 | def printFullName(self): 48 | print( self._fullnameField.value) 49 | 50 | ################################################################################################################## 51 | ################################################################################################################## 52 | ################################################################################################################## 53 | 54 | #Execute the application 55 | if __name__ == "__main__": pyforms.start_app( PersonWindow ) -------------------------------------------------------------------------------- /tutorials/4.MdiApplication/Core/BaseWindow.py: -------------------------------------------------------------------------------- 1 | import pyforms 2 | from pyforms.basewidget import BaseWidget 3 | 4 | from pyforms.controls import ControlText 5 | from pyforms.controls import ControlButton 6 | from pyforms.controls import ControlDockWidget 7 | from pyforms.controls import ControlMdiArea 8 | 9 | from Core.SimpleExample1 import SimpleExample1 10 | from Core.Controllers.ProjectTree import ProjectTree 11 | 12 | class BaseWindow(BaseWidget): 13 | 14 | 15 | def __init__(self): 16 | super(BaseWindow, self).__init__('Test') 17 | 18 | #Definition of the forms fields 19 | self._mdiArea = ControlMdiArea() 20 | 21 | self._textField = ControlText("Example") 22 | self._projectTree = ControlDockWidget('Project tree', side=ControlDockWidget.SIDE_RIGHT) 23 | self._details = ControlDockWidget('Details', side=ControlDockWidget.SIDE_RIGHT) 24 | self._addWindow = ControlButton('Add window') 25 | 26 | self.formset = [ '_addWindow','_textField', '_mdiArea'] 27 | 28 | self._details.value = SimpleExample1() 29 | 30 | 31 | #self._mdiArea.showCloseButton = False 32 | self._addWindow.value = self.__addWindow 33 | 34 | self.mainmenu.append( 35 | { 'File': [ 36 | {'Save as': self.saveWindow}, 37 | {'Open as': self.loadWindow}, 38 | '-', 39 | {'Exit': self.__exit}, 40 | ] 41 | } 42 | ) 43 | 44 | def __addWindow(self): 45 | self._simple = SimpleExample1(); 46 | self._mdiArea += self._simple 47 | 48 | def __exit(self): exit() 49 | 50 | 51 | 52 | 53 | 54 | ################################################################################################################## 55 | ################################################################################################################## 56 | ################################################################################################################## 57 | 58 | #Execute the application 59 | if __name__ == "__main__": pyforms.start_app( BaseWindow ) -------------------------------------------------------------------------------- /tutorials/1.SimpleExamples/SimpleExample4/SimpleExample4.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | __author__ = "Ricardo Ribeiro" 5 | __credits__ = ["Ricardo Ribeiro"] 6 | __license__ = "MIT" 7 | __version__ = "0.0" 8 | __maintainer__ = "Ricardo Ribeiro" 9 | __email__ = "ricardojvr@gmail.com" 10 | __status__ = "Development" 11 | 12 | 13 | from __init__ import * 14 | 15 | 16 | 17 | class SimpleExample4(BaseWidget): 18 | 19 | def __init__(self): 20 | super(SimpleExample4,self).__init__('Simple example 4') 21 | 22 | #Definition of the forms fields 23 | self._firstname = ControlText('First name', 'Default value') 24 | self._middlename = ControlText('Middle name') 25 | self._lastname = ControlText('Lastname name') 26 | self._fullname = ControlText('Full name') 27 | self._button = ControlButton('Press this button') 28 | 29 | #Define the organization of the forms 30 | self.formset = [ { 31 | 'Tab1':['_firstname','||','_middlename','||','_lastname'], 32 | 'Tab2': ['_fullname'] 33 | }, 34 | '=',(' ','_button', ' ') ] 35 | #Use dictionaries for tabs 36 | #Use the sign '=' for a vertical splitter 37 | #Use the signs '||' for a horizontal splitter 38 | 39 | #Define the button action 40 | self._button.value = self.__buttonAction 41 | 42 | 43 | def __buttonAction(self): 44 | """Button action event""" 45 | self._fullname.value = self._firstname.value +" "+ self._middlename.value + \ 46 | " "+ self._lastname.value 47 | 48 | 49 | 50 | ################################################################################################################## 51 | ################################################################################################################## 52 | ################################################################################################################## 53 | 54 | #Execute the application 55 | if __name__ == "__main__": pyforms.start_app( SimpleExample4 ) 56 | -------------------------------------------------------------------------------- /tutorials/1.SimpleExamples/SimpleExample5/SimpleExample5.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | __author__ = "Ricardo Ribeiro" 5 | __credits__ = ["Ricardo Ribeiro"] 6 | __license__ = "MIT" 7 | __version__ = "0.0" 8 | __maintainer__ = "Ricardo Ribeiro" 9 | __email__ = "ricardojvr@gmail.com" 10 | __status__ = "Development" 11 | 12 | 13 | from __init__ import * 14 | 15 | 16 | 17 | class SimpleExample5(BaseWidget): 18 | 19 | def __init__(self): 20 | super(SimpleExample5,self).__init__('Simple example 5') 21 | 22 | #Definition of the forms fields 23 | self._firstname = ControlText('First name', 'Default value') 24 | self._middlename = ControlText('Middle name') 25 | self._lastname = ControlText('Lastname name') 26 | self._fullname = ControlText('Full name') 27 | self._button = ControlButton('Press this button') 28 | 29 | self.formset = [ { 30 | 'Tab1':['_firstname','||','_middlename','||','_lastname'], 31 | 'Tab2': ['_fullname'] 32 | }, 33 | '=',(' ','_button', ' ') ] 34 | 35 | 36 | #Define the window main menu using the property main menu 37 | self.mainmenu = [ 38 | { 'File': [ 39 | {'Open': self.__dummyEvent}, 40 | '-', 41 | {'Save': self.__dummyEvent}, 42 | {'Save as': self.__dummyEvent} 43 | ] 44 | }, 45 | { 'Edit': [ 46 | {'Copy': self.__dummyEvent}, 47 | {'Past': self.__dummyEvent} 48 | ] 49 | } 50 | ] 51 | 52 | def __dummyEvent(self): 53 | print "Menu option selected" 54 | 55 | 56 | ################################################################################################################## 57 | ################################################################################################################## 58 | ################################################################################################################## 59 | 60 | #Execute the application 61 | if __name__ == "__main__": pyforms.start_app( SimpleExample5 ) 62 | -------------------------------------------------------------------------------- /pyforms_gui/controls/sliderInput.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Form 4 | 5 | 6 | 7 | 0 8 | 0 9 | 344 10 | 38 11 | 12 | 13 | 14 | 15 | 0 16 | 0 17 | 18 | 19 | 20 | 21 | 0 22 | 38 23 | 24 | 25 | 26 | 27 | 16777215 28 | 38 29 | 30 | 31 | 32 | Form 33 | 34 | 35 | 36 | 0 37 | 38 | 39 | 40 | 41 | TextLabel 42 | 43 | 44 | 45 | 46 | 47 | 48 | Qt::Horizontal 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 30 57 | 0 58 | 59 | 60 | 61 | Qt::LeftToRight 62 | 63 | 64 | 0 65 | 66 | 67 | Qt::AlignCenter 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /tutorials/2.ControlsExamples/Example3.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | __author__ = "Ricardo Ribeiro" 5 | __credits__ = ["Ricardo Ribeiro"] 6 | __license__ = "MIT" 7 | __version__ = "0.0" 8 | __maintainer__ = "Ricardo Ribeiro" 9 | __email__ = "ricardojvr@gmail.com" 10 | __status__ = "Development" 11 | 12 | 13 | from __init__ import * 14 | import numpy as np 15 | 16 | 17 | class Example3(BaseWidget): 18 | 19 | def __init__(self): 20 | super(Example3,self).__init__('Simple example 1') 21 | 22 | #Definition of the forms fields 23 | self._combobox = ControlCombo('Choose a item') 24 | self._list = ControlList('List label') 25 | self._progress = ControlProgress('Progress bar') 26 | self._visvisVolume = ControlVisVisVolume('Visvis') 27 | self._timeline = ControlEventTimeline('Timeline') 28 | 29 | 30 | self.formset = [ ('_combobox',' '), '_progress', '=',('_visvisVolume', '||','_list'), '_timeline'] 31 | 32 | 33 | self._combobox.addItem('Item 1', 'Value 1') 34 | self._combobox.addItem('Item 2', 'Value 2') 35 | self._combobox.addItem('Item 3', 'Value 3') 36 | self._combobox.addItem('Item 4') #The value is = to the item 37 | 38 | self._list.value = [ ('Item1', 'Item2', 'Item3',), ('Item3', 'Item4', 'Item5',)] 39 | 40 | #Create a an example of an image with volume 41 | imageWithVolume = np.zeros( (100,100,100), np.uint8 ) 42 | imageWithVolume[30:40, 30:50, :] = 255 43 | imageWithVolume[30:40, 70:72, :] = 255 44 | ############################################# 45 | 46 | self._visvisVolume.value = imageWithVolume 47 | 48 | ################################################################################################################## 49 | ################################################################################################################## 50 | ################################################################################################################## 51 | 52 | #Execute the application 53 | if __name__ == "__main__": pyforms.start_app( Example3 ) -------------------------------------------------------------------------------- /pyforms_gui/resources_settings.py: -------------------------------------------------------------------------------- 1 | import os 2 | from AnyQt.QtGui import QIcon, QPixmap 3 | from AnyQt.QtWidgets import QStyle, qApp 4 | 5 | 6 | def path(filename): 7 | """ 8 | :param filename: 9 | :return: 10 | """ 11 | return os.path.join(os.path.dirname(__file__), filename) 12 | 13 | 14 | PYFORMS_ICON_VIDEOPLAYER_PAUSE_PLAY = QIcon() 15 | PYFORMS_ICON_VIDEOPLAYER_PAUSE_PLAY.addPixmap(qApp.style().standardPixmap(QStyle.SP_MediaPlay), mode=QIcon.Normal, 16 | state=QIcon.Off) 17 | PYFORMS_ICON_VIDEOPLAYER_PAUSE_PLAY.addPixmap(qApp.style().standardPixmap(QStyle.SP_MediaPause), mode=QIcon.Normal, 18 | state=QIcon.On) 19 | 20 | PYFORMS_ICON_VIDEOPLAYER_DETACH = QIcon() 21 | PYFORMS_ICON_VIDEOPLAYER_DETACH.addPixmap(qApp.style().standardPixmap(QStyle.SP_TitleBarMaxButton), mode=QIcon.Normal ) 22 | 23 | PYFORMS_ICON_CODEEDITOR_SAVE = QIcon(qApp.style().standardPixmap(QStyle.SP_DialogSaveButton)) 24 | PYFORMS_ICON_CODEEDITOR_DISCARD = QIcon(qApp.style().standardPixmap(QStyle.SP_DialogDiscardButton)) 25 | 26 | PYFORMS_PIXMAP_EVENTTIMELINE_ZOOM_IN = QPixmap(path(os.path.join("Controls", "uipics", "zoom_in.png"))) 27 | PYFORMS_PIXMAP_EVENTTIMELINE_ZOOM_OUT = QPixmap(path(os.path.join("Controls", "uipics", "zoom_in.png"))) 28 | 29 | PYFORMS_ICON_EVENTTIMELINE_IMPORT = QIcon(path(os.path.join("Controls", "uipics", "page_white_get.png"))) 30 | PYFORMS_ICON_EVENTTIMELINE_EXPORT = QIcon(path(os.path.join("Controls", "uipics", "page_white_put.png"))) 31 | PYFORMS_ICON_EVENTTIMELINE_GRAPH = QIcon(path(os.path.join("Controls", "uipics", "graph.png"))) 32 | PYFORMS_ICON_EVENTTIMELINE_TIMELINE = QIcon(path(os.path.join("Controls", "uipics", "timeline.png"))) 33 | PYFORMS_ICON_EVENTTIMELINE_REFRESH = QIcon(path(os.path.join("Controls", "uipics", "refresh.png"))) 34 | PYFORMS_ICON_EVENTTIMELINE_ADD = QIcon(path(os.path.join("Controls", "uipics", "add.png"))) 35 | PYFORMS_ICON_EVENTTIMELINE_REMOVE = QIcon(path(os.path.join("Controls", "uipics", "remove.png"))) 36 | 37 | PYFORMS_ICON_FILE_OPEN = QIcon() -------------------------------------------------------------------------------- /tutorials/Controls4Docs/ControlBoundingSlider.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | __author__ = "Ricardo Ribeiro" 5 | __credits__ = ["Ricardo Ribeiro"] 6 | __license__ = "MIT" 7 | __version__ = "0.0" 8 | __maintainer__ = "Ricardo Ribeiro" 9 | __email__ = "ricardojvr@gmail.com" 10 | __status__ = "Development" 11 | 12 | 13 | from __init__ import * 14 | 15 | 16 | class SimpleExample(BaseWidget): 17 | 18 | 19 | def __init__(self): 20 | super(SimpleExample,self).__init__('Simple example') 21 | 22 | #Definition of the forms fields 23 | self._control = ControlBoundingSlider('Threshold', default=[80, 255], min=0, max=255, 24 | horizontal=True, helptext='help text example') 25 | 26 | self.formset = [' ','_control',' '] 27 | 28 | 29 | 30 | 31 | # IO test 32 | data = self._control.save_form({}) 33 | data['value'] = 200, 255 34 | self._control.load_form(data) 35 | 36 | self._control.hide() 37 | self._control.show() 38 | 39 | self._control.add_popup_menu_option('option 0', function_action=lambda x: x) 40 | 41 | submenu1 = self._control.add_popup_submenu('menu 1') 42 | submenu2 = self._control.add_popup_submenu('menu 2', submenu=submenu1) 43 | 44 | self._control.add_popup_menu_option('option 1', function_action=lambda x: x, key='Control+Q', submenu=submenu2) 45 | 46 | self._control.changed_event = self.__control_changed_event 47 | 48 | self._control.value = [10,100] 49 | #self._control.enabled = False 50 | #self._control.label = 'Some label' 51 | 52 | def __control_changed_event(self): 53 | print self._control.value 54 | 55 | 56 | 57 | 58 | ################################################################################################################## 59 | ################################################################################################################## 60 | ################################################################################################################## 61 | 62 | #Execute the application 63 | if __name__ == "__main__": pyforms.start_app( SimpleExample ) 64 | -------------------------------------------------------------------------------- /tutorials/1.SimpleExamples/SimpleExample1/SimpleExample1.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | __author__ = "Ricardo Ribeiro" 5 | __credits__ = ["Ricardo Ribeiro"] 6 | __license__ = "MIT" 7 | __version__ = "0.0" 8 | __maintainer__ = "Ricardo Ribeiro" 9 | __email__ = "ricardojvr@gmail.com" 10 | __status__ = "Development" 11 | 12 | 13 | from __init__ import * 14 | 15 | 16 | 17 | 18 | class SimpleExample1(BaseWidget): 19 | 20 | 21 | def __init__(self): 22 | super(SimpleExample1,self).__init__('Simple example 1') 23 | 24 | #Definition of the forms fields 25 | self._firstname = ControlText('First name', 'Default value') 26 | self._middlename = ControlText('Middle name') 27 | self._lastname = ControlText('Lastname name') 28 | self._fullname = ControlText('Full name') 29 | self._button = ControlButton('Press this button') 30 | self._graph = ControlMatplotlib('Graph') 31 | 32 | #Define the button action 33 | self._button.value = self.__buttonAction 34 | 35 | self._graph.value = self.__on_draw 36 | 37 | 38 | 39 | def __on_draw(self, figure): 40 | """ Redraws the figure 41 | """ 42 | data = [1,2,1,4] 43 | x = range(len(data)) 44 | 45 | axes = figure.add_subplot(111) 46 | axes.bar(x, height=data) 47 | 48 | 49 | axes = figure.add_subplot(222, projection='3d') 50 | #axes.clear(); 51 | pts = axes.scatter(x, data, data, c=x) 52 | figure.colorbar(pts) 53 | 54 | 55 | def __buttonAction(self): 56 | """Button action event""" 57 | self._fullname.value = self._firstname.value +" "+ self._middlename.value + \ 58 | " "+ self._lastname.value 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | ################################################################################################################## 67 | ################################################################################################################## 68 | ################################################################################################################## 69 | 70 | #Execute the application 71 | if __name__ == "__main__": pyforms.start_app( SimpleExample1 ) 72 | -------------------------------------------------------------------------------- /pyforms_gui/controls/control_tableview.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | """ pyforms_gui.controls.ControlList 5 | 6 | """ 7 | import logging 8 | import os 9 | 10 | from confapp import conf 11 | 12 | from AnyQt import QtCore, uic 13 | from AnyQt.QtWidgets import QTableView, QAbstractItemView 14 | from AnyQt.QtGui import QIcon 15 | 16 | from pyforms_gui.basewidget import BaseWidget 17 | from pyforms_gui.controls.control_base import ControlBase 18 | 19 | logger = logging.getLogger(__name__) 20 | 21 | 22 | class ControlTableView(ControlBase, QTableView): 23 | """ This class represents a wrapper to the table widget 24 | It allows to implement a list view 25 | """ 26 | 27 | CELL_VALUE_BEFORE_CHANGE = None # store value when cell is double clicked 28 | 29 | def __init__(self, *args, **kwargs): 30 | QTableView.__init__(self) 31 | ControlBase.__init__(self, *args, **kwargs) 32 | 33 | if kwargs.get('select_entire_row', False): 34 | self.setSelectionBehavior(QAbstractItemView.SelectRows) 35 | 36 | 37 | ########################################################################## 38 | ############ EVENTS ###################################################### 39 | ########################################################################## 40 | 41 | 42 | ########################################################################## 43 | ############ PROPERTIES ################################################## 44 | ########################################################################## 45 | 46 | 47 | 48 | @property 49 | def value(self): 50 | return self.model() 51 | 52 | @value.setter 53 | def value(self, value): 54 | self.setModel(value) 55 | 56 | 57 | 58 | 59 | @property 60 | def form(self): 61 | return self 62 | 63 | 64 | ########################################################################## 65 | ############ PRIVATE FUNCTIONS ########################################### 66 | ########################################################################## 67 | -------------------------------------------------------------------------------- /pyforms_gui/controls/control_textarea.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | __author__ = "Ricardo Ribeiro" 5 | __credits__ = ["Ricardo Ribeiro"] 6 | __license__ = "MIT" 7 | __version__ = "0.0" 8 | __maintainer__ = "Ricardo Ribeiro" 9 | __email__ = "ricardojvr@gmail.com" 10 | __status__ = "Development" 11 | 12 | import pyforms_gui.utils.tools as tools 13 | from AnyQt import uic, QtGui 14 | from pyforms_gui.controls.control_base import ControlBase 15 | 16 | class ControlTextArea(ControlBase): 17 | 18 | def __init__(self, *args, **kwargs): 19 | ControlBase.__init__(self, *args, **kwargs) 20 | self.autoscroll = kwargs.get('autoscroll', False) 21 | 22 | 23 | 24 | def init_form(self): 25 | control_path = tools.getFileInSameDirectory(__file__, "textArea.ui") 26 | self._form = uic.loadUi(control_path) 27 | self._form.label.setText(self._label) 28 | if self._value: 29 | self._form.plainTextEdit.setPlainText(str(self._value)) 30 | 31 | if not self._label or len(self._label)==0: 32 | self.form.label.hide() 33 | 34 | super(ControlTextArea, self).init_form() 35 | self.form.plainTextEdit.textChanged.connect(self.finishEditing) 36 | 37 | def __add__(self, other): 38 | self._form.plainTextEdit.appendPlainText(str(other)) 39 | 40 | # if activated the text field is autoscrolled to the bottom 41 | if self.autoscroll: 42 | self._form.plainTextEdit.moveCursor(QtGui.QTextCursor.End) 43 | 44 | return self 45 | 46 | def finishEditing(self): 47 | """Function called when the lineEdit widget is edited""" 48 | self.changed_event() 49 | 50 | 51 | @property 52 | def value(self): 53 | return self._form.plainTextEdit.toPlainText() 54 | 55 | @value.setter 56 | def value(self, value): 57 | self._form.plainTextEdit.setPlainText(str(value)) 58 | 59 | @property 60 | def readonly(self): 61 | return self._form.plainTextEdit.isReadOnly() 62 | 63 | @readonly.setter 64 | def readonly(self, value): 65 | self._form.plainTextEdit.setReadOnly(value) 66 | 67 | 68 | @property 69 | def autoscroll(self): return self._autoscroll 70 | @autoscroll.setter 71 | def autoscroll(self, value): self._autoscroll = value 72 | -------------------------------------------------------------------------------- /pyforms_gui/controls/control_web.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | __author__ = "Ricardo Ribeiro" 5 | __credits__ = ["Ricardo Ribeiro"] 6 | __license__ = "MIT" 7 | __version__ = "0.0" 8 | __maintainer__ = "Ricardo Ribeiro" 9 | __email__ = "ricardojvr@gmail.com" 10 | __status__ = "Development" 11 | 12 | from AnyQt.QtWebEngineWidgets import QWebEngineView as QWebView 13 | from AnyQt.QtCore import QUrl 14 | from AnyQt.QtWidgets import QSizePolicy 15 | from pyforms_gui.controls.control_base import ControlBase 16 | 17 | 18 | class ControlWeb(ControlBase, QWebView): 19 | def __init__(self, *args, **kwargs): 20 | QWebView.__init__(self) 21 | if 'load_finished_event' in kwargs: 22 | self.load_finished_event=kwargs['load_finished_event'] 23 | self.loadFinished.connect(self.__load_finished_evt) 24 | ControlBase.__init__(self, *args, **kwargs) 25 | 26 | 27 | def init_form(self): 28 | """ 29 | Load Control and initiate the events 30 | """ 31 | ControlBase.init_form(self) 32 | if self._value: QWebView.load(self, QUrl(self._value)) 33 | if self.help: self.form.setToolTip(self.help) 34 | 35 | self.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding); 36 | ############################################################################ 37 | ############ Properties #################################################### 38 | ############################################################################ 39 | 40 | def __load_finished_evt(self, ok): 41 | self.load_finished_event(ok) 42 | 43 | def load_finished_event(self,ok): 44 | pass 45 | 46 | @property 47 | def value(self): return ControlBase.value.fget(self) 48 | 49 | @value.setter 50 | def value(self, value): 51 | ControlBase.value.fset(self, value) 52 | QWebView.load(self, QUrl(value)) 53 | 54 | @property 55 | def html(self): return None 56 | 57 | @html.setter 58 | def html(self, value): 59 | QWebView.setHtml(self, value) 60 | 61 | @property 62 | def form(self): 63 | return self 64 | -------------------------------------------------------------------------------- /pyforms_gui/controls/control_progress.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | import os 5 | from pyforms_gui.controls.control_base import ControlBase 6 | from AnyQt import uic 7 | from AnyQt.QtWidgets import QApplication 8 | 9 | class ControlProgress(ControlBase): 10 | 11 | def __init__(self, *args, **kwargs): 12 | self._updateSlider = True 13 | self._min = kwargs.get('minimum', 0) 14 | self._max = kwargs.get('maximum', 100) 15 | if 'default' not in kwargs: kwargs['default'] = 0 16 | ControlBase.__init__(self, *args, **kwargs) 17 | 18 | 19 | 20 | def init_form(self): 21 | module_path = os.path.abspath(os.path.dirname(__file__)) 22 | control_path = os.path.join(module_path, "progressInput.ui") 23 | self._form = uic.loadUi(control_path) 24 | self._form.horizontalSlider.setMinimum(self._min) 25 | self._form.horizontalSlider.setMaximum(self._max) 26 | self._form.horizontalSlider.setValue(self._value) 27 | self._form.horizontalSlider.setFormat(self._label) 28 | super(ControlProgress, self).init_form() 29 | 30 | @property 31 | def label(self): return self._label 32 | 33 | @label.setter 34 | def label(self, value): 35 | self._label = value 36 | self._form.horizontalSlider.setFormat(self._label) 37 | 38 | @property 39 | def value(self): return self._form.horizontalSlider.value() 40 | 41 | @value.setter 42 | def value(self, value): 43 | self._form.horizontalSlider.setValue(value) 44 | QApplication.processEvents() 45 | 46 | def __add__(self, other): 47 | self.value = self.value + other 48 | return self 49 | 50 | def __sub__(self, other): 51 | self.value = self.value - other 52 | return self 53 | 54 | @property 55 | def min(self): return self._form.horizontalSlider.minimum() 56 | 57 | @min.setter 58 | def min(self, value): self._form.horizontalSlider.setMinimum(value) 59 | 60 | @property 61 | def max(self): return self._form.horizontalSlider.maximum() 62 | 63 | @max.setter 64 | def max(self, value): self._form.horizontalSlider.setMaximum(value) 65 | -------------------------------------------------------------------------------- /tutorials/3.CodeOrganization/PeopleWindow.py: -------------------------------------------------------------------------------- 1 | from __init__ import * 2 | from People import People 3 | from PersonWindow import PersonWindow 4 | from AddMenuFuntionality import AddMenuFuntionality 5 | 6 | from pyforms.controls import ControlDockWidget 7 | 8 | 9 | class PeopleWindow(AddMenuFuntionality, People, BaseWidget): 10 | """ 11 | This applications is a GUI implementation of the People class 12 | """ 13 | 14 | def __init__(self): 15 | People.__init__(self) 16 | BaseWidget.__init__(self,'People window') 17 | AddMenuFuntionality.__init__(self) 18 | self._panel = ControlDockWidget() 19 | 20 | #Definition of the forms fields 21 | self._peopleList = ControlList('People', 22 | add_function = self.__addPersonBtnAction, 23 | remove_function = self.__rmPersonBtnAction) 24 | 25 | self._peopleList.horizontalHeaders = ['First name', 'Middle name', 'Last name'] 26 | 27 | def closeEvent(self, event): 28 | print "called on close" 29 | 30 | def initForm(self): 31 | super(PeopleWindow, self).initForm() 32 | 33 | self.mainmenu[0]['File'][0]['Save as'].setEnabled(False) 34 | 35 | def addPerson(self, person): 36 | """ 37 | Redefines the addPerson function from People class to update the GUI 38 | everytime a new person is added. 39 | """ 40 | super(PeopleWindow, self).addPerson(person) 41 | self._peopleList += [person._firstName, person._middleName, person._lastName] 42 | person.close() 43 | 44 | def removePerson(self, index): 45 | """ 46 | Redefines the addPerson function from People class to update the GUI 47 | everytime a person is removed. 48 | """ 49 | super(PeopleWindow, self).removePerson(index) 50 | self._peopleList -= index 51 | 52 | 53 | def __addPersonBtnAction(self): 54 | """ 55 | Add person button event. 56 | """ 57 | # A new instance of the PersonWindow is opened and shown to the user. 58 | win = PersonWindow() 59 | win.parent = self 60 | #win.show() 61 | self._panel.value = win 62 | 63 | def __rmPersonBtnAction(self): 64 | """ 65 | Remove person button event 66 | """ 67 | self.removePerson( self._peopleList.selected_row_index ) 68 | 69 | 70 | #Execute the application 71 | if __name__ == "__main__": pyforms.start_app( PeopleWindow ) 72 | -------------------------------------------------------------------------------- /pyforms_gui/organizers.py: -------------------------------------------------------------------------------- 1 | 2 | 3 | class vsplitter(object): 4 | def __init__(self, *args, **kwargs): 5 | self.items = args 6 | self.left_width = kwargs.get('left_width', 1) 7 | self.right_width = kwargs.get('right_width', 1) 8 | def __getitem__(self,index): return self.items[index] 9 | def __setitem__(self,index,value): self.items[index] = value 10 | def __len__(self): return len(self.items) 11 | def __iter__(self): 12 | self._index = -1; return self 13 | def __next__(self): 14 | self._index += 1 15 | if self._index>=len(self.items): raise StopIteration 16 | return self.items[self._index] 17 | 18 | class hsplitter(object): 19 | def __init__(self, *args, **kwargs): self.items = args 20 | def __getitem__(self,index): return self.items[index] 21 | def __setitem__(self,index,value): self.items[index] = value 22 | def __len__(self): return len(self.items) 23 | def __iter__(self): 24 | self._index = -1; return self 25 | def __next__(self): 26 | self._index += 1 27 | if self._index>=len(self.items): raise StopIteration 28 | return self.items[self._index] 29 | 30 | 31 | class no_columns(object): 32 | def __init__(self, *args): self.items = args 33 | def __getitem__(self,index): return self.items[index] 34 | def __setitem__(self,index,value): self.items[index] = value 35 | def __len__(self): return len(self.items) 36 | def __iter__(self): 37 | self._index = -1; return self 38 | def __next__(self): 39 | self._index += 1 40 | if self._index>=len(self.items): raise StopIteration 41 | return self.items[self._index] 42 | 43 | 44 | class segment(object): 45 | def __init__(self, *args, **kwargs): 46 | self.css = kwargs.get('css', '') 47 | self.items = args 48 | def __getitem__(self,index): return self.items[index] 49 | def __setitem__(self,index,value): self.items[index] = value 50 | def __len__(self): return len(self.items) 51 | def __iter__(self): 52 | self._index = -1; return self 53 | def __next__(self): 54 | self._index += 1 55 | if self._index>=len(self.items): raise StopIteration 56 | return self.items[self._index] 57 | -------------------------------------------------------------------------------- /tutorials/1.SimpleExamples/SimpleExample6/SimpleExample6.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | __author__ = "Ricardo Ribeiro" 5 | __credits__ = ["Ricardo Ribeiro"] 6 | __license__ = "MIT" 7 | __version__ = "0.0" 8 | __maintainer__ = "Ricardo Ribeiro" 9 | __email__ = "ricardojvr@gmail.com" 10 | __status__ = "Development" 11 | 12 | 13 | from __init__ import * 14 | 15 | 16 | 17 | class SimpleExample6(BaseWidget): 18 | 19 | def __init__(self): 20 | super(SimpleExample6,self).__init__('Simple example 6') 21 | 22 | #Definition of the forms fields 23 | self._firstname = ControlText('First name', 'Default value') 24 | self._middlename = ControlText('Middle name') 25 | self._lastname = ControlText('Lastname name') 26 | self._fullname = ControlText('Full name') 27 | self._button = ControlButton('Press this button') 28 | 29 | self.formset = [ { 30 | 'Tab1':['_firstname','||','_middlename','||','_lastname'], 31 | 'Tab2': ['_fullname'] 32 | }, 33 | '=',(' ','_button', ' ') ] 34 | 35 | 36 | submenu = self._fullname.add_popup_submenu('Path') 37 | self._fullname.add_popup_menu_option('Delete', function_action=self.__dummyEvent, submenu=submenu) 38 | self._fullname.add_popup_menu_option('Edit', function_action=self.__dummyEvent, submenu=submenu) 39 | self._fullname.add_popup_menu_option('Interpolate', function_action=self.__dummyEvent, submenu=submenu) 40 | 41 | #Define the window main menu using the property main menu 42 | self.mainmenu = [ 43 | { 'File': [ 44 | {'Open': self.__dummyEvent}, 45 | '-', 46 | {'Save': self.__dummyEvent}, 47 | {'Save as': self.__dummyEvent} 48 | ] 49 | }, 50 | { 'Edit': [ 51 | {'Copy': self.__dummyEvent}, 52 | {'Past': self.__dummyEvent} 53 | ] 54 | } 55 | ] 56 | 57 | def __dummyEvent(self): 58 | print ("Menu option selected") 59 | 60 | 61 | ################################################################################################################## 62 | ################################################################################################################## 63 | ################################################################################################################## 64 | 65 | #Execute the application 66 | if __name__ == "__main__": pyforms.start_app( SimpleExample6 ) 67 | -------------------------------------------------------------------------------- /pyforms_gui/controls/control_text.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | ''' 4 | @author: Ricardo Ribeiro 5 | @credits: Ricardo Ribeiro 6 | @license: MIT 7 | @version: 0.0 8 | @maintainer: Ricardo Ribeiro 9 | @email: ricardojvr@gmail.com 10 | @status: Development 11 | @lastEditedBy: Carlos Mão de Ferro (carlos.maodeferro@neuro.fchampalimaud.org) 12 | ''' 13 | import pyforms_gui.utils.tools as tools 14 | from pyforms_gui.controls.control_base import ControlBase 15 | from AnyQt.QtWidgets import QLineEdit 16 | from AnyQt import uic 17 | 18 | class ControlText(ControlBase): 19 | 20 | def init_form(self): 21 | control_path = tools.getFileInSameDirectory(__file__, "textInput.ui") 22 | self._form = uic.loadUi(control_path) 23 | self.form.label.setText(self._label) 24 | 25 | if self._value is not None: self.form.lineEdit.setText(self._value) 26 | 27 | self.form.setToolTip(self.help) 28 | 29 | super(ControlText, self).init_form() 30 | 31 | self.form.label.setAccessibleName('ControlText-label') 32 | self.form.lineEdit.editingFinished.connect(self.finishEditing) 33 | self.form.lineEdit.keyPressEvent = self.__key_pressed 34 | 35 | def finishEditing(self): 36 | """Function called when the lineEdit widget is edited""" 37 | self.changed_event() 38 | 39 | def __key_pressed(self, event): 40 | QLineEdit.keyPressEvent(self.form.lineEdit, event) 41 | 42 | self.key_pressed_event(event) 43 | 44 | def key_pressed_event(self, evt): pass 45 | 46 | ################################################################### 47 | ############ Properties ########################################### 48 | ################################################################### 49 | 50 | @property 51 | def value(self): 52 | self._value = str(self._form.lineEdit.text()) 53 | return self._value 54 | 55 | @value.setter 56 | def value(self, value): 57 | self._form.lineEdit.setText(value) 58 | ControlBase.value.fset(self, value) 59 | 60 | @property 61 | def label(self): return self.form.label.text() 62 | 63 | @label.setter 64 | def label(self, value): 65 | self.form.label.setText(value) 66 | ControlBase.label.fset(self, value) 67 | 68 | @property 69 | def readonly(self): 70 | return self._form.lineEdit.isReadOnly() 71 | 72 | @readonly.setter 73 | def readonly(self, value): 74 | self._form.lineEdit.setReadOnly(value) 75 | self._form.lineEdit.setEnabled(not value) 76 | -------------------------------------------------------------------------------- /pyforms_gui/controls/control_slider.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | import pyforms_gui.utils.tools as tools 5 | 6 | from AnyQt import uic 7 | from pyforms_gui.controls.control_base import ControlBase 8 | 9 | 10 | class ControlSlider(ControlBase): 11 | 12 | def __init__(self, *args, **kwargs): 13 | self._updateSlider = True 14 | self._min = kwargs.get('minimum', 0) 15 | self._max = kwargs.get('maximum', 100) 16 | if 'default' not in kwargs: kwargs['default'] = 0 17 | ControlBase.__init__(self, *args, **kwargs) 18 | 19 | self._form.value.setText(str(kwargs['default'])) 20 | self._form.horizontalSlider.valueChanged.connect(self.valueChanged) 21 | 22 | 23 | 24 | def init_form(self): 25 | control_path = tools.getFileInSameDirectory(__file__, "sliderInput.ui") 26 | self._form = uic.loadUi(control_path) 27 | self._form.label.setText(self._label) 28 | self.form.label.setAccessibleName('ControlSlider-label') 29 | 30 | self._form.horizontalSlider.setMinimum(self._min) 31 | self._form.horizontalSlider.setMaximum(self._max) 32 | self._form.horizontalSlider.setValue(self._value) 33 | super(ControlSlider, self).init_form() 34 | 35 | def valueChanged(self, value): 36 | self._updateSlider = False 37 | self.value = value 38 | self._updateSlider = True 39 | 40 | def load_form(self, data, path=None): 41 | if 'value' in data: self.value = int(data['value']) 42 | 43 | def save_form(self, data, path=None): 44 | data['value'] = self.value 45 | 46 | @property 47 | def value(self): 48 | return self._value 49 | 50 | @value.setter 51 | def value(self, value): 52 | ControlBase.value.fset(self, value) 53 | if self._updateSlider and self._value != None: self._form.horizontalSlider.setValue(int(value)) 54 | self._form.value.setText(str(value)) 55 | 56 | @property 57 | def min(self): 58 | return self._form.horizontalSlider.minimum() 59 | 60 | @min.setter 61 | def min(self, value): 62 | self._form.horizontalSlider.setMinimum(value) 63 | 64 | @property 65 | def max(self): 66 | return self._form.horizontalSlider.maximum() 67 | 68 | @max.setter 69 | def max(self, value): 70 | self._form.horizontalSlider.setMaximum(value) 71 | -------------------------------------------------------------------------------- /pyforms_gui/controls/control_events_graph/Pointer.py: -------------------------------------------------------------------------------- 1 | # !/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | from AnyQt.QtGui import QColor 5 | from AnyQt import QtCore 6 | 7 | class Pointer(object): 8 | """ 9 | 10 | """ 11 | 12 | def __init__(self, position, parent, scroll): 13 | """ 14 | 15 | :param position: 16 | :param parent: 17 | :param scroll: 18 | """ 19 | self._position = position 20 | self._parent = parent 21 | self._scroll = scroll 22 | 23 | def draw(self, painter, left_shift=0, scale=1): 24 | """ 25 | 26 | :param painter: 27 | :param left_shift: 28 | :param scale: 29 | :return: 30 | """ 31 | x = self.position / scale + left_shift 32 | 33 | painter.setPen(QColor(0, 255, 0)) 34 | painter.setBrush(QColor(0, 255, 0)) 35 | painter.drawLine(x, 8, x, self._parent.height()) 36 | painter.drawEllipse(QtCore.QPoint(x, 8), 5, 5) 37 | painter.drawText(x + 8, 8 + 4, str(self.position)) 38 | 39 | ########################################################################## 40 | #### HELPERS/FUNCTIONS ################################################### 41 | ########################################################################## 42 | 43 | def moveEvent(self): 44 | """ 45 | 46 | """ 47 | pass 48 | 49 | def collide(self, x, y): 50 | """ 51 | 52 | :param x: 53 | :param y: 54 | :return: 55 | """ 56 | return (self.position - 5) <= x <= (self.position + 5) and 3 <= y <= 11 57 | 58 | def canSlideBegin(self, x, y): 59 | """ 60 | 61 | :param x: 62 | :param y: 63 | :rtype: bool 64 | """ 65 | return False 66 | 67 | def canSlideEnd(self, x, y): 68 | """ 69 | 70 | :param x: 71 | :param y: 72 | :rtype: bool 73 | """ 74 | return False 75 | 76 | def move(self, x, y): 77 | """ 78 | 79 | :param x: 80 | :param y: 81 | :return: 82 | """ 83 | if (self._position - x) >= 0 and (self._position - x) <= (self._parent.width()): 84 | self._position += x 85 | self.moveEvent() 86 | 87 | ########################################################################## 88 | #### PROPERTIES ########################################################## 89 | ########################################################################## 90 | 91 | @property 92 | def position(self): return self._position 93 | 94 | @position.setter 95 | def position(self, value): 96 | self._position = value 97 | self.moveEvent() 98 | 99 | @property 100 | def frame(self): return self._position 101 | -------------------------------------------------------------------------------- /pyforms_gui/controls/control_toolbox.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | from confapp import conf 5 | 6 | from AnyQt import _api 7 | from AnyQt.QtWidgets import QToolBox 8 | from AnyQt.QtWidgets import QFrame 9 | from AnyQt.QtWidgets import QVBoxLayout 10 | from AnyQt.QtWidgets import QHBoxLayout 11 | 12 | from pyforms_gui.controls.control_base import ControlBase 13 | 14 | 15 | class ControlToolBox(ControlBase): 16 | def init_form(self): 17 | self._form = QToolBox() 18 | super(ControlToolBox, self).init_form() 19 | 20 | # self.form.layout().setMargin(0) 21 | 22 | @property 23 | def value(self): 24 | return self._value 25 | 26 | @value.setter 27 | def value(self, value): 28 | ControlBase.label.fset(self, value); 29 | 30 | for item in range(self.form.count(), -1, -1): self.form.removeItem(item) 31 | 32 | for item in value: 33 | if isinstance(item, tuple): 34 | widget = QFrame(self.form); 35 | layout = QVBoxLayout(); 36 | 37 | if _api.USED_API == _api.QT_API_PYQT5: 38 | layout.setContentsMargins(0,0,0,0) 39 | elif _api.USED_API == _api.QT_API_PYQT4: 40 | layout.setMargin(0) 41 | 42 | widget.setLayout(layout) 43 | 44 | for e in item[1]: 45 | if isinstance(e, tuple): 46 | hwidget = QFrame(self.form); 47 | hlayout = QHBoxLayout(); 48 | 49 | if _api.USED_API == _api.QT_API_PYQT5: 50 | hlayout.setContentsMargins(0,0,0,0) 51 | elif _api.USED_API == _api.QT_API_PYQT4: 52 | hlayout.setMargin(0) 53 | 54 | hwidget.setLayout(hlayout) 55 | for ee in e: 56 | hlayout.addWidget(ee.form) 57 | widget.layout().addWidget(hwidget) 58 | else: 59 | widget.layout().addWidget(e.form) 60 | self.form.addItem(widget, item[0]) 61 | else: 62 | self.form.addItem(item.form, item.label) 63 | 64 | 65 | def set_item_enabled(self, index, enabled): 66 | """ 67 | Enable or disable an item 68 | """ 69 | self.form.setItemEnabled(index, enabled) 70 | 71 | def is_item_enabled(self, index): 72 | """ 73 | Check if an item is enabled or disabled 74 | """ 75 | return self.form.isItemEnabled(index) -------------------------------------------------------------------------------- /pyforms_gui/utils/plugins_finder.py: -------------------------------------------------------------------------------- 1 | # !/usr/bin/python3 2 | # -*- coding: utf-8 -*- 3 | 4 | import re 5 | import logging 6 | from confapp import conf 7 | 8 | logger = logging.getLogger(__name__) 9 | 10 | 11 | class PluginsFinder(object): 12 | """ 13 | Manage and find plugins at runtime 14 | """ 15 | 16 | def __init__(self, plugins=[]): 17 | self._plugins = plugins 18 | 19 | def __add__(self, other): 20 | self._plugins.append(other) 21 | return self 22 | 23 | def __sub__(self, other): 24 | self._plugins.remove(other) 25 | return self 26 | 27 | def find_class(self, class_full_name): 28 | res = self.get_module_and_class(class_full_name) 29 | if res is None: 30 | return [] 31 | 32 | package_name, class_name = res 33 | 34 | res = [] 35 | for plugin in self._plugins: 36 | try: 37 | values = class_full_name.split('.') 38 | 39 | class_name = values[-1] 40 | module_name = ('.' + '.'.join(values[:-1])) if len(values) > 1 else '' 41 | module = __import__(plugin + module_name, fromlist=['']) 42 | try: 43 | class_def = getattr(module, class_name) 44 | res.append(class_def) 45 | logger.debug("FOUND: {0:20} IN PLUGIN: {1:50}".format(package_name, plugin)) 46 | 47 | except AttributeError: 48 | if not conf.PYFORMS_SILENT_PLUGINS_FINDER: 49 | logger.debug('Importing setting {0} {1} {2}'.format(str(plugin), str(package_name), str(class_name)), exc_info=True) 50 | 51 | except ImportError: 52 | if not conf.PYFORMS_SILENT_PLUGINS_FINDER: 53 | logger.debug('Importing setting {0} {1} {2}'.format(str(plugin), str(package_name), str(class_name)), exc_info=True) 54 | 55 | except: 56 | logger.debug( 57 | 'Importing model {0} {1} {2}'.format(str(plugin), str(package_name), str(class_name)), 58 | exc_info=True) 59 | pass 60 | 61 | return res 62 | 63 | def get_module_and_class(self, plugin_info): 64 | """ 65 | :param plugin_info: 66 | :return: 67 | """ 68 | expression = re.compile('(.*)\.(\w*)') 69 | 70 | res = re.findall(expression, plugin_info) 71 | if len(res) > 0: 72 | matches = re.findall(expression, plugin_info)[0] 73 | plugin_module = matches[0] 74 | plugin_class = matches[1] 75 | return plugin_module, plugin_class 76 | else: 77 | return None 78 | -------------------------------------------------------------------------------- /tutorials/1.SimpleExamples/ComputerVisionAlgorithmExample/Example.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | __author__ = "Ricardo Ribeiro" 5 | __credits__ = ["Ricardo Ribeiro"] 6 | __license__ = "MIT" 7 | __version__ = "0.0" 8 | __maintainer__ = "Ricardo Ribeiro" 9 | __email__ = "ricardojvr@gmail.com" 10 | __status__ = "Development" 11 | 12 | 13 | from pyforms.basewidget import BaseWidget 14 | from pyforms.controls import ControlText 15 | from pyforms.controls import ControlButton 16 | from pyforms.controls import ControlSlider 17 | from pyforms.controls import ControlFile 18 | from pyforms.controls import ControlPlayer 19 | 20 | import pyforms 21 | 22 | 23 | class ComputerVisionAlgorithm(BaseWidget): 24 | 25 | def __init__(self): 26 | super(ComputerVisionAlgorithm,self).__init__('Computer vision algorithm example') 27 | 28 | #Definition of the forms fields 29 | self._videofile = ControlFile('Video') 30 | self._outputfile = ControlText('Results output file') 31 | self._threshold = ControlSlider('Threshold', default=114, minimum=0, maximum=255) 32 | self._blobsize = ControlSlider('Minimum blob size', default=110, minimum=100, maximum=2000) 33 | self._player = ControlPlayer('Player') 34 | self._runbutton = ControlButton('Run') 35 | 36 | #Define the function that will be called when a file is selected 37 | self._videofile.changed_event = self.__videoFileSelectionEvent 38 | #Define the event that will be called when the run button is processed 39 | self._runbutton.value = self.__runEvent 40 | #Define the event called before showing the image in the player 41 | self._player.process_frame_event = self.__process_frame 42 | 43 | #Define the organization of the Form Controls 44 | self.formset = [ 45 | ('_videofile', '_outputfile'), 46 | '_threshold', 47 | ('_blobsize', '_runbutton'), 48 | '_player' 49 | ] 50 | 51 | 52 | def __videoFileSelectionEvent(self): 53 | """ 54 | When the videofile is selected instanciate the video in the player 55 | """ 56 | self._player.value = self._videofile.value 57 | 58 | def __process_frame(self, frame): 59 | """ 60 | Do some processing to the frame and return the result frame 61 | """ 62 | return frame 63 | 64 | def __runEvent(self): 65 | """ 66 | After setting the best parameters run the full algorithm 67 | """ 68 | pass 69 | 70 | 71 | 72 | ################################################################################################################## 73 | ################################################################################################################## 74 | ################################################################################################################## 75 | 76 | #Execute the application 77 | if __name__ == "__main__": pyforms.start_app( ComputerVisionAlgorithm ) -------------------------------------------------------------------------------- /docs/about/about.md: -------------------------------------------------------------------------------- 1 | # About 2 | 3 | ## License 4 | *************************** 5 | 6 | The MIT License 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in 16 | all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | THE SOFTWARE. 25 | 26 | ## Rationale behind the framework 27 | *************************** 28 | 29 | The development of this library started with the necessity of allowing users with low programming skills to edit parameters of my python scripts. 30 | The idea was to transform scripts which had already been developed into GUI applications with a low effort and in a short time. 31 | 32 | For example in my computer vision applications in the majority of the times there were variables that had to be set manually in the scripts for each video, to adjust the thresholds, blobs sizes, and other parameters to the environment light conditions... To test each set of parameters the script had to be executed. 33 | With GUI applications, users would be able to set the parameters using a GUI interface and visualize the results instantly without the need of restarting the script. That was the idea. 34 | 35 | After looking into the several python options for GUI interfaces, PyQt was the one that seemed the best tool for a fast development with the QtDesigner, but after a while developing in Qt, switching between the designer and the python IDE was becoming too costly in terms of time, because the interfaces were constantly evolving, and it was tedious, because GUI controls were repeated several times. 36 | 37 | Being a Django developer, I did get inspiration on it for this framework. In the [Django](https://www.djangoproject.com/) Models we just need to define the type of variables and their disposition in the form (in ModelAdmin) to generate a HTML form for data edition. 38 | For the GUIs that I wanted to build for my python scripts, I would like to have the same simplicity, because I did wanted to focus on the algorithms and not on GUIs developing. -------------------------------------------------------------------------------- /pyforms_gui/controls/control_file.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | from confapp import conf 5 | from pyforms_gui.controls.control_base import ControlBase 6 | 7 | import pyforms_gui.utils.tools as tools 8 | 9 | 10 | from AnyQt import uic, _api 11 | from AnyQt.QtWidgets import QFileDialog 12 | 13 | 14 | class ControlFile(ControlBase): 15 | 16 | def __init__(self, *args, **kwargs): 17 | self.__exec_changed_event = True 18 | super(ControlFile, self).__init__(*args, **kwargs) 19 | self.use_save_dialog = kwargs.get('use_save_dialog', False) 20 | 21 | # used to avoid triggering the finnishEditing when the input loses the focus 22 | self._value_before_finishEditing = None 23 | 24 | def init_form(self): 25 | control_path = tools.getFileInSameDirectory(__file__, "fileInput.ui") 26 | self._form = uic.loadUi(control_path) 27 | self._form.label.setText(self._label) 28 | self._form.pushButton.clicked.connect(self.click) 29 | self.form.lineEdit.editingFinished.connect(self.finishEditing) 30 | self._form.pushButton.setIcon(conf.PYFORMS_ICON_FILE_OPEN) 31 | super().init_form() 32 | 33 | def finishEditing(self): 34 | """Function called when the lineEdit widget is edited""" 35 | if self.__exec_changed_event and self._value_before_finishEditing!=self.value: 36 | self._value_before_finishEditing = self.value 37 | self.changed_event() 38 | 39 | def click(self): 40 | if self.use_save_dialog: 41 | value, _ = QFileDialog.getSaveFileName(self.parent, self._label, self.value) 42 | else: 43 | if conf.PYFORMS_DIALOGS_OPTIONS: 44 | value = QFileDialog.getOpenFileName(self.parent, self._label, self.value, 45 | options=conf.PYFORMS_DIALOGS_OPTIONS) 46 | else: 47 | value = QFileDialog.getOpenFileName(self.parent, self._label, self.value) 48 | 49 | 50 | if _api.USED_API == _api.QT_API_PYQT5: 51 | value = value[0] 52 | elif _api.USED_API == _api.QT_API_PYQT4: 53 | value = str(value) 54 | 55 | if value and len(value)>0: 56 | self.value = value 57 | self._value_before_finishEditing = value 58 | 59 | 60 | @property 61 | def value(self): 62 | self._value = str(self._form.lineEdit.text()) 63 | return self._value 64 | 65 | @value.setter 66 | def value(self, value): 67 | self.__exec_changed_event = False 68 | self._form.lineEdit.setText(value) 69 | self.__exec_changed_event = True 70 | ControlBase.value.fset(self, value) 71 | 72 | @property 73 | def label(self): return self.form.label.text() 74 | 75 | @label.setter 76 | def label(self, value): 77 | self.form.label.setText(value) 78 | ControlBase.label.fset(self, value) -------------------------------------------------------------------------------- /pyforms_gui/controls/control_events_graph/Track.py: -------------------------------------------------------------------------------- 1 | # !/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | import bisect 5 | from AnyQt.QtGui import QColor 6 | 7 | class Track(object): 8 | """ 9 | 10 | """ 11 | 12 | DEFAULT_COLOR = QColor(100, 100, 255) 13 | 14 | def __init__(self, parent): 15 | """ 16 | 17 | :param parent: 18 | """ 19 | self._title = '' 20 | self._color = self.DEFAULT_COLOR 21 | self._parent = parent 22 | self._events = [] 23 | 24 | # Functions needed for the bisect insertion ############################ 25 | def __len__(self): 26 | return len(self._events) 27 | 28 | def __getitem__(self, index): 29 | if isinstance(index, slice): 30 | return [self._events[x] for x in range(*index.indices(len(self)))] 31 | return self._events[index] 32 | 33 | def insert(self, item, index): 34 | """ 35 | 36 | :param item: 37 | :param index: 38 | :return: 39 | """ 40 | self._events.insert(item, index) 41 | 42 | ######################################################################## 43 | 44 | def add_event(self, period): 45 | """ 46 | The events are added in a sorted way for rendering optimization 47 | :param period: 48 | :return: 49 | """ 50 | bisect.insort_right(self, period) 51 | return period 52 | 53 | def draw(self, painter, start, end, track_index): 54 | """ 55 | 56 | :param painter: 57 | :param start: 58 | :param end: 59 | :param track_index: 60 | :return: 61 | """ 62 | y = (track_index * self._parent.tracks_height) + 18 63 | painter.drawLine(start, y, end, y) 64 | 65 | def draw_events(self, painter, start, end, track_index, left_shift=0, scale=1.0): 66 | """ 67 | 68 | :param painter: 69 | :param start: 70 | :param end: 71 | :param track_index: 72 | :param left_shift: 73 | :param scale: 74 | :return: 75 | """ 76 | top = track_index * self._parent.tracks_height + 20 77 | 78 | first_index = bisect.bisect(self, start) 79 | 80 | for period in self._events[first_index:]: 81 | if period.begin > end: 82 | continue 83 | painter.setBrush(period.color) 84 | period.draw(painter, top=top, left_shift=left_shift, scale=scale) 85 | 86 | def clear(self): 87 | """ 88 | 89 | :return: 90 | """ 91 | del self._events[:] 92 | self._events = [] 93 | 94 | @property 95 | def events(self): 96 | return self._events 97 | 98 | @property 99 | def color(self): 100 | return self._color 101 | 102 | @color.setter 103 | def color(self, value): 104 | self._color = value 105 | 106 | @property 107 | def title(self): 108 | return self._title 109 | 110 | @title.setter 111 | def title(self, value): 112 | self._title = value 113 | 114 | @property 115 | def properties(self): 116 | return ['T', self.title, self.color.name()] 117 | 118 | @properties.setter 119 | def properties(self, value): 120 | self.title = value[1] 121 | self.color = QColor(value[2]) 122 | -------------------------------------------------------------------------------- /pyforms_gui/controls/control_matplotlib.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | 5 | __author__ = "Ricardo Ribeiro" 6 | __credits__ = ["Ricardo Ribeiro"] 7 | __license__ = "MIT" 8 | __version__ = "0.0" 9 | __maintainer__ = "Ricardo Ribeiro" 10 | __email__ = "ricardojvr@gmail.com" 11 | __status__ = "Development" 12 | 13 | from AnyQt.QtCore import QMargins 14 | from AnyQt.QtWidgets import QWidget, QVBoxLayout 15 | from pyforms_gui.controls.control_base import ControlBase 16 | from matplotlib.figure import Figure 17 | from AnyQt import _api 18 | 19 | if _api.USED_API == _api.QT_API_PYQT5: 20 | from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas 21 | from matplotlib.backends.backend_qt5agg import NavigationToolbar2QT as NavigationToolbar 22 | elif _api.USED_API == _api.QT_API_PYQT4: 23 | from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas 24 | from matplotlib.backends.backend_qt4agg import NavigationToolbar2QT as NavigationToolbar 25 | 26 | class ControlMatplotlib(ControlBase, QWidget): 27 | 28 | def __init__(self, *args, **kwargs): 29 | QWidget.__init__(self) 30 | ControlBase.__init__(self, *args, **kwargs) 31 | 32 | self.on_draw = kwargs.get('on_draw', self.on_draw) 33 | 34 | def init_form(self): 35 | 36 | self._fig = Figure((5.0, 4.0), dpi=100) 37 | self.canvas = FigureCanvas(self._fig) 38 | self.canvas.setParent(self) 39 | self.mpl_toolbar = NavigationToolbar(self.canvas, self) 40 | 41 | vbox = QVBoxLayout() 42 | vbox.addWidget(self.canvas) 43 | vbox.addWidget(self.mpl_toolbar) 44 | vbox.setContentsMargins(QMargins(0,0,0,0)) 45 | self.setLayout(vbox) 46 | super(ControlMatplotlib, self).init_form() 47 | 48 | @property 49 | def value(self): return None 50 | 51 | @value.setter 52 | def value(self, value): 53 | self.on_draw = value 54 | self.draw() 55 | 56 | def draw(self): 57 | self.on_draw(self._fig) 58 | self.canvas.draw() 59 | 60 | def on_draw(self, figure): 61 | """ Redraws the figure 62 | """ 63 | x = range(len(self.value)) 64 | 65 | #self._axes = self._fig.add_subplot(111) 66 | 67 | #self._axes.bar(left=x, height=self.data) 68 | #self.canvas.draw() 69 | 70 | axes = figure.add_subplot(111, projection='3d') 71 | axes.clear(); 72 | pts = axes.scatter(x, x, x, c=x) 73 | figure.colorbar(pts) 74 | 75 | 76 | ############################################################################ 77 | ############ Properties #################################################### 78 | ############################################################################ 79 | 80 | @property 81 | def fig(self): return self._fig 82 | @fig.setter 83 | def fig(self, value): self._fig = value 84 | 85 | 86 | @property 87 | def form(self): return self -------------------------------------------------------------------------------- /pyforms_gui/utils/ImageBlobTools.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | __author__ = "Ricardo Ribeiro" 5 | __credits__ = ["Ricardo Ribeiro"] 6 | __license__ = "MIT" 7 | __version__ = "0.0" 8 | __maintainer__ = "Ricardo Ribeiro" 9 | __email__ = "ricardojvr@gmail.com" 10 | __status__ = "Development" 11 | 12 | 13 | from numpy import * 14 | import cv2, math 15 | 16 | def biggestContour(contours, howmany=1): 17 | biggest = [] 18 | for blob in contours: area = cv2.contourArea(blob); biggest.append( (area, blob) ) 19 | if len(biggest)==0: return None 20 | biggest = sorted( biggest, key=lambda x: -x[0]) 21 | if howmany==1: return biggest[0][1] 22 | return [x[1] for x in biggest[:howmany] ] 23 | 24 | def getBiggestContour(image, howmany=1): 25 | (blobs, dummy) = cv2.findContours( image.copy(), cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE ) 26 | return biggestContour(blobs, howmany) 27 | 28 | def cutBiggestContour(image, howmany=1): 29 | contour = getBiggestContour(image) 30 | 31 | mask = zeros_like(image);cv2.drawContours(mask, array([contour]), -1, (255,255,255), -1 ) 32 | tmp = cv2.bitwise_and( image, mask ) 33 | 34 | rect = cv2.boundingRect(contour) 35 | x, y, w, h = rect 36 | x, y, xx, yy = x,y,x+w,y+h 37 | return tmp[y:yy, x:xx] 38 | 39 | 40 | def rotate_image(image, angle): 41 | """ 42 | Rotates the given image about it's centre 43 | """ 44 | 45 | image_size = (image.shape[1], image.shape[0]) 46 | image_center = tuple(array(image_size) / 2) 47 | 48 | rot_mat = vstack([cv2.getRotationMatrix2D(image_center, angle, 1.0), [0, 0, 1]]) 49 | trans_mat = identity(3) 50 | 51 | w2 = image_size[0] * 0.5 52 | h2 = image_size[1] * 0.5 53 | 54 | rot_mat_notranslate = matrix(rot_mat[0:2, 0:2]) 55 | 56 | tl = (array([-w2, h2]) * rot_mat_notranslate).A[0] 57 | tr = (array([w2, h2]) * rot_mat_notranslate).A[0] 58 | bl = (array([-w2, -h2]) * rot_mat_notranslate).A[0] 59 | br = (array([w2, -h2]) * rot_mat_notranslate).A[0] 60 | 61 | x_coords = [pt[0] for pt in [tl, tr, bl, br]] 62 | x_pos = [x for x in x_coords if x > 0] 63 | x_neg = [x for x in x_coords if x < 0] 64 | 65 | y_coords = [pt[1] for pt in [tl, tr, bl, br]] 66 | y_pos = [y for y in y_coords if y > 0] 67 | y_neg = [y for y in y_coords if y < 0] 68 | 69 | right_bound = max(x_pos) 70 | left_bound = min(x_neg) 71 | top_bound = max(y_pos) 72 | bot_bound = min(y_neg) 73 | 74 | new_w = int(abs(right_bound - left_bound)) 75 | new_h = int(abs(top_bound - bot_bound)) 76 | new_image_size = (new_w, new_h) 77 | 78 | new_midx = new_w * 0.5 79 | new_midy = new_h * 0.5 80 | 81 | dx = int(new_midx - w2) 82 | dy = int(new_midy - h2) 83 | 84 | trans_mat = getTranslationMatrix2d(dx, dy) 85 | affine_mat = (matrix(trans_mat) * matrix(rot_mat))[0:2, :] 86 | result = cv2.warpAffine(image, affine_mat, new_image_size, flags=cv2.INTER_LINEAR) 87 | 88 | return result 89 | --------------------------------------------------------------------------------