本文整理汇总了C#中TextEditor.SetScrollAdjustments方法的典型用法代码示例。如果您正苦于以下问题:C# TextEditor.SetScrollAdjustments方法的具体用法?C# TextEditor.SetScrollAdjustments怎么用?C# TextEditor.SetScrollAdjustments使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextEditor
的用法示例。
在下文中一共展示了TextEditor.SetScrollAdjustments方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BlameWidget
public BlameWidget (VersionControlDocumentInfo info)
{
this.info = info;
vAdjustment = new Adjustment (0, 0, 0, 0, 0, 0);
vAdjustment.Changed += HandleAdjustmentChanged;
vScrollBar = new VScrollbar (vAdjustment);
AddChild (vScrollBar);
hAdjustment = new Adjustment (0, 0, 0, 0, 0, 0);
hAdjustment.Changed += HandleAdjustmentChanged;
hScrollBar = new HScrollbar (hAdjustment);
AddChild (hScrollBar);
editor = new TextEditor (info.Document.Editor.Document, info.Document.Editor.Options);
AddChild (editor);
editor.SetScrollAdjustments (hAdjustment, vAdjustment);
overview = new BlameRenderer (this);
AddChild (overview);
this.DoubleBuffered = true;
editor.Painted += HandleEditorExposeEvent;
editor.EditorOptionsChanged += delegate {
overview.OptionsChanged ();
};
editor.Caret.PositionChanged += ComparisonWidget.CaretPositionChanged;
editor.FocusInEvent += ComparisonWidget.EditorFocusIn;
editor.Document.Folded += delegate {
QueueDraw ();
};
editor.Document.FoldTreeUpdated += delegate {
QueueDraw ();
};
editor.ButtonPressEvent += OnPopupMenu;
Show ();
}
示例2: BlameWidget
public BlameWidget (VersionControlDocumentInfo info)
{
GtkWorkarounds.FixContainerLeak (this);
this.info = info;
var sourceEditor = info.Document.GetContent<MonoDevelop.SourceEditor.SourceEditorView> ();
vAdjustment = new Adjustment (0, 0, 0, 0, 0, 0);
vAdjustment.Changed += HandleAdjustmentChanged;
vScrollBar = new VScrollbar (vAdjustment);
AddChild (vScrollBar);
hAdjustment = new Adjustment (0, 0, 0, 0, 0, 0);
hAdjustment.Changed += HandleAdjustmentChanged;
hScrollBar = new HScrollbar (hAdjustment);
AddChild (hScrollBar);
editor = new TextEditor (sourceEditor.TextEditor.Document, sourceEditor.TextEditor.Options);
AddChild (editor);
editor.SetScrollAdjustments (hAdjustment, vAdjustment);
overview = new BlameRenderer (this);
AddChild (overview);
this.DoubleBuffered = true;
editor.Painted += HandleEditorExposeEvent;
editor.EditorOptionsChanged += delegate {
overview.OptionsChanged ();
};
editor.Caret.PositionChanged += ComparisonWidget.CaretPositionChanged;
editor.FocusInEvent += ComparisonWidget.EditorFocusIn;
editor.Document.Folded += delegate {
QueueDraw ();
};
editor.Document.FoldTreeUpdated += delegate {
QueueDraw ();
};
editor.DoPopupMenu = ShowPopup;
Show ();
}
示例3: ComparisonWidget
public ComparisonWidget (VersionControlDocumentInfo info)
{
this.info = info;
vAdjustment = new Adjustment (0, 0, 0, 0, 0, 0);
vAdjustment.Changed += HandleAdjustmentChanged;
leftVAdjustment = new Adjustment (0, 0, 0, 0, 0, 0);
Connect (leftVAdjustment, vAdjustment);
rightVAdjustment = new Adjustment (0, 0, 0, 0, 0, 0);
Connect (rightVAdjustment, vAdjustment);
vScrollBar = new VScrollbar (vAdjustment);
AddChild (vScrollBar);
vScrollBar.Hide ();
hAdjustment = new Adjustment (0, 0, 0, 0, 0, 0);
hAdjustment.Changed += HandleAdjustmentChanged;
leftHAdjustment = new Adjustment (0, 0, 0, 0, 0, 0);
Connect (leftHAdjustment, hAdjustment);
rightHAdjustment = new Adjustment (0, 0, 0, 0, 0, 0);
Connect (rightHAdjustment, hAdjustment);
leftHScrollBar = new HScrollbar (hAdjustment);
AddChild (leftHScrollBar);
rightHScrollBar = new HScrollbar (hAdjustment);
AddChild (rightHScrollBar);
originalEditor = new TextEditor ();
originalEditor.Caret.PositionChanged += CaretPositionChanged;
originalEditor.FocusInEvent += EditorFocusIn;
AddChild (originalEditor);
originalEditor.SetScrollAdjustments (leftHAdjustment, leftVAdjustment);
originalComboBox = new DropDownBox ();
originalComboBox.WindowRequestFunc = CreateComboBoxSelector;
originalComboBox.Text = "Local";
originalComboBox.Tag = originalEditor;
AddChild (originalComboBox);
diffEditor = new TextEditor ();
diffEditor.Caret.PositionChanged += CaretPositionChanged;
diffEditor.FocusInEvent += EditorFocusIn;
AddChild (diffEditor);
diffEditor.Document.ReadOnly = true;
diffEditor.SetScrollAdjustments (leftHAdjustment, leftVAdjustment);
this.vAdjustment.ValueChanged += delegate {
middleArea.QueueDraw ();
};
diffComboBox = new DropDownBox ();
diffComboBox.WindowRequestFunc = CreateComboBoxSelector;
diffComboBox.Text = "Base";
diffComboBox.Tag = diffEditor;
AddChild (diffComboBox);
overview = new OverviewRenderer (this);
AddChild (overview);
middleArea = new MiddleArea (this);
AddChild (middleArea);
prev = new Button ();
prev.Add (new Arrow (ArrowType.Up, ShadowType.None));
AddChild (prev);
prev.ShowAll ();
prev.Clicked += delegate {
if (this.Diff == null)
return;
originalEditor.GrabFocus ();
int line = originalEditor.Caret.Line;
int max = -1, searched = -1;
foreach (Diff.Hunk hunk in this.Diff) {
if (hunk.Same)
continue;
max = System.Math.Max (hunk.Right.Start, max);
if (hunk.Right.Start < line)
searched = System.Math.Max (hunk.Right.Start, searched);
}
if (max >= 0) {
originalEditor.Caret.Line = searched < 0 ? max : searched;
originalEditor.CenterToCaret ();
}
};
next = new Button ();
next.BorderWidth = 0;
next.Add (new Arrow (ArrowType.Down, ShadowType.None));
next.Clicked += delegate {
if (this.Diff == null)
return;
originalEditor.GrabFocus ();
int line = originalEditor.Caret.Line;
int min = Int32.MaxValue, searched = Int32.MaxValue;
foreach (Diff.Hunk hunk in this.Diff) {
//.........这里部分代码省略.........