コード例 #1
0
        public AnchorControl(VerseControl ctrlVerse, StoryStageLogic storyStageLogic,
                             AnchorsData anAnchorsData, Font font)
            : base(storyStageLogic)
        {
            _ctrlVerse     = ctrlVerse;
            _myAnchorsData = anAnchorsData;
            _font          = font;
            InitializeComponent();

            tableLayoutPanel.SuspendLayout();
            SuspendLayout();

            tableLayoutPanel.Controls.Add(labelAnchor, 0, 0);
            tableLayoutPanel.Controls.Add(toolStripAnchors, 1, 0);

            // add the label and tool strip as a new row to the table layout panel
            // finally populate the buttons on that tool strip
            foreach (AnchorData anAnchorData in anAnchorsData)
            {
                ToolStripButton theAnchorButton = InitAnchorButton(toolStripAnchors, anAnchorData);

                if (anAnchorData.ExegeticalHelpNotes.Count > 0)
                {
                    InitExegeticalHelpsRow(ctrlVerse, theAnchorButton, anAnchorData.ExegeticalHelpNotes, ref m_nNumRows);
                }
            }

            tableLayoutPanel.ResumeLayout(false);
            ResumeLayout(false);
        }
コード例 #2
0
 public AnchorsData(AnchorsData rhs)
 {
     IsKeyTermChecked = rhs.IsKeyTermChecked;
     foreach (AnchorData aAnchor in rhs)
     {
         Add(new AnchorData(aAnchor));
     }
 }
コード例 #3
0
ファイル: VerseData.cs プロジェクト: sillsdevarchive/onestory
 public VerseData()
 {
     guid                = Guid.NewGuid().ToString();
     VernacularText      = new StringTransfer(null);
     NationalBTText      = new StringTransfer(null);
     InternationalBTText = new StringTransfer(null);
     Anchors             = new AnchorsData();
     TestQuestions       = new TestQuestionsData();
     Retellings          = new RetellingsData();
     ConsultantNotes     = new ConsultantNotesData();
     CoachNotes          = new CoachNotesData();
 }
コード例 #4
0
        protected void InitAnchors(AnchorsData anAnchorsData, int nLayoutRow, Font font)
        {
            System.Diagnostics.Debug.Assert(!tableLayoutPanel.Controls.ContainsKey(CstrFieldNameAnchors));
            AnchorControl anAnchorCtrl = new AnchorControl(this, StageLogic, anAnchorsData, font);

            anAnchorCtrl.Name          = CstrFieldNameAnchors;
            anAnchorCtrl.ParentControl = this;

            InsertRow(nLayoutRow);
            tableLayoutPanel.SetColumnSpan(anAnchorCtrl, 2);
            tableLayoutPanel.Controls.Add(anAnchorCtrl, 0, nLayoutRow);
        }
コード例 #5
0
ファイル: VerseData.cs プロジェクト: sillsdevarchive/onestory
        public VerseData(VerseData rhs)
        {
            // the guid shouldn't be replicated
            guid         = Guid.NewGuid().ToString();       // rhs.guid;
            IsFirstVerse = rhs.IsFirstVerse;
            IsVisible    = rhs.IsVisible;

            VernacularText      = new StringTransfer(rhs.VernacularText.ToString());
            NationalBTText      = new StringTransfer(rhs.NationalBTText.ToString());
            InternationalBTText = new StringTransfer(rhs.InternationalBTText.ToString());
            Anchors             = new AnchorsData(rhs.Anchors);
            TestQuestions       = new TestQuestionsData(rhs.TestQuestions);
            Retellings          = new RetellingsData(rhs.Retellings);
            ConsultantNotes     = new ConsultantNotesData(rhs.ConsultantNotes);
            CoachNotes          = new CoachNotesData(rhs.CoachNotes);
        }
コード例 #6
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);
        }
コード例 #7
0
ファイル: VerseData.cs プロジェクト: sillsdevarchive/onestory
        public VerseData(NewDataSet.verseRow theVerseRow, NewDataSet projFile)
        {
            guid = theVerseRow.guid;

            if (!theVerseRow.IsfirstNull())
            {
                IsFirstVerse = theVerseRow.first;
            }

            if (!theVerseRow.IsvisibleNull())
            {
                IsVisible = theVerseRow.visible;
            }

            VernacularText      = new StringTransfer((!theVerseRow.IsVernacularNull()) ? theVerseRow.Vernacular : null);
            NationalBTText      = new StringTransfer((!theVerseRow.IsNationalBTNull()) ? theVerseRow.NationalBT : null);
            InternationalBTText = new StringTransfer((!theVerseRow.IsInternationalBTNull()) ? theVerseRow.InternationalBT : null);

            Anchors         = new AnchorsData(theVerseRow, projFile);
            TestQuestions   = new TestQuestionsData(theVerseRow, projFile);
            Retellings      = new RetellingsData(theVerseRow, projFile);
            ConsultantNotes = new ConsultantNotesData(theVerseRow, projFile);
            CoachNotes      = new CoachNotesData(theVerseRow, projFile);
        }
コード例 #8
0
        public void Show(AnchorsData theAnchors, StoryProjectData theStoryProject)
        {
            Show();
            Cursor curCursor = Cursor;

            Cursor = Cursors.WaitCursor;

            try
            {
#if DEBUG
                // Test the Sword names vs. the names used by Paratext
                foreach (string str in AnchorData.mapSwordToParatextBookCodes.Values)
                {
                    VerseRef verser = new VerseRef(str + " 1:1");
                }
                foreach (string str in AnchorData.mapSwordToParatextBookCodes.Keys)
                {
                    string     strAnchor  = str + " 1:1";
                    AnchorData anchorData = new AnchorData(strAnchor, strAnchor);
                    VerseRef   verser     = new VerseRef(anchorData.AnchorAsVerseRef);
                }
#endif

                List <string> lstRefs = new List <string>();
                foreach (AnchorData anAnchor in theAnchors)
                {
                    VerseRef verseRef = new VerseRef(anAnchor.AnchorAsVerseRef);
                    lstRefs.Add(verseRef.BBBCCCVVV());
                }

                visibleTerms.Clear();
                progressBarLoadingKeyTerms.Maximum = _biblicalTerms.Terms.Count;
                progressBarLoadingKeyTerms.Value   = 0;
                foreach (Term term in _biblicalTerms.Terms)
                {
                    foreach (Verse aVerseReference in term.References)
                    {
                        if (lstRefs.Contains(aVerseReference.VerseRef.BBBCCCVVV()))
                        {
                            visibleTerms.Add(term);
                            break;
                        }
                    }
                    progressBarLoadingKeyTerms.Value++;
                }

                // indicate that we've checked the key terms here.
                theAnchors.IsKeyTermChecked = true;

                if (visibleTerms.Count == 0)
                {
                    MessageBox.Show(Localizer.Str("There are no Biblical Terms in this verse(s)."));
                    return;
                }

                renderings        = TermRenderingsList.GetTermRenderings(_projSettings.ProjectFolder, MainLang.LangCode);
                termLocalizations = TermLocalizations.Localizations;

                ColumnTermLemma.DefaultCellStyle.Font       = new Font("Charis SIL", 12);
                ColumnStatus.DefaultCellStyle.Font          = new Font("Wingdings", 11);
                ColumnRenderings.DefaultCellStyle.Font      = MainLang.FontToUse;
                ColumnRenderings.DefaultCellStyle.ForeColor = MainLang.FontColor;

                termIndexRequested = -1;
                LoadTermsList();
            }
            catch (Exception ex)
            {
                MessageBox.Show(String.Format(Properties.Resources.IDS_KeyTermsProblem,
                                              Environment.NewLine, ex.Message), Properties.Resources.IDS_Caption);
                return;
            }
            finally
            {
                Cursor = curCursor;
            }
        }