split view problems

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
tehKaiN
In need of some credit
In need of some credit
Posts: 8
Joined: Tue Jul 25, 2017 7:09 pm
Location: Poland
Contact:

split view problems

Post by tehKaiN »

So I'm trying to do some basing splitting with wxSplitterWindow containing wxListCtrl and wxGLCanvas and have some issues.

1. Scrolling wxListCtrl affects GL Canvas: GIF here. Currently I'm updating GL Canvas with timer + idle event under trylock mutex. Should I force canvas update during wxListCtrl scroll event or is there other/better way to do this?

2. I'd like to define right panel's maximum & minimum size with left panel's dimensions unrestricted, or restricted with other values. Should I just attach to splitter's event and veto/override size if needed?

3. During wxListCtrl creation I'm setting its columns' width. I'd like to get right panel's minimum width with columns fully visible. Is there a way to calculate it? Also, solution taking into account user's resize of columns would be nice. ;)

4. I was looking at wxSashWindow but I can't see if I can force drawing resized window during sizing in similar way as wxSP_LIVE_UPDATE does in wxSplitterWindow. Is there a way? Also, which API is preferable: wxSplitterWindow or wxSashWindow? Is one of them older, deprecated or less maintained?
User avatar
evstevemd
Part Of The Furniture
Part Of The Furniture
Posts: 2409
Joined: Wed Jan 28, 2009 11:57 am
Location: United Republic of Tanzania

Re: split view problems

Post by evstevemd »

can you post testable minimal code?
Chief Justice: We have trouble dear citizens!
Citizens: What it is his honor?
Chief Justice:Our president is an atheist, who will he swear to?
User avatar
tehKaiN
In need of some credit
In need of some credit
Posts: 8
Joined: Tue Jul 25, 2017 7:09 pm
Location: Poland
Contact:

Re: split view problems

Post by tehKaiN »

Sorry for my absence in topic, but I had some things to do. I've solved 2) & 3) by using something like that:

Code: Select all

	m_pSplitter->Bind(wxEVT_SPLITTER_SASH_POS_CHANGING, [this](wxSplitterEvent &evt){
		auto clientWidth = this->m_pSplitter->GetParent()->GetClientSize().GetWidth();
		this->m_pTable->InvalidateBestSize(); // used for column resizes
		auto tableWidth = this->m_pTable->GetEffectiveMinSize().GetWidth();
		if(clientWidth - evt.GetSashPosition() > tableWidth) {
			m_pSplitter->SetSashPosition(clientWidth - tableWidth);
			evt.Veto();
		}
	});
Unfortunately 1) is still unsolved. I'll try to post some example code later.
Post Reply