예제 #1
0
        private void btnClone_Click(object sender, Janus.Windows.Ribbon.CommandEventArgs e)
        {
            if (currentNewsPaperControl != null)
            {
                INewsPaperControl newcontrol = currentNewsPaperControl.clone();
                Point             p          = new Point(newcontrol.getAttList().getLocation().X *zoomDegree, newcontrol.getAttList().getLocation().Y *zoomDegree);
                Size s = new System.Drawing.Size(newcontrol.getAttList().getSize().Width *zoomDegree, newcontrol.getAttList().getSize().Height *zoomDegree);
                //newcontrol.getCtrl().Location = p;
                newcontrol.getCtrl().Size = s;

                newcontrol.getCtrl().MouseDown += new MouseEventHandler(MainProgram_MouseDown);
                newcontrol.getCtrl().MouseUp   += new MouseEventHandler(MainProgram_MouseUp);
                panelInnerScreen.Controls.Add(newcontrol.getCtrl());
                currentNewsPaperControl = newcontrol;

                iObjNumber++;
                currentNewsPaperControl.getAttList().setInstanceName("Obj" + iObjNumber.ToString());

                saveControlTraceAndSetRealLocationSize();

                //Xử lý marker
                if (currentNewsPaperControl.getName() == "NewsPaperMarker")
                {
                    lstMarker.Add(currentNewsPaperControl);
                    MarkerList.lstMarkerList = new List <string>();
                    foreach (INewsPaperControl c in lstMarker)
                    {
                        MarkerList.lstMarkerList.Add(c.getAttList().getInstanceName());
                    }
                }
            }
        }
예제 #2
0
 void MainProgram_MouseUp(object sender, MouseEventArgs e)
 {
     currentNewsPaperControl = (NewsPaperControlBase)sender;
     currentNewsPaperControl.getAttList().setLocation(currentNewsPaperControl.getCtrl().Location);
     currentNewsPaperControl.getAttList().setSize(currentNewsPaperControl.getCtrl().Size);
     loadProperties();
     preState.Add(currentNewsPaperControl.clone());
     currentState.Add(currentNewsPaperControl);
 }
예제 #3
0
 void MainProgram_MouseUp(object sender, MouseEventArgs e)
 {
     currentNewsPaperControl = (NewsPaperControlBase)sender;
     if (currentNewsPaperControl.getAttList().getLocation() != currentNewsPaperControl.getCtrl().Location ||
         currentNewsPaperControl.getAttList().getSize() != currentNewsPaperControl.getCtrl().Size)
     {
         saveControlTraceAndSetRealLocationSize();
     }
     loadProperties();
     btnClone.Enabled = true;
     //MessageBox.Show(currentNewsPaperControl.getAttList().getSize().Height.ToString());
 }
        public override void copy(INewsPaperControl control)
        {
            Attributs.setLocation(control.getAttList().getLocation());
            Attributs.setSize(control.getAttList().getSize());
            ((CAudioAtt)(Attributs)).AudioURL = ((CAudioAtt)(control.getAttList())).AudioURL;

            /*try
             * {
             *  Bitmap img = new Bitmap(((CAudioAtt)(Attributs)).AudioURL);
             *  ImgBackground = img;
             *  Ctrl.BackgroundImage = ImgBackground;
             * }
             * catch { };*/
        }
예제 #5
0
 public override void copy(INewsPaperControl control)
 {
     Attributs.setLocation(control.getAttList().getLocation());
     Attributs.setSize(control.getAttList().getSize());
     ((C3DObjectAtt)(Attributs)).Md2URL     = ((C3DObjectAtt)(control.getAttList())).Md2URL;
     ((C3DObjectAtt)(Attributs)).TextureURL = ((C3DObjectAtt)(control.getAttList())).TextureURL;
     try
     {
         Bitmap img = new Bitmap(((C3DObjectAtt)(Attributs)).TextureURL);
         ImgBackground        = img;
         Ctrl.BackgroundImage = ImgBackground;
     }
     catch { };
 }
예제 #6
0
 public override void copy(INewsPaperControl control)
 {
     Attributs.setLocation(control.getAttList().getLocation());
     Attributs.setSize(control.getAttList().getSize());
     ((CVideoAtt)(Attributs)).VideoURL = ((CVideoAtt)(control.getAttList())).VideoURL;
     try
     {
         Bitmap img = new Bitmap(((CVideoAtt)(Attributs)).VideoURL);
         ImgBackground        = img;
         Ctrl.BackgroundImage = ImgBackground;
     }
     catch {
         loadBackgroundAndICO();
         Ctrl.BackgroundImage = ImgBackground;
     };
 }
 public override void copy(INewsPaperControl control)
 {
     Attributs.setLocation(control.getAttList().getLocation());
     Attributs.setSize(control.getAttList().getSize());
     //((CMarkerAtt)(Attributs)).MarkerURL = ((CMarkerAtt)(control.getAttList())).MarkerURL;
     //try
     //{
     //    Bitmap img = new Bitmap(((CMarkerAtt)(Attributs)).MarkerURL);
     //    ImgBackground = img;
     //    Ctrl.BackgroundImage = ImgBackground;
     //}
     //catch {
     //    loadBackgroundAndICO();
     //    Ctrl.BackgroundImage = ImgBackground;
     //};
 }
예제 #8
0
        private void RedoMethod()
        {
            if (lstNextState.Count > 0)
            {
                int index = lstNextState.Count - 1;
                if (index >= 0)
                {
                    if (lstNextState[index] == null)
                    {
                        currentNewsPaperControl.removeFromPanel();
                        lstPreState.Add(currentNewsPaperControl.clone());
                    }
                    else
                    {
                        lstNextPointerControl[index].copy(lstNextState[index]);
                        currentNewsPaperControl = lstNextPointerControl[index];
                        bool isNotAvaible = true;
                        foreach (INewsPaperControl contr in lstCurrentPointerControl)
                        {
                            if (lstNextPointerControl[index] == contr)
                            {
                                isNotAvaible = false;
                            }
                        }
                        if (isNotAvaible)
                        {
                            panelInnerScreen.Controls.Add(currentNewsPaperControl.getCtrl());
                        }

                        currentNewsPaperControl.getCtrl().Location = currentNewsPaperControl.getAttList().getLocation();
                        currentNewsPaperControl.getCtrl().Size     = currentNewsPaperControl.getAttList().getSize();

                        lstPreState.Add(lstNextState[index].clone());
                    }

                    lstNextState.RemoveAt(index);
                    lstCurrentPointerControl.Add(lstNextPointerControl[index]);
                    lstNextPointerControl.RemoveAt(index);
                }
            }
            checkRedoButtonState();
            checkUndoButtonState();
        }
예제 #9
0
        void buttonBarItem_Click(object sender, Janus.Windows.ButtonBar.ItemEventArgs e)
        {
            INewsPaperControl item = (INewsPaperControl)((Janus.Windows.ButtonBar.ButtonBarItem)(sender)).Tag;

            if (Directory.GetFiles(Path.Combine(Application.StartupPath, "Plugins"), "*.dll").Length > 0)
            {
                string   Filename = Path.Combine(Application.StartupPath, "Plugins") + @"\" + item.getName() + ".dll";
                Assembly Asm      = Assembly.LoadFile(Filename);
                foreach (Type AsmType in Asm.GetTypes())
                {
                    if (AsmType.GetInterface("INewsPaperControl") != null && AsmType.Name != "NewsPaperControlBase")
                    {
                        NewsPaperControlBase Plugin = (NewsPaperControlBase)Activator.CreateInstance(AsmType);
                        currentNewsPaperControl = Plugin;
                        Point p = new Point(currentNewsPaperControl.getAttList().getLocation().X *zoomDegree, currentNewsPaperControl.getAttList().getLocation().Y *zoomDegree);
                        Size  s = new System.Drawing.Size(currentNewsPaperControl.getAttList().getSize().Width *zoomDegree, currentNewsPaperControl.getAttList().getSize().Height *zoomDegree);
                        Plugin.getCtrl().Location = p;
                        Plugin.getCtrl().Size     = s;

                        iObjNumber++;
                        Plugin.getAttList().setInstanceName("Obj" + iObjNumber.ToString());

                        //Xử lý marker
                        if (Plugin.getName() == "NewsPaperMarker")
                        {
                            lstMarker.Add(Plugin);
                        }
                        MarkerList.lstMarkerList = new List <string>();
                        foreach (INewsPaperControl c in lstMarker)
                        {
                            MarkerList.lstMarkerList.Add(c.getAttList().getInstanceName());
                        }
                        break;
                    }
                }
            }

            ((Control)(currentNewsPaperControl)).MouseDown += new MouseEventHandler(MainProgram_MouseDown);
            ((Control)(currentNewsPaperControl)).MouseUp   += new MouseEventHandler(MainProgram_MouseUp);
            panelInnerScreen.Controls.Add((Control)currentNewsPaperControl);
            saveControlTraceAndSetRealLocationSize();
        }
예제 #10
0
        public override void copy(INewsPaperControl control)
        {
            Attributs.setLocation(control.getAttList().getLocation());
            Attributs.setSize(control.getAttList().getSize());
            foreach (PictureList p in ((CPictureCollectionAtt)control.getAttList()).PictureURLList)
            {
                ((CPictureCollectionAtt)Attributs).PictureURLList.Add(p);
            }

            try
            {
                System.Drawing.Bitmap img = new System.Drawing.Bitmap(((CPictureCollectionAtt)Attributs).PictureURLList[0].PictureURL);
                ImgBackground        = img;
                Ctrl.BackgroundImage = ImgBackground;
            }
            catch {
                loadBackgroundAndICO();
                Ctrl.BackgroundImage = ImgBackground;
            };
        }
예제 #11
0
 private void btnRedo_Click(object sender, Janus.Windows.Ribbon.CommandEventArgs e)
 {
     if (currentNewsPaperControl != null && panelInnerScreen.Controls.Count > 0 && nextState.Count > 0)
     {
         int index = nextState.Count - 1;
         if (index >= 0)
         {
             currentNewsPaperControl.removeFromPanel();
             INewsPaperControl newControl = nextState[index].clone();
             panelInnerScreen.Controls.Add((Control)newControl);
             preState.Add(nextState[index].clone());
             nextState.RemoveAt(index);
             newControl.getCtrl().Location   = newControl.getAttList().getLocation();
             newControl.getCtrl().MouseDown += new MouseEventHandler(MainProgram_MouseDown);
             newControl.getCtrl().MouseUp   += new MouseEventHandler(MainProgram_MouseUp);
             currentNewsPaperControl = newControl;
         }
     }
 }
예제 #12
0
 private void btnUndo_Click(object sender, Janus.Windows.Ribbon.CommandEventArgs e)
 {
     if (currentNewsPaperControl != null && panelInnerScreen.Controls.Count > 0 && preState.Count > 0)
     {
         int index = preState.Count - 2;
         if (index >= 0)
         {
             (currentState[currentState.Count - 2]).copy(preState[index]);
             currentNewsPaperControl = currentState[currentState.Count - 1];
             currentState.RemoveAt(currentState.Count - 1);
             //INewsPaperControl newControl = preState[index].clone();
             //panelInnerScreen.Controls.Add((Control)newControl);
             currentNewsPaperControl.getCtrl().Location = currentNewsPaperControl.getAttList().getLocation();
             //currentNewsPaperControl.getCtrl().MouseDown += new MouseEventHandler(MainProgram_MouseDown);
             //newControl.getCtrl().MouseUp+=new MouseEventHandler(MainProgram_MouseUp);
             nextState.Add(preState[index + 1].clone());
             preState.RemoveAt(index + 1);
             //currentNewsPaperControl = newControl;
         }
     }
 }
예제 #13
0
 public void loadProperties()
 {
     propertyGrid1.SelectedObject = currentNewsPaperControl.getAttList();
 }
예제 #14
0
 public void loadProperties()
 {
     //currentNewsPaperControl.getAttList().setZoomCoefficient(zoomDegree);
     //currentNewsPaperControl.setZoomCoefficient(zoomDegree);
     propertyGrid1.SelectedObject = currentNewsPaperControl.getAttList();
 }