* libsteticui/Clipboard.cs: Use the new PasteChild method, since
ReplaceChild is now protected. * libsteticui/Glade.cs: Don't try to resolve references when loading a glade file. * libsteticui/libsteticui.dll.config, libstetic/libstetic.dll.config: Added dlls maps for MacOSX * libstetic/wrapper/Button.cs, libstetic/wrapper/CheckButton.cs: Set UseUnderline = true by default. * libstetic/wrapper/Container.cs: Made ReplaceChild protected. Make sure widgets copied from clipboard are properly registered in the undo system. * libstetic/wrapper/Paned.cs, libstetic/wrapper/Box.cs, libstetic/wrapper/Frame.cs, libstetic/wrapper/Fixed.cs, libstetic/wrapper/ScrolledWindow.cs, libstetic/wrapper/Toolbar.cs, libstetic/wrapper/Notebook.cs, libstetic/wrapper/Expander.cs: Made ReplaceChild protected. * libstetic/wrapper/ComboBoxEntry.cs: Fix code generation issue for text combo box. * libstetic/wrapper/objects.xml: Added UseUnderline property to CheckButton. * libstetic/DND.cs: Use the native format for copy/paste widgets. svn path=/trunk/stetic/; revision=72032
This commit is contained in:
Родитель
9272a8f4cc
Коммит
d47ac9c7e2
24
ChangeLog
24
ChangeLog
|
@ -1,3 +1,27 @@
|
||||||
|
2007-01-31 Lluis Sanchez Gual <lluis@novell.com>
|
||||||
|
|
||||||
|
* libsteticui/Clipboard.cs: Use the new PasteChild method, since
|
||||||
|
ReplaceChild is now protected.
|
||||||
|
* libsteticui/Glade.cs: Don't try to resolve references when loading a
|
||||||
|
glade file.
|
||||||
|
* libsteticui/libsteticui.dll.config, libstetic/libstetic.dll.config:
|
||||||
|
Added dlls maps for MacOSX
|
||||||
|
* libstetic/wrapper/Button.cs, libstetic/wrapper/CheckButton.cs: Set
|
||||||
|
UseUnderline = true by default.
|
||||||
|
* libstetic/wrapper/Container.cs: Made ReplaceChild protected. Make
|
||||||
|
sure widgets copied from clipboard are properly registered in the
|
||||||
|
undo system.
|
||||||
|
* libstetic/wrapper/Paned.cs, libstetic/wrapper/Box.cs,
|
||||||
|
libstetic/wrapper/Frame.cs, libstetic/wrapper/Fixed.cs,
|
||||||
|
libstetic/wrapper/ScrolledWindow.cs, libstetic/wrapper/Toolbar.cs,
|
||||||
|
libstetic/wrapper/Notebook.cs, libstetic/wrapper/Expander.cs: Made
|
||||||
|
ReplaceChild protected.
|
||||||
|
* libstetic/wrapper/ComboBoxEntry.cs: Fix code generation issue for
|
||||||
|
text combo box.
|
||||||
|
* libstetic/wrapper/objects.xml: Added UseUnderline property to
|
||||||
|
CheckButton.
|
||||||
|
* libstetic/DND.cs: Use the native format for copy/paste widgets.
|
||||||
|
|
||||||
2007-01-25 Lluis Sanchez Gual <lluis@novell.com>
|
2007-01-25 Lluis Sanchez Gual <lluis@novell.com>
|
||||||
|
|
||||||
* libsteticui/CodeGenerator.cs,
|
* libsteticui/CodeGenerator.cs,
|
||||||
|
|
|
@ -167,7 +167,7 @@ namespace Stetic {
|
||||||
if (args.Info == GladeType) {
|
if (args.Info == GladeType) {
|
||||||
Gtk.Widget w = Cancel ();
|
Gtk.Widget w = Cancel ();
|
||||||
if (w != null)
|
if (w != null)
|
||||||
GladeUtils.Copy (w, args.SelectionData, false);
|
WidgetUtils.Copy (w, args.SelectionData, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -504,7 +504,7 @@ namespace Stetic {
|
||||||
|
|
||||||
Stetic.Wrapper.Widget faultOwner = Stetic.Wrapper.Widget.Lookup ((Gtk.Widget)obj);
|
Stetic.Wrapper.Widget faultOwner = Stetic.Wrapper.Widget.Lookup ((Gtk.Widget)obj);
|
||||||
if (faultOwner != null)
|
if (faultOwner != null)
|
||||||
dropped = GladeUtils.Paste (faultOwner.Project, args.SelectionData);
|
dropped = WidgetUtils.Paste (faultOwner.Project, args.SelectionData);
|
||||||
Gtk.Drag.Finish (args.Context, dropped != null,
|
Gtk.Drag.Finish (args.Context, dropped != null,
|
||||||
dropped != null, args.Time);
|
dropped != null, args.Time);
|
||||||
if (dropped != null) {
|
if (dropped != null) {
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
<configuration>
|
<configuration>
|
||||||
<dllmap dll="libgobject-2.0-0.dll" target="libgobject-2.0.so.0"/>
|
<dllmap dll="libgobject-2.0-0.dll" target="libgobject-2.0.so.0" os="!osx !windows" />
|
||||||
<dllmap dll="libgtk-win32-2.0-0.dll" target="libgtk-x11-2.0.so.0"/>
|
<dllmap dll="libgobject-2.0-0.dll" target="libgobject-2.0.dylib" os="osx" />
|
||||||
<dllmap dll="libgdk-win32-2.0-0.dll" target="libgdk-x11-2.0.so.0"/>
|
<dllmap dll="libgtk-win32-2.0-0.dll" target="libgtk-x11-2.0.so.0" os="!osx !windows"/>
|
||||||
|
<dllmap dll="libgtk-win32-2.0-0.dll" target="libgtk-x11-2.0.dylib" os="osx"/>
|
||||||
|
<dllmap dll="libgdk-win32-2.0-0.dll" target="libgdk-x11-2.0.so.0" os="!osx !windows"/>
|
||||||
|
<dllmap dll="libgdk-win32-2.0-0.dll" target="libgdk-x11-2.0.dylib" os="osx"/>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
|
|
@ -194,7 +194,7 @@ namespace Stetic.Wrapper {
|
||||||
base.ChildContentsChanged (child);
|
base.ChildContentsChanged (child);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void ReplaceChild (Gtk.Widget oldChild, Gtk.Widget newChild)
|
protected override void ReplaceChild (Gtk.Widget oldChild, Gtk.Widget newChild)
|
||||||
{
|
{
|
||||||
base.ReplaceChild (oldChild, newChild);
|
base.ReplaceChild (oldChild, newChild);
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,9 @@ namespace Stetic.Wrapper {
|
||||||
{
|
{
|
||||||
base.Wrap (obj, initialized);
|
base.Wrap (obj, initialized);
|
||||||
|
|
||||||
|
if (!initialized)
|
||||||
|
UseUnderline = true;
|
||||||
|
|
||||||
if (button.UseStock) {
|
if (button.UseStock) {
|
||||||
type = ButtonType.StockItem;
|
type = ButtonType.StockItem;
|
||||||
StockId = button.Label;
|
StockId = button.Label;
|
||||||
|
@ -29,6 +32,12 @@ namespace Stetic.Wrapper {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override void Read (ObjectReader reader, XmlElement elem)
|
||||||
|
{
|
||||||
|
base.Read (reader, elem);
|
||||||
|
if (reader.Format == FileFormat.Glade)
|
||||||
|
UseUnderline = true;
|
||||||
|
}
|
||||||
protected override ObjectWrapper ReadChild (ObjectReader reader, XmlElement child_elem)
|
protected override ObjectWrapper ReadChild (ObjectReader reader, XmlElement child_elem)
|
||||||
{
|
{
|
||||||
ObjectWrapper ret = null;
|
ObjectWrapper ret = null;
|
||||||
|
|
|
@ -6,6 +6,19 @@ namespace Stetic.Wrapper {
|
||||||
|
|
||||||
public class CheckButton : Container {
|
public class CheckButton : Container {
|
||||||
|
|
||||||
|
public override void Wrap (object obj, bool initialized)
|
||||||
|
{
|
||||||
|
base.Wrap (obj, initialized);
|
||||||
|
if (!initialized)
|
||||||
|
checkbutton.UseUnderline = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Read (ObjectReader reader, XmlElement elem)
|
||||||
|
{
|
||||||
|
base.Read (reader, elem);
|
||||||
|
if (reader.Format == FileFormat.Glade)
|
||||||
|
checkbutton.UseUnderline = true;
|
||||||
|
}
|
||||||
protected override ObjectWrapper ReadChild (ObjectReader reader, XmlElement child_elem)
|
protected override ObjectWrapper ReadChild (ObjectReader reader, XmlElement child_elem)
|
||||||
{
|
{
|
||||||
hasLabel = false;
|
hasLabel = false;
|
||||||
|
@ -46,7 +59,7 @@ namespace Stetic.Wrapper {
|
||||||
HasLabel = true;
|
HasLabel = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void ReplaceChild (Gtk.Widget oldChild, Gtk.Widget newChild)
|
protected override void ReplaceChild (Gtk.Widget oldChild, Gtk.Widget newChild)
|
||||||
{
|
{
|
||||||
base.ReplaceChild (oldChild, newChild);
|
base.ReplaceChild (oldChild, newChild);
|
||||||
EmitNotify ("HasContents");
|
EmitNotify ("HasContents");
|
||||||
|
|
|
@ -16,7 +16,7 @@ namespace Stetic.Wrapper {
|
||||||
|
|
||||||
internal protected override CodeExpression GenerateObjectCreation (GeneratorContext ctx)
|
internal protected override CodeExpression GenerateObjectCreation (GeneratorContext ctx)
|
||||||
{
|
{
|
||||||
if (Items != null && Items.Length > 0) {
|
if (IsTextCombo) {
|
||||||
return new CodeMethodInvokeExpression (
|
return new CodeMethodInvokeExpression (
|
||||||
new CodeTypeReferenceExpression ("Gtk.ComboBoxEntry"),
|
new CodeTypeReferenceExpression ("Gtk.ComboBoxEntry"),
|
||||||
"NewText"
|
"NewText"
|
||||||
|
|
|
@ -746,11 +746,13 @@ namespace Stetic.Wrapper
|
||||||
|
|
||||||
void PlaceholderDragDataReceived (object obj, Gtk.DragDataReceivedArgs args)
|
void PlaceholderDragDataReceived (object obj, Gtk.DragDataReceivedArgs args)
|
||||||
{
|
{
|
||||||
Widget dropped = GladeUtils.Paste (proj, args.SelectionData);
|
Widget dropped = WidgetUtils.Paste (proj, args.SelectionData);
|
||||||
Gtk.Drag.Finish (args.Context, dropped != null,
|
Gtk.Drag.Finish (args.Context, dropped != null,
|
||||||
dropped != null, args.Time);
|
dropped != null, args.Time);
|
||||||
if (dropped != null)
|
if (dropped != null) {
|
||||||
|
dropped.RequiresUndoStatusUpdate = true;
|
||||||
PlaceholderDrop ((Placeholder)obj, dropped);
|
PlaceholderDrop ((Placeholder)obj, dropped);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void ChildContentsChanged (Container child) {
|
protected virtual void ChildContentsChanged (Container child) {
|
||||||
|
@ -800,14 +802,23 @@ namespace Stetic.Wrapper
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ReplaceChild (Gtk.Widget oldChild, Gtk.Widget newChild, bool destroyOld)
|
public void PasteChild (Gtk.Widget oldChild, Gtk.Widget newChild)
|
||||||
|
{
|
||||||
|
using (UndoManager.AtomicChange) {
|
||||||
|
Widget w = Widget.Lookup (newChild);
|
||||||
|
w.RequiresUndoStatusUpdate = true;
|
||||||
|
ReplaceChild (oldChild, newChild, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void ReplaceChild (Gtk.Widget oldChild, Gtk.Widget newChild, bool destroyOld)
|
||||||
{
|
{
|
||||||
ReplaceChild (oldChild, newChild);
|
ReplaceChild (oldChild, newChild);
|
||||||
if (destroyOld)
|
if (destroyOld)
|
||||||
oldChild.Destroy ();
|
oldChild.Destroy ();
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void ReplaceChild (Gtk.Widget oldChild, Gtk.Widget newChild)
|
protected virtual void ReplaceChild (Gtk.Widget oldChild, Gtk.Widget newChild)
|
||||||
{
|
{
|
||||||
using (UndoManager.AtomicChange)
|
using (UndoManager.AtomicChange)
|
||||||
{
|
{
|
||||||
|
|
|
@ -47,7 +47,7 @@ namespace Stetic.Wrapper {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void ReplaceChild (Gtk.Widget oldChild, Gtk.Widget newChild)
|
protected override void ReplaceChild (Gtk.Widget oldChild, Gtk.Widget newChild)
|
||||||
{
|
{
|
||||||
if (oldChild == expander.LabelWidget)
|
if (oldChild == expander.LabelWidget)
|
||||||
expander.LabelWidget = newChild;
|
expander.LabelWidget = newChild;
|
||||||
|
|
|
@ -46,7 +46,7 @@ namespace Stetic.Wrapper
|
||||||
|
|
||||||
void FixedDragDataReceived (object obj, Gtk.DragDataReceivedArgs args)
|
void FixedDragDataReceived (object obj, Gtk.DragDataReceivedArgs args)
|
||||||
{
|
{
|
||||||
Widget dropped = GladeUtils.Paste (proj, args.SelectionData);
|
Widget dropped = WidgetUtils.Paste (proj, args.SelectionData);
|
||||||
Gtk.Drag.Finish (args.Context, dropped != null, dropped != null, args.Time);
|
Gtk.Drag.Finish (args.Context, dropped != null, dropped != null, args.Time);
|
||||||
if (dropped != null) {
|
if (dropped != null) {
|
||||||
gtkfixed.Put (dropped.Wrapped, 0, 0);
|
gtkfixed.Put (dropped.Wrapped, 0, 0);
|
||||||
|
|
|
@ -72,7 +72,7 @@ namespace Stetic.Wrapper {
|
||||||
base.GenerateChildBuildCode (ctx, parentVar, wrapper);
|
base.GenerateChildBuildCode (ctx, parentVar, wrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void ReplaceChild (Gtk.Widget oldChild, Gtk.Widget newChild)
|
protected override void ReplaceChild (Gtk.Widget oldChild, Gtk.Widget newChild)
|
||||||
{
|
{
|
||||||
if (oldChild == frame.LabelWidget)
|
if (oldChild == frame.LabelWidget)
|
||||||
frame.LabelWidget = newChild;
|
frame.LabelWidget = newChild;
|
||||||
|
|
|
@ -120,7 +120,7 @@ namespace Stetic.Wrapper {
|
||||||
base.Select (widget);
|
base.Select (widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void ReplaceChild (Gtk.Widget oldChild, Gtk.Widget newChild)
|
protected override void ReplaceChild (Gtk.Widget oldChild, Gtk.Widget newChild)
|
||||||
{
|
{
|
||||||
int index = tabs.IndexOf (oldChild);
|
int index = tabs.IndexOf (oldChild);
|
||||||
if (index != -1) {
|
if (index != -1) {
|
||||||
|
|
|
@ -19,7 +19,7 @@ namespace Stetic.Wrapper {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void ReplaceChild (Gtk.Widget oldChild, Gtk.Widget newChild)
|
protected override void ReplaceChild (Gtk.Widget oldChild, Gtk.Widget newChild)
|
||||||
{
|
{
|
||||||
if (oldChild == paned.Child1) {
|
if (oldChild == paned.Child1) {
|
||||||
paned.Remove (oldChild);
|
paned.Remove (oldChild);
|
||||||
|
|
|
@ -40,7 +40,7 @@ namespace Stetic.Wrapper {
|
||||||
scrolled.Add (viewport);
|
scrolled.Add (viewport);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void ReplaceChild (Gtk.Widget oldChild, Gtk.Widget newChild)
|
protected override void ReplaceChild (Gtk.Widget oldChild, Gtk.Widget newChild)
|
||||||
{
|
{
|
||||||
if (scrolled.Child is Gtk.Viewport) {
|
if (scrolled.Child is Gtk.Viewport) {
|
||||||
Gtk.Viewport vp = (Gtk.Viewport)scrolled.Child;
|
Gtk.Viewport vp = (Gtk.Viewport)scrolled.Child;
|
||||||
|
|
|
@ -124,7 +124,7 @@ namespace Stetic.Wrapper {
|
||||||
return index;
|
return index;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void ReplaceChild (Gtk.Widget oldChild, Gtk.Widget newChild)
|
protected override void ReplaceChild (Gtk.Widget oldChild, Gtk.Widget newChild)
|
||||||
{
|
{
|
||||||
ToolItemize (newChild, ToolDeItemize (oldChild));
|
ToolItemize (newChild, ToolDeItemize (oldChild));
|
||||||
}
|
}
|
||||||
|
|
|
@ -474,6 +474,7 @@
|
||||||
<property name="Inconsistent" />
|
<property name="Inconsistent" />
|
||||||
<property name="DrawIndicator" />
|
<property name="DrawIndicator" />
|
||||||
<property name="HasLabel" internal="true" />
|
<property name="HasLabel" internal="true" />
|
||||||
|
<property name="UseUnderline" />
|
||||||
<command name="RestoreLabel" label="Restore Label" icon="res:add-check-label.png"
|
<command name="RestoreLabel" label="Restore Label" icon="res:add-check-label.png"
|
||||||
description="Restore the button's label">
|
description="Restore the button's label">
|
||||||
<disabled-if name="HasLabel" value="true" />
|
<disabled-if name="HasLabel" value="true" />
|
||||||
|
|
|
@ -78,9 +78,7 @@ namespace Stetic {
|
||||||
if (wrapper == null)
|
if (wrapper == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
using (wrapper.UndoManager.AtomicChange) {
|
parent.PasteChild (target, wrapper.Wrapped);
|
||||||
parent.ReplaceChild (target, wrapper.Wrapped, true);
|
|
||||||
}
|
|
||||||
target = null;
|
target = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,7 @@ namespace Stetic {
|
||||||
{
|
{
|
||||||
XmlDocument doc = new XmlDocument ();
|
XmlDocument doc = new XmlDocument ();
|
||||||
doc.PreserveWhitespace = true;
|
doc.PreserveWhitespace = true;
|
||||||
|
doc.XmlResolver = null;
|
||||||
doc.Load (filename);
|
doc.Load (filename);
|
||||||
project.SetFileName (filename);
|
project.SetFileName (filename);
|
||||||
project.Id = System.IO.Path.GetFileName (filename);
|
project.Id = System.IO.Path.GetFileName (filename);
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
<configuration>
|
<configuration>
|
||||||
<dllmap dll="libgobject-2.0-0.dll" target="libgobject-2.0.so.0"/>
|
<dllmap dll="libgobject-2.0-0.dll" target="libgobject-2.0.so.0" os="!osx !windows" />
|
||||||
<dllmap dll="libgtk-win32-2.0-0.dll" target="libgtk-x11-2.0.so.0"/>
|
<dllmap dll="libgobject-2.0-0.dll" target="libgobject-2.0.dylib" os="osx" />
|
||||||
<dllmap dll="libgdk-win32-2.0-0.dll" target="libgdk-x11-2.0.so.0"/>
|
<dllmap dll="libgtk-win32-2.0-0.dll" target="libgtk-x11-2.0.so.0" os="!osx !windows"/>
|
||||||
|
<dllmap dll="libgtk-win32-2.0-0.dll" target="libgtk-x11-2.0.dylib" os="osx"/>
|
||||||
|
<dllmap dll="libgdk-win32-2.0-0.dll" target="libgdk-x11-2.0.so.0" os="!osx !windows"/>
|
||||||
|
<dllmap dll="libgdk-win32-2.0-0.dll" target="libgdk-x11-2.0.dylib" os="osx"/>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
|
Загрузка…
Ссылка в новой задаче