Пример #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;
        }