亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? diagrameditor.cpp

?? 大家用過UML的流程圖設(shè)計器吧
?? CPP
?? 第 1 頁 / 共 5 頁
字號:
/* ==========================================================================
	Class :			CDiagramEditor

	Author :		Johan Rosengren, Abstrakt Mekanik AB

	Date :			2004-03-29

	Purpose :		"CDiagramEditor" encapsulates a basic vector editor geared 
					towards diagrams rather than graphics. It supports 
					virtual screens both smaller and larger than the window, 
					snap to grid, copy/paste, unlimited undo, zoom etc. It 
					can be added to both dialogbox- and doc/view apps due to 
					the use of a separate container for data.

					Normally, this class need only to be inherited from when 
					the drawing functionality is insufficient - many of the 
					settings can be modified through member accessors.

	Description :	The class derives from "CWnd", and handles Windows messages 
					relevant to the operations. 

	Usage :			

   ========================================================================
	Changes :		8/4  2004	SendMessageToObjects sets TRUE flag
								sending message only to selected objects.
					9/4  2004	Made some message mapping functions
								virtual to allow enhancements in 
								derived classes.
					9/4  2004	Added accessors for states to allow
								access for derived classes
					28/4 2004	Set interact mode to MODE_NONE after
								ctrl+clicking item (to not move lines)
					28/4 2004	Setting scrollbar positions to zero
								in Clear
					29/4 2004	Sending this window as a parent to the 
								property dialog. This is to be able to 
								redraw the editor properly after changes 
								to the dialog.
					30/4 2004	Changed c-style casts to static_cast
					30/4 2004	Remove ShowProperties-const-ness.
   ========================================================================
					14/5 2004	Added access to m_subMode in 
								SetInteractMode
					14/5 2004	Made OnObjectCommand virtual to allow 
								interception in derived classes.
					15/5 2004	Made GetBackgroundColor const.
					20/5 2004	Made SelectAll virtual.
					24/5 2004	Added virtual size check against the client 
								rect in HScroll and VScroll (Graham).
   ========================================================================
					24/6 2004	Corrected bug in SetZoom, where the minimum
								zoom value was not honoured (pgrohs).
					24/6 2004	Zeroing m_internalData after delete to 
								avoid crash. (pgrohs).
					26/6 2004	Added group handling (Unruled Boy).
   ========================================================================
					26/6 2004	Corrected bug in alignment handling - all 
								objects, not only selected, where modified.
								Also made functions virtual.
					29/6 2004	Added ZoomToFitScreen and 
								mousewheel-handling (John A. Johnson).
					30/6 2004	Added panning (John A. Johnson).
					3/7	 2004	Made AddObject virtual and added the virtual 
								MoveObject function. This is to allow 
								trapping of added or moved objects in the 
								editor in derived classes. Also made 
								clipboard-functions and DeleteAllSelected 
								virtual.
					5/7	2004	Made Clear virtual.
					5/7	2004	Added virtual GetCursor function.
					6/7	2004	Correction in VirtualToScreen, not deducting 
								scrollbar positions any longer (Wolfgang Busch).
					6/7	2004	Coordinate conversion functions made public.
								(Wolfgang Busch).
   ========================================================================
					12/7 2004	Added scroll wheel mode. By calling 
								SetScrollWheelMode( WHEEL_SCROLL/WHEEL_ZOOM), 
								the scroll wheel will either scroll or zoom.
   ========================================================================
					16/7 2004	Added virtual to more message handlers, 
								among them the scrollbar ones.
					16/7 2004	Added virtual to SetZoom.
					16/7 2004	Added virtual functions to set the 
								scrollbar positions to get one single point 
								where this is made.
					25/7 2004	Checking if the cursor is outside of 
								restraint when placing an item in 
								OnLButtonDown.
   ========================================================================
					3/8	 2004	Added ScrollIntoView commands
					4/8	 2004	Fixed bug with selection markers - 
								virtualization of the mouse coordinates was 
								in discord with the selection marker 
								rectangles. (Marc G)
   ========================================================================
					9/8	 2004	Added new ScrollIntoView command taking 
								object as an inparam.
					19/8 2004	Fixed bug in hit testing objects when 
								zooming in OnLButtonDown (Marc G)
   ========================================================================
					28/8 2004	Added check for non-normalized rect when 
								hit-testing in OnLButtonDown, as lines 
								have them.
   ========================================================================
					11/12 2004	Added minimum step size one pixel in 
								OnKeyDown to avoid 0-pixel movement for
								arrow keys (Graham G Pearson)
					11/12 2004	Made UnselectAll virtual (Grisha Vinevich)
  ========================================================================*/

#include "stdafx.h"
#include "DiagramEditor.h"
#include <math.h>

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

#pragma warning( disable : 4706 )

/////////////////////////////////////////////////////////////////////////////
// CDiagramEditor construction/destruction/initialization

CDiagramEditor::CDiagramEditor()
/* ============================================================
	Function :		CDiagramEditor::CDiagramEditor
	Description :	Constructor
	Access :		Public

	Return :		void
	Parameters :	none

	Usage :			

   ============================================================*/
{

	m_bkgndCol = ::GetSysColor( COLOR_WINDOW );
	m_nonClientBkgndCol = ::GetSysColor( COLOR_3DSHADOW );

	m_gridCol = RGB( 192, 192, 192 );
	m_grid = TRUE;
	m_gridStyle = PS_SOLID;
	m_gridSize = CSize( 8, 8 );

	m_snap = FALSE;
	m_bgResize = FALSE;
	m_bgResizeZone = 10;
	m_bgResizeSelected = FALSE;
	m_markerSize = CSize( 8, 8 );

	m_drawObj = NULL;
	m_objs = NULL;
	m_multiSelObj = NULL;
	m_internalData = NULL;

	m_restraint = RESTRAINT_NONE;

	m_leftMargin = 8;
	m_topMargin = 8;
	m_rightMargin = 8;
	m_bottomMargin = 16;
	m_margin = FALSE;
	m_marginColor = RGB( 128, 128, 255 );

	m_popupMenu = NULL;
	m_multiDraw = FALSE;

	m_zoomFactor = 0.01;
	m_zoomMax = 10.0;
	m_zoomMin = 0.0;

	m_panningTimer = 100;
	m_panning = FALSE;

	m_keyInterface = KEY_ALL;

	m_cursorNorth		= ::LoadCursor( NULL, IDC_SIZENS );
	m_cursorNorthEast	= ::LoadCursor( NULL, IDC_SIZENESW );
	m_cursorEast		= ::LoadCursor( NULL, IDC_SIZEWE );
	m_cursorSouthEast	= ::LoadCursor( NULL, IDC_SIZENWSE );
	m_cursorSouth		= ::LoadCursor( NULL, IDC_SIZENS );
	m_cursorSouthWest	= ::LoadCursor( NULL, IDC_SIZENESW );
	m_cursorWest		= ::LoadCursor( NULL, IDC_SIZEWE );
	m_cursorNorthWest	= ::LoadCursor( NULL, IDC_SIZENWSE );

	SetScrollWheelMode( WHEEL_SCROLL );

	Clear();

}

CDiagramEditor::~CDiagramEditor()
/* ============================================================
	Function :		CDiagramEditor::~CDiagramEditor
	Description :	Destructor
	Access :		Public

	Return :		void
	Parameters :	none

	Usage :			

   ============================================================*/
{

	delete m_drawObj;
	delete m_internalData;
	delete m_popupMenu;

}

void CDiagramEditor::Clear()
/* ============================================================
	Function :		CDiagramEditor::Clear
	Description :	Clears internal run-time variables.
	Access :		Public

	Return :		void
	Parameters :	none

	Usage :			Call to reset internal states.

   ============================================================*/
{

	// Clearing internal states and vars
	m_selectionRect.SetRectEmpty();
	m_interactMode = MODE_NONE;
	m_zoom = 1.0;
	m_bgResizeSelected = FALSE;
	m_deltaPoint = CSize( 0, 0 );
	m_multiSelObj = NULL;
	m_drawing = FALSE;

	SetPanning( FALSE );

	delete m_drawObj;
	m_drawObj = NULL;

	if( m_hWnd )
	{

		SetupScrollbars();
		SetHScroll( 0 );
		SetVScroll( 0 );

		RedrawWindow();

	}

}

BOOL CDiagramEditor::Create( DWORD dwStyle, const RECT &rect, CWnd *pParentWnd, CDiagramEntityContainer* data )
/* ============================================================
	Function :		CDiagramEditor::Create
	Description :	Creates a "CDiagramEditor" window.
	Access :		Public

	Return :		BOOL							-	"TRUE" if success
	Parameters :	DWORD dwStyle					-	Window styles for 
														the editor
					const RECT &rect				-	Window rectangle
					CWnd *pParentWnd				-	Parent of the 
														editor
					CDiagramEntityContainer* data	-	Pointer to data. 
														Might be "NULL".
					
	Usage :			If data is "NULL", a "CDiagramEntityContainer" 
					will be created internally, and the instance 
					of the editor will be responsible for the 
					container deletion.

   ============================================================*/
{
	if( data == NULL )
	{
		m_internalData = new CDiagramEntityContainer;
		SetInternalDiagramEntityContainer( m_internalData );
	}
	else
		SetDiagramEntityContainer( data );

	BOOL res = CWnd::Create( NULL, NULL, dwStyle, rect, pParentWnd, NULL );
	CSize virtualSize;
	if( GetVirtualSize().cx == 0 &&  GetVirtualSize().cy == 0 )
		virtualSize = CSize( rect.right - rect.left, rect.bottom - rect.top );
	else
		virtualSize = GetVirtualSize();

	SetInternalVirtualSize( virtualSize );

	return res;

}

void CDiagramEditor::New()
/* ============================================================
	Function :		CDiagramEditor::New
	Description :	Clears the current 'page' and creates a 
					new one.
	Access :		Public

	Return :		void
	Parameters :	none

	Usage :			Call to start a new drawing.

   ============================================================*/
{

	SetRedraw( FALSE );
	Clear();
	m_objs->Clear();
	SetRedraw( TRUE );
	RedrawWindow();

}

void CDiagramEditor::SetDiagramEntityContainer( CDiagramEntityContainer* objs )
/* ============================================================
	Function :		CDiagramEditor::SetDiagramEntityContainer
	Description :	Sets the data container for the editor.
	Access :		Public
					
	Return :		void
	Parameters :	CDiagramEntityContainer* objs	-	the data 
														container
					
	Usage :			If this function is used, the caller is 
					responsible for deleting the container. Can 
					be called before or after "Create".

   ============================================================*/
{

	if( m_internalData )
		delete m_internalData;

	m_internalData = NULL;

	SetInternalDiagramEntityContainer ( objs );

}

void CDiagramEditor::SetInternalDiagramEntityContainer( CDiagramEntityContainer* objs )
/* ============================================================
	Function :		CDiagramEditor::SetInternalDiagramEntityContainer
	Description :	Sets the internal data container pointer.
	Access :		Protected

	Return :		void
	Parameters :	CDiagramEntityContainer* objs	-	A pointer to the 
														container to set.
					
	Usage :			Internal function.

   ============================================================*/
{

	m_objs = objs;

}

CDiagramEntityContainer* CDiagramEditor::GetDiagramEntityContainer() const
/* ============================================================
	Function :		CDiagramEditor::GetDiagramEntityContainer
	Description :	Returns a pointer to the data container.
	Access :		Public

	Return :		CDiagramEntityContainer*	-	The current data 
													container (might 
													be "NULL").
	Parameters :	none

	Usage :			If modifications are made to the contents of 
					the container, "SetModified" must be called as 
					appropriate. If visual changes are expected, 
					"RedrawWindow" must be called for the editor.

   ============================================================*/
{

	return m_objs;

}

BEGIN_MESSAGE_MAP( CDiagramEditor, CWnd )
	//{{AFX_MSG_MAP( CDiagramEditor )
	ON_WM_PAINT()
	ON_WM_ERASEBKGND()
	ON_WM_SETCURSOR()
	ON_WM_SIZE()
	ON_WM_HSCROLL()
	ON_WM_VSCROLL()
	ON_WM_LBUTTONDOWN()
	ON_WM_LBUTTONUP()
	ON_WM_RBUTTONUP()
	ON_WM_RBUTTONDOWN()
	ON_WM_MOUSEMOVE()
	ON_WM_GETDLGCODE()
	ON_WM_KEYDOWN()
	ON_WM_LBUTTONDBLCLK()
	ON_WM_MBUTTONDOWN()
	//}}AFX_MSG_MAP

	ON_WM_KILLFOCUS()
	ON_WM_TIMER()
	ON_WM_MOUSEWHEEL()
	ON_COMMAND_RANGE( CMD_START, CMD_END, OnObjectCommand )

	ON_COMMAND( ID_EDIT_CUT, OnEditCut )
	ON_COMMAND( ID_EDIT_COPY, OnEditCopy )
	ON_COMMAND( ID_EDIT_PASTE, OnEditPaste )
	ON_COMMAND( ID_EDIT_GROUP, OnEditGroup )
	ON_COMMAND( ID_EDIT_UNGROUP, OnEditUngroup )

END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CDiagramEditor painting

void CDiagramEditor::OnPaint() 
/* ============================================================
	Function :		CDiagramEditor::OnPaint
	Description :	Draws the screen. A memory "CDC" is created 
					and drawn to.
	Access :		Protected

	Return :		void
	Parameters :	none

	Usage :			Called from MFC. Do not call from code.

   ============================================================*/
{

	CPaintDC outputdc( this );

	// Getting coordinate data
	CRect rect;
	GetClientRect( &rect );

	SCROLLINFO sih;
	sih.cbSize = sizeof( SCROLLINFO );
	sih.fMask = SIF_POS;
	SCROLLINFO siv;
	siv.cbSize = sizeof( SCROLLINFO );
	siv.fMask = SIF_POS;
	if( !GetScrollInfo( SB_HORZ, &sih ) )
		sih.nPos = 0;
	if( !GetScrollInfo( SB_VERT, &siv ) )
		siv.nPos = 0;

	CRect totalRect;
	int virtwidth = round( static_cast< double >( GetVirtualSize().cx ) * GetZoom() ) + 1;
	int virtheight = round( static_cast< double >( GetVirtualSize().cy ) * GetZoom() ) + 1;
	totalRect.SetRect( 0, 0, virtwidth, virtheight );

	// Creating memory CDC
	CDC dc;
	dc.CreateCompatibleDC( &outputdc );
	CBitmap bmp;

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩一区二区电影| 欧美福利一区二区| 欧美在线一二三四区| 欧美视频自拍偷拍| 精品国精品自拍自在线| 欧美亚洲国产一区二区三区| 日韩午夜av一区| 中文字幕一区二区在线播放| 亚洲高清不卡在线| 国产成人免费9x9x人网站视频| 色综合天天狠狠| 在线不卡a资源高清| 国产亚洲成aⅴ人片在线观看| 亚洲六月丁香色婷婷综合久久 | 亚洲亚洲精品在线观看| 美脚の诱脚舐め脚责91 | 亚洲欧洲另类国产综合| 水野朝阳av一区二区三区| 国产成人亚洲综合a∨婷婷| 欧美性感一区二区三区| 久久久久久久久99精品| 午夜久久久久久电影| 成人午夜av电影| 欧美精品v日韩精品v韩国精品v| 精品电影一区二区| 一区二区三区不卡视频| 国产成人aaaa| 国产精品素人视频| 蜜臀av性久久久久蜜臀av麻豆| 粉嫩久久99精品久久久久久夜| 91精品国产丝袜白色高跟鞋| 亚洲欧美日韩国产成人精品影院| 男女男精品视频| 欧美日韩一区二区三区在线| 2023国产精品视频| 美女网站色91| 日韩一区二区三区电影在线观看| 一区在线观看免费| 国产精品88888| 日韩精品最新网址| 亚洲国产精品久久不卡毛片 | 成人精品免费看| xnxx国产精品| 亚洲国产视频在线| 色999日韩国产欧美一区二区| 国产精品视频一区二区三区不卡| 久久99精品久久久久久动态图| 欧美色中文字幕| 一区二区三区四区激情| 不卡电影免费在线播放一区| 国产欧美日韩亚州综合| 国产酒店精品激情| 日韩天堂在线观看| 色综合天天天天做夜夜夜夜做| 国产精品毛片无遮挡高清| 成人在线一区二区三区| 亚洲国产精品传媒在线观看| 国产成人精品在线看| 国产精品午夜在线| 一本一道久久a久久精品 | 在线观看91视频| 日韩国产一区二| 国产亚洲精品中文字幕| 91国偷自产一区二区开放时间 | 成人中文字幕电影| 亚洲一区二区三区视频在线| 日韩欧美一二三区| 成人av第一页| 蜜臀av一区二区在线免费观看| 中文一区一区三区高中清不卡| 欧美日韩高清在线播放| 国产成a人亚洲| 天天色天天操综合| 亚洲国产成人午夜在线一区| 欧美影视一区在线| 国产麻豆精品theporn| 亚洲影院免费观看| 中文字幕乱码一区二区免费| 在线免费观看视频一区| 国产一区 二区| 天堂久久久久va久久久久| 国产精品伦理在线| 欧美大片一区二区三区| 91福利国产精品| 国产69精品久久久久毛片| 亚洲va国产va欧美va观看| 国产精品午夜久久| 精品播放一区二区| 欧美人狂配大交3d怪物一区 | 懂色av噜噜一区二区三区av| 日韩国产一区二| 亚洲在线观看免费| 国产精品麻豆久久久| 久久精品水蜜桃av综合天堂| 6080午夜不卡| 在线观看一区日韩| 成人网在线播放| 国产精品99久久久久| 免费观看30秒视频久久| 亚洲一区二区三区中文字幕| 亚洲欧美中日韩| 国产精品国产三级国产普通话蜜臀 | 久久国产欧美日韩精品| 午夜精品久久久久久久久久久| 亚洲图片激情小说| 18欧美乱大交hd1984| 欧美国产一区在线| 中文字幕精品三区| 国产情人综合久久777777| 26uuu国产在线精品一区二区| 日韩一区二区三区视频在线观看| 91精品国产综合久久久蜜臀图片| 欧美日韩免费视频| 欧美日韩国产高清一区二区| 欧美优质美女网站| 在线观看欧美精品| 欧美性大战久久久久久久蜜臀 | 欧美成人一区二区三区片免费| 91精品国产综合久久精品性色| 欧美日韩一区小说| 欧美日韩日日夜夜| 欧美一卡2卡3卡4卡| 9191精品国产综合久久久久久 | 久久99国产精品免费| 日韩—二三区免费观看av| 奇米四色…亚洲| 精品午夜久久福利影院 | 久久久777精品电影网影网| 久久久久久一二三区| 国产亚洲va综合人人澡精品| 国产精品黄色在线观看| 尤物av一区二区| 日韩福利电影在线观看| 国产一区二区三区电影在线观看 | 欧美日本不卡视频| 日韩精品中文字幕一区| 26uuu亚洲综合色欧美| 久久久亚洲精品石原莉奈| 国产亚洲一二三区| 亚洲美女视频在线观看| 视频在线观看一区| 免费成人美女在线观看.| 粉嫩在线一区二区三区视频| 一本色道久久综合狠狠躁的推荐 | 青青草国产精品97视觉盛宴| 国产精品18久久久久久久久| av成人免费在线| 91麻豆精品国产综合久久久久久| 久久久夜色精品亚洲| 一区二区三区中文字幕精品精品| 日日夜夜一区二区| 国产东北露脸精品视频| 91视频在线观看| 日韩精品一区二区三区视频播放| 国产精品青草综合久久久久99| 亚洲午夜国产一区99re久久| 久久成人羞羞网站| 色婷婷综合久久久久中文一区二区| 欧美一区二区免费| 亚洲人快播电影网| 狠狠狠色丁香婷婷综合久久五月| 91色乱码一区二区三区| 欧美白人最猛性xxxxx69交| 亚洲日本免费电影| 激情欧美一区二区| 在线精品视频免费观看| 中文字幕av不卡| 婷婷丁香久久五月婷婷| 99久久99久久精品免费观看| 久久综合色天天久久综合图片| 亚洲午夜激情网页| 97久久超碰精品国产| 久久九九国产精品| 蜜桃在线一区二区三区| 在线观看免费亚洲| 中文字幕在线视频一区| 国产一区在线精品| 欧美日韩午夜在线视频| 亚洲视频每日更新| 成人精品视频网站| 欧美激情一区二区三区| 国产酒店精品激情| 精品乱人伦小说| 五月天亚洲精品| 在线影院国内精品| 亚洲精品视频自拍| 一本色道久久综合精品竹菊| 亚洲欧洲日韩在线| 成人国产精品免费观看动漫| 久久久国产精品午夜一区ai换脸| 青青草国产成人99久久| 91精品麻豆日日躁夜夜躁| 亚洲一区免费在线观看| 日本电影亚洲天堂一区| 亚洲精品福利视频网站| 色综合婷婷久久| 亚洲国产视频a| 欧美日韩激情一区二区三区| 亚洲国产视频直播| 欧美情侣在线播放|