예제 #1
0
        public FileChooser(LayoutEditor newCreator)
        {
            creator = newCreator;

            InitializeComponent();

            this.Visible  = false;
            this.TabStop  = false;
            this.TabIndex = 99999;
        }
예제 #2
0
        public FileChooser(LayoutEditor newCreator)
        {
            creator = newCreator;

            InitializeComponent();

            this.Visible = false;
            this.TabStop = false;
            this.TabIndex = 99999;
        }
예제 #3
0
        public PlayerControl(LayoutEditor newCreator)
        {
            InitializeComponent();

            creator   = newCreator;
            player    = new Player();
            filePath  = "";
            alias     = "";
            isOpen    = false;
            isPlaying = false;

            positionControls();
            updateButtonStates();
        }
예제 #4
0
        public PlayerControl(LayoutEditor newCreator)
        {
            InitializeComponent();

            creator = newCreator;
            player = new Player();
            filePath = "";
            alias = "";
            isOpen = false;
            isPlaying = false;

            positionControls();
            updateButtonStates();
        }
예제 #5
0
        public FlashcardTagsDialog(LayoutEditor newCaller)
        {
            InitializeComponent();

            caller = newCaller;

            lblInheritedTags.Text = caller.deck.category;

            if (!caller.deck.subcategory.Equals(""))
            {
                lblInheritedTags.Text += "," + caller.deck.subcategory;
            }

            txtTags.Text = caller.currentCard.tag;
        }
예제 #6
0
        public FlashcardTagsDialog(LayoutEditor newCaller)
        {
            InitializeComponent();

            caller = newCaller;

            lblInheritedTags.Text = caller.deck.category;

            if (!caller.deck.subcategory.Equals(""))
            {
                lblInheritedTags.Text += "," + caller.deck.subcategory;
            }

            txtTags.Text = caller.currentCard.tag;
        }
예제 #7
0
        public TemplateSelector(LayoutEditor newCreator, string newQuizType)
        {
            templates = new List <Template>();
            buttons   = new List <Button>();

            creator  = newCreator;
            quizType = newQuizType;

            InitializeComponent();

            Button curButton;
            Bitmap bg;

            foreach (Template curTemplate in Template.templates[quizType])
            {
                templates.Add(curTemplate);

                curButton = new Button();

                bg = makeImage(curTemplate);

                curButton.Size = bg.Size;
                curButton.BackgroundImageLayout = ImageLayout.Stretch;
                curButton.BackgroundImage       = bg;
                curButton.Margin    = new Padding(0, 0, 0, 0);
                curButton.Text      = "";
                curButton.FlatStyle = FlatStyle.Standard;
                curButton.Click    += new EventHandler(curButton_Click);
                toolTip.SetToolTip(curButton, "Click to apply this template to the current flashcard");

                buttons.Add(curButton);
                panelTemplates.Controls.Add(curButton);
            }

            RichTextBox legend = new RichTextBox();

            legend.BorderStyle = BorderStyle.None;
            legend.ReadOnly    = true;
            legend.Rtf         = "{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset2 Wingdings;}{\\f1\\fswiss\\fprq2\\fcharset0 Arial;}{\\f2\\fswiss\\fcharset0 Arial;}}\n{\\colortbl ;\\red0\\green120\\blue0;\\red0\\green0\\blue0;\\red255\\green0\\blue0;}\n{\\*\\generator Msftedit 5.41.15.1507;}\\viewkind4\\uc1\\pard\\cf1\\f0\\fs24 n\\cf0\\f1\\fs16  \\cf2 Answer\\cf0\\par\n\\cf3\\f0\\fs24 n\\cf0\\f1\\fs16  \\cf2 Question\\cf0\\f2\\fs20\\par\n}";
            panelTemplates.Controls.Add(legend);

            if (creator.deck.cardList.Count == 0)
            {
                buttons[0].PerformClick();
            }
        }
예제 #8
0
        public CreatorObject(LayoutEditor newCreator, eObject newObj)
        {
            if (newObj == null)
            {
                throw new ArgumentException("eObject argument to CreatorObject constructor cannot be null");
            }

            creator = newCreator;
            obj = newObj;

            InitializeComponent();

            switch (obj.type)
            {
                case Constant.textFile:
                    initTextBox();
                    break;
                case Constant.imageFile:
                    initImage();
                    break;
                case Constant.soundFile:
                    initAudio();
                    break;
                default:
                    throw new ArgumentException("Invalid CreatorObject type: " + obj.type);
            }

            bool canEdit = (creator.deck.type == Constant.noQuizDeck);
            deleteToolStripMenuItem.Enabled = canEdit;

            this.Leave += new System.EventHandler(this.ctlObject_Leave);
            this.Enter += new System.EventHandler(this.ctlObject_Enter);
            ctlObject.MouseDown += new MouseEventHandler(ctlObject_MouseDown);

            ctlObject.ContextMenuStrip = menuContext;

            if (obj.quizType == Constant.answerPrefix)
            {
                this.BackColor = Color.FromArgb(40, Color.Green);
            }
            else if (obj.quizType == Constant.questionPrefix)
            {
                this.BackColor = Color.FromArgb(40, Color.Red);
            }
        }
예제 #9
0
        public TemplateSelector(LayoutEditor newCreator, string newQuizType)
        {
            templates = new List<Template>();
            buttons = new List<Button>();

            creator = newCreator;
            quizType = newQuizType;

            InitializeComponent();

            Button curButton;
            Bitmap bg;
            foreach (Template curTemplate in Template.templates[quizType])
            {
                templates.Add(curTemplate);

                curButton = new Button();

                bg = makeImage(curTemplate);

                curButton.Size = bg.Size;
                curButton.BackgroundImageLayout = ImageLayout.Stretch;
                curButton.BackgroundImage = bg;
                curButton.Margin = new Padding(0, 0, 0, 0);
                curButton.Text = "";
                curButton.FlatStyle = FlatStyle.Standard;
                curButton.Click += new EventHandler(curButton_Click);
                toolTip.SetToolTip(curButton, "Click to apply this template to the current flashcard");

                buttons.Add(curButton);
                panelTemplates.Controls.Add(curButton);
            }

            RichTextBox legend = new RichTextBox();
            legend.BorderStyle = BorderStyle.None;
            legend.ReadOnly = true;
            legend.Rtf = "{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset2 Wingdings;}{\\f1\\fswiss\\fprq2\\fcharset0 Arial;}{\\f2\\fswiss\\fcharset0 Arial;}}\n{\\colortbl ;\\red0\\green120\\blue0;\\red0\\green0\\blue0;\\red255\\green0\\blue0;}\n{\\*\\generator Msftedit 5.41.15.1507;}\\viewkind4\\uc1\\pard\\cf1\\f0\\fs24 n\\cf0\\f1\\fs16  \\cf2 Answer\\cf0\\par\n\\cf3\\f0\\fs24 n\\cf0\\f1\\fs16  \\cf2 Question\\cf0\\f2\\fs20\\par\n}";
            panelTemplates.Controls.Add(legend);

            if (creator.deck.cardList.Count == 0)
            {
                buttons[0].PerformClick();
            }
        }
예제 #10
0
        private CreatorCard(LayoutEditor newCreator, int newCardID, int newUID, string newTag, List<eObject> newObjects, int newIndex)
        {
            _cardID = newCardID;
            _uid = newUID;
            _tag = newTag;
            _objects = new List<CreatorObject>();
            index = newIndex;
            creator = newCreator;

            originalCard = null;

            CreatorObject curNewObj;

            foreach (eObject curEObj in newObjects)
            {
                curNewObj = CreatorObject.newFromEObject(creator, curEObj, (objects.Count * 2) + 10);

                objects.Add(curNewObj);
            }
        }
예제 #11
0
        private CreatorCard(LayoutEditor newCreator, int newCardID, int newUID, string newTag, List <eObject> newObjects, int newIndex)
        {
            _cardID  = newCardID;
            _uid     = newUID;
            _tag     = newTag;
            _objects = new List <CreatorObject>();
            index    = newIndex;
            creator  = newCreator;

            originalCard = null;

            CreatorObject curNewObj;

            foreach (eObject curEObj in newObjects)
            {
                curNewObj = CreatorObject.newFromEObject(creator, curEObj, (objects.Count * 2) + 10);

                objects.Add(curNewObj);
            }
        }
예제 #12
0
 public CreatorCard(LayoutEditor newCreator, Card card, int newIndex)
     : this(newCreator, card.cardID, card.uid, card.tag, card.eObjectList, newIndex)
 {
     originalCard = card;
 }
예제 #13
0
 public CreatorCard(LayoutEditor newCreator, Card card, int newIndex)
     : this(newCreator, card.cardID, card.uid, card.tag, card.eObjectList, newIndex)
 {
     originalCard = card;
 }
예제 #14
0
 public void setCreator(LayoutEditor newCreator)
 {
     creator = newCreator;
 }
예제 #15
0
 public void setCreator(LayoutEditor newCreator)
 {
     creator = newCreator;
 }
예제 #16
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;
        }