Guidance
指路人
g.yi.org
Guidance Forums / wxWidgets (wxWindows) in C++ / mutliple inheritance

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. mutliple inheritance
#5052
Posted by: 2004-09-03 20:20:46
 Hi All!,

i'm a newbie...

i'd like to know how i can use multiple inheritance.

i tried :
 
class MyChild: public wxMDIChildFrame, wxScrolledWindow
{
public:

    MyChild(wxMDIParentFrame *parent, const wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, const wxBitmap& bitmap);
	MyChild(wxScrolledWindow *parent);
    virtual ~MyChild();

	void OnPaint(wxPaintEvent& event);

...

    DECLARE_EVENT_TABLE()
};



this is the .h file

and the .cpp file is:

MyChild::MyChild(wxMDIParentFrame *parent, 
				 const wxWindowID id, 
				 const wxString& title,
                 const wxPoint& pos, 
				 const wxSize& size,
				 const wxBitmap& bitmap)
       : wxMDIChildFrame(parent, -1, image_name, 
						wxDefaultPosition, wxDefaultSize), 
						m_bitmap(bitmap),
		 wxScrolledWindow(parent)
{
	...	
}

BEGIN_EVENT_TABLE(MyChild, wxMDIChildFrame) // how can i integrate wxScrolledWindow?
	EVT_PAINT(MyChild::OnPaint)
	EVT_MOUSE_EVENTS(MyChild::OnMouse)
	EVT_SIZE(MyChild::OnSize)
	EVT_SCROLL(MyChild::OnScroll)
	EVT_CHOICE(FUNC_CHOICE, MyChild::OnFuncChoice)
	EVT_CHOICE(SOURCE_CHOICE, MyChild::OnSourceChoice)
	EVT_CHOICE(DEST_CHOICE, MyChild::OnDestChoice)
END_EVENT_TABLE()
  


my problem is that the compiler haves many failures with BEGIN_EVENT_TABLE
Message2. Re: mutliple inheritance
#5208
Posted by: 2004-10-08 04:47:37
Why not to use wxMDIChildFrame with a scroll-bar enabled? I think multiple inheritance is problematic in wxWidgets classes.
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Thu 2022-12-8  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0