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?
split view problems
- evstevemd
- Part Of The Furniture
- Posts: 2409
- Joined: Wed Jan 28, 2009 11:57 am
- Location: United Republic of Tanzania
Re: split view problems
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?
Citizens: What it is his honor?
Chief Justice:Our president is an atheist, who will he swear to?
Re: split view problems
Sorry for my absence in topic, but I had some things to do. I've solved 2) & 3) by using something like that:
Unfortunately 1) is still unsolved. I'll try to post some example code later.
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();
}
});