wxFlatNotebook
- Billy Bones
- In need of some credit
- Posts: 3
- Joined: Mon Nov 13, 2006 7:54 pm
- Location: Moscow, Russia
- Contact:
Hi eranif, thank you for really great work!
I detected that wxFlatNotebook sample has memory leaks. I compile wxWidgets 2.7.1 as monolithic shared library and wxFlatnotebook 2.1 as shared library. Than I compile sample application and start debugging it under Visual Studio 2005. When I close application and in the output window I saw "detected memory leaks...". I'was really surprised because with wxWidgets 2.6.3 there was any problem...
And one more question: what does mean preprocessor definition 'FNB_USE_AUI'?
Sorry for my bad english, please.
I detected that wxFlatNotebook sample has memory leaks. I compile wxWidgets 2.7.1 as monolithic shared library and wxFlatnotebook 2.1 as shared library. Than I compile sample application and start debugging it under Visual Studio 2005. When I close application and in the output window I saw "detected memory leaks...". I'was really surprised because with wxWidgets 2.6.3 there was any problem...
And one more question: what does mean preprocessor definition 'FNB_USE_AUI'?
Sorry for my bad english, please.
That's not really a memory leak...Billy Bones wrote:Hi eranif, thank you for really great work!
I detected that wxFlatNotebook sample has memory leaks. I compile wxWidgets 2.7.1 as monolithic shared library and wxFlatnotebook 2.1 as shared library. Than I compile sample application and start debugging it under Visual Studio 2005. When I close application and in the output window I saw "detected memory leaks...". I'was really surprised because with wxWidgets 2.6.3 there was any problem...
And one more question: what does mean preprocessor definition 'FNB_USE_AUI'?
Sorry for my bad english, please.
When building flatnotebook as DLL, and using it in your app, there is a singleton object instanciated twice (once in the dll, once in the app).
The "Get" method initializes the copy in the DLL.
When releasing it (calling wxFNBRendererMgrST::Free();), you "free" the copy in the app.
Thus, when closing, memory leak...
I submitted a patch for this. Maybe you should check the SVN repository of wxFlatNotebook, and get the latest version.
I also added files to declare wxFlatNotebook objects in XRC files, as well as minor features and code clean-up.
All your patches exist in the SVN, including this one and the XRC handlers.benedicte wrote:I submitted a patch for this. Maybe you should check the SVN repository of wxFlatNotebook, and get the latest version.
I also added files to declare wxFlatNotebook objects in XRC files, as well as minor features and code clean-up.
This preprocessor is for a demo I was working on with bwilliams, to show possible integration of wxFlatNotebook & AUI.Billy Bones wrote:what does mean preprocessor definition 'FNB_USE_AUI'
If you would like to see what I achieved with minimum code changes, you can try this sample (the source code for this is not integrated into SVN):
http://www.eistware.com/aui_dock/wxFlatNotebookTest.zip
To "play" with it try this:
To add more AUI panes, do the following:
0. Add some tabs using Ctrl + N
1. Set: Edit->Enable Darg and Drop of tabs
2. Set: Edit->Enable Darg and Drop of tabs to foreign notebooks
3. Pull tabs from the main notebook and drop them anywhere but on the their's tab drawing area (the thin area where they are drawn) - the result is that your tab now floats
4. Dock the tab, you can add as many tabs as you want
5. Now that you have some docking panes, play with the styles.
This sample also shows an initial implementation for the wxDockArt class. (the class that is reponsible for drawing the caption area, buttons etc)
/Eran
Hi eranif,
As discussion has grown into a different direction, I continue with my code::blocks/wxFlatNotebook issue here (From the 10.11. nightly thread). I tried the demo in your last post and it doesn't have the issue. Here is a screenshot of what happens, before (top) and after (bottom) opening a new file:
As discussion has grown into a different direction, I continue with my code::blocks/wxFlatNotebook issue here (From the 10.11. nightly thread). I tried the demo in your last post and it doesn't have the issue. Here is a screenshot of what happens, before (top) and after (bottom) opening a new file:
-
- wxWorld Domination!
- Posts: 1339
- Joined: Wed Aug 03, 2005 8:10 am
- Location: BANGALORE, INDIA
- Contact:
Can you please change the name of the wxAui.lib to the wxMSW28[d]_AUI.lib as aui is integrated into wxWidgets with this name. Also for the debug unicode, the flatnotebook character set is not set to unicode and the test project the optimization is enabled for debug unicode causing compilation error as /o2 and /zi used in the same project. Also I find the Release Unicode missing project.
Eran,
The drop-down arrow is not drawn correctly when wxFNB_NO_X_BUTTON is used.
I looked at the source, and it seems that the same bitmap (m_xBgBmp) is used to draw the background for both the drop-down arrow and the x button, and if the x button is not drawn, then the background bitmap is not initialized correctly, thus the background is all black. (I think)
Here is a patch which fixes it:
The drop-down arrow is not drawn correctly when wxFNB_NO_X_BUTTON is used.
I looked at the source, and it seems that the same bitmap (m_xBgBmp) is used to draw the background for both the drop-down arrow and the x button, and if the x button is not drawn, then the background bitmap is not initialized correctly, thus the background is all black. (I think)
Here is a patch which fixes it:
Code: Select all
Index: renderer.cpp
===================================================================
--- renderer.cpp (revision 3)
+++ renderer.cpp (working copy)
@@ -205,7 +205,7 @@
xbmp.SetMask(new wxMask(xbmp, MASK_COLOR));
// erase old bitmap
int posx = GetDropArrowButtonPos( pc );
- dc.DrawBitmap(m_xBgBmp, posx, 6);
+ dc.DrawBitmap(m_rightBgBmp, posx, 6);
// Draw the new bitmap
dc.DrawBitmap(xbmp, posx, 6, true);
There is a bug on wxFlatNotebook.cpp:
The codes miss out this line to trigger the PAGE_CHANGING event:
GetEventHandler()->ProcessEvent(event);
Code: Select all
void wxFlatNotebook::SetSelection(size_t page)
{
//......
if( m_sendPageChangeEvent )
{
// Allow the user to veto the selection
int oldSelection = GetSelection();
wxFlatNotebookEvent event(wxEVT_COMMAND_FLATNOTEBOOK_PAGE_CHANGING, GetId());
event.SetSelection( (int)page );
event.SetOldSelection( oldSelection );
event.SetEventObject( this );
if( !event.IsAllowed() )
{
return;
}
}
//......
}
GetEventHandler()->ProcessEvent(event);
MadEdit
This is a Text/Hex Editor for Linux & Win32
This is a Text/Hex Editor for Linux & Win32
-
- Ultimate wxWidgets Guru
- Posts: 536
- Joined: Fri Jan 07, 2005 3:44 pm
- Location: Finland
- Contact:
Would it be possible for you to make some checks for the wxWidgets 2.8.0 version? Particularly the following should be changed:
TIA
Since Inside() was declared deprecated. If I'm not mistaken, Inside() should be replaced with Contains() (at least it worked for me).wxFlatNotebook.cpp(1036) : error C2039: 'Inside' : is not a member of 'wxRect'
d:\wxWidgets-2.8.0-rc1\include\wx\gdicmn.h(329) : see declaration of 'wxRect'
TIA
Visual C++ 9.0 / Windows XP Pro SP3 / wxWidgets 2.9.0 (SVN) | Colligere
I already compiled it with 2.7 and fixed all deprecated calls to Inside --> Contains, however, the reason I am delaying with it is because there is a major bug in 2.7.1 which only recently fixed in CVS head by VZ which causes the Ctrl+Tab functionality not to work.
Until an official release with this issue fixed is released, I dont think I will work on porting it to 2.8 (which in the worth case will take couple of hours)
Eran
Until an official release with this issue fixed is released, I dont think I will work on porting it to 2.8 (which in the worth case will take couple of hours)
Eran
-
- Super wx Problem Solver
- Posts: 264
- Joined: Mon Aug 07, 2006 3:25 pm
- Location: Baia Mare, Romania
- Contact:
making a macro with the xpm files
Hi,
Would it be to much to ask to put a macro that will "fake" the compiler not to display "not used" warining messages.
Something like:
Would be no problem with a shared library (so/dll). I compile FNB into my binary, so i always see 10+ lines of warnings and sometimes i miss some other warining becuase I don't pay attention to them.
The macro I posted does the job. Of course it's faulty (if you look real carefully ), but with gcc 4.1.0 it works .
There might be other solutions , like putting an inline method into a class wich "uses" the icons.
Cheers
Would it be to much to ask to put a macro that will "fake" the compiler not to display "not used" warining messages.
Something like:
Code: Select all
#define FNB_USE_XPM_ICONS(name) static char ** name##FNB___used___xpm__ = 1 ? name : name##FNB___used___xpm__ ;
////////////////////////////////////////////////////////////
// Images used by the control
////////////////////////////////////////////////////////////
/* XPM */
static char *left_arrow_disabled_xpm[] = {
/* width height num_colors chars_per_pixel */
" 16 16 8 1",
/* colors */
"` c #008080",
". c #555555",
"# c #000000",
"a c #000000",
"b c #000000",
"c c #000000",
"d c #000000",
"e c #000000",
/* pixels */
"````````````````",
"````````````````",
"````````````````",
"````````.```````",
"```````..```````",
"``````.`.```````",
"`````.``.```````",
"````.```.```````",
"`````.``.```````",
"``````.`.```````",
"```````..```````",
"````````.```````",
"````````````````",
"````````````````",
"````````````````",
"````````````````"
};
FNB_USE_XPM_ICONS(left_arrow_disabled_xpm)
The macro I posted does the job. Of course it's faulty (if you look real carefully ), but with gcc 4.1.0 it works .
There might be other solutions , like putting an inline method into a class wich "uses" the icons.
Cheers
Software is like sex,
It's better when it's free.
~Linus Torvalds
It's better when it's free.
~Linus Torvalds
-
- Super wx Problem Solver
- Posts: 264
- Joined: Mon Aug 07, 2006 3:25 pm
- Location: Baia Mare, Romania
- Contact:
Is there any possibility to display tabs in 2 rows?
Anyone working on stuff like this?
I noticed a bug (wx 2.6.3) , when using VS8 tabs + close button on tab the close button is not drawn and the blue gradient from the buttons are drawn on the inactive tabs even if I set non-active tab colors, this thing keeps happening.
Regards
Anyone working on stuff like this?
I noticed a bug (wx 2.6.3) , when using VS8 tabs + close button on tab the close button is not drawn and the blue gradient from the buttons are drawn on the inactive tabs even if I set non-active tab colors, this thing keeps happening.
Regards
Software is like sex,
It's better when it's free.
~Linus Torvalds
It's better when it's free.
~Linus Torvalds
Hi,
Anyway, I upgraded my wxWidgets to 2.8 so if I will fix this - it will be against my 2.8 build
Eran
No.framepointer wrote: Is there any possibility to display tabs in 2 rows? Very Happy
Not currently, I might have a look on it this weekend.framepointer wrote: Anyone working on stuff like this?
Can you post a screensoht?framepointer wrote: I noticed a bug (wx 2.6.3) , when using VS8 tabs + close button on tab the close button is not drawn and the blue gradient from the buttons are drawn on the inactive tabs even if I set non-active tab colors, this thing keeps happening.
Anyway, I upgraded my wxWidgets to 2.8 so if I will fix this - it will be against my 2.8 build
Eran
-
- Super wx Problem Solver
- Posts: 264
- Joined: Mon Aug 07, 2006 3:25 pm
- Location: Baia Mare, Romania
- Contact:
Hi,
I checked out the latest version from svn, works like a charm
One more thing that might be done is change
to get the parent font if any .
I use smaller fonts in my app and the notebook uses the default, much larger fonts.
For example in exceed all fonts in the app are huge, so i set the font explicitly to something smaller (10px usually).
Cheers
PS: in the linux makefile, under wx 2.6.3 there is problem with the wx-config arguments. Usually to compile wx stuff under linux you need 'wx-config --cxxflags --libs', the debug argument didn't work for me
I checked out the latest version from svn, works like a charm
One more thing that might be done is change
Code: Select all
wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT)
I use smaller fonts in my app and the notebook uses the default, much larger fonts.
For example in exceed all fonts in the app are huge, so i set the font explicitly to something smaller (10px usually).
Cheers
PS: in the linux makefile, under wx 2.6.3 there is problem with the wx-config arguments. Usually to compile wx stuff under linux you need 'wx-config --cxxflags --libs', the debug argument didn't work for me
Software is like sex,
It's better when it's free.
~Linus Torvalds
It's better when it's free.
~Linus Torvalds