Skip to content

Commit

Permalink
core: remove DearPyGui_Ext submodule and update standard Axis colors
Browse files Browse the repository at this point in the history
  • Loading branch information
SamuMazzi authored and hoffstadt committed Sep 17, 2024
1 parent 79c03ce commit 290cc36
Show file tree
Hide file tree
Showing 27 changed files with 985 additions and 4 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,3 @@
[submodule "thirdparty/freetype"]
path = thirdparty/freetype
url = https://gitlab.freedesktop.org/freetype/freetype
[submodule "thirdparty/DearPyGui_Ext"]
path = thirdparty/DearPyGui_Ext
url = https://github.com/hoffstadt/DearPyGui_Ext
1 change: 0 additions & 1 deletion thirdparty/DearPyGui_Ext
Submodule DearPyGui_Ext deleted from e21b2a
21 changes: 21 additions & 0 deletions thirdparty/DearPyGui_Ext/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021 Raylock, LLC

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
85 changes: 85 additions & 0 deletions thirdparty/DearPyGui_Ext/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
<a id="user-content-dear-pygui" class="anchor" aria-hidden="true" href="#dear-pygui">

<div align="center">
<img src="https://github.com/hoffstadt/DearPyGui/blob/assets/newlogo.jpg?raw=true" alt="Dear PyGui">
</div>

</a>

<h6 align="center">(This library is available under a free and permissive license however, if you Enjoy <i>Dear PyGui</i> please consider becoming a <a href="https://github.com/hoffstadt/DearPyGui/wiki/Sponsors">Sponsor</a>)</h6>

![Python Version](https://img.shields.io/pypi/pyversions/dearpygui-ext)
[![PYPI](https://img.shields.io/pypi/v/dearpygui-ext)](https://pypi.org/project/dearpygui-ext/)
[![Build](https://github.com/hoffstadt/DearPyGui_Ext/actions/workflows/BuildPackage.yml/badge.svg)](https://github.com/hoffstadt/DearPyGui_Ext/actions/workflows/BuildPackage.yml)
[![Documentation Status](https://readthedocs.org/projects/dearpygui-ext/badge/?version=latest)](https://dearpygui-ext.readthedocs.io/en/latest/?badge=latest)

**Dear PyGui Extensions** is a collection of useful tools, abstractions, and simplification layers built with/for _Dear PyGui_ users.

## Installation

Ensure you have at least Python 3.6 64bit and _dearpygui_.
```
pip install dearpygui_ext
or
pip3 install dearpygui_ext
```

## Resources

[![Chat on Discord](https://img.shields.io/discord/736279277242417272?logo=discord)](https://discord.gg/tyE7Gu4)
[![Reddit](https://img.shields.io/reddit/subreddit-subscribers/dearpygui?label=r%2Fdearpygui)](https://www.reddit.com/r/DearPyGui/)

- [Documentation](https://github.com/hoffstadt/DearPyGui/wiki) comprehensive documentaion, tutorials, and examples.
- [Feature Tracker](https://github.com/hoffstadt/DearPyGui/projects/5) all proposed new features.
- [Bug Tracker](https://github.com/hoffstadt/DearPyGui/projects/1) current bugs and issues.

## Support

If you are having issues or want to help, here are some places you can go:
- [Github Discussions](https://github.com/hoffstadt/DearPyGui_Ext/discussions/)
- [Discord Forum](https://discord.gg/tyE7Gu4)
- [Reddit](https://www.reddit.com/r/DearPyGui/)

## Sponsors

![GitHub Sponsors](https://img.shields.io/github/sponsors/hoffstadt?label=Github%20Sponsors)
![Open Collective](https://img.shields.io/opencollective/sponsors/dearpygui?label=Open%20Collective%20Sponsors)

If you enjoy _Dear PyGui_ and _Dear PyGui Extensions_ please consider becoming a [sponsor](https://github.com/hoffstadt/DearPyGui/wiki/Sponsors).

Ongoing _Dear PyGui_ development is financially supported by users and private sponsors.

These include:
* 🏢 [Anthony Tanbakuchi](https://github.com/kuchi) _Corporate Sponsor_
* 🏆 [Dean Keinan](https://github.com/deankeinan) _Partner Sponsor_
* 🏆 [何凌锋](https://github.com/Hedaozi) _Partner Sponsor_
* 🏆 [Anthony Doupe](https://github.com/Atlamillias) _Partner Sponsor_
* 🏆 [Ray Heasman](https://github.com/rheasman) _Partner Sponsor_
* 🏆 [Marco Studer](https://github.com/Mstpyt) _Partner Sponsor_
* 🏆 [Scripts](https://github.com/scriptslol) _Partner Sponsor_
* 🥇 [Caden Bloxham](https://github.com/cbxm) _Gold Sponsor_
* 🥇 [Yan Zaretskiy](https://github.com/mindv0rtex) _Gold Sponsor_
* 🥇 [Leron Gray](https://github.com/daddycocoaman) _Gold Sponsor_
* 🥇 [Trinnik](https://github.com/Trinnik) _Gold Sponsor_
* 🥇 [Barney Mannerings](https://github.com/barnabee) _Gold Sponsor_
* 🥇 [RB Blackstone](https://github.com/RBBlackstone) _Gold Sponsor_
* 🥇 [Charles Ray](https://github.com/ray-5050) _Gold Sponsor_


Thank you to all other [sponsors](https://github.com/hoffstadt/DearPyGui/wiki/Sponsors) for keeping this project moving forward!

<a href="https://www.buymeacoffee.com/DearPyGui"><img src="https://img.buymeacoffee.com/button-api/?text=Buy us a coffee&emoji=&slug=DearPyGui&button_colour=FFDD00&font_colour=000000&font_family=Cookie&outline_colour=000000&coffee_colour=ffffff"></a>

## Credits

Developed by [Jonathan Hoffstadt](https://github.com/hoffstadt), [Preston Cothren](https://github.com/Pcothren), and every direct or indirect contributor.

[Omar Cornut](http://www.miracleworld.net/) for all his incredible work on [Dear ImGui](https://github.com/ocornut/imgui).

[Evan Pezent](http://evanpezent.com/) for all his work on [ImPlot](https://github.com/epezent/implot).

[Johann Muszynski](https://github.com/Nelarius) for all of his work on [imnodes](https://github.com/Nelarius/imnodes).

## License

_Dear PyGui_ and _Dear PyGui Extensions_ are licensed under the [MIT License](https://github.com/hoffstadt/DearPyGui_Ext/blob/master/LICENSE).
7 changes: 7 additions & 0 deletions thirdparty/DearPyGui_Ext/Resources/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
*
!*.ttf
!*.otf
!.gitignore
!*.py
!*.png
!*.ico
Binary file not shown.
Binary file added thirdparty/DearPyGui_Ext/Resources/Retron2000.ttf
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions thirdparty/DearPyGui_Ext/dearpygui_ext/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__pycache__/
1 change: 1 addition & 0 deletions thirdparty/DearPyGui_Ext/dearpygui_ext/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pass
109 changes: 109 additions & 0 deletions thirdparty/DearPyGui_Ext/dearpygui_ext/logger.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
import dearpygui.dearpygui as dpg

class mvLogger:

def __init__(self, parent=None):

self.log_level = 0
self._auto_scroll = True
self.filter_id = None
if parent:
self.window_id = parent
else:
self.window_id = dpg.add_window(label="mvLogger", pos=(200, 200), width=500, height=500)
self.count = 0
self.flush_count = 1000

with dpg.group(horizontal=True, parent=self.window_id):
dpg.add_checkbox(label="Auto-scroll", default_value=True, callback=lambda sender:self.auto_scroll(dpg.get_value(sender)))
dpg.add_button(label="Clear", callback=lambda: dpg.delete_item(self.filter_id, children_only=True))

dpg.add_input_text(label="Filter", callback=lambda sender: dpg.set_value(self.filter_id, dpg.get_value(sender)),
parent=self.window_id)
self.child_id = dpg.add_child_window(parent=self.window_id, autosize_x=True, autosize_y=True)
self.filter_id = dpg.add_filter_set(parent=self.child_id)

with dpg.theme() as self.trace_theme:
with dpg.theme_component(0):
dpg.add_theme_color(dpg.mvThemeCol_Text, (0, 255, 0, 255))

with dpg.theme() as self.debug_theme:
with dpg.theme_component(0):
dpg.add_theme_color(dpg.mvThemeCol_Text, (64, 128, 255, 255))

with dpg.theme() as self.info_theme:
with dpg.theme_component(0):
dpg.add_theme_color(dpg.mvThemeCol_Text, (255, 255, 255, 255))

with dpg.theme() as self.warning_theme:
with dpg.theme_component(0):
dpg.add_theme_color(dpg.mvThemeCol_Text, (255, 255, 0, 255))

with dpg.theme() as self.error_theme:
with dpg.theme_component(0):
dpg.add_theme_color(dpg.mvThemeCol_Text, (255, 0, 0, 255))

with dpg.theme() as self.critical_theme:
with dpg.theme_component(0):
dpg.add_theme_color(dpg.mvThemeCol_Text, (255, 0, 0, 255))

def auto_scroll(self, value):
self._auto_scroll = value

def _log(self, message, level):

if level < self.log_level:
return

self.count+=1

if self.count > self.flush_count:
self.clear_log()

theme = self.info_theme

if level == 0:
message = "[TRACE]\t\t" + message
theme = self.trace_theme
elif level == 1:
message = "[DEBUG]\t\t" + message
theme = self.debug_theme
elif level == 2:
message = "[INFO]\t\t" + message
elif level == 3:
message = "[WARNING]\t\t" + message
theme = self.warning_theme
elif level == 4:
message = "[ERROR]\t\t" + message
theme = self.error_theme
elif level == 5:
message = "[CRITICAL]\t\t" + message
theme = self.critical_theme

new_log = dpg.add_text(message, parent=self.filter_id, filter_key=message)
dpg.bind_item_theme(new_log, theme)
if self._auto_scroll:
scroll_max = dpg.get_y_scroll_max(self.child_id)
dpg.set_y_scroll(self.child_id, -1.0)

def log(self, message):
self._log(message, 0)

def log_debug(self, message):
self._log(message, 1)

def log_info(self, message):
self._log(message, 2)

def log_warning(self, message):
self._log(message, 3)

def log_error(self, message):
self._log(message, 4)

def log_critical(self, message):
self._log(message, 5)

def clear_log(self):
dpg.delete_item(self.filter_id, children_only=True)
self.count = 0
Loading

0 comments on commit 290cc36

Please sign in to comment.