예제 #1
0
    public StoryNode(Vector2 position, float width, float height, GUIStyle style, GUIStyle selectedStyle, GUIStyle inPointStyle, GUIStyle outPointStyle, Action <ConnectionPoint> OnClickInPoint, Action <ConnectionPoint> OnClickOutPoint, Action <StoryNode> OnClickRemoveNode, StoryEditor editor, Story story)
    {
        rect = new Rect(position.x, position.y, width, height);
        this.defaultNodeStyle  = style;
        this.selectedNodeStyle = selectedStyle;
        this.style             = defaultNodeStyle;
        this.editor            = editor;

        this.outPointStyle   = outPointStyle;
        this.OnClickOutPoint = OnClickOutPoint;

        inPoint = new ConnectionPoint(this, ConnectionPointType.In, inPointStyle, OnClickInPoint);

        this.OnRemoveNode = OnClickRemoveNode;

        if (story != null)
        {
            this.story = story;
        }
        else
        {
            Debug.Log(StoryStructure.Instance);
            this._storyID = StoryStructure.Instance.gameObject.AddComponent <Story>().GetInstanceID();
        }
    }
예제 #2
0
        public bool Focus(StoryEditor theSE)
        {
            Focus();
            if (theSE.viewVernacularLangFieldMenuItem.Checked)
            {
                System.Diagnostics.Debug.Assert((_aVerseData.VernacularText.TextBox != null) && _aVerseData.VernacularText.TextBox.Visible);
                _aVerseData.VernacularText.TextBox.Focus();
            }
            else if (theSE.viewNationalLangFieldMenuItem.Checked)
            {
                System.Diagnostics.Debug.Assert((_aVerseData.NationalBTText.TextBox != null) && _aVerseData.NationalBTText.TextBox.Visible);
                _aVerseData.NationalBTText.TextBox.Focus();
            }
            else if (theSE.viewEnglishBTFieldMenuItem.Checked)
            {
                System.Diagnostics.Debug.Assert((_aVerseData.InternationalBTText.TextBox != null) && _aVerseData.InternationalBTText.TextBox.Visible);
                _aVerseData.InternationalBTText.TextBox.Focus();
            }
            else
            {
                return(false);
            }

            return(true);
        }
예제 #3
0
        void buttonDragDropHandle_QueryContinueDrag(object sender, System.Windows.Forms.QueryContinueDragEventArgs e)
        {
            Form form = FindForm();

            System.Diagnostics.Debug.Assert(form is StoryEditor);
            if (form is StoryEditor)
            {
                StoryEditor theSE = (StoryEditor)form;

                // this code causes the vertical scroll bar to move if the user is dragging the mouse beyond
                //  the boundary of the flowLayout panel that these verse controls are sitting it.
                System.Drawing.Point pt = theSE.flowLayoutPanelVerses.PointToClient(MousePosition);
                if (theSE.flowLayoutPanelVerses.Bounds.Height < (pt.Y + 10))                    // close to the bottom edge...
                {
                    theSE.flowLayoutPanelVerses.VerticalScroll.Value += 10;                     // bump the scroll bar down
                }
                else if ((pt.Y < 10) && theSE.flowLayoutPanelVerses.VerticalScroll.Value > 0)   // close to the top edge, while the scroll bar position is non-zero
                {
                    theSE.flowLayoutPanelVerses.VerticalScroll.Value -= Math.Min(10, theSE.flowLayoutPanelVerses.VerticalScroll.Value);
                }

                if (e.Action != DragAction.Continue)
                {
                    theSE.DimDropTargetButtons();
                }
                else
                {
                    theSE.LightUpDropTargetButtons(this);
                }
            }
        }
예제 #4
0
        private void addConsultantCoachNoteOnThisAnchorToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // the only function of the button here is to add a slot to type a con note
            StoryEditor theSE;

            if (!CheckForProperEditToken(out theSE))
            {
                return;
            }

            if (m_theLastButtonClicked != null)
            {
                Debug.Assert(theSE.LoggedOnMember != null);
                string strNote = StoryEditor.GetInitials(theSE.LoggedOnMember.Name) + ": Re: anc: ";
                strNote += m_theLastButtonClicked.Text;

                if (m_theLastButtonClicked.ToolTipText != m_theLastButtonClicked.Text)
                {
                    strNote += String.Format(" ({0})", m_theLastButtonClicked.ToolTipText);
                }

                strNote += ". ";

                theSE.SendNoteToCorrectPane(_ctrlVerse.VerseNumber, strNote);
            }
            else
            {
                MessageBox.Show("Right-click on one of the buttons to choose which one to add the comment to", Properties.Resources.IDS_Caption);
            }
        }
예제 #5
0
 protected void InitTestingQuestions(StoryEditor theSE, TestQuestionsData aTQsData, int nLayoutRow)
 {
     for (int i = 0; i < aTQsData.Count; i++)
     {
         InitTestQuestion(theSE, i, aTQsData[i], nLayoutRow, (i == 0));
     }
 }
예제 #6
0
        void aButton_Click(object sender, EventArgs e)
        {
            Form form = FindForm();

            if ((form != null) && (form is StoryEditor))
            {
                StoryEditor     aSE  = (StoryEditor)form;
                ToolStripButton tssb = (ToolStripButton)sender;

                // the button may have the extra indicator that there's a tooltip.
                string strJumpTarget = tssb.Text;
                int    nIndLen       = CstrTooltipIndicator.Length;
                if (strJumpTarget.Substring(strJumpTarget.Length - nIndLen, nIndLen) == CstrTooltipIndicator)
                {
                    strJumpTarget = strJumpTarget.Substring(0, strJumpTarget.Length - nIndLen);
                }

                aSE.SetNetBibleVerse(strJumpTarget);
                aSE.FocusOnVerse(_ctrlVerse.VerseNumber, true, true);

                // if we aren't already in some text box, then set the focus on the
                //  parent verse form so that scroll wheel can work
                if (CtrlTextBox._inTextBox == null)
                {
                    _ctrlVerse.Focus();
                }
            }
        }
예제 #7
0
        protected bool CheckForProperEditToken(out StoryEditor theSE)
        {
            theSE = TheSE;              // (StoryEditor)FindForm();
            try
            {
                if (theSE == null)
                {
                    throw new ApplicationException(
                              "Unable to edit the file! Restart the program and if it persists, contact [email protected]");
                }

                if (!theSE.IsInStoriesSet)
                {
                    throw theSE.CantEditOldStoriesEx;
                }

                if (!theSE.theCurrentStory.ProjStage.IsEditAllowed(theSE.LoggedOnMember.MemberType))
                {
                    throw theSE.theCurrentStory.ProjStage.WrongMemberTypeEx;
                }
            }
            catch (Exception ex)
            {
                if (theSE != null)
                {
                    theSE.SetStatusBar(String.Format("Error: {0}", ex.Message));
                }
                return(false);
            }

            return(true);
        }
예제 #8
0
        /// <summary>
        /// Setup the template variables related to a single verse of a single project
        /// </summary>
        private void setupReferenceVars(StoryEditor theSE, int projectNum, string strVerseReference,
                                        out bool renderingFound, out bool renderingDenied)
        {
            referenceVariables = new Dictionary <string, string>();

            referenceVariables["ProjectClass"]  = "project" + (projectNum + 1).ToString();
            referenceVariables["Reference"]     = strVerseReference;
            referenceVariables["ReferenceAsId"] = strVerseReference.Replace(' ', '_');

            renderingDenied = false;
            string text = MarkRenderings(projectNum, mapReferenceToVerseTextList[strVerseReference][projectNum],
                                         out renderingFound);

            TermRendering termRendering = termRenderingsList[0];

            if (!renderingFound)
            {
                string strOneStoryUrl = ConstructUrlFromReference(theSE, strVerseReference);
                renderingDenied = termRendering.Denials.Contains(strOneStoryUrl);
            }
            referenceVariables["Text"] = text;

            if (projectNum == 0)
            {
                referenceVariables["StatusBMP"] = RenderingStatus(renderingFound, renderingDenied, strVerseReference);
            }
            else
            {
                referenceVariables["StatusBMP"] = "";
            }
        }
예제 #9
0
        private void regularExpressionHelpToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // launch the ICU help
            string strCommandLine = Properties.Resources.RegexHelpProgram;

            StoryEditor.LaunchProgram(strCommandLine, null);
        }
예제 #10
0
            public void SetView(StoryEditor theSE)
            {
                // the vern should be visible if it is configured and either it's supposed to be visible (based on the
                //  state information) OR it's the only one in existance--i.e. an English story project)
                theSE.viewVernacularLangFieldMenuItem.Checked = (theSE.StoryProject.ProjSettings.Vernacular.HasData &&
                                                                 (IsVernacularVisible ||
                                                                  (!theSE.StoryProject.ProjSettings.NationalBT.HasData &&
                                                                   !theSE.StoryProject.ProjSettings.InternationalBT.HasData)));

                // the National BT should be visible if it is configured and either it's supposed to be visible (based on the
                //  state information) OR it's the only one in existance--i.e. an EnglishBT-only project)
                theSE.viewNationalLangFieldMenuItem.Checked = (theSE.StoryProject.ProjSettings.NationalBT.HasData &&
                                                               (IsNationalBTVisible ||
                                                                (!theSE.StoryProject.ProjSettings.Vernacular.HasData &&
                                                                 !theSE.StoryProject.ProjSettings.InternationalBT.HasData)));

                // the English BT should be visible if it is configured and either it's supposed to be visible (based on the
                //  state information) OR it's the only one in existance--i.e. an EnglishBT-only project)
                theSE.viewEnglishBTFieldMenuItem.Checked = (theSE.StoryProject.ProjSettings.InternationalBT.HasData &&
                                                            (IsEnglishBTVisible ||
                                                             (!theSE.StoryProject.ProjSettings.Vernacular.HasData &&
                                                              !theSE.StoryProject.ProjSettings.NationalBT.HasData)));

                theSE.viewAnchorFieldMenuItem.Checked = IsAnchorVisible;
                theSE.viewStoryTestingQuestionFieldMenuItem.Checked = IsStoryTestingQuestion;
                theSE.viewRetellingFieldMenuItem.Checked            = IsRetellingVisible;
                theSE.viewConsultantNoteFieldMenuItem.Checked       = IsConsultantNotesVisible;
                theSE.viewCoachNotesFieldMenuItem.Checked           = IsCoachNotesVisible;
                theSE.viewNetBibleMenuItem.Checked = IsNetBibleVisible;
            }
예제 #11
0
 public VerseControl(StoryStageLogic storyStageLogic, int nVerseNumber,
                     StoryEditor theSE, LineFlowLayoutPanel parentFlowLayoutPanel)
     : base(storyStageLogic)
 {
     VerseNumber           = nVerseNumber;
     TheSE                 = theSE;
     ParentFlowLayoutPanel = parentFlowLayoutPanel;
 }
예제 #12
0
        // if we've click (or tabbed) into another edit box, then the 'last place we were
        //  searching from' indices are no longer valid.
        protected void ClearSearchIndices()
        {
            StoryEditor theSE = (StoryEditor)_ctrlVerseParent.FindForm();

            if (theSE.m_frmFind != null)
            {
                theSE.m_frmFind.ResetSearchStartParameters();
            }
        }
예제 #13
0
    static void Init()
    {
        StoryEditor window = GetWindow <StoryEditor>(typeof(StoryEditor));

        window.titleContent   = new GUIContent("剧情编辑器");
        window.wantsMouseMove = true;
        window.Show();
        window.OnShowWindow();
    }
예제 #14
0
        private void RunFixupProgram()
        {
            string strRunPath = Path.Combine(StoryProjectData.GetRunningFolder, "FixupOneStoryFile.exe");

            if (File.Exists(strRunPath))
            {
                StoryEditor.LaunchProgram(strRunPath, null);
            }
        }
예제 #15
0
        private void contextMenuStrip_Opening(object sender, CancelEventArgs e)
        {
            // if this is a Biblical story, we have to add a few menu items
            StoryEditor theSE = (StoryEditor)FindForm();

            if (theSE.theCurrentStory.CraftingInfo.IsBiblicalStory)
            {
                contextMenuStrip.Items.Insert(2, menuAddTestQuestion);

                /* adding answer and retelling spots is now done during end-of-state processing for ProjFacReadyForTest1
                 * contextMenuStrip.Items.Insert(3, addTestQuestionAnswerToolStripMenuItem);
                 * contextMenuStrip.Items.Insert(4, addRetellingToolStripMenuItem);
                 */
            }

            // for answers, we have to attach them to the correct question

            /* adding answer spots is now done during end-of-state processing for ProjFacReadyForTest1
             * int nTestQuestionCount = _verseData.TestQuestions.Count;
             * if (nTestQuestionCount > 1)
             * {
             *      addTestQuestionAnswerToolStripMenuItem.DropDown.Items.Clear();
             *      int nIndex = 0;
             *      foreach (TestQuestionData aTQD in _verseData.TestQuestions)
             *              AddAnswerSubmenu(aTQD.QuestionVernacular.ToString(), nIndex++);
             * }
             * else if (nTestQuestionCount == 0)
             *      addTestQuestionAnswerToolStripMenuItem.Enabled = false;
             */

            // add all the test questions to a drop down menu to allow removing them
            removeToolStripMenuItem.DropDown.Items.Clear();

            /*
             * if (theSE.viewRetellingFieldMenuItem.Checked)
             *      AddRemoveRetellingSubmenus(_verseData.Retellings);
             */
            if (theSE.viewStoryTestingQuestionFieldMenuItem.Checked)
            {
                AddRemoveTestQuestionsAndAnswersSubmenus(_verseData.TestQuestions);
            }

            removeToolStripMenuItem.Enabled = (removeToolStripMenuItem.DropDown.Items.Count > 0);

            if (_verseData.IsVisible)
            {
                hideVerseToolStripMenuItem.Text = "&Hide verse";
            }
            else
            {
                hideVerseToolStripMenuItem.Text = "&Unhide verse";
            }

            moveSelectedTextToANewLineToolStripMenuItem.Enabled =
                tableLayoutPanel.Controls.ContainsKey(CstrFieldNameStoryLine);
        }
예제 #16
0
        /* can't think of a good reason to allow them to remove a retelling (at least not this way)
         * protected void AddRemoveRetellingSubmenus(RetellingsData theRD)
         * {
         *      ToolStripMenuItem tsm = AddHeadSubmenu("Retelling(s)");
         *
         *      int nRetellingNum = 1;
         *      foreach (StringTransfer rd in theRD)
         *      {
         *              string strText = rd.ToString();
         *              if (String.IsNullOrEmpty(strText))
         *                      strText = String.Format("<no retelling #{0}>", nRetellingNum);
         *              nRetellingNum++;
         *
         *              AddSubmenu(tsm, strText, theRD, remLine_Click);
         *      }
         * }
         *
         * protected void AddSubmenu(ToolStripMenuItem tsm, string strText, MultipleLineDataConverter theObj, EventHandler theEH)
         * {
         *      ToolStripMenuItem tsmSub = new ToolStripMenuItem();
         *      tsmSub.Name = strText;
         *      tsmSub.Text = strText;
         *      tsmSub.Tag = theObj;
         *      tsmSub.Click += theEH;
         *      tsm.DropDown.Items.Add(tsmSub);
         * }
         *
         * private void remLine_Click(object sender, EventArgs e)
         * {
         *      ToolStripMenuItem tsm = (ToolStripMenuItem)sender;
         *      MultipleLineDataConverter theObj = (MultipleLineDataConverter)tsm.Tag;
         *      theObj.RemoveLine(tsm.Text);
         *      UpdateViewOfThisVerse();
         * }
         */

        internal void UpdateViewOfThisVerse(StoryEditor theSE)
        {
            System.Diagnostics.Debug.Assert(theSE != null);
            ClearControls();
            InitControls(theSE);
            UpdateHeight(Width);
            tableLayoutPanel.PerformLayout();
            PerformLayout();
            theSE.Modified = true;
        }
예제 #17
0
        public ViewEnableForm(StoryEditor theSE,
                              ProjectSettings projSettings, StoryData theCurrentStory)
        {
            InitializeComponent();
            if (projSettings.Vernacular.HasData)
            {
                checkBoxLangVernacular.Text = String.Format(Properties.Resources.IDS_LanguageFields,
                                                            projSettings.Vernacular.LangName);
            }
            else
            {
                checkBoxLangVernacular.Visible = false;
            }

            if (projSettings.NationalBT.HasData)
            {
                checkBoxLangNationalBT.Text = String.Format(Properties.Resources.IDS_StoryLanguageField,
                                                            projSettings.NationalBT.LangName);

                checkBoxLangNationalBT.Enabled = ((theCurrentStory != null) &&
                                                  (((int)theCurrentStory.ProjStage.ProjectStage)
                                                   >= (int)StoryStageLogic.ProjectStages.eProjFacTypeNationalBT));
            }
            else
            {
                checkBoxLangNationalBT.Visible = false;
            }

            if (projSettings.InternationalBT.HasData)
            {
                checkBoxLangInternationalBT.Visible = true;
                checkBoxLangInternationalBT.Enabled = ((theCurrentStory != null) &&
                                                       (((int)theCurrentStory.ProjStage.ProjectStage)
                                                        >=
                                                        (int)
                                                        StoryStageLogic.ProjectStages.eProjFacTypeInternationalBT));
            }
            else
            {
                checkBoxLangInternationalBT.Visible = false;
            }

            checkBoxAnchors.Enabled = ((theCurrentStory != null) &&
                                       (((int)theCurrentStory.ProjStage.ProjectStage)
                                        >= (int)StoryStageLogic.ProjectStages.eProjFacAddAnchors));

            checkBoxStoryTestingQuestions.Enabled = ((theCurrentStory != null) &&
                                                     (((int)theCurrentStory.ProjStage.ProjectStage)
                                                      > (int)StoryStageLogic.ProjectStages.eProjFacAddStoryQuestions));


            checkBoxConsultantNotes.Enabled =
                checkBoxCoachNotes.Enabled  = (theCurrentStory != null);
        }
 // if the coach tries to add a note in the consultant's pane, that should fail.
 // (but it's okay for a project facilitator to add one if they have a question
 //  for the consultant)
 public bool CheckAddNotePrivilege(StoryEditor theSE,
                                   TeamMemberData.UserTypes eLoggedOnMember)
 {
     if (!HasAddNotePrivilege(eLoggedOnMember))
     {
         theSE.SetStatusBar("Error: " + String.Format("You must be logged in as a '{0}' or a '{1}' to add a note here",
                                                      TeamMemberData.GetMemberTypeAsDisplayString(MentorType),
                                                      TeamMemberData.GetMemberTypeAsDisplayString(MenteeType)));
         return(false);
     }
     return(true);
 }
예제 #19
0
        protected void InitStoryLine(StoryEditor theSE, VerseData aVerseData, int nLayoutRow)
        {
            System.Diagnostics.Debug.Assert(!tableLayoutPanel.Controls.ContainsKey(CstrFieldNameStoryLine));
            StoryLineControl aStoryLineCtrl = new StoryLineControl(theSE, this, aVerseData);

            aStoryLineCtrl.Name          = CstrFieldNameStoryLine;
            aStoryLineCtrl.ParentControl = this;

            InsertRow(nLayoutRow);
            tableLayoutPanel.SetColumnSpan(aStoryLineCtrl, 2);
            tableLayoutPanel.Controls.Add(aStoryLineCtrl, 0, nLayoutRow);
        }
        public StoryFrontMatterForm(StoryEditor theSE, StoryProjectData theStoryProjectData, StoryData theCurrentStory)
        {
            _theSE = theSE;
            _theStoryProjectData = theStoryProjectData;
            _theCurrentStory     = theCurrentStory;

            InitializeComponent();

            InitToolboxTextTip(theCurrentStory.CraftingInfo.ProjectFacilitatorMemberID,
                               textBoxProjectFacilitator);

            InitToolboxTextTip(theCurrentStory.CraftingInfo.StoryCrafterMemberID,
                               textBoxStoryCrafter);

            textBoxStoryPurpose.Text  = theCurrentStory.CraftingInfo.StoryPurpose;
            textBoxResourcesUsed.Text = theCurrentStory.CraftingInfo.ResourcesUsed;

            InitToolboxTextTip(theCurrentStory.CraftingInfo.BackTranslatorMemberID,
                               textBoxUnsBackTranslator);

            if (theCurrentStory.CraftingInfo.Testors.Count > 0)
            {
                InitToolboxTextTip(theCurrentStory.CraftingInfo.Testors[0],
                                   textBoxUnsTest1);

                buttonBrowseUnsTest2.Enabled = true;
            }
            else
            {
                buttonBrowseUnsTest2.Enabled = false;
            }

            if (theCurrentStory.CraftingInfo.Testors.Count > 1)
            {
                InitToolboxTextTip(theCurrentStory.CraftingInfo.Testors[1],
                                   textBoxUnsTest2);

                buttonBrowseUnsTest3.Enabled = true;
            }
            else
            {
                buttonBrowseUnsTest3.Enabled = false;
            }

            if (theCurrentStory.CraftingInfo.Testors.Count > 2)
            {
                InitToolboxTextTip(theCurrentStory.CraftingInfo.Testors[2],
                                   textBoxUnsTest3);
            }

            Text = String.Format("Story Information for '{0}'", theCurrentStory.Name);
        }
예제 #21
0
        protected void InitTestQuestion(StoryEditor theSE, int i, TestQuestionData aTQData, int nLayoutRow, bool bShowHeader)
        {
            TestingQuestionControl aTestingQuestionCtrl = new TestingQuestionControl(theSE, this, aTQData, bShowHeader);

            aTestingQuestionCtrl.ParentControl = this;
            aTestingQuestionCtrl.Name          = CstrFieldNameTestQuestions + nLayoutRow.ToString();

            int nRowIndex = nLayoutRow + i;

            InsertRow(nRowIndex);
            tableLayoutPanel.SetColumnSpan(aTestingQuestionCtrl, 2);
            tableLayoutPanel.Controls.Add(aTestingQuestionCtrl, 0, nRowIndex);
        }
        void buttonDragDropHandle_DragDrop(object sender, System.Windows.Forms.DragEventArgs e)
        {
            if (e.Data.GetDataPresent(typeof(ConsultNoteControl)))
            {
                ConsultNoteControl theCNC = (ConsultNoteControl)e.Data.GetData(typeof(ConsultNoteControl));
                System.Diagnostics.Debug.Assert((sender is Button) && (sender == buttonDragDropHandle) && (theCNC.ParentControl != null) && (theCNC.ParentControl is ConsultNotesControl));
                ConsultNoteDataConverter theMovingCNDC = theCNC._myCNDC;
                theCNC._myCollection.Remove(theMovingCNDC);
                _theCNsDC.Insert(0, theMovingCNDC);

                StoryEditor theSE = (StoryEditor)FindForm();
                theSE.ReInitConsultNotesPane(_theCNsDC);
            }
        }
예제 #23
0
        internal static string ConstructUrlFromReference(StoryEditor theSE, string reference)
        {
            string strStoryName, strAnchor;
            int    nLineNum;

            ParseReference(reference, out strStoryName, out nLineNum, out strAnchor);

            StoryData theStory = theSE.TheCurrentStoriesSet.GetStoryFromName(strStoryName);

            System.Diagnostics.Debug.Assert((theStory != null) && ((nLineNum - 1) < theStory.Verses.Count));
            return(OneStoryUrlBuilder.Url(
                       theSE.StoryProject.ProjSettings.ProjectName,
                       theStory.guid,
                       theStory.Verses[nLineNum - 1].guid,
                       OneStoryUrlBuilder.FieldType.eAnchorFields, strAnchor, strAnchor));
        }
예제 #24
0
        protected void InitControls(StoryEditor theSE)
        {
            tableLayoutPanel.SuspendLayout();
            SuspendLayout();

            int nNumRows = 1;

            // if the user is requesting one of the story lines (vernacular, nationalBT, or English), then...
            if (theSE.viewVernacularLangFieldMenuItem.Checked || theSE.viewNationalLangFieldMenuItem.Checked || theSE.viewEnglishBTFieldMenuItem.Checked)
            {
                // ask that control to do the Update View
                InitStoryLine(theSE, _verseData, nNumRows);
                nNumRows++;
            }

            if (theSE.viewAnchorFieldMenuItem.Checked)
            {
                AnchorsData anAnchorsData = _verseData.Anchors;
                if (anAnchorsData != null)
                {
                    InitAnchors(anAnchorsData, nNumRows, TheSE.StoryProject.ProjSettings.InternationalBT.FontToUse);
                    nNumRows++;
                }
            }

            if (theSE.viewRetellingFieldMenuItem.Checked)
            {
                if (_verseData.Retellings.Count > 0)
                {
                    InitRetellings(_verseData.Retellings, nNumRows, theSE.theCurrentStory.CraftingInfo.Testors,
                                   TheSE.StoryProject.ProjSettings.InternationalBT.FontToUse);
                    nNumRows++;
                }
            }

            if (theSE.viewStoryTestingQuestionFieldMenuItem.Checked)
            {
                if (_verseData.TestQuestions.Count > 0)
                {
                    InitTestingQuestions(theSE, _verseData.TestQuestions, nNumRows);
                    nNumRows++;
                }
            }

            tableLayoutPanel.ResumeLayout(false);
            ResumeLayout(false);
        }
        public StringTransfer DoAddNote(string strNote)
        {
            // the only function of the button here is to add a slot to type a con note
            StoryEditor theSE;

            if (!CheckForProperEditToken(out theSE))
            {
                return(null);
            }

            // if we're not given anything to put in the box, at least put in the logged
            //  in member's initials and re
            if (String.IsNullOrEmpty(strNote) && (theSE.LoggedOnMember != null))
            {
                strNote = StoryEditor.GetInitials(theSE.LoggedOnMember.Name) + ": Re: ";
            }

            // if the coach tries to add a note in the consultant's pane, that should fail.
            // (but it's okay for a project facilitator to add one if they have a question
            //  for the consultant)
            if (!_theCNsDC.CheckAddNotePrivilege(theSE, theSE.LoggedOnMember.MemberType))
            {
                return(null);
            }

            StoryStageLogic.ProjectStages eCurState = theSE.theCurrentStory.ProjStage.ProjectStage;
            int round = 1;

            if (eCurState > StoryStageLogic.ProjectStages.eProjFacOnlineReview1WithConsultant)
            {
                round = 2;
                if (eCurState > StoryStageLogic.ProjectStages.eProjFacOnlineReview2WithConsultant)
                {
                    round = 3;
                }
            }

            ConsultNoteDataConverter cndc =
                _theCNsDC.Add(round, theSE.LoggedOnMember.MemberType, strNote);

            System.Diagnostics.Debug.Assert(cndc.Count == 1);

            theSE.ReInitConsultNotesPane(_theCNsDC);

            // return the StringTransfer we just created
            return(cndc[0]);
        }
        readonly BiblicalTermsList _biblicalTerms;           // All Biblical terms

        public BiblicalKeyTermsForm(StoryEditor theSE, ProjectSettings projSettings, ProjectSettings.LanguageInfo liMainLang)
        {
            _theSE        = theSE;
            MainLang      = liMainLang;
            _projSettings = projSettings;
            InitializeComponent();
            _biblicalTerms = BiblicalTermsList.GetBiblicalTerms();
            htmlBuilder    = new BiblicalTermsHTMLBuilder(projSettings);

            // TODO: temporary hack. If we are using the Hindi 'MyKeyTerms' db, then
            // change the 'English Gloss' column header to Hindi and change the font
            if (_biblicalTerms.IsMyBiblicalTerms)
            {
                ColumnGlossEnglish.HeaderText            = "Gloss";
                ColumnGlossEnglish.DefaultCellStyle.Font = new Font("Arial Unicode MS", 12);
            }
        }
예제 #27
0
        public VerseBtControl(StoryEditor theSE, LineFlowLayoutPanel parentFlowLayoutPanel,
                              VerseData dataVerse, int nVerseNumber)
            : base(theSE.theCurrentStory.ProjStage, nVerseNumber, theSE,
                   parentFlowLayoutPanel)
        {
            _verseData = dataVerse;
            InitializeComponent();

            tableLayoutPanel.Controls.Add(labelReference, 0, 0);
            tableLayoutPanel.Controls.Add(buttonDragDropHandle, 1, 0);
            labelReference.Text = CstrVerseName + VerseNumber;

            if (theSE.viewTransliterationVernacular.Checked &&
                !String.IsNullOrEmpty(theSE.LoggedOnMember.TransliteratorVernacular))
            {
                if (TransliteratorVernacular == null)
                {
                    TransliteratorVernacular = new DirectableEncConverter(theSE.LoggedOnMember.TransliteratorVernacular,
                                                                          theSE.LoggedOnMember.
                                                                          TransliteratorDirectionForwardVernacular,
                                                                          NormalizeFlags.None);
                }
            }
            else
            {
                TransliteratorVernacular = null;                  // in case it was set from before
            }
            if (theSE.viewTransliterationNationalBT.Checked &&
                !String.IsNullOrEmpty(theSE.LoggedOnMember.TransliteratorNationalBT))
            {
                if (TransliteratorNationalBT == null)
                {
                    TransliteratorNationalBT = new DirectableEncConverter(theSE.LoggedOnMember.TransliteratorNationalBT,
                                                                          theSE.LoggedOnMember.
                                                                          TransliteratorDirectionForwardNationalBT,
                                                                          NormalizeFlags.None);
                }
            }
            else
            {
                TransliteratorNationalBT = null;
            }

            InitControls(theSE);
        }
예제 #28
0
        private void MoveSelectedTextToANewLineToolStripMenuItem(StoryEditor theSE)
        {
            System.Diagnostics.Debug.Assert(tableLayoutPanel.Controls.ContainsKey(CstrFieldNameStoryLine));
            StoryLineControl slc = tableLayoutPanel.Controls[CstrFieldNameStoryLine] as StoryLineControl;
            string           strVernacular, strNationalBT, strEnglishBT;

            slc.GetTextBoxValues(out strVernacular, out strNationalBT, out strEnglishBT);

            // all this verse to have it's buttons shown (so the editor can delete now
            //  obsolete comments)
            _verseData.AllowConNoteButtonsOverride();

            copyVerseToClipboardToolStripMenuItem_Click(null, null);
            _myClipboard.VernacularText.SetValue(strVernacular);
            _myClipboard.NationalBTText.SetValue(strNationalBT);
            _myClipboard.InternationalBTText.SetValue(strEnglishBT);
            PasteVerseToIndex(VerseNumber);
            // theSE.AddNewVerse(VerseNumber, strVernacular, strNationalBT, strEnglishBT);
        }
예제 #29
0
        public HtmlDisplayForm(StoryEditor theSE, StoryData storyData)
        {
            InitializeComponent();
            htmlStoryBtControl.TheSE               = theSE;
            htmlStoryBtControl.StoryData           = storyData;
            htmlStoryBtControl.ViewItemsToInsureOn = VerseData.SetItemsToInsureOn(
                theSE.viewVernacularLangFieldMenuItem.Checked,
                theSE.viewNationalLangFieldMenuItem.Checked,
                theSE.viewEnglishBTFieldMenuItem.Checked,
                theSE.viewAnchorFieldMenuItem.Checked,
                theSE.viewStoryTestingQuestionFieldMenuItem.Checked,
                theSE.viewRetellingFieldMenuItem.Checked,
                theSE.viewConsultantNoteFieldMenuItem.Checked,
                theSE.viewCoachNotesFieldMenuItem.Checked,
                theSE.viewNetBibleMenuItem.Checked);

            htmlStoryBtControl.MembersData    = theSE.StoryProject.TeamMembers;
            htmlStoryBtControl.LoggedOnMember = theSE.LoggedOnMember;
            htmlStoryBtControl.LoadDocument();
        }
예제 #30
0
        public void Show(StoryEditor theSE, bool bShowFind)
        {
            TheSE = theSE;
            checkBoxLookInStoryLanguage.Visible =
                TheSE.StoryProject.ProjSettings.Vernacular.HasData;

            checkBoxLookInNationalBT.Visible =
                TheSE.StoryProject.ProjSettings.NationalBT.HasData;
            if (TheSE.StoryProject.ProjSettings.NationalBT.HasData)
            {
                checkBoxLookInNationalBT.Text = TheSE.StoryProject.ProjSettings.NationalBT.LangName;
            }

            checkBoxLookInEnglishBT.Visible =
                TheSE.StoryProject.ProjSettings.InternationalBT.HasData;

            checkBoxEnableFind.Checked    = bShowFind;
            checkBoxEnableReplace.Checked = !bShowFind;

            Show();
        }