1 //Prak3 MFC ohne Assistenten

 2 //Author: Steve Moser

 3 //Email: smoser@anno74.de

 4 //Datum: 4.11.2003

 5 
 6 
 7 #include "mydoc.h"	// XXX

 8 
 9 //************************************************************************

10 //Eigene View Klasse abgeleitet von CSrollView

11 //Hier werden alle Messages das Zeichnen betreffend abgefangen und behandelt

12 //Es handelt sich hier nur um das ClientFenster

13 //************************************************************************

14 class CMyView : public CScrollView
15 {
16     DECLARE_DYNCREATE(CMyView)
17 public:
18     CMyView();
19 
20     virtual void OnDraw(CDC* pDC);  // Überladen, um diese Ansicht darzustellen

21     virtual void OnInitialUpdate();
22     virtual void OnUpdate(CView *pSender,LPARAM lHINT,CObject *pHint);
23 
25 private:							
26 
27     CMyDoc* GetDocument()
28     {
29         return (CMyDoc*)m_pDocument;
30     }
31 
32     bool m_movement;  //wird gesetzt wenn mousemove aktiv

33     bool m_locked;   //wird gesetzt nach capturing (ButtonDown), aufgehoben nach ButtonUp

34 
35     CPoint m_start;  //startpunkt einer figur

36     CPoint m_ende;	  //endpunkt der zu zeichnenden figur

37 
38     HCURSOR m_standard;  //vordefinierter typ für den cursor

39 
40     void InvertLine(CDC* pDC, CPoint start, CPoint ende);	//loescht das bereits gezeichnete

41     CPoint MakeQuadrat(CPoint point);                      //dient zur kreisberechnung

42     void AddToList();                                      //fuegt ein objekt dem pArray hinzu

43 protected:
44 
45     afx_msg void OnSize( UINT,int,int );                   //wird bei scrolloperationen aufgerufen

46     afx_msg void OnLButtonDown (UINT nFlags, CPoint point);
47     afx_msg void OnLButtonUp (UINT nFlags, CPoint point);
48     afx_msg void OnMouseMove(UINT nFlags, CPoint point);
49     afx_msg void OnContextMenu (CWnd * pWnd, CPoint pos);  //initialisiert das rechtemausmenue

50     afx_msg void OnMenuUpdate(UINT ID);                   //gleicht hauptmenue und contextmenue ab

51 
52 
53 
54     DECLARE_MESSAGE_MAP ()
55 };


syntax highlighted by Code2HTML, v. 0.9.1