Giter VIP home page Giter VIP logo

directguidesigner's People

Contributors

augustifolia avatar fireclawthefox avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

directguidesigner's Issues

Fails to build for manylinux

ERROR: Could not find a version that satisfies the requirement panda3d (from versions: none)
ERROR: No matching distribution found for panda3d

Traceback (most recent call last):
  File "D:\Github\DirectGuiDesigner\setup.py", line 10, in <module>
    setup(
  File "C:\Users\Michael\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\__init__.py", line 153, in setup
    return distutils.core.setup(**attrs)
  File "C:\Users\Michael\AppData\Local\Programs\Python\Python310\lib\distutils\core.py", line 148, in setup
    dist.run_commands()
  File "C:\Users\Michael\AppData\Local\Programs\Python\Python310\lib\distutils\dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "C:\Users\Michael\AppData\Local\Programs\Python\Python310\lib\distutils\dist.py", line 985, in run_command
    cmd_obj.run()
  File "C:\Users\Michael\AppData\Local\Programs\Python\Python310\lib\site-packages\direct\dist\commands.py", line 436, in run
    self.build_runtimes(platform, True)
  File "C:\Users\Michael\AppData\Local\Programs\Python\Python310\lib\site-packages\direct\dist\commands.py", line 596, in build_runtimes
    wheelpaths = self.download_wheels(platform)
  File "C:\Users\Michael\AppData\Local\Programs\Python\Python310\lib\site-packages\direct\dist\commands.py", line 499, in download_wheels
    subprocess.check_call([sys.executable, '-m', 'pip'] + pip_args)
  File "C:\Users\Michael\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 369, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['C:\\Users\\Michael\\AppData\\Local\\Programs\\Python\\Python310\\python.exe', '-m', 'pip', '--disable-pip-version-check', 'download', '-d', 'D:\\Github\\DirectGuiDesigner\\build\\__whl_cache__\\manylinux1_x86_64_cp310', '-r', 'D:\\Github\\DirectGuiDesigner\\requirements.txt', '--only-binary', ':all:', '--abi', 'cp310', '--platform', 'manylinux1_x86_64', '--extra-index-url', 'https://archive.panda3d.org/simple/opt', '--extra-index-url', 'https://archive.panda3d.org/thirdparty']' returned non-zero exit status 1.

Crash when entering invalid path to a path property

Hi again, I have found a few more bugs.

When entering an invalid path to a path property (for example image or geom) the program crashes. This is because of the line updateElement[updateAttribute] = None, where updateElement and updateAttribute are undefined (this is in the method __createPathProperty). Replacing it with elementInfo.element[definition.internalName] = None fixes that issue.

I also noticed that if you first enter a valid path and then enter an invalid one the image is removed from the first state but still there for all other states. But if you first set the property to something else (for example None) before restoring the old value the old image is set for all states.
Something like this (added in the exception clause of the setValue method of the propertyHelper):

                if definition.nullable:
                    elementInfo.element[propName] = None
                elementInfo.element[propName] = oldValue

This feels a bit hacky, but I haven't found a better solution. This also requires the image and geom properties to be marked as nullable, which seems reasonable to me.

Unknown options when making an OkCancelDialog

Hello, I've started using your GUI editor and it's amazing, well done!

Just a potential bug that I may have discovered, when creating an Ok/Cancel dialog and exporting it into Python code, I get this error:
KeyError: 'Unknown options "Button_borderWidth, Button_frameSize, Button_hpr, Button_pad, Button_pos, Button_text" for OkCancelDialog'.

Looking at the code, I have noticed that there are parameters for both Button and Button0, I didn't get errors for Button0 and I seem to have fixed this by replacing all Buttons with Button1. Here is the full working code for my modified code:

class GUI:
    def __init__(self, rootParent=None):
        
        self.pg125 = OkCancelDialog(
            frameSize=(-0.3324999973643571, 0.3324999973643571, -0.34249999769032, 0.19224999830126763),
            hpr=LVecBase3f(0, 0, 0),
            pos=LPoint3f(0, 0.1, 0.025),
            state='normal',
            text='Ok/Cancel Dialog',
            Button1_borderWidth=(0.01, 0.01),
            Button1_frameSize=(-0.09699999749660491, 0.10150000661611557, -0.016750000640749933, 0.05349999874830246),
            Button1_hpr=LVecBase3f(0, 0, 0),
            Button1_pad=(0.01, 0.01),
            Button1_pos=LPoint3f(-0.109175, 0, -0.21575),
            Button1_text='Cancel',
            Button0_text_align=TextNode.A_center,
            Button0_text_scale=(0.06, 0.06),
            Button0_text_pos=(0, 0),
            Button0_text_fg=LVecBase4f(0, 0, 0, 1),
            Button0_text_bg=LVecBase4f(0, 0, 0, 0),
            Button0_text='Ok',
            text_align=TextNode.A_left,
            text_scale=(0.06, 0.06),
            text_pos=(-0.23549999739043415, -0.012749999761581421),
            text_fg=LVecBase4f(0, 0, 0, 1),
            text_bg=LVecBase4f(0, 0, 0, 0),
            parent=rootParent,
        )
        self.pg125.setTransparency(0)


    def show(self):
        self.pg125.show()

    def hide(self):
        self.pg125.hide()

    def destroy(self):
        self.pg125.destroy()

gui = GUI()

gui.show()

Properties panel performance

The performance of the properties panel is affecting the whole application, dragging a widget around, changing options etc, makes the full panel reload

  • Don't reload full panel every time a value updates, only change values of entries in the panel
  • Restore opened sections
  • Remove the delayed update of the panel once performance is up again
  • check if hide/show enhances performance when collapsible frames are closed/opened. Otherwise change to something else (stash/unstash for example)

Image property for every state will be overridden on every change

If the user wants to have different images for different states (e.g. button click, hover, normal and disabled), he needs to set them for the OnscreenImage of the desired state. But, setting it in one OnscreenImage also sets the same image value of all other OnscreenImages of the same button. The editor view still shows the correct images though but exporting them will result in only one image being used.

Undo/Redo

To err is human, and I have developed a compulsive reflex to hit ctrl-z when I inevitably ruin progress.

Stateless options

Currently stated options like text, image, etc for states like hover, click, disabled, and so on have to be set for each state individually and can not be simply "copied" over to all other states or simply be set for every state at once.

Option 1: Add stateless property entries like text for entering text for text1, text2, etc.
Option 2: Add button next to entries to copy to other states
Option 3: Selection on top to only show a specific state or "all" states

Error when adding objects with thumbs - Panda 1.10.11

Thanks for this program. It has been a great help in allowing me to design my UI.

Pip won't install Panda3d 1.10.8 any more, so I installed 1.10.11. This is probably what causes my problem. If I insert any object with a thumb, I get an error:

  File "~/panda3d/DirectGuiDesigner/DirectGuiDesigner/panels/PropertiesPanel.py", line 969, in __createBaseNInput
    if updateElement[parts[0]] is not None:
  File "~/panda3d/DirectGuiDesigner/dgd/lib/python3.10/site-packages/direct/gui/DirectGuiBase.py", line 484, in cget
    raise KeyError('Unknown option "' + option + \
KeyError: 'Unknown option "thumb" for DirectSlider'

I believe the problem is caused by option thumb_image_size, being split.

To reproduce:

  • Open the program
  • Click on a slider (Or scrollbar) to insert it into the editor
  • Click on the inserted object and see the stack trace.

Incidentally the Startup section readme also needs to be updated to change the name of the main program from DirectGuiDesigner.py to main.py

Issues with undoing copy and cut events

Cutting and pasting elements does not currently support undoing. We should probably add a call to the kill ring in the method pasteCutElement.

If you copy an element (1) onto another element (2) and then tries to undo a couple of times the application crashes. Specifically undoing the creation of element (2) seems to be the issue.
Here is the log file for the that issue:
DirectGuiDesigner.log

Issue with expanding list and tuple properties in the properties panel

When adding an entry to a list or tuple property the property panel is refreshed and the new entry is removed. By updating the sections of the panel, instead of refreshing the panel every time an entry is added, the issue is resolved.
In other words, do this:

            if updateMainBox:
                entriesBox.refresh()
                for section, boxFrame in self.boxFrames.items():
                    boxFrame.refresh()
                    self.updateSection(section)
                    section.toggleCollapsed()
                    section.toggleCollapsed()

and remove the line:
self.resizeFrame()

Typo in help dialog

This is a very minor issue, but the help dialog claims that the keyboard-event control-delete can be used to delete objects. Destroying objects is actually bound to just delete instead. What would you consider to be the expected behaviour?

Crash when pasting options while no object is selected

If self.selectedElement is None (no element is selected) while pasting options the application crashes. Adding a check in the method pasteOptions in DirectGuiDesigner fixes the issue. Something like this:

    def pasteOptions(self):
        if self.copyOptionsElementInfo is None: return

        if self.selectedElement is None:  # if no object is selected
            base.messenger.send("showInfo", ["Please select an object to paste to"])
            return

        self.__copyOptions(self.copyOptionsElementInfo, self.selectedElement)

Do you prefer a new pull request for every issue? Or can I add several bugfixes to the same pull request?

Help and Designer Settings Dialog issues

Hi,

When editor scale is set to Pixel, the grid is drawn on top of the Designer Settings Dialog when the latter is displayed. This does not happen with the Help Dialog however.

A problem that occurs with both dialogs is that when the editor window is quite small, there does not seem to be a way to close these dialogs, as their OK/Cancel buttons are not accessible then.
If I may, I'd like to suggest assigning hotkeys to them for this purpose. For example, F1 might toggle the Help Dialog instead of just showing it, while Escape would be a good choice for closing both dialogs, I think.

It might also be a good idea to block the entire GUI whenever a dialog is shown, just to prevent bugs due to unforeseen user interaction; perhaps overlaying a window-filling MouseWatcherRegion with suppress flags on top of the GUI but below the dialog could work?

On a side note, I'm glad to see that the editor no longer starts in high resolution (1920 by 1080 pixels). This seemed to force the application to start in fullscreen mode and behaved very strangely on my laptop, to which I have a monitor attached whose native resolution is 1920 x 1080, while that of the laptop's built-in screen is a bit lower. What happened there was that the monitor blacked out for a split-second, then displayed the window in a slightly blurry, seemingly lower-res mode (although a screengrab I made was indeed 1920 x 1080), but the editor window was still decorated. There were some other applications open at that time, and when everything went back to normal after closing the editor, the windows of those applications had been downsized (presumably to fit that apparent lower resolution).

Unable to load images on windows

Thank you for making this designer, it is very helpfull when designing GUI:s.

When setting an image for a gui object the program crashes when trying to load the image. I am using Windows 10. The crash occurs on both the latest release and the master branch version.

Console output (using master version):

Known pipe types:
  wglGraphicsPipe
(all display modules loaded.)
:express(warning): Filename uses Windows-style path: C:\Users\augus\PycharmProjects\DirectGuiDesigner\DirectGuiDesigner\icons\ArrowDownSmall.png
:express(warning):   expected Unix-style path: /c/Users/augus/PycharmProjects/DirectGuiDesigner/DirectGuiDesigner/icons/ArrowDownSmall.png
:gobj(error): Texture::read() - couldn't read: C:\Users\augus\PycharmProjects\DirectGuiDesigner\DirectGuiDesigner\icons\ArrowDownSmall.png
:express(warning): Filename uses Windows-style path: C:\Users\augus\PycharmProjects\DirectGuiDesigner\DirectGuiDesigner\icons\ArrowDownSmall.png
:express(warning):   expected Unix-style path: /c/Users/augus/PycharmProjects/DirectGuiDesigner/DirectGuiDesigner/icons/ArrowDownSmall.png
:gobj(error): Unable to find texture "C:\Users\augus\PycharmProjects\DirectGuiDesigner\DirectGuiDesigner\icons\ArrowDownSmall.png" on model-path /c/Users/augus/PycharmProjects/DirectGuiDesigner/DirectGuiDesigner/;.;/c/Users/augus/PycharmProjects/DirectGuiDesigner;/c/Users/augus/PycharmProjects/DirectGuiDesigner/venv/Lib/site-packages/panda3d/etc/..;/c/Users/augus/PycharmProjects/DirectGuiDesigner/venv/Lib/site-packages/panda3d/etc/../models
:gobj(error): Texture::read() - couldn't read: /c/Users/augus/PycharmProjects/DirectGuiDesigner/DirectGuiDesigner
:gobj(error): Texture "/c/Users/augus/PycharmProjects/DirectGuiDesigner/DirectGuiDesigner" exists but cannot be read.
:gobj(error): Texture extension "" is unknown.  Supported texture types:
  Texture Object                  .txo
  DirectDraw Surface              .dds
  Khronos Texture                 .ktx
  SGI RGB                         .rgb, .rgba, .sgi
  Targa                           .tga
  Raw binary RGB                  .img
  SoftImage                       .pic, .soft
  Windows BMP                     .bmp
  NetPBM-style PBM/PGM/PPM/PNM    .pbm, .pgm, .ppm, .pnm
  Portable Float Map              .pfm
  JPEG                            .jpg, .jpeg
  PNG                             .png
  TIFF                            .tiff, .tif
  OpenEXR                         .exr
  stb_image                       .psd, .hdr, .gif
  MovieTexture                    .asf
  MovieTexture                    .avi
  MovieTexture                    .flv
  MovieTexture                    .m2v
  MovieTexture                    .mkv
  MovieTexture                    .mov
  MovieTexture                    .mp4
  MovieTexture                    .mpeg
  MovieTexture                    .mpg
  MovieTexture                    .nut
  MovieTexture                    .ogm
  MovieTexture                    .ogv
  MovieTexture                    .webm
  MovieTexture                    .wmv
:task(error): Exception occurred in PythonTask eventManager
Try to save file after unhandled exception. Please restart the app to automatically load the exception save file!
Try to save file after unhandled exception. Please restart the app to automatically load the exception save file!

Process finished with exit code 1

And the log file (also with master version):
DirectGuiDesigner.log

Support DirectGuiExtention widgets

I was thinking that it would be useful to be able to use the widgets from your DirectGuiExtention in the designer. But, before I work on that, I would first like to make some changes to how custom widgets get loaded in the editor:

Most, but not all, options in a .widget file use CamelCase. For consistency I would like to rename:

  1. visiblename to visibleName.
  2. the editType optionmenu to optionMenu.
  3. displayName to visibleName for consistency
  4. classfileName to classFileName

Other changes:

  1. To match naming between editType and internalType, I would like to rename the option int to integer in internalType.

  2. It could be useful to have an option to specify to what node new items should be attached to. This would be useful for classes similar to DirectScrolledFrame that has a canvas to attach new nodes to. Or would you prefer that custom widgets just define an addItemFunction instead?

  3. For example the DirectGridSizer requires some extra arguments to be passed to its addItemFunction, which is not supported at the moment. For this we could add an option with some extra args for the addItemFunction in the .widget file.

I do however fell like it might be better to keep the complexity of the custom widget loader down and simply add workarounds in DirectGuiExtention to deal with 6 and 7.

What are your thoughts on the matter?

Crash when saving settings

variable prcFileName needs to be set for writing. It actually should be given already since it's also the place where settings will get loaded from. Maybe just missing a self. or passing it to the function.

  File ".../DirectGuiDesigner/DirectGuiDesigner.py", line 1328, in hideSettings
    with open(prcFileName, "w") as prcFile:
NameError: name 'prcFileName' is not defined

Toggling editor scale to Aspect takes a long time

Hi,

When I press the toolbutton to switch editor scale to Pixel, the change is pretty much instantaneous. But when I switch back to Aspect, this takes up an entire second on my laptop and about half a second on my desktop PC.
That's with a completely empty layout, so I find this lag a bit surprising.
To clarify, the entire application seems to freeze during that time; the button tooltip doesn't disappear and the interface is unresponsive.

Do you have any idea what might be causing this?

Tested on Windows 10

multiselect of widgets

Implement possibility for selecting multiple widgets at once

Things to consider:

  • Selection possibility (shift-click to select multiple, box select with drag and drop)
  • enhanced property panel (only show properties valid for all selected widgets)

Check node editor for how multiselect is handled there (selection, boxselect, move, etc)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.