Layout in a scrolled window Topic is solved

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.
User avatar
doublemax
Moderator
Moderator
Posts: 19115
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Layout in a scrolled window

Post by doublemax »

Too many errors to fix without the missing include files
#include "arguments.c"
#include "typecombobox.h"
Use the source, Luke!
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Layout in a scrolled window

Post by ONEEYEMAN »

doublemax,
Sorry, this should work.

Thank you.
Attachments
retrievalarguments.h
(1.75 KiB) Downloaded 136 times
retrievalarguments.cpp
(13.34 KiB) Downloaded 131 times
arguments.c
(1.83 KiB) Downloaded 126 times
User avatar
doublemax
Moderator
Moderator
Posts: 19115
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Layout in a scrolled window

Post by doublemax »

If you're using wx 3.1.5 or newer, at least under Windows this bug i had forgotten about could be the problem:
https://trac.wxwidgets.org/ticket/19170

Replace the SetSizeHints call with this:

Code: Select all

//sizer->SetSizeHints( this );
const wxSize size = sizer->ComputeFittingClientSize(this);
SetMinClientSize(size);
SetClientSize(size);
BTW: You can make dialogs resizable by adding the wxRESIZE_BORDER style flag.
Use the source, Luke!
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Layout in a scrolled window

Post by ONEEYEMAN »

doublemax,
Fixed on both systems. And the GTK is still looks good.

Thank you.
User avatar
doublemax
Moderator
Moderator
Posts: 19115
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Layout in a scrolled window

Post by doublemax »

doublemax wrote: Fri Jul 23, 2021 4:04 pm If you're using wx 3.1.5 or newer, at least under Windows this bug i had forgotten about could be the problem:
https://trac.wxwidgets.org/ticket/19170
Bug should be fixed as of today.
Use the source, Luke!
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Layout in a scrolled window

Post by ONEEYEMAN »

doublemax,
Yes, I saw it.

I'll wait for the release and get rid of the workaround.

Thank you.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Layout in a scrolled window

Post by ONEEYEMAN »

doublemax,
One more question in regards to this.
What would be the way to handle TAB traversal?

I'm creating a panel with the default styles, which means TAB traversals handled by default, but I need to add the moving pointer.

Maybe I should handle it myself and remove the wxTAB_TRAVERSAL when creating a wxPanel?

Or there is a better alternative?

Thank you.
User avatar
doublemax
Moderator
Moderator
Posts: 19115
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Layout in a scrolled window

Post by doublemax »

ONEEYEMAN wrote: Sat Jul 24, 2021 6:39 pm I'm creating a panel with the default styles, which means TAB traversals handled by default, but I need to add the moving pointer.
What exactly is the problem, what are you trying to achieve?
Use the source, Luke!
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Layout in a scrolled window

Post by ONEEYEMAN »

doublemax,
Let's say I have 2 lines and my focus is on the first line combo.
When I press TAB, I want the focus move to the second line text control and the hand arrow to move down.
Same with the Shift+TAB

The first portion works (focus is moving), but the pointer is still points to the first line.

If you try it - you will see what I'm talking about.

Thank you.
User avatar
doublemax
Moderator
Moderator
Posts: 19115
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Layout in a scrolled window

Post by doublemax »

I thinks it's more universal to observe which control has focus and calculate the current line based on that. Then you could also get rid of the mouse click handler which does this at the moment.
Use the source, Luke!
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Layout in a scrolled window

Post by ONEEYEMAN »

doublemax,
Where?
Which event should I catch in order to do that?

Thank you.
User avatar
doublemax
Moderator
Moderator
Posts: 19115
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Layout in a scrolled window

Post by doublemax »

Focus event for the text controls and combo boxes.
Use the source, Luke!
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Layout in a scrolled window

Post by ONEEYEMAN »

doublemax,
I tried to add that handlers but it broke the key event (for up/down arrow).
I guess I will need some flag to not process focus set and set it inside the key event.

Any alternatives?

Thank you.
User avatar
doublemax
Moderator
Moderator
Posts: 19115
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Layout in a scrolled window

Post by doublemax »

If you call event.Skip in the handlers, they shouldn't interfere with anything. What else are you doing in the handler?
Use the source, Luke!
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Layout in a scrolled window

Post by ONEEYEMAN »

doublemax,
Problem is - they interfere with each other.
In the key down event handler I set the focus to the next row and call event.Skip(), otherwise the handler won't work.
But then SetFocus() handler is executed and should set a focus to the 3rd row...

Thank you.
Post Reply