Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
rocrail
Super wx Problem Solver
Posts: 293 Joined: Fri Oct 02, 2009 2:02 pm
Contact:
Post
by rocrail » Sat Nov 14, 2020 2:10 pm
Before "Big Sur" this hard coded Work Around did help:
Code: Select all
wxSize size = this->getFrame()->GetSize();
if( size.GetWidth() > 100 && size.GetHeight() > 100 ) {
wWindow.setcx( wGui.getwindow( m_Ini ), size.GetWidth() );
wWindow.setcy( wGui.getwindow( m_Ini ), size.GetHeight() );
}
#ifdef __APPLE__
if( !wGui.isverticaltoolbar( m_Ini ) )
wWindow.setcy( wGui.getwindow( m_Ini ), size.GetHeight() - 35 ); // hard coded work around for increasing height.
#endif
But with "Big Sur" I have to double this Work Around value. Can some wxApple Developer check this? Or is FrameSize not equal FrameSize?
The save and restore of the applications frame size works perfect under wx Windows and Linux.
ONEEYEMAN
Part Of The Furniture
Posts: 7459 Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine
Post
by ONEEYEMAN » Sat Nov 14, 2020 3:57 pm
Hi,
What is the context of this?
Why do you need a conditional for OSX? What happen if you omit this?
Thank you.
rocrail
Super wx Problem Solver
Posts: 293 Joined: Fri Oct 02, 2009 2:02 pm
Contact:
Post
by rocrail » Sun Nov 15, 2020 7:33 am
Hi,
the Frame size of the wxWidgets App is saved, and restored at restart.
The #ifdef is the Work-Around for macOS and wxWidgets, but the used value must be corrected for "Big Sur".
ONEEYEMAN
Part Of The Furniture
Posts: 7459 Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine
Post
by ONEEYEMAN » Sun Nov 15, 2020 8:29 am
Hi,
Are you saving the frame size or the client size?
Notice that under OSX/*nix it is better to store the client size, as the window decoration is not yet available...
Thank you.
rocrail
Super wx Problem Solver
Posts: 293 Joined: Fri Oct 02, 2009 2:02 pm
Contact:
Post
by rocrail » Sun Nov 15, 2020 8:52 am
Thanks!
Saving and restoring the client size is OK under macOS "Big Sur".
rocrail
Super wx Problem Solver
Posts: 293 Joined: Fri Oct 02, 2009 2:02 pm
Contact:
Post
by rocrail » Sun Dec 27, 2020 6:55 am
Hi,
this is not the right solution:
1) under Catalina the windows height shrinks. -24
2) under Big Sur the windows height grows. +4
Which solution would be OK for both cases?
Last edited by
rocrail on Sun Dec 27, 2020 7:28 am, edited 1 time in total.
ONEEYEMAN
Part Of The Furniture
Posts: 7459 Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine
Post
by ONEEYEMAN » Sun Dec 27, 2020 7:26 am
Hi,
It is the right solution.
It should work under all 3 major platforms. Especially on GTK as there the window size is not known prior to rendering.
Are you using wxPersistentManager (wx persistent framework)?
And how do you save/restore the size?
Thank you.
rocrail
Super wx Problem Solver
Posts: 293 Joined: Fri Oct 02, 2009 2:02 pm
Contact:
Post
by rocrail » Sun Dec 27, 2020 7:31 am
I'm saving it in a separate file.
Save:
Code: Select all
wxSize size = this->getFrame()->GetSize();
#ifdef __APPLE__
size = this->getFrame()->GetClientSize();
#endif
if( size.GetWidth() > 100 && size.GetHeight() > 100 ) {
wWindow.setcx( wGui.getwindow( m_Ini ), size.GetWidth() );
wWindow.setcy( wGui.getwindow( m_Ini ), size.GetHeight() );
}
Restore:
Code: Select all
int iWidth = wWindow.getcx( wGui.getwindow( m_Ini ) );
int iHeight = wWindow.getcy( wGui.getwindow( m_Ini ) );
m_Frame = new RocGuiFrame( _T("Rocrail"), wxPoint(iX, iY), wxDefaultSize, m_Ini, theme, sp, tp, dp );
#ifdef __APPLE__
m_Frame->SetClientSize(wxSize(iWidth, iHeight));
#else
m_Frame->SetSize(wxSize(iWidth, iHeight));
#endif
ONEEYEMAN
Part Of The Furniture
Posts: 7459 Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine
Post
by ONEEYEMAN » Sun Dec 27, 2020 7:47 am
Hi,
Why do you have conditional for OSX? As I said - it also should work much better on GTK.
Also - out of curiosity - can you try to run persist sample on both systems? Maybe you did find the inconsistency in those versions.
Thank you.
rocrail
Super wx Problem Solver
Posts: 293 Joined: Fri Oct 02, 2009 2:02 pm
Contact:
Post
by rocrail » Sun Dec 27, 2020 7:51 am
Hi,
under Windows the ClientSize does not fit, and grows the height too.
I will check the example, and report.
rocrail
Super wx Problem Solver
Posts: 293 Joined: Fri Oct 02, 2009 2:02 pm
Contact:
Post
by rocrail » Sun Dec 27, 2020 7:52 am
There is no persist sample...
Code: Select all
samples % ls
Makefile combo drawing htlbox mdi propgrid sound thread widgets
animate config erase html menu render splash toolbar wizard
archive dataview event image minimal ribbon splitter treectrl wrapsizer
artprov debugrpt except internat notebook richtext statbar treelist xrc
aui dialogs exec ipc opengl sashtest stc typetest
calendar display font joytest popup scroll svg uiaction
caret dnd fswatcher keyboard power secretstore taborder validate
clipboard docview grid layout preferences shaped taskbar vscroll
collpane dragimag help listctrl printing sockets text webview
ONEEYEMAN
Part Of The Furniture
Posts: 7459 Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine
Post
by ONEEYEMAN » Sun Dec 27, 2020 8:56 am
Hi,
I'm sorry - there is no sample
However there is a test for a persistence classes - can you try and see if its passes?
Thank you.
rocrail
Super wx Problem Solver
Posts: 293 Joined: Fri Oct 02, 2009 2:02 pm
Contact:
Post
by rocrail » Sun Dec 27, 2020 9:12 am
ONEEYEMAN wrote: ↑ Sun Dec 27, 2020 8:56 am
However there is a test for a persistence classes - can you try and see if its passes?
in which sample is this?
Or should I try the wxPersistence? Class in my application?
ONEEYEMAN
Part Of The Furniture
Posts: 7459 Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine
Post
by ONEEYEMAN » Sun Dec 27, 2020 3:06 pm
Hi,
Just try to compile and run tests and test_gui application.
Code: Select all
can wxWidgets/buildMac/tests
make
./test
./test_gui
and see if there will be failures from wxPersistence* classes.
Thank you.
rocrail
Super wx Problem Solver
Posts: 293 Joined: Fri Oct 02, 2009 2:02 pm
Contact:
Post
by rocrail » Sun Dec 27, 2020 3:15 pm
Hi,
no such directory found under wxWidgets Source tree.