开发者

draw on child canvas

Create an SDI application that incorporates the following object hierarchy. CVeiw<-(Class derived from CWnd)

• The CWnd class should response to all size notifications and resize accordingly. It should maximize itself to utilise the entire client area. • The class should be able to support the following interfaces. • ShowRectangle() - A rectangle should be drawn anywhere within the client area. • ShowCircle() - The first parameter being a structure that defines the dimension and colour of the circle. • Erase All – Clears the canvas. • The above methods within the class should be invoked when the user chooses Draw -> Circle, Draw -> Rectangle, Draw -> Erase from the menu.(Menu should be generated dynamically)

开发者_开发百科

I have implemented the class Derived from CWnd and a window as child of CVeiw and added dynamic menu and hanlers of them inside Mainfrm.cpp file.

Now my problem is, How to draw on the canvas of child window when events are handled inside the Mainfrm.cpp??


You can also use the view class as a target for the menu events. Move the handlers out of the application class and into the view.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜