flush
svn path=/trunk/diacanvas-sharp/; revision=16393
This commit is contained in:
Родитель
89a0787506
Коммит
ab15c9269b
|
@ -12,3 +12,18 @@ extern static IntPtr dia_canvas_item_create (uint object_type, IntPtr dummy);
|
|||
public static CanvasItem ItemCreate (uint object_type) {
|
||||
return new CanvasItem (dia_canvas_item_create (object_type, IntPtr.Zero));
|
||||
}
|
||||
|
||||
[DllImport("diacanvas2")]
|
||||
extern static IntPtr dia_canvas_item_create (uint object_type,
|
||||
string pixbufs, IntPtr pixbuf,
|
||||
string widths, double width,
|
||||
string heights, double height,
|
||||
IntPtr dummy);
|
||||
|
||||
public static CanvasItem ItemCreate (uint object_type, Gdk.Pixbuf pixbuf) {
|
||||
return new CanvasItem (dia_canvas_item_create (object_type,
|
||||
"image", pixbuf.Handle,
|
||||
"width", pixbuf.Width,
|
||||
"height", pixbuf.Height,
|
||||
IntPtr.Zero));
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ public static PlacementTool Image (Gdk.Pixbuf pixbuf)
|
|||
{
|
||||
return new PlacementTool (dia_placement_tool_new (CanvasImage.GType,
|
||||
"image", pixbuf.Handle,
|
||||
"width", 100,
|
||||
"height", 100,
|
||||
"width", pixbuf.Width,
|
||||
"height", pixbuf.Height,
|
||||
IntPtr.Zero));
|
||||
}
|
||||
|
|
|
@ -360,29 +360,6 @@
|
|||
|
||||
<child>
|
||||
<widget class="GtkRadioButton" id="tool5">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="active">False</property>
|
||||
<property name="inconsistent">False</property>
|
||||
<property name="draw_indicator">False</property>
|
||||
<property name="group">tool1</property>
|
||||
<signal name="clicked" handler="TextTool" last_modification_time="Fri, 11 Jul 2003 06:50:53 GMT"/>
|
||||
|
||||
<child>
|
||||
<widget class="GtkImage" id="image5">
|
||||
<property name="visible">True</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkRadioButton" id="tool6">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
|
@ -393,7 +370,7 @@
|
|||
<signal name="clicked" handler="ImageTool" last_modification_time="Sat, 12 Jul 2003 09:15:54 GMT"/>
|
||||
|
||||
<child>
|
||||
<widget class="GtkImage" id="image6">
|
||||
<widget class="GtkImage" id="image5">
|
||||
<property name="visible">True</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
|
|
|
@ -367,7 +367,7 @@
|
|||
<property name="inconsistent">False</property>
|
||||
<property name="draw_indicator">False</property>
|
||||
<property name="group">tool1</property>
|
||||
<signal name="clicked" handler="TextTool" last_modification_time="Fri, 11 Jul 2003 06:50:53 GMT"/>
|
||||
<signal name="clicked" handler="ImageTool" last_modification_time="Sat, 12 Jul 2003 09:15:54 GMT"/>
|
||||
|
||||
<child>
|
||||
<widget class="GtkImage" id="image5">
|
||||
|
@ -380,27 +380,6 @@
|
|||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkRadioButton" id="tool6">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="active">False</property>
|
||||
<property name="inconsistent">False</property>
|
||||
<property name="draw_indicator">False</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkImage" id="image6">
|
||||
<property name="visible">True</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
|
|
|
@ -11,7 +11,8 @@ RESOURCES= -resource:glade/gui.glade \
|
|||
-resource:pixmaps/gimp-zoom.png \
|
||||
-resource:pixmaps/line.png \
|
||||
-resource:pixmaps/box.png \
|
||||
-resource:pixmaps/text.png \
|
||||
-resource:pixmaps/glade-image.png \
|
||||
-resource:pixmaps/text.png
|
||||
|
||||
SAMPLE= sample.exe
|
||||
|
||||
|
|
Двоичный файл не отображается.
После Ширина: | Высота: | Размер: 1.4 KiB |
|
@ -29,7 +29,8 @@ public class Sample {
|
|||
scrolledwindow.Add (view);
|
||||
SetupTools();
|
||||
|
||||
Dia.CanvasItem item = Dia.CanvasItem.ItemCreate (CanvasBox.GType);
|
||||
Pixbuf pixbuf = new Pixbuf (null, "pixmaps/logo.png");
|
||||
Dia.CanvasItem item = Dia.CanvasItem.ItemCreate (CanvasImage.GType, pixbuf);
|
||||
item.Move (200, 200);
|
||||
canvas.Root.Add (item, item);
|
||||
|
||||
|
@ -40,15 +41,14 @@ public class Sample {
|
|||
main.ShowAll();
|
||||
}
|
||||
|
||||
[Glade.Widget] Gtk.Image image1, image2, image3, image4, image5, image6;
|
||||
[Glade.Widget] Gtk.Image image1, image2, image3, image4, image5;
|
||||
void SetupTools()
|
||||
{
|
||||
image1.Pixbuf = new Pixbuf (null, "pixmaps/selection.png");
|
||||
image2.Pixbuf = new Pixbuf (null, "pixmaps/gimp-zoom.png");
|
||||
image3.Pixbuf = new Pixbuf (null, "pixmaps/line.png");
|
||||
image4.Pixbuf = new Pixbuf (null, "pixmaps/box.png");
|
||||
image5.Pixbuf = new Pixbuf (null, "pixmaps/text.png");
|
||||
image6.Pixbuf = new Pixbuf (null, "pixmaps/text.png");
|
||||
image5.Pixbuf = new Pixbuf (null, "pixmaps/glade-image.png");
|
||||
}
|
||||
|
||||
void SelectionTool (object sender, EventArgs args)
|
||||
|
@ -78,22 +78,15 @@ public class Sample {
|
|||
view.Tool.ButtonReleaseEvent += new DiaSharp.ButtonReleaseEventHandler (UnsetTool);
|
||||
}
|
||||
|
||||
Gdk.Pixbuf pixbuf;
|
||||
Pixbuf pixbuf;
|
||||
void ImageTool (object sender, EventArgs args)
|
||||
{
|
||||
ToolCleanUp();
|
||||
pixbuf = new Gdk.Pixbuf ("pixmaps/logo.png");
|
||||
pixbuf = new Pixbuf (null, "pixmaps/logo.png");
|
||||
view.Tool = PlacementTool.Image (pixbuf);
|
||||
view.Tool.ButtonReleaseEvent += new DiaSharp.ButtonReleaseEventHandler (UnsetTool);
|
||||
}
|
||||
|
||||
void TextTool (object sender, EventArgs args)
|
||||
{
|
||||
//ToolCleanUp();
|
||||
//view.Tool = PlacementTool.Text();
|
||||
//view.Tool.ButtonReleaseEvent += new DiaSharp.ButtonReleaseEventHandler (UnsetTool);
|
||||
}
|
||||
|
||||
void ToolCleanUp()
|
||||
{
|
||||
view.ButtonPressEvent -= new ButtonPressEventHandler (Zoom);
|
||||
|
|
Загрузка…
Ссылка в новой задаче