当前位置: 首页>>代码示例>>C#>>正文


C# IVwGraphics类代码示例

本文整理汇总了C#中IVwGraphics的典型用法代码示例。如果您正苦于以下问题:C# IVwGraphics类的具体用法?C# IVwGraphics怎么用?C# IVwGraphics使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IVwGraphics类属于命名空间,在下文中一共展示了IVwGraphics类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetRenderer

		public IRenderEngine GetRenderer(int ws, IVwGraphics vg)
		{
			IRenderEngine result;
			if (m_renderers.TryGetValue(ws, out result))
				return result;
			return Renderer;
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:7,代码来源:MockRendererFactory.cs

示例2: DrawText

		public void DrawText(int ichBase, IVwGraphics vg, Rect rcSrc, Rect rcDst, out int dxdWidth)
		{
			dxdWidth = Width;
			var args = new SegDrawTextArgs();
			args.ichBase = ichBase;
			args.vg = vg;
			args.rcSrc = rcSrc;
			args.rcDst = rcDst;
			LastDrawTextCall = args;
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:10,代码来源:MockSegment.cs

示例3: PaintForeground

		public override void PaintForeground(IVwGraphics vg, PaintTransform ptrans)
		{
			if (Segment == null)
				return;
			int dxdWidth;
			PaintTransform segTrans = ptrans.PaintTransformOffsetBy(Left, Top);

			if (AnyColoredBackground)
				Segment.DrawTextNoBackground(IchMin, vg, segTrans.SourceRect, segTrans.DestRect, out dxdWidth);
			else
				Segment.DrawText(IchMin, vg, segTrans.SourceRect, segTrans.DestRect, out dxdWidth); // more efficient.
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:12,代码来源:StringBox.cs

示例4: FindBreakPoint

		public void FindBreakPoint(IVwGraphics vg, IVwTextSource _ts, IVwJustifier _vjus, int ichMin, int ichLim,
			int ichLimBacktrack, bool fNeedFinalBreak, bool fStartLine, int dxMaxWidth, LgLineBreak lbPref,
			LgLineBreak lbMax, LgTrailingWsHandling twsh, bool fParaRightToLeft,
			out ILgSegment segRet, out int dichLimSeg, out int dxWidth, out LgEndSegmentType est, ILgSegment _segPrev)
		{

			MockSegment seg;
			var key = new MockSegKey(ichMin, ichLim);
			if (lbPref != LgLineBreak.klbClipBreak && m_failOnPartialLine.Contains(key))
			{
				// fail.
				segRet = null;
				dichLimSeg = 0;
				dxWidth = 0;
				est = LgEndSegmentType.kestNothingFit;
				return;
			}
			if (m_potentialSegs.TryGetValue(key, out seg))
			{
				if (seg.Width < dxMaxWidth) // otherwise we meant it for the next line.
				{
					segRet = seg;
					dichLimSeg = seg.get_Lim(ichMin);
					dxWidth = seg.get_Width(ichMin, vg);
					est = seg.EndSegType;
					return;
				}
			}
			switch(OtherSegPolicy)
			{
				case UnexpectedSegments.DontFit:
				default: // to make compiler happy
					Assert.AreNotEqual(LgLineBreak.klbClipBreak, lbMax,
									   "FindBreakPoint called with unexpected arguments.");
					// If we aren't pre-prepared for the requested break, assume nothing fits with these arguments.
					segRet = null;
					dichLimSeg = 0;
					dxWidth = 0;
					est = LgEndSegmentType.kestNothingFit;
					break;
				case UnexpectedSegments.MakeOneCharSeg:
					// Make a very narrow segment that will fit and allow more stuff. This will usually give a test failure if not intentional.
					seg = new MockSegment(1, 2, 1, LgEndSegmentType.kestOkayBreak);
					// If we aren't pre-prepared for the requested break, assume nothing fits with these arguments.
					segRet = seg;
					dichLimSeg = 1;
					dxWidth = 2;
					est = LgEndSegmentType.kestOkayBreak;
					break;
			}
		}
开发者ID:sillsdev,项目名称:FieldWorks,代码行数:51,代码来源:MockRenderEngine.cs

示例5: PaintForeground

			public override void PaintForeground(IVwGraphics vg, PaintTransform ptrans)
			{
				((MockGraphics)vg).DrawActions.Add(this);
			}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:4,代码来源:RowTests.cs

示例6: get_Renderer

		public IRenderEngine get_Renderer(int ws, IVwGraphics _vg)
		{
			return m_engine;
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:4,代码来源:DefaultWritingSystemFactory.cs

示例7:

		/// -----------------------------------------------------------------------------------
		/// <summary>
		/// Inform the container when done with the graphics object.
		/// </summary>
		/// <param name="prootb"></param>
		/// <param name="pvg"></param>
		/// -----------------------------------------------------------------------------------
		void IVwRootSite.ReleaseGraphics(IVwRootBox prootb, IVwGraphics pvg)
		{
			// Do nothing for printing
		}
开发者ID:sillsdev,项目名称:FieldWorks,代码行数:11,代码来源:PrintRootSite.cs

示例8: MakeSelectionAt

		/// <summary>
		/// Make whatever selection is appropriate for the given click. The transformation is the usual one passed to this box,
		/// that is, it transforms where (which is in paint coords) into a point in the same coordinate system as our own top, left.
		/// </summary>
		internal virtual Selections.Selection MakeSelectionAt(Point where, IVwGraphics vg, PaintTransform leafTrans)
		{
			return null;
		}
开发者ID:sillsdev,项目名称:FieldWorks,代码行数:8,代码来源:LeafBox.cs

示例9: Location

		public void Location(IVwGraphics _vg, Utils.Rect rcSrc, Utils.Rect rcDst,
			out Utils.Rect _rdPrimary, out Utils.Rect _rdSecondary, out bool _fSplit,
			out bool _fEndBeforeAnchor)
		{
			_rdPrimary = default(Utils.Rect);
			_rdSecondary = default(Utils.Rect);
			_fSplit = false;
			_fEndBeforeAnchor = false;
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:9,代码来源:IbusRootSiteEventHandlerTests.cs

示例10: DrawingErrors

		public void DrawingErrors(IVwGraphics _vg)
		{
			throw new NotImplementedException();
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:4,代码来源:IbusRootSiteEventHandlerTests.cs

示例11: MakeLayoutInfo

		internal static LayoutInfo MakeLayoutInfo(int maxWidth, IVwGraphics vg, IRendererFactory factory)
		{
			return new LayoutInfo(2, 2, 96, 96, maxWidth, vg, factory);
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:4,代码来源:DoubleClickTests.cs

示例12: CallOnTyping

			protected override void CallOnTyping(IVwGraphics vg, string str, int cchBackspace, int cchDelForward, char chFirst, Rectangle rcSrcRoot, Rectangle rcDstRoot)
			{
				base.CallOnTyping(vg, str, cchBackspace, cchDelForward, chFirst, rcSrcRoot, rcDstRoot);
				Cache.EnableUndo = false;	// Things have changed in a way we can't Undo.
			}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:5,代码来源:ReversalIndexEntrySlice.cs

示例13: Paint

		/// <summary>
		/// The root box handles the overall paint.
		/// </summary>
		/// <param name="vg"></param>
		/// <param name="ptrans"></param>
		public void Paint(IVwGraphics vg, PaintTransform ptrans)
		{
			if (m_layoutCallbacks != null)
			{
				// In a state where we can't paint. Arrange for an invalidate AFTER the dangerous operation is over,
				// so what needs painting eventually does get painted.
				var bounds = Bounds;
				bounds.Inflate(10, 10);
				m_layoutCallbacks.Invalidate(bounds);
				return;
			}
			// First we paint the overall background. This basically covers everything but text.
			PaintBackground(vg, ptrans);
			// Then the text.
			PaintForeground(vg, ptrans);
			// And finally the selection.
			if (Selection != null && m_selectionShowing)
			{
				if (Selection.IsValid)
					Selection.Draw(vg, ptrans);
				else
					Selection = null;
			}
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:29,代码来源:RootBox.cs

示例14: OnDragDrop

		/// <summary>
		/// Implement dragging to this view.
		/// </summary>
		public void OnDragDrop(DragEventArgs drgevent, Point location, IVwGraphics vg, PaintTransform ptrans)
		{
			var sel = GetSelectionAt(location, vg, ptrans) as InsertionPoint;
			if (sel == null)
				return;
			var rtf = drgevent.Data.GetData(DataFormats.Rtf);
			var data = drgevent.Data.GetData(DataFormats.StringFormat);
			if (data == null)
				return;
			var text = data.ToString(); // MS example of GetData does this, though for DataFormats.Text.

			if (DragState == WindowDragState.InternalMove)
			{
				DragState = WindowDragState.None;
				// We are dragging our own selection. Is it in the same property?
				var range = (RangeSelection)Selection;
				// Enhance JohnT: when we can drag a range that isn't all in one property, this needs more work.
				if (!Selection.IsInsertionPoint)
				{
					if (Selection.Contains(sel))
					{
						Selection = sel;
						return; // Can't drag to inside own selection.
					}
				}
				if (range.End.Hookup == sel.Hookup && range.End.StringPosition < sel.StringPosition)
				{
					// Dragging to later in the same property. If we delete first, we will mess up the insert
					// position. However, a simple solution is to insert first.
					//Log("Inserted dropped " + text + " before deleted range");
					if (rtf == null)
						sel.InsertText(text);
					else if (!sel.InsertRtfString(rtf.ToString()))
						sel.InsertText(text);
					range.Delete();
					return;
				}
				// The bit we're moving comes after the place to insert, or they are in separate properties.
				// We can just go ahead and delete the source first, since we already have a copy of the
				// text to insert.
				// Enhance JohnT: do we need to consider a special case where the source and destination are
				// different occurrences of the same property?
				//Log("Deleted selection");
				range.Delete();
			}
			DragState = WindowDragState.None;

			//Log("Dropped text: " + text);
			if (rtf == null)
				sel.InsertText(text);
			else if (!sel.InsertRtfString(rtf.ToString()))
				sel.InsertText(text);
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:56,代码来源:RootBox.cs

示例15: OnDragEnter

		/// <summary>
		/// Returns information about possible drops with these arguments.
		/// </summary>
		public void OnDragEnter(DragEventArgs drgevent, Point location, IVwGraphics vg, PaintTransform ptrans)
		{
			if (DragState == WindowDragState.InternalMove)
			{
				// On a simple click (at least), Windows calls OnDragEnter AFTER OnQueryContinueDrag, attempting to drop
				// right where we clicked. OnQueryContinueDrag detects this; we must not reset it.
				return;
			}
			drgevent.Effect = DragDropEffects.None; // default
			var sel = GetSelectionAt(location, vg, ptrans) as InsertionPoint;
			if (sel == null)
				return;
			if (!sel.CanInsertText)
				return;
			var data = drgevent.Data.GetData(DataFormats.StringFormat);
			if (data == null)
				return;

			DragState = WindowDragState.DraggingHere;

			// We will copy if control is held down or move is not allowed.)
			if ((drgevent.KeyState & (int)DragDropKeyStates.ControlKey) != 0 ||
				(drgevent.AllowedEffect & DragDropEffects.Move) == 0)
			{
				//Log("DragEnter/Move: set effect to copy");
				drgevent.Effect = DragDropEffects.Copy;
			}
			else
			{
				//Log("DragEnter/Move: set effect to move");
				drgevent.Effect = DragDropEffects.Move;
			}
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:36,代码来源:RootBox.cs


注:本文中的IVwGraphics类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。