* 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>
|
||||
|
||||
* libsteticui/CodeGenerator.cs,
|
||||
|
|
|
@ -167,7 +167,7 @@ namespace Stetic {
|
|||
if (args.Info == GladeType) {
|
||||
Gtk.Widget w = Cancel ();
|
||||
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);
|
||||
if (faultOwner != null)
|
||||
dropped = GladeUtils.Paste (faultOwner.Project, args.SelectionData);
|
||||
dropped = WidgetUtils.Paste (faultOwner.Project, args.SelectionData);
|
||||
Gtk.Drag.Finish (args.Context, dropped != null,
|
||||
dropped != null, args.Time);
|
||||
if (dropped != null) {
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
<configuration>
|
||||
<dllmap dll="libgobject-2.0-0.dll" target="libgobject-2.0.so.0"/>
|
||||
<dllmap dll="libgtk-win32-2.0-0.dll" target="libgtk-x11-2.0.so.0"/>
|
||||
<dllmap dll="libgdk-win32-2.0-0.dll" target="libgdk-x11-2.0.so.0"/>
|
||||
<dllmap dll="libgobject-2.0-0.dll" target="libgobject-2.0.so.0" os="!osx !windows" />
|
||||
<dllmap dll="libgobject-2.0-0.dll" target="libgobject-2.0.dylib" os="osx" />
|
||||
<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>
|
||||
|
|
|
@ -194,7 +194,7 @@ namespace Stetic.Wrapper {
|
|||
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);
|
||||
|
||||
|
|
|
@ -13,6 +13,9 @@ namespace Stetic.Wrapper {
|
|||
{
|
||||
base.Wrap (obj, initialized);
|
||||
|
||||
if (!initialized)
|
||||
UseUnderline = true;
|
||||
|
||||
if (button.UseStock) {
|
||||
type = ButtonType.StockItem;
|
||||
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)
|
||||
{
|
||||
ObjectWrapper ret = null;
|
||||
|
|
|
@ -6,6 +6,19 @@ namespace Stetic.Wrapper {
|
|||
|
||||
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)
|
||||
{
|
||||
hasLabel = false;
|
||||
|
@ -46,7 +59,7 @@ namespace Stetic.Wrapper {
|
|||
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);
|
||||
EmitNotify ("HasContents");
|
||||
|
|
|
@ -16,7 +16,7 @@ namespace Stetic.Wrapper {
|
|||
|
||||
internal protected override CodeExpression GenerateObjectCreation (GeneratorContext ctx)
|
||||
{
|
||||
if (Items != null && Items.Length > 0) {
|
||||
if (IsTextCombo) {
|
||||
return new CodeMethodInvokeExpression (
|
||||
new CodeTypeReferenceExpression ("Gtk.ComboBoxEntry"),
|
||||
"NewText"
|
||||
|
|
|
@ -746,11 +746,13 @@ namespace Stetic.Wrapper
|
|||
|
||||
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,
|
||||
dropped != null, args.Time);
|
||||
if (dropped != null)
|
||||
if (dropped != null) {
|
||||
dropped.RequiresUndoStatusUpdate = true;
|
||||
PlaceholderDrop ((Placeholder)obj, dropped);
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
if (destroyOld)
|
||||
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)
|
||||
{
|
||||
|
|
|
@ -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)
|
||||
expander.LabelWidget = newChild;
|
||||
|
|
|
@ -46,7 +46,7 @@ namespace Stetic.Wrapper
|
|||
|
||||
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);
|
||||
if (dropped != null) {
|
||||
gtkfixed.Put (dropped.Wrapped, 0, 0);
|
||||
|
|
|
@ -72,7 +72,7 @@ namespace Stetic.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)
|
||||
frame.LabelWidget = newChild;
|
||||
|
|
|
@ -120,7 +120,7 @@ namespace Stetic.Wrapper {
|
|||
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);
|
||||
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) {
|
||||
paned.Remove (oldChild);
|
||||
|
|
|
@ -40,7 +40,7 @@ namespace Stetic.Wrapper {
|
|||
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) {
|
||||
Gtk.Viewport vp = (Gtk.Viewport)scrolled.Child;
|
||||
|
|
|
@ -124,7 +124,7 @@ namespace Stetic.Wrapper {
|
|||
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));
|
||||
}
|
||||
|
|
|
@ -474,6 +474,7 @@
|
|||
<property name="Inconsistent" />
|
||||
<property name="DrawIndicator" />
|
||||
<property name="HasLabel" internal="true" />
|
||||
<property name="UseUnderline" />
|
||||
<command name="RestoreLabel" label="Restore Label" icon="res:add-check-label.png"
|
||||
description="Restore the button's label">
|
||||
<disabled-if name="HasLabel" value="true" />
|
||||
|
|
|
@ -78,9 +78,7 @@ namespace Stetic {
|
|||
if (wrapper == null)
|
||||
return;
|
||||
|
||||
using (wrapper.UndoManager.AtomicChange) {
|
||||
parent.ReplaceChild (target, wrapper.Wrapped, true);
|
||||
}
|
||||
parent.PasteChild (target, wrapper.Wrapped);
|
||||
target = null;
|
||||
}
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@ namespace Stetic {
|
|||
{
|
||||
XmlDocument doc = new XmlDocument ();
|
||||
doc.PreserveWhitespace = true;
|
||||
doc.XmlResolver = null;
|
||||
doc.Load (filename);
|
||||
project.SetFileName (filename);
|
||||
project.Id = System.IO.Path.GetFileName (filename);
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
<configuration>
|
||||
<dllmap dll="libgobject-2.0-0.dll" target="libgobject-2.0.so.0"/>
|
||||
<dllmap dll="libgtk-win32-2.0-0.dll" target="libgtk-x11-2.0.so.0"/>
|
||||
<dllmap dll="libgdk-win32-2.0-0.dll" target="libgdk-x11-2.0.so.0"/>
|
||||
<dllmap dll="libgobject-2.0-0.dll" target="libgobject-2.0.so.0" os="!osx !windows" />
|
||||
<dllmap dll="libgobject-2.0-0.dll" target="libgobject-2.0.dylib" os="osx" />
|
||||
<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>
|
||||
|
|
Загрузка…
Ссылка в новой задаче