2005-04-15 Chris Toshok <toshok@ximian.com>

* Makefile.am (GLADE_FILES): add stringvis.glade
	(RESOURCES): same.

	* corlib/stringvis.glade: new file, the string visualizer dialog.

	* corlib/StringVisualizer.cs (StringWindow): display a glade ui
	containing a textview showing the string.  Paves the way for an
	editable UI once ReplaceObject is implemented.
	(StringVisualizer.Show): use StringWindow.


svn path=/trunk/monodevelop-visualizers/; revision=43082
This commit is contained in:
Chris Toshok 2005-04-15 21:44:50 +00:00
Родитель 87f4701dd6
Коммит 3faab87d36
4 изменённых файлов: 151 добавлений и 8 удалений

Просмотреть файл

@ -1,3 +1,15 @@
2005-04-15 Chris Toshok <toshok@ximian.com>
* Makefile.am (GLADE_FILES): add stringvis.glade
(RESOURCES): same.
* corlib/stringvis.glade: new file, the string visualizer dialog.
* corlib/StringVisualizer.cs (StringWindow): display a glade ui
containing a textview showing the string. Paves the way for an
editable UI once ReplaceObject is implemented.
(StringVisualizer.Show): use StringWindow.
2005-04-15 Chris Toshok <toshok@ximian.com> 2005-04-15 Chris Toshok <toshok@ximian.com>
* Makefile.am: add support for gtk glade files and resources. * Makefile.am: add support for gtk glade files and resources.

Просмотреть файл

@ -16,8 +16,8 @@ CSFILES=AssemblyInfo.cs \
gtk/PixbufVisualizer.cs \ gtk/PixbufVisualizer.cs \
$(GECKO_CSFILES) $(GECKO_CSFILES)
GLADE_FILES=gtk/pixbufvis.glade $(GECKO_GLADE_FILES) GLADE_FILES=corlib/stringvis.glade gtk/pixbufvis.glade $(GECKO_GLADE_FILES)
RESOURCES= /resource:./gtk/pixbufvis.glade,pixbufvis.glade $(GECKO_RESOURCES) RESOURCES= /resource:./corlib/stringvis.glade,stringvis.glade /resource:./gtk/pixbufvis.glade,pixbufvis.glade $(GECKO_RESOURCES)
CSFLAGS=-g $(GECKO_FLAGS) CSFLAGS=-g $(GECKO_FLAGS)

Просмотреть файл

@ -1,19 +1,57 @@
using Gtk; using Gtk;
using Glade;
using MonoDevelop.DebuggerVisualizers; using MonoDevelop.DebuggerVisualizers;
namespace CorlibVisualizers namespace CorlibVisualizers
{ {
public class StringWindow
{
[Widget] Gtk.Dialog string_dialog;
[Widget] Gtk.TextView string_textview;
Gtk.TextBuffer buffer;
public StringWindow (string data)
{
Glade.XML ui;
buffer = new Gtk.TextBuffer (null);
ui = Glade.XML.FromAssembly ("stringvis.glade", "string_dialog", null);
ui.Autoconnect (this);
string_dialog.SetDefaultSize (400, 300);
string_textview.Buffer = buffer;
buffer.Text = data;
}
public void Show ()
{
string_dialog.Run();
string_dialog.Hide();
}
public bool Editable {
get {
return string_textview.Editable;
}
set {
string_textview.Editable = value;
string_textview.CursorVisible = value;
}
}
}
public class StringVisualizer : DialogDebuggerVisualizer public class StringVisualizer : DialogDebuggerVisualizer
{ {
protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider) protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider)
{ {
MessageDialog dialog = new MessageDialog (null, StringWindow win = new StringWindow (objectProvider.GetObject().ToString());
DialogFlags.Modal, MessageType.Info, ButtonsType.Close, false,
objectProvider.GetObject().ToString());
dialog.Title = "String Visualizer";
dialog.Run(); win.Editable = objectProvider.IsObjectReplaceable;
dialog.Hide();
win.Show ();
} }
} }
} }

93
corlib/stringvis.glade Normal file
Просмотреть файл

@ -0,0 +1,93 @@
<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
<glade-interface>
<widget class="GtkDialog" id="string_dialog">
<property name="visible">True</property>
<property name="title" translatable="yes">String Visualizer</property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_NONE</property>
<property name="modal">True</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
<property name="decorated">True</property>
<property name="skip_taskbar_hint">False</property>
<property name="skip_pager_hint">False</property>
<property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
<property name="focus_on_map">True</property>
<property name="has_separator">True</property>
<child internal-child="vbox">
<widget class="GtkVBox" id="dialog-vbox1">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child internal-child="action_area">
<widget class="GtkHButtonBox" id="dialog-action_area1">
<property name="visible">True</property>
<property name="layout_style">GTK_BUTTONBOX_END</property>
<child>
<widget class="GtkButton" id="closebutton1">
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-close</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="response_id">-7</property>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack_type">GTK_PACK_END</property>
</packing>
</child>
<child>
<widget class="GtkScrolledWindow" id="scrolledwindow1">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
<property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
<property name="shadow_type">GTK_SHADOW_IN</property>
<property name="window_placement">GTK_CORNER_TOP_LEFT</property>
<child>
<widget class="GtkTextView" id="string_textview">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">True</property>
<property name="overwrite">False</property>
<property name="accepts_tab">True</property>
<property name="justification">GTK_JUSTIFY_LEFT</property>
<property name="wrap_mode">GTK_WRAP_NONE</property>
<property name="cursor_visible">True</property>
<property name="pixels_above_lines">0</property>
<property name="pixels_below_lines">0</property>
<property name="pixels_inside_wrap">0</property>
<property name="left_margin">0</property>
<property name="right_margin">0</property>
<property name="indent">0</property>
<property name="text" translatable="yes"></property>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
</widget>
</child>
</widget>
</glade-interface>