Author Topic: Adding support for Bitmap property , wxStaticBitmap widgets  (Read 14297 times)

Offline cyberkoa

  • Plugin developer
  • Almost regular
  • ****
  • Posts: 145
    • http://
Adding support for Bitmap property , wxStaticBitmap widgets
« on: January 12, 2006, 06:53:40 am »
I have committed a changes to add in the bitmap property , and a new widgets : wxStaticBitmap widgets . :)

There are still some part miss out in code generation , basically codes that generated can be compiled and linked with manually adding a <wx/image.h> at the header file , however, there will be a run-time error because the image-handler is not loaded. :(

byo, the code generation engine I just read one round , not very clear how it works , maybe you can give some explanation or suggestion to modify.

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: Adding support for Bitmap property , wxStaticBitmap widgets
« Reply #1 on: January 12, 2006, 11:31:19 am »
i really wonder why your latest commit builds under linux :?

you've added
wxsadvimageproperty.cpp
wxsadvimageproperty.h

but didn't add them to
makefile.am

but it built without errors ... never referenced class ?
« Last Edit: January 12, 2006, 11:35:02 am by tiwag »

Offline cyberkoa

  • Plugin developer
  • Almost regular
  • ****
  • Posts: 145
    • http://
Re: Adding support for Bitmap property , wxStaticBitmap widgets
« Reply #2 on: January 12, 2006, 05:15:10 pm »
i really wonder why your latest commit builds under linux :?

you've added
wxsadvimageproperty.cpp
wxsadvimageproperty.h

but didn't add them to
makefile.am

but it built without errors ... never referenced class ?
thank for informing  :)
frankly say I don't know how to configure to include new files in  automake script..  :oops:
I have just tried to compile in Linux but had not seen the result ..

The reason why it can be compiled I think because only new files (wxsstaticbitmap.cpp & wxsstaticbitmap.h) are referring to this class which also not added into the makefile.am

I shall modify the makefile.am and wxSmith-unix.cbp and commit them tonight.

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: Adding support for Bitmap property , wxStaticBitmap widgets
« Reply #3 on: January 12, 2006, 05:55:37 pm »
@cyberkoa
be careful when editing the makefile.am file, it needs to have lines separated by LF only (no CR+LF as it is DOS/WIN standard )
otherwise it will not build with autotools make system.
best is to edit these files using linux ... and maybe try to build it in linux, it isn't very complicated.  8)

thx, tiwag

sethjackson

  • Guest
Re: Adding support for Bitmap property , wxStaticBitmap widgets
« Reply #4 on: January 12, 2006, 05:59:48 pm »
@cyberkoa
be careful when editing the makefile.am file, it needs to have lines separated by LF only (no CR+LF as it is DOS/WIN standard )
otherwise it will not build with autotools make system.
best is to edit these files using linux ... and maybe try to build it in linux, it isn't very complicated.  8)

thx, tiwag

Can't you just open it in C::B and set End-of-line-mode to LF?

Offline byo

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 837
Re: Adding support for Bitmap property , wxStaticBitmap widgets
« Reply #5 on: January 12, 2006, 06:12:15 pm »
First, thx for adding support for bitmaps. There are some bugs but it's good start point :)

Second thing is 2nd include file required for one widget - try changing Entry() in wxsstdwidgetmanager.cpp to Entry2Headers and it will add 2 header files automatically, image handlers may be loaded when initializing application (there's also automatically-generated code so it souldn't be hard to add :) ).

About generated code - I haven't checked it very well but it seems to work fine :)

Ok, problems I see:

  • global paths for image files - these should be local ones, but currently there's no way to determine what directory should be base
  • property doesn't support images from wxArtProvider classes
  • Maybe wxBITMAP_TYPE_ANY should be used for any type of image ? (I may be wrong)
  • Something is wrong when default size is used - widget should resize to whole image size but it still keep small

Ok, another thing to write here:
I've looked into wxSmith code and realized that it's really junky, hard to understand, and probably buggy in thousands of places, just badly organized  :( :oops: so when I have more time to work on it and when I'll get back here, wxSmith is going to be cleaned, no mercy ;). It's high time to do so

Offline phlox81

  • Multiple posting newcomer
  • *
  • Posts: 53
    • phlox81.de
Re: Adding support for Bitmap property , wxStaticBitmap widgets
« Reply #6 on: January 12, 2006, 06:59:54 pm »
Second thing is 2nd include file required for one widget - try changing Entry() in wxsstdwidgetmanager.cpp to Entry2Headers and it will add 2 header files automatically, image handlers may be loaded when initializing application (there's also automatically-generated code so it souldn't be hard to add :) ).
The required Headers should be a property of your widget-class.

Ok, problems I see:

  • global paths for image files - these should be local ones, but currently there's no way to determine what directory should be base
  • property doesn't support images from wxArtProvider classes
  • Maybe wxBITMAP_TYPE_ANY should be used for any type of image ? (I may be wrong)
  • Something is wrong when default size is used - widget should resize to whole image size but it still keep small
The path to the image file, should be editable by the user -> Property of your staticbitmap class. The user also knows the correct path also.
Also the ImageLoader could be editable by the user, wxBITMAP_TYPE_ANY could be default.
For Size the same.

Ok, another thing to write here:
I've looked into wxSmith code and realized that it's really junky, hard to understand, and probably buggy in thousands of places, just badly organized  :( :oops: so when I have more time to work on it and when I'll get back here, wxSmith is going to be cleaned, no mercy ;). It's high time to do so
I don't know about the code of your plugin, think about a rebuild, even if its much work, it can ease a lot.
I just did that with my CodeGenerator Framework...

phlox

Offline cyberkoa

  • Plugin developer
  • Almost regular
  • ****
  • Posts: 145
    • http://
Re: Adding support for Bitmap property , wxStaticBitmap widgets
« Reply #7 on: January 15, 2006, 06:52:16 am »
@tiwag
next time I shall take note on the CR+LF problem

I am surely will build in Linux , in fact already did that .. my aim is totally develop wxSmith under my Ubuntu Linux in the next few months :)

@byo
Quote
Second thing is 2nd include file required for one widget - try changing Entry() in wxsstdwidgetmanager.cpp to Entry2Headers and it will add 2 header files automatically, image handlers may be loaded when initializing application (there's also automatically-generated code so it souldn't be hard to add .

this should be ok :)
[/quote]

Quote
Ok, problems I see:

    * global paths for image files - these should be local ones, but currently there's no way to determine what directory should be base
this problem I know , plan to solve it eventually
Quote
    * property doesn't support images from wxArtProvider classes
this one .. I haven't study how to use wxArtProvider  .. :oops:  still consider need to customize propgrid or code it on the wxAdvImageproperty
Quote
    * Maybe wxBITMAP_TYPE_ANY should be used for any type of image ? (I may be wrong)
to my understand wxBITMAP_TYPE_ANY will autodetect the image type and load  the image.
Quote
    * Something is wrong when default size is used - widget should resize to whole image size but it still keep small
yup , I know this also but I can't find which place to hook . One thing I notice , the MyPropertyUpdated is coded at wxsstaticline for customize version but I find MyPropertyChanged should be the correct function ?

I can't find way to get the property value before changing unless changing the underlying code , I need that to determine whether the image is the first time been loaded to allow it loaded with the original size.

in fact the wxSmith is quite well form and well commented but my C++ level is not high take time to understand , but slowly catch up :)

@phlox81
 thx for your comment and advice..


Offline SamT

  • Multiple posting newcomer
  • *
  • Posts: 41
Re: Adding support for Bitmap property , wxStaticBitmap widgets
« Reply #8 on: January 22, 2006, 01:34:44 pm »
manually adding a <wx/image.h> at the header file , however, there will be a run-time error because the image-

It's really joy that wxSmith has wxStaticBitmap function. I try to use today however, it fails during compiling. After I saw this mail, I notice that the <wx/image.h> need to be added manually. It's fine after added the include file and pass the compiling stage.

But...

During runtime, it still fails and give me a warning message "No image handler for type 13 defined."

What's the matter? How can I solve this? Any idea?

Thanks!
 

sethjackson

  • Guest
Re: Adding support for Bitmap property , wxStaticBitmap widgets
« Reply #9 on: January 22, 2006, 03:40:57 pm »
manually adding a <wx/image.h> at the header file , however, there will be a run-time error because the image-

It's really joy that wxSmith has wxStaticBitmap function. I try to use today however, it fails during compiling. After I saw this mail, I notice that the <wx/image.h> need to be added manually. It's fine after added the include file and pass the compiling stage.

But...

During runtime, it still fails and give me a warning message "No image handler for type 13 defined."

What's the matter? How can I solve this? Any idea?

Thanks!
 

I have had this same problem..... Either do a full rebuild (of your program) or use wxBITMAP_TYPE_TYPE-YOU-ARE-LOADING.

Ex: for PNG wxBITMAP_TYPE_PNG.

HTH :)

Offline cyberkoa

  • Plugin developer
  • Almost regular
  • ****
  • Posts: 145
    • http://
Re: Adding support for Bitmap property , wxStaticBitmap widgets
« Reply #10 on: January 23, 2006, 03:33:29 am »
sorry SamT,  I have not fix this problem, for the time being I think you need to do as sethjackson.

Recently byo is doing a rewriting of the underlying engine of wxSmith and  advise not temporary hold for the development . 

I shall be back to my home country Malaysia for the coming two weeks and when come back will assist byo to finish up the rewrite , hope that the new engine can improve the wxSmith  performance and stability  :wink:

Offline SamT

  • Multiple posting newcomer
  • *
  • Posts: 41
Re: Adding support for Bitmap property , wxStaticBitmap widgets
« Reply #11 on: January 23, 2006, 02:03:53 pm »
sorry SamT,  I have not fix this problem, for the time being I think you need to do as sethjackson.

Recently byo is doing a rewriting of the underlying engine of wxSmith and  advise not temporary hold for the development . 

I shall be back to my home country Malaysia for the coming two weeks and when come back will assist byo to finish up the rewrite , hope that the new engine can improve the wxSmith  performance and stability  :wink:

No problem   :mrgreen:

I am a hardware engineer in my company. For myself, it's really hard to write a software program because I don't have the knowledge of it. Thanks C::B and wxSmith. Now, I can write a very small program by using these tools. The wxStaticBitmap function can't work at this moment but it doesn't means that will not work forever. Hope to get new engine of wxSmith up and I will be as a tester to do more on it. :wink: