Code::Blocks Forums

User forums => Nightly builds => Topic started by: killerbot on February 20, 2011, 02:09:26 pm

Title: The 20 February 2011 build (7017) is out.
Post by: killerbot on February 20, 2011, 02:09:26 pm
Get quick announcements through the RSS feed http://www.codeblocks.org/nightly/CodeBlock_RSS.xml

Before you use a nightly make sure you understand how it works (http://forums.codeblocks.org/index.php/topic,3232.0.html).

A link to the unicode windows wxWidget dll for Code::Blocks : http://prdownload.berlios.de/codeblocks/wxmsw28u_gcc_cb_wx2810_gcc451-TDM.7z

For those who might need this one (when no MingW installed on your system) : the mingw10m.dll : http://prdownload.berlios.de/codeblocks/mingwm10_gcc451-TDM.7z

The 20 February 2011 build is out.
  - Windows :
   http://prdownload.berlios.de/codeblocks/CB_20110220_rev7017_win32.7z
  - Linux :
   none

Resolved Fixed:


Regressions/Confirmed/Annoying/Common bugs:


Title: Re: The 20 February 2011 build (7017) is out.
Post by: Phenom on February 20, 2011, 08:23:19 pm
The new call tip is really cool!
Title: Re: The 20 February 2011 build (7017) is out.
Post by: Jenna on February 20, 2011, 11:44:30 pm
Debian packages (binaries and sources) for 32-bit and 64-bit systems can be found in my repo (http://apt.jenslody.de/).
Title: Re: The 20 February 2011 build (7017) is out.
Post by: Borr on February 21, 2011, 03:10:52 pm
added to the file line (/// TODO (Borr#1#): Test or // TODO: Test) and save the file.
click the Refresh button
to do list is still empty. although the 10.05 everything works
Title: Re: The 20 February 2011 build (7017) is out.
Post by: jccddd on February 23, 2011, 08:59:55 am
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.
Title: Re: The 20 February 2011 build (7017) is out.
Post by: Jenna on February 23, 2011, 10:00:54 am
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 ?
Can you provide a screenshot ?
Title: Re: The 20 February 2011 build (7017) is out.
Post by: jccddd on February 23, 2011, 02:16:45 pm
My os is windows 7 ultimate 32 bit.A snapshot is attached.

[attachment deleted by admin]
Title: Re: The 20 February 2011 build (7017) is out.
Post by: oBFusCATed on February 23, 2011, 02:44:48 pm
Hm, the problem with different aui style is present on windows, too, very strange.
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).
Title: Re: The 20 February 2011 build (7017) is out.
Post by: Jenna on February 23, 2011, 03:12:46 pm
Hm, the problem with different aui style is present on windows, too, very strange.
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).

I never saw this, are there any steps to reproduce this ?
Title: Re: The 20 February 2011 build (7017) is out.
Post by: oBFusCATed on February 23, 2011, 03:50:59 pm
I get this all the time with my gtk styled notebook, but I think the normal styles have the same problem.
Title: Re: The 20 February 2011 build (7017) is out.
Post by: Phenom on February 24, 2011, 08:53:18 pm
Bug with CC:
Type a function declaration, e.g.:
Code
void 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.
Title: Re: The 20 February 2011 build (7017) is out.
Post by: ollydbg on February 25, 2011, 01:48:19 am
Bug with CC:
Type a function declaration, e.g.:
Code
void 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.
confirm, I will check this bug. :D
Title: Re: The 20 February 2011 build (7017) is out.
Post by: ollydbg on February 25, 2011, 02:27:51 am
Ok, I found the bug. the sample code is:
Code
void foo(int arg1, int arg2)
{
    arg1(
}


you enter the "(" here, and finally, it will call ShowCallTip() function

it seems there are something wrong in this function call (nativeparser.cpp line 1874)
Code
            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);
            }

the *token is actually  "arg1", see:
Quote
> 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
}

But after running this function, the string "full" is below:
Code
> p full
$3 = "void foo(int arg1, int arg2)"
>>>>>>cb_gdb:

So, my guess is there is something wrong with "PrettyPrintToken try to print arg1". :D :D
Title: Re: The 20 February 2011 build (7017) is out.
Post by: oBFusCATed on February 25, 2011, 08:59:22 am
This patch fixes the problem for me, but I've not done extensive testing, so there are chances for other bugs...

Code
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;
Title: Re: The 20 February 2011 build (7017) is out.
Post by: stahta01 on February 25, 2011, 07:07:10 pm
Patch needed for NON-PCH Type Build under Windows (CB_PRECOMP and WX_PRECOMP not defined and NOPCH is defined)

Tim S.

Code
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>
Title: Re: The 20 February 2011 build (7017) is out.
Post by: MortenMacFly on February 25, 2011, 08:03:19 pm
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?
Title: Re: The 20 February 2011 build (7017) is out.
Post by: oBFusCATed on February 25, 2011, 08:30:34 pm
Thanks I'll try these two :)

Probably it will look something like this:
Code
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'm not totally sure that the condition is correct.
Loaden, Ollydbg can you look at it?
Title: Re: The 20 February 2011 build (7017) is out.
Post by: oBFusCATed on February 25, 2011, 10:24:24 pm
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 :)
Title: Re: The 20 February 2011 build (7017) is out.
Post by: Jenna on February 26, 2011, 11:33:22 am
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 :)
I still don't get this error.
Does it happen with self-compiled C::B or only in official nightlies provided by killerbot.
Does it also happen on platforms other than windows ?
I tested it on windows 7 professional 64-bit with self-compiled C::B from (really) clean sources.

EDIT:
Does it only happen if a plugin is used (probably cppcheck like mentined above) or does it happen always ?
Title: Re: The 20 February 2011 build (7017) is out.
Post by: oBFusCATed on February 26, 2011, 12:02:27 pm
The screenshot above was the first time I see it happen on windows. I'm mostly using gentoo linux 64bit + debuggers branch.

Just tried almost clean trunk (rHEAD) and the same problem happens.

Code
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" />

Edit:

This seems to fix it:
Code
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()
Title: Re: The 20 February 2011 build (7017) is out.
Post by: ollydbg on February 26, 2011, 01:10:02 pm
Thanks I'll try these two :)

Probably it will look something like this:
Code
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'm not totally sure that the condition is correct.
Loaden, Ollydbg can you look at it?
Oh my god, the PrettyPrintToken will call recursively. and the condition was too complex to understand. let me have a look deeply.
Title: Re: The 20 February 2011 build (7017) is out.
Post by: oBFusCATed on February 26, 2011, 07:27:52 pm
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:
Code
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 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.

With this patch my other gtk_style patch ( http://smrt.is-a-geek.org/codeblocks/patches/gtk_notebook4.patch ) works super :)
Title: Re: The 20 February 2011 build (7017) is out.
Post by: Jenna on February 26, 2011, 08:31:47 pm
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.

Can you try it with target->SetTabCtrlHeight(-1); commented out ?
I'm not sure if it is still needed.
Title: Re: The 20 February 2011 build (7017) is out.
Post by: ollydbg on February 27, 2011, 03:28:44 am
The condition is something like:
Ok, I understand now, and it should work fine. So I totally agree this fix :D
so, what about this one:

Code
//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)) )

Also, the sentence can added as comments. :D

Title: Re: The 20 February 2011 build (7017) is out.
Post by: oBFusCATed on March 03, 2011, 09:57:19 am
Can you try it with target->SetTabCtrlHeight(-1); commented out ?
I'm not sure if it is still needed.
Removing my patch from above and target->SetTabCtrlHeight(-1); brings the problem back :(
If I don't remove my patch and remove target->SetTabCtrlHeight(-1); it works...
Title: Re: The 20 February 2011 build (7017) is out.
Post by: Jenna on March 03, 2011, 10:00:37 am
Can you try it with target->SetTabCtrlHeight(-1); commented out ?
I'm not sure if it is still needed.
Removing my patch from above and target->SetTabCtrlHeight(-1); brings the problem back :(
If I don't remove my patch and remove target->SetTabCtrlHeight(-1); it works...
Really weird, it still does not happen for me on any machine.
Title: Re: The 20 February 2011 build (7017) is out.
Post by: oBFusCATed on March 03, 2011, 11:44:31 am
I'm using wxGTK 2.8.11 (which is build from the wxPython sources), gtk+ 2.22.1.

And this patch: http://smrt.is-a-geek.org/codeblocks/patches/gtk_notebook4.patch
Title: Re: The 20 February 2011 build (7017) is out.
Post by: Jenna on March 07, 2011, 08:14:34 am
I'm using wxGTK 2.8.11 (which is build from the wxPython sources), gtk+ 2.22.1.

And this patch: http://smrt.is-a-geek.org/codeblocks/patches/gtk_notebook4.patch
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.
I use a modified (and enhanced) version of your gtk-notebook patch.
I still never get it without this patch.
I will set some debug-messages to find the real cause for this issue.
Your workaround works, but I like it more, if I find the real cause.
Title: Re: The 20 February 2011 build (7017) is out.
Post by: Jenna on March 08, 2011, 08:52:01 am
@oBFusCATed :
Could you please test the attached patch (if possible) ?

It moves an improved version of your gtk-notebook stuff into notebookstyles.{cpp|h} and should also fix the issue that some of the notebooks do not use the correct TabArtProvider after a start of C::B.

Improvements to the gtk-notebook stuff:
Always use the close-icon provided by gtk (switching theme now also switches close-icon),
use the foreground-color provided by gtk for active and inactive tabs,
use different height for active tabs (as gtk does it),
use a focus rectangle as gtk does it.

On some themes the "Build messages" tab might be one (or two) pixels too large (height), because the used icon has the wrong size.
If the patch will be committed, I also commit a fixed icon.

If there aren't any objections, I will commit this patch (using gtk as TabArtProvider for auinotebooks if default tab-theme is used on wxGTK systems).
This needs gtk-2.0 as build-dependency on linux.

EDIT:
I just updated the patch to fix an issue with the focus-rectangle on the rightmost tab.
If the tab is clipped, but still has the focus, the focus-rectangle was partially drawn
Title: Re: The 20 February 2011 build (7017) is out.
Post by: oBFusCATed on March 08, 2011, 10:07:18 am
OK, I'll test tonight, but I prefer the style to be in separate file.
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:)
Title: Re: The 20 February 2011 build (7017) is out.
Post by: Jenna on March 08, 2011, 10:24:39 am
OK, I'll test tonight, but I prefer the style to be in separate file.
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:)
I put it into the notebookstyles.{cpp|h} files to keep it consistent with the other two styles we already have.
It would possibly make sense to put the styles in own files inside a subfolder, to make it easier to add new (community-generated ?) styles, without littering the src-folder .
Title: Re: The 20 February 2011 build (7017) is out.
Post by: jccddd on March 08, 2011, 12:24:55 pm
If change the notebook tab style to "default" ,the problem's gone.It shows up when the tab style is changed to visual studio 7.1.
Title: Re: The 20 February 2011 build (7017) is out.
Post by: oBFusCATed on March 08, 2011, 09:40:34 pm
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)...
Also you've lost the Makefile.am changes...
Title: Re: The 20 February 2011 build (7017) is out.
Post by: Jenna on March 08, 2011, 10:56:16 pm
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)...
Also you've lost the Makefile.am changes...
I attach two diffs, one for the header and one for the cpp file.
The diffs compare only the relevant part of the notebokstyles.{h|cpp} files with your files.

The main changes:

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).

The automake-stuff will come with my next patch, it was not on top of my priority list.
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.
Title: Re: The 20 February 2011 build (7017) is out.
Post by: oBFusCATed on March 08, 2011, 11:26:44 pm
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.
The diffs compare only the relevant part of the notebokstyles.{h|cpp} files with your files.
There are many irrelevant changes, so it is hard to follow :(

The main changes:
    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]
1. Probably this should be fixed in the wxGTK, not workarounded?
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 :( -> Darkilouche

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.
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.
OK, my auto-fu is very low...
Title: Re: The 20 February 2011 build (7017) is out.
Post by: Jenna on March 09, 2011, 10:24:33 am
The automake-stuff will come with my next patch, it was not on top of my priority list.

Here it comes.
Some small changes :
focus-rect nowalso includes bitmap and close-icon as done by gtk,
close-button removed from DraSimpleButtun, because it's not used there.

A real fix: texth was used to calculate texty before it was calculated  :oops:
Curiously this issue only leads to an incorrect text-placement in the first tab, if it is not the active tab.
Title: Re: The 20 February 2011 build (7017) is out.
Post by: oBFusCATed on March 09, 2011, 10:29:27 am
But my comment is still regarded as spam...
Title: Re: The 20 February 2011 build (7017) is out.
Post by: Jenna on March 09, 2011, 10:55:23 am
But my comment is still regarded as spam...
Some of my posts are also regarde as spam, especially if they contain many quotes.
Yours  is approved now.
If that happens you can send me or another admin a PM.

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.
The diffs compare only the relevant part of the notebokstyles.{h|cpp} files with your files.
There are many irrelevant changes, so it is hard to follow :(

The main changes:
    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]
1. Probably this should be fixed in the wxGTK, not workarounded?
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 :( -> Darkilouche

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.
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.
OK, my auto-fu is very low...


1. Surely, but it is not yet fixed and it might take a while until this happens (probably never). Sometimes it takes very long until fixes like this will be accepted or it never happens, but it is aminor issue, because changing the icon-theme while C::B is running will not happen so often.
4. Because there is no need to derive it.
5. because of 6. The measuring-font is by default m_selected_font and it is a bold-font, but as far as I have seen all gtk-themes use normal fonts for the tab-labels, if a bold-font is used for measuring, but a normal one is efectively used, the tab-size is too large for the active tab.
8. Just replace all nullptr's with NULL and it is done. I think it's a great enhancement for C::B to use the "real" gtk-theme for the notebooks (if selected) and until it is in wxWidgets, I like to have it in C::B (and as implied in 1. it sometimes take very much time until new things make it into wxWidgets). And I prefer to use nullptr instead of NULL for uninitialized pointers.
9. Should be fixed with the new patch.
The broken theme should be fixed with the new patch (incorrect calculation of texty).
Title: Re: The 20 February 2011 build (7017) is out.
Post by: oBFusCATed on March 09, 2011, 01:04:21 pm
BTW: the forum started to behave strangely... missing posts, when using the 'Show unread post since ...', so someone have changed some setting, which broke it...

1. Why don't we leave it just like it is now and report a problem to wxGTK. It is not a very big problem after all.
8. I would prefer both versions to be very similar, because if this is added to wxGTK it will be added at trunk,
   so wx2.8 won't have it and we would have to support it in C::B.
   If the versions are very different it would be harder to keep them in sync.

I'll test your new patch tonight and report if there are problems.

p.s. probably you should add some copyright names in the license header, so if the code would be included in wxGTK, a license change would be required and as this is a team effort now, all contributors should approve it (I'm not a lawyer, so I could be wrong).
Title: Re: The 20 February 2011 build (7017) is out.
Post by: oBFusCATed on March 09, 2011, 09:43:46 pm
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...
Title: Re: The 20 February 2011 build (7017) is out.
Post by: Jenna on March 12, 2011, 11:24:18 am
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...

Sorry for the delay, time is a little bit limited sometimes.

FireFox does not really use gtk, because it applies it's own themes.


Can you test the attached patch ?
I do not have issues with it until now, but four (or more) eyes see mre than two of course.
Title: Re: The 20 February 2011 build (7017) is out.
Post by: oBFusCATed on March 12, 2011, 05:24:32 pm
FF <= 3.6 uses gtk, I've looked at their code to see how they've done their notebook
In FF > 3.6 they seems to draw the buttons themselves.

I'll test when I'm on linux again...
Title: Re: The 20 February 2011 build (7017) is out.
Post by: Jenna on March 12, 2011, 06:30:47 pm
FF <= 3.6 uses gtk, I've looked at their code to see how they've done their notebook
In FF > 3.6 they seems to draw the buttons themselves.

I'll test when I'm on linux again...
I use 4.0b12 at the moment, but as far as I know the tabs appearance depends on the theme you use.
And all other (native) gtk-2.0 programs use tabs with different heights as far as I know.
The default wxNotebook also uses real gtk-tabs with wxGTK.
Title: Re: The 20 February 2011 build (7017) is out.
Post by: oBFusCATed on March 12, 2011, 07:06:31 pm
I'm on 4.0b13pre or something like that and that's why I've noticed the change.
When I've done the patch FF was 3.6 and the notebook was different... more similar to the gtk-notebook.

wxNotebook uses gtk-notebook directly...
Title: Re: The 20 February 2011 build (7017) is out.
Post by: Jenna on March 12, 2011, 07:21:38 pm
wxNotebook uses gtk-notebook directly...
That's what I meant.
Title: Re: The 20 February 2011 build (7017) is out.
Post by: Jenna on March 12, 2011, 11:07:42 pm
Can you test the attached patch ?
I do not have issues with it until now, but four (or more) eyes see mre than two of course.
There's a minor issue with bitmap-placing (y-value).
Can be fixed by replacing:
Code
        dc.DrawBitmap(page.bitmap,
                      bitmap_offset,
                      tab_rect.y +(tab_rect.height - page.bitmap.GetHeight()) / 2,
                      true);
with
Code
        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);
Title: Re: The 20 February 2011 build (7017) is out.
Post by: oBFusCATed on March 13, 2011, 12:07:06 pm
Looks better now, but there are some problems left:
(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
Title: Re: The 20 February 2011 build (7017) is out.
Post by: Jenna on March 13, 2011, 08:12:54 pm
Looks better now, but there are some problems left:
(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. 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),
2. is fixed with the attached patch,
3. is smaller now, but I did not find a real gtk-notebook with a window-list, so the size might be mre or less a mtter of taste.

The patch is against actual trunk (svn r7055).
Title: Re: The 20 February 2011 build (7017) is out.
Post by: oBFusCATed on March 13, 2011, 08:42:08 pm
1. Will test with this one...
2. What patch?
3. Have you tried FF 4.0b13pre?

Edit:
1. Still broken with your version of Darkilouche. Here I'm on wxGTK 2.8.11 (from wxPython), gtk+-2.22.1-r1...

Also do you have the correct gtk engine for the theme? (I'm not sure which it is thought)
Title: Re: The 20 February 2011 build (7017) is out.
Post by: Jenna on March 13, 2011, 08:51:35 pm
1. Will test with this one...
2. What patch?
3. Have you tried FF 4.0b13pre?
2.  :oops: here it is
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.
Title: Re: The 20 February 2011 build (7017) is out.
Post by: oBFusCATed on March 13, 2011, 10:29:41 pm
1. Will test with this one...
2. What patch?
3. Have you tried FF 4.0b13pre?
2.  :oops: here it is
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...
Title: Re: The 20 February 2011 build (7017) is out.
Post by: Jenna on March 13, 2011, 11:19:34 pm
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. I just made a screenshot to measure them and they have exactly the same diemnsions and placement in all notebooks,
2. Nice to here,
3. I think this can be done.

By the way I reintroduce the GetTabSize-function, because it's used to determine the tab-size in IsTabVisible a function I used for the minimize space stuff in cbAuiNotebook.
I will provide a new patch tomorrow.
It's time for bed now.
Title: Re: The 20 February 2011 build (7017) is out.
Post by: oBFusCATed on March 14, 2011, 12:11:26 am
1. On my system, it is 2-3 pixels higher, no matter of the theme
Title: Re: The 20 February 2011 build (7017) is out.
Post by: Jenna on March 14, 2011, 10:56:50 am
1. On my system, it is 2-3 pixels higher, no matter of the theme
I don't know how to fix (or even try to fix it, if I don't get this issue).

Nevertheless here is an updated patch with a window-list-button that has the same height than the tabs (like in ff4), but a smaller arrow inside.
Title: Re: The 20 February 2011 build (7017) is out.
Post by: oBFusCATed on March 14, 2011, 11:14:28 am
OK, I'll do some debugging to see what is going on there...