Author Topic: My first C::B build  (Read 5115 times)

Offline Michaela Joy

  • Multiple posting newcomer
  • *
  • Posts: 11
My first C::B build
« on: May 19, 2015, 05:31:41 pm »
Hi All,
So I've been working with Code::Blocks for about 3 months now (Writing / re-learning C++). It's totally awesome. Of course, there are things that I don't (didn't) like. One of which is that "annoying" popup dialog box that comes up when I press <Ctrl><Tab>. Yesterday, I decided to do something about it. :)

The first thing I did was download wxWidgets (The version from the Code::Blocks repository) and build it. After some searching, I found the info around here about "-fpermissive". :)
Then, I grabbed the latest "HEAD" from the svn repository. Then, I read the "BUILD" file. :)

The result: Everything built flawlessly. :) (Well...almost flawlessly) On the "about" dialog, the SVN version is 0.

After some reading inside main.cpp, I found this function at line 4460


void MainFrame::OnSwitchTabs(cb_unused wxCommandEvent& event)

This is the function that displays the switcher dialog. So, I decided to replace that code. My thinking is to add a checkbox in the settings dialog somewhere (Not sure where; I'm open to suggestions) which will allow me to optionally disable the switcher dialog.

For now, I replaced the original code with this.

Code
cbAuiNotebook* nb = Manager::Get()->GetEditorManager()->GetNotebook();
if (!nb)
    return;
if (nb->GetPageCount() <= 1)
    return;
int currentSelection = nb->GetSelection();
wxWindow* page = nullptr;
size_t maxPages = nb->GetPageCount();
currentSelection++;
if (currentSelection < 0)
    currentSelection = maxPages - 1;
else if (currentSelection >= maxPages)
    currentSelection = 0;
nb->SetSelection(currentSelection);

I've been putting C::B through its' paces, and so far, all seems to work well. If any C::B developer sees a potential problem with this code, please let Me know.

Also, if anybody can give Me a hint as to how to change the SVN version number so that I can reflect the correct value, I'd sure appreciate it.

Best,
:MJ

Online stahta01

  • Lives here!
  • ****
  • Posts: 7592
    • My Best Post
Re: My first C::B build
« Reply #1 on: May 19, 2015, 06:19:48 pm »
To get rid of SVN 0; you need to have an SVN program installed and CB needs to be able to find it.

No comment on the code posted.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Michaela Joy

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: My first C::B build
« Reply #2 on: May 19, 2015, 07:00:00 pm »
@stahta01: Thank you for your reply.

Currently, I have Tortoise SVN installed, which was what I used to get a snapshot from the C::B repository.

I found this.

http://www.collab.net/downloads/subversion

I was thinking of downloading "Subversion 1.8.13 (Windows 64-bit)"

Do you know if this will work? (I'm running Windows 7, x64)  If so, I guess I have to get my snapshots through SVN using a command prompt instead of using Tortoise.

:MJ
   

Offline scarphin

  • Lives here!
  • ****
  • Posts: 644
Re: My first C::B build
« Reply #3 on: May 19, 2015, 10:12:37 pm »
TortoiseSVN has an option to install command line tools which are the command line svn executables (svn, svnadmin etc...). You have to insert TortoiseSVN's bin directory to your system path for them to work though. It should have an option to insert bin directory to system path during install.

Edit: You can already disable the tab dialogue. Try 'settings->environment->notebooks appereance->use drop-down tab list'.
« Last Edit: May 19, 2015, 10:17:23 pm by scarphin »

Offline raynebc

  • Almost regular
  • **
  • Posts: 217
Re: My first C::B build
« Reply #4 on: May 19, 2015, 11:30:38 pm »
Having ALT+Tab bring up a list of all open files instead of just changing tabs like most programs is one of the little things about C::B that annoys me too.  I'd love for there to be a user setting to bring back the original, forward tab behavior.

Edit: You can already disable the tab dialogue. Try 'settings->environment->notebooks appereance->use drop-down tab list'.
I tried changing that setting, but ALT+Tab still brings up a list instead of just advancing to the next tab in the way that CTRL+ALT+Tab advances to the previous tab.
« Last Edit: May 19, 2015, 11:34:49 pm by raynebc »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: My first C::B build
« Reply #5 on: May 20, 2015, 12:17:29 am »
raynebc:
Are you sure you're talking for using alt-tab?
On Windows this is reserved for switching between applications.
It is the same with most WMs on linux. What OS/WM are you using?
(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 Michaela Joy

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: My first C::B build
« Reply #6 on: May 20, 2015, 12:53:16 am »
@scarphin: Thanks for your reply.

Quote
TortoiseSVN has an option to install command line tools which are the command line svn executables (svn, svnadmin etc...).
   You have to insert TortoiseSVN's bin directory to your system path for them to work though. It should have an option to insert bin directory to system path during install.
I'll do some digging into my svn setup and try it again. :)
Quote
Edit: You can already disable the tab dialogue. Try 'settings->environment->notebooks appereance->use drop-down tab list'.

I have tried toggling those switches. They have no effect on suppressing the Switcher dlg.
Besides...It was a good excuse to spend some time reading through the source code. It's well written, and usably commented. 8)

@raynebc: I'm talking about <Ctrl><Tab>. Not <Alt><Tab>. Typically, <Ctrl><Tab> will switch between tab stops in a Windows app. <Alt><Tab> switches between applications.

:MJ

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: My first C::B build
« Reply #7 on: May 20, 2015, 06:09:51 am »
If you hae cbKeybinder-plugin enabled (it's part of the contrib-plugins like e.g. wxSmith), you can open "Settings -> Editor -> Keyboard shortcuts" and try to change/remove the access keys for "View -> Switch tabs".

Offline Michaela Joy

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: My first C::B build
« Reply #8 on: May 20, 2015, 07:29:04 am »
@Jens: Thanks for the info. I'll try it as soon as I get a free moment.

:MJ

Offline raynebc

  • Almost regular
  • **
  • Posts: 217
Re: My first C::B build
« Reply #9 on: May 20, 2015, 06:37:12 pm »
raynebc:
Are you sure you're talking for using alt-tab?
Sorry, I did mean to say CTRL+TAB.

Offline Michaela Joy

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: My first C::B build
« Reply #10 on: May 21, 2015, 03:22:38 am »
@Jens: Thank You. That fixed it.

:MJ