public AddRingyIconWindow() : base("File") { double initialWidth = this.Width; this.Width = 6 * 64; this.Title = "Configure Launcher"; this.WindowStartupLocation = WindowStartupLocation.CenterOwner; launcherTypeComboBox = new CustomComboBox(items: new[] { "File", "Path" }, width: (int)(this.Width - initialWidth), thickness: new Thickness(left: ((Thickness)targetTextBox.Margin).Left, top: ((Thickness)targetTextBox.Margin).Top, right: 0, bottom: 0)); launcherTypeComboBox.SelectedIndex = 0; targetTextBox.Width -= 5; titleTextBox.Width += this.Width - initialWidth; targetTextBox.Margin = new Thickness(left: ((Thickness)targetTextBox.Margin).Left + (this.Width - initialWidth) + 10, top: ((Thickness)targetTextBox.Margin).Top, right: 0, bottom: 0); browseButton.Margin = new Thickness(left: ((Thickness)browseButton.Margin).Left + this.Width - initialWidth, top: ((Thickness)browseButton.Margin).Top, right: 0, bottom: 0); saveButton.Margin = new Thickness(left: ((Thickness)saveButton.Margin).Left + this.Width - initialWidth, top: ((Thickness)saveButton.Margin).Top, right: 0, bottom: 0); closeButton.Margin = new Thickness(left: ((Thickness)closeButton.Margin).Left + this.Width - initialWidth, top: ((Thickness)closeButton.Margin).Top, right: 0, bottom: 0); canvas.Children.Add(launcherTypeComboBox); launcherTypeComboBox.SelectionChanged += new SelectionChangedEventHandler(launcherTypeComboBox_SelectionChanged); }
public DockyOptionsWindow() { this.Width = 6 * 64; this.Height = 5 * 64; this.ResizeMode = ResizeMode.NoResize; this.ShowInTaskbar = false; this.Title = "Docky Options"; this.Topmost = true; this.WindowStyle = WindowStyle.ToolWindow; this.WindowStartupLocation = WindowStartupLocation.CenterScreen; this.Visibility = Visibility.Visible; GlassEffect.SetIsEnabled(element: this, value: true); Canvas mainCanvas = new Canvas(); TabControl categoryTabControl = new TabControl(); categoryTabControl.Width = this.Width - (this.Width / (this.Width / 6)); categoryTabControl.Height = this.Height - (this.Height / 5); positionDockyOptionsTabItem = new DockyOptionsTabItem(title: "Position", iconLocation: "Icons/Toolbar Icon/step.png", tabControl: ref categoryTabControl); styleDockyOptionsTabItem = new DockyOptionsTabItem(title: "Style", iconLocation: "Icons/Toolbar Icon/style.png", tabControl: ref categoryTabControl); aboutDockyOptionsTabItem = new DockyOptionsTabItem(title: "About", iconLocation: "Icons/Toolbar Icon/info.png", tabControl: ref categoryTabControl); Canvas positionDockyOptionsCanvas = new Canvas(); positionDockyOptionsCanvas.Background = new LinearGradientBrush(startColor: Colors.White, endColor: Color.FromRgb(r: 235, g: 235, b: 235), angle: -45); CustomLabel screenPositionLabel = new CustomLabel(text: "Screen Positions:", thickness: new Thickness(uniformLength: 10)); CustomLabel layeringLabel = new CustomLabel(text: "Layering:", thickness: new Thickness(left: ((Thickness)screenPositionLabel.Margin).Left, top: ((Thickness)screenPositionLabel.Margin).Top + (1 * 30), right: 0, bottom: 0)); CustomLabel centeringLabel = new CustomLabel(text: "Centering:", thickness: new Thickness(left: ((Thickness)layeringLabel.Margin).Left, top: ((Thickness)layeringLabel.Margin).Top + (2 * 30), right: 0, bottom: 0)); CustomLabel edgeOffsetLabel = new CustomLabel(text: "Edge Offset:", thickness: new Thickness(left: ((Thickness)centeringLabel.Margin).Left, top: ((Thickness)centeringLabel.Margin).Top + (1 * 30), right: 0, bottom: 0)); screenPositionComboBox = new CustomComboBox(items: screenPositions, width: STANDARD_WIDTH * 2, thickness: new Thickness(left: ((Thickness)screenPositionLabel.Margin).Left + 120, top: ((Thickness)screenPositionLabel.Margin).Top + 3, right: 0, bottom: 0)); layeringComboBox = new CustomComboBox(items: layering, width: (int)screenPositionComboBox.Width, thickness: new Thickness(left: ((Thickness)screenPositionComboBox.Margin).Left, top: ((Thickness)layeringLabel.Margin).Top + 3, right: 0, bottom: 0)); centeringSlider = new CustomSlider(width: STANDARD_WIDTH * 3, startValue: -100, endValue: 100, thickness: new Thickness(left: ((Thickness)layeringComboBox.Margin).Left - 5, top: ((Thickness)centeringLabel.Margin).Top, right: 0, bottom: 0)); edgeOffsetSlider = new CustomSlider(width: (int)centeringSlider.Width, startValue: -15, endValue: 128, thickness: new Thickness(left: ((Thickness)layeringComboBox.Margin).Left - 5, top: ((Thickness)edgeOffsetLabel.Margin).Top, right: 0, bottom: 0)); Canvas styleDockyOptionsCanvas = new Canvas(); styleDockyOptionsCanvas.Background = new LinearGradientBrush(startColor: Colors.White, endColor: Color.FromRgb(r: 235, g: 235, b: 235), angle: -45); CustomLabel themeLabel = new CustomLabel(text: "Theme:", thickness: new Thickness(uniformLength: 10)); CustomLabel hoaverEffectLabel = new CustomLabel(text: "Hoaver Effect:", thickness: new Thickness(left: ((Thickness)themeLabel.Margin).Left, top: ((Thickness)themeLabel.Margin).Top + (1 * 30), right: 0, bottom: 0)); CustomLabel clickEffectLabel = new CustomLabel(text: "Click Effect:", thickness: new Thickness(left: ((Thickness)hoaverEffectLabel.Margin).Left, top: ((Thickness)hoaverEffectLabel.Margin).Top + 30, right: 0, bottom: 0)); themeComboBox = new CustomComboBox(items: getThemeName(themeDirectories: Directory.GetDirectories(Directory.GetCurrentDirectory() + @"\Skins")), width: STANDARD_WIDTH * 2, thickness: new Thickness(left: ((Thickness)themeLabel.Margin).Left + 120, top: ((Thickness)themeLabel.Margin).Top + 3, right: 0, bottom: 0)); hoaverEffectComboBox = new CustomComboBox(items: animationEffects, width: STANDARD_WIDTH * 2, thickness: new Thickness(left: ((Thickness)themeComboBox.Margin).Left, top: ((Thickness)hoaverEffectLabel.Margin).Top + 3, right: 0, bottom: 0)); clickEffectComboBox = new CustomComboBox(items: animationEffects, width: STANDARD_WIDTH * 2, thickness: new Thickness(left: ((Thickness)hoaverEffectComboBox.Margin).Left, top: ((Thickness)clickEffectLabel.Margin).Top + 3, right: 0, bottom: 0)); showIconLabelCheckBox = new CheckBox(); showIconLabelCheckBox.Content = "Show Icon Label"; showIconLabelCheckBox.Margin = new Thickness(left: ((Thickness)clickEffectLabel.Margin).Left, top: ((Thickness)clickEffectLabel.Margin).Top + (3 * 30), right: 0, bottom: 0); helpButton = new CustomButton(buttonContent: "Help", width: STANDARD_WIDTH, height: STANDARD_BUTTON_HEIGHT, thickness: new Thickness(left: 0, top: this.Height - (2 * STANDARD_BUTTON_HEIGHT), right: 0, bottom: 0)); defaultButton = new CustomButton(buttonContent: "Default", width: STANDARD_WIDTH, height: STANDARD_BUTTON_HEIGHT, thickness: new Thickness(left: this.Width - (2 * STANDARD_WIDTH) - (2 * STANDARD_BUTTON_SEPARATOR), top: ((Thickness)helpButton.Margin).Top, right: 0, bottom: 0)); closeButton = new CustomButton(buttonContent: "Close", width: STANDARD_WIDTH, height: STANDARD_BUTTON_HEIGHT, thickness: new Thickness(left: this.Width - (1 * STANDARD_WIDTH) - (1 * STANDARD_BUTTON_SEPARATOR), top: ((Thickness)defaultButton.Margin).Top, right: 0, bottom: 0)); // Adding contents this.Content = mainCanvas; mainCanvas.Children.Add(categoryTabControl); mainCanvas.Children.Add(helpButton); mainCanvas.Children.Add(defaultButton); mainCanvas.Children.Add(closeButton); positionDockyOptionsTabItem.Content = positionDockyOptionsCanvas; positionDockyOptionsCanvas.Children.Add(screenPositionLabel); positionDockyOptionsCanvas.Children.Add(screenPositionComboBox); positionDockyOptionsCanvas.Children.Add(layeringLabel); positionDockyOptionsCanvas.Children.Add(layeringComboBox); positionDockyOptionsCanvas.Children.Add(centeringLabel); positionDockyOptionsCanvas.Children.Add(centeringSlider); positionDockyOptionsCanvas.Children.Add(edgeOffsetLabel); positionDockyOptionsCanvas.Children.Add(edgeOffsetSlider); styleDockyOptionsTabItem.Content = styleDockyOptionsCanvas; styleDockyOptionsCanvas.Children.Add(themeLabel); styleDockyOptionsCanvas.Children.Add(themeComboBox); styleDockyOptionsCanvas.Children.Add(hoaverEffectLabel); styleDockyOptionsCanvas.Children.Add(hoaverEffectComboBox); styleDockyOptionsCanvas.Children.Add(clickEffectLabel); styleDockyOptionsCanvas.Children.Add(clickEffectComboBox); styleDockyOptionsCanvas.Children.Add(showIconLabelCheckBox); aboutDockyOptionsTabItem.Content = new AboutStackPanel(); // Adding Event Handler this.MouseLeftButtonDown += new MouseButtonEventHandler(DockyOptionsWindow_MouseLeftButtonDown); helpButton.Click += new RoutedEventHandler(helpButton_Click); closeButton.Click += new RoutedEventHandler(closeButton_Click); }
public RingyOptionsWindow(ref List <IconSettings> ringyIconSettings, string logoImageLocation) { this.Width = 4 * 64; this.Height = 8 * 64; this.ShowInTaskbar = false; this.Title = "Ringy Options"; this.Topmost = true; this.ResizeMode = ResizeMode.NoResize; this.WindowStyle = WindowStyle.ToolWindow; this.Visibility = Visibility.Visible; this.Left = STANDARD_SEPARATOR_DISTANCE * 10; this.Top = this.Left; GlassEffect.SetIsEnabled(element: this, value: true); Canvas baseCanvas = new Canvas(); Canvas ringyOptionsCanvas = new Canvas(); ringyOptionsCanvas.Background = new LinearGradientBrush(startColor: Colors.White, endColor: Color.FromRgb(r: 221, g: 231, b: 244), angle: -30); ringyOptionsCanvas.Width = this.Width; ringyOptionsCanvas.Height = this.Height - ((this.Height) / 9); ringyOptionsCanvas.Margin = new Thickness(uniformLength: 0); generalGroupBox = new CustomGroupBox(title: "General", width: (int)ringyOptionsCanvas.Width - (STANDARD_SEPARATOR_DISTANCE * 3), height: (int)ringyOptionsCanvas.Height / 4 - (STANDARD_SEPARATOR_DISTANCE * 0), thickness: new Thickness(uniformLength: STANDARD_SEPARATOR_DISTANCE), baseCanvas: ref ringyOptionsCanvas); iconSettingsGroupBox = new CustomGroupBox(title: "Icon Settings", width: (int)generalGroupBox.Width, height: (int)(ringyOptionsCanvas.Height - generalGroupBox.Height - (STANDARD_SEPARATOR_DISTANCE * 14)), thickness: new Thickness(left: ((Thickness)generalGroupBox.Margin).Left, top: ((Thickness)generalGroupBox.Margin).Top + generalGroupBox.Height + (STANDARD_SEPARATOR_DISTANCE * 1), right: 0, bottom: 0), baseCanvas: ref ringyOptionsCanvas); logoImageGroupBox = new CustomGroupBox(title: "Logo Image", width: (int)iconSettingsGroupBox.Width, height: (int)(this.Height - generalGroupBox.Height - iconSettingsGroupBox.Height - (STANDARD_SEPARATOR_DISTANCE * 6)) / 2, thickness: new Thickness(left: ((Thickness)iconSettingsGroupBox.Margin).Left, top: ((Thickness)iconSettingsGroupBox.Margin).Top + iconSettingsGroupBox.Height + (STANDARD_SEPARATOR_DISTANCE * 1), right: 0, bottom: 0), baseCanvas: ref ringyOptionsCanvas); generalCanvas = new Canvas(); CustomLabel themeLabel = new CustomLabel(text: "Theme:", thickness: new Thickness(uniformLength: STANDARD_SEPARATOR_DISTANCE * 1)); CustomLabel animationEffectLabel = new CustomLabel(text: "Animation Effect:", thickness: new Thickness(left: ((Thickness)themeLabel.Margin).Left, top: ((Thickness)themeLabel.Margin).Top + (STANDARD_SEPARATOR_DISTANCE * 6), right: 0, bottom: 0)); themeComboBox = new CustomComboBox(items: getThemeName(themeLocation: Directory.GetFiles(path: "Background")), width: (int)(STANDARD_WIDTH * 1.5), thickness: new Thickness(left: STANDARD_WIDTH * 1.7, top: ((Thickness)themeLabel.Margin).Top, right: 0, bottom: 0)); animationEffectComboBox = new CustomComboBox(items: new [] { "Zoom", "Fade", "Rotate" }, width: (int)themeComboBox.Width, thickness: new Thickness(left: ((Thickness)themeComboBox.Margin).Left, top: ((Thickness)animationEffectLabel.Margin).Top, right: 0, bottom: 0)); showIconLabelCheckBox = new CheckBox(); showIconLabelCheckBox.Content = "Show Icon Label"; showIconLabelCheckBox.Margin = new Thickness(left: ((Thickness)animationEffectLabel.Margin).Left + STANDARD_SEPARATOR_DISTANCE, top: ((Thickness)animationEffectLabel.Margin).Top + (STANDARD_SEPARATOR_DISTANCE * 7), right: 0, bottom: 0); helpButton = new CustomButton(buttonContent: "Help", width: STANDARD_WIDTH, height: STANDARD_BUTTON_HEIGHT, thickness: new Thickness(left: 0, top: ringyOptionsCanvas.Height + (STANDARD_SEPARATOR_DISTANCE * 1), right: 0, bottom: 0)); closeButton = new CustomButton(buttonContent: "Close", width: (int)helpButton.Width, height: (int)helpButton.Height, thickness: new Thickness(left: this.Width - helpButton.Width - (STANDARD_SEPARATOR_DISTANCE * 1) - 1, top: ((Thickness)helpButton.Margin).Top, right: 0, bottom: 0)); defaultButton = new CustomButton(buttonContent: "Default", width: (int)closeButton.Width, height: (int)closeButton.Height, thickness: new Thickness(left: ((Thickness)closeButton.Margin).Left - closeButton.Width - STANDARD_SEPARATOR_DISTANCE, top: ((Thickness)closeButton.Margin).Top, right: 0, bottom: 0)); iconSettingsCanvas = new Canvas(); logoImageCanvas = new Canvas(); // Adding Contents this.Content = baseCanvas; baseCanvas.Children.Add(ringyOptionsCanvas); generalGroupBox.Content = generalCanvas; generalCanvas.Children.Add(themeLabel); generalCanvas.Children.Add(themeComboBox); generalCanvas.Children.Add(animationEffectLabel); generalCanvas.Children.Add(animationEffectComboBox); generalCanvas.Children.Add(showIconLabelCheckBox); iconSettingsGroupBox.Content = iconSettingsCanvas; logoImageGroupBox.Content = logoImageCanvas; baseCanvas.Children.Add(helpButton); baseCanvas.Children.Add(closeButton); baseCanvas.Children.Add(defaultButton); // Addings Event Handler helpButton.Click += new RoutedEventHandler(helpButton_Click); closeButton.Click += new RoutedEventHandler(closeButton_Click); setLogoImageComponents(logoImageLocation); }