Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
Request : C::B View::notebook enhancements
daniloz:
OK, thanks... Compiling right now, I'll report back after testing... :-)
daniloz:
--- Quote from: jens on December 21, 2010, 07:43:36 am ---Should be fixed in the attached patch.
--- End quote ---
Yeap, I confirm, no more crashes here....
@jens:
I've changed the Mousewheel behavior. What I wanted originally was just scrolling the tabs and not changing the current editor tab, so here is what I did in "cbAuiNotebook::OnTabCtrlMouseWheel" (file cbauibook.cpp:265) :
--- Code: ---void cbAuiNotebook::OnTabCtrlMouseWheel(wxMouseEvent& event)
{
wxAuiTabCtrl* tabCtrl = (wxAuiTabCtrl*)event.GetEventObject();
cbAuiNotebook* nb = (cbAuiNotebook*)tabCtrl->GetParent();
wxWindow* win = (wxWindow*) nb->GetParent();
nb->CancelToolTip();
nb->m_LastTime = nb->m_StopWatch.Time();
nb->SetSelection(nb->GetPageIndex(tabCtrl->GetWindowFromIdx(tabCtrl->GetActivePage())));
size_t tabOffset = tabCtrl->GetTabOffset();
size_t lastTabIdx = tabCtrl->GetPageCount()-1;
wxClientDC dc(win);
//Manager::Get()->GetLogManager()->DebugLog(F(_T("MouseWheel: tabOffset before=%d (last %d) [last visible=%1d]\n"),tabOffset,lastTabIdx,tabCtrl->IsTabVisible(lastTabIdx,tabOffset,&dc,win)));
if (event.GetWheelRotation() > 0)
{
if (!tabCtrl->IsTabVisible(lastTabIdx,tabOffset,&dc,win))
tabOffset++;
}
else
{
if (tabOffset > 0)
tabOffset--;
}
tabCtrl->SetTabOffset(tabOffset);
nb->Refresh();
}
--- End code ---
Sorry, it was easier just to give you my code than to create a patch against your patch... :-)
oBFusCATed:
But you could generate new patch, so I can test it :)
daniloz:
Here it goes, patch against trunk rev6904...
Jenna:
--- Quote from: daniloz on December 22, 2010, 11:47:11 am ---
--- Quote from: jens on December 21, 2010, 07:43:36 am ---Should be fixed in the attached patch.
--- End quote ---
Yeap, I confirm, no more crashes here....
@jens:
I've changed the Mousewheel behavior. What I wanted originally was just scrolling the tabs and not changing the current editor tab, so here is what I did in "cbAuiNotebook::OnTabCtrlMouseWheel" (file cbauibook.cpp:265) :
[...]
Sorry, it was easier just to give you my code than to create a patch against your patch... :-)
--- End quote ---
I understood that, but I think it's not really intuitive.
In other applications scrolling with the mousewheel als changes the focus.
What do you think about making it configurable:
as default scrolling with mousewheel changes the focus, but with key pressed (I suggest ctrl) we only scroll through the tabs without changing the activated tab.
The default behaviour, without additional key (scrolling and activating or just scrolling) can be made configurable and the additional key also.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version