Author Topic: wxSmithAui plugin: wxAui support for wxSmith  (Read 52256 times)

Offline Ganbito

  • Multiple posting newcomer
  • *
  • Posts: 79
Re: wxSmithAui plugin: wxAui support for wxSmith
« Reply #15 on: February 02, 2009, 07:27:09 pm »
Updated to version: 0.6.2 beta.

FIXED: Non standard properties generation when a standard pane type is selected.

To download the plugin: go to the first post on this topic.

Offline Ganbito

  • Multiple posting newcomer
  • *
  • Posts: 79
Re: wxSmithAui plugin: wxAui support for wxSmith
« Reply #16 on: February 06, 2009, 01:20:57 am »
Is there still a bug in this plugin, because it should call the UnInit() method of wxAuiManager before destroying it, in code and preview generation.

I've searched a lot for it, but I didn't see how to make it with the functions that wxSmith provide me.

Are these implemented and I missed them (please guide me to the methods/classes where I can find it) or it is necessary to modify something in wxSmith to allow this "todo before destroy"?


P.S.: wxAuiToolBar works well with all type of controls in my working copy, now I going to implement wxAuiToolBarItems.

Offline byo

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 837
Re: wxSmithAui plugin: wxAui support for wxSmith
« Reply #17 on: February 07, 2009, 01:21:29 am »
Is there still a bug in this plugin, because it should call the UnInit() method of wxAuiManager before destroying it, in code and preview generation.

I've searched a lot for it, but I didn't see how to make it with the functions that wxSmith provide me.

Are these implemented and I missed them (please guide me to the methods/classes where I can find it) or it is necessary to modify something in wxSmith to allow this "todo before destroy"?


P.S.: wxAuiToolBar works well with all type of controls in my working copy, now I going to implement wxAuiToolBarItems.

Right now there's no such functionality. You can try to workaround this by connection to EVT_CLOSE event but I don't know whether it will work.

Regards
  BYO

Offline Ganbito

  • Multiple posting newcomer
  • *
  • Posts: 79
Re: wxSmithAui plugin: wxAui support for wxSmith
« Reply #18 on: February 11, 2009, 11:44:46 am »
I'm having problems with AuiToolBarItems. These items shouldn't have a variable declaration, so I'm not sending flVariable to the Constructor.

For example, this is the code of the constructor of an separator (which have no styles, no events and no properties):

Code
namespace
{
    #include "../images/wxsAuiToolBarSeparator16.xpm"
    #include "../images/wxsAuiToolBarSeparator32.xpm"

    wxsRegisterItem<wxsAuiToolBarSeparator> Reg(
        _T("wxAuiToolBarSeparator"),            // Class name
        wxsTWidget,                             // Item type
        _T("wxWindows"),                        // License
        _T("Benjamin I. Williams"),             // Author
        _T(""),                                 // Author's email
        _T(""),                                 // Item's homepage
        _T("Aui"),                              // Category in palette
        10,                                     // Priority in palette
        _T("AuiToolBarSeparator"),              // Base part of names for new items
        wxsCPP,                                 // List of coding languages supported by this item
        2, 8,                                   // Version
        wxBitmap(wxsAuiToolBarSeparator32_xpm), // 32x32 bitmap
        wxBitmap(wxsAuiToolBarSeparator16_xpm), // 16x16 bitmap
        false);

    long flAuiToolBarSeparator = flVariable;
}

wxsAuiToolBarSeparator::wxsAuiToolBarSeparator(wxsItemResData* Data):
    wxsItem(Data,&Reg.Info,0,0,0)
{}

With this, I get no properties in the property editor, but this code is created in the declaration section:
Code
wxAuiToolBarSeparator* ;

I'm watching wxSmith code, specially wxsToolBarItem's code and I can't see what I'm doing wrong. Any idea?

By now, wxsAuiToolBar and wxsAuiToolBarItems are not derived from wxsTool. I'm deriving wxsAuiToolBar from wxsContainer. Should I swith to wxsTool? Can it help with this?

Offline rcoll

  • Almost regular
  • **
  • Posts: 150
Re: wxSmithAui plugin: wxAui support for wxSmith
« Reply #19 on: February 11, 2009, 08:28:15 pm »
This looks like it might be a problem with wxSmith not handling flVariable properly (BYO?); but there is an easy work-around.  Override the declarations code with your own version of OnBuildDeclarationsCode, and make the declarations in there that you want (you might just want it to be empty).

Ringo

Offline Ganbito

  • Multiple posting newcomer
  • *
  • Posts: 79
Re: wxSmithAui plugin: wxAui support for wxSmith
« Reply #20 on: February 11, 2009, 10:41:07 pm »
Thanks, rcoll, that was what I need.

I hope to upload an update in the next days.

Offline Ganbito

  • Multiple posting newcomer
  • *
  • Posts: 79
Re: wxSmithAui plugin: wxAui support for wxSmith
« Reply #21 on: February 13, 2009, 09:57:05 pm »
Right now there's no such functionality. You can try to workaround this by connection to EVT_CLOSE event but I don't know whether it will work.

I've tried this, but only works with Exact preview, inside C::B don't. :?

Offline byo

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 837
Re: wxSmithAui plugin: wxAui support for wxSmith
« Reply #22 on: February 14, 2009, 11:40:49 am »
Right now there's no such functionality. You can try to workaround this by connection to EVT_CLOSE event but I don't know whether it will work.

I've tried this, but only works with Exact preview, inside C::B don't. :?

Here are another "workarounds" which came into my mind, unfortunately I haven't tested them yet. All are based by subclassing the wxAuiManager into new class and:
* Can try to overwrite Destroy() function, it's virtual and used to destroy the window. But from my test projects it's not always called
* Can try to call Uninit in descructor of the class

If this won't work, I'll try to add such feature into wxSmith.

Regards
  BYO

Offline Ganbito

  • Multiple posting newcomer
  • *
  • Posts: 79
Re: wxSmithAui plugin: wxAui support for wxSmith
« Reply #23 on: February 15, 2009, 11:22:13 am »
Sorry, I get the solution using EVT_DESTROY but I forget posting it.

But I still don't know how to generate the code in the destruction section, so I'll wait for this feature... when you can add it.

Offline GeO

  • Multiple posting newcomer
  • *
  • Posts: 51
Re: wxSmithAui plugin: wxAui support for wxSmith
« Reply #24 on: February 21, 2009, 02:03:22 pm »
I'm not happy to write this :(, but i found another bug:
if i click on a wxAuiNotebook that haven't any pages Cb crashs

greetings GeO

Offline Ganbito

  • Multiple posting newcomer
  • *
  • Posts: 79
Re: wxSmithAui plugin: wxAui support for wxSmith
« Reply #25 on: February 21, 2009, 05:02:55 pm »
I'm not happy to write this :(, but i found another bug:
if i click on a wxAuiNotebook that haven't any pages Cb crashs

greetings GeO

Confirmed. I'll solve it for the next release (0.8.0) wich is coming soon (this weekend or at the beginning of the next week). With this release will come wxAuiToolBar support (with real preview) wich is almost implemented.

Offline Ganbito

  • Multiple posting newcomer
  • *
  • Posts: 79
Re: wxSmithAui plugin: wxAui support for wxSmith
« Reply #26 on: February 28, 2009, 02:43:36 pm »
Updated to version 0.8.0 beta. Sorry for the delay, I was really busy this week.

FIXED: Code::Blocks crash when click on wxAuiNotebook preview and it has no pages. (Thans GeO for your reports).

ADDED: wxAuiToolBar support with real preview inside Code::Blocks.
    * Any wxControl derived class can be added to wxAuiToolBar, except itself (I see this have no sense, but it can be added in the future, specially if someone claims for it).
    * wxAuiToolBarItems that can be added separately:
        * Item: wxITEM_NORMAL and wxITEM_CHECK. There is only one event supported by these at this moment: wxEVT_COMMAND_TOOL_CLICKED. More can arrive in future releases. These are separated for the other, because the other don't need most properties and I see that it is more easy and intuitive to work with these various items.
        * Separator: wxITEM_SEPARATOR.
        * Label: wxITEM_LABEL. Default width can be chosen, but don't work so good, at least in linux, so you have to specify the width manually or use an wxStaticText instead.
        * Spacer: wxITEM_SPACER. Size can be select as width (in pixels) or proportional, but proportional result in a zero-sized spacer right now.

Pictures for the added items are basically taken from wxSmith and little modified.

Basic wxAui features are implemented. By the way, I have other projects that need my attention, so this will be the last release for a long time with the exception of bug-fix releases.

Byo: As the primary developement stage has ended, I think that this can now be added to wxSmith, because following updates can be easily submitted as patches. I can try to do this, but I need you solve me a pair of questions:
* It is a problem for you that I use CamelCase instead of the smallcase wich all wxSmith is written?
* It is acceptable to put the wxSmithAui with its actual directory layout inside wxSmith (.../wxSmith/wxwidgets/defitems/wxAui/[wxSmithAui source] and .../wxSmith/wxwidgets/icons/wxAui/[wxSmithAui icons])?

If the answer to both is "yes", I can try to fix the #includes and attach the result so you can add it to trunk.


To download the plugin: go to the first post on this topic.
« Last Edit: February 28, 2009, 02:47:18 pm by Ganbito »

Offline PsYhLo

  • Almost regular
  • **
  • Posts: 157
Re: wxSmithAui plugin: wxAui support for wxSmith
« Reply #27 on: March 05, 2009, 11:16:26 am »
i can't compile it :(
Code
........
/home/psyhlo/Desktop/downloads/wxSmithAui/wxAuiManager/wxsAuiManager.cpp||In member function ‘virtual wxObject* wxsAuiManager::OnBuildPreview(wxWindow*, long int)’:|
/home/psyhlo/Desktop/downloads/wxSmithAui/wxAuiManager/wxsAuiManager.cpp|564|error: ‘wxAuiToolBar’ was not declared in this scope|
/home/psyhlo/Desktop/downloads/wxSmithAui/wxAuiManager/wxsAuiManager.cpp|564|error: ‘ChildAsToolBar’ was not declared in this scope|
/home/psyhlo/Desktop/downloads/wxSmithAui/wxAuiManager/wxsAuiManager.cpp|564|error: expected primary-expression before ‘)’ token|
/home/psyhlo/Desktop/downloads/wxSmithAui/wxAuiManager/wxsAuiManager.cpp|564|error: expected `)' before ‘wxCheckDynamicCast’|
/home/psyhlo/Desktop/downloads/wxSmithAui/wxAuiManager/wxsAuiManager.cpp||In member function ‘virtual void wxsAuiManager::OnAddChildQPP(wxsItem*, wxsAdvQPP*)’:|
/home/psyhlo/Desktop/downloads/wxSmithAui/wxAuiManager/wxsAuiManager.cpp|669|error: ‘wxAuiToolBar’ was not declared in this scope|
/home/psyhlo/Desktop/downloads/wxSmithAui/wxAuiManager/wxsAuiManager.cpp|669|error: expected primary-expression before ‘)’ token|
/home/psyhlo/Desktop/downloads/wxSmithAui/wxAuiManager/wxsAuiManager.cpp|669|error: expected `)' before ‘wxCheckDynamicCast’|
/home/psyhlo/Desktop/downloads/wxSmithAui/wxAuiManager/wxsAuiManager.cpp|684|error: expected `)' before ‘}’ token|
/home/psyhlo/Desktop/downloads/wxSmithAui/wxAuiManager/wxsAuiManager.cpp|684|error: expected primary-expression before ‘}’ token|
/home/psyhlo/Desktop/downloads/wxSmithAui/wxAuiManager/wxsAuiManager.cpp|684|error: expected `;' before ‘}’ token|
||=== Build finished: 10 errors, 58 warnings ===|
and after some tweaking :) this
Code
........
/home/psyhlo/Desktop/downloads/wxSmithAui/wxAuiManager/wxsAuiManager.cpp||In member function ‘virtual wxObject* wxsAuiManager::OnBuildPreview(wxWindow*, long int)’:|
/home/psyhlo/Desktop/downloads/wxSmithAui/wxAuiManager/wxsAuiManager.cpp|564|error: invalid static_cast from type ‘wxWindow*’ to type ‘const wxsAuiToolBar*’|
/home/psyhlo/Desktop/downloads/wxSmithAui/wxAuiManager/wxsAuiManager.cpp|564|error: ‘ms_classInfo’ is not a member of ‘wxsAuiToolBar’|
/home/psyhlo/Desktop/downloads/wxSmithAui/wxAuiManager/wxsAuiManager.cpp||In member function ‘virtual void wxsAuiManager::OnAddChildQPP(wxsItem*, wxsAdvQPP*)’:|
/home/psyhlo/Desktop/downloads/wxSmithAui/wxAuiManager/wxsAuiManager.cpp|669|error: invalid static_cast from type ‘wxObject*’ to type ‘const wxsAuiToolBar*’|
/home/psyhlo/Desktop/downloads/wxSmithAui/wxAuiManager/wxsAuiManager.cpp|669|error: ‘ms_classInfo’ is not a member of ‘wxsAuiToolBar’|
||=== Build finished: 4 errors, 58 warnings ===|

ubuntu 8.10
« Last Edit: March 05, 2009, 11:18:27 am by PsYhLo »

Offline Ganbito

  • Multiple posting newcomer
  • *
  • Posts: 79
Re: wxSmithAui plugin: wxAui support for wxSmith
« Reply #28 on: March 05, 2009, 03:55:14 pm »
I'm developing the plugin on Ubuntu 8.04.1 64bits and it compiles with no error, only a few warnings derived from .xpm images generated by the gimp.

What version of wxWidgets are you using?

You can't change "wxAuiToolBar" to "wxsAuiToolBar", are completely different classes, in fact, wxsAuiToolBar is not derived from wxAuiToolBar or any other wxWindow class.

It seems that compiler can't found wxAuiToolBar, but the #include files are correct in the attached version. You can try to include <wx/aui/aui.h> or <wx/aui/auibar.h> in wxAuiManager.cpp. Then report what happen.

Offline PsYhLo

  • Almost regular
  • **
  • Posts: 157
Re: wxSmithAui plugin: wxAui support for wxSmith
« Reply #29 on: March 05, 2009, 06:14:07 pm »
same thing
wxwidgets version is 2.8.8.0

#include <wx/aui/auibar.h> - gave me that there is no such file

my wx library is from ubuntu repository

edit
after update to 2.8.9.2 it nearly works
Code
/home/psyhlo/Desktop/downloads/wxSmithAui/wxAuiManager/wxsAuiManager.cpp|566|error: ‘class wxAuiToolBar’ has no member named ‘m_GripperSize’|
« Last Edit: March 05, 2009, 06:29:31 pm by PsYhLo »