?? drawview.h
字號:
// DrawView.h : interface of the CDrawView class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_DrawVIEW_H__0EFFC630_8953_11D2_AE7B_444553540000__INCLUDED_)
#define AFX_DrawVIEW_H__0EFFC630_8953_11D2_AE7B_444553540000__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
class CDrawCntrItem;
class CText;
class TextWriteDlg;
class CDrawView : public CView
{
protected: // create from serialization only
CDrawView();
DECLARE_DYNCREATE(CDrawView)
protected:
float xLeft,xRight,yTop,yBottom,xPage,yPage,xWide,yHigh;
int nPageX,nPageY;
int m_MapMode;
int m_hScreen1,m_wScreen1; //當前視圖的高度和寬度
CWinThread* m_PDrawThread;
int nHScrollMax,nHScrollPos,nVScrollMax,nVScrollPos;
int nXPage,nXLine,nYPage,nYLine,nScrollMin;
float m_xStart,m_yStart,blc; //繪制圖形時的起點坐標和比例尺
int m_hScreen,m_wScreen; //當前視圖的高度和寬度
// int m_CurrentScreen; //當前屏幕的序號
// int m_MaxScreen; //最多能夠有的屏幕數
int m_DrawCurrent; //當前正進行操作的序號
int PushNumb; //記錄按下鼠標的次數
ScreenStruct* p_Screen; //記錄屏幕參數的結構指針
PointStruct *PointXyz; //記錄連續直線頂點坐標的數組指針
CPoint mPointOrign,mPointOrign1,mPointOld;//記錄鼠標移動時的鼠標點頂坐標
short m_pColor; //當前畫筆顏色的序號
short m_bColor; //當前底色的序號
short m_brColor; //當前畫刷顏色的序號
short m_LineWide; //當前直線寬度(像素)
short m_LineType; //當前線型
short m_Layer; //當前層
BOOL b_RunFirst; //是否第一次運行
BOOL DrawArcYes;
//用來存儲圓或圓弧的參數
float m_CircleX,m_CircleY,m_CircleR,m_Angle1,m_Angle2;
//用來存儲標注文字的參數
float m_FontHeight,m_FontWide,m_FontBetween,m_TextAngle,m_FontAngle;
float m_TextX,m_TextY;
CString m_TextString; //存儲標注的文字
// Attributes
CText *m_Text1; //聲明一個文字類
CArc m_Arc1; //聲明一個圓弧類指針
GraphSelectStruct GraphUndo[4]; //聲明一個存儲恢復信息的數組
void InitVScroll(); //設定縱向滾動條
void InitHScroll(); //設定橫向滾動條
public:
CLinkDataSet* m_pLinkSet;
TextWriteDlg *pTextDlg; //標注文字的對話框的指針
CDrawDoc* GetDocument(); //得到文檔類的指針
// TODO: replace this selection mechanism with one appropriate to your app.
CDrawCntrItem* m_pSelection;
public:
void PutTracker(CDrawCntrItem* pItem,CRectTracker* pTracker);
void DPtoVP(float x,float y,int *X,int *Y);
void VPtoDP(int x,int y,float *X,float *Y);
int DLtoVL(float l);
float VLtoDL(int l);
protected:
void DrawBack(CDC* pDC); //用底色繪制屏幕
BOOL jsarc(CPoint p1,CPoint p2,CPoint p3,float *CircleX,float *CircleY,
float *CircleR,float *Angle1,float *Angle2);//由三個點計算圓弧參數
void Delete(CDC* pDC,int Lb,int Index); //刪除圖形操作
BOOL RectCross(float *x1,float *y1,float *x2,float *y2,float xx1,
float yy1,float xx2,float yy2); //計算兩個矩形的交面
void ReDrawRect(float X1,float Y1,float X2,float Y2); //重新繪制視圖的區域
// Operations
public:
// UINT Draw(CDC *pDC);
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDrawView)
public:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
virtual void OnPrepareDC(CDC* pDC, CPrintInfo* pInfo = NULL);
protected:
virtual void OnInitialUpdate(); // called first time after construct
virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
virtual BOOL IsSelected(const CObject* pDocItem) const;// Container support
virtual void OnActivateView(BOOL bActivate, CView* pActivateView, CView* pDeactiveView);
virtual void OnPrint(CDC* pDC, CPrintInfo* pInfo);
//}}AFX_VIRTUAL
// Implementation
public:
LPVOID bmpdata;
HPALETTE hpal;
HBITMAP bhm_ddb;
int nPalate;
void DrawBmp1(CDC* pDC,int x,int y,int wide,int high,UINT idCBitmap,int DrawMode);
void DrawBmp2(CDC* pDC,int x,int y,int wide,int high,char *fName,int DrawMode);
void DrawBmp3(CDC* pDC,int x,int y,int wide,int high,char *fName,int DrawMode);
void DIBtoDDB(HDC hdc);
void make_palette();
virtual ~CDrawView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
// Generated message map functions
protected:
//{{AFX_MSG(CDrawView)
afx_msg void OnDestroy();
afx_msg void OnSetFocus(CWnd* pOldWnd);
afx_msg void OnSize(UINT nType, int cx, int cy);//視圖大小改變時調用
afx_msg void OnInsertObject();
afx_msg void OnCancelEditCntr();
afx_msg void OnDrawArc(); //繪制圓弧
afx_msg void OnDrawCircle(); //繪制圓
afx_msg void OnDrawCircle1(); //繪制圓形區域(填充圓)
afx_msg void OnDrawLine(); //繪制直線
afx_msg void OnDrawPline(); //繪制連續直線
afx_msg void OnDrawRgn(); //繪制多邊形區域
afx_msg void OnDrawText(); //標注文字
afx_msg void DrawText();//在標注文字對話框中填入文字時被調用在屏幕上寫文字
afx_msg void DrawTextOnOk(); //按‘確定'退出標注文字對話框時被調用
afx_msg void DrawTextOnCancel();//按‘放棄'退出標注文字對話框時被調用
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);//按下鼠標左鍵時調用
afx_msg void OnMouseMove(UINT nFlags, CPoint point); //鼠標移動時調用
afx_msg void OnRButtonDown(UINT nFlags, CPoint point);//按下鼠標右鍵時調用
afx_msg void OnGraphRedraw(); //圖形重畫
afx_msg void OnGraphZoom(); //圖形放大
afx_msg void OnGraphPan(); //圖形移動
afx_msg void OnGraphUp(); //重畫上屏圖形
afx_msg void OnGraphFirst(); //重畫首屏圖形
afx_msg void OnGraphAll(); //重畫全屏
afx_msg void OnSelectMouse(); //運行鼠標選中圖形
afx_msg void OnSelectClear(); //放棄選中圖形
afx_msg void OnSelectDelete(); //刪除選中圖形
afx_msg void OnEditCut(); //裁剪選中圖形進裁剪板
afx_msg void OnEditPaste(); //粘貼圖形
afx_msg void OnEditUndo(); //逆向放棄操作
afx_msg void OnEditCopy(); //拷貝選中圖形進裁剪板
afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
afx_msg void OnBitmapCut();
afx_msg void OnBitmapPaste();
afx_msg void OnUpdateEditPaste(CCmdUI* pCmdUI);
afx_msg void OnGraphDraw();
afx_msg void OnChangeDlgEdit();
afx_msg void OnChangeDlgCom();
afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
afx_msg void OnDataSeacher();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
#ifndef _DEBUG // debug version in DrawView.cpp
inline CDrawDoc* CDrawView::GetDocument()
{ return (CDrawDoc*)m_pDocument; }
#endif
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DrawVIEW_H__0EFFC630_8953_11D2_AE7B_444553540000__INCLUDED_)
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -