* 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:
Lluis Sanchez 2007-01-31 15:26:40 +00:00
Родитель 9272a8f4cc
Коммит d47ac9c7e2
19 изменённых файлов: 89 добавлений и 26 удалений

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

@ -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;
@ -20,7 +23,7 @@ namespace Stetic.Wrapper {
type = ButtonType.TextOnly;
Label = button.Name;
} else if (button.Child is Gtk.Label) {
type = ButtonType.TextOnly;
type = ButtonType.TextOnly;
label = button.Label;
useUnderline = button.UseUnderline;
} else {
@ -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) {
@ -799,15 +801,24 @@ namespace Stetic.Wrapper
return container.AllChildren;
}
}
public void PasteChild (Gtk.Widget oldChild, Gtk.Widget newChild)
{
using (UndoManager.AtomicChange) {
Widget w = Widget.Lookup (newChild);
w.RequiresUndoStatusUpdate = true;
ReplaceChild (oldChild, newChild, true);
}
}
public void ReplaceChild (Gtk.Widget oldChild, Gtk.Widget newChild, bool destroyOld)
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>