Author Topic: ScrollingDialog  (Read 15610 times)

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: ScrollingDialog
« Reply #15 on: February 10, 2011, 04:55:56 pm »
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

  • Guest
Re: ScrollingDialog
« Reply #16 on: February 10, 2011, 05:10:48 pm »
Here are the files..

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: ScrollingDialog
« Reply #17 on: February 10, 2011, 07:41:29 pm »
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

  • Guest
Re: ScrollingDialog
« Reply #18 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"?
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....

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: ScrollingDialog
« Reply #19 on: February 10, 2011, 08:55:20 pm »
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:

Code
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.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: ScrollingDialog
« Reply #20 on: February 10, 2011, 09:18:47 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.
2) Yes i use wxWidgets 2.9.1, how can i obtain a scrolledwindow so?
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
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

  • Guest
Re: ScrollingDialog
« Reply #21 on: February 10, 2011, 09:56:01 pm »
Ok...thanks for the suggestions...