Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development
Adding support for Bitmap property , wxStaticBitmap widgets
byo:
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
phlox81:
--- Quote from: byo on January 12, 2006, 06:12:15 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 :) ).
--- End quote ---
The required Headers should be a property of your widget-class.
--- Quote from: byo on January 12, 2006, 06:12:15 pm ---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
--- End quote ---
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.
--- Quote from: byo on January 12, 2006, 06:12:15 pm ---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
--- End quote ---
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
cyberkoa:
@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 .
--- End quote ---
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
--- End quote ---
this problem I know , plan to solve it eventually
--- Quote --- * property doesn't support images from wxArtProvider classes
--- End quote ---
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)
--- End quote ---
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
--- End quote ---
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..
SamT:
--- Quote from: cyberkoa on January 12, 2006, 06:53:40 am --- manually adding a <wx/image.h> at the header file , however, there will be a run-time error because the image-
--- End quote ---
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:
--- Quote from: SamT on January 22, 2006, 01:34:44 pm ---
--- Quote from: cyberkoa on January 12, 2006, 06:53:40 am --- manually adding a <wx/image.h> at the header file , however, there will be a run-time error because the image-
--- End quote ---
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!
--- End quote ---
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 :)
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version