Problems when trying 2.9.4 after 2.8.12

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Tapsa
Earned some good credits
Earned some good credits
Posts: 144
Joined: Tue Dec 06, 2011 5:52 pm
Location: Helsinki

Problems when trying 2.9.4 after 2.8.12

Post by Tapsa » Thu Mar 07, 2013 6:29 pm

Is wxWidgets still actively developed?

None of my problems appeared in 2.8.12.

Error 1:

When I check the value of a custom wxTextCtrl in my own focus event handler, that shows a popup if the value is wrong, cursor disappears from the text control and it cannot be gotten back before I correct the value and click elsewhere. Why do cursor and the possibility to select text disappear after showing a wxMessageBox?
Note that I added "Event.Skip();" to all focus event handlers (otherwise I get a lot stranger behavior).

Error 2:

I have command event handlers that fire when I select items from wxListBox. They enable/disable and show/hide mainly custom wxTextCtrls. The problem is that sometimes their borders don't get drawn. Especially if they are right next to other boxes. Sometimes whole text/list boxes disappear because only border separates them from background and whole scroll bars disappear too.
I assume that there is an easy fix to this and this is semi common problem.
Refresh is not a fix because it causes a lot of lag when I go through wxListBox items. I would not be able to quickly go through them, because refresh lags so badly (and I cannot see the actual data in refreshed boxes unless I wait hundreds of milliseconds on each item).

Also, should I try to fix the things that give me assert failures, like setting too high selection into a combo box?

And can I get the old font sizes back to everywhere?

Thanks for your help.

User avatar
doublemax
Moderator
Moderator
Posts: 15065
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Problems when trying 2.9.4 after 2.8.12

Post by doublemax » Thu Mar 07, 2013 6:49 pm

Is wxWidgets still actively developed?
Yes

What platform are you using?
When I check the value of a custom wxTextCtrl in my own focus event handler, that shows a popup if the value is wrong, cursor disappears from the text control and it cannot be gotten back before I correct the value and click elsewhere. Why do cursor and the possibility to select text disappear after showing a wxMessageBox?
Sounds normal to me that displaying a message box destroys the focus. If this worked in 2.8.12 you could open a regression report at http://trac.wxwidgets.org/

But i think the better option would be to display a wxRichToolTip instead, because it's less intrusive:
http://docs.wxwidgets.org/trunk/classwx ... l_tip.html
The problem is that sometimes their borders don't get drawn. Especially if they are right next to other boxes. Sometimes whole text/list boxes disappear because only border separates them from background and whole scroll bars disappear too.
You'd need to create a minimal compilable sample that shows the problem, ideally a patch to the "minimal" sample that comes with wxWidgets.
Also, should I try to fix the things that give me assert failures, like setting too high selection into a combo box?
Yes. wx 2.9.x is more picky about things like that. The asserts indicate errors in your code that were undetected before.
And can I get the old font sizes back to everywhere?
What do you mean?
Use the source, Luke!

Tapsa
Earned some good credits
Earned some good credits
Posts: 144
Joined: Tue Dec 06, 2011 5:52 pm
Location: Helsinki

Re: Problems when trying 2.9.4 after 2.8.12

Post by Tapsa » Sun Mar 10, 2013 9:41 am

I'm using wxMSW. (Windows 7 64-bit Home Premium Service Pack 1)

After the message box is closed, the focus is set to the box that launched it. The focus goes back as I have ordered, but the cursor disappears and no text can be visibly selected in that box.

What's minimal sample?
Can I use this as basis?
ftp://biolpc22.york.ac.uk/pub/binary/wx ... indows.zip
And remove the unnecessary things from it.

By the font I meant the default font everywhere.
It changed from 2.8.12 to 2.9.4.

User avatar
doublemax
Moderator
Moderator
Posts: 15065
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Problems when trying 2.9.4 after 2.8.12

Post by doublemax » Sun Mar 10, 2013 10:25 am

The "minimal" sample is in <wxdir>/samples/minimal/
By the font I meant the default font everywhere.
It changed from 2.8.12 to 2.9.4.
I'm not aware of such a change and i don't see it in my applications.
Use the source, Luke!

Tapsa
Earned some good credits
Earned some good credits
Posts: 144
Joined: Tue Dec 06, 2011 5:52 pm
Location: Helsinki

Re: Problems when trying 2.9.4 after 2.8.12

Post by Tapsa » Sun Mar 10, 2013 10:31 am

Well on my computer, the whole style of my program changes when I move from 2.8.12 to 2.9.4
Apparently that demo doesn't even compile with 2.9.4. Only with 2.8.12.

I'll expand that minimal sample and see if my problems remain.

It seems that I haven't used DECLARE_EVENT_TABLE things in my own project.
Is that fatal error?

Tapsa
Earned some good credits
Earned some good credits
Posts: 144
Joined: Tue Dec 06, 2011 5:52 pm
Location: Helsinki

Re: Problems when trying 2.9.4 after 2.8.12

Post by Tapsa » Mon Mar 11, 2013 4:50 pm

I did the minimal sample. Where do I upload it?
If you can download it from MediaFire, here it is:
http://www.mediafire.com/file/r1c8f90m3 ... Tapsas.zip
Only thing you'd need to change is the wxWidgets path in the bat file.

It has 6 files and 1 folder (empty txt):
AppIcon.ico
buildDebug.bat
CMakeLists.txt
minimal.cpp
Resources.h
Resources.rc
buildD

To compile, I used MinGW and CMake.

As you can see, when you click "Break Borders", some of them disappear.
And when you type low numbers in the blue boxes until you get the popup, you'll see that the box, that launched the popup, is not focusable anymore, nor text can be selected in it, until you click elsewhere and back.

User avatar
doublemax
Moderator
Moderator
Posts: 15065
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Problems when trying 2.9.4 after 2.8.12

Post by doublemax » Mon Mar 11, 2013 5:50 pm

I see the problem with the focus, but in order to make sure it's a bug in wxWidgets you need to strip down the sample much more. Basically just two wxTextCtrls and a focus event handler added to the original "minimal" sample, nothing else. No derived classes etc. The absolute minimum that's needed to demonstrate the problem. If you've done that and the problem still occurs, please open a ticket at http://trac.wxwidgets.org/

I don't see any problem with the borders though. As you were also talking about wrong font sizes, there must be some other factors that come into play. Can you show a screenshot?
Use the source, Luke!

Tapsa
Earned some good credits
Earned some good credits
Posts: 144
Joined: Tue Dec 06, 2011 5:52 pm
Location: Helsinki

Re: Problems when trying 2.9.4 after 2.8.12

Post by Tapsa » Mon Mar 11, 2013 6:23 pm

I'll try that.

The border problem appears only if I use 2.9.4 and compile resources.rc which gives a ton better graphics than if I don't include it.

Are there other ways to get better graphics than having a .rc file with this line?

#include "wx/msw/wx.rc"

Using this rc file gives different graphics (bigger font size for example) in 2.9.4 than in 2.8.12.

Image

User avatar
doublemax
Moderator
Moderator
Posts: 15065
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Problems when trying 2.9.4 after 2.8.12

Post by doublemax » Mon Mar 11, 2013 6:53 pm

The .rc file also contains the manifest file which is needed under XP and higher systems. Without it, you'll always get the "classic" WIndows 95 style look.
Last edited by doublemax on Mon Mar 11, 2013 7:05 pm, edited 1 time in total.
Use the source, Luke!

Tapsa
Earned some good credits
Earned some good credits
Posts: 144
Joined: Tue Dec 06, 2011 5:52 pm
Location: Helsinki

Re: Problems when trying 2.9.4 after 2.8.12

Post by Tapsa » Mon Mar 11, 2013 6:59 pm

Well, do I need to demonstrate more the fact that borders disappear or not?
There are dozens of situations when borders disappear.
It seems to happen under scrolling sections and inside static boxes.
And why did the style change from 2.8.12 to 2.9.4?

User avatar
doublemax
Moderator
Moderator
Posts: 15065
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Problems when trying 2.9.4 after 2.8.12

Post by doublemax » Mon Mar 11, 2013 8:03 pm

Well, do I need to demonstrate more the fact that borders disappear or not?
Yes. Without being able to reproduce it, it's impossible to fix.
There are dozens of situations when borders disappear.
It seems to happen under scrolling sections and inside static boxes.
Never happened to me. Do you see it in any of the wxWidgets samples?
And why did the style change from 2.8.12 to 2.9.4?
I still don't know what you mean. Can you show a before and after screenshot?
Use the source, Luke!

Tapsa
Earned some good credits
Earned some good credits
Posts: 144
Joined: Tue Dec 06, 2011 5:52 pm
Location: Helsinki

Re: Problems when trying 2.9.4 after 2.8.12

Post by Tapsa » Mon Mar 11, 2013 8:31 pm

There is a clear difference as you can see from these screenshots.
Everything that fitted nicely in 2.8.12, don't fit anymore in 2.9.4 (in my own program).

Image

:D Haha, got border drawing error in sample\widgets
I compiled straight with the makefile provided.
When I opened the window, I maximized it, then got it back to normal and a la voila!
The scrollbar was half hidden/undrawn behind the area right to it!
And it remains buggy no matter what I click/do now, unless I resize the window without min/max buttons.

User avatar
doublemax
Moderator
Moderator
Posts: 15065
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Problems when trying 2.9.4 after 2.8.12

Post by doublemax » Mon Mar 11, 2013 9:20 pm

The only difference i see is that the tabs are slightly (2 pixels) bigger than before. The font size is definitely identical. If you really consider this a regression, you can open a trac ticket, but honestly, i don't think anyone will bother.

The only changes i can think of that might change your layout, are these ( from <wxdir>/docs/changes.txt ):
- Sizers distribute only the extra space between the stretchable items
according to their proportions and not all available space. We believe the
new behaviour corresponds better to user expectations but if you did rely
on the old behaviour you will have to update your code to set the minimal
sizes of the sizer items to be in the same proportion as the items
proportions to return to the old behaviour.

- Interpretation of font height in pixels parameter has changed in wxFont
ctor and SetPixelSize() in wxMSW: it is now used as character height and not
the total cell height. If you previously used negative height to explicitly
request character height matching, you may now change your code to use
positive value (passing negative height still works but is undocumented and
deprecated). If you used positive height before you should retest your code
to check if the changes correspond to your expectations. And if you do need
the old behaviour please contact us at wx-dev to let us know about it!
Regarding the wxTextCtrl borders, i don't see them disappearing on my system.
Use the source, Luke!

Tapsa
Earned some good credits
Earned some good credits
Posts: 144
Joined: Tue Dec 06, 2011 5:52 pm
Location: Helsinki

Re: Problems when trying 2.9.4 after 2.8.12

Post by Tapsa » Mon Mar 11, 2013 9:47 pm

I do consider that as a regression, but if nobody cares, then it's not worth ticketing it.
I'll just stick with 2.8.12 until Windows stops supporting it.
The font size increased from 8 to 9 pixels in height and probably in width a bit too.
There must be a way to change it anyway.

Image

How can this happen on my computer, but not on yours?

I have already taken care of the proportions.
In some places I have used every letter that I could squeeze in the space (labels for text controls).
Most of my static texts are constructed like this:
new wxStaticText(***wxPanel***, wxID_ANY, " Name", wxDefaultPosition, wxSize(-1, 15), wxALIGN_LEFT | wxST_NO_AUTORESIZE);
So the second chapter you quoted probably don't apply to my problems.

I also wonder why Event.Skip() in non-command events started to be necessary after 2.8.12 and why it doesn't happen by default if it's necessary.

Here's how I compiled wxWidgets (in \wxWidgets\build\msw):
mingw32-make -f makefile.gcc SHARED=0 BUILD=debug clean
mingw32-make -f makefile.gcc SHARED=0 BUILD=debug
mingw32-make -f makefile.gcc SHARED=0 BUILD=release clean
mingw32-make -f makefile.gcc SHARED=0 BUILD=release

User avatar
doublemax
Moderator
Moderator
Posts: 15065
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Problems when trying 2.9.4 after 2.8.12

Post by doublemax » Mon Mar 11, 2013 10:40 pm

When running Windows 7 in a VM i could finally reproduce the problem with the overdrawn scrollbar. I didn't see it on a "real" Windows 7 machine. Either the desktop settings were slightly different are it's caused by the lack of hardware acceleration in the VM.

Anyway, it's just a small glitch in a sense that everything snaps back to normal when you grab the resize border and resize the frame a bit, so that the layout is recalculated.

I would consider this a bug, but creating a small sample that reproduces the problem reliably, might not be so easy.
Use the source, Luke!

Post Reply