Multiple problems in wxWidgets Layout Application
-
- Knows some wx things
- Posts: 29
- Joined: Wed Mar 03, 2021 9:24 pm
Multiple problems in wxWidgets Layout Application
Could someone give me several advice? For example how do i develop the layout of a application? i do it with the Frame maximized at development? How can i set a size for the textctrls and statictext and all the other controls, in my app when i have a radiogroup with 3 choices the control is big, so it overlapps the space of the next control, how can i solve that problem? i have added a sizer (wxVERTICAL) and to it a gridsizer so i can place controls in ALL the frame, if you need it i will post here my Project. Thank you in advance
Re: Multiple problems in wxWidgets Layout Application
Hi,
1. Do you use any RAD tool?
2. If yes - do you modify its generated code?
3. Can you post the code you use and the screenshot of what the code is doing?
Thank you.
1. Do you use any RAD tool?
2. If yes - do you modify its generated code?
3. Can you post the code you use and the screenshot of what the code is doing?
Thank you.
-
- Knows some wx things
- Posts: 29
- Joined: Wed Mar 03, 2021 9:24 pm
Re: Multiple problems in wxWidgets Layout Application
RAD tool ? Sorry i dont know the difference i use wxDatePicker several times, i am developing all from the code, i am not using wxcrafter heres my Project and a image when i run my application, the frame shows minimized or i dont know very little, even thought i have set its size to 1100 and 680 when i create the frame,
Re: Multiple problems in wxWidgets Layout Application
Are you using MDI on purpose? It's very unusual and i don't think it fits your use case very well.
The mainframe opens small, because the size you pass to the constructor is not passed through to the base constructor of wxMDIParentFrame
Code: Select all
MainFrame::MainFrame(wxWindow* parent,
wxWindowID id,
const wxString& title,
const wxPoint& pos,
const wxSize& size,
long style)
: wxMDIParentFrame(parent, id, title)
{
Use the source, Luke!
-
- Knows some wx things
- Posts: 29
- Joined: Wed Mar 03, 2021 9:24 pm
Re: Multiple problems in wxWidgets Layout Application
Yes, its a MDI application, but now if i place controls and the window gets smaller, how can i make the controls proportional to the frame new size? Thank you i didnt noticed the constructor problem, how can i make the panels bigger? With its constructor ? Sorry im new to wxWidgets
Re: Multiple problems in wxWidgets Layout Application
You want to scale everything down when the size gets smaller? Not easily possible and - given the nature of the application - not the right thing to do anyway. The best thing to do is to set the minimum size of the window so that it's guaranteed that all controls are visible. To do that, in the cHistorialMedico constructor, replace this->SetSizer(sizer); with this->SetSizerAndFit(sizer);i place controls and the window gets smaller, how can i make the controls proportional to the frame new size?
Use the source, Luke!
-
- Knows some wx things
- Posts: 29
- Joined: Wed Mar 03, 2021 9:24 pm
Re: Multiple problems in wxWidgets Layout Application
Oh now i understand, thank you, and the height of the wxtextctrl also in the constructor of the text control?
-
- Knows some wx things
- Posts: 29
- Joined: Wed Mar 03, 2021 9:24 pm
Re: Multiple problems in wxWidgets Layout Application
I cannot complete my project as it is, for example the height of the textctrls is very big, how can i modify my layout ?
Re: Multiple problems in wxWidgets Layout Application
In a wxGridSizer all cells have the same size, determined by the biggest cell. You probably don't want that here, replace it with a wxFlexGridSizer.
And when you add wxTextCtrls into the sizer, don't set the wxEXPAND flag.
And when you add wxTextCtrls into the sizer, don't set the wxEXPAND flag.
Use the source, Luke!
-
- Knows some wx things
- Posts: 29
- Joined: Wed Mar 03, 2021 9:24 pm
Re: Multiple problems in wxWidgets Layout Application
I have modified my project, but now a big control makes all the column very big, how can i make only the column of the big control grow?
Re: Multiple problems in wxWidgets Layout Application
Can you show a screenshot?
Use the source, Luke!
-
- Knows some wx things
- Posts: 29
- Joined: Wed Mar 03, 2021 9:24 pm
Re: Multiple problems in wxWidgets Layout Application
Heres the screenshot, as you can see in the last row a control has lots of text and makes the whole column bigger, is it possible to configure just only his row?
- Attachments
-
- This is a screenshot of my app right now
- app.png (69.27 KiB) Viewed 1231 times
Re: Multiple problems in wxWidgets Layout Application
I think you can increase the gridbag sizer column or row span to a value larger than 1 for this label, so it will use more than one column or/and row.
and/or by inserting "\n" to the text label you can make it a multiline textlabel.
and/or by inserting "\n" to the text label you can make it a multiline textlabel.
Re: Multiple problems in wxWidgets Layout Application
I don't think you will be able to solve this (and make it look good and efficient to use) with a single wxGridSizer. E.g. you should group related items together and put them in a wxStaticBoxSizer.
Do you have a paper form this GUI is based on? If yes, can you show it?
Do you have a paper form this GUI is based on? If yes, can you show it?
Use the source, Luke!
-
- Knows some wx things
- Posts: 29
- Joined: Wed Mar 03, 2021 9:24 pm
Re: Multiple problems in wxWidgets Layout Application
It is for a application i have developed but in Visual Basic heres a screenshot showing the app running