Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Plugins development => Topic started by: Cryogen on July 19, 2010, 10:54:01 pm

Title: Added some of the missing controls to wxSmith
Post by: Cryogen on July 19, 2010, 10:54:01 pm
Adds:
wxBitmapComboBox
wxContextHelpButton
wxDialUpManager
wxHtmlEasyPrinting
wxListView
wxRichTextCtrl
wxSearchCtrl
wxSimpleHtmlListBox
wxTreebook

to wxSmith's control palette.

This patch covers all of the missing controls (I think) excepting wxGridBagSizer and those that required overriding.

I have spent over a month working on wxTreebook and wxGridBagSizer, with only limited success. wxTreebook requires functionality that doesn't exist for the other notebook controls in order to manage the tree hierarchy. I have not been able to find a method that will work within the existing framework, so far, so this patch only allows you to add nodes at the root level via wxSmith. I hope to add the missing functionality in a future update. Since the existing notebook code could do with additional functionality, I intend to revisit the whole thing later.

wxGridBagSizer has also been troublesome and I have spent most of the time on it. The difficulty is, again, due to the fact that this sizer requires additional consideration for cell positioning and spanning and the existing sizer framework doesn't do this. I am close to a solution but it has eluded me so far. I'm also having major problems debugging with GDB 7.1 on both Windows and Linux, which has made life very difficult. Rather than stay bogged down in frustrating details, I'm going to leave this one for later, too.

In this release, files can only be added to wxBitmapComboBox from files. The next release will add the ability to add images from an image list.

Finally, this one also includes a range of improvements and updates for patches 10, 12, 13 & 14 [http://forums.codeblocks.org/index.php/topic,12619.0.html] and reorganises the layout and standard toolbars. For these reasons this patch touches a lot of files. I looked at separating these things from the new controls in another patch but it's become impossible, now, to try to manage different versions of serial patches on a codebase that isn't yet in SVN.

I will try and get a release of the accompanying demo app. out over the next few days so you can see them first hand.

Cheers.
Title: Re: Added some of the missing controls to wxSmith
Post by: seb_seb0 on July 19, 2010, 11:53:24 pm
Hello Cryogen,

I had a lot of problems applying your patches (duplicate code, incompatible changes...)
In addition, I had a bug (crash of codeblocks when editing XPMToolPanel in my XPMEditor plugin).

I do not know the cause of the bug - it comes however from the Bitmap Editor patch.
I tried to debug it, but it did not happen during a debugging session (probably a memory initialisation problem / release)

I provide here a single patch for: Dialogs, Pickers, Media + Animation, Hyperlink, Missing controls. Done against latest SVN
+ wxGLCanvas patched for wx2.9.x (#if #endif construction)
+ wxGrid patch (added 1 event handler wxGRID_CELL_CHANGED)

This patch does not produce the bug.

It will be hopefully easier to apply in the trunk.

Best regards,

Sebastien
Title: Re: Added some of the missing controls to wxSmith
Post by: seb_seb0 on July 19, 2010, 11:56:03 pm
I am also missing some icons for (probably a file missing / mispelled):
  wxHtmlEasyPrinting
  wxDialupManager
  wxContextHelpButton
  wxListView
  wxRichTextCtrl
  wxSearchCtrl
  wxSimpleHtmlListBox
  wxTreebook

Thank you for the good work !

Sebastien
Title: Re: Added some of the missing controls to wxSmith
Post by: Cryogen on July 20, 2010, 06:10:35 am
Hey seb,

I do not know the cause of the bug - it comes however from the Bitmap Editor patch.
I tried to debug it, but it did not happen during a debugging session (probably a memory initialisation problem / release)

Hmmm, sorry about that. It has become just about impossible for me to isolate changes, now. I'm thinking of creating my own off-line repository just to manage this but I'm not sure if that'll do enough. I guess it should work. It might be that something crept in that shouldn't have. I went to a lot of trouble to avoid it but...

I provide here a single patch for: Dialogs, Pickers, Media + Animation, Hyperlink, Missing controls. Done against latest SVN
+ wxGLCanvas patched for wx2.9.x (#if #endif construction)
+ wxGrid patch (added 1 event handler wxGRID_CELL_CHANGED)

This patch does not produce the bug.

It will be hopefully easier to apply in the trunk.

Cool, thanks. I was getting to the point of doing something similar myself.
Title: Re: Added some of the missing controls to wxSmith
Post by: Cryogen on July 20, 2010, 06:12:05 am
I am also missing some icons for (probably a file missing / mispelled):
  wxHtmlEasyPrinting
  wxDialupManager
  wxContextHelpButton
  wxListView
  wxRichTextCtrl
  wxSearchCtrl
  wxSimpleHtmlListBox
  wxTreebook

Did you download the image pack below? It sounds like you missed it.  :wink:

Thank you for the good work !

Sebastien

No problem, thanks.  :D

Title: Re: Added some of the missing controls to wxSmith
Post by: seb_seb0 on July 20, 2010, 07:02:49 am
I am also missing some icons for (probably a file missing / mispelled):
  wxHtmlEasyPrinting
  wxDialupManager
  wxContextHelpButton
  wxListView
  wxRichTextCtrl
  wxSearchCtrl
  wxSimpleHtmlListBox
  wxTreebook

Did you download the image pack below? It sounds like you missed it.  :wink:

Yes I did, and I checked that I had all the icons in my folders "share\..."
I will double check anyway, and let you know.

Sebastien
Title: Re: Added some of the missing controls to wxSmith
Post by: Cryogen on July 20, 2010, 07:19:47 pm
I am also missing some icons for (probably a file missing / mispelled):

Did you download the image pack below? It sounds like you missed it.  :wink:

Yes I did, and I checked that I had all the icons in my folders "share\..."
I will double check anyway, and let you know.

Well they're all in there. Add them to ...\contrib\wxSmith\wxwidgets\icons and either recompile to run the update script or run ...\contrib\wxSmith\update.bat manually. You then need to run C::B's update.bat to get them into src\output.

In future I'll try to remember to create the dir structure in the image zip.

Have fun.
Title: Re: Added some of the missing controls to wxSmith
Post by: seb_seb0 on July 20, 2010, 09:59:23 pm
Mea culpa.
I have double-checked, and I have noticed that I have copied the file to another directory.
It is corrected, and now it works (of course).

Sorry for the disturbance - mistake was on my side.

I have tested the new tools today, and they work good (I did not test wxBitmapComboBox thought, because I could not compile it with the new wxPropGrid patch).

Some information about the patch I send you:
 
  - it takes into account the following patches from your "patchorama"
      Patch12 (animation + media)
      Patch10 (hyperlink)
      Patch13 (dialogs)
      Patch14 (pickers)
      Patch15 (missing controls, excep wxBitmapComboBox)

  - it does NOT take into account:
      Patch16 (propgrid patch: it came too late)
      Patch 1 (image selector : it provokes a bug, for an unknown reason).

  It build without problems on windows vista.
  I have not tested yet other platforms.

Other topic:
  I am approaching the end of the XPMEditor plugin (hopefully). Once I have fixed the remaining bugs, I will gladly give a hand on wxSmith.
  The first thing I would like to see done is a better handling of images in wxSmith : typically your Patch 1 is a very good start.
  You might be aware that rcoll has done another plugin which can be interesting to merge with wxSmith: it is called wxSmithImage. See here: http://forums.codeblocks.org/index.php/topic,12362.0.html (http://forums.codeblocks.org/index.php/topic,12362.0.html) (reply #5)
  It already has code to handle:
    - images lists
    - embedded images in the main wxFrame / wxDialog / wxPanel code.

Let me know what you think.

Sebastien
Title: Re: Added some of the missing controls to wxSmith
Post by: pafarrell on July 20, 2010, 11:31:52 pm
I just updated to CB 10.05 today, because I want to work with media controls.
I installed the Debian pkgs on Ubuntu 9.04.
I was sorry to see the wxMediaCtrl missing.
I also noticed libwxsmith.so was built on May 27, which seems old enough to include cryo's patches up to #12 (thanks Cryo).
Do I need to build from source and apply the diff file myself?  Or are they being included in the berlios *.deb files.
Thanks to all of you for your excellent contributions!!!
(If I need to apply the patch, does 12 include all of the previous ones?)
Title: Re: Added some of the missing controls to wxSmith
Post by: MortenMacFly on July 23, 2010, 07:09:30 am
Adds:
wxBitmapComboBox
wxContextHelpButton
wxDialUpManager
wxHtmlEasyPrinting
wxListView
wxRichTextCtrl
wxSearchCtrl
wxSimpleHtmlListBox
wxTreebook
Just for the record: I am currently testing the whole patch. If it works, I'll commit.

BTW: I assume it_s tested under Linux? Because that'd be a problem for to do me ATM.
Title: Re: Added some of the missing controls to wxSmith
Post by: MortenMacFly on July 23, 2010, 09:09:24 pm
Just for the record: I am currently testing the whole patch. If it works, I'll commit.
Lucky winner: Its accepted an committed to trunk. Some of the new controls I've even already used in other projects using earlier patches of yours. So I thought it's really time to provide your hard work to the community. :-)

Could you please update the "patchorama" now to reflect the submission and make it easier for me to see what's left?

BTW: The weight which you have applied to the different controls might be worth a discussion. But we will see whether there are complains on that issue after the next nightly.

Some information about the patch I send you:
@seb_seb0: Could you please verify that this matches your expectations / experiences? Hopefully I didn't miss something...
Title: Re: Added some of the missing controls to wxSmith
Post by: seb_seb0 on July 23, 2010, 10:35:19 pm
Some information about the patch I send you:
@seb_seb0: Could you please verify that this matches your expectations / experiences? Hopefully I didn't miss something...
[/quote]

I am currently checking out the source (I do a clean check-out so it takes more time).
I will test this week-end and let you know.

Sebastien
Title: Re: Added some of the missing controls to wxSmith
Post by: seb_seb0 on July 25, 2010, 09:12:09 pm
Hello,

sorry for the delay in replying, my computer was overheating and I had to repair it ...
So I have done a clean check-out, and re-compiled everything (nice to see there are DoxyBlocks and NassiSchneidermann plugins).
The results for me are (on Windows Vista - gcc TDM 4.4.1, wxWidgets 2.8.10):
   1 - everything compile fine
   2 - everything was working (I have made quick tests only - maybe new bugs will be discovered later).

I have seen 2 problems:
   1 - icons are missing in wxSmith, for:
             wxHyperLinkCtrl
             wxFindReplaceDialog
             wxFontDialog
             wxMessageDialog
             wxPageSetupDialog
             wxPasswordEntryDialog
             wxPrintDialog
             wxProgressDialog
             wxRichTextFormattingDialog
             wxRichTextStyleOrganizerDialog
             wxTextEntryDialog
             wxColourPicker
             wxDirPickerCtrl
             wxFilePickerCtrl
             wxFontPickerCtrl

            I attach them in the 7z archive

     2 - the wxSmithAUI cbp project file contains 2 targets : Windows & Unix. It leads to a warning message when recompiling the workspace. Is it possible to split the project in 2 files (1 for each target), and add only the Windows target to the workspace ? (and same for UNIX)

     3 - I have many times the same warning regarding wxPropGrid:
Code
..\..\..\sdk\wxpropgrid\include/wx/propgrid/propdev.h:18: warning: type attributes ignored after type is already defined
Would it be possible to remove it ? (probably a #define to do somewhere, or in the compilation line).
 
Title: Re: Added some of the missing controls to wxSmith
Post by: MortenMacFly on July 26, 2010, 08:44:24 am
  1 - icons are missing in wxSmith, for:
Fixed that in SVN.
    2 - the wxSmithAUI cbp project file contains 2 targets : Windows & Unix. It leads to a warning message when recompiling the workspace. Is it possible to split the project in 2 files (1 for each target), and add only the Windows target to the workspace ? (and same for UNIX)
I actually like this idea of having just one project file very much, although it throws an error (actually it's a warning only). I think it's a nice "tech-demo" to explain the "platform" feature of C::B for project files. So I'd rather leave it like it is.
Title: Re: Added some of the missing controls to wxSmith
Post by: seb_seb0 on July 26, 2010, 10:09:41 pm
Fixed that in SVN.
     2 - the wxSmithAUI cbp project file contains 2 targets : Windows & Unix. It leads to a warning message when recompiling the workspace. Is it possible to split the project in 2 files (1 for each target), and add only the Windows target to the workspace ? (and same for UNIX)
I actually like this idea of having just one project file very much, although it throws an error (actually it's a warning only). I think it's a nice "tech-demo" to explain the "platform" feature of C::B for project files. So I'd rather leave it like it is.

OK, actually I was curious - at first, I thought that wxSmithAUI was not built.
And you are right, it is a nice demonstration !
Title: Re: Added some of the missing controls to wxSmith
Post by: seb_seb0 on July 26, 2010, 10:42:02 pm
Hello,

I have a crash occuring with wxBitmapComboBox (on Windows Vista).
Insert a new wxBitmapComboBox in a wxPanel.
Modify the field "number of images" to a positive value in the property grid.

I have tried to debug, but the bug did not appear during debugging.
The bug *seems* to happen in the following lines (in function wxsBitmapComboBox::OnExtraPropertyChanged, in file wxsbitmapcombobox.cpp, start at line 228)
Code
for(int i = m_iNumImages; i < iNewFields; i++) {
                m_arrBitmapIds[i] = Grid->GetGrid()->AppendIn(m_idImages, NEW_IN_WXPG14X wxImageFileProperty(wxString::Format(wxT("%s %d"), sImage.c_str(), i + 1), wxPG_LABEL));
            }
but I have no guarantees for that. Does anybody have an idea ?
If I find a solution, I will post it of course.

Sebastien
Title: Re: Added some of the missing controls to wxSmith
Post by: Cryogen on August 06, 2010, 10:44:37 pm

 Hi Guys,

I'm way behind the discussion due to computer death. It's killing me. :-(

Mea culpa.
I have double-checked, and I have noticed that I have copied the file to another directory.
It is corrected, and now it works (of course).

Sorry for the disturbance - mistake was on my side.

I know. ;-)

Other topic:
  I am approaching the end of the XPMEditor plugin (hopefully). Once I have fixed the remaining bugs, I will gladly give a hand on wxSmith.
  The first thing I would like to see done is a better handling of images in wxSmith : typically your Patch 1 is a very good start.
  You might be aware that rcoll has done another plugin which can be interesting to merge with wxSmith: it is called wxSmithImage. See here: http://forums.codeblocks.org/index.php/topic,12362.0.html (http://forums.codeblocks.org/index.php/topic,12362.0.html) (reply #5)
  It already has code to handle:
    - images lists
    - embedded images in the main wxFrame / wxDialog / wxPanel code.

Let me know what you think.

Yes, I'm already well on the way to integrating parts of that into the mainline code as it adds things we need such as image list management. It's a nice piece of work. I was working on that when the machine died. After being messed about by a local hardware shop I'm now awaiting parts and a warranty repair. Until it's fixed I'm trying to set up CB portable but the box I'm using right now won't even let me run the installer without admin privileges, which of course I don't have. This is where Windows absolutely sucks. So, I'm trying other avenues.


Ciao.
Title: Re: Added some of the missing controls to wxSmith
Post by: Cryogen on August 06, 2010, 10:48:00 pm

 Hi,

I also noticed libwxsmith.so was built on May 27, which seems old enough to include cryo's patches up to #12 (thanks Cryo).
...
Thanks to all of you for your excellent contributions!!!


Any time. ;-)

Do I need to build from source and apply the diff file myself?

Yes, sir.

(If I need to apply the patch, does 12 include all of the previous ones?)

No. That will be stated if it happens.

Cheers.

Title: Re: Added some of the missing controls to wxSmith
Post by: Cryogen on August 06, 2010, 10:48:52 pm

BTW: I assume it_s tested under Linux? Because that'd be a problem for to do me ATM.

You betcha. Always. :-)

Title: Re: Added some of the missing controls to wxSmith
Post by: Cryogen on August 06, 2010, 10:53:17 pm
Just for the record: I am currently testing the whole patch. If it works, I'll commit.
Lucky winner: Its accepted an committed to trunk. Some of the new controls I've even already used in other projects using earlier patches of yours. So I thought it's really time to provide your hard work to the community. :-)

Great, thanks.

Could you please update the "patchorama" now to reflect the submission and make it easier for me to see what's left?

Yes but see my PM for more.

BTW: The weight which you have applied to the different controls might be worth a discussion. But we will see whether there are complains on that issue after the next nightly.

Yes, as suggested some time back. It's currently purely alphabetical, which makes most sense to me although I understand that that moves apart some related controls. I think we probably need to add some tabs and group a few things that way.

Cheers.
Title: Re: Added some of the missing controls to wxSmith
Post by: Cryogen on August 06, 2010, 10:56:30 pm
    2 - the wxSmithAUI cbp project file contains 2 targets : Windows & Unix. It leads to a warning message when recompiling the workspace. Is it possible to split the project in 2 files (1 for each target), and add only the Windows target to the workspace ? (and same for UNIX)

Yes, pleeeeeeeeease get rid of this. It's been like that for ages. ;-)
I think you'll find the same on Unix.

    3 - I have many times the same warning regarding wxPropGrid:
Code
..\..\..\sdk\wxpropgrid\include/wx/propgrid/propdev.h:18: warning: type attributes ignored after type is already defined
Would it be possible to remove it ? (probably a #define to do somewhere, or in the compilation line).
 

I wish. I can't find exactly what causes this. It happens in a few places around C::B. There is a compiler directive which fixes it but I can't get to my code to tell you what it is. Google it.

Bye.
Title: Re: Added some of the missing controls to wxSmith
Post by: Cryogen on August 06, 2010, 10:58:42 pm
I actually like this idea of having just one project file very much, although it throws an error (actually it's a warning only). I think it's a nice "tech-demo" to explain the "platform" feature of C::B for project files. So I'd rather leave it like it is.

I see your point but it's another warning we shouldn't see and it's inconsistent with every other project in the system. Perhaps we need an option within C::B to turn off warnings for other platform projects?

Ciao.
Title: Re: Added some of the missing controls to wxSmith
Post by: Cryogen on August 06, 2010, 11:02:58 pm
Hello,

I have a crash occuring with wxBitmapComboBox (on Windows Vista).
Insert a new wxBitmapComboBox in a wxPanel.
Modify the field "number of images" to a positive value in the property grid.

I have tried to debug, but the bug did not appear during debugging.
The bug *seems* to happen in the following lines (in function wxsBitmapComboBox::OnExtraPropertyChanged, in file wxsbitmapcombobox.cpp, start at line 228)
Code
for(int i = m_iNumImages; i < iNewFields; i++) {
                m_arrBitmapIds[i] = Grid->GetGrid()->AppendIn(m_idImages, NEW_IN_WXPG14X wxImageFileProperty(wxString::Format(wxT("%s %d"), sImage.c_str(), i + 1), wxPG_LABEL));
            }
but I have no guarantees for that. Does anybody have an idea ?
If I find a solution, I will post it of course.

Sebastien

I'll check when I can (don't hold your breath) but this will change with the image manager, anyway. Do you have a number in that field and no path for the image? That might do it. The line you show inserts a path field for each image in iNumImages, which is the number in that "Number of images" field. It also assumes PropGrid 1.4, of course.

Cryo.