User forums > Using Code::Blocks
Strange wxSmith behaviour
paul_c_weiss:
Hello!
I am working with Code::Blocks 16.01 and wxWidgets 3.0.
Of late, I am facing an issue which is for me difficult to understand.
I have a program with a pretty complexframe with right in its middle a panel which size is fixed to 540 x 540.
This program compiles, links, and runs without any error, warning, or problem.
For some reason, I have decided to change the panel size to 360 x 360 (there is no issue with its content...).
After performing this modification with the wxSmith RAD, the project rebuilds without any error or warning.
Alas, I now get an execution error!
Worse, if I back-correct the panel size to 540 x 540, and obviously rebuild the project, I STILL have an execution error
Bad luck!
Now, it happens that the initial and back-corrected sections of the code are NOT identical:
......
AllMaskedButton = new wxButton(HidePanel, ID_BUTTON11, _("Tous"), wxPoint(25,50), wxSize(50,25), 0, wxDefaultValidator, _T("ID_BUTTON11"));
BoxSizer3->Add(AllMaskedButton, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
HidePanel->SetSizer(BoxSizer3);
SetSizer(BoxSizer3); <- THESE 2 LINES ARE NOT PRESENT IN THE INITIAL FILE
Layout(); <- THESE 2 LINES ARE NOT PRESENT IN THE INITIAL FILE
BoxSizer2->Add(HidePanel, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
BoxSizer4 = new wxBoxSizer(wxHORIZONTAL);
Slate = new wxPanel(Panel1, ID_PANEL2, wxDefaultPosition, wxSize(540,540), wxDOUBLE_BORDER|wxTAB_TRAVERSAL, _T("ID_PANEL2"));
BoxSizer4->Add(Slate, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
........
Two strange new lines appear in the main file!
Commenting off these lines solves the issue! Miraculously, the program runs again!
There are no meaningful differences between the corresponding .wxs files.
Now to some questions:
- Is this behaviour understood?
- Is this due, maybe, to a faulty frame structure?
- Are they some warnings relative to it (in some documentation, I mean...)
Regards!
oBFusCATed:
--- Quote from: paul_c_weiss on April 16, 2016, 05:21:06 pm ---- Is this behaviour understood?
- Is this due, maybe, to a faulty frame structure?
- Are they some warnings relative to it (in some documentation, I mean...)
--- End quote ---
No idea, but we'll need minimal sample project or exact steps to reproduce in a default wx project.
paul_c_weiss:
Nice...
and obvious...
I have not done that because the project is complex enough, and I suspect
that the devils lies in the complexity, precisely.
Thus isolating the problem may be difficult. I shall try, nevertheles, but this will take some time.
Thanks anyhow!
paul_c_weiss:
Ok, then...
I have now notably simplified my project (it now mainly consists in a frame which does nothing..)
However, the execution error is always present.
I have zipped the several project files and attached them to this post. Is this acceptable?
If not please tell me what exactly you expect :).
In file IsolatingErrorMain.cpp you will notice lines 95 and 96:
SetSizer(BoxSizer3);
Layout();
These are wxSmith-generated. They do not seem to make a lot of sense in their position.
Furthermore, commenting them off yields a working project...
Clearly, this is the cause of the error. But why? and how to avoid it?
Regards!
stahta01:
FYI: The attached file IsolatingError.zip is a Windows wxWidgets MultiLib Project with hard coded paths.
I am trying to fix the Hard Code paths; but, I do NOT know enough to answer the OP issue even after I fix the hard code paths.
Edit2: It is also an wxWidgets shared project that tries to link to static wxWidgets libs.
Tim S.
Navigation
[0] Message Index
[#] Next page
Go to full version