A bug still exists with the message output.When you open a project and run cppcheck plugin or other tools,the output messages run out of the message window and cover up the editor area,you have to resize the ide to make everything clear.Which OS are you on ?
Hm, the problem with different aui style is present on windows, too, very strange.I never saw this, are there any steps to reproduce this ?
Jens have you tried to understand why it is happening?
The bug is that the log's notebook uses different style, than the other two notebooks (see the attached screenshot).
void foo(int arg1, int arg2)
Bug with CC:confirm, I will check this bug. :D
Type a function declaration, e.g.:Codevoid foo(int arg1, int arg2)
Inside the function body, type an argument's name and an '(' character. The call tip for that function is shown.
void foo(int arg1, int arg2)
{
arg1(
}
else
{
wxString s;
wxString full;
if(!PrettyPrintToken(full, *token, *tokens))
full = wxT("Error while pretty printing token!");
BreakUpInLines(s, full, chars_per_line);
m_CallTips.Add(s);
}
> p *token
$2 = {
<BlockAllocated<Token, 50000u, false>> = {
static allocator = {
allocBlocks = std::vector of length 1, capacity 1 = {0xdaa0020},
first = 0xdb565a0,
ref_count = 0,
max_refs = 0,
total_refs = 0
}
},
members of Token:
m_Type = "int",
m_ActualType = "int",
m_Name = "arg1",
m_Args = "",
m_BaseArgs = "",
m_AncestorsString = "",
m_TemplateArgument = "",
m_FileIdx = 6,
m_Line = 10,
m_ImplFileIdx = 0,
m_ImplLine = 0,
m_ImplLineStart = 0,
m_ImplLineEnd = 0,
m_Scope = tsUndefined,
m_TokenKind = tkVariable,
m_IsOperator = false,
m_IsLocal = false,
m_IsTemp = true,
m_IsConst = false,
m_ParentIndex = 429,
m_Children = std::set with 0 elements,
m_Ancestors = std::set with 0 elements,
m_DirectAncestors = std::set with 0 elements,
m_Descendants = std::set with 0 elements,
m_Aliases = 0 count of wxArrayString,
m_TemplateType = 0 count of wxArrayString,
m_TemplateMap = std::map with 0 elements,
m_TemplateAlias = "",
m_UserData = 0x0,
m_TokensTree = 0x6939f30,
m_Self = 3111,
m_Ticket = 3383
}
> p full
$3 = "void foo(int arg1, int arg2)"
>>>>>>cb_gdb:
Index: src/plugins/codecompletion/nativeparser.cpp
===================================================================
--- src/plugins/codecompletion/nativeparser.cpp (revision 7025)
+++ src/plugins/codecompletion/nativeparser.cpp (working copy)
@@ -1727,7 +1727,9 @@
bool PrettyPrintToken(wxString &result, Token const &token, TokensTree const &tokens, bool root = true)
{
- if (token.m_ParentIndex != -1)
+ if (token.m_ParentIndex != -1 &&
+ ((token.m_TokenKind == tkConstructor) || (token.m_TokenKind == tkFunction)
+ || (token.m_TokenKind == tkClass) || (token.m_TokenKind == tkNamespace)))
{
if (!PrettyPrintToken(result, *tokens.at(token.m_ParentIndex), tokens, false))
return false;
Index: src/sdk/projectfileoptionsdlg.cpp
===================================================================
--- src/sdk/projectfileoptionsdlg.cpp (revision 7028)
+++ src/sdk/projectfileoptionsdlg.cpp (working copy)
@@ -12,6 +12,7 @@
#ifndef CB_PRECOMP
#include "cbproject.h"
#include "compilerfactory.h"
+ #include "editormanager.h"
#include "logmanager.h"
#include "projectmanager.h"
#include <wx/xrc/xmlres.h>
This patch fixes the problem for me, but I've not done extensive testing, so there are chances for other bugs...Thanks! But probably it's better to use tkAnyContainer || tkAnyFunction?
Index: src/plugins/codecompletion/nativeparser.cpp
===================================================================
--- src/plugins/codecompletion/nativeparser.cpp (revision 7025)
+++ src/plugins/codecompletion/nativeparser.cpp (working copy)
@@ -1727,7 +1727,7 @@
bool PrettyPrintToken(wxString &result, Token const &token, TokensTree const &tokens, bool root = true)
{
- if (token.m_ParentIndex != -1)
+ if (token.m_ParentIndex != -1 && (token.m_TokenKind & (tkAnyContainer | tkAnyFunction)) != 0)
{
if (!PrettyPrintToken(result, *tokens.at(token.m_ParentIndex), tokens, false))
return false;
I never saw this, are there any steps to reproduce this ?The steps for non gtk-style patched C::B is to switch to the VC 7.1 style, then restart C::B.
I still don't get this error.I never saw this, are there any steps to reproduce this ?The steps for non gtk-style patched C::B is to switch to the VC 7.1 style, then restart C::B.
The other styles seem to work, I should check them :)
Index: update
===================================================================
--- update (revision 7028)
+++ update (working copy)
@@ -97,12 +97,12 @@
rm excludes.txt
echo Stripping debug info from output tree
-strip output/codeblocks${EXEEXT}
+###strip output/codeblocks${EXEEXT}
# strip output/cb_share_config${EXEEXT}
strip output/cb_console_runner${EXEEXT}
# strip output/codesnippets${EXEEXT}
-strip output/*.${LIBEXT}
-strip output/share/codeblocks/plugins/*.${LIBEXT}
+###strip output/*.${LIBEXT}
+###strip output/share/codeblocks/plugins/*.${LIBEXT}
if [ "x$MSYSTEM" = "x" ] ; then
echo Creating launch-scripts
Index: src/main.cpp
===================================================================
--- src/main.cpp (revision 7028)
+++ src/main.cpp (working copy)
@@ -1055,9 +1055,11 @@
PluginManager* m_PluginManager = Manager::Get()->GetPluginManager();
// user paths first
- wxString path = ConfigManager::GetPluginsFolder(false);
- Manager::Get()->GetLogManager()->Log(_("Scanning for plugins in ") + path);
- int count = m_PluginManager->ScanForPlugins(path);
+ int count = 0;
+ wxString path;
+// path = ConfigManager::GetPluginsFolder(false);
+// Manager::Get()->GetLogManager()->Log(_("Scanning for plugins in ") + path);
+// count += m_PluginManager->ScanForPlugins(path);
// global paths
path = ConfigManager::GetPluginsFolder(true);
Index: CodeBlocks-unix.cbp
===================================================================
--- CodeBlocks-unix.cbp (revision 7028)
+++ CodeBlocks-unix.cbp (working copy)
@@ -159,7 +159,7 @@
<Option working_dir="devel" />
<Option type="0" />
<Option compiler="gcc" />
- <Option parameters="--debug-log --multiple-instance -ns -ni" />
+ <Option parameters="--debug-log --multiple-instance -ns -ni -p debug" />
<Option projectLinkerOptionsRelation="2" />
<Compiler>
<Add option="-DENABLE_BINRELOC" />
Index: src/notebookstyles.cpp
===================================================================
--- src/notebookstyles.cpp (revision 7028)
+++ src/notebookstyles.cpp (working copy)
@@ -197,7 +197,7 @@
int x_ext = 0;
wxSize s = GetTabSize(dc, wnd, wxT("ABCDEFGHIj"), wxNullBitmap, true,
wxAUI_BUTTON_STATE_HIDDEN, &x_ext);
- return s.y + 4;
+ return s.y + 6;
}
NbStyleFF2::NbStyleFF2() : wxAuiDefaultTabArt()
Thanks I'll try these two :)Oh my god, the PrettyPrintToken will call recursively. and the condition was too complex to understand. let me have a look deeply.
Probably it will look something like this:CodeI'm not totally sure that the condition is correct.Index: src/plugins/codecompletion/nativeparser.cpp
===================================================================
--- src/plugins/codecompletion/nativeparser.cpp (revision 7025)
+++ src/plugins/codecompletion/nativeparser.cpp (working copy)
@@ -1727,7 +1727,7 @@
bool PrettyPrintToken(wxString &result, Token const &token, TokensTree const &tokens, bool root = true)
{
- if (token.m_ParentIndex != -1)
+ if (token.m_ParentIndex != -1 && (token.m_TokenKind & (tkAnyContainer | tkAnyFunction)) != 0)
{
if (!PrettyPrintToken(result, *tokens.at(token.m_ParentIndex), tokens, false))
return false;
Loaden, Ollydbg can you look at it?
Index: src/src/main.cpp
===================================================================
--- src/src/main.cpp (revision 7028)
+++ src/src/main.cpp (working copy)
@@ -724,6 +724,10 @@
if (!Manager::IsBatchBuild())
{
m_pInfoPane = new InfoPane(this);
+
+ long closestyle = Manager::Get()->GetConfigManager(_T("app"))->ReadBool(_T("/environment/tabs_close_on_all"))?wxAUI_NB_CLOSE_ON_ALL_TABS:0;
+ DoUpdateEditorStyle(m_pInfoPane, _T("infopane"), closestyle | wxAUI_NB_DEFAULT_STYLE);
+
m_LayoutManager.AddPane(m_pInfoPane, wxAuiPaneInfo().
Name(wxT("MessagesPane")).Caption(_("Logs & others")).
BestSize(wxSize(clientsize.GetWidth(), bottomH)).//MinSize(wxSize(50,50)).
The condition is something like: if the token has parents and the token is a container or a function, then pretty print the parent of the token.
Jens:
I think this patches works around the problem:
[...]
The problem happens, because wxAuiNotebook::UpdateTabCtrlHeight is called.
Inside it there is some call to the cloning of the ArtProvider and probably something is pointing to the wrong/old ArtProvider.
Unfortunately I don't understand the way wxAUI works, nor how C::B uses it, so I can't debug further.
I couldn't reproduce it with the auidemo in wx2.9's sources.
The condition is something like:Ok, I understand now, and it should work fine. So I totally agree this fix :D
//if the token has parents and the token is a container or a function, then pretty print the parent of the token.
if (token.m_ParentIndex != -1 && (token.m_TokenKind & (tkAnyContainer | tkAnyFunction)) )
Can you try it with target->SetTabCtrlHeight(-1); commented out ?Removing my patch from above and target->SetTabCtrlHeight(-1); brings the problem back :(
I'm not sure if it is still needed.
Really weird, it still does not happen for me on any machine.Can you try it with target->SetTabCtrlHeight(-1); commented out ?Removing my patch from above and target->SetTabCtrlHeight(-1); brings the problem back :(
I'm not sure if it is still needed.
If I don't remove my patch and remove target->SetTabCtrlHeight(-1); it works...
I'm using wxGTK 2.8.11 (which is build from the wxPython sources), gtk+ 2.22.1.In the meantime, I get this issue also, but not always and if I get it, it happens for "Logs & others" and the "Management"-pane.
And this patch: http://smrt.is-a-geek.org/codeblocks/patches/gtk_notebook4.patch
OK, I'll test tonight, but I prefer the style to be in separate file.I put it into the notebookstyles.{cpp|h} files to keep it consistent with the other two styles we already have.
I had an idea to show it to the wx guys, so it can be included in wxGTK, by default.
But I'm lacking the motivation to talk to them:)
Jens: Can you apply your changes over my patch, so I can see what you've changed (no naming changes please, for now at least)...I attach two diffs, one for the header and one for the cpp file.
Also you've lost the Makefile.am changes...
I attach two diffs, one for the header and one for the cpp file.There are many irrelevant changes, so it is hard to follow :(
The diffs compare only the relevant part of the notebokstyles.{h|cpp} files with your files.
The main changes:1. Probably this should be fixed in the wxGTK, not workarounded?1.I removed
GetIcon() and m_close_icon completely, because wxGTK seems not to update the "gtk-close" icon if the theme is changed, only on program startup.[/li][/list]
2.I fetch the actual close-icon from stock and rescale it if necessary to the wanted size (16x16)[/li][/list]
3.The wanted close-icon-size is set as static variable, I also added a setter-function to change the size, but it is actually not used[/li][/list]
4.I removed completely GetTabSize[/li][/list]
5.I use m_normal_font as measuring-font in GetBestTabCtrlSize()[/li][/list]
6.I always use normal font (for all tabs as gtk seems to do it), a better approach would surely be to get the actual notebook-font from gtk if possible[/li][/list]
7.I changed ArrowStateAndShadow() to return values for disabled, hovered, pressed and normal buttons, according to the way it is done in by gtk[/li][/list]
8.I use nullptr instead of NULL, wherever it is possible[/li][/list]
9.I overwork DrawTab() at many places to create tabs with different height for normal and selected tabs, to fetch the actual close-button from gtk-stock, to draw a focus-rect and to place the bitmap and the label[/li]
[/list]
To fix the issue with not correctly applied/used TabArtProvider, I use target->SetTabCtrlHeight(0); before applying the new ArtProvider and target->SetTabCtrlHeight(-1); after applying it. Doing so seems to fix the issue (at least here).This seems to work, probably you can apply it separately...
The automake-stuff will come with my next patch, it was not on top of my priority list.OK, my auto-fu is very low...
I do not use your GTK2 test from configure.in, because we already test for it some lines later, I just remove the if-xlause around the test, as we need it for C::B's core now.
The automake-stuff will come with my next patch, it was not on top of my priority list.
But my comment is still regarded as spam...Some of my posts are also regarde as spam, especially if they contain many quotes.
Okay, you've broken my theme -> http://smrt.is-a-geek.org/codeblocks/screens/cb_gtk_tool_breakage.png
On the second row is the working version with my patch, forth row is screenshot from pidgin.I attach two diffs, one for the header and one for the cpp file.There are many irrelevant changes, so it is hard to follow :(
The diffs compare only the relevant part of the notebokstyles.{h|cpp} files with your files.The main changes:1. Probably this should be fixed in the wxGTK, not workarounded?1.I removed
GetIcon() and m_close_icon completely, because wxGTK seems not to update the "gtk-close" icon if the theme is changed, only on program startup.[/li][/list]
2.I fetch the actual close-icon from stock and rescale it if necessary to the wanted size (16x16)[/li][/list]
3.The wanted close-icon-size is set as static variable, I also added a setter-function to change the size, but it is actually not used[/li][/list]
4.I removed completely GetTabSize[/li][/list]
5.I use m_normal_font as measuring-font in GetBestTabCtrlSize()[/li][/list]
6.I always use normal font (for all tabs as gtk seems to do it), a better approach would surely be to get the actual notebook-font from gtk if possible[/li][/list]
7.I changed ArrowStateAndShadow() to return values for disabled, hovered, pressed and normal buttons, according to the way it is done in by gtk[/li][/list]
8.I use nullptr instead of NULL, wherever it is possible[/li][/list]
9.I overwork DrawTab() at many places to create tabs with different height for normal and selected tabs, to fetch the actual close-button from gtk-stock, to draw a focus-rect and to place the bitmap and the label[/li]
[/list]
4. Why?
5. Why, too?
8. Don't do it please, the main idea was to prepare this for inclusion in wxGTK, not distributed in C::B
9. Seems broken with my theme :( -> DarkiloucheTo fix the issue with not correctly applied/used TabArtProvider, I use target->SetTabCtrlHeight(0); before applying the new ArtProvider and target->SetTabCtrlHeight(-1); after applying it. Doing so seems to fix the issue (at least here).This seems to work, probably you can apply it separately...The automake-stuff will come with my next patch, it was not on top of my priority list.OK, my auto-fu is very low...
I do not use your GTK2 test from configure.in, because we already test for it some lines later, I just remove the if-xlause around the test, as we need it for C::B's core now.
Jens:
The new patch doesn't fix my theme...
Probably, you've calculated too large height of the tab.
The nice edge at the bottom is missing, see the screen shot I've made...
This border is missing from many themes I have on my machine
(my themes are old, because I've not updated theme for the last 6-12 months, but I doubt it makes a difference)
Some themes are even more broken. This is because they want to make the notebook higher that possible (probably) in wxAuiNotebook.
Probably that is why I've not done the selected tab is higher thing. Firefox does the same -> all tabs have the same height...
One very broken theme is "Milke 2.3"...
The focus rectangle is very broken in the "MurrinaAqualsh" theme....
On all themes the text is moving in the wrong direction (up instead of down), when the tab is unselected.
On the other hand, your patch does many things well...
The fonts are always working, which my patch does not do successfully.
The close button is placed, correctly, for all themes, my patch failed on some of them...
FF <= 3.6 uses gtk, I've looked at their code to see how they've done their notebookI use 4.0b12 at the moment, but as far as I know the tabs appearance depends on the theme you use.
In FF > 3.6 they seems to draw the buttons themselves.
I'll test when I'm on linux again...
wxNotebook uses gtk-notebook directly...That's what I meant.
Can you test the attached patch ?There's a minor issue with bitmap-placing (y-value).
I do not have issues with it until now, but four (or more) eyes see mre than two of course.
dc.DrawBitmap(page.bitmap,
bitmap_offset,
tab_rect.y +(tab_rect.height - page.bitmap.GetHeight()) / 2,
true);
int bitmapY = tab_rect.y +(tab_rect.height - page.bitmap.GetHeight()) / 2;
if(!page.active)
bitmapY += m_Ythickness;
dc.DrawBitmap(page.bitmap,
bitmap_offset,
bitmapY,
true);
Looks better now, but there are some problems left:1. I already have seen this issue with one or two themes, but can not reproduce it now (Darkilouche from http://art.gnome.org/download/themes/gtk2/1285/GTK2-Darkilouche.tar.bz2 (http://art.gnome.org/download/themes/gtk2/1285/GTK2-Darkilouche.tar.bz2) also works well),
(only tested with my theme):
1. Height calculations in the Log's notebook are wrong (there are 1 or 2 pixels more then needed).
2. The close button has the same problem as the text in the previous patch -> when the tab is deactivated the icon moves up instead of down. (I've applied your patch plus the change in the last post).
3. The drop list button is larger, than it should be, with my patch it is the correct size.
Screenshot showing 2 and 3: http://smrt.is-a-geek.org/codeblocks/screens/cb_gtk_tool_breakage2.png
1. Will test with this one...2. :oops: here it is
2. What patch?
3. Have you tried FF 4.0b13pre?
1. The new patch fixes it or in fact it workarounds it somehow, because the it draws correctly but the log's notebook buttons are 2-3 pixels higher than the buttons in the editor's notebook.1. Will test with this one...2. :oops: here it is
2. What patch?
3. Have you tried FF 4.0b13pre?
3. I use iceweasel (the unbranded debian-build of ff) version is rc1 at the moment, here the button has the same height than the tabs, but the arrow inside is quite small. As I wrote its matter of taste, but in ff it looks good.
1. The new patch fixes it or in fact it workarounds it somehow, because the it draws correctly but the log's notebook buttons are 2-3 pixels higher than the buttons in the editor's notebook.
2. Fixed
3. Yes, not it looks better, but probably we should make it look the same as FF, so there is a bit of uniformity...
1. On my system, it is 2-3 pixels higher, no matter of the themeI don't know how to fix (or even try to fix it, if I don't get this issue).