Also, hier sind meine Quellcodes:
abgeleiteter header:
Code: Alles auswählen
#ifndef __ImageDisplayImageFrame__
#define __ImageDisplayImageFrame__
/**
@file
Subclass of ImageFrame, which is generated by wxFormBuilder.
*/
#include "ImageDisplay.h"
#include <wx/bitmap.h>
/** Implementing ImageFrame */
class ImageDisplayImageFrame : public ImageFrame
{
protected:
// Handlers for ImageFrame events.
void OnPaint( wxPaintEvent& event );
public:
/** Constructor */
ImageDisplayImageFrame( wxWindow* parent );
void setBitmap(wxBitmap Bitamp){m_Bitmap = Bitamp;};
wxBitmap m_Bitmap;
private:
};
#endif // __ImageDisplayImageFrame__
header:
Code: Alles auswählen
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 16 2008)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __ImageDisplay__
#define __ImageDisplay__
#include <wx/string.h>
#include <wx/frame.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Class ImageFrame
///////////////////////////////////////////////////////////////////////////////
class ImageFrame : public wxFrame
{
private:
protected:
// Virtual event handlers, overide them in your derived class
virtual void OnPaint( wxPaintEvent& event ){ event.Skip(); }
public:
ImageFrame( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT("Image"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 800,800 ), long style = wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL );
~ImageFrame();
};
#endif //__ImageDisplay__
cpp:
Code: Alles auswählen
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 16 2008)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "ImageDisplay.h"
///////////////////////////////////////////////////////////////////////////
ImageFrame::ImageFrame( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxFrame( parent, id, title, pos, size, style )
{
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
// Connect Events
this->Connect( wxEVT_PAINT, wxPaintEventHandler( ImageFrame::OnPaint ) );
}
ImageFrame::~ImageFrame()
{
// Disconnect Events
this->Disconnect( wxEVT_PAINT, wxPaintEventHandler( ImageFrame::OnPaint ) );
}
abgeleitete cpp:
Code: Alles auswählen
#include "ImageDisplayImageFrame.h"
#include "wx/dcclient.h"
#include <wx/msgdlg.h>
ImageDisplayImageFrame::ImageDisplayImageFrame( wxWindow* parent )
:
ImageFrame( parent )
{
}
void ImageDisplayImageFrame::OnPaint( wxPaintEvent& event )
{
wxPaintDC pdc(this);
PrepareDC(pdc);
pdc.DrawBitmap(m_Bitmap,3,25,true);
wxMessageBox(wxT("event kommt"));
}
Falls mir jemand sagen kann wie bzw. ob ich die onPaint noch anmelden muss wäre das sehr hilfreich..