Scroll content of Dialog/Notebook on low resolution displays

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.
Post Reply
User avatar
rocrail
Super wx Problem Solver
Super wx Problem Solver
Posts: 293
Joined: Fri Oct 02, 2009 2:02 pm
Contact:

Scroll content of Dialog/Notebook on low resolution displays

Post by rocrail »

Hi,

if a dialog is bigger than the display can show, RaspBerry Pi with a small display, it would be nice if you could scroll the contents to be able to use it.
Is there a common solution for this?
Experiments with embedding the dialog contents with in a scrolled window did not work for me.
Note: All dialogs have a vertical box sizer and a wxNotebook.
Best regards,
Rob.
https://wiki.rocrail.net
User avatar
doublemax
Moderator
Moderator
Posts: 19115
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Scroll content of Dialog/Notebook on low resolution displays

Post by doublemax »

Experiments with embedding the dialog contents with in a scrolled window did not work for me.
That should work.

A step that is often forgotten is to call SetScrollbars(...), otherwise the scrollbars won't appear.
http://docs.wxwidgets.org/trunk/classwx ... 4a8e1210bb
Use the source, Luke!
User avatar
rocrail
Super wx Problem Solver
Super wx Problem Solver
Posts: 293
Joined: Fri Oct 02, 2009 2:02 pm
Contact:

Re: Scroll content of Dialog/Notebook on low resolution displays

Post by rocrail »

Hi,

I create some of the Dialogs with the Tool DialogBlocks, and this call is automatically embedded.
If I use a wxScrolledWindow the content is minimised.
See the attached screen shots.
The first one ist without a scrolled windows and the second one with a scrolled window.
Attachments
Screen Shot 2017-05-28 at 15.30.55.png
Screen Shot 2017-05-28 at 15.30.38.png
Best regards,
Rob.
https://wiki.rocrail.net
User avatar
doublemax
Moderator
Moderator
Posts: 19115
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Scroll content of Dialog/Notebook on low resolution displays

Post by doublemax »

The wxScrolledWindow should come directly after the dialog in the hierarchy.
dialog -> scrolledwindow -> vsizer
Everything else remains the same.
Use the source, Luke!
User avatar
rocrail
Super wx Problem Solver
Super wx Problem Solver
Posts: 293
Joined: Fri Oct 02, 2009 2:02 pm
Contact:

Re: Scroll content of Dialog/Notebook on low resolution displays

Post by rocrail »

also in this order the dialog is very small.
Attachments
Screen Shot 2017-05-28 at 15.41.51.png
Best regards,
Rob.
https://wiki.rocrail.net
User avatar
doublemax
Moderator
Moderator
Posts: 19115
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Scroll content of Dialog/Notebook on low resolution displays

Post by doublemax »

How does it look at runtime?
Use the source, Luke!
User avatar
rocrail
Super wx Problem Solver
Super wx Problem Solver
Posts: 293
Joined: Fri Oct 02, 2009 2:02 pm
Contact:

Re: Scroll content of Dialog/Notebook on low resolution displays

Post by rocrail »

It looks like this:
Screen Shot 2017-05-28 at 15.55.10.png
The scrolling works.
Best regards,
Rob.
https://wiki.rocrail.net
User avatar
doublemax
Moderator
Moderator
Posts: 19115
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Scroll content of Dialog/Notebook on low resolution displays

Post by doublemax »

Something like vsizer->Fit( dialog ) should do the trick.
Use the source, Luke!
User avatar
rocrail
Super wx Problem Solver
Super wx Problem Solver
Posts: 293
Joined: Fri Oct 02, 2009 2:02 pm
Contact:

Re: Scroll content of Dialog/Notebook on low resolution displays

Post by rocrail »

Yes, almost there.
but if there is enough room it still does not show all it content.
Screen Shot 2017-05-28 at 16.03.12.png

Code: Select all

RocguiIniDialog::RocguiIniDialog( wxWindow* parent, iONode ini )
{
  Create(parent, -1, _("Rocview"));
  initLabels();
  m_Ini = ini;

  m_GeneralTab->GetSizer()->Layout();
  m_TracePanel->GetSizer()->Layout();
  m_MICpanel->GetSizer()->Layout();
  m_PTpanel->GetSizer()->Layout();
  m_SVGpanel->GetSizer()->Layout();
  m_RICpanel->GetSizer()->Layout();

  m_Notebook->Fit();
  m_Scroller->GetSizer()->Fit(this);
  m_Scroller->GetSizer()->SetSizeHints(this);

  initValues();
}
Best regards,
Rob.
https://wiki.rocrail.net
User avatar
rocrail
Super wx Problem Solver
Super wx Problem Solver
Posts: 293
Joined: Fri Oct 02, 2009 2:02 pm
Contact:

Re: Scroll content of Dialog/Notebook on low resolution displays

Post by rocrail »

If I disable to show the scrollbars always, it works as expected also with low resolution where the scrollbars appear.
The draw back is I cannot edit the dialog any longer with DialogBlocks... (Version 5.11.1)
Attachments
Screen Shot 2017-05-28 at 16.36.31.png
Best regards,
Rob.
https://wiki.rocrail.net
Post Reply