User forums > General (but related to Code::Blocks)

wxGenericStaticBitmap

(1/4) > >>

spflanze:
I see in the documentation for wxStaticBitmap in the wxWidgets Manual that there are operating systems where this can only be used for 64x64 pixel icons. It is a much larger image I seek to display. So to avoid potential trouble I seek to use wxGenericStaticBitmap as is recommended in that documentation. In Code::Blocks I see in the Standard tab the icon for wxStaticBitmap. I am not able to find a similar icon for wxGenericStaticBitmap in any of the tabs.

What is the best way to get wxGenericStaticBitmap on a form?

Will this have to be manually coded?

oBFusCATed:
There is button for custom controls. It could be used for controls we've not added to wxsmith. Otherwise you could try to add this control to the plugin and provide a patch.

spflanze:
I found a custom icon with the silhouette of a head, and a question mark on its chest. When I drag into the wxStaticBoxSizer I see a dark field with three question marks in it.

I would very much appreciate links to any information on how to use this.

BlueHazzard:
You insert this custom control. Then you set the "class name" property from the left side to your class (wxStaticBitmap).  Then you can use this element like a normal wxSmith element. You can search for youtube videos how to use them...

spflanze:
I inserted the custom control. But instead of setting the "Class name" property to wxStaticBitmap I set it to wxGenericStaticBitmap as the use of this class is the reason for the custom control. The "Var name" property was set to img_Schem_Cascode_Boost, and the Identifier property was set to ID_IMG_SCHEM_CASCODE_BOOST.

In the Code::Blocks generated code the compiler indicated an error line 91:

--- Code: ---TIAFrame::TIAFrame(wxWindow* parent,wxWindowID id)
{
  ...
     img_Schem_Cascode_Boost = new wxGenericStaticBitmap(Panel1,ID_IMG_SCHEM_CASCODE_BOOST,wxPoint(0,0),wxDefaultSize,0,wxDefaultValidator,_T("ID_IMG_SCHEM_CASCODE_BOOST"));  // Line 91
 ...
}

--- End code ---

The errors:

--- Quote ---||=== Build: Debug in TIA (compiler: GNU GCC Compiler) ===|
C:\Engineering Software\TIA\TIAMain.cpp||In constructor 'TIAFrame::TIAFrame(wxWindow*, wxWindowID)':|
C:\Engineering Software\TIA\TIAMain.cpp|91|error: no matching function for call to 'wxGenericStaticBitmap::wxGenericStaticBitmap(wxPanel*&, const long int&, wxPoint, const wxSize&, int, const wxValidator&, const wchar_t [27])'|
C:\Engineering Software\TIA\TIAMain.cpp|91|note: candidates are:|
C:\wxWidgets-3.0.3\include\wx\generic\statbmpg.h|19|note: wxGenericStaticBitmap::wxGenericStaticBitmap(wxWindow*, wxWindowID, const wxBitmap&, const wxPoint&, const wxSize&, long int, const wxString&)|
C:\wxWidgets-3.0.3\include\wx\generic\statbmpg.h|19|note:   no known conversion for argument 3 from 'wxPoint' to 'const wxBitmap&'|
C:\wxWidgets-3.0.3\include\wx\generic\statbmpg.h|18|note: wxGenericStaticBitmap::wxGenericStaticBitmap()|
C:\wxWidgets-3.0.3\include\wx\generic\statbmpg.h|18|note:   candidate expects 0 arguments, 7 provided|
C:\wxWidgets-3.0.3\include\wx\generic\statbmpg.h|15|note: wxGenericStaticBitmap::wxGenericStaticBitmap(const wxGenericStaticBitmap&)|
C:\wxWidgets-3.0.3\include\wx\generic\statbmpg.h|15|note:   candidate expects 1 argument, 7 provided|
||=== Build failed: 1 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|

--- End quote ---

Missing in the Code::Blocks created constructor call in that line 91's instantiation is a parameter of type wxBitmap. Is this a bug in Code::Blocks? What can be done get this working?

I know how to create a wxBitmap type object and I have written the code to create it to pass to wxGenericStaticBitmap::SetBitmap()  .

Navigation

[0] Message Index

[#] Next page

Go to full version