Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

Commit

Permalink
* Controller/MoonlightController.cs: Added default Tool.
Browse files Browse the repository at this point in the history
* gtk-gui/LunarEclipse.View.MainWindow2.cs,
  gtk-gui/LunarEclipse.View.MoonlightWidget.cs, gtk-gui/objects.xml:
  added
* gtk-gui/LunarEclipse.MainWindow2.cs: Renamed to LE.View...
* View/MainWindow2.cs: Added action handlers
* View/MoonlightWidget.cs: Added a MonoDevelop Widget for GtkSilver

svn path=/trunk/lunareclipse/; revision=105876
  • Loading branch information
Manuel Cerón committed Jun 16, 2008
1 parent 4b9d535 commit 6fe6310
Show file tree
Hide file tree
Showing 12 changed files with 367 additions and 39 deletions.
7 changes: 7 additions & 0 deletions ChangeLog
@@ -1,3 +1,10 @@
2008-06-15 Manuel Cerón <ceronman@unicauca.edu.co>

* gtk-gui/LunarEclipse.View.MainWindow2.cs,
gtk-gui/LunarEclipse.View.MoonlightWidget.cs, gtk-gui/objects.xml:
added
* gtk-gui/LunarEclipse.MainWindow2.cs: Renamed to LE.View...

2008-06-15 Manuel Cerón <ceronman@unicauca.edu.co>

* gtk-gui/LunarEclipse.MainWindow2.cs, Icons/circle-tool.png,
Expand Down
4 changes: 4 additions & 0 deletions Controller/ChangeLog
@@ -1,3 +1,7 @@
2008-06-15 Manuel Cerón <ceronman@unicauca.edu.co>

* MoonlightController.cs: Added default Tool.

2008-06-13 Manuel Cerón <ceronman@unicauca.edu.co>

* Toolbox.cs: Added NormalizeRect()
Expand Down
1 change: 1 addition & 0 deletions Controller/MoonlightController.cs
Expand Up @@ -151,6 +151,7 @@ public MoonlightController(GtkSilver moonlight, AnimationTimeline timeline)
storyboardManager.Add(new Storyboard());
undo = new UndoEngine();
Selection = new StandardSelection(this);
CurrentTool = new SelectionTool(this);
}


Expand Down
11 changes: 9 additions & 2 deletions LunarEclipse.mdp
Expand Up @@ -95,7 +95,6 @@
<File name="Controller/UndoActions/UndoPropertyChange.cs" subtype="Code" buildaction="Compile" />
<File name="Controller/UndoActions/UndoRotation.cs" subtype="Code" buildaction="Compile" />
<File name="View/MainWindow2.cs" subtype="Code" buildaction="Compile" />
<File name="gtk-gui/LunarEclipse.MainWindow2.cs" subtype="Code" buildaction="Compile" />
<File name="Icons/circle-tool.png" subtype="Code" buildaction="Nothing" />
<File name="Icons/ellipse-tool.png" subtype="Code" buildaction="Nothing" />
<File name="Icons/path-tool.png" subtype="Code" buildaction="Nothing" />
Expand All @@ -104,6 +103,10 @@
<File name="Icons/line-tool.png" subtype="Code" buildaction="Nothing" />
<File name="Icons/selection-tool.png" subtype="Code" buildaction="Nothing" />
<File name="Icons/icons.svg" subtype="Code" buildaction="Nothing" />
<File name="gtk-gui/LunarEclipse.View.MainWindow2.cs" subtype="Code" buildaction="Compile" />
<File name="View/MoonlightWidget.cs" subtype="Code" buildaction="Compile" />
<File name="gtk-gui/objects.xml" subtype="Code" buildaction="EmbedAsResource" resource_id="objects.xml" />
<File name="gtk-gui/LunarEclipse.View.MoonlightWidget.cs" subtype="Code" buildaction="Compile" />
</Contents>
<References>
<ProjectReference type="Gac" localcopy="True" refto="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
Expand All @@ -117,5 +120,9 @@
<ProjectReference type="Gac" localcopy="True" refto="Mono.Moonlight, Version=3.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756" />
<ProjectReference type="Gac" localcopy="True" refto="System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</References>
<GtkDesignInfo gtkVersion="2.12.2" />
<GtkDesignInfo gtkVersion="2.12.2">
<ExportedWidgets>
<Widget>LunarEclipse.View.MoonlightWidget</Widget>
</ExportedWidgets>
</GtkDesignInfo>
</Project>
5 changes: 5 additions & 0 deletions View/ChangeLog
@@ -1,3 +1,8 @@
2008-06-15 Manuel Cerón <ceronman@unicauca.edu.co>

* MainWindow2.cs: Added action handlers
* MoonlightWidget.cs: Added a MonoDevelop Widget for GtkSilver

2008-06-15 Manuel Cerón <ceronman@unicauca.edu.co>

* MainWindow2.cs: Added new MainWindows, it's going to replace
Expand Down
60 changes: 57 additions & 3 deletions View/MainWindow2.cs
Expand Up @@ -26,18 +26,72 @@
//

using System;
using LunarEclipse.Controller;
using LunarEclipse.Controls;
using LunarEclipse.Model;

namespace LunarEclipse
namespace LunarEclipse.View
{


public partial class MainWindow2 : Gtk.Window
{

public MainWindow2() :
base(Gtk.WindowType.Toplevel)
{
this.Build();

timeline = new AnimationTimeline(800, 70);
controller = new MoonlightController(moonlightwidget.Silver, timeline);
}

protected virtual void OnDeleteEvent (object o, Gtk.DeleteEventArgs args)
{
Gtk.Application.Quit();
}

protected virtual void OnSelectionToolActionActivated (object sender, System.EventArgs e)
{
controller.CurrentTool = new SelectionTool(controller);
}

protected virtual void OnRectangleToolActionActivated (object sender, System.EventArgs e)
{
controller.CurrentTool = new RectangleCreationTool(controller);
}

protected virtual void OnSquareToolActionActivated (object sender, System.EventArgs e)
{
controller.CurrentTool = new SquareCreationTool(controller);
}

protected virtual void OnCircleToolActionActivated (object sender, System.EventArgs e)
{
controller.CurrentTool = new CircleCreationTool(controller);
}

protected virtual void OnEllipseToolActionActivated (object sender, System.EventArgs e)
{
controller.CurrentTool = new EllipseCreationTool(controller);
}

protected virtual void OnPathToolActionActivated (object sender, System.EventArgs e)
{
controller.CurrentTool = new PenCreationTool(controller);
}

protected virtual void OnLineToolActionActivated (object sender, System.EventArgs e)
{
controller.CurrentTool = new LineCreationTool(controller);
}

protected virtual void OnLimpiarActionActivated (object sender, System.EventArgs e)
{
controller.Clear();
}

private MoonlightController controller;

// TODO: Make timeline a stetic widget;
private AnimationTimeline timeline;
}
}
85 changes: 85 additions & 0 deletions View/MoonlightWidget.cs
@@ -0,0 +1,85 @@
// MoonlightWidget.cs
//
// Author:
// Manuel Cerón <ceronman@unicauca.edu.co>
//
// Copyright (c) 2008 [copyright holders]
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
//

using System.Windows.Controls;
using System.Windows.Media;
using Gtk.Moonlight;

namespace LunarEclipse.View {

public partial class MoonlightWidget : Gtk.Bin {

public MoonlightWidget()
{
this.Build();

silver = new GtkSilver();
canvas = new Canvas();
canvas.Width = 600;
canvas.Height = 400;
canvas.Background = new SolidColorBrush(Colors.White);
silver.Attach(canvas);

this.Add(silver);
}

public Canvas Canvas {
get { return canvas; }
set {
canvas = value;
silver.Attach(canvas);
}
}

public int Height {
get { return height; }
set {
height = value;
Canvas.Height = value;
silver.Resize(width, height);
}
}

public int Width {
get { return width; }
set {
width = value;
Canvas.Width = value;
silver.Resize(width, height);
}
}

public GtkSilver Silver {
get { return silver; }
}

private int width;
private int height;
private Canvas canvas;
private GtkSilver silver;
}
}

0 comments on commit 6fe6310

Please sign in to comment.