Bug: Didn't manage to import a number of elements from a .wxs file
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:
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.
Thanks a lot!
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.
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. :(
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.
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.
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: @.***>
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: @.***
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: @.***>
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: @.***