How to Privent wxFrame from Move and stay it maxsized

Это русская секция форума wxWidjets. В этой секции вы можете обсуждать любые вопросы, связанные с wxWidgets на вашем родном языке.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 5311
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: How to Privent wxFrame from Move and stay it maxsized

Post by ONEEYEMAN » Thu Jan 14, 2021 10:19 pm

Hi,
cutecode wrote:
Thu Jan 14, 2021 9:46 pm
This won't help.
After calling SetPosition() - OnFrameMove() is called twice.
The first time immediately after calling SetPosition(), and second time after exiting from OnFrameMove2()

Not sure if this behaver would be all linux distributions
Weird.
Are you saying that its doing a recursion with OnFrameMove()?

Because according to your message this is a flow:

Code: Select all

SetPosition()
OnFrameMove()
OnFrameMove()
Thank you.

User avatar
cutecode
Super wx Problem Solver
Super wx Problem Solver
Posts: 396
Joined: Fri Dec 09, 2016 7:28 am
Contact:

Re: How to Privent wxFrame from Move and stay it maxsized

Post by cutecode » Thu Jan 14, 2021 10:26 pm

see this

Code: Select all

OnFrameMove2
1x27
OnFrameMove
0x0
OnFrameMove
wx 3.1.6 win/mac/linux

regards,
Alexander Saprykin
https://v2.dental-soft.ru

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

Re: How to Privent wxFrame from Move and stay it maxsized

Post by doublemax » Thu Jan 14, 2021 11:00 pm

Does that code prevent the high CPU load?

If yes, you could try to use wxRecursionGuard to do the same.
https://docs.wxwidgets.org/trunk/classw ... guard.html
Use the source, Luke!

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 5311
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: How to Privent wxFrame from Move and stay it maxsized

Post by ONEEYEMAN » Thu Jan 14, 2021 11:26 pm

Hi,
Why do you have OnFrameMove2() and OnFrameMove()?

Thank you.

User avatar
cutecode
Super wx Problem Solver
Super wx Problem Solver
Posts: 396
Joined: Fri Dec 09, 2016 7:28 am
Contact:

Re: How to Privent wxFrame from Move and stay it maxsized

Post by cutecode » Fri Jan 15, 2021 6:37 am

ONEEYEMAN wrote:
Thu Jan 14, 2021 11:26 pm
Hi,
Why do you have OnFrameMove2() and OnFrameMove()?

Thank you.
OnFrameMove2() is called after exiting from OnFrameMove()
I can't call SetPosition() inside OnFrameMove()
wx 3.1.6 win/mac/linux

regards,
Alexander Saprykin
https://v2.dental-soft.ru

User avatar
cutecode
Super wx Problem Solver
Super wx Problem Solver
Posts: 396
Joined: Fri Dec 09, 2016 7:28 am
Contact:

Re: How to Privent wxFrame from Move and stay it maxsized

Post by cutecode » Fri Jan 15, 2021 6:44 am

doublemax wrote:
Thu Jan 14, 2021 11:00 pm
Does that code prevent the high CPU load?

If yes, you could try to use wxRecursionGuard to do the same.
https://docs.wxwidgets.org/trunk/classw ... guard.html
Yes, it prevents, but it overlods for some seconds at startup of aplication.
It seems to me I found a solution adding one more flag

Code: Select all

void MyFrame::OnFrameMove(wxMoveEvent& event)
{
	if (!m_bFinishedLoading)
		return;
	...
Setposition() is called only after aplication full load

Thank you
wx 3.1.6 win/mac/linux

regards,
Alexander Saprykin
https://v2.dental-soft.ru

Post Reply