diff --git a/.gitattributes b/.gitattributes
deleted file mode 100644
index 47913f597..000000000
--- a/.gitattributes
+++ /dev/null
@@ -1,36 +0,0 @@
-*.py text diff=python
-*.pyi text diff=python
-*.c text diff=c
-*.cpp text diff=cpp
-*.hpp text diff=cpp
-*.h text diff=c
-*.m text diff=objc
-*.mm text
-*.bat text
-*.md text
-*.txt text
-*.html text
-*.sh text eol=lf
-*.yml text
-*.ttf binary
-*.png binary
-*.jpg binary
-*.jpeg binary
-*.gif binary
-*.tif binary
-*.tiff binary
-*.ico binary
-
-.gitattributes export-ignore
-.gitignore export-ignore
-
-# generated code
-dearpygui/dearpygui.py linguist-generated
-dearpygui/_dearpygui.pyi linguist-generated
-dearpygui/_dearpygui_RTD.py linguist-generated
-
-# vendored code
-thirdparty/* linguist-vendored
-
-# documentation
-docs/* linguist-documentation
\ No newline at end of file
diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md
deleted file mode 100644
index c1db814ef..000000000
--- a/.github/CHANGELOG.md
+++ /dev/null
@@ -1,27 +0,0 @@
-# 1.x.y CHANGELOG
-
-This document holds the user-facing changelog that we also use in release notes.
-We generally fold multiple commits pertaining to the same topic as a single entry.
-
-* RELEASE NOTES: https://github.com/hoffstadt/DearPyGui/releases
-* REPORT ISSUES, ASK QUESTIONS: https://github.com/hoffstadt/DearPyGui/issues
-* COMMITS HISTORY: https://github.com/hoffstadt/DearPyGui/commits/master
-* WIKI https://github.com/hoffstadt/DearPyGui/wiki
-
-### When to update?
-
-- Keeping your copy of Dear PyGui updated regularly is recommended.
-- It is generally safe to sync to the latest commit in master
- The library is fairly stable and regressions tends to be fixed fast when reported.
-
-### How to update?
-
-- pip or pip3 install dearpygui --upgrade
-- Read the `Breaking Changes` section (here in the changelog).
-- Please report any issue!
-
-## VERSION 1.0.1
-
-### Fixes
-* fixed `show_item_registry()` not rendering widgets
-* fixed themes not binding to node attributes #1320
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
deleted file mode 100644
index b23dae7d8..000000000
--- a/.github/CODEOWNERS
+++ /dev/null
@@ -1,23 +0,0 @@
-
-# directories
-/thirdparty/ @hoffstadt
-/scripts/ @hoffstadt
-/docs/* @hoffstadt
-
-# specific files
-/src/distribution.cmake @hoffstadt
-/src/embedded.cmake @hoffstadt
-/src/CMakeLists.txt @hoffstadt
-/src/.gitignore @hoffstadt
-CMakeLists.txt @hoffstadt
-CMakeSettings.json @hoffstadt
-setup.py @hoffstadt
-.gitattributes @hoffstadt
-.gitignore @hoffstadt
-.gitmodules @hoffstadt
-.readthedocs.yaml @hoffstadt
-
-# no owners
-README.md
-/docs/source/
-/assets
diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
new file mode 100644
index 000000000..6ee9f6669
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -0,0 +1,58 @@
+---
+name: Bug report
+about: Create a report to help us improve
+title: ''
+labels: ''
+assignees: ''
+
+---
+
+1. PLEASE CAREFULLY READ: [FAQ](https://github.com/hoffstadt/DearPyGui/discussions/categories/frequently-asked-questions-faq)
+
+2. PLEASE CAREFULLY READ: [Documentation](https://github.com/hoffstadt/DearPyGui/wiki)
+
+3. FOR FIRST-TIME USERS ISSUES, please use the [Discord server](https://discord.gg/tyE7Gu4).
+
+4. PLEASE MAKE SURE that you have: read the FAQ; explored the examples; searched among Issues; and read the link provided in (1) (2).
+
+5. Be mindful that messages are being sent to the e-mail box of "Watching" users. Try to proof-read your messages before sending them. Edits are not seen by those users.
+
+6. Delete points 1-6 and PLEASE FILL THE TEMPLATE BELOW before submitting your issue or we will immediately close it.
+
+Thank you!
+
+----
+
+## Version of Dear PyGui
+
+Version: XXX
+Operating System: XXX (Windows 10, macOs xx, Ubuntu 20.04, etc.)
+
+## My Issue/Question
+
+A clear and concise description of what the issue/question is. Please provide as much context as possible.
+
+## To Reproduce
+
+Steps to reproduce the behavior:
+1. Go to '...'
+2. Click on '....'
+3. Scroll down to '....'
+4. See error
+
+## Expected behavior
+
+A clear and concise description of what you expected to happen.
+
+## Screenshots/Video
+
+XXX _(you can drag files here)_
+
+## Standalone, minimal, complete and verifiable example
+
+```python
+# Here's some code anyone can copy and paste to reproduce your issue
+add_button("Example Bug")
+more_code_to_explain_my_issue()
+start_dearpygui()
+```
diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml
deleted file mode 100644
index 8325e2e5e..000000000
--- a/.github/ISSUE_TEMPLATE/bug_report.yml
+++ /dev/null
@@ -1,121 +0,0 @@
-name: Bug Report
-description: File a report for unexpected or broken behavior.
-labels: ["state: pending", "type: bug"]
-body:
- - type: markdown
- attributes:
- value: |
- **Before opening a bug report, please:**
- - Search [existing issues](https://github.com/hoffstadt/DearPyGui/issues?q=is%3Aissue) (including closed ones) — your bug may already be known.
- - Check the [FAQ](https://github.com/hoffstadt/DearPyGui/discussions/categories/frequently-asked-questions-faq), [Wiki](https://github.com/hoffstadt/DearPyGui/wiki), and [online documentation](https://dearpygui.readthedocs.io/en/latest/index.html).
- - **!!! FOR FIRST-TIME USERS' ISSUES, please use the [Discord server](https://discord.gg/tyE7Gu4) !!!**
- - Remove all third-party libraries.
- - Confirm that the problem still exists with the **latest released version** of DearPyGui.
- - Be mindful that messages are being sent to the e-mail box of "Watching" users. Try to proof-read your messages before sending them. Edits are not seen by those users.
-
- - type: input
- id: dpg_version
- attributes:
- label: "Dear PyGui version:"
- description: >
- Run `python -c "import dearpygui; print(dearpygui.__version__)"` or `pip show dearpygui` to obtain it.
- placeholder: "e.g. 2.2.1"
- validations:
- required: true
-
- - type: input
- id: python_version
- attributes:
- label: "Python version:"
- description: >
- Run `python --version` to obtain it.
- Note: DearPyGui requires Python 3.8+.
- placeholder: "e.g. 3.11.4"
- validations:
- required: true
-
- - type: input
- id: operating_system
- attributes:
- label: "Operating system:"
- placeholder: "e.g. Windows 11 22H2 or Ubuntu 22.04 LTS"
- validations:
- required: true
-
- - type: textarea
- id: description
- attributes:
- label: "My issue/question:"
- description: "A clear and concise description of what the issue/question is. Please provide as much context as possible!"
- validations:
- required: true
-
- - type: textarea
- id: steps
- attributes:
- label: "Steps to reproduce:"
- value: |
- 1. Go to '...'
- 2. Click on '....'
- 3. Scroll down to '....'
- 4. See error
- validations:
- required: true
-
- - type: textarea
- id: expected
- attributes:
- label: "Expected behavior:"
- description: "What did you expect to happen?"
- validations:
- required: true
-
- - type: textarea
- id: screenshots
- attributes:
- label: "Screenshots:"
- description: |
- If applicable, attach screenshots or a screen recording (GIF/video) to help illustrate the problem. You can drag and drop files directly into this field. Please remove "N/A" text if you insert any screenshots.
- # This is to prevent GitHub from inserting "No response" section - N/A reads better.
- # As soon as GitHub starts entirely omitting empty inputs from issue description,
- # we can remove the "value" and just let the Screenshots section disappear if the user
- # doesn't provide any.
- value: "N/A"
- validations:
- required: false
-
- - type: textarea
- id: mcve
- attributes:
- label: "Standalone, minimal, complete and verifiable example:"
- description: |
- **Please provide the shortest self-contained Python script that recreates the issue.**
- Strip your code down to only what is necessary to trigger the bug.
- **Anyone** should be able to **copy and paste** this code and recreate your issue.
- Issues without a reproducible example may be closed.
- render: python
- placeholder: |
- import dearpygui.dearpygui as dpg
-
- dpg.create_context()
- dpg.create_viewport(title="Bug Demo")
- dpg.setup_dearpygui()
-
- with dpg.window(label="Bug Demo"):
- # minimal code that triggers the bug
- pass
-
- dpg.show_viewport()
- dpg.start_dearpygui()
- dpg.destroy_context()
- validations:
- required: true
-
- - type: markdown
- attributes:
- value: |
- **Last-chance checklist:**
- - I have read DearPyGui documentation,
- - I have checked FAQ and wiki articles for solution,
- - I have searched for similar issues and found none,
- - I have proof-read the description and it fully describes the problem.
diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml
deleted file mode 100644
index 57dc07550..000000000
--- a/.github/ISSUE_TEMPLATE/config.yml
+++ /dev/null
@@ -1,8 +0,0 @@
-blank_issues_enabled: false
-contact_links:
- - name: Quick question? Discord!
- url: https://discord.gg/tyE7Gu4
- about: Dear PyGui community is more active on Discord than here. If you're asking a question rather than reporting a bug, head over to Discord for a quick answer.
- - name: Dear PyGui is in maintenance mode!
- url: https://github.com/hoffstadt/DearPyGui/wiki/What's-going-on%3F
- about: Read this wiki article if you're unaware of the maintenance-only status of this project.
diff --git a/.github/ISSUE_TEMPLATE/doc_change.yml b/.github/ISSUE_TEMPLATE/doc_change.yml
deleted file mode 100644
index 189af0b98..000000000
--- a/.github/ISSUE_TEMPLATE/doc_change.yml
+++ /dev/null
@@ -1,24 +0,0 @@
-name: Documentation Improvement
-description: Suggest a doc change.
-labels: ["state: pending", "type: docs"]
-body:
- - type: textarea
- id: description
- attributes:
- label: Description
- description: "A clear and concise description of what the improvement is. Please provide as much context as possible."
- validations:
- required: true
-
- - type: textarea
- id: assets
- attributes:
- label: Necessary assets
- description: "Any assets to use in the documentation. You can drag and drop files directly into this field."
- value: |
- - [ ] Pictures
- - [ ] Code Sample
- - [ ] GIFs
-
- validations:
- required: false
diff --git a/.github/ISSUE_TEMPLATE/documentation.md b/.github/ISSUE_TEMPLATE/documentation.md
new file mode 100644
index 000000000..59f100f98
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/documentation.md
@@ -0,0 +1,42 @@
+---
+name: Documentation Improvement
+about: Not Documented, Not Done... Help us be done!
+title: ''
+labels: ''
+assignees: ''
+
+---
+
+---
+We'd love help and you are welcome to improve the the documentation with the exception of the api reference because
+it is currently generated manually from the stub file. It needs to be integrated within our CI process soon.
+If you'd like to change the API reference, update the stub file and we will generate the api docs during releases:
+
+https://github.com/hoffstadt/DearPyGui/blob/master/DearPyGui/stubs/dearpygui.pyi
+
+
+What can be modified related to docs:
+* Wiki
+* https://github.com/hoffstadt/DearPyGui/tree/gh-pages except (api_docs.html)
+* Readme
+* https://github.com/hoffstadt/DearPyGui/blob/master/DearPyGui/include/mvMarvel.h (this shows up in _show_documentation()_)
+* https://github.com/hoffstadt/DearPyGui/blob/master/DearPyGui/src/Core/StandardWindows/mvDocWindow.cpp (this shows up in _show_documentation()_)
+* https://github.com/hoffstadt/DearPyGui/tree/master/Examples (adding examples)
+
+Currently the CSS formatting is inherited from the autogenerated AIP docs done using pdoc3 to keep uniformity.
+
+Delete the above comment between the lines and PLEASE FILL THE TEMPLATE BELOW before submitting your issue.
+
+Thank you!
+
+----
+
+**My Improvement**
+
+A clear and concise description of what the improvement is. Please provide as much context as possible.
+
+**Necessary Assets**
+
+- [ ] Pictures
+- [x] Code Sample
+- [ ] GIFs
diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md
new file mode 100644
index 000000000..bbcbbe7d6
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/feature_request.md
@@ -0,0 +1,20 @@
+---
+name: Feature request
+about: Suggest an idea for this project
+title: ''
+labels: ''
+assignees: ''
+
+---
+
+**Is your feature request related to a problem? Please describe.**
+A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
+
+**Describe the solution you'd like**
+A clear and concise description of what you want to happen.
+
+**Describe alternatives you've considered**
+A clear and concise description of any alternative solutions or features you've considered.
+
+**Additional context**
+Add any other context or screenshots about the feature request here.
diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml
deleted file mode 100644
index dc2419b26..000000000
--- a/.github/ISSUE_TEMPLATE/feature_request.yml
+++ /dev/null
@@ -1,45 +0,0 @@
-name: Feature Request
-description: Suggest a new feature or improvement.
-labels: ["state: pending", "type: improvement"]
-body:
- - type: markdown
- attributes:
- value: |
- **Before opening a feature request, please:**
- - Search [existing issues](https://github.com/hoffstadt/DearPyGui/issues?q=is%3Aissue) and [discussions](https://github.com/hoffstadt/DearPyGui/discussions) (including closed ones) for similar requests.
- - Be mindful of [The XY Problem](https://en.wikipedia.org/wiki/XY_problem): describe **what you are trying to accomplish**, not only the specific solution you have in mind. There may be a better or already-available approach.
-
- - type: textarea
- id: description
- attributes:
- label: Description
- description: "A clear and concise description of what the problem is."
- placeholder: "e.g. I'm trying to build X. There is currently no way to do Y, which means I have to work around it by..."
- validations:
- required: true
-
- - type: textarea
- id: solution
- attributes:
- label: Proposed solution
- description: "A clear and concise description of what you want to happen."
- validations:
- required: true
-
- - type: textarea
- id: alternatives
- attributes:
- label: Alternatives considered
- description: "Describe any alternative approaches, workarounds, or existing solutions you have already tried or considered."
- value: "N/A"
- validations:
- required: false
-
- - type: textarea
- id: additional
- attributes:
- label: Additional context
- description: "Any other context, screenshots, links to related issues, or references that might help."
- value: "N/A"
- validations:
- required: false
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
index 47899303d..64042b0b4 100644
--- a/.github/PULL_REQUEST_TEMPLATE.md
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -1,16 +1,16 @@
-
-
+---
+name: Pull Request
+about: Create a pull request to help us improve
+title: ''
+assignees: ''
+
+---
+
+
+
**Description:**
**Concerning Areas:**
-
-**A checklist on final steps:**
-
-I confirm that I have:
-- [ ] listed all necessary tickets with the "closes" keyword,
-- [ ] added reviewers,
-- [ ] proof-read the description in the Preview tab,
-- [ ] removed this checklist from PR description :) (yes, this checklist is for *you*, not for us - use it as a reminder).
diff --git a/.github/TODO.md b/.github/TODO.md
deleted file mode 100644
index 8141cf3d2..000000000
--- a/.github/TODO.md
+++ /dev/null
@@ -1,13 +0,0 @@
-## ISSUES & TODO LIST
-
-Issue numbers (#) refer to github issues listed at https://github.com/hoffstadt/DearPyGui/issues
-The list below consist mostly of ideas noted down before they are requested/discussed by users (at which point they usually exist on the github issue tracker).
-It's mostly a bunch of personal notes, probably incomplete. Feel free to query if you have any questions.
-
-* window class: alot of work needs to happen here to clean this up.
-* doc: work on the CONTRIBUTING.md file
-* doc/wiki: work on the wiki https://github.com/hoffstadt/DearPyGui/wiki
-* custom widgets: add a fully supported custom widget API to allow users to make their own widgets more easily
-* mvPythonTranslator: make commands more consistent, more like ToPyPairII
-* add_texture: fix alpha channel mess
-* mac: handle retina display nonsense
diff --git a/.github/workflows/Deployment.yml b/.github/workflows/Deployment.yml
deleted file mode 100644
index 379745715..000000000
--- a/.github/workflows/Deployment.yml
+++ /dev/null
@@ -1,245 +0,0 @@
-name: Deployment
-
-on:
-
- workflow_dispatch:
-
- branches:
- - master
- - development
- - development_*
-
- inputs:
-
- version:
- description: 'Dear PyGui Version'
- required: false
- default: '2.1.2'
-
- deploy:
- description: 'Deploy (true will deploy to pypi)'
- required: false
- default: 'false'
-
- deploytest:
- description: 'Deploy (true will deploy to test pypi)'
- required: false
- default: 'false'
-
-jobs:
-
- build-windows-wheels:
-
- runs-on: windows-2022
- strategy:
- matrix:
- python-version: [ 3.8, 3.9, "3.10", "3.11", "3.12", "3.13", "3.14" ]
-
- steps:
-
- - name: Checkout
- uses: actions/checkout@v4
-
- - name: Setup Python ${{ matrix.python-version }}
- uses: actions/setup-python@v5
- with:
- python-version: ${{ matrix.python-version }}
-
- - name: Retrieve submodules
- shell: cmd
- run: |
- git submodule update --init --recursive ./thirdparty/imgui
- git submodule update --init --recursive ./thirdparty/implot
- git submodule update --init --recursive ./thirdparty/freetype
-
- - name: Mark Versions
- shell: cmd
- run: |
- cd %GITHUB_WORKSPACE%
- echo ${{ github.event.inputs.version }} > version_number.txt
-
- - name: Build Wheel
- shell: cmd
- run: |
- cd %GITHUB_WORKSPACE%
- python -m pip install --upgrade pip twine wheel setuptools
- python -m setup bdist_wheel --plat-name win_amd64 --dist-dir dist
-
- - name: Upload Windows ${{ matrix.python-version }} Wheel
- uses: actions/upload-artifact@v4
- with:
- name: windowsbuild${{ matrix.python-version }}
- path: ${{ github.workspace }}/dist/*.whl
- overwrite: true
-
- build-mac-silicon-wheels:
-
- runs-on: macos-latest-xlarge
- strategy:
- matrix:
- python-version: [ "3.10", "3.11", "3.12", "3.13", "3.14" ]
-
- steps:
-
- - name: Checkout
- uses: actions/checkout@v4
-
- - name: Setup Python ${{ matrix.python-version }}
- uses: actions/setup-python@v5
- with:
- python-version: ${{ matrix.python-version }}
-
- - name: Retrieve submodules
- run: |
- git submodule update --init --recursive ./thirdparty/imgui
- git submodule update --init --recursive ./thirdparty/implot
- git submodule update --init --recursive ./thirdparty/glfw
-
- - name: Mark Versions
- run: |
- cd $GITHUB_WORKSPACE
- echo ${{ github.event.inputs.version }} > version_number.txt
-
- - name: Build Wheel
- run: |
- cd $GITHUB_WORKSPACE
- python -m pip install --upgrade pip twine wheel setuptools
- python -m setup bdist_wheel --plat-name macosx-13.0-arm64 --dist-dir dist
-
- - name: Upload MacOS ${{ matrix.python-version }} Wheel
- uses: actions/upload-artifact@v4
- with:
- name: apple10sbuild${{ matrix.python-version }}
- path: ${{ github.workspace }}/dist/*.whl
- overwrite: true
-
- build-linux-x64-wheels:
-
- runs-on: ubuntu-22.04
- env:
- CXX: g++-10
- strategy:
- matrix:
- python-version: [ 3.8, 3.9, "3.10", "3.11", "3.12", "3.13", "3.14" ]
-
- steps:
-
- - name: Checkout
- uses: actions/checkout@v4
-
- - name: Setup Python ${{ matrix.python-version }}
- uses: actions/setup-python@v5
- with:
- python-version: ${{ matrix.python-version }}
-
- - name: Retrieve submodules/Dependencies
- run: |
- git submodule update --init --recursive ./thirdparty/imgui
- git submodule update --init --recursive ./thirdparty/implot
- git submodule update --init --recursive ./thirdparty/glfw
- sudo apt-get update
- sudo apt-get install libglu1-mesa-dev libgl1-mesa-dev xorg-dev libxrandr-dev -y
-
- - name: Mark Versions
- run: |
- cd $GITHUB_WORKSPACE
- echo ${{ github.event.inputs.version }} > version_number.txt
-
- - name: Build Wheel
- run: |
- cd $GITHUB_WORKSPACE
- python -m pip install --upgrade pip twine wheel setuptools
- python -m setup bdist_wheel --plat-name manylinux1_x86_64 --dist-dir dist
-
- - name: Upload Linux ${{ matrix.python-version }} Wheel
- uses: actions/upload-artifact@v4
- with:
- name: linuxbuild${{ matrix.python-version }}
- path: ${{ github.workspace }}/dist/*.whl
- overwrite: true
-
- build-linux-aarch64-wheels:
-
- runs-on: ubuntu-22.04-arm
- env:
- CXX: g++-10
- strategy:
- matrix:
- python-version: [ 3.8, 3.9, "3.10", "3.11", "3.12", "3.13", "3.14" ]
-
- steps:
-
- - name: Checkout
- uses: actions/checkout@v4
-
- - name: Setup Python ${{ matrix.python-version }}
- uses: actions/setup-python@v5
- with:
- python-version: ${{ matrix.python-version }}
-
- - name: Retrieve submodules/Dependencies
- run: |
- git submodule update --init --recursive ./thirdparty/imgui
- git submodule update --init --recursive ./thirdparty/implot
- git submodule update --init --recursive ./thirdparty/glfw
- sudo apt-get update
- sudo apt-get install libglu1-mesa-dev libgl1-mesa-dev xorg-dev libxrandr-dev -y
-
- - name: Mark Versions
- run: |
- cd $GITHUB_WORKSPACE
- echo ${{ github.event.inputs.version }} > version_number.txt
-
- - name: Build Wheel
- run: |
- cd $GITHUB_WORKSPACE
- python -m pip install --upgrade pip twine wheel setuptools
- python -m setup bdist_wheel --plat-name manylinux2014_aarch64 --dist-dir dist
-
- - name: Upload Linux ${{ matrix.python-version }} Wheel
- uses: actions/upload-artifact@v4
- with:
- name: linuxaarchbuild${{ matrix.python-version }}
- path: ${{ github.workspace }}/dist/*.whl
- overwrite: true
-
- deploy-packages:
-
- needs: [build-windows-wheels, build-linux-x64-wheels, build-linux-aarch64-wheels, build-mac-silicon-wheels]
- runs-on: windows-2022
-
- steps:
-
- - name: Checkout
- uses: actions/checkout@v4
-
- - name: Set up Python 3.9
- uses: actions/setup-python@v5
- with:
- python-version: 3.9
-
- - name: Install Dependencies
- run: |
- python -m pip install --upgrade pip setuptools wheel twine
-
- - name: Download artifacts
- uses: actions/download-artifact@v4
-
- - name: PyPi Deployment
- shell: cmd
- if: ${{contains(github.event.inputs.deploy, 'true') && github.ref == 'refs/heads/master'}}
- run: |
- python -m twine upload windowsbuild*/* -u __token__ -p ${{ secrets.PYPI_PASSWORD }} --skip-existing
- python -m twine upload apple10sbuild*/* -u __token__ -p ${{ secrets.PYPI_PASSWORD }} --skip-existing
- python -m twine upload linuxbuild*/* -u __token__ -p ${{ secrets.PYPI_PASSWORD }} --skip-existing
- python -m twine upload linuxaarchbuild*/* -u __token__ -p ${{ secrets.PYPI_PASSWORD }} --skip-existing
-
- - name: Test PyPi Deployment
- shell: cmd
- if: "contains(github.event.inputs.deploytest, 'true')"
- run: |
- dir
- python -m twine upload --repository testpypi windowsbuild*/* -u __token__ -p ${{ secrets.TEST_PYPI_PASSWORD }} --skip-existing
- python -m twine upload --repository testpypi apple10sbuild*/* -u __token__ -p ${{ secrets.TEST_PYPI_PASSWORD }} --skip-existing
- python -m twine upload --repository testpypi linuxbuild*/* -u __token__ -p ${{ secrets.TEST_PYPI_PASSWORD }} --skip-existing
- python -m twine upload --repository testpypi linuxaarchbuild*/* -u __token__ -p ${{ secrets.TEST_PYPI_PASSWORD }} --skip-existing
diff --git a/.github/workflows/EmbeddedBuild.yml b/.github/workflows/EmbeddedBuild.yml
index e21d690cc..ac70d6d86 100644
--- a/.github/workflows/EmbeddedBuild.yml
+++ b/.github/workflows/EmbeddedBuild.yml
@@ -1,37 +1,19 @@
name: Embedded Build
on:
-
- schedule:
- - cron: '0 1 * * 1'
-
- push:
-
- branches:
- - master
- - development
- - development_*
-
- paths-ignore:
- - 'docs/**'
- - 'assets/**'
- - 'scripts/**'
-
- pull_request:
-
- workflow_dispatch:
+ push: {}
+ pull_request: {}
jobs:
build-windows:
- runs-on: windows-2022
- if: ${{! contains(github.event.head_commit.message, '[individual]') || contains(github.event.head_commit.message, '[windows]')}}
+ runs-on: windows-2019
+ if: "! contains(github.event.head_commit.message, '[skip ci]')"
steps:
- - name: Checkout
- uses: actions/checkout@v4
+ - uses: actions/checkout@v2
- name: Retrieve submodules
shell: cmd
@@ -40,139 +22,78 @@ jobs:
- name: Build Python
shell: cmd
run: |
- cd %GITHUB_WORKSPACE%
- cd scripts
+ cd Scripts
call BuildPythonForWindows.bat --ci
+ cd ..
+ mkdir cmake-build-release
+ cd cmake-build-release
+ cmake ..
- name: Build DearPyGui
shell: cmd
run: |
- cd %GITHUB_WORKSPACE%
- mkdir cmake-build-release
- cd cmake-build-release
- cmake .. -DMV_TESTS_ONLY=True
- cd ..
cmake --build cmake-build-release --config Release
-# temporarily removed until github runners are fixed (freetype is causing issues)
-# - name: Run Tests
-# shell: cmd
-# run: |
-# cd %GITHUB_WORKSPACE%
-# cd cmake-build-release\DearSandbox
-# DearSandbox.exe
-
build-MacOS:
-
+
runs-on: MacOS-latest
- if: ${{! contains(github.event.head_commit.message, '[individual]') || contains(github.event.head_commit.message, '[apple]')}}
+ if: "! contains(github.event.head_commit.message, '[skip ci]')"
steps:
- - name: Checkout
- uses: actions/checkout@v4
+ - uses: actions/checkout@v2
- name: Retrieve submodules
run: git submodule update --init --recursive
-
+
- name: Build Python
run: |
- cd $GITHUB_WORKSPACE
- cd thirdparty/cpython
- mkdir -p build/debug
- chmod +x configure
- cd build/debug
- ../../configure --with-pydebug --enable-shared --prefix=$(pwd) LDFLAGS=-Wl,-rpath,$(pwd)
+ cd Dependencies/cpython
+ mkdir debug
+ cd debug
+ ../configure --with-pydebug --enable-shared --prefix=$(pwd) LDFLAGS=-Wl,-rpath,$(pwd)
make
make install
- name: Build DearPyGui
run: |
- cd $GITHUB_WORKSPACE
- mkdir cmake-build-debug
- cd cmake-build-debug
- cmake .. -DMV_TESTS_ONLY=True
- cd ..
- cmake --build cmake-build-debug --config Debug
-
- build-x64-Linux:
-
- # Delete in the future
- name: build-Ubuntu
- runs-on: ubuntu-22.04
- env:
- CXX: g++-10
- if: ${{! contains(github.event.head_commit.message, '[individual]') || contains(github.event.head_commit.message, '[linux]')}}
-
- steps:
-
- - name: Checkout
- uses: actions/checkout@v4
-
- - name: Retrieve submodules
- run: git submodule update --init --recursive
-
- - name: Install Dependencies
- run: |
- cd $GITHUB_WORKSPACE
- sudo apt-get update
- sudo apt-get install libgl1-mesa-dev xorg-dev
-
- - name: Build Python
- run: |
- cd $GITHUB_WORKSPACE
- cd thirdparty/cpython
- mkdir -p build/debug
- chmod +x configure
- cd build/debug
- ../../configure --with-pydebug --enable-shared
- make
-
- - name: Build DearPyGui
- run: |
- cd $GITHUB_WORKSPACE
mkdir cmake-build-debug
cd cmake-build-debug
- cmake .. -DMV_TESTS_ONLY=True
+ cmake ..
cd ..
cmake --build cmake-build-debug --config Debug
- build-aarch64-Linux:
-
- runs-on: ubuntu-22.04-arm
- env:
- CXX: g++-10
- if: ${{! contains(github.event.head_commit.message, '[individual]') || contains(github.event.head_commit.message, '[linux]')}}
+ build-Ubuntu:
+
+ runs-on: ubuntu-18.04
+ if: "! contains(github.event.head_commit.message, '[skip ci]')"
steps:
- - name: Checkout
- uses: actions/checkout@v4
+ - uses: actions/checkout@v2
- name: Retrieve submodules
run: git submodule update --init --recursive
- name: Install Dependencies
run: |
- cd $GITHUB_WORKSPACE
sudo apt-get update
- sudo apt-get install libgl1-mesa-dev xorg-dev
-
+ sudo apt-get install libgl1-mesa-dev
+ sudo apt-get install xorg-dev
+ sudo apt-get install libfreetype6-dev
+
- name: Build Python
run: |
- cd $GITHUB_WORKSPACE
- cd thirdparty/cpython
- mkdir -p build/debug
- chmod +x configure
- cd build/debug
- ../../configure --with-pydebug --enable-shared
+ cd Dependencies/cpython
+ mkdir debug
+ cd debug
+ ../configure --with-pydebug --enable-shared
make
- name: Build DearPyGui
run: |
- cd $GITHUB_WORKSPACE
mkdir cmake-build-debug
cd cmake-build-debug
- cmake .. -DMV_TESTS_ONLY=True
+ cmake ..
cd ..
cmake --build cmake-build-debug --config Debug
diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml
index 12c507982..739759947 100644
--- a/.github/workflows/static-analysis.yml
+++ b/.github/workflows/static-analysis.yml
@@ -1,29 +1,16 @@
-name: Static Analysis
+name: static-analysis
on:
- push:
-
- branches:
- - master
- - development
- - development_*
-
- paths-ignore:
- - 'docs/**'
- - 'assets/**'
- - 'scripts/**'
-
- pull_request:
- workflow_dispatch:
+ push: {}
+ pull_request: {}
jobs:
PVS-Studio:
- runs-on: ubuntu-22.04
- if: ${{! contains(github.event.head_commit.message, '[individual]') || contains(github.event.head_commit.message, '[static analysis]')}}
+ runs-on: ubuntu-18.04
steps:
- - uses: actions/checkout@v4
- #with:
- # fetch-depth: 1
+ - uses: actions/checkout@v1
+ with:
+ fetch-depth: 1
- name: Retrieve submodules
run: git submodule update --init --recursive
@@ -48,11 +35,11 @@ jobs:
sudo apt-get update
sudo apt-get install libgl1-mesa-dev
sudo apt-get install xorg-dev
- cd thirdparty/cpython
- chmod +x configure
- mkdir -p build/debug
- cd build/debug
- ../../configure --with-pydebug --enable-shared
+ sudo apt-get install libfreetype6-dev
+ cd Dependencies/cpython
+ mkdir debug
+ cd debug
+ ../configure --with-pydebug --enable-shared
make
- name: PVS-Studio static analysis
@@ -69,12 +56,12 @@ jobs:
cmake .. -DCMAKE_EXPORT_COMPILE_COMMANDS=On
cd ..
pvs-studio-analyzer trace -- cmake --build cmake-build-debug --config Debug
- pvs-studio-analyzer analyze -e ./thirdparty -l pvs-studio.lic -o pvs-studio.log
- plog-converter -a 'GA:1,2;OP:1' -t html -o pvs-studio.html -w pvs-studio.log
+ pvs-studio-analyzer analyze -e ./Dependencies -e ./DearPyGui/vendor -e ./DearPyGui/src/core/AppItems/custom/mvTextEditor.cpp -l pvs-studio.lic -o pvs-studio.log
+ plog-converter -a 'GA:1,2;OP:1' -t fullhtml -o pvs-studio.html -w pvs-studio.log
- name: Archive code coverage results
if: ${{ always() }}
- uses: actions/upload-artifact@v4
+ uses: actions/upload-artifact@v2
with:
name: pvs-results
- path: /home/runner/work/DearPyGui/DearPyGui/pvs-studio.html
\ No newline at end of file
+ path: /home/runner/work/DearPyGui/DearPyGui/pvs-studio.html
diff --git a/.gitignore b/.gitignore
index 45385971a..7611eadd8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,21 +1,9 @@
.idea/
.vs/
-.vscode/
out/
cmake-build-debug/
cmake-build-release/
cmake-build-local/
-output/
+Output/
dist/
-.DS_Store
-__pycache__/
-lib_location.txt
-version_number.txt
-dearpygui.egg-info/
-build/
-# Ignore only subdirectories
-sandbox/*/
-src/CMakeFiles/
-thirdparty/CMakeFiles/
-thirdparty/Makefile
-thirdparty/cmake_install.cmake
+.DS_Store
\ No newline at end of file
diff --git a/.gitmodules b/.gitmodules
index 22c3527e4..eed104296 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,19 +1,22 @@
-[submodule "thirdparty/imgui"]
- path = thirdparty/imgui
+[submodule "Dependencies/imgui"]
+ path = Dependencies/imgui
url = https://github.com/ocornut/imgui
- branch = docking
-[submodule "thirdparty/implot"]
- path = thirdparty/implot
- url = https://github.com/epezent/implot
branch = master
-[submodule "thirdparty/cpython"]
- path = thirdparty/cpython
+[submodule "Dependencies/cpython"]
+ path = Dependencies/cpython
url = https://github.com/python/cpython
branch = master
-[submodule "thirdparty/glfw"]
- path = thirdparty/glfw
+[submodule "Dependencies/glfw"]
+ path = Dependencies/glfw
url = https://github.com/glfw/glfw
branch = master
-[submodule "thirdparty/freetype"]
- path = thirdparty/freetype
+[submodule "Dependencies/ImGuiFileDialog"]
+ path = Dependencies/ImGuiFileDialog
+ url = https://github.com/aiekick/ImGuiFileDialog
+ branch = master
+[submodule "Dependencies/spdlog"]
+ path = Dependencies/spdlog
+ url = https://github.com/gabime/spdlog
+[submodule "Dependencies/freetype"]
+ path = Dependencies/freetype
url = https://gitlab.freedesktop.org/freetype/freetype
diff --git a/.readthedocs.yaml b/.readthedocs.yaml
deleted file mode 100644
index 2ff93384f..000000000
--- a/.readthedocs.yaml
+++ /dev/null
@@ -1,23 +0,0 @@
-# Read the Docs configuration file
-# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
-
-# Required
-version: 2
-
-build:
- os: ubuntu-22.04
- tools:
- python: "3.8"
-
-# Build documentation in the docs/ directory with Sphinx
-sphinx:
- configuration: docs/source/conf.py
-
-# Optionally build your docs in additional formats such as PDF and ePub
-formats: all
-
-python:
- install:
- - requirements: docs/requirements.txt
- - method: pip
- path: .
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 33a54057b..989737966 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,40 +1,18 @@
-cmake_minimum_required (VERSION 3.16)
+cmake_minimum_required (VERSION 3.13)
-if(APPLE)
- # When using precompiled headers on macOS, we need to enable Objective-C
- # as a distinct language. This won't work on other platforms (will fail to
- # find the Obj-C compiler), hence the "if APPLE".
- project ("DearPyGui" LANGUAGES C CXX OBJC OBJCXX)
-else()
- project ("DearPyGui")
-endif()
-
-if(WIN32)
- add_definitions(-DIMGUI_USER_CONFIG="mvImGuiConfig_win32.h")
- add_definitions(-DMV_PLATFORM="windows")
-elseif(APPLE)
- add_definitions(-DIMGUI_USER_CONFIG="mvImGuiConfig_apple.h")
- add_definitions(-DMV_PLATFORM="apple")
-else() # Linux
- add_definitions(-DIMGUI_USER_CONFIG="mvImGuiConfig_linux.h")
- add_definitions(-DMV_PLATFORM="linux")
-endif()
-
-if(WIN32)
-else() # Linux
- add_definitions(-DCUSTOM_IMGUIFILEDIALOG_CONFIG="ImGuiFileDialogConfigUnix.h")
-endif()
+project ("DearPyGui")
# various settings
-add_definitions(
- -D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR
- -D_CRT_SECURE_NO_WARNINGS
- -D_USE_MATH_DEFINES)
-
-set(MV_PY_VERSION ${MV_PY_VERSION})
-set(MVDPG_VERSION ${MVDPG_VERSION})
-add_definitions(-DMV_DPG_MAJOR_VERSION=1)
-add_definitions(-DMV_DPG_MINOR_VERSION=0)
+set(GLFW_BUILD_DOCS OFF)
+add_definitions(-D_USE_MATH_DEFINES -DIMGUI_USER_CONFIG="mvImGuiConfig.h")
+
+# can be set to 36, 37, 38, 39, or 0
+# * 36 = Python 3.6
+# * 37 = Python 3.7
+# * 38 = Python 3.8
+# * 39 = Python 3.9
+# * 0 = Embedded Python
+set(MVPY_VERSION ${MVPY_VERSION})
if(MVDPG_VERSION)
add_definitions(-DMV_SANDBOX_VERSION="${MVDPG_VERSION}")
else()
@@ -44,35 +22,32 @@ endif()
# when set to "ON", the embedded version
# will be the only version build (no sandbox builds)
set(MVDIST_ONLY ${MVDIST_ONLY})
+
if(MVDIST_ONLY)
add_definitions(-DMVDIST_ONLY)
-else()
- add_definitions(-DMV_LOG)
endif()
-# runs python tests
-set(MV_TESTS_ONLY ${MV_TESTS_ONLY})
-if(MV_TESTS_ONLY)
- add_definitions(-DMV_TESTS_ONLY)
-endif()
-
-# Specifying MV_NO_USER_THREADS turns off some thread safety features (might give
-# you some perf gain, yeah, those 0.01%) and must only be used when no user threads
-# (threading.Thread) **ever** call DPG API. With MV_NO_USER_THREADS, it's only
-# allowed to call DPG from the main thread and from handlers/callbacks.
-# Also can be used to get back the behavior of old DPG versions that were thread
-# unsafe (for testing/debugging).
-set(MV_NO_USER_THREADS ${MV_NO_USER_THREADS})
-if(MV_NO_USER_THREADS)
- add_definitions(-DMV_NO_USER_THREADS)
+if(NOT MVDIST_ONLY)
+ add_subdirectory ("ImguiTesting")
+ add_definitions(-DMV_LOG)
endif()
-add_subdirectory("thirdparty")
+# version number of Dear PyGui, usually set
+# by AppVeyor
+set(MVDPG_VERSION ${MVDPG_VERSION})
# if this is not a distribution build
# build development environment
if(NOT MVDIST_ONLY)
- add_subdirectory ("sandbox")
+ add_subdirectory("Dependencies/spdlog")
+ add_subdirectory ("DearSandbox")
+endif()
+
+if(WIN32)
+ # do nothing
+else() # Apple and Linux
+ add_subdirectory ("Dependencies/glfw")
endif()
-add_subdirectory ("src")
+add_subdirectory("Dependencies/freetype")
+add_subdirectory ("DearPyGui")
diff --git a/CMakeSettings.json b/CMakeSettings.json
index fdf20f56f..1f2f0d758 100644
--- a/CMakeSettings.json
+++ b/CMakeSettings.json
@@ -2,14 +2,15 @@
"configurations": [
{
"name": "x64-Debug",
- "generator": "Ninja",
+ "generator": "Visual Studio 16 2019 Win64",
"configurationType": "Debug",
"inheritEnvironments": [ "msvc_x64_x64" ],
"buildRoot": "${projectDir}\\cmake-build-debug",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "",
- "ctestCommandArgs": ""
+ "ctestCommandArgs": "",
+ "variables": []
},
{
"name": "x64-Release",
@@ -20,7 +21,8 @@
"cmakeCommandArgs": "",
"buildCommandArgs": "",
"ctestCommandArgs": "",
- "inheritEnvironments": [ "msvc_x64_x64" ]
+ "inheritEnvironments": [ "msvc_x64_x64" ],
+ "variables": []
}
]
}
\ No newline at end of file
diff --git a/testing/.gitignore b/DearPyGui/.gitignore
similarity index 100%
rename from testing/.gitignore
rename to DearPyGui/.gitignore
diff --git a/DearPyGui/CMakeLists.txt b/DearPyGui/CMakeLists.txt
new file mode 100644
index 000000000..04c766447
--- /dev/null
+++ b/DearPyGui/CMakeLists.txt
@@ -0,0 +1,29 @@
+cmake_minimum_required (VERSION 3.13)
+
+include("cmake/dpg_sources.cmake")
+
+# For distribution
+if(MVDIST_ONLY)
+
+ add_library(core SHARED)
+
+ target_sources(core PRIVATE ${MARVEL_SOURCES})
+
+ target_compile_definitions(core
+
+ PRIVATE
+ $<$:MV_RELEASE>
+ )
+
+ if(WIN32)
+ include("cmake/windows_runner.cmake")
+ elseif(APPLE)
+ include("cmake/mac_runner.cmake")
+ else() # Linux
+ include("cmake/linux_runner.cmake")
+ endif()
+
+# For development
+else()
+ include("cmake/embedded.cmake")
+endif()
diff --git a/DearPyGui/cmake/dpg_sources.cmake b/DearPyGui/cmake/dpg_sources.cmake
new file mode 100644
index 000000000..2befdfc8b
--- /dev/null
+++ b/DearPyGui/cmake/dpg_sources.cmake
@@ -0,0 +1,198 @@
+
+set(MARVEL_SOURCES
+
+ "$<$:src/core/Modules/mvModule_Core.cpp>"
+ "$<$:src/core/Modules/mvModule_Core.cpp>"
+ "$<$:src/core/Modules/mvModule_Core.mm>"
+
+ "src/core/AppItems/composite/mvDebugWindow.cpp"
+ "src/core/AppItems/composite/mvDocWindow.cpp"
+
+ "src/core/PythonUtilities/mvPyObject.cpp"
+ "src/core/PythonUtilities/mvPythonTranslator.cpp"
+ "src/core/PythonUtilities/mvPythonParser.cpp"
+ "src/core/PythonUtilities/mvPythonExceptions.cpp"
+ "src/core/PythonUtilities/mvGlobalIntepreterLock.cpp"
+
+ "$<$:src/platform/Windows/mvWindowsViewport.cpp>"
+ "$<$:src/platform/Windows/mvUtilities.cpp>"
+
+ "$<$:src/platform/Apple/mvAppleViewport.mm>"
+ "$<$:src/platform/Apple/mvAppleUtilities.mm>"
+
+ "$<$:src/platform/Linux/mvUtilities.cpp>"
+ "$<$:src/platform/Linux/mvLinuxViewport.cpp>"
+
+ "src/core/mvEvents.cpp"
+ "src/core/mvApp.cpp"
+ "src/core/mvAppLog.cpp"
+ "src/core/mvInput.cpp"
+ "src/core/mvViewport.cpp"
+ "src/core/mvProfiler.cpp"
+ "src/core/mvLog.cpp"
+
+ "src/core/Theming/mvThemeManager.cpp"
+ "src/core/Theming/mvFontScope.cpp"
+ "src/core/Theming/mvFontManager.cpp"
+
+ "src/core/Registries/mvCallbackRegistry.cpp"
+ "src/core/Registries/mvTextureStorage.cpp"
+
+ "src/core/AppItems/mvAppItemState.cpp"
+ "src/core/AppItems/mvAppItem.cpp"
+ "src/core/AppItems/mvTypeBases.cpp"
+ "src/core/AppItems/mvItemRegistry.cpp"
+
+ "src/core/AppItems/basic/mvMenuItem.cpp"
+ "src/core/AppItems/basic/mvInputText.cpp"
+ "src/core/AppItems/basic/mvText.cpp"
+ "src/core/AppItems/basic/mvSliderSingle.cpp"
+ "src/core/AppItems/basic/mvSliderMulti.cpp"
+ "src/core/AppItems/basic/mvImage.cpp"
+ "src/core/AppItems/basic/mvImageButton.cpp"
+ "src/core/AppItems/basic/mvColorButton.cpp"
+ "src/core/AppItems/basic/mvColorEdit.cpp"
+ "src/core/AppItems/basic/mvColorPicker.cpp"
+ "src/core/AppItems/basic/mvRadioButton.cpp"
+ "src/core/AppItems/basic/mvListbox.cpp"
+ "src/core/AppItems/basic/mvCombo.cpp"
+ "src/core/AppItems/basic/mvCheckbox.cpp"
+ "src/core/AppItems/basic/mvButton.cpp"
+ "src/core/AppItems/basic/mvSelectable.cpp"
+ "src/core/AppItems/basic/mvTabButton.cpp"
+ "src/core/AppItems/basic/mvDragSingle.cpp"
+ "src/core/AppItems/basic/mvDragMulti.cpp"
+ "src/core/AppItems/basic/mvInputSingle.cpp"
+ "src/core/AppItems/basic/mvInputMulti.cpp"
+
+ "src/core/AppItems/misc/mvProgressBar.cpp"
+ "src/core/AppItems/misc/mvIndent.cpp"
+ "src/core/AppItems/misc/mvUnindent.cpp"
+ "src/core/AppItems/misc/mvSameLine.cpp"
+ "src/core/AppItems/misc/mvSeparator.cpp"
+ "src/core/AppItems/misc/mvDummy.cpp"
+ "src/core/AppItems/misc/mvSpacing.cpp"
+
+ "src/core/AppItems/containers/mvCollapsingHeader.cpp"
+ "src/core/AppItems/containers/mvGroup.cpp"
+ "src/core/AppItems/containers/mvChild.cpp"
+ "src/core/AppItems/containers/mvTooltip.cpp"
+ "src/core/AppItems/containers/mvTab.cpp"
+ "src/core/AppItems/containers/mvTabBar.cpp"
+ "src/core/AppItems/containers/mvMenu.cpp"
+ "src/core/AppItems/containers/mvMenuBar.cpp"
+ "src/core/AppItems/containers/mvTreeNode.cpp"
+ "src/core/AppItems/containers/mvWindowAppItem.cpp"
+ "src/core/AppItems/containers/mvPopup.cpp"
+
+ "src/core/AppItems/tables/mvTable.cpp"
+ "src/core/AppItems/tables/mvTableColumn.cpp"
+ "src/core/AppItems/tables/mvTableNextColumn.cpp"
+
+ "src/core/AppItems/custom/mvDatePicker.cpp"
+ "src/core/AppItems/custom/mvTimePicker.cpp"
+ "src/core/AppItems/custom/mvTextEditor.cpp"
+ "src/core/AppItems/custom/mvColorMapScale.cpp"
+
+ "src/core/AppItems/drawing/mvDrawing.cpp"
+ "src/core/AppItems/drawing/mvDrawLine.cpp"
+ "src/core/AppItems/drawing/mvDrawArrow.cpp"
+ "src/core/AppItems/drawing/mvDrawTriangle.cpp"
+ "src/core/AppItems/drawing/mvDrawCircle.cpp"
+ "src/core/AppItems/drawing/mvDrawBezierCurve.cpp"
+ "src/core/AppItems/drawing/mvDrawQuad.cpp"
+ "src/core/AppItems/drawing/mvDrawRect.cpp"
+ "src/core/AppItems/drawing/mvDrawText.cpp"
+ "src/core/AppItems/drawing/mvDrawPolygon.cpp"
+ "src/core/AppItems/drawing/mvDrawPolyline.cpp"
+ "src/core/AppItems/drawing/mvDrawImage.cpp"
+
+ "src/core/AppItems/composite/mvFileDialog.cpp"
+ "src/core/AppItems/composite/mvAboutWindow.cpp"
+ "src/core/AppItems/composite/mvDataGrid.cpp"
+ "src/core/AppItems/composite/mvLogger.cpp"
+ "src/core/AppItems/composite/mvStyleWindow.cpp"
+ "src/core/AppItems/composite/mvMetricsWindow.cpp"
+ "src/core/AppItems/composite/mvAboutWindow.cpp"
+
+ "src/core/AppItems/nodes/mvNodeEditor.cpp"
+ "src/core/AppItems/nodes/mvNode.cpp"
+ "src/core/AppItems/nodes/mvNodeAttribute.cpp"
+
+ "src/core/AppItems/plots/mvPlot.cpp"
+ "src/core/AppItems/plots/mvAreaSeries.cpp"
+ "src/core/AppItems/plots/mvDragPoint.cpp"
+ "src/core/AppItems/plots/mvDragLine.cpp"
+ "src/core/AppItems/plots/mvAnnotation.cpp"
+ "src/core/AppItems/plots/mvSimplePlot.cpp"
+ "src/core/AppItems/plots/mvLineSeries.cpp"
+ "src/core/AppItems/plots/mvScatterSeries.cpp"
+ "src/core/AppItems/plots/mvStemSeries.cpp"
+ "src/core/AppItems/plots/mvStairSeries.cpp"
+ "src/core/AppItems/plots/mvBarSeries.cpp"
+ "src/core/AppItems/plots/mvErrorSeries.cpp"
+ "src/core/AppItems/plots/mvInfiniteLineSeries.cpp"
+ "src/core/AppItems/plots/mvHeatSeries.cpp"
+ "src/core/AppItems/plots/mvImageSeries.cpp"
+ "src/core/AppItems/plots/mvPieSeries.cpp"
+ "src/core/AppItems/plots/mvShadeSeries.cpp"
+ "src/core/AppItems/plots/mvLabelSeries.cpp"
+ "src/core/AppItems/plots/mvCandleSeries.cpp"
+
+ # imnodes
+ "vendor/imnodes/imnodes.cpp"
+
+ # implot
+ "vendor/implot/implot.cpp"
+ "vendor/implot/implot_items.cpp"
+ "vendor/implot/implot_demo.cpp"
+
+ # ImGuiFileDialog
+ "../Dependencies/ImGuiFileDialog/ImGuiFileDialog/ImGuiFileDialog.cpp"
+
+ # imgui
+ "../Dependencies/imgui/misc/freetype/imgui_freetype.cpp"
+ "../Dependencies/imgui/misc/cpp/imgui_stdlib.cpp"
+ "../Dependencies/imgui/imgui.cpp"
+ "../Dependencies/imgui/imgui_demo.cpp"
+ "../Dependencies/imgui/imgui_draw.cpp"
+ "../Dependencies/imgui/imgui_widgets.cpp"
+ "../Dependencies/imgui/imgui_tables.cpp"
+ "$<$:../Dependencies/imgui/backends/imgui_impl_win32.cpp>"
+ "$<$:../Dependencies/imgui/backends/imgui_impl_dx11.cpp>"
+ "$<$:../Dependencies/imgui/backends/imgui_impl_metal.mm>"
+ "$<$:../Dependencies/imgui/backends/imgui_impl_glfw.cpp>"
+ "$<$:../Dependencies/imgui/examples/libs/gl3w/GL/gl3w.c>"
+ "$<$:../Dependencies/imgui/backends/imgui_impl_glfw.cpp>"
+ "$<$:../Dependencies/imgui/backends/imgui_impl_opengl3.cpp>"
+)
+
+set(MARVEL_INCLUDE_DIR
+
+ "vendor/implot"
+ "vendor/stb"
+ "vendor/imnodes"
+ "src/"
+ "src/core"
+ "src/core/Modules"
+ "src/core/AppItems"
+ "src/core/DrawCommands"
+ "src/core/CppUtilities"
+ "src/core/PythonUtilities"
+ "src/core/Registries"
+ "src/core/Theming"
+ "$<$:${CMAKE_SOURCE_DIR}/DearPyGui/vendor/dirent/>"
+ "../Dependencies/ImGuiFileDialog/ImGuiFileDialog/"
+ "../Dependencies/spdlog/include/"
+ "../Dependencies/glfw/include/"
+ "../Dependencies/glfw/deps/"
+ "../Dependencies/imgui/"
+ "../Dependencies/imgui/misc/freetype/"
+ "../Dependencies/imgui/backends/"
+ "../Dependencies/imgui/examples/libs/gl3w"
+ "../Dependencies/cpython/"
+ "../Dependencies/cpython/Include/"
+ "$<$:${CMAKE_SOURCE_DIR}/Dependencies/cpython/PC/>"
+ # may can delete this
+ "../Dependencies/cpython/debug/"
+)
diff --git a/src/embedded.cmake b/DearPyGui/cmake/embedded.cmake
similarity index 59%
rename from src/embedded.cmake
rename to DearPyGui/cmake/embedded.cmake
index 5614ecf91..ca00e1613 100644
--- a/src/embedded.cmake
+++ b/DearPyGui/cmake/embedded.cmake
@@ -1,14 +1,7 @@
-cmake_minimum_required (VERSION 3.16)
+cmake_minimum_required (VERSION 3.13)
add_library(coreemb STATIC)
-
-set_target_properties(coreemb
- PROPERTIES
- CXX_STANDARD 17
- ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}$<$:/cmake-build-release/>$<$:/cmake-build-debug/>DearPyGui/"
- LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}$<$:/cmake-build-release/>$<$:/cmake-build-debug/>DearPyGui/"
- RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}$<$:/cmake-build-release/>$<$:/cmake-build-debug/>DearPyGui/"
- )
+set_target_properties(coreemb PROPERTIES CXX_STANDARD 17)
target_include_directories(coreemb PRIVATE ${MARVEL_INCLUDE_DIR})
@@ -21,24 +14,19 @@ target_compile_definitions(coreemb
# Add sources
target_sources(coreemb PRIVATE ${MARVEL_SOURCES})
-if(WIN32)
- target_precompile_headers(coreemb
- PRIVATE mvPyUtils.h
- )
-endif()
-
###############################################################################
# Windows Specifics
###############################################################################
if(WIN32)
add_definitions(-DWIN32)
+ add_definitions(-DMV_PROFILE)
# tell cmake where to find the python3x dlls
- target_link_directories(coreemb PRIVATE "../thirdparty/cpython/PCbuild/amd64/")
+ target_link_directories(coreemb PRIVATE "../Dependencies/cpython/PCbuild/amd64/")
# Add libraries to link to
- target_link_libraries(coreemb PUBLIC d3d11 dxgi freetype dwmapi $<$:python39_d> $<$:python39>)
+ target_link_libraries(coreemb PUBLIC d3d11 freetype $<$:python39_d> $<$:python39>)
###############################################################################
# Apple Specifics
@@ -46,17 +34,19 @@ if(WIN32)
elseif(APPLE)
add_definitions(-DAPPLE)
+ add_definitions(-DUNIX)
# tell cmake where to find the python3x dlls
- target_link_directories(coreemb PRIVATE "../thirdparty/cpython/build/debug")
+ target_link_directories(coreemb PRIVATE "../Dependencies/cpython/debug")
- SET_PROPERTY(TARGET coreemb APPEND_STRING PROPERTY COMPILE_FLAGS "-fobjc-arc -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -arch x86_64")
+ SET_PROPERTY(TARGET coreemb APPEND_STRING PROPERTY COMPILE_FLAGS "-fobjc-arc -Wunused-function -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64")
target_link_libraries(coreemb
PUBLIC
glfw
+ freetype
"-framework Metal"
"-framework MetalKit"
"-framework Cocoa"
@@ -76,11 +66,11 @@ else() # Linux
add_definitions(-DIMGUI_IMPL_OPENGL_LOADER_GL3W)
# tell cmake where to find the python3x dlls
- target_link_directories(coreemb PRIVATE "../thirdparty/cpython/build/debug")
+ target_link_directories(coreemb PRIVATE "../Dependencies/cpython/debug")
- set_property(TARGET coreemb APPEND_STRING PROPERTY COMPILE_FLAGS "-fPIC -DNDEBUG -g -fwrapv -O3")
+ set_property(TARGET coreemb APPEND_STRING PROPERTY COMPILE_FLAGS "-fPIC -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall")
# Add libraries to link to
- target_link_libraries(coreemb PRIVATE "-lcrypt -lpthread -ldl -lutil -lm" GL glfw python3.9d)
+ target_link_libraries(coreemb PRIVATE "-lcrypt -lpthread -ldl -lutil -lm" GL glfw python3.9d freetype)
endif()
diff --git a/DearPyGui/cmake/linux_runner.cmake b/DearPyGui/cmake/linux_runner.cmake
new file mode 100644
index 000000000..2cdb12429
--- /dev/null
+++ b/DearPyGui/cmake/linux_runner.cmake
@@ -0,0 +1,132 @@
+
+add_definitions(-DLINUX)
+add_definitions(-DUNIX)
+set_target_properties(core PROPERTIES PREFIX "")
+set_target_properties(core PROPERTIES CXX_STANDARD 17)
+
+set_property(TARGET core APPEND_STRING PROPERTY COMPILE_FLAGS "-fPIC -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall")
+
+add_definitions(-DIMGUI_IMPL_OPENGL_LOADER_GL3W)
+
+if(MVPY_VERSION EQUAL 36)
+
+ target_include_directories(core
+ PRIVATE
+ ${MARVEL_INCLUDE_DIR}
+ "/home/appveyor/.localpython3.6.12"
+ "/home/appveyor/.localpython3.6.12/include/python3.6m"
+ )
+
+ target_link_directories(core
+ PRIVATE
+ "/usr/lib"
+ "/home/appveyor/.localpython3.6.12/lib"
+ )
+
+ target_link_libraries(core
+ PRIVATE
+ "-fPIC -lcrypt -lpthread -ldl -lutil -lm"
+ GL
+ freetype
+ glfw
+ python3.6m
+ )
+
+elseif(MVPY_VERSION EQUAL 37)
+
+ target_include_directories(core
+ PRIVATE
+ ${MARVEL_INCLUDE_DIR}
+ "/home/appveyor/.localpython3.7.9"
+ "/home/appveyor/.localpython3.7.9/include/python3.7m"
+ )
+
+ target_link_directories(core
+ PRIVATE
+ "/usr/lib"
+ "/home/appveyor/.localpython3.7.9/lib"
+ )
+
+ target_link_libraries(core
+ PRIVATE
+ "-fPIC -lcrypt -lpthread -ldl -lutil -lm"
+ GL
+ freetype
+ glfw
+ python3.7m
+ )
+
+elseif(MVPY_VERSION EQUAL 38)
+
+ target_include_directories(core
+ PRIVATE
+ ${MARVEL_INCLUDE_DIR}
+ "/home/appveyor/.localpython3.8.6"
+ "/home/appveyor/.localpython3.8.6/include/python3.8"
+ )
+
+ target_link_directories(core
+ PRIVATE
+ "/usr/lib"
+ "/home/appveyor/.localpython3.8.6/lib"
+ )
+
+ target_link_libraries(core
+ PRIVATE
+ "-fPIC -lcrypt -lpthread -ldl -lutil -lm"
+ GL
+ freetype
+ glfw
+ python3.8
+ )
+
+elseif(MVPY_VERSION EQUAL 39)
+
+ target_include_directories(core
+ PRIVATE
+ ${MARVEL_INCLUDE_DIR}
+ "/home/appveyor/.localpython3.9.1"
+ "/home/appveyor/.localpython3.9.1/include/python3.9"
+ )
+
+ target_link_directories(core
+ PRIVATE
+ "/usr/lib"
+ "/home/appveyor/.localpython3.9.1/lib"
+ )
+
+ target_link_libraries(core
+ PRIVATE
+ "-fPIC -lcrypt -lpthread -ldl -lutil -lm"
+ GL
+ glfw
+ freetype
+ python3.9
+ )
+
+elseif(MVPY_VERSION EQUAL 0)
+ find_package (Python COMPONENTS Development)
+ if(NOT Python_Development_FOUND)
+ message(FATAL_ERROR "The python3 development library from your distribution repo need to be installed first!")
+ endif()
+ target_include_directories(core
+ PRIVATE
+ ${MARVEL_INCLUDE_DIR}
+ ${Python_INCLUDE_DIRS}
+ )
+
+ target_link_directories(core
+ PRIVATE
+ "/usr/lib"
+ ${Python_LIBRARY_DIRS}
+ )
+
+ target_link_libraries(core
+ PRIVATE
+ "-fPIC -lcrypt -lpthread -ldl -lutil -lm"
+ GL
+ glfw
+ freetype
+ ${Python_LIBRARIES}
+ )
+endif()
\ No newline at end of file
diff --git a/DearPyGui/cmake/mac_runner.cmake b/DearPyGui/cmake/mac_runner.cmake
new file mode 100644
index 000000000..af21d7626
--- /dev/null
+++ b/DearPyGui/cmake/mac_runner.cmake
@@ -0,0 +1,88 @@
+
+add_definitions(-DAPPLE)
+add_definitions(-DUNIX)
+set_target_properties(core PROPERTIES SUFFIX ".so")
+set_target_properties(core PROPERTIES PREFIX "")
+set_target_properties(core PROPERTIES CXX_STANDARD 17)
+
+SET_PROPERTY(TARGET core APPEND_STRING PROPERTY COMPILE_FLAGS "-fobjc-arc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall")
+
+target_link_libraries(core
+
+ PRIVATE
+
+ glfw
+ freetype
+ "-undefined dynamic_lookup"
+ "-framework Metal"
+ "-framework MetalKit"
+ "-framework Cocoa"
+ "-framework CoreVideo"
+ "-framework IOKit"
+ "-framework QuartzCore"
+)
+
+if(MVPY_VERSION EQUAL 36)
+
+ target_include_directories(core
+ PRIVATE
+ ${MARVEL_INCLUDE_DIR}
+ "/Users/appveyor/.localpython3.6.12"
+ "/Users/appveyor/.localpython3.6.12/include/python3.6m"
+ )
+
+ target_link_directories(core
+ PRIVATE
+ "/Users/appveyor/.localpython3.6.12/lib"
+ )
+
+elseif(MVPY_VERSION EQUAL 37)
+
+ target_include_directories(core
+ PRIVATE
+ ${MARVEL_INCLUDE_DIR}
+ "/Users/appveyor/.localpython3.7.9"
+ "/Users/appveyor/.localpython3.7.9/include/python3.7m"
+ )
+
+ target_link_directories(core
+ PRIVATE
+ "/Users/appveyor/.localpython3.7.9/lib"
+ )
+
+elseif(MVPY_VERSION EQUAL 38)
+
+ target_include_directories(core
+ PRIVATE
+ ${MARVEL_INCLUDE_DIR}
+ "/Users/appveyor/.localpython3.8.6"
+ "/Users/appveyor/.localpython3.8.6/include/python3.8"
+ )
+
+ target_link_directories(core
+ PRIVATE
+ "/Users/appveyor/.localpython3.8.6/lib"
+ )
+
+elseif(MVPY_VERSION EQUAL 39)
+
+ target_include_directories(core
+ PRIVATE
+ ${MARVEL_INCLUDE_DIR}
+ "/Users/appveyor/.localpython3.9.1"
+ "/Users/appveyor/.localpython3.9.1/include/python3.9"
+ )
+
+ target_link_directories(core
+ PRIVATE
+ "/Users/appveyor/.localpython3.9.1/lib"
+ )
+
+elseif(MVPY_VERSION EQUAL 0)
+ target_link_directories(core PRIVATE ../Dependencies/cpython/debug)
+
+ target_include_directories(core
+ PRIVATE
+ ${MARVEL_INCLUDE_DIR}
+ )
+endif()
\ No newline at end of file
diff --git a/DearPyGui/cmake/windows_runner.cmake b/DearPyGui/cmake/windows_runner.cmake
new file mode 100644
index 000000000..b04f28c85
--- /dev/null
+++ b/DearPyGui/cmake/windows_runner.cmake
@@ -0,0 +1,85 @@
+
+add_definitions(-DWIN32)
+set_target_properties(core PROPERTIES SUFFIX ".pyd")
+set_target_properties(core PROPERTIES CXX_STANDARD 17)
+
+if(MVPY_VERSION EQUAL 36)
+
+ target_link_libraries(core PUBLIC d3d11 python36 freetype)
+
+ target_include_directories(core
+ PRIVATE
+ ${MARVEL_INCLUDE_DIR}
+ "C:/Python36-x64"
+ "C:/Python36-x64/include"
+ )
+
+ target_link_directories(core
+ PRIVATE
+ "C:/Python36-x64"
+ "C:/Python36-x64/libs"
+ "C:/Python36-x64/DLLs"
+ )
+
+elseif(MVPY_VERSION EQUAL 37)
+
+ target_link_libraries(core PUBLIC d3d11 python37 freetype)
+
+ target_include_directories(core
+ PRIVATE
+ ${MARVEL_INCLUDE_DIR}
+ "C:/Python37-x64"
+ "C:/Python37-x64/include"
+ )
+
+ target_link_directories(core
+ PRIVATE
+ "C:/Python37-x64"
+ "C:/Python37-x64/libs"
+ "C:/Python37-x64/DLLs"
+ )
+
+elseif(MVPY_VERSION EQUAL 38)
+ target_link_libraries(core PUBLIC d3d11 python38 freetype)
+
+ target_include_directories(core
+ PRIVATE
+ ${MARVEL_INCLUDE_DIR}
+ "C:/Python38-x64"
+ "C:/Python38-x64/include"
+ )
+
+ target_link_directories(core
+ PRIVATE
+ "C:/Python38-x64"
+ "C:/Python38-x64/libs"
+ "C:/Python38-x64/DLLs"
+ )
+
+elseif(MVPY_VERSION EQUAL 39)
+ target_link_libraries(core PUBLIC d3d11 python39 freetype)
+
+ target_include_directories(core
+ PRIVATE
+ ${MARVEL_INCLUDE_DIR}
+ "C:/Python39-x64"
+ "C:/Python39-x64/include"
+ )
+
+ target_link_directories(core
+ PRIVATE
+ "C:/Python39-x64"
+ "C:/Python39-x64/libs"
+ "C:/Python39-x64/DLLs"
+ )
+
+elseif(MVPY_VERSION EQUAL 0)
+ target_link_directories(core PRIVATE "../Dependencies/cpython/PCbuild/amd64/")
+ target_link_libraries(core PUBLIC d3d11 python39 freetype)
+
+ target_include_directories(core
+ PRIVATE
+ ${MARVEL_INCLUDE_DIR}
+ )
+
+endif()
\ No newline at end of file
diff --git a/DearPyGui/dearpygui/core.py b/DearPyGui/dearpygui/core.py
new file mode 100644
index 000000000..5d202400f
--- /dev/null
+++ b/DearPyGui/dearpygui/core.py
@@ -0,0 +1 @@
+from core import *
\ No newline at end of file
diff --git a/DearPyGui/dearpygui/core.pyi b/DearPyGui/dearpygui/core.pyi
new file mode 100644
index 000000000..4dfc68170
--- /dev/null
+++ b/DearPyGui/dearpygui/core.pyi
@@ -0,0 +1,912 @@
+from typing import List, Any, Callable
+from dearpygui.core import *
+
+##########################################################
+# This file is generated automatically by mvPythonParser #
+##########################################################
+
+# ~ Dear PyGui Version: master
+def add_about_window(name: str = ..., *, width: int = -1, height: int = -1, x_pos: int = 200, y_pos: int = 200, autosize: bool = False, no_resize: bool = False, no_title_bar: bool = False, no_move: bool = False, no_scrollbar: bool = False, no_collapse: bool = False, horizontal_scrollbar: bool = False, no_focus_on_appearing: bool = False, no_bring_to_front_on_focus: bool = False, no_close: bool = False, no_background: bool = False, label: str = '', show: bool = True) -> None:
+ """Creates an about window."""
+ ...
+
+def add_area_series(name: str = ..., *, x: List[float] = ..., y: List[float] = ..., fill: List[float] = (0, 0, 0, -1), label: str = '', source: str = '', parent: str = '', before: str = '', show: bool = True, axis: int = 0, contribute_to_bounds: bool = True) -> None:
+ """Adds a drag point to a plot."""
+ ...
+
+def add_bar_series(name: str = ..., *, x: List[float] = ..., y: List[float] = ..., weight: float = 1.0, horizontal: bool = False, label: str = '', source: str = '', parent: str = '', before: str = '', show: bool = True, axis: int = 0, contribute_to_bounds: bool = True) -> None:
+ """Adds a drag point to a plot."""
+ ...
+
+def add_button(name: str = ..., *, small: bool = False, arrow: bool = False, direction: int = 0, callback: Callable = None, callback_data: Any = None, parent: str = '', before: str = '', width: int = 0, height: int = 0, label: str = '', show: bool = True, enabled: bool = True) -> None:
+ """Adds a button."""
+ ...
+
+def add_candle_series(name: str = ..., *, dates: List[float] = ..., opens: List[float] = ..., closes: List[float] = ..., lows: List[float] = ..., highs: List[float] = ..., tooltip: bool = True, bull_color: List[float] = (0, 255, 113, 255), bear_color: List[float] = (218, 13, 79, 255), weight: float = 0.25, label: str = '', source: str = '', parent: str = '', before: str = '', show: bool = True, axis: int = 0, contribute_to_bounds: bool = True) -> None:
+ """Adds a drag point to a plot."""
+ ...
+
+def add_checkbox(name: str = ..., *, default_value: int = False, callback: Callable = None, callback_data: Any = None, parent: str = '', before: str = '', source: str = '', label: str = '', show: bool = True, enabled: bool = True) -> None:
+ """Adds a checkbox widget."""
+ ...
+
+def add_child(name: str = ..., *, show: bool = True, parent: str = '', before: str = '', width: int = 0, height: int = 0, border: bool = True, autosize_x: bool = False, autosize_y: bool = False, no_scrollbar: bool = False, horizontal_scrollbar: bool = False, menubar: bool = False) -> None:
+ """Adds an embedded child window. Will show scrollbars when items do not fit. Must be followed by a call to end."""
+ ...
+
+def add_collapsing_header(name: str = ..., *, label: str = '', show: bool = True, parent: str = '', before: str = '', closable: bool = False, default_open: bool = False, open_on_double_click: bool = False, open_on_arrow: bool = False, leaf: bool = False, bullet: bool = False) -> None:
+ """Adds a collapsing header to add items to. Must be closed with the end command."""
+ ...
+
+def add_color_button(name: str = ..., *, default_value: List[int] = (0, 0, 0, 255), callback: Callable = None, callback_data: Any = None, parent: str = '', before: str = '', width: int = 0, height: int = 0, show: bool = True, no_alpha: bool = False, no_border: bool = False, no_drag_drop: bool = False, enabled: bool = True) -> None:
+ """Adds a color button."""
+ ...
+
+def add_color_edit3(name: str = ..., *, default_value: List[int] = (0, 0, 0, 255), callback: Callable = None, callback_data: Any = None, parent: str = '', before: str = '', source: str = '', width: int = 0, height: int = 0, label: str = '', show: bool = True, enabled: bool = True, no_alpha: bool = False, no_picker: bool = False, no_options: bool = False, no_small_preview: bool = False, no_inputs: bool = False, no_tooltip: bool = False, no_label: bool = False, no_drag_drop: bool = False, alpha_bar: bool = False, alpha_preview: bool = False, alpha_preview_half: bool = False, display_rgb: bool = False, display_hsv: bool = False, display_hex: bool = False, uint8: bool = False, floats: bool = False, input_rgb: bool = False, input_hsv: bool = False) -> None:
+ """Adds an rgb color editing widget. Click and draging the color square will copy the color to be applied on any other color widget."""
+ ...
+
+def add_color_edit4(name: str = ..., *, default_value: List[int] = (0, 0, 0, 255), callback: Callable = None, callback_data: Any = None, parent: str = '', before: str = '', source: str = '', width: int = 0, height: int = 0, label: str = '', show: bool = True, enabled: bool = True, no_alpha: bool = False, no_picker: bool = False, no_options: bool = False, no_small_preview: bool = False, no_inputs: bool = False, no_tooltip: bool = False, no_label: bool = False, no_drag_drop: bool = False, alpha_bar: bool = False, alpha_preview: bool = False, alpha_preview_half: bool = False, display_rgb: bool = False, display_hsv: bool = False, display_hex: bool = False, uint8: bool = False, floats: bool = False, input_rgb: bool = False, input_hsv: bool = False) -> None:
+ """Adds an rgba color editing widget. Click and draging the color square will copy the color to be applied on any other color widget."""
+ ...
+
+def add_color_picker3(name: str = ..., *, default_value: List[int] = (0, 0, 0, 255), callback: Callable = None, callback_data: Any = None, parent: str = '', before: str = '', source: str = '', width: int = 0, height: int = 0, label: str = '', show: bool = True, enabled: bool = True, no_alpha: bool = False, no_small_preview: bool = False, no_inputs: bool = False, no_tooltip: bool = False, no_label: bool = False, no_side_preview: bool = False, alpha_bar: bool = False, alpha_preview: bool = False, alpha_preview_half: bool = False, display_rgb: bool = False, display_hsv: bool = False, display_hex: bool = False, uint8: bool = False, floats: bool = False, picker_hue_bar: bool = False, picker_hue_wheel: bool = False, input_rgb: bool = False, input_hsv: bool = False) -> None:
+ """Adds an rgb color picking widget. Click and draging the color square will copy the color to be applied on any other color widget. Right Click allows the style of the color picker to be changed."""
+ ...
+
+def add_color_picker4(name: str = ..., *, default_value: List[int] = (0, 0, 0, 255), callback: Callable = None, callback_data: Any = None, parent: str = '', before: str = '', source: str = '', width: int = 0, height: int = 0, label: str = '', show: bool = True, enabled: bool = True, no_alpha: bool = False, no_small_preview: bool = False, no_inputs: bool = False, no_tooltip: bool = False, no_label: bool = False, no_side_preview: bool = False, alpha_bar: bool = False, alpha_preview: bool = False, alpha_preview_half: bool = False, display_rgb: bool = False, display_hsv: bool = False, display_hex: bool = False, uint8: bool = False, floats: bool = False, picker_hue_bar: bool = False, picker_hue_wheel: bool = False, input_rgb: bool = False, input_hsv: bool = False) -> None:
+ """Adds an rgba color picking widget. Click and draging the color square will copy the color to be applied on any other color widget. Right Click allows the style of the color picker to be changed"""
+ ...
+
+def add_colormap_scale(name: str = ..., *, default_value: int = 0, min_scale: float = 0.0, max_scale: float = 1.0, parent: str = '', before: str = '', source: str = '', width: int = 0, height: int = 0, label: str = '', show: bool = True) -> None:
+ """Adds drag for a single int value. CTRL+Click to directly modify the value."""
+ ...
+
+def add_combo(name: str = ..., *, items: List[str] = (), default_value: str = '', callback: Callable = None, callback_data: Any = None, parent: str = '', before: str = '', source: str = '', enabled: bool = True, width: int = 0, label: str = '', show: bool = True, popup_align_left: bool = False, height_small: bool = False, height_regular: bool = False, height_large: bool = False, height_largest: bool = False, no_arrow_button: bool = False, no_preview: bool = False) -> None:
+ """Adds a combo."""
+ ...
+
+def add_data_grid(name: str = ..., *, headers: List[str] = ..., callback: Callable = None, callback_data: Any = None, parent: str = '', before: str = '', width: int = 0, height: int = 200, hide_headers: bool = False, show: bool = True) -> None:
+ """Adds data grid."""
+ ...
+
+def add_date_picker(name: str = ..., *, default_value: dict = {'month_day': 14, 'year':20, 'month':5}, level: int = 0, callback: Callable = None, callback_data: Any = None, parent: str = '', before: str = '', show: bool = True) -> None:
+ """Adds a data selector widget."""
+ ...
+
+def add_debug_window(name: str = ..., *, width: int = 700, height: int = 500, x_pos: int = 200, y_pos: int = 200, autosize: bool = False, no_resize: bool = False, no_title_bar: bool = False, no_move: bool = False, no_scrollbar: bool = False, no_collapse: bool = False, horizontal_scrollbar: bool = False, no_focus_on_appearing: bool = False, no_bring_to_front_on_focus: bool = False, no_close: bool = False, no_background: bool = False, label: str = '', show: bool = True) -> None:
+ """Creates a debug window."""
+ ...
+
+def add_doc_window(name: str = ..., *, width: int = -1, height: int = -1, x_pos: int = 200, y_pos: int = 200, autosize: bool = True, no_resize: bool = False, no_title_bar: bool = False, no_move: bool = False, no_scrollbar: bool = False, no_collapse: bool = False, horizontal_scrollbar: bool = False, no_focus_on_appearing: bool = False, no_bring_to_front_on_focus: bool = False, no_close: bool = False, no_background: bool = False, label: str = '', show: bool = True) -> None:
+ """Creates a documentation window."""
+ ...
+
+def add_drag_float(name: str = ..., *, default_value: float = 0.0, speed: float = 1.0, min_value: float = 0.0, max_value: float = 100.0, format: str = '%0.3f', callback: Callable = None, callback_data: Any = None, parent: str = '', before: str = '', source: str = '', enabled: bool = True, width: int = 0, no_input: bool = False, clamped: bool = False, label: str = '', show: bool = True) -> None:
+ """Adds drag for a single float value. CTRL+Click to directly modify the value."""
+ ...
+
+def add_drag_floatx(name: str = ..., *, default_value: List[float] = (0.0, 0.0, 0.0, 0.0), size: int = 4, speed: float = 1.0, min_value: float = 0.0, max_value: float = 100.0, format: str = '%0.3f', callback: Callable = None, callback_data: Any = None, parent: str = '', before: str = '', source: str = '', enabled: bool = True, width: int = 0, no_input: bool = False, clamped: bool = False, label: str = '', show: bool = True) -> None:
+ """Adds drag for multiple float values. CTRL+Click to directly modify the value."""
+ ...
+
+def add_drag_int(name: str = ..., *, default_value: int = 0, speed: float = 1.0, min_value: int = 0, max_value: int = 100, format: str = '%d', callback: Callable = None, callback_data: Any = None, parent: str = '', before: str = '', source: str = '', enabled: bool = True, width: int = 0, no_input: bool = False, clamped: bool = False, label: str = '', show: bool = True) -> None:
+ """Adds drag for a single int value. CTRL+Click to directly modify the value."""
+ ...
+
+def add_drag_intx(name: str = ..., *, default_value: List[float] = (0, 0, 0, 0), size: int = 4, speed: float = 1.0, min_value: int = 0, max_value: int = 100, format: str = '%0.3f', callback: Callable = None, callback_data: Any = None, parent: str = '', before: str = '', source: str = '', enabled: bool = True, width: int = 0, no_input: bool = False, clamped: bool = False, label: str = '', show: bool = True) -> None:
+ """Adds drag for multiple int values. CTRL+Click to directly modify the value."""
+ ...
+
+def add_drag_line(name: str = ..., *, default_value: List[float] = (0.0, 0.0, 0.0, 0.0), label: str = '', source: str = '', color: List[float] = (0, 0, 0, -1), thickness: float = 1.0, show_label: bool = True, vertical: bool = True, callback: Callable = None, parent: str = '', before: str = '', show: bool = True) -> None:
+ """Adds a drag point to a plot."""
+ ...
+
+def add_drag_point(name: str = ..., *, default_value: List[float] = (0.0, 0.0, 0.0, 0.0), label: str = '', source: str = '', color: List[float] = (0, 0, 0, -1), radius: float = 4.0, show_label: bool = True, callback: Callable = None, parent: str = '', before: str = '', show: bool = True) -> None:
+ """Adds a drag point to a plot."""
+ ...
+
+def add_drawing(name: str = ..., *, parent: str = '', before: str = '', width: int = 0, height: int = 0, show: bool = True) -> None:
+ """Adds a drawing widget."""
+ ...
+
+def add_dummy(name: str = 'dummy', *, width: int = 0, height: int = 0, parent: str = '', before: str = '', show: bool = True) -> None:
+ """Adds a spacer or 'dummy' object."""
+ ...
+
+def add_error_series(name: str = ..., *, x: List[float] = ..., y: List[float] = ..., negative: List[float] = ..., positive: List[float] = ..., horizontal: bool = False, label: str = '', source: str = '', parent: str = '', before: str = '', show: bool = True, axis: int = 0, contribute_to_bounds: bool = True) -> None:
+ """Adds a drag point to a plot."""
+ ...
+
+def add_font(font: str, file: str, size: float = 13.0, glyph_ranges: str = '', *, custom_glyph_chars: List[int] = (), custom_glyph_ranges: Any = List[List[int]], char_remaps: Any = List[List[int]]) -> None:
+ """Adds additional font."""
+ ...
+
+def add_grid_column(data_grid: str, name: str, column: List[str]) -> None:
+ """Adds a column to the end of a data grid."""
+ ...
+
+def add_grid_row(data_grid: str, row: List[str]) -> None:
+ """Adds a row to the end of a data grid."""
+ ...
+
+def add_group(name: str = ..., *, show: bool = True, parent: str = '', before: str = '', width: int = 0, horizontal: bool = False, horizontal_spacing: float = -1) -> None:
+ """Creates a group that other widgets can belong to. The group allows item commands to be issued for all of its members. Must be closed with the end command."""
+ ...
+
+def add_heat_series(name: str = ..., *, x: List[float] = ..., rows: int = 1, cols: int = 1, scale_min: float = 0.0, scale_max: float = 1.0, format: str = '%0.1f', bounds_min: List[float] = (0.0, 0.0), bounds_max: List[float] = (1.0, 1.0), label: str = '', source: str = '', parent: str = '', before: str = '', show: bool = True, contribute_to_bounds: bool = True) -> None:
+ """Adds a drag point to a plot."""
+ ...
+
+def add_hline_series(name: str = ..., *, x: List[float] = ..., label: str = '', source: str = '', parent: str = '', before: str = '', show: bool = True, axis: int = 0, contribute_to_bounds: bool = True) -> None:
+ """Adds a drag point to a plot."""
+ ...
+
+def add_image(name: str = ..., *, value: str = ..., tint_color: List[float] = (255, 255, 255, 255), border_color: List[float] = (0, 0, 0, 0), parent: str = '', before: str = '', source: str = '', width: int = 0, height: int = 0, uv_min: List[float] = (0.0, 0.0), uv_max: List[float] = (1.0, 1.0), show: bool = True) -> None:
+ """Adds an image.uv_min and uv_max represent the normalized texture coordinates of the original image that will be shown.Using(0,0)->(1,1) texture coordinates will generally display the entire texture"""
+ ...
+
+def add_image_button(name: str = ..., *, value: str = ..., callback: Callable = None, callback_data: Any = None, tint_color: List[float] = (255, 255, 255, 255), background_color: List[float] = (0, 0, 0, 0), parent: str = '', before: str = '', width: int = 0, height: int = 0, frame_padding: int = -1, uv_min: List[float] = (0.0, 0.0), uv_max: List[float] = (1.0, 1.0), show: bool = True, enabled: bool = True) -> None:
+ """Adds an image button.uv_min and uv_max represent the normalized texture coordinates of the original image that will be shown.Using(0,0)->(1,1) texture coordinates will generally display the entire texture"""
+ ...
+
+def add_image_series(name: str = ..., *, value: str = ..., bounds_min: List[float] = ..., bounds_max: List[float] = ..., uv_min: List[float] = (0.0, 0.0), uv_max: List[float] = (1.0, 1.0), tint_color: List[int] = (255, 255, 255, 255), label: str = '', parent: str = '', before: str = '', show: bool = True, contribute_to_bounds: bool = True) -> None:
+ """Adds a drag point to a plot."""
+ ...
+
+def add_indent(name: str = 'indent', *, offset: float = 0.0, parent: str = '', before: str = '', show: bool = True) -> None:
+ """Adds an indent to following items. Must be closed with the unindent command."""
+ ...
+
+def add_input_float(name: str = ..., *, default_value: float = 0.0, min_value: float = 0, max_value: float = 100, min_clamped: bool = False, max_clamped: bool = False, format: str = '%.3f', callback: Callable = None, callback_data: Any = None, parent: str = '', before: str = '', source: str = '', enabled: bool = True, width: int = 0, on_enter: bool = False, label: str = '', show: bool = True, step: float = 0.1, step_fast: float = 1.0, readonly: bool = False) -> None:
+ """Adds input for float values."""
+ ...
+
+def add_input_floatx(name: str = ..., *, default_value: List[float] = (0.0, 0.0, 0.0, 0.0), size: int = 4, min_value: float = 0, max_value: float = 100, min_clamped: bool = False, max_clamped: bool = False, format: str = '%.3f', callback: Callable = None, callback_data: Any = None, parent: str = '', before: str = '', source: str = '', enabled: bool = True, width: int = 0, on_enter: bool = False, label: str = '', show: bool = True, readonly: bool = False) -> None:
+ """Adds input for 4 float values."""
+ ...
+
+def add_input_int(name: str = ..., *, default_value: int = 0, min_value: int = 0, max_value: int = 100, min_clamped: bool = False, max_clamped: bool = False, callback: Callable = None, callback_data: Any = None, parent: str = '', before: str = '', source: str = '', enabled: bool = True, width: int = 0, on_enter: bool = False, label: str = '', show: bool = True, step: int = 1, step_fast: int = 100, readonly: bool = False) -> None:
+ """Adds input for integer values."""
+ ...
+
+def add_input_intx(name: str = ..., *, default_value: List[int] = (0, 0, 0, 0), size: int = 4, min_value: int = 0, max_value: int = 100, min_clamped: bool = False, max_clamped: bool = False, callback: Callable = None, callback_data: Any = None, parent: str = '', before: str = '', source: str = '', enabled: bool = True, width: int = 0, on_enter: bool = False, label: str = '', show: bool = True, readonly: bool = False) -> None:
+ """Adds input for 4 integer values."""
+ ...
+
+def add_input_text(name: str = ..., *, default_value: str = '', hint: str = '', multiline: bool = False, no_spaces: bool = False, uppercase: bool = False, tab_input: bool = False, decimal: bool = False, hexadecimal: bool = False, readonly: bool = False, password: bool = False, scientific: bool = False, callback: Callable = None, callback_data: Any = None, parent: str = '', before: str = '', source: str = '', enabled: bool = True, width: int = 0, height: int = 0, on_enter: bool = False, label: str = '', show: bool = True) -> None:
+ """Adds input for text values."""
+ ...
+
+def add_label_text(name: str = ..., *, default_value: str = '', color: List[float] = (-1, 0, 0, 0), parent: str = '', before: str = '', source: str = '', label: str = '', show: bool = True) -> None:
+ """Adds text with a label. Useful for output values."""
+ ...
+
+def add_line_series(name: str = ..., *, x: List[float] = ..., y: List[float] = ..., label: str = '', source: str = '', parent: str = '', before: str = '', show: bool = True, axis: int = 0, contribute_to_bounds: bool = True) -> None:
+ """Adds a drag point to a plot."""
+ ...
+
+def add_listbox(name: str = ..., *, items: List[str] = (), default_value: int = 0, callback: Callable = None, callback_data: Any = None, parent: str = '', before: str = '', source: str = '', enabled: bool = True, width: int = 0, num_items: int = 3, label: str = '', show: bool = True) -> None:
+ """Adds a listbox."""
+ ...
+
+def add_logger(name: str = ..., *, log_level: int = 1, auto_scroll: bool = True, auto_scroll_button: bool = True, clear_button: bool = True, copy_button: bool = True, filter: bool = True, width: int = 0, height: int = 0, parent: str = '', before: str = '', show: bool = True, autosize_x: bool = False, autosize_y: bool = False) -> None:
+ """Adds a logging widget."""
+ ...
+
+def add_menu(name: str = ..., *, label: str = '', show: bool = True, parent: str = '', before: str = '', enabled: bool = True) -> None:
+ """Adds a menu to an existing menu bar. Must be followed by a call to end."""
+ ...
+
+def add_menu_bar(name: str = ..., *, show: bool = True, parent: str = '', before: str = '') -> None:
+ """Adds a menu bar to a window. Must be followed by a call to end."""
+ ...
+
+def add_menu_item(name: str = ..., *, default_value: int = False, shortcut: str = '', check: bool = False, callback: Callable = None, callback_data: Any = None, source: str = '', label: str = '', show: bool = True, enabled: bool = True, parent: str = '', before: str = '') -> None:
+ """Adds a menu item to an existing menu."""
+ ...
+
+def add_metrics_window(name: str = ..., *, width: int = 700, height: int = 500, x_pos: int = 200, y_pos: int = 200, autosize: bool = False, no_resize: bool = False, no_title_bar: bool = False, no_move: bool = False, no_scrollbar: bool = False, no_collapse: bool = False, horizontal_scrollbar: bool = False, no_focus_on_appearing: bool = False, no_bring_to_front_on_focus: bool = False, no_close: bool = False, no_background: bool = False, label: str = '', show: bool = True) -> None:
+ """Creates a metrics window."""
+ ...
+
+def add_node(name: str = ..., *, show: bool = True, label: str = '', draggable: bool = True, parent: str = '', before: str = '', x_pos: int = 100, y_pos: int = 100) -> None:
+ """Adds a node to a node editor."""
+ ...
+
+def add_node_attribute(name: str = ..., *, shape: int = 1, output: bool = False, static: bool = False, show: bool = True, parent: str = '', before: str = '') -> None:
+ """Adds a node attribute."""
+ ...
+
+def add_node_editor(name: str = ..., *, show: bool = True, parent: str = '', before: str = '', link_callback: Callable = None, delink_callback: Callable = None) -> None:
+ """Adds a node editor."""
+ ...
+
+def add_node_link(node_editor: str, node_1: str, node_2: str) -> None:
+ """Adds a node link between nodes."""
+ ...
+
+def add_pie_series(name: str = ..., *, values: List[float] = ..., labels: List[str] = ..., x: float = ..., y: float = ..., radius: float = ..., normalize: bool = False, angle: float = 90.0, format: str = '%0.2f', label: str = '', parent: str = '', before: str = '', show: bool = True, axis: int = 0) -> None:
+ """Adds a drag point to a plot."""
+ ...
+
+def add_plot_annotation(name: str = ..., *, default_value: List[float] = (0.0, 0.0), offset: List[float] = (0.0, 0.0), label: str = '', source: str = '', color: List[float] = (0, 0, 0, -1), clamped: bool = True, parent: str = '', before: str = '', show: bool = True) -> None:
+ """Adds a drag point to a plot."""
+ ...
+
+def add_plot_stack(name: str = ..., *, x_axis_name: str = '', y_axis_name: str = '', no_legend: bool = False, no_menus: bool = False, no_box_select: bool = False, no_mouse_pos: bool = False, no_highlight: bool = False, no_child: bool = False, query: bool = False, crosshairs: bool = False, anti_aliased: bool = False, equal_aspects: bool = False, yaxis2: bool = False, yaxis3: bool = False, xaxis_no_gridlines: bool = False, xaxis_no_tick_marks: bool = False, xaxis_no_tick_labels: bool = False, xaxis_log_scale: bool = False, xaxis_time: bool = False, xaxis_invert: bool = False, xaxis_lock_min: bool = False, xaxis_lock_max: bool = False, yaxis_no_gridlines: bool = False, yaxis_no_tick_marks: bool = False, yaxis_no_tick_labels: bool = False, yaxis_log_scale: bool = False, yaxis_invert: bool = False, yaxis_lock_min: bool = False, yaxis_lock_max: bool = False, y2axis_no_gridlines: bool = False, y2axis_no_tick_marks: bool = False, y2axis_no_tick_labels: bool = False, y2axis_log_scale: bool = False, y2axis_invert: bool = False, y2axis_lock_min: bool = False, y2axis_lock_max: bool = False, y3axis_no_gridlines: bool = False, y3axis_no_tick_marks: bool = False, y3axis_no_tick_labels: bool = False, y3axis_log_scale: bool = False, y3axis_invert: bool = False, y3axis_lock_min: bool = False, y3axis_lock_max: bool = False, parent: str = '', before: str = '', width: int = -1, height: int = -1, query_callback: Callable = None, label: str = '', show: bool = True) -> None:
+ """Adds a plot widget."""
+ ...
+
+def add_popup(name: str = ..., *, mousebutton: int = 1, modal: bool = False, parent: str = '', before: str = '', width: int = 0, height: int = 0, show: bool = True) -> None:
+ """Adds a popup window for an item. This command must come immediately after the item the popup is for. Must be followed by a call to end."""
+ ...
+
+def add_progress_bar(name: str = ..., *, default_value: float = 0.0, overlay: str = '', parent: str = '', before: str = '', source: str = '', label: str = '', width: int = 0, height: int = 0, show: bool = True) -> None:
+ """Adds a progress bar."""
+ ...
+
+def add_radio_button(name: str = ..., *, items: List[str] = (), default_value: int = 0, callback: Callable = None, callback_data: Any = None, parent: str = '', before: str = '', source: str = '', enabled: bool = True, horizontal: bool = False, show: bool = True) -> None:
+ """Adds a set of radio buttons. If items is empty, nothing will be shown."""
+ ...
+
+def add_same_line(name: str = 'sameline', *, xoffset: float = 0.0, spacing: float = -1.0, parent: str = '', before: str = '', show: bool = True) -> None:
+ """Places a widget on the same line as the previous widget. Can also be used for horizontal spacing."""
+ ...
+
+def add_scatter_series(name: str = ..., *, x: List[float] = ..., y: List[float] = ..., label: str = '', source: str = '', parent: str = '', before: str = '', show: bool = True, axis: int = 0, contribute_to_bounds: bool = True) -> None:
+ """Adds a drag point to a plot."""
+ ...
+
+def add_selectable(name: str = ..., *, default_value: bool = False, callback: Callable = None, callback_data: Any = None, width: int = 0, height: int = 0, parent: str = '', before: str = '', source: str = '', enabled: bool = True, label: str = '', show: bool = True, span_columns: bool = False) -> None:
+ """Adds a selectable."""
+ ...
+
+def add_separator(name: str = 'separator', *, parent: str = '', before: str = '') -> None:
+ """Adds a horizontal line."""
+ ...
+
+def add_shade_series(name: str = ..., *, x: List[float] = ..., y1: List[float] = ..., y2: List[float] = ..., label: str = '', source: str = '', parent: str = '', before: str = '', show: bool = True, axis: int = 0, contribute_to_bounds: bool = True) -> None:
+ """Adds a drag point to a plot."""
+ ...
+
+def add_simple_plot(name: str = ..., *, value: List[float] = (), overlay: str = '', minscale: float = 0.0, maxscale: float = 0.0, histogram: bool = False, parent: str = '', before: str = '', width: int = 0, height: int = 0, source: str = '', label: str = '', show: bool = True) -> None:
+ """A simple plot for visualization of a set of values"""
+ ...
+
+def add_slider_float(name: str = ..., *, default_value: float = 0.0, min_value: float = 0.0, max_value: float = 100.0, format: str = '%.3f', vertical: bool = False, callback: Callable = None, callback_data: Any = None, parent: str = '', before: str = '', source: str = '', enabled: bool = True, width: int = 0, height: int = 0, no_input: bool = False, clamped: bool = False, label: str = '', show: bool = True) -> None:
+ """Adds slider for a single float value. CTRL+Click to directly modify the value."""
+ ...
+
+def add_slider_floatx(name: str = ..., *, default_value: List[float] = (0.0, 0.0, 0.0, 0.0), size: int = 4, min_value: float = 0.0, max_value: float = 100.0, format: str = '%.3f', callback: Callable = None, callback_data: Any = None, parent: str = '', before: str = '', source: str = '', enabled: bool = True, width: int = 0, no_input: bool = False, clamped: bool = False, label: str = '', show: bool = True) -> None:
+ """Adds slider for a 4 float values. CTRL+Click to directly modify the value."""
+ ...
+
+def add_slider_int(name: str = ..., *, default_value: int = 0, min_value: int = 0, max_value: int = 100, format: str = '%d', vertical: bool = False, callback: Callable = None, callback_data: Any = None, parent: str = '', before: str = '', source: str = '', enabled: bool = True, width: int = 0, height: int = 0, no_input: bool = False, clamped: bool = False, label: str = '', show: bool = True) -> None:
+ """Adds slider for a single int value. CTRL+Click to directly modify the value."""
+ ...
+
+def add_slider_intx(name: str = ..., *, default_value: List[int] = (0, 0, 0, 0), size: int = 4, min_value: int = 0, max_value: int = 100, format: str = '%d', callback: Callable = None, callback_data: Any = None, parent: str = '', before: str = '', source: str = '', enabled: bool = True, width: int = 0, no_input: bool = False, clamped: bool = False, label: str = '', show: bool = True) -> None:
+ """Adds slider for a 4 int values. CTRL+Click to directly modify the value."""
+ ...
+
+def add_spacing(name: str = 'spacing', *, count: int = 1, parent: str = '', before: str = '', show: bool = True) -> None:
+ """Adds vertical spacing."""
+ ...
+
+def add_stair_series(name: str = ..., *, x: List[float] = ..., y: List[float] = ..., label: str = '', source: str = '', parent: str = '', before: str = '', show: bool = True, axis: int = 0, contribute_to_bounds: bool = True) -> None:
+ """Adds a drag point to a plot."""
+ ...
+
+def add_stem_series(name: str = ..., *, x: List[float] = ..., y: List[float] = ..., label: str = '', source: str = '', parent: str = '', before: str = '', show: bool = True, axis: int = 0, contribute_to_bounds: bool = True) -> None:
+ """Adds a drag point to a plot."""
+ ...
+
+def add_style_window(name: str = ..., *, width: int = 700, height: int = 500, x_pos: int = 200, y_pos: int = 200, autosize: bool = False, no_resize: bool = False, no_title_bar: bool = False, no_move: bool = False, no_scrollbar: bool = False, no_collapse: bool = False, horizontal_scrollbar: bool = False, no_focus_on_appearing: bool = False, no_bring_to_front_on_focus: bool = False, no_close: bool = False, no_background: bool = False, label: str = '', show: bool = True) -> None:
+ """Creates a style window."""
+ ...
+
+def add_tab(name: str = ..., *, closable: bool = False, label: str = '', show: bool = True, no_reorder: bool = False, leading: bool = False, trailing: bool = False, no_tooltip: bool = False, parent: str = '', before: str = '') -> None:
+ """Adds a tab to a tab bar. Must be closed with the end command."""
+ ...
+
+def add_tab_bar(name: str = ..., *, reorderable: bool = False, callback: Callable = None, callback_data: Any = None, show: bool = True, parent: str = '', before: str = '') -> None:
+ """Adds a tab bar."""
+ ...
+
+def add_tab_button(name: str = ..., *, label: str = '', show: bool = True, no_reorder: bool = False, leading: bool = False, trailing: bool = False, no_tooltip: bool = False, callback: Callable = None, callback_data: Any = None, parent: str = '', before: str = '') -> None:
+ """Adds a tab button to a tab bar"""
+ ...
+
+def add_table(name: str = ..., *, header_row: bool = True, width: int = 0, height: int = 0, inner_width: int = 0, show: bool = True, parent: str = '', before: str = '', resizable: bool = False, reorderable: bool = False, hideable: bool = False, sortable: bool = False, context_menu_in_body: bool = False, row_background: bool = False, borders_innerH: bool = False, borders_outerH: bool = False, borders_innerV: bool = False, borders_outerV: bool = False, policy: int = 0, no_host_extendX: bool = False, no_host_extendY: bool = False, no_keep_columns_visible: bool = False, precise_widths: bool = False, no_clip: bool = False, pad_outerX: bool = False, no_pad_outerX: bool = False, no_pad_innerX: bool = False, scrollX: bool = False, scrollY: bool = False) -> None:
+ """Adds managed columns."""
+ ...
+
+def add_table_column(name: str = ..., *, init_width_or_weight: float = 0.0, show: bool = True, parent: str = '', before: str = '', default_hide: bool = False, default_sort: bool = False, width_stretch: bool = False, width_fixed: bool = False, no_resize: bool = False, no_reorder: bool = False, no_hide: bool = False, no_clip: bool = False, no_sort: bool = False, no_sort_ascending: bool = False, no_sort_descending: bool = False, no_header_width: bool = False, prefer_sort_ascending: bool = False, prefer_sort_descending: bool = False, indent_enable: bool = False, indent_disable: bool = False) -> None:
+ """Changes to next column."""
+ ...
+
+def add_table_next_column(name: str = 'next_column', *, show: bool = True, parent: str = '', before: str = '') -> None:
+ """Changes to next column."""
+ ...
+
+def add_text(name: str = ..., *, wrap: int = -1, color: List[float] = (-1, 0, 0, 0), bullet: bool = False, parent: str = '', before: str = '', source: str = '', default_value: str = '', show: bool = True) -> None:
+ """Adds text"""
+ ...
+
+def add_text_point(name: str = ..., *, x: float = ..., y: float = ..., vertical: bool = False, x_offset: int = 0.0, y_offset: int = 0.0, label: str = '', source: str = '', parent: str = '', before: str = '', show: bool = True, axis: int = 0, contribute_to_bounds: bool = True) -> None:
+ """Adds a drag point to a plot."""
+ ...
+
+def add_texture(name: str, data: List[int], width: int, height: int, *, format: int = 0) -> None:
+ """Adds a texture. Incorrect format may yield unexpected results."""
+ ...
+
+def add_time_picker(name: str = ..., *, default_value: dict = {'hour': 14, 'min': 32, 'sec': 23}, hour24: bool = False, callback: Callable = None, callback_data: Any = None, parent: str = '', before: str = '', show: bool = True) -> None:
+ """Adds a time selector widget."""
+ ...
+
+def add_tooltip(name: str = ..., *, parent: str = ..., before: str = '', show: bool = True) -> None:
+ """Adds an advanced tool tip for an item. This command must come immediately after the item the tip is for."""
+ ...
+
+def add_tree_node(name: str = ..., *, label: str = '', show: bool = True, parent: str = '', before: str = '', default_open: bool = False, open_on_double_click: bool = False, open_on_arrow: bool = False, leaf: bool = False, bullet: bool = False) -> None:
+ """Adds a tree node to add items to. Must be closed with the end command."""
+ ...
+
+def add_vline_series(name: str = ..., *, x: List[float] = ..., label: str = '', source: str = '', parent: str = '', before: str = '', show: bool = True, axis: int = 0, contribute_to_bounds: bool = True) -> None:
+ """Adds a drag point to a plot."""
+ ...
+
+def add_window(name: str = ..., *, width: int = -1, height: int = -1, x_pos: int = 200, y_pos: int = 200, autosize: bool = False, no_resize: bool = False, no_title_bar: bool = False, no_move: bool = False, no_scrollbar: bool = False, no_collapse: bool = False, horizontal_scrollbar: bool = False, no_focus_on_appearing: bool = False, no_bring_to_front_on_focus: bool = False, menubar: bool = False, no_close: bool = False, no_background: bool = False, label: str = '', show: bool = True, collapsed: bool = False, on_close: Callable = None, min_size: List[int] = [32, 32], max_size: List[int] = [30000, 30000]) -> None:
+ """Creates a new window for following items to be added to."""
+ ...
+
+def cleanup_dearpygui() -> None:
+ """Cleans up DearPyGui after calling setup_dearpygui."""
+ ...
+
+def clear_data_grid(data_grid: str) -> None:
+ """Clears data in a data grid"""
+ ...
+
+def clear_log(*, logger: str = '') -> None:
+ """Clears the logger."""
+ ...
+
+def clear_selected_links(node_editor: str) -> None:
+ """Clears selected links."""
+ ...
+
+def clear_selected_nodes(node_editor: str) -> None:
+ """Clears selected nodes."""
+ ...
+
+def close_popup(item: str) -> None:
+ """Closes a popup."""
+ ...
+
+def configure_item(item: str, **Kwargs) -> None:
+ """Configures an item"""
+ ...
+
+def configure_viewport(**Kwargs) -> None:
+ """Shows viewport"""
+ ...
+
+def create_viewport(*, title: str = ..., width: int = ..., height: int = ..., x_pos: int = ..., y_pos: int = ..., resizable: bool = ..., vsync: bool = ..., always_on_top: bool = ..., maximized_box: bool = ..., minimized_box: bool = ..., border: bool = ..., caption: bool = ..., overlapped: bool = ..., min_width: int = ..., max_width: int = ..., min_height: int = ..., max_height: int = ...) -> None:
+ """Creates a viewport"""
+ ...
+
+def decrement_texture(name: str) -> None:
+ """Decrements a texture."""
+ ...
+
+def delete_grid_column(data_grid: str, column: int) -> None:
+ """Delete a column in a data grid."""
+ ...
+
+def delete_grid_row(data_grid: str, row: int) -> None:
+ """Delete a row in a data grid."""
+ ...
+
+def delete_item(item: str, *, children_only: bool = False) -> None:
+ """Deletes an item if it exists."""
+ ...
+
+def delete_node_link(node_editor: str, node_1: str, node_2: str) -> None:
+ """Deletes a node link if it exist."""
+ ...
+
+def does_item_exist(item: str) -> bool:
+ """Checks if item exists."""
+ ...
+
+def draw_arrow(name: str = '', *, p1: List[float] = ..., p2: List[float] = ..., color: List[int] = ..., thickness: int = ..., size: int = ..., parent: str = '', before: str = '', show: bool = True) -> None:
+ """Draws an arrow on a drawing."""
+ ...
+
+def draw_bezier_curve(name: str = '', *, p1: List[float] = ..., p2: List[float] = ..., p3: List[float] = ..., p4: List[float] = ..., color: List[int] = ..., thickness: float = 1.0, segments: int = 0, parent: str = '', before: str = '', show: bool = True) -> None:
+ """Draws a bezier curve on a drawing."""
+ ...
+
+def draw_circle(name: str = '', *, center: List[float] = ..., radius: float = ..., color: List[int] = ..., segments: int = 0, thickness: float = 1.0, fill: List[float] = (0, 0, 0, -1), parent: str = '', before: str = '', show: bool = True) -> None:
+ """Draws a circle on a drawing."""
+ ...
+
+def draw_image(name: str = '', *, file: str = ..., pmin: List[float] = ..., pmax: List[float] = ..., uv_min: List[float] = (0.0, 0.0), uv_max: List[float] = (1.0, 1.0), color: List[int] = (255, 255, 255, 255), parent: str = '', before: str = '', show: bool = True) -> None:
+ """Draws an image on a drawing. p_min (bottom-left) and p_max (upper-right) represent corners of the rectangle the image will be drawn to.Setting the p_min equal to the p_max will sraw the image to with 1:1 scale.uv_min and uv_max represent the normalized texture coordinates of the original image that will be shown. Using (0,0)->(1,1) texturecoordinates will generally display the entire texture."""
+ ...
+
+def draw_line(name: str = '', *, p1: List[float] = ..., p2: List[float] = ..., color: List[int] = ..., thickness: int = ..., parent: str = '', before: str = '', show: bool = True) -> None:
+ """Draws a line on a drawing."""
+ ...
+
+def draw_polygon(name: str = '', *, points: List[List[float]] = ..., color: List[int] = ..., fill: List[float] = (0, 0, 0, -1), thickness: float = 1.0, parent: str = '', before: str = '', show: bool = True) -> None:
+ """Draws a polygon on a drawing."""
+ ...
+
+def draw_polyline(name: str = '', *, points: List[List[float]] = ..., color: List[int] = ..., closed: bool = False, thickness: float = 1.0, parent: str = '', before: str = '', show: bool = True) -> None:
+ """Draws lines on a drawing."""
+ ...
+
+def draw_quad(name: str = '', *, p1: List[float] = ..., p2: List[float] = ..., p3: List[float] = ..., p4: List[float] = ..., color: List[int] = ..., fill: List[float] = (0, 0, 0, -1), thickness: float = 1.0, parent: str = '', before: str = '', show: bool = True) -> None:
+ """Draws a quad on a drawing."""
+ ...
+
+def draw_rectangle(name: str = '', *, pmin: List[float] = ..., pmax: List[float] = ..., color: List[int] = ..., fill: List[float] = (0, 0, 0, -1), rounding: float = 0.0, thickness: float = 1.0, parent: str = '', before: str = '', show: bool = True) -> None:
+ """Draws a line on a drawing."""
+ ...
+
+def draw_text(name: str = '', *, pos: List[float] = ..., text: str = ..., color: List[int] = (0, 0, 0, -1), size: int = 10, parent: str = '', before: str = '', show: bool = True) -> None:
+ """Draws text on a drawing."""
+ ...
+
+def draw_triangle(name: str = '', *, p1: List[float] = ..., p2: List[float] = ..., p3: List[float] = ..., color: List[int] = ..., fill: List[float] = (0, 0, 0, -1), thickness: float = 1.0, parent: str = '', before: str = '', show: bool = True) -> None:
+ """Draws a triangle on a drawing."""
+ ...
+
+def enable_docking(*, shift_only: bool = True, dock_space: bool = False) -> None:
+ """Decrements a texture."""
+ ...
+
+def end() -> None:
+ """Ends a container."""
+ ...
+
+def get_active_window() -> str:
+ """Returns the active window name."""
+ ...
+
+def get_all_items() -> List[str]:
+ """Returns a list of all items."""
+ ...
+
+def get_dearpygui_version() -> str:
+ """Returns the current version of Dear PyGui."""
+ ...
+
+def get_delta_time() -> float:
+ """Returns time since last frame."""
+ ...
+
+def get_drawing_mouse_pos() -> (int, int):
+ """Returns the current mouse position in the currently hovered drawing."""
+ ...
+
+def get_global_font_scale() -> float:
+ """Returns the global font scale."""
+ ...
+
+def get_grid_data(data_grid: str) -> List[List[str]]:
+ """Gets data grid data."""
+ ...
+
+def get_grid_item(data_grid: str, row: int, column: int) -> str:
+ """Gets a data grid's cell value."""
+ ...
+
+def get_grid_selections(data_grid: str) -> List[List[int]]:
+ """Retrieves data from storage."""
+ ...
+
+def get_item_callback(item: str) -> Callable:
+ """Returns an item' callback"""
+ ...
+
+def get_item_callback_data(item: str) -> Any:
+ """Returns an item' callback data"""
+ ...
+
+def get_item_children[1](item: str) -> List[str]:
+ """Returns a list of an item's children."""
+ ...
+
+def get_item_configuration(item: str) -> dict:
+ """Returns an items configuration"""
+ ...
+
+def get_item_parent(item: str) -> str:
+ """Returns an item's parent."""
+ ...
+
+def get_item_rect_max(item: str) -> [float, float]:
+ """Returns an item's maximum allowable size. [width, height]"""
+ ...
+
+def get_item_rect_min(item: str) -> [float, float]:
+ """Returns an item's minimum allowable size. [width, height]"""
+ ...
+
+def get_item_rect_size(item: str) -> [float, float]:
+ """Returns an item's current size. [width, height]"""
+ ...
+
+def get_item_type(item: str) -> str:
+ """Returns an item's type"""
+ ...
+
+def get_links(node_editor: str) -> List[List[str]]:
+ """Returns all links. """
+ ...
+
+def get_log_level(*, logger: str = '') -> int:
+ """Returns the log level."""
+ ...
+
+def get_mouse_drag_delta() -> (float, float):
+ """Returns the current mouse drag delta in pixels"""
+ ...
+
+def get_mouse_pos(*, local: bool = True) -> (int, int):
+ """Returns the current mouse position in relation to the active window (minus titlebar) unless local flag is unset."""
+ ...
+
+def get_plot_mouse_pos() -> (int, int):
+ """Returns the current mouse position in the currently hovered plot."""
+ ...
+
+def get_plot_query_area(plot: str) -> List[float]:
+ """Returns the bounding axis limits for the query area [x_min, x_max, y_min, y_max]"""
+ ...
+
+def get_plot_xlimits(plot: str) -> List[float]:
+ """Returns the plots x limits"""
+ ...
+
+def get_plot_ylimits(plot: str) -> List[float]:
+ """Returns the plots x limits"""
+ ...
+
+def get_selected_links(node_editor: str) -> List[List[str]]:
+ """Returns selected links."""
+ ...
+
+def get_selected_nodes(node_editor: str) -> List[str]:
+ """Returns selected nodes."""
+ ...
+
+def get_total_time() -> float:
+ """Returns total time since app started."""
+ ...
+
+def get_value(name: str) -> Any:
+ """Returns an item's value or None if there is none."""
+ ...
+
+def get_windows() -> List[str]:
+ """Returns a list of windows."""
+ ...
+
+def insert_grid_column(data_grid: str, column_index: int, name: str, column: List[str]) -> None:
+ """Inserts a column into a data grid."""
+ ...
+
+def insert_grid_row(data_grid: str, row_index: int, row: List[str]) -> None:
+ """Inserts a row into a data grid."""
+ ...
+
+def is_dearpygui_running() -> bool:
+ """Checks if dearpygui is still running"""
+ ...
+
+def is_item_activated(item: str) -> bool:
+ """Checks if an item has been activated."""
+ ...
+
+def is_item_active(item: str) -> bool:
+ """Checks if an item is active."""
+ ...
+
+def is_item_clicked(item: str) -> bool:
+ """Checks if an item is clicked."""
+ ...
+
+def is_item_container(item: str) -> bool:
+ """Checks if an item is container."""
+ ...
+
+def is_item_deactivated(item: str) -> bool:
+ """Checks if an item has been deactivated."""
+ ...
+
+def is_item_deactivated_after_edit(item: str) -> bool:
+ """Checks if an item has been deactivated after editing."""
+ ...
+
+def is_item_edited(item: str) -> bool:
+ """Checks if an item has been edited."""
+ ...
+
+def is_item_focused(item: str) -> bool:
+ """Checks if an item is focused."""
+ ...
+
+def is_item_hovered(item: str) -> bool:
+ """Checks if an item is hovered."""
+ ...
+
+def is_item_shown(item: str) -> bool:
+ """Checks if an item is shown."""
+ ...
+
+def is_item_toggled_open(item: str) -> bool:
+ """Checks if an item is toggled."""
+ ...
+
+def is_item_visible(item: str) -> bool:
+ """Checks if an item is visible on screen."""
+ ...
+
+def is_key_down(key: int) -> bool:
+ """Checks if the key is down."""
+ ...
+
+def is_key_pressed(key: int) -> bool:
+ """Checks if the key is pressed."""
+ ...
+
+def is_key_released(key: int) -> bool:
+ """Checks if the key is released."""
+ ...
+
+def is_mouse_button_clicked(button: int) -> bool:
+ """Checks if the mouse button is clicked."""
+ ...
+
+def is_mouse_button_double_clicked(button: int) -> bool:
+ """Checks if the mouse button is double clicked."""
+ ...
+
+def is_mouse_button_down(button: int) -> bool:
+ """Checks if the mouse button is pressed."""
+ ...
+
+def is_mouse_button_dragging(button: int, threshold: float) -> bool:
+ """Checks if the mouse is dragging."""
+ ...
+
+def is_mouse_button_released(button: int) -> bool:
+ """Checks if the mouse button is released."""
+ ...
+
+def is_plot_queried(plot: str) -> bool:
+ """Returns true if plot was queried"""
+ ...
+
+def log(message: Any, *, level: str = 'TRACE', logger: str = '') -> None:
+ """Logs a trace level log."""
+ ...
+
+def log_debug(message: Any, *, logger: str = '') -> None:
+ """Logs a debug level log."""
+ ...
+
+def log_error(message: Any, *, logger: str = '') -> None:
+ """Logs a error level log."""
+ ...
+
+def log_info(message: Any, *, logger: str = '') -> None:
+ """Logs a info level log."""
+ ...
+
+def log_warning(message: Any, *, logger: str = '') -> None:
+ """Logs a warning level log."""
+ ...
+
+def maximize_viewport() -> None:
+ """Maximizes viewport"""
+ ...
+
+def minimize_viewport() -> None:
+ """Minimizes viewport"""
+ ...
+
+def move_item(item: str, *, parent: str = '', before: str = '') -> None:
+ """Moves an existing item."""
+ ...
+
+def move_item_down(item: str) -> None:
+ """Moves item down if possible and if it exists."""
+ ...
+
+def move_item_up(item: str) -> None:
+ """Moves item up if possible and if it exists."""
+ ...
+
+def open_file_dialog(callback: Callable = None, extensions: str = '') -> None:
+ """Opens an 'open file' dialog."""
+ ...
+
+def render_dearpygui_frame() -> None:
+ """Renders a DearPyGui frame. Should be called within a user's event loop. Must first call setup_dearpygui outside of event loop."""
+ ...
+
+def reset_xticks(plot: str) -> None:
+ """Sets plots x ticks and labels back to automatic"""
+ ...
+
+def reset_yticks(plot: str) -> None:
+ """Sets plots y ticks and labels back to automatic"""
+ ...
+
+def set_accelerator_callback(callback: Any) -> None:
+ """Callback similar to keypress but used for accelerator keys."""
+ ...
+
+def set_exit_callback(callback: Any) -> None:
+ """Callback to run when exiting main window."""
+ ...
+
+def set_font(font: str, size: int, *, item: str = '') -> None:
+ """Adds additional font."""
+ ...
+
+def set_global_font_scale(scale: float) -> None:
+ """Changes the global font scale."""
+ ...
+
+def set_grid_data(data_grid: str, data: List[List[str]]) -> None:
+ """Overwrites data grid data."""
+ ...
+
+def set_grid_headers(data_grid: str, headers: List[str]) -> None:
+ """Sets a data grid's headers."""
+ ...
+
+def set_grid_item(data_grid: str, row: int, column: int, value: str) -> None:
+ """Sets a data grid's cell value."""
+ ...
+
+def set_grid_selection(data_grid: str, row: int, column: int, value: bool) -> None:
+ """Sets a data grid's cell selection value."""
+ ...
+
+def set_item_callback(item: str, callback: Callable, *, callback_data: Any = None) -> None:
+ """Sets an item's callback if applicable."""
+ ...
+
+def set_item_callback_data(item: str, callback_data: Any) -> None:
+ """Sets an item's callback data if applicable."""
+ ...
+
+def set_key_down_callback(callback: Callable) -> None:
+ """Sets a callback for a key down event."""
+ ...
+
+def set_key_press_callback(callback: Callable) -> None:
+ """Sets a callback for a key press event."""
+ ...
+
+def set_key_release_callback(callback: Callable) -> None:
+ """Sets a callback for a key release event."""
+ ...
+
+def set_log_level(level: int, *, logger: str = '') -> None:
+ """Sets the log level."""
+ ...
+
+def set_logger_window_title(title: str) -> None:
+ """Sets the title of the logger window."""
+ ...
+
+def set_mouse_click_callback(callback: Callable) -> None:
+ """Sets a callback for a mouse click event."""
+ ...
+
+def set_mouse_double_click_callback(callback: Callable) -> None:
+ """Sets a callback for a mouse double click event."""
+ ...
+
+def set_mouse_down_callback(callback: Callable) -> None:
+ """Sets a callback for a mouse down event."""
+ ...
+
+def set_mouse_drag_callback(callback: Callable, threshold: float) -> None:
+ """Sets a callback for a mouse drag event."""
+ ...
+
+def set_mouse_move_callback(callback: Callable) -> None:
+ """Sets a callback for a mouse move event. Data is the mouse position in local coordinates."""
+ ...
+
+def set_mouse_release_callback(callback: Callable) -> None:
+ """Sets a callback for a mouse release event."""
+ ...
+
+def set_mouse_wheel_callback(callback: Callable) -> None:
+ """Sets a callback for a mouse wheel event."""
+ ...
+
+def set_plot_xlimits(plot: str, xmin: float, xmax: float) -> None:
+ """Sets x axis limits of a plot. (can be undone with set_plot_xlimits_auto()"""
+ ...
+
+def set_plot_xlimits_auto(plot: str) -> None:
+ """Sets plots x limits to be automatic."""
+ ...
+
+def set_plot_ylimits(plot: str, ymin: float, ymax: float) -> None:
+ """Sets y axis limits of a plot. (can be undone with set_plot_ylimits_auto()"""
+ ...
+
+def set_plot_ylimits_auto(plot: str) -> None:
+ """Sets plots y limits to be automatic."""
+ ...
+
+def set_primary_window(window: str, value: bool) -> None:
+ """Sets the primary window to fill the viewport."""
+ ...
+
+def set_resize_callback(callback: Callable, *, handler: str = '') -> None:
+ """Sets a callback for a window resize event."""
+ ...
+
+def set_start_callback(callback: Any) -> None:
+ """Callback to run when starting main window."""
+ ...
+
+def set_theme_color(constant: int, color: List[float], item: str = '') -> None:
+ """Sets a color of a theme item for when the item is enabled."""
+ ...
+
+def set_theme_color_disabled(constant: int, color: List[float], item: str = '') -> None:
+ """Sets a color of a theme item for when the item is disabled."""
+ ...
+
+def set_theme_style(constant: int, style: float, item: str = '') -> None:
+ """Sets a style of a theme item."""
+ ...
+
+def set_value(name: str, value: Any) -> bool:
+ """Sets an item's value if applicable."""
+ ...
+
+def set_xticks(plot: str, label_pairs: Any) -> None:
+ """Sets plots x ticks and labels"""
+ ...
+
+def set_yticks(plot: str, label_pairs: Any) -> None:
+ """Sets plots y ticks and labels"""
+ ...
+
+def setup_dearpygui() -> None:
+ """Sets up DearPyGui for user controlled rendering. Only call once and you must call cleanup_deapygui when finished."""
+ ...
+
+def show_logger() -> None:
+ """Shows the logging window. The Default log level is Trace"""
+ ...
+
+def show_viewport(*, minimized: bool = ..., maximized: bool = ...) -> None:
+ """Shows viewport"""
+ ...
+
+def stop_dearpygui() -> None:
+ """Stops DearPyGui."""
+ ...
+
+def unindent(name: str = 'unindent', *, offset: float = 0.0, parent: str = '', before: str = '', show: bool = True) -> None:
+ """Unindents following items."""
+ ...
+
diff --git a/DearPyGui/dearpygui/demo.py b/DearPyGui/dearpygui/demo.py
new file mode 100644
index 000000000..1361b6bd9
--- /dev/null
+++ b/DearPyGui/dearpygui/demo.py
@@ -0,0 +1,966 @@
+from dearpygui.core import *
+from dearpygui.simple import *
+from math import sin, cos
+import random
+
+########################################################################################################################
+# Helpers
+########################################################################################################################
+
+def demo_help(message):
+ """[INTERNAL DPG DEMO COMMAND]: This is a helper function that is intended to make the demo easier to read. not suggested for external use.
+ If this command is appearing in your code consider importing demo as demo to prevent namespace polution.
+
+ Creates a hoverable question marker on the same line as the last created item. The message will be displayed as a popup.
+
+ Args:
+ message: text that will be displayed in the popup when the "(?)" is hovered.
+
+ Returns:
+ None"""
+ add_same_line()
+ parent = add_text(color=[150, 150, 150], default_value="(?)")
+ add_tooltip(parent=parent)
+ add_text(default_value=message)
+ end()
+
+def demo_hsv_to_rgb(h: float, s: float, v: float) -> (float, float, float):
+ """[INTERNAL DPG DEMO COMMAND]: This is a helper function that is intended to make the demo easier to read. not suggested for external use.
+ If this command is appearing in your code consider importing demo as demo to prevent namespace polution.
+
+ converts hsv to rgb
+
+ Args:
+ h: hue.
+ s: saturation
+ v: value
+
+ Returns:
+ rgb as a tuple of floats
+ """
+ if s == 0.0: return (v, v, v)
+ i = int(h*6.) # XXX assume int() truncates!
+ f = (h*6.)-i; p,q,t = v*(1.-s), v*(1.-s*f), v*(1.-s*(1.-f)); i%=6
+ if i == 0: return (255*v, 255*t, 255*p)
+ if i == 1: return (255*q, 255*v, 255*p)
+ if i == 2: return (255*p, 255*v, 255*t)
+ if i == 3: return (255*p, 255*q, 255*v)
+ if i == 4: return (255*t, 255*p, 255*v)
+ if i == 5: return (255*v, 255*p, 255*q)
+
+def demo_recursive_disable(sender, siblings, restart_index=0):
+ """[INTERNAL DPG DEMO COMMAND]: This is a helper function that is intended to make the demo easier to read. not suggested for external use.
+ If this command is appearing in your code consider importing demo as demo to prevent namespace polution.
+
+ This command will toggle enable/disable for any eligible children of the parent container recursively down the widget tree.
+ Args:
+ sender: is the widgets name that called the command.
+ siblings: children in the same container that this checkbox is in.
+ **restart_index: sets the position of the next item to check so the same item isnt checked multiple times.
+
+ Returns:
+ None"""
+ for i in range(restart_index,len(siblings)-1, 1):
+ if is_item_container(siblings[i]):
+ siblings += get_item_children(siblings.pop(i))
+ demo_recursive_disable(sender, siblings, i-1)
+ return
+ siblings.remove(sender)
+ for item in siblings:
+ for key,value in get_item_configuration(item).items():
+ if key == 'enabled':
+ configure_item(item, enabled = not value)
+
+def demo_enable_disable():
+ """[INTERNAL DPG DEMO COMMAND]: This is a helper function that is intended to make the demo easier to read. not suggested for external use.
+ If this command is appearing in your code consider importing demo as demo to prevent namespace polution.
+
+ Creates a checkbox that will toggle enable/disable for any eligible children of the parent container recursively down the widget tree.
+ Args:
+ None
+
+ Returns:
+ None"""
+ add_checkbox(label="Enable/Disable", default_value=True, callback=lambda sender: demo_recursive_disable(sender, get_item_children(get_item_parent(sender))))
+ demo_help('This will toggle the keyword "enable" for any sibling widgets that allow enabled & disabled')
+
+def demo_config(sender, data):
+ """[INTERNAL DPG DEMO COMMAND]: This is a helper function that is intended to make the demo easier to read. not suggested for external use.
+ If this command is appearing in your code consider importing demo as demo to prevent namespace polution.
+
+ Applies configuration of the data in callback_data.
+
+ Args:
+ sender: is the widgets name that called the command.
+ data: data that is populated by callback_data. Item as string or items as list that the configuration will be applied to.
+
+ Returns:
+ None
+ """
+ widget_type = get_item_type(sender)
+ log_debug(widget_type)
+ items = data
+ value = get_value(sender)
+
+ if widget_type == "mvAppItemType::mvCheckbox":
+ keyword = get_item_configuration(sender)["label"]
+ log_debug(keyword)
+
+ elif widget_type == "mvAppItemType::mvRadioButton":
+ keyword = get_item_configuration(sender)["items"][value]
+
+
+ if isinstance(data, list):
+ for item in items:
+ configure_item(item, **{keyword: value})
+ else:
+ configure_item(item, **{keyword: value})
+
+def demo_log(sender):
+ """[INTERNAL DPG DEMO COMMAND]: This is a helper function that is intended to make the demo easier to read. not suggested for external use.
+ If this command is appearing in your code consider importing demo as demo to prevent namespace polution.
+
+ Logs the name and value of the widget that called the command.
+
+ Args:
+ sender: widgets name that called the command.
+ that will get configured. The second item in the tuple is the keyword that will be set.
+
+ Returns:
+ None
+ """
+ log_debug(f"{sender} ran a callback its value is {get_value(sender)}")
+
+def demo_main_callback():
+ """[INTERNAL DPG DEMO COMMAND]: This is a helper function that is intended to make the demo easier to read. not suggested for external use.
+ If this command is appearing in your code consider importing demo as demo to prevent namespace polution.
+ """
+ set_value("Mouse Position##demo", str(get_mouse_pos()))
+ set_value("Drawing Mouse Position##demo", str(get_drawing_mouse_pos()))
+ set_value("Plot Mouse Position##demo", str(get_plot_mouse_pos()))
+
+ # keys
+ if is_key_down(mvKey_A):
+ set_value("A key Down##demo", "True")
+ else:
+ set_value("A key Down##demo", "False")
+
+ if is_key_pressed(mvKey_W):
+ set_value("W key Pressed##demo", "True")
+ else:
+ set_value("W key Pressed##demo", "False")
+
+ if is_key_released(mvKey_Q):
+ set_value("Q key Released##demo", "True")
+ else:
+ set_value("Q key Released##demo", "False")
+
+ # mouse dragging
+ if is_mouse_button_dragging(mvMouseButton_Left, 1):
+ set_value("Left Mouse Dragging##demo", "True")
+ else:
+ set_value("Left Mouse Dragging##demo", "False")
+
+ if is_mouse_button_dragging(mvMouseButton_Right, 1):
+ set_value("Right Mouse Dragging##demo", "True")
+ else:
+ set_value("Right Mouse Dragging##demo", "False")
+
+ if is_mouse_button_dragging(mvMouseButton_Middle, 1):
+ set_value("Middle Mouse Dragging##demo", "True")
+ else:
+ set_value("Middle Mouse Dragging##demo", "False")
+
+ # mouse down
+ if is_mouse_button_down(mvMouseButton_Left):
+ set_value("Left Mouse Down##demo", "True")
+ else:
+ set_value("Left Mouse Down##demo", "False")
+
+ if is_mouse_button_down(mvMouseButton_Right):
+ set_value("Right Mouse Down##demo", "True")
+ else:
+ set_value("Right Mouse Down##demo", "False")
+
+ if is_mouse_button_down(mvMouseButton_Middle):
+ set_value("Middle Mouse Down##demo", "True")
+ else:
+ set_value("Middle Mouse Down##demo", "False")
+
+ # mouse clicked
+ if is_mouse_button_clicked(mvMouseButton_Left):
+ set_value("Left Mouse Clicked##demo", "True")
+ else:
+ set_value("Left Mouse Clicked##demo", "False")
+
+ if is_mouse_button_clicked(mvMouseButton_Right):
+ set_value("Right Mouse Clicked##demo", "True")
+ else:
+ set_value("Right Mouse Clicked##demo", "False")
+
+ if is_mouse_button_clicked(mvMouseButton_Middle):
+ set_value("Middle Mouse Clicked##demo", "True")
+ else:
+ set_value("Middle Mouse Clicked##demo", "False")
+
+ # mouse double clicked
+ if is_mouse_button_double_clicked(mvMouseButton_Left):
+ set_value("Left Mouse Double Clicked##demo", "True")
+ else:
+ set_value("Left Mouse Double Clicked##demo", "False")
+
+ if is_mouse_button_double_clicked(mvMouseButton_Right):
+ set_value("Right Mouse Double Clicked##demo", "True")
+ else:
+ set_value("Right Mouse Double Clicked##demo", "False")
+
+ if is_mouse_button_double_clicked(mvMouseButton_Middle):
+ set_value("Middle Mouse Double Clicked##demo", "True")
+ else:
+ set_value("Middle Mouse Double Clicked##demo", "False")
+
+ # mouse released
+ if is_mouse_button_released(mvMouseButton_Left):
+ set_value("Left Mouse Released##demo", "True")
+ else:
+ set_value("Left Mouse Released##demo", "False")
+
+ if is_mouse_button_released(mvMouseButton_Right):
+ set_value("Right Mouse Released##demo", "True")
+ else:
+ set_value("Right Mouse Released##demo", "False")
+
+ if is_mouse_button_released(mvMouseButton_Middle):
+ set_value("Middle Mouse Released##demo", "True")
+ else:
+ set_value("Middle Mouse Released##demo", "False")
+
+def demo_accelerator_callback(sender, data):
+
+ mapping = {
+ "P": mvKey_P,
+ "Y": mvKey_Y,
+ "T": mvKey_T,
+ "SHIFT": mvKey_Shift,
+ "CTRL": mvKey_Control,
+ }
+
+ def are_all_true(shortcut):
+ keys = shortcut.split("+")
+ for item in keys:
+ if not is_key_down(mapping[item.upper()]):
+ return False
+ return True
+
+ items = get_all_items()
+ for item in items:
+ # print(get_item_type(item))
+ if get_item_type(item) == "mvAppItemType::MenuItem":
+ shortcut = get_item_configuration(item)["shortcut"]
+ if shortcut != None and shortcut != "":
+ if are_all_true(shortcut):
+ get_item_callback(item)(item, None)
+
+def on_demo_close(sender, data):
+
+ delete_item("Dear PyGui Demo")
+ if does_item_exist("Logging Widget On Window##demo"):
+ delete_item("Logging Widget On Window##demo")
+ set_mouse_down_callback(None)
+ set_mouse_drag_callback(None, 10)
+ set_mouse_move_callback(None)
+ set_mouse_double_click_callback(None)
+ set_mouse_click_callback(None)
+ set_mouse_release_callback(None)
+ set_mouse_wheel_callback(None)
+ set_key_down_callback(None)
+ set_key_press_callback(None)
+ set_key_release_callback(None)
+ set_accelerator_callback(None)
+
+def show_demo():
+
+ #set_accelerator_callback(demo_accelerator_callback)
+
+ with window("Dear PyGui Demo", x_pos=100, y_pos=100, width=800, height=800, on_close=on_demo_close):
+
+ with menu_bar():
+
+ with menu(label="Menu"):
+ add_menu_item(label="New")
+ add_menu_item(label="Open")
+
+ with menu(label="Open Recent"):
+ add_menu_item(label="harrell.c")
+ add_menu_item(label="patty.h")
+ add_menu_item(label="nick.py")
+ add_menu_item(label="Save")
+ add_menu_item(label="Save As..")
+ add_separator()
+
+ with menu(label="Settings"):
+ demo_enable_disable()
+ add_menu_item(label="Option 1", callback=demo_log)
+ add_menu_item(label="Option 2", check=True, callback=demo_log)
+ add_menu_item(label="Option 3", check=True, callback=demo_log, default_value=True)
+ with child(height=60, autosize_x=True):
+ for i in range(0, 10):
+ add_text(default_value=f"Scrolling Text {i}")
+ add_slider_float(label="Slider Float")
+ add_input_float(label="Input Int")
+ add_combo(label="Combo", items=["Yes", "No", "Maybe"])
+
+ with menu(label="Tools"):
+ add_menu_item(label="Show Logger", callback=show_logger)
+ add_menu_item(label="Show About", callback=show_about)
+ add_menu_item(label="Show Metrics", callback=show_metrics)
+ add_menu_item(label="Show Documentation", callback=show_documentation)
+ add_menu_item(label="Show Debug", callback=show_debug)
+ add_menu_item(label="Show Style Editor", callback=show_style_editor)
+
+ add_text(default_value=f'Dear PyGui says hello. ({get_dearpygui_version()})')
+ add_text(default_value="This code for this demo can be found here: ")
+ add_text(default_value="https://github.com/hoffstadt/DearPyGui/blob/master/DearPyGui/dearpygui/demo.py")
+
+ with collapsing_header(label="Window options"):
+ with table(header_row=False):
+ add_table_column()
+ add_table_column()
+ add_table_column()
+
+ # TODO: when autogenerated names are done and labels are set the label is correctly displayed however when the label is retrieved out of the config dict
+ # the label is the autogenerated name
+ add_checkbox(label="no_title_bar", callback=demo_config, callback_data="Dear PyGui Demo")
+ add_checkbox(label="no_scrollbar", callback=demo_config, callback_data="Dear PyGui Demo")
+ add_checkbox(label="menubar", callback=demo_config, callback_data="Dear PyGui Demo", default_value=True)
+
+ add_table_next_column()
+ add_checkbox(label="no_move", callback=demo_config, callback_data="Dear PyGui Demo")
+ add_checkbox(label="no_resize", callback=demo_config, callback_data="Dear PyGui Demo")
+ add_checkbox(label="no_collapse", callback=demo_config, callback_data="Dear PyGui Demo")
+
+ add_table_next_column()
+ add_checkbox(label="no_close", callback=demo_config, callback_data="Dear PyGui Demo")
+ add_checkbox(label="no_background", callback=demo_config, callback_data="Dear PyGui Demo")
+ add_checkbox(label="no_bring_to_front_on_focus", callback=demo_config, callback_data="Dear PyGui Demo")
+
+ with collapsing_header(label="Widgets"):
+
+ with tree_node(label="Basic"):
+
+ demo_enable_disable()
+
+ with group(horizontal=True):
+ add_button(label="Button", callback=demo_log)
+ add_button(label="Button", callback=demo_log, small=True)
+ add_button(label="Button", callback=demo_log, arrow=True)
+ add_button(label="Button", callback=demo_log, arrow=True, direction=4010)
+ add_button(label="Button", callback=demo_log, arrow=True, direction=4020)
+ add_button(label="Button", callback=demo_log, arrow=True, direction=4030)
+
+ add_checkbox(label="checkbox", callback=demo_log)
+ add_radio_button(items=["radio a", "radio b", "radio c"], callback=demo_log, horizontal=True)
+ add_selectable(label="selectable", callback=demo_log)
+
+ # TODO: when items whose colors are set then disabled the disable color is not found so its clear
+ # probably because if you dont set disable at the item level when the searcher finds color it grabs an empty disable member
+
+ # demonstrate the ability to programmatically create buttons and store their id to do something.
+ # In this case we are adding to the list of items that will be disabled
+ log_items = []
+ for i in range(0, 7):
+ if i > 0:
+ add_same_line()
+ button_widget = add_button(label="Click", callback=lambda: log_debug(log_items))
+ set_theme_style(mvThemeStyle_Button_Rounding, i*5, item=button_widget)
+ set_theme_style(mvThemeStyle_Button_PaddingX, i*3, item=button_widget)
+ set_theme_style(mvThemeStyle_Button_PaddingY, i*3, item=button_widget)
+ set_theme_color(mvThemeCol_Button_Bg, demo_hsv_to_rgb(i/7.0, 0.6, 0.6), item=button_widget)
+ set_theme_color(mvThemeCol_Button_Active, demo_hsv_to_rgb(i/7.0, 0.8, 0.8), item=button_widget)
+ set_theme_color(mvThemeCol_Button_Hovered, demo_hsv_to_rgb(i/7.0, 0.7, 0.7), item=button_widget)
+ log_items.append(button_widget)
+
+ with group(horizontal=True):
+ add_text(default_value="Press a button: ")
+ add_button(arrow=True, direction=mvDir_Left, callback=lambda: set_value(widget, int(get_value(widget))-1))
+ add_button(arrow=True, direction=mvDir_Right, callback=lambda: set_value(widget, int(get_value(widget))+1))
+ widget = add_text(default_value="0")
+
+ with group(horizontal=True):
+ parent = add_text(default_value="hover me")
+ with tooltip(parent=parent):
+ add_text(default_value="I'm a tooltip")
+ add_dummy(width=10)
+ parent = add_text(default_value="or me")
+ with tooltip(parent=parent):
+ add_text(default_value="I'm a fancy tooltip")
+ add_simple_plot(label="Curve",value=[0.6, 0.1, 1.0, 0.5, 0.92, 0.1, 0.2])
+
+ add_separator()
+
+ add_label_text(label="Label", default_value="Value")
+ add_combo(label="combo", items=["AAAA", "BBBB", "CCCC", "DDDD", "EEEE", "FFFF", "GGGG", "HHHH", "IIII", "JJJJ", "KKKK"], default_value="AAAA", callback=demo_log)
+ add_input_text(label="input text", default_value="Hello, world!", callback=demo_log)
+ demo_help(
+ "USER:\n"
+ "Hold SHIFT or use mouse to select text.\n"
+ "CTRL+Left/Right to word jump.\n"
+ "CTRL+A or double-click to select all.\n"
+ "CTRL+X,CTRL+C,CTRL+V clipboard.\n"
+ "CTRL+Z,CTRL+Y undo/redo.\n"
+ "ESCAPE to revert.\n\n")
+ add_input_text(label="input text (w/ hint)", hint="enter text here", callback=demo_log)
+ add_input_int(label="input int", callback=demo_log)
+ add_input_float(label="input float", callback=demo_log)
+ add_input_float(label="input scientific", format="%e", callback=demo_log)
+ add_input_floatx(label="input floatx", callback=demo_log)
+ add_drag_int(label="drag int", callback=demo_log)
+ demo_help(
+ "Click and drag to edit value.\n"
+ "Hold SHIFT/ALT for faster/slower edit.\n"
+ "Double-click or CTRL+click to input value.")
+ add_drag_int(label="drag int 0..100", format="%d%%", callback=demo_log)
+ add_drag_float(label="drag float", callback=demo_log)
+ add_drag_float(label="drag small float", default_value=0.0067, format="%.06f ns", callback=demo_log)
+ add_slider_int(label="slider int", max_value=3, callback=demo_log)
+ demo_help("CTRL+click to enter value.")
+ add_slider_float(label="slider float", max_value=1.0, format="ratio = %.3f", callback=demo_log)
+ add_slider_int(label="slider angle", min_value=-360, max_value=360, format="%d deg", callback=demo_log)
+ add_color_edit3(label="color edit 3", default_value=[255, 0, 51], callback=demo_log)
+ demo_help(
+ "Click on the colored square to open a color picker.\n"
+ "Click and hold to use drag and drop.\n"
+ "Right-click on the colored square to show options.\n"
+ "CTRL+click on individual component to input value.\n")
+ add_color_edit4(label="color edit 4", default_value=[102, 179, 0, 128], callback=demo_log)
+ add_listbox(label="listbox", items=["Apple", "Banana", "Cherry", "Kiwi", "Mango", "Orange", "Pineapple", "Strawberry", "Watermelon"], num_items=4, callback=demo_log)
+
+ with tree_node(label="Trees"):
+ with tree_node(label="Basic Trees"):
+ with tree_node(label="Child 0", default_open=True):
+ add_text(default_value="blah blah")
+ add_same_line()
+ add_button(label="button")
+ with tree_node(label="Child 1"):
+ add_text(default_value="blah blah")
+ add_same_line()
+ add_button(label="button")
+ with tree_node(label="Child 2"):
+ add_text(default_value="blah blah")
+ add_same_line()
+ add_button(label="button")
+ with tree_node(label="Child 3"):
+ add_text(default_value="blah blah")
+ add_same_line()
+ add_button(label="button")
+ with tree_node(label="Child 4"):
+ add_text(default_value="blah blah")
+ add_same_line()
+ add_button(label="button")
+ with tree_node(label="Advanced, with selectable nodes"):
+ demo_help("This is a more typical looking tree with selectable nodes.\n"
+ "Click to select, CTRL+Click to toggle, click on arrows or double-click to open.")
+
+ with tree_node(label="Bullets"):
+ add_text(default_value="Bullet point 1", bullet=True)
+ add_text(default_value="Bullet point 2\nbullet text can be\nOn multiple lines", bullet=True)
+ with tree_node(label="Tree node"):
+ add_text(default_value="Another bullet point", bullet=True)
+ # TODO: discuss the below behavior. intended was to set the label to an empty string but
+ # because label is checking if empty or not to use name we get the auto name showing
+ add_text(default_value="1", bullet=True)
+ add_same_line()
+ add_button(label="Button", small=True)
+
+ with tree_node(label="Text"):
+
+ with tree_node(label="Colored Text"):
+ add_text(default_value="Pink", color=[255, 0, 255])
+ add_text(default_value="Yellow", color=[255, 255, 0])
+
+ with tree_node(label="Images"):
+ add_text(default_value="Below we are displaying the font texture (which is the only texture we have access to in this demo).")
+ add_image("INTERNAL_DPG_FONT_ATLAS")
+ add_text(default_value="Here is an image button using a portion of the font atlas")
+ demo_enable_disable()
+ add_image_button(value="INTERNAL_DPG_FONT_ATLAS",uv_max=[0.1, 0.1], callback=demo_log)
+ add_same_line()
+ textdata = []
+ for i in range(0, 10000):
+ textdata.append(255)
+ textdata.append(0)
+ textdata.append(255)
+ textdata.append(255)
+ # TODO: texture requires a name when it would be nice that it didnt
+ add_texture("#cooltexture", textdata, 100, 100, format=mvTEX_RGBA_INT)
+ add_image_button(value="#cooltexture", callback=demo_log)
+
+ with tree_node(label="Text Input"):
+ demo_enable_disable()
+ add_checkbox(label="readonly", callback=demo_config, callback_data="Multi-line Text Input")
+ add_checkbox(label="on_enter", callback=demo_config, callback_data="Multi-line Text Input")
+ with tree_node("Multi-line Text Input"):
+ add_input_text(multiline=True, default_value="/*\n"
+ " The Pentium F00F bug, shorthand for F0 0F C7 C8,\n"
+ " the hexadecimal encoding of one offending instruction,\n"
+ " more formally, the invalid operand with locked CMPXCHG8B\n"
+ " instruction bug, is a design flaw in the majority of\n"
+ " Intel Pentium, Pentium MMX, and Pentium OverDrive\n"
+ " processors (all in the P5 microarchitecture).\n"
+ "*/\n\n"
+ "label:\n"
+ "\tlock cmpxchg8b eax\n", height=300, callback=demo_log, tab_input=True)
+
+ with tree_node(label="Filtered Text Input"):
+ add_input_text(callback=demo_log, label="default")
+ add_input_text(callback=demo_log, label="decimal", decimal=True)
+ add_input_text(callback=demo_log, label="no blank", no_spaces=True)
+ add_input_text(callback=demo_log, label="uppercase", uppercase=True)
+ add_input_text(callback=demo_log, label="scientific", scientific=True)
+ add_input_text(callback=demo_log, label="hexdecimal", hexadecimal=True)
+
+ with tree_node(label="Password Input"):
+ password = add_input_text(label="password", password=True, callback=demo_log)
+ add_input_text(label="password (w/ hint)", password=True, hint="", source=password, callback=demo_log)
+ add_input_text(label="password (clear)", source=password, callback=demo_log)
+
+ with tree_node(label="Simple Plot Widgets"):
+ add_simple_plot(label="Frame Times", value=[0.6, 0.1, 1.0, 0.5, 0.92, 0.1, 0.2])
+ add_simple_plot(label="Histogram", value=(0.6, 0.1, 1.0, 0.5, 0.92, 0.1, 0.2), height=80, histogram=True, minscale=0.0)
+
+ data1 = []
+ for i in range(0, 70):
+ data1.append(cos(3.14*6*i/180))
+ add_simple_plot(label="Lines", value=data1, height=80)
+ add_simple_plot(label="Histogram", value=data1, height=80, histogram=True)
+ add_progress_bar(label="Progress Bar", default_value=0.78, overlay="78%")
+ add_same_line()
+ add_text(default_value="Progress Bar")
+ bar = add_progress_bar(default_value=0.78, overlay="1367/1753")
+ set_theme_color(mvThemeCol_ProgressBar_Bar, [255,0,0, 255], item=bar )
+
+ with tree_node(label="Multi-component Widgets"):
+ demo_enable_disable()
+ input_float_2 = add_input_floatx(label="input float 2", min_value=0.0, max_value=100.0)
+ add_drag_floatx(label="drag float 2", source=input_float_2)
+ add_slider_floatx(label="slider float 2", source=input_float_2)
+ input_int_2 = add_input_intx(label="input int 2", min_value=0, max_value=100)
+ add_drag_intx(label="drag int 2", source=input_int_2)
+ add_slider_intx(label="slider int 2", source=input_int_2)
+ add_spacing()
+ input_float_3 = add_input_floatx(label="input float 3", min_value=0.0, max_value=100.0)
+ add_drag_floatx(label="drag float 3", source=input_float_3)
+ add_slider_floatx(label="slider float 3", source=input_float_3)
+ input_int_3 = add_input_intx(label="input intx", min_value=0, max_value=100)
+ add_drag_intx(label="drag int 3", source=input_int_3)
+ add_slider_intx(label="slider int 3", source=input_int_3)
+ add_spacing()
+ input_float_4 = add_input_floatx(label="input float 4", min_value=0.0, max_value=100.0)
+ add_drag_floatx(label="drag float 4", source=input_float_4)
+ add_slider_floatx(label="slider float 4", source=input_float_4)
+ input_int_4 = add_input_intx(label="input int 4", min_value=0, max_value=100)
+ add_drag_intx(label="drag int 4", source=input_int_4)
+ add_slider_intx(label="slider intx", source=input_int_4)
+
+ with tree_node(label="Vertical Sliders"):
+ demo_enable_disable()
+ add_slider_int(label="", default_value=1, vertical=True, max_value=5, height=160)
+ add_same_line()
+
+ with group():
+ values = [ 0.0, 0.60, 0.35, 0.9, 0.70, 0.20, 0.0 ]
+ for i in range(0, 7):
+ if i > 0:
+ add_same_line()
+ widget = add_slider_float(label="", default_value=values[i], vertical=True, max_value=1.0, height=160)
+ set_theme_color(mvThemeCol_SliderFloat_Bg, demo_hsv_to_rgb(i/7.0, 0.5, 0.5), item=widget)
+ set_theme_color(mvThemeCol_SliderFloat_Grab, demo_hsv_to_rgb(i/7.0, 0.9, 0.9), item=widget)
+ set_theme_color(mvThemeCol_SliderFloat_BgActive, demo_hsv_to_rgb(i/7.0, 0.7, 0.5), item=widget)
+ set_theme_color(mvThemeCol_SliderFloat_BgHovered, demo_hsv_to_rgb(i/7.0, 0.6, 0.5), item=widget)
+
+ # TODO: Find out why the final slider is throwing a error for duplicate name when the name should be autogenerated
+ add_same_line()
+ with group():
+ for i in range(0, 3):
+ with group():
+ values = [ 0.20, 0.80, 0.40, 0.25 ]
+ for j in range(0, 4):
+ add_slider_float(label="", default_value=values[j], vertical=True, max_value=1.0, height=50)
+ if i != 3:
+ add_same_line()
+ # TODO: Should the label default just be an empty string when the item isnt given a name or a label, having to evter label="" is annoying, when you dont want a label to show
+ add_same_line()
+ with group(horizontal=True):
+ add_slider_float(label="", vertical=True, max_value=1.0, height=160, width=40)
+ add_slider_float(label="", vertical=True, max_value=1.0, height=160, width=40)
+ add_slider_float(label="", vertical=True, max_value=1.0, height=160, width=40)
+ add_slider_float(label="", vertical=True, max_value=1.0, height=160, width=40)
+
+ with collapsing_header("Layout & Scolling##demo"):
+
+ with tree_node("Child windows##demo"):
+
+ with child(border=False, width=400):
+ for i in range(0, 100):
+ add_text(f"{i}: scrollable region")
+
+ add_same_line()
+ with child(autosize_x=True):
+ with menu_bar():
+ with menu("Menu##child##demo"):
+ pass
+ with group(width=-20):
+ for i in range(0, 100):
+ add_button(f"{i}##childbutton##demo")
+
+ with tree_node("Child Window Flags##demo"):
+
+ with table(header_row=False):
+ add_table_column()
+ add_table_column()
+ add_table_column()
+
+ add_checkbox("autosize_x##demo", callback=lambda sender, data: configure_item("testchild##demo", autosize_x=get_value(sender)))
+ add_checkbox("autosize_y##demo", callback=lambda sender, data: configure_item("testchild##demo", autosize_y=get_value(sender)))
+
+ add_table_next_column()
+ add_checkbox("menubar##childdemo", default_value=True, callback=lambda sender, data: configure_item("testchild##demo", menubar=get_value(sender)))
+ add_checkbox("no_scrollbar##childdemo", callback=lambda sender, data: configure_item("testchild##demo", no_scrollbar=get_value(sender)))
+
+ add_table_next_column()
+ add_checkbox("horizontal_scrollbar##childdemo", callback=lambda sender, data: configure_item("testchild##demo", horizontal_scrollbar=get_value(sender)))
+ add_checkbox("border##childdemo", default_value=True, callback=lambda sender, data: configure_item("testchild##demo", border=get_value(sender)))
+
+ with child(width=500, height=500):
+ with menu_bar():
+ with menu("Menu##testchild##demo"):
+ pass
+ for i in range(0, 100):
+ add_text(default_value="A pretty long sentence if you really think about it. It's also pointless.")
+
+ with tree_node("Widgets Width##demo"):
+
+ add_text("Width=100")
+ add_drag_float("float##demowidths1", width=100)
+
+ add_text("Width=-100")
+ add_drag_float("float##demowidths2", width=-100)
+
+ add_text("Width=-1")
+ add_drag_float("float##demowidths3", width=-1)
+
+ add_text("group with width=75")
+ with group(width=75):
+ add_drag_float("float##demowidths4")
+ add_drag_float("float##demowidths5")
+ add_drag_float("float##demowidths6")
+
+ with tree_node("Basic Horizontal Layout##demo"):
+ add_text("(Use add_same_line(), to keep adding items to the right of the preceding item)")
+ add_text("Normal buttons")
+ add_same_line()
+ add_button("Banana##demo")
+ add_same_line()
+ add_button("Apple##demo")
+ add_same_line()
+ add_button("Corniflower##demo")
+
+ add_text("Small buttons")
+ add_same_line()
+ add_button("Like this one##demo", small=True)
+ add_same_line()
+ add_text("can fit within a text block")
+
+ add_text("Aligned")
+ add_same_line(xoffset=150)
+ add_text("x=150")
+ add_same_line(xoffset=300)
+ add_text("x=300")
+
+ add_text(default_value="Aligned")
+ add_same_line(xoffset=150)
+ add_button("x=150##demo1", small=True)
+ add_same_line(xoffset=300)
+ add_button("x=300##demo1", small=True)
+
+ add_checkbox("My##demo")
+ add_same_line()
+ add_checkbox("Tailor##demo")
+ add_same_line()
+ add_checkbox("is##demo")
+ add_same_line()
+ add_checkbox("rich##demo")
+
+ add_text("Lists:")
+ add_listbox("##demolistbox1", items=["AAAA", "BBBB", "CCCC", "DDDD"], default_value=0, width=100)
+ add_same_line()
+ add_listbox("##demolistbox2", items=["AAAA", "BBBB", "CCCC", "DDDD"], default_value=1, width=100)
+ add_same_line()
+ add_listbox("##demolistbox3", items=["AAAA", "BBBB", "CCCC", "DDDD"], default_value=2, width=100)
+ add_same_line()
+ add_listbox("##demolistbox4", items=["AAAA", "BBBB", "CCCC", "DDDD"], default_value=3, width=100)
+
+
+ add_text("Spacing(100):")
+ add_button("A##demospacing", width=50, height=50)
+ add_same_line(spacing=100)
+ add_button("B##demospacing", width=50, height=50)
+
+ with tree_node("Tabs##demo"):
+ with tree_node("Basic##tabs##demo"):
+ with tab_bar():
+ with tab("Avocado##demo"):
+ add_text("This is the avocado tab!")
+ with tab("Broccoli##demo"):
+ add_text("This is the broccoli tab!")
+ with tab("Cucumber##demo"):
+ add_text("This is the cucumber tab!")
+ with tree_node("Advanced##tabs##demo"):
+ add_checkbox("tab bar reorderable##demo", callback=lambda sender, data: configure_item("Basic Tabbar1##demo", reorderable=get_value(sender)))
+ add_checkbox("tab 2 no_reorder##demo", callback=lambda sender, data: configure_item("tab 2##demo", no_reorder=get_value(sender)))
+ add_checkbox("tab 2 leading##demo", callback=lambda sender, data: configure_item("tab 2##demo", leading=get_value(sender)))
+ add_checkbox("tab 2 trailing##demo", callback=lambda sender, data: configure_item("tab 2##demo", trailing=get_value(sender)))
+ add_checkbox("tab button trailing##demo", callback=lambda sender, data: configure_item("+##demo", trailing=get_value(sender)))
+ add_checkbox("tab button leading##demo", callback=lambda sender, data: configure_item("+##demo", leading=get_value(sender)))
+ with tab_bar("Basic Tabbar1##demo"):
+ with tab("tab 1##demo"):
+ add_text("This is the tab 1!")
+ with tab("tab 2##demo"):
+ add_text("This is the tab 2!")
+ with tab("tab 3##demo"):
+ add_text("This is the tab 3!")
+ with tab("tab 4##demo"):
+ add_text("This is the tab 4!")
+ add_tab_button("+##demo", callback=lambda sender, data: log_debug("Pressed tab button"))
+ add_tab_button("?##demo", callback=lambda sender, data: log_debug("Pressed tab button"))
+
+ with tree_node("Groups##demo123"):
+ add_text("Groups can be used to bundle widths together so that you can use functions such as is_item_hovered or add_same_line on the whole group.")
+ with group("group##demotabexamples"):
+ add_button("AAA##demogroup")
+ add_button("BBB##demogroup")
+ add_button("CCC##demogroup")
+ with tooltip(parent="group##demotabexamples"):
+ add_text("The group is hovered", wrap=200)
+
+ add_text("Horizontal group:")
+ with group(horizontal=True):
+ add_button("AAA##demogroup1")
+ add_button("BBB##demogroup1")
+ add_button("CCC##demogroup1")
+
+ with collapsing_header("Tooltips##demo"):
+ add_text("Hover me for a fancy tooltip")
+ with tooltip("tool_tip##tooltips", parent="Hover me for a fancy tooltip"):
+ add_simple_plot("Simpleplot##tooltips##demo", value=(0.3, 0.9, 2.5, 8.9), height = 80)
+
+ with collapsing_header("Popups, Modal windows, & Dialogs##demo"):
+
+ with tree_node("Popups##demo"):
+ add_text("When a popup is active, it inhibits interacting with windows that are behind the popup. Clicking outside the popup closes it.")
+ add_button("Select..##popups##demo")
+ add_same_line()
+ add_text("")
+ demo_help("right click for popup, it is set to right mouse button, this can be changed")
+ with popup("popup1", parent="Select..##popups##demo", ):
+ add_text("Aquariam")
+ add_separator()
+ add_selectable("Bream##demo", callback=lambda sender, data: set_value("", sender))
+ add_selectable("Haddock##demo", callback=lambda sender, data: set_value("", sender))
+ add_selectable("Mackerel##demo", callback=lambda sender, data: set_value("", sender))
+ add_selectable("Pollock##demo", callback=lambda sender, data: set_value("", sender))
+ add_selectable("Tilefish##demo", callback=lambda sender, data: set_value("", sender))
+
+ with tree_node("Modals##demo"):
+ add_text("Modal windows are like popups but the user cannot close them by clicking outside.")
+ add_button("Delete..##modals##demo")
+ demo_help("right click for popup, it is set to right mouse button, this can be changed ")
+ with popup("Delete?", parent="Delete..##modals##demo", modal=True):
+ add_text("All those beautiful files will be deleted.\nThis operation cannot be undone!")
+ add_separator()
+ add_checkbox("Don't ask me next time##demo")
+ add_button("OK##modal##demo", width=75, callback=lambda sender, data: close_popup("Delete?"))
+ add_same_line()
+ add_button("Cancel##modal##demo", width=75, callback=lambda sender, data: close_popup("Delete?"))
+
+ with tree_node("File Selector##demo"):
+ def file_selected(sender, data):
+ log_info(data)
+ add_button("Select Python File##demo", callback = lambda sender, data: open_file_dialog(file_selected, ".*,.py"))
+ add_button("Select C++ File##demo", callback = lambda sender, data: open_file_dialog(file_selected, ".*,.cpp"))
+
+ with tree_node("Directory Selector##demo"):
+ def directory_selected(sender, data):
+ log_info(data)
+ add_button("Select Directory##demo", callback = lambda sender, data: select_directory_dialog(directory_selected))
+
+ with tree_node("Menus inside a regular window##demo"):
+ add_text("Below we are testing adding menu items to a regular window. It's rather unusual but should work")
+ add_separator()
+ add_menu_item("Menu item##demotestingmenus", shortcut="CTRL+M")
+ with menu("Menu inside a regular window##demo"):
+ add_menu_item("Disabled item##demotestingmenus", enabled=False)
+ add_menu_item("New##demotestingmenus")
+
+ with collapsing_header("Tables##demo"):
+
+ with tree_node("Basic##tables##demo"):
+
+ # basic usage of the table api
+ with table(header_row=False):
+
+ # use add_table_column to add columns to the table
+ add_table_column()
+ add_table_column()
+ add_table_column()
+
+ # add_table_next_column will jump to the next row
+ # once it reaches the end of the columns
+ for i in range(0, 4):
+ for j in range(0, 3):
+ add_text(f"Row{i} Column{j}")
+ if not (i == 3 and j == 2):
+ add_table_next_column()
+
+ with tree_node("Borders, background##tables##demo"):
+
+ add_checkbox("row_background##tables2##demo", default_value=True, callback=lambda sender:configure_item("table2##demo", row_background=get_value(sender)))
+ add_checkbox("borders_innerH##tables2##demo", default_value=True, callback=lambda sender:configure_item("table2##demo", borders_innerH=get_value(sender)))
+ add_checkbox("borders_innerV##tables2##demo", default_value=True, callback=lambda sender:configure_item("table2##demo", borders_innerV=get_value(sender)))
+ add_checkbox("borders_outerH##tables2##demo", default_value=True, callback=lambda sender:configure_item("table2##demo", borders_outerH=get_value(sender)))
+ add_checkbox("borders_outerV##tables2##demo", default_value=True, callback=lambda sender:configure_item("table2##demo", borders_outerV=get_value(sender)))
+ add_checkbox("header_row##tables2##demo", default_value=False, callback=lambda sender:configure_item("table2##demo", header_row=get_value(sender)))
+
+ with table("table2##demo", header_row=False, row_background=True,
+ borders_innerH=True, borders_outerH=True, borders_innerV=True,
+ borders_outerV=True):
+ add_table_column("Header 1##democolumns2")
+ add_table_column("Header 2##democolumns2")
+ add_table_column("Header 3##democolumns2")
+
+ for i in range(0, 5):
+ for j in range(0, 3):
+ add_text(default_value=f"Row{i} Column{j}")
+ if not (i == 4 and j == 2):
+ add_table_next_column()
+
+ with tree_node("Resizable, stretch##tables##demo"):
+
+ add_checkbox("borders_innerV##tables3##demo", default_value=True, callback=lambda sender:configure_item("table3##demo", borders_innerV=get_value(sender)))
+ add_checkbox("borders_outerV##tables3##demo", default_value=True, callback=lambda sender:configure_item("table3##demo", borders_outerV=get_value(sender)))
+ add_checkbox("resizable##tables3##demo", default_value=True, callback=lambda sender:configure_item("table3##demo", resizable=get_value(sender)))
+
+ with table("table3##demo", header_row=False, resizable=True,
+ borders_outerH=True, borders_innerV=True, borders_outerV=True):
+ add_table_column("Header 1##democolumns3")
+ add_table_column("Header 2##democolumns3")
+ add_table_column("Header 3##democolumns3")
+
+ for i in range(0, 5):
+ for j in range(0, 3):
+ add_text(default_value=f"Row{i} Column{j}")
+ if not (i == 4 and j == 2):
+ add_table_next_column()
+
+ with tree_node("Resizable, fixed##tables##demo"):
+
+ add_checkbox("no_host_extendX##tables3##demo", callback=lambda sender:configure_item("table4##demo", no_host_extendX=get_value(sender)))
+
+ with table("table4##demo", header_row=False, policy=8192, resizable=True, no_host_extendX=False,
+ borders_innerV=True, borders_outerV=True,borders_outerH=True):
+ add_table_column("Header 1##democolumns4")
+ add_table_column("Header 2##democolumns4")
+ add_table_column("Header 3##democolumns4")
+
+ for i in range(0, 5):
+ for j in range(0, 3):
+ add_text(default_value=f"Row{i} Column{j}")
+ if not (i == 4 and j == 2):
+ add_table_next_column()
+
+ with tree_node("Resizable, mixed##tables##demo"):
+
+ with table("table5##demo", header_row=True, policy=mvTable_SizingFixedFit, row_background=True, reorderable=True,
+ resizable=True, no_host_extendX=False, hideable=True,
+ borders_innerV=True, borders_outerV=True, borders_innerH=True, borders_outerH=True):
+ add_table_column("AAA##democolumns5", width_fixed=True)
+ add_table_column("BBB##democolumns5", width_fixed=True)
+ add_table_column("CCC##democolumns5", width_stretch=True, init_width_or_weight=0.0)
+
+ for i in range(0, 5):
+ for j in range(0, 3):
+ if j == 2:
+ add_text(f"Stretch {i}, {j}")
+ else:
+ add_text(f"Fixed {i}, {j}")
+ if not (i == 4 and j == 2):
+ add_table_next_column()
+
+ with table("table6##demo", header_row=True, policy=mvTable_SizingFixedFit, row_background=True, reorderable=True,
+ resizable=True, no_host_extendX=False, hideable=True,
+ borders_innerV=True, borders_outerV=True, borders_innerH=True, borders_outerH=True):
+ add_table_column("AAA##democolumns6", width_fixed=True)
+ add_table_column("BBB##democolumns6", width_fixed=True)
+ add_table_column("CCC##democolumns6", width_stretch=True, init_width_or_weight=0.0)
+ add_table_column("DDD##democolumns6", width_stretch=True, init_width_or_weight=0.0)
+
+ for i in range(0, 5):
+ for j in range(0, 4):
+ if j == 2 or j == 3:
+ add_text(default_value=f"Stretch {i},{j}")
+ else:
+ add_text(default_value=f"Fixed {i}, {j}")
+ if not (i == 4 and j == 3):
+ add_table_next_column()
+
+ with tree_node("Reorderable, hideable, with headers##tables##demo"):
+
+ add_checkbox("hideable##tables7##demo", default_value=True, callback=lambda sender:configure_item("table7##demo", hideable=get_value(sender)))
+ add_checkbox("reorderable##tables7##demo", default_value=True, callback=lambda sender:configure_item("table7##demo", reorderable=get_value(sender)))
+ add_checkbox("resizable##tables7##demo", default_value=True, callback=lambda sender:configure_item("table7##demo", resizable=get_value(sender)))
+
+ with table("table7##demo", header_row=True, resizable=True,
+ hideable=True, reorderable=True):
+ add_table_column("One##democolumns7")
+ add_table_column("Two##democolumns7")
+ add_table_column("three##democolumns7")
+
+ for i in range(0, 5):
+ for j in range(0, 3):
+ add_text(f"Hello {i}, {j}")
+ if not (i == 4 and j == 2):
+ add_table_next_column()
+
+ with tree_node("Outer Size##tables##demo"):
+
+ add_checkbox("no_host_extendX##tables8##demo", default_value=True, callback=lambda sender:configure_item("table8##demo", no_host_extendX=get_value(sender)))
+ add_checkbox("no_host_extendY##tables8##demo", default_value=False, callback=lambda sender:configure_item("table8##demo", no_host_extendY=get_value(sender)))
+
+ with table("table8##demo", header_row=False, no_host_extendX=True,
+ borders_innerH=True, borders_outerH=True, borders_innerV=True,
+ borders_outerV=True, context_menu_in_body=True, row_background=True,
+ policy=mvTable_SizingFixedFit, height=150):
+ add_table_column("One##democolumns8")
+ add_table_column("Two##democolumns8")
+ add_table_column("three##democolumns8")
+
+ for i in range(0, 10):
+ for j in range(0, 3):
+ add_text(f"Cell {i}, {j}")
+ if not (i == 9 and j == 2):
+ add_table_next_column()
+
+ add_text("Using explicit size:")
+ with table("table9##demo", header_row=False, no_host_extendX=True,
+ borders_innerH=True, borders_outerH=True, borders_innerV=True,
+ borders_outerV=True, context_menu_in_body=True, row_background=True,
+ policy=mvTable_SizingFixedFit, height=0, width=300):
+ add_table_column("One##democolumns9")
+ add_table_column("Two##democolumns9")
+ add_table_column("three##democolumns9")
+
+ for i in range(0, 6):
+ for j in range(0, 3):
+ add_text(default_value=f"Cell {i}, {j}")
+ if not (i == 9 and j == 2):
+ add_table_next_column()
diff --git a/DearPyGui/dearpygui/simple.py b/DearPyGui/dearpygui/simple.py
new file mode 100644
index 000000000..66a356ebe
--- /dev/null
+++ b/DearPyGui/dearpygui/simple.py
@@ -0,0 +1,706 @@
+"""DearPyGui's simple contains wrappings of the core API.
+"""
+from contextlib import contextmanager
+from typing import List, Any, Callable, Union
+import dearpygui.core as internal_dpg
+
+########################################################################################################################
+# context manager container wrappers
+########################################################################################################################
+
+@contextmanager
+def table(*args, header_row: bool = True, width: int = 0, height: int = 0, inner_width: int = 0, show: bool = True, parent: str = "",
+ before: str = "", resizable: bool = False, reorderable: bool = False, hideable: bool = False, sortable: bool = False,
+ context_menu_in_body: bool = False, row_background: bool = False, borders_innerH: bool = False, borders_outerH: bool = False,
+ borders_innerV: bool = False, borders_outerV: bool = False, policy: int = 0, no_host_extendX: bool = False,
+ no_host_extendY: bool = False, no_keep_columns_visible: bool = False, precise_widths: bool = False, no_clip: bool = False,
+ pad_outerX: bool = False, no_pad_outerX: bool = False, no_pad_innerX: bool = False, scrollX: bool = False, scrollY: bool = False):
+ """Wraps add_table() and automates calling end().
+
+ Args:
+ name: Unique name used to programmatically refer to the item. If label is unused this will be the label,
+ anything after "##" that occurs in the name will not be shown on screen.
+ **header_row: show headers at the top of the columns
+ **width:
+ **height:
+ **inner_width:
+ **show: Attempt to render
+ **parent: Parent this item will be added to. (runtime adding)
+ **before: This item will be displayed before the specified item in the parent. (runtime adding)
+ **resizable: Enable resizing columns
+ **reorderable: Enable reordering columns in header row
+ **hideable: Enable hiding/disabling columns in context menu.
+ **sortable: Enable sorting.
+ **context_menu_in_body: Right-click on columns body/contents will display table context menu.
+ **row_background: Set each RowBg color with ImGuiCol_TableRowBg or ImGuiCol_TableRowBgAlt (equivalent of calling TableSetBgColor with ImGuiTableBgFlags_RowBg0 on each row manually)
+ **borders_innerH: Draw horizontal borders between rows.
+ **borders_outerH: Draw horizontal borders at the top and bottom.
+ **borders_innerV: Draw vertical borders between columns.
+ **borders_outerV: Draw vertical borders on the left and right sides.
+ **policy: sizing policy
+ **no_host_extendX: Make outer width auto-fit to columns, overriding outer_size.x value. Only available when ScrollX/ScrollY are disabled and Stretch columns are not used.
+ **no_host_extendY: Make outer height stop exactly at outer_size.y (prevent auto-extending table past the limit). Only available when ScrollX/ScrollY are disabled. Data below the limit will be clipped and not visible.
+ **no_keep_columns_visible: Disable keeping column always minimally visible when ScrollX is off and table gets too small. Not recommended if columns are resizable.
+ **precise_widths: Disable distributing remainder width to stretched columns (width allocation on a 100-wide table with 3 columns: Without this flag: 33,33,34. With this flag: 33,33,33). With larger number of columns, resizing will appear to be less smooth.
+ **no_clip: Disable clipping rectangle for every individual columns.
+ **pad_outerX: Default if BordersOuterV is on. Enable outer-most padding. Generally desirable if you have headers.
+ **no_pad_outerX: Default if BordersOuterV is off. Disable outer-most padding.
+ **no_pad_innerX: Disable inner padding between columns (double inner padding if BordersOuterV is on, single inner padding if BordersOuterV is off).
+ **scollX: Enable horizontal scrolling. Require 'outer_size' parameter of BeginTable() to specify the container size. Changes default sizing policy. Because this create a child window, ScrollY is currently generally recommended when using ScrollX.
+ **scollY: Enable horizontal vertical.
+
+ Returns:
+ None
+ """
+ try:
+ yield internal_dpg.add_table(*args, header_row=header_row, width = width, height = height, inner_width = inner_width,
+ show = show, parent = parent, before = before, resizable = resizable, reorderable = reorderable, hideable = hideable,
+ sortable = sortable, context_menu_in_body = context_menu_in_body, row_background = row_background,
+ borders_innerH = borders_innerH, borders_outerH = borders_outerH, borders_innerV = borders_innerV,
+ borders_outerV = borders_outerV, policy = policy, no_host_extendX = no_host_extendX,
+ no_host_extendY = no_host_extendY, no_keep_columns_visible = no_keep_columns_visible, precise_widths = precise_widths,
+ no_clip = no_clip, pad_outerX = pad_outerX, no_pad_outerX = no_pad_outerX, no_pad_innerX = no_pad_innerX,
+ scrollX = scrollX, scrollY = scrollY)
+ finally:
+ internal_dpg.end()
+
+@contextmanager
+def window(*args, width: int = 200, height: int = 200, x_pos: int = 200, y_pos: int = 200, autosize: bool = False,
+ no_resize: bool = False, no_title_bar: bool = False, no_move: bool = False, no_scrollbar: bool = False,
+ no_collapse: bool = False, horizontal_scrollbar: bool = False, no_focus_on_appearing: bool = False,
+ no_bring_to_front_on_focus: bool = False, menubar: bool = False, no_close: bool = False,
+ no_background: bool = False, label: str = "__DearPyGuiDefault", show: bool = True, collapsed: bool = False,
+ on_close: Callable = None, min_size: List[int]=[32, 32], max_size: List[int] = [30000, 30000]):
+ """Wraps add_window() and automates calling end().
+
+ Args:
+ name: Unique name used to programmatically refer to the item. If label is unused this will be the label,
+ anything after "##" that occurs in the name will not be shown on screen.
+ **width: Width of the item.
+ **height: Height of the item.
+ **x_pos: x position the window will start at
+ **y_pos: y position the window will start at
+ **autosize: Autosized the window to fit it's items.
+ **no_resize: Allows for the window size to be changed or fixed
+ **no_title_bar: Title name for the title bar of the window
+ **no_move: Allows for the window's position to be changed or fixed
+ **no_scrollbar: Disable scrollbars (window can still scroll with mouse or programmatically)
+ **no_collapse: Disable user collapsing window by double-clicking on it
+ **horizontal_scrollbar: Allow horizontal scrollbar to appear (off by default).
+ **no_focus_on_appearing: Disable taking focus when transitioning from hidden to visible state
+ **no_bring_to_front_on_focus: Disable bringing window to front when taking focus (e.g. clicking on it or
+ programmatically giving it focus)
+ **menubar: Decides if the menubar is shown or not.
+ **no_close: Decides if the window can be closed.
+ **no_background:
+ **label: Displayed name of the item.
+ **show: sets if the item is shown or not window.
+ **on_close: Callback ran when window is closed
+ **min_size: Minimum window size
+ **max_size: Maximum window size
+
+ Returns:
+ None
+ """
+ try:
+ if label == "__DearPyGuiDefault":
+ yield internal_dpg.add_window(*args, width=width, height=height, x_pos=x_pos, y_pos=y_pos, autosize=autosize,
+ no_resize=no_resize, no_title_bar=no_title_bar, no_move=no_move,
+ no_scrollbar=no_scrollbar, no_collapse=no_collapse,
+ horizontal_scrollbar=horizontal_scrollbar,
+ no_focus_on_appearing=no_focus_on_appearing,
+ no_bring_to_front_on_focus=no_bring_to_front_on_focus,
+ menubar=menubar, no_close=no_close, no_background=no_background,
+ show=show, collapsed=collapsed, on_close=on_close,
+ min_size=min_size, max_size=max_size)
+ else:
+ yield internal_dpg.add_window(*args, width=width, height=height, x_pos=x_pos, y_pos=y_pos, autosize=autosize,
+ no_resize=no_resize, no_title_bar=no_title_bar, no_move=no_move,
+ no_scrollbar=no_scrollbar, no_collapse=no_collapse,
+ horizontal_scrollbar=horizontal_scrollbar,
+ no_focus_on_appearing=no_focus_on_appearing,
+ no_bring_to_front_on_focus=no_bring_to_front_on_focus,
+ menubar=menubar, no_close=no_close,
+ no_background=no_background, label=label, show=show,
+ collapsed=collapsed, on_close=on_close,
+ min_size=min_size, max_size=max_size)
+ finally:
+ internal_dpg.end()
+
+
+@contextmanager
+def menu_bar(*args, show: bool = True, parent: str = "", before: str = ""):
+ """Wraps add_menu_bar() and automates calling end().
+
+ Args:
+ name: Unique name used to programmatically refer to the item. If label is unused this will be the label,
+ anything after "##" that occurs in the name will not be shown on screen.
+ **show: Decides if the item is shown of not.
+ **parent: Parent this item will be added to. (runtime adding)
+ **before: This item will be displayed before the specified item in the parent. (runtime adding)
+
+ Returns:
+ None
+ """
+ try:
+ yield internal_dpg.add_menu_bar(*args, show=show, parent=parent, before=before)
+ finally:
+ internal_dpg.end()
+
+
+@contextmanager
+def menu(*args, label: str = "__DearPyGuiDefault", show: bool = True, parent: str = "",
+ before: str = "", enabled: bool = True):
+ """Wraps add_menu() and automates calling end().
+
+ Args:
+ name: Unique name used to programmatically refer to the item. If label is unused this will be the label,
+ anything after "##" that occurs in the name will not be shown on screen.
+ **label: Displayed name of the item.
+ **show: Decides if the item is shown of not.
+ **parent: Parent this item will be added to. (runtime adding)
+ **before: This item will be displayed before the specified item in the parent. (runtime adding)
+ **enabled: Will enable or disable the menu.
+
+ Returns:
+ None
+ """
+ try:
+ if label == "__DearPyGuiDefault":
+ yield internal_dpg.add_menu(*args, show=show, parent=parent, before=before, enabled=enabled)
+ else:
+ yield internal_dpg.add_menu(*args, label=label, show=show, parent=parent,
+ before=before, enabled=enabled)
+ finally:
+ internal_dpg.end()
+
+
+@contextmanager
+def child(*args, show: bool = True, parent: str = "", before: str = "", width: int = 0,
+ height: int = 0, border: bool = True, autosize_x: bool = False, autosize_y: bool = False,
+ no_scrollbar: bool = False, horizontal_scrollbar: bool = False, menubar: bool = False):
+ """Wraps add_child() and automates calling end().
+
+ Args:
+ name: Unique name used to programmatically refer to the item. If label is unused this will be the label,
+ anything after "##" that occurs in the name will not be shown on screen.
+ show: Decides if the item is shown of not.
+ **parent: Parent to add this item to. (runtime adding)
+ **before: This item will be displayed before the specified item in the parent. (runtime adding)
+ **width: Width of the item.
+ **height: Height of the item.
+ **border: Shows/Hides the border around the sides
+ **autosize_x: Autosize the window to fit its items in the x.
+ **autosize_y: Autosize the window to fit its items in the y.
+ **no_scrollbar: Disable scrollbars (window can still scroll with mouse or programmatically)
+ **horizontal_scrollbar: Allow horizontal scrollbar to appear (off by default)
+ **menubar: adds a bar to add menus
+
+ Returns:
+ None
+ """
+ try:
+ yield internal_dpg.add_child(*args, show=show, parent=parent, before=before, width=width,
+ height=height, border=border, autosize_x=autosize_x, autosize_y=autosize_y,
+ no_scrollbar=no_scrollbar, horizontal_scrollbar=horizontal_scrollbar,
+ menubar=menubar)
+ finally:
+ internal_dpg.end()
+
+
+@contextmanager
+def collapsing_header(*args, label: str = "__DearPyGuiDefault", show: bool = True,
+ parent: str = "", before: str = "",closable: bool = False,
+ default_open: bool = False, open_on_double_click: bool = False, open_on_arrow: bool = False,
+ leaf: bool = False, bullet: bool = False):
+ """Wraps add_collapsing_header() and automates calling end().
+
+ Args:
+ name: Unique name used to programmatically refer to the item. If label is unused this will be the label,
+ anything after "##" that occurs in the name will not be shown on screen.
+ **label: Displayed name of the item.
+ **show: Decides if the item is shown of not.
+ **parent: Parent to add this item to. (runtime adding)
+ **before: This item will be displayed before the specified item in the parent. (runtime adding)
+ **closable: Decides if the header can be collapsed.
+ **default_open: Decides if item is open by default.
+ **open_on_double_click: Need double-click to open node.
+ **open_on_arrow: Only open when clicking on the arrow part.
+ **leaf: No collapsing, no arrow (use as a convenience for leaf nodes).
+ **bullet: Display a bullet instead of arrow.
+
+
+ Returns:
+ None
+ """
+ try:
+ if label == "__DearPyGuiDefault":
+ yield internal_dpg.add_collapsing_header(*args, show=show, parent=parent, before=before,
+ closable=closable, default_open=default_open,
+ open_on_double_click=open_on_double_click,
+ open_on_arrow=open_on_arrow, leaf=leaf, bullet=bullet)
+ else:
+ yield internal_dpg.add_collapsing_header(*args, show=show, label=label, parent=parent, before=before,
+ closable=closable, default_open=default_open,
+ open_on_double_click=open_on_double_click,
+ open_on_arrow=open_on_arrow, leaf=leaf, bullet=bullet)
+ finally:
+ internal_dpg.end()
+
+
+@contextmanager
+def group(*args, show: bool = True, parent: str = "", before: str = "", width: int = 0,
+ horizontal: bool = False, horizontal_spacing: float = -1.0):
+ """Wraps add_group() and automates calling end().
+
+ Args:
+ name: Unique name used to programmatically refer to the item. If label is unused this will be the label,
+ anything after "##" that occurs in the name will not be shown on screen.
+ **show: Decides if the item is shown of not.
+ **parent: Parent to add this item to. (runtime adding)
+ **before: This item will be displayed before the specified item in the parent. (runtime adding)
+ **width: Width of the item.
+ **horizontal: Adds the items on the same row by default.
+ **horizontal_spacing: Decides the spacing for the items.
+
+ Returns:
+ None
+ """
+ try:
+ yield internal_dpg.add_group(*args, show=show, parent=parent, before=before, width=width,
+ horizontal=horizontal, horizontal_spacing=horizontal_spacing)
+ finally:
+ internal_dpg.end()
+
+@contextmanager
+def node(*args, label: str = "__DearPyGuiDefault", show: bool = True, draggable: bool = True,
+ parent: str = "", before: str = "", x_pos: int = 100, y_pos: int = 100):
+ """Wraps add_node() and automates calling end().
+
+ Args:
+ name: Unique name used to programmatically refer to the item. If label is unused this will be the label,
+ anything after "##" that occurs in the name will not be shown on screen.
+ **label: Displayed name of the item.
+ **parent: Parent to add this item to. (runtime adding)
+ **before: This item will be displayed before the specified item in the parent. (runtime adding)
+ **show: sets if the item is shown or not window.
+ **draggable: Allow node to be draggable.
+ **x_pos: x position the node will start at
+ **y_pos: y position the node will start at
+
+ Returns:
+ None
+ """
+ try:
+ if label == "__DearPyGuiDefault":
+ yield internal_dpg.add_node(*args, show=show, parent=parent, before=before,
+ draggable=draggable, x_pos=x_pos, y_pos=y_pos)
+ else:
+ yield internal_dpg.add_node(*args, label=label, show=show, parent=parent, before=before,
+ draggable=draggable, x_pos=x_pos, y_pos=y_pos)
+ finally:
+ internal_dpg.end()
+
+@contextmanager
+def node_attribute(*args, show: bool = True, output: bool = False,
+ static: bool = False, parent: str = "", before: str = "", shape: int = 1):
+ """Wraps add_node_attribute() and automates calling end().
+
+ Args:
+ name: Unique name used to programmatically refer to the item. If label is unused this will be the label,
+ anything after "##" that occurs in the name will not be shown on screen.
+ **parent: Parent to add this item to. (runtime adding)
+ **before: This item will be displayed before the specified item in the parent. (runtime adding)
+ **show: sets if the item is shown or not window.
+ **output: Set as output attribute
+ **static: Set as static attribute
+
+ Returns:
+ None
+ """
+ try:
+ yield internal_dpg.add_node_attribute(*args, show=show, parent=parent, before=before,
+ output=output, static=static, shape=shape)
+
+ finally:
+ internal_dpg.end()
+
+@contextmanager
+def node_editor(*args, show: bool = True, parent: str = "", before: str = "", link_callback: Callable = None, delink_callback: Callable = None):
+ """Wraps add_node_editor() and automates calling end().
+
+ Args:
+ name: Unique name used to programmatically refer to the item. If label is unused this will be the label,
+ anything after "##" that occurs in the name will not be shown on screen.
+ **parent: Parent to add this item to. (runtime adding)
+ **before: This item will be displayed before the specified item in the parent. (runtime adding)
+ **show: sets if the item is shown or not window.
+ **link_callback: Callback ran when a new link is created
+ **delink_callback: Callback ran when a link is detached
+
+ Returns:
+ None
+ """
+ try:
+ yield internal_dpg.add_node_editor(*args, show=show, parent=parent, before=before, link_callback=link_callback, delink_callback=delink_callback)
+ finally:
+ internal_dpg.end()
+
+
+@contextmanager
+def tab_bar(*args, reorderable: bool = False, callback: Callable = None, callback_data: Any = None, show: bool = True,
+ parent: str = "", before: str = ""):
+ """Wraps add_tab_bar() and automates calling end().
+
+ Args:
+ name: Unique name used to programmatically refer to the item. If label is unused this will be the label,
+ anything after "##" that occurs in the name will not be shown on screen.
+ **reorderable: Allows for moveable tabs.
+ **callback: Registers a callback.
+ **callback_data: Callback data.
+ **show: Decides if the item is shown of not.
+ **parent: Parent to add this item to. (runtime adding)
+ **before: This item will be displayed before the specified item in the parent. (runtime adding)
+
+ Returns:
+ None
+ """
+ try:
+ yield internal_dpg.add_tab_bar(*args, reorderable=reorderable, callback=callback, callback_data=callback_data,
+ show=show, parent=parent, before=before)
+ finally:
+ internal_dpg.end()
+
+
+@contextmanager
+def tab(*args, closable: bool = False, label: str = "__DearPyGuiDefault", show: bool = True,
+ no_reorder: bool = False, leading: bool = False, trailing: bool = False, no_tooltip: bool = False,
+ parent: str = "", before: str = ""):
+ """Wraps add_tab() and automates calling end().
+
+ Args:
+ name: Unique name used to programmatically refer to the item. If label is unused this will be the label,
+ anything after "##" that occurs in the name will not be shown on screen.
+ **closable: creates a button on the tab that can hide the tab.
+ **label: Displayed name of the item.
+ **show: Decides if the item is shown of not.
+ **no_reorder: Disable reordering this tab or having another tab cross over this tab
+ **leading: Enforce the tab position to the left of the tab bar (after the tab list popup button)
+ **trailing: Enforce the tab position to the right of the tab bar (before the scrolling buttons)
+ **no_tooltip: Disable tooltip for the given tab
+ **parent: Parent to add this item to. (runtime adding)
+ **before: This item will be displayed before the specified item in the parent. (runtime adding)
+
+ Returns:
+ None
+ """
+ try:
+ if label == "__DearPyGuiDefault":
+ yield internal_dpg.add_tab(*args, closable=closable, show=show, parent=parent, before=before,
+ no_reorder=no_reorder, leading=leading, trailing=trailing, no_tooltip=no_tooltip)
+ else:
+ yield internal_dpg.add_tab(*args, closable=closable, label=label, show=show, parent=parent,
+ before=before, no_reorder=no_reorder, leading=leading, trailing=trailing, no_tooltip=no_tooltip)
+ finally:
+ internal_dpg.end()
+
+
+@contextmanager
+def tree_node(*args, label: str = "__DearPyGuiDefault", show: bool = True, parent: str = "",
+ before: str = "", default_open: bool = False, open_on_double_click: bool = False,
+ open_on_arrow: bool = False, leaf: bool = False, bullet: bool = False):
+ """Wraps add_tree_node() and automates calling end().
+
+ Args:
+ name: Unique name used to programmatically refer to the item. If label is unused this will be the label,
+ anything after "##" that occurs in the name will not be shown on screen.
+ **label: Displayed name of the item.
+ **show: Decides if the item is shown of not.
+ **parent: Parent to add this item to. (runtime adding)
+ **before: This item will be displayed before the specified item in the parent. (runtime adding)
+ **default_open: Decides if item is open by default.
+ **open_on_double_click: Need double-click to open node.
+ **open_on_arrow: Only open when clicking on the arrow part.
+ **leaf: No collapsing, no arrow (use as a convenience for leaf nodes).
+ **bullet: Display a bullet instead of arrow.
+
+ Returns:
+ None
+ """
+ try:
+ if label == "__DearPyGuiDefault":
+ yield internal_dpg.add_tree_node(*args, show=show, parent=parent,
+ before=before, default_open=default_open,
+ open_on_double_click=open_on_double_click,
+ open_on_arrow=open_on_arrow,
+ leaf=leaf, bullet=bullet)
+ else:
+ yield internal_dpg.add_tree_node(*args, show=show, parent=parent,
+ before=before, default_open=default_open,
+ open_on_double_click=open_on_double_click,
+ open_on_arrow=open_on_arrow,
+ leaf=leaf, bullet=bullet, label=label)
+ finally:
+ internal_dpg.end()
+
+
+@contextmanager
+def tooltip(*args, parent: str = "", before: str = "", show: bool = True):
+ """Wraps add_tooltip() and automates calling end().
+
+ Args:
+ tipparent: Sets the item's tool tip to be the same as the named item's tool tip.
+ name: Unique name used to programmatically refer to the item. If label is unused this will be the label,
+ anything after "##" that occurs in the name will not be shown on screen.
+ **parent: Parent to add this item to. (runtime adding)
+ **before: This item will be displayed before the specified item in the parent. (runtime adding)
+ **show: Decides if the item is shown of not.
+
+ Returns:
+ None
+ """
+ try:
+ yield internal_dpg.add_tooltip(*args, parent=parent, before=before, show=show)
+ finally:
+ internal_dpg.end()
+
+
+@contextmanager
+def popup(*args, mousebutton: int = 1, modal: bool = False, parent: str = "",
+ before: str = "", width: int = 0, height: int = 0, show: bool = True):
+ """Wraps add_popup() and automates calling end().
+
+ Args:
+ popupparent: Parent that the popup will be assigned to.
+ name: Unique name used to programmatically refer to the item. If label is unused this will be the label,
+ anything after "##" that occurs in the name will not be shown on screen.
+ **mousebutton: The mouse code that will trigger the popup. Default is 1 or mvMouseButton_Right.
+ (mvMouseButton_Left, mvMouseButton_Right, mvMouseButton_Middle, mvMouseButton_X1, mvMouseButton_X2)
+ **modal: Makes the popup modal.
+ **parent: Parent to add this item to. (runtime adding)
+ **before: This item will be displayed before the specified item in the parent. (runtime adding)
+ **width: Width of the item.
+ **height: Height of the item.
+ **show: Decides if the item is shown of not.
+
+ Returns:
+ None
+ """
+ try:
+ yield internal_dpg.add_popup(*args, mousebutton=mousebutton, modal=modal, parent=parent,
+ before=before, width=width, height=height, show=show)
+ finally:
+ internal_dpg.end()
+
+########################################################################################################################
+# Old Commands
+########################################################################################################################
+
+
+# window configure
+def set_window_pos(window: str, x: int, y: int):
+ """Sets the top left corner of the window to the specified position.
+
+ Args:
+ window: window to position
+ x: The x position.
+ y: The y position.
+
+ Returns:
+ None
+ """
+ internal_dpg.configure_item(window, x_pos=x, y_pos=y)
+
+
+def get_window_pos(window: str) -> Union[List[int], None]:
+ """Gets the top left corner of the window to the specified position.
+
+ Args:
+ window: window to retrieve position
+ x: The x position.
+ y: The y position.
+
+ Returns:
+ list as [x,y] or None
+ """
+ config = internal_dpg.get_item_configuration(window)
+ return [config["x_pos"], config["y_pos"]]
+
+
+def show_item(item: str):
+ """Shows the item.
+
+ Args:
+ item: Item to show.
+
+ Returns:
+ None
+ """
+ internal_dpg.configure_item(item, show=True)
+
+
+def hide_item(item: str, *, children_only: bool = False):
+ """Hides the item.
+
+ Args:
+ **item: Item to hide.
+
+ Returns:
+ None
+ """
+ if children_only:
+ children = internal_dpg.get_item_children(item)
+ for child in children:
+ internal_dpg.configure_item(child, show=False)
+ else:
+ internal_dpg.configure_item(item, show=False)
+
+
+# item configure commands
+def set_item_name(item: str, name: str):
+ """Sets the item's name, anything after the characters "##" in the name will not be shown.
+
+ If no label is specified then by default this will be the displayed label.
+
+ Args:
+ item: Item name will be applied to.
+ name: Unique name used to programmatically refer to the item. If label is unused this will be the label,
+ anything after "##" that occurs in the name will not be shown on screen.
+
+ Returns:
+ None
+ """
+ internal_dpg.configure_item(item, name=name)
+
+
+def set_item_label(item: str, label: str):
+ """Sets the item's displayed label, anything after the characters "##" in the name will not be shown.
+
+ Args:
+ item: Item label will be applied to.
+ label: Displayed name of the item.
+
+ Returns:
+ None
+ """
+ internal_dpg.configure_item(item, label=label)
+
+
+def set_item_width(item: str, width: int):
+ """Sets the item's width.
+
+ Args:
+ item: Item the Width will be applied to.
+ width: Width of the item. width to be applied.
+
+ Returns:
+ None
+ """
+ internal_dpg.configure_item(item, width=width)
+
+
+def set_item_height(item: str, height: int):
+ """Sets the item's height.
+
+ Args:
+ item: Item the Height will be applied to.
+ height: Height of the item. height to be applied.
+
+ Returns:
+ None
+ """
+ internal_dpg.configure_item(item, height=height)
+
+
+def get_item_label(item: str) -> Union[str, None]:
+ """Gets the item's label.
+
+ Returns:
+ label as a string or None
+ """
+ return internal_dpg.get_item_configuration(item)["label"]
+
+
+def get_item_width(item: str) -> Union[int, None]:
+ """Gets the item's width.
+
+ Returns:
+ width as a int or None
+ """
+ return internal_dpg.get_item_configuration(item)["width"]
+
+
+def get_item_height(item: str) -> Union[int, None]:
+ """Gets the item's height.
+
+ Returns:
+ height as a int or None
+ """
+ return internal_dpg.get_item_configuration(item)["height"]
+
+
+def set_drawing_size(drawing: str, width: int, height: int):
+ """Sets the drawing's size, width and height.
+
+ Args:
+ drawing: Drawing that will be set.
+ width: x axis width to set
+ height: y axis height to set
+
+ Returns:
+ None
+ """
+ internal_dpg.configure_item(drawing, width=width, height=height)
+
+
+def get_drawing_size(drawing: str) -> Union[List[int], None]:
+ """Gets the drawing's scale.
+
+ Args:
+ drawing: Drawing that will be set.
+
+ Returns:
+ list as [width, height] or None
+ """
+ config = internal_dpg.get_item_configuration(drawing)
+ return [config["width"], config["height"]]
+
+def show_style_editor(sender: str="", data: Any=None) -> None:
+ """Shows the standard style editor window
+
+ Returns:
+ None
+ """
+ internal_dpg.configure_item("style##standard", show=True)
+
+def show_metrics(sender: str="", data: Any=None) -> None:
+ """Shows the standard metrics window
+
+ Returns:
+ None
+ """
+ internal_dpg.configure_item("metrics##standard", show=True)
+
+def show_about(sender: str="", data: Any=None) -> None:
+ """Shows the standard about window
+
+ Returns:
+ None
+ """
+ internal_dpg.configure_item("about##standard", show=True)
+
+def show_debug(sender: str="", data: Any=None) -> None:
+ """Shows the standard debug window
+
+ Returns:
+ None
+ """
+ internal_dpg.configure_item("debug##standard", show=True)
+
+def show_documentation(sender: str="", data: Any=None) -> None:
+ """Shows the standard documentation window
+
+ Returns:
+ None
+ """
+ internal_dpg.configure_item("documentation##standard", show=True)
diff --git a/DearPyGui/src/core/AppItems/basic/mvButton.cpp b/DearPyGui/src/core/AppItems/basic/mvButton.cpp
new file mode 100644
index 000000000..489febfe8
--- /dev/null
+++ b/DearPyGui/src/core/AppItems/basic/mvButton.cpp
@@ -0,0 +1,90 @@
+#include
+#include "mvButton.h"
+#include "mvCore.h"
+#include "mvApp.h"
+#include "mvItemRegistry.h"
+#include "mvImGuiThemeScope.h"
+#include "mvFontScope.h"
+
+namespace Marvel {
+
+ void mvButton::InsertParser(std::map* parsers)
+ {
+ parsers->insert({ s_command, mvPythonParser({
+ {mvPythonDataType::Optional},
+ {mvPythonDataType::String, "name"},
+ {mvPythonDataType::KeywordOnly},
+ {mvPythonDataType::Bool, "small", "Small button, useful for embedding in text.", "False"},
+ {mvPythonDataType::Bool, "arrow", "Arrow button, must use with direction", "False"},
+ {mvPythonDataType::Integer, "direction", "A cardinal direction", "0"},
+ {mvPythonDataType::Callable, "callback", "Registers a callback", "None"},
+ {mvPythonDataType::Object, "callback_data", "Callback data", "None"},
+ {mvPythonDataType::String, "parent", "Parent to add this item to. (runtime adding)", "''"},
+ {mvPythonDataType::String, "before", "This item will be displayed before the specified item in the parent. (runtime adding)", "''"},
+ {mvPythonDataType::Integer, "width","", "0"},
+ {mvPythonDataType::Integer, "height", "", "0"},
+ {mvPythonDataType::String, "label", "Overrides 'name' as label", "''"},
+ {mvPythonDataType::Bool, "show", "Attempt to render", "True"},
+ {mvPythonDataType::Bool, "enabled", "", "True"},
+ }, "Adds a button.", "None", "Adding Widgets") });
+ }
+
+ mvButton::mvButton(const std::string& name)
+ :
+ mvAppItem(name)
+ {
+ }
+
+ void mvButton::draw(ImDrawList* drawlist, float x, float y)
+ {
+ ScopedID id;
+ mvImGuiThemeScope scope(this);
+ mvFontScope fscope(this);
+
+ if (m_small_button)
+ {
+ if (ImGui::SmallButton(m_label.c_str()))
+ mvApp::GetApp()->getCallbackRegistry().addCallback(getCallback(false), m_name, m_callback_data);
+ return;
+ }
+
+ if (m_arrow)
+ {
+ if (ImGui::ArrowButton(m_label.c_str(), m_direction))
+ mvApp::GetApp()->getCallbackRegistry().addCallback(getCallback(false), m_name, m_callback_data);
+
+ return;
+ }
+
+ if (ImGui::Button(m_label.c_str(), ImVec2((float)m_width, (float)m_height)))
+ mvApp::GetApp()->getCallbackRegistry().addCallback(getCallback(false), m_name, m_callback_data);
+
+ }
+
+ void mvButton::setExtraConfigDict(PyObject* dict)
+ {
+ if (dict == nullptr)
+ return;
+
+ if (PyObject* item = PyDict_GetItemString(dict, "small")) m_small_button = ToBool(item);
+ if (PyObject* item = PyDict_GetItemString(dict, "arrow")) m_arrow = ToBool(item);
+
+ if (PyObject* item = PyDict_GetItemString(dict, "direction"))
+ {
+ m_direction = ToInt(item);
+ DecodelibID(m_direction, &m_direction);
+ }
+
+ }
+
+ void mvButton::getExtraConfigDict(PyObject* dict)
+ {
+ if (dict == nullptr)
+ return;
+
+ PyDict_SetItemString(dict, "small", ToPyBool(m_small_button));
+ PyDict_SetItemString(dict, "arrow", ToPyBool(m_arrow));
+ PyDict_SetItemString(dict, "direction", ToPyInt(MV_ENCODE_CONSTANT(m_direction, 0)));
+ }
+
+}
\ No newline at end of file
diff --git a/DearPyGui/src/core/AppItems/basic/mvButton.h b/DearPyGui/src/core/AppItems/basic/mvButton.h
new file mode 100644
index 000000000..74bb0a166
--- /dev/null
+++ b/DearPyGui/src/core/AppItems/basic/mvButton.h
@@ -0,0 +1,82 @@
+#pragma once
+
+#include "mvTypeBases.h"
+
+namespace Marvel {
+
+ MV_REGISTER_WIDGET(mvButton, MV_ITEM_DESC_DEFAULT, StorageValueTypes::None, 1);
+ class mvButton : public mvAppItem
+ {
+ public:
+
+ static void InsertParser(std::map* parsers);
+
+ MV_APPLY_WIDGET_REGISTRATION(mvAppItemType::mvButton, add_button)
+
+ MV_CREATE_CONSTANT(mvDir_None , -1L, 0L);
+ MV_CREATE_CONSTANT(mvDir_Left , 0L, 0L);
+ MV_CREATE_CONSTANT(mvDir_Right , 1L, 0L);
+ MV_CREATE_CONSTANT(mvDir_Up , 2L, 0L);
+ MV_CREATE_CONSTANT(mvDir_Down , 3L, 0L);
+
+ MV_CREATE_CONSTANT(mvThemeCol_Button_Text , ImGuiCol_Text , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_Button_Bg , ImGuiCol_Button , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_Button_Hovered , ImGuiCol_ButtonHovered, 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_Button_Active , ImGuiCol_ButtonActive , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_Button_Border , ImGuiCol_Border , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_Button_BorderShadow , ImGuiCol_BorderShadow , 0L);
+
+ MV_CREATE_CONSTANT(mvThemeStyle_Button_Rounding , ImGuiStyleVar_FrameRounding , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_Button_BorderSize , ImGuiStyleVar_FrameBorderSize , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_Button_TextAlignX , ImGuiStyleVar_ButtonTextAlign , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_Button_TextAlignY , ImGuiStyleVar_ButtonTextAlign , 1L);
+ MV_CREATE_CONSTANT(mvThemeStyle_Button_PaddingX , ImGuiStyleVar_FramePadding , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_Button_PaddingY , ImGuiStyleVar_FramePadding , 1L);
+
+ MV_START_EXTRA_COMMANDS
+ MV_END_EXTRA_COMMANDS
+
+ MV_START_GENERAL_CONSTANTS
+ MV_ADD_GENERAL_CONSTANT(mvDir_None),
+ MV_ADD_GENERAL_CONSTANT(mvDir_Left),
+ MV_ADD_GENERAL_CONSTANT(mvDir_Right),
+ MV_ADD_GENERAL_CONSTANT(mvDir_Up),
+ MV_ADD_GENERAL_CONSTANT(mvDir_Down),
+ MV_END_GENERAL_CONSTANTS
+
+ MV_START_COLOR_CONSTANTS
+ MV_ADD_CONSTANT(mvThemeCol_Button_Text, mvColor(255, 255, 255, 255), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_Button_Bg, mvColor( 41, 74, 122, 138), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_Button_Hovered, mvColor( 66, 150, 250, 102), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_Button_Active, mvColor( 66, 150, 250, 171), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_Button_Border, mvColor(110, 110, 128, 128), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_Button_BorderShadow, mvColor( 0, 0, 0, 0), mvColor(128, 128, 128, 63)),
+ MV_END_COLOR_CONSTANTS
+
+ MV_START_STYLE_CONSTANTS
+ MV_ADD_CONSTANT(mvThemeStyle_Button_Rounding , 0 ,12),
+ MV_ADD_CONSTANT(mvThemeStyle_Button_BorderSize , 0 , 1),
+ MV_ADD_CONSTANT(mvThemeStyle_Button_TextAlignX , 0.5f , 1),
+ MV_ADD_CONSTANT(mvThemeStyle_Button_TextAlignY , 0.5f , 1),
+ MV_ADD_CONSTANT(mvThemeStyle_Button_PaddingX , 4 ,20),
+ MV_ADD_CONSTANT(mvThemeStyle_Button_PaddingY , 3 ,20),
+ MV_END_STYLE_CONSTANTS
+
+ public:
+
+ mvButton(const std::string& name);
+
+ void draw(ImDrawList* drawlist, float x, float y) override;
+
+ void setExtraConfigDict(PyObject* dict) override;
+ void getExtraConfigDict(PyObject* dict) override;
+
+ private:
+
+ ImGuiDir m_direction = ImGuiDir_Up;
+ bool m_small_button = false;
+ bool m_arrow = false;
+
+ };
+
+}
diff --git a/DearPyGui/src/core/AppItems/basic/mvCheckbox.cpp b/DearPyGui/src/core/AppItems/basic/mvCheckbox.cpp
new file mode 100644
index 000000000..53d638070
--- /dev/null
+++ b/DearPyGui/src/core/AppItems/basic/mvCheckbox.cpp
@@ -0,0 +1,47 @@
+#include
+#include "mvCheckbox.h"
+#include "mvApp.h"
+#include "mvItemRegistry.h"
+#include "mvImGuiThemeScope.h"
+#include "mvFontScope.h"
+
+namespace Marvel {
+
+ void mvCheckbox::InsertParser(std::map* parsers)
+ {
+ parsers->insert({ s_command, mvPythonParser({
+ {mvPythonDataType::Optional},
+ {mvPythonDataType::String, "name"},
+ {mvPythonDataType::KeywordOnly},
+ {mvPythonDataType::Integer, "default_value", "", "False"},
+ {mvPythonDataType::Callable, "callback", "Registers a callback", "None"},
+ {mvPythonDataType::Object, "callback_data", "Callback data", "None"},
+ {mvPythonDataType::String, "parent", "Parent to add this item to. (runtime adding)", "''"},
+ {mvPythonDataType::String, "before", "This item will be displayed before the specified item in the parent. (runtime adding)", "''"},
+ {mvPythonDataType::String, "source", "Overrides 'name' as value storage key", "''"},
+ {mvPythonDataType::String, "label", "Overrides 'name' as label", "''"},
+ {mvPythonDataType::Bool, "show", "Attempt to render", "True"},
+ {mvPythonDataType::Bool, "enabled", "", "True"}
+ }, "Adds a checkbox widget.", "None", "Adding Widgets") });
+ }
+
+ mvCheckbox::mvCheckbox(const std::string& name)
+ :
+ mvBoolPtrBase(name)
+ {
+ }
+
+ void mvCheckbox::draw(ImDrawList* drawlist, float x, float y)
+ {
+ ScopedID id;
+ mvImGuiThemeScope scope(this);
+ mvFontScope fscope(this);
+
+ if (!m_enabled) m_disabled_value = *m_value;
+
+ if (ImGui::Checkbox(m_label.c_str(), m_enabled ? m_value.get() : &m_disabled_value))
+ mvApp::GetApp()->getCallbackRegistry().addCallback(getCallback(false), m_name, m_callback_data);
+
+ }
+
+}
\ No newline at end of file
diff --git a/DearPyGui/src/core/AppItems/basic/mvCheckbox.h b/DearPyGui/src/core/AppItems/basic/mvCheckbox.h
new file mode 100644
index 000000000..4b308c89b
--- /dev/null
+++ b/DearPyGui/src/core/AppItems/basic/mvCheckbox.h
@@ -0,0 +1,68 @@
+#pragma once
+
+#include "mvTypeBases.h"
+
+namespace Marvel {
+
+ MV_REGISTER_WIDGET(mvCheckbox, MV_ITEM_DESC_DEFAULT, StorageValueTypes::Bool, 1);
+ class mvCheckbox : public mvBoolPtrBase
+ {
+
+ public:
+
+ static void InsertParser(std::map* parsers);
+
+ MV_APPLY_WIDGET_REGISTRATION(mvAppItemType::mvCheckbox, add_checkbox)
+
+ MV_CREATE_CONSTANT(mvThemeCol_CheckBox_Text , ImGuiCol_Text , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_CheckBox_Bg , ImGuiCol_FrameBg , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_CheckBox_BgHovered , ImGuiCol_FrameBgHovered , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_CheckBox_BgActive , ImGuiCol_CheckMark , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_CheckBox_Border , ImGuiCol_Border , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_CheckBox_BorderShadow , ImGuiCol_BorderShadow , 0L);
+
+ MV_CREATE_CONSTANT(mvThemeStyle_Checkbox_Rounding , ImGuiStyleVar_FrameRounding , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_Checkbox_BorderSize , ImGuiStyleVar_FrameBorderSize , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_Checkbox_PaddingX , ImGuiStyleVar_FramePadding , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_Checkbox_PaddingY , ImGuiStyleVar_FramePadding , 1L);
+ MV_CREATE_CONSTANT(mvThemeStyle_Checkbox_InnerItemSpacingX , ImGuiStyleVar_ItemInnerSpacing, 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_Checkbox_InnerItemSpacingY , ImGuiStyleVar_ItemInnerSpacing, 1L);
+
+ MV_START_EXTRA_COMMANDS
+ MV_END_EXTRA_COMMANDS
+
+ MV_START_GENERAL_CONSTANTS
+ MV_END_GENERAL_CONSTANTS
+
+ MV_START_COLOR_CONSTANTS
+ MV_ADD_CONSTANT(mvThemeCol_CheckBox_Text, mvColor(255, 255, 255, 255), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_CheckBox_Bg, mvColor( 41, 74, 122, 138), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_CheckBox_BgHovered, mvColor( 66, 150, 250, 102), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_CheckBox_BgActive, mvColor( 66, 150, 250, 171), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_CheckBox_Border, mvColor(110, 110, 128, 128), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_CheckBox_BorderShadow, mvColor( 0, 0, 0, 0), mvColor(128, 128, 128, 63)),
+ MV_END_COLOR_CONSTANTS
+
+ MV_START_STYLE_CONSTANTS
+ MV_ADD_CONSTANT(mvThemeStyle_Checkbox_BorderSize , 0, 1),
+ MV_ADD_CONSTANT(mvThemeStyle_Checkbox_Rounding , 0, 12),
+ MV_ADD_CONSTANT(mvThemeStyle_Checkbox_PaddingX , 4, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_Checkbox_PaddingY , 3, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_Checkbox_InnerItemSpacingX , 4, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_Checkbox_InnerItemSpacingY , 4, 20),
+ MV_END_STYLE_CONSTANTS
+
+ public:
+
+ mvCheckbox(const std::string& name);
+
+ void draw(ImDrawList* drawlist, float x, float y) override;
+
+ private:
+
+ bool m_default_value = false;
+ std::string m_source = "";
+
+ };
+
+}
diff --git a/DearPyGui/src/core/AppItems/basic/mvColorButton.cpp b/DearPyGui/src/core/AppItems/basic/mvColorButton.cpp
new file mode 100644
index 000000000..94f9005a4
--- /dev/null
+++ b/DearPyGui/src/core/AppItems/basic/mvColorButton.cpp
@@ -0,0 +1,82 @@
+#include "mvColorButton.h"
+#include "mvApp.h"
+#include
+#include "mvItemRegistry.h"
+#include "mvImGuiThemeScope.h"
+#include "mvFontScope.h"
+
+namespace Marvel {
+
+ void mvColorButton::InsertParser(std::map* parsers)
+ {
+ parsers->insert({ s_command, mvPythonParser({
+ {mvPythonDataType::Optional},
+ {mvPythonDataType::String, "name"},
+ {mvPythonDataType::KeywordOnly},
+ {mvPythonDataType::IntList, "default_value", "", "(0, 0, 0, 255)"},
+ {mvPythonDataType::Callable, "callback", "Registers a callback", "None"},
+ {mvPythonDataType::Object, "callback_data", "Callback data", "None"},
+ {mvPythonDataType::String, "parent", "Parent to add this item to. (runtime adding)", "''"},
+ {mvPythonDataType::String, "before", "This item will be displayed before the specified item in the parent. (runtime adding)", "''"},
+ {mvPythonDataType::Integer, "width","", "0"},
+ {mvPythonDataType::Integer, "height", "", "0"},
+ {mvPythonDataType::Bool, "show", "Attemp to render", "True"},
+ {mvPythonDataType::Bool, "no_alpha", "ignore Alpha component", "False"},
+ {mvPythonDataType::Bool, "no_border", "disable border (which is enforced by default)", "False"},
+ {mvPythonDataType::Bool, "no_drag_drop", "disable display of inline text label", "False"},
+ {mvPythonDataType::Bool, "enabled", "", "True"},
+ }, "Adds a color button.", "None", "Adding Widgets") });
+ }
+
+ mvColorButton::mvColorButton(const std::string& name)
+ :
+ mvColorPtrBase(name)
+ {
+ }
+
+ void mvColorButton::draw(ImDrawList* drawlist, float x, float y)
+ {
+ ScopedID id;
+ mvImGuiThemeScope scope(this);
+ mvFontScope fscope(this);
+
+ ImVec4 col = { (*m_value)[0], (*m_value)[1], (*m_value)[2], (*m_value)[3] };
+
+ if (ImGui::ColorButton(m_label.c_str(), col, m_flags, ImVec2((float)m_width, (float)m_height)))
+ mvApp::GetApp()->getCallbackRegistry().addCallback(getCallback(false), m_name, m_callback_data);
+
+ }
+
+ void mvColorButton::setExtraConfigDict(PyObject* dict)
+ {
+ if (dict == nullptr)
+ return;
+
+
+ // helpers for bit flipping
+ auto flagop = [dict](const char* keyword, int flag, int& flags)
+ {
+ if (PyObject* item = PyDict_GetItemString(dict, keyword)) ToBool(item) ? flags |= flag : flags &= ~flag;
+ };
+ flagop("no_alpha", ImGuiColorEditFlags_NoAlpha, m_flags);
+ flagop("no_border", ImGuiColorEditFlags_NoBorder, m_flags);
+ flagop("no_drag_drop", ImGuiColorEditFlags_NoDragDrop, m_flags);
+ }
+
+ void mvColorButton::getExtraConfigDict(PyObject* dict)
+ {
+ if (dict == nullptr)
+ return;
+
+ // helper to check and set bit
+ auto checkbitset = [dict](const char* keyword, int flag, const int& flags)
+ {
+ PyDict_SetItemString(dict, keyword, ToPyBool(flags & flag));
+ };
+
+ checkbitset("no_alpha", ImGuiColorEditFlags_NoAlpha, m_flags);
+ checkbitset("no_border", ImGuiColorEditFlags_NoBorder, m_flags);
+ checkbitset("no_drag_drop", ImGuiColorEditFlags_NoDragDrop, m_flags);
+ }
+
+}
\ No newline at end of file
diff --git a/DearPyGui/src/core/AppItems/basic/mvColorButton.h b/DearPyGui/src/core/AppItems/basic/mvColorButton.h
new file mode 100644
index 000000000..abfe3b773
--- /dev/null
+++ b/DearPyGui/src/core/AppItems/basic/mvColorButton.h
@@ -0,0 +1,73 @@
+#pragma once
+
+#include "mvTypeBases.h"
+
+namespace Marvel {
+
+ MV_REGISTER_WIDGET(mvColorButton, MV_ITEM_DESC_DEFAULT, StorageValueTypes::None, 1);
+ class mvColorButton : public mvColorPtrBase
+ {
+
+ public:
+
+ static void InsertParser(std::map* parsers);
+
+ MV_APPLY_WIDGET_REGISTRATION(mvAppItemType::mvColorButton, add_color_button)
+
+ MV_CREATE_CONSTANT(mvThemeCol_ColorButton_Text , ImGuiCol_Text , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_ColorButton_Separator , ImGuiCol_Separator , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_ColorButton_PopupBg , ImGuiCol_PopupBg , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_ColorButton_DragDrop , ImGuiCol_DragDropTarget , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_ColorButton_Border , ImGuiCol_Border , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_ColorButton_BorderShadow , ImGuiCol_BorderShadow , 0L);
+
+ MV_CREATE_CONSTANT(mvThemeStyle_ColorButton_Rounding , ImGuiStyleVar_FrameRounding , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_ColorButton_BorderSize , ImGuiStyleVar_FrameBorderSize , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_ColorButton_PopupRounding , ImGuiStyleVar_PopupRounding , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_ColorButton_PopupBorderSize , ImGuiStyleVar_PopupBorderSize , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_ColorButton_PopupPaddingX , ImGuiStyleVar_WindowPadding , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_ColorButton_PopupPaddingY , ImGuiStyleVar_WindowPadding , 1L);
+
+ MV_START_EXTRA_COMMANDS
+ MV_END_EXTRA_COMMANDS
+
+ MV_START_GENERAL_CONSTANTS
+ MV_END_GENERAL_CONSTANTS
+
+ MV_START_COLOR_CONSTANTS
+ MV_ADD_CONSTANT(mvThemeCol_ColorButton_Text , mvColor(255, 255, 255, 255), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_ColorButton_Separator , mvColor(110, 110, 128, 128), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_ColorButton_PopupBg , mvColor( 20, 20, 20, 240), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_ColorButton_DragDrop , mvColor(255, 255, 0, 230), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_ColorButton_Border , mvColor(110, 110, 128, 128), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_ColorButton_BorderShadow , mvColor( 0, 0, 0, 0), mvColor(128, 128, 128, 63)),
+ MV_END_COLOR_CONSTANTS
+
+ MV_START_STYLE_CONSTANTS
+ MV_ADD_CONSTANT(mvThemeStyle_ColorButton_Rounding , 0, 12),
+ MV_ADD_CONSTANT(mvThemeStyle_ColorButton_BorderSize , 0, 1),
+ MV_ADD_CONSTANT(mvThemeStyle_ColorButton_PopupRounding , 0, 12),
+ MV_ADD_CONSTANT(mvThemeStyle_ColorButton_PopupBorderSize, 1, 1),
+ MV_ADD_CONSTANT(mvThemeStyle_ColorButton_PopupPaddingX , 8, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_ColorButton_PopupPaddingY , 8, 20),
+ MV_END_STYLE_CONSTANTS
+
+ public:
+
+ mvColorButton(const std::string& name);
+
+ void draw(ImDrawList* drawlist, float x, float y) override;
+
+ void setExtraConfigDict(PyObject* dict) override;
+ void getExtraConfigDict(PyObject* dict) override;
+
+ private:
+
+ ImGuiColorEditFlags m_flags = ImGuiColorEditFlags_None;
+ bool m_no_alpha = false;
+ bool m_no_border = false;
+ bool m_no_drag_drop = false;
+
+ };
+
+}
diff --git a/DearPyGui/src/core/AppItems/basic/mvColorEdit.cpp b/DearPyGui/src/core/AppItems/basic/mvColorEdit.cpp
new file mode 100644
index 000000000..397bb4a88
--- /dev/null
+++ b/DearPyGui/src/core/AppItems/basic/mvColorEdit.cpp
@@ -0,0 +1,303 @@
+#include "mvColorEdit.h"
+#include "mvApp.h"
+#include
+#include "mvItemRegistry.h"
+#include "mvImGuiThemeScope.h"
+#include "mvFontScope.h"
+
+namespace Marvel {
+
+ void mvColorEdit3::InsertParser(std::map* parsers)
+ {
+
+ parsers->insert({ s_command, mvPythonParser({
+ {mvPythonDataType::Optional},
+ {mvPythonDataType::String, "name"},
+ {mvPythonDataType::KeywordOnly},
+ {mvPythonDataType::IntList, "default_value", "", "(0, 0, 0, 255)"},
+ {mvPythonDataType::Callable, "callback", "Registers a callback", "None"},
+ {mvPythonDataType::Object, "callback_data", "Callback data", "None"},
+ {mvPythonDataType::String, "parent", "Parent to add this item to. (runtime adding)", "''"},
+ {mvPythonDataType::String, "before", "This item will be displayed before the specified item in the parent. (runtime adding)", "''"},
+ {mvPythonDataType::String, "source", "", "''"},
+ {mvPythonDataType::Integer, "width","", "0"},
+ {mvPythonDataType::Integer, "height", "", "0"},
+ {mvPythonDataType::String, "label", "", "''"},
+ {mvPythonDataType::Bool, "show", "Attempt to render", "True"},
+ {mvPythonDataType::Bool, "enabled", "", "True"},
+ {mvPythonDataType::Bool, "no_alpha", "ignore Alpha component", "False"},
+ {mvPythonDataType::Bool, "no_picker", "disable picker when clicking on colored square.", "False"},
+ {mvPythonDataType::Bool, "no_options", " disable toggling options menu when right-clicking on inputs/small preview.", "False"},
+ {mvPythonDataType::Bool, "no_small_preview", "disable colored square preview next to the inputs. For color pickers this only shows if the side preview is not shown.", "False"},
+ {mvPythonDataType::Bool, "no_inputs", "disable inputs sliders/text widgets (e.g. to show only the small preview colored square)", "False"},
+ {mvPythonDataType::Bool, "no_tooltip", "disable tooltip when hovering the preview.", "False"},
+ {mvPythonDataType::Bool, "no_label", "disable display of inline text label", "False"},
+ {mvPythonDataType::Bool, "no_drag_drop", "disable display of inline text label", "False"},
+ {mvPythonDataType::Bool, "alpha_bar", "show vertical alpha bar/gradient in picker.", "False"},
+ {mvPythonDataType::Bool, "alpha_preview", "display preview as a transparent color over a checkerboard, instead of opaque.", "False"},
+ {mvPythonDataType::Bool, "alpha_preview_half", "display half opaque / half checkerboard, instead of opaque.", "False"},
+ {mvPythonDataType::Bool, "display_rgb", "override _display_ type among RGB/HSV/Hex.", "False"},
+ {mvPythonDataType::Bool, "display_hsv", "override _display_ type among RGB/HSV/Hex.", "False"},
+ {mvPythonDataType::Bool, "display_hex", "override _display_ type among RGB/HSV/Hex.", "False"},
+ {mvPythonDataType::Bool, "uint8", "display values formatted as 0..255", "False"},
+ {mvPythonDataType::Bool, "floats", "display values formatted as 0.0f..1.0f floats instead of 0..255 integers.", "False"},
+ {mvPythonDataType::Bool, "input_rgb", "input and output data in RGB format.", "False"},
+ {mvPythonDataType::Bool, "input_hsv", "input and output data in HSV format.", "False"},
+
+ }, "Adds an rgb color editing widget. Click and draging the color square will copy the color to be applied on any other color widget.", "None", "Adding Widgets") });
+ }
+
+ void mvColorEdit4::InsertParser(std::map* parsers)
+ {
+ parsers->insert({ s_command, mvPythonParser({
+ {mvPythonDataType::Optional},
+ {mvPythonDataType::String, "name"},
+ {mvPythonDataType::KeywordOnly},
+ {mvPythonDataType::IntList, "default_value", "", "(0, 0, 0, 255)"},
+ {mvPythonDataType::Callable, "callback", "Registers a callback", "None"},
+ {mvPythonDataType::Object, "callback_data", "Callback data", "None"},
+ {mvPythonDataType::String, "parent", "Parent to add this item to. (runtime adding)", "''"},
+ {mvPythonDataType::String, "before", "This item will be displayed before the specified item in the parent. (runtime adding)", "''"},
+ {mvPythonDataType::String, "source", "", "''"},
+ {mvPythonDataType::Integer, "width","", "0"},
+ {mvPythonDataType::Integer, "height", "", "0"},
+ {mvPythonDataType::String, "label", "", "''"},
+ {mvPythonDataType::Bool, "show", "Attempt to render", "True"},
+ {mvPythonDataType::Bool, "enabled", "", "True"},
+ {mvPythonDataType::Bool, "no_alpha", "ignore Alpha component", "False"},
+ {mvPythonDataType::Bool, "no_picker", "disable picker when clicking on colored square.", "False"},
+ {mvPythonDataType::Bool, "no_options", " disable toggling options menu when right-clicking on inputs/small preview.", "False"},
+ {mvPythonDataType::Bool, "no_small_preview", "disable colored square preview next to the inputs. (e.g. to show only the inputs). This only displays if the side preview is not shown.", "False"},
+ {mvPythonDataType::Bool, "no_inputs", "disable inputs sliders/text widgets (e.g. to show only the small preview colored square)", "False"},
+ {mvPythonDataType::Bool, "no_tooltip", "disable tooltip when hovering the preview.", "False"},
+ {mvPythonDataType::Bool, "no_label", "disable display of inline text label", "False"},
+ {mvPythonDataType::Bool, "no_drag_drop", "disable display of inline text label", "False"},
+ {mvPythonDataType::Bool, "alpha_bar", "show vertical alpha bar/gradient in picker.", "False"},
+ {mvPythonDataType::Bool, "alpha_preview", "display preview as a transparent color over a checkerboard, instead of opaque.", "False"},
+ {mvPythonDataType::Bool, "alpha_preview_half", "display half opaque / half checkerboard, instead of opaque.", "False"},
+ {mvPythonDataType::Bool, "display_rgb", "override _display_ type among RGB/HSV/Hex.", "False"},
+ {mvPythonDataType::Bool, "display_hsv", "override _display_ type among RGB/HSV/Hex.", "False"},
+ {mvPythonDataType::Bool, "display_hex", "override _display_ type among RGB/HSV/Hex.", "False"},
+ {mvPythonDataType::Bool, "uint8", "display values formatted as 0..255", "False"},
+ {mvPythonDataType::Bool, "floats", "display values formatted as 0.0f..1.0f floats instead of 0..255 integers.", "False"},
+ {mvPythonDataType::Bool, "input_rgb", "input and output data in RGB format.", "False"},
+ {mvPythonDataType::Bool, "input_hsv", "input and output data in HSV format.", "False"},
+
+ }, "Adds an rgba color editing widget. Click and draging the color square will copy the color to be applied on any other color widget.", "None", "Adding Widgets") });
+ }
+
+ mvColorEdit3::mvColorEdit3(const std::string& name)
+ :
+ mvColorPtrBase(name)
+ {
+ }
+
+ void mvColorEdit3::draw(ImDrawList* drawlist, float x, float y)
+ {
+ ScopedID id;
+ mvImGuiThemeScope scope(this);
+ mvFontScope fscope(this);
+
+ if (!m_enabled) std::copy(m_value->data(), m_value->data() + 3, m_disabled_value);
+
+ if (ImGui::ColorEdit3(m_label.c_str(), m_enabled ? m_value->data() : &m_disabled_value[0], m_flags))
+ mvApp::GetApp()->getCallbackRegistry().addCallback(getCallback(false), m_name, m_callback_data);
+ }
+
+ mvColorEdit4::mvColorEdit4(const std::string& name)
+ :
+ mvColorPtrBase(name)
+ {
+ }
+
+ void mvColorEdit4::draw(ImDrawList* drawlist, float x, float y)
+ {
+ ScopedID id;
+ mvImGuiThemeScope scope(this);
+ mvFontScope fscope(this);
+
+ if (!m_enabled) std::copy(m_value->data(), m_value->data() + 4, m_disabled_value);
+
+ if (ImGui::ColorEdit4(m_label.c_str(), m_enabled ? m_value->data() : &m_disabled_value[0], m_flags))
+ mvApp::GetApp()->getCallbackRegistry().addCallback(getCallback(false), m_name, m_callback_data);
+
+ }
+
+ void mvColorEdit3::setExtraConfigDict(PyObject* dict)
+ {
+ if (dict == nullptr)
+ return;
+
+ // helpers for bit flipping
+ auto flagop = [dict](const char* keyword, int flag, int& flags)
+ {
+ if (PyObject* item = PyDict_GetItemString(dict, keyword)) ToBool(item) ? flags |= flag : flags &= ~flag;
+ };
+
+ auto conflictingflagop = [dict](const std::vector& keywords, std::vector flags, int& mflags)
+ {
+
+ for (size_t i = 0; i < keywords.size(); i++)
+ {
+ if (PyObject* item = PyDict_GetItemString(dict, keywords[i].c_str()))
+ {
+ //turning all conflicting flags false
+ for (const auto& flag : flags) mflags &= ~flag;
+ //writing only the first conflicting flag
+ ToBool(item) ? mflags |= flags[i] : mflags &= ~flags[i];
+ break;
+ }
+ }
+
+ };
+
+ flagop("no_alpha", ImGuiColorEditFlags_NoAlpha, m_flags);
+ flagop("no_picker", ImGuiColorEditFlags_NoPicker, m_flags);
+ flagop("no_options", ImGuiColorEditFlags_NoOptions, m_flags);
+ flagop("no_small_preview", ImGuiColorEditFlags_NoSmallPreview, m_flags);
+ flagop("no_inputs", ImGuiColorEditFlags_NoInputs, m_flags);
+ flagop("no_tooltip", ImGuiColorEditFlags_NoTooltip, m_flags);
+ flagop("no_label", ImGuiColorEditFlags_NoLabel, m_flags);
+ flagop("no_drag_drop", ImGuiColorEditFlags_NoDragDrop, m_flags);
+ flagop("alpha_bar", ImGuiColorEditFlags_AlphaBar, m_flags);
+
+ static std::vector AlphaPreviewKeywords{ "alpha_preview", "alpha_preview_half" };
+ static std::vector AlphaPreviewFlags{ ImGuiColorEditFlags_AlphaPreview, ImGuiColorEditFlags_AlphaPreviewHalf };
+
+ static std::vector DisplayValueTypeKeywords{ "uint8", "floats" };
+ static std::vector DisplayValueTypeFlags{ ImGuiColorEditFlags_Uint8, ImGuiColorEditFlags_Float };
+
+ std::vector DisplayTypeKeywords{ "display_rgb", "display_hsv", "display_hex" };
+ std::vector DisplayTypeFlags{ ImGuiColorEditFlags_DisplayRGB, ImGuiColorEditFlags_DisplayHSV, ImGuiColorEditFlags_DisplayHex };
+
+ static std::vector IOTypeKeywords{ "input_rgb", "input_hsv" };
+ static std::vector IOTypeFlags{ ImGuiColorEditFlags_InputRGB, ImGuiColorEditFlags_InputHSV };
+
+ conflictingflagop(AlphaPreviewKeywords, AlphaPreviewFlags, m_flags);
+ conflictingflagop(DisplayValueTypeKeywords, DisplayValueTypeFlags, m_flags);
+ conflictingflagop(DisplayTypeKeywords, DisplayTypeFlags, m_flags);
+ conflictingflagop(IOTypeKeywords, IOTypeFlags, m_flags);
+
+ }
+
+ void mvColorEdit3::getExtraConfigDict(PyObject* dict)
+ {
+ if (dict == nullptr)
+ return;
+
+ // helper to check and set bit
+ auto checkbitset = [dict](const char* keyword, int flag, const int& flags)
+ {
+ PyDict_SetItemString(dict, keyword, ToPyBool(flags & flag));
+ };
+
+ checkbitset("no_alpha", ImGuiColorEditFlags_NoAlpha, m_flags);
+ checkbitset("no_picker", ImGuiColorEditFlags_NoPicker, m_flags);
+ checkbitset("no_options", ImGuiColorEditFlags_NoOptions, m_flags);
+ checkbitset("no_small_preview", ImGuiColorEditFlags_NoSmallPreview, m_flags);
+ checkbitset("no_inputs", ImGuiColorEditFlags_NoInputs, m_flags);
+ checkbitset("no_tooltip", ImGuiColorEditFlags_NoTooltip, m_flags);
+ checkbitset("no_label", ImGuiColorEditFlags_NoLabel, m_flags);
+ checkbitset("no_drag_drop", ImGuiColorEditFlags_NoDragDrop, m_flags);
+ checkbitset("alpha_bar", ImGuiColorEditFlags_AlphaBar, m_flags);
+ checkbitset("alpha_preview", ImGuiColorEditFlags_AlphaPreview, m_flags);
+ checkbitset("alpha_preview_half", ImGuiColorEditFlags_AlphaPreviewHalf, m_flags);
+ checkbitset("display_rgb", ImGuiColorEditFlags_DisplayRGB, m_flags);
+ checkbitset("display_hsv", ImGuiColorEditFlags_DisplayHSV, m_flags);
+ checkbitset("display_hex", ImGuiColorEditFlags_DisplayHex, m_flags);
+ checkbitset("unit8", ImGuiColorEditFlags_Uint8, m_flags);
+ checkbitset("floats", ImGuiColorEditFlags_Float, m_flags);
+ checkbitset("input_rgb", ImGuiColorEditFlags_InputRGB, m_flags);
+ checkbitset("input_hsv", ImGuiColorEditFlags_InputHSV, m_flags);
+ }
+
+ void mvColorEdit4::setExtraConfigDict(PyObject* dict)
+ {
+ if (dict == nullptr)
+ return;
+
+ // helpers for bit flipping
+ auto flagop = [dict](const char* keyword, int flag, int& flags)
+ {
+ if (PyObject* item = PyDict_GetItemString(dict, keyword)) ToBool(item) ? flags |= flag : flags &= ~flag;
+ };
+
+ auto conflictingflagop = [dict](const std::vector& keywords, std::vector flags, int& mflags)
+ {
+
+ for (size_t i = 0; i < keywords.size(); i++)
+ {
+ if (PyObject* item = PyDict_GetItemString(dict, keywords[i].c_str()))
+ {
+ //turning all conflicting flags false
+ for (const auto& flag : flags) mflags &= ~flag;
+ //writing only the first conflicting flag
+ ToBool(item) ? mflags |= flags[i] : mflags &= ~flags[i];
+ break;
+ }
+ }
+
+ };
+
+ flagop("no_alpha", ImGuiColorEditFlags_NoAlpha, m_flags);
+ flagop("no_picker", ImGuiColorEditFlags_NoPicker, m_flags);
+ flagop("no_options", ImGuiColorEditFlags_NoOptions, m_flags);
+ flagop("no_small_preview", ImGuiColorEditFlags_NoSmallPreview, m_flags);
+ flagop("no_inputs", ImGuiColorEditFlags_NoInputs, m_flags);
+ flagop("no_tooltip", ImGuiColorEditFlags_NoTooltip, m_flags);
+ flagop("no_label", ImGuiColorEditFlags_NoLabel, m_flags);
+ flagop("no_side_preview", ImGuiColorEditFlags_NoSidePreview, m_flags);
+ flagop("no_drag_drop", ImGuiColorEditFlags_NoDragDrop, m_flags);
+ flagop("alpha_bar", ImGuiColorEditFlags_AlphaBar, m_flags);
+
+ static std::vector AlphaPreviewKeywords{ "alpha_preview", "alpha_preview_half" };
+ static std::vector AlphaPreviewFlags{ ImGuiColorEditFlags_AlphaPreview, ImGuiColorEditFlags_AlphaPreviewHalf };
+
+ static std::vector DisplayValueTypeKeywords{ "uint8", "floats" };
+ static std::vector DisplayValueTypeFlags{ ImGuiColorEditFlags_Uint8, ImGuiColorEditFlags_Float };
+
+ std::vector DisplayTypeKeywords{ "display_rgb", "display_hsv", "display_hex" };
+ std::vector DisplayTypeFlags{ ImGuiColorEditFlags_DisplayRGB, ImGuiColorEditFlags_DisplayHSV, ImGuiColorEditFlags_DisplayHex };
+
+ static std::vector IOTypeKeywords{ "input_rgb", "input_hsv" };
+ static std::vector IOTypeFlags{ ImGuiColorEditFlags_InputRGB, ImGuiColorEditFlags_InputHSV };
+
+ conflictingflagop(AlphaPreviewKeywords, AlphaPreviewFlags, m_flags);
+ conflictingflagop(DisplayValueTypeKeywords, DisplayValueTypeFlags, m_flags);
+ conflictingflagop(DisplayTypeKeywords, DisplayTypeFlags, m_flags);
+ conflictingflagop(IOTypeKeywords, IOTypeFlags, m_flags);
+
+ }
+
+ void mvColorEdit4::getExtraConfigDict(PyObject* dict)
+ {
+ if (dict == nullptr)
+ return;
+
+ // helper to check and set bit
+ auto checkbitset = [dict](const char* keyword, int flag, const int& flags)
+ {
+ PyDict_SetItemString(dict, keyword, ToPyBool(flags & flag));
+ };
+
+ checkbitset("no_alpha", ImGuiColorEditFlags_NoAlpha, m_flags);
+ checkbitset("no_picker", ImGuiColorEditFlags_NoPicker, m_flags);
+ checkbitset("no_options", ImGuiColorEditFlags_NoOptions, m_flags);
+ checkbitset("no_small_preview", ImGuiColorEditFlags_NoSmallPreview, m_flags);
+ checkbitset("no_inputs", ImGuiColorEditFlags_NoInputs, m_flags);
+ checkbitset("no_tooltip", ImGuiColorEditFlags_NoTooltip, m_flags);
+ checkbitset("no_label", ImGuiColorEditFlags_NoLabel, m_flags);
+ checkbitset("no_drag_drop", ImGuiColorEditFlags_NoDragDrop, m_flags);
+ checkbitset("alpha_bar", ImGuiColorEditFlags_AlphaBar, m_flags);
+ checkbitset("alpha_preview", ImGuiColorEditFlags_AlphaPreview, m_flags);
+ checkbitset("alpha_preview_half", ImGuiColorEditFlags_AlphaPreviewHalf, m_flags);
+ checkbitset("display_rgb", ImGuiColorEditFlags_DisplayRGB, m_flags);
+ checkbitset("display_hsv", ImGuiColorEditFlags_DisplayHSV, m_flags);
+ checkbitset("display_hex", ImGuiColorEditFlags_DisplayHex, m_flags);
+ checkbitset("unit8", ImGuiColorEditFlags_Uint8, m_flags);
+ checkbitset("floats", ImGuiColorEditFlags_Float, m_flags);
+ checkbitset("input_rgb", ImGuiColorEditFlags_InputRGB, m_flags);
+ checkbitset("input_hsv", ImGuiColorEditFlags_InputHSV, m_flags);
+ }
+
+}
diff --git a/DearPyGui/src/core/AppItems/basic/mvColorEdit.h b/DearPyGui/src/core/AppItems/basic/mvColorEdit.h
new file mode 100644
index 000000000..ac5e9dee0
--- /dev/null
+++ b/DearPyGui/src/core/AppItems/basic/mvColorEdit.h
@@ -0,0 +1,215 @@
+#pragma once
+
+#include "mvTypeBases.h"
+
+//-----------------------------------------------------------------------------
+// Widget Index
+//
+// * mvColorEdit3
+// * mvColorEdit4
+//
+//-----------------------------------------------------------------------------
+
+namespace Marvel {
+
+ //-----------------------------------------------------------------------------
+ // mvColorEdit3
+ //-----------------------------------------------------------------------------
+ MV_REGISTER_WIDGET(mvColorEdit3, MV_ITEM_DESC_DEFAULT, StorageValueTypes::Color, 1);
+ class mvColorEdit3 : public mvColorPtrBase
+ {
+
+ public:
+
+ static void InsertParser(std::map* parsers);
+
+ MV_APPLY_WIDGET_REGISTRATION(mvAppItemType::mvColorEdit3, add_color_edit3)
+
+ MV_CREATE_CONSTANT(mvThemeCol_ColorEdit3_Text , ImGuiCol_Text , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_ColorEdit3_TextHighlight , ImGuiCol_TextSelectedBg , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_ColorEdit3_Bg , ImGuiCol_FrameBg , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_ColorEdit3_BgHovered , ImGuiCol_FrameBgHovered , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_ColorEdit3_BgActive , ImGuiCol_FrameBgActive , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_ColorEdit3_DragDrop , ImGuiCol_DragDropTarget , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_ColorEdit3_PopupBg , ImGuiCol_PopupBg , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_ColorEdit3_Border , ImGuiCol_Border , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_ColorEdit3_BorderShadow , ImGuiCol_BorderShadow , 0L);
+
+ MV_CREATE_CONSTANT(mvThemeStyle_ColorEdit3_Rounding , ImGuiStyleVar_FrameRounding , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_ColorEdit3_BorderSize , ImGuiStyleVar_FrameBorderSize , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_ColorEdit3_PopupRounding , ImGuiStyleVar_PopupRounding , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_ColorEdit3_PopupBorderSize , ImGuiStyleVar_PopupBorderSize , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_ColorEdit3_InnerSpacingX , ImGuiStyleVar_ItemInnerSpacing, 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_ColorEdit3_InnerSpacingY , ImGuiStyleVar_ItemInnerSpacing, 1L);
+ MV_CREATE_CONSTANT(mvThemeStyle_ColorEdit3_PopupPaddingX , ImGuiStyleVar_WindowPadding , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_ColorEdit3_PopupPaddingY , ImGuiStyleVar_WindowPadding , 1L);
+ MV_CREATE_CONSTANT(mvThemeStyle_ColorEdit3_PaddingX , ImGuiStyleVar_FramePadding , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_ColorEdit3_PaddingY , ImGuiStyleVar_FramePadding , 1L);
+
+ MV_START_EXTRA_COMMANDS
+ MV_END_EXTRA_COMMANDS
+
+ MV_START_GENERAL_CONSTANTS
+ MV_END_GENERAL_CONSTANTS
+
+ MV_START_COLOR_CONSTANTS
+ MV_ADD_CONSTANT(mvThemeCol_ColorEdit3_Text, mvColor(255, 255, 255, 255), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_ColorEdit3_TextHighlight, mvColor( 66, 150, 250, 89), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_ColorEdit3_Bg, mvColor( 41, 74, 122, 138), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_ColorEdit3_BgHovered, mvColor( 66, 150, 250, 102), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_ColorEdit3_BgActive, mvColor( 66, 150, 250, 171), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_ColorEdit3_DragDrop, mvColor(255, 255, 0, 230), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_ColorEdit3_PopupBg, mvColor( 20, 20, 20, 240), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_ColorEdit3_Border, mvColor(110, 110, 128, 128), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_ColorEdit3_BorderShadow, mvColor( 0, 0, 0, 0), mvColor(128, 128, 128, 63)),
+ MV_END_COLOR_CONSTANTS
+
+ MV_START_STYLE_CONSTANTS
+ MV_ADD_CONSTANT(mvThemeStyle_ColorEdit3_Rounding , 0, 12),
+ MV_ADD_CONSTANT(mvThemeStyle_ColorEdit3_BorderSize , 0, 1),
+ MV_ADD_CONSTANT(mvThemeStyle_ColorEdit3_PopupRounding , 0, 12),
+ MV_ADD_CONSTANT(mvThemeStyle_ColorEdit3_PopupBorderSize , 1, 1),
+ MV_ADD_CONSTANT(mvThemeStyle_ColorEdit3_InnerSpacingX , 4, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_ColorEdit3_InnerSpacingY , 4, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_ColorEdit3_PopupPaddingX , 8, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_ColorEdit3_PopupPaddingY , 8, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_ColorEdit3_PaddingX , 4, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_ColorEdit3_PaddingY , 3, 20),
+ MV_END_STYLE_CONSTANTS
+
+ public:
+
+ mvColorEdit3(const std::string& name);
+
+ void draw(ImDrawList* drawlist, float x, float y) override;
+
+ void setExtraConfigDict(PyObject* dict) override;
+ void getExtraConfigDict(PyObject* dict) override;
+
+ private:
+
+ ImGuiColorEditFlags m_flags = ImGuiColorEditFlags_None;
+
+ std::array m_default_value = { 0.0f, 0.0f, 0.0f, 1.0f };
+ bool m_no_alpha = false;
+ bool m_no_picker = false;
+ bool m_no_options = false;
+ bool m_no_small_preview = false;
+ bool m_no_inputs = false;
+ bool m_no_tooltip = false;
+ bool m_no_label = false;
+ bool m_no_drag_drop = false;
+ bool m_alpha_bar = false;
+ bool m_alpha_preview = false;
+ bool m_alpha_preview_half = false;
+ bool m_display_rgb = false;
+ bool m_display_hsv = false;
+ bool m_display_hex = false;
+ bool m_uint8 = false;
+ bool m_floats = false;
+ bool m_input_rgb = false;
+ bool m_input_hsv = false;
+ };
+
+ //-----------------------------------------------------------------------------
+ // mvColorEdit4
+ //-----------------------------------------------------------------------------
+ MV_REGISTER_WIDGET(mvColorEdit4, MV_ITEM_DESC_DEFAULT, StorageValueTypes::Color, 1);
+ class mvColorEdit4 : public mvColorPtrBase
+ {
+
+ public:
+
+ static void InsertParser(std::map* parsers);
+
+ MV_APPLY_WIDGET_REGISTRATION(mvAppItemType::mvColorEdit4, add_color_edit4)
+
+ MV_CREATE_CONSTANT(mvThemeCol_ColorEdit4_Text , ImGuiCol_Text , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_ColorEdit4_TextHighlight , ImGuiCol_TextSelectedBg , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_ColorEdit4_Bg , ImGuiCol_FrameBg , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_ColorEdit4_BgHovered , ImGuiCol_FrameBgHovered , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_ColorEdit4_BgActive , ImGuiCol_FrameBgActive , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_ColorEdit4_DragDrop , ImGuiCol_DragDropTarget , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_ColorEdit4_PopupBg , ImGuiCol_PopupBg , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_ColorEdit4_Border , ImGuiCol_Border , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_ColorEdit4_BorderShadow , ImGuiCol_BorderShadow , 0L);
+
+ MV_CREATE_CONSTANT(mvThemeStyle_ColorEdit4_Rounding , ImGuiStyleVar_FrameRounding , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_ColorEdit4_BorderSize , ImGuiStyleVar_FrameBorderSize , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_ColorEdit4_PopupRounding , ImGuiStyleVar_PopupRounding , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_ColorEdit4_PopupBorderSize , ImGuiStyleVar_PopupBorderSize , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_ColorEdit4_InnerSpacingX , ImGuiStyleVar_ItemInnerSpacing, 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_ColorEdit4_InnerSpacingY , ImGuiStyleVar_ItemInnerSpacing, 1L);
+ MV_CREATE_CONSTANT(mvThemeStyle_ColorEdit4_PopupPaddingX , ImGuiStyleVar_WindowPadding , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_ColorEdit4_PopupPaddingY , ImGuiStyleVar_WindowPadding , 1L);
+ MV_CREATE_CONSTANT(mvThemeStyle_ColorEdit4_PaddingX , ImGuiStyleVar_FramePadding , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_ColorEdit4_PaddingY , ImGuiStyleVar_FramePadding , 1L);
+
+ MV_START_EXTRA_COMMANDS
+ MV_END_EXTRA_COMMANDS
+
+ MV_START_GENERAL_CONSTANTS
+ MV_END_GENERAL_CONSTANTS
+
+ MV_START_COLOR_CONSTANTS
+ MV_ADD_CONSTANT(mvThemeCol_ColorEdit4_Text, mvColor(255, 255, 255, 255), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_ColorEdit4_TextHighlight, mvColor( 66, 150, 250, 89), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_ColorEdit4_Bg, mvColor( 41, 74, 122, 138), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_ColorEdit4_BgHovered, mvColor( 66, 150, 250, 102), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_ColorEdit4_BgActive, mvColor( 66, 150, 250, 171), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_ColorEdit4_DragDrop, mvColor(255, 255, 0, 230), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_ColorEdit4_PopupBg, mvColor( 20, 20, 20, 240), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_ColorEdit4_Border, mvColor(110, 110, 128, 128), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_ColorEdit4_BorderShadow, mvColor( 0, 0, 0, 0), mvColor(128, 128, 128, 63)),
+ MV_END_COLOR_CONSTANTS
+
+ MV_START_STYLE_CONSTANTS
+ MV_ADD_CONSTANT(mvThemeStyle_ColorEdit4_Rounding , 0, 12),
+ MV_ADD_CONSTANT(mvThemeStyle_ColorEdit4_BorderSize , 0, 1),
+ MV_ADD_CONSTANT(mvThemeStyle_ColorEdit4_PopupRounding , 0, 12),
+ MV_ADD_CONSTANT(mvThemeStyle_ColorEdit4_PopupBorderSize , 1, 1),
+ MV_ADD_CONSTANT(mvThemeStyle_ColorEdit4_InnerSpacingX , 4, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_ColorEdit4_InnerSpacingY , 4, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_ColorEdit4_PopupPaddingX , 8, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_ColorEdit4_PopupPaddingY , 8, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_ColorEdit4_PaddingX , 4, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_ColorEdit4_PaddingY , 3, 20),
+ MV_END_STYLE_CONSTANTS
+
+ public:
+
+ mvColorEdit4(const std::string& name);
+
+ void draw(ImDrawList* drawlist, float x, float y) override;
+
+ void setExtraConfigDict(PyObject* dict) override;
+ void getExtraConfigDict(PyObject* dict) override;
+
+ private:
+
+ ImGuiColorEditFlags m_flags = ImGuiColorEditFlags_None;
+
+
+ std::array m_default_value = { 0.0f, 0.0f, 0.0f, 1.0f };
+ bool m_no_alpha = false;
+ bool m_no_picker = false;
+ bool m_no_options = false;
+ bool m_no_small_preview = false;
+ bool m_no_inputs = false;
+ bool m_no_tooltip = false;
+ bool m_no_label = false;
+ bool m_no_drag_drop = false;
+ bool m_alpha_bar = false;
+ bool m_alpha_preview = false;
+ bool m_alpha_preview_half = false;
+ bool m_display_rgb = false;
+ bool m_display_hsv = false;
+ bool m_display_hex = false;
+ bool m_uint8 = false;
+ bool m_floats = false;
+ bool m_input_rgb = false;
+ bool m_input_hsv = false;
+
+ };
+
+}
diff --git a/DearPyGui/src/core/AppItems/basic/mvColorPicker.cpp b/DearPyGui/src/core/AppItems/basic/mvColorPicker.cpp
new file mode 100644
index 000000000..dcf7b5d56
--- /dev/null
+++ b/DearPyGui/src/core/AppItems/basic/mvColorPicker.cpp
@@ -0,0 +1,304 @@
+#include "mvColorPicker.h"
+#include "mvApp.h"
+#include
+#include "mvItemRegistry.h"
+#include "mvImGuiThemeScope.h"
+#include "mvFontScope.h"
+
+namespace Marvel {
+
+ void mvColorPicker3::InsertParser(std::map* parsers)
+ {
+
+ parsers->insert({ s_command, mvPythonParser({
+ {mvPythonDataType::Optional},
+ {mvPythonDataType::String, "name"},
+ {mvPythonDataType::KeywordOnly},
+ {mvPythonDataType::IntList, "default_value", "", "(0, 0, 0, 255)"},
+ {mvPythonDataType::Callable, "callback", "Registers a callback", "None"},
+ {mvPythonDataType::Object, "callback_data", "Callback data", "None"},
+ {mvPythonDataType::String, "parent", "Parent to add this item to. (runtime adding)", "''"},
+ {mvPythonDataType::String, "before", "This item will be displayed before the specified item in the parent. (runtime adding)", "''"},
+ {mvPythonDataType::String, "source", "", "''"},
+ {mvPythonDataType::Integer, "width","", "0"},
+ {mvPythonDataType::Integer, "height", "", "0"},
+ {mvPythonDataType::String, "label", "", "''"},
+ {mvPythonDataType::Bool, "show", "Attempt to render", "True"},
+ {mvPythonDataType::Bool, "enabled", "", "True"},
+ {mvPythonDataType::Bool, "no_alpha", "ignore Alpha component", "False"},
+ {mvPythonDataType::Bool, "no_small_preview", "disable colored square preview next to the inputs. (e.g. to show only the inputs). This only displays if the side preview is not shown.", "False"},
+ {mvPythonDataType::Bool, "no_inputs", "disable inputs sliders/text widgets (e.g. to show only the small preview colored square)", "False"},
+ {mvPythonDataType::Bool, "no_tooltip", "disable tooltip when hovering the preview.", "False"},
+ {mvPythonDataType::Bool, "no_label", "disable display of inline text label", "False"},
+ {mvPythonDataType::Bool, "no_side_preview", "disable bigger color preview on right side of the picker, use small colored square preview instead , unless small preview is also hidden", "False"},
+ {mvPythonDataType::Bool, "alpha_bar", "show vertical alpha bar/gradient in picker.", "False"},
+ {mvPythonDataType::Bool, "alpha_preview", "display preview as a transparent color over a checkerboard, instead of opaque.", "False"},
+ {mvPythonDataType::Bool, "alpha_preview_half", "display half opaque / half checkerboard, instead of opaque.", "False"},
+ {mvPythonDataType::Bool, "display_rgb", "override _display_ type among RGB/HSV/Hex.", "False"},
+ {mvPythonDataType::Bool, "display_hsv", "override _display_ type among RGB/HSV/Hex.", "False"},
+ {mvPythonDataType::Bool, "display_hex", "override _display_ type among RGB/HSV/Hex.", "False"},
+ {mvPythonDataType::Bool, "uint8", "display values formatted as 0..255", "False"},
+ {mvPythonDataType::Bool, "floats", "display values formatted as 0.0f..1.0f floats instead of 0..255 integers.", "False"},
+ {mvPythonDataType::Bool, "picker_hue_bar", "bar for Hue, rectangle for Sat/Value.", "False"},
+ {mvPythonDataType::Bool, "picker_hue_wheel", "wheel for Hue, triangle for Sat/Value.", "False"},
+ {mvPythonDataType::Bool, "input_rgb", "input and output data in RGB format.", "False"},
+ {mvPythonDataType::Bool, "input_hsv", "input and output data in HSV format.", "False"},
+ }, "Adds an rgb color picking widget. Click and draging the color square will copy the color to be applied on any other color widget. Right Click allows the style of the color picker to be changed.", "None", "Adding Widgets") });
+ }
+
+ void mvColorPicker4::InsertParser(std::map* parsers)
+ {
+
+ parsers->insert({ s_command, mvPythonParser({
+ {mvPythonDataType::Optional},
+ {mvPythonDataType::String, "name"},
+ {mvPythonDataType::KeywordOnly},
+ {mvPythonDataType::IntList, "default_value", "", "(0, 0, 0, 255)"},
+ {mvPythonDataType::Callable, "callback", "Registers a callback", "None"},
+ {mvPythonDataType::Object, "callback_data", "Callback data", "None"},
+ {mvPythonDataType::String, "parent", "Parent to add this item to. (runtime adding)", "''"},
+ {mvPythonDataType::String, "before", "This item will be displayed before the specified item in the parent. (runtime adding)", "''"},
+ {mvPythonDataType::String, "source", "", "''"},
+ {mvPythonDataType::Integer, "width", "", "0"},
+ {mvPythonDataType::Integer, "height", "", "0"},
+ {mvPythonDataType::String, "label", "", "''"},
+ {mvPythonDataType::Bool, "show", "Attempt to render", "True"},
+ {mvPythonDataType::Bool, "enabled", "", "True"},
+ {mvPythonDataType::Bool, "no_alpha", "ignore Alpha component", "False"},
+ {mvPythonDataType::Bool, "no_small_preview", "disable colored square preview next to the inputs. (e.g. to show only the inputs). This only displays if the side preview is not shown.", "False"},
+ {mvPythonDataType::Bool, "no_inputs", "disable inputs sliders/text widgets (e.g. to show only the small preview colored square)", "False"},
+ {mvPythonDataType::Bool, "no_tooltip", "disable tooltip when hovering the preview.", "False"},
+ {mvPythonDataType::Bool, "no_label", "disable display of inline text label", "False"},
+ {mvPythonDataType::Bool, "no_side_preview", "disable bigger color preview on right side of the picker, use small colored square preview instead , unless small preview is also hidden", "False"},
+ {mvPythonDataType::Bool, "alpha_bar", "show vertical alpha bar/gradient in picker.", "False"},
+ {mvPythonDataType::Bool, "alpha_preview", "display preview as a transparent color over a checkerboard, instead of opaque.", "False"},
+ {mvPythonDataType::Bool, "alpha_preview_half", "display half opaque / half checkerboard, instead of opaque.", "False"},
+ {mvPythonDataType::Bool, "display_rgb", "override _display_ type among RGB/HSV/Hex.", "False"},
+ {mvPythonDataType::Bool, "display_hsv", "override _display_ type among RGB/HSV/Hex.", "False"},
+ {mvPythonDataType::Bool, "display_hex", "override _display_ type among RGB/HSV/Hex.", "False"},
+ {mvPythonDataType::Bool, "uint8", "display values formatted as 0..255", "False"},
+ {mvPythonDataType::Bool, "floats", "display values formatted as 0.0f..1.0f floats instead of 0..255 integers.", "False"},
+ {mvPythonDataType::Bool, "picker_hue_bar", "bar for Hue, rectangle for Sat/Value.", "False"},
+ {mvPythonDataType::Bool, "picker_hue_wheel", "wheel for Hue, triangle for Sat/Value.", "False"},
+ {mvPythonDataType::Bool, "input_rgb", "input and output data in RGB format.", "False"},
+ {mvPythonDataType::Bool, "input_hsv", "input and output data in HSV format.", "False"},
+ }, "Adds an rgba color picking widget. Click and draging the color square will copy the color to be applied on any other color widget. Right Click allows the style of the color picker to be changed", "None", "Adding Widgets") });
+ }
+
+ mvColorPicker3::mvColorPicker3(const std::string& name)
+ :
+ mvColorPtrBase(name)
+ {
+ }
+
+ void mvColorPicker3::draw(ImDrawList* drawlist, float x, float y)
+ {
+ ScopedID id;
+ mvImGuiThemeScope scope(this);
+ mvFontScope fscope(this);
+
+ if (!m_enabled) std::copy(m_value->data(), m_value->data() + 3, m_disabled_value);
+
+ if (ImGui::ColorPicker3(m_label.c_str(), m_enabled ? m_value->data() : &m_disabled_value[0], m_flags))
+ mvApp::GetApp()->getCallbackRegistry().addCallback(getCallback(false), m_name, m_callback_data);
+
+ }
+
+ mvColorPicker4::mvColorPicker4(const std::string& name)
+ :
+ mvColorPtrBase(name)
+ {
+ }
+
+ void mvColorPicker4::draw(ImDrawList* drawlist, float x, float y)
+ {
+ ScopedID id;
+ mvImGuiThemeScope scope(this);
+ mvFontScope fscope(this);
+
+ if (!m_enabled) std::copy(m_value->data(), m_value->data() + 4, m_disabled_value);
+
+ if (ImGui::ColorPicker4(m_label.c_str(), m_enabled ? m_value->data() : &m_disabled_value[0], m_flags))
+ mvApp::GetApp()->getCallbackRegistry().addCallback(getCallback(false), m_name, m_callback_data);
+
+ }
+
+ void mvColorPicker3::setExtraConfigDict(PyObject* dict)
+ {
+ if (dict == nullptr)
+ return;
+
+ // helpers for bit flipping
+ auto flagop = [dict](const char* keyword, int flag, int& flags)
+ {
+ if (PyObject* item = PyDict_GetItemString(dict, keyword)) ToBool(item) ? flags |= flag : flags &= ~flag;
+ };
+
+ auto conflictingflagop = [dict](const std::vector& keywords, std::vector flags, int& mflags)
+ {
+
+ for (size_t i = 0; i < keywords.size(); i++)
+ {
+ if (PyObject* item = PyDict_GetItemString(dict, keywords[i].c_str()))
+ {
+ //turning all conflicting flags false
+ for (const auto& flag : flags) mflags &= ~flag;
+ //writing only the first conflicting flag
+ ToBool(item) ? mflags |= flags[i] : mflags &= ~flags[i];
+ break;
+ }
+ }
+
+ };
+
+ flagop("no_alpha", ImGuiColorEditFlags_NoAlpha, m_flags);
+ flagop("no_small_preview", ImGuiColorEditFlags_NoSmallPreview, m_flags);
+ flagop("no_inputs", ImGuiColorEditFlags_NoInputs, m_flags);
+ flagop("no_tooltip", ImGuiColorEditFlags_NoTooltip, m_flags);
+ flagop("no_label", ImGuiColorEditFlags_NoLabel, m_flags);
+ flagop("no_side_preview", ImGuiColorEditFlags_NoSidePreview, m_flags);
+ flagop("alpha_bar", ImGuiColorEditFlags_AlphaBar, m_flags);
+ flagop("display_rgb", ImGuiColorEditFlags_DisplayRGB, m_flags);
+ flagop("display_hsv", ImGuiColorEditFlags_DisplayHSV, m_flags);
+ flagop("display_hex", ImGuiColorEditFlags_DisplayHex, m_flags);
+
+ static std::vector AlphaPreviewKeywords{ "alpha_preview", "alpha_preview_half" };
+ static std::vector AlphaPreviewFlags{ ImGuiColorEditFlags_AlphaPreview, ImGuiColorEditFlags_AlphaPreviewHalf };
+
+ static std::vector DisplayValueTypeKeywords{ "uint8", "floats" };
+ static std::vector DisplayValueTypeFlags{ ImGuiColorEditFlags_Uint8, ImGuiColorEditFlags_Float };
+
+ static std::vector PickerTypeKeywords{ "picker_hue_bar", "picker_hue_wheel" };
+ static std::vector PickerTypeFlags{ ImGuiColorEditFlags_PickerHueBar, ImGuiColorEditFlags_PickerHueWheel };
+
+ static std::vector IOTypeKeywords{ "input_rgb", "input_hsv" };
+ static std::vector IOTypeFlags{ ImGuiColorEditFlags_InputRGB, ImGuiColorEditFlags_InputHSV };
+
+ conflictingflagop(AlphaPreviewKeywords, AlphaPreviewFlags, m_flags);
+ conflictingflagop(DisplayValueTypeKeywords, DisplayValueTypeFlags, m_flags);
+ conflictingflagop(PickerTypeKeywords, PickerTypeFlags, m_flags);
+ conflictingflagop(IOTypeKeywords, IOTypeFlags, m_flags);
+
+ }
+
+ void mvColorPicker3::getExtraConfigDict(PyObject* dict)
+ {
+ if (dict == nullptr)
+ return;
+
+ // helper to check and set bit
+ auto checkbitset = [dict](const char* keyword, int flag, const int& flags)
+ {
+ PyDict_SetItemString(dict, keyword, ToPyBool(flags & flag));
+ };
+
+ checkbitset("no_alpha", ImGuiColorEditFlags_NoAlpha, m_flags);
+ checkbitset("no_small_preview", ImGuiColorEditFlags_NoSmallPreview, m_flags);
+ checkbitset("no_inputs", ImGuiColorEditFlags_NoInputs, m_flags);
+ checkbitset("no_tooltip", ImGuiColorEditFlags_NoTooltip, m_flags);
+ checkbitset("no_label", ImGuiColorEditFlags_NoLabel, m_flags);
+ checkbitset("no_side_preview", ImGuiColorEditFlags_NoSidePreview, m_flags);
+ checkbitset("alpha_bar", ImGuiColorEditFlags_AlphaBar, m_flags);
+ checkbitset("alpha_preview", ImGuiColorEditFlags_AlphaPreview, m_flags);
+ checkbitset("alpha_preview_half", ImGuiColorEditFlags_AlphaPreviewHalf, m_flags);
+ checkbitset("display_rgb", ImGuiColorEditFlags_DisplayRGB, m_flags);
+ checkbitset("display_hsv", ImGuiColorEditFlags_DisplayHSV, m_flags);
+ checkbitset("display_hex", ImGuiColorEditFlags_DisplayHex, m_flags);
+ checkbitset("unit8", ImGuiColorEditFlags_Uint8, m_flags);
+ checkbitset("floats", ImGuiColorEditFlags_Float, m_flags);
+ checkbitset("picker_hue_bar", ImGuiColorEditFlags_PickerHueBar, m_flags);
+ checkbitset("picker_hue_wheel", ImGuiColorEditFlags_PickerHueWheel, m_flags);
+ checkbitset("input_rgb", ImGuiColorEditFlags_InputRGB, m_flags);
+ checkbitset("input_hsv", ImGuiColorEditFlags_InputHSV, m_flags);
+ }
+
+ void mvColorPicker4::setExtraConfigDict(PyObject* dict)
+ {
+ if (dict == nullptr)
+ return;
+
+ // helpers for bit flipping
+ auto flagop = [dict](const char* keyword, int flag, int& flags)
+ {
+ if (PyObject* item = PyDict_GetItemString(dict, keyword)) ToBool(item) ? flags |= flag : flags &= ~flag;
+ };
+
+ auto conflictingflagop = [dict](const std::vector& keywords, std::vector flags, int& mflags)
+ {
+
+ for (size_t i = 0; i < keywords.size(); i++)
+ {
+ if (PyObject* item = PyDict_GetItemString(dict, keywords[i].c_str()))
+ {
+ //turning all conflicting flags false
+ for (const auto& flag : flags) mflags &= ~flag;
+ //writing only the first conflicting flag
+ ToBool(item) ? mflags |= flags[i] : mflags &= ~flags[i];
+ break;
+ }
+ }
+
+ };
+
+ flagop("no_alpha", ImGuiColorEditFlags_NoAlpha, m_flags);
+ flagop("no_small_preview", ImGuiColorEditFlags_NoSmallPreview, m_flags);
+ flagop("no_inputs", ImGuiColorEditFlags_NoInputs, m_flags);
+ flagop("no_tooltip", ImGuiColorEditFlags_NoTooltip, m_flags);
+ flagop("no_label", ImGuiColorEditFlags_NoLabel, m_flags);
+ flagop("no_side_preview", ImGuiColorEditFlags_NoSidePreview, m_flags);
+ flagop("alpha_bar", ImGuiColorEditFlags_AlphaBar, m_flags);
+ flagop("display_rgb", ImGuiColorEditFlags_DisplayRGB, m_flags);
+ flagop("display_hsv", ImGuiColorEditFlags_DisplayHSV, m_flags);
+ flagop("display_hex", ImGuiColorEditFlags_DisplayHex, m_flags);
+
+ static std::vector AlphaPreviewKeywords{ "alpha_preview", "alpha_preview_half" };
+ static std::vector AlphaPreviewFlags{ ImGuiColorEditFlags_AlphaPreview, ImGuiColorEditFlags_AlphaPreviewHalf };
+
+ static std::vector DisplayValueTypeKeywords{ "uint8", "floats" };
+ static std::vector DisplayValueTypeFlags{ ImGuiColorEditFlags_Uint8, ImGuiColorEditFlags_Float };
+
+ static std::vector PickerTypeKeywords{ "picker_hue_bar", "picker_hue_wheel" };
+ static std::vector PickerTypeFlags{ ImGuiColorEditFlags_PickerHueBar, ImGuiColorEditFlags_PickerHueWheel };
+
+ static std::vector IOTypeKeywords{ "input_rgb", "input_hsv" };
+ static std::vector IOTypeFlags{ ImGuiColorEditFlags_InputRGB, ImGuiColorEditFlags_InputHSV };
+
+ conflictingflagop(AlphaPreviewKeywords, AlphaPreviewFlags, m_flags);
+ conflictingflagop(DisplayValueTypeKeywords, DisplayValueTypeFlags, m_flags);
+ conflictingflagop(PickerTypeKeywords, PickerTypeFlags, m_flags);
+ conflictingflagop(IOTypeKeywords, IOTypeFlags, m_flags);
+
+ }
+
+ void mvColorPicker4::getExtraConfigDict(PyObject* dict)
+ {
+ if (dict == nullptr)
+ return;
+
+ // helper to check and set bit
+ auto checkbitset = [dict](const char* keyword, int flag, const int& flags)
+ {
+ PyDict_SetItemString(dict, keyword, ToPyBool(flags & flag));
+ };
+
+ checkbitset("no_alpha", ImGuiColorEditFlags_NoAlpha, m_flags);
+ checkbitset("no_small_preview", ImGuiColorEditFlags_NoSmallPreview, m_flags);
+ checkbitset("no_inputs", ImGuiColorEditFlags_NoInputs, m_flags);
+ checkbitset("no_tooltip", ImGuiColorEditFlags_NoTooltip, m_flags);
+ checkbitset("no_label", ImGuiColorEditFlags_NoLabel, m_flags);
+ checkbitset("no_side_preview", ImGuiColorEditFlags_NoSidePreview, m_flags);
+ checkbitset("alpha_bar", ImGuiColorEditFlags_AlphaBar, m_flags);
+ checkbitset("alpha_preview", ImGuiColorEditFlags_AlphaPreview, m_flags);
+ checkbitset("alpha_preview_half", ImGuiColorEditFlags_AlphaPreviewHalf, m_flags);
+ checkbitset("display_rgb", ImGuiColorEditFlags_DisplayRGB, m_flags);
+ checkbitset("display_hsv", ImGuiColorEditFlags_DisplayHSV, m_flags);
+ checkbitset("display_hex", ImGuiColorEditFlags_DisplayHex, m_flags);
+ checkbitset("unit8", ImGuiColorEditFlags_Uint8, m_flags);
+ checkbitset("floats", ImGuiColorEditFlags_Float, m_flags);
+ checkbitset("picker_hue_bar", ImGuiColorEditFlags_PickerHueBar, m_flags);
+ checkbitset("picker_hue_wheel", ImGuiColorEditFlags_PickerHueWheel, m_flags);
+ checkbitset("input_rgb", ImGuiColorEditFlags_InputRGB, m_flags);
+ checkbitset("input_hsv", ImGuiColorEditFlags_InputHSV, m_flags);
+ }
+
+}
\ No newline at end of file
diff --git a/DearPyGui/src/core/AppItems/basic/mvColorPicker.h b/DearPyGui/src/core/AppItems/basic/mvColorPicker.h
new file mode 100644
index 000000000..da0562f68
--- /dev/null
+++ b/DearPyGui/src/core/AppItems/basic/mvColorPicker.h
@@ -0,0 +1,207 @@
+#pragma once
+
+#include "mvTypeBases.h"
+
+//-----------------------------------------------------------------------------
+// Widget Index
+//
+// * mvColorPicker3
+// * mvColorPicker4
+//
+//-----------------------------------------------------------------------------
+
+namespace Marvel {
+
+ //-----------------------------------------------------------------------------
+ // mvColorPicker3
+ //-----------------------------------------------------------------------------
+ MV_REGISTER_WIDGET(mvColorPicker3, MV_ITEM_DESC_DEFAULT, StorageValueTypes::Color, 1);
+ class mvColorPicker3 : public mvColorPtrBase
+ {
+
+ public:
+
+ static void InsertParser(std::map* parsers);
+
+ MV_APPLY_WIDGET_REGISTRATION(mvAppItemType::mvColorPicker3, add_color_picker3)
+
+ MV_CREATE_CONSTANT(mvThemeCol_ColorPicker3_Text , ImGuiCol_Text , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_ColorPicker3_Bg , ImGuiCol_FrameBg , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_ColorPicker3_BgHovered , ImGuiCol_FrameBgHovered , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_ColorPicker3_BgActive , ImGuiCol_FrameBgActive , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_ColorPicker3_DragDrop , ImGuiCol_DragDropTarget , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_ColorPicker3_Border , ImGuiCol_Border , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_ColorPicker3_BorderShadow , ImGuiCol_BorderShadow , 0L);
+
+ MV_CREATE_CONSTANT(mvThemeStyle_ColorPicker3_Rounding , ImGuiStyleVar_FrameRounding , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_ColorPicker3_BorderSize , ImGuiStyleVar_FrameBorderSize , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_ColorPicker3_PopupRounding , ImGuiStyleVar_PopupRounding , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_ColorPicker3_PopupBorderSize, ImGuiStyleVar_PopupBorderSize , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_ColorPicker3_InnerSpacingX , ImGuiStyleVar_ItemInnerSpacing, 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_ColorPicker3_InnerSpacingY , ImGuiStyleVar_ItemInnerSpacing, 1L);
+ MV_CREATE_CONSTANT(mvThemeStyle_ColorPicker3_PopupPaddingX , ImGuiStyleVar_WindowPadding , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_ColorPicker3_PopupPaddingY , ImGuiStyleVar_WindowPadding , 1L);
+ MV_CREATE_CONSTANT(mvThemeStyle_ColorPicker3_PaddingX , ImGuiStyleVar_FramePadding , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_ColorPicker3_PaddingY , ImGuiStyleVar_FramePadding , 1L);
+
+ MV_START_EXTRA_COMMANDS
+ MV_END_EXTRA_COMMANDS
+
+ MV_START_GENERAL_CONSTANTS
+ MV_END_GENERAL_CONSTANTS
+
+ MV_START_COLOR_CONSTANTS
+ MV_ADD_CONSTANT(mvThemeCol_ColorPicker3_Text , mvColor(255, 255, 255, 255), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_ColorPicker3_Bg , mvColor( 41, 74, 122, 138), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_ColorPicker3_BgHovered , mvColor( 66, 150, 250, 102), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_ColorPicker3_BgActive , mvColor( 66, 150, 250, 171), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_ColorPicker3_DragDrop , mvColor(255, 255, 0, 230), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_ColorPicker3_Border , mvColor(110, 110, 128, 128), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_ColorPicker3_BorderShadow, mvColor( 0, 0, 0, 0), mvColor(128, 128, 128, 63)),
+ MV_END_COLOR_CONSTANTS
+
+ MV_START_STYLE_CONSTANTS
+ MV_ADD_CONSTANT(mvThemeStyle_ColorPicker3_Rounding , 0, 12),
+ MV_ADD_CONSTANT(mvThemeStyle_ColorPicker3_BorderSize , 0, 1),
+ MV_ADD_CONSTANT(mvThemeStyle_ColorPicker3_PopupRounding , 0, 12),
+ MV_ADD_CONSTANT(mvThemeStyle_ColorPicker3_PopupBorderSize , 1, 1),
+ MV_ADD_CONSTANT(mvThemeStyle_ColorPicker3_InnerSpacingX , 4, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_ColorPicker3_InnerSpacingY , 4, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_ColorPicker3_PopupPaddingX , 8, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_ColorPicker3_PopupPaddingY , 8, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_ColorPicker3_PaddingX , 4, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_ColorPicker3_PaddingY , 3, 20),
+ MV_END_STYLE_CONSTANTS
+
+ public:
+
+ mvColorPicker3(const std::string& name);
+
+ void draw(ImDrawList* drawlist, float x, float y) override;
+
+ void setExtraConfigDict(PyObject* dict) override;
+ void getExtraConfigDict(PyObject* dict) override;
+
+ private:
+
+ ImGuiColorEditFlags m_flags = ImGuiColorEditFlags_None;
+
+ std::array m_default_value = { 0.0f, 0.0f, 0.0f, 1.0f };
+ bool m_no_alpha = false;
+ bool m_no_small_preview = false;
+ bool m_no_inputs = false;
+ bool m_no_tooltip = false;
+ bool m_no_label = false;
+ bool m_no_side_preview = false;
+ bool m_alpha_bar = false;
+ bool m_alpha_preview = false;
+ bool m_alpha_preview_half = false;
+ bool m_display_rgb = false;
+ bool m_display_hsv = false;
+ bool m_display_hex = false;
+ bool m_uint8 = false;
+ bool m_floats = false;
+ bool m_picker_hue_bar = false;
+ bool m_picker_hue_wheel = false;
+ bool m_input_rgb = false;
+ bool m_input_hsv = false;
+
+ };
+
+ //-----------------------------------------------------------------------------
+ // mvColorPicker4
+ //-----------------------------------------------------------------------------
+ MV_REGISTER_WIDGET(mvColorPicker4, MV_ITEM_DESC_DEFAULT, StorageValueTypes::Color, 1);
+ class mvColorPicker4 : public mvColorPtrBase
+ {
+
+ public:
+
+ static void InsertParser(std::map* parsers);
+
+ MV_APPLY_WIDGET_REGISTRATION(mvAppItemType::mvColorPicker4, add_color_picker4)
+
+ MV_CREATE_CONSTANT(mvThemeCol_ColorPicker4_Text , ImGuiCol_Text , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_ColorPicker4_Bg , ImGuiCol_FrameBg , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_ColorPicker4_BgHovered , ImGuiCol_FrameBgHovered , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_ColorPicker4_BgActive , ImGuiCol_FrameBgActive , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_ColorPicker4_DragDrop , ImGuiCol_DragDropTarget , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_ColorPicker4_Border , ImGuiCol_Border , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_ColorPicker4_BorderShadow , ImGuiCol_BorderShadow , 0L);
+
+ MV_CREATE_CONSTANT(mvThemeStyle_ColorPicker4_Rounding , ImGuiStyleVar_FrameRounding , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_ColorPicker4_BorderSize , ImGuiStyleVar_FrameBorderSize , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_ColorPicker4_PopupRounding , ImGuiStyleVar_PopupRounding , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_ColorPicker4_PopupBorderSize, ImGuiStyleVar_PopupBorderSize , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_ColorPicker4_InnerSpacingX , ImGuiStyleVar_ItemInnerSpacing, 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_ColorPicker4_InnerSpacingY , ImGuiStyleVar_ItemInnerSpacing, 1L);
+ MV_CREATE_CONSTANT(mvThemeStyle_ColorPicker4_PopupPaddingX , ImGuiStyleVar_WindowPadding , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_ColorPicker4_PopupPaddingY , ImGuiStyleVar_WindowPadding , 1L);
+ MV_CREATE_CONSTANT(mvThemeStyle_ColorPicker4_PaddingX , ImGuiStyleVar_FramePadding , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_ColorPicker4_PaddingY , ImGuiStyleVar_FramePadding , 1L);
+
+ MV_START_EXTRA_COMMANDS
+ MV_END_EXTRA_COMMANDS
+
+ MV_START_GENERAL_CONSTANTS
+ MV_END_GENERAL_CONSTANTS
+
+ MV_START_COLOR_CONSTANTS
+ MV_ADD_CONSTANT(mvThemeCol_ColorPicker4_Text , mvColor(255, 255, 255, 255), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_ColorPicker4_Bg , mvColor( 41, 74, 122, 138), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_ColorPicker4_BgHovered , mvColor( 66, 150, 250, 102), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_ColorPicker4_BgActive , mvColor( 66, 150, 250, 171), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_ColorPicker4_DragDrop , mvColor(255, 255, 0, 230), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_ColorPicker4_Border , mvColor(110, 110, 128, 128), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_ColorPicker4_BorderShadow, mvColor( 0, 0, 0, 0), mvColor(128, 128, 128, 63)),
+ MV_END_COLOR_CONSTANTS
+
+ MV_START_STYLE_CONSTANTS
+ MV_ADD_CONSTANT(mvThemeStyle_ColorPicker4_Rounding , 0, 12),
+ MV_ADD_CONSTANT(mvThemeStyle_ColorPicker4_BorderSize , 0, 1),
+ MV_ADD_CONSTANT(mvThemeStyle_ColorPicker4_PopupRounding , 0, 12),
+ MV_ADD_CONSTANT(mvThemeStyle_ColorPicker4_PopupBorderSize , 1, 1),
+ MV_ADD_CONSTANT(mvThemeStyle_ColorPicker4_InnerSpacingX , 4, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_ColorPicker4_InnerSpacingY , 4, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_ColorPicker4_PopupPaddingX , 8, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_ColorPicker4_PopupPaddingY , 8, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_ColorPicker4_PaddingX , 4, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_ColorPicker4_PaddingY , 3, 20),
+ MV_END_STYLE_CONSTANTS
+
+ public:
+
+ mvColorPicker4(const std::string& name);
+
+ void draw(ImDrawList* drawlist, float x, float y) override;
+
+ void setExtraConfigDict(PyObject* dict) override;
+ void getExtraConfigDict(PyObject* dict) override;
+
+ private:
+
+ ImGuiColorEditFlags m_flags = ImGuiColorEditFlags_None;
+
+ std::array m_default_value = { 0.0f, 0.0f, 0.0f, 1.0f };
+ bool m_no_alpha = false;
+ bool m_no_small_preview = false;
+ bool m_no_inputs = false;
+ bool m_no_tooltip = false;
+ bool m_no_label = false;
+ bool m_no_side_preview = false;
+ bool m_alpha_bar = false;
+ bool m_alpha_preview = false;
+ bool m_alpha_preview_half = false;
+ bool m_display_rgb = false;
+ bool m_display_hsv = false;
+ bool m_display_hex = false;
+ bool m_uint8 = false;
+ bool m_floats = false;
+ bool m_picker_hue_bar = false;
+ bool m_picker_hue_wheel = false;
+ bool m_input_rgb = false;
+ bool m_input_hsv = false;
+
+ };
+
+}
diff --git a/DearPyGui/src/core/AppItems/basic/mvCombo.cpp b/DearPyGui/src/core/AppItems/basic/mvCombo.cpp
new file mode 100644
index 000000000..29f6a1e45
--- /dev/null
+++ b/DearPyGui/src/core/AppItems/basic/mvCombo.cpp
@@ -0,0 +1,146 @@
+#include
+#include "mvCombo.h"
+#include "mvApp.h"
+#include "mvItemRegistry.h"
+#include "mvImGuiThemeScope.h"
+#include "mvFontScope.h"
+
+namespace Marvel {
+
+ void mvCombo::InsertParser(std::map* parsers)
+ {
+ parsers->insert({ s_command, mvPythonParser({
+ {mvPythonDataType::Optional},
+ {mvPythonDataType::String, "name"},
+ {mvPythonDataType::KeywordOnly},
+ {mvPythonDataType::StringList, "items", "", "()"},
+ {mvPythonDataType::String, "default_value", "", "''"},
+ {mvPythonDataType::Callable, "callback", "Registers a callback", "None"},
+ {mvPythonDataType::Object, "callback_data", "Callback data", "None"},
+ {mvPythonDataType::String, "parent", "Parent this item will be added to. (runtime adding)", "''"},
+ {mvPythonDataType::String, "before", "This item will be displayed before the specified item in the parent. (runtime adding)", "''"},
+ {mvPythonDataType::String, "source", "Overrides 'name' as value storage key", "''"},
+ {mvPythonDataType::Bool, "enabled", "Display grayed out text so selectable cannot be selected", "True"},
+ {mvPythonDataType::Integer, "width","", "0"},
+ {mvPythonDataType::String, "label", "Overrides 'name' as label", "''"},
+ {mvPythonDataType::Bool, "show","Attemp to render", "True"},
+ {mvPythonDataType::Bool, "popup_align_left","Align the popup toward the left by default", "False"},
+ {mvPythonDataType::Bool, "height_small","Max ~4 items visible", "False"},
+ {mvPythonDataType::Bool, "height_regular","Max ~8 items visible (default)", "False"},
+ {mvPythonDataType::Bool, "height_large","Max ~20 items visible", "False"},
+ {mvPythonDataType::Bool, "height_largest","As many items visible as possible", "False"},
+ {mvPythonDataType::Bool, "no_arrow_button","Display on the preview box without the square arrow button", "False"},
+ {mvPythonDataType::Bool, "no_preview","Display only a square arrow button", "False"},
+ }, "Adds a combo.", "None", "Adding Widgets") });
+ }
+
+ mvCombo::mvCombo(const std::string& name)
+ :
+ mvStringPtrBase(name)
+ {
+ }
+
+ void mvCombo::draw(ImDrawList* drawlist, float x, float y)
+ {
+
+ ScopedID id;
+ mvImGuiThemeScope scope(this);
+ mvFontScope fscope(this);
+
+ static std::vector disabled_items{};
+
+ // The second parameter is the label previewed before opening the combo.
+ if (ImGui::BeginCombo(m_label.c_str(), m_value->c_str(), m_flags))
+ {
+ for (const auto& name : m_enabled ? m_items : disabled_items)
+ {
+ bool is_selected = (*m_value == name);
+ if (ImGui::Selectable((name).c_str(), is_selected))
+ {
+ if (m_enabled) { *m_value = name; }
+ mvApp::GetApp()->getCallbackRegistry().addCallback(m_callback, m_name, m_callback_data);
+
+ }
+
+ // Set the initial focus when opening the combo (scrolling + for keyboard navigation support in the upcoming navigation branch)
+ if (is_selected)
+ ImGui::SetItemDefaultFocus();
+ }
+
+ ImGui::EndCombo();
+ }
+
+ }
+
+ void mvCombo::setExtraConfigDict(PyObject* dict)
+ {
+ if (dict == nullptr)
+ return;
+
+ if (PyObject* item = PyDict_GetItemString(dict, "items")) m_items = ToStringVect(item);
+
+ // helpers for bit flipping
+ auto flagop = [dict](const char* keyword, int flag, int& flags)
+ {
+ if (PyObject* item = PyDict_GetItemString(dict, keyword)) ToBool(item) ? flags |= flag : flags &= ~flag;
+ };
+
+ auto conflictingflagop = [dict](const char* const keywords[4], const int flags[4], int& mflags)
+ {
+
+ for (size_t i = 0; i < 4; i++)
+ {
+ if (PyObject* item = PyDict_GetItemString(dict, keywords[i]))
+ {
+ //turning all conflicting flags false
+ for (int i = 0; i < 4; i++) mflags &= ~flags[i];
+ //writing only the first conflicting flag
+ ToBool(item) ? mflags |= flags[i] : mflags &= ~flags[i];
+ break;
+ }
+ }
+
+ };
+
+ flagop("popup_align_left", ImGuiComboFlags_PopupAlignLeft, m_flags);
+ flagop("no_arrow_button", ImGuiComboFlags_NoArrowButton, m_flags);
+ flagop("no_preview", ImGuiComboFlags_NoPreview, m_flags);
+
+ constexpr static const char* HeightKeywords[4]{
+ "height_small",
+ "height_regular",
+ "height_large",
+ "height_largest" };
+
+ constexpr static const int HeightFlags[4]{
+ ImGuiComboFlags_HeightSmall,
+ ImGuiComboFlags_HeightRegular,
+ ImGuiComboFlags_HeightLarge,
+ ImGuiComboFlags_HeightLargest };
+
+ conflictingflagop(HeightKeywords, HeightFlags, m_flags);
+
+ }
+
+ void mvCombo::getExtraConfigDict(PyObject* dict)
+ {
+ if (dict == nullptr)
+ return;
+
+ PyDict_SetItemString(dict, "items", ToPyList(m_items));
+
+ // helper to check and set bit
+ auto checkbitset = [dict](const char* keyword, int flag, const int& flags)
+ {
+ PyDict_SetItemString(dict, keyword, ToPyBool(flags & flag));
+ };
+ checkbitset("popup_align_left", ImGuiComboFlags_PopupAlignLeft, m_flags);
+ checkbitset("height_small", ImGuiComboFlags_HeightSmall, m_flags);
+ checkbitset("height_regular", ImGuiComboFlags_HeightRegular, m_flags);
+ checkbitset("height_large", ImGuiComboFlags_HeightLarge, m_flags);
+ checkbitset("height_largest", ImGuiComboFlags_HeightLargest, m_flags);
+ checkbitset("no_arrow_button", ImGuiComboFlags_NoArrowButton, m_flags);
+ checkbitset("no_preview", ImGuiComboFlags_NoPreview, m_flags);
+ }
+
+}
\ No newline at end of file
diff --git a/DearPyGui/src/core/AppItems/basic/mvCombo.h b/DearPyGui/src/core/AppItems/basic/mvCombo.h
new file mode 100644
index 000000000..4b0fe9aee
--- /dev/null
+++ b/DearPyGui/src/core/AppItems/basic/mvCombo.h
@@ -0,0 +1,112 @@
+#pragma once
+
+#include "mvTypeBases.h"
+
+namespace Marvel {
+
+ MV_REGISTER_WIDGET(mvCombo, MV_ITEM_DESC_DEFAULT, StorageValueTypes::String, 1);
+ class mvCombo : public mvStringPtrBase
+ {
+
+ public:
+
+ static void InsertParser(std::map* parsers);
+
+ MV_APPLY_WIDGET_REGISTRATION(mvAppItemType::mvCombo, add_combo)
+
+ MV_CREATE_CONSTANT(mvThemeCol_Combo_Text , ImGuiCol_Text , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_Combo_Selected , ImGuiCol_Header , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_Combo_Hovered , ImGuiCol_HeaderHovered , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_Combo_Active , ImGuiCol_HeaderActive , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_Combo_Bg , ImGuiCol_FrameBg , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_Combo_BgHovered , ImGuiCol_FrameBgHovered , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_Combo_DropBg , ImGuiCol_PopupBg , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_Combo_DropButtonBg , ImGuiCol_Button , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_Combo_DropButtonHovered , ImGuiCol_ButtonHovered , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_Combo_Scrollbar , ImGuiCol_ScrollbarBg , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_Combo_ScrollbarGrab , ImGuiCol_ScrollbarGrab , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_Combo_ScrollbarGrabHovered, ImGuiCol_ScrollbarGrabHovered , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_Combo_ScrollbarGrabActive , ImGuiCol_ScrollbarGrabActive , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_Combo_Border , ImGuiCol_Border , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_Combo_BorderShadow , ImGuiCol_BorderShadow , 0L);
+
+ MV_CREATE_CONSTANT(mvThemeStyle_Combo_BorderSize , ImGuiStyleVar_FrameBorderSize , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_Combo_Rounding , ImGuiStyleVar_FrameRounding , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_Combo_PaddingX , ImGuiStyleVar_FramePadding , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_Combo_PaddingY , ImGuiStyleVar_FramePadding , 1L);
+ MV_CREATE_CONSTANT(mvThemeStyle_Combo_DropPaddingX , ImGuiStyleVar_WindowPadding , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_Combo_DropPaddingY , ImGuiStyleVar_WindowPadding , 1L);
+ MV_CREATE_CONSTANT(mvThemeStyle_Combo_DropBorderSize , ImGuiStyleVar_PopupBorderSize , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_Combo_DropRounding , ImGuiStyleVar_PopupRounding , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_Combo_ItemSpacingX , ImGuiStyleVar_ItemSpacing , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_Combo_ItemSpacingY , ImGuiStyleVar_ItemSpacing , 1L);
+ MV_CREATE_CONSTANT(mvThemeStyle_Combo_ScrollbarSize , ImGuiStyleVar_ScrollbarSize , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_Combo_ScrollbarRounding , ImGuiStyleVar_ScrollbarRounding , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_Combo_TextAlignX , ImGuiStyleVar_SelectableTextAlign , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_Combo_TextAlignY , ImGuiStyleVar_SelectableTextAlign , 1L);
+
+ MV_START_EXTRA_COMMANDS
+ MV_END_EXTRA_COMMANDS
+
+ MV_START_GENERAL_CONSTANTS
+ MV_END_GENERAL_CONSTANTS
+
+ MV_START_COLOR_CONSTANTS
+ MV_ADD_CONSTANT(mvThemeCol_Combo_Text, mvColor(255, 255, 255, 255), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_Combo_Selected, mvColor( 66, 150, 250, 171), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_Combo_Hovered, mvColor( 41, 74, 74, 138), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_Combo_Active, mvColor( 66, 150, 250, 171), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_Combo_Bg, mvColor( 41, 74, 122, 138), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_Combo_BgHovered, mvColor( 41, 74, 74, 138), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_Combo_DropBg, mvColor( 20, 20, 20, 240), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_Combo_DropButtonBg, mvColor( 66, 150, 250, 102), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_Combo_DropButtonHovered, mvColor( 66, 150, 250, 255), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_Combo_Scrollbar, mvColor( 5, 5, 5, 135), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_Combo_ScrollbarGrab, mvColor( 79, 79, 79, 255), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_Combo_ScrollbarGrabHovered, mvColor(105, 105, 105, 255), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_Combo_ScrollbarGrabActive, mvColor(130, 130, 130, 255), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_Combo_Border, mvColor(110, 110, 128, 128), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_Combo_BorderShadow, mvColor( 0, 0, 0, 0), mvColor(128, 128, 128, 63)),
+ MV_END_COLOR_CONSTANTS
+
+ MV_START_STYLE_CONSTANTS
+ MV_ADD_CONSTANT(mvThemeStyle_Combo_BorderSize , 0, 1),
+ MV_ADD_CONSTANT(mvThemeStyle_Combo_Rounding , 0, 12),
+ MV_ADD_CONSTANT(mvThemeStyle_Combo_PaddingX , 4, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_Combo_PaddingY , 3, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_Combo_DropPaddingX , 8, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_Combo_DropPaddingY , 8, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_Combo_DropBorderSize , 1, 1),
+ MV_ADD_CONSTANT(mvThemeStyle_Combo_DropRounding , 0, 12),
+ MV_ADD_CONSTANT(mvThemeStyle_Combo_ItemSpacingX , 8, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_Combo_ItemSpacingY , 4, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_Combo_ScrollbarSize ,14, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_Combo_ScrollbarRounding, 9, 12),
+ MV_ADD_CONSTANT(mvThemeStyle_Combo_TextAlignX , 0, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_Combo_TextAlignY , 0, 20),
+ MV_END_STYLE_CONSTANTS
+
+ public:
+
+ mvCombo(const std::string& name);
+
+ void draw(ImDrawList* drawlist, float x, float y) override;
+
+ void setExtraConfigDict(PyObject* dict) override;
+ void getExtraConfigDict(PyObject* dict) override;
+
+ private:
+ ImGuiComboFlags m_flags = ImGuiComboFlags_None;
+
+ std::vector m_items;
+ std::string m_default_value = "";
+ bool m_popup_align_left = false;
+ bool m_height_small = false;
+ bool m_height_regular = false;
+ bool m_height_large = false;
+ bool m_height_largest = false;
+ bool m_no_arrow_button = false;
+ bool m_no_preview = false;
+ };
+
+}
diff --git a/DearPyGui/src/core/AppItems/basic/mvDragMulti.cpp b/DearPyGui/src/core/AppItems/basic/mvDragMulti.cpp
new file mode 100644
index 000000000..3e5ad9864
--- /dev/null
+++ b/DearPyGui/src/core/AppItems/basic/mvDragMulti.cpp
@@ -0,0 +1,263 @@
+#include "mvDragMulti.h"
+#include "mvTypeBases.h"
+#include
+#include "mvApp.h"
+#include "mvModule_Core.h"
+#include
+#include "mvItemRegistry.h"
+#include "mvImGuiThemeScope.h"
+#include "mvFontScope.h"
+
+namespace Marvel {
+
+ void mvDragFloatMulti::InsertParser(std::map* parsers)
+ {
+ parsers->insert({ s_command, mvPythonParser({
+ {mvPythonDataType::Optional},
+ {mvPythonDataType::String, "name"},
+ {mvPythonDataType::KeywordOnly},
+ {mvPythonDataType::FloatList, "default_value", "", "(0.0, 0.0, 0.0, 0.0)"},
+ {mvPythonDataType::Integer, "size", "number of components", "4"},
+ {mvPythonDataType::Float, "speed", "", "1.0"},
+ {mvPythonDataType::Float, "min_value", "", "0.0"},
+ {mvPythonDataType::Float, "max_value", "", "100.0"},
+ {mvPythonDataType::String, "format", "", "'%0.3f'"},
+ {mvPythonDataType::Callable, "callback", "Registers a callback", "None"},
+ {mvPythonDataType::Object, "callback_data", "Callback data", "None"},
+ {mvPythonDataType::String, "parent", "Parent this item will be added to. (runtime adding)", "''"},
+ {mvPythonDataType::String, "before", "This item will be displayed before the specified item in the parent. (runtime adding)", "''"},
+ {mvPythonDataType::String, "source", "", "''"},
+ {mvPythonDataType::Bool, "enabled", "Display grayed out text so selectable cannot be selected", "True"},
+ {mvPythonDataType::Integer, "width","", "0"},
+ {mvPythonDataType::Bool, "no_input", "Disable CTRL+Click or Enter key allowing to input text directly into the widget", "False"},
+ {mvPythonDataType::Bool, "clamped", "Clamp value to min/max bounds when input manually with CTRL+Click. By default CTRL+Click allows going out of bounds.", "False"},
+ {mvPythonDataType::String, "label", "", "''"},
+ {mvPythonDataType::Bool, "show", "Attempt to render", "True"},
+ }, "Adds drag for multiple float values. CTRL+Click to directly modify the value.", "None", "Adding Widgets") });
+ }
+
+ void mvDragIntMulti::InsertParser(std::map* parsers)
+ {
+ parsers->insert({ s_command, mvPythonParser({
+ {mvPythonDataType::Optional},
+ {mvPythonDataType::String, "name"},
+ {mvPythonDataType::KeywordOnly},
+ {mvPythonDataType::FloatList, "default_value", "", "(0, 0, 0, 0)"},
+ {mvPythonDataType::Integer, "size", "number of components", "4"},
+ {mvPythonDataType::Float, "speed", "", "1.0"},
+ {mvPythonDataType::Integer, "min_value", "", "0"},
+ {mvPythonDataType::Integer, "max_value", "", "100"},
+ {mvPythonDataType::String, "format", "", "'%0.3f'"},
+ {mvPythonDataType::Callable, "callback", "Registers a callback", "None"},
+ {mvPythonDataType::Object, "callback_data", "Callback data", "None"},
+ {mvPythonDataType::String, "parent", "Parent this item will be added to. (runtime adding)", "''"},
+ {mvPythonDataType::String, "before", "This item will be displayed before the specified item in the parent. (runtime adding)", "''"},
+ {mvPythonDataType::String, "source", "", "''"},
+ {mvPythonDataType::Bool, "enabled", "Display grayed out text so selectable cannot be selected", "True"},
+ {mvPythonDataType::Integer, "width","", "0"},
+ {mvPythonDataType::Bool, "no_input", "Disable CTRL+Click or Enter key allowing to input text directly into the widget", "False"},
+ {mvPythonDataType::Bool, "clamped", "Clamp value to min/max bounds when input manually with CTRL+Click. By default CTRL+Click allows going out of bounds.", "False"},
+ {mvPythonDataType::String, "label", "", "''"},
+ {mvPythonDataType::Bool, "show", "Attempt to render", "True"},
+ }, "Adds drag for multiple int values. CTRL+Click to directly modify the value.", "None", "Adding Widgets") });
+ }
+
+ mvDragFloatMulti::mvDragFloatMulti(const std::string& name)
+ : mvFloat4PtrBase(name)
+ {
+ }
+
+ void mvDragFloatMulti::draw(ImDrawList* drawlist, float x, float y)
+ {
+ ScopedID id;
+ mvImGuiThemeScope scope(this);
+ mvFontScope fscope(this);
+
+ if (!m_enabled) std::copy(m_value->data(), m_value->data() + 2, m_disabled_value);
+
+ switch (m_size)
+ {
+ case 2:
+ if (ImGui::DragFloat2(m_label.c_str(), m_enabled ? m_value->data() : &m_disabled_value[0], m_speed, m_min, m_max, m_format.c_str(), m_flags))
+ mvApp::GetApp()->getCallbackRegistry().addCallback(getCallback(false), m_name, m_callback_data);
+ break;
+ case 3:
+ if (ImGui::DragFloat3(m_label.c_str(), m_enabled ? m_value->data() : &m_disabled_value[0], m_speed, m_min, m_max, m_format.c_str(), m_flags))
+ mvApp::GetApp()->getCallbackRegistry().addCallback(getCallback(false), m_name, m_callback_data);
+ break;
+ case 4:
+ if (ImGui::DragFloat4(m_label.c_str(), m_enabled ? m_value->data() : &m_disabled_value[0], m_speed, m_min, m_max, m_format.c_str(), m_flags))
+ mvApp::GetApp()->getCallbackRegistry().addCallback(getCallback(false), m_name, m_callback_data);
+ break;
+ default:
+ break;
+ }
+
+ }
+
+ void mvDragFloatMulti::setEnabled(bool value)
+ {
+ if (value == m_enabled)
+ return;
+
+ if (value)
+ {
+ m_flags = m_stor_flags;
+ }
+ else
+ {
+ m_stor_flags = m_flags;
+ m_flags |= ImGuiSliderFlags_NoInput;
+ }
+
+ m_enabled = value;
+ }
+
+ void mvDragFloatMulti::setExtraConfigDict(PyObject* dict)
+ {
+ if (dict == nullptr)
+ return;
+
+ if (PyObject* item = PyDict_GetItemString(dict, "format")) m_format = ToString(item);
+ if (PyObject* item = PyDict_GetItemString(dict, "speed")) m_speed = ToFloat(item);
+ if (PyObject* item = PyDict_GetItemString(dict, "min_value")) m_min = ToFloat(item);
+ if (PyObject* item = PyDict_GetItemString(dict, "max_value")) m_max = ToFloat(item);
+ if (PyObject* item = PyDict_GetItemString(dict, "size")) m_size = ToInt(item);
+
+ // helper for bit flipping
+ auto flagop = [dict](const char* keyword, int flag, int& flags)
+ {
+ if (PyObject* item = PyDict_GetItemString(dict, keyword)) ToBool(item) ? flags |= flag : flags &= ~flag;
+ };
+
+ // flags
+ flagop("clamped", ImGuiSliderFlags_ClampOnInput, m_flags);
+ flagop("clamped", ImGuiSliderFlags_ClampOnInput, m_stor_flags);
+ flagop("no_input", ImGuiSliderFlags_NoInput, m_flags);
+ flagop("no_input", ImGuiSliderFlags_NoInput, m_stor_flags);
+
+ }
+
+ void mvDragFloatMulti::getExtraConfigDict(PyObject* dict)
+ {
+ if (dict == nullptr)
+ return;
+
+ PyDict_SetItemString(dict, "format", ToPyString(m_format));
+ PyDict_SetItemString(dict, "speed", ToPyFloat(m_speed));
+ PyDict_SetItemString(dict, "min_value", ToPyFloat(m_min));
+ PyDict_SetItemString(dict, "max_value", ToPyFloat(m_max));
+ PyDict_SetItemString(dict, "size", ToPyInt(m_size));
+
+ // helper to check and set bit
+ auto checkbitset = [dict](const char* keyword, int flag, const int& flags)
+ {
+ PyDict_SetItemString(dict, keyword, ToPyBool(flags & flag));
+ };
+
+ // window flags
+ checkbitset("clamped", ImGuiSliderFlags_ClampOnInput, m_flags);
+ checkbitset("no_input", ImGuiSliderFlags_NoInput, m_flags);
+
+ }
+
+ mvDragIntMulti::mvDragIntMulti(const std::string& name)
+ : mvInt4PtrBase(name)
+ {
+ }
+
+ void mvDragIntMulti::draw(ImDrawList* drawlist, float x, float y)
+ {
+ ScopedID id;
+ mvImGuiThemeScope scope(this);
+ mvFontScope fscope(this);
+
+ if (!m_enabled) std::copy(m_value->data(), m_value->data() + 2, m_disabled_value);
+
+ switch (m_size)
+ {
+ case 2:
+ if (ImGui::DragInt2(m_label.c_str(), m_enabled ? m_value->data() : &m_disabled_value[0], m_speed, m_min, m_max, m_format.c_str(), m_flags))
+ mvApp::GetApp()->getCallbackRegistry().addCallback(getCallback(false), m_name, m_callback_data);
+ break;
+ case 3:
+ if (ImGui::DragInt3(m_label.c_str(), m_enabled ? m_value->data() : &m_disabled_value[0], m_speed, m_min, m_max, m_format.c_str(), m_flags))
+ mvApp::GetApp()->getCallbackRegistry().addCallback(getCallback(false), m_name, m_callback_data);
+ break;
+ case 4:
+ if (ImGui::DragInt4(m_label.c_str(), m_enabled ? m_value->data() : &m_disabled_value[0], m_speed, m_min, m_max, m_format.c_str(), m_flags))
+ mvApp::GetApp()->getCallbackRegistry().addCallback(getCallback(false), m_name, m_callback_data);
+ break;
+ default:
+ break;
+ }
+
+ }
+
+ void mvDragIntMulti::setEnabled(bool value)
+ {
+ if (value == m_enabled)
+ return;
+
+ if (value)
+ {
+ m_flags = m_stor_flags;
+ }
+ else
+ {
+ m_stor_flags = m_flags;
+ m_flags |= ImGuiSliderFlags_NoInput;
+ }
+
+ m_enabled = value;
+ }
+
+ void mvDragIntMulti::setExtraConfigDict(PyObject* dict)
+ {
+ if (dict == nullptr)
+ return;
+
+ if (PyObject* item = PyDict_GetItemString(dict, "format")) m_format = ToString(item);
+ if (PyObject* item = PyDict_GetItemString(dict, "speed")) m_speed = ToFloat(item);
+ if (PyObject* item = PyDict_GetItemString(dict, "min_value")) m_min = ToInt(item);
+ if (PyObject* item = PyDict_GetItemString(dict, "max_value")) m_max = ToInt(item);
+ if (PyObject* item = PyDict_GetItemString(dict, "size")) m_size = ToInt(item);
+
+ // helper for bit flipping
+ auto flagop = [dict](const char* keyword, int flag, int& flags)
+ {
+ if (PyObject* item = PyDict_GetItemString(dict, keyword)) ToBool(item) ? flags |= flag : flags &= ~flag;
+ };
+
+ // flags
+ flagop("clamped", ImGuiSliderFlags_ClampOnInput, m_flags);
+ flagop("clamped", ImGuiSliderFlags_ClampOnInput, m_stor_flags);
+ flagop("no_input", ImGuiSliderFlags_NoInput, m_flags);
+ flagop("no_input", ImGuiSliderFlags_NoInput, m_stor_flags);
+
+ }
+
+ void mvDragIntMulti::getExtraConfigDict(PyObject* dict)
+ {
+ if (dict == nullptr)
+ return;
+
+ PyDict_SetItemString(dict, "format", ToPyString(m_format));
+ PyDict_SetItemString(dict, "speed", ToPyFloat(m_speed));
+ PyDict_SetItemString(dict, "min_value", ToPyInt(m_min));
+ PyDict_SetItemString(dict, "max_value", ToPyInt(m_max));
+ PyDict_SetItemString(dict, "size", ToPyInt(m_size));
+
+ // helper to check and set bit
+ auto checkbitset = [dict](const char* keyword, int flag, const int& flags)
+ {
+ PyDict_SetItemString(dict, keyword, ToPyBool(flags & flag));
+ };
+
+ // window flags
+ checkbitset("clamped", ImGuiSliderFlags_ClampOnInput, m_flags);
+ checkbitset("no_input", ImGuiSliderFlags_NoInput, m_flags);
+
+ }
+
+}
\ No newline at end of file
diff --git a/DearPyGui/src/core/AppItems/basic/mvDragMulti.h b/DearPyGui/src/core/AppItems/basic/mvDragMulti.h
new file mode 100644
index 000000000..10ab28b97
--- /dev/null
+++ b/DearPyGui/src/core/AppItems/basic/mvDragMulti.h
@@ -0,0 +1,161 @@
+#pragma once
+
+#include "mvTypeBases.h"
+#include "mvApp.h"
+#include "mvModule_Core.h"
+#include
+
+//-----------------------------------------------------------------------------
+// Widget Index
+//
+// * mvDragFloatMulti
+// * mvDragIntMulti
+//
+//-----------------------------------------------------------------------------
+
+namespace Marvel {
+
+ //-----------------------------------------------------------------------------
+ // mvDragFloatMulti
+ //-----------------------------------------------------------------------------
+ MV_REGISTER_WIDGET(mvDragFloatMulti, MV_ITEM_DESC_DEFAULT, StorageValueTypes::Float4, 1);
+ class mvDragFloatMulti : public mvFloat4PtrBase
+ {
+
+ public:
+
+ static void InsertParser(std::map* parsers);
+
+ MV_APPLY_WIDGET_REGISTRATION(mvAppItemType::mvDragFloatMulti, add_drag_floatx)
+
+ MV_CREATE_CONSTANT(mvThemeCol_DragFloatx_Text, ImGuiCol_Text, 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_DragFloatx_Bg, ImGuiCol_FrameBg, 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_DragFloatx_BgHovered, ImGuiCol_FrameBgHovered, 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_DragFloatx_BgActive, ImGuiCol_FrameBgActive, 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_DragFloatx_Border, ImGuiCol_Border, 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_DragFloatx_BorderShadow, ImGuiCol_BorderShadow, 0L);
+
+ MV_CREATE_CONSTANT(mvThemeStyle_DragFloatx_Rounding, ImGuiStyleVar_FrameRounding, 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_DragFloatx_BorderSize, ImGuiStyleVar_FrameBorderSize, 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_DragFloatx_PaddingX, ImGuiStyleVar_FramePadding, 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_DragFloatx_PaddingY, ImGuiStyleVar_FramePadding, 1L);
+ MV_CREATE_CONSTANT(mvThemeStyle_DragFloatx_InnerSpacingX, ImGuiStyleVar_ItemInnerSpacing, 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_DragFloatx_InnerSpacingY, ImGuiStyleVar_ItemInnerSpacing, 1L);
+
+ MV_START_EXTRA_COMMANDS
+ MV_END_EXTRA_COMMANDS
+
+ MV_START_GENERAL_CONSTANTS
+ MV_END_GENERAL_CONSTANTS
+
+ MV_START_COLOR_CONSTANTS
+ MV_ADD_CONSTANT(mvThemeCol_DragFloatx_Text, mvColor(255, 255, 255, 255), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_DragFloatx_Bg, mvColor( 41, 74, 122, 138), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_DragFloatx_BgHovered, mvColor( 66, 150, 250, 102), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_DragFloatx_BgActive, mvColor( 66, 150, 250, 171), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_DragFloatx_Border, mvColor(110, 110, 128, 128), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_DragFloatx_BorderShadow, mvColor( 0, 0, 0, 0), mvColor(128, 128, 128, 63)),
+ MV_END_COLOR_CONSTANTS
+
+ MV_START_STYLE_CONSTANTS
+ MV_ADD_CONSTANT(mvThemeStyle_DragFloatx_Rounding, 0, 12),
+ MV_ADD_CONSTANT(mvThemeStyle_DragFloatx_BorderSize, 0, 1),
+ MV_ADD_CONSTANT(mvThemeStyle_DragFloatx_PaddingX, 4, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_DragFloatx_PaddingY, 3, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_DragFloatx_InnerSpacingX, 4, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_DragFloatx_InnerSpacingY, 4, 20),
+ MV_END_STYLE_CONSTANTS
+
+ public:
+
+ mvDragFloatMulti(const std::string& name);
+
+ void setEnabled(bool value) override;
+ void draw(ImDrawList* drawlist, float x, float y) override;
+
+ void setExtraConfigDict(PyObject* dict) override;
+ void getExtraConfigDict(PyObject* dict) override;
+
+ private:
+
+ float m_speed = 1.0f;
+ float m_min = 0.0f;
+ float m_max = 100.0f;
+ std::string m_format = "%.3f";
+ ImGuiInputTextFlags m_flags = ImGuiSliderFlags_None;
+ ImGuiInputTextFlags m_stor_flags = ImGuiSliderFlags_None;
+ int m_size = 4;
+ };
+
+ //-----------------------------------------------------------------------------
+ // mvDragIntMulti
+ //-----------------------------------------------------------------------------
+ MV_REGISTER_WIDGET(mvDragIntMulti, MV_ITEM_DESC_DEFAULT, StorageValueTypes::Int4, 1);
+ class mvDragIntMulti : public mvInt4PtrBase
+ {
+
+ public:
+
+ static void InsertParser(std::map* parsers);
+
+ MV_APPLY_WIDGET_REGISTRATION(mvAppItemType::mvDragIntMulti, add_drag_intx)
+
+ MV_CREATE_CONSTANT(mvThemeCol_DragIntx_Text, ImGuiCol_Text, 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_DragIntx_Bg, ImGuiCol_FrameBg, 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_DragIntx_BgHovered, ImGuiCol_FrameBgHovered, 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_DragIntx_BgActive, ImGuiCol_FrameBgActive, 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_DragIntx_Border, ImGuiCol_Border, 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_DragIntx_BorderShadow, ImGuiCol_BorderShadow, 0L);
+
+ MV_CREATE_CONSTANT(mvThemeStyle_DragIntx_Rounding, ImGuiStyleVar_FrameRounding, 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_DragIntx_BorderSize, ImGuiStyleVar_FrameBorderSize, 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_DragIntx_PaddingX, ImGuiStyleVar_FramePadding, 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_DragIntx_PaddingY, ImGuiStyleVar_FramePadding, 1L);
+ MV_CREATE_CONSTANT(mvThemeStyle_DragIntx_InnerSpacingX, ImGuiStyleVar_ItemInnerSpacing, 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_DragIntx_InnerSpacingY, ImGuiStyleVar_ItemInnerSpacing, 1L);
+
+ MV_START_EXTRA_COMMANDS
+ MV_END_EXTRA_COMMANDS
+
+ MV_START_GENERAL_CONSTANTS
+ MV_END_GENERAL_CONSTANTS
+
+ MV_START_COLOR_CONSTANTS
+ MV_ADD_CONSTANT(mvThemeCol_DragIntx_Text, mvColor(255, 255, 255, 255), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_DragIntx_Bg, mvColor( 41, 74, 122, 138), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_DragIntx_BgHovered, mvColor( 66, 150, 250, 102), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_DragIntx_BgActive, mvColor( 66, 150, 250, 171), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_DragIntx_Border, mvColor(110, 110, 128, 128), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_DragIntx_BorderShadow, mvColor( 0, 0, 0, 0), mvColor(128, 128, 128, 63)),
+ MV_END_COLOR_CONSTANTS
+
+ MV_START_STYLE_CONSTANTS
+ MV_ADD_CONSTANT(mvThemeStyle_DragIntx_Rounding, 0, 12),
+ MV_ADD_CONSTANT(mvThemeStyle_DragIntx_BorderSize, 0, 1),
+ MV_ADD_CONSTANT(mvThemeStyle_DragIntx_PaddingX, 4, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_DragIntx_PaddingY, 3, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_DragIntx_InnerSpacingX, 4, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_DragIntx_InnerSpacingY, 4, 20),
+ MV_END_STYLE_CONSTANTS
+
+ public:
+
+ mvDragIntMulti(const std::string& name);
+
+ void setEnabled(bool value) override;
+ void draw(ImDrawList* drawlist, float x, float y) override;
+
+ void setExtraConfigDict(PyObject* dict) override;
+ void getExtraConfigDict(PyObject* dict) override;
+
+ private:
+
+ float m_speed = 1.0f;
+ int m_min = 0;
+ int m_max = 100;
+ std::string m_format = "%d";
+ ImGuiInputTextFlags m_flags = ImGuiSliderFlags_None;
+ ImGuiInputTextFlags m_stor_flags = ImGuiSliderFlags_None;
+ int m_size = 4;
+ };
+}
\ No newline at end of file
diff --git a/DearPyGui/src/core/AppItems/basic/mvDragSingle.cpp b/DearPyGui/src/core/AppItems/basic/mvDragSingle.cpp
new file mode 100644
index 000000000..f0839db74
--- /dev/null
+++ b/DearPyGui/src/core/AppItems/basic/mvDragSingle.cpp
@@ -0,0 +1,224 @@
+#include "mvDragSingle.h"
+#include "mvTypeBases.h"
+#include
+#include "mvApp.h"
+#include "mvModule_Core.h"
+#include
+#include "mvItemRegistry.h"
+#include "mvImGuiThemeScope.h"
+#include "mvFontScope.h"
+
+namespace Marvel {
+
+ void mvDragFloat::InsertParser(std::map* parsers)
+ {
+ parsers->insert({ s_command, mvPythonParser({
+ {mvPythonDataType::Optional},
+ {mvPythonDataType::String, "name"},
+ {mvPythonDataType::KeywordOnly},
+ {mvPythonDataType::Float, "default_value", "", "0.0"},
+ {mvPythonDataType::Float, "speed", "", "1.0"},
+ {mvPythonDataType::Float, "min_value", "", "0.0"},
+ {mvPythonDataType::Float, "max_value", "", "100.0"},
+ {mvPythonDataType::String, "format", "", "'%0.3f'"},
+ {mvPythonDataType::Callable, "callback", "Registers a callback", "None"},
+ {mvPythonDataType::Object, "callback_data", "Callback data", "None"},
+ {mvPythonDataType::String, "parent", "Parent this item will be added to. (runtime adding)", "''"},
+ {mvPythonDataType::String, "before", "This item will be displayed before the specified item in the parent. (runtime adding)", "''"},
+ {mvPythonDataType::String, "source", "", "''"},
+ {mvPythonDataType::Bool, "enabled", "Display grayed out text so selectable cannot be selected", "True"},
+ {mvPythonDataType::Integer, "width","", "0"},
+ {mvPythonDataType::Bool, "no_input", "Disable CTRL+Click or Enter key allowing to input text directly into the widget", "False"},
+ {mvPythonDataType::Bool, "clamped", "Clamp value to min/max bounds when input manually with CTRL+Click. By default CTRL+Click allows going out of bounds.", "False"},
+ {mvPythonDataType::String, "label", "", "''"},
+ {mvPythonDataType::Bool, "show", "Attempt to render", "True"},
+ }, "Adds drag for a single float value. CTRL+Click to directly modify the value.", "None", "Adding Widgets") });
+ }
+
+ void mvDragInt::InsertParser(std::map* parsers)
+ {
+ parsers->insert({ s_command, mvPythonParser({
+ {mvPythonDataType::Optional},
+ {mvPythonDataType::String, "name"},
+ {mvPythonDataType::KeywordOnly},
+ {mvPythonDataType::Integer, "default_value", "", "0"},
+ {mvPythonDataType::Float, "speed", "", "1.0"},
+ {mvPythonDataType::Integer, "min_value", "", "0"},
+ {mvPythonDataType::Integer, "max_value", "", "100"},
+ {mvPythonDataType::String, "format", "", "'%d'"},
+ {mvPythonDataType::Callable, "callback", "Registers a callback", "None"},
+ {mvPythonDataType::Object, "callback_data", "Callback data", "None"},
+ {mvPythonDataType::String, "parent", "Parent this item will be added to. (runtime adding)", "''"},
+ {mvPythonDataType::String, "before", "This item will be displayed before the specified item in the parent. (runtime adding)", "''"},
+ {mvPythonDataType::String, "source", "", "''"},
+ {mvPythonDataType::Bool, "enabled", "Display grayed out text so selectable cannot be selected", "True"},
+ {mvPythonDataType::Integer, "width","", "0"},
+ {mvPythonDataType::Bool, "no_input", "Disable CTRL+Click or Enter key allowing to input text directly into the widget", "False"},
+ {mvPythonDataType::Bool, "clamped", "Clamp value to min/max bounds when input manually with CTRL+Click. By default CTRL+Click allows going out of bounds.", "False"},
+ {mvPythonDataType::String, "label", "", "''"},
+ {mvPythonDataType::Bool, "show", "Attempt to render", "True"},
+ }, "Adds drag for a single int value. CTRL+Click to directly modify the value.", "None", "Adding Widgets") });
+ }
+
+ mvDragFloat::mvDragFloat(const std::string& name)
+ : mvFloatPtrBase(name)
+ {
+ }
+
+ void mvDragFloat::setEnabled(bool value)
+ {
+ if (value == m_enabled)
+ return;
+
+ if (value)
+ {
+ m_flags = m_stor_flags;
+ }
+ else
+ {
+ m_stor_flags = m_flags;
+ m_flags |= ImGuiSliderFlags_NoInput;
+ }
+
+ m_enabled = value;
+ }
+
+ void mvDragFloat::draw(ImDrawList* drawlist, float x, float y)
+ {
+ ScopedID id;
+ mvImGuiThemeScope scope(this);
+ mvFontScope fscope(this);
+
+ if (!m_enabled) m_disabled_value = *m_value;
+
+ if (ImGui::DragFloat(m_label.c_str(), m_enabled ? m_value.get() : &m_disabled_value, m_speed, m_min, m_max, m_format.c_str(), m_flags))
+ mvApp::GetApp()->getCallbackRegistry().addCallback(getCallback(false), m_name, m_callback_data);
+
+ }
+
+ mvDragInt::mvDragInt(const std::string& name)
+ : mvIntPtrBase(name)
+ {
+ }
+
+ void mvDragInt::setEnabled(bool value)
+ {
+ if (value == m_enabled)
+ return;
+
+ if (value)
+ m_flags = m_stor_flags;
+
+ else
+ {
+ m_stor_flags = m_flags;
+ m_flags |= ImGuiSliderFlags_NoInput;
+ }
+
+ m_enabled = value;
+ }
+
+ void mvDragInt::draw(ImDrawList* drawlist, float x, float y)
+ {
+ ScopedID id;
+ mvImGuiThemeScope scope(this);
+ mvFontScope fscope(this);
+
+ if (!m_enabled) m_disabled_value = *m_value;
+
+ if (ImGui::DragInt(m_label.c_str(), m_enabled ? m_value.get() : &m_disabled_value, m_speed, m_min, m_max, m_format.c_str(), m_flags))
+ mvApp::GetApp()->getCallbackRegistry().addCallback(getCallback(false), m_name, m_callback_data);
+ }
+
+ void mvDragFloat::setExtraConfigDict(PyObject* dict)
+ {
+ if (dict == nullptr)
+ return;
+
+ if (PyObject* item = PyDict_GetItemString(dict, "format")) m_format = ToString(item);
+ if (PyObject* item = PyDict_GetItemString(dict, "speed")) m_speed = ToFloat(item);
+ if (PyObject* item = PyDict_GetItemString(dict, "min_value")) m_min = ToFloat(item);
+ if (PyObject* item = PyDict_GetItemString(dict, "max_value")) m_max = ToFloat(item);
+
+ // helper for bit flipping
+ auto flagop = [dict](const char* keyword, int flag, int& flags)
+ {
+ if (PyObject* item = PyDict_GetItemString(dict, keyword)) ToBool(item) ? flags |= flag : flags &= ~flag;
+ };
+
+ // flags
+ flagop("clamped", ImGuiSliderFlags_ClampOnInput, m_flags);
+ flagop("clamped", ImGuiSliderFlags_ClampOnInput, m_stor_flags);
+ flagop("no_input", ImGuiSliderFlags_NoInput, m_flags);
+ flagop("no_input", ImGuiSliderFlags_NoInput, m_stor_flags);
+
+ }
+
+ void mvDragFloat::getExtraConfigDict(PyObject* dict)
+ {
+ if (dict == nullptr)
+ return;
+
+ PyDict_SetItemString(dict, "format", ToPyString(m_format));
+ PyDict_SetItemString(dict, "speed", ToPyFloat(m_speed));
+ PyDict_SetItemString(dict, "min_value", ToPyFloat(m_min));
+ PyDict_SetItemString(dict, "max_value", ToPyFloat(m_max));
+
+ // helper to check and set bit
+ auto checkbitset = [dict](const char* keyword, int flag, const int& flags)
+ {
+ PyDict_SetItemString(dict, keyword, ToPyBool(flags & flag));
+ };
+
+ // window flags
+ checkbitset("clamped", ImGuiSliderFlags_ClampOnInput, m_flags);
+ checkbitset("no_input", ImGuiSliderFlags_NoInput, m_flags);
+
+ }
+
+ void mvDragInt::setExtraConfigDict(PyObject* dict)
+ {
+ if (dict == nullptr)
+ return;
+
+ if (PyObject* item = PyDict_GetItemString(dict, "format")) m_format = ToString(item);
+ if (PyObject* item = PyDict_GetItemString(dict, "speed")) m_speed = ToFloat(item);
+ if (PyObject* item = PyDict_GetItemString(dict, "min_value")) m_min = ToInt(item);
+ if (PyObject* item = PyDict_GetItemString(dict, "max_value")) m_max = ToInt(item);
+
+ // helper for bit flipping
+ auto flagop = [dict](const char* keyword, int flag, int& flags)
+ {
+ if (PyObject* item = PyDict_GetItemString(dict, keyword)) ToBool(item) ? flags |= flag : flags &= ~flag;
+ };
+
+ // flags
+ flagop("clamped", ImGuiSliderFlags_ClampOnInput, m_flags);
+ flagop("clamped", ImGuiSliderFlags_ClampOnInput, m_stor_flags);
+ flagop("no_input", ImGuiSliderFlags_NoInput, m_flags);
+ flagop("no_input", ImGuiSliderFlags_NoInput, m_stor_flags);
+ }
+
+ void mvDragInt::getExtraConfigDict(PyObject* dict)
+ {
+ if (dict == nullptr)
+ return;
+
+ PyDict_SetItemString(dict, "format", ToPyString(m_format));
+ PyDict_SetItemString(dict, "speed", ToPyFloat(m_speed));
+ PyDict_SetItemString(dict, "min_value", ToPyInt(m_min));
+ PyDict_SetItemString(dict, "max_value", ToPyInt(m_max));
+
+ // helper to check and set bit
+ auto checkbitset = [dict](const char* keyword, int flag, const int& flags)
+ {
+ PyDict_SetItemString(dict, keyword, ToPyBool(flags & flag));
+ };
+
+ // window flags
+ checkbitset("clamped", ImGuiSliderFlags_ClampOnInput, m_flags);
+ checkbitset("no_input", ImGuiSliderFlags_NoInput, m_flags);
+
+ }
+
+}
diff --git a/DearPyGui/src/core/AppItems/basic/mvDragSingle.h b/DearPyGui/src/core/AppItems/basic/mvDragSingle.h
new file mode 100644
index 000000000..4f7e3b5ea
--- /dev/null
+++ b/DearPyGui/src/core/AppItems/basic/mvDragSingle.h
@@ -0,0 +1,163 @@
+#pragma once
+
+#include "mvTypeBases.h"
+#include "mvApp.h"
+#include "mvModule_Core.h"
+#include
+
+//-----------------------------------------------------------------------------
+// Widget Index
+//
+// * mvDragFloat
+// * mvDragInt
+//
+//-----------------------------------------------------------------------------
+
+namespace Marvel {
+
+ //-----------------------------------------------------------------------------
+ // mvDragFloat
+ //-----------------------------------------------------------------------------
+ MV_REGISTER_WIDGET(mvDragFloat, MV_ITEM_DESC_DEFAULT, StorageValueTypes::Float, 1);
+ class mvDragFloat : public mvFloatPtrBase
+ {
+
+ public:
+
+ static void InsertParser(std::map* parsers);
+
+ MV_APPLY_WIDGET_REGISTRATION(mvAppItemType::mvDragFloat, add_drag_float)
+
+ MV_CREATE_CONSTANT(mvThemeCol_DragFloat_Text, ImGuiCol_Text, 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_DragFloat_Bg, ImGuiCol_FrameBg, 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_DragFloat_BgHovered, ImGuiCol_FrameBgHovered, 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_DragFloat_BgActive, ImGuiCol_FrameBgActive, 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_DragFloat_Border, ImGuiCol_Border, 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_DragFloat_BorderShadow, ImGuiCol_BorderShadow, 0L);
+
+ MV_CREATE_CONSTANT(mvThemeStyle_DragFloat_Rounding, ImGuiStyleVar_FrameRounding, 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_DragFloat_BorderSize, ImGuiStyleVar_FrameBorderSize, 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_DragFloat_PaddingX, ImGuiStyleVar_FramePadding, 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_DragFloat_PaddingY, ImGuiStyleVar_FramePadding, 1L);
+ MV_CREATE_CONSTANT(mvThemeStyle_DragFloat_InnerSpacingX, ImGuiStyleVar_ItemInnerSpacing, 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_DragFloat_InnerSpacingY, ImGuiStyleVar_ItemInnerSpacing, 1L);
+
+ MV_START_EXTRA_COMMANDS
+ MV_END_EXTRA_COMMANDS
+
+ MV_START_GENERAL_CONSTANTS
+ MV_END_GENERAL_CONSTANTS
+
+ MV_START_COLOR_CONSTANTS
+ MV_ADD_CONSTANT(mvThemeCol_DragFloat_Text, mvColor(255, 255, 255, 255), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_DragFloat_Bg, mvColor( 41, 74, 122, 138), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_DragFloat_BgHovered, mvColor( 66, 150, 250, 102), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_DragFloat_BgActive, mvColor( 66, 150, 250, 171), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_DragFloat_Border, mvColor(110, 110, 128, 128), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_DragFloat_BorderShadow, mvColor( 0, 0, 0, 0), mvColor(128, 128, 128, 63)),
+ MV_END_COLOR_CONSTANTS
+
+ MV_START_STYLE_CONSTANTS
+ MV_ADD_CONSTANT(mvThemeStyle_DragFloat_Rounding, 0, 12),
+ MV_ADD_CONSTANT(mvThemeStyle_DragFloat_BorderSize, 0, 1),
+ MV_ADD_CONSTANT(mvThemeStyle_DragFloat_PaddingX, 4, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_DragFloat_PaddingY, 3, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_DragFloat_InnerSpacingX, 4, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_DragFloat_InnerSpacingY, 4, 20),
+ MV_END_STYLE_CONSTANTS
+
+ public:
+
+ mvDragFloat(const std::string& name);
+
+ void setEnabled(bool value) override;
+
+ void draw(ImDrawList* drawlist, float x, float y) override;
+
+ void setExtraConfigDict(PyObject* dict) override;
+ void getExtraConfigDict(PyObject* dict) override;
+
+ private:
+
+ float m_speed = 1.0f;
+ float m_min = 0.0f;
+ float m_max = 100.0f;
+ std::string m_format = "%.3f";
+ ImGuiInputTextFlags m_flags = ImGuiSliderFlags_None;
+ ImGuiInputTextFlags m_stor_flags = ImGuiSliderFlags_None;
+
+ };
+
+ //-----------------------------------------------------------------------------
+ // mvDragInt
+ //-----------------------------------------------------------------------------
+ MV_REGISTER_WIDGET(mvDragInt, MV_ITEM_DESC_DEFAULT, StorageValueTypes::Int, 1);
+ class mvDragInt : public mvIntPtrBase
+ {
+
+ public:
+
+ static void InsertParser(std::map* parsers);
+
+ MV_APPLY_WIDGET_REGISTRATION(mvAppItemType::mvDragInt, add_drag_int)
+
+ MV_CREATE_CONSTANT(mvThemeCol_DragInt_Text, 0L, 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_DragInt_Bg, 7L, 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_DragInt_BgHovered, 8L, 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_DragInt_BgActive, 9L, 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_DragInt_Border, 5L, 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_DragInt_BorderShadow, 6L, 0L);
+
+ MV_CREATE_CONSTANT(mvThemeStyle_DragInt_Rounding, 11L, 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_DragInt_BorderSize, 12L, 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_DragInt_PaddingX, 10L, 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_DragInt_PaddingY, 10L, 1L);
+ MV_CREATE_CONSTANT(mvThemeStyle_DragInt_InnerSpacingX, 14L, 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_DragInt_InnerSpacingY, 14L, 1L);
+
+ MV_START_EXTRA_COMMANDS
+ MV_END_EXTRA_COMMANDS
+
+ MV_START_GENERAL_CONSTANTS
+ MV_END_GENERAL_CONSTANTS
+
+ MV_START_COLOR_CONSTANTS
+ MV_ADD_CONSTANT(mvThemeCol_DragInt_Text, mvColor(255, 255, 255, 255), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_DragInt_Bg, mvColor( 41, 74, 122, 138), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_DragInt_BgHovered, mvColor( 66, 150, 250, 102), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_DragInt_BgActive, mvColor( 66, 150, 250, 171), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_DragInt_Border, mvColor(110, 110, 128, 128), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_DragInt_BorderShadow, mvColor( 0, 0, 0, 0), mvColor(128, 128, 128, 63)),
+ MV_END_COLOR_CONSTANTS
+
+ MV_START_STYLE_CONSTANTS
+ MV_ADD_CONSTANT(mvThemeStyle_DragInt_Rounding, 0, 12),
+ MV_ADD_CONSTANT(mvThemeStyle_DragInt_BorderSize, 0, 1),
+ MV_ADD_CONSTANT(mvThemeStyle_DragInt_PaddingX, 4, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_DragInt_PaddingY, 3, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_DragInt_InnerSpacingX, 4, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_DragInt_InnerSpacingY, 4, 20),
+ MV_END_STYLE_CONSTANTS
+
+ public:
+
+ mvDragInt(const std::string& name);
+
+ void setEnabled(bool value) override;
+ void draw(ImDrawList* drawlist, float x, float y) override;
+
+ void setExtraConfigDict(PyObject* dict) override;
+ void getExtraConfigDict(PyObject* dict) override;
+
+ private:
+
+ float m_speed = 1.0f;
+ int m_min = 0;
+ int m_max = 100;
+ std::string m_format = "%d";
+ ImGuiInputTextFlags m_flags = ImGuiSliderFlags_None;
+ ImGuiInputTextFlags m_stor_flags = ImGuiSliderFlags_None;
+
+ };
+
+}
\ No newline at end of file
diff --git a/DearPyGui/src/core/AppItems/basic/mvImage.cpp b/DearPyGui/src/core/AppItems/basic/mvImage.cpp
new file mode 100644
index 000000000..dfdf26e3c
--- /dev/null
+++ b/DearPyGui/src/core/AppItems/basic/mvImage.cpp
@@ -0,0 +1,155 @@
+#include "mvImage.h"
+#include "mvTextureStorage.h"
+#include "mvItemRegistry.h"
+#include "mvApp.h"
+#include "mvImGuiThemeScope.h"
+
+namespace Marvel {
+
+ void mvImage::InsertParser(std::map* parsers)
+ {
+ parsers->insert({ s_command, mvPythonParser({
+ {mvPythonDataType::Optional},
+ {mvPythonDataType::String, "name"},
+ {mvPythonDataType::KeywordOnly},
+ {mvPythonDataType::String, "value"},
+ {mvPythonDataType::FloatList, "tint_color", "", "(255, 255, 255, 255)"},
+ {mvPythonDataType::FloatList, "border_color", "", "(0, 0, 0, 0)"},
+ {mvPythonDataType::String, "parent", "Parent this item will be added to. (runtime adding)", "''"},
+ {mvPythonDataType::String, "before", "This item will be displayed before the specified item in the parent. (runtime adding)", "''"},
+ {mvPythonDataType::String, "source", "data source for shared data", "''"},
+ {mvPythonDataType::Integer, "width","", "0"},
+ {mvPythonDataType::Integer, "height","", "0"},
+ {mvPythonDataType::FloatList, "uv_min", "normalized texture coordinates", "(0.0, 0.0)"},
+ {mvPythonDataType::FloatList, "uv_max", "normalized texture coordinates", "(1.0, 1.0)"},
+ {mvPythonDataType::Bool, "show", "Attempt to render", "True"},
+ }, "Adds an image."
+ "uv_min and uv_max represent the normalized texture coordinates of the original image that will be shown."
+ "Using(0,0)->(1,1) texture coordinates will generally display the entire texture", "None", "Adding Widgets") });
+ }
+
+ mvImage::mvImage(const std::string& name)
+ : mvAppItem(name)
+ {
+ mvEventBus::Subscribe(this, mvEVT_DELETE_TEXTURE);
+ }
+
+ mvImage::~mvImage()
+ {
+ mvEventBus::Publish(mvEVT_CATEGORY_TEXTURE, mvEVT_DEC_TEXTURE, { CreateEventArgument("NAME", m_value) });
+ mvEventBus::UnSubscribe(this);
+ }
+
+ bool mvImage::onEvent(mvEvent& event)
+ {
+ mvEventDispatcher dispatcher(event);
+ dispatcher.dispatch(BIND_EVENT_METH(mvImage::onTextureDeleted), mvEVT_DELETE_TEXTURE);
+
+ return event.handled;
+ }
+
+ bool mvImage::onTextureDeleted(mvEvent& event)
+ {
+ std::string name = GetEString(event, "NAME");
+
+ if (name == m_value)
+ {
+ m_texture = nullptr;
+ return true;
+ }
+
+ return false;
+ }
+
+ void mvImage::draw(ImDrawList* drawlist, float x, float y)
+ {
+
+ if (m_texture == nullptr && !m_value.empty())
+ {
+ mvApp::GetApp()->getTextureStorage().addTexture(m_value);
+ mvTexture* texture = mvApp::GetApp()->getTextureStorage().getTexture(m_value);
+ if (texture == nullptr)
+ {
+ mvApp::GetApp()->getCallbackRegistry().submitCallback([&]()
+ {
+ PyErr_Format(PyExc_Exception,
+ "Image %s could not be found for add_image. Check the path to the image "
+ "you provided.", m_value.c_str());
+ PyErr_Print();
+ m_value = "";
+ });
+ return;
+ }
+
+ m_texture = texture->texture;
+
+ if (m_width == 0) m_width = (int)((float)texture->width * (m_uv_max.x - m_uv_min.x));
+ if (m_height == 0) m_height = (int)((float)texture->height * (m_uv_max.y - m_uv_min.y));
+
+ }
+
+ if (m_dirty)
+ {
+ mvTexture* texture = mvApp::GetApp()->getTextureStorage().getTexture(m_value);
+ if (texture)
+ {
+ m_texture = texture->texture;
+ m_width = (int)((float)texture->width * (m_uv_max.x - m_uv_min.x));
+ m_height = (int)((float)texture->height * (m_uv_max.y - m_uv_min.y));
+ }
+ m_dirty = false;
+ }
+
+ if (m_texture)
+ {
+ ImGui::Image(m_texture, ImVec2((float)m_width, (float)m_height), ImVec2(m_uv_min.x, m_uv_min.y), ImVec2(m_uv_max.x, m_uv_max.y),
+ ImVec4((float)m_tintColor.r, (float)m_tintColor.g, (float)m_tintColor.b, (float)m_tintColor.a),
+ ImVec4((float)m_borderColor.r, (float)m_borderColor.g, (float)m_borderColor.b, (float)m_borderColor.a));
+
+ }
+
+ }
+
+ void mvImage::setValue(const std::string& value)
+ {
+ m_value = value;
+ }
+
+ const std::string& mvImage::getValue() const
+ {
+ return m_value;
+ }
+
+ void mvImage::setExtraConfigDict(PyObject* dict)
+ {
+ if (dict == nullptr)
+ return;
+
+ if (PyObject* item = PyDict_GetItemString(dict, "uv_min"))
+ {
+ m_uv_min = ToVec2(item);
+ m_dirty = true;
+ }
+ if (PyObject* item = PyDict_GetItemString(dict, "uv_max"))
+ {
+ m_uv_max = ToVec2(item);
+ m_dirty = true;
+ }
+ if (PyObject* item = PyDict_GetItemString(dict, "tint_color")) m_tintColor = ToColor(item);
+ if (PyObject* item = PyDict_GetItemString(dict, "border_color")) m_borderColor = ToColor(item);
+ if (PyObject* item = PyDict_GetItemString(dict, "value")) m_value = ToString(item);
+ }
+
+ void mvImage::getExtraConfigDict(PyObject* dict)
+ {
+ if (dict == nullptr)
+ return;
+
+ PyDict_SetItemString(dict, "uv_min", ToPyPair(m_uv_min.x, m_uv_min.y));
+ PyDict_SetItemString(dict, "uv_max", ToPyPair(m_uv_max.x, m_uv_max.y));
+ PyDict_SetItemString(dict, "tint_color", ToPyColor(m_tintColor));
+ PyDict_SetItemString(dict, "border_color", ToPyColor(m_borderColor));
+ PyDict_SetItemString(dict, "value", ToPyString(m_value));
+ }
+
+}
\ No newline at end of file
diff --git a/DearPyGui/src/core/AppItems/basic/mvImage.h b/DearPyGui/src/core/AppItems/basic/mvImage.h
new file mode 100644
index 000000000..1b0bf7b70
--- /dev/null
+++ b/DearPyGui/src/core/AppItems/basic/mvImage.h
@@ -0,0 +1,59 @@
+#pragma once
+
+#include
+#include
+#include "mvAppItem.h"
+#include "mvItemRegistry.h"
+
+namespace Marvel {
+
+ MV_REGISTER_WIDGET(mvImage, MV_ITEM_DESC_DEFAULT, StorageValueTypes::None, 1);
+ class mvImage : public mvAppItem, public mvEventHandler
+ {
+
+ public:
+
+ static void InsertParser(std::map* parsers);
+
+ MV_APPLY_WIDGET_REGISTRATION(mvAppItemType::mvImage, add_image)
+
+ MV_START_EXTRA_COMMANDS
+ MV_END_EXTRA_COMMANDS
+
+ MV_START_GENERAL_CONSTANTS
+ MV_END_GENERAL_CONSTANTS
+
+ MV_START_COLOR_CONSTANTS
+ MV_END_COLOR_CONSTANTS
+
+ MV_START_STYLE_CONSTANTS
+ MV_END_STYLE_CONSTANTS
+
+ mvImage(const std::string& name);
+
+ bool onEvent(mvEvent& event) override;
+ bool onTextureDeleted(mvEvent& event);
+
+ ~mvImage() override;
+
+ void draw(ImDrawList* drawlist, float x, float y) override;
+
+ void setExtraConfigDict(PyObject* dict) override;
+ void getExtraConfigDict(PyObject* dict) override;
+
+ void setValue (const std::string& value);
+ const std::string& getValue () const;
+
+ private:
+
+ std::string m_value;
+ mvVec2 m_uv_min = {0.0f, 0.0f};
+ mvVec2 m_uv_max = {1.0f, 1.0f};
+ mvColor m_tintColor = {1.0f, 1.0f, 1.0f, 1.0f};
+ mvColor m_borderColor = {0.0f, 0.0f, 0.0f, 0.0f};
+ void* m_texture = nullptr;
+ bool m_dirty = false;
+
+ };
+
+}
\ No newline at end of file
diff --git a/DearPyGui/src/core/AppItems/basic/mvImageButton.cpp b/DearPyGui/src/core/AppItems/basic/mvImageButton.cpp
new file mode 100644
index 000000000..592ab13f5
--- /dev/null
+++ b/DearPyGui/src/core/AppItems/basic/mvImageButton.cpp
@@ -0,0 +1,150 @@
+#include "mvImageButton.h"
+#include "mvTextureStorage.h"
+#include "mvApp.h"
+#include "mvItemRegistry.h"
+#include "mvImGuiThemeScope.h"
+
+namespace Marvel {
+
+ void mvImageButton::InsertParser(std::map* parsers)
+ {
+ parsers->insert({ s_command, mvPythonParser({
+ {mvPythonDataType::Optional},
+ {mvPythonDataType::String, "name"},
+ {mvPythonDataType::KeywordOnly},
+ {mvPythonDataType::String, "value"},
+ {mvPythonDataType::Callable, "callback", "Registers a callback", "None"},
+ {mvPythonDataType::Object, "callback_data", "Callback data", "None"},
+ {mvPythonDataType::FloatList, "tint_color", "", "(255, 255, 255, 255)"},
+ {mvPythonDataType::FloatList, "background_color", "", "(0, 0, 0, 0)"},
+ {mvPythonDataType::String, "parent", "Parent this item will be added to. (runtime adding)", "''"},
+ {mvPythonDataType::String, "before", "This item will be displayed before the specified item in the parent. (runtime adding)", "''"},
+ {mvPythonDataType::Integer, "width","", "0"},
+ {mvPythonDataType::Integer, "height","", "0"},
+ {mvPythonDataType::Integer, "frame_padding","", "-1"},
+ {mvPythonDataType::FloatList, "uv_min", "normalized texture coordinates", "(0.0, 0.0)"},
+ {mvPythonDataType::FloatList, "uv_max", "normalized texture coordinates", "(1.0, 1.0)"},
+ {mvPythonDataType::Bool, "show", "Attempt to render", "True"},
+ {mvPythonDataType::Bool, "enabled", "", "True"},
+ }, "Adds an image button."
+ "uv_min and uv_max represent the normalized texture coordinates of the original image that will be shown."
+ "Using(0,0)->(1,1) texture coordinates will generally display the entire texture", "None", "Adding Widgets") });
+ }
+
+ mvImageButton::mvImageButton(const std::string& name)
+ : mvAppItem(name)
+ {
+ mvEventBus::Subscribe(this, mvEVT_DELETE_TEXTURE);
+ }
+
+ mvImageButton::~mvImageButton()
+ {
+ mvEventBus::Publish(mvEVT_CATEGORY_TEXTURE, mvEVT_DEC_TEXTURE, { CreateEventArgument("NAME", m_value) });
+ mvEventBus::UnSubscribe(this);
+ }
+
+ bool mvImageButton::onEvent(mvEvent& event)
+ {
+ mvEventDispatcher dispatcher(event);
+ dispatcher.dispatch(BIND_EVENT_METH(mvImageButton::onTextureDeleted), mvEVT_DELETE_TEXTURE);
+
+ return event.handled;
+ }
+
+ bool mvImageButton::onTextureDeleted(mvEvent& event)
+ {
+ std::string name = GetEString(event, "NAME");
+
+ if (name == m_value)
+ {
+ m_texture = nullptr;
+ return true;
+ }
+
+ return false;
+ }
+
+ void mvImageButton::draw(ImDrawList* drawlist, float x, float y)
+ {
+ mvImGuiThemeScope scope(this);
+
+ if (m_texture == nullptr && !m_value.empty())
+ {
+ mvApp::GetApp()->getTextureStorage().addTexture(m_value);
+ mvTexture* texture = mvApp::GetApp()->getTextureStorage().getTexture(m_value);
+ if (texture == nullptr)
+ {
+ mvApp::GetApp()->getCallbackRegistry().submitCallback([&]()
+ {
+ PyErr_Format(PyExc_Exception,
+ "Image %s could not be found for add_image_button. Check the path to the image "
+ "you provided.", m_value.c_str());
+ PyErr_Print();
+ m_value = "";
+ });
+ return;
+ }
+ if (m_width == 0) m_width = (int)((float)texture->width * (m_uv_max.x - m_uv_min.x));
+ if (m_height == 0) m_height = (int)((float)texture->height * (m_uv_max.y - m_uv_min.y));
+
+ m_texture = texture->texture;
+ }
+
+ if (m_dirty)
+ {
+ mvTexture* texture = mvApp::GetApp()->getTextureStorage().getTexture(m_value);
+ if (texture)
+ {
+ m_width = (int)((float)texture->width * (m_uv_max.x - m_uv_min.x));
+ m_height = (int)((float)texture->height * (m_uv_max.y - m_uv_min.y));
+ }
+ m_dirty = false;
+ }
+
+ if (m_texture)
+ {
+ ImGui::PushID(m_name.c_str());
+ if (ImGui::ImageButton(m_texture, ImVec2((float)m_width, (float)m_height),
+ ImVec2(m_uv_min.x, m_uv_min.y), ImVec2(m_uv_max.x, m_uv_max.y), m_framePadding,
+ m_backgroundColor, m_tintColor))
+ mvApp::GetApp()->getCallbackRegistry().addCallback(getCallback(false), m_name, m_callback_data);
+ ImGui::PopID();
+ }
+
+ }
+
+ void mvImageButton::setExtraConfigDict(PyObject* dict)
+ {
+ if (dict == nullptr)
+ return;
+
+ if (PyObject* item = PyDict_GetItemString(dict, "uv_min"))
+ {
+ m_uv_min = ToVec2(item);
+ m_dirty = true;
+ }
+ if (PyObject* item = PyDict_GetItemString(dict, "uv_max"))
+ {
+ m_uv_max = ToVec2(item);
+ m_dirty = true;
+ }
+ if (PyObject* item = PyDict_GetItemString(dict, "tint_color")) m_tintColor = ToColor(item);
+ if (PyObject* item = PyDict_GetItemString(dict, "background_color")) m_backgroundColor = ToColor(item);
+ if (PyObject* item = PyDict_GetItemString(dict, "frame_padding")) m_framePadding = ToInt(item);
+ if (PyObject* item = PyDict_GetItemString(dict, "value")) m_value = ToString(item);
+ }
+
+ void mvImageButton::getExtraConfigDict(PyObject* dict)
+ {
+ if (dict == nullptr)
+ return;
+
+ PyDict_SetItemString(dict, "uv_min", ToPyPair(m_uv_min.x, m_uv_min.y));
+ PyDict_SetItemString(dict, "uv_max", ToPyPair(m_uv_max.x, m_uv_max.y));
+ PyDict_SetItemString(dict, "tint_color", ToPyColor(m_tintColor));
+ PyDict_SetItemString(dict, "background_color", ToPyColor(m_backgroundColor));
+ PyDict_SetItemString(dict, "frame_padding", ToPyInt(m_framePadding));
+ PyDict_SetItemString(dict, "value", ToPyString(m_value));
+ }
+
+}
\ No newline at end of file
diff --git a/DearPyGui/src/core/AppItems/basic/mvImageButton.h b/DearPyGui/src/core/AppItems/basic/mvImageButton.h
new file mode 100644
index 000000000..14373d3a7
--- /dev/null
+++ b/DearPyGui/src/core/AppItems/basic/mvImageButton.h
@@ -0,0 +1,77 @@
+#pragma once
+
+#include
+#include
+#include "mvAppItem.h"
+#include "mvItemRegistry.h"
+
+namespace Marvel {
+
+ MV_REGISTER_WIDGET(mvImageButton, MV_ITEM_DESC_DEFAULT, StorageValueTypes::None, 1);
+ class mvImageButton : public mvAppItem, public mvEventHandler
+ {
+
+ public:
+
+ static void InsertParser(std::map* parsers);
+
+ MV_APPLY_WIDGET_REGISTRATION(mvAppItemType::mvImageButton, add_image_button)
+
+ MV_CREATE_CONSTANT(mvThemeCol_ImageButton_Bg, ImGuiCol_Button, 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_ImageButton_BgHovered, ImGuiCol_ButtonHovered, 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_ImageButton_BgActive, ImGuiCol_ButtonActive, 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_ImageButton_Border, ImGuiCol_Border, 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_ImageButton_BorderShadow, ImGuiCol_BorderShadow, 0L);
+
+ MV_CREATE_CONSTANT(mvThemeStyle_ImageButton_BorderSize, ImGuiStyleVar_FrameBorderSize, 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_ImageButton_PaddingX, ImGuiStyleVar_FramePadding, 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_ImageButton_PaddingY, ImGuiStyleVar_FramePadding, 1L);
+
+ MV_START_EXTRA_COMMANDS
+ MV_END_EXTRA_COMMANDS
+
+ MV_START_GENERAL_CONSTANTS
+ MV_END_GENERAL_CONSTANTS
+
+ MV_START_COLOR_CONSTANTS
+ MV_ADD_CONSTANT(mvThemeCol_ImageButton_Bg, mvColor( 41, 74, 122, 138), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_ImageButton_BgHovered, mvColor( 66, 150, 250, 102), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_ImageButton_BgActive, mvColor( 66, 150, 250, 171), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_ImageButton_Border, mvColor(110, 110, 128, 128), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_ImageButton_BorderShadow, mvColor( 0, 0, 0, 0), mvColor(128, 128, 128, 63)),
+ MV_END_COLOR_CONSTANTS
+
+ MV_START_STYLE_CONSTANTS
+ MV_ADD_CONSTANT(mvThemeStyle_ImageButton_BorderSize, 0, 1),
+ MV_ADD_CONSTANT(mvThemeStyle_ImageButton_PaddingX, 4, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_ImageButton_PaddingY, 3, 20),
+ MV_END_STYLE_CONSTANTS
+
+ public:
+
+ mvImageButton(const std::string& name);
+
+ ~mvImageButton() override;
+
+ bool onEvent(mvEvent& event) override;
+ bool onTextureDeleted(mvEvent& event);
+
+ void draw(ImDrawList* drawlist, float x, float y) override;
+
+ void setExtraConfigDict(PyObject* dict) override;
+ void getExtraConfigDict(PyObject* dict) override;
+
+ private:
+
+ std::string m_value;
+ mvVec2 m_uv_min = { 0.0f, 0.0f };
+ mvVec2 m_uv_max = { 1.0f, 1.0f };
+ mvColor m_tintColor = { 1.0f, 1.0f, 1.0f, 1.0f };
+ mvColor m_backgroundColor = { 0.0f, 0.0f, 0.0f, 0.0f };
+ void* m_texture = nullptr;
+ int m_framePadding = -1;
+ bool m_dirty = false;
+
+ };
+
+}
\ No newline at end of file
diff --git a/DearPyGui/src/core/AppItems/basic/mvInputMulti.cpp b/DearPyGui/src/core/AppItems/basic/mvInputMulti.cpp
new file mode 100644
index 000000000..5be89feac
--- /dev/null
+++ b/DearPyGui/src/core/AppItems/basic/mvInputMulti.cpp
@@ -0,0 +1,317 @@
+#include "mvInputMulti.h"
+#include "mvTypeBases.h"
+#include
+#include "mvModule_Core.h"
+#include "mvApp.h"
+#include
+#include "mvItemRegistry.h"
+#include "mvImGuiThemeScope.h"
+#include "mvFontScope.h"
+
+namespace Marvel {
+
+ void mvInputIntMulti::InsertParser(std::map* parsers)
+ {
+ parsers->insert({ s_command, mvPythonParser({
+ {mvPythonDataType::Optional},
+ {mvPythonDataType::String, "name"},
+ {mvPythonDataType::KeywordOnly},
+ {mvPythonDataType::IntList, "default_value", "", "(0, 0, 0, 0)"},
+ {mvPythonDataType::Integer, "size", "number of components", "4"},
+ {mvPythonDataType::Integer, "min_value", "", "0"},
+ {mvPythonDataType::Integer, "max_value", "", "100"},
+ {mvPythonDataType::Bool, "min_clamped", "activates and deactivates min_value", "False"},
+ {mvPythonDataType::Bool, "max_clamped", "activates and deactivates max_value", "False"},
+ {mvPythonDataType::Callable, "callback", "Registers a callback", "None"},
+ {mvPythonDataType::Object, "callback_data", "Callback data", "None"},
+ {mvPythonDataType::String, "parent", "Parent this item will be added to. (runtime adding)", "''"},
+ {mvPythonDataType::String, "before", "This item will be displayed before the specified item in the parent. (runtime adding)", "''"},
+ {mvPythonDataType::String, "source", "", "''"},
+ {mvPythonDataType::Bool, "enabled", "Display grayed out text so selectable cannot be selected", "True"},
+ {mvPythonDataType::Integer, "width","", "0"},
+ {mvPythonDataType::Bool, "on_enter", "Only runs callback on enter", "False"},
+ {mvPythonDataType::String, "label", "", "''"},
+ {mvPythonDataType::Bool, "show", "Attempt to render", "True"},
+ {mvPythonDataType::Bool, "readonly", "", "False"},
+ }, "Adds input for 4 integer values.", "None", "Adding Widgets") });
+ }
+
+ void mvInputFloatMulti::InsertParser(std::map* parsers)
+ {
+ parsers->insert({ s_command, mvPythonParser({
+ {mvPythonDataType::Optional},
+ {mvPythonDataType::String, "name"},
+ {mvPythonDataType::KeywordOnly},
+ {mvPythonDataType::FloatList, "default_value", "", "(0.0, 0.0, 0.0, 0.0)"},
+ {mvPythonDataType::Integer, "size", "number of components", "4"},
+ {mvPythonDataType::Float, "min_value", "", "0"},
+ {mvPythonDataType::Float, "max_value", "", "100"},
+ {mvPythonDataType::Bool, "min_clamped", "activates and deactivates min_value", "False"},
+ {mvPythonDataType::Bool, "max_clamped", "activates and deactivates max_value", "False"},
+ {mvPythonDataType::String, "format", "", "'%.3f'"},
+ {mvPythonDataType::Callable, "callback", "Registers a callback", "None"},
+ {mvPythonDataType::Object, "callback_data", "Callback data", "None"},
+ {mvPythonDataType::String, "parent", "Parent this item will be added to. (runtime adding)", "''"},
+ {mvPythonDataType::String, "before", "This item will be displayed before the specified item in the parent. (runtime adding)", "''"},
+ {mvPythonDataType::String, "source", "", "''"},
+ {mvPythonDataType::Bool, "enabled", "Display grayed out text so selectable cannot be selected", "True"},
+ {mvPythonDataType::Integer, "width","", "0"},
+ {mvPythonDataType::Bool, "on_enter", "Only runs callback on enter", "False"},
+ {mvPythonDataType::String, "label", "", "''"},
+ {mvPythonDataType::Bool, "show", "Attempt to render", "True"},
+ {mvPythonDataType::Bool, "readonly", "", "False"},
+ }, "Adds input for 4 float values.", "None", "Adding Widgets") });
+ }
+
+ mvInputIntMulti::mvInputIntMulti(const std::string& name)
+ : mvInt4PtrBase(name)
+ {
+ m_last_value = *m_value;
+ }
+
+ void mvInputIntMulti::setEnabled(bool value)
+ {
+ if (value == m_enabled)
+ return;
+
+ if (value)
+ m_flags = m_stor_flags;
+
+ else
+ {
+ m_stor_flags = m_flags;
+ m_flags |= ImGuiInputTextFlags_ReadOnly;
+ m_flags &= ~ImGuiInputTextFlags_EnterReturnsTrue;
+ }
+
+ m_enabled = value;
+ }
+
+ void mvInputIntMulti::draw(ImDrawList* drawlist, float x, float y)
+ {
+ ScopedID id;
+ mvImGuiThemeScope scope(this);
+ mvFontScope fscope(this);
+
+ bool res = false;
+
+ switch (m_size)
+ {
+ case 2:
+ res = ImGui::InputInt2(m_label.c_str(), m_value->data(), m_flags);
+ break;
+ case 3:
+ res = ImGui::InputInt3(m_label.c_str(), m_value->data(), m_flags);
+ break;
+ case 4:
+ res = ImGui::InputInt4(m_label.c_str(), m_value->data(), m_flags);
+ break;
+ default:
+ break;
+ }
+
+ if (res)
+ {
+ auto inital_value = *m_value;
+ // determines clamped cases
+ if (m_min_clamped && m_max_clamped)
+ {
+ for (int i = 0; i < 4; i++)
+ {
+ if (m_value->data()[i] < m_min) m_value->data()[i] = m_min;
+ else if (m_value->data()[i] > m_max) m_value->data()[i] = m_max;
+ }
+ }
+ else if (m_min_clamped)
+ {
+ for (int i = 0; i < 4; i++)
+ {
+ if (m_value->data()[i] < m_min) m_value->data()[i] = m_min;
+ }
+ }
+ else if (m_max_clamped)
+ {
+ for (int i = 0; i < 4; i++)
+ {
+ if (m_value->data()[i] > m_max) m_value->data()[i] = m_max;
+ }
+ }
+
+ // If the widget is edited through ctrl+click mode the active value will be entered every frame.
+ // If the value is out of bounds the value will be overwritten with max or min so each frame the value will be switching between the
+ // ctrl+click value and the bounds value until the widget is not in ctrl+click mode. To prevent the callback from running every
+ // frame we check if the value was already submitted.
+ if (m_last_value != *m_value)
+ {
+ m_last_value = *m_value;
+ mvApp::GetApp()->getCallbackRegistry().addCallback(m_callback, m_name, m_callback_data);
+ }
+ }
+ }
+
+ mvInputFloatMulti::mvInputFloatMulti(const std::string& name)
+ : mvFloat4PtrBase(name)
+ {
+ m_last_value = *m_value;
+ }
+
+ void mvInputFloatMulti::setEnabled(bool value)
+ {
+ if (value == m_enabled)
+ return;
+
+ if (value)
+ m_flags = m_stor_flags;
+
+ else
+ {
+ m_stor_flags = m_flags;
+ m_flags |= ImGuiInputTextFlags_ReadOnly;
+ m_flags &= ~ImGuiInputTextFlags_EnterReturnsTrue;
+ }
+
+ m_enabled = value;
+ }
+
+ void mvInputFloatMulti::draw(ImDrawList* drawlist, float x, float y)
+ {
+ ScopedID id;
+ mvImGuiThemeScope scope(this);
+ mvFontScope fscope(this);
+
+ bool res = false;
+
+ switch (m_size)
+ {
+ case 2:
+ res = ImGui::InputFloat2(m_label.c_str(), m_value->data(), m_format.c_str(), m_flags);
+ break;
+ case 3:
+ res = ImGui::InputFloat3(m_label.c_str(), m_value->data(), m_format.c_str(), m_flags);
+ break;
+ case 4:
+ res = ImGui::InputFloat4(m_label.c_str(), m_value->data(), m_format.c_str(), m_flags);
+ break;
+ default:
+ break;
+ }
+
+ if (res)
+ {
+ auto inital_value = *m_value;
+ // determines clamped cases
+ if (m_min_clamped && m_max_clamped)
+ {
+ for (int i = 0; i < 4; i++)
+ {
+ if (m_value->data()[i] < m_min) m_value->data()[i] = m_min;
+ else if (m_value->data()[i] > m_max) m_value->data()[i] = m_max;
+ }
+ }
+ else if (m_min_clamped)
+ {
+ for (int i = 0; i < 4; i++)
+ {
+ if (m_value->data()[i] < m_min) m_value->data()[i] = m_min;
+ }
+ }
+ else if (m_max_clamped)
+ {
+ for (int i = 0; i < 4; i++)
+ {
+ if (m_value->data()[i] > m_max) m_value->data()[i] = m_max;
+ }
+ }
+
+ // If the widget is edited through ctrl+click mode the active value will be entered every frame.
+ // If the value is out of bounds the value will be overwritten with max or min so each frame the value will be switching between the
+ // ctrl+click value and the bounds value until the widget is not in ctrl+click mode. To prevent the callback from running every
+ // frame we check if the value was already submitted.
+ if (m_last_value != *m_value)
+ {
+ m_last_value = *m_value;
+ mvApp::GetApp()->getCallbackRegistry().addCallback(m_callback, m_name, m_callback_data);
+ }
+ }
+ }
+
+ void mvInputIntMulti::setExtraConfigDict(PyObject* dict)
+ {
+ if (dict == nullptr)
+ return;
+
+ if (PyObject* item = PyDict_GetItemString(dict, "on_enter")) ToBool(item) ? m_flags |= ImGuiInputTextFlags_EnterReturnsTrue : m_flags &= ~ImGuiInputTextFlags_EnterReturnsTrue;
+ if (PyObject* item = PyDict_GetItemString(dict, "on_enter")) ToBool(item) ? m_stor_flags |= ImGuiInputTextFlags_EnterReturnsTrue : m_stor_flags &= ~ImGuiInputTextFlags_EnterReturnsTrue;
+ if (PyObject* item = PyDict_GetItemString(dict, "readonly")) ToBool(item) ? m_flags |= ImGuiInputTextFlags_ReadOnly : m_flags &= ~ImGuiInputTextFlags_ReadOnly;
+ if (PyObject* item = PyDict_GetItemString(dict, "readonly")) ToBool(item) ? m_stor_flags |= ImGuiInputTextFlags_ReadOnly : m_stor_flags &= ~ImGuiInputTextFlags_ReadOnly;
+ if (PyObject* item = PyDict_GetItemString(dict, "min_value")) { m_min = ToInt(item); m_min_clamped = true; }
+ if (PyObject* item = PyDict_GetItemString(dict, "max_value")) { m_max = ToInt(item); m_max_clamped = true; }
+ if (PyObject* item = PyDict_GetItemString(dict, "min_clamped")) m_min_clamped = ToBool(item);
+ if (PyObject* item = PyDict_GetItemString(dict, "max_clamped")) m_max_clamped = ToBool(item);
+ if (PyObject* item = PyDict_GetItemString(dict, "size")) m_size = ToInt(item);
+ }
+
+ void mvInputIntMulti::getExtraConfigDict(PyObject* dict)
+ {
+ if (dict == nullptr)
+ return;
+
+ PyDict_SetItemString(dict, "on_enter", ToPyBool(m_flags & ImGuiInputTextFlags_EnterReturnsTrue));
+ PyDict_SetItemString(dict, "readonly", ToPyBool(m_flags & ImGuiInputTextFlags_ReadOnly));
+ PyDict_SetItemString(dict, "min_value", ToPyInt(m_min));
+ PyDict_SetItemString(dict, "max_value", ToPyInt(m_max));
+ PyDict_SetItemString(dict, "min_clamped", ToPyBool(m_min_clamped));
+ PyDict_SetItemString(dict, "max_clamped", ToPyBool(m_max_clamped));
+ PyDict_SetItemString(dict, "size", ToPyInt(m_size));
+ }
+
+ void mvInputFloatMulti::setExtraConfigDict(PyObject* dict)
+ {
+ if (dict == nullptr)
+ return;
+
+ if (PyObject* item = PyDict_GetItemString(dict, "format")) m_format = ToString(item);
+ if (PyObject* item = PyDict_GetItemString(dict, "min_value")) { m_min = ToFloat(item); m_min_clamped = true; }
+ if (PyObject* item = PyDict_GetItemString(dict, "max_value")) { m_max = ToFloat(item); m_max_clamped = true; }
+ if (PyObject* item = PyDict_GetItemString(dict, "min_clamped")) m_min_clamped = ToBool(item);
+ if (PyObject* item = PyDict_GetItemString(dict, "max_clamped")) m_max_clamped = ToBool(item);
+ if (PyObject* item = PyDict_GetItemString(dict, "size")) m_size = ToInt(item);
+
+ // helper for bit flipping
+ auto flagop = [dict](const char* keyword, int flag, int& flags)
+ {
+ if (PyObject* item = PyDict_GetItemString(dict, keyword)) ToBool(item) ? flags |= flag : flags &= ~flag;
+ };
+
+ // flags
+ flagop("on_enter", ImGuiInputTextFlags_EnterReturnsTrue, m_flags);
+ flagop("on_enter", ImGuiInputTextFlags_EnterReturnsTrue, m_stor_flags);
+ flagop("readonly", ImGuiInputTextFlags_ReadOnly, m_flags);
+ flagop("readonly", ImGuiInputTextFlags_ReadOnly, m_stor_flags);
+
+ }
+
+ void mvInputFloatMulti::getExtraConfigDict(PyObject* dict)
+ {
+ if (dict == nullptr)
+ return;
+
+ PyDict_SetItemString(dict, "format", ToPyString(m_format));
+ PyDict_SetItemString(dict, "min_value", ToPyFloat(m_min));
+ PyDict_SetItemString(dict, "max_value", ToPyFloat(m_max));
+ PyDict_SetItemString(dict, "min_clamped", ToPyBool(m_min_clamped));
+ PyDict_SetItemString(dict, "max_clamped", ToPyBool(m_max_clamped));
+ PyDict_SetItemString(dict, "size", ToPyInt(m_size));
+
+ // helper to check and set bit
+ auto checkbitset = [dict](const char* keyword, int flag, const int& flags)
+ {
+ PyDict_SetItemString(dict, keyword, ToPyBool(flags & flag));
+ };
+
+ // window flags
+ checkbitset("on_enter", ImGuiInputTextFlags_EnterReturnsTrue, m_flags);
+ checkbitset("readonly", ImGuiInputTextFlags_ReadOnly, m_flags);
+ }
+
+}
diff --git a/DearPyGui/src/core/AppItems/basic/mvInputMulti.h b/DearPyGui/src/core/AppItems/basic/mvInputMulti.h
new file mode 100644
index 000000000..3ed62871c
--- /dev/null
+++ b/DearPyGui/src/core/AppItems/basic/mvInputMulti.h
@@ -0,0 +1,162 @@
+#pragma once
+
+#include "mvTypeBases.h"
+#include "mvApp.h"
+#include "mvModule_Core.h"
+#include
+
+//-----------------------------------------------------------------------------
+// Widget Index
+//
+// * mvInputIntMulti
+// * mvInputFloatMulti
+//
+//-----------------------------------------------------------------------------
+
+namespace Marvel {
+
+ //-----------------------------------------------------------------------------
+ // mvInputIntMulti
+ //-----------------------------------------------------------------------------
+ MV_REGISTER_WIDGET(mvInputIntMulti, MV_ITEM_DESC_DEFAULT, StorageValueTypes::Int4, 1);
+ class mvInputIntMulti : public mvInt4PtrBase
+ {
+
+ public:
+
+ static void InsertParser(std::map* parsers);
+
+ MV_APPLY_WIDGET_REGISTRATION(mvAppItemType::mvInputIntMulti, add_input_intx)
+
+ MV_CREATE_CONSTANT(mvThemeCol_InputIntx_Text, ImGuiCol_Text, 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_InputIntx_TextHighlight, ImGuiCol_TextSelectedBg, 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_InputIntx_Bg, ImGuiCol_FrameBg, 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_InputIntx_Border, ImGuiCol_Border, 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_InputIntx_BorderShadow, ImGuiCol_BorderShadow, 0L);
+
+ MV_CREATE_CONSTANT(mvThemeStyle_InputIntx_Rounding, ImGuiStyleVar_FrameRounding, 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_InputIntx_BorderSize, ImGuiStyleVar_FrameBorderSize, 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_InputIntx_PaddingX, ImGuiStyleVar_FramePadding, 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_InputIntx_PaddingY, ImGuiStyleVar_FramePadding, 1L);
+ MV_CREATE_CONSTANT(mvThemeStyle_InputIntx_InnerSpacingX, ImGuiStyleVar_ItemInnerSpacing, 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_InputIntx_InnerSpacingY, ImGuiStyleVar_ItemInnerSpacing, 1L);
+
+ MV_START_EXTRA_COMMANDS
+ MV_END_EXTRA_COMMANDS
+
+ MV_START_GENERAL_CONSTANTS
+ MV_END_GENERAL_CONSTANTS
+
+ MV_START_COLOR_CONSTANTS
+ MV_ADD_CONSTANT(mvThemeCol_InputIntx_Text, mvColor(255, 255, 255, 255), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_InputIntx_TextHighlight, mvColor( 66, 150, 250, 89), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_InputIntx_Bg, mvColor( 41, 74, 122, 138), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_InputIntx_Border, mvColor(110, 110, 128, 128), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_InputIntx_BorderShadow, mvColor( 0, 0, 0, 0), mvColor(128, 128, 128, 63)),
+ MV_END_COLOR_CONSTANTS
+
+ MV_START_STYLE_CONSTANTS
+ MV_ADD_CONSTANT(mvThemeStyle_InputIntx_Rounding, 0, 12),
+ MV_ADD_CONSTANT(mvThemeStyle_InputIntx_BorderSize, 0, 1),
+ MV_ADD_CONSTANT(mvThemeStyle_InputIntx_PaddingX, 4, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_InputIntx_PaddingY, 3, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_InputIntx_InnerSpacingX, 4, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_InputIntx_InnerSpacingY, 4, 20),
+ MV_END_STYLE_CONSTANTS
+
+ public:
+
+ mvInputIntMulti(const std::string& name);
+
+ void setEnabled(bool value) override;
+ void draw(ImDrawList* drawlist, float x, float y) override;
+
+ void setExtraConfigDict(PyObject* dict) override;
+ void getExtraConfigDict(PyObject* dict) override;
+
+ private:
+
+ int m_min = 0;
+ int m_max = 100;
+ bool m_min_clamped = false;
+ bool m_max_clamped = false;
+ ImGuiInputTextFlags m_flags = 0;
+ ImGuiInputTextFlags m_stor_flags = 0;
+ std::array m_last_value = { 0, 0, 0, 0 };
+ int m_size = 4;
+
+ };
+
+ //-----------------------------------------------------------------------------
+ // mvInputFloatMulti
+ //-----------------------------------------------------------------------------
+ MV_REGISTER_WIDGET(mvInputFloatMulti, MV_ITEM_DESC_DEFAULT, StorageValueTypes::Float4, 1);
+ class mvInputFloatMulti : public mvFloat4PtrBase
+ {
+
+ public:
+
+ static void InsertParser(std::map* parsers);
+
+ MV_APPLY_WIDGET_REGISTRATION(mvAppItemType::mvInputFloatMulti, add_input_floatx)
+
+ MV_CREATE_CONSTANT(mvThemeCol_InputFloatx_Text, ImGuiCol_Text, 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_InputFloatx_TextHighlight, ImGuiCol_TextSelectedBg, 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_InputFloatx_Bg, ImGuiCol_FrameBg, 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_InputFloatx_Border, ImGuiCol_Border, 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_InputFloatx_BorderShadow, ImGuiCol_BorderShadow, 0L);
+
+ MV_CREATE_CONSTANT(mvThemeStyle_InputFloatx_Rounding, ImGuiStyleVar_FrameRounding, 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_InputFloatx_BorderSize, ImGuiStyleVar_FrameBorderSize, 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_InputFloatx_PaddingX, ImGuiStyleVar_FramePadding, 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_InputFloatx_PaddingY, ImGuiStyleVar_FramePadding, 1L);
+ MV_CREATE_CONSTANT(mvThemeStyle_InputFloatx_InnerSpacingX, ImGuiStyleVar_ItemInnerSpacing, 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_InputFloatx_InnerSpacingY, ImGuiStyleVar_ItemInnerSpacing, 1L);
+
+ MV_START_EXTRA_COMMANDS
+ MV_END_EXTRA_COMMANDS
+
+ MV_START_GENERAL_CONSTANTS
+ MV_END_GENERAL_CONSTANTS
+
+ MV_START_COLOR_CONSTANTS
+ MV_ADD_CONSTANT(mvThemeCol_InputFloatx_Text, mvColor(255, 255, 255, 255), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_InputFloatx_TextHighlight, mvColor( 66, 150, 250, 89), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_InputFloatx_Bg, mvColor( 41, 74, 122, 138), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_InputFloatx_Border, mvColor(110, 110, 128, 128), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_InputFloatx_BorderShadow, mvColor( 0, 0, 0, 0), mvColor(128, 128, 128, 63)),
+ MV_END_COLOR_CONSTANTS
+
+ MV_START_STYLE_CONSTANTS
+ MV_ADD_CONSTANT(mvThemeStyle_InputFloatx_Rounding, 0, 12),
+ MV_ADD_CONSTANT(mvThemeStyle_InputFloatx_BorderSize, 0, 1),
+ MV_ADD_CONSTANT(mvThemeStyle_InputFloatx_PaddingX, 4, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_InputFloatx_PaddingY, 3, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_InputFloatx_InnerSpacingX, 4, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_InputFloatx_InnerSpacingY, 4, 20),
+ MV_END_STYLE_CONSTANTS
+
+ public:
+
+ mvInputFloatMulti(const std::string& name);
+
+ void setEnabled(bool value) override;
+ void draw(ImDrawList* drawlist, float x, float y) override;
+
+ void setExtraConfigDict(PyObject* dict) override;
+ void getExtraConfigDict(PyObject* dict) override;
+
+ private:
+
+ float m_min = 0.0f;
+ float m_max = 100.0f;
+ bool m_min_clamped = false;
+ bool m_max_clamped = false;
+ std::string m_format = "%.3f";
+ ImGuiInputTextFlags m_flags = 0;
+ ImGuiInputTextFlags m_stor_flags = 0;
+ std::arraym_last_value = { 0.0f, 0.0f, 0.0f, 0.0f };
+ int m_size = 4;
+ };
+
+}
diff --git a/DearPyGui/src/core/AppItems/basic/mvInputSingle.cpp b/DearPyGui/src/core/AppItems/basic/mvInputSingle.cpp
new file mode 100644
index 000000000..a5d9811cc
--- /dev/null
+++ b/DearPyGui/src/core/AppItems/basic/mvInputSingle.cpp
@@ -0,0 +1,273 @@
+#include "mvInputSingle.h"
+#include "mvTypeBases.h"
+#include
+#include "mvModule_Core.h"
+#include "mvApp.h"
+#include
+#include "mvItemRegistry.h"
+#include "mvImGuiThemeScope.h"
+#include "mvFontScope.h"
+
+namespace Marvel {
+
+ void mvInputInt::InsertParser(std::map* parsers)
+ {
+ parsers->insert({ s_command, mvPythonParser({
+ {mvPythonDataType::Optional},
+ {mvPythonDataType::String, "name"},
+ {mvPythonDataType::KeywordOnly},
+ {mvPythonDataType::Integer, "default_value", "", "0"},
+ {mvPythonDataType::Integer, "min_value", "", "0"},
+ {mvPythonDataType::Integer, "max_value", "", "100"},
+ {mvPythonDataType::Bool, "min_clamped", "activates and deactivates min_value", "False"},
+ {mvPythonDataType::Bool, "max_clamped", "activates and deactivates max_value", "False"},
+ {mvPythonDataType::Callable, "callback", "Registers a callback", "None"},
+ {mvPythonDataType::Object, "callback_data", "Callback data", "None"},
+ {mvPythonDataType::String, "parent", "Parent to add this item to. (runtime adding)", "''"},
+ {mvPythonDataType::String, "before", "This item will be displayed before the specified item in the parent. (runtime adding)", "''"},
+ {mvPythonDataType::String, "source", "", "''"},
+ {mvPythonDataType::Bool, "enabled", "Display grayed out text so selectable cannot be selected", "True"},
+ {mvPythonDataType::Integer, "width","", "0"},
+ {mvPythonDataType::Bool, "on_enter", "Only runs callback on enter", "False"},
+ {mvPythonDataType::String, "label", "", "''"},
+ {mvPythonDataType::Bool, "show", "Attempt to render", "True"},
+ {mvPythonDataType::Integer, "step", "", "1"},
+ {mvPythonDataType::Integer, "step_fast", "", "100"},
+ {mvPythonDataType::Bool, "readonly", "", "False"},
+ }, "Adds input for integer values.", "None", "Adding Widgets") });
+ }
+
+ void mvInputFloat::InsertParser(std::map* parsers)
+ {
+ parsers->insert({ s_command, mvPythonParser({
+ {mvPythonDataType::Optional},
+ {mvPythonDataType::String, "name"},
+ {mvPythonDataType::KeywordOnly},
+ {mvPythonDataType::Float, "default_value", "", "0.0"},
+ {mvPythonDataType::Float, "min_value", "", "0"},
+ {mvPythonDataType::Float, "max_value", "", "100"},
+ {mvPythonDataType::Bool, "min_clamped", "activates and deactivates min_value", "False"},
+ {mvPythonDataType::Bool, "max_clamped", "activates and deactivates max_value", "False"},
+ {mvPythonDataType::String, "format", "", "'%.3f'"},
+ {mvPythonDataType::Callable, "callback", "Registers a callback", "None"},
+ {mvPythonDataType::Object, "callback_data", "Callback data", "None"},
+ {mvPythonDataType::String, "parent", "Parent this item will be added to. (runtime adding)", "''"},
+ {mvPythonDataType::String, "before", "This item will be displayed before the specified item in the parent. (runtime adding)", "''"},
+ {mvPythonDataType::String, "source", "", "''"},
+ {mvPythonDataType::Bool, "enabled", "Display grayed out text so selectable cannot be selected", "True"},
+ {mvPythonDataType::Integer, "width","", "0"},
+ {mvPythonDataType::Bool, "on_enter", "Only runs callback on enter", "False"},
+ {mvPythonDataType::String, "label", "", "''"},
+ {mvPythonDataType::Bool, "show", "Attempt to render", "True"},
+ {mvPythonDataType::Float, "step", "", "0.1"},
+ {mvPythonDataType::Float, "step_fast", "", "1.0"},
+ {mvPythonDataType::Bool, "readonly", "", "False"},
+ }, "Adds input for float values.", "None", "Adding Widgets") });
+ }
+
+ mvInputInt::mvInputInt(const std::string& name)
+ : mvIntPtrBase(name)
+ {
+ m_last_value = *m_value;
+ }
+
+ void mvInputInt::setEnabled(bool value)
+ {
+ if (value == m_enabled)
+ return;
+
+ if (value)
+ m_flags = m_stor_flags;
+
+ else
+ {
+ m_stor_flags = m_flags;
+ m_flags |= ImGuiInputTextFlags_ReadOnly;
+ m_flags &= ~ImGuiInputTextFlags_EnterReturnsTrue;
+ }
+
+ m_enabled = value;
+ }
+
+ void mvInputInt::draw(ImDrawList* drawlist, float x, float y)
+ {
+ ScopedID id;
+ mvImGuiThemeScope scope(this);
+ mvFontScope fscope(this);
+
+ if (ImGui::InputInt(m_label.c_str(), m_value.get(), m_step, m_step_fast, m_flags))
+ {
+ // determines clamped cases
+ if (m_min_clamped && m_max_clamped)
+ {
+ if (*m_value < m_min) *m_value = m_min;
+ else if (*m_value > m_max) *m_value = m_max;
+ }
+ else if (m_min_clamped)
+ {
+ if (*m_value < m_min) *m_value = m_min;
+ }
+ else if (m_max_clamped)
+ {
+ if (*m_value > m_max) *m_value = m_max;
+ }
+
+ // If the widget is edited through ctrl+click mode the active value will be entered every frame.
+ // If the value is out of bounds the value will be overwritten with max or min so each frame the value will be switching between the
+ // ctrl+click value and the bounds value until the widget is not in ctrl+click mode. To prevent the callback from running every
+ // frame we check if the value was already submitted.
+ if (m_last_value != *m_value)
+ {
+ m_last_value = *m_value;
+ mvApp::GetApp()->getCallbackRegistry().addCallback(m_callback, m_name, m_callback_data);
+ }
+ }
+
+ }
+
+ mvInputFloat::mvInputFloat(const std::string& name)
+ : mvFloatPtrBase(name)
+ {
+ m_last_value = *m_value;
+ }
+
+ void mvInputFloat::setEnabled(bool value)
+ {
+ if (value == m_enabled)
+ return;
+
+ if (value)
+ m_flags = m_stor_flags;
+
+ else
+ {
+ m_stor_flags = m_flags;
+ m_flags |= ImGuiInputTextFlags_ReadOnly;
+ m_flags &= ~ImGuiInputTextFlags_EnterReturnsTrue;
+ }
+
+ m_enabled = value;
+ }
+
+ void mvInputFloat::draw(ImDrawList* drawlist, float x, float y)
+ {
+ ScopedID id;
+ mvImGuiThemeScope scope(this);
+ mvFontScope fscope(this);
+
+ if (ImGui::InputFloat(m_label.c_str(), m_value.get(), m_step, m_step_fast, m_format.c_str(), m_flags))
+ {
+ auto inital_value = *m_value;
+ // determines clamped cases
+ if (m_min_clamped && m_max_clamped)
+ {
+ if (*m_value < m_min) *m_value = m_min;
+ else if (*m_value > m_max) *m_value = m_max;
+ }
+ else if (m_min_clamped)
+ {
+ if (*m_value < m_min) *m_value = m_min;
+ }
+ else if (m_max_clamped)
+ {
+ if (*m_value > m_max) *m_value = m_max;
+ }
+
+ // If the widget is edited through ctrl+click mode the active value will be entered every frame.
+ // If the value is out of bounds the value will be overwritten with max or min so each frame the value will be switching between the
+ // ctrl+click value and the bounds value until the widget is not in ctrl+click mode. To prevent the callback from running every
+ // frame we check if the value was already submitted.
+ if (m_last_value != *m_value)
+ {
+ m_last_value = *m_value;
+ mvApp::GetApp()->getCallbackRegistry().addCallback(m_callback, m_name, m_callback_data);
+ }
+ }
+ }
+
+ void mvInputInt::setExtraConfigDict(PyObject* dict)
+ {
+ if (dict == nullptr)
+ return;
+
+ if (PyObject* item = PyDict_GetItemString(dict, "on_enter")) ToBool(item) ? m_flags |= ImGuiInputTextFlags_EnterReturnsTrue : m_flags &= ~ImGuiInputTextFlags_EnterReturnsTrue;
+ if (PyObject* item = PyDict_GetItemString(dict, "on_enter")) ToBool(item) ? m_stor_flags |= ImGuiInputTextFlags_EnterReturnsTrue : m_stor_flags &= ~ImGuiInputTextFlags_EnterReturnsTrue;
+ if (PyObject* item = PyDict_GetItemString(dict, "readonly")) ToBool(item) ? m_flags |= ImGuiInputTextFlags_ReadOnly : m_flags &= ~ImGuiInputTextFlags_ReadOnly;
+ if (PyObject* item = PyDict_GetItemString(dict, "readonly")) ToBool(item) ? m_stor_flags |= ImGuiInputTextFlags_ReadOnly : m_stor_flags &= ~ImGuiInputTextFlags_ReadOnly;
+ if (PyObject* item = PyDict_GetItemString(dict, "step")) m_step = ToInt(item);
+ if (PyObject* item = PyDict_GetItemString(dict, "step_fast")) m_step_fast = ToInt(item);
+ if (PyObject* item = PyDict_GetItemString(dict, "min_value")) { m_min = ToInt(item); m_min_clamped = true; }
+ if (PyObject* item = PyDict_GetItemString(dict, "max_value")) { m_max = ToInt(item); m_max_clamped = true; }
+ if (PyObject* item = PyDict_GetItemString(dict, "min_clamped")) m_min_clamped = ToBool(item);
+ if (PyObject* item = PyDict_GetItemString(dict, "max_clamped")) m_max_clamped = ToBool(item);
+ }
+
+ void mvInputInt::getExtraConfigDict(PyObject* dict)
+ {
+ if (dict == nullptr)
+ return;
+
+ PyDict_SetItemString(dict, "on_enter", ToPyBool(m_flags & ImGuiInputTextFlags_EnterReturnsTrue));
+ PyDict_SetItemString(dict, "readonly", ToPyBool(m_flags & ImGuiInputTextFlags_ReadOnly));
+ PyDict_SetItemString(dict, "step", ToPyInt(m_step));
+ PyDict_SetItemString(dict, "step_fast", ToPyInt(m_step_fast));
+ PyDict_SetItemString(dict, "min_value", ToPyInt(m_min));
+ PyDict_SetItemString(dict, "max_value", ToPyInt(m_max));
+ PyDict_SetItemString(dict, "min_clamped", ToPyBool(m_min_clamped));
+ PyDict_SetItemString(dict, "max_clamped", ToPyBool(m_max_clamped));
+
+ }
+
+ void mvInputFloat::setExtraConfigDict(PyObject* dict)
+ {
+ if (dict == nullptr)
+ return;
+
+ if (PyObject* item = PyDict_GetItemString(dict, "format")) m_format = ToString(item);
+ if (PyObject* item = PyDict_GetItemString(dict, "step")) m_step = ToFloat(item);
+ if (PyObject* item = PyDict_GetItemString(dict, "step_fast")) m_step_fast = ToFloat(item);
+ if (PyObject* item = PyDict_GetItemString(dict, "min_value")) { m_min = ToFloat(item); m_min_clamped = true; }
+ if (PyObject* item = PyDict_GetItemString(dict, "max_value")) { m_max = ToFloat(item); m_max_clamped = true; }
+ if (PyObject* item = PyDict_GetItemString(dict, "min_clamped")) m_min_clamped = ToBool(item);
+ if (PyObject* item = PyDict_GetItemString(dict, "max_clamped")) m_max_clamped = ToBool(item);
+
+ // helper for bit flipping
+ auto flagop = [dict](const char* keyword, int flag, int& flags)
+ {
+ if (PyObject* item = PyDict_GetItemString(dict, keyword)) ToBool(item) ? flags |= flag : flags &= ~flag;
+ };
+
+ // flags
+ flagop("on_enter", ImGuiInputTextFlags_EnterReturnsTrue, m_flags);
+ flagop("on_enter", ImGuiInputTextFlags_EnterReturnsTrue, m_stor_flags);
+ flagop("readonly", ImGuiInputTextFlags_ReadOnly, m_flags);
+ flagop("readonly", ImGuiInputTextFlags_ReadOnly, m_stor_flags);
+
+ }
+
+ void mvInputFloat::getExtraConfigDict(PyObject* dict)
+ {
+ if (dict == nullptr)
+ return;
+
+ PyDict_SetItemString(dict, "format", ToPyString(m_format));
+ PyDict_SetItemString(dict, "step", ToPyFloat(m_step));
+ PyDict_SetItemString(dict, "step_fast", ToPyFloat(m_step_fast));
+ PyDict_SetItemString(dict, "min_value", ToPyFloat(m_min));
+ PyDict_SetItemString(dict, "max_value", ToPyFloat(m_max));
+ PyDict_SetItemString(dict, "min_clamped", ToPyBool(m_min_clamped));
+ PyDict_SetItemString(dict, "max_clamped", ToPyBool(m_max_clamped));
+
+ // helper to check and set bit
+ auto checkbitset = [dict](const char* keyword, int flag, const int& flags)
+ {
+ PyDict_SetItemString(dict, keyword, ToPyBool(flags & flag));
+ };
+
+ // window flags
+ checkbitset("on_enter", ImGuiInputTextFlags_EnterReturnsTrue, m_flags);
+ checkbitset("readonly", ImGuiInputTextFlags_ReadOnly, m_flags);
+
+ }
+
+}
diff --git a/DearPyGui/src/core/AppItems/basic/mvInputSingle.h b/DearPyGui/src/core/AppItems/basic/mvInputSingle.h
new file mode 100644
index 000000000..d4914adcc
--- /dev/null
+++ b/DearPyGui/src/core/AppItems/basic/mvInputSingle.h
@@ -0,0 +1,185 @@
+#pragma once
+
+#include "mvTypeBases.h"
+#include "mvApp.h"
+#include "mvModule_Core.h"
+#include
+
+//-----------------------------------------------------------------------------
+// Widget Index
+//
+// * mvInputInt
+// * mvInputFloat
+//
+//-----------------------------------------------------------------------------
+
+namespace Marvel {
+
+ //-----------------------------------------------------------------------------
+ // mvInputInt
+ //-----------------------------------------------------------------------------
+ MV_REGISTER_WIDGET(mvInputInt, MV_ITEM_DESC_DEFAULT, StorageValueTypes::Int, 1);
+ class mvInputInt : public mvIntPtrBase
+ {
+
+ public:
+
+ static void InsertParser(std::map* parsers);
+
+ MV_APPLY_WIDGET_REGISTRATION(mvAppItemType::mvInputInt, add_input_int)
+
+ MV_CREATE_CONSTANT(mvThemeCol_InputInt_Text , ImGuiCol_Text , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_InputInt_TextHighlight , ImGuiCol_TextSelectedBg , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_InputInt_Bg , ImGuiCol_FrameBg , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_InputInt_ButtonBg , ImGuiCol_Button , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_InputInt_ButtonBgHovered , ImGuiCol_ButtonHovered , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_InputInt_ButtonBgActive , ImGuiCol_ButtonActive , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_InputInt_Border , ImGuiCol_Border , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_InputInt_BorderShadow , ImGuiCol_BorderShadow , 0L);
+
+ MV_CREATE_CONSTANT(mvThemeStyle_InputInt_Rounding , ImGuiStyleVar_FrameRounding , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_InputInt_BorderSize , ImGuiStyleVar_FrameBorderSize , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_InputInt_PaddingX , ImGuiStyleVar_FramePadding , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_InputInt_PaddingY , ImGuiStyleVar_FramePadding , 1L);
+ MV_CREATE_CONSTANT(mvThemeStyle_InputInt_InnerSpacingX , ImGuiStyleVar_ItemInnerSpacing , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_InputInt_InnerSpacingY , ImGuiStyleVar_ItemInnerSpacing , 1L);
+ MV_CREATE_CONSTANT(mvThemeStyle_InputInt_ButtonTextAlignX, ImGuiStyleVar_ButtonTextAlign , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_InputInt_ButtonTextAlignY, ImGuiStyleVar_ButtonTextAlign , 1L);
+
+ MV_START_EXTRA_COMMANDS
+ MV_END_EXTRA_COMMANDS
+
+ MV_START_GENERAL_CONSTANTS
+ MV_END_GENERAL_CONSTANTS
+
+ MV_START_COLOR_CONSTANTS
+ MV_ADD_CONSTANT(mvThemeCol_InputInt_Text, mvColor(255, 255, 255, 255), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_InputInt_TextHighlight, mvColor( 66, 150, 250, 89), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_InputInt_Bg, mvColor( 41, 74, 122, 138), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_InputInt_ButtonBg, mvColor( 66, 150, 250, 102), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_InputInt_ButtonBgHovered, mvColor( 66, 150, 250, 255), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_InputInt_ButtonBgActive, mvColor( 15, 135, 250, 255), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_InputInt_Border, mvColor(110, 110, 128, 128), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_InputInt_BorderShadow, mvColor( 0, 0, 0, 0), mvColor(128, 128, 128, 63)),
+ MV_END_COLOR_CONSTANTS
+
+ MV_START_STYLE_CONSTANTS
+ MV_ADD_CONSTANT(mvThemeStyle_InputInt_Rounding , 0, 12),
+ MV_ADD_CONSTANT(mvThemeStyle_InputInt_BorderSize , 0, 1),
+ MV_ADD_CONSTANT(mvThemeStyle_InputInt_PaddingX , 4, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_InputInt_PaddingY , 3, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_InputInt_InnerSpacingX , 4, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_InputInt_InnerSpacingY , 4, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_InputInt_ButtonTextAlignX , 0.5, 1),
+ MV_ADD_CONSTANT(mvThemeStyle_InputInt_ButtonTextAlignY , 0.5, 1),
+ MV_END_STYLE_CONSTANTS
+
+ public:
+
+ mvInputInt(const std::string& name);
+
+ void setEnabled(bool value) override;
+ void draw(ImDrawList* drawlist, float x, float y) override;
+
+ void setExtraConfigDict(PyObject* dict) override;
+ void getExtraConfigDict(PyObject* dict) override;
+
+ private:
+
+ int m_step = 1;
+ int m_step_fast = 100;
+ int m_min = 0;
+ int m_max = 100;
+ bool m_min_clamped = false;
+ bool m_max_clamped = false;
+ ImGuiInputTextFlags m_flags = 0;
+ ImGuiInputTextFlags m_stor_flags = 0;
+ int m_last_value = 0;
+
+ };
+
+ //-----------------------------------------------------------------------------
+ // mvInputFloat
+ //-----------------------------------------------------------------------------
+ MV_REGISTER_WIDGET(mvInputFloat, MV_ITEM_DESC_DEFAULT, StorageValueTypes::Float, 1);
+ class mvInputFloat : public mvFloatPtrBase
+ {
+
+ public:
+
+ static void InsertParser(std::map* parsers);
+
+ MV_APPLY_WIDGET_REGISTRATION(mvAppItemType::mvInputFloat, add_input_float)
+
+ MV_CREATE_CONSTANT(mvThemeCol_InputFloat_Text , ImGuiCol_Text , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_InputFloat_TextHighlight , ImGuiCol_TextSelectedBg, 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_InputFloat_Bg , ImGuiCol_FrameBg , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_InputFloat_ButtonBg , ImGuiCol_Button , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_InputFloat_ButtonBgHovered , ImGuiCol_ButtonHovered , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_InputFloat_ButtonBgActive , ImGuiCol_ButtonActive , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_InputFloat_Border , ImGuiCol_Border , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_InputFloat_BorderShadow , ImGuiCol_BorderShadow , 0L);
+
+ MV_CREATE_CONSTANT(mvThemeStyle_InputFloat_Rounding , ImGuiStyleVar_FrameRounding , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_InputFloat_BorderSize , ImGuiStyleVar_FrameBorderSize , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_InputFloat_PaddingX , ImGuiStyleVar_FramePadding , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_InputFloat_PaddingY , ImGuiStyleVar_FramePadding , 1L);
+ MV_CREATE_CONSTANT(mvThemeStyle_InputFloat_InnerSpacingX , ImGuiStyleVar_ItemInnerSpacing , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_InputFloat_InnerSpacingY , ImGuiStyleVar_ItemInnerSpacing , 1L);
+ MV_CREATE_CONSTANT(mvThemeStyle_InputFloat_ButtonTextAlignX, ImGuiStyleVar_ButtonTextAlign , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_InputFloat_ButtonTextAlignY, ImGuiStyleVar_ButtonTextAlign , 1L);
+
+ MV_START_EXTRA_COMMANDS
+ MV_END_EXTRA_COMMANDS
+
+ MV_START_GENERAL_CONSTANTS
+ MV_END_GENERAL_CONSTANTS
+
+ MV_START_COLOR_CONSTANTS
+ MV_ADD_CONSTANT(mvThemeCol_InputFloat_Text, mvColor(255, 255, 255, 255), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_InputFloat_TextHighlight, mvColor( 66, 150, 250, 89), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_InputFloat_Bg, mvColor( 41, 74, 122, 138), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_InputFloat_ButtonBg, mvColor( 66, 150, 250, 102), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_InputFloat_ButtonBgHovered, mvColor( 66, 150, 250, 255), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_InputFloat_ButtonBgActive, mvColor( 15, 135, 250, 255), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_InputFloat_Border, mvColor(110, 110, 128, 128), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_InputFloat_BorderShadow, mvColor( 0, 0, 0, 0), mvColor(128, 128, 128, 63)),
+ MV_END_COLOR_CONSTANTS
+
+ MV_START_STYLE_CONSTANTS
+ MV_ADD_CONSTANT(mvThemeStyle_InputFloat_Rounding , 0, 12),
+ MV_ADD_CONSTANT(mvThemeStyle_InputFloat_BorderSize , 0, 1),
+ MV_ADD_CONSTANT(mvThemeStyle_InputFloat_PaddingX , 4, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_InputFloat_PaddingY , 3, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_InputFloat_InnerSpacingX , 4, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_InputFloat_InnerSpacingY , 4, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_InputFloat_ButtonTextAlignX, 0.5, 1),
+ MV_ADD_CONSTANT(mvThemeStyle_InputFloat_ButtonTextAlignY, 0.5, 1),
+ MV_END_STYLE_CONSTANTS
+
+ public:
+
+ mvInputFloat(const std::string& name);
+
+ void setEnabled(bool value) override;
+ void draw(ImDrawList* drawlist, float x, float y) override;
+
+ void setExtraConfigDict(PyObject* dict) override;
+ void getExtraConfigDict(PyObject* dict) override;
+
+ private:
+
+ float m_min = 0.0f;
+ float m_max = 100.0f;
+ bool m_min_clamped = false;
+ bool m_max_clamped = false;
+ std::string m_format = "%.3f";
+ float m_step = 0.1f;
+ float m_step_fast = 1.0f;
+ ImGuiInputTextFlags m_flags = 0;
+ ImGuiInputTextFlags m_stor_flags = 0;
+ float m_last_value = 0.0f;
+
+ };
+
+}
diff --git a/DearPyGui/src/core/AppItems/basic/mvInputText.cpp b/DearPyGui/src/core/AppItems/basic/mvInputText.cpp
new file mode 100644
index 000000000..ba45f8508
--- /dev/null
+++ b/DearPyGui/src/core/AppItems/basic/mvInputText.cpp
@@ -0,0 +1,145 @@
+#include "mvInputText.h"
+#include
+#include
+#include "mvItemRegistry.h"
+#include "mvImGuiThemeScope.h"
+#include "mvFontScope.h"
+
+namespace Marvel {
+
+ void mvInputText::InsertParser(std::map* parsers)
+ {
+ parsers->insert({ s_command, mvPythonParser({
+ {mvPythonDataType::Optional},
+ {mvPythonDataType::String, "name"},
+ {mvPythonDataType::KeywordOnly},
+ {mvPythonDataType::String, "default_value", "", "''"},
+ {mvPythonDataType::String, "hint", "", "''"},
+ {mvPythonDataType::Bool, "multiline", "", "False"},
+ {mvPythonDataType::Bool, "no_spaces", "Filter out spaces, tabs", "False"},
+ {mvPythonDataType::Bool, "uppercase", "", "False"},
+ {mvPythonDataType::Bool, "tab_input", "Allows tabs to be input instead of changing widget focus", "False"},
+ {mvPythonDataType::Bool, "decimal", "Allow 0123456789.+-*/", "False"},
+ {mvPythonDataType::Bool, "hexadecimal", "Allow 0123456789ABCDEFabcdef", "False"},
+ {mvPythonDataType::Bool, "readonly", "", "False"},
+ {mvPythonDataType::Bool, "password", "Password mode, display all characters as '*'", "False"},
+ {mvPythonDataType::Bool, "scientific", "Allow 0123456789.+-*/eE (Scientific notation input)", "False"},
+ {mvPythonDataType::Callable, "callback", "Registers a callback", "None"},
+ {mvPythonDataType::Object, "callback_data", "Callback data", "None"},
+ {mvPythonDataType::String, "parent", "Parent to add this item to. (runtime adding)", "''"},
+ {mvPythonDataType::String, "before", "This item will be displayed before the specified item in the parent. (runtime adding)", "''"},
+ {mvPythonDataType::String, "source", "", "''"},
+ {mvPythonDataType::Bool, "enabled", "Display grayed out text so selectable cannot be selected", "True"},
+ {mvPythonDataType::Integer, "width","", "0"},
+ {mvPythonDataType::Integer, "height","", "0"},
+ {mvPythonDataType::Bool, "on_enter", "Only runs callback on enter", "False"},
+ {mvPythonDataType::String, "label", "", "''"},
+ {mvPythonDataType::Bool, "show", "Attempt to render", "True"},
+ }, "Adds input for text values.", "None", "Adding Widgets") });
+ }
+
+ mvInputText::mvInputText(const std::string& name)
+ :
+ mvStringPtrBase(name)
+ {
+ }
+
+ void mvInputText::setEnabled(bool value)
+ {
+ if (value)
+ m_flags = m_stor_flags;
+
+ else
+ {
+ m_stor_flags = m_flags;
+ m_flags |= ImGuiInputTextFlags_ReadOnly;
+ m_flags &= ~ImGuiInputTextFlags_EnterReturnsTrue;
+ }
+
+ m_enabled = value;
+ }
+
+ void mvInputText::draw(ImDrawList* drawlist, float x, float y)
+ {
+ ScopedID id;
+ mvImGuiThemeScope scope(this);
+ mvFontScope fscope(this);
+
+ if (m_multiline)
+ m_hint = "";
+
+ if (m_hint.empty())
+ {
+ if (m_multiline)
+ {
+ if (ImGui::InputTextMultiline(m_label.c_str(), m_value.get(), ImVec2((float)m_width, (float)m_height), m_flags))
+ mvApp::GetApp()->getCallbackRegistry().addCallback(m_callback, m_name, m_callback_data);
+ }
+ else
+ {
+ if (ImGui::InputText(m_label.c_str(), m_value.get(), m_flags))
+ mvApp::GetApp()->getCallbackRegistry().addCallback(m_callback, m_name, m_callback_data);
+ }
+ }
+
+ else
+ {
+ if (ImGui::InputTextWithHint(m_label.c_str(), m_hint.c_str(), m_value.get(), m_flags))
+ mvApp::GetApp()->getCallbackRegistry().addCallback(m_callback, m_name, m_callback_data);
+ }
+
+ }
+
+ void mvInputText::setExtraConfigDict(PyObject* dict)
+ {
+ if (dict == nullptr)
+ return;
+
+ if (PyObject* item = PyDict_GetItemString(dict, "hint")) m_hint = ToString(item);
+ if (PyObject* item = PyDict_GetItemString(dict, "multiline")) m_multiline = ToBool(item);
+
+ // helper for bit flipping
+ auto flagop = [dict](const char* keyword, int flag, int& flags)
+ {
+ if (PyObject* item = PyDict_GetItemString(dict, keyword)) ToBool(item) ? flags |= flag : flags &= ~flag;
+ };
+
+ // flags
+ flagop("no_spaces", ImGuiInputTextFlags_CharsNoBlank, m_flags);
+ flagop("uppercase", ImGuiInputTextFlags_CharsUppercase, m_flags);
+ flagop("decimal", ImGuiInputTextFlags_CharsDecimal, m_flags);
+ flagop("hexadecimal", ImGuiInputTextFlags_CharsHexadecimal, m_flags);
+ flagop("readonly", ImGuiInputTextFlags_ReadOnly, m_flags);
+ flagop("password", ImGuiInputTextFlags_Password, m_flags);
+ flagop("on_enter", ImGuiInputTextFlags_EnterReturnsTrue, m_flags);
+ flagop("scientific", ImGuiInputTextFlags_CharsScientific, m_flags);
+ flagop("tab_input", ImGuiInputTextFlags_AllowTabInput, m_flags);
+ }
+
+ void mvInputText::getExtraConfigDict(PyObject* dict)
+ {
+ if (dict == nullptr)
+ return;
+
+ PyDict_SetItemString(dict, "hint", ToPyString(m_hint));
+ PyDict_SetItemString(dict, "multline", ToPyBool(m_multiline));
+
+ // helper to check and set bit
+ auto checkbitset = [dict](const char* keyword, int flag, const int& flags)
+ {
+ PyDict_SetItemString(dict, keyword, ToPyBool(flags & flag));
+ };
+
+ // window flags
+ checkbitset("no_spaces", ImGuiInputTextFlags_CharsNoBlank, m_flags);
+ checkbitset("uppercase", ImGuiInputTextFlags_CharsUppercase, m_flags);
+ checkbitset("decimal", ImGuiInputTextFlags_CharsDecimal, m_flags);
+ checkbitset("hexadecimal", ImGuiInputTextFlags_CharsHexadecimal, m_flags);
+ checkbitset("readonly", ImGuiInputTextFlags_ReadOnly, m_flags);
+ checkbitset("password", ImGuiInputTextFlags_Password, m_flags);
+ checkbitset("on_enter", ImGuiInputTextFlags_EnterReturnsTrue, m_flags);
+ checkbitset("scientific", ImGuiInputTextFlags_CharsScientific, m_flags);
+ checkbitset("tab_input", ImGuiInputTextFlags_AllowTabInput, m_flags);
+ }
+
+}
\ No newline at end of file
diff --git a/DearPyGui/src/core/AppItems/basic/mvInputText.h b/DearPyGui/src/core/AppItems/basic/mvInputText.h
new file mode 100644
index 000000000..6266dc2ec
--- /dev/null
+++ b/DearPyGui/src/core/AppItems/basic/mvInputText.h
@@ -0,0 +1,75 @@
+#pragma once
+
+#include "mvApp.h"
+#include "mvTypeBases.h"
+
+namespace Marvel {
+
+ MV_REGISTER_WIDGET(mvInputText, MV_ITEM_DESC_DEFAULT, StorageValueTypes::String, 1);
+ class mvInputText : public mvStringPtrBase
+ {
+
+ public:
+
+ static void InsertParser(std::map* parsers);
+
+ MV_APPLY_WIDGET_REGISTRATION(mvAppItemType::mvInputText, add_input_text)
+
+ MV_CREATE_CONSTANT(mvThemeCol_InputText_Text, ImGuiCol_Text, 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_InputText_TextHighlight, ImGuiCol_TextSelectedBg, 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_InputText_Bg, ImGuiCol_FrameBg, 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_InputText_Hint, ImGuiCol_TextDisabled, 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_InputText_Border, ImGuiCol_Border, 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_InputText_BorderShadow, ImGuiCol_BorderShadow, 0L);
+
+ MV_CREATE_CONSTANT(mvThemeStyle_InputText_Rounding, ImGuiStyleVar_FrameRounding, 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_InputText_BorderSize, ImGuiStyleVar_FrameBorderSize, 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_InputText_PaddingX, ImGuiStyleVar_FramePadding, 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_InputText_PaddingY, ImGuiStyleVar_FramePadding, 1L);
+ MV_CREATE_CONSTANT(mvThemeStyle_InputText_InnerSpacingX, ImGuiStyleVar_ItemInnerSpacing, 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_InputText_InnerSpacingY, ImGuiStyleVar_ItemInnerSpacing, 1L);
+
+ MV_START_EXTRA_COMMANDS
+ MV_END_EXTRA_COMMANDS
+
+ MV_START_GENERAL_CONSTANTS
+ MV_END_GENERAL_CONSTANTS
+
+ MV_START_COLOR_CONSTANTS
+ MV_ADD_CONSTANT(mvThemeCol_InputText_Text, mvColor(255, 255, 255, 255), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_InputText_TextHighlight, mvColor( 66, 150, 250, 89), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_InputText_Bg, mvColor( 41, 74, 122, 138), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_InputText_Hint, mvColor(128, 128, 128, 255), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_InputText_Border, mvColor(110, 110, 128, 128), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_InputText_BorderShadow, mvColor( 0, 0, 0, 0), mvColor(128, 128, 128, 63)),
+ MV_END_COLOR_CONSTANTS
+
+ MV_START_STYLE_CONSTANTS
+ MV_ADD_CONSTANT(mvThemeStyle_InputText_Rounding , 0, 12),
+ MV_ADD_CONSTANT(mvThemeStyle_InputText_BorderSize , 0, 1),
+ MV_ADD_CONSTANT(mvThemeStyle_InputText_PaddingX , 4, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_InputText_PaddingY , 3, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_InputText_InnerSpacingX , 4, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_InputText_InnerSpacingY , 4, 20),
+ MV_END_STYLE_CONSTANTS
+
+ public:
+
+ mvInputText(const std::string& name);
+
+ void setEnabled (bool value) override;
+ void draw(ImDrawList* drawlist, float x, float y) override;
+
+ void setExtraConfigDict(PyObject* dict) override;
+ void getExtraConfigDict(PyObject* dict) override;
+
+ private:
+
+ std::string m_hint;
+ bool m_multiline = false;
+ ImGuiInputTextFlags m_flags = 0;
+ ImGuiInputTextFlags m_stor_flags = 0;
+
+ };
+
+}
\ No newline at end of file
diff --git a/DearPyGui/src/core/AppItems/basic/mvListbox.cpp b/DearPyGui/src/core/AppItems/basic/mvListbox.cpp
new file mode 100644
index 000000000..cc4da3cc0
--- /dev/null
+++ b/DearPyGui/src/core/AppItems/basic/mvListbox.cpp
@@ -0,0 +1,72 @@
+#include
+#include "mvListbox.h"
+#include "mvApp.h"
+#include "mvItemRegistry.h"
+#include "mvImGuiThemeScope.h"
+#include "mvFontScope.h"
+
+namespace Marvel {
+
+ void mvListbox::InsertParser(std::map* parsers)
+ {
+ parsers->insert({ s_command, mvPythonParser({
+ {mvPythonDataType::Optional},
+ {mvPythonDataType::String, "name", "Name of the listbox"},
+ {mvPythonDataType::KeywordOnly},
+ {mvPythonDataType::StringList, "items", "", "()"},
+ {mvPythonDataType::Integer, "default_value", "", "0"},
+ {mvPythonDataType::Callable, "callback", "Registers a callback", "None"},
+ {mvPythonDataType::Object, "callback_data", "Callback data", "None"},
+ {mvPythonDataType::String, "parent", "Parent this item will be added to. (runtime adding)", "''"},
+ {mvPythonDataType::String, "before", "This item will be displayed before the specified item in the parent. (runtime adding)", "''"},
+ {mvPythonDataType::String, "source", "", "''"},
+ {mvPythonDataType::Bool, "enabled", "Display grayed out text so selectable cannot be selected", "True"},
+ {mvPythonDataType::Integer, "width","", "0"},
+ {mvPythonDataType::Integer, "num_items", "number of items to show", "3"},
+ {mvPythonDataType::String, "label","", "''"},
+ {mvPythonDataType::Bool, "show", "Attempt to render", "True"},
+ }, "Adds a listbox.", "None", "Adding Widgets") });
+ }
+
+ mvListbox::mvListbox(const std::string& name)
+ : mvIntPtrBase(name)
+ {
+ }
+
+ void mvListbox::draw(ImDrawList* drawlist, float x, float y)
+ {
+ ScopedID id;
+ mvImGuiThemeScope scope(this);
+ mvFontScope fscope(this);
+
+ if (!m_enabled) m_disabled_value = *m_value;
+
+ if (ImGui::ListBox(m_label.c_str(), m_enabled ? m_value.get() : &m_disabled_value, m_charNames.data(), (int)m_names.size(), m_itemsHeight))
+ mvApp::GetApp()->getCallbackRegistry().addCallback(getCallback(false), m_name, m_callback_data);
+ }
+
+ void mvListbox::setExtraConfigDict(PyObject* dict)
+ {
+ if (dict == nullptr)
+ return;
+
+ if (PyObject* item = PyDict_GetItemString(dict, "num_items")) m_itemsHeight = ToInt(item);
+ if (PyObject* item = PyDict_GetItemString(dict, "items"))
+ {
+ m_names = ToStringVect(item);
+ m_charNames.clear();
+ for (const std::string& item : m_names)
+ m_charNames.emplace_back(item.c_str());
+ }
+ }
+
+ void mvListbox::getExtraConfigDict(PyObject* dict)
+ {
+ if (dict == nullptr)
+ return;
+
+ PyDict_SetItemString(dict, "items", ToPyList(m_names));
+ PyDict_SetItemString(dict, "num_items", ToPyInt(m_itemsHeight));
+ }
+
+}
\ No newline at end of file
diff --git a/DearPyGui/src/core/AppItems/basic/mvListbox.h b/DearPyGui/src/core/AppItems/basic/mvListbox.h
new file mode 100644
index 000000000..e1f606ac0
--- /dev/null
+++ b/DearPyGui/src/core/AppItems/basic/mvListbox.h
@@ -0,0 +1,88 @@
+#pragma once
+
+#include "mvTypeBases.h"
+
+namespace Marvel {
+
+ MV_REGISTER_WIDGET(mvListbox, MV_ITEM_DESC_DEFAULT, StorageValueTypes::Int, 1);
+ class mvListbox : public mvIntPtrBase
+ {
+
+ public:
+
+ static void InsertParser(std::map* parsers);
+
+ MV_APPLY_WIDGET_REGISTRATION(mvAppItemType::mvListbox, add_listbox)
+
+ MV_CREATE_CONSTANT(mvThemeCol_Listbox_Text , ImGuiCol_Text , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_Listbox_Selected , ImGuiCol_Header , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_Listbox_Hovered , ImGuiCol_HeaderHovered , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_Listbox_Active , ImGuiCol_HeaderActive , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_Listbox_Bg , ImGuiCol_FrameBg , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_Listbox_Border , ImGuiCol_Border , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_Listbox_Scrollbar , ImGuiCol_ScrollbarBg , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_Listbox_ScrollbarGrab , ImGuiCol_ScrollbarGrab , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_Listbox_ScrollbarGrabHovered, ImGuiCol_ScrollbarGrabHovered , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_Listbox_ScrollbarGrabActive , ImGuiCol_ScrollbarGrabActive , 0L);
+
+ MV_CREATE_CONSTANT(mvThemeStyle_Listbox_BorderSize , ImGuiStyleVar_FrameBorderSize , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_Listbox_Rounding , ImGuiStyleVar_FrameRounding , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_Listbox_PaddingX , ImGuiStyleVar_FramePadding , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_Listbox_PaddingY , ImGuiStyleVar_FramePadding , 1L);
+ MV_CREATE_CONSTANT(mvThemeStyle_Listbox_ItemSpacingX , ImGuiStyleVar_ItemSpacing , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_Listbox_ItemSpacingY , ImGuiStyleVar_ItemSpacing , 1L);
+ MV_CREATE_CONSTANT(mvThemeStyle_Listbox_ScrollbarSize , ImGuiStyleVar_ScrollbarSize , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_Listbox_ScrollbarRounding , ImGuiStyleVar_ScrollbarRounding , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_Listbox_TextAlignX , ImGuiStyleVar_SelectableTextAlign , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_Listbox_TextAlignY , ImGuiStyleVar_SelectableTextAlign , 1L);
+
+ MV_START_EXTRA_COMMANDS
+ MV_END_EXTRA_COMMANDS
+
+ MV_START_GENERAL_CONSTANTS
+ MV_END_GENERAL_CONSTANTS
+
+ MV_START_COLOR_CONSTANTS
+ MV_ADD_CONSTANT(mvThemeCol_Listbox_Text, mvColor(255, 255, 255, 255), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_Listbox_Selected, mvColor( 60, 150, 250, 79), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_Listbox_Hovered, mvColor( 66, 150, 250, 102), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_Listbox_Active, mvColor( 66, 150, 250, 171), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_Listbox_Bg, mvColor( 41, 74, 122, 138), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_Listbox_Border, mvColor(110, 110, 128, 128), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_Listbox_Scrollbar, mvColor( 5, 5, 5, 135), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_Listbox_ScrollbarGrab, mvColor( 79, 79, 79, 255), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_Listbox_ScrollbarGrabHovered, mvColor(105, 105, 105, 255), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_Listbox_ScrollbarGrabActive, mvColor(130, 130, 130, 255), mvColor(128, 128, 128, 63)),
+ MV_END_COLOR_CONSTANTS
+
+ MV_START_STYLE_CONSTANTS
+ MV_ADD_CONSTANT(mvThemeStyle_Listbox_BorderSize , 0, 1),
+ MV_ADD_CONSTANT(mvThemeStyle_Listbox_Rounding , 0, 12),
+ MV_ADD_CONSTANT(mvThemeStyle_Listbox_PaddingX , 4, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_Listbox_PaddingY , 3, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_Listbox_ItemSpacingX , 8, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_Listbox_ItemSpacingY , 4, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_Listbox_ScrollbarSize ,14, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_Listbox_ScrollbarRounding , 9, 12),
+ MV_ADD_CONSTANT(mvThemeStyle_Listbox_TextAlignX , 0, 1),
+ MV_ADD_CONSTANT(mvThemeStyle_Listbox_TextAlignY , 0, 1),
+ MV_END_STYLE_CONSTANTS
+
+ public:
+
+ mvListbox(const std::string& name);
+
+ void draw(ImDrawList* drawlist, float x, float y) override;
+
+ void setExtraConfigDict(PyObject* dict) override;
+ void getExtraConfigDict(PyObject* dict) override;
+
+ private:
+
+ std::vector m_names;
+ int m_itemsHeight = 3; // number of items to show (default -1)
+ std::vector m_charNames;
+
+ };
+
+}
diff --git a/DearPyGui/src/core/AppItems/basic/mvMenuItem.cpp b/DearPyGui/src/core/AppItems/basic/mvMenuItem.cpp
new file mode 100644
index 000000000..e5fef9548
--- /dev/null
+++ b/DearPyGui/src/core/AppItems/basic/mvMenuItem.cpp
@@ -0,0 +1,74 @@
+#include "mvMenuItem.h"
+#include "mvApp.h"
+#include "mvItemRegistry.h"
+#include "mvImGuiThemeScope.h"
+#include "mvFontScope.h"
+
+namespace Marvel {
+
+ void mvMenuItem::InsertParser(std::map* parsers)
+ {
+ parsers->insert({ s_command, mvPythonParser({
+ {mvPythonDataType::Optional},
+ {mvPythonDataType::String, "name"},
+ {mvPythonDataType::KeywordOnly},
+ {mvPythonDataType::Integer, "default_value", "", "False"},
+ {mvPythonDataType::String, "shortcut", "Adds a shortcut", "''"},
+ {mvPythonDataType::Bool, "check", "Makes menu item with checkmark. Only one menu item per container can be checked at a time.", "False"},
+ {mvPythonDataType::Callable, "callback", "Registers a callback", "None"},
+ {mvPythonDataType::Object, "callback_data", "Callback data", "None"},
+ {mvPythonDataType::String, "source", "Overrides 'name' as value storage key", "''"},
+ {mvPythonDataType::String, "label", "", "''"},
+ {mvPythonDataType::Bool, "show", "Attempt to render", "True"},
+ {mvPythonDataType::Bool, "enabled", "", "True"},
+ {mvPythonDataType::String, "parent", "Parent this item will be added to. (runtime adding)", "''"},
+ {mvPythonDataType::String, "before", "This item will be displayed before the specified item in the parent. (runtime adding)", "''"},
+ }, "Adds a menu item to an existing menu.", "None", "Containers") });
+ }
+
+ mvMenuItem::mvMenuItem(const std::string& name)
+ : mvBoolPtrBase(name)
+ {
+ }
+
+ void mvMenuItem::draw(ImDrawList* drawlist, float x, float y)
+ {
+ ScopedID id;
+ mvImGuiThemeScope scope(this);
+ mvFontScope fscope(this);
+
+ // This is ugly and goes against our style system but its the only widget that ImGui chooses to push teh disable color for us
+ // so we have to map our text disable color to the system text disable color, or we can create a new constant which goes agains our
+ // constants.
+ ImGui::PushStyleColor(ImGuiCol_TextDisabled, ImGui::GetStyleColorVec4(ImGuiCol_Text));
+
+ // create menu item and see if its selected
+ if (ImGui::MenuItem(m_label.c_str(), m_shortcut.c_str(), m_check ? m_value.get() : nullptr, m_enabled))
+ {
+ mvApp::GetApp()->getCallbackRegistry().addCallback(m_callback, m_name, m_callback_data);
+ }
+
+ ImGui::PopStyleColor();
+
+ }
+
+ void mvMenuItem::setExtraConfigDict(PyObject* dict)
+ {
+ if (dict == nullptr)
+ return;
+
+ if (PyObject* item = PyDict_GetItemString(dict, "shortcut")) m_shortcut = ToString(item);
+ if (PyObject* item = PyDict_GetItemString(dict, "check")) m_check = ToBool(item);
+
+}
+
+ void mvMenuItem::getExtraConfigDict(PyObject* dict)
+ {
+ if (dict == nullptr)
+ return;
+
+ PyDict_SetItemString(dict, "shortcut", ToPyString(m_shortcut));
+ PyDict_SetItemString(dict, "check", ToPyBool(m_check));
+ }
+
+}
diff --git a/DearPyGui/src/core/AppItems/basic/mvMenuItem.h b/DearPyGui/src/core/AppItems/basic/mvMenuItem.h
new file mode 100644
index 000000000..575039e82
--- /dev/null
+++ b/DearPyGui/src/core/AppItems/basic/mvMenuItem.h
@@ -0,0 +1,58 @@
+#pragma once
+
+#include "mvTypeBases.h"
+#include "mvApp.h"
+
+namespace Marvel {
+
+ MV_REGISTER_WIDGET(mvMenuItem, MV_ITEM_DESC_DEFAULT, StorageValueTypes::Bool, 1);
+ class mvMenuItem : public mvBoolPtrBase
+ {
+
+ public:
+
+ static void InsertParser(std::map* parsers);
+
+ MV_APPLY_WIDGET_REGISTRATION(mvAppItemType::mvMenuItem, add_menu_item)
+
+ MV_CREATE_CONSTANT(mvThemeCol_MenuItem_Text , ImGuiCol_Text , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_MenuItem_BgHovered , ImGuiCol_HeaderHovered, 0L);
+
+ MV_CREATE_CONSTANT(ImGuiStyleVar_MenuItem_TextAlignX , ImGuiStyleVar_SelectableTextAlign, 0L);
+ MV_CREATE_CONSTANT(ImGuiStyleVar_MenuItem_TextAlignY , ImGuiStyleVar_SelectableTextAlign, 1L);
+
+ MV_START_EXTRA_COMMANDS
+ MV_END_EXTRA_COMMANDS
+
+ MV_START_GENERAL_CONSTANTS
+ MV_END_GENERAL_CONSTANTS
+
+ MV_START_COLOR_CONSTANTS
+ MV_ADD_CONSTANT(mvThemeCol_MenuItem_Text, mvColor(255, 255, 255, 255), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_MenuItem_BgHovered, mvColor( 66, 150, 250, 240), mvColor(128, 128, 128, 0)),
+ MV_END_COLOR_CONSTANTS
+
+ MV_START_STYLE_CONSTANTS
+ MV_ADD_CONSTANT(ImGuiStyleVar_MenuItem_TextAlignX, 0, 1),
+ MV_ADD_CONSTANT(ImGuiStyleVar_MenuItem_TextAlignY, 0, 1),
+ MV_END_STYLE_CONSTANTS
+
+ public:
+
+ explicit mvMenuItem(const std::string& name);
+
+ void draw(ImDrawList* drawlist, float x, float y) override;
+
+ void setExtraConfigDict(PyObject* dict) override;
+ void getExtraConfigDict(PyObject* dict) override;
+
+ private:
+
+ std::string m_shortcut;
+ bool m_default_value = false;
+ bool m_check = false;
+ std::string m_source = "";
+
+ };
+
+}
\ No newline at end of file
diff --git a/DearPyGui/src/core/AppItems/basic/mvRadioButton.cpp b/DearPyGui/src/core/AppItems/basic/mvRadioButton.cpp
new file mode 100644
index 000000000..5c4a1cf58
--- /dev/null
+++ b/DearPyGui/src/core/AppItems/basic/mvRadioButton.cpp
@@ -0,0 +1,74 @@
+#include
+#include "mvRadioButton.h"
+#include "mvApp.h"
+#include "mvItemRegistry.h"
+#include "mvImGuiThemeScope.h"
+#include "mvFontScope.h"
+
+namespace Marvel {
+ void mvRadioButton::InsertParser(std::map* parsers)
+ {
+ parsers->insert({ s_command, mvPythonParser({
+ {mvPythonDataType::Optional},
+ {mvPythonDataType::String, "name"},
+ {mvPythonDataType::KeywordOnly},
+ {mvPythonDataType::StringList, "items", "", "()"},
+ {mvPythonDataType::Integer, "default_value", "", "0"},
+ {mvPythonDataType::Callable, "callback", "Registers a callback", "None"},
+ {mvPythonDataType::Object, "callback_data", "Callback data", "None"},
+ {mvPythonDataType::String, "parent", "Parent to add this item to. (runtime adding)", "''"},
+ {mvPythonDataType::String, "before", "This item will be displayed before the specified item in the parent. (runtime adding)", "''"},
+ {mvPythonDataType::String, "source", "", "''"},
+ {mvPythonDataType::Bool, "enabled", "Display grayed out text so selectable cannot be selected", "True"},
+ {mvPythonDataType::Bool, "horizontal", "", "False"},
+ {mvPythonDataType::Bool, "show", "Attempt to render", "True"},
+ }, "Adds a set of radio buttons. If items is empty, nothing will be shown.", "None", "Adding Widgets") });
+ }
+
+ mvRadioButton::mvRadioButton(const std::string& name)
+ : mvIntPtrBase(name)
+ {
+ }
+
+ void mvRadioButton::draw(ImDrawList* drawlist, float x, float y)
+ {
+
+ ImGui::BeginGroup();
+
+ ScopedID id;
+ mvImGuiThemeScope scope(this);
+ mvFontScope fscope(this);
+
+ if (!m_enabled) m_disabled_value = *m_value;
+
+ for (size_t i = 0; i < m_itemnames.size(); i++)
+ {
+ if (m_horizontal && i != 0)
+ ImGui::SameLine();
+
+ if (ImGui::RadioButton((m_itemnames[i] + "##" + m_name).c_str(), m_enabled ? m_value.get() : &m_disabled_value, (int)i))
+ mvApp::GetApp()->getCallbackRegistry().addCallback(getCallback(false), m_name, m_callback_data);
+ }
+
+ ImGui::EndGroup();
+ }
+
+ void mvRadioButton::setExtraConfigDict(PyObject* dict)
+ {
+ if (dict == nullptr)
+ return;
+
+ if (PyObject* item = PyDict_GetItemString(dict, "items")) m_itemnames = ToStringVect(item);
+ if (PyObject* item = PyDict_GetItemString(dict, "horizontal")) m_horizontal = ToBool(item);
+ }
+
+ void mvRadioButton::getExtraConfigDict(PyObject* dict)
+ {
+ if (dict == nullptr)
+ return;
+
+ PyDict_SetItemString(dict, "items", ToPyList(m_itemnames));
+ PyDict_SetItemString(dict, "horizontal", ToPyBool(m_horizontal));
+ }
+
+}
\ No newline at end of file
diff --git a/DearPyGui/src/core/AppItems/basic/mvRadioButton.h b/DearPyGui/src/core/AppItems/basic/mvRadioButton.h
new file mode 100644
index 000000000..87600e56d
--- /dev/null
+++ b/DearPyGui/src/core/AppItems/basic/mvRadioButton.h
@@ -0,0 +1,68 @@
+#pragma once
+
+#include "mvTypeBases.h"
+
+namespace Marvel {
+
+ MV_REGISTER_WIDGET(mvRadioButton, MV_ITEM_DESC_DEFAULT, StorageValueTypes::Int, 1);
+ class mvRadioButton : public mvIntPtrBase
+ {
+
+ public:
+
+ static void InsertParser(std::map* parsers);
+
+ MV_APPLY_WIDGET_REGISTRATION(mvAppItemType::mvRadioButton, add_radio_button)
+
+ MV_CREATE_CONSTANT(mvThemeCol_RadioButton_Text , ImGuiCol_Text , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_RadioButton_Bg , ImGuiCol_FrameBg , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_RadioButton_BgHovered , ImGuiCol_FrameBgHovered , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_RadioButton_BgActive , ImGuiCol_CheckMark , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_RadioButton_Border , ImGuiCol_Border , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_RadioButton_BorderShadow , ImGuiCol_BorderShadow , 0L);
+
+ MV_CREATE_CONSTANT(mvThemeStyle_RadioButton_BorderSize , ImGuiStyleVar_FrameBorderSize , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_RadioButton_PaddingX , ImGuiStyleVar_FramePadding , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_RadioButton_PaddingY , ImGuiStyleVar_FramePadding , 1L);
+ MV_CREATE_CONSTANT(mvThemeStyle_RadioButton_InnerSpacingX , ImGuiStyleVar_ItemInnerSpacing, 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_RadioButton_InnerSpacingY , ImGuiStyleVar_ItemInnerSpacing, 1L);
+
+ MV_START_EXTRA_COMMANDS
+ MV_END_EXTRA_COMMANDS
+
+ MV_START_GENERAL_CONSTANTS
+ MV_END_GENERAL_CONSTANTS
+
+ MV_START_COLOR_CONSTANTS
+ MV_ADD_CONSTANT(mvThemeCol_RadioButton_Text, mvColor(255, 255, 255, 255), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_RadioButton_Bg, mvColor( 41, 74, 122, 138), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_RadioButton_BgHovered, mvColor( 66, 150, 250, 102), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_RadioButton_BgActive, mvColor( 66, 150, 250, 171), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_RadioButton_Border, mvColor(110, 110, 128, 128), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_RadioButton_BorderShadow, mvColor( 0, 0, 0, 0), mvColor(128, 128, 128, 63)),
+ MV_END_COLOR_CONSTANTS
+
+ MV_START_STYLE_CONSTANTS
+ MV_ADD_CONSTANT(mvThemeStyle_RadioButton_BorderSize, 0, 1),
+ MV_ADD_CONSTANT(mvThemeStyle_RadioButton_PaddingX, 4, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_RadioButton_PaddingY, 3, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_RadioButton_InnerSpacingX, 4, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_RadioButton_InnerSpacingY, 4, 20),
+ MV_END_STYLE_CONSTANTS
+
+ public:
+
+ mvRadioButton(const std::string& name);
+
+ void draw(ImDrawList* drawlist, float x, float y) override;
+
+ void setExtraConfigDict(PyObject* dict) override;
+ void getExtraConfigDict(PyObject* dict) override;
+
+ private:
+
+ std::vector m_itemnames;
+ bool m_horizontal = false;
+ };
+
+}
diff --git a/DearPyGui/src/core/AppItems/basic/mvSelectable.cpp b/DearPyGui/src/core/AppItems/basic/mvSelectable.cpp
new file mode 100644
index 000000000..5736b6073
--- /dev/null
+++ b/DearPyGui/src/core/AppItems/basic/mvSelectable.cpp
@@ -0,0 +1,95 @@
+#include
+#include "mvSelectable.h"
+#include "mvApp.h"
+#include "mvItemRegistry.h"
+#include "mvImGuiThemeScope.h"
+#include "mvFontScope.h"
+
+namespace Marvel {
+
+ void mvSelectable::InsertParser(std::map* parsers)
+ {
+ parsers->insert({ s_command, mvPythonParser({
+ {mvPythonDataType::Optional},
+ {mvPythonDataType::String, "name"},
+ {mvPythonDataType::KeywordOnly},
+ {mvPythonDataType::Bool, "default_value", "", "False"},
+ {mvPythonDataType::Callable, "callback", "Registers a callback", "None"},
+ {mvPythonDataType::Object, "callback_data", "Callback data", "None"},
+ {mvPythonDataType::Integer, "width","", "0"},
+ {mvPythonDataType::Integer, "height", "", "0"},
+ {mvPythonDataType::String, "parent", "Parent this item will be added to. (runtime adding)", "''"},
+ {mvPythonDataType::String, "before", "This item will be displayed before the specified item in the parent. (runtime adding)", "''"},
+ {mvPythonDataType::String, "source", "", "''"},
+ {mvPythonDataType::Bool, "enabled", "Display grayed out text so selectable cannot be selected", "True"},
+ {mvPythonDataType::String, "label", "", "''"},
+ {mvPythonDataType::Bool, "show", "Attempt to render", "True"},
+ {mvPythonDataType::Bool, "span_columns", "span all columns", "False"},
+ }, "Adds a selectable.", "None", "Adding Widgets") });
+ }
+
+ mvSelectable::mvSelectable(const std::string& name)
+ : mvBoolPtrBase(name)
+ {
+ }
+
+ void mvSelectable::setEnabled(bool value)
+ {
+ if (value == m_enabled)
+ return;
+
+ if (value)
+ m_flags &= ~ImGuiSelectableFlags_Disabled;
+
+ else
+ m_flags |= ImGuiSelectableFlags_Disabled;
+
+ m_enabled = value;
+ }
+
+ void mvSelectable::draw(ImDrawList* drawlist, float x, float y)
+ {
+
+ ScopedID id;
+ mvImGuiThemeScope scope(this);
+ mvFontScope fscope(this);
+
+ if (ImGui::Selectable(m_label.c_str(), m_value.get(), m_flags, ImVec2((float)m_width, (float)m_height)))
+ mvApp::GetApp()->getCallbackRegistry().addCallback(m_callback, m_name, m_callback_data);
+
+ }
+
+ void mvSelectable::setExtraConfigDict(PyObject* dict)
+ {
+ if (dict == nullptr)
+ return;
+
+
+ // helper for bit flipping
+ auto flagop = [dict](const char* keyword, int flag, int& flags, bool flip)
+ {
+ if (PyObject* item = PyDict_GetItemString(dict, keyword)) ToBool(item) ? flags |= flag : flags &= ~flag;
+ };
+
+ // window flags
+ flagop("span_columns", ImGuiSelectableFlags_SpanAllColumns, m_flags, false);
+
+ }
+
+ void mvSelectable::getExtraConfigDict(PyObject* dict)
+ {
+ if (dict == nullptr)
+ return;
+
+
+ // helper to check and set bit
+ auto checkbitset = [dict](const char* keyword, int flag, const int& flags, bool flip)
+ {
+ PyDict_SetItemString(dict, keyword, ToPyBool(flags & flag));
+ };
+
+ // window flags
+ checkbitset("span_columns", ImGuiSelectableFlags_SpanAllColumns, m_flags, false);
+ }
+
+}
\ No newline at end of file
diff --git a/DearPyGui/src/core/AppItems/basic/mvSelectable.h b/DearPyGui/src/core/AppItems/basic/mvSelectable.h
new file mode 100644
index 000000000..88100d519
--- /dev/null
+++ b/DearPyGui/src/core/AppItems/basic/mvSelectable.h
@@ -0,0 +1,62 @@
+#pragma once
+
+#include "mvTypeBases.h"
+
+namespace Marvel {
+
+ MV_REGISTER_WIDGET(mvSelectable, MV_ITEM_DESC_DEFAULT, StorageValueTypes::Bool, 1);
+ class mvSelectable : public mvBoolPtrBase
+ {
+
+ public:
+
+ static void InsertParser(std::map* parsers);
+
+ MV_APPLY_WIDGET_REGISTRATION(mvAppItemType::mvSelectable, add_selectable)
+
+ MV_CREATE_CONSTANT(mvThemeCol_Selectable_Text , ImGuiCol_Text , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_Selectable_Bg , ImGuiCol_Header , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_Selectable_BgHovered , ImGuiCol_HeaderHovered, 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_Selectable_BgActive , ImGuiCol_HeaderActive , 0L);
+
+ MV_CREATE_CONSTANT(mvThemeStyle_Selectable_TextAlignX , ImGuiStyleVar_SelectableTextAlign , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_Selectable_TextAlignY , ImGuiStyleVar_SelectableTextAlign , 1L);
+ MV_CREATE_CONSTANT(mvThemeStyle_Selectable_ItemSpacingX , ImGuiStyleVar_ItemSpacing , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_Selectable_ItemSpacingY , ImGuiStyleVar_ItemSpacing , 1L);
+
+ MV_START_EXTRA_COMMANDS
+ MV_END_EXTRA_COMMANDS
+
+ MV_START_GENERAL_CONSTANTS
+ MV_END_GENERAL_CONSTANTS
+
+ MV_START_COLOR_CONSTANTS
+ MV_ADD_CONSTANT(mvThemeCol_Selectable_Text, mvColor(255, 255, 255, 255), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_Selectable_Bg, mvColor( 41, 74, 122, 138), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_Selectable_BgHovered, mvColor( 66, 150, 250, 102), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_Selectable_BgActive, mvColor( 66, 150, 250, 171), mvColor(128, 128, 128, 63)),
+ MV_END_COLOR_CONSTANTS
+
+ MV_START_STYLE_CONSTANTS
+ MV_ADD_CONSTANT(mvThemeStyle_Selectable_TextAlignX , 0, 1),
+ MV_ADD_CONSTANT(mvThemeStyle_Selectable_TextAlignY , 0, 1),
+ MV_ADD_CONSTANT(mvThemeStyle_Selectable_ItemSpacingX , 8, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_Selectable_ItemSpacingY , 4, 20),
+ MV_END_STYLE_CONSTANTS
+
+ public:
+
+ mvSelectable(const std::string& name);
+
+ void setEnabled(bool value) override;
+ void draw(ImDrawList* drawlist, float x, float y) override;
+
+ void setExtraConfigDict(PyObject* dict) override;
+ void getExtraConfigDict(PyObject* dict) override;
+
+ private:
+
+ ImGuiSelectableFlags m_flags = ImGuiSelectableFlags_None;
+ };
+
+}
diff --git a/DearPyGui/src/core/AppItems/basic/mvSliderMulti.cpp b/DearPyGui/src/core/AppItems/basic/mvSliderMulti.cpp
new file mode 100644
index 000000000..372e2cfec
--- /dev/null
+++ b/DearPyGui/src/core/AppItems/basic/mvSliderMulti.cpp
@@ -0,0 +1,258 @@
+#include "mvSliderMulti.h"
+#include "mvTypeBases.h"
+#include
+#include "mvAppItem.h"
+#include "mvModule_Core.h"
+#include "mvApp.h"
+#include
+#include "mvItemRegistry.h"
+#include "mvImGuiThemeScope.h"
+#include "mvFontScope.h"
+
+namespace Marvel {
+
+
+ void mvSliderFloatMulti::InsertParser(std::map* parsers)
+ {
+ parsers->insert({ s_command, mvPythonParser({
+ {mvPythonDataType::Optional},
+ {mvPythonDataType::String, "name"},
+ {mvPythonDataType::KeywordOnly},
+ {mvPythonDataType::FloatList, "default_value", "", "(0.0, 0.0, 0.0, 0.0)"},
+ {mvPythonDataType::Integer, "size", "number of components", "4"},
+ {mvPythonDataType::Float, "min_value", "", "0.0"},
+ {mvPythonDataType::Float, "max_value", "", "100.0"},
+ {mvPythonDataType::String, "format", "", "'%.3f'"},
+ {mvPythonDataType::Callable, "callback", "Registers a callback", "None"},
+ {mvPythonDataType::Object, "callback_data", "Callback data", "None"},
+ {mvPythonDataType::String, "parent", "Parent this item will be added to. (runtime adding)", "''"},
+ {mvPythonDataType::String, "before", "This item will be displayed before the specified item in the parent. (runtime adding)", "''"},
+ {mvPythonDataType::String, "source", "", "''"},
+ {mvPythonDataType::Bool, "enabled", "Display grayed out text so selectable cannot be selected", "True"},
+ {mvPythonDataType::Integer, "width","", "0"},
+ {mvPythonDataType::Bool, "no_input", "Disable CTRL+Click or Enter key allowing to input text directly into the widget", "False"},
+ {mvPythonDataType::Bool, "clamped", "Clamp value to min/max bounds when input manually with CTRL+Click. By default CTRL+Click allows going out of bounds.", "False"},
+ {mvPythonDataType::String, "label", "", "''"},
+ {mvPythonDataType::Bool, "show", "Attempt to render", "True"},
+ }, "Adds slider for a 4 float values. CTRL+Click to directly modify the value.", "None", "Adding Widgets") });
+
+ }
+
+ void mvSliderIntMulti::InsertParser(std::map* parsers)
+ {
+ parsers->insert({ s_command, mvPythonParser({
+ {mvPythonDataType::Optional},
+ {mvPythonDataType::String, "name"},
+ {mvPythonDataType::KeywordOnly},
+ {mvPythonDataType::IntList, "default_value", "", "(0, 0, 0, 0)"},
+ {mvPythonDataType::Integer, "size", "number of components", "4"},
+ {mvPythonDataType::Integer, "min_value", "", "0"},
+ {mvPythonDataType::Integer, "max_value", "", "100"},
+ {mvPythonDataType::String, "format", "", "'%d'"},
+ {mvPythonDataType::Callable, "callback", "Registers a callback", "None"},
+ {mvPythonDataType::Object, "callback_data", "Callback data", "None"},
+ {mvPythonDataType::String, "parent", "Parent this item will be added to. (runtime adding)", "''"},
+ {mvPythonDataType::String, "before", "This item will be displayed before the specified item in the parent. (runtime adding)", "''"},
+ {mvPythonDataType::String, "source", "", "''"},
+ {mvPythonDataType::Bool, "enabled", "Display grayed out text so selectable cannot be selected", "True"},
+ {mvPythonDataType::Integer, "width","", "0"},
+ {mvPythonDataType::Bool, "no_input", "Disable CTRL+Click or Enter key allowing to input text directly into the widget", "False"},
+ {mvPythonDataType::Bool, "clamped", "Clamp value to min/max bounds when input manually with CTRL+Click. By default CTRL+Click allows going out of bounds.", "False"},
+ {mvPythonDataType::String, "label", "", "''"},
+ {mvPythonDataType::Bool, "show", "Attempt to render", "True"},
+ }, "Adds slider for a 4 int values. CTRL+Click to directly modify the value.", "None", "Adding Widgets") });
+
+ }
+
+ mvSliderFloatMulti::mvSliderFloatMulti(const std::string& name)
+ : mvFloat4PtrBase(name)
+ {
+ }
+
+ void mvSliderFloatMulti::setEnabled(bool value)
+ {
+ if (value == m_enabled)
+ return;
+
+ if (value)
+ m_flags = m_stor_flags;
+
+ else
+ {
+ m_stor_flags = m_flags;
+ m_flags |= ImGuiSliderFlags_NoInput;
+ }
+
+ m_enabled = value;
+ }
+
+ void mvSliderFloatMulti::draw(ImDrawList* drawlist, float x, float y)
+ {
+ ScopedID id;
+ mvImGuiThemeScope scope(this);
+ mvFontScope fscope(this);
+
+ if (!m_enabled) std::copy(m_value->data(), m_value->data() + 4, m_disabled_value);
+
+ switch (m_size)
+ {
+ case 2:
+ if (ImGui::SliderFloat2(m_label.c_str(), m_enabled ? m_value->data() : &m_disabled_value[0], m_min, m_max, m_format.c_str(), m_flags))
+ mvApp::GetApp()->getCallbackRegistry().addCallback(getCallback(false), m_name, m_callback_data);
+ break;
+ case 3:
+ if (ImGui::SliderFloat3(m_label.c_str(), m_enabled ? m_value->data() : &m_disabled_value[0], m_min, m_max, m_format.c_str(), m_flags))
+ mvApp::GetApp()->getCallbackRegistry().addCallback(getCallback(false), m_name, m_callback_data);
+ break;
+ case 4:
+ if (ImGui::SliderFloat4(m_label.c_str(), m_enabled ? m_value->data() : &m_disabled_value[0], m_min, m_max, m_format.c_str(), m_flags))
+ mvApp::GetApp()->getCallbackRegistry().addCallback(getCallback(false), m_name, m_callback_data);
+ break;
+ default:
+ break;
+ }
+ }
+
+ mvSliderIntMulti::mvSliderIntMulti(const std::string& name)
+ : mvInt4PtrBase(name)
+ {
+ }
+
+ void mvSliderIntMulti::setEnabled(bool value)
+ {
+ if (value == m_enabled)
+ return;
+
+ if (value)
+ m_flags = m_stor_flags;
+
+ else
+ {
+ m_stor_flags = m_flags;
+ m_flags |= ImGuiSliderFlags_NoInput;
+ }
+
+ m_enabled = value;
+ }
+
+ void mvSliderIntMulti::draw(ImDrawList* drawlist, float x, float y)
+ {
+ ScopedID id;
+ mvImGuiThemeScope scope(this);
+ mvFontScope fscope(this);
+
+ if (!m_enabled) std::copy(m_value->data(), m_value->data() + 4, m_disabled_value);
+
+ switch (m_size)
+ {
+ case 2:
+ if (ImGui::SliderInt2(m_label.c_str(), m_enabled ? m_value->data() : &m_disabled_value[0], m_min, m_max, m_format.c_str(), m_flags))
+ mvApp::GetApp()->getCallbackRegistry().addCallback(getCallback(false), m_name, m_callback_data);
+ break;
+ case 3:
+ if (ImGui::SliderInt3(m_label.c_str(), m_enabled ? m_value->data() : &m_disabled_value[0], m_min, m_max, m_format.c_str(), m_flags))
+ mvApp::GetApp()->getCallbackRegistry().addCallback(getCallback(false), m_name, m_callback_data);
+ break;
+ case 4:
+ if (ImGui::SliderInt4(m_label.c_str(), m_enabled ? m_value->data() : &m_disabled_value[0], m_min, m_max, m_format.c_str(), m_flags))
+ mvApp::GetApp()->getCallbackRegistry().addCallback(getCallback(false), m_name, m_callback_data);
+ break;
+ default:
+ break;
+ }
+
+ }
+
+ void mvSliderFloatMulti::setExtraConfigDict(PyObject* dict)
+ {
+ if (dict == nullptr)
+ return;
+
+ if (PyObject* item = PyDict_GetItemString(dict, "format")) m_format = ToString(item);
+ if (PyObject* item = PyDict_GetItemString(dict, "min_value")) m_min = ToFloat(item);
+ if (PyObject* item = PyDict_GetItemString(dict, "max_value")) m_max = ToFloat(item);
+ if (PyObject* item = PyDict_GetItemString(dict, "size")) m_size = ToInt(item);
+
+ // helper for bit flipping
+ auto flagop = [dict](const char* keyword, int flag, int& flags)
+ {
+ if (PyObject* item = PyDict_GetItemString(dict, keyword)) ToBool(item) ? flags |= flag : flags &= ~flag;
+ };
+
+ // flags
+ flagop("clamped", ImGuiSliderFlags_ClampOnInput, m_flags);
+ flagop("clamped", ImGuiSliderFlags_ClampOnInput, m_stor_flags);
+ flagop("no_input", ImGuiSliderFlags_NoInput, m_flags);
+ flagop("no_input", ImGuiSliderFlags_NoInput, m_stor_flags);
+
+ }
+
+ void mvSliderFloatMulti::getExtraConfigDict(PyObject* dict)
+ {
+ if (dict == nullptr)
+ return;
+
+ PyDict_SetItemString(dict, "format", ToPyString(m_format));
+ PyDict_SetItemString(dict, "min_value", ToPyFloat(m_min));
+ PyDict_SetItemString(dict, "max_value", ToPyFloat(m_max));
+ PyDict_SetItemString(dict, "size", ToPyInt(m_size));
+
+ // helper to check and set bit
+ auto checkbitset = [dict](const char* keyword, int flag, const int& flags)
+ {
+ PyDict_SetItemString(dict, keyword, ToPyBool(flags & flag));
+ };
+
+ // window flags
+ checkbitset("clamped", ImGuiSliderFlags_ClampOnInput, m_flags);
+ checkbitset("no_input", ImGuiSliderFlags_NoInput, m_flags);
+
+ }
+
+ void mvSliderIntMulti::setExtraConfigDict(PyObject* dict)
+ {
+ if (dict == nullptr)
+ return;
+
+ if (PyObject* item = PyDict_GetItemString(dict, "format")) m_format = ToString(item);
+ if (PyObject* item = PyDict_GetItemString(dict, "min_value")) m_min = ToInt(item);
+ if (PyObject* item = PyDict_GetItemString(dict, "max_value")) m_max = ToInt(item);
+ if (PyObject* item = PyDict_GetItemString(dict, "size")) m_size = ToInt(item);
+
+ // helper for bit flipping
+ auto flagop = [dict](const char* keyword, int flag, int& flags)
+ {
+ if (PyObject* item = PyDict_GetItemString(dict, keyword)) ToBool(item) ? flags |= flag : flags &= ~flag;
+ };
+
+ // flags
+ flagop("clamped", ImGuiSliderFlags_ClampOnInput, m_flags);
+ flagop("clamped", ImGuiSliderFlags_ClampOnInput, m_stor_flags);
+ flagop("no_input", ImGuiSliderFlags_NoInput, m_flags);
+ flagop("no_input", ImGuiSliderFlags_NoInput, m_stor_flags);
+
+ }
+
+ void mvSliderIntMulti::getExtraConfigDict(PyObject* dict)
+ {
+ if (dict == nullptr)
+ return;
+
+ PyDict_SetItemString(dict, "format", ToPyString(m_format));
+ PyDict_SetItemString(dict, "min_value", ToPyInt(m_min));
+ PyDict_SetItemString(dict, "max_value", ToPyInt(m_max));
+ PyDict_SetItemString(dict, "size", ToPyInt(m_size));
+
+ // helper to check and set bit
+ auto checkbitset = [dict](const char* keyword, int flag, const int& flags)
+ {
+ PyDict_SetItemString(dict, keyword, ToPyBool(flags & flag));
+ };
+
+ // window flags
+ checkbitset("clamped", ImGuiSliderFlags_ClampOnInput, m_flags);
+ checkbitset("no_input", ImGuiSliderFlags_NoInput, m_flags);
+
+ }
+
+}
diff --git a/DearPyGui/src/core/AppItems/basic/mvSliderMulti.h b/DearPyGui/src/core/AppItems/basic/mvSliderMulti.h
new file mode 100644
index 000000000..e0807e5df
--- /dev/null
+++ b/DearPyGui/src/core/AppItems/basic/mvSliderMulti.h
@@ -0,0 +1,174 @@
+#pragma once
+#include "mvTypeBases.h"
+#include
+#include "mvModule_Core.h"
+
+//-----------------------------------------------------------------------------
+// Widget Index
+//
+// * mvSliderFloatMulti
+// * mvSliderIntMulti
+//
+//-----------------------------------------------------------------------------
+
+namespace Marvel {
+
+ //-----------------------------------------------------------------------------
+ // mvSliderFloat4
+ //-----------------------------------------------------------------------------
+ MV_REGISTER_WIDGET(mvSliderFloatMulti, MV_ITEM_DESC_DEFAULT, StorageValueTypes::Float4, 1);
+ class mvSliderFloatMulti : public mvFloat4PtrBase
+ {
+
+ public:
+
+ static void InsertParser(std::map* parsers);
+
+ MV_APPLY_WIDGET_REGISTRATION(mvAppItemType::mvSliderFloatMulti, add_slider_floatx)
+
+ MV_CREATE_CONSTANT(mvThemeCol_SliderFloatx_Text , ImGuiCol_Text , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_SliderFloatx_Bg , ImGuiCol_FrameBg , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_SliderFloatx_BgHovered , ImGuiCol_FrameBgHovered , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_SliderFloatx_BgActive , ImGuiCol_FrameBgActive , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_SliderFloatx_Grab , ImGuiCol_SliderGrab , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_SliderFloatx_GrabActive , ImGuiCol_SliderGrabActive , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_SliderFloatx_Border , ImGuiCol_Border , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_SliderFloatx_BorderShadow , ImGuiCol_BorderShadow , 0L);
+
+ MV_CREATE_CONSTANT(mvThemeStyle_SliderFloatx_Rounding , ImGuiStyleVar_FrameRounding , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_SliderFloatx_BorderSize , ImGuiStyleVar_FrameBorderSize , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_SliderFloatx_PaddingX , ImGuiStyleVar_FramePadding , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_SliderFloatx_PaddingY , ImGuiStyleVar_FramePadding , 1L);
+ MV_CREATE_CONSTANT(mvThemeStyle_SliderFloatx_InnerSpacingX , ImGuiStyleVar_ItemInnerSpacing , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_SliderFloatx_InnerSpacingY , ImGuiStyleVar_ItemInnerSpacing , 1L);
+ MV_CREATE_CONSTANT(mvThemeStyle_SliderFloatx_GrabMinSize , ImGuiStyleVar_GrabMinSize , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_SliderFloatx_GrabRounding , ImGuiStyleVar_GrabRounding , 0L);
+
+ MV_START_EXTRA_COMMANDS
+ MV_END_EXTRA_COMMANDS
+
+ MV_START_GENERAL_CONSTANTS
+ MV_END_GENERAL_CONSTANTS
+
+ MV_START_COLOR_CONSTANTS
+ MV_ADD_CONSTANT(mvThemeCol_SliderFloatx_Text, mvColor(255, 255, 255, 255), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_SliderFloatx_Bg, mvColor( 41, 74, 122, 138), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_SliderFloatx_BgHovered, mvColor( 66, 150, 250, 102), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_SliderFloatx_BgActive, mvColor( 66, 150, 250, 171), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_SliderFloatx_Grab, mvColor( 61, 133, 224, 255), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_SliderFloatx_GrabActive, mvColor( 66, 150, 250, 255), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_SliderFloatx_Border, mvColor(110, 110, 128, 128), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_SliderFloatx_BorderShadow, mvColor( 0, 0, 0, 0), mvColor(128, 128, 128, 63)),
+ MV_END_COLOR_CONSTANTS
+
+ MV_START_STYLE_CONSTANTS
+ MV_ADD_CONSTANT(mvThemeStyle_SliderFloatx_Rounding , 0, 12),
+ MV_ADD_CONSTANT(mvThemeStyle_SliderFloatx_BorderSize , 0, 1),
+ MV_ADD_CONSTANT(mvThemeStyle_SliderFloatx_PaddingX , 4, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_SliderFloatx_PaddingY , 3, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_SliderFloatx_InnerSpacingX, 4, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_SliderFloatx_InnerSpacingY, 4, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_SliderFloatx_GrabMinSize ,10, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_SliderFloatx_GrabRounding , 0, 12),
+ MV_END_STYLE_CONSTANTS
+
+ public:
+
+ mvSliderFloatMulti(const std::string& name);
+
+ void setEnabled(bool value) override;
+ void draw(ImDrawList* drawlist, float x, float y) override;
+
+ void setExtraConfigDict(PyObject* dict) override;
+ void getExtraConfigDict(PyObject* dict) override;
+
+ private:
+
+ float m_min = 0.0f;
+ float m_max = 100.0f;
+ std::string m_format = "%.3f";
+ ImGuiInputTextFlags m_flags = ImGuiSliderFlags_None;
+ ImGuiInputTextFlags m_stor_flags = ImGuiSliderFlags_None;
+ int m_size = 4;
+ };
+
+ //-----------------------------------------------------------------------------
+ // mvSliderIntMulti
+ //-----------------------------------------------------------------------------
+ MV_REGISTER_WIDGET(mvSliderIntMulti, MV_ITEM_DESC_DEFAULT, StorageValueTypes::Int4, 1);
+ class mvSliderIntMulti : public mvInt4PtrBase
+ {
+
+ public:
+
+ static void InsertParser(std::map* parsers);
+
+ MV_APPLY_WIDGET_REGISTRATION(mvAppItemType::mvSliderIntMulti, add_slider_intx)
+
+ MV_CREATE_CONSTANT(mvThemeCol_SliderIntx_Text , ImGuiCol_Text , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_SliderIntx_Bg , ImGuiCol_FrameBg , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_SliderIntx_BgHovered , ImGuiCol_FrameBgHovered , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_SliderIntx_BgActive , ImGuiCol_FrameBgActive , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_SliderIntx_Grab , ImGuiCol_SliderGrab , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_SliderIntx_GrabActive , ImGuiCol_SliderGrabActive , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_SliderIntx_Border , ImGuiCol_Border , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_SliderIntx_BorderShadow , ImGuiCol_BorderShadow , 0L);
+
+ MV_CREATE_CONSTANT(mvThemeStyle_SliderIntx_Rounding , ImGuiStyleVar_FrameRounding , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_SliderIntx_BorderSize , ImGuiStyleVar_FrameBorderSize , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_SliderIntx_PaddingX , ImGuiStyleVar_FramePadding , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_SliderIntx_PaddingY , ImGuiStyleVar_FramePadding , 1L);
+ MV_CREATE_CONSTANT(mvThemeStyle_SliderIntx_InnerSpacingX , ImGuiStyleVar_ItemInnerSpacing , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_SliderIntx_InnerSpacingY , ImGuiStyleVar_ItemInnerSpacing , 1L);
+ MV_CREATE_CONSTANT(mvThemeStyle_SliderIntx_GrabMinSize , ImGuiStyleVar_GrabMinSize , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_SliderIntx_GrabRounding , ImGuiStyleVar_GrabRounding , 0L);
+
+ MV_START_EXTRA_COMMANDS
+ MV_END_EXTRA_COMMANDS
+
+ MV_START_GENERAL_CONSTANTS
+ MV_END_GENERAL_CONSTANTS
+
+ MV_START_COLOR_CONSTANTS
+ MV_ADD_CONSTANT(mvThemeCol_SliderIntx_Text, mvColor(255, 255, 255, 255), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_SliderIntx_Bg, mvColor( 41, 74, 122, 138), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_SliderIntx_BgHovered, mvColor( 66, 150, 250, 102), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_SliderIntx_BgActive, mvColor( 66, 150, 250, 171), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_SliderIntx_Grab, mvColor( 61, 133, 224, 255), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_SliderIntx_GrabActive, mvColor( 66, 150, 250, 255), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_SliderIntx_Border, mvColor(110, 110, 128, 128), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_SliderIntx_BorderShadow, mvColor( 0, 0, 0, 0), mvColor(128, 128, 128, 63)),
+ MV_END_COLOR_CONSTANTS
+
+ MV_START_STYLE_CONSTANTS
+ MV_ADD_CONSTANT(mvThemeStyle_SliderIntx_Rounding , 0, 12),
+ MV_ADD_CONSTANT(mvThemeStyle_SliderIntx_BorderSize , 0, 1),
+ MV_ADD_CONSTANT(mvThemeStyle_SliderIntx_PaddingX , 4, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_SliderIntx_PaddingY , 3, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_SliderIntx_InnerSpacingX , 4, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_SliderIntx_InnerSpacingY , 4, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_SliderIntx_GrabMinSize ,10, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_SliderIntx_GrabRounding , 0, 12),
+ MV_END_STYLE_CONSTANTS
+
+ public:
+
+ mvSliderIntMulti(const std::string& name);
+
+ void setEnabled(bool value) override;
+ void draw(ImDrawList* drawlist, float x, float y) override;
+
+ void setExtraConfigDict(PyObject* dict) override;
+ void getExtraConfigDict(PyObject* dict) override;
+
+ private:
+
+ int m_min = 0;
+ int m_max = 100;
+ std::string m_format = "%d";
+ ImGuiInputTextFlags m_flags = ImGuiSliderFlags_None;
+ ImGuiInputTextFlags m_stor_flags = ImGuiSliderFlags_None;
+ int m_size = 4;
+ };
+
+}
diff --git a/DearPyGui/src/core/AppItems/basic/mvSliderSingle.cpp b/DearPyGui/src/core/AppItems/basic/mvSliderSingle.cpp
new file mode 100644
index 000000000..80270daba
--- /dev/null
+++ b/DearPyGui/src/core/AppItems/basic/mvSliderSingle.cpp
@@ -0,0 +1,257 @@
+#include "mvSliderSingle.h"
+#include "mvTypeBases.h"
+#include
+#include "mvAppItem.h"
+#include "mvModule_Core.h"
+#include "mvApp.h"
+#include
+#include "mvItemRegistry.h"
+#include "mvImGuiThemeScope.h"
+#include "mvFontScope.h"
+
+namespace Marvel {
+
+ void mvSliderFloat::InsertParser(std::map* parsers)
+ {
+ parsers->insert({ s_command, mvPythonParser({
+ {mvPythonDataType::Optional},
+ {mvPythonDataType::String, "name"},
+ {mvPythonDataType::KeywordOnly},
+ {mvPythonDataType::Float, "default_value", "", "0.0"},
+ {mvPythonDataType::Float, "min_value", "", "0.0"},
+ {mvPythonDataType::Float, "max_value", "", "100.0"},
+ {mvPythonDataType::String, "format", "", "'%.3f'"},
+ {mvPythonDataType::Bool, "vertical", "sets orientation to vertical", "False"},
+ {mvPythonDataType::Callable, "callback", "Registers a callback", "None"},
+ {mvPythonDataType::Object, "callback_data", "Callback data", "None"},
+ {mvPythonDataType::String, "parent", "Parent this item will be added to. (runtime adding)", "''"},
+ {mvPythonDataType::String, "before", "This item will be displayed before the specified item in the parent. (runtime adding)", "''"},
+ {mvPythonDataType::String, "source", "", "''"},
+ {mvPythonDataType::Bool, "enabled", "Display grayed out text so selectable cannot be selected", "True"},
+ {mvPythonDataType::Integer, "width","", "0"},
+ {mvPythonDataType::Integer, "height","Height of a vertical slider", "0"},
+ {mvPythonDataType::Bool, "no_input", "Disable CTRL+Click or Enter key allowing to input text directly into the widget", "False"},
+ {mvPythonDataType::Bool, "clamped", "Clamp value to min/max bounds when input manually with CTRL+Click. By default CTRL+Click allows going out of bounds.", "False"},
+ {mvPythonDataType::String, "label", "", "''"},
+ {mvPythonDataType::Bool, "show", "Attempt to render", "True"},
+ }, "Adds slider for a single float value. CTRL+Click to directly modify the value.", "None", "Adding Widgets") });
+
+ }
+
+ void mvSliderInt::InsertParser(std::map* parsers)
+ {
+ parsers->insert({ "add_slider_int", mvPythonParser({
+ {mvPythonDataType::Optional},
+ {mvPythonDataType::String, "name"},
+ {mvPythonDataType::KeywordOnly},
+ {mvPythonDataType::Integer, "default_value", "", "0"},
+ {mvPythonDataType::Integer, "min_value", "", "0"},
+ {mvPythonDataType::Integer, "max_value", "", "100"},
+ {mvPythonDataType::String, "format", "", "'%d'"},
+ {mvPythonDataType::Bool, "vertical", "sets orientation to vertical", "False"},
+ {mvPythonDataType::Callable, "callback", "Registers a callback", "None"},
+ {mvPythonDataType::Object, "callback_data", "Callback data", "None"},
+ {mvPythonDataType::String, "parent", "Parent this item will be added to. (runtime adding)", "''"},
+ {mvPythonDataType::String, "before", "This item will be displayed before the specified item in the parent. (runtime adding)", "''"},
+ {mvPythonDataType::String, "source", "", "''"},
+ {mvPythonDataType::Bool, "enabled", "Display grayed out text so selectable cannot be selected", "True"},
+ {mvPythonDataType::Integer, "width","", "0"},
+ {mvPythonDataType::Integer, "height","Height of a vertical slider", "0"},
+ {mvPythonDataType::Bool, "no_input", "Disable CTRL+Click or Enter key allowing to input text directly into the widget", "False"},
+ {mvPythonDataType::Bool, "clamped", "Clamp value to min/max bounds when input manually with CTRL+Click. By default CTRL+Click allows going out of bounds.", "False"},
+ {mvPythonDataType::String, "label", "", "''"},
+ {mvPythonDataType::Bool, "show", "Attempt to render", "True"},
+ }, "Adds slider for a single int value. CTRL+Click to directly modify the value.", "None", "Adding Widgets") });
+
+ }
+
+ mvSliderFloat::mvSliderFloat(const std::string& name)
+ : mvFloatPtrBase(name)
+ {
+ }
+
+ void mvSliderFloat::setEnabled(bool value)
+ {
+ if (value == m_enabled)
+ return;
+
+ if (value)
+ m_flags = m_stor_flags;
+
+ else
+ {
+ m_stor_flags = m_flags;
+ m_flags |= ImGuiSliderFlags_NoInput;
+ }
+
+ m_enabled = value;
+ }
+
+ void mvSliderFloat::draw(ImDrawList* drawlist, float x, float y)
+ {
+ ScopedID id;
+ mvImGuiThemeScope scope(this);
+ mvFontScope fscope(this);
+
+ if (!m_enabled) m_disabled_value = *m_value;
+
+ if (m_vertical)
+ {
+ if ((float)m_height < 1.0f)
+ m_height = 100;
+ if ((float)m_width < 1.0f)
+ m_width = 20;
+
+ if (ImGui::VSliderFloat(m_label.c_str(), ImVec2((float)m_width, (float)m_height), m_enabled ? m_value.get() : &m_disabled_value, m_min, m_max, m_format.c_str()))
+ mvApp::GetApp()->getCallbackRegistry().addCallback(getCallback(false), m_name, m_callback_data);
+
+ }
+ else
+ {
+ if (ImGui::SliderFloat(m_label.c_str(), m_enabled ? m_value.get() : &m_disabled_value, m_min, m_max, m_format.c_str(), m_flags))
+ mvApp::GetApp()->getCallbackRegistry().addCallback(getCallback(false), m_name, m_callback_data);
+
+ }
+ }
+
+ mvSliderInt::mvSliderInt(const std::string& name)
+ : mvIntPtrBase(name)
+ {
+ }
+
+ void mvSliderInt::setEnabled(bool value)
+ {
+ if (value == m_enabled)
+ return;
+
+ if (value)
+ m_flags = m_stor_flags;
+
+ else
+ {
+ m_stor_flags = m_flags;
+ m_flags |= ImGuiSliderFlags_NoInput;
+ }
+
+ m_enabled = value;
+ }
+
+ void mvSliderInt::draw(ImDrawList* drawlist, float x, float y)
+ {
+ ScopedID id;
+ mvImGuiThemeScope scope(this);
+ mvFontScope fscope(this);
+
+ if (!m_enabled) m_disabled_value = *m_value;
+
+ if (m_vertical)
+ {
+ if ((float)m_height < 1.0f)
+ m_height = 100;
+ if ((float)m_width < 1.0f)
+ m_width = 20;
+
+ if (ImGui::VSliderInt(m_label.c_str(), ImVec2((float)m_width, (float)m_height), m_enabled ? m_value.get() : &m_disabled_value, m_min, m_max, m_format.c_str()))
+ mvApp::GetApp()->getCallbackRegistry().addCallback(getCallback(false), m_name, m_callback_data);
+ }
+ else
+ {
+ if (ImGui::SliderInt(m_label.c_str(), m_enabled ? m_value.get() : &m_disabled_value, m_min, m_max, m_format.c_str(), m_flags))
+ mvApp::GetApp()->getCallbackRegistry().addCallback(getCallback(false), m_name, m_callback_data);
+
+ }
+ }
+
+ void mvSliderFloat::setExtraConfigDict(PyObject* dict)
+ {
+ if (dict == nullptr)
+ return;
+
+ if (PyObject* item = PyDict_GetItemString(dict, "format")) m_format = ToString(item);
+ if (PyObject* item = PyDict_GetItemString(dict, "vertical")) m_vertical = ToBool(item);
+ if (PyObject* item = PyDict_GetItemString(dict, "min_value")) m_min = ToFloat(item);
+ if (PyObject* item = PyDict_GetItemString(dict, "max_value")) m_max = ToFloat(item);
+
+ // helper for bit flipping
+ auto flagop = [dict](const char* keyword, int flag, int& flags)
+ {
+ if (PyObject* item = PyDict_GetItemString(dict, keyword)) ToBool(item) ? flags |= flag : flags &= ~flag;
+ };
+
+ // flags
+ flagop("clamped", ImGuiSliderFlags_ClampOnInput, m_flags);
+ flagop("clamped", ImGuiSliderFlags_ClampOnInput, m_stor_flags);
+ flagop("no_input", ImGuiSliderFlags_NoInput, m_flags);
+ flagop("no_input", ImGuiSliderFlags_NoInput, m_stor_flags);
+
+ }
+
+ void mvSliderFloat::getExtraConfigDict(PyObject* dict)
+ {
+ if (dict == nullptr)
+ return;
+
+ PyDict_SetItemString(dict, "format", ToPyString(m_format));
+ PyDict_SetItemString(dict, "vertical", ToPyBool(m_vertical));
+ PyDict_SetItemString(dict, "min_value", ToPyFloat(m_min));
+ PyDict_SetItemString(dict, "max_value", ToPyFloat(m_max));
+
+ // helper to check and set bit
+ auto checkbitset = [dict](const char* keyword, int flag, const int& flags)
+ {
+ PyDict_SetItemString(dict, keyword, ToPyBool(flags & flag));
+ };
+
+ // window flags
+ checkbitset("clamped", ImGuiSliderFlags_ClampOnInput, m_flags);
+ checkbitset("no_input", ImGuiSliderFlags_NoInput, m_flags);
+
+ }
+
+ void mvSliderInt::setExtraConfigDict(PyObject* dict)
+ {
+ if (dict == nullptr)
+ return;
+
+ if (PyObject* item = PyDict_GetItemString(dict, "format")) m_format = ToString(item);
+ if (PyObject* item = PyDict_GetItemString(dict, "vertical")) m_vertical = ToBool(item);
+ if (PyObject* item = PyDict_GetItemString(dict, "min_value")) m_min = ToInt(item);
+ if (PyObject* item = PyDict_GetItemString(dict, "max_value")) m_max = ToInt(item);
+
+ // helper for bit flipping
+ auto flagop = [dict](const char* keyword, int flag, int& flags)
+ {
+ if (PyObject* item = PyDict_GetItemString(dict, keyword)) ToBool(item) ? flags |= flag : flags &= ~flag;
+ };
+
+ // flags
+ flagop("clamped", ImGuiSliderFlags_ClampOnInput, m_flags);
+ flagop("clamped", ImGuiSliderFlags_ClampOnInput, m_stor_flags);
+ flagop("no_input", ImGuiSliderFlags_NoInput, m_flags);
+ flagop("no_input", ImGuiSliderFlags_NoInput, m_stor_flags);
+
+ }
+
+ void mvSliderInt::getExtraConfigDict(PyObject* dict)
+ {
+ if (dict == nullptr)
+ return;
+
+ PyDict_SetItemString(dict, "format", ToPyString(m_format));
+ PyDict_SetItemString(dict, "vertical", ToPyBool(m_vertical));
+ PyDict_SetItemString(dict, "min_value", ToPyInt(m_min));
+ PyDict_SetItemString(dict, "max_value", ToPyInt(m_max));
+
+ // helper to check and set bit
+ auto checkbitset = [dict](const char* keyword, int flag, const int& flags)
+ {
+ PyDict_SetItemString(dict, keyword, ToPyBool(flags & flag));
+ };
+
+ // window flags
+ checkbitset("clamped", ImGuiSliderFlags_ClampOnInput, m_flags);
+ checkbitset("no_input", ImGuiSliderFlags_NoInput, m_flags);
+
+ }
+
+}
diff --git a/DearPyGui/src/core/AppItems/basic/mvSliderSingle.h b/DearPyGui/src/core/AppItems/basic/mvSliderSingle.h
new file mode 100644
index 000000000..c7be377b1
--- /dev/null
+++ b/DearPyGui/src/core/AppItems/basic/mvSliderSingle.h
@@ -0,0 +1,176 @@
+#pragma once
+#include "mvTypeBases.h"
+#include
+#include "mvModule_Core.h"
+
+//-----------------------------------------------------------------------------
+// Widget Index
+//
+// * mvSliderFloat
+// * mvSliderInt
+//
+//-----------------------------------------------------------------------------
+
+namespace Marvel {
+
+ //-----------------------------------------------------------------------------
+ // mvSliderFloat
+ //-----------------------------------------------------------------------------
+ MV_REGISTER_WIDGET(mvSliderFloat, MV_ITEM_DESC_DEFAULT, StorageValueTypes::Float, 1);
+ class mvSliderFloat : public mvFloatPtrBase
+ {
+
+ public:
+
+ static void InsertParser(std::map* parsers);
+
+ MV_APPLY_WIDGET_REGISTRATION(mvAppItemType::mvSliderFloat, add_slider_float)
+
+ MV_CREATE_CONSTANT(mvThemeCol_SliderFloat_Text , ImGuiCol_Text , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_SliderFloat_Bg , ImGuiCol_FrameBg , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_SliderFloat_BgHovered , ImGuiCol_FrameBgHovered , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_SliderFloat_BgActive , ImGuiCol_FrameBgActive , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_SliderFloat_Grab , ImGuiCol_SliderGrab , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_SliderFloat_GrabActive , ImGuiCol_SliderGrabActive , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_SliderFloat_Border , ImGuiCol_Border , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_SliderFloat_BorderShadow , ImGuiCol_BorderShadow , 0L);
+
+ MV_CREATE_CONSTANT(mvThemeStyle_SliderFloat_Rounding , ImGuiStyleVar_FrameRounding , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_SliderFloat_BorderSize , ImGuiStyleVar_FrameBorderSize , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_SliderFloat_PaddingX , ImGuiStyleVar_FramePadding , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_SliderFloat_PaddingY , ImGuiStyleVar_FramePadding , 1L);
+ MV_CREATE_CONSTANT(mvThemeStyle_SliderFloat_InnerSpacingX , ImGuiStyleVar_ItemInnerSpacing , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_SliderFloat_InnerSpacingY , ImGuiStyleVar_ItemInnerSpacing , 1L);
+ MV_CREATE_CONSTANT(mvThemeStyle_SliderFloat_GrabMinSize , ImGuiStyleVar_GrabMinSize , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_SliderFloat_GrabRounding , ImGuiStyleVar_GrabRounding , 0L);
+
+ MV_START_EXTRA_COMMANDS
+ MV_END_EXTRA_COMMANDS
+
+ MV_START_GENERAL_CONSTANTS
+ MV_END_GENERAL_CONSTANTS
+
+ MV_START_COLOR_CONSTANTS
+ MV_ADD_CONSTANT(mvThemeCol_SliderFloat_Text, mvColor(255, 255, 255, 255), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_SliderFloat_Bg, mvColor( 41, 74, 122, 138), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_SliderFloat_BgHovered, mvColor( 66, 150, 250, 102), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_SliderFloat_BgActive, mvColor( 66, 150, 250, 171), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_SliderFloat_Grab, mvColor( 61, 133, 224, 255), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_SliderFloat_GrabActive, mvColor( 66, 150, 250, 255), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_SliderFloat_Border, mvColor(110, 110, 128, 128), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_SliderFloat_BorderShadow, mvColor( 0, 0, 0, 0), mvColor(128, 128, 128, 63)),
+ MV_END_COLOR_CONSTANTS
+
+ MV_START_STYLE_CONSTANTS
+ MV_ADD_CONSTANT(mvThemeStyle_SliderFloat_Rounding , 0, 12),
+ MV_ADD_CONSTANT(mvThemeStyle_SliderFloat_BorderSize , 0, 1),
+ MV_ADD_CONSTANT(mvThemeStyle_SliderFloat_PaddingX , 4, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_SliderFloat_PaddingY , 3, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_SliderFloat_InnerSpacingX , 4, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_SliderFloat_InnerSpacingY , 4, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_SliderFloat_GrabMinSize ,10, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_SliderFloat_GrabRounding , 0, 12),
+ MV_END_STYLE_CONSTANTS
+
+ public:
+
+ mvSliderFloat(const std::string& name);
+
+ void setEnabled(bool value) override;
+ void draw(ImDrawList* drawlist, float x, float y) override;
+
+ void setExtraConfigDict(PyObject* dict) override;
+ void getExtraConfigDict(PyObject* dict) override;
+
+ private:
+
+ float m_min = 0.0f;
+ float m_max = 100.0f;
+ std::string m_format = "%.3f";
+ bool m_vertical = false;
+ ImGuiInputTextFlags m_flags = ImGuiSliderFlags_None;
+ ImGuiInputTextFlags m_stor_flags = ImGuiSliderFlags_None;
+
+ };
+
+ //-----------------------------------------------------------------------------
+ // mvSliderInt
+ //-----------------------------------------------------------------------------
+ MV_REGISTER_WIDGET(mvSliderInt, MV_ITEM_DESC_DEFAULT, StorageValueTypes::Int, 1);
+ class mvSliderInt : public mvIntPtrBase
+ {
+
+ public:
+
+ static void InsertParser(std::map* parsers);
+
+ MV_APPLY_WIDGET_REGISTRATION(mvAppItemType::mvSliderInt, add_slider_int)
+
+ MV_CREATE_CONSTANT(mvThemeCol_SliderInt_Text , ImGuiCol_Text , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_SliderInt_Bg , ImGuiCol_FrameBg , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_SliderInt_BgHovered , ImGuiCol_FrameBgHovered , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_SliderInt_BgActive , ImGuiCol_FrameBgActive , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_SliderInt_Grab , ImGuiCol_SliderGrab , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_SliderInt_GrabActive , ImGuiCol_SliderGrabActive , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_SliderInt_Border , ImGuiCol_Border , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_SliderInt_BorderShadow , ImGuiCol_BorderShadow , 0L);
+
+ MV_CREATE_CONSTANT(mvThemeStyle_SliderInt_Rounding , ImGuiStyleVar_FrameRounding , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_SliderInt_BorderSize , ImGuiStyleVar_FrameBorderSize , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_SliderInt_PaddingX , ImGuiStyleVar_FramePadding , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_SliderInt_PaddingY , ImGuiStyleVar_FramePadding , 1L);
+ MV_CREATE_CONSTANT(mvThemeStyle_SliderInt_InnerSpacingX , ImGuiStyleVar_ItemInnerSpacing , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_SliderInt_InnerSpacingY , ImGuiStyleVar_ItemInnerSpacing , 1L);
+ MV_CREATE_CONSTANT(mvThemeStyle_SliderInt_GrabMinSize , ImGuiStyleVar_GrabMinSize , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_SliderInt_GrabRounding , ImGuiStyleVar_GrabRounding , 0L);
+
+ MV_START_EXTRA_COMMANDS
+ MV_END_EXTRA_COMMANDS
+
+ MV_START_GENERAL_CONSTANTS
+ MV_END_GENERAL_CONSTANTS
+
+ MV_START_COLOR_CONSTANTS
+ MV_ADD_CONSTANT(mvThemeCol_SliderInt_Text, mvColor(255, 255, 255, 255), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_SliderInt_Bg, mvColor( 41, 74, 122, 138), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_SliderInt_BgHovered, mvColor( 66, 150, 250, 102), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_SliderInt_BgActive, mvColor( 66, 150, 250, 171), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_SliderInt_Grab, mvColor( 61, 133, 224, 255), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_SliderInt_GrabActive, mvColor( 66, 150, 250, 255), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_SliderInt_Border, mvColor(110, 110, 128, 128), mvColor(128, 128, 128, 63)),
+ MV_ADD_CONSTANT(mvThemeCol_SliderInt_BorderShadow, mvColor( 0, 0, 0, 0), mvColor(128, 128, 128, 63)),
+ MV_END_COLOR_CONSTANTS
+
+ MV_START_STYLE_CONSTANTS
+ MV_ADD_CONSTANT(mvThemeStyle_SliderInt_Rounding , 0, 12),
+ MV_ADD_CONSTANT(mvThemeStyle_SliderInt_BorderSize , 0, 1),
+ MV_ADD_CONSTANT(mvThemeStyle_SliderInt_PaddingX , 4, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_SliderInt_PaddingY , 3, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_SliderInt_InnerSpacingX , 4, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_SliderInt_InnerSpacingY , 4, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_SliderInt_GrabMinSize ,10, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_SliderInt_GrabRounding , 0, 12),
+ MV_END_STYLE_CONSTANTS
+
+ public:
+
+ mvSliderInt(const std::string& name);
+
+ void setEnabled(bool value) override;
+ void draw(ImDrawList* drawlist, float x, float y) override;
+
+ void setExtraConfigDict(PyObject* dict) override;
+ void getExtraConfigDict(PyObject* dict) override;
+
+ private:
+
+ int m_min = 0;
+ int m_max = 100;
+ std::string m_format = "%d";
+ bool m_vertical = false;
+ ImGuiInputTextFlags m_flags = ImGuiSliderFlags_None;
+ ImGuiInputTextFlags m_stor_flags = ImGuiSliderFlags_None;
+ };
+
+
+}
diff --git a/DearPyGui/src/core/AppItems/basic/mvTabButton.cpp b/DearPyGui/src/core/AppItems/basic/mvTabButton.cpp
new file mode 100644
index 000000000..7a8901bac
--- /dev/null
+++ b/DearPyGui/src/core/AppItems/basic/mvTabButton.cpp
@@ -0,0 +1,100 @@
+#include "mvTabButton.h"
+#include "mvApp.h"
+#include "mvLog.h"
+#include "mvItemRegistry.h"
+#include "mvImGuiThemeScope.h"
+#include "mvFontScope.h"
+
+namespace Marvel {
+
+ void mvTabButton::InsertParser(std::map* parsers)
+ {
+ parsers->insert({ s_command, mvPythonParser({
+ {mvPythonDataType::Optional},
+ {mvPythonDataType::String, "name"},
+ {mvPythonDataType::KeywordOnly},
+ {mvPythonDataType::String, "label", "", "''"},
+ {mvPythonDataType::Bool, "show", "Attempt to render", "True"},
+ {mvPythonDataType::Bool, "no_reorder", "Disable reordering this tab or having another tab cross over this tab", "False"},
+ {mvPythonDataType::Bool, "leading", "Enforce the tab position to the left of the tab bar (after the tab list popup button)", "False"},
+ {mvPythonDataType::Bool, "trailing", "Enforce the tab position to the right of the tab bar (before the scrolling buttons)", "False"},
+ {mvPythonDataType::Bool, "no_tooltip", "Disable tooltip for the given tab", "False"},
+ {mvPythonDataType::Callable, "callback", "Registers a callback", "None"},
+ {mvPythonDataType::Object, "callback_data", "Callback data", "None"},
+ {mvPythonDataType::String, "parent", "Parent to add this item to. (runtime adding)", "''"},
+ {mvPythonDataType::String, "before", "This item will be displayed before the specified item in the parent. (runtime adding)", "''"},
+ }, "Adds a tab button to a tab bar", "None", "Containers") });
+ }
+
+ mvTabButton::mvTabButton(const std::string& name)
+ :
+ mvAppItem(name)
+ {
+ }
+
+ void mvTabButton::draw(ImDrawList* drawlist, float x, float y)
+ {
+ ScopedID id;
+ mvImGuiThemeScope scope(this);
+ mvFontScope fscope(this);
+
+ if (ImGui::TabItemButton(m_label.c_str(), m_flags))
+ mvApp::GetApp()->getCallbackRegistry().addCallback(getCallback(false), m_name, m_callback_data);
+
+ }
+
+ bool mvTabButton::isParentCompatible(mvAppItemType type)
+ {
+ if (type == mvAppItemType::mvTabBar)
+ return true;
+
+ mvThrowPythonError(1000, "Tab button parent must be a tab bar.");
+ MV_ITEM_REGISTRY_ERROR("Tab button parent must be a tab bar.");
+ assert(false);
+ return false;
+ }
+
+ void mvTabButton::setExtraConfigDict(PyObject* dict)
+ {
+ if (dict == nullptr)
+ return;
+
+
+ // helper for bit flipping
+ auto flagop = [dict](const char* keyword, int flag, int& flags)
+ {
+ if (PyObject* item = PyDict_GetItemString(dict, keyword)) ToBool(item) ? flags |= flag : flags &= ~flag;
+ };
+
+ // window flags
+ flagop("no_reorder", ImGuiTabItemFlags_NoReorder, m_flags);
+ flagop("leading", ImGuiTabItemFlags_Leading, m_flags);
+ flagop("trailing", ImGuiTabItemFlags_Trailing, m_flags);
+ flagop("no_tooltip", ImGuiTabItemFlags_NoTooltip, m_flags);
+
+ if (m_flags & ImGuiTabItemFlags_Leading && m_flags & ImGuiTabItemFlags_Trailing)
+ m_flags &= ~ImGuiTabItemFlags_Leading;
+
+ }
+
+ void mvTabButton::getExtraConfigDict(PyObject* dict)
+ {
+ if (dict == nullptr)
+ return;
+
+
+ // helper to check and set bit
+ auto checkbitset = [dict](const char* keyword, int flag, const int& flags)
+ {
+ PyDict_SetItemString(dict, keyword, ToPyBool(flags & flag));
+ };
+
+ // window flags
+ checkbitset("no_reorder", ImGuiTabBarFlags_Reorderable, m_flags);
+ checkbitset("leading", ImGuiTabItemFlags_Leading, m_flags);
+ checkbitset("trailing", ImGuiTabItemFlags_Trailing, m_flags);
+ checkbitset("no_tooltip", ImGuiTabItemFlags_NoTooltip, m_flags);
+
+ }
+
+}
\ No newline at end of file
diff --git a/DearPyGui/src/core/AppItems/basic/mvTabButton.h b/DearPyGui/src/core/AppItems/basic/mvTabButton.h
new file mode 100644
index 000000000..f84849ac1
--- /dev/null
+++ b/DearPyGui/src/core/AppItems/basic/mvTabButton.h
@@ -0,0 +1,65 @@
+#pragma once
+
+#include "mvTypeBases.h"
+
+namespace Marvel {
+
+ MV_REGISTER_WIDGET(mvTabButton, MV_ITEM_DESC_DEFAULT, StorageValueTypes::None, 1);
+ class mvTabButton : public mvAppItem
+ {
+
+ public:
+
+ static void InsertParser(std::map* parsers);
+
+ MV_APPLY_WIDGET_REGISTRATION(mvAppItemType::mvTabButton, add_tab_button)
+
+ MV_CREATE_CONSTANT(mvThemeCol_TabButton_Text , ImGuiCol_Text , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_TabButton_Bg , ImGuiCol_Tab , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_TabButton_BgHovered , ImGuiCol_TabHovered , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_TabButton_Border , ImGuiCol_Border , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_TabButton_PopupBg , ImGuiCol_PopupBg , 0L);
+
+ MV_CREATE_CONSTANT(mvThemeStyle_TabButton_Rounding , ImGuiStyleVar_FrameRounding , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_TabButton_BorderSize , ImGuiStyleVar_FrameBorderSize , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_TabButton_PaddingX , ImGuiStyleVar_FramePadding , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_TabButton_PaddingY , ImGuiStyleVar_FramePadding , 1L);
+
+ MV_START_EXTRA_COMMANDS
+ MV_END_EXTRA_COMMANDS
+
+ MV_START_GENERAL_CONSTANTS
+ MV_END_GENERAL_CONSTANTS
+
+ MV_START_COLOR_CONSTANTS
+ MV_CREATE_CONSTANT_PAIR(mvThemeCol_TabButton_Text, mvColor(255, 255, 255, 255)),
+ MV_CREATE_CONSTANT_PAIR(mvThemeCol_TabButton_Bg, mvColor( 41, 74, 122, 138)),
+ MV_CREATE_CONSTANT_PAIR(mvThemeCol_TabButton_BgHovered, mvColor( 66, 150, 250, 102)),
+ MV_CREATE_CONSTANT_PAIR(mvThemeCol_TabButton_Border, mvColor(110, 110, 128, 128)),
+ MV_CREATE_CONSTANT_PAIR(mvThemeCol_TabButton_PopupBg, mvColor( 20, 20, 20, 240)),
+ MV_END_COLOR_CONSTANTS
+
+ MV_START_STYLE_CONSTANTS
+ MV_ADD_CONSTANT(mvThemeStyle_TabButton_Rounding , 0, 12),
+ MV_ADD_CONSTANT(mvThemeStyle_TabButton_BorderSize , 0, 1),
+ MV_ADD_CONSTANT(mvThemeStyle_TabButton_PaddingX , 4, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_TabButton_PaddingY , 3, 20),
+ MV_END_STYLE_CONSTANTS
+
+ public:
+
+ mvTabButton(const std::string& name);
+
+ void draw(ImDrawList* drawlist, float x, float y) override;
+
+ bool isParentCompatible(mvAppItemType type) override;
+
+ void setExtraConfigDict(PyObject* dict) override;
+ void getExtraConfigDict(PyObject* dict) override;
+
+ private:
+
+ ImGuiTabItemFlags m_flags = ImGuiTabItemFlags_None;
+
+ };
+}
\ No newline at end of file
diff --git a/DearPyGui/src/core/AppItems/basic/mvText.cpp b/DearPyGui/src/core/AppItems/basic/mvText.cpp
new file mode 100644
index 000000000..7f862d2d7
--- /dev/null
+++ b/DearPyGui/src/core/AppItems/basic/mvText.cpp
@@ -0,0 +1,143 @@
+#include "mvText.h"
+#include "mvApp.h"
+#include "mvItemRegistry.h"
+#include "mvImGuiThemeScope.h"
+#include "mvFontScope.h"
+
+namespace Marvel {
+
+ void mvText::InsertParser(std::map* parsers)
+ {
+ parsers->insert({ s_command, mvPythonParser({
+ {mvPythonDataType::Optional},
+ {mvPythonDataType::String, "name"},
+ {mvPythonDataType::KeywordOnly},
+ {mvPythonDataType::Integer, "wrap", "number of characters until wraping", "-1"},
+ {mvPythonDataType::FloatList, "color", "color of the text (rgba)", "(-1, 0, 0, 0)"},
+ {mvPythonDataType::Bool, "bullet", "makes the text bulleted", "False"},
+ {mvPythonDataType::String, "parent", "Parent this item will be added to. (runtime adding)", "''"},
+ {mvPythonDataType::String, "before", "This item will be displayed before the specified item in the parent. (runtime adding)", "''"},
+ {mvPythonDataType::String, "source", "", "''"},
+ {mvPythonDataType::String, "default_value", "", "''"},
+ {mvPythonDataType::Bool, "show", "Attempt to render", "True"},
+ }, "Adds text", "None", "Adding Widgets") });
+ }
+
+ void mvLabelText::InsertParser(std::map* parsers)
+ {
+ parsers->insert({ s_command, mvPythonParser({
+ {mvPythonDataType::Optional},
+ {mvPythonDataType::String, "name"},
+ {mvPythonDataType::KeywordOnly},
+ {mvPythonDataType::String, "default_value", "", "''"},
+ {mvPythonDataType::FloatList, "color", "", "(-1, 0, 0, 0)"},
+ {mvPythonDataType::String, "parent", "Parent this item will be added to. (runtime adding)", "''"},
+ {mvPythonDataType::String, "before", "This item will be displayed before the specified item in the parent. (runtime adding)", "''"},
+ {mvPythonDataType::String, "source", "data source for shared data", "''"},
+ {mvPythonDataType::String, "label", "", "''"},
+ {mvPythonDataType::Bool, "show", "Attempt to render", "True"},
+ }, "Adds text with a label. Useful for output values.", "None", "Adding Widgets") });
+ }
+
+ mvText::mvText(const std::string& name)
+ :
+ mvStringPtrBase(name)
+ {
+ *m_value = name;
+ }
+
+ void mvText::draw(ImDrawList* drawlist, float x, float y)
+ {
+ ScopedID id;
+ mvImGuiThemeScope scope(this);
+ mvFontScope fscope(this);
+
+ if (m_color.r > 0.0f)
+ ImGui::PushStyleColor(ImGuiCol_Text, m_color.toVec4());
+
+ if (m_wrap >= 0)
+ ImGui::PushTextWrapPos((float)m_wrap);
+
+ if (m_bullet)
+ ImGui::Bullet();
+
+ //ImGui::Text("%s", m_value.c_str());
+ ImGui::TextUnformatted(m_value->c_str()); // this doesn't have a buffer size limit
+
+ if (m_wrap >= 0)
+ ImGui::PopTextWrapPos();
+
+ if (m_color.r > 0.0f)
+ ImGui::PopStyleColor();
+
+ }
+
+ mvLabelText::mvLabelText(const std::string& name)
+ :
+ mvStringPtrBase(name)
+ {
+ }
+
+ void mvLabelText::draw(ImDrawList* drawlist, float x, float y)
+ {
+
+ if (m_color.r > 0.0f)
+ {
+ ImGui::PushStyleColor(ImGuiCol_Text, m_color.toVec4());
+
+ ImGui::TextUnformatted(m_value->c_str());
+
+ ImGui::PopStyleColor();
+
+ ImGui::SameLine();
+
+ mvImGuiThemeScope scope(this);
+ ImGui::TextUnformatted(m_specificedlabel.c_str());
+ }
+
+ else
+ {
+ mvImGuiThemeScope scope(this);
+ ImGui::LabelText(m_specificedlabel.c_str(), m_value->c_str());
+ }
+
+ }
+
+ void mvText::setExtraConfigDict(PyObject* dict)
+ {
+ if (dict == nullptr)
+ return;
+
+ if (PyObject* item = PyDict_GetItemString(dict, "color")) m_color = ToColor(item);
+ if (PyObject* item = PyDict_GetItemString(dict, "wrap")) m_wrap = ToInt(item);
+ if (PyObject* item = PyDict_GetItemString(dict, "bullet")) m_bullet = ToBool(item);
+
+ }
+
+ void mvText::getExtraConfigDict(PyObject* dict)
+ {
+ if (dict == nullptr)
+ return;
+
+ PyDict_SetItemString(dict, "color", ToPyColor(m_color));
+ PyDict_SetItemString(dict, "wrap", ToPyInt(m_wrap));
+ PyDict_SetItemString(dict, "bullet", ToPyBool(m_bullet));
+ }
+
+ void mvLabelText::setExtraConfigDict(PyObject* dict)
+ {
+ if (dict == nullptr)
+ return;
+
+ if (PyObject* item = PyDict_GetItemString(dict, "color")) m_color = ToColor(item);
+ }
+
+ void mvLabelText::getExtraConfigDict(PyObject* dict)
+ {
+ if (dict == nullptr)
+ return;
+
+ PyDict_SetItemString(dict, "color", ToPyColor(m_color));
+ }
+
+}
\ No newline at end of file
diff --git a/DearPyGui/src/core/AppItems/basic/mvText.h b/DearPyGui/src/core/AppItems/basic/mvText.h
new file mode 100644
index 000000000..e6157ca14
--- /dev/null
+++ b/DearPyGui/src/core/AppItems/basic/mvText.h
@@ -0,0 +1,111 @@
+#pragma once
+
+#include "mvTypeBases.h"
+
+//-----------------------------------------------------------------------------
+// Widget Index
+//
+// * mvText
+// * mvLabelText
+//
+//-----------------------------------------------------------------------------
+
+namespace Marvel {
+
+ //-----------------------------------------------------------------------------
+ // mvText
+ //-----------------------------------------------------------------------------
+ MV_REGISTER_WIDGET(mvText, MV_ITEM_DESC_DEFAULT, StorageValueTypes::String, 1);
+ class mvText : public mvStringPtrBase
+ {
+
+ public:
+
+ static void InsertParser(std::map* parsers);
+
+ MV_APPLY_WIDGET_REGISTRATION(mvAppItemType::mvText, add_text)
+
+ MV_CREATE_CONSTANT(mvThemeCol_Text_Text, ImGuiCol_Text, 0L);
+
+ MV_START_EXTRA_COMMANDS
+ MV_END_EXTRA_COMMANDS
+
+ MV_START_GENERAL_CONSTANTS
+ MV_END_GENERAL_CONSTANTS
+
+ MV_START_COLOR_CONSTANTS
+ MV_CREATE_CONSTANT_PAIR(mvThemeCol_Text_Text, mvColor(255, 255, 255, 255))
+ MV_END_COLOR_CONSTANTS
+
+ MV_START_STYLE_CONSTANTS
+ MV_END_STYLE_CONSTANTS
+
+ public:
+
+ mvText(const std::string& name);
+
+ void draw(ImDrawList* drawlist, float x, float y) override;
+
+ void setExtraConfigDict(PyObject* dict) override;
+ void getExtraConfigDict(PyObject* dict) override;
+
+ private:
+
+ mvColor m_color = {-1.0f, 0.0f, 0.0f, 1.0f};
+ int m_wrap = -1;
+ bool m_bullet = false;
+
+ };
+
+ //-----------------------------------------------------------------------------
+ // mvLabelText
+ //-----------------------------------------------------------------------------
+ MV_REGISTER_WIDGET(mvLabelText, MV_ITEM_DESC_DEFAULT, StorageValueTypes::String, 1);
+ class mvLabelText : public mvStringPtrBase
+ {
+
+ public:
+
+ static void InsertParser(std::map* parsers);
+
+ MV_APPLY_WIDGET_REGISTRATION(mvAppItemType::mvLabelText, add_label_text)
+
+ MV_CREATE_CONSTANT(mvThemeCol_LabelText_Text , ImGuiCol_Text, 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_LabelText_PaddingX , ImGuiCol_TitleBg, 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_LabelText_PaddingY , ImGuiCol_TitleBg, 1L);
+ MV_CREATE_CONSTANT(mvThemeStyle_LabelText_ItemInnerSpacingX , 14L, 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_LabelText_ItemInnerSpacingY , 14L, 1L);
+
+ MV_START_EXTRA_COMMANDS
+ MV_END_EXTRA_COMMANDS
+
+ MV_START_GENERAL_CONSTANTS
+ MV_END_GENERAL_CONSTANTS
+
+ MV_START_COLOR_CONSTANTS
+ MV_CREATE_CONSTANT_PAIR(mvThemeCol_LabelText_Text, mvColor(255, 255, 255, 255))
+ MV_END_COLOR_CONSTANTS
+
+ MV_START_STYLE_CONSTANTS
+ MV_ADD_CONSTANT(mvThemeStyle_LabelText_PaddingX , 4, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_LabelText_PaddingY , 3, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_LabelText_ItemInnerSpacingX , 4, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_LabelText_ItemInnerSpacingY , 4, 20),
+ MV_END_STYLE_CONSTANTS
+
+ public:
+
+ mvLabelText(const std::string& name);
+
+ void draw(ImDrawList* drawlist, float x, float y) override;
+
+ void setExtraConfigDict(PyObject* dict) override;
+ void getExtraConfigDict(PyObject* dict) override;
+
+ private:
+
+ mvColor m_color = { -1.0f, 0.0f, 0.0f, 1.0f};
+
+ };
+
+}
\ No newline at end of file
diff --git a/DearPyGui/src/core/AppItems/composite/mvAboutWindow.cpp b/DearPyGui/src/core/AppItems/composite/mvAboutWindow.cpp
new file mode 100644
index 000000000..d5a12aa57
--- /dev/null
+++ b/DearPyGui/src/core/AppItems/composite/mvAboutWindow.cpp
@@ -0,0 +1,163 @@
+#include "mvAboutWindow.h"
+#include "mvTypeBases.h"
+#include "mvAppItem.h"
+#include "mvInput.h"
+#include "mvModule_Core.h"
+#include "mvApp.h"
+#include
+#include "mvItemRegistry.h"
+#include "mvFontScope.h"
+
+namespace Marvel {
+
+ void mvAboutWindow::InsertParser(std::map* parsers)
+ {
+ parsers->insert({ s_command, mvPythonParser({
+ {mvPythonDataType::Optional},
+ {mvPythonDataType::String, "name"},
+ {mvPythonDataType::KeywordOnly},
+ {mvPythonDataType::Integer, "width", "", "-1"},
+ {mvPythonDataType::Integer, "height", "", "-1"},
+ {mvPythonDataType::Integer, "x_pos", "x position the window will start at", "200"},
+ {mvPythonDataType::Integer, "y_pos", "y position the window will start at", "200"},
+ {mvPythonDataType::Bool, "autosize", "Autosized the window to fit it's items.", "False"},
+ {mvPythonDataType::Bool, "no_resize", "Allows for the window size to be changed or fixed", "False"},
+ {mvPythonDataType::Bool, "no_title_bar", "Title name for the title bar of the window", "False"},
+ {mvPythonDataType::Bool, "no_move", "Allows for the window's position to be changed or fixed", "False"},
+ {mvPythonDataType::Bool, "no_scrollbar" ," Disable scrollbars (window can still scroll with mouse or programmatically)", "False"},
+ {mvPythonDataType::Bool, "no_collapse" ,"Disable user collapsing window by double-clicking on it", "False"},
+ {mvPythonDataType::Bool, "horizontal_scrollbar" ,"Allow horizontal scrollbar to appear (off by default).", "False"},
+ {mvPythonDataType::Bool, "no_focus_on_appearing" ,"Disable taking focus when transitioning from hidden to visible state", "False"},
+ {mvPythonDataType::Bool, "no_bring_to_front_on_focus" ,"Disable bringing window to front when taking focus (e.g. clicking on it or programmatically giving it focus)", "False"},
+ {mvPythonDataType::Bool, "no_close", "", "False"},
+ {mvPythonDataType::Bool, "no_background", "", "False"},
+ {mvPythonDataType::String, "label", "", "''"},
+ {mvPythonDataType::Bool, "show", "Attempt to render", "True"},
+ }, "Creates an about window.",
+ "None", "Containers") });
+ }
+
+ mvAboutWindow::mvAboutWindow(const std::string& name)
+ : mvBaseWindowAppitem(name)
+ {
+ m_windowflags = ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoSavedSettings;
+ }
+
+ void mvAboutWindow::draw(ImDrawList* drawlist, float x, float y)
+ {
+ if (!prerender())
+ return;
+
+ ImGui::Text("Dear PyGui %s", mvApp::GetVersion());
+ ImGui::Text("Dear ImGui %s", ImGui::GetVersion());
+ ImGui::Separator();
+ ImGui::TextColored(ImGui::GetStyleColorVec4(ImGuiCol_PlotHistogramHovered), "Authors");
+ ImGui::BulletText("Jonathan Hoffstadt");
+ ImGui::BulletText("Preston Cothren");
+ ImGui::Text("Dear PyGui is licensed under the MIT License, see LICENSE for more information.");
+ ImGui::Separator();
+ ImGui::TextColored(ImGui::GetStyleColorVec4(ImGuiCol_PlotHistogramHovered), "Corporate");
+ ImGui::BulletText("Anthony Tanbakuchi");
+ ImGui::Separator();
+ ImGui::TextColored(ImGui::GetStyleColorVec4(ImGuiCol_PlotHistogramHovered), "Partners");
+ ImGui::BulletText("Dean Keinan");
+ ImGui::BulletText("He Lingfeng");
+ ImGui::BulletText("Anthony Doupe");
+ ImGui::BulletText("Ray Heasman");
+ ImGui::BulletText("Marco Studer");
+ ImGui::Separator();
+ ImGui::TextColored(ImGui::GetStyleColorVec4(ImGuiCol_PlotHistogramHovered), "ImPlot");
+ ImGui::Text("ImPlot Author Evan Pezent.");
+ ImGui::Separator();
+ ImGui::TextColored(ImGui::GetStyleColorVec4(ImGuiCol_PlotHistogramHovered), "imnodes");
+ ImGui::Text("imnodes Author Johann Muszynski.");
+ ImGui::Separator();
+ ImGui::TextColored(ImGui::GetStyleColorVec4(ImGuiCol_PlotHistogramHovered), "Dear ImGui");
+ ImGui::Text("Dear ImGui Author Omar Cornut and all Dear ImGui contributors.");
+ ImGui::Text("Dear ImGui is licensed under the MIT License, see LICENSE for more information.");
+
+ static bool show_config_info = false;
+ ImGui::Checkbox("Config/Build Information", &show_config_info);
+ if (show_config_info)
+ {
+ ImGuiIO& io = ImGui::GetIO();
+ ImGuiStyle& style = ImGui::GetStyle();
+
+ bool copy_to_clipboard = ImGui::Button("Copy to clipboard");
+ ImGui::BeginChildFrame(ImGui::GetID("cfginfos"), ImVec2(0, ImGui::GetTextLineHeightWithSpacing() * 18), ImGuiWindowFlags_NoMove);
+ if (copy_to_clipboard)
+ {
+ ImGui::LogToClipboard();
+ ImGui::LogText("```\n"); // Back quotes will make the text appears without formatting when pasting to GitHub
+ }
+
+ ImGui::Text("Dear ImGui %s (%d)", IMGUI_VERSION, IMGUI_VERSION_NUM);
+ ImGui::Separator();
+ ImGui::Text("sizeof(size_t): %d, sizeof(ImDrawIdx): %d, sizeof(ImDrawVert): %d", (int)sizeof(size_t), (int)sizeof(ImDrawIdx), (int)sizeof(ImDrawVert));
+ ImGui::Text("define: __cplusplus=%d", (int)__cplusplus);
+ ImGui::Text("define: _WIN32");
+ ImGui::Text("define: _WIN64");
+ #if defined (_WIN32)
+ ImGui::Text("define: _MSC_VER=%d", _MSC_VER);
+ #endif
+ ImGui::Separator();
+ ImGui::Text("io.BackendPlatformName: %s", io.BackendPlatformName ? io.BackendPlatformName : "NULL");
+ ImGui::Text("io.BackendRendererName: %s", io.BackendRendererName ? io.BackendRendererName : "NULL");
+ ImGui::Text("io.ConfigFlags: 0x%08X", io.ConfigFlags);
+ if (io.ConfigFlags & ImGuiConfigFlags_NavEnableKeyboard) ImGui::Text(" NavEnableKeyboard");
+ if (io.ConfigFlags & ImGuiConfigFlags_NavEnableGamepad) ImGui::Text(" NavEnableGamepad");
+ if (io.ConfigFlags & ImGuiConfigFlags_NavEnableSetMousePos) ImGui::Text(" NavEnableSetMousePos");
+ if (io.ConfigFlags & ImGuiConfigFlags_NavNoCaptureKeyboard) ImGui::Text(" NavNoCaptureKeyboard");
+ if (io.ConfigFlags & ImGuiConfigFlags_NoMouse) ImGui::Text(" NoMouse");
+ if (io.ConfigFlags & ImGuiConfigFlags_NoMouseCursorChange) ImGui::Text(" NoMouseCursorChange");
+ if (io.MouseDrawCursor) ImGui::Text("io.MouseDrawCursor");
+ if (io.ConfigMacOSXBehaviors) ImGui::Text("io.ConfigMacOSXBehaviors");
+ if (io.ConfigInputTextCursorBlink) ImGui::Text("io.ConfigInputTextCursorBlink");
+ if (io.ConfigWindowsResizeFromEdges) ImGui::Text("io.ConfigWindowsResizeFromEdges");
+ if (io.ConfigWindowsMoveFromTitleBarOnly) ImGui::Text("io.ConfigWindowsMoveFromTitleBarOnly");
+ ImGui::Text("io.BackendFlags: 0x%08X", io.BackendFlags);
+ if (io.BackendFlags & ImGuiBackendFlags_HasGamepad) ImGui::Text(" HasGamepad");
+ if (io.BackendFlags & ImGuiBackendFlags_HasMouseCursors) ImGui::Text(" HasMouseCursors");
+ if (io.BackendFlags & ImGuiBackendFlags_HasSetMousePos) ImGui::Text(" HasSetMousePos");
+ if (io.BackendFlags & ImGuiBackendFlags_RendererHasVtxOffset) ImGui::Text(" RendererHasVtxOffset");
+ ImGui::Separator();
+ ImGui::Text("io.Fonts: %d fonts, Flags: 0x%08X, TexSize: %d,%d", io.Fonts->Fonts.Size, io.Fonts->Flags, io.Fonts->TexWidth, io.Fonts->TexHeight);
+ ImGui::Text("io.DisplaySize: %.2f,%.2f", io.DisplaySize.x, io.DisplaySize.y);
+ ImGui::Text("io.DisplayFramebufferScale: %.2f,%.2f", io.DisplayFramebufferScale.x, io.DisplayFramebufferScale.y);
+ ImGui::Separator();
+ ImGui::Text("style.WindowPadding: %.2f,%.2f", style.WindowPadding.x, style.WindowPadding.y);
+ ImGui::Text("style.WindowBorderSize: %.2f", style.WindowBorderSize);
+ ImGui::Text("style.FramePadding: %.2f,%.2f", style.FramePadding.x, style.FramePadding.y);
+ ImGui::Text("style.FrameRounding: %.2f", style.FrameRounding);
+ ImGui::Text("style.FrameBorderSize: %.2f", style.FrameBorderSize);
+ ImGui::Text("style.ItemSpacing: %.2f,%.2f", style.ItemSpacing.x, style.ItemSpacing.y);
+ ImGui::Text("style.ItemInnerSpacing: %.2f,%.2f", style.ItemInnerSpacing.x, style.ItemInnerSpacing.y);
+
+ if (copy_to_clipboard)
+ {
+ ImGui::LogText("\n```\n");
+ ImGui::LogFinish();
+ }
+ ImGui::EndChildFrame();
+ }
+
+ if (ImGui::IsWindowFocused())
+ {
+
+ float titleBarHeight = ImGui::GetStyle().FramePadding.y * 2 + ImGui::GetFontSize();
+
+ // update mouse
+ ImVec2 mousePos = ImGui::GetMousePos();
+ float x = mousePos.x - ImGui::GetWindowPos().x;
+ float y = mousePos.y - ImGui::GetWindowPos().y - titleBarHeight;
+ mvInput::setMousePosition(x, y);
+
+ if (mvApp::GetApp()->getItemRegistry().getActiveWindow() != m_name)
+ mvEventBus::Publish(mvEVT_CATEGORY_ITEM, mvEVT_ACTIVE_WINDOW, { CreateEventArgument("WINDOW", m_name) });
+ }
+
+ ImGui::End();
+
+ }
+
+}
diff --git a/DearPyGui/src/core/AppItems/composite/mvAboutWindow.h b/DearPyGui/src/core/AppItems/composite/mvAboutWindow.h
new file mode 100644
index 000000000..8e56c1d40
--- /dev/null
+++ b/DearPyGui/src/core/AppItems/composite/mvAboutWindow.h
@@ -0,0 +1,36 @@
+#pragma once
+#include "mvTypeBases.h"
+#include "mvModule_Core.h"
+
+namespace Marvel {
+
+ MV_REGISTER_WIDGET(mvAboutWindow, MV_ITEM_DESC_ROOT, StorageValueTypes::None, 1);
+ class mvAboutWindow : public mvBaseWindowAppitem
+ {
+
+ public:
+
+ static void InsertParser(std::map* parsers);
+
+ MV_APPLY_WIDGET_REGISTRATION(mvAppItemType::mvAboutWindow, add_about_window)
+
+ MV_START_EXTRA_COMMANDS
+ MV_END_EXTRA_COMMANDS
+
+ MV_START_GENERAL_CONSTANTS
+ MV_END_GENERAL_CONSTANTS
+
+ MV_START_COLOR_CONSTANTS
+ MV_END_COLOR_CONSTANTS
+
+ MV_START_STYLE_CONSTANTS
+ MV_END_STYLE_CONSTANTS
+
+ public:
+
+ mvAboutWindow(const std::string& name);
+
+ void draw(ImDrawList* drawlist, float x, float y) override;
+ };
+
+}
diff --git a/DearPyGui/src/core/AppItems/composite/mvDataGrid.cpp b/DearPyGui/src/core/AppItems/composite/mvDataGrid.cpp
new file mode 100644
index 000000000..e508b2aee
--- /dev/null
+++ b/DearPyGui/src/core/AppItems/composite/mvDataGrid.cpp
@@ -0,0 +1,1078 @@
+#include "mvDataGrid.h"
+#include "mvApp.h"
+#include "mvAppLog.h"
+#include "mvItemRegistry.h"
+#include "mvImGuiThemeScope.h"
+#include "mvFontScope.h"
+
+namespace Marvel {
+
+ void mvDataGrid::InsertParser(std::map* parsers)
+ {
+ parsers->insert({ s_command, mvPythonParser({
+ {mvPythonDataType::Optional},
+ {mvPythonDataType::String, "name"},
+ {mvPythonDataType::KeywordOnly},
+ {mvPythonDataType::StringList, "headers"},
+ {mvPythonDataType::Callable, "callback", "Registers a callback", "None"},
+ {mvPythonDataType::Object, "callback_data", "Callback data", "None"},
+ {mvPythonDataType::String, "parent", "Parent this item will be added to. (runtime adding)", "''"},
+ {mvPythonDataType::String, "before","This item will be displayed before the specified item in the parent. (runtime adding)", "''"},
+ {mvPythonDataType::Integer, "width","", "0"},
+ {mvPythonDataType::Integer, "height","", "200"},
+ {mvPythonDataType::Bool, "hide_headers", "Hide headers of the table", "False"},
+ {mvPythonDataType::Bool, "show","Attempt to render", "True"}
+ }, "Adds data grid.", "None", "Tables") });
+
+ parsers->insert({ "set_grid_data", mvPythonParser({
+ {mvPythonDataType::String, "data_grid"},
+ {mvPythonDataType::ListStrList, "data"}
+ }, "Overwrites data grid data.", "None", "Tables") });
+
+ parsers->insert({ "get_grid_data", mvPythonParser({
+ {mvPythonDataType::String, "data_grid"},
+ }, "Gets data grid data.", "List[List[str]]", "Tables") });
+
+ parsers->insert({ "set_grid_headers", mvPythonParser({
+ {mvPythonDataType::String, "data_grid"},
+ {mvPythonDataType::StringList, "headers"},
+ }, "Sets a data grid's headers.", "None", "Tables") });
+
+ parsers->insert({ "clear_data_grid", mvPythonParser({
+ {mvPythonDataType::String, "data_grid"}
+ }, "Clears data in a data grid", "None", "Tables") });
+
+ parsers->insert({ "add_grid_column", mvPythonParser({
+ {mvPythonDataType::String, "data_grid"},
+ {mvPythonDataType::String, "name"},
+ {mvPythonDataType::StringList, "column"},
+ }, "Adds a column to the end of a data grid.", "None", "Tables") });
+
+ parsers->insert({ "insert_grid_column", mvPythonParser({
+ {mvPythonDataType::String, "data_grid"},
+ {mvPythonDataType::Integer, "column_index"},
+ {mvPythonDataType::String, "name"},
+ {mvPythonDataType::StringList, "column"},
+ }, "Inserts a column into a data grid.", "None", "Tables") });
+
+ parsers->insert({ "delete_grid_column", mvPythonParser({
+ {mvPythonDataType::String, "data_grid"},
+ {mvPythonDataType::Integer, "column"}
+ }, "Delete a column in a data grid.", "None", "Tables") });
+
+ parsers->insert({ "add_grid_row", mvPythonParser({
+ {mvPythonDataType::String, "data_grid"},
+ {mvPythonDataType::StringList, "row"},
+ }, "Adds a row to the end of a data grid.", "None", "Tables") });
+
+ parsers->insert({ "insert_grid_row", mvPythonParser({
+ {mvPythonDataType::String, "data_grid"},
+ {mvPythonDataType::Integer, "row_index"},
+ {mvPythonDataType::StringList, "row"},
+ }, "Inserts a row into a data grid.", "None", "Tables") });
+
+ parsers->insert({ "delete_grid_row", mvPythonParser({
+ {mvPythonDataType::String, "data_grid"},
+ {mvPythonDataType::Integer, "row"}
+ }, "Delete a row in a data grid.", "None", "Tables") });
+
+ parsers->insert({ "get_grid_item", mvPythonParser({
+ {mvPythonDataType::String, "data_grid"},
+ {mvPythonDataType::Integer, "row"},
+ {mvPythonDataType::Integer, "column"}
+ }, "Gets a data grid's cell value.", "str", "Tables") });
+
+ parsers->insert({ "set_grid_item", mvPythonParser({
+ {mvPythonDataType::String, "data_grid"},
+ {mvPythonDataType::Integer, "row"},
+ {mvPythonDataType::Integer, "column"},
+ {mvPythonDataType::String, "value"},
+ }, "Sets a data grid's cell value.", "None", "Tables") });
+
+ parsers->insert({ "get_grid_selections", mvPythonParser({
+ {mvPythonDataType::String, "data_grid"}
+ }, "Retrieves data from storage.", "List[List[int]]", "Tables") });
+
+ parsers->insert({ "set_grid_selection", mvPythonParser({
+ {mvPythonDataType::String, "data_grid"},
+ {mvPythonDataType::Integer, "row"},
+ {mvPythonDataType::Integer, "column"},
+ {mvPythonDataType::Bool, "value"},
+ }, "Sets a data grid's cell selection value.", "None", "Tables") });
+ }
+
+ mvDataGrid::mvDataGrid(const std::string& name)
+ : mvAppItem(name)
+ {
+ m_height = 200;
+ m_hide_headers = false;
+ }
+
+ void mvDataGrid::setExtraConfigDict(PyObject* dict)
+ {
+ if (dict == nullptr)
+ return;
+
+ if (PyObject* item = PyDict_GetItemString(dict, "hide_headers")) m_hide_headers = ToBool(item);
+ if (PyObject* item = PyDict_GetItemString(dict, "headers"))
+ {
+ m_headers = ToStringVect(item);
+ m_columns = m_headers.size();
+ }
+ }
+
+ void mvDataGrid::getExtraConfigDict(PyObject* dict)
+ {
+ if (dict == nullptr)
+ return;
+
+ PyDict_SetItemString(dict, "hide_headers", ToPyBool(m_hide_headers));
+ }
+
+ bool mvDataGrid::isIndexValid(int row, int column) const
+ {
+ if (column < 0 || row < 0)
+ {
+ ThrowPythonException("Data Grid index must be a positive integer.");
+ return false;
+ }
+
+ if (static_cast(column) > m_columns + 1 || static_cast(row) > m_values.size() + 1)
+ {
+ ThrowPythonException("Data Grid indices out of range.");
+ return false;
+ }
+
+ return true;
+ }
+
+ void mvDataGrid::updateHashValues()
+ {
+ m_hashValues.clear();
+
+ m_hashValues = m_values;
+
+ for (size_t i = 0; i < m_hashValues.size(); i++)
+ {
+ for (size_t j = 0; j < m_hashValues[i].size(); j++)
+ m_hashValues[i][j] = m_hashValues[i][j] + "##" + m_name + "-" + std::to_string(i) + "-" + std::to_string(j);
+
+ for (size_t j = m_hashValues[i].size(); j < m_columns; j++)
+ m_hashValues[i].push_back("##" + m_name + "-" + std::to_string(i) + "-" + std::to_string(j));
+ }
+ }
+
+ void mvDataGrid::setGridItem(int row, int column, const std::string& value)
+ {
+ if (!isIndexValid(row, column))
+ return;
+
+ m_values[row][column] = value;
+ m_hashValues[row][column] = value + "##" + m_name + "-" + std::to_string(row) + "-" + std::to_string(column);
+
+ }
+
+ std::string mvDataGrid::getGridItem(int row, int column) const
+ {
+ if (!isIndexValid(row, column))
+ return "";
+
+ return m_values[row][column];
+ }
+
+ void mvDataGrid::setSelection(int row, int column, bool value)
+ {
+ if (!isIndexValid(row, column))
+ return;
+
+ m_selections[{row, column}] = value;
+ }
+
+ void mvDataGrid::setPyValue(PyObject* value)
+ {
+ auto values = ToVectVectString(value, m_name + " requires a list/tuple or list/tuple of strings.");
+
+ m_values = std::move(values);
+
+ if (!m_values.empty()) // just in case value is set to an empty list
+ {
+ while (m_headers.size() > m_columns)
+ m_headers.pop_back();
+ }
+
+ updateHashValues();
+
+ m_selections.clear();
+ }
+
+ PyObject* mvDataGrid::getPyValue()
+ {
+ return ToPyList(m_values);
+ }
+
+ PyObject* mvDataGrid::getSelections() const
+ {
+ int selectionCount = 0;
+
+ for (auto& item : m_selections)
+ if (item.second) selectionCount++;
+
+ std::vector> selections;
+
+ for (auto& item : m_selections)
+ {
+ if (item.second)
+ selections.emplace_back(item.first.first, item.first.second);
+ }
+
+ return ToPyList(selections);
+ }
+
+ void mvDataGrid::addHeaders(const std::vector& headers)
+ {
+ m_headers = headers;
+ m_columns = headers.size();
+
+ if (m_values.empty())
+ return;
+
+ if (m_columns > m_values[0].size())
+ {
+ for (auto& row : m_values)
+ row.emplace_back("");
+ }
+ else if (m_columns < m_values[0].size())
+ {
+ m_columns = m_values[0].size();
+ while (m_headers.size() < m_columns)
+ m_headers.emplace_back("Header");
+ }
+ updateHashValues();
+ }
+
+ void mvDataGrid::addRow(const std::vector& row)
+ {
+ m_values.push_back(row);
+
+ while (m_values.back().size() < m_headers.size())
+ m_values.back().emplace_back("");
+
+ while (m_values.back().size() > m_headers.size())
+ m_values.back().pop_back();
+
+ updateHashValues();
+ }
+
+ void mvDataGrid::addColumn(const std::string& name, const std::vector& column)
+ {
+ m_headers.push_back(name);
+
+ if (column.size() > m_values.size())
+ {
+ for (unsigned i = 0; i < column.size(); i++)
+ {
+ // row exists
+ if (i < m_values.size())
+ {
+ m_values[i].emplace_back(column[i]);
+ continue;
+ }
+
+ // row does not exist
+ m_values.push_back({});
+ for (unsigned j = 0; j < m_headers.size() - 1; j++)
+ m_values[i].emplace_back("");
+
+ m_values[i].emplace_back(column[i]);
+ }
+ }
+
+ else
+ {
+ size_t index = 0;
+ for (auto& row : m_values)
+ {
+ if (index >= column.size())
+ {
+ row.emplace_back("");
+ index++;
+ continue;
+
+ }
+
+ row.push_back(column[index]);
+ index++;
+ }
+ }
+
+ m_columns++;
+
+ updateHashValues();
+ }
+
+ void mvDataGrid::insertColumn(int column_index, const std::string& name, const std::vector& column)
+ {
+ if (!isIndexValid(0, column_index))
+ return;
+
+ if (static_cast(column_index) == m_headers.size())
+ {
+ addColumn(name, column);
+ return;
+ }
+
+ auto oldValues = m_values;
+ auto oldHeaders = m_headers;
+
+ m_values.clear();
+ m_headers.clear();
+ m_columns++;
+
+ for (size_t i = 0; i < m_columns; i++)
+ {
+ if (i < static_cast(column_index))
+ m_headers.push_back(oldHeaders[i]);
+ else if (i == static_cast(column_index))
+ m_headers.push_back(name);
+ else
+ m_headers.push_back(oldHeaders[i - 1]);
+ }
+
+ if (column.size() > oldValues.size())
+ {
+ for (size_t i = 0; i < column.size(); i++)
+ {
+ if (i < oldValues.size())
+ {
+ std::vector row;
+ for (size_t j = 0; j < oldHeaders.size(); j++)
+ {
+ if (j == static_cast(column_index))
+ {
+ row.push_back(column[i]);
+ continue;
+ }
+
+ if (j > static_cast(column_index))
+ row.push_back(oldValues[i][j - 1]);
+
+ else
+ row.push_back(oldValues[i][j]);
+
+ }
+ row.push_back(oldValues[i].back());
+
+ m_values.push_back(row);
+ }
+
+ else
+ {
+ std::vector row;
+ for (size_t j = 0; j < oldHeaders.size(); j++)
+ {
+ if (j == static_cast(column_index))
+ {
+ row.push_back(column[i]);
+ continue;
+ }
+ row.push_back("");
+ }
+ row.push_back("");
+
+ m_values.push_back(row);
+ }
+ }
+ }
+
+ else
+ {
+ for (size_t i = 0; i < oldValues.size(); i++)
+ {
+ std::vector row;
+ for (size_t j = 0; j < oldHeaders.size(); j++)
+ {
+ if (j == static_cast(column_index))
+ {
+ if (i >= column.size())
+ row.emplace_back("");
+ else
+ row.push_back(column[i]);
+ continue;
+ }
+
+ if (j > static_cast(column_index))
+ row.push_back(oldValues[i][j - 1]);
+
+ else
+ row.push_back(oldValues[i][j]);
+
+ }
+ row.push_back(oldValues[i].back());
+
+ m_values.push_back(row);
+ }
+ }
+
+ updateHashValues();
+
+ // update selections
+ std::map, bool> oldSelection = m_selections;
+ m_selections.clear();
+
+ for (auto& item : oldSelection)
+ {
+
+ if (item.first.second >= column_index)
+ m_selections[{item.first.first, item.first.second + 1}] = item.second;
+
+ else
+ m_selections[item.first] = item.second;
+
+ }
+
+ }
+
+ void mvDataGrid::insertRow(int row_index, const std::vector& row)
+ {
+ if (!isIndexValid(row_index, 0))
+ return;
+
+ if (static_cast(row_index) >= m_values.size())
+ {
+ addRow(row);
+ return;
+ }
+
+ auto oldValues = m_values;
+
+ m_values.clear();
+
+ for (size_t i = 0; i < oldValues.size(); i++)
+ {
+ if (i == static_cast(row_index))
+ {
+ m_values.push_back(row);
+ continue;
+ }
+
+ if(i > static_cast(row_index))
+ m_values.push_back(oldValues[i-1]);
+ else
+ m_values.push_back(oldValues[i]);
+ }
+ m_values.push_back(oldValues.back());
+
+ while (m_values[row_index].size() < m_headers.size())
+ m_values[row_index].emplace_back("");
+
+ while (m_values.back().size() > m_headers.size())
+ m_values.back().pop_back();
+
+ updateHashValues();
+
+ // update selections
+ std::map, bool> oldSelection = m_selections;
+ m_selections.clear();
+
+ for (auto& item : oldSelection)
+ {
+
+ if (item.first.first >= row_index)
+ m_selections[{item.first.first + 1, item.first.second}] = item.second;
+
+ else
+ m_selections[item.first] = item.second;
+
+ }
+
+ }
+
+ void mvDataGrid::deleteRow(int row)
+ {
+ if (!isIndexValid(row, 0))
+ return ;
+
+ auto oldValues = m_values;
+
+ m_values.clear();
+
+ int index = 0;
+ for (auto& item : oldValues)
+ {
+
+ if (index == row)
+ {
+ index++;
+ continue;
+ }
+ m_values.push_back(item);
+
+ index++;
+
+ }
+
+ updateHashValues();
+
+ // update selections
+ std::map, bool> oldSelection = m_selections;
+ m_selections.clear();
+
+ for (auto& item : oldSelection)
+ {
+ if (item.first.first == row)
+ continue;
+
+ else if (item.first.first < row)
+ m_selections[item.first] = item.second;
+
+
+ else if (item.first.first > row)
+ m_selections[{item.first.first - 1, item.first.second}] = item.second;
+ }
+
+ }
+
+ void mvDataGrid::deleteColumn(int column)
+ {
+ if (!isIndexValid(0, column))
+ return;
+
+ if (static_cast(column) >= m_headers.size())
+ {
+ ThrowPythonException("Column to delete does not exist.");
+ return;
+ }
+
+ auto oldValues = m_values;
+ auto oldHeaders = m_headers;
+
+ m_values.clear();
+ m_headers.clear();
+ m_columns--;
+
+ for (size_t i = 0; i < oldHeaders.size(); i++)
+ {
+ if (i == static_cast(column))
+ continue;
+ m_headers.push_back(oldHeaders[i]);
+ }
+
+ //for (int i = 0; i < oldValues.size(); i++)
+ for (auto& oldvalue : oldValues)
+ {
+ std::vector row;
+ for (size_t j = 0; j < oldHeaders.size(); j++)
+ {
+ if (j == static_cast(column))
+ continue;
+ row.push_back(oldvalue[j]);
+ }
+
+ m_values.push_back(row);
+ }
+
+ updateHashValues();
+
+ // update selections
+ std::map, bool> oldSelection = m_selections;
+ m_selections.clear();
+ for (auto& item : oldSelection)
+ {
+ if (item.first.second == column)
+ continue;
+
+ else if (item.first.second < column)
+ m_selections[item.first] = item.second;
+
+
+ else if (item.first.second > column)
+ m_selections[{item.first.first, item.first.second - 1}] = item.second;
+ }
+
+ }
+
+ void mvDataGrid::clearGrid()
+ {
+ m_selections.clear();
+ m_hashValues.clear();
+ m_values.clear();
+ }
+
+ void mvDataGrid::draw(ImDrawList* drawlist, float x, float y)
+ {
+ ScopedID id;
+ mvImGuiThemeScope scope(this);
+ mvFontScope fscope(this);
+
+ if (ImGui::BeginTable(m_name.c_str(), m_columns,
+ ImGuiTableFlags_Hideable | ImGuiTableFlags_Resizable | ImGuiTableFlags_RowBg | ImGuiTableFlags_Borders))
+ {
+ if (!m_hide_headers)
+ {
+ for (auto& header : m_headers)
+ ImGui::TableSetupColumn(header.c_str());
+ ImGui::TableHeadersRow();
+ //ImGui::TableNextColumn();
+ }
+
+ for (size_t i = 0; i < m_hashValues.size(); i++)
+ {
+ ImGui::TableNextRow();
+ for (size_t j = 0; j < m_hashValues[i].size(); j++)
+ {
+ ImGui::TableSetColumnIndex(j);
+ if (ImGui::Selectable(m_hashValues[i][j].c_str(), m_selections[{i, j}]))
+ {
+ m_selections[{i, j}] = !m_selections[{i, j}];
+ mvApp::GetApp()->getCallbackRegistry().addCallback(m_callback,
+ m_name, m_callback_data);
+ }
+ }
+
+ }
+
+ ImGui::EndTable();
+ }
+
+
+ }
+
+ PyObject* mvDataGrid::get_grid_data(PyObject* self, PyObject* args, PyObject* kwargs)
+ {
+ const char* grid;
+
+ if (!(mvApp::GetApp()->getParsers())["get_grid_data"].parse(args, kwargs, __FUNCTION__, &grid))
+ return GetPyNone();
+
+ std::lock_guard lk(mvApp::GetApp()->getMutex());
+ auto item = mvApp::GetApp()->getItemRegistry().getItem(std::string(grid));
+
+ if (item == nullptr)
+ {
+ std::string message = grid;
+ ThrowPythonException(message + " table does not exist.");
+ return GetPyNone();
+ }
+
+ if (item->getType() != mvAppItemType::mvDataGrid)
+ {
+ std::string message = grid;
+ ThrowPythonException(message + " is not a table.");
+ return GetPyNone();
+ }
+
+ return static_cast(item.get())->getPyValue();
+ }
+
+ PyObject* mvDataGrid::set_grid_data(PyObject* self, PyObject* args, PyObject* kwargs)
+ {
+ const char* grid;
+ PyObject* value;
+
+ if (!(mvApp::GetApp()->getParsers())["set_grid_data"].parse(args, kwargs, __FUNCTION__, &grid, &value))
+ return GetPyNone();
+
+ std::lock_guard lk(mvApp::GetApp()->getMutex());
+ auto item = mvApp::GetApp()->getItemRegistry().getItem(std::string(grid));
+
+ if (item == nullptr)
+ {
+ std::string message = grid;
+ ThrowPythonException(message + " grid does not exist.");
+ return GetPyNone();
+ }
+
+ if (item->getType() != mvAppItemType::mvDataGrid)
+ {
+ std::string message = grid;
+ ThrowPythonException(message + " is not a grid.");
+ return GetPyNone();
+ }
+
+ static_cast(item.get())->setPyValue(value);
+
+ return GetPyNone();
+ }
+
+ PyObject* mvDataGrid::set_grid_headers(PyObject* self, PyObject* args, PyObject* kwargs)
+ {
+ const char* grid;
+ PyObject* headers;
+
+ if (!(mvApp::GetApp()->getParsers())["set_grid_headers"].parse(args, kwargs, __FUNCTION__, &grid, &headers))
+ return GetPyNone();
+
+ std::lock_guard lk(mvApp::GetApp()->getMutex());
+ auto item = mvApp::GetApp()->getItemRegistry().getItem(grid);
+ if (item == nullptr)
+ {
+ std::string message = grid;
+ ThrowPythonException(message + " grid does not exist.");
+ return GetPyNone();
+ }
+
+ auto prow = ToStringVect(headers);
+ mvDataGrid* atable = static_cast(item.get());
+
+ atable->addHeaders(prow);
+
+ return GetPyNone();
+ }
+
+ PyObject* mvDataGrid::clear_data_grid(PyObject* self, PyObject* args, PyObject* kwargs)
+ {
+ const char* grid;
+
+ if (!(mvApp::GetApp()->getParsers())["clear_data_grid"].parse(args, kwargs, __FUNCTION__, &grid))
+ return GetPyNone();
+
+ std::lock_guard lk(mvApp::GetApp()->getMutex());
+ auto item = mvApp::GetApp()->getItemRegistry().getItem(grid);
+ if (item == nullptr)
+ {
+ std::string message = grid;
+ ThrowPythonException(message + " grid does not exist.");
+ return GetPyNone();
+ }
+
+ if (item->getType() != mvAppItemType::mvDataGrid)
+ {
+ std::string message = grid;
+ ThrowPythonException(message + " is not a grid.");
+ return GetPyNone();
+ }
+
+ mvDataGrid* atable = static_cast(item.get());
+ atable->clearGrid();
+ Py_RETURN_NONE;
+ }
+
+ PyObject* mvDataGrid::get_grid_item(PyObject* self, PyObject* args, PyObject* kwargs)
+ {
+ const char* grid;
+ int row;
+ int column;
+
+ if (!(mvApp::GetApp()->getParsers())["get_grid_item"].parse(args, kwargs, __FUNCTION__, &grid, &row,
+ &column))
+ return GetPyNone();
+
+ std::lock_guard lk(mvApp::GetApp()->getMutex());
+ auto item = mvApp::GetApp()->getItemRegistry().getItem(grid);
+ if (item == nullptr)
+ {
+ std::string message = grid;
+ ThrowPythonException(message + " grid does not exist.");
+ return GetPyNone();
+ }
+
+ if (item->getType() != mvAppItemType::mvDataGrid)
+ {
+ std::string message = grid;
+ ThrowPythonException(message + " is not a grid.");
+ return GetPyNone();
+ }
+
+ mvDataGrid* atable = static_cast(item.get());
+ return Py_BuildValue("s", atable->getGridItem(row, column).c_str());
+
+ }
+
+ PyObject* mvDataGrid::set_grid_item(PyObject* self, PyObject* args, PyObject* kwargs)
+ {
+ const char* grid;
+ int row;
+ int column;
+ const char* value;
+
+ if (!(mvApp::GetApp()->getParsers())["set_grid_item"].parse(args, kwargs, __FUNCTION__, &grid, &row,
+ &column, &value))
+ return GetPyNone();
+
+ std::lock_guard lk(mvApp::GetApp()->getMutex());
+ auto item = mvApp::GetApp()->getItemRegistry().getItem(grid);
+ if (item == nullptr)
+ {
+ std::string message = grid;
+ ThrowPythonException(message + " grid does not exist.");
+ return GetPyNone();
+ }
+
+ if (item->getType() != mvAppItemType::mvDataGrid)
+ {
+ std::string message = grid;
+ ThrowPythonException(message + " is not a grid.");
+ return GetPyNone();
+ }
+
+ mvDataGrid* atable = static_cast(item.get());
+ atable->setGridItem(row, column, value);
+
+ return GetPyNone();
+ }
+
+ PyObject* mvDataGrid::get_grid_selections(PyObject* self, PyObject* args, PyObject* kwargs)
+ {
+ const char* grid;
+
+ if (!(mvApp::GetApp()->getParsers())["get_grid_selections"].parse(args, kwargs, __FUNCTION__, &grid))
+ return GetPyNone();
+
+ std::lock_guard lk(mvApp::GetApp()->getMutex());
+ auto item = mvApp::GetApp()->getItemRegistry().getItem(grid);
+ if (item == nullptr)
+ {
+ std::string message = grid;
+ ThrowPythonException(message + " grid does not exist.");
+ return GetPyNone();
+ }
+
+ if (item->getType() != mvAppItemType::mvDataGrid)
+ {
+ std::string message = grid;
+ ThrowPythonException(message + " is not a grid.");
+ return GetPyNone();
+ }
+
+ mvDataGrid* atable = static_cast(item.get());
+ return atable->getSelections();
+ }
+
+ PyObject* mvDataGrid::set_grid_selection(PyObject* self, PyObject* args, PyObject* kwargs)
+ {
+ const char* grid;
+ int row;
+ int column;
+ int value;
+
+ if (!(mvApp::GetApp()->getParsers())["set_grid_selection"].parse(args, kwargs, __FUNCTION__, &grid, &row,
+ &column, &value))
+ return GetPyNone();
+
+ std::lock_guard lk(mvApp::GetApp()->getMutex());
+ auto item = mvApp::GetApp()->getItemRegistry().getItem(grid);
+ if (item == nullptr)
+ {
+ std::string message = grid;
+ ThrowPythonException(message + " grid does not exist.");
+ return GetPyNone();
+ }
+
+ if (item->getType() != mvAppItemType::mvDataGrid)
+ {
+ std::string message = grid;
+ ThrowPythonException(message + " is not a grid.");
+ return GetPyNone();
+ }
+
+ mvDataGrid* atable = static_cast(item.get());
+ atable->setSelection(row, column, value);
+
+ return GetPyNone();
+ }
+
+ PyObject* mvDataGrid::add_grid_column(PyObject* self, PyObject* args, PyObject* kwargs)
+ {
+ const char* grid;
+ const char* name;
+ PyObject* column;
+
+ if (!(mvApp::GetApp()->getParsers())["add_grid_column"].parse(args, kwargs, __FUNCTION__, &grid, &name, &column))
+ return GetPyNone();
+
+ std::lock_guard lk(mvApp::GetApp()->getMutex());
+ auto item = mvApp::GetApp()->getItemRegistry().getItem(grid);
+ if (item == nullptr)
+ {
+ std::string message = grid;
+ ThrowPythonException(message + " table does not exist.");
+ return GetPyNone();
+ }
+
+ if (item->getType() != mvAppItemType::mvDataGrid)
+ {
+ std::string message = grid;
+ ThrowPythonException(message + " is not a table.");
+ return GetPyNone();
+ }
+
+ auto pcolumn = ToStringVect(column);
+
+ mvDataGrid* atable = static_cast(item.get());
+ atable->addColumn(name, pcolumn);
+
+ return GetPyNone();
+ }
+
+ PyObject* mvDataGrid::insert_grid_column(PyObject* self, PyObject* args, PyObject* kwargs)
+ {
+ const char* grid;
+ int column_index;
+ const char* name;
+ PyObject* column;
+
+ if (!(mvApp::GetApp()->getParsers())["insert_grid_column"].parse(args, kwargs, __FUNCTION__, &grid, &column_index, &name, &column))
+ return GetPyNone();
+
+ std::lock_guard lk(mvApp::GetApp()->getMutex());
+ auto item = mvApp::GetApp()->getItemRegistry().getItem(grid);
+ if (item == nullptr)
+ {
+ std::string message = grid;
+ ThrowPythonException(message + " grid does not exist.");
+ return GetPyNone();
+ }
+
+ if (item->getType() != mvAppItemType::mvDataGrid)
+ {
+ std::string message = grid;
+ ThrowPythonException(message + " is not a grid.");
+ return GetPyNone();
+ }
+
+ auto prow = ToStringVect(column);
+
+ mvDataGrid* atable = static_cast(item.get());
+ atable->insertColumn(column_index, name, prow);
+
+ return GetPyNone();
+ }
+
+ PyObject* mvDataGrid::delete_grid_column(PyObject* self, PyObject* args, PyObject* kwargs)
+ {
+ const char* grid;
+ int column;
+
+ if (!(mvApp::GetApp()->getParsers())["delete_grid_column"].parse(args, kwargs, __FUNCTION__, &grid, &column))
+ return GetPyNone();
+
+ std::lock_guard lk(mvApp::GetApp()->getMutex());
+ auto item = mvApp::GetApp()->getItemRegistry().getItem(grid);
+ if (item == nullptr)
+ {
+ std::string message = grid;
+ ThrowPythonException(message + " grid does not exist.");
+ return GetPyNone();
+ }
+
+ if (item->getType() != mvAppItemType::mvDataGrid)
+ {
+ std::string message = grid;
+ ThrowPythonException(message + " is not a grid.");
+ return GetPyNone();
+ }
+
+ mvDataGrid* atable = static_cast(item.get());
+ atable->deleteColumn(column);
+
+ return GetPyNone();
+ }
+
+ PyObject* mvDataGrid::add_grid_row(PyObject* self, PyObject* args, PyObject* kwargs)
+ {
+ const char* grid;
+ PyObject* row;
+
+ if (!(mvApp::GetApp()->getParsers())["add_grid_row"].parse(args, kwargs, __FUNCTION__, &grid, &row))
+ return GetPyNone();
+
+ std::lock_guard lk(mvApp::GetApp()->getMutex());
+ auto item = mvApp::GetApp()->getItemRegistry().getItem(grid);
+ if (item == nullptr)
+ {
+ std::string message = grid;
+ ThrowPythonException(message + " grid does not exist.");
+ return GetPyNone();
+ }
+
+ if (item->getType() != mvAppItemType::mvDataGrid)
+ {
+ std::string message = grid;
+ ThrowPythonException(message + " is not a grid.");
+ return GetPyNone();
+ }
+
+ auto prow = ToStringVect(row);
+ mvDataGrid* atable = static_cast(item.get());
+ if (atable->getColumnCount() == 0)
+ {
+ std::vector headers;
+ for (size_t i = 0; i < prow.size(); i++)
+ headers.emplace_back("Header" + std::to_string(i));
+ atable->addHeaders(headers);
+ }
+ atable->addRow(prow);
+
+ return GetPyNone();
+ }
+
+ PyObject* mvDataGrid::insert_grid_row(PyObject* self, PyObject* args, PyObject* kwargs)
+ {
+ const char* grid;
+ int row_index;
+ PyObject* row;
+
+ if (!(mvApp::GetApp()->getParsers())["insert_grid_row"].parse(args, kwargs, __FUNCTION__, &grid, &row_index, &row))
+ return GetPyNone();
+
+ std::lock_guard lk(mvApp::GetApp()->getMutex());
+ auto item = mvApp::GetApp()->getItemRegistry().getItem(grid);
+ if (item == nullptr)
+ {
+ std::string message = grid;
+ ThrowPythonException(message + " grid does not exist.");
+ return GetPyNone();
+ }
+
+ if (item->getType() != mvAppItemType::mvDataGrid)
+ {
+ std::string message = grid;
+ ThrowPythonException(message + " is not a grid.");
+ return GetPyNone();
+ }
+
+ auto prow = ToStringVect(row);
+ mvDataGrid* atable = static_cast(item.get());
+ if (atable->getColumnCount() == 0)
+ {
+ std::vector headers;
+ for (size_t i = 0; i < prow.size(); i++)
+ headers.emplace_back("Header" + std::to_string(i));
+ atable->addHeaders(headers);
+ }
+ atable->insertRow(row_index, prow);
+
+ return GetPyNone();
+ }
+
+ PyObject* mvDataGrid::delete_grid_row(PyObject* self, PyObject* args, PyObject* kwargs)
+ {
+ const char* grid;
+ int row;
+
+ if (!(mvApp::GetApp()->getParsers())["delete_grid_row"].parse(args, kwargs, __FUNCTION__, &grid, &row))
+ return GetPyNone();
+
+ std::lock_guard lk(mvApp::GetApp()->getMutex());
+ auto item = mvApp::GetApp()->getItemRegistry().getItem(grid);
+ if (item == nullptr)
+ {
+ std::string message = grid;
+ ThrowPythonException(message + " grid does not exist.");
+ return GetPyNone();
+ }
+
+ if (item->getType() != mvAppItemType::mvDataGrid)
+ {
+ std::string message = grid;
+ ThrowPythonException(message + " is not a grid.");
+ return GetPyNone();
+ }
+
+ mvDataGrid* atable = static_cast(item.get());
+ atable->deleteRow(row);
+
+ return GetPyNone();
+ }
+
+}
diff --git a/DearPyGui/src/core/AppItems/composite/mvDataGrid.h b/DearPyGui/src/core/AppItems/composite/mvDataGrid.h
new file mode 100644
index 000000000..f5a5cec8d
--- /dev/null
+++ b/DearPyGui/src/core/AppItems/composite/mvDataGrid.h
@@ -0,0 +1,141 @@
+#pragma once
+
+#include "mvAppItem.h"
+#include "mvApp.h"
+#include "mvAppLog.h"
+#include "mvItemRegistry.h"
+
+namespace Marvel {
+
+ MV_REGISTER_WIDGET(mvDataGrid, MV_ITEM_DESC_DEFAULT, StorageValueTypes::None, 1);
+ class mvDataGrid : public mvAppItem
+ {
+
+ public:
+
+ static void InsertParser(std::map* parsers);
+
+ MV_APPLY_WIDGET_REGISTRATION(mvAppItemType::mvDataGrid, add_data_grid)
+
+ MV_CREATE_EXTRA_COMMAND(set_grid_headers);
+ MV_CREATE_EXTRA_COMMAND(set_grid_data);
+ MV_CREATE_EXTRA_COMMAND(get_grid_data);
+ MV_CREATE_EXTRA_COMMAND(clear_data_grid);
+ MV_CREATE_EXTRA_COMMAND(get_grid_item);
+ MV_CREATE_EXTRA_COMMAND(set_grid_item);
+ MV_CREATE_EXTRA_COMMAND(get_grid_selections);
+ MV_CREATE_EXTRA_COMMAND(set_grid_selection);
+ MV_CREATE_EXTRA_COMMAND(add_grid_column);
+ MV_CREATE_EXTRA_COMMAND(insert_grid_column);
+ MV_CREATE_EXTRA_COMMAND(delete_grid_column);
+ MV_CREATE_EXTRA_COMMAND(add_grid_row);
+ MV_CREATE_EXTRA_COMMAND(insert_grid_row);
+ MV_CREATE_EXTRA_COMMAND(delete_grid_row);
+
+ MV_CREATE_CONSTANT(mvThemeCol_DataGrid_Text , ImGuiCol_Text , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_DataGrid_HeaderBg , ImGuiCol_TableHeaderBg , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_DataGrid_RowBg , ImGuiCol_TableRowBg , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_DataGrid_RowBgAlt , ImGuiCol_TableRowBgAlt , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_DataGrid_Item , ImGuiCol_Header , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_DataGrid_ItemHovered , ImGuiCol_HeaderHovered , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_DataGrid_ItemActive , ImGuiCol_HeaderActive , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_DataGrid_BorderStrong , ImGuiCol_TableBorderStrong , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_DataGrid_BorderLight , ImGuiCol_TableBorderLight , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_DataGrid_BorderHovered , ImGuiCol_SeparatorHovered , 0L);
+ MV_CREATE_CONSTANT(mvThemeCol_DataGrid_BorderActive , ImGuiCol_SeparatorActive , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_DataGrid_CellPaddingX , ImGuiStyleVar_CellPadding , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_DataGrid_CellPaddingY , ImGuiStyleVar_CellPadding , 1L);
+ MV_CREATE_CONSTANT(mvThemeStyle_DataGrid_ItemSpacingX , ImGuiStyleVar_ItemSpacing , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_DataGrid_ItemSpacingY , ImGuiStyleVar_ItemSpacing , 1L);
+ MV_CREATE_CONSTANT(mvThemeStyle_DataGrid_ItemTextAlignX , ImGuiStyleVar_SelectableTextAlign , 0L);
+ MV_CREATE_CONSTANT(mvThemeStyle_DataGrid_ItemTextAlignY , ImGuiStyleVar_SelectableTextAlign , 1L);
+
+ MV_START_EXTRA_COMMANDS
+ MV_ADD_EXTRA_COMMAND(set_grid_headers);
+ MV_ADD_EXTRA_COMMAND(set_grid_data);
+ MV_ADD_EXTRA_COMMAND(get_grid_data);
+ MV_ADD_EXTRA_COMMAND(clear_data_grid);
+ MV_ADD_EXTRA_COMMAND(get_grid_item);
+ MV_ADD_EXTRA_COMMAND(set_grid_item);
+ MV_ADD_EXTRA_COMMAND(get_grid_selections);
+ MV_ADD_EXTRA_COMMAND(set_grid_selection);
+ MV_ADD_EXTRA_COMMAND(add_grid_column);
+ MV_ADD_EXTRA_COMMAND(insert_grid_column);
+ MV_ADD_EXTRA_COMMAND(delete_grid_column);
+ MV_ADD_EXTRA_COMMAND(add_grid_row);
+ MV_ADD_EXTRA_COMMAND(insert_grid_row);
+ MV_ADD_EXTRA_COMMAND(delete_grid_row);
+ MV_END_EXTRA_COMMANDS
+
+ MV_START_GENERAL_CONSTANTS
+ MV_END_GENERAL_CONSTANTS
+
+ MV_START_COLOR_CONSTANTS
+ MV_CREATE_CONSTANT_PAIR(mvThemeCol_DataGrid_Text, mvColor(255, 255, 255, 255)),
+ MV_CREATE_CONSTANT_PAIR(mvThemeCol_DataGrid_HeaderBg, mvColor( 48, 48, 51, 255)),
+ MV_CREATE_CONSTANT_PAIR(mvThemeCol_DataGrid_RowBg, mvColor( 0, 0, 0, 0)),
+ MV_CREATE_CONSTANT_PAIR(mvThemeCol_DataGrid_RowBgAlt, mvColor(255, 255, 255, 15)),
+ MV_CREATE_CONSTANT_PAIR(mvThemeCol_DataGrid_Item, mvColor( 66, 150, 250, 79)),
+ MV_CREATE_CONSTANT_PAIR(mvThemeCol_DataGrid_ItemHovered, mvColor( 66, 150, 250, 255)),
+ MV_CREATE_CONSTANT_PAIR(mvThemeCol_DataGrid_ItemActive, mvColor( 15, 135, 250, 255)),
+ MV_CREATE_CONSTANT_PAIR(mvThemeCol_DataGrid_BorderStrong, mvColor( 79, 79, 89, 255)),
+ MV_CREATE_CONSTANT_PAIR(mvThemeCol_DataGrid_BorderLight, mvColor( 59, 59, 64, 255)),
+ MV_CREATE_CONSTANT_PAIR(mvThemeCol_DataGrid_BorderHovered, mvColor( 26, 102, 191, 199)),
+ MV_CREATE_CONSTANT_PAIR(mvThemeCol_DataGrid_BorderActive, mvColor( 26, 102, 191, 255)),
+ MV_END_COLOR_CONSTANTS
+
+ MV_START_STYLE_CONSTANTS
+ MV_ADD_CONSTANT(mvThemeStyle_DataGrid_CellPaddingX , 4, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_DataGrid_CellPaddingY , 2, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_DataGrid_ItemSpacingX , 8, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_DataGrid_ItemSpacingY , 4, 20),
+ MV_ADD_CONSTANT(mvThemeStyle_DataGrid_ItemTextAlignX , 0, 1),
+ MV_ADD_CONSTANT(mvThemeStyle_DataGrid_ItemTextAlignY , 0, 1),
+ MV_END_STYLE_CONSTANTS
+
+ public:
+
+ mvDataGrid(const std::string& name);
+
+ // table operations
+ void setGridItem (int row, int column, const std::string& value);
+ void setSelection (int row, int column, bool value);
+ void addHeaders (const std::vector& headers);
+ void addRow (const std::vector& row);
+ void insertRow (int row_index, const std::vector& row);
+ void deleteRow (int row);
+ void addColumn (const std::string& name, const std::vector& column);
+ void insertColumn (int column_index, const std::string& name, const std::vector& column);
+ void deleteColumn (int column);
+ void clearGrid ();
+ int getColumnCount() const { return (int)m_columns; }
+ void setExtraConfigDict(PyObject* dict) override;
+ void getExtraConfigDict(PyObject* dict) override;
+
+ [[nodiscard]] std::string getGridItem (int row, int column) const;
+ [[nodiscard]] PyObject* getSelections() const;
+
+ void setPyValue(PyObject* value) override;
+ [[nodiscard]] PyObject* getPyValue() override;
+ void draw(ImDrawList* drawlist, float x, float y) override;
+
+ private:
+
+ [[nodiscard]] bool isIndexValid(int row, int column) const;
+ void updateHashValues();
+
+ private:
+
+ std::map, bool> m_selections;
+ std::vector m_headers;
+ std::vector> m_hashValues;
+ std::vector> m_values;
+ size_t m_columns;
+ bool m_hide_headers;
+
+ // new table api items
+ ImGuiTableFlags m_flags = 0;
+
+ };
+
+}
diff --git a/DearPyGui/src/core/AppItems/composite/mvDebugWindow.cpp b/DearPyGui/src/core/AppItems/composite/mvDebugWindow.cpp
new file mode 100644
index 000000000..e28cb636e
--- /dev/null
+++ b/DearPyGui/src/core/AppItems/composite/mvDebugWindow.cpp
@@ -0,0 +1,362 @@
+#include "mvDebugWindow.h"
+#include "mvEvents.h"
+#include