Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
More build stubbing
  • Loading branch information
directhex authored and Jo Shields committed Jul 30, 2018
commit 6606b918a6d4db15d5a719aa7f343844a75d631f
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ protected override void OnDestroyed()
}

// TODO: Make static.
void TitleColDataFunc (TreeViewColumn treeColumn, CellRenderer cell, TreeModel model, TreeIter iter)
void TitleColDataFunc (TreeViewColumn treeColumn, CellRenderer cell, ITreeModel model, TreeIter iter)
{
var provider = (Tuple<CodeDiagnosticDescriptor, DiagnosticDescriptor>)model.GetValue (iter, 1);
if (provider == null) {
Expand All @@ -366,7 +366,7 @@ void TitleColDataFunc (TreeViewColumn treeColumn, CellRenderer cell, TreeModel m
}

// TODO: Make static.
void ComboDataFunc (TreeViewColumn treeColumn, CellRenderer cell, TreeModel model, TreeIter iter)
void ComboDataFunc (TreeViewColumn treeColumn, CellRenderer cell, ITreeModel model, TreeIter iter)
{
var provider = (Tuple<CodeDiagnosticDescriptor, DiagnosticDescriptor>)treeStore.GetValue (iter, 1);
if (provider == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public RefactoringPreviewDialog (IList<Change> changes)
FillChanges ();
}

void SetLocationTextData (Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
void SetLocationTextData (Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.ITreeModel model, Gtk.TreeIter iter)
{
CellRendererText cellRendererText = (CellRendererText)cell;
Change change = store.GetValue (iter, objColumn) as Change;
Expand All @@ -122,7 +122,7 @@ void SetLocationTextData (Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell,
}
}

void SetDiffCellData (Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
void SetDiffCellData (Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.ITreeModel model, Gtk.TreeIter iter)
{
try {
CellRendererDiff cellRendererDiff = (CellRendererDiff)cell;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ partial class BehaviorPanel

private global::Gtk.Label label1;

private global::Gtk.ComboBox indentationCombobox;
private global::Gtk.ComboBoxText indentationCombobox;

private global::Gtk.CheckButton tabAsReindentCheckbutton;

Expand All @@ -56,7 +56,7 @@ partial class BehaviorPanel

private global::Gtk.Label label2;

private global::Gtk.ComboBox controlLeftRightCombobox;
private global::Gtk.ComboBoxText controlLeftRightCombobox;

protected virtual void Build()
{
Expand Down Expand Up @@ -228,7 +228,7 @@ protected virtual void Build()
w14.Expand = false;
w14.Fill = false;
// Container child hbox1.Gtk.Box+BoxChild
this.indentationCombobox = global::Gtk.ComboBox.NewText();
this.indentationCombobox = new global::Gtk.ComboBoxText();
this.indentationCombobox.Name = "indentationCombobox";
this.hbox1.Add(this.indentationCombobox);
global::Gtk.Box.BoxChild w15 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.indentationCombobox]));
Expand Down Expand Up @@ -304,7 +304,7 @@ protected virtual void Build()
w22.Expand = false;
w22.Fill = false;
// Container child hbox3.Gtk.Box+BoxChild
this.controlLeftRightCombobox = global::Gtk.ComboBox.NewText();
this.controlLeftRightCombobox = new global::Gtk.ComboBoxText();
this.controlLeftRightCombobox.Name = "controlLeftRightCombobox";
this.hbox3.Add(this.controlLeftRightCombobox);
global::Gtk.Box.BoxChild w23 = ((global::Gtk.Box.BoxChild)(this.hbox3[this.controlLeftRightCombobox]));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ protected virtual void Build ()
this.openingRadiobutton.Name = "openingRadiobutton";
this.openingRadiobutton.DrawIndicator = true;
this.openingRadiobutton.UseUnderline = true;
this.openingRadiobutton.Group = new global::GLib.SList (global::System.IntPtr.Zero);
this.openingRadiobutton.Group = new Gtk.RadioButton [0];
this.hbox2.Add (this.openingRadiobutton);
global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.openingRadiobutton]));
w14.Position = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ internal partial class GeneralOptionsPanel

private global::Gtk.Label label1;

private global::Gtk.ComboBox comboboxLineEndings;
private global::Gtk.ComboBoxText comboboxLineEndings;

private global::Gtk.Label GtkLabel14;

Expand Down Expand Up @@ -106,7 +106,7 @@ protected virtual void Build()
w4.Expand = false;
w4.Fill = false;
// Container child hbox1.Gtk.Box+BoxChild
this.comboboxLineEndings = global::Gtk.ComboBox.NewText();
this.comboboxLineEndings = new global::Gtk.ComboBoxText();
this.comboboxLineEndings.Name = "comboboxLineEndings";
this.hbox1.Add(this.comboboxLineEndings);
global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.comboboxLineEndings]));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ partial class MarkerPanel

private global::Gtk.Label label1;

private global::Gtk.ComboBox showWhitespacesCombobox;
private global::Gtk.ComboBoxText showWhitespacesCombobox;

protected virtual void Build()
{
Expand Down Expand Up @@ -239,7 +239,7 @@ protected virtual void Build()
w14.XOptions = ((global::Gtk.AttachOptions)(4));
w14.YOptions = ((global::Gtk.AttachOptions)(4));
// Container child table1.Gtk.Table+TableChild
this.showWhitespacesCombobox = global::Gtk.ComboBox.NewText();
this.showWhitespacesCombobox = new global::Gtk.ComboBoxText();
this.showWhitespacesCombobox.Name = "showWhitespacesCombobox";
this.table1.Add(this.showWhitespacesCombobox);
global::Gtk.Table.TableChild w15 = ((global::Gtk.Table.TableChild)(this.table1[this.showWhitespacesCombobox]));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ partial class NewColorShemeDialog
{
private global::Gtk.Table table1;

private global::Gtk.ComboBox comboboxBaseStyle;
private global::Gtk.ComboBoxText comboboxBaseStyle;

private global::Gtk.Entry entryDescription;

Expand All @@ -31,7 +31,7 @@ protected virtual void Build()
this.WindowPosition = ((global::Gtk.WindowPosition)(4));
this.BorderWidth = ((uint)(6));
// Internal child MonoDevelop.SourceEditor.OptionPanels.NewColorShemeDialog.VBox
global::Gtk.VBox w1 = this.VBox;
global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea;
w1.Name = "dialog1_VBox";
w1.BorderWidth = ((uint)(2));
// Container child dialog1_VBox.Gtk.Box+BoxChild
Expand All @@ -40,7 +40,7 @@ protected virtual void Build()
this.table1.RowSpacing = ((uint)(6));
this.table1.ColumnSpacing = ((uint)(6));
// Container child table1.Gtk.Table+TableChild
this.comboboxBaseStyle = global::Gtk.ComboBox.NewText();
this.comboboxBaseStyle = new global::Gtk.ComboBoxText();
this.comboboxBaseStyle.Name = "comboboxBaseStyle";
this.table1.Add(this.comboboxBaseStyle);
global::Gtk.Table.TableChild w2 = ((global::Gtk.Table.TableChild)(this.table1[this.comboboxBaseStyle]));
Expand Down Expand Up @@ -115,7 +115,7 @@ protected virtual void Build()
w8.Expand = false;
w8.Fill = false;
// Internal child MonoDevelop.SourceEditor.OptionPanels.NewColorShemeDialog.ActionArea
global::Gtk.HButtonBox w9 = this.ActionArea;
global::Gtk.HButtonBox w9 = (Gtk.HButtonBox)this.ActionArea;
w9.Name = "dialog1_ActionArea";
w9.Spacing = 10;
w9.BorderWidth = ((uint)(5));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,10 @@ void DrawList (Gdk.EventExpose args)
var window = args.Window;

int winWidth, winHeight;
window.GetSize (out winWidth, out winHeight);
// window.GetSize (out winWidth, out winHeight);

int ypos = margin;
int lineWidth = winWidth - margin*2;
// int lineWidth = winWidth - margin*2;
int xpos = margin + padding;

using (var cr = this.CreateXwtContext ()) {
Expand All @@ -227,67 +227,67 @@ void DrawList (Gdk.EventExpose args)
int n = 0;
n = (int)(vadj.Value / rowHeight);

while (ypos < winHeight - margin && n < win.DataProvider.Count) {
bool hasMarkup = false;
IMarkupListDataProvider<T> markupListDataProvider = win.DataProvider as IMarkupListDataProvider<T>;
if (markupListDataProvider != null) {
if (markupListDataProvider.HasMarkup (n)) {
layout.Markup = (markupListDataProvider.GetMarkup (n) ?? "&lt;null&gt;");
hasMarkup = true;
}
}

if (!hasMarkup)
layout.Text = (win.DataProvider.GetText (n) ?? "<null>");

Xwt.Drawing.Image icon = win.DataProvider.GetIcon (n);
int iconHeight, iconWidth;

if (icon != null) {
iconWidth = (int)icon.Width;
iconHeight = (int)icon.Height;
} else if (!Gtk.Icon.SizeLookup (Gtk.IconSize.Menu, out iconWidth, out iconHeight)) {
iconHeight = iconWidth = 24;
}

var s = layout.GetSize ();
int typos, iypos;
int he = (int)s.Height;

typos = he < rowHeight ? ypos + (rowHeight - he) / 2 : ypos;
iypos = iconHeight < rowHeight ? ypos + (rowHeight - iconHeight) / 2 : ypos;

if (n == selection) {
if (!disableSelection) {
cr.Rectangle (margin, ypos, lineWidth, he + padding);
cr.SetColor (this.Style.Base (StateType.Selected).ToXwtColor ());
cr.Fill ();

cr.SetColor (this.Style.Text (StateType.Selected).ToXwtColor ());
cr.DrawTextLayout (layout, xpos + iconWidth + 2, typos);
} else {
cr.Rectangle (margin, ypos, lineWidth, he + padding);
cr.SetColor (this.Style.Base (StateType.Selected).ToXwtColor ());
cr.Stroke ();

cr.SetColor (textColor);
cr.DrawTextLayout (layout, xpos + iconWidth + 2, typos);
}
} else {
cr.SetColor (textColor);
cr.DrawTextLayout (layout, xpos + iconWidth + 2, typos);
}

if (icon != null)
cr.DrawImage (icon, xpos, iypos);

ypos += rowHeight;
n++;

//reset the markup or it carries over to the next SetText
if (hasMarkup)
layout.Markup = string.Empty;
}
// while (ypos < winHeight - margin && n < win.DataProvider.Count) {
// bool hasMarkup = false;
// IMarkupListDataProvider<T> markupListDataProvider = win.DataProvider as IMarkupListDataProvider<T>;
// if (markupListDataProvider != null) {
// if (markupListDataProvider.HasMarkup (n)) {
// layout.Markup = (markupListDataProvider.GetMarkup (n) ?? "&lt;null&gt;");
// hasMarkup = true;
// }
// }
//
// if (!hasMarkup)
// layout.Text = (win.DataProvider.GetText (n) ?? "<null>");
//
// Xwt.Drawing.Image icon = win.DataProvider.GetIcon (n);
// int iconHeight, iconWidth;
//
// if (icon != null) {
// iconWidth = (int)icon.Width;
// iconHeight = (int)icon.Height;
// } else if (!Gtk.Icon.SizeLookup (Gtk.IconSize.Menu, out iconWidth, out iconHeight)) {
// iconHeight = iconWidth = 24;
// }
//
// var s = layout.GetSize ();
// int typos, iypos;
// int he = (int)s.Height;
//
// typos = he < rowHeight ? ypos + (rowHeight - he) / 2 : ypos;
// iypos = iconHeight < rowHeight ? ypos + (rowHeight - iconHeight) / 2 : ypos;
//
// if (n == selection) {
// if (!disableSelection) {
// cr.Rectangle (margin, ypos, lineWidth, he + padding);
// cr.SetColor (this.Style.Base (StateType.Selected).ToXwtColor ());
// cr.Fill ();
//
// cr.SetColor (this.Style.Text (StateType.Selected).ToXwtColor ());
// cr.DrawTextLayout (layout, xpos + iconWidth + 2, typos);
// } else {
// cr.Rectangle (margin, ypos, lineWidth, he + padding);
// cr.SetColor (this.Style.Base (StateType.Selected).ToXwtColor ());
// cr.Stroke ();
//
// cr.SetColor (textColor);
// cr.DrawTextLayout (layout, xpos + iconWidth + 2, typos);
// }
// } else {
// cr.SetColor (textColor);
// cr.DrawTextLayout (layout, xpos + iconWidth + 2, typos);
// }
//
// if (icon != null)
// cr.DrawImage (icon, xpos, iypos);
//
// ypos += rowHeight;
// n++;
//
// //reset the markup or it carries over to the next SetText
// if (hasMarkup)
// layout.Markup = string.Empty;
// }
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -368,15 +368,15 @@ protected virtual void OnSelectionChanged ()
{
}

protected override bool OnExposeEvent (Gdk.EventExpose args)
{
base.OnExposeEvent (args);

int winWidth, winHeight;
this.GetSize (out winWidth, out winHeight);
this.GdkWindow.DrawRectangle (this.Style.ForegroundGC (StateType.Insensitive), false, 0, 0, winWidth-1, winHeight-1);
return false;
}
// protected override bool OnExposeEvent (Gdk.EventExpose args)
// {
// base.OnExposeEvent (args);
//
// int winWidth, winHeight;
// this.GetSize (out winWidth, out winHeight);
// this.GdkWindow.DrawRectangle (this.Style.ForegroundGC (StateType.Insensitive), false, 0, 0, winWidth-1, winHeight-1);
// return false;
// }

public int TextOffset {
get { return list.TextOffset + (int) this.BorderWidth; }
Expand Down
Loading