Пример #1
0
 private void canvas_DragDrop(object sender, DragEventArgs e)
 {
     if (draggingObj != null)
     {
         if (((TabPage)sender).Controls.Count >= 6)
         {
             canvas_DragLeave(sender, e);
             MessageBox.Show("You may have at most 5 objects per side.");
         }
         else
         {
             draggingObj.initialize();
             draggingObj.endInitialDragging();
             currentCard.objects.Add(draggingObj);
             draggingObj = null;
         }
     }
 }
Пример #2
0
        private void canvas_DragEnter(object sender, DragEventArgs e)
        {
            if (e.Data.GetDataPresent(CREATOR_OBJECT_TYPE))
            {
                e.Effect = DragDropEffects.Move;

                draggingObj      = (CreatorObject)(e.Data.GetData(CREATOR_OBJECT_TYPE));
                draggingObj.Name = "draggingObj";
                if (draggingObj.eObj.quizType == Constant.soundFile)
                {
                    draggingObj.Size = new System.Drawing.Size(100, 100);
                }
                else
                {
                    draggingObj.Size = new System.Drawing.Size(100, 100);
                }
                draggingObj.TabIndex = (currentCard.objects.Count * 2) + 10;
                draggingObj.TabStop  = true;

                draggingObj.initialize();
                draggingObj.beginInitialDragging();
                ((TabPage)sender).Controls.Add(draggingObj);
            }
        }
Пример #3
0
        private void canvas_DragEnter(object sender, DragEventArgs e)
        {
            if (e.Data.GetDataPresent(CREATOR_OBJECT_TYPE))
            {
                e.Effect = DragDropEffects.Move;

                draggingObj = (CreatorObject) (e.Data.GetData(CREATOR_OBJECT_TYPE));
                draggingObj.Name = "draggingObj";
                if (draggingObj.eObj.quizType == Constant.soundFile)
                {
                    draggingObj.Size = new System.Drawing.Size(100, 100);
                }
                else
                {
                    draggingObj.Size = new System.Drawing.Size(100, 100);
                }
                draggingObj.TabIndex = (currentCard.objects.Count * 2) + 10;
                draggingObj.TabStop = true;

                draggingObj.initialize();
                draggingObj.beginInitialDragging();
                ((TabPage) sender).Controls.Add(draggingObj);
            }
        }
Пример #4
0
        public static CreatorObject newFromEObject(LayoutEditor newCreator, eObject newObj, int tabStop)
        {
            CreatorObject curNewObj = new CreatorObject(newCreator, newObj);

            curNewObj.Name = "creatorObject";
            curNewObj.TabIndex = tabStop;
            curNewObj.TabStop = true;

            curNewObj.initialize();

            curNewObj.setCoords(newObj.x1, newObj.y1, newObj.x2, newObj.y2);

            return curNewObj;
        }