示例#1
0
文件: Context.cs 项目: dzamkov/DUIP
 public TranslatedProbe(Point Offset, Probe Source)
     : base(Source)
 {
     this._Offset = Offset;
 }
示例#2
0
 public InputContext(Probe Probe)
 {
     this._Probe = Probe;
 }
示例#3
0
文件: Context.cs 项目: dzamkov/DUIP
 public DerivedProbe(Probe Source)
 {
     this._Source = Source;
 }
示例#4
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            this.MakeCurrent();

            this._Renderer = new Renderer();
            this._Renderer.Cache = new FileSystemRenderCache(Program.Cache["Render"]);
            this._Renderer.Initialize();
            SystemTypeface.Create = this._Renderer.CreateSystemTypeface;

            this._Probe = new Probe();
            this._InputContext = new InputContext(this._Probe);

            this._Camera = new Camera(new Point(0.0, 0.0), 1.0);
            this._Ambience = new OceanAmbience(Random.Default);
            this._World = new World(this._InputContext, new Theme());
            this._MakeView();

            Content testcontent = new EditorContent();
            this._World.Spawn(testcontent, Point.Origin);
        }
示例#5
0
文件: Node.cs 项目: dzamkov/DUIP
 public _NodeProbe(Node Node, Probe Source)
     : base(Source)
 {
     this._Node = Node;
 }
示例#6
0
文件: Node.cs 项目: dzamkov/DUIP
 /// <summary>
 /// Calls the probe signal change handler on the input context and returns wether the event was handled.
 /// </summary>
 /// <param name="Probe">The probe in the parent input context whose signal was changed.</param>
 public bool ProbeSignalChange(Probe Probe, ProbeSignal Signal, bool Value)
 {
     bool handled = false;
     if (this._ProbeSignalChange != null)
     {
         this._ProbeSignalChange(new _NodeProbe(this._Node, Probe), Signal, Value, ref handled);
     }
     return handled;
 }
示例#7
0
文件: Node.cs 项目: dzamkov/DUIP
        /// <summary>
        /// Handles a probe signal change over the node.
        /// </summary>
        /// <param name="Offset">The offset of the probe from the top-left corner of the node.</param>
        public void ProbeSignalChange(World World, Probe Probe, Point Offset, ProbeSignal Signal, bool Value)
        {
            // See if the event can be handled by the content of the node
            if (this._InputContext.ProbeSignalChange(Probe, Signal, Value))
                return;

            // Start dragging if possible
            if (this._DragState == null && Signal == ProbeSignal.Primary && Value == true)
            {
                this._DragState = new DragState
                {
                    Offset = Offset,
                    Probe = Probe,
                    ReleaseProbe = Probe.Lock()
                };
            }
        }
示例#8
0
文件: World.cs 项目: dzamkov/DUIP
 /// <summary>
 /// Handles a probe signal change event from the input context.
 /// </summary>
 private void _ProbeSignalChange(Probe Probe, ProbeSignal Signal, bool Value, ref bool Handled)
 {
     Point pos = Probe.Position;
     Node node = this.NodeAtPoint(pos);
     if (node != null)
     {
         Handled = true;
         node.ProbeSignalChange(this, Probe, pos - node.Position, Signal, Value);
     }
 }