Author Topic: Request : C::B View::notebook enhancements  (Read 73970 times)

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Request : C::B View::notebook enhancements
« Reply #45 on: December 16, 2010, 06:11:38 pm »
The patch comes after some more cleanup.

Her it is, as written it contains the maximize-editor-on-tab-dclk-patch as described here: http://forums.codeblocks.org/index.php/topic,13862.msg93310.html#msg93310 .
It's not tested on windows, and might not work correctly in some cases with tabs, that are moved with drag and drop.

EDIT:

Updated patch: http://forums.codeblocks.org/index.php/topic,13826.msg93555.html#msg93555
« Last Edit: December 20, 2010, 01:25:10 pm by jens »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Request : C::B View::notebook enhancements
« Reply #46 on: December 16, 2010, 07:28:06 pm »
Unfortunately the patch doesn't apply in the debuggers branch, so I can't test it :(
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Request : C::B View::notebook enhancements
« Reply #47 on: December 16, 2010, 07:58:27 pm »
Unfortunately the patch doesn't apply in the debuggers branch, so I can't test it :(
So try this, just the minimize space patch, without the other changes.
Not (yet) tested (currently compiling), but it's against actual revision of debugger-branch.

Does not compile (most likely a missing include).
Update comes later this evening, no time at the moment.

EDIT:

Updated patch: http://forums.codeblocks.org/index.php/topic,13826.msg93389.html#msg93389
« Last Edit: December 16, 2010, 10:05:01 pm by jens »

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Request : C::B View::notebook enhancements
« Reply #48 on: December 16, 2010, 10:04:02 pm »
This one should compile and work, I missed an essential part in the first one.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Request : C::B View::notebook enhancements
« Reply #49 on: December 20, 2010, 01:22:32 pm »
Since the feature-request season is open... ;-)

On thing I miss is the ability to scroll through the tabs (notebooks) by using the mouse wheel.

Here is an updated patch that includes the maximize-editor-on-tab-dclk-patch described here: http://forums.codeblocks.org/index.php/topic,13862.msg93310.html#msg93310 ,
the minimize-free-space-patch as described above and a patch that allows scrolling through the tabs.
The mousewheel-feature is easy to implement on wxGTK, but needs a hack using mouseenter- and mouseleave-event on windows.
That's the cause, why it took so long to create it.

EDIT:

Updated patch: http://forums.codeblocks.org/index.php/topic,13826.msg93583.html#msg93583
« Last Edit: December 21, 2010, 07:44:30 am by jens »

Offline daniloz

  • Regular
  • ***
  • Posts: 268
Re: Request : C::B View::notebook enhancements
« Reply #50 on: December 20, 2010, 01:37:34 pm »
The mousewheel-feature is easy to implement on wxGTK, but needs a hack using mouseenter- and mouseleave-event on windows.
That's the cause, why it took so long to create it.
Thanks jens... I was actually thinking that your super DwellTimer could also be used to implement the mousewheel and I got the same problems as you... but, anyway, you were quicker... Very nice !!! I've downloaded the patch and will test right now !

Thank you again!

Offline daniloz

  • Regular
  • ***
  • Posts: 268
Re: Request : C::B View::notebook enhancements
« Reply #51 on: December 20, 2010, 01:53:20 pm »
Maximize on double-click and mousewheel working like a charm... Great!!!

However, I the tooltip is not working anymore... is this normal? (I missed it already)

Offline daniloz

  • Regular
  • ***
  • Posts: 268
Re: Request : C::B View::notebook enhancements
« Reply #52 on: December 20, 2010, 02:05:46 pm »
@jens:

It crashed here, just after I finished writing the last post and clicked back on C::B... :-)

Here is the RPT:
Code
Error occured on Monday, December 20, 2010 at 13:50:56.

C:\Work\codeblocks_trunk\src\output\codeblocks.exe caused an Access Violation at location 010e5a77 in module C:\Work\codeblocks_trunk\src\output\codeblocks.dll Reading from location 00000000.

Registers:
eax=00000000 ebx=00000000 ecx=0022f4e0 edx=0000000e esi=ffffffff edi=0022f4e0
eip=010e5a77 esp=0022f398 ebp=0022f3c0 iopl=0         nv up ei pl zr na po nc
cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=0000             efl=00010246

Call stack:
010E5A77  C:\Work\codeblocks_trunk\src\output\codeblocks.dll:010E5A77  _ZN13cbAuiNotebook14OnLeaveTabCtrlER12wxMouseEvent
62783C28  C:\Work\codeblocks_trunk\src\output\wxmsw28u_gcc_custom.dll:62783C28  _ZN12wxEvtHandler21ProcessEventIfMatchesERK21wxEventTableEntryBasePS_R7wxEvent
6278404E  C:\Work\codeblocks_trunk\src\output\wxmsw28u_gcc_custom.dll:6278404E  _ZN12wxEvtHandler23SearchDynamicEventTableER7wxEvent
62784103  C:\Work\codeblocks_trunk\src\output\wxmsw28u_gcc_custom.dll:62784103  _ZN12wxEvtHandler12ProcessEventER7wxEvent
627CF28E  C:\Work\codeblocks_trunk\src\output\wxmsw28u_gcc_custom.dll:627CF28E  _ZN8wxWindow18GenerateMouseLeaveEv
627D22CC  C:\Work\codeblocks_trunk\src\output\wxmsw28u_gcc_custom.dll:627D22CC  _ZN8wxWindow13MSWWindowProcEjjl
627CB6FE  C:\Work\codeblocks_trunk\src\output\wxmsw28u_gcc_custom.dll:627CB6FE  _Z9wxWndProcP6HWND__jjl@16
77ECFD72  C:\Windows\system32\USER32.dll:77ECFD72  GetWindowLongW
77ECFE4A  C:\Windows\system32\USER32.dll:77ECFE4A  GetWindowLongW
77ED018D  C:\Windows\system32\USER32.dll:77ED018D  GetMessageW
77ED022B  C:\Windows\system32\USER32.dll:77ED022B  DispatchMessageW
627B0966  C:\Work\codeblocks_trunk\src\output\wxmsw28u_gcc_custom.dll:627B0966  _ZN11wxEventLoop14ProcessMessageEP6tagMSG
627B0B43  C:\Work\codeblocks_trunk\src\output\wxmsw28u_gcc_custom.dll:627B0B43  _ZN11wxEventLoop8DispatchEv
62844A6C  C:\Work\codeblocks_trunk\src\output\wxmsw28u_gcc_custom.dll:62844A6C  _ZN17wxEventLoopManual3RunEv
62824279  C:\Work\codeblocks_trunk\src\output\wxmsw28u_gcc_custom.dll:62824279  _ZN9wxAppBase8MainLoopEv
004058C4  C:\Work\codeblocks_trunk\src\output\codeblocks.exe:004058C4
6273114E  C:\Work\codeblocks_trunk\src\output\wxmsw28u_gcc_custom.dll:6273114E  _Z14wxEntryCleanupv
627895D6  C:\Work\codeblocks_trunk\src\output\wxmsw28u_gcc_custom.dll:627895D6  _Z7wxEntryP11HINSTANCE__S0_Pci
00401D71  C:\Work\codeblocks_trunk\src\output\codeblocks.exe:00401D71  WinMain@16  C:/Work/codeblocks_trunk/src/src/app.cpp:260
00460446  C:\Work\codeblocks_trunk\src\output\codeblocks.exe:00460446
004010DB  C:\Work\codeblocks_trunk\src\output\codeblocks.exe:004010DB
00401158  C:\Work\codeblocks_trunk\src\output\codeblocks.exe:00401158
768ED0E9  C:\Windows\system32\kernel32.dll:768ED0E9  BaseThreadInitThunk
77D319BB  C:\Windows\system32\ntdll.dll:77D319BB  RtlInitializeExceptionChain
77D3198E  C:\Windows\system32\ntdll.dll:77D3198E  RtlInitializeExceptionChain

Sorry, but I cannot give you more information, see below...
Code
addr2line -e C:\Work\codeblocks_trunk\src\devel\codeblocks.dll 010E5A77

C:\Work\codeblocks_trunk\src\output\codeblocks.dll[010E5A77]:
??:0

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Request : C::B View::notebook enhancements
« Reply #53 on: December 20, 2010, 06:29:11 pm »
@jens:

It crashed here, just after I finished writing the last post and clicked back on C::B... :-)


No such crash here.
Did you try to remove the devel and output subdirectory and the pch-files (include/*.gch) manually, to be sure everything is linked correctly.

The windows-hack for the mousewheel seems to break the tooltips. I will see if I find a solution.
For the moment, you can just comment out the part of the hack in cbauinotebook.cpp in cbAuiNotebook::UpdateTabControlsArray() (the lines that disconnect and connect the wxEVT_LEAVE_WINDOW and wxEVT_ENTER_WINDOW events).

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Request : C::B View::notebook enhancements
« Reply #54 on: December 21, 2010, 07:43:36 am »
@jens:

It crashed here, just after I finished writing the last post and clicked back on C::B... :-)


No such crash here.
Did you try to remove the devel and output subdirectory and the pch-files (include/*.gch) manually, to be sure everything is linked correctly.

The windows-hack for the mousewheel seems to break the tooltips. I will see if I find a solution.
For the moment, you can just comment out the part of the hack in cbauinotebook.cpp in cbAuiNotebook::UpdateTabControlsArray() (the lines that disconnect and connect the wxEVT_LEAVE_WINDOW and wxEVT_ENTER_WINDOW events).
I found the cause for the crash (shame on me): the dynamically connected event-handler have the control, that sends the event as this-pointer, not the instance of the class, they are member of. But the compiler does not know this (dynamically) and therefore it does not lead to an error, if we call a member-function directly or use a member-variable as pointer.
It's corrected now, also the issuethat the tooltips are closed immediately aftr they are created.
ToolTip-creation gives the focus to the tooltip, this leads to a mouseleave-evemt of the tabctrl, this leads to a restore of the old focus (or set it to the new selected tab) and this closes the tooltip, because it loses the focus.

Should be fixed in the attached patch.

EDIT:

updated patch: http://forums.codeblocks.org/index.php/topic,13826.msg93728.html#msg93728
« Last Edit: December 26, 2010, 12:25:09 am by jens »

Offline daniloz

  • Regular
  • ***
  • Posts: 268
Re: Request : C::B View::notebook enhancements
« Reply #55 on: December 21, 2010, 08:29:23 am »
OK, thanks... Compiling right now, I'll report back after testing... :-)

Offline daniloz

  • Regular
  • ***
  • Posts: 268
Re: Request : C::B View::notebook enhancements
« Reply #56 on: December 22, 2010, 11:47:11 am »
Should be fixed in the attached patch.
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();
}

Sorry, it was easier just to give you my code than to create a patch against your patch... :-)

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Request : C::B View::notebook enhancements
« Reply #57 on: December 22, 2010, 12:27:33 pm »
But you could generate new patch, so I can test it :)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline daniloz

  • Regular
  • ***
  • Posts: 268
Re: Request : C::B View::notebook enhancements
« Reply #58 on: December 22, 2010, 01:16:38 pm »
Here it goes, patch against trunk rev6904...

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Request : C::B View::notebook enhancements
« Reply #59 on: December 22, 2010, 02:18:21 pm »
Should be fixed in the attached patch.
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... :-)

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.