Hi,
Lately, I've been using Code::Blocks on my laptop, with limited vertical screen space (bloody 16:9 screens...), and I've been trying to optimize C::B's layout so there is as much space as possible that is dedicated to the code editor, while keeping all the features that make Code::Block cool.
I've done what I could : removing the bottom status bar, removing unused toolbars, ... but there is room for more.
So I have a few suggestions :
- Could we have a toggle somewhere that would hide/show the different pannels' headers (in yellow) :
(http://babystyle.free.fr/cbpannel.png)
Once your layout suits your need, you have very little need for these.
- Maybe also add a toggle for the Logs & Others panel that would allow the log tabs to be arranged vertically :
(http://babystyle.free.fr/cblogsvert.png)
- Can the Code Completion toolbar (so handy by the way) be resized ? I never need that much width for the second dropdown box, and making it smaller could allow more toolbars to be on the same level, reducing the number of toolbar lines :
(http://babystyle.free.fr/cbcctoolbar.png)
- I'd also apreciate a toggle that hides/show file tabs, as I never use these : too many files to cycle through, I prefer the project hierarchy on the left.
(http://babystyle.free.fr/cbfiletabs.png)
- When using complicated project hierarchy, there can be a lot a wasted space in the project file list :
(http://babystyle.free.fr/cbprojectfiles.png)
Is it possible to reduce the indentation amount between folder levels ?
- My last point will go to the TodoList plugin, that I docked right beneath the project file list. It fits well there, because there is more than enough vertical space for the project file list, but the dark side of this choice is that it makes it impossible to reduce the width of the left panel :
(http://babystyle.free.fr/cbtodolist.png)
Space can be gained by removing dropdown labels ("Scope" and "User") and replacing the "Refresh" text by a fancy icon, or by using a two line layout (one line for labels, one line for dropdowns for example).
I hope that'll give you ideas on how to improve C::B for future releases :)
Quote from: Kalith on April 27, 2011, 01:22:38 AM
Not sure how easy to resize a toolbar by mouse drag. :D
BTW:
I can't see the image http://babystyle.free.fr/cbcctoolbar.png unless I use a proxy. :D
Hi, it seems we can change it. (after reading some wx manual about wxtoolbar and wxchoice. :D
See the screen shot:
(http://i683.photobucket.com/albums/vv194/ollydbg_cb/2011-04-27142308.png)
We can just do it like:
m_Scope->SetSize(wxSize(100, -1));
m_Function->SetSize(wxSize(300,-1));
So, it is possible to save these two length values in the CC options? some one can help to do it?
QuoteWhen using complicated project hierarchy, there can be a lot a wasted space in the project file list :
You can already make this easier : right click on the project in the tree, and play around with the options in Project tree submenu :
- Display folders as on disk (uncheck it)
- Hide Folder Name (check it, requires the previous one to be unchecked)
I have also limited screen space and use View -> Perspectives -> Code::Blocks minimal. I set shortcut Ctrl + 2 for it and Ctrl + 1 for default perspective. This gives me enough space for coding and all panels for other actions. I think it's the best way.
Quote from: m.29 on April 27, 2011, 11:38:30 AM
I have also limited screen space and use View -> Perspectives -> Code::Blocks minimal. I set shortcut Ctrl + 2 for it and Ctrl + 1 for default perspective. This gives me enough space for coding and all panels for other actions. I think it's the best way.
Instead of the shortcut, you can double-click on a tab to change between actual perspective and minimal perspective.
You can also add whatever you need for minimal perspective. Next time you change it to another perspective or you close C::B you will be asked, whether you want to save it or not.
About the vertical tabs at the left or right side: that does not work with the current wxAuiNoteBokk (wxWidgets limitation).
Quote from: ollydbg on April 27, 2011, 08:31:23 AM
Hi, it seems we can change it. (after reading some wx manual about wxtoolbar and wxchoice. :D)
Cool :)
Quote from: killerbot on April 27, 2011, 08:42:48 AMYou can already make this easier : right click on the project in the tree, and play around with the options in Project tree submenu
Yes thanks, that's a good start !
Edit : I tried, and it's working well except when the project has a complex hierarchy : there is no way to distinguish files that are in different folders, or hide some of them that you don't want to touch. I realize that's a luxury, and somehow you have to make compromises to optimize your workspace, but still you could so something like :
(http://babystyle.free.fr/cbprojectfiles2.png)
and preserve all the advantages of the tree view.
Quote from: m.29 on April 27, 2011, 11:38:30 AM
I have also limited screen space and use View -> Perspectives -> Code::Blocks minimal. I set shortcut Ctrl + 2 for it and Ctrl + 1 for default perspective.
That's a good idea, I'll try to see if I can get used to it. But probably not with the bare minimal perspective.
Quote from: jens on April 27, 2011, 06:19:45 PM
About the vertical tabs at the left or right side: that does not work with the current wxAuiNoteBokk (wxWidgets limitation).
Isn't wxAuiNoteBook the text editor panel ?
Quote from: Kalith on April 30, 2011, 03:24:04 PM
Quote from: ollydbg on April 27, 2011, 08:31:23 AM
Hi, it seems we can change it. (after reading some wx manual about wxtoolbar and wxchoice. :D)
Cool :)
I have take some time to implement this feature, so that user can change it.
See the patch:
Index: ccoptionsdlg.cpp
===================================================================
--- ccoptionsdlg.cpp (revision 7639)
+++ ccoptionsdlg.cpp (working copy)
@@ -155,6 +155,11 @@
XRCCTRL(*this, "chkTreeMembers", wxCheckBox)->SetValue(m_Parser.ClassBrowserOptions().treeMembers);
XRCCTRL(*this, "chkScopeFilter", wxCheckBox)->SetValue(cfg->ReadBool(_T("/scope_filter"), true));
+
+
+ XRCCTRL(*this, "spnChoiceScopeLength", wxSpinCtrl)->SetValue(cfg->ReadInt(_T("/toolbar_scope_length"),286));
+ XRCCTRL(*this, "spnChoiceFunctionLength", wxSpinCtrl)->SetValue(cfg->ReadInt(_T("/toolbar_function_length"),660));
+
// m_Parser.ParseBuffer(g_SampleClasses, true);
// m_Parser.BuildTree(*XRCCTRL(*this, "treeClasses", wxTreeCtrl));
}
@@ -220,6 +225,9 @@
m_Parser.ClassBrowserOptions().treeMembers = XRCCTRL(*this, "chkTreeMembers", wxCheckBox)->GetValue();
cfg->Write(_T("/scope_filter"), (bool) XRCCTRL(*this, "chkScopeFilter", wxCheckBox)->GetValue());
+ cfg->Write(_T("/toolbar_scope_length"), (int) XRCCTRL(*this, "spnChoiceScopeLength", wxSpinCtrl)->GetValue());
+ cfg->Write(_T("/toolbar_function_length"), (int) XRCCTRL(*this, "spnChoiceFunctionLength", wxSpinCtrl)->GetValue());
+
// Now write the parser options and re-read them again to make sure they are up-to-date
m_Parser.WriteOptions();
m_NativeParsers->RereadParserOptions();
Index: codecompletion.cpp
===================================================================
--- codecompletion.cpp (revision 7639)
+++ codecompletion.cpp (working copy)
@@ -88,6 +88,7 @@
#endif
static wxCriticalSection s_HeadersCriticalSection;
+/** scopes choice name for global functions in CC's toolbar */
static wxString g_GlobalScope(_T("<global>"));
// this auto-registers the plugin
@@ -597,11 +598,14 @@
{
ConfigManager* cfg = Manager::Get()->GetConfigManager(_T("code_completion"));
bool showScope = cfg->ReadBool(_T("/scope_filter"), true);
+ int choice_scope_length = cfg->ReadInt(_T("/toolbar_scope_length"), 286);
+ int choice_function_length = cfg->ReadInt(_T("/toolbar_function_length"), 660);
if (showScope && !m_Scope)
{
- m_Scope = new wxChoice(m_ToolBar, wxNewId(), wxPoint(0, 0), wxSize(280, -1), 0, 0);
+ m_Scope = new wxChoice(m_ToolBar, wxNewId(), wxPoint(0, 0), wxSize(100, -1), 0, 0);
m_ToolBar->InsertControl(0, m_Scope);
+ m_Function->SetSize(wxSize(choice_function_length,-1));
}
else if (!showScope && m_Scope)
{
@@ -609,8 +613,15 @@
m_Scope = NULL;
}
else
+ {
+ m_Scope->SetSize(wxSize(choice_scope_length,-1));
+ m_Function->SetSize(wxSize(choice_function_length,-1));
+ m_ToolBar->Realize();
+ m_ToolBar->SetInitialSize();
return;
+ }
+
m_ToolBar->Realize();
m_ToolBar->SetInitialSize();
}
@@ -1551,6 +1562,9 @@
ed->GetControl()->CallTipShow(pos, definition);
if (start != 0 && end > start)
ed->GetControl()->CallTipSetHighlight(start, end);
+ //Manager::Get()->GetLogManager()->DebugLog(F(_T("start=%d, end=%d"), start, end));
+ //Manager::Get()->GetLogManager()->DebugLog(F(_T("definition=%s"), definition.wx_str()));
+
}
int CodeCompletion::DoClassMethodDeclImpl()
Index: resources/settings.xrc
===================================================================
--- resources/settings.xrc (revision 7639)
+++ resources/settings.xrc (working copy)
@@ -530,6 +530,56 @@
<border>5</border>
<option>1</option>
</object>
+ <object class="sizeritem">
+ <object class="wxBoxSizer">
+ <object class="sizeritem">
+ <object class="wxStaticText" name="ID_STATICTEXT8">
+ <label>Scope choice length</label>
+ </object>
+ <flag>wxALL|wxALIGN_LEFT|wxALIGN_BOTTOM</flag>
+ <border>5</border>
+ <option>1</option>
+ </object>
+ <object class="sizeritem">
+ <object class="wxSpinCtrl" name="spnChoiceScopeLength">
+ <value>286</value>
+ <min>100</min>
+ <max>600</max>
+ </object>
+ <flag>wxALL|wxALIGN_LEFT|wxALIGN_BOTTOM</flag>
+ <border>5</border>
+ <option>1</option>
+ </object>
+ </object>
+ <flag>wxALL|wxALIGN_LEFT|wxALIGN_BOTTOM</flag>
+ <border>5</border>
+ <option>1</option>
+ </object>
+ <object class="sizeritem">
+ <object class="wxBoxSizer">
+ <object class="sizeritem">
+ <object class="wxStaticText" name="ID_STATICTEXT9">
+ <label>Function choice length</label>
+ </object>
+ <flag>wxALL|wxALIGN_LEFT|wxALIGN_BOTTOM</flag>
+ <border>5</border>
+ <option>1</option>
+ </object>
+ <object class="sizeritem">
+ <object class="wxSpinCtrl" name="spnChoiceFunctionLength">
+ <value>660</value>
+ <min>1</min>
+ <max>800</max>
+ </object>
+ <flag>wxALL|wxALIGN_LEFT|wxALIGN_BOTTOM</flag>
+ <border>5</border>
+ <option>1</option>
+ </object>
+ </object>
+ <flag>wxALL|wxALIGN_LEFT|wxALIGN_BOTTOM</flag>
+ <border>5</border>
+ <option>1</option>
+ </object>
</object>
<flag>wxTOP|wxLEFT|wxRIGHT|wxEXPAND|wxALIGN_LEFT|wxALIGN_BOTTOM</flag>
<border>8</border>
Quote from: ollydbg on December 22, 2011, 05:44:48 AM
if (showScope && !m_Scope)
[...]
else if (!showScope && m_Scope)
[...]
else
+ {
+ m_Scope->SetSize(wxSize(choice_scope_length,-1));
Be careful here - you probably introduced a crash candidate. The else - clause is entered in case:
1.) showScope && m_Scope --> OK
2.) !showScope && !m_Scope --> Not OK -->
NULL pointer access at
m_Scope->SetSize(...).
Maybe I missed something but that's what I see from the patch.
What about this logic:
void CodeCompletion::UpdateToolBar()
{
ConfigManager* cfg = Manager::Get()->GetConfigManager(_T("code_completion"));
bool showScope = cfg->ReadBool(_T("/scope_filter"), true);
int choice_scope_length = cfg->ReadInt(_T("/toolbar_scope_length"), 286);
int choice_function_length = cfg->ReadInt(_T("/toolbar_function_length"), 660);
if (showScope)
{
if(m_Scope)
m_Scope->SetSize(wxSize(choice_scope_length,-1));
else
{
m_Scope = new wxChoice(m_ToolBar, wxNewId(), wxPoint(0, 0), wxSize(choice_scope_length, -1), 0, 0);
m_ToolBar->InsertControl(0, m_Scope);
}
}
else
{
if(m_Scope)
{
m_ToolBar->DeleteTool(m_Scope->GetId());
m_Scope = NULL;
}
}
m_Function->SetSize(wxSize(choice_function_length,-1));
m_ToolBar->Realize();
m_ToolBar->SetInitialSize();
}
Quote from: ollydbg on December 22, 2011, 01:57:32 PM
What about this logic:
Note sure where this portion did go:
+ m_Scope->SetSize(wxSize(choice_scope_length,-1));
+ m_Function->SetSize(wxSize(choice_function_length,-1));
+ m_ToolBar->Realize();
+ m_ToolBar->SetInitialSize();...but the if/then/else looks now OK. ;-)
Quote from: MortenMacFly on December 22, 2011, 02:29:52 PM
Quote from: ollydbg on December 22, 2011, 01:57:32 PM
What about this logic:
Note sure where this portion did go:
+ m_Scope->SetSize(wxSize(choice_scope_length,-1));
+ m_Function->SetSize(wxSize(choice_function_length,-1));
+ m_ToolBar->Realize();
+ m_ToolBar->SetInitialSize();
You typo "Not" -> "Note" made me think more than 5 minutes to guess your meaning. ;D
I think the code above are not needed.
Quote from: ollydbg on December 23, 2011, 12:52:13 AM
You typo "Not" -> "Note" made me think more than 5 minutes to guess your meaning. ;D
Oooops. ;D
Nice ! I'll test it in the next nightly, thank you very much ;)
I hadn't see that :
QuoteI'd also apreciate a toggle that hides/show file tabs, as I never use these : too many files to cycle through, I prefer the project hierarchy on the left.
Is there a way to remove that tab bar ? I never used it too, too many files, I use the worskpace view, really more usefull __for me__ !
I doubt it is possible. But you can try to hack it and then post the patch.
Quote from: Folco on December 23, 2011, 01:47:16 PM
I hadn't see that :
QuoteI'd also apreciate a toggle that hides/show file tabs, as I never use these : too many files to cycle through, I prefer the project hierarchy on the left.
Is there a way to remove that tab bar ? I never used it too, too many files, I use the worskpace view, really more usefull __for me__ !
Quote from: oBFusCATed on December 23, 2011, 09:03:28 PM
I doubt it is possible. But you can try to hack it and then post the patch.
It's easy to do.
If I find the time, I create a patch and post it here.
Quote from: jens on December 24, 2011, 11:04:16 PM
If I find the time, I create a patch and post it here.
Here it comes.
There is a new checkbox: "Settings -> Environment... -> Notebooks appearance -> Hide editor tabs", it's unchecked by default.
Don't forget to run
update[.bat] after compilation.
Btw.: it's not tested on windows.
That's a nice Christmas present ;D ! Thank you jens (and as I have the opportunity : thank you also for your ubuntu repository !)
Thanks Jens, and happy Christmas !!!
(OMG, I had 2⁸ messages before this one \o/)