Esempio n. 1
0
        // Graphics prep
        private void PrepareForDisplay()
        {
            // This method will prepare the data for the graphics engine to make it faster
            // It take all the bible text and break it across multiple slides
            // Requirements: reload data on the fly (save state and start from where left off)

            // Clean up
            int currentVerseBackup = currentVerseNum; // back this up just in case

            this.slideData.Clear();

            // Init
            bibFont = PresenterFont.GetFontFromDatabase(-1); // Get the bib font from db

            /// Split each of the verses if necessary
            foreach (BibleVerse bvCurrent in this.bibVerses.Values)
            {
                // Calculate max block size
                Size   nativeSize   = DisplayEngine.NativeResolution.Size;
                int    transCount   = TranslationList().Count;
                double insideHeight = nativeSize.Height;
                insideHeight -= imageFactory.paddingPixels * 2;                // Top and bottom
                insideHeight -= imageFactory.paddingPixels * (transCount - 1); // Between translations
                insideHeight /= transCount;
                insideHeight -= bibFont.SizeInPoints * 1.5;                    // Space for verse labels
                int  maxh    = (int)insideHeight;
                Size maxSize = new Size(imageFactory.maxInsideWidth, maxh);

                VerseBreakDown d = new VerseBreakDown();
                d.bibleVerse    = bvCurrent;
                d.primaryText   = InternalBreakString(bvCurrent.RefVerse, bvCurrent.Text, maxSize);
                d.secondaryText = InternalBreakString(bvCurrent.SecondaryVerse, bvCurrent.SecondaryText, maxSize);
                d.tertiaryText  = InternalBreakString(bvCurrent.TertiaryVerse, bvCurrent.TertiaryText, maxSize);
                slideData.Add(bvCurrent.RefVerse, d);
            }

            // Read initial opacity
            EnsureBackground();
            UpdateOpacity(Program.ConfigHelper.BibleImageOpacity);

            // Reset the current location
            if (bibVerses.Count > 0 && currentVerseBackup < bibVerses.Count + 1 &&
                currentVerseBackup != -1)
            {
                currentVerseNum = currentVerseBackup;
            }
            else
            {
                currentVerseNum = 1;
            }
        }
Esempio n. 2
0
        private void btnFont_Click(object sender, EventArgs e)
        {
#if DEMO
            new DemoVersionOnly("Changing font").ShowDialog();
#else
            FontSelection fsForm = new FontSelection();
            currentRow.FontId = currentRow.AutoNumber;
            fsForm.LoadFont(PresenterFont.GetFontFromDatabase(currentRow.FontId));
            if (fsForm.ShowDialog() == DialogResult.OK)
            {
                PresenterFont.SaveFontToDatabase(currentRow.FontId, fsForm.PresenterFont);
            }
#endif
        }
Esempio n. 3
0
 private void btnFont_Click(object sender, EventArgs e)
 {
     #if DEMO
     new DemoVersionOnly("Changing font").ShowDialog();
     #else
     FontSelection fsForm = new FontSelection();
     fsForm.LoadFont(PresenterFont.GetFontFromDatabase(-2));
     if (fsForm.ShowDialog() == DialogResult.OK)
     {
         PresenterFont.SaveFontToDatabase(-2, fsForm.PresenterFont);
     }
     Program.ConfigHelper.NotifySongDefaultsChanged();
     #endif
 }
Esempio n. 4
0
        private void btnFont_Click(object sender, EventArgs e)
        {
#if DEMO
            new DemoVersionOnly("Changing font").ShowDialog();
#else
            FontSelection fsForm = new FontSelection();
            fsForm.LoadFont(PresenterFont.GetFontFromDatabase(-1));
            fsForm.cbDoubleSpace.Visible = false;
            fsForm.gbAlignment.Visible   = (GetCurrentFormat() != BibleRenderingFormat.MultiTranslation);
            if (fsForm.ShowDialog() == DialogResult.OK)
            {
                PresenterFont.SaveFontToDatabase(-1, fsForm.PresenterFont);
                proj.RefreshData();
            }
#endif
        }
Esempio n. 5
0
        private void btnFont_Click(object sender, EventArgs e)
        {
#if DEMO
            new DemoVersionOnly("Changing font").ShowDialog();
#else
            FontSelection fsForm = new FontSelection();
            fsForm.LoadFont(PresenterFont.GetFontFromDatabase(proj.currentSong.FontId));
            if (fsForm.ShowDialog() == DialogResult.OK)
            {
                proj.currentSong.FontId = proj.currentSong.AutoNumber;
                PresenterFont.SaveFontToDatabase(proj.currentSong.FontId, fsForm.PresenterFont);
                proj.RefreshData();
            }
            proj.currentSong.AcceptChanges();
#endif
        }
Esempio n. 6
0
        private void LoadData(PresenterDataset.SongsRow currentSong)
        {
            // Clear
            songVerses.Clear();

            // Populate songVerses
            LoadVerses(songVerses, currentSong.AutoNumber, false);

            // Load other data
            currentSong.Image       = Data.Songs.GetSongBackground(currentSong.AutoNumber);
            copyright               = EmpowerPresenter.Data.Songs.GetSongCopyright(currentSong.AutoNumber);
            songFont                = PresenterFont.GetFontFromDatabase(currentSong.FontId);
            graphicsContext.opacity = currentSong.Overlay;
            if (graphicsContext.opacity == 777)
            {
                graphicsContext.opacity = Program.ConfigHelper.SongDefaultOpacity;
            }

            // Load img into context
            if (graphicsContext.img == null)
            {
                PhotoInfo pi = new PhotoInfo();
                pi.ImageId          = currentSong.Image;
                graphicsContext.img = pi.FullSizeImage;
            }

            // Load formatting settings
            string settings = currentSong.Settings;

            if (settings == null || settings == "")
            {
                settings = Program.ConfigHelper.SongDefaultFormat;
            }
            string[] sparts = settings.Split("|".ToCharArray());
            if (sparts.Length == 2)
            {
                stripFormatting     = bool.Parse(sparts[0]);
                includeVerseNumbers = bool.Parse(sparts[1]);
            }
        }