wxUiEditor icon indicating copy to clipboard operation
wxUiEditor copied to clipboard

Bug: Didn't manage to import a number of elements from a .wxs file

Open kencamargo opened this issue 1 year ago • 5 comments

Description:

When importing a wxs layout file, I got the following errors:

Unable to create wxBitmapButton as a child of wxNotebook Unable to create wxButton as a child of wxNotebook Unable to create wxButton as a child of wxPanel Unable to create wxGrid as a child of wxNotebook Unable to create wxStaticText as a child of wxNotebook Unable to create wxTextCtrl as a child of wxNotebook

Those work without problems in wxSmith, though. Couldn't attach the file, copying it below:

Assistente 523,349 0 1 3 523,23 16,8 14 bold 0 swiss Sans wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL 523,276 202,14 523,260 40,72 400,27 448,72 40,144 400,27 448,144 48,48 48,120 174,11 6 1 20 40 65 Campo Bloco Comp. Corr. Inc. Lim. 16,24 448,168 104,208 224,208 344,208 480,40 1 480,80 160,15 60,140 80,72 64,17 60,24 80,104 180,72 180,104 0 170,135 175,19 40,32 350,176 416,176 36,36 0 Aceita 464,176 36,36 Abandona 40,8 wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL 523,47 340,8 425,8 wxBOTTOM|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL 5 Seleciona arquivo Seleciona arquivo

kencamargo avatar Jun 25 '24 18:06 kencamargo

I see what the problem is. Without a top level sizer for a wxNotebook or wxPanel, wxWidgets won't be able to automatically size/resize child controls based on their size and possible scale factor (currently that only affects Windows, but will presumably affect Linux at some point). By default, wxUiEditor insists on a sizer as a parent for the controls you are trying to add. While that's generally a good idea, wxWidgets does not require it and it certainly should not be required when importing. I can certainly change that for importing, and perhaps relax the sizer requirement for books and panels.

KeyWorksRW avatar Jun 26 '24 13:06 KeyWorksRW

Thanks a lot!

kencamargo avatar Jun 26 '24 18:06 kencamargo

Actually, I do need to see how your .wxs file is laid out -- I think there must be something between wxNotebook and the controls and sizers you are trying to add that wxUiEditor isn't seeing. You should be able to attach the file to a comment by clicking the paperclip icon in the format bar (to the right of Preview) and specifying the path to the file. That will create a copy of the file on github and provide a link to the copy that I can look at.

KeyWorksRW avatar Jul 11 '24 01:07 KeyWorksRW

There you have it: wizdup.zip I had pasted the contents of the wxs in my last message, it didn't occur to me to zip it in order to upload. :(

kencamargo avatar Jul 11 '24 14:07 kencamargo

First off, thank-you for attaching the zip file. The pasted .wxs file was missing a lot of the content, so I couldn't just paste it into a new .wxs file and load it into CodeBlocks to see how it was supposed to work.

tldr; version: supporting hard-coded positions and sizes instead of sizers will involve a fairly complicated overhaul, and the results will not look correct on a high-resolution diplay until #603 is fixed. Both are planned for the 1.2.2 release, but the work probably won't be completed until later this summer.

I tried just inserting a sizer between any book pages and their controls, and while that does allow the controls to get added to the converted project, they are not displayed correctly. That's not really a viable alternative. While wxWidgets does support adding controls without a parent sizer, the resulting program will not display correctly on any OS that either scales fonts for accessability, or scales the entire display for high-dpi screens. As such, I don't currently support that approach in wxUiEditor.

I noticed that on Windows 11 on a high-dpi display, the word "Deduplica" has the bottom half of the text cut off. That's because Windows scales the font size to make it legible on the high-res screen, but Panel3 has a hard-coded height of 23 which is insufficient to display the text using the scaled font. Starting with wxWidgets 3.2, it is possible to use hard-coded positions and sizes that will automatically scale when the app is run on a high-dpi display. However, that feature is not yet implemented in wxUiEditor.

The current plan for fixing issue #603 is that if you specify you are using wxWidgets 3.2 or higher, and you choose automatic scaling, then all positions and sizes will automatically scale when an app is run on a high-dpi display. Once that work is completed, then it will make sense to not only support absolute positions and sizes referenced in #603 but to also fix your issue by removing the requirement for sizers for things like wxPanel, book pages, etc.

KeyWorksRW avatar Jul 14 '24 21:07 KeyWorksRW

With the daily build on 8/19, your wxSmith project file should import fine. Note that because of the fixed sizes rather than sizers, some controls do not display correctly on a high dpi display. Also, wxUiEditor does not support the tools that wxSmith does -- which you are using for wxFileDialog. Those cannot be imported since there is no equivalent in wxUiEditor.

KeyWorksRW avatar Aug 18 '24 15:08 KeyWorksRW

Thanks!

Kenneth Rochel de Camargo, Jr. MD PhD Professor Titular - Full Professor Instituto de Medicina Social - Social Medicine Institute Universidade do Estado do Rio de Janeiro - Rio de Janeiro State U. (Brazil) Editor Emeritus - American Journal of Public Health Senior Editor - Global Public Health e-mail: @.***

On Sun, Aug 18, 2024, 12:32 KeyWorksRW @.***> wrote:

Closed #1478 https://github.com/KeyWorksRW/wxUiEditor/issues/1478 as completed.

— Reply to this email directly, view it on GitHub https://github.com/KeyWorksRW/wxUiEditor/issues/1478#event-13922346524, or unsubscribe https://github.com/notifications/unsubscribe-auth/A64PJVCN35M4A6GBQOADFOLZSC5ARAVCNFSM6AAAAABJ4LRNA6VHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJTHEZDEMZUGY2TENA . You are receiving this because you authored the thread.Message ID: @.***>

kencamargo avatar Aug 18 '24 16:08 kencamargo

Hi, I attempted to get a daily build, but when I get to the Artifacts section, there is no download link. What am I doing wrong? Thanks in advance, Ken

On Sun, Aug 18, 2024 at 12:32 PM KeyWorksRW @.***> wrote:

With the daily build on 8/19, your wxSmith project file should import fine. Note that because of the fixed sizes rather than sizers, some controls do not display correctly on a high dpi display. Also, wxUiEditor does not support the tools that wxSmith does -- which you are using for wxFileDialog. Those cannot be imported since there is no equivalent in wxUiEditor.

— Reply to this email directly, view it on GitHub https://github.com/KeyWorksRW/wxUiEditor/issues/1478#issuecomment-2295302643, or unsubscribe https://github.com/notifications/unsubscribe-auth/A64PJVA2WQGNPGTF2PL4JUTZSC5ARAVCNFSM6AAAAABJ4LRNA6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOJVGMYDENRUGM . You are receiving this because you authored the thread.Message ID: @.***>

-- Kenneth Rochel de Camargo, Jr. MD PhD Professor Titular - Full Professor Instituto de Medicina Social - Social Medicine Institute Universidade do Estado do Rio de Janeiro - Rio de Janeiro State U. (Brazil) Editor Emeritus - American Journal of Public Health Senior Editor - Global Public Health e-mail: @.***

kencamargo avatar Sep 10 '24 19:09 kencamargo

Just to make certain you are going to the right location, here is the link to daily builds: https://github.com/KeyWorksRW/wxUiEditor/actions/workflows/daily_build.yml https://github.com/KeyWorksRW/wxUiEditor/actions/workflows/daily_build.yml

You will want the top most daily build -- click that link and then you should see artifacts with DebianSetup and WindowsExecutable as download links.

On Tue, Sep 10, 2024 at 12:56 PM kencamargo @.***> wrote:

Hi, I attempted to get a daily build, but when I get to the Artifacts section, there is no download link. What am I doing wrong? Thanks in advance, Ken

On Sun, Aug 18, 2024 at 12:32 PM KeyWorksRW @.***> wrote:

With the daily build on 8/19, your wxSmith project file should import fine. Note that because of the fixed sizes rather than sizers, some controls do not display correctly on a high dpi display. Also, wxUiEditor does not support the tools that wxSmith does -- which you are using for wxFileDialog. Those cannot be imported since there is no equivalent in wxUiEditor.

— Reply to this email directly, view it on GitHub < https://github.com/KeyWorksRW/wxUiEditor/issues/1478#issuecomment-2295302643>,

or unsubscribe < https://github.com/notifications/unsubscribe-auth/A64PJVA2WQGNPGTF2PL4JUTZSC5ARAVCNFSM6AAAAABJ4LRNA6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOJVGMYDENRUGM>

. You are receiving this because you authored the thread.Message ID: @.***>

-- Kenneth Rochel de Camargo, Jr. MD PhD Professor Titular - Full Professor Instituto de Medicina Social - Social Medicine Institute Universidade do Estado do Rio de Janeiro - Rio de Janeiro State U. (Brazil) Editor Emeritus - American Journal of Public Health Senior Editor - Global Public Health e-mail: @.***

— Reply to this email directly, view it on GitHub https://github.com/KeyWorksRW/wxUiEditor/issues/1478#issuecomment-2341900314, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKGN3UY4FS5XQWBIDNLTSB3ZV5FG3AVCNFSM6AAAAABJ4LRNA6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNBRHEYDAMZRGQ . You are receiving this because you modified the open/close state.Message ID: @.***>

KeyWorksRW avatar Sep 11 '24 15:09 KeyWorksRW

HI, thanks once again. I was at the right place, but hadn't logged in, so the download link wasn't showing up for me. All good now. Best, Ken

On Wed, Sep 11, 2024 at 12:34 PM KeyWorksRW @.***> wrote:

Just to make certain you are going to the right location, here is the link to daily builds: * https://github.com/KeyWorksRW/wxUiEditor/actions/workflows/daily_build.yml < https://github.com/KeyWorksRW/wxUiEditor/actions/workflows/daily_build.yml>*

You will want the top most daily build -- click that link and then you should see artifacts with DebianSetup and WindowsExecutable as download links.

On Tue, Sep 10, 2024 at 12:56 PM kencamargo @.***> wrote:

Hi, I attempted to get a daily build, but when I get to the Artifacts section, there is no download link. What am I doing wrong? Thanks in advance, Ken

On Sun, Aug 18, 2024 at 12:32 PM KeyWorksRW @.***> wrote:

With the daily build on 8/19, your wxSmith project file should import fine. Note that because of the fixed sizes rather than sizers, some controls do not display correctly on a high dpi display. Also, wxUiEditor does not support the tools that wxSmith does -- which you are using for wxFileDialog. Those cannot be imported since there is no equivalent in wxUiEditor.

— Reply to this email directly, view it on GitHub <

https://github.com/KeyWorksRW/wxUiEditor/issues/1478#issuecomment-2295302643>,

or unsubscribe <

https://github.com/notifications/unsubscribe-auth/A64PJVA2WQGNPGTF2PL4JUTZSC5ARAVCNFSM6AAAAABJ4LRNA6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOJVGMYDENRUGM>

. You are receiving this because you authored the thread.Message ID: @.***>

-- Kenneth Rochel de Camargo, Jr. MD PhD Professor Titular - Full Professor Instituto de Medicina Social - Social Medicine Institute Universidade do Estado do Rio de Janeiro - Rio de Janeiro State U. (Brazil) Editor Emeritus - American Journal of Public Health Senior Editor - Global Public Health e-mail: @.***

— Reply to this email directly, view it on GitHub < https://github.com/KeyWorksRW/wxUiEditor/issues/1478#issuecomment-2341900314>,

or unsubscribe < https://github.com/notifications/unsubscribe-auth/AKGN3UY4FS5XQWBIDNLTSB3ZV5FG3AVCNFSM6AAAAABJ4LRNA6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNBRHEYDAMZRGQ>

. You are receiving this because you modified the open/close state.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/KeyWorksRW/wxUiEditor/issues/1478#issuecomment-2344008681, or unsubscribe https://github.com/notifications/unsubscribe-auth/A64PJVGURMLJOGOVUPX2HQLZWBPIBAVCNFSM6AAAAABJ4LRNA6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNBUGAYDQNRYGE . You are receiving this because you authored the thread.Message ID: @.***>

-- Kenneth Rochel de Camargo, Jr. MD PhD Professor Titular - Full Professor Instituto de Medicina Social - Social Medicine Institute Universidade do Estado do Rio de Janeiro - Rio de Janeiro State U. (Brazil) Editor Emeritus - American Journal of Public Health Senior Editor - Global Public Health e-mail: @.***

kencamargo avatar Sep 11 '24 16:09 kencamargo