private void ButtonColor_Click(object sender, RoutedEventArgs e) { AugmentedButton button = (AugmentedButton)sender; SolidColorBrush brush = (SolidColorBrush)button.Background; ObjColorPicker.SelectedColor = brush.Color; }
private void button_brainstorm_Click(object sender, RoutedEventArgs e) { AugmentedButton button_brainstorm = sender as AugmentedButton; TopicOverviewData tod = button_brainstorm.Tag as TopicOverviewData; MainWindowServiceDispatcher.Instance.ExploreTopicInBrainstorm(tod.web_library_detail, tod.topic); }
public static void FormatWebcastButton(AugmentedButton ButtonWebcast, Webcast webcast) { ButtonWebcast.Icon = Icons.GetAppIcon(Icons.Webcast); ButtonWebcast.ToolTip = webcast.description; ButtonWebcast.Tag = webcast; ButtonWebcast.Click += ButtonWebcast_Click; }
void ThemeColorButton_Click(object sender, RoutedEventArgs e) { FeatureTrackingManager.Instance.UseFeature(Features.App_ThemeColour); AugmentedButton button = sender as AugmentedButton; Color color = (Color)button.Tag; ThemeColours.SetThemeColour(color); }
public AugmentedPopup GetWindowLocationPopupMenu() { AugmentedButton ImageLeft = new AugmentedButton(); AugmentedButton ImageBottom = new AugmentedButton(); AugmentedButton ImageRight = new AugmentedButton(); AugmentedButton ImageFloating = new AugmentedButton(); AugmentedButton ImageClose = new AugmentedButton(); ImageLeft.Icon = Icons.GetAppIcon(Icons.DualTabbed_TopLeft); ImageBottom.Icon = Icons.GetAppIcon(Icons.DualTabbed_Bottom); ImageRight.Icon = Icons.GetAppIcon(Icons.DualTabbed_TopRight); ImageFloating.Icon = Icons.GetAppIcon(Icons.DualTabbed_Floating); ImageClose.Icon = Icons.GetAppIcon(Icons.DualTabbed_Close); ImageLeft.Visibility = item.location == DualTabbedLayoutItem.Location.Left ? Visibility.Collapsed : Visibility.Visible; ImageBottom.Visibility = item.location == DualTabbedLayoutItem.Location.Bottom ? Visibility.Collapsed : Visibility.Visible; ImageRight.Visibility = item.location == DualTabbedLayoutItem.Location.Right ? Visibility.Collapsed : Visibility.Visible; ImageFloating.Visibility = item.can_floating ? (item.location == DualTabbedLayoutItem.Location.Floating ? Visibility.Collapsed : Visibility.Visible) : Visibility.Collapsed; ImageClose.Visibility = item.can_close ? Visibility.Visible : Visibility.Collapsed; ImageLeft.ToolTip = ImageLeft.Caption = "Move pane to top-left-hand group"; ImageBottom.ToolTip = ImageBottom.Caption = "Move pane to bottom group"; ImageRight.ToolTip = ImageRight.Caption = "Move pane to top-right-hand group"; ImageFloating.ToolTip = ImageFloating.Caption = "Move pane to a floating window"; ImageClose.ToolTip = ImageClose.Caption = "Close pane"; ImageLeft.CaptionDock = Dock.Right; ImageBottom.CaptionDock = Dock.Right; ImageRight.CaptionDock = Dock.Right; ImageFloating.CaptionDock = Dock.Right; ImageClose.CaptionDock = Dock.Right; ImageLeft.Click += ImageLeft_MouseDown; ImageBottom.Click += ImageBottom_MouseDown; ImageRight.Click += ImageRight_MouseDown; ImageFloating.Click += ImageFloating_MouseDown; ImageClose.Click += ImageClose_Click; StackPanel popup_panel = new StackPanel(); popup_panel.Children.Add(ImageLeft); popup_panel.Children.Add(ImageBottom); popup_panel.Children.Add(ImageRight); popup_panel.Children.Add(ImageFloating); popup_panel.Children.Add(ImageClose); popup = new AugmentedPopup(popup_panel); return(popup); }
//ProxySettingsControl.StandardProxySettings proxy_settings = new ProxySettingsControl.StandardProxySettings(); //DisableSSLData disable_ssl_data = new DisableSSLData(); public LoginWindow() { //Theme.Initialize(); -- already done in StandardWindow base class InitializeComponent(); ProgressInfo.Text = ""; ProgressInfoWrapper.Visibility = Visibility.Collapsed; StatusManager.Instance.OnStatusEntryUpdate += StatusManager_OnStatusEntryUpdate; Title = String.Format("Welcome to Qiqqa v{0}!", ClientVersion.CurrentBuild); if (WebsiteAccess.IsTestEnvironment) { Title = String.Format("Welcome to Qiqqa v{0}! (TEST ENVIRONMENT)", ClientVersion.CurrentBuild); } WindowStyle = WindowStyle.SingleBorderWindow; Brush BRUSH = new LinearGradientBrush(Colors.White, Color.FromRgb(230, 240, 255), 90); Background = BRUSH; ImageQiqqaLogo.Source = Icons.GetAppIcon(Icons.QiqqaLogoSmall); ObjQiqqaDatabaseLocation.Text = ConfigurationManager.Instance.BaseDirectoryForQiqqa; ObjQiqqaDatabaseLocation.ToolTip = ConfigurationManager.Instance.BaseDirectoryForQiqqa; ButtonChangeBasePath.Click += ButtonChangeBasePath_Click; ButtonRestore.Icon = Icons.GetAppIcon(Icons.Backup); ButtonRestore.IconWidth = ButtonRestore.IconHeight = 64; ButtonRestore.Caption = "Restore"; ButtonRestore.Click += ButtonRestore_Click; ButtonBackup.Icon = Icons.GetAppIcon(Icons.Backup); ButtonBackup.IconWidth = ButtonBackup.IconHeight = 64; ButtonBackup.Caption = "Backup"; ButtonBackup.Click += ButtonBackup_Click; ButtonGuest.Click += ButtonGuest_Click; AugmentedButton.ApplyStyling(ButtonGuest); IsEnabled = true; Closing += LoginWindow_Closing; Closed += LoginWindow_Closed; KeyDown += LoginWindow_KeyDown; }
public LoginWindow() { InitializeComponent(); Title = "Welcome to Qiqqa!"; if (WebsiteAccess.IsTestEnvironment) { Title = "Welcome to Qiqqa! (TEST ENVIRONMENT)"; } WindowStyle = WindowStyle.SingleBorderWindow; Brush BRUSH = new LinearGradientBrush(Colors.White, Color.FromRgb(230, 240, 255), 90); this.Background = BRUSH; ImageQiqqaLogo.Source = Icons.GetAppIcon(Icons.QiqqaLogoSmall); { ObjQiqqaDatabaseLocation.Text = ConfigurationManager.Instance.BaseDirectoryForQiqqa; ButtonRestore.Icon = Icons.GetAppIcon(Icons.Backup); ButtonRestore.IconWidth = ButtonRestore.IconHeight = 64; ButtonRestore.Caption = "Restore"; ButtonRestore.Click += ButtonRestore_Click; ButtonBackup.Icon = Icons.GetAppIcon(Icons.Backup); ButtonBackup.IconWidth = ButtonBackup.IconHeight = 64; ButtonBackup.Caption = "Backup"; ButtonBackup.Click += ButtonBackup_Click; } { ButtonGuest.Click += ButtonGuest_Click; AugmentedButton.ApplyStyling(ButtonGuest); } this.IsEnabled = true; this.Closing += LoginWindow_Closing; this.KeyDown += LoginWindow_KeyDown; }
private void PopulateDetail(bool detailed_mode) { // Clear the old ObjHeader.Header = null; ObjHeader.ToolTip = null; ObjPapers.Children.Clear(); // Try to get the context TopicOverviewData tod = DataContext as TopicOverviewData; if (null == tod) { return; } // Quick refs ExpeditionDataSource eds = tod.web_library_detail.Xlibrary?.ExpeditionManager?.ExpeditionDataSource; if (null != eds) { LDAAnalysis lda_analysis = eds.LDAAnalysis; // First the terms header { string header = eds.GetDescriptionForTopic(tod.topic); ObjHeader.Header = header; ObjHeader.ToolTip = header; ObjHeader.HeaderBackground = new SolidColorBrush(eds.Colours[tod.topic]); } // Then the docs { int NUM_DOCS = Math.Min(detailed_mode ? 50 : 10, lda_analysis.NUM_DOCS); ASSERT.Test(tod.topic >= 0); ASSERT.Test(tod.topic < lda_analysis.NUM_TOPICS); for (int d = 0; d < NUM_DOCS && d < eds.docs.Count; ++d) { DocProbability[] docs = lda_analysis.DensityOfDocsInTopicsSorted[tod.topic]; ASSERT.Test(docs != null); ASSERT.Test(docs.Length == lda_analysis.NUM_DOCS); DocProbability lda_elem = docs[d]; ASSERT.Test(lda_elem != null); PDFDocument pdf_document = tod.web_library_detail.Xlibrary.GetDocumentByFingerprint(eds.docs[lda_elem.doc]); string doc_percentage = String.Format("{0:N0}%", 100 * lda_elem.prob); bool alternator = false; TextBlock text_doc = ListFormattingTools.GetDocumentTextBlock(pdf_document, ref alternator, Features.Expedition_TopicDocument, TopicDocumentPressed_MouseButtonEventHandler, doc_percentage + " - "); ObjPapers.Children.Add(text_doc); } // The MORE button if (!detailed_mode && NUM_DOCS < eds.docs.Count) { AugmentedButton button_more = new AugmentedButton(); button_more.Caption = "Show me more"; button_more.Click += button_more_Click; ObjPapers.Children.Add(button_more); } // The BRAINSTORM button { AugmentedButton button_brainstorm = new AugmentedButton(); button_brainstorm.Caption = "Show me in Brainstorm"; button_brainstorm.Click += button_brainstorm_Click; button_brainstorm.Tag = tod; ObjPapers.Children.Add(button_brainstorm); } } } }
public ConfigurationControl() { InitializeComponent(); this.DataContext = ConfigurationManager.Instance.ConfigurationRecord_Bindable; this.Background = ThemeColours.Background_Brush_Blue_LightToDark; bool ADVANCED_MENUS = ConfigurationManager.Instance.ConfigurationRecord.GUI_AdvancedMenus; ButtonOpenDataDirectory.Caption = "Open Qiqqa data directory."; ButtonOpenDataDirectory.Icon = Icons.GetAppIcon(Icons.GarbageCollect); ButtonOpenDataDirectory.Click += ButtonOpenDataDirectory_Click; ButtonOpenTempDirectory.Caption = "Open Qiqqa temp directory."; ButtonOpenTempDirectory.Icon = Icons.GetAppIcon(Icons.GarbageCollect); ButtonOpenTempDirectory.Click += ButtonOpenTempDirectory_Click; ButtonGarbageCollect.Caption = "Run garbage collection."; ButtonGarbageCollect.Icon = Icons.GetAppIcon(Icons.GarbageCollect); ButtonGarbageCollect.Click += ButtonGarbageCollect_Click; ButtonRebuildIndices.Caption = "Rebuild library search indices."; ButtonRebuildIndices.Icon = Icons.GetAppIcon(Icons.GarbageCollect); ButtonRebuildIndices.Click += ButtonRebuildIndices_Click; ButtonPurgeDeletedPDFs.Caption = "Purge deleted PDFs."; ButtonPurgeDeletedPDFs.Icon = Icons.GetAppIcon(Icons.GarbageCollect); ButtonPurgeDeletedPDFs.Click += ButtonPurgeDeletedPDFs_Click; ButtonClearAutoSuggests.Caption = "Clear out all the autosuggestions for title, author and year."; ButtonClearAutoSuggests.Icon = Icons.GetAppIcon(Icons.GarbageCollect); ButtonClearAutoSuggests.Click += ButtonClearAutoSuggests_Click; ButtonSeeDebugStatistics.Caption = "See debug statistics."; ButtonSeeDebugStatistics.Icon = Icons.GetAppIcon(Icons.GarbageCollect); ButtonSeeDebugStatistics.Click += ButtonSeeDebugStatistics_Click; ButtonZipLogs.Caption = "Bundle logs for Qiqqa support"; ButtonZipLogs.Icon = Icons.GetAppIcon(Icons.GarbageCollect); ButtonZipLogs.Click += ButtonZipLogs_Click; ButtonLibraryDBExplorer.Caption = "LibraryDB Explorer"; ButtonLibraryDBExplorer.Icon = Icons.GetAppIcon(Icons.GarbageCollect); ButtonLibraryDBExplorer.Click += ButtonLibraryDBExplorer_Click; ObjBlurrySnapToPixels.IsChecked = RegistrySettings.Instance.IsSet(RegistrySettings.SnapToPixels); ObjBlurrySnapToPixels.Checked += ObjBlurrySnapToPixels_Checked; ObjBlurrySnapToPixels.Unchecked += ObjBlurrySnapToPixels_Unchecked; TextQiqqaBaseFolder.Text = ConfigurationManager.Instance.BaseDirectoryForQiqqa; TextQiqqaBaseFolder.TextChanged += TextQiqqaBaseFolder_TextChanged; CmdClearColour.Click += CmdClearColour_Click; ObjColorPicker.SelectedColorChanged += ObjColorPicker_SelectedColorChanged; foreach (Color color in ThemeColours.THEMES) { AugmentedButton button = new AugmentedButton(); button.Tag = color; button.Caption = " "; button.Background = new SolidColorBrush(ColorTools.MakeDarkerColor(color, 1.2)); button.Click += ThemeColorButton_Click; ObjColoursPanel.Children.Add(button); } ObjCheckAskOnExit.IsEnabled = true; ObjRestoreWindowsAtStartup.IsEnabled = true; ObjRestoreLocationAtStartup.IsEnabled = true; ObjUserAgent_Clear.Click += ObjUserAgent_XXX_Click; ObjUserAgent_IE.Click += ObjUserAgent_XXX_Click; ObjUserAgent_Chrome.Click += ObjUserAgent_XXX_Click; ObjUserAgent_Safari.Click += ObjUserAgent_XXX_Click; ObjListEZProxy.ItemsSource = Proxies.Instance.GetProxies(); ObjListEZProxy.SelectionChanged += ObjListEZProxy_SelectionChanged; }
public ConfigurationControl() { Theme.Initialize(); InitializeComponent(); DataContext = ConfigurationManager.Instance.ConfigurationRecord_Bindable; Background = ThemeColours.Background_Brush_Blue_LightToDark; ButtonOpenDataDirectory.Caption = "Open Qiqqa data directory"; ButtonOpenDataDirectory.Icon = Icons.GetAppIcon(Icons.GarbageCollect); ButtonOpenDataDirectory.Click += ButtonOpenDataDirectory_Click; ButtonOpenTempDirectory.Caption = "Open Qiqqa temp directory"; ButtonOpenTempDirectory.Icon = Icons.GetAppIcon(Icons.GarbageCollect); ButtonOpenTempDirectory.Click += ButtonOpenTempDirectory_Click; ButtonGarbageCollect.Caption = "Run garbage collection"; ButtonGarbageCollect.Icon = Icons.GetAppIcon(Icons.GarbageCollect); ButtonGarbageCollect.Click += ButtonGarbageCollect_Click; ButtonRebuildIndices.Caption = "Rebuild library search indices"; ButtonRebuildIndices.Icon = Icons.GetAppIcon(Icons.GarbageCollect); ButtonRebuildIndices.Click += ButtonRebuildIndices_Click; ButtonPurgeDeletedPDFs.Caption = "Purge deleted PDFs"; ButtonPurgeDeletedPDFs.Icon = Icons.GetAppIcon(Icons.GarbageCollect); ButtonPurgeDeletedPDFs.Click += ButtonPurgeDeletedPDFs_Click; ButtonClearAutoSuggests.Caption = "Clear out all the autosuggestions for title, author and year"; ButtonClearAutoSuggests.Icon = Icons.GetAppIcon(Icons.GarbageCollect); ButtonClearAutoSuggests.Click += ButtonClearAutoSuggests_Click; ButtonSeeDebugStatistics.Caption = "See debug statistics"; ButtonSeeDebugStatistics.Icon = Icons.GetAppIcon(Icons.GarbageCollect); ButtonSeeDebugStatistics.Click += ButtonSeeDebugStatistics_Click; ButtonZipLogs.Caption = "Bundle logs for Qiqqa support"; ButtonZipLogs.Icon = Icons.GetAppIcon(Icons.GarbageCollect); ButtonZipLogs.Click += ButtonZipLogs_Click; ButtonLibraryDBExplorer.Caption = "LibraryDB Explorer"; ButtonLibraryDBExplorer.Icon = Icons.GetAppIcon(Icons.GarbageCollect); ButtonLibraryDBExplorer.Click += ButtonLibraryDBExplorer_Click; CmdResetDevCfgToFactoryDefaults.Click += CmdResetDevCfgToFactoryDefaults_Click; GUI_LoadKnownWebLibraries.IsChecked = ConfigurationManager.IsEnabled("LoadKnownWebLibraries"); GUI_LoadKnownWebLibraries.Unchecked += GUI_DevAdvCfg_Unchecked; GUI_LoadKnownWebLibraries.Checked += GUI_DevAdvCfg_Checked; GUI_AddLegacyWebLibrariesThatCanBeFoundOnDisk.IsChecked = ConfigurationManager.IsEnabled("AddLegacyWebLibrariesThatCanBeFoundOnDisk"); GUI_AddLegacyWebLibrariesThatCanBeFoundOnDisk.Checked += GUI_DevAdvCfg_Unchecked; GUI_AddLegacyWebLibrariesThatCanBeFoundOnDisk.Unchecked += GUI_DevAdvCfg_Checked; GUI_SaveKnownWebLibraries.IsChecked = ConfigurationManager.IsEnabled("SaveKnownWebLibraries"); GUI_SaveKnownWebLibraries.Checked += GUI_DevAdvCfg_Unchecked; GUI_SaveKnownWebLibraries.Unchecked += GUI_DevAdvCfg_Checked; GUI_DoInterestingAnalysis_GoogleScholar.IsChecked = ConfigurationManager.IsEnabled("DoInterestingAnalysis_GoogleScholar"); GUI_DoInterestingAnalysis_GoogleScholar.Checked += GUI_DevAdvCfg_Unchecked; GUI_DoInterestingAnalysis_GoogleScholar.Unchecked += GUI_DevAdvCfg_Checked; GUI_FolderWatcher.IsChecked = ConfigurationManager.IsEnabled("FolderWatcher"); GUI_FolderWatcher.Checked += GUI_DevAdvCfg_Unchecked; GUI_FolderWatcher.Unchecked += GUI_DevAdvCfg_Checked; GUI_TextExtraction.IsChecked = ConfigurationManager.IsEnabled("TextExtraction"); GUI_TextExtraction.Checked += GUI_DevAdvCfg_Unchecked; GUI_TextExtraction.Unchecked += GUI_DevAdvCfg_Checked; GUI_SuggestingMetadata.IsChecked = ConfigurationManager.IsEnabled("SuggestingMetadata"); GUI_SuggestingMetadata.Checked += GUI_DevAdvCfg_Unchecked; GUI_SuggestingMetadata.Unchecked += GUI_DevAdvCfg_Checked; GUI_BuildSearchIndex.IsChecked = ConfigurationManager.IsEnabled("BuildSearchIndex"); GUI_BuildSearchIndex.Checked += GUI_DevAdvCfg_Unchecked; GUI_BuildSearchIndex.Unchecked += GUI_DevAdvCfg_Checked; GUI_RenderPDFPagesForSidePanels.IsChecked = ConfigurationManager.IsEnabled("RenderPDFPagesForSidePanels"); GUI_RenderPDFPagesForSidePanels.Checked += GUI_DevAdvCfg_Unchecked; GUI_RenderPDFPagesForSidePanels.Unchecked += GUI_DevAdvCfg_Checked; GUI_RenderPDFPagesForReading.IsChecked = ConfigurationManager.IsEnabled("RenderPDFPagesForReading"); GUI_RenderPDFPagesForReading.Checked += GUI_DevAdvCfg_Unchecked; GUI_RenderPDFPagesForReading.Unchecked += GUI_DevAdvCfg_Checked; GUI_RenderPDFPagesForOCR.IsChecked = ConfigurationManager.IsEnabled("RenderPDFPagesForOCR"); GUI_RenderPDFPagesForOCR.Checked += GUI_DevAdvCfg_Unchecked; GUI_RenderPDFPagesForOCR.Unchecked += GUI_DevAdvCfg_Checked; ObjBlurrySnapToPixels.IsChecked = ConfigurationManager.Instance.ConfigurationRecord.SnapToPixels; ObjBlurrySnapToPixels.Checked += ObjBlurrySnapToPixels_Checked; ObjBlurrySnapToPixels.Unchecked += ObjBlurrySnapToPixels_Unchecked; TextQiqqaBaseFolder.Text = ConfigurationManager.Instance.BaseDirectoryForQiqqa; TextQiqqaBaseFolder.TextChanged += TextQiqqaBaseFolder_TextChanged; CmdClearColour.Click += CmdClearColour_Click; ObjColorPicker.SelectedColorChanged += ObjColorPicker_SelectedColorChanged; foreach (Color color in ThemeColours.THEMES) { AugmentedButton button = new AugmentedButton(); button.Tag = color; button.Caption = " "; button.Background = new SolidColorBrush(ColorTools.MakeDarkerColor(color, 1.2)); button.Click += ThemeColorButton_Click; ObjColoursPanel.Children.Add(button); } ObjCheckAskOnExit.IsEnabled = true; ObjRestoreWindowsAtStartup.IsEnabled = true; ObjRestoreLocationAtStartup.IsEnabled = true; ObjUserAgent_Clear.Click += ObjUserAgent_XXX_Click; ObjUserAgent_IE.Click += ObjUserAgent_XXX_Click; ObjUserAgent_Chrome.Click += ObjUserAgent_XXX_Click; ObjUserAgent_Safari.Click += ObjUserAgent_XXX_Click; ObjListEZProxy.ItemsSource = Proxies.Instance.GetProxies(); ObjListEZProxy.SelectionChanged += ObjListEZProxy_SelectionChanged; }