// Populates the list of source records for inclusion/exclusion in the website private void FillSourcesList(SortableListView listView, bool bFirstColumnIsCheckbox) { LogFile.TheLogFile.WriteLine(LogFile.DT_APP, LogFile.EDebugLevel.Note, "FillSourcesList() : " + m_gedcom.m_alSourceRecords.Count.ToString()); m_bDisablePrunepanelCheckEvent = true; // call to item.Checked below invokes event handler. Cursor.Current = Cursors.WaitCursor; Cursor.Show(); listView.Clear(); listView.View = View.Details; int nWidthTitle = listView.Width - 140 - 20; if (bFirstColumnIsCheckbox) { listView.Columns.Add("Include", 30, HorizontalAlignment.Left); nWidthTitle -= 30; } listView.Columns.Add("Title", nWidthTitle, HorizontalAlignment.Left); listView.Columns.Add("Repository", 100, HorizontalAlignment.Left); listView.Columns.Add("Citations", 60, HorizontalAlignment.Left); listView.Columns.Add("B", 30, HorizontalAlignment.Left); listView.Columns.Add("M", 30, HorizontalAlignment.Left); listView.Columns.Add("D", 30, HorizontalAlignment.Left); listView.Columns.Add("Id", 60, HorizontalAlignment.Left); listView.Columns.Add("Pics", 48, HorizontalAlignment.Left); ListViewItem[] temporaryItemsList = new ListViewItem[m_gedcom.m_alSourceRecords.Count]; int nItem = 0; foreach (GEDmill.LLClasses.CSourceRecord sr in m_gedcom.m_alSourceRecords) { CListableBool item = new CListableBool(sr, bFirstColumnIsCheckbox); SetSourceSubItems(item, sr, bFirstColumnIsCheckbox); item.Checked = !(sr.Restricted); temporaryItemsList[nItem++] = item; } listView.Items.AddRange(temporaryItemsList); listView.Sort(); m_tabpagePruneRecordsSources.Text = "Sources (" + listView.Items.Count + ")"; Cursor.Current = Cursors.Default; Cursor.Hide(); m_bDisablePrunepanelCheckEvent = false; }
// Constructor public IndividualBrowserDialog( MainForm mainForm, bool bMultiSelect ) { m_mainForm = mainForm; // // Required for Windows Form Designer support // InitializeComponent( bMultiSelect ); this.m_contextmenuChooseIndi = new ContextMenu(); // // Choose individual context menu // m_menuitemChooseIndiMenuDetails = new MenuItem( "&Details...", new System.EventHandler(this.chooseIndiContextMenuDetails_Click ) ); this.m_contextmenuChooseIndi.MenuItems.Add( m_menuitemChooseIndiMenuDetails ); this.m_contextmenuChooseIndi.Popup += new EventHandler(this.chooseIndiContextMenu_popup); // // listView1 // this.m_sortableListView = new SortableListView(); this.m_sortableListView.Location = new System.Drawing.Point(16, 32); this.m_sortableListView.Name = "listView1"; this.m_sortableListView.Size = new System.Drawing.Size(this.Width-32, 192); this.m_sortableListView.TabIndex = 2; this.m_sortableListView.View = System.Windows.Forms.View.Details; this.m_sortableListView.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.m_sortableListView.ColumnClickHandler); this.m_sortableListView.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right | System.Windows.Forms.AnchorStyles.Left ))); this.m_sortableListView.MultiSelect = bMultiSelect; this.m_sortableListView.SelectedIndexChanged += new System.EventHandler(this.listView1_selectionChanged); this.m_sortableListView.AllowColumnReorder = true; this.m_sortableListView.GridLines = true; this.m_sortableListView.ContextMenu = m_contextmenuChooseIndi; this.Controls.Add(this.m_sortableListView); m_buttonOk.Enabled = false; }
// Populates the list of individuals records for inclusion/exclusion in the website // alSelectedIndividuals is a small array indicating xrefs of those individuals to mark selected. (not currently used, 3Jan08) private void FillIndividualsList(SortableListView listView, bool bExcludeRestricted, ArrayList alSelectedIndividuals, bool bFirstColumnIsCheckbox) { LogFile.TheLogFile.WriteLine(LogFile.DT_APP, LogFile.EDebugLevel.Note, "FillIndividualsList() : " + m_gedcom.m_alIndividualRecords.Count.ToString()); m_bDisablePrunepanelCheckEvent = true; Cursor.Current = Cursors.WaitCursor; Cursor.Show(); listView.Clear(); listView.View = View.Details; int nameWidth = listView.Width - 70 - 70 - 20; if (bFirstColumnIsCheckbox) { listView.Columns.Add("Include", 30, HorizontalAlignment.Left); nameWidth -= 30; } listView.Columns.Add("Name", nameWidth, HorizontalAlignment.Left); listView.Columns.Add("Born", 70, HorizontalAlignment.Left); listView.Columns.Add("Died", 70, HorizontalAlignment.Left); listView.Columns.Add("Id", 60, HorizontalAlignment.Left); listView.Columns.Add("User ref", 78, HorizontalAlignment.Left); listView.Columns.Add("Pics", 48, HorizontalAlignment.Left); // Build an array first then blit the whole array to the list control. This is faster than adding each item to the list control individually. ListViewItem[] temporaryItemsList = new ListViewItem[m_gedcom.m_alIndividualRecords.Count]; int nItem = 0; foreach (GEDmill.LLClasses.CIndividualRecord ir in m_gedcom.m_alIndividualRecords) { // Only allow fully unrestricted individuals. if (bExcludeRestricted && ir.Visibility() != LLClasses.CIndividualRecord.EVisibility.Visible) { continue; } CListableBool lbItem; if (bFirstColumnIsCheckbox) { lbItem = new CListableBool(ir, true); } else { string sSurname = ""; string sFirstName = ""; s_config.CapitaliseName(ir.Name, ref sFirstName, ref sSurname); if (ir.NameSuffix != null && ir.NameSuffix != "") { sFirstName += ", " + ir.NameSuffix; } lbItem = new CListableBool(ir, sSurname, sFirstName, false); } SetIndividualSubItems(lbItem, ir, bFirstColumnIsCheckbox); // alSelectedIndividuals is a small array indicating xrefs of those individuals to mark selected. (not currently used, 3Jan08) if (alSelectedIndividuals != null && alSelectedIndividuals.Contains(ir.m_xref)) { lbItem.Selected = true; } lbItem.Checked = !(ir.Restricted); temporaryItemsList[nItem++] = lbItem; } listView.Items.AddRange(temporaryItemsList); listView.Sort(); m_tabpagePruneRecordsIndis.Text = "Individuals (" + listView.Items.Count + ")"; Cursor.Current = Cursors.Default; Cursor.Hide(); m_bDisablePrunepanelCheckEvent = false; }
// Instantiates all the GUI elements private void CreateControls() { m_buttonNext = new Button(); m_buttonBack = new Button(); m_buttonCancel = new Button(); m_buttonHelp = new Button(); m_buttonSettings = new Button(); m_buttonSettingsCancel = new Button(); m_labelConfigFrontImageEdit = new Label(); m_textboxConfigFrontImageEdit = new TextBox(); m_buttonConfigFrontImageBrowse = new Button(); m_textboxConfigBackImageEdit = new TextBox(); m_labelConfigBackImageEdit = new Label(); m_buttonConfigBackImageBrowse = new Button(); m_labelConfigIndiImageSize = new Label(); m_labelConfigIndiImageWidth = new Label(); m_textboxConfigIndiImageWidth = new TextBox(); m_labelConfigIndiImageHeight = new Label(); m_textboxConfigIndiImageHeight = new TextBox(); m_labelConfigSourceImageSize = new Label(); m_labelConfigSourceImageWidth = new Label(); m_textboxConfigSourceImageWidth = new TextBox(); m_labelConfigSourceImageHeight = new Label(); m_textboxConfigSourceImageHeight = new TextBox(); m_labelConfigThumbnailImageSize = new Label(); m_labelConfigThumbnailImageWidth = new Label(); m_textboxConfigThumbnailImageWidth = new TextBox(); m_labelConfigThumbnailImageHeight = new Label(); m_textboxConfigThumbnailImageHeight = new TextBox(); m_labelConfigCharset = new Label(); m_comboboxConfigCharset = new ComboBox(); m_labelConfigHtmlExtn = new Label(); m_comboboxConfigHtmlExtn = new ComboBox(); m_checkboxConfigW3C = new CheckBox(); m_checkboxConfigUserRecFilename = new CheckBox(); m_labelConfigCustomFooter = new Label(); m_textboxConfigCustomFooter = new TextBox(); m_labelConfigFooterIsHtml = new Label(); m_checkboxConfigFooterIsHtml = new CheckBox(); m_checkboxConfigConserveTreeWidth = new CheckBox(); m_checkboxConfigKeepSiblingOrder = new CheckBox(); m_groupboxMiniTreeColours = new GroupBox(); m_buttonConfigMiniTreeColourIndiBackground = new Button(); m_buttonConfigMiniTreeColourIndiHighlight = new Button(); m_buttonConfigMiniTreeColourIndiBgConcealed = new Button(); m_buttonConfigMiniTreeColourIndiShade = new Button(); m_buttonConfigMiniTreeColourIndiText = new Button(); m_buttonConfigMiniTreeColourIndiLink = new Button(); m_buttonConfigMiniTreeColourBranch = new Button(); m_buttonConfigMiniTreeColourIndiBorder = new Button(); m_buttonConfigMiniTreeColourIndiFgConcealed = new Button(); m_checkboxConfigAllowMultimedia = new CheckBox(); m_checkboxConfigUseBom = new CheckBox(); m_checkboxConfigSupressBackreferences = new CheckBox(); m_labelConfigNoName = new Label(); m_textboxConfigNoName = new TextBox(); m_groupboxConfigWithheldName = new GroupBox(); m_radiobuttonConfigWithheldNameLabel = new RadioButton(); m_radiobuttonConfigWithheldNameName = new RadioButton(); m_textboxConfigWithheldName = new TextBox(); m_checkboxConfigCapNames = new CheckBox(); m_checkboxConfigCapEvents = new CheckBox(); m_checkboxConfigHideEmails = new CheckBox(); m_checkboxConfigOccupationHeadline = new CheckBox(); m_checkboxConfigAllowTrailingSpaces = new CheckBox(); m_checkboxConfigShowWithheldRecords = new CheckBox(); ; m_labelConfigTabSpaces = new Label(); m_textboxConfigTabSpaces = new TextBox(); m_labelConfigCommentary = new Label(); m_labelConfigCommentaryIsHtml = new Label(); // Opening bracket m_checkboxConfigCommentaryIsHtml = new CheckBox(); m_textboxConfigCommentary = new TextBox(); m_labelConfigEmail = new Label(); m_textboxConfigEmail = new TextBox(); m_labelConfigUserLink = new Label(); m_textboxConfigUserLink = new TextBox(); m_textboxConfigIndexName = new TextBox(); m_labelConfigIndexName = new Label(); m_labelConfigIndexNameExtn = new Label(); m_checkboxConfigPreserveFrontPage = new CheckBox(); m_textboxConfigStylesheetName = new TextBox(); m_labelConfigStylesheetName = new Label(); m_labelConfigStylesheetNameExtn = new Label(); m_checkboxConfigPreserveStylesheet = new CheckBox(); m_checkboxConfigIncludeHelppage = new CheckBox(); m_checkboxConfigStats = new CheckBox(); m_checkboxConfigTreeDiagrams = new CheckBox(); m_checkboxConfigTreeDiagramsFakeBg = new CheckBox(); m_labelConfigTreeDiagramsFormat = new Label(); m_comboboxConfigTreeDiagramsFormat = new ComboBox(); m_checkboxConfigMultiPageIndex = new CheckBox(); m_checkboxConfigUserRefInIndex = new CheckBox(); m_labelConfigMultiPageIndexNumber = new Label(); m_textboxConfigMultiPageIndexNumber = new TextBox(); m_checkboxConfigIndiImages = new CheckBox(); m_checkboxConfigNonPictures = new CheckBox(); m_checkboxConfigCdrom = new CheckBox(); m_checkboxConfigRenameOriginals = new CheckBox(); m_checkboxConfigKeepOriginals = new CheckBox(); m_panelWelcome = new Panel(); m_pictureBoxWelcome = new PictureBox(); m_labelWelcomeContinue = new Label(); m_labelWelcomeVersion = new Label(); m_labelWelcomeSubtitle = new Label(); m_picturebox = new PictureBox(); m_panelChooseGedcom = new Panel(); m_buttonChooseGedcomBrowse = new Button(); m_labelChooseGedcom = new Label(); m_labelChooseGedcomInstructions = new Label(); m_textboxChooseGedcom = new TextBox(); m_panelChooseOutput = new Panel(); m_textboxChooseOutput = new TextBox(); m_labelChooseOutputInstructions = new Label(); m_labelChooseOutput = new Label(); m_buttonChooseOutputBrowse = new Button(); m_labelChooseOutputContinue = new Label(); m_panelPruneRecords = new Panel(); m_labelPruneRecordsContinue = new Label(); m_listviewPruneRecordsIndis = new SortableListView(); m_listviewPruneRecordsSources = new SortableListView(); m_labelPruneRecordsInstructions = new Label(); m_labelPruneRecordsButtons = new Label(); m_buttonPruneRecordsSave = new Button(); m_buttonPruneRecordsLoad = new Button(); m_panelSelectKey = new Panel(); m_tabcontrolConfigPanel = new TabControl(); m_tabcontrolPruneRecords = new TabControl(); m_labelSelectKey = new Label(); m_textboxSelectKey = new TextBox(); m_labelSelectKeyInstructions = new Label(); m_labelSelectKeyIndividuals = new Label(); m_listboxSelectKey = new ListBox(); m_buttonSelectKeyAdd = new Button(); m_buttonSelectKeyDelete = new Button(); m_panelAllDone = new Panel(); m_checkboxAllDoneShowSite = new CheckBox(); m_linklabelAllDone = new LinkLabel(); m_labelAllDoneThankYou = new Label(); m_labelAllDoneDirectory = new Label(); m_labelAllDoneStartFile = new Label(); m_contextmenuPruneRecordsIndis = new ContextMenu(); m_contextmenuPruneRecordsSources = new ContextMenu(); m_helpProvider = new HelpProvider(); m_helpProvider.HelpNamespace = s_config.m_sApplicationPath + "\\" + m_sHelpFilename; }