News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

ScrollingDialog

Started by Rossifumi, February 08, 2011, 04:36:39 PM

Previous topic - Next topic

Jenna

If possible please sen also the *.cbp, *.wxs and (probably *.xrc)-files.
You can either attach it her (if it's not too large) or send it to me  per mail (jens at codeblocks dot org).

If you really use a release build, I wonder why you get this warning, because the asserts are normally only enabled in debug-builds.

Rossifumi


Jenna

First: you use a debug version of wxWidgets (as I thought), that's why you get the assert message.
Second: you use wxWidgets 2.9.1 and most likely do not need wxSrollingdialog as dmoore stated above.
Third: the height of all child-elements together is greater than the maxsize and that leads to the warning, if you set the sizer.


Rossifumi

1) i compiled the project in debug and releas mode, both, with the same error...is this that you mean with "debug version of wxWidgets"?
2) Yes i use wxWidgets 2.9.1, how can i obtain a scrolledwindow so?
3)I think that the height of all child-elemnts is ofcourse greater than the maxsize...in other way i don't need a scroll....

dmoore

1. Yikes. Your wxWidgets DLL was compiled with debugging symbols/code.
2. Read the link I posted earlier.
3. If you take a look at the code of wxScrollingDialog you will see it does its magic by dynamically moving the widgets in the dialog into a scrolling window, BUT ONLY when you call "Show" or "ShowModal". By forcing your dialog to resize using Fit and SetSizeHints in your constructor, you are creating a warning because there is no scrolling window to dump everything into, but you aren't changing the size of the dialog because all of that will be undone when you call Show. You will also notice that wxScrollingDialog is hard coded to set the size of the dialog to the lower of the size required to show it or the display size. If you want to do something different you could try something like override Show/ShowModal:


bool YourDerivedDialog::Show(bool show)
{
   if (CanDoLayoutAdaptation())
       DoLayoutAdaptation();
   wxSize s=GetSize();
   SetSize(s.x,700);

   return wxDialog::Show(show);
}


Anyway, this really isn't C::B development related.
Python plugins: [url="https://github.com/spillz/codeblocks-python"]https://github.com/spillz/codeblocks-python[/url]
Code::Blocks Daily Builds -- Ubuntu PPA: [url="https://launchpad.net/~damien-moore/+archive/codeblocks"]https://launchpad.net/~damien-moore/+archive/codeblocks[/url]

Jenna

Quote from: Rossifumi on February 10, 2011, 08:18:56 PM
1) i compiled the project in debug and releas mode, both, with the same error...is this that you mean with "debug version of wxWidgets"?
You link against a debug library of wxWidgets, that's normally only needed if you want to debug wxWidgets itself.
Quote from: Rossifumi on February 10, 2011, 08:18:56 PM
2) Yes i use wxWidgets 2.9.1, how can i obtain a scrolledwindow so?
Quote from: dmoore on February 09, 2011, 05:26:00 PM
Quote from: jens on February 09, 2011, 02:59:10 PM
It should work as for "real" wxDialogs.
We use it for almost all dialogs in C::B and it works correctly there (as far as I know).
Is this going to be redundant soon? http://docs.wxwidgets.org/trunk/overview_dialog.html#overview_dialog_autoscrolling
Quote from: Rossifumi on February 10, 2011, 08:18:56 PM
3)I think that the height of all child-elemnts is ofcourse greater than the maxsize...in other way i don't need a scroll....
You misunderstood what a wxScrollingDialog does:
It's a drop-in replacement for wxDialog, that automatically adds scrollbars (and makes sure that standard buttons are always visible) if the dialog is larger than the screensize.
It's designed to make sure that all parts of a dialog are reachable on small screens like netbooks have.
See here: http://www.anthemion.co.uk/code.htm#scrollingdialog

Maybe it would be enough to use a wxScrolledWindow directly (I never did it), but we leave the scope of this forum here and should stop the discussion !

Rossifumi

Ok...thanks for the suggestions...