From 6b978e9ab5d06dfcc1a133ca980358ba12c45b2e Mon Sep 17 00:00:00 2001 From: EternalModz <86510009+EternalModz@users.noreply.github.com> Date: Sat, 15 Apr 2023 20:32:45 -0700 Subject: [PATCH] V2 is here! The newest theme is here! It fixes several bugs and it removes a ton of junk while adding in tons of new options and features to mess around with. --- ...e-Library.sln => CBH-NET-Theme-Library.sln | 8 +- .../MainForm.cs | 20 - .../Program.cs | 22 - .../Properties/Resources.Designer.cs | 71 - .../Theme/Controls/Banner/CrEaTiiOn_Banner.cs | 152 - .../Theme/Controls/Button/CrEaTiiOn_Button.cs | 160 - .../Button/CrEaTiiOn_DescriptiveButton.cs | 172 - .../Controls/Button/CrEaTiiOn_FlatButton.cs | 363 -- .../Controls/Button/CrEaTiiOn_LightButton.cs | 196 - .../Controls/Button/CrEaTiiOn_ModernButton.cs | 334 -- .../Controls/Button/CrEaTiiOn_PillButton.cs | 315 -- .../Controls/CheckBox/CrEaTiiOn_CheckBox.cs | 91 - .../CheckBox/CrEaTiiOn_FlatCheckBox.cs | 176 - .../CheckBox/CrEaTiiOn_LightCheckBox.cs | 186 - .../CheckBox/CrEaTiiOn_MetroCheckBox5.cs | 219 -- .../CheckBox/CrEaTiiOn_RoundCheckBox.cs | 75 - .../Controller/CrEaTiiOn_DragControl.cs | 38 - .../Controller/CrEaTiiOn_VolumeController.cs | 71 - .../DatePicker/CrEaTiiOn_DatePicker.cs | 314 -- .../DropDown/CrEaTiiOn_ClasicDropdownMenu.cs | 90 - .../DropDown/CrEaTiiOn_DropdownMenu.cs | 103 - .../Controls/Ellipse/CrEaTiiOn_Ellipse.cs | 47 - .../Ellipse/CrEaTiiOn_ObjectEllipse.cs | 241 -- .../GroupBox/CrEaTiiOn_FlatGroupBox.cs | 52 - .../Controls/Handle/CrEaTiiOn_FormHandle.cs | 72 - .../Theme/Controls/Icon/CrEaTiiOn_InfoIcon.cs | 68 - .../Theme/Controls/Icon/CrEaTiiOn_TickIcon.cs | 68 - .../Label/CrEaTiiOn_ClasicHeaderLabel.cs | 24 - .../Controls/Label/CrEaTiiOn_ClasicLabel.cs | 30 - .../Controls/Label/CrEaTiiOn_FancyLabel.cs | 45 - .../Controls/Label/CrEaTiiOn_FlatLabel.cs | 23 - .../Controls/Label/CrEaTiiOn_MetroLabel.cs | 25 - .../Label/CrEaTiiOn_ModernHeaderLabel.cs | 110 - .../Controls/Label/CrEaTiiOn_ModernLabel.cs | 33 - .../Controls/Menu/CrEaTiiOn_MenuColorTable.cs | 52 - .../Controls/Menu/CrEaTiiOn_MenuRenderer.cs | 72 - .../Controls/Menu/Support/MenuColorTable.cs | 50 - .../Controls/Menu/Support/MenuRenderer.cs | 58 - .../Controls/Message/CrEaTiiOn_Message.cs | 136 - .../Controls/Numeric/CrEaTiiOn_Numeric.cs | 342 -- .../Palette/CrEaTiiOn_ColorPalette.cs | 393 -- .../Controls/Panel/CrEaTiiOn_FlatPanel.cs | 126 - .../Controls/Panel/CrEaTiiOn_ModernPanel.cs | 98 - .../Theme/Controls/Panel/CrEaTiiOn_Panel.cs | 82 - .../Controls/Panel/CrEaTiiOn_WidgetPanel.cs | 63 - .../Picker/CrEaTiiOn_ColorPicker.Designer.cs | 133 - .../Controls/Picker/CrEaTiiOn_ColorPicker.cs | 247 -- .../Picker/CrEaTiiOn_ColorPicker.resx | 60 - .../Progress/CrEaTiiOn_FlatProgressBar.cs | 350 -- .../CrEaTiiOn_FlatRoundProgressBar.cs | 94 - .../Progress/CrEaTiiOn_ModernProgressBar.cs | 279 -- .../RadioButton/CrEaTiiOn_MetroRadioButton.cs | 220 -- .../CrEaTiiOn_RichTextBoxEdit.cs | 252 -- .../Controls/Sleeper/CrEaTiiOn_Sleeper.cs | 27 - .../StatusBar/CrEaTiiOn_FlatStatusBar.cs | 253 -- .../Controls/Stick/CrEaTiiOn_JoyStick.cs | 482 --- .../Strip/CrEaTiiOn_ContextMenuStrip.cs | 96 - .../Strip/CrEaTiiOn_FlatContextMenuStrip.cs | 70 - .../Controls/Strip/Support/StripRenderer.cs | 108 - .../TabControl/CrEaTiiOn_FlatTabControl.cs | 111 - .../TabControl/CrEaTiiOn_MetroTabControl.cs | 90 - .../TabControl/CrEaTiiOn_ModernTabControl.cs | 102 - .../Controls/TabPage/CrEaTiiOn_TabPage.cs | 162 - .../CrEaTiiOn_ModernTextBox.Designer.cs | 72 - .../TextBoxEdit/CrEaTiiOn_TextPosition.cs | 11 - .../Toggle/CrEaTiiOn_ModernToggleButton.cs | 165 - .../Controls/Toggle/CrEaTiiOn_ToggleButton.cs | 121 - .../CrEaTiiOn_ExtendedFileSystemWatcher.cs | 268 -- .../Helpers/Main/Helper/ThemeContainer.cs | 148 - .../CrEaTiiOn_Ultimate_FancyComboBox.cs | 203 -- ...rEaTiiOn_Ultimate_GradientNumericUpDown.cs | 146 - .../CrEaTiiOn_Ultimate_GroupBox.cs | 65 - .../CrEaTiiOn_Ultimate_NumericUpDown.cs | 143 - .../CrEaTiiOn_Ultimate_PictureBox.cs | 73 - .../CBH-Ultimate-Theme-Library.csproj | 31 - CBH-Ultimate-Theme-Library/MainForm.cs | 20 - CBH-Ultimate-Theme-Library/MainForm.resx | 60 - CBH-Ultimate-Theme-Library/Program.cs | 17 - .../Properties/Resources.resx | 120 - .../Theme/Controls/Badge/CrEaTiiOn_Badge.cs | 125 - .../Theme/Controls/Banner/CrEaTiiOn_Banner.cs | 149 - .../Bubble/CrEaTiiOn_ChatBubbleLeft.cs | 168 - .../Bubble/CrEaTiiOn_ChatBubbleRight.cs | 190 - .../Theme/Controls/Button/CrEaTiiOn_Button.cs | 157 - .../Button/CrEaTiiOn_DescriptiveButton.cs | 172 - .../Controls/Button/CrEaTiiOn_FlatButton.cs | 360 -- .../Controls/Button/CrEaTiiOn_LightButton.cs | 196 - .../Controls/Button/CrEaTiiOn_ModernButton.cs | 331 -- .../Controls/Button/CrEaTiiOn_PillButton.cs | 312 -- .../Controls/Card/CrEaTiiOn_GradientCard.cs | 166 - .../Controls/CheckBox/CrEaTiiOn_CheckBox.cs | 89 - .../CheckBox/CrEaTiiOn_CustomCheckBox.cs | 265 -- .../CheckBox/CrEaTiiOn_FlatCheckBox.cs | 173 - .../CheckBox/CrEaTiiOn_LightCheckBox.cs | 186 - .../CheckBox/CrEaTiiOn_MetroCheckBox5.cs | 216 -- .../CheckBox/CrEaTiiOn_ModernCheckBox.cs | 150 - .../CheckBox/CrEaTiiOn_RoundCheckBox.cs | 75 - .../Controls/Combobox/CrEaTiiOn_ComboBox.cs | 380 -- .../Controls/Combobox/CrEaTiiOn_ComboBox.resx | 60 - .../ControlBox/CrEaTiiOn_ControlBox.cs | 334 -- .../ControlBox/CrEaTiiOn_FlatControlBox.cs | 189 - .../ControlBox/CrEaTiiOn_ModernControlBox.cs | 448 --- .../Controller/CrEaTiiOn_DragControl.cs | 36 - .../Controller/CrEaTiiOn_VolumeController.cs | 71 - .../DatePicker/CrEaTiiOn_DatePicker.cs | 310 -- .../DropDown/CrEaTiiOn_ClasicDropdownMenu.cs | 87 - .../DropDown/CrEaTiiOn_DropdownMenu.cs | 100 - .../Controls/Ellipse/CrEaTiiOn_Ellipse.cs | 44 - .../Ellipse/CrEaTiiOn_ObjectEllipse.cs | 238 -- .../Theme/Controls/Gauge/CrEaTiiOn_Gauge.cs | 237 -- .../GroupBox/CrEaTiiOn_FlatGroupBox.cs | 50 - .../GroupBox/CrEaTiiOn_ModernGroupBox.cs | 91 - .../Controls/Handle/CrEaTiiOn_FormHandle.cs | 70 - .../Theme/Controls/Icon/CrEaTiiOn_InfoIcon.cs | 66 - .../Theme/Controls/Icon/CrEaTiiOn_TickIcon.cs | 66 - .../Controls/Label/CrEaTiiOn_AirLabel.cs | 20 - .../Controls/Label/CrEaTiiOn_BigLabel.cs | 21 - .../Label/CrEaTiiOn_ClasicHeaderLabel.cs | 22 - .../Controls/Label/CrEaTiiOn_ClasicLabel.cs | 27 - .../Controls/Label/CrEaTiiOn_FancyLabel.cs | 43 - .../Controls/Label/CrEaTiiOn_FlatLabel.cs | 22 - .../Controls/Label/CrEaTiiOn_HeaderLabel.cs | 21 - .../Theme/Controls/Label/CrEaTiiOn_Label.cs | 113 - .../Controls/Label/CrEaTiiOn_MetroLabel.cs | 20 - .../Label/CrEaTiiOn_ModernHeaderLabel.cs | 108 - .../Controls/Label/CrEaTiiOn_ModernLabel.cs | 29 - .../Controls/Label/CrEaTiiOn_SmallLabel.cs | 21 - .../Controls/LabelEdit/CrEaTiiOn_LabelEdit.cs | 21 - .../Controls/LinkLabel/CrEaTiiOn_LinkLabel.cs | 24 - .../LinkLabelEdit/CrEaTiiOn_LinkLabelEdit.cs | 24 - .../Controls/ListBox/CrEaTiiOn_ListBox.cs | 77 - .../Controls/Menu/CrEaTiiOn_MenuColorTable.cs | 52 - .../Controls/Menu/CrEaTiiOn_MenuRenderer.cs | 72 - .../Controls/Menu/Support/MenuColorTable.cs | 50 - .../Controls/Menu/Support/MenuRenderer.cs | 58 - .../Notify/CrEaTiiOn_NotificationBox.cs | 473 --- .../Controls/Numeric/CrEaTiiOn_Numeric.cs | 338 -- .../Palette/CrEaTiiOn_ColorPalette.cs | 390 -- .../Controls/Panel/CrEaTiiOn_FlatPanel.cs | 123 - .../Controls/Panel/CrEaTiiOn_ModernPanel.cs | 95 - .../Theme/Controls/Panel/CrEaTiiOn_Panel.cs | 79 - .../Controls/Panel/CrEaTiiOn_WidgetPanel.cs | 61 - .../Picker/CrEaTiiOn_ColorPicker.Designer.cs | 133 - .../Controls/Picker/CrEaTiiOn_ColorPicker.cs | 247 -- .../Picker/CrEaTiiOn_ColorPicker.resx | 60 - .../CrEaTiiOn_CircularPictureBox.cs | 127 - .../PictureBox/CrEaTiiOn_ModernPictureBox.cs | 129 - .../PictureBox/CrEaTiiOn_PictureBox.cs | 282 -- .../Progress/CrEaTiiOn_CircleProgressBar.cs | 197 - .../Progress/CrEaTiiOn_FancyProgressBar.cs | 110 - .../Progress/CrEaTiiOn_FlatProgressBar.cs | 350 -- .../CrEaTiiOn_FlatRoundProgressBar.cs | 94 - .../Progress/CrEaTiiOn_ProcessingControl.cs | 154 - .../Progress/CrEaTiiOn_ProgressBar.cs | 120 - .../Progress/CrEaTiiOn_SpinningCircles.cs | 113 - .../RadioButton/CrEaTiiOn_AirRadioButton.cs | 216 -- .../CrEaTiiOn_ClasicRadioButton.cs | 192 - .../RadioButton/CrEaTiiOn_MetroRadioButton.cs | 220 -- .../CrEaTiiOn_ModernRadioButton.cs | 112 - .../RadioButton/CrEaTiiOn_RadioButton.cs | 165 - .../RichTextBox/CrEaTiiOn_RichTextBox.cs | 207 -- .../Controls/Segment/CrEaTiiOn_Segment.cs | 448 --- .../Separator/CrEaTiiOn_LightSeperator.cs | 58 - .../Separator/CrEaTiiOn_ModernSeperator.cs | 99 - .../Controls/Separator/CrEaTiiOn_Separator.cs | 43 - .../Controls/Sleeper/CrEaTiiOn_Sleeper.cs | 27 - .../Slider/CrEaTiiOn_FlatSliderBar.cs | 164 - .../Controls/Slider/CrEaTiiOn_ModernSlider.cs | 445 --- .../StatusBar/CrEaTiiOn_FlatStatusBar.cs | 253 -- .../Controls/Stick/CrEaTiiOn_JoyStick.cs | 482 --- .../Strip/CrEaTiiOn_ContextMenuStrip.cs | 96 - .../Strip/CrEaTiiOn_FlatContextMenuStrip.cs | 70 - .../Controls/Strip/Support/StripRenderer.cs | 108 - .../TabControl/CrEaTiiOn_BarTabControl.cs | 288 -- .../TabControl/CrEaTiiOn_MetroTabControl.cs | 90 - .../TabControl/CrEaTiiOn_ModernTabControl.cs | 102 - .../TabPage/CrEaTiiOn_ModernTabPage.cs | 302 -- .../Controls/TabPage/CrEaTiiOn_TabPage.cs | 162 - .../Controls/TextBox/CrEaTiiOn_AirTextBox.cs | 60 - .../TextBox/CrEaTiiOn_ModernTextBox.cs | 218 -- .../TextBox/CrEaTiiOn_ModernTextBox.resx | 60 - .../TextBoxEdit/CrEaTiiOn_TextPosition.cs | 11 - .../Toggle/CrEaTiiOn_ModernToggleButton.cs | 165 - .../Controls/Toggle/CrEaTiiOn_ToggleButton.cs | 121 - .../Controls/TrackBar/CrEaTiiOn_TrackBar.cs | 254 -- .../CrEaTiiOn_ExtendedFileSystemWatcher.cs | 268 -- .../Theme/Helpers/Helpers.cs | 878 ----- .../Theme/Helpers/Main/Helper/Theme.cs | 2465 ------------- .../Helpers/Main/Helper/ThemeContainer.cs | 148 - .../CrEaTiiOn_Shadow_Controls.cs | 3166 ----------------- .../CrEaTiiOn_Ultimate_FancyButton.cs | 109 - .../CrEaTiiOn_Ultimate_FancyTextBox.resx | 60 - .../CrEaTiiOn_Ultimate_GradientButton.cs | 113 - .../CrEaTiiOn_Ultimate_GradientLabel.cs | 42 - ...rEaTiiOn_Ultimate_GradientNumericUpDown.cs | 146 - .../CrEaTiiOn_Ultimate_GradientPanel.cs | 251 -- ...TiiOn_Ultimate_GradientTextBox.Designer.cs | 72 - .../CrEaTiiOn_Ultimate_GradientTextBox.cs | 227 -- .../CrEaTiiOn_Ultimate_GradientTextBox.resx | 60 - ...CrEaTiiOn_Ultimate_GradientToggleButton.cs | 83 - .../CrEaTiiOn_Ultimate_NumericUpDown.cs | 143 - .../CrEaTiiOn_Ultimate_RadioButton.cs | 74 - .../CrEaTiiOn_Ultimate_ToggleButton.cs | 76 - .../App.config | 6 +- .../CBH-WinForm-Theme-NET-.csproj | 205 +- .../MainForm.resx | 0 .../Properties/AssemblyInfo.cs | 16 +- .../Properties/Resources.Designer.cs | 4 +- .../Properties/Resources.resx | 0 .../Properties/Settings.Designer.cs | 22 +- .../Properties/Settings.settings | 0 .../Theme/Controls/Badge/CrEaTiiOn_Badge.cs | 23 +- .../Theme/Controls/Banner/CrEaTiiOn_Banner.cs | 89 + .../Bubble/CrEaTiiOn_ChatBubbleLeft.cs | 2 +- .../Bubble/CrEaTiiOn_ChatBubbleRight.cs | 2 +- .../Controls/Card/CrEaTiiOn_GradientCard.cs | 0 .../CheckBox/CrEaTiiOn_CustomCheckBox.cs | 0 .../CheckBox/CrEaTiiOn_ModernCheckBox.cs | 0 .../Classes/ColorChangedEventArgs.cs | 39 + .../Color Controls/Classes/ColorModes.cs | 13 + .../Color Controls/Classes/HslColor.cs | 352 ++ .../Color Controls/Classes/MathExtensions.cs | 23 + .../CrEaTiiOn_ColorBox2D.Designer.cs | 27 +- .../Color Controls/CrEaTiiOn_ColorBox2D.cs | 308 ++ .../CrEaTiiOn_ColorHexagon.Designer.cs | 36 + .../Color Controls/CrEaTiiOn_ColorHexagon.cs | 400 +++ .../CrEaTiiOn_ColorSliderVertical.Designer.cs | 25 +- .../CrEaTiiOn_ColorSliderVertical.cs | 319 ++ .../CrEaTiiOn_ColorSliderVertical.resx | 0 .../Color Controls/CrEaTiiOn_ColorWheel.cs | 883 +++++ .../Controls/Combobox/CrEaTiiOn_ComboBox.cs | 20 +- .../Controls/Combobox/CrEaTiiOn_ComboBox.resx | 0 .../ControlBox/CrEaTiiOn_ControlBox.cs | 0 .../ControlBox/CrEaTiiOn_FlatControlBox.cs | 0 .../ControlBox/CrEaTiiOn_ModernControlBox.cs | 0 .../Theme/Controls/Gauge/CrEaTiiOn_Gauge.cs | 0 .../GroupBox/CrEaTiiOn_GradientGroupBox.cs | 87 + .../GroupBox/CrEaTiiOn_ModernGroupBox.cs | 85 +- .../Controls/Label/CrEaTiiOn_AirLabel.cs | 0 .../Controls/Label/CrEaTiiOn_BigLabel.cs | 0 .../Controls/Label/CrEaTiiOn_HeaderLabel.cs | 0 .../Theme/Controls/Label/CrEaTiiOn_Label.cs | 0 .../Controls/Label/CrEaTiiOn_SmallLabel.cs | 0 .../Controls/LabelEdit/CrEaTiiOn_LabelEdit.cs | 0 .../Controls/LinkLabel/CrEaTiiOn_LinkLabel.cs | 0 .../LinkLabelEdit/CrEaTiiOn_LinkLabelEdit.cs | 3 +- .../Controls/ListBox/CrEaTiiOn_ListBox.cs | 0 .../Controls/Message/CrEaTiiOn_Message.cs | 4 +- .../Notify/CrEaTiiOn_NotificationBox.cs | 0 .../Theme/Controls/Panel/CrEaTiiOn_Panel.cs | 95 + .../CrEaTiiOn_CircularPictureBox.cs | 0 .../PictureBox/CrEaTiiOn_ModernPictureBox.cs | 1 - .../PictureBox/CrEaTiiOn_PictureBox.cs | 0 .../Progress/CrEaTiiOn_CircleProgressBar.cs | 0 .../Progress/CrEaTiiOn_FancyProgressBar.cs | 0 .../Progress/CrEaTiiOn_ModernProgressBar.cs | 35 +- .../Progress/CrEaTiiOn_ProcessingControl.cs | 0 .../Progress/CrEaTiiOn_ProgressBar.cs | 0 .../Progress/CrEaTiiOn_SpinningCircles.cs | 2 +- .../RadioButton/CrEaTiiOn_AirRadioButton.cs | 0 .../CrEaTiiOn_ClasicRadioButton.cs | 0 .../CrEaTiiOn_ModernRadioButton.cs | 9 +- .../RadioButton/CrEaTiiOn_RadioButton.cs | 0 .../RichTextBox/CrEaTiiOn_RichTextBox.cs | 0 .../CrEaTiiOn_RichTextBoxEdit.cs | 4 +- .../Controls/Segment/CrEaTiiOn_Segment.cs | 0 .../Separator/CrEaTiiOn_LightSeperator.cs | 0 .../Separator/CrEaTiiOn_ModernSeperator.cs | 0 .../Controls/Separator/CrEaTiiOn_Separator.cs | 0 .../Slider/CrEaTiiOn_FlatSliderBar.cs | 2 +- .../Controls/Slider/CrEaTiiOn_ModernSlider.cs | 0 .../TabControl/CrEaTiiOn_BarTabControl.cs | 1 - .../TabControl/CrEaTiiOn_FlatTabControl.cs | 82 +- .../TabControl/CrEaTiiOn_MetroTabControl.cs | 88 + .../TabPage/CrEaTiiOn_ModernTabPage.cs | 0 .../Controls/TabPage/CrEaTiiOn_TabPage.cs | 107 + .../Controls/TextBox/CrEaTiiOn_AirTextBox.cs | 0 .../CrEaTiiOn_ModernTextBox.Designer.cs | 2 +- .../TextBox/CrEaTiiOn_ModernTextBox.cs | 10 +- .../TextBox/CrEaTiiOn_ModernTextBox.resx | 0 .../Controls/TrackBar/CrEaTiiOn_TrackBar.cs | 0 .../Theme/ThemeBase}/Helpers/Helpers.cs | 349 +- .../Theme/ThemeBase/Helpers}/Theme.cs | 16 +- .../Theme/ThemeBase/Helpers/ThemeContainer.cs | 165 + .../CrEaTiiOn_Shadow_Controls.cs | 84 +- .../CrEaTiiOn_Ultimate_FancyButton.cs | 8 +- .../CrEaTiiOn_Ultimate_FancyComboBox.cs | 4 +- .../CrEaTiiOn_Ultimate_FancyComboBox.resx | 0 .../CrEaTiiOn_Ultimate_FancyTextBox.resx | 0 .../CrEaTiiOn_Ultimate_GradientButton.cs | 0 .../CrEaTiiOn_Ultimate_GradientLabel.cs | 9 +- ...rEaTiiOn_Ultimate_GradientNumericUpDown.cs | 146 + .../CrEaTiiOn_Ultimate_GradientPanel.cs | 0 ...TiiOn_Ultimate_GradientTextBox.Designer.cs | 0 .../CrEaTiiOn_Ultimate_GradientTextBox.cs | 0 .../CrEaTiiOn_Ultimate_GradientTextBox.resx | 0 ...CrEaTiiOn_Ultimate_GradientToggleButton.cs | 4 +- .../CrEaTiiOn_Ultimate_GroupBox.cs | 6 +- .../CrEaTiiOn_Ultimate_NumericUpDown.cs | 143 + .../CrEaTiiOn_Ultimate_PictureBox.cs | 6 +- .../CrEaTiiOn_Ultimate_RadioButton.cs | 6 +- .../CrEaTiiOn_Ultimate_ToggleButton.cs | 17 +- 302 files changed, 3624 insertions(+), 35551 deletions(-) rename CBH-Ultimate-Theme-Library.sln => CBH-NET-Theme-Library.sln (56%) delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/MainForm.cs delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/Program.cs delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/Properties/Resources.Designer.cs delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Banner/CrEaTiiOn_Banner.cs delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Button/CrEaTiiOn_Button.cs delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Button/CrEaTiiOn_DescriptiveButton.cs delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Button/CrEaTiiOn_FlatButton.cs delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Button/CrEaTiiOn_LightButton.cs delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Button/CrEaTiiOn_ModernButton.cs delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Button/CrEaTiiOn_PillButton.cs delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/CheckBox/CrEaTiiOn_CheckBox.cs delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/CheckBox/CrEaTiiOn_FlatCheckBox.cs delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/CheckBox/CrEaTiiOn_LightCheckBox.cs delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/CheckBox/CrEaTiiOn_MetroCheckBox5.cs delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/CheckBox/CrEaTiiOn_RoundCheckBox.cs delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Controller/CrEaTiiOn_DragControl.cs delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Controller/CrEaTiiOn_VolumeController.cs delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/DatePicker/CrEaTiiOn_DatePicker.cs delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/DropDown/CrEaTiiOn_ClasicDropdownMenu.cs delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/DropDown/CrEaTiiOn_DropdownMenu.cs delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Ellipse/CrEaTiiOn_Ellipse.cs delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Ellipse/CrEaTiiOn_ObjectEllipse.cs delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/GroupBox/CrEaTiiOn_FlatGroupBox.cs delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Handle/CrEaTiiOn_FormHandle.cs delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Icon/CrEaTiiOn_InfoIcon.cs delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Icon/CrEaTiiOn_TickIcon.cs delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Label/CrEaTiiOn_ClasicHeaderLabel.cs delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Label/CrEaTiiOn_ClasicLabel.cs delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Label/CrEaTiiOn_FancyLabel.cs delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Label/CrEaTiiOn_FlatLabel.cs delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Label/CrEaTiiOn_MetroLabel.cs delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Label/CrEaTiiOn_ModernHeaderLabel.cs delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Label/CrEaTiiOn_ModernLabel.cs delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Menu/CrEaTiiOn_MenuColorTable.cs delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Menu/CrEaTiiOn_MenuRenderer.cs delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Menu/Support/MenuColorTable.cs delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Menu/Support/MenuRenderer.cs delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Message/CrEaTiiOn_Message.cs delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Numeric/CrEaTiiOn_Numeric.cs delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Palette/CrEaTiiOn_ColorPalette.cs delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Panel/CrEaTiiOn_FlatPanel.cs delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Panel/CrEaTiiOn_ModernPanel.cs delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Panel/CrEaTiiOn_Panel.cs delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Panel/CrEaTiiOn_WidgetPanel.cs delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Picker/CrEaTiiOn_ColorPicker.Designer.cs delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Picker/CrEaTiiOn_ColorPicker.cs delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Picker/CrEaTiiOn_ColorPicker.resx delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Progress/CrEaTiiOn_FlatProgressBar.cs delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Progress/CrEaTiiOn_FlatRoundProgressBar.cs delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Progress/CrEaTiiOn_ModernProgressBar.cs delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/RadioButton/CrEaTiiOn_MetroRadioButton.cs delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/RichTextBoxEdit/CrEaTiiOn_RichTextBoxEdit.cs delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Sleeper/CrEaTiiOn_Sleeper.cs delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/StatusBar/CrEaTiiOn_FlatStatusBar.cs delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Stick/CrEaTiiOn_JoyStick.cs delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Strip/CrEaTiiOn_ContextMenuStrip.cs delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Strip/CrEaTiiOn_FlatContextMenuStrip.cs delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Strip/Support/StripRenderer.cs delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/TabControl/CrEaTiiOn_FlatTabControl.cs delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/TabControl/CrEaTiiOn_MetroTabControl.cs delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/TabControl/CrEaTiiOn_ModernTabControl.cs delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/TabPage/CrEaTiiOn_TabPage.cs delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/TextBox/CrEaTiiOn_ModernTextBox.Designer.cs delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/TextBoxEdit/CrEaTiiOn_TextPosition.cs delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Toggle/CrEaTiiOn_ModernToggleButton.cs delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Toggle/CrEaTiiOn_ToggleButton.cs delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Watcher/CrEaTiiOn_ExtendedFileSystemWatcher.cs delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/Theme/Helpers/Main/Helper/ThemeContainer.cs delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_FancyComboBox.cs delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientNumericUpDown.cs delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GroupBox.cs delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_NumericUpDown.cs delete mode 100644 CBH-Ultimate-Theme-Library-NET-Framework/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_PictureBox.cs delete mode 100644 CBH-Ultimate-Theme-Library/CBH-Ultimate-Theme-Library.csproj delete mode 100644 CBH-Ultimate-Theme-Library/MainForm.cs delete mode 100644 CBH-Ultimate-Theme-Library/MainForm.resx delete mode 100644 CBH-Ultimate-Theme-Library/Program.cs delete mode 100644 CBH-Ultimate-Theme-Library/Properties/Resources.resx delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/Badge/CrEaTiiOn_Badge.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/Banner/CrEaTiiOn_Banner.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/Bubble/CrEaTiiOn_ChatBubbleLeft.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/Bubble/CrEaTiiOn_ChatBubbleRight.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/Button/CrEaTiiOn_Button.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/Button/CrEaTiiOn_DescriptiveButton.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/Button/CrEaTiiOn_FlatButton.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/Button/CrEaTiiOn_LightButton.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/Button/CrEaTiiOn_ModernButton.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/Button/CrEaTiiOn_PillButton.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/Card/CrEaTiiOn_GradientCard.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/CheckBox/CrEaTiiOn_CheckBox.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/CheckBox/CrEaTiiOn_CustomCheckBox.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/CheckBox/CrEaTiiOn_FlatCheckBox.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/CheckBox/CrEaTiiOn_LightCheckBox.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/CheckBox/CrEaTiiOn_MetroCheckBox5.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/CheckBox/CrEaTiiOn_ModernCheckBox.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/CheckBox/CrEaTiiOn_RoundCheckBox.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/Combobox/CrEaTiiOn_ComboBox.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/Combobox/CrEaTiiOn_ComboBox.resx delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/ControlBox/CrEaTiiOn_ControlBox.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/ControlBox/CrEaTiiOn_FlatControlBox.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/ControlBox/CrEaTiiOn_ModernControlBox.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/Controller/CrEaTiiOn_DragControl.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/Controller/CrEaTiiOn_VolumeController.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/DatePicker/CrEaTiiOn_DatePicker.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/DropDown/CrEaTiiOn_ClasicDropdownMenu.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/DropDown/CrEaTiiOn_DropdownMenu.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/Ellipse/CrEaTiiOn_Ellipse.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/Ellipse/CrEaTiiOn_ObjectEllipse.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/Gauge/CrEaTiiOn_Gauge.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/GroupBox/CrEaTiiOn_FlatGroupBox.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/GroupBox/CrEaTiiOn_ModernGroupBox.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/Handle/CrEaTiiOn_FormHandle.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/Icon/CrEaTiiOn_InfoIcon.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/Icon/CrEaTiiOn_TickIcon.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/Label/CrEaTiiOn_AirLabel.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/Label/CrEaTiiOn_BigLabel.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/Label/CrEaTiiOn_ClasicHeaderLabel.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/Label/CrEaTiiOn_ClasicLabel.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/Label/CrEaTiiOn_FancyLabel.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/Label/CrEaTiiOn_FlatLabel.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/Label/CrEaTiiOn_HeaderLabel.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/Label/CrEaTiiOn_Label.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/Label/CrEaTiiOn_MetroLabel.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/Label/CrEaTiiOn_ModernHeaderLabel.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/Label/CrEaTiiOn_ModernLabel.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/Label/CrEaTiiOn_SmallLabel.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/LabelEdit/CrEaTiiOn_LabelEdit.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/LinkLabel/CrEaTiiOn_LinkLabel.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/LinkLabelEdit/CrEaTiiOn_LinkLabelEdit.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/ListBox/CrEaTiiOn_ListBox.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/Menu/CrEaTiiOn_MenuColorTable.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/Menu/CrEaTiiOn_MenuRenderer.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/Menu/Support/MenuColorTable.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/Menu/Support/MenuRenderer.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/Notify/CrEaTiiOn_NotificationBox.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/Numeric/CrEaTiiOn_Numeric.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/Palette/CrEaTiiOn_ColorPalette.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/Panel/CrEaTiiOn_FlatPanel.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/Panel/CrEaTiiOn_ModernPanel.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/Panel/CrEaTiiOn_Panel.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/Panel/CrEaTiiOn_WidgetPanel.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/Picker/CrEaTiiOn_ColorPicker.Designer.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/Picker/CrEaTiiOn_ColorPicker.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/Picker/CrEaTiiOn_ColorPicker.resx delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/PictureBox/CrEaTiiOn_CircularPictureBox.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/PictureBox/CrEaTiiOn_ModernPictureBox.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/PictureBox/CrEaTiiOn_PictureBox.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/Progress/CrEaTiiOn_CircleProgressBar.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/Progress/CrEaTiiOn_FancyProgressBar.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/Progress/CrEaTiiOn_FlatProgressBar.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/Progress/CrEaTiiOn_FlatRoundProgressBar.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/Progress/CrEaTiiOn_ProcessingControl.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/Progress/CrEaTiiOn_ProgressBar.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/Progress/CrEaTiiOn_SpinningCircles.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/RadioButton/CrEaTiiOn_AirRadioButton.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/RadioButton/CrEaTiiOn_ClasicRadioButton.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/RadioButton/CrEaTiiOn_MetroRadioButton.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/RadioButton/CrEaTiiOn_ModernRadioButton.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/RadioButton/CrEaTiiOn_RadioButton.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/RichTextBox/CrEaTiiOn_RichTextBox.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/Segment/CrEaTiiOn_Segment.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/Separator/CrEaTiiOn_LightSeperator.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/Separator/CrEaTiiOn_ModernSeperator.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/Separator/CrEaTiiOn_Separator.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/Sleeper/CrEaTiiOn_Sleeper.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/Slider/CrEaTiiOn_FlatSliderBar.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/Slider/CrEaTiiOn_ModernSlider.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/StatusBar/CrEaTiiOn_FlatStatusBar.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/Stick/CrEaTiiOn_JoyStick.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/Strip/CrEaTiiOn_ContextMenuStrip.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/Strip/CrEaTiiOn_FlatContextMenuStrip.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/Strip/Support/StripRenderer.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/TabControl/CrEaTiiOn_BarTabControl.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/TabControl/CrEaTiiOn_MetroTabControl.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/TabControl/CrEaTiiOn_ModernTabControl.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/TabPage/CrEaTiiOn_ModernTabPage.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/TabPage/CrEaTiiOn_TabPage.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/TextBox/CrEaTiiOn_AirTextBox.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/TextBox/CrEaTiiOn_ModernTextBox.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/TextBox/CrEaTiiOn_ModernTextBox.resx delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/TextBoxEdit/CrEaTiiOn_TextPosition.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/Toggle/CrEaTiiOn_ModernToggleButton.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/Toggle/CrEaTiiOn_ToggleButton.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/TrackBar/CrEaTiiOn_TrackBar.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Controls/Watcher/CrEaTiiOn_ExtendedFileSystemWatcher.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Helpers/Helpers.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Helpers/Main/Helper/Theme.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/Helpers/Main/Helper/ThemeContainer.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/ThemeBase/Shadow Controls/CrEaTiiOn_Shadow_Controls.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_FancyButton.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_FancyTextBox.resx delete mode 100644 CBH-Ultimate-Theme-Library/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientButton.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientLabel.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientNumericUpDown.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientPanel.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientTextBox.Designer.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientTextBox.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientTextBox.resx delete mode 100644 CBH-Ultimate-Theme-Library/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientToggleButton.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_NumericUpDown.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_RadioButton.cs delete mode 100644 CBH-Ultimate-Theme-Library/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_ToggleButton.cs rename {CBH-Ultimate-Theme-Library-NET-Framework => CBH-WinForm-Theme-NET}/App.config (59%) rename CBH-Ultimate-Theme-Library-NET-Framework/CBH-Ultimate-Theme-Library-NET-Framework.csproj => CBH-WinForm-Theme-NET/CBH-WinForm-Theme-NET-.csproj (64%) rename {CBH-Ultimate-Theme-Library-NET-Framework => CBH-WinForm-Theme-NET}/MainForm.resx (100%) rename {CBH-Ultimate-Theme-Library-NET-Framework => CBH-WinForm-Theme-NET}/Properties/AssemblyInfo.cs (67%) rename {CBH-Ultimate-Theme-Library => CBH-WinForm-Theme-NET}/Properties/Resources.Designer.cs (93%) rename {CBH-Ultimate-Theme-Library-NET-Framework => CBH-WinForm-Theme-NET}/Properties/Resources.resx (100%) rename {CBH-Ultimate-Theme-Library-NET-Framework => CBH-WinForm-Theme-NET}/Properties/Settings.Designer.cs (80%) rename {CBH-Ultimate-Theme-Library-NET-Framework => CBH-WinForm-Theme-NET}/Properties/Settings.settings (100%) rename {CBH-Ultimate-Theme-Library-NET-Framework => CBH-WinForm-Theme-NET}/Theme/Controls/Badge/CrEaTiiOn_Badge.cs (79%) create mode 100644 CBH-WinForm-Theme-NET/Theme/Controls/Banner/CrEaTiiOn_Banner.cs rename {CBH-Ultimate-Theme-Library-NET-Framework => CBH-WinForm-Theme-NET}/Theme/Controls/Bubble/CrEaTiiOn_ChatBubbleLeft.cs (99%) rename {CBH-Ultimate-Theme-Library-NET-Framework => CBH-WinForm-Theme-NET}/Theme/Controls/Bubble/CrEaTiiOn_ChatBubbleRight.cs (99%) rename {CBH-Ultimate-Theme-Library-NET-Framework => CBH-WinForm-Theme-NET}/Theme/Controls/Card/CrEaTiiOn_GradientCard.cs (100%) rename {CBH-Ultimate-Theme-Library-NET-Framework => CBH-WinForm-Theme-NET}/Theme/Controls/CheckBox/CrEaTiiOn_CustomCheckBox.cs (100%) rename {CBH-Ultimate-Theme-Library-NET-Framework => CBH-WinForm-Theme-NET}/Theme/Controls/CheckBox/CrEaTiiOn_ModernCheckBox.cs (100%) create mode 100644 CBH-WinForm-Theme-NET/Theme/Controls/Color Controls/Classes/ColorChangedEventArgs.cs create mode 100644 CBH-WinForm-Theme-NET/Theme/Controls/Color Controls/Classes/ColorModes.cs create mode 100644 CBH-WinForm-Theme-NET/Theme/Controls/Color Controls/Classes/HslColor.cs create mode 100644 CBH-WinForm-Theme-NET/Theme/Controls/Color Controls/Classes/MathExtensions.cs rename CBH-Ultimate-Theme-Library/MainForm.Designer.cs => CBH-WinForm-Theme-NET/Theme/Controls/Color Controls/CrEaTiiOn_ColorBox2D.Designer.cs (50%) create mode 100644 CBH-WinForm-Theme-NET/Theme/Controls/Color Controls/CrEaTiiOn_ColorBox2D.cs create mode 100644 CBH-WinForm-Theme-NET/Theme/Controls/Color Controls/CrEaTiiOn_ColorHexagon.Designer.cs create mode 100644 CBH-WinForm-Theme-NET/Theme/Controls/Color Controls/CrEaTiiOn_ColorHexagon.cs rename CBH-Ultimate-Theme-Library-NET-Framework/MainForm.Designer.cs => CBH-WinForm-Theme-NET/Theme/Controls/Color Controls/CrEaTiiOn_ColorSliderVertical.Designer.cs (62%) create mode 100644 CBH-WinForm-Theme-NET/Theme/Controls/Color Controls/CrEaTiiOn_ColorSliderVertical.cs rename CBH-Ultimate-Theme-Library-NET-Framework/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_FancyComboBox.resx => CBH-WinForm-Theme-NET/Theme/Controls/Color Controls/CrEaTiiOn_ColorSliderVertical.resx (100%) create mode 100644 CBH-WinForm-Theme-NET/Theme/Controls/Color Controls/CrEaTiiOn_ColorWheel.cs rename {CBH-Ultimate-Theme-Library-NET-Framework => CBH-WinForm-Theme-NET}/Theme/Controls/Combobox/CrEaTiiOn_ComboBox.cs (97%) rename {CBH-Ultimate-Theme-Library-NET-Framework => CBH-WinForm-Theme-NET}/Theme/Controls/Combobox/CrEaTiiOn_ComboBox.resx (100%) rename {CBH-Ultimate-Theme-Library-NET-Framework => CBH-WinForm-Theme-NET}/Theme/Controls/ControlBox/CrEaTiiOn_ControlBox.cs (100%) rename {CBH-Ultimate-Theme-Library-NET-Framework => CBH-WinForm-Theme-NET}/Theme/Controls/ControlBox/CrEaTiiOn_FlatControlBox.cs (100%) rename {CBH-Ultimate-Theme-Library-NET-Framework => CBH-WinForm-Theme-NET}/Theme/Controls/ControlBox/CrEaTiiOn_ModernControlBox.cs (100%) rename {CBH-Ultimate-Theme-Library-NET-Framework => CBH-WinForm-Theme-NET}/Theme/Controls/Gauge/CrEaTiiOn_Gauge.cs (100%) create mode 100644 CBH-WinForm-Theme-NET/Theme/Controls/GroupBox/CrEaTiiOn_GradientGroupBox.cs rename {CBH-Ultimate-Theme-Library-NET-Framework => CBH-WinForm-Theme-NET}/Theme/Controls/GroupBox/CrEaTiiOn_ModernGroupBox.cs (54%) rename {CBH-Ultimate-Theme-Library-NET-Framework => CBH-WinForm-Theme-NET}/Theme/Controls/Label/CrEaTiiOn_AirLabel.cs (100%) rename {CBH-Ultimate-Theme-Library-NET-Framework => CBH-WinForm-Theme-NET}/Theme/Controls/Label/CrEaTiiOn_BigLabel.cs (100%) rename {CBH-Ultimate-Theme-Library-NET-Framework => CBH-WinForm-Theme-NET}/Theme/Controls/Label/CrEaTiiOn_HeaderLabel.cs (100%) rename {CBH-Ultimate-Theme-Library-NET-Framework => CBH-WinForm-Theme-NET}/Theme/Controls/Label/CrEaTiiOn_Label.cs (100%) rename {CBH-Ultimate-Theme-Library-NET-Framework => CBH-WinForm-Theme-NET}/Theme/Controls/Label/CrEaTiiOn_SmallLabel.cs (100%) rename {CBH-Ultimate-Theme-Library-NET-Framework => CBH-WinForm-Theme-NET}/Theme/Controls/LabelEdit/CrEaTiiOn_LabelEdit.cs (100%) rename {CBH-Ultimate-Theme-Library-NET-Framework => CBH-WinForm-Theme-NET}/Theme/Controls/LinkLabel/CrEaTiiOn_LinkLabel.cs (100%) rename {CBH-Ultimate-Theme-Library-NET-Framework => CBH-WinForm-Theme-NET}/Theme/Controls/LinkLabelEdit/CrEaTiiOn_LinkLabelEdit.cs (99%) rename {CBH-Ultimate-Theme-Library-NET-Framework => CBH-WinForm-Theme-NET}/Theme/Controls/ListBox/CrEaTiiOn_ListBox.cs (100%) rename {CBH-Ultimate-Theme-Library => CBH-WinForm-Theme-NET}/Theme/Controls/Message/CrEaTiiOn_Message.cs (99%) rename {CBH-Ultimate-Theme-Library-NET-Framework => CBH-WinForm-Theme-NET}/Theme/Controls/Notify/CrEaTiiOn_NotificationBox.cs (100%) create mode 100644 CBH-WinForm-Theme-NET/Theme/Controls/Panel/CrEaTiiOn_Panel.cs rename {CBH-Ultimate-Theme-Library-NET-Framework => CBH-WinForm-Theme-NET}/Theme/Controls/PictureBox/CrEaTiiOn_CircularPictureBox.cs (100%) rename {CBH-Ultimate-Theme-Library-NET-Framework => CBH-WinForm-Theme-NET}/Theme/Controls/PictureBox/CrEaTiiOn_ModernPictureBox.cs (99%) rename {CBH-Ultimate-Theme-Library-NET-Framework => CBH-WinForm-Theme-NET}/Theme/Controls/PictureBox/CrEaTiiOn_PictureBox.cs (100%) rename {CBH-Ultimate-Theme-Library-NET-Framework => CBH-WinForm-Theme-NET}/Theme/Controls/Progress/CrEaTiiOn_CircleProgressBar.cs (100%) rename {CBH-Ultimate-Theme-Library-NET-Framework => CBH-WinForm-Theme-NET}/Theme/Controls/Progress/CrEaTiiOn_FancyProgressBar.cs (100%) rename {CBH-Ultimate-Theme-Library => CBH-WinForm-Theme-NET}/Theme/Controls/Progress/CrEaTiiOn_ModernProgressBar.cs (92%) rename {CBH-Ultimate-Theme-Library-NET-Framework => CBH-WinForm-Theme-NET}/Theme/Controls/Progress/CrEaTiiOn_ProcessingControl.cs (100%) rename {CBH-Ultimate-Theme-Library-NET-Framework => CBH-WinForm-Theme-NET}/Theme/Controls/Progress/CrEaTiiOn_ProgressBar.cs (100%) rename {CBH-Ultimate-Theme-Library-NET-Framework => CBH-WinForm-Theme-NET}/Theme/Controls/Progress/CrEaTiiOn_SpinningCircles.cs (99%) rename {CBH-Ultimate-Theme-Library-NET-Framework => CBH-WinForm-Theme-NET}/Theme/Controls/RadioButton/CrEaTiiOn_AirRadioButton.cs (100%) rename {CBH-Ultimate-Theme-Library-NET-Framework => CBH-WinForm-Theme-NET}/Theme/Controls/RadioButton/CrEaTiiOn_ClasicRadioButton.cs (100%) rename {CBH-Ultimate-Theme-Library-NET-Framework => CBH-WinForm-Theme-NET}/Theme/Controls/RadioButton/CrEaTiiOn_ModernRadioButton.cs (95%) rename {CBH-Ultimate-Theme-Library-NET-Framework => CBH-WinForm-Theme-NET}/Theme/Controls/RadioButton/CrEaTiiOn_RadioButton.cs (100%) rename {CBH-Ultimate-Theme-Library-NET-Framework => CBH-WinForm-Theme-NET}/Theme/Controls/RichTextBox/CrEaTiiOn_RichTextBox.cs (100%) rename {CBH-Ultimate-Theme-Library => CBH-WinForm-Theme-NET}/Theme/Controls/RichTextBoxEdit/CrEaTiiOn_RichTextBoxEdit.cs (98%) rename {CBH-Ultimate-Theme-Library-NET-Framework => CBH-WinForm-Theme-NET}/Theme/Controls/Segment/CrEaTiiOn_Segment.cs (100%) rename {CBH-Ultimate-Theme-Library-NET-Framework => CBH-WinForm-Theme-NET}/Theme/Controls/Separator/CrEaTiiOn_LightSeperator.cs (100%) rename {CBH-Ultimate-Theme-Library-NET-Framework => CBH-WinForm-Theme-NET}/Theme/Controls/Separator/CrEaTiiOn_ModernSeperator.cs (100%) rename {CBH-Ultimate-Theme-Library-NET-Framework => CBH-WinForm-Theme-NET}/Theme/Controls/Separator/CrEaTiiOn_Separator.cs (100%) rename {CBH-Ultimate-Theme-Library-NET-Framework => CBH-WinForm-Theme-NET}/Theme/Controls/Slider/CrEaTiiOn_FlatSliderBar.cs (98%) rename {CBH-Ultimate-Theme-Library-NET-Framework => CBH-WinForm-Theme-NET}/Theme/Controls/Slider/CrEaTiiOn_ModernSlider.cs (100%) rename {CBH-Ultimate-Theme-Library-NET-Framework => CBH-WinForm-Theme-NET}/Theme/Controls/TabControl/CrEaTiiOn_BarTabControl.cs (99%) rename {CBH-Ultimate-Theme-Library => CBH-WinForm-Theme-NET}/Theme/Controls/TabControl/CrEaTiiOn_FlatTabControl.cs (60%) create mode 100644 CBH-WinForm-Theme-NET/Theme/Controls/TabControl/CrEaTiiOn_MetroTabControl.cs rename {CBH-Ultimate-Theme-Library-NET-Framework => CBH-WinForm-Theme-NET}/Theme/Controls/TabPage/CrEaTiiOn_ModernTabPage.cs (100%) create mode 100644 CBH-WinForm-Theme-NET/Theme/Controls/TabPage/CrEaTiiOn_TabPage.cs rename {CBH-Ultimate-Theme-Library-NET-Framework => CBH-WinForm-Theme-NET}/Theme/Controls/TextBox/CrEaTiiOn_AirTextBox.cs (100%) rename {CBH-Ultimate-Theme-Library => CBH-WinForm-Theme-NET}/Theme/Controls/TextBox/CrEaTiiOn_ModernTextBox.Designer.cs (99%) rename {CBH-Ultimate-Theme-Library-NET-Framework => CBH-WinForm-Theme-NET}/Theme/Controls/TextBox/CrEaTiiOn_ModernTextBox.cs (97%) rename {CBH-Ultimate-Theme-Library-NET-Framework => CBH-WinForm-Theme-NET}/Theme/Controls/TextBox/CrEaTiiOn_ModernTextBox.resx (100%) rename {CBH-Ultimate-Theme-Library-NET-Framework => CBH-WinForm-Theme-NET}/Theme/Controls/TrackBar/CrEaTiiOn_TrackBar.cs (100%) rename {CBH-Ultimate-Theme-Library-NET-Framework/Theme => CBH-WinForm-Theme-NET/Theme/ThemeBase}/Helpers/Helpers.cs (59%) rename {CBH-Ultimate-Theme-Library-NET-Framework/Theme/Helpers/Main/Helper => CBH-WinForm-Theme-NET/Theme/ThemeBase/Helpers}/Theme.cs (99%) create mode 100644 CBH-WinForm-Theme-NET/Theme/ThemeBase/Helpers/ThemeContainer.cs rename {CBH-Ultimate-Theme-Library-NET-Framework => CBH-WinForm-Theme-NET}/Theme/ThemeBase/Shadow Controls/CrEaTiiOn_Shadow_Controls.cs (98%) rename {CBH-Ultimate-Theme-Library-NET-Framework => CBH-WinForm-Theme-NET}/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_FancyButton.cs (93%) rename {CBH-Ultimate-Theme-Library => CBH-WinForm-Theme-NET}/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_FancyComboBox.cs (98%) rename {CBH-Ultimate-Theme-Library => CBH-WinForm-Theme-NET}/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_FancyComboBox.resx (100%) rename {CBH-Ultimate-Theme-Library-NET-Framework => CBH-WinForm-Theme-NET}/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_FancyTextBox.resx (100%) rename {CBH-Ultimate-Theme-Library-NET-Framework => CBH-WinForm-Theme-NET}/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientButton.cs (100%) rename {CBH-Ultimate-Theme-Library-NET-Framework => CBH-WinForm-Theme-NET}/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientLabel.cs (84%) create mode 100644 CBH-WinForm-Theme-NET/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientNumericUpDown.cs rename {CBH-Ultimate-Theme-Library-NET-Framework => CBH-WinForm-Theme-NET}/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientPanel.cs (100%) rename {CBH-Ultimate-Theme-Library-NET-Framework => CBH-WinForm-Theme-NET}/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientTextBox.Designer.cs (100%) rename {CBH-Ultimate-Theme-Library-NET-Framework => CBH-WinForm-Theme-NET}/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientTextBox.cs (100%) rename {CBH-Ultimate-Theme-Library-NET-Framework => CBH-WinForm-Theme-NET}/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientTextBox.resx (100%) rename {CBH-Ultimate-Theme-Library-NET-Framework => CBH-WinForm-Theme-NET}/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientToggleButton.cs (98%) rename {CBH-Ultimate-Theme-Library => CBH-WinForm-Theme-NET}/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GroupBox.cs (92%) create mode 100644 CBH-WinForm-Theme-NET/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_NumericUpDown.cs rename {CBH-Ultimate-Theme-Library => CBH-WinForm-Theme-NET}/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_PictureBox.cs (95%) rename {CBH-Ultimate-Theme-Library-NET-Framework => CBH-WinForm-Theme-NET}/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_RadioButton.cs (92%) rename {CBH-Ultimate-Theme-Library-NET-Framework => CBH-WinForm-Theme-NET}/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_ToggleButton.cs (90%) diff --git a/CBH-Ultimate-Theme-Library.sln b/CBH-NET-Theme-Library.sln similarity index 56% rename from CBH-Ultimate-Theme-Library.sln rename to CBH-NET-Theme-Library.sln index 887832e..41f41be 100644 --- a/CBH-Ultimate-Theme-Library.sln +++ b/CBH-NET-Theme-Library.sln @@ -3,9 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.1.32421.90 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CBH-Ultimate-Theme-Library", "CBH-Ultimate-Theme-Library\CBH-Ultimate-Theme-Library.csproj", "{9C5E98D3-671D-41D9-9B6D-BE9EFFB64F0B}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CBH-Ultimate-Theme-Library-NET-Framework", "CBH-Ultimate-Theme-Library-NET-Framework\CBH-Ultimate-Theme-Library-NET-Framework.csproj", "{C3D7B16C-C047-4BAA-884F-7A2308619C33}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CBH-WinForm-Theme-NET-", "CBH-WinForm-Theme-NET\CBH-WinForm-Theme-NET-.csproj", "{C3D7B16C-C047-4BAA-884F-7A2308619C33}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -13,10 +11,6 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {9C5E98D3-671D-41D9-9B6D-BE9EFFB64F0B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9C5E98D3-671D-41D9-9B6D-BE9EFFB64F0B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9C5E98D3-671D-41D9-9B6D-BE9EFFB64F0B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9C5E98D3-671D-41D9-9B6D-BE9EFFB64F0B}.Release|Any CPU.Build.0 = Release|Any CPU {C3D7B16C-C047-4BAA-884F-7A2308619C33}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C3D7B16C-C047-4BAA-884F-7A2308619C33}.Debug|Any CPU.Build.0 = Debug|Any CPU {C3D7B16C-C047-4BAA-884F-7A2308619C33}.Release|Any CPU.ActiveCfg = Release|Any CPU diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/MainForm.cs b/CBH-Ultimate-Theme-Library-NET-Framework/MainForm.cs deleted file mode 100644 index 8e56131..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/MainForm.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; - -namespace CBH_Ultimate_Theme_Library_NET_Framework -{ - public partial class MainForm : Form - { - public MainForm() - { - InitializeComponent(); - } - } -} diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Program.cs b/CBH-Ultimate-Theme-Library-NET-Framework/Program.cs deleted file mode 100644 index a84e1c0..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Program.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using System.Windows.Forms; - -namespace CBH_Ultimate_Theme_Library_NET_Framework -{ - internal static class Program - { - /// - /// The main entry point for the application. - /// - [STAThread] - static void Main() - { - Application.EnableVisualStyles(); - Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new MainForm()); - } - } -} diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Properties/Resources.Designer.cs b/CBH-Ultimate-Theme-Library-NET-Framework/Properties/Resources.Designer.cs deleted file mode 100644 index 9362b02..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Properties/Resources.Designer.cs +++ /dev/null @@ -1,71 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace CBH_Ultimate_Theme_Library_NET_Framework.Properties -{ - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources - { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() - { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager - { - get - { - if ((resourceMan == null)) - { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CBH_Ultimate_Theme_Library_NET_Framework.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture - { - get - { - return resourceCulture; - } - set - { - resourceCulture = value; - } - } - } -} diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Banner/CrEaTiiOn_Banner.cs b/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Banner/CrEaTiiOn_Banner.cs deleted file mode 100644 index 6ed903d..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Banner/CrEaTiiOn_Banner.cs +++ /dev/null @@ -1,152 +0,0 @@ -#region Imports - -using System.Collections.Generic; -using System.ComponentModel; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Drawing.Text; -using System.Windows.Forms; - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_Banner - - public class CrEaTiiOn_Banner : Control - { - public CrEaTiiOn_Banner() - { - base.Size = new Size(100, 20); - base.SetStyle(ControlStyles.SupportsTransparentBackColor, true); - BackColor = Color.Transparent; - Text = base.Name; - ForeColor = Color.White; - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The banner border color")] - public Color BorderColor - { - get => borderColor; - set - { - borderColor = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The color of the banner")] - public Color BannerColor - { - get => bannerColor; - set - { - bannerColor = value; - base.Invalidate(); - } - } - - private PixelOffsetMode _PixelOffsetType = PixelOffsetMode.HighQuality; - [Category("CrEaTiiOn")] - [Browsable(true)] - public PixelOffsetMode PixelOffsetType - { - get => _PixelOffsetType; - set - { - _PixelOffsetType = value; - Invalidate(); - } - } - - private TextRenderingHint _TextRenderingType = TextRenderingHint.ClearTypeGridFit; - [Category("CrEaTiiOn")] - [Browsable(true)] - public TextRenderingHint TextRenderingType - { - get => _TextRenderingType; - set - { - _TextRenderingType = value; - Invalidate(); - } - } - - protected override void OnPaint(PaintEventArgs e) - { - List list = new(); - List list2 = new(); - list.Add(new Point(0, base.Height / 10 * 5)); - list.Add(new Point(base.Height / 10, base.Height / 10 * 4)); - list.Add(new Point(base.Height / 10 * 2, base.Height / 10 * 3)); - list.Add(new Point(base.Height / 10 * 3, base.Height / 10 * 2)); - list.Add(new Point(base.Height / 10 * 4, base.Height / 10)); - list.Add(new Point(base.Height / 10 * 5, 0)); - list.Add(new Point(base.Width - base.Height / 10 * 5, 0)); - list.Add(new Point(base.Width - base.Height / 10 * 4, base.Height / 10)); - list.Add(new Point(base.Width - base.Height / 10 * 3, base.Height / 10 * 2)); - list.Add(new Point(base.Width - base.Height / 10 * 2, base.Height / 10 * 3)); - list.Add(new Point(base.Width - base.Height / 10, base.Height / 10 * 4)); - list.Add(new Point(base.Width, base.Height / 10 * 5)); - list.Add(new Point(base.Width - base.Height / 10, base.Height / 10 * 6)); - list.Add(new Point(base.Width - base.Height / 10 * 2, base.Height / 10 * 7)); - list.Add(new Point(base.Width - base.Height / 10 * 3, base.Height / 10 * 8)); - list.Add(new Point(base.Width - base.Height / 10 * 4, base.Height / 10 * 9)); - list.Add(new Point(base.Width - base.Height / 10 * 5, base.Height / 10 * 10)); - list.Add(new Point(base.Height / 10 * 5, base.Height / 10 * 10)); - list.Add(new Point(base.Height / 10 * 4, base.Height / 10 * 9)); - list.Add(new Point(base.Height / 10 * 3, base.Height / 10 * 8)); - list.Add(new Point(base.Height / 10 * 2, base.Height / 10 * 7)); - list.Add(new Point(base.Height / 10, base.Height / 10 * 6)); - list.Add(new Point(0, base.Height / 10 * 5)); - SolidBrush brush = new(bannerColor); - e.Graphics.FillPolygon(brush, list.ToArray()); - list2.Add(new Point(0, base.Height / 10 * 5)); - list2.Add(new Point(base.Height / 10, base.Height / 10 * 4)); - list2.Add(new Point(base.Height / 10 * 2, base.Height / 10 * 3)); - list2.Add(new Point(base.Height / 10 * 3, base.Height / 10 * 2)); - list2.Add(new Point(base.Height / 10 * 4, base.Height / 10)); - list2.Add(new Point(base.Height / 10 * 5, 0)); - list2.Add(new Point(base.Width - base.Height / 10 * 5 - 1, 0)); - list2.Add(new Point(base.Width - base.Height / 10 * 4 - 1, base.Height / 10)); - list2.Add(new Point(base.Width - base.Height / 10 * 3 - 1, base.Height / 10 * 2)); - list2.Add(new Point(base.Width - base.Height / 10 * 2 - 1, base.Height / 10 * 3)); - list2.Add(new Point(base.Width - base.Height / 10 - 1, base.Height / 10 * 4)); - list2.Add(new Point(base.Width - 1, base.Height / 10 * 5)); - list2.Add(new Point(base.Width - base.Height / 10 - 1, base.Height / 10 * 6)); - list2.Add(new Point(base.Width - base.Height / 10 * 2 - 1, base.Height / 10 * 7)); - list2.Add(new Point(base.Width - base.Height / 10 * 3 - 1, base.Height / 10 * 8)); - list2.Add(new Point(base.Width - base.Height / 10 * 4 - 1, base.Height / 10 * 9)); - list2.Add(new Point(base.Width - base.Height / 10 * 5, base.Height / 10 * 10 - 1)); - list2.Add(new Point(base.Height / 10 * 5 - 1, base.Height / 10 * 10 - 1)); - list2.Add(new Point(base.Height / 10 * 4, base.Height / 10 * 9)); - list2.Add(new Point(base.Height / 10 * 3, base.Height / 10 * 8)); - list2.Add(new Point(base.Height / 10 * 2, base.Height / 10 * 7)); - list2.Add(new Point(base.Height / 10, base.Height / 10 * 6)); - list2.Add(new Point(0, base.Height / 10 * 5)); - Pen pen = new Pen(borderColor, 1f); - e.Graphics.DrawPolygon(pen, list2.ToArray()); - StringFormat stringFormat = new() - { - LineAlignment = StringAlignment.Center, - Alignment = StringAlignment.Center - }; - SolidBrush brush2 = new(ForeColor); - RectangleF layoutRectangle = new(0f, 0f, Width, Height); - e.Graphics.PixelOffsetMode = PixelOffsetType; - e.Graphics.TextRenderingHint = TextRenderingType; - e.Graphics.DrawString(Text, Font, brush2, layoutRectangle, stringFormat); - base.OnPaint(e); - } - - private Color borderColor = Color.FromArgb(250, 36, 38); - - private Color bannerColor = Color.FromArgb(15, 15, 15); - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Button/CrEaTiiOn_Button.cs b/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Button/CrEaTiiOn_Button.cs deleted file mode 100644 index 5f3e981..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Button/CrEaTiiOn_Button.cs +++ /dev/null @@ -1,160 +0,0 @@ -#region Imports - -using System; -using System.ComponentModel; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Windows.Forms; - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_Button - - public class CrEaTiiOn_Button : Button - { - //Fields - private int borderSize = 2; - private int borderRadius = 3; - private Color borderColor = Color.FromArgb(250, 36, 38); - - //Properties - [Category("CrEaTiiOn")] - public int BorderSize - { - get { return borderSize; } - set - { - borderSize = value; - this.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - public int BorderRadius - { - get { return borderRadius; } - set - { - borderRadius = value; - this.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - public Color BorderColor - { - get { return borderColor; } - set - { - borderColor = value; - this.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - public Color BackgroundColor - { - get { return this.BackColor; } - set { this.BackColor = value; } - } - - [Category("CrEaTiiOn")] - public Color TextColor - { - get { return this.ForeColor; } - set { this.ForeColor = value; } - } - - //Constructor - public CrEaTiiOn_Button() - { - this.FlatStyle = FlatStyle.Flat; - this.FlatAppearance.BorderSize = 0; - this.Size = new Size(150, 40); - this.BackColor = Color.FromArgb(15, 15, 15); - this.ForeColor = Color.White; - this.Resize += new EventHandler(Button_Resize); - } - - //Methods - private GraphicsPath GetFigurePath(Rectangle rect, int radius) - { - GraphicsPath path = new GraphicsPath(); - float curveSize = radius * 2F; - - path.StartFigure(); - path.AddArc(rect.X, rect.Y, curveSize, curveSize, 180, 90); - path.AddArc(rect.Right - curveSize, rect.Y, curveSize, curveSize, 270, 90); - path.AddArc(rect.Right - curveSize, rect.Bottom - curveSize, curveSize, curveSize, 0, 90); - path.AddArc(rect.X, rect.Bottom - curveSize, curveSize, curveSize, 90, 90); - path.CloseFigure(); - return path; - } - - protected override void OnPaint(PaintEventArgs pevent) - { - base.OnPaint(pevent); - - - Rectangle rectSurface = this.ClientRectangle; - Rectangle rectBorder = Rectangle.Inflate(rectSurface, -borderSize, -borderSize); - int smoothSize = 2; - if (borderSize > 0) - smoothSize = borderSize; - - if (borderRadius > 2) //Rounded button - { - using (GraphicsPath pathSurface = GetFigurePath(rectSurface, borderRadius)) - using (GraphicsPath pathBorder = GetFigurePath(rectBorder, borderRadius - borderSize)) - using (Pen penSurface = new Pen(this.Parent.BackColor, smoothSize)) - using (Pen penBorder = new Pen(borderColor, borderSize)) - { - pevent.Graphics.SmoothingMode = SmoothingMode.AntiAlias; - //Button surface - this.Region = new Region(pathSurface); - //Draw surface border for HD result - pevent.Graphics.DrawPath(penSurface, pathSurface); - - //Button border - if (borderSize >= 1) - //Draw control border - pevent.Graphics.DrawPath(penBorder, pathBorder); - } - } - else //Normal button - { - pevent.Graphics.SmoothingMode = SmoothingMode.None; - //Button surface - this.Region = new Region(rectSurface); - //Button border - if (borderSize >= 1) - { - using (Pen penBorder = new Pen(borderColor, borderSize)) - { - penBorder.Alignment = PenAlignment.Inset; - pevent.Graphics.DrawRectangle(penBorder, 0, 0, this.Width - 1, this.Height - 1); - } - } - } - } - protected override void OnHandleCreated(EventArgs e) - { - base.OnHandleCreated(e); - this.Parent.BackColorChanged += new EventHandler(Container_BackColorChanged); - } - - private void Container_BackColorChanged(object sender, EventArgs e) - { - this.Invalidate(); - } - private void Button_Resize(object sender, EventArgs e) - { - if (borderRadius > this.Height) - borderRadius = this.Height; - } - } - - #endregion -} diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Button/CrEaTiiOn_DescriptiveButton.cs b/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Button/CrEaTiiOn_DescriptiveButton.cs deleted file mode 100644 index 36a41bf..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Button/CrEaTiiOn_DescriptiveButton.cs +++ /dev/null @@ -1,172 +0,0 @@ -#region Imports -using CBH_Ultimate_Theme_Library.Theme.Helpers; -using System; -using System.Collections.Generic; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Windows.Forms; -#endregion - -namespace CBH.Controls -{ - public class CrEaTiiOn_DescriptiveButton : Control - { - protected override void OnPaint(PaintEventArgs e) - { - base.OnPaint(e); - - Graphics g = e.Graphics; - g.SmoothingMode = SmoothingMode.HighQuality; - g.Clear(Parent.BackColor); - - DrawingHelper dh = new DrawingHelper(); - MultiLineHandler mlh = new MultiLineHandler(); - int slope = Adjustments.Roundness; - - Rectangle mainRect = new Rectangle(0, 0, Width - 1, Height - 1); - GraphicsPath mainPath = dh.RoundRect(mainRect, slope); - - ColorBlend backCB = new ColorBlend(3); - backCB.Colors = new[] { Color.FromArgb(15, 15, 15), Color.FromArgb(15, 15, 15), Color.FromArgb(15, 15, 15) }; - backCB.Positions = new[] { 0.0f, 0.75f, 1.0f }; - LinearGradientBrush backLGB = new LinearGradientBrush(mainRect, Color.Black, Color.Black, 90.0F); - backLGB.InterpolationColors = backCB; - g.FillPath(backLGB, mainPath); - - SolidBrush textBrush = new SolidBrush(Color.White); - - if (_image != null) - { - Rectangle imageRect = new Rectangle(12, 12, 48, 48); - g.DrawImage(_image, imageRect); - g.DrawString(_title, _titleFont, textBrush, new Point(12 + 48 + 4, (int)(12 + (48 / 2.0) - (g.MeasureString(_title, _titleFont).Height / 2.0)))); - } - else - { - g.DrawString(_title, _titleFont, textBrush, new Point(12, (int)(12 + (48 / 2.0) - (g.MeasureString(_title, _titleFont).Height / 2.0)))); - } - - int descY = 12 + 48 + 14; - textBrush = new SolidBrush(Color.FromArgb(120, 120, 120)); - - foreach (string line in mlh.GetLines(g, Text, Font, Width - 24)) - { - g.DrawString(line, Font, textBrush, new Point(12, descY)); - descY += 13; - } - - if (state == MouseState.Over) - { - g.FillPath(new SolidBrush(Color.FromArgb(10, Color.Black)), mainPath); - } - else if (state == MouseState.Down) - { - g.FillPath(new SolidBrush(Color.FromArgb(18, Color.Black)), mainPath); - } - - LinearGradientBrush borderLGB = new LinearGradientBrush(new Rectangle(0, 0, Width, Height), Color.FromArgb(250, 36, 38), Color.FromArgb(250, 36, 38), 90.0F); - g.DrawPath(new Pen(borderLGB), mainPath); - - } - - public CrEaTiiOn_DescriptiveButton() - { - SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.UserPaint, true); - Font = new Font(Adjustments.DefaultFontFamily, 8); - Size = new Size(200, 130); - Cursor = Cursors.Hand; - } - - private Image _image; - public Image Image - { - get - { - return _image; - } - set - { - _image = value; - Invalidate(); - } - } - - private string _title = "Title"; - public string Title - { - get - { - return _title; - } - set - { - _title = value; - Invalidate(); - } - } - - private Font _titleFont = new Font(Adjustments.DefaultFontFamily, 14); - public Font TitleFont - { - get - { - return _titleFont; - } - set - { - _titleFont = value; - Invalidate(); - } - } - - public enum MouseState - { - None, - Over, - Down - } - - private MouseState state = MouseState.None; - - protected override void OnMouseEnter(EventArgs e) - { - base.OnMouseEnter(e); - state = MouseState.Over; - Invalidate(); - } - - protected override void OnMouseLeave(EventArgs e) - { - base.OnMouseLeave(e); - state = MouseState.None; - Invalidate(); - } - - protected override void OnMouseDown(MouseEventArgs e) - { - base.OnMouseDown(e); - state = MouseState.Down; - Invalidate(); - } - - protected override void OnMouseUp(MouseEventArgs e) - { - base.OnMouseUp(e); - state = MouseState.Over; - Invalidate(); - } - - protected override void OnTextChanged(EventArgs e) - { - base.OnTextChanged(e); - Invalidate(); - } - - protected override void OnFontChanged(EventArgs e) - { - base.OnFontChanged(e); - Font = new Font(Font.FontFamily, 8); - } - - } -} diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Button/CrEaTiiOn_FlatButton.cs b/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Button/CrEaTiiOn_FlatButton.cs deleted file mode 100644 index ae6ba36..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Button/CrEaTiiOn_FlatButton.cs +++ /dev/null @@ -1,363 +0,0 @@ -#region Imports - -using System; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Windows.Forms; - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_FlatButton - - public class CrEaTiiOn_FlatButton : Control - { - #region Variables - - private int MouseState; - private GraphicsPath Shape; - private LinearGradientBrush InactiveGB; - private Color _InactiveColor = Color.FromArgb(15, 15, 15); - private LinearGradientBrush PressedGB; - private Color _PressedColor = Color.FromArgb(20, 20, 20); - private LinearGradientBrush EnteredGB; - private Color _EnteredColor = Color.FromArgb(25, 25, 25); - private Rectangle R1; - private readonly Pen P1; - private readonly Pen P3; - private Image _Image; - private Size _ImageSize; - private StringAlignment _TextAlignment = StringAlignment.Center; - private Color _TextColor; // VBConversions Note: Initial value cannot be assigned here since it is non-static. Assignment has been moved to the class constructors. - private ContentAlignment _ImageAlign = ContentAlignment.MiddleLeft; - - #endregion - - #region Image Designer - - private static PointF ImageLocation(StringFormat SF, SizeF Area, SizeF ImageArea) - { - PointF MyPoint = new(); - switch (SF.Alignment) - { - case StringAlignment.Center: - MyPoint.X = (float)((Area.Width - ImageArea.Width) / 2); - break; - case StringAlignment.Near: - MyPoint.X = 2; - break; - case StringAlignment.Far: - MyPoint.X = Area.Width - ImageArea.Width - 2; - break; - - } - - switch (SF.LineAlignment) - { - case StringAlignment.Center: - MyPoint.Y = (float)((Area.Height - ImageArea.Height) / 2); - break; - case StringAlignment.Near: - MyPoint.Y = 2; - break; - case StringAlignment.Far: - MyPoint.Y = Area.Height - ImageArea.Height - 2; - break; - } - return MyPoint; - } - - private StringFormat GetStringFormat(ContentAlignment _ContentAlignment) - { - StringFormat SF = new(); - switch (_ContentAlignment) - { - case ContentAlignment.MiddleCenter: - SF.LineAlignment = StringAlignment.Center; - SF.Alignment = StringAlignment.Center; - break; - case ContentAlignment.MiddleLeft: - SF.LineAlignment = StringAlignment.Center; - SF.Alignment = StringAlignment.Near; - break; - case ContentAlignment.MiddleRight: - SF.LineAlignment = StringAlignment.Center; - SF.Alignment = StringAlignment.Far; - break; - case ContentAlignment.TopCenter: - SF.LineAlignment = StringAlignment.Near; - SF.Alignment = StringAlignment.Center; - break; - case ContentAlignment.TopLeft: - SF.LineAlignment = StringAlignment.Near; - SF.Alignment = StringAlignment.Near; - break; - case ContentAlignment.TopRight: - SF.LineAlignment = StringAlignment.Near; - SF.Alignment = StringAlignment.Far; - break; - case ContentAlignment.BottomCenter: - SF.LineAlignment = StringAlignment.Far; - SF.Alignment = StringAlignment.Center; - break; - case ContentAlignment.BottomLeft: - SF.LineAlignment = StringAlignment.Far; - SF.Alignment = StringAlignment.Near; - break; - case ContentAlignment.BottomRight: - SF.LineAlignment = StringAlignment.Far; - SF.Alignment = StringAlignment.Far; - break; - } - return SF; - } - - #endregion - - #region Properties - - public Image Image - { - get => _Image; - set - { - if (value == null) - { - _ImageSize = Size.Empty; - } - else - { - _ImageSize = value.Size; - } - - _Image = value; - Invalidate(); - } - } - - protected Size ImageSize => _ImageSize; - - public ContentAlignment ImageAlign - { - get => _ImageAlign; - set - { - _ImageAlign = value; - Invalidate(); - } - } - - public StringAlignment TextAlignment - { - get => _TextAlignment; - set - { - _TextAlignment = value; - Invalidate(); - } - } - - public override Color ForeColor - { - get => _TextColor; - set - { - _TextColor = value; - Invalidate(); - } - } - - public Color InactiveColor - { - get => _InactiveColor; - set => _InactiveColor = value; - } - - public Color PressedColor - { - get => _PressedColor; - set => _PressedColor = value; - } - - public Color EnteredColor - { - get => _EnteredColor; - set => _EnteredColor = value; - } - - #endregion - - #region EventArgs - - protected override void OnMouseUp(MouseEventArgs e) - { - MouseState = 2; - Invalidate(); - base.OnMouseUp(e); - } - - /*protected override void OnMouseMove(MouseEventArgs e) - { - if (Enabled == true) - Cursor = Cursors.Hand; - else - Cursor = Cursors.No; - base.OnMouseMove(e); - }*/ - - protected override void OnMouseEnter(EventArgs e) - { - MouseState = 2; - Invalidate(); - base.OnMouseEnter(e); - } - - protected override void OnMouseDown(MouseEventArgs e) - { - MouseState = 1; - Focus(); - Invalidate(); - base.OnMouseDown(e); - } - - protected override void OnMouseLeave(EventArgs e) - { - MouseState = 0; - Invalidate(); - base.OnMouseLeave(e); - } - - protected override void OnTextChanged(EventArgs e) - { - Invalidate(); - base.OnTextChanged(e); - } - - #endregion - - public CrEaTiiOn_FlatButton() - { - SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.SupportsTransparentBackColor | ControlStyles.UserPaint, true); - - BackColor = Color.Transparent; - Cursor = Cursors.Hand; - DoubleBuffered = true; - Font = new("Segoe UI", 12); - ForeColor = Color.White; - Size = new(120, 40); - _TextAlignment = StringAlignment.Center; - P1 = new(Color.FromArgb(250, 36, 38)); // P1 = Border color - P3 = new(Color.FromArgb(250, 36, 38)); // P3 = Border color when pressed - } - - protected override void OnResize(EventArgs e) - { - base.OnResize(e); - if (Width > 0 && Height > 0) - { - Shape = new(); - R1 = new(0, 0, Width, Height); - - InactiveGB = new(new Rectangle(0, 0, Width, Height), _InactiveColor, _InactiveColor, 90.0F); - PressedGB = new(new Rectangle(0, 0, Width, Height), _PressedColor, _PressedColor, 90.0F); - EnteredGB = new(new Rectangle(0, 0, Width, Height), _EnteredColor, _EnteredColor, 90.0F); - } - - Shape.AddArc(0, 0, 10, 10, 180, 90); - Shape.AddArc(Width - 11, 0, 10, 10, -90, 90); - Shape.AddArc(Width - 11, Height - 11, 10, 10, 0, 90); - Shape.AddArc(0, Height - 11, 10, 10, 90, 90); - Shape.CloseAllFigures(); - Invalidate(); - } - - protected override void OnPaint(PaintEventArgs e) - { - Graphics G = e.Graphics; - G.SmoothingMode = SmoothingMode.HighQuality; - PointF ipt = ImageLocation(GetStringFormat(ImageAlign), Size, ImageSize); - - switch (MouseState) - { - case 0: - //Inactive - G.FillPath(InactiveGB, Shape); - // Fill button body with InactiveGB color gradient - G.DrawPath(P1, Shape); - // Draw button border [InactiveGB] - if ((Image == null)) - { - G.DrawString(Text, Font, new SolidBrush(ForeColor), R1, new StringFormat - { - Alignment = _TextAlignment, - LineAlignment = StringAlignment.Center - }); - } - else - { - G.DrawImage(_Image, ipt.X, ipt.Y, ImageSize.Width, ImageSize.Height); - G.DrawString(Text, Font, new SolidBrush(ForeColor), R1, new StringFormat - { - Alignment = _TextAlignment, - LineAlignment = StringAlignment.Center - }); - } - break; - case 1: - //Pressed - G.FillPath(PressedGB, Shape); - // Fill button body with PressedGB color gradient - G.DrawPath(P3, Shape); - // Draw button border [PressedGB] - - if ((Image == null)) - { - G.DrawString(Text, Font, new SolidBrush(ForeColor), R1, new StringFormat - { - Alignment = _TextAlignment, - LineAlignment = StringAlignment.Center - }); - } - else - { - G.DrawImage(_Image, ipt.X, ipt.Y, ImageSize.Width, ImageSize.Height); - G.DrawString(Text, Font, new SolidBrush(ForeColor), R1, new StringFormat - { - Alignment = _TextAlignment, - LineAlignment = StringAlignment.Center - }); - } - break; - case 2: - //Entered - G.FillPath(EnteredGB, Shape); - // Fill button body with EnteredGB color gradient - G.DrawPath(P3, Shape); - // Draw button border [EnteredGB] - - if ((Image == null)) - { - G.DrawString(Text, Font, new SolidBrush(ForeColor), R1, new StringFormat - { - Alignment = _TextAlignment, - LineAlignment = StringAlignment.Center - }); - } - else - { - G.DrawImage(_Image, ipt.X, ipt.Y, ImageSize.Width, ImageSize.Height); - G.DrawString(Text, Font, new SolidBrush(ForeColor), R1, new StringFormat - { - Alignment = _TextAlignment, - LineAlignment = StringAlignment.Center - }); - } - break; - } - base.OnPaint(e); - } - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Button/CrEaTiiOn_LightButton.cs b/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Button/CrEaTiiOn_LightButton.cs deleted file mode 100644 index dac9b34..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Button/CrEaTiiOn_LightButton.cs +++ /dev/null @@ -1,196 +0,0 @@ -#region Imports -using System; -using System.Drawing.Drawing2D; -using System.Drawing; -using System.Windows.Forms; -#endregion - -namespace CBH.Controls -{ - public class CrEaTiiOn_LightButton : Control - { - - #region "CreateRound" - private GraphicsPath CreateRoundPath; - - private Rectangle CreateRoundRectangle; - public GraphicsPath CreateRound(int x, int y, int width, int height, int slope) - { - CreateRoundRectangle = new Rectangle(x, y, width, height); - return CreateRound(CreateRoundRectangle, slope); - } - - public GraphicsPath CreateRound(Rectangle r, int slope) - { - CreateRoundPath = new GraphicsPath(FillMode.Winding); - CreateRoundPath.AddArc(r.X, r.Y, slope, slope, 180f, 90f); - CreateRoundPath.AddArc(r.Right - slope, r.Y, slope, slope, 270f, 90f); - CreateRoundPath.AddArc(r.Right - slope, r.Bottom - slope, slope, slope, 0f, 90f); - CreateRoundPath.AddArc(r.X, r.Bottom - slope, slope, slope, 90f, 90f); - CreateRoundPath.CloseFigure(); - return CreateRoundPath; - } - #endregion - - #region "Mouse states" - private MouseStates State; - public enum MouseStates - { - None = 0, - Over = 1, - Down = 2 - } - - protected override void OnMouseEnter(EventArgs e) - { - State = MouseStates.Over; - Invalidate(); - base.OnMouseEnter(e); - } - - protected override void OnMouseLeave(EventArgs e) - { - State = MouseStates.None; - Invalidate(); - base.OnMouseEnter(e); - } - - protected override void OnMouseDown(MouseEventArgs e) - { - State = MouseStates.Down; - Invalidate(); - base.OnMouseDown(e); - } - - protected override void OnMouseUp(MouseEventArgs e) - { - State = MouseStates.Over; - Invalidate(); - if (e.Button == MouseButtons.Left) - base.OnClick(null); - //This fixes some fucked up lag you get... - base.OnMouseDown(e); - } - - //Do nothing here or it fires twice - protected override void OnClick(EventArgs e) - { - } - #endregion - - #region "Properties" - - public enum ImageAlignments - { - Left = 0, - Center = 1, - Right = 2 - } - - ImageAlignments _ImageAlignment = ImageAlignments.Left; - public ImageAlignments ImageAlignment - { - get { return _ImageAlignment; } - set - { - _ImageAlignment = value; - Invalidate(); - } - } - - Image _Image; - public Image Image - { - get { return _Image; } - set - { - _Image = value; - Invalidate(); - } - } - - #endregion - - public CrEaTiiOn_LightButton() - { - Size = new Size(120, 31); - DoubleBuffered = true; - SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.SupportsTransparentBackColor, true); - BackColor = Color.FromArgb(250, 36, 38); - Font = new Font("Segoe UI", 9); - } - - protected override void OnPaint(PaintEventArgs e) - { - e.Graphics.SmoothingMode = SmoothingMode.HighQuality; - - Brush LGB = default(Brush); - - switch (State) - { - case MouseStates.None: - LGB = new LinearGradientBrush(new Rectangle(0, 0, Width - 1, Height - 1), Color.FromArgb(20, 20, 20), Color.FromArgb(25, 25, 25), 90f); - break; - case MouseStates.Over: - LGB = new LinearGradientBrush(new Rectangle(0, 0, Width - 1, Height - 1), Color.FromArgb(20, 20, 20), Color.FromArgb(25, 25, 25), 90f); - break; - default: - LGB = new LinearGradientBrush(new Rectangle(0, 0, Width - 1, Height - 1), Color.FromArgb(20, 20, 20), Color.FromArgb(18, 18, 18), 90f); - break; - } - if (!Enabled) - { - LGB = new SolidBrush(Color.FromArgb(20, 20, 20)); - } - e.Graphics.FillPath(LGB, CreateRound(0, 0, Width - 1, Height - 1, 6)); - - if ((_Image == null)) - { - e.Graphics.DrawString(Text, Font, Brushes.White, new Rectangle(3, 2, Width - 7, Height - 5), new StringFormat - { - Alignment = StringAlignment.Center, - LineAlignment = StringAlignment.Center, - Trimming = StringTrimming.EllipsisCharacter - }); - } - else - { - e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic; - switch (_ImageAlignment) - { - case ImageAlignments.Left: - Rectangle ImageRect = new Rectangle(9, 6, Height - 13, Height - 13); - e.Graphics.DrawImage(_Image, ImageRect); - e.Graphics.DrawString(Text, Font, Brushes.White, new Rectangle(ImageRect.X + ImageRect.Width + 6, 2, Width - ImageRect.Width - 22, Height - 5), new StringFormat - { - Alignment = StringAlignment.Center, - LineAlignment = StringAlignment.Center, - Trimming = StringTrimming.EllipsisCharacter - }); - break; - case ImageAlignments.Center: - Rectangle ImageRect1 = new Rectangle(((Width - 1) / 2) - (Height - 13) / 2, 6, Height - 13, Height - 13); - e.Graphics.DrawImage(_Image, ImageRect1); - break; - case ImageAlignments.Right: - Rectangle ImageRect2 = new Rectangle(Width - Height + 3, 6, Height - 13, Height - 13); - e.Graphics.DrawImage(_Image, ImageRect2); - e.Graphics.DrawString(Text, Font, Brushes.White, new Rectangle(3, 2, Width - ImageRect2.Width - 22, Height - 5), new StringFormat - { - Alignment = StringAlignment.Center, - LineAlignment = StringAlignment.Center, - Trimming = StringTrimming.EllipsisCharacter - }); - break; - } - } - - base.OnPaint(e); - } - - public void PerformClick() - { - base.OnClick(null); - } - } -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Button/CrEaTiiOn_ModernButton.cs b/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Button/CrEaTiiOn_ModernButton.cs deleted file mode 100644 index fcabfe3..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Button/CrEaTiiOn_ModernButton.cs +++ /dev/null @@ -1,334 +0,0 @@ -using CBH_Ultimate_Theme_Library.Theme.Helpers; -using System; -using System.Drawing; -using System.Windows.Forms; - -namespace CBH.Controls -{ - #region CrEaTiiOn_ModernButton - - public class CrEaTiiOn_ModernButton : Button - { - private Graphics G; - - private Helpers.MouseState State; - - private Schemes SchemeClone = Schemes.Black; - public Schemes Scheme - { - get { return SchemeClone; } - set - { - SchemeClone = value; - Invalidate(); - } - } - - public enum Schemes : byte - { - Black = 0, - Green = 1, - Red = 2, - Blue = 3 - } - - public CrEaTiiOn_ModernButton() - { - DoubleBuffered = true; - SetStyle(ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.Opaque | ControlStyles.OptimizedDoubleBuffer, true); - } - - protected override void OnPaint(PaintEventArgs e) - { - G = e.Graphics; - - base.OnPaint(e); - - G.Clear(Parent.BackColor); - - switch (Scheme) - { - - case Schemes.Black: - - - if (Enabled) - { - - if (State == Helpers.MouseState.None) - { - using (SolidBrush Background = new SolidBrush(Color.FromArgb(20, 20, 20))) - { - using (Pen Border = new Pen(Color.FromArgb(250, 36, 38))) - { - G.FillPath(Background, Helpers.RoundRect(new Rectangle(0, 0, Width - 1, Height - 1), 2)); - G.DrawPath(Border, Helpers.RoundRect(new Rectangle(0, 0, Width - 1, Height - 1), 2)); - } - } - - - } - else if (State == Helpers.MouseState.Over) - { - using (SolidBrush Background = new SolidBrush(Color.FromArgb(58, 58, 57))) - { - using (Pen Border = new Pen(Color.FromArgb(46, 46, 45))) - { - G.FillPath(Background, Helpers.RoundRect(new Rectangle(0, 0, Width - 1, Height - 1), 2)); - G.DrawPath(Border, Helpers.RoundRect(new Rectangle(0, 0, Width - 1, Height - 1), 2)); - } - } - - - } - else if (State == Helpers.MouseState.Down) - { - using (SolidBrush Background = new SolidBrush(Color.FromArgb(50, 50, 49))) - { - using (Pen Border = new Pen(Color.FromArgb(38, 38, 37))) - { - G.FillPath(Background, Helpers.RoundRect(new Rectangle(0, 0, Width - 1, Height - 1), 2)); - G.DrawPath(Border, Helpers.RoundRect(new Rectangle(0, 0, Width - 1, Height - 1), 2)); - } - } - - } - - - } - else - { - using (SolidBrush Background = new SolidBrush(Color.FromArgb(40, 40, 39))) - { - using (Pen Border = new Pen(Color.FromArgb(38, 38, 37))) - { - G.FillPath(Background, Helpers.RoundRect(new Rectangle(0, 0, Width - 1, Height - 1), 2)); - G.DrawPath(Border, Helpers.RoundRect(new Rectangle(0, 0, Width - 1, Height - 1), 2)); - } - } - - } - - break; - case Schemes.Green: - - - if (State == Helpers.MouseState.None) - { - using (SolidBrush Background = new SolidBrush(Color.FromArgb(123, 164, 93))) - { - using (Pen Border = new Pen(Color.FromArgb(119, 160, 89))) - { - G.FillPath(Background, Helpers.RoundRect(new Rectangle(0, 0, Width - 1, Height - 1), 2)); - G.DrawPath(Border, Helpers.RoundRect(new Rectangle(0, 0, Width - 1, Height - 1), 2)); - } - } - - - } - else if (State == Helpers.MouseState.Over) - { - using (SolidBrush Background = new SolidBrush(Color.FromArgb(127, 168, 97))) - { - using (Pen Border = new Pen(Color.FromArgb(123, 164, 93))) - { - G.FillPath(Background, Helpers.RoundRect(new Rectangle(0, 0, Width - 1, Height - 1), 2)); - G.DrawPath(Border, Helpers.RoundRect(new Rectangle(0, 0, Width - 1, Height - 1), 2)); - } - } - - - } - else if (State == Helpers.MouseState.Down) - { - using (SolidBrush Background = new SolidBrush(Color.FromArgb(119, 160, 93))) - { - using (Pen Border = new Pen(Color.FromArgb(115, 156, 85))) - { - G.FillPath(Background, Helpers.RoundRect(new Rectangle(0, 0, Width - 1, Height - 1), 2)); - G.DrawPath(Border, Helpers.RoundRect(new Rectangle(0, 0, Width - 1, Height - 1), 2)); - } - } - - } - - break; - case Schemes.Red: - - - if (State == Helpers.MouseState.None) - { - using (SolidBrush Background = new SolidBrush(Color.FromArgb(164, 93, 93))) - { - using (Pen Border = new Pen(Color.FromArgb(160, 89, 89))) - { - G.FillPath(Background, Helpers.RoundRect(new Rectangle(0, 0, Width - 1, Height - 1), 2)); - G.DrawPath(Border, Helpers.RoundRect(new Rectangle(0, 0, Width - 1, Height - 1), 2)); - } - } - - - } - else if (State == Helpers.MouseState.Over) - { - using (SolidBrush Background = new SolidBrush(Color.FromArgb(168, 97, 97))) - { - using (Pen Border = new Pen(Color.FromArgb(164, 93, 93))) - { - G.FillPath(Background, Helpers.RoundRect(new Rectangle(0, 0, Width - 1, Height - 1), 2)); - G.DrawPath(Border, Helpers.RoundRect(new Rectangle(0, 0, Width - 1, Height - 1), 2)); - } - } - - - } - else if (State == Helpers.MouseState.Down) - { - using (SolidBrush Background = new SolidBrush(Color.FromArgb(160, 89, 89))) - { - using (Pen Border = new Pen(Color.FromArgb(156, 85, 85))) - { - G.FillPath(Background, Helpers.RoundRect(new Rectangle(0, 0, Width - 1, Height - 1), 2)); - G.DrawPath(Border, Helpers.RoundRect(new Rectangle(0, 0, Width - 1, Height - 1), 2)); - } - } - - } - - break; - case Schemes.Blue: - - - if (State == Helpers.MouseState.None) - { - using (SolidBrush Background = new SolidBrush(Color.FromArgb(93, 154, 164))) - { - using (Pen Border = new Pen(Color.FromArgb(89, 150, 160))) - { - G.FillPath(Background, Helpers.RoundRect(new Rectangle(0, 0, Width - 1, Height - 1), 2)); - G.DrawPath(Border, Helpers.RoundRect(new Rectangle(0, 0, Width - 1, Height - 1), 2)); - } - } - - - } - else if (State == Helpers.MouseState.Over) - { - using (SolidBrush Background = new SolidBrush(Color.FromArgb(97, 160, 168))) - { - using (Pen Border = new Pen(Color.FromArgb(93, 154, 164))) - { - G.FillPath(Background, Helpers.RoundRect(new Rectangle(0, 0, Width - 1, Height - 1), 2)); - G.DrawPath(Border, Helpers.RoundRect(new Rectangle(0, 0, Width - 1, Height - 1), 2)); - } - } - - - } - else if (State == Helpers.MouseState.Down) - { - using (SolidBrush Background = new SolidBrush(Color.FromArgb(89, 150, 160))) - { - using (Pen Border = new Pen(Color.FromArgb(85, 146, 156))) - { - G.FillPath(Background, Helpers.RoundRect(new Rectangle(0, 0, Width - 1, Height - 1), 2)); - G.DrawPath(Border, Helpers.RoundRect(new Rectangle(0, 0, Width - 1, Height - 1), 2)); - } - } - - } - - break; - } - - - if (Scheme == Schemes.Black) - { - if (Enabled) - { - using (SolidBrush TextBrush = new SolidBrush(Color.FromArgb(220, 220, 219))) - { - using (Font TextFont = new Font("Segoe UI", 9)) - { - using (StringFormat SF = new StringFormat { Alignment = StringAlignment.Center }) - { - G.DrawString(Text, TextFont, TextBrush, new Rectangle(0, Height / 2 - 9, Width, Height), SF); - } - } - } - - - } - else - { - using (SolidBrush TextBrush = new SolidBrush(Color.FromArgb(140, 140, 139))) - { - using (Font TextFont = new Font("Segoe UI", 9)) - { - using (StringFormat SF = new StringFormat { Alignment = StringAlignment.Center }) - { - G.DrawString(Text, TextFont, TextBrush, new Rectangle(0, Height / 2 - 9, Width, Height), SF); - } - } - } - - } - - - } - else - { - if (!Enabled) - { - Scheme = Schemes.Black; - } - - using (SolidBrush TextBrush = new SolidBrush(Color.FromArgb(250, 250, 249))) - { - using (Font TextFont = new Font("Segoe UI", 9)) - { - using (StringFormat SF = new StringFormat { Alignment = StringAlignment.Center }) - { - G.DrawString(Text, TextFont, TextBrush, new Rectangle(0, Height / 2 - 9, Width, Height), SF); - } - } - } - - } - - - - } - - protected override void OnMouseEnter(EventArgs e) - { - State = Helpers.MouseState.Over; - Invalidate(); - base.OnMouseEnter(e); - } - - protected override void OnMouseLeave(EventArgs e) - { - State = Helpers.MouseState.None; - Invalidate(); - base.OnMouseLeave(e); - } - - protected override void OnMouseUp(MouseEventArgs e) - { - State = Helpers.MouseState.Over; - Invalidate(); - base.OnMouseUp(e); - } - - protected override void OnMouseDown(MouseEventArgs e) - { - State = Helpers.MouseState.Down; - Invalidate(); - base.OnMouseDown(e); - } - - } - - #endregion -} diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Button/CrEaTiiOn_PillButton.cs b/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Button/CrEaTiiOn_PillButton.cs deleted file mode 100644 index 19cc834..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Button/CrEaTiiOn_PillButton.cs +++ /dev/null @@ -1,315 +0,0 @@ -#region Imports - -using CBH_Ultimate_Theme_Library.Theme.Helpers; -using System; -using System.ComponentModel; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Windows.Forms; - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_PillButton - - [Description("Text")] - public class CrEaTiiOn_PillButton : Control, IButtonControl - { - #region Variables - int radius; - bool transparency; - MouseState state; - RoundedRectangleF roundedRect; - Color inactive1, inactive2, active1, active2; - private Color strokeColor; - private bool stroke; - - public bool Stroke - { - get { return stroke; } - set - { - stroke = value; - Invalidate(); - } - } - - public Color StrokeColor - { - get { return strokeColor; } - set - { - strokeColor = value; - Invalidate(); - } - } - #endregion - - #region AltoButton - public CrEaTiiOn_PillButton() - { - Width = 65; - Height = 30; - stroke = false; - strokeColor = Color.Gray; - inactive1 = Color.FromArgb(250, 36, 38); - inactive2 = Color.FromArgb(250, 36, 38); - active1 = Color.FromArgb(230, 16, 18); - active2 = Color.FromArgb(230, 16, 18); - - radius = 10; - roundedRect = new RoundedRectangleF(Width, Height, radius); - - SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | - ControlStyles.ResizeRedraw | ControlStyles.SupportsTransparentBackColor | - ControlStyles.UserPaint, true); - BackColor = Color.Transparent; - ForeColor = Color.White; - Font = new System.Drawing.Font("Segoe UI", 10, FontStyle.Bold); - state = MouseState.Leave; - transparency = false; - } - #endregion - - #region Events - protected override void OnPaint(PaintEventArgs e) - { - #region Transparency - if (transparency) - Transparenter.MakeTransparent(this, e.Graphics); - #endregion - - #region Drawing - e.Graphics.SmoothingMode = SmoothingMode.HighQuality; - roundedRect = new RoundedRectangleF(Width, Height, radius); - e.Graphics.FillRectangle(Brushes.Transparent, this.ClientRectangle); - - int R1 = (active1.R + inactive1.R) / 2; - int G1 = (active1.G + inactive1.G) / 2; - int B1 = (active1.B + inactive1.B) / 2; - - int R2 = (active2.R + inactive2.R) / 2; - int G2 = (active2.G + inactive2.G) / 2; - int B2 = (active2.B + inactive2.B) / 2; - - Rectangle rect = new Rectangle(0, 0, Width, Height); - - if (this.Enabled) - { - if (state == MouseState.Leave) - using (LinearGradientBrush inactiveGB = new LinearGradientBrush(rect, inactive1, inactive2, 90f)) - e.Graphics.FillPath(inactiveGB, roundedRect.Path); - else if (state == MouseState.Enter) - using (LinearGradientBrush activeGB = new LinearGradientBrush(rect, active1, active2, 90f)) - e.Graphics.FillPath(activeGB, roundedRect.Path); - else if (state == MouseState.Down) - using (LinearGradientBrush downGB = new LinearGradientBrush(rect, Color.FromArgb(R1, G1, B1), Color.FromArgb(R2, G2, B2), 90f)) - e.Graphics.FillPath(downGB, roundedRect.Path); - if (stroke) - using (Pen pen = new Pen(strokeColor, 1)) - using (GraphicsPath path = new RoundedRectangleF(Width - (radius > 0 ? 0 : 1), Height - (radius > 0 ? 0 : 1), radius).Path) - e.Graphics.DrawPath(pen, path); - } - else - { - Color linear1 = Color.FromArgb(190, 190, 190); - Color linear2 = Color.FromArgb(210, 210, 210); - using (LinearGradientBrush inactiveGB = new LinearGradientBrush(rect, linear1, linear2, 90f)) - { - e.Graphics.FillPath(inactiveGB, roundedRect.Path); - e.Graphics.DrawPath(new Pen(inactiveGB), roundedRect.Path); - } - } - - - #endregion - - #region Text Drawing - using (StringFormat sf = new StringFormat() - { - LineAlignment = StringAlignment.Center, - Alignment = StringAlignment.Center - }) - using (Brush brush = new SolidBrush(ForeColor)) - e.Graphics.DrawString(Text, Font, brush, this.ClientRectangle, sf); - #endregion - base.OnPaint(e); - } - protected override void OnMouseDoubleClick(MouseEventArgs e) - { - base.OnMouseDoubleClick(e); - base.OnClick(e); - } - protected override void OnClick(EventArgs e) - { - base.OnClick(e); - } - protected override void OnEnabledChanged(EventArgs e) - { - Invalidate(); - base.OnEnabledChanged(e); - } - protected override void OnResize(EventArgs e) - { - Invalidate(); - base.OnResize(e); - } - protected override void OnMouseEnter(EventArgs e) - { - state = MouseState.Enter; - base.OnMouseEnter(e); - Invalidate(); - } - protected override void OnMouseLeave(EventArgs e) - { - state = MouseState.Leave; - base.OnMouseLeave(e); - Invalidate(); - } - protected override void OnMouseDown(MouseEventArgs e) - { - Capture = false; - state = MouseState.Down; - base.OnMouseDown(e); - Invalidate(); - } - protected override void OnMouseUp(MouseEventArgs e) - { - if (state != MouseState.Leave) - state = MouseState.Enter; - base.OnMouseUp(e); - Invalidate(); - } - #endregion - - #region Properties - - - public int Radius - { - get - { - return radius; - } - set - { - radius = value; - Invalidate(); - } - } - public Color Inactive1 - { - get - { - return inactive1; - } - set - { - inactive1 = value; - Invalidate(); - } - } - public Color Inactive2 - { - get - { - return inactive2; - } - set - { - inactive2 = value; - Invalidate(); - } - } - public Color Active1 - { - get - { - return active1; - } - set - { - active1 = value; - Invalidate(); - } - } - public Color Active2 - { - get - { - return active2; - } - set - { - active2 = value; - Invalidate(); - } - } - public bool Transparency - { - get - { - return transparency; - } - set - { - transparency = value; - } - } - public override string Text - { - get - { - return base.Text; - } - set - { - base.Text = value; - Invalidate(); - } - } - public override Color ForeColor - { - get - { - return base.ForeColor; - } - set - { - base.ForeColor = value; - Invalidate(); - } - } - - public DialogResult DialogResult - { - get - { - return System.Windows.Forms.DialogResult.OK; - } - set - { - } - } - - public void NotifyDefault(bool value) - { - } - - public void PerformClick() - { - OnClick(EventArgs.Empty); - } - #endregion - } - public enum MouseState - { - Enter, - Leave, - Down, - Up, - } - - #endregion -} diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/CheckBox/CrEaTiiOn_CheckBox.cs b/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/CheckBox/CrEaTiiOn_CheckBox.cs deleted file mode 100644 index 8f7eb83..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/CheckBox/CrEaTiiOn_CheckBox.cs +++ /dev/null @@ -1,91 +0,0 @@ -using CBH_Ultimate_Theme_Library.Theme.Helpers; -using System.Drawing; -using System.Windows.Forms; - -namespace CBH.Controls -{ - public class CrEaTiiOn_CheckBox : CheckBox - { - private Graphics G; - public CrEaTiiOn_CheckBox() - { - DoubleBuffered = true; - Font = new Font("Segoe UI", 9); - SetStyle(ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.Opaque | ControlStyles.OptimizedDoubleBuffer, true); - } - - protected override void OnPaint(PaintEventArgs e) - { - G = e.Graphics; - - base.OnPaint(e); - - G.Clear(Parent.BackColor); - - if (Enabled) - { - using (SolidBrush Back = new SolidBrush(Color.Transparent)) - { - G.FillPath(Back, Helpers.RoundRect(new Rectangle(0, 0, 16, 16), 1)); - } - - using (Pen Border = new Pen(Color.FromArgb(250, 36, 38))) - { - G.DrawPath(Border, Helpers.RoundRect(new Rectangle(0, 0, 16, 16), 1)); - } - - using (SolidBrush TextBrush = new SolidBrush(Color.White)) - { - using (Font TextFont = new Font("Segoe UI", 9)) - { - G.DrawString(Text, TextFont, TextBrush, new Point(22, 0)); - } - } - - if (Checked) - { - using (SolidBrush TextBrush = new SolidBrush(Color.FromArgb(20, 20, 20))) - { - using (Font TextFont = new Font("Marlett", 12)) - { - G.DrawString("b", TextFont, TextBrush, new Point(-2, 1)); - } - } - - } - - } - else - { - using (SolidBrush Back = new SolidBrush(Color.FromArgb(20, 20, 20))) - { - G.FillPath(Back, Helpers.RoundRect(new Rectangle(0, 0, 16, 16), 1)); - } - - using (Pen Border = new Pen(Color.FromArgb(36, 36, 35))) - { - G.DrawPath(Border, Helpers.RoundRect(new Rectangle(0, 0, 16, 16), 1)); - } - - using (SolidBrush TextBrush = new SolidBrush(Color.FromArgb(20, 20, 20))) - { - using (Font TextFont = new Font("Segoe UI", 9)) - { - G.DrawString(Text, TextFont, TextBrush, new Point(22, 0)); - } - } - - if (Checked) - { - using (SolidBrush TextBrush = new SolidBrush(Color.FromArgb(20, 20, 20))) - { - using (Font TextFont = new Font("Marlett", 12)) - { - G.DrawString("b", TextFont, TextBrush, new Point(-2, 1)); - } - } - } - } - } - } -} diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/CheckBox/CrEaTiiOn_FlatCheckBox.cs b/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/CheckBox/CrEaTiiOn_FlatCheckBox.cs deleted file mode 100644 index 9437863..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/CheckBox/CrEaTiiOn_FlatCheckBox.cs +++ /dev/null @@ -1,176 +0,0 @@ -#region Imports - -using System; -using System.ComponentModel; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Windows.Forms; - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_FlatCheckBox - - [DefaultEvent("CheckedChanged")] - public class CrEaTiiOn_FlatCheckBox : Control - { - #region Variables - - private int X; - private bool _Enable = true; - private bool _Checked = false; - private GraphicsPath Shape; - private Color _CheckedEnabledColor = Color.FromArgb(250, 36, 38); - private Color _CheckedDisabledColor = Color.Gray; - private Color _CheckedBorderColor = Color.FromArgb(250, 36, 38); - private Color _CheckedBackColor = Color.FromArgb(20, 20, 20); - - #endregion - - #region Properties - - public bool Checked - { - get => _Checked; - set - { - _Checked = value; - CheckedChangedEvent?.Invoke(this); - Invalidate(); - } - } - - public bool Enable - { - get => _Enable; - set - { - _Enable = value; - Invalidate(); - } - } - - public Color CheckedEnabledColor - { - get => _CheckedEnabledColor; - set => _CheckedEnabledColor = value; - } - - public Color CheckedDisabledColor - { - get => _CheckedDisabledColor; - set => _CheckedDisabledColor = value; - } - - public Color CheckedBorderColor - { - get => _CheckedBorderColor; - set => _CheckedBorderColor = value; - } - - public Color CheckedBackColor - { - get => _CheckedBackColor; - set => _CheckedBackColor = value; - } - - #endregion - - #region EventArgs - - public delegate void CheckedChangedEventHandler(object sender); - private CheckedChangedEventHandler CheckedChangedEvent; - - public event CheckedChangedEventHandler CheckedChanged - { - add => CheckedChangedEvent = (CheckedChangedEventHandler)Delegate.Combine(CheckedChangedEvent, value); - remove => CheckedChangedEvent = (CheckedChangedEventHandler)Delegate.Remove(CheckedChangedEvent, value); - } - - - protected override void OnMouseMove(MouseEventArgs e) - { - base.OnMouseMove(e); - X = e.Location.X; - Invalidate(); - } - - protected override void OnMouseDown(MouseEventArgs e) - { - if (_Enable) - { - Checked = !Checked; - Focus(); - base.OnMouseDown(e); - } - } - - protected override void OnResize(EventArgs e) - { - base.OnResize(e); - - Height = 16; - - Shape = new(); - Shape.AddArc(0, 0, 10, 10, 180, 90); - Shape.AddArc(Width - 11, 0, 10, 10, -90, 90); - Shape.AddArc(Width - 11, Height - 11, 10, 10, 0, 90); - Shape.AddArc(0, Height - 11, 10, 10, 90, 90); - Shape.CloseAllFigures(); - Invalidate(); - } - - #endregion - - public CrEaTiiOn_FlatCheckBox() - { - Width = 85; - Height = 16; - Font = new("Segoe UI", 9); - DoubleBuffered = true; - Cursor = Cursors.Hand; - ForeColor = Color.White; - } - - protected override void OnPaint(PaintEventArgs e) - { - base.OnPaint(e); - Graphics G = e.Graphics; - G.Clear(BackColor); - - if (_Checked) - { - G.FillRectangle(new SolidBrush(_CheckedBorderColor), new Rectangle(0, 0, 16, 16)); - G.FillRectangle(new SolidBrush(_CheckedBackColor), new Rectangle(1, 1, 16 - 2, 16 - 2)); - } - else - { - G.FillRectangle(new SolidBrush(_CheckedBorderColor), new Rectangle(0, 0, 16, 16)); - G.FillRectangle(new SolidBrush(_CheckedBackColor), new Rectangle(1, 1, 16 - 2, 16 - 2)); - } - - if (_Enable) - { - if (_Checked) - { - G.DrawString("a", new Font("Marlett", 16), new SolidBrush(_CheckedEnabledColor), new Point(-5, -3)); - } - - Cursor = Cursors.Hand; - } - else - { - if (_Checked) - { - G.DrawString("a", new Font("Marlett", 16), new SolidBrush(_CheckedDisabledColor), new Point(-5, -3)); - } - - Cursor = Cursors.Default; - } - - G.DrawString(Text, Font, new SolidBrush(ForeColor), new Point(20, 0)); - } - } - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/CheckBox/CrEaTiiOn_LightCheckBox.cs b/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/CheckBox/CrEaTiiOn_LightCheckBox.cs deleted file mode 100644 index 1f24fef..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/CheckBox/CrEaTiiOn_LightCheckBox.cs +++ /dev/null @@ -1,186 +0,0 @@ -#region Imports -using System; -using System.Drawing.Drawing2D; -using System.ComponentModel; -using System.Drawing; -using System.Windows.Forms; -#endregion - -namespace CBH.Controls -{ - [DefaultEvent("CheckedChanged")] - public class CrEaTiiOn_LightCheckBox : Control - { - - #region "CreateRound" - private GraphicsPath CreateRoundPath; - - private Rectangle CreateRoundRectangle; - public GraphicsPath CreateRound(int x, int y, int width, int height, int slope) - { - CreateRoundRectangle = new Rectangle(x, y, width, height); - return CreateRound(CreateRoundRectangle, slope); - } - - public GraphicsPath CreateRound(Rectangle r, int slope) - { - CreateRoundPath = new GraphicsPath(FillMode.Winding); - CreateRoundPath.AddArc(r.X, r.Y, slope, slope, 180f, 90f); - CreateRoundPath.AddArc(r.Right - slope, r.Y, slope, slope, 270f, 90f); - CreateRoundPath.AddArc(r.Right - slope, r.Bottom - slope, slope, slope, 0f, 90f); - CreateRoundPath.AddArc(r.X, r.Bottom - slope, slope, slope, 90f, 90f); - CreateRoundPath.CloseFigure(); - return CreateRoundPath; - } - #endregion - - #region "Mouse states" - private MouseStates State; - private int X; - public enum MouseStates - { - None = 0, - Over = 1, - Down = 2 - } - - protected override void OnMouseEnter(EventArgs e) - { - State = MouseStates.Over; - Invalidate(); - base.OnMouseEnter(e); - } - - protected override void OnMouseLeave(EventArgs e) - { - State = MouseStates.None; - X = -1; - Invalidate(); - base.OnMouseEnter(e); - } - - protected override void OnMouseDown(MouseEventArgs e) - { - State = MouseStates.Down; - Invalidate(); - base.OnMouseDown(e); - } - - protected override void OnMouseMove(MouseEventArgs e) - { - X = e.X; - Invalidate(); - base.OnMouseMove(e); - } - - protected override void OnMouseUp(MouseEventArgs e) - { - State = MouseStates.Over; - Invalidate(); - if (e.Button == MouseButtons.Left) - { - base.OnClick(null); - _Checked = !_Checked; - Invalidate(); - } - - base.OnMouseDown(e); - } - - //Do nothing here or it fires twice - protected override void OnClick(EventArgs e) - { - } - #endregion - - #region "Properties" - - public event CheckedChangedEventHandler CheckedChanged; - public delegate void CheckedChangedEventHandler(object sender); - - private bool _Checked; - public bool Checked - { - get { return _Checked; } - set - { - _Checked = value; - if (CheckedChanged != null) - { - CheckedChanged(this); - } - Invalidate(); - } - } - - public enum SliderLocations - { - Left = 0, - Right = 1 - } - - private SliderLocations _SliderLocation = SliderLocations.Right; - public SliderLocations SliderLocation - { - get { return _SliderLocation; } - set - { - _SliderLocation = value; - Invalidate(); - } - } - - #endregion - - public CrEaTiiOn_LightCheckBox() - { - DoubleBuffered = true; - SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.SupportsTransparentBackColor, true); - Font = new Font("Segoe UI", 9); - ForeColor = Color.White; - BackColor = Color.Transparent; - Size = new Size(150, 21); - } - - protected override void OnPaint(PaintEventArgs e) - { - e.Graphics.SmoothingMode = SmoothingMode.HighQuality; - - Brush LGB = default(Brush); - - if (X >= 0 & X < 17) - { - switch (State) - { - case MouseStates.None: - LGB = new LinearGradientBrush(new Rectangle(0, 0, Width - 1, Height - 1), Color.FromArgb(20, 20, 20), Color.FromArgb(25, 25, 25), 90f); - break; - case MouseStates.Over: - LGB = new LinearGradientBrush(new Rectangle(0, 0, Width - 1, Height - 1), Color.FromArgb(20, 20, 20), Color.FromArgb(25, 25, 25), 90f); - break; - default: - LGB = new LinearGradientBrush(new Rectangle(0, 0, Width - 1, Height - 1), Color.FromArgb(20, 20, 20), Color.FromArgb(10, 10, 10), 90f); - break; - } - } - else - { - LGB = new LinearGradientBrush(new Rectangle(0, 0, Width - 1, Height - 1), Color.FromArgb(20, 20, 20), Color.FromArgb(25, 25, 25), 90f); - } - e.Graphics.FillPath(LGB, CreateRound(1, 2, 15, 15, 7)); - - if (_Checked) - { - e.Graphics.DrawString("a", new Font("Marlett", 13), Brushes.Red, new Point(-2, 1)); - } - - e.Graphics.DrawString(Text, Font, new SolidBrush(ForeColor), new Rectangle(20, 0, Width - 21, Height - 1), new StringFormat - { - Alignment = StringAlignment.Near, - LineAlignment = StringAlignment.Center, - Trimming = StringTrimming.EllipsisCharacter - }); - base.OnPaint(e); - } - } -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/CheckBox/CrEaTiiOn_MetroCheckBox5.cs b/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/CheckBox/CrEaTiiOn_MetroCheckBox5.cs deleted file mode 100644 index e1aed42..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/CheckBox/CrEaTiiOn_MetroCheckBox5.cs +++ /dev/null @@ -1,219 +0,0 @@ -#region Imports - -using System; -using System.ComponentModel; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Drawing.Text; -using System.Windows.Forms; - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_MetroCheckBox - - [DefaultEvent("CheckedChanged")] - public class CrEaTiiOn_MetroCheckBox : Control - { - - #region " Control Help - MouseState & Flicker Control" - protected override void OnTextChanged(EventArgs e) - { - base.OnTextChanged(e); - Invalidate(); - } - - private bool _Checked = false; - public bool Checked - { - get => _Checked; - set - { - _Checked = value; - CheckedChangedEvent?.Invoke(this); - Invalidate(); - } - } - - private SmoothingMode _SmoothingType = SmoothingMode.HighQuality; - public SmoothingMode SmoothingType - { - get => _SmoothingType; - set - { - _SmoothingType = value; - Invalidate(); - } - } - - private CompositingQuality _CompositingQualityType = CompositingQuality.HighQuality; - public CompositingQuality CompositingQualityType - { - get => _CompositingQualityType; - set - { - _CompositingQualityType = value; - Invalidate(); - } - } - - private TextRenderingHint _TextRenderingType = TextRenderingHint.AntiAliasGridFit; - public TextRenderingHint TextRenderingType - { - get => _TextRenderingType; - set - { - _TextRenderingType = value; - Invalidate(); - } - } - - private Color _BaseColor = Color.Transparent; - public Color BaseColor - { - get => _BaseColor; - set - { - _BaseColor = value; - Invalidate(); - } - } - - private Color _CheckedColor = Color.FromArgb(250, 36, 38); - public Color CheckedColor - { - get => _CheckedColor; - set - { - _CheckedColor = value; - Invalidate(); - } - } - - private Color _CheckBorderColorA = Color.FromArgb(20, 20, 20); - public Color CheckBorderColorA - { - get => _CheckBorderColorA; - set - { - _CheckBorderColorA = value; - Invalidate(); - } - } - - private Color _CheckBorderColorB = Color.FromArgb(20, 20, 20); - public Color CheckBorderColorB - { - get => _CheckBorderColorB; - set - { - _CheckBorderColorB = value; - Invalidate(); - } - } - - private Color _CheckBackColorA = Color.Transparent; - public Color CheckBackColorA - { - get => _CheckBackColorA; - set - { - _CheckBackColorA = value; - Invalidate(); - } - } - - private Color _CheckBackColorB = Color.Transparent; - public Color CheckBackColorB - { - get => _CheckBackColorB; - set - { - _CheckBackColorB = value; - Invalidate(); - } - } - - protected override void OnResize(EventArgs e) - { - base.OnResize(e); - Height = 14; - Invalidate(); - } - - protected override void OnMouseMove(MouseEventArgs e) - { - base.OnMouseMove(e); - Invalidate(); - } - - protected override void OnMouseDown(MouseEventArgs e) - { - Checked = !Checked; - Focus(); - base.OnMouseDown(e); - } - - public delegate void CheckedChangedEventHandler(object sender); - private CheckedChangedEventHandler CheckedChangedEvent; - - public event CheckedChangedEventHandler CheckedChanged - { - add => CheckedChangedEvent = (CheckedChangedEventHandler)Delegate.Combine(CheckedChangedEvent, value); - remove => CheckedChangedEvent = (CheckedChangedEventHandler)Delegate.Remove(CheckedChangedEvent, value); - } - #endregion - - public CrEaTiiOn_MetroCheckBox() : base() - { - SetStyle(ControlStyles.UserPaint | ControlStyles.SupportsTransparentBackColor | ControlStyles.OptimizedDoubleBuffer, true); - BackColor = Color.Transparent; - ForeColor = Color.White; - Size = new(120, 16); - DoubleBuffered = true; - Font = new("Segoe UI", 8, FontStyle.Bold); - Cursor = Cursors.Hand; - } - - protected override void OnPaint(PaintEventArgs e) - { - base.OnPaint(e); - Bitmap B = new(Width, Height); - Graphics G = Graphics.FromImage(B); - Rectangle checkBoxRectangle = new(0, 0, Height, Height - 1); - Rectangle Inner = new(1, 1, Height - 2, Height - 3); - - G.SmoothingMode = SmoothingType; - G.CompositingQuality = CompositingQualityType; - G.TextRenderingHint = TextRenderingType; - - G.Clear(BaseColor); - - LinearGradientBrush bodyGrad = new(checkBoxRectangle, CheckBackColorA, CheckBackColorB, 90); - G.FillRectangle(bodyGrad, bodyGrad.Rectangle); - G.DrawRectangle(new(CheckBorderColorA), checkBoxRectangle); - G.DrawRectangle(new(CheckBorderColorB), Inner); - - if (Checked) - { - Font t = new("Marlett", 10, FontStyle.Regular); - G.DrawString("a", t, new SolidBrush(CheckedColor), -1.5F, 0F); - } - - G.DrawString(Text, Font, new SolidBrush(ForeColor), new Point(18, 7), new StringFormat - { - Alignment = StringAlignment.Near, - LineAlignment = StringAlignment.Center - }); - - e.Graphics.DrawImage(B, 0, 0); - G.Dispose(); - B.Dispose(); - - } - - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/CheckBox/CrEaTiiOn_RoundCheckBox.cs b/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/CheckBox/CrEaTiiOn_RoundCheckBox.cs deleted file mode 100644 index 303a283..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/CheckBox/CrEaTiiOn_RoundCheckBox.cs +++ /dev/null @@ -1,75 +0,0 @@ -#region Imports -using System; -using System.Drawing.Drawing2D; -using System.ComponentModel; -using System.Drawing; -using System.Windows.Forms; -#endregion - -namespace CBH.Controls -{ - - [DefaultEvent("CheckedChanged")] - public class CrEaTiiOn_RoundCheckBox : Control - { - - public event CheckedChangedEventHandler CheckedChanged; - public delegate void CheckedChangedEventHandler(object sender); - - private bool _checked; - public bool Checked { - get { return _checked; } - set { - _checked = value; - Invalidate(); - } - } - - public CrEaTiiOn_RoundCheckBox() - { - SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.UserPaint | ControlStyles.ResizeRedraw, true); - Size = new Size(120, 17); - Font = new Font("Segoe UI", 9); - } - - protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) - { - base.OnPaint(e); - - Graphics G = e.Graphics; - G.SmoothingMode = SmoothingMode.HighQuality; - G.Clear(Parent.BackColor); - - Height = 17; - - Rectangle boxRect = new Rectangle(1, 1, Height - 3, Height - 3); - G.DrawEllipse(new Pen(Color.FromArgb(250, 36, 38), 2), boxRect); - - int textY = ((Height - 1) / 2) - Convert.ToInt32((G.MeasureString(Text, Font).Height / 2)); - G.DrawString(Text, Font, new SolidBrush(Color.FromArgb(160, 160, 160)), new Point((Height - 1) + 4, textY)); - - if (_checked) - G.DrawString("a", new Font("Marlett", 17), new SolidBrush(Color.FromArgb(120, 180, 255)), new Point(-3, -5)); - - } - - protected override void OnMouseDown(System.Windows.Forms.MouseEventArgs e) - { - base.OnMouseDown(e); - - if (_checked) { - _checked = false; - } else { - _checked = true; - } - - if (CheckedChanged != null) { - CheckedChanged(this); - } - Invalidate(); - - } - - } - -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Controller/CrEaTiiOn_DragControl.cs b/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Controller/CrEaTiiOn_DragControl.cs deleted file mode 100644 index aa7141f..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Controller/CrEaTiiOn_DragControl.cs +++ /dev/null @@ -1,38 +0,0 @@ -#region Imports -using System; -using System.ComponentModel; -using System.Runtime.InteropServices; -using System.Windows.Forms; -#endregion - -namespace CBH.Controls -{ - internal class CrEaTiiOn_DragControl : Component - { - private Control controler; - - [DllImport("user32.dll")] - private static extern int SendMessage(IntPtr o, int msg, int wParams, int IParam); - - [DllImport("user32.dll")] - public static extern bool ReleaseCapture(); - - public Control TargetControl - { - get => this.controler; - set - { - this.controler = value; - this.controler.MouseDown += new MouseEventHandler(this.Controler_MouseDown); - } - } - - private void Controler_MouseDown(object sender, MouseEventArgs e) - { - if (e.Button != MouseButtons.Left) - return; - CrEaTiiOn_DragControl.ReleaseCapture(); - CrEaTiiOn_DragControl.SendMessage(this.TargetControl.FindForm().Handle, 161, 2, 0); - } - } -} diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Controller/CrEaTiiOn_VolumeController.cs b/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Controller/CrEaTiiOn_VolumeController.cs deleted file mode 100644 index 21a96e8..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Controller/CrEaTiiOn_VolumeController.cs +++ /dev/null @@ -1,71 +0,0 @@ -#region Imports - -using System.ComponentModel; -using System.Runtime.InteropServices; - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_VolumeController - - public class CrEaTiiOn_VolumeController : Component - { - [DllImport("user32.dll")] - private static extern void keybd_event(byte bVk, byte bScan, uint dwFlags, uint dwExtraInfo); - - [DllImport("user32.dll")] - private static extern byte MapVirtualKey(uint uCode, uint uMapType); - - public void VolumeUp() - { - keybd_event(VK_VOLUME_UP, MapVirtualKey(VK_VOLUME_UP_U, KEYEVENTF_NONKEY), KEYEVENTF_EXTENDEDKEY, KEYEVENTF_NONKEY); - keybd_event(VK_VOLUME_UP, MapVirtualKey(VK_VOLUME_UP_U, KEYEVENTF_NONKEY), KEYEVENTF_TOPUP, KEYEVENTF_NONKEY); - } - - public void VolumeDown() - { - keybd_event(VK_VOLUME_DOWN, MapVirtualKey(VK_VOLUME_DOWN_U, KEYEVENTF_NONKEY), KEYEVENTF_EXTENDEDKEY, KEYEVENTF_NONKEY); - keybd_event(VK_VOLUME_DOWN, MapVirtualKey(VK_VOLUME_DOWN_U, KEYEVENTF_NONKEY), KEYEVENTF_TOPUP, KEYEVENTF_NONKEY); - } - - public void Mute() - { - keybd_event(VK_VOLUME_MUTE, MapVirtualKey(VK_VOLUME_MUTE_U, KEYEVENTF_NONKEY), KEYEVENTF_EXTENDEDKEY, KEYEVENTF_NONKEY); - keybd_event(VK_VOLUME_MUTE, MapVirtualKey(VK_VOLUME_MUTE_U, KEYEVENTF_NONKEY), KEYEVENTF_TOPUP, KEYEVENTF_NONKEY); - } - - public void SetVolume(int value) - { - for (int num = 0; num != 50; num++) - { - keybd_event(VK_VOLUME_DOWN, MapVirtualKey(VK_VOLUME_DOWN_U, KEYEVENTF_NONKEY), KEYEVENTF_EXTENDEDKEY, KEYEVENTF_NONKEY); - keybd_event(VK_VOLUME_DOWN, MapVirtualKey(VK_VOLUME_DOWN_U, KEYEVENTF_NONKEY), KEYEVENTF_TOPUP, KEYEVENTF_NONKEY); - } - if (value > 0) - { - for (int num = 0; num != value / 2; num++) - { - keybd_event(VK_VOLUME_UP, MapVirtualKey(VK_VOLUME_UP_U, KEYEVENTF_NONKEY), KEYEVENTF_EXTENDEDKEY, KEYEVENTF_NONKEY); - keybd_event(VK_VOLUME_UP, MapVirtualKey(VK_VOLUME_UP_U, KEYEVENTF_NONKEY), KEYEVENTF_TOPUP, KEYEVENTF_NONKEY); - } - } - } - - private const byte VK_VOLUME_MUTE = 173; - private const uint VK_VOLUME_MUTE_U = 173U; - - private const byte VK_VOLUME_DOWN = 174; - private const uint VK_VOLUME_DOWN_U = 174U; - - private const byte VK_VOLUME_UP = 175; - private const uint VK_VOLUME_UP_U = 175U; - - private const uint KEYEVENTF_NONKEY = 0U; - private const uint KEYEVENTF_EXTENDEDKEY = 1U; - private const uint KEYEVENTF_KEYUP = 2U; - private const uint KEYEVENTF_TOPUP = 3U; - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/DatePicker/CrEaTiiOn_DatePicker.cs b/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/DatePicker/CrEaTiiOn_DatePicker.cs deleted file mode 100644 index af98b41..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/DatePicker/CrEaTiiOn_DatePicker.cs +++ /dev/null @@ -1,314 +0,0 @@ -#region Imports -using CBH_Ultimate_Theme_Library.Theme.Helpers; -using System; -using System.Collections.Generic; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Drawing.Text; -using System.Windows.Forms; -#endregion - -namespace CBH.Controls -{ - public partial class CrEaTiiOn_DatePicker : Control - { - public new Color BackColor { get { return ThemeColors.PrimaryColor; } set { } } - - private RectangleF TopDateRect;//顶部日期区域 - private RectangleF WeekRect;//显示星期区域 - - private List> DateRectangles;//显示日期区域 - - private RectangleF PreviousMonthRect;//上一月区域 - private RectangleF NextMonthRect;//下一月区域 - private RectangleF PreviousYearRect;//上一年区域 - private RectangleF NextYearRect;//下一年区域 - - private DateTime CurrentDate; - public DateTime Date { get { return CurrentDate; } set { CurrentDate = value; Invalidate(); } } - - - private int DateRectDefaultSize; - private int HoverX; - private int HoverY; - private int SelectedX; - private int SelectedY; - - private bool previousYearHovered; - private bool previousMonthHovered; - private bool nextMonthHovered; - private bool nextYearHovered; - - #region 事件 - public delegate void DateChanged(DateTime newDateTime); - public event DateChanged onDateChanged; - #endregion - - #region 重写事件 - protected override void OnMouseMove(MouseEventArgs e) - { - base.OnMouseMove(e); - - for (int i = 0; i < 7; i++) - { - for (int j = 0; j < 7; j++) - { - if (DateRectangles[i][j].Drawn) - { - if (DateRectangles[i][j].Rect.Contains(e.Location)) - { - if (HoverX != i || HoverY != j) - { - HoverX = i; - previousYearHovered = false; - nextYearHovered = false; - HoverY = j; - Invalidate(); - } - return; - } - } - } - } - - if (PreviousYearRect.Contains(e.Location)) - { - previousYearHovered = true; - HoverX = -1; - Invalidate(); - return; - } - if (PreviousMonthRect.Contains(e.Location)) - { - previousMonthHovered = true; - HoverX = -1; - Invalidate(); - return; - } - if (NextMonthRect.Contains(e.Location)) - { - nextMonthHovered = true; - HoverX = -1; - Invalidate(); - return; - } - if (NextYearRect.Contains(e.Location)) - { - nextYearHovered = true; - HoverX = -1; - Invalidate(); - return; - } - if (HoverX >= 0 || previousYearHovered || previousMonthHovered || nextMonthHovered || nextYearHovered) - { - HoverX = -1; - previousYearHovered = false; - previousMonthHovered = false; - nextMonthHovered = false; - nextYearHovered = false; - Invalidate(); - } - } - - protected override void OnMouseUp(MouseEventArgs e) - { - if (HoverX >= 0) - { - SelectedX = HoverX; - SelectedY = HoverY; - CurrentDate = DateRectangles[SelectedX][SelectedY].Date; - Invalidate(); - if (onDateChanged != null) - { - onDateChanged(CurrentDate); - } - return; - } - - if (PreviousYearRect.Contains(e.Location)) - CurrentDate = FirstDayOfMonth(CurrentDate.AddYears(-1)); - if (PreviousMonthRect.Contains(e.Location)) - CurrentDate = FirstDayOfMonth(CurrentDate.AddMonths(-1)); - if (NextMonthRect.Contains(e.Location)) - CurrentDate = FirstDayOfMonth(CurrentDate.AddMonths(1)); - if (NextYearRect.Contains(e.Location)) - CurrentDate = FirstDayOfMonth(CurrentDate.AddYears(1)); - CalculateRectangles(); - Invalidate(); - if (onDateChanged != null) - { - onDateChanged(CurrentDate); - } - base.OnMouseUp(e); - } - - protected override void OnMouseLeave(EventArgs e) - { - HoverX = -1; - HoverY = -1; - previousYearHovered = false; - previousMonthHovered = false; - nextMonthHovered = false; - nextYearHovered = false; - Invalidate(); - base.OnMouseLeave(e); - } - - #endregion - - private void CalculateRectangles() - { - //日期位置List - DateRectangles = new List>(); - for (int i = 0; i < 7; i++) - { - DateRectangles.Add(new List()); - for (int j = 0; j < 7; j++) - { - DateRectangles[i].Add(new DateRect(new RectangleF(10 + (j * (Width - 20) / 7), WeekRect.Y + WeekRect.Height + (i * DateRectDefaultSize), DateRectDefaultSize, DateRectDefaultSize))); - } - } - DateTime FirstDay = FirstDayOfMonth(CurrentDate); - var temp = 0; - for (int i = FirstDay.DayOfWeek == DayOfWeek.Sunday ? 6 : (int)FirstDay.DayOfWeek - 1; i > 0; i--, temp++) - { - DateRectangles[temp / 7][temp % 7].Drawn = false; - DateRectangles[temp / 7][temp % 7].Date = FirstDay.AddDays(0 - i); - } - for (DateTime date = FirstDay; date <= LastDayOfMonth(CurrentDate); date = date.AddDays(1), temp++) - { - if (date.DayOfYear == CurrentDate.DayOfYear && date.Year == CurrentDate.Year) - { - SelectedX = temp / 7; - SelectedY = temp % 7; - } - DateRectangles[temp / 7][temp % 7].Drawn = true; - DateRectangles[temp / 7][temp % 7].Date = date; - } - DateTime LastDay = LastDayOfMonth(CurrentDate); - for (int i = 0; temp < 42; i++, temp++) - { - DateRectangles[temp / 7][temp % 7].Drawn = false; - DateRectangles[temp / 7][temp % 7].Date = LastDay.AddDays(i + 1); - } - } - - - protected override void OnResize(EventArgs e) - { - Width = 250; - Height = 270; - } - - public CrEaTiiOn_DatePicker() - { - SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.OptimizedDoubleBuffer, true); - DoubleBuffered = true; - Width = 250; - Height = 260; - - DateRectDefaultSize = (Width - 20) / 7; - TopDateRect = new RectangleF(20, 5, Width - 40, DateRectDefaultSize); - WeekRect = new RectangleF(0, TopDateRect.Y + TopDateRect.Height, DateRectDefaultSize, DateRectDefaultSize); - - PreviousYearRect = new RectangleF(10, TopDateRect.Y, 20, DateRectDefaultSize); - PreviousMonthRect = new RectangleF(35, TopDateRect.Y + 1, 20, DateRectDefaultSize); - NextMonthRect = new RectangleF(Width - 55, TopDateRect.Y + 1, 20, DateRectDefaultSize); - NextYearRect = new RectangleF(Width - 30, TopDateRect.Y, 20, DateRectDefaultSize); - - CurrentDate = DateTime.Now; - - HoverX = -1; - HoverY = -1; - CalculateRectangles(); - } - - protected override void OnPaint(PaintEventArgs e) - { - base.OnPaint(e); - - var graphics = e.Graphics; - graphics.PixelOffsetMode = PixelOffsetMode.HighQuality; - graphics.SmoothingMode = SmoothingMode.HighQuality; - graphics.TextRenderingHint = TextRenderingHint.ClearTypeGridFit; - graphics.Clear(Parent.BackColor); - - //绘制背景边框 - var bg = DrawHelper.CreateRoundRect(1f, 1f, Width - 2, Height - 2, 3); - graphics.FillPath(new SolidBrush(Color.FromArgb(20, 20, 20)), bg); - graphics.DrawPath(new Pen(ThemeColors.OneLevelBorder), bg); - - //绘制年月 - graphics.DrawString(string.Format("{0}年{1,2}月", CurrentDate.Year, CurrentDate.Month), new Font("微软雅黑", 12f), new SolidBrush(ThemeColors.MainText), TopDateRect, StringAlign.Center); - //绘制年月选择区域 - graphics.DrawString("7", new Font("Segoe UI", 12f), new SolidBrush(previousYearHovered ? ThemeColors.PrimaryColor : ThemeColors.PlaceholderText), PreviousYearRect, StringAlign.Center); - graphics.DrawString("3", new Font("Segoe UI", 12f), new SolidBrush(previousMonthHovered ? ThemeColors.PrimaryColor : ThemeColors.PlaceholderText), PreviousMonthRect, StringAlign.Center); - graphics.DrawString("4", new Font("Segoe UI", 12f), new SolidBrush(nextMonthHovered ? ThemeColors.PrimaryColor : ThemeColors.PlaceholderText), NextMonthRect, StringAlign.Center); - graphics.DrawString("8", new Font("Segoe UI", 12f), new SolidBrush(nextYearHovered ? ThemeColors.PrimaryColor : ThemeColors.PlaceholderText), NextYearRect, StringAlign.Center); - - //绘制星期 - string s = "一二三四五六日"; - for (int i = 0; i < 7; i++) - { - graphics.DrawString(s[i].ToString(), new Font("微软雅黑", 10f), new SolidBrush(ThemeColors.RegularText), new RectangleF(10 + i * (Width - 20) / 7, WeekRect.Y, WeekRect.Width, WeekRect.Height), StringAlign.Center); - } - - //绘制分割线 - graphics.DrawLine(new Pen(ThemeColors.TwoLevelBorder, 0.5f), 10, WeekRect.Y + WeekRect.Height, Width - 10, WeekRect.Y + WeekRect.Height); - - //绘制日期 - DateTime FirstDay = FirstDayOfMonth(CurrentDate); - for (int i = 0; i < 42; i++) - { - var tempDate = DateRectangles[i / 7][i % 7]; - var brush = new SolidBrush(ThemeColors.MainText); - //突出显示鼠标所指 - if (HoverX == i / 7 && HoverY == i % 7) - { - var rect1 = tempDate.Rect; - var bg1 = DrawHelper.CreateRoundRect(rect1.X + 2, rect1.Y + 2, rect1.Width - 4, rect1.Width - 4, 3); - graphics.FillPath(new SolidBrush(ThemeColors.ThreeLevelBorder), bg1); - //graphics.FillRectangle(new SolidBrush(ThemeColors.ThreeLevelBorder), new RectangleF(rect1.X + 3, rect1.Y + 3, rect1.Width - 6, rect1.Width - 6)); - } - //突出显示今天 - if (tempDate.Date == DateTime.Today) - { - brush = new SolidBrush(ThemeColors.DarkPrimary); - } - //突出显示所选日期 - if (tempDate.Date == Date) - { - var rect1 = tempDate.Rect; - var bg1 = DrawHelper.CreateRoundRect(rect1.X + 2, rect1.Y + 2, rect1.Width - 4, rect1.Width - 4, 3); - graphics.FillPath(new SolidBrush(ThemeColors.PrimaryColor), bg1); - - //graphics.FillRectangle(new SolidBrush(ThemeColors.PrimaryColor), new RectangleF(rect1.X+3,rect1.Y+3,rect1.Width-6,rect1.Width-6)); - brush = new SolidBrush(Color.White); - } - graphics.DrawString(DateRectangles[i / 7][i % 7].Date.Day.ToString(), Font, DateRectangles[i / 7][i % 7].Drawn ? brush : new SolidBrush(ThemeColors.SecondaryText), DateRectangles[i / 7][i % 7].Rect, StringAlign.Center); - } - } - - public DateTime FirstDayOfMonth(DateTime value) - { - return new DateTime(value.Year, value.Month, 1); - } - - public DateTime LastDayOfMonth(DateTime value) - { - return new DateTime(value.Year, value.Month, DateTime.DaysInMonth(value.Year, value.Month)); - } - - private class DateRect - { - public RectangleF Rect; - public bool Drawn = false; - public DateTime Date; - - public DateRect(RectangleF pRect) - { - Rect = pRect; - } - } - } -} diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/DropDown/CrEaTiiOn_ClasicDropdownMenu.cs b/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/DropDown/CrEaTiiOn_ClasicDropdownMenu.cs deleted file mode 100644 index 86d14ec..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/DropDown/CrEaTiiOn_ClasicDropdownMenu.cs +++ /dev/null @@ -1,90 +0,0 @@ -#region Imports -using System; -using System.ComponentModel; -using System.Drawing; -using System.Windows.Forms; -using System.Windows.Forms.Layout; -#endregion - -namespace CBH.Controls -{ - public class CrEaTiiOn_ClasicDropdownMenu : CrEaTiiOn_ContextMenuStrip - { - private bool isMainMenu; - private int menuItemHeight = 25; - private Color menuItemTextColor = Color.Empty; - private Color primaryColor = Color.FromArgb(20, 20, 20); - private Bitmap menuItemHeaderSize; - - public CrEaTiiOn_ClasicDropdownMenu(IContainer container) - : base(container) - { - } - - [Browsable(false)] - public bool IsMainMenu - { - get => this.isMainMenu; - set => this.isMainMenu = value; - } - - [Browsable(false)] - public int MenuItemHeight - { - get => this.menuItemHeight; - set => this.menuItemHeight = value; - } - - [Browsable(false)] - public Color MenuItemTextColor - { - get => this.menuItemTextColor; - set => this.menuItemTextColor = value; - } - - [Browsable(false)] - public Color PrimaryColor - { - get => this.primaryColor; - set => this.primaryColor = value; - } - - private void LoadMenuItemHeight() - { - this.menuItemHeaderSize = !this.isMainMenu ? new Bitmap(20, this.menuItemHeight) : new Bitmap(25, 45); - foreach (ToolStripMenuItem toolStripMenuItem in (ArrangedElementCollection)this.Items) - { - toolStripMenuItem.ImageScaling = ToolStripItemImageScaling.None; - if (toolStripMenuItem.Image == null) - toolStripMenuItem.Image = (Image)this.menuItemHeaderSize; - foreach (ToolStripMenuItem dropDownItem1 in (ArrangedElementCollection)toolStripMenuItem.DropDownItems) - { - dropDownItem1.ImageScaling = ToolStripItemImageScaling.None; - if (dropDownItem1.Image == null) - dropDownItem1.Image = (Image)this.menuItemHeaderSize; - foreach (ToolStripMenuItem dropDownItem2 in (ArrangedElementCollection)dropDownItem1.DropDownItems) - { - dropDownItem2.ImageScaling = ToolStripItemImageScaling.None; - if (dropDownItem2.Image == null) - dropDownItem2.Image = (Image)this.menuItemHeaderSize; - foreach (ToolStripMenuItem dropDownItem3 in (ArrangedElementCollection)dropDownItem2.DropDownItems) - { - dropDownItem3.ImageScaling = ToolStripItemImageScaling.None; - if (dropDownItem3.Image == null) - dropDownItem3.Image = (Image)this.menuItemHeaderSize; - } - } - } - } - } - - protected override void OnHandleCreated(EventArgs e) - { - base.OnHandleCreated(e); - if (this.DesignMode) - return; - this.Renderer = (ToolStripRenderer)new MenuRenderer(this.isMainMenu, this.primaryColor, this.menuItemTextColor); - this.LoadMenuItemHeight(); - } - } -} diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/DropDown/CrEaTiiOn_DropdownMenu.cs b/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/DropDown/CrEaTiiOn_DropdownMenu.cs deleted file mode 100644 index fefe2dd..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/DropDown/CrEaTiiOn_DropdownMenu.cs +++ /dev/null @@ -1,103 +0,0 @@ -#region Imports -using System; -using System.ComponentModel; -using System.Drawing; -using System.Windows.Forms; -#endregion - -namespace CBH.Controls -{ - public class CrEaTiiOn_DropdownMenu : CrEaTiiOn_ContextMenuStrip - { - //Fields - private bool isMainMenu; - private int menuItemHeight = 25; - private Color menuItemTextColor = Color.Empty;//No color, The default color is set in the MenuRenderer class - private Color primaryColor = Color.Empty;//No color, The default color is set in the MenuRenderer class - - private Bitmap menuItemHeaderSize; - - //Constructor - public CrEaTiiOn_DropdownMenu(IContainer container) - : base(container) - { - - } - - //Properties - //Optionally, hide the properties in the toolbox to avoid the problem of displaying and/or - //saving control property changes in the designer at design time in Visual Studio. - //If the problem I mention does not occur you can expose the properties and manipulate them from the toolbox. - [Browsable(false)] - public bool IsMainMenu - { - get { return isMainMenu; } - set { isMainMenu = value; } - } - - [Browsable(false)] - public int MenuItemHeight - { - get { return menuItemHeight; } - set { menuItemHeight = value; } - } - - [Browsable(false)] - public Color MenuItemTextColor - { - get { return menuItemTextColor; } - set { menuItemTextColor = value; } - } - - [Browsable(false)] - public Color PrimaryColor - { - get { return primaryColor; } - set { primaryColor = value; } - } - - //Private methods - private void LoadMenuItemHeight() - { - if (isMainMenu) - menuItemHeaderSize = new Bitmap(25, 45); - else menuItemHeaderSize = new Bitmap(20, menuItemHeight); - - foreach (ToolStripMenuItem menuItemL1 in this.Items) - { - menuItemL1.ImageScaling = ToolStripItemImageScaling.None; - if (menuItemL1.Image == null) menuItemL1.Image = menuItemHeaderSize; - - foreach (ToolStripMenuItem menuItemL2 in menuItemL1.DropDownItems) - { - menuItemL2.ImageScaling = ToolStripItemImageScaling.None; - if (menuItemL2.Image == null) menuItemL2.Image = menuItemHeaderSize; - - foreach (ToolStripMenuItem menuItemL3 in menuItemL2.DropDownItems) - { - menuItemL3.ImageScaling = ToolStripItemImageScaling.None; - if (menuItemL3.Image == null) menuItemL3.Image = menuItemHeaderSize; - - foreach (ToolStripMenuItem menuItemL4 in menuItemL3.DropDownItems) - { - menuItemL4.ImageScaling = ToolStripItemImageScaling.None; - if (menuItemL4.Image == null) menuItemL4.Image = menuItemHeaderSize; - ///Level 5++ - } - } - } - } - } - - //Overrides - protected override void OnHandleCreated(EventArgs e) - { - base.OnHandleCreated(e); - if (this.DesignMode == false) - { - this.Renderer = new MenuRenderer(isMainMenu, primaryColor, menuItemTextColor); - LoadMenuItemHeight(); - } - } - } -} diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Ellipse/CrEaTiiOn_Ellipse.cs b/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Ellipse/CrEaTiiOn_Ellipse.cs deleted file mode 100644 index 589b331..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Ellipse/CrEaTiiOn_Ellipse.cs +++ /dev/null @@ -1,47 +0,0 @@ -#region Imports -using System; -using System.ComponentModel; -using System.Drawing; -using System.Runtime.InteropServices; -using System.Windows.Forms; -#endregion - -namespace CBH.Controls -{ - public class CrEaTiiOn_Ellipse : Component - { - private Control control; - private int cornerRadius = 6; - - [DllImport("gdi32.dll")] - private static extern IntPtr CreateRoundRectRgn( - int nL, - int nT, - int nR, - int nB, - int nWidthEllipse, - int nHeightEllipse); - - public Control TargetControl - { - get => this.control; - set - { - this.control = value; - this.control.SizeChanged += (EventHandler)((sender, eventArgs) => this.control.Region = Region.FromHrgn(CrEaTiiOn_Ellipse.CreateRoundRectRgn(0, 0, this.control.Width, this.control.Height, this.cornerRadius, this.cornerRadius))); - } - } - - public int CornerRadius - { - get => this.cornerRadius; - set - { - this.cornerRadius = value; - if (this.control == null) - return; - this.control.Region = Region.FromHrgn(CrEaTiiOn_Ellipse.CreateRoundRectRgn(0, 0, this.control.Width, this.control.Height, this.cornerRadius, this.cornerRadius)); - } - } - } -} diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Ellipse/CrEaTiiOn_ObjectEllipse.cs b/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Ellipse/CrEaTiiOn_ObjectEllipse.cs deleted file mode 100644 index 1ff13be..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Ellipse/CrEaTiiOn_ObjectEllipse.cs +++ /dev/null @@ -1,241 +0,0 @@ -#region Imports - -using System; -using System.ComponentModel; -using System.ComponentModel.Design; -using System.Drawing; -using System.Runtime.InteropServices; -using System.Windows.Forms; - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_ObjectEllipse - - public class CrEaTiiOn_ObjectEllipse : Component - { - public CrEaTiiOn_ObjectEllipse() - { - UpdateControl(); - UpdateForm(); - } - - public override ISite Site - { - get => base.Site; - set - { - base.Site = value; - - if (value == null) - { - return; - } - - IDesignerHost designerHost = value.GetService(typeof(IDesignerHost)) as IDesignerHost; - - if (designerHost != null) - { - IComponent rootComponent = designerHost.RootComponent; - - if (rootComponent is ContainerControl && rootComponent is not Form) - { - effectedControl = rootComponent as ContainerControl; - - DefaultControl = rootComponent as ContainerControl; - - if (DefaultControl != null) - { - DefaultControlRegion = DefaultControl.Region; - } - } - - if (rootComponent is Form) - { - effectedForm = rootComponent as Form; - - DefaultForm = rootComponent as Form; - - if (DefaultForm != null) - { - DefaultFormRegion = DefaultForm.Region; - DefaultStyle = DefaultForm.FormBorderStyle; - } - } - } - } - } - - private void SetCustomRegion() - { - if (effectedControl != null) - { - effectedControl.Region = Region.FromHrgn(CreateRoundRectRgn(0, 0, effectedControl.Width, effectedControl.Height, cornerRadius, cornerRadius)); - effectedControl.SizeChanged += Container_SizeChanged; - } - - if (effectedForm != null) - { - effectedForm.FormBorderStyle = FormBorderStyle.None; - - effectedForm.Region = Region.FromHrgn(CreateRoundRectRgn(0, 0, effectedForm.Width, effectedForm.Height, cornerRadius, cornerRadius)); - effectedForm.SizeChanged += Container_SizeChanged; - } - } - - private void UpdateControl() - { - if (DefaultControl != null) - { - DefaultControl.Region = DefaultControlRegion; - } - - if (effectedControl != null) - { - DefaultControl = effectedControl; - - DefaultControlRegion = effectedControl.Region; - - SetCustomRegion(); - } - } - - private void UpdateForm() - { - if (DefaultForm != null) - { - DefaultForm.FormBorderStyle = DefaultStyle; - - DefaultForm.Region = DefaultFormRegion; - } - - if (effectedForm != null) - { - DefaultForm = effectedForm; - - DefaultFormRegion = effectedForm.Region; - - DefaultStyle = effectedForm.FormBorderStyle; - - SetCustomRegion(); - } - } - - protected override void Dispose(bool disposing) - { - base.Dispose(disposing); - - if (effectedControl != null) - { - effectedControl.Region = DefaultControlRegion; - } - - if (effectedForm != null) - { - effectedForm.FormBorderStyle = DefaultStyle; - - effectedForm.Region = DefaultFormRegion; - } - } - - private void Container_SizeChanged(object sender, EventArgs e) - { - if (effectedControl != null) - { - effectedControl.Region = Region.FromHrgn(CreateRoundRectRgn(0, 0, effectedControl.Width, effectedControl.Height, cornerRadius, cornerRadius)); - } - - if (effectedForm != null) - { - effectedForm.Region = Region.FromHrgn(CreateRoundRectRgn(0, 0, effectedForm.Width, effectedForm.Height, cornerRadius, cornerRadius)); - } - } - - [Category("Parrot")] - [Browsable(true)] - [Description("The corner radius")] - public int CornerRadius - { - get => cornerRadius; - set - { - cornerRadius = value; - SetCustomRegion(); - } - } - - [Category("Parrot")] - [Browsable(true)] - [Description("The effected control")] - public Control EffectedControl - { - get - { - if (effectedControl != null) - { - return effectedControl; - } - else - { - return null; - } - } - set - { - if (value != EffectedForm || value == null) - { - effectedControl = value; - UpdateControl(); - } - } - } - - [Category("Parrot")] - [Browsable(true)] - [Description("The effected form(will remove ellipse from effected control)")] - public Form EffectedForm - { - get - { - if (effectedForm != null) - { - return effectedForm; - } - else - { - return null; - } - } - set - { - if (value != EffectedControl || value == null) - { - effectedForm = value; - UpdateForm(); - } - } - } - - [DllImport("Gdi32.dll")] - private static extern IntPtr CreateRoundRectRgn(int nLeftRect, int nTopRect, int nRightRect, int nBottomRect, int nWidthEllipse, int nHeightEllipse); - - private Control DefaultControl = null; - - private Form DefaultForm = null; - - private FormBorderStyle DefaultStyle; - - private Region DefaultControlRegion = null; - - private Region DefaultFormRegion = null; - - private int cornerRadius = 10; - - private Control effectedControl = null; - - private Form effectedForm = null; - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/GroupBox/CrEaTiiOn_FlatGroupBox.cs b/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/GroupBox/CrEaTiiOn_FlatGroupBox.cs deleted file mode 100644 index e3d5a53..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/GroupBox/CrEaTiiOn_FlatGroupBox.cs +++ /dev/null @@ -1,52 +0,0 @@ -#region Imports -using CBH_Ultimate_Theme_Library.Theme.Helpers; -using System.ComponentModel; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Drawing.Text; -using System.Windows.Forms; -#endregion - -namespace CBH.Controls -{ - public class CrEaTiiOn_FlatGroupBox : GroupBox - { - #region 属性 - - [RefreshProperties(RefreshProperties.Repaint)] - public Color ThemeColor { get; set; } = ThemeColors.PrimaryColor; - - [Description("是否显示控件文本")] - [RefreshProperties(RefreshProperties.Repaint)] - public bool ShowText { get; set; } = false; - - #endregion - - protected override void OnPaint(PaintEventArgs e) - { - base.OnPaint(e); - Graphics graphics = e.Graphics; - graphics.SmoothingMode = SmoothingMode.HighQuality;//消除锯齿 - graphics.PixelOffsetMode = PixelOffsetMode.HighQuality;//高质量显示 - graphics.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;//最高质量显示文本 - graphics.Clear(Parent.BackColor); - - var BG = DrawHelper.CreateRoundRect(1, 1, Width - 2, Height - 2, 3); - graphics.FillPath(new SolidBrush(BackColor), BG); - graphics.DrawPath(new Pen(ThemeColors.OneLevelBorder), BG); - - if (ShowText) - { - graphics.DrawLine(new Pen(ThemeColors.OneLevelBorder, 1), 0, 38, Width, 38); - graphics.DrawString(Text, new Font("Segoe UI", 12F), new SolidBrush(ThemeColors.MainText), new RectangleF(15, 0, Width - 50, 38), StringAlign.Left); - } - } - - public CrEaTiiOn_FlatGroupBox() - { - SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.OptimizedDoubleBuffer, true); - DoubleBuffered = true; - Font = new Font("Segoe UI", 12); - } - } -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Handle/CrEaTiiOn_FormHandle.cs b/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Handle/CrEaTiiOn_FormHandle.cs deleted file mode 100644 index 7087412..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Handle/CrEaTiiOn_FormHandle.cs +++ /dev/null @@ -1,72 +0,0 @@ -#region Imports - -using System; -using System.ComponentModel; -using System.Runtime.InteropServices; -using System.Windows.Forms; - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_FormHandle - - public class CrEaTiiOn_FormHandle : Component - { - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The handleControl")] - public Control HandleControl - { - get => handleControl; - set - { - handleControl = value; - handleControl.MouseDown += DragForm_MouseDown; - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("Maximize when dragged to top")] - public bool DockAtTop - { - get => dockAtTop; - set => dockAtTop = value; - } - - [DllImport("user32.dll")] - public static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam); - - [DllImport("user32.dll")] - public static extern bool ReleaseCapture(); - - private void DragForm_MouseDown(object sender, MouseEventArgs e) - { - if (e.Button == MouseButtons.Left) - { - ReleaseCapture(); - SendMessage(HandleControl.FindForm().Handle, 161, 2, 0); - if (dockAtTop && handleControl.FindForm().FormBorderStyle == FormBorderStyle.None) - { - if (HandleControl.FindForm().WindowState != FormWindowState.Maximized && Cursor.Position.Y <= 3) - { - HandleControl.FindForm().WindowState = FormWindowState.Maximized; - return; - } - HandleControl.FindForm().WindowState = FormWindowState.Normal; - } - } - } - - private Control handleControl; - - private bool dockAtTop = true; - - public const int WM_NCLBUTTONDOWN = 161; - - public const int HT_CAPTION = 2; - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Icon/CrEaTiiOn_InfoIcon.cs b/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Icon/CrEaTiiOn_InfoIcon.cs deleted file mode 100644 index d6dfeb5..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Icon/CrEaTiiOn_InfoIcon.cs +++ /dev/null @@ -1,68 +0,0 @@ -#region Imports - -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Drawing.Text; -using System.Windows.Forms; - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_InfoIcon - - public class CrEaTiiOn_InfoIcon : Control - { - #region Settings - - private Color _BaseColor = Color.FromArgb(246, 246, 246); - public Color BaseColor - { - get => _BaseColor; - set => _BaseColor = value; - } - - private Color _CircleColor = Color.Gray; - public Color CircleColor - { - get => _CircleColor; - set => _CircleColor = value; - } - - private string _String = "¡"; - public string String - { - get => _String; - set => _String = value; - } - - #endregion - - public CrEaTiiOn_InfoIcon() - { - ForeColor = Color.DimGray; - BackColor = Color.FromArgb(20, 20, 20); - ForeColor = Color.White; - Font = new("Segoe UI", 25, FontStyle.Bold); - Size = new(33, 33); - DoubleBuffered = true; - } - - protected override void OnPaint(PaintEventArgs e) - { - e.Graphics.SmoothingMode = SmoothingMode.HighQuality; - e.Graphics.TextRenderingHint = TextRenderingHint.ClearTypeGridFit; - - e.Graphics.FillEllipse(new SolidBrush(_CircleColor), new Rectangle(1, 1, 29, 29)); - e.Graphics.FillEllipse(new SolidBrush(_BaseColor), new Rectangle(3, 3, 25, 25)); - - e.Graphics.DrawString(_String, Font, new SolidBrush(ForeColor), new Rectangle(4, -14, Width, 43), new StringFormat - { - Alignment = StringAlignment.Near, - LineAlignment = StringAlignment.Near - }); - } - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Icon/CrEaTiiOn_TickIcon.cs b/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Icon/CrEaTiiOn_TickIcon.cs deleted file mode 100644 index a594131..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Icon/CrEaTiiOn_TickIcon.cs +++ /dev/null @@ -1,68 +0,0 @@ -#region Imports - -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Drawing.Text; -using System.Windows.Forms; - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_TickIcon - - public class CrEaTiiOn_TickIcon : Control - { - #region Settings - - private Color _BaseColor = Color.FromArgb(246, 246, 246); - public Color BaseColor - { - get => _BaseColor; - set => _BaseColor = value; - } - - private Color _CircleColor = Color.Gray; - public Color CircleColor - { - get => _CircleColor; - set => _CircleColor = value; - } - - private string _String = "ü"; - public string String - { - get => _String; - set => _String = value; - } - - #endregion - - public CrEaTiiOn_TickIcon() - { - ForeColor = Color.White; - BackColor = Color.Transparent; - ForeColor = Color.Gray; - Font = new("Wingdings", 25, FontStyle.Bold); - Size = new(33, 33); - DoubleBuffered = true; - } - - protected override void OnPaint(PaintEventArgs e) - { - e.Graphics.SmoothingMode = SmoothingMode.HighQuality; - e.Graphics.TextRenderingHint = TextRenderingHint.ClearTypeGridFit; - - e.Graphics.FillEllipse(new SolidBrush(_CircleColor), new Rectangle(1, 1, 29, 29)); - e.Graphics.FillEllipse(new SolidBrush(_BaseColor), new Rectangle(3, 3, 25, 25)); - - e.Graphics.DrawString(_String, Font, new SolidBrush(ForeColor), new Rectangle(0, -3, Width, 43), new StringFormat - { - Alignment = StringAlignment.Near, - LineAlignment = StringAlignment.Near - }); - } - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Label/CrEaTiiOn_ClasicHeaderLabel.cs b/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Label/CrEaTiiOn_ClasicHeaderLabel.cs deleted file mode 100644 index 2b7904c..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Label/CrEaTiiOn_ClasicHeaderLabel.cs +++ /dev/null @@ -1,24 +0,0 @@ -#region Imports - - -#endregion - -using System.Drawing; - -namespace CBH.Controls -{ - #region CrEaTiiOn_ClasicHeaderLabel - - public class CrEaTiiOn_ClasicHeaderLabel : System.Windows.Forms.Label - { - - public CrEaTiiOn_ClasicHeaderLabel() - { - Font = new("Segoe UI", 11, FontStyle.Bold); - ForeColor = Color.White; - BackColor = Color.Transparent; - } - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Label/CrEaTiiOn_ClasicLabel.cs b/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Label/CrEaTiiOn_ClasicLabel.cs deleted file mode 100644 index 3fdf29c..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Label/CrEaTiiOn_ClasicLabel.cs +++ /dev/null @@ -1,30 +0,0 @@ -#region Imports - - -#endregion - -using System.Drawing; -using System.Windows.Forms; - -namespace CBH.Controls -{ - #region Label5 - - public class CrEaTiiOn_ClasicLabel : System.Windows.Forms.Label - { - public CrEaTiiOn_ClasicLabel() - { - Font = new("Segoe UI", 9, FontStyle.Regular); - BackColor = Color.Transparent; - ForeColor = ColorTranslator.FromHtml("#FFFFFF"); - } - - protected override void OnMouseDown(MouseEventArgs e) - { - base.OnMouseDown(e); - Focus(); - } - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Label/CrEaTiiOn_FancyLabel.cs b/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Label/CrEaTiiOn_FancyLabel.cs deleted file mode 100644 index 94b5740..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Label/CrEaTiiOn_FancyLabel.cs +++ /dev/null @@ -1,45 +0,0 @@ -#region Imports - -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Windows.Forms; - -#endregion - -namespace CBH.Controls -{ - #region Label7 - - public class CrEaTiiOn_FancyLabel : Control - { - public CrEaTiiOn_FancyLabel() - { - SetStyle(ControlStyles.SupportsTransparentBackColor, true); - SetStyle(ControlStyles.UserPaint, true); - BackColor = Color.Transparent; - ForeColor = Color.White; - DoubleBuffered = true; - Size = new(96, 16); - } - - protected override void OnPaint(PaintEventArgs e) - { - Bitmap B = new(Width, Height); - Graphics G = Graphics.FromImage(B); - //Rectangle ClientRectangle = new(0, 0, Width - 1, Height - 1); - base.OnPaint(e); - G.Clear(BackColor); - Font drawFont = new("", 9, FontStyle.Bold); - StringFormat format = new() { Alignment = StringAlignment.Near, LineAlignment = StringAlignment.Center }; - G.CompositingQuality = CompositingQuality.HighQuality; - G.SmoothingMode = SmoothingMode.HighQuality; - G.DrawString(Text, drawFont, new SolidBrush(Color.FromArgb(5, 5, 5)), new Rectangle(1, 0, Width - 1, Height - 1), format); - G.DrawString(Text, drawFont, new SolidBrush(ForeColor), new Rectangle(0, -1, Width - 1, Height - 1), format); - e.Graphics.DrawImage((Image)B.Clone(), 0, 0); - G.Dispose(); - B.Dispose(); - } - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Label/CrEaTiiOn_FlatLabel.cs b/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Label/CrEaTiiOn_FlatLabel.cs deleted file mode 100644 index 0267778..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Label/CrEaTiiOn_FlatLabel.cs +++ /dev/null @@ -1,23 +0,0 @@ -#region Imports - - -#endregion - -using System.Drawing; -namespace CBH.Controls -{ - #region Label2 - - public class CrEaTiiOn_FlatLabel : System.Windows.Forms.Label - { - - public CrEaTiiOn_FlatLabel() - { - Font = new("Segoe UI", 11); - ForeColor = Color.White; - BackColor = Color.Transparent; - } - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Label/CrEaTiiOn_MetroLabel.cs b/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Label/CrEaTiiOn_MetroLabel.cs deleted file mode 100644 index eb42085..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Label/CrEaTiiOn_MetroLabel.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System; -using System.Drawing; -using System.Reflection.Emit; -using System.Windows.Forms; - -namespace CBH.Controls -{ - public class CrEaTiiOn_MetroLabel : Control - { - protected override void OnTextChanged(EventArgs e) - { - base.OnTextChanged(e); - Invalidate(); - } - - public CrEaTiiOn_MetroLabel() - { - SetStyle(ControlStyles.SupportsTransparentBackColor, true); - Font = new Font("Segoe UI", 10); - ForeColor = Color.White; - BackColor = Color.Transparent; - Text = Text; - } - } -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Label/CrEaTiiOn_ModernHeaderLabel.cs b/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Label/CrEaTiiOn_ModernHeaderLabel.cs deleted file mode 100644 index e369007..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Label/CrEaTiiOn_ModernHeaderLabel.cs +++ /dev/null @@ -1,110 +0,0 @@ -#region Imports - -using System.ComponentModel; -using System.Drawing; -using System.Drawing.Text; -using System.Windows.Forms; - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_ModernHeaderLabel - - public class CrEaTiiOn_ModernHeaderLabel : System.Windows.Forms.Label - { - #region Properties - - private PanelSide _Side; - [Browsable(true)] - [Description("Determines the foreground color of the label according to which side it is placed on.")] - public PanelSide Side - { - get => _Side; - set - { - _Side = value; - switch (value) - { - case PanelSide.LeftPanel: - ForeColor = _LeftSideForeColor; - break; - case PanelSide.RightPanel: - ForeColor = _RightSideForeColor; - break; - } - Invalidate(); - } - } - - private Color _LeftSideForeColor = ColorTranslator.FromHtml("#FAFAFA"); - public Color LeftSideForeColor - { - get => _LeftSideForeColor; - set - { - _LeftSideForeColor = value; - Invalidate(); - } - } - - private Color _RightSideForeColor = ColorTranslator.FromHtml("#AAABB0"); - public Color RightSideForeColor - { - get => _RightSideForeColor; - set - { - _RightSideForeColor = value; - Invalidate(); - } - } - - private TextRenderingHint _TextRenderingHint = TextRenderingHint.AntiAliasGridFit; - [Browsable(true)] - [Description("Specifies the quality of text rendering.")] - public TextRenderingHint TextRenderingHint - { - get => _TextRenderingHint; - set - { - _TextRenderingHint = value; - Invalidate(); - } - } - - #endregion - - #region Enum - - public enum PanelSide - { - LeftPanel, - RightPanel - }; - - #endregion - - public CrEaTiiOn_ModernHeaderLabel() - { - Font = new("Segoe UI", 22, FontStyle.Regular, GraphicsUnit.Point); - TextAlign = ContentAlignment.MiddleCenter; - ForeColor = _RightSideForeColor; - BackColor = Color.Transparent; - UseCompatibleTextRendering = true; - } - - protected override void OnMouseDown(MouseEventArgs e) - { - base.OnMouseDown(e); - Focus(); - } - - protected override void OnPaint(PaintEventArgs e) - { - e.Graphics.TextRenderingHint = _TextRenderingHint; - base.OnPaint(e); - } - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Label/CrEaTiiOn_ModernLabel.cs b/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Label/CrEaTiiOn_ModernLabel.cs deleted file mode 100644 index ed63a5a..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Label/CrEaTiiOn_ModernLabel.cs +++ /dev/null @@ -1,33 +0,0 @@ -#region Imports - - -#endregion - -using System; -using System.Drawing; -using System.Windows.Forms; - -namespace CBH.Controls -{ - #region Label3 - - public class CrEaTiiOn_ModernLabel : System.Windows.Forms.Label - { - protected override void OnTextChanged(EventArgs e) - { - base.OnTextChanged(e); - Invalidate(); - } - - public CrEaTiiOn_ModernLabel() - { - SetStyle(ControlStyles.SupportsTransparentBackColor, true); - Font = new("Segoe UI", 8); - ForeColor = Color.LightGray; - BackColor = Color.Transparent; - Text = Text; - } - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Menu/CrEaTiiOn_MenuColorTable.cs b/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Menu/CrEaTiiOn_MenuColorTable.cs deleted file mode 100644 index de5b597..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Menu/CrEaTiiOn_MenuColorTable.cs +++ /dev/null @@ -1,52 +0,0 @@ -#region Imports -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; -using System.Drawing; -#endregion - -namespace CBH.Controls -{ - public class CrEaTiiOn_MenuColorTable : ProfessionalColorTable - { - //Fields - private Color backColor; - private Color leftColumnColor; - private Color borderColor; - private Color menuItemBorderColor; - private Color menuItemSelectedColor; - - //Constructor - public CrEaTiiOn_MenuColorTable(bool isMainMenu, Color primaryColor) - { - if (isMainMenu) - { - backColor = Color.FromArgb(37, 39, 60); - leftColumnColor = Color.FromArgb(32, 33, 51); - borderColor = Color.FromArgb(32, 33, 51); - menuItemBorderColor = primaryColor; - menuItemSelectedColor = primaryColor; - } - else - { - backColor = Color.White; - leftColumnColor = Color.LightGray; - borderColor = Color.LightGray; - menuItemBorderColor = primaryColor; - menuItemSelectedColor = primaryColor; - } - } - - //Overrides - public override Color ToolStripDropDownBackground { get { return backColor; } } - public override Color MenuBorder { get { return borderColor; } } - public override Color MenuItemBorder { get { return menuItemBorderColor; } } - public override Color MenuItemSelected { get { return menuItemSelectedColor; } } - public override Color ImageMarginGradientBegin { get { return leftColumnColor; } } - public override Color ImageMarginGradientMiddle { get { return leftColumnColor; } } - public override Color ImageMarginGradientEnd { get { return leftColumnColor; } } - } -} diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Menu/CrEaTiiOn_MenuRenderer.cs b/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Menu/CrEaTiiOn_MenuRenderer.cs deleted file mode 100644 index 9b5e22c..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Menu/CrEaTiiOn_MenuRenderer.cs +++ /dev/null @@ -1,72 +0,0 @@ -#region Imports -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; -using System.Drawing; -using System.Drawing.Drawing2D; -using CBH.RJControls; -#endregion - -namespace CBH.Controls -{ - public class CrEaTiiOn_MenuRenderer : ToolStripProfessionalRenderer - { - //Fields - private Color primaryColor; - private Color textColor; - private int arrowThickness; - - //Constructor - public CrEaTiiOn_MenuRenderer(bool isMainMenu, Color primaryColor, Color textColor) - : base(new CrEaTiiOn_MenuColorTable(isMainMenu, primaryColor)) - { - this.primaryColor = primaryColor; - if (isMainMenu) - { - arrowThickness = 3; - if (textColor == Color.Empty) //Set Default Color - this.textColor = Color.Gainsboro; - else//Set custom text color - this.textColor = textColor; - } - else - { - arrowThickness = 2; - if (textColor == Color.Empty) //Set Default Color - this.textColor = Color.DimGray; - else//Set custom text color - this.textColor = textColor; - } - } - - //Overrides - protected override void OnRenderItemText(ToolStripItemTextRenderEventArgs e) - { - base.OnRenderItemText(e); - e.Item.ForeColor = e.Item.Selected ? Color.White : textColor; - } - - protected override void OnRenderArrow(ToolStripArrowRenderEventArgs e) - { - //Fields - var graph = e.Graphics; - var arrowSize = new Size(5, 12); - var arrowColor = e.Item.Selected ? Color.White : primaryColor; - var rect = new Rectangle(e.ArrowRectangle.Location.X, (e.ArrowRectangle.Height - arrowSize.Height) / 2, - arrowSize.Width, arrowSize.Height); - using (GraphicsPath path = new GraphicsPath()) - using (Pen pen = new Pen(arrowColor, arrowThickness)) - { - //Drawing - graph.SmoothingMode = SmoothingMode.AntiAlias; - path.AddLine(rect.Left, rect.Top, rect.Right, rect.Top + rect.Height / 2); - path.AddLine(rect.Right, rect.Top + rect.Height / 2, rect.Left, rect.Top + rect.Height); - graph.DrawPath(pen, path); - } - } - - } -} diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Menu/Support/MenuColorTable.cs b/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Menu/Support/MenuColorTable.cs deleted file mode 100644 index c687fff..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Menu/Support/MenuColorTable.cs +++ /dev/null @@ -1,50 +0,0 @@ -#region Imports -using System.Drawing; -using System.Windows.Forms; -#endregion - -namespace CBH.Controls -{ - public class MenuColorTable : ProfessionalColorTable - { - private Color backColor; - private Color leftColumnColor; - private Color borderColor; - private Color menuItemBorderColor; - private Color menuItemSelectedColor; - - public MenuColorTable(bool isMainMenu, Color primaryColor) - { - if (isMainMenu) - { - this.backColor = Color.FromArgb(37, 39, 60); - this.leftColumnColor = Color.FromArgb(32, 33, 51); - this.borderColor = Color.FromArgb(32, 33, 51); - this.menuItemBorderColor = primaryColor; - this.menuItemSelectedColor = primaryColor; - } - else - { - this.backColor = Color.White; - this.leftColumnColor = Color.LightGray; - this.borderColor = Color.LightGray; - this.menuItemBorderColor = primaryColor; - this.menuItemSelectedColor = primaryColor; - } - } - - public override Color ToolStripDropDownBackground => this.backColor; - - public override Color MenuBorder => this.borderColor; - - public override Color MenuItemBorder => this.menuItemBorderColor; - - public override Color MenuItemSelected => this.menuItemSelectedColor; - - public override Color ImageMarginGradientBegin => this.leftColumnColor; - - public override Color ImageMarginGradientMiddle => this.leftColumnColor; - - public override Color ImageMarginGradientEnd => this.leftColumnColor; - } -} diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Menu/Support/MenuRenderer.cs b/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Menu/Support/MenuRenderer.cs deleted file mode 100644 index 23a5a5c..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Menu/Support/MenuRenderer.cs +++ /dev/null @@ -1,58 +0,0 @@ -#region Imports -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Windows.Forms; -#endregion - -namespace CBH.Controls -{ - public class MenuRenderer : ToolStripProfessionalRenderer - { - private Color primaryColor; - private Color textColor; - private int arrowThickness; - - public MenuRenderer(bool isMainMenu, Color primaryColor, Color textColor) - : base((ProfessionalColorTable) new MenuColorTable(isMainMenu, primaryColor)) - { - this.primaryColor = primaryColor; - if (isMainMenu) - { - this.arrowThickness = 3; - if (textColor == Color.Empty) - this.textColor = Color.Gainsboro; - else - this.textColor = textColor; - } - else - { - this.arrowThickness = 2; - this.textColor = !(textColor == Color.Empty) ? textColor : Color.DimGray; - } - } - - protected override void OnRenderItemText(ToolStripItemTextRenderEventArgs e) - { - base.OnRenderItemText(e); - e.Item.ForeColor = e.Item.Selected ? Color.Black : this.textColor; - } - - protected override void OnRenderArrow(ToolStripArrowRenderEventArgs e) - { - Graphics graphics = e.Graphics; - Size size = new Size(5, 12); - Color color = e.Item.Selected ? Color.Blue : this.primaryColor; - Rectangle rectangle = new Rectangle(e.ArrowRectangle.Location.X, (e.ArrowRectangle.Height - size.Height) / 2, size.Width, size.Height); - using (GraphicsPath path = new GraphicsPath()) - { - using (Pen pen = new Pen(color, (float) this.arrowThickness)) - { - graphics.SmoothingMode = SmoothingMode.AntiAlias; - path.AddLine(rectangle.Left, rectangle.Top, rectangle.Right, rectangle.Top + rectangle.Height / 2); - path.AddLine(rectangle.Right, rectangle.Top + rectangle.Height / 2, rectangle.Left, rectangle.Top + rectangle.Height); - graphics.DrawPath(pen, path); - } - } - } - } -} diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Message/CrEaTiiOn_Message.cs b/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Message/CrEaTiiOn_Message.cs deleted file mode 100644 index b58757c..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Message/CrEaTiiOn_Message.cs +++ /dev/null @@ -1,136 +0,0 @@ -#region Imports -using CBH_Ultimate_Theme_Library.Theme.Helpers; -using System; -using System.Collections.Generic; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Windows.Forms; -#endregion - -namespace CBH.Controls -{ - public class CrEaTiiOn_Message : Control - { - protected override void OnPaint(PaintEventArgs e) - { - base.OnPaint(e); - - Graphics g = e.Graphics; - g.SmoothingMode = SmoothingMode.HighQuality; - g.Clear(Parent.BackColor); - - DrawingHelper dh = new DrawingHelper(); - MultiLineHandler mlh = new MultiLineHandler(); - int slope = Adjustments.Roundness; - - Rectangle mainRect = new Rectangle(0, 0, Width - 1, Height - 1); - GraphicsPath mainPath = dh.RoundRect(mainRect, slope); - - Color bgColor = new Color(); - Color borderColor = new Color(); - Color textColor = new Color(); - - bgColor = dh.AdjustColor(BackColor, 30, DrawingHelper.ColorAdjustmentType.Lighten); - - ColorBlend bgCB = new ColorBlend(3); - bgCB.Colors = new[] { bgColor, bgColor, dh.AdjustColor(bgColor, 15, DrawingHelper.ColorAdjustmentType.Darken) }; - bgCB.Positions = new[] { 0.0F, 0.7F, 1.0F }; - - LinearGradientBrush bgLGB = new LinearGradientBrush(mainRect, Color.FromArgb(250, 36, 38), Color.FromArgb(250, 36, 38), 90.0F); - bgLGB.InterpolationColors = bgCB; - - borderColor = dh.AdjustColor(bgColor, 20, DrawingHelper.ColorAdjustmentType.Darken); - textColor = dh.AdjustColor(bgColor, 95, DrawingHelper.ColorAdjustmentType.Darken); - - g.FillPath(bgLGB, mainPath); - g.DrawPath(new Pen(borderColor), mainPath); - - int descY = 0; - - if (Header != null) - { - g.DrawString(_header, _headerFont, new SolidBrush(textColor), new Point(8, 8)); - descY = (int)(8 + g.MeasureString(_header, _headerFont).Height + 6); - } - else - { - descY = 8; - } - - foreach (string line in mlh.GetLines(g, Text, Font, Width - 16)) - { - g.DrawString(line, Font, new SolidBrush(textColor), new Point(8, descY)); - descY += 13; - } - - if (_sizeByText) - { - Size = new Size(Width, 8 + descY + 4); - } - - } - - public CrEaTiiOn_Message() - { - SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.UserPaint, true); - BackColor = Color.FromArgb(250, 36, 38); - Font = new Font(Adjustments.DefaultFontFamily, 8); - Size = new Size(600, 80); - } - - private string _header = "Welcome!"; - public string Header - { - get - { - return _header; - } - set - { - _header = value; - Invalidate(); - } - } - - private Font _headerFont = new Font(Adjustments.DefaultFontFamily, 10F, FontStyle.Bold); - public Font HeaderFont - { - get - { - return _headerFont; - } - set - { - _headerFont = value; - Invalidate(); - } - } - - private bool _sizeByText = false; - public bool SizeByText - { - get - { - return _sizeByText; - } - set - { - _sizeByText = value; - Invalidate(); - } - } - - protected override void OnTextChanged(EventArgs e) - { - base.OnTextChanged(e); - Invalidate(); - } - - protected override void OnFontChanged(EventArgs e) - { - base.OnFontChanged(e); - Font = new Font(Font.FontFamily, 8); - } - - } -} diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Numeric/CrEaTiiOn_Numeric.cs b/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Numeric/CrEaTiiOn_Numeric.cs deleted file mode 100644 index bc9d4d1..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Numeric/CrEaTiiOn_Numeric.cs +++ /dev/null @@ -1,342 +0,0 @@ -#region Imports - -using System; -using System.Collections.Generic; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Windows.Forms; - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_Numeric - - public class CrEaTiiOn_Numeric : Control - { - #region " Properties & Flicker Control " - private int X; - private int Y; - private long _Value; - private long _Max; - private long _Min; - private bool Typing; - - public long Value - { - get => _Value; - set - { - if (value <= _Max & value >= _Min) - { - _Value = value; - } - - Invalidate(); - } - } - - public long Maximum - { - get => _Max; - set - { - if (value > _Min) - { - _Max = value; - } - - if (_Value > _Max) - { - _Value = _Max; - } - - Invalidate(); - } - } - - public long Minimum - { - get => _Min; - set - { - if (value < _Max) - { - _Min = value; - } - - if (_Value < _Min) - { - _Value = _Min; - } - - Invalidate(); - } - } - protected override void OnMouseMove(MouseEventArgs e) - { - base.OnMouseMove(e); - X = e.Location.X; - Y = e.Location.Y; - Invalidate(); - if (e.X < Width - 23) - { - Cursor = Cursors.Default; - } - else - { - Cursor = Cursors.Hand; - } - } - - protected override void OnResize(EventArgs e) - { - base.OnResize(e); - Height = 30; - } - - protected override void OnMouseDown(MouseEventArgs e) - { - base.OnMouseClick(e); - if (X > Width - 21 && X < Width - 3) - { - if (Y < 15) - { - if ((Value + 1) <= _Max) - { - _Value += 1; - } - } - else - { - if ((Value - 1) >= _Min) - { - _Value -= 1; - } - } - } - else - { - Typing = !Typing; - Focus(); - } - Invalidate(); - } - - protected override void OnKeyPress(KeyPressEventArgs e) - { - base.OnKeyPress(e); - try - { - if (Typing) - { - _Value = Convert.ToInt32(Convert.ToString(Convert.ToString(_Value) + e.KeyChar.ToString())); - } - - if (_Value > _Max) { _Value = _Max; } - - } - catch - { - } - } - - protected override void OnKeyUp(KeyEventArgs e) - { - base.OnKeyUp(e); - if (e.KeyCode == Keys.Up) - { - if ((Value + 1) <= _Max) - { - _Value += 1; - } - - Invalidate(); - } - else if (e.KeyCode == Keys.Down) - { - if ((Value - 1) >= _Min) - { - _Value -= 1; - } - } - else if (e.KeyCode == Keys.Back) - { - string tmp = _Value.ToString(); - tmp = tmp.Remove(Convert.ToInt32(tmp.Length - 1)); - if (tmp.Length == 0) { tmp = "0"; } - _Value = Convert.ToInt32(tmp); - } - Invalidate(); - } - - protected void DrawTriangle(Color Clr, Point FirstPoint, Point SecondPoint, Point ThirdPoint, Graphics G) - { - List points = new() - { - FirstPoint, - SecondPoint, - ThirdPoint - }; - G.FillPolygon(new SolidBrush(Clr), points.ToArray()); - } - #endregion - - #region Variables - private SmoothingMode _SmoothingType = SmoothingMode.HighQuality; - private Color _TopTriangleColor = Color.FromArgb(255, 255, 255); - private Color _BotTriangleColor = Color.FromArgb(255, 255, 255); - private Color _BorderColorA = Color.FromArgb(250, 36, 38); - private Color _BorderColorB = Color.FromArgb(250, 36, 38); - private Color _BorderColorC = Color.FromArgb(250, 36, 38); - private Color _BorderColorD = Color.FromArgb(250, 36, 38); - private Color _ButtonBackColorA = Color.FromArgb(20, 20, 20); - private Color _ButtonBackColorB = Color.FromArgb(15, 15, 15); - private Color _ButtonBorderColorA = Color.FromArgb(250, 36, 38); - private Color _ButtonBorderColorB = Color.FromArgb(250, 36, 38); - private Color _ButtonBorderColorC = Color.FromArgb(250, 36, 38); - private Color _ButtonBorderColorD = Color.FromArgb(250, 36, 38); - private Color _ButtonBorderColorE = Color.FromArgb(250, 36, 38); - #endregion - - #region Settings - public SmoothingMode SmoothingType - { - get => _SmoothingType; - set - { - _SmoothingType = value; - Invalidate(); - } - } - - public Color TopTriangleColor - { - get => _TopTriangleColor; - set => _TopTriangleColor = value; - } - - public Color BotTriangleColor - { - get => _BotTriangleColor; - set => _BotTriangleColor = value; - } - - public Color BorderColorA - { - get => _BorderColorA; - set => _BorderColorA = value; - } - - public Color BorderColorB - { - get => _BorderColorB; - set => _BorderColorB = value; - } - - public Color BorderColorC - { - get => _BorderColorC; - set => _BorderColorC = value; - } - - public Color BorderColorD - { - get => _BorderColorD; - set => _BorderColorD = value; - } - - public Color ButtonBackColorA - { - get => _ButtonBackColorA; - set => _ButtonBackColorA = value; - } - - public Color ButtonBackColorB - { - get => _ButtonBackColorB; - set => _ButtonBackColorB = value; - } - - public Color ButtonBorderColorA - { - get => _ButtonBorderColorA; - set => _ButtonBorderColorA = value; - } - - public Color ButtonBorderColorB - { - get => _ButtonBorderColorB; - set => _ButtonBorderColorB = value; - } - - public Color ButtonBorderColorC - { - get => _ButtonBorderColorC; - set => _ButtonBorderColorC = value; - } - - public Color ButtonBorderColorD - { - get => _ButtonBorderColorD; - set => _ButtonBorderColorD = value; - } - - public Color ButtonBorderColorE - { - get => _ButtonBorderColorE; - set => _ButtonBorderColorE = value; - } - #endregion - - public CrEaTiiOn_Numeric() - { - _Max = 9999999; - _Min = 0; - Cursor = Cursors.IBeam; - SetStyle(ControlStyles.UserPaint | ControlStyles.SupportsTransparentBackColor, true); - BackColor = Color.FromArgb(20, 20, 20); - ForeColor = Color.White; - DoubleBuffered = true; - Font = new("Segoe UI", 6.75f, FontStyle.Bold); - } - - protected override void OnPaint(PaintEventArgs e) - { - Bitmap B = new(Width, Height); - Graphics G = Graphics.FromImage(B); - - G.Clear(BackColor); - G.SmoothingMode = SmoothingType; - - LinearGradientBrush innerBorderBrush = new(new Rectangle(1, 1, Width - 3, Height - 3), BorderColorA, BorderColorB, 90); - Pen innerBorderPen = new(innerBorderBrush); - G.DrawRectangle(innerBorderPen, new Rectangle(1, 1, Width - 3, Height - 3)); - G.DrawLine(new(BorderColorC), new Point(1, 1), new Point(Width - 3, 1)); - - G.DrawRectangle(new(BorderColorD), new Rectangle(0, 0, Width - 1, Height - 1)); - - LinearGradientBrush buttonGradient = new(new Rectangle(Width - 23, 4, 19, 21), ButtonBackColorA, ButtonBackColorB, 90); - G.FillRectangle(buttonGradient, buttonGradient.Rectangle); - G.DrawRectangle(new(ButtonBorderColorA), new Rectangle(Width - 22, 5, 17, 19)); - G.DrawRectangle(new(ButtonBorderColorB), new Rectangle(Width - 23, 4, 19, 21)); - G.DrawLine(new(ButtonBorderColorC), new Point(Width - 22, Height - 4), new Point(Width - 5, Height - 4)); - G.DrawLine(new(ButtonBorderColorD), new Point(Width - 22, Height - 16), new Point(Width - 5, Height - 16)); - G.DrawLine(new(ButtonBorderColorE), new Point(Width - 22, Height - 15), new Point(Width - 5, Height - 15)); - - //Top Triangle - DrawTriangle(TopTriangleColor, new Point(Width - 17, 18), new Point(Width - 9, 18), new Point(Width - 13, 21), G); - - //Bottom Triangle - DrawTriangle(BotTriangleColor, new Point(Width - 17, 10), new Point(Width - 9, 10), new Point(Width - 13, 7), G); - - G.DrawString(Value.ToString(), Font, new SolidBrush(ForeColor), new Rectangle(5, 0, Width - 1, Height - 1), new StringFormat { LineAlignment = StringAlignment.Center }); - - e.Graphics.DrawImage(B, 0, 0); - G.Dispose(); - B.Dispose(); - } - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Palette/CrEaTiiOn_ColorPalette.cs b/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Palette/CrEaTiiOn_ColorPalette.cs deleted file mode 100644 index c0a53f1..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Palette/CrEaTiiOn_ColorPalette.cs +++ /dev/null @@ -1,393 +0,0 @@ -#region Imports - -using System; -using System.ComponentModel; -using System.Drawing; -using System.Windows.Forms; - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_ColorPalette - - public class CrEaTiiOn_ColorPalette : Control - { - public CrEaTiiOn_ColorPalette() - { - base.Size = new Size(175, 50); - Increment = base.Width / 7; - Cursor = Cursors.Hand; - } - - [Browsable(false)] - [EditorBrowsable(EditorBrowsableState.Never)] - public new Color BackColor { get; set; } - - [Browsable(false)] - [EditorBrowsable(EditorBrowsableState.Never)] - public new Color ForeColor { get; set; } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The selected color")] - public Color SelectedColor - { - get => selectedColor; - set - { - selectedColor = value; - OnColorChange(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The color of the grid")] - public Color GridColor - { - get => gridColor; - set - { - gridColor = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("Show gridlines")] - public bool ShowGrid - { - get => showGrid; - set - { - showGrid = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("Color 1")] - public Color Color1 - { - get => color1; - set - { - color1 = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("Color 2")] - public Color Color2 - { - get => color2; - set - { - color2 = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("Color 3")] - public Color Color3 - { - get => color3; - set - { - color3 = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("Color 4")] - public Color Color4 - { - get => color4; - set - { - color4 = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("Color 5")] - public Color Color5 - { - get => color5; - set - { - color5 = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("Color 6")] - public Color Color6 - { - get => color6; - set - { - color6 = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("Color 7")] - public Color Color7 - { - get => color7; - set - { - color7 = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("Color 8")] - public Color Color8 - { - get => color8; - set - { - color8 = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("Color 9")] - public Color Color9 - { - get => color9; - set - { - color9 = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("Color 10")] - public Color Color10 - { - get => color10; - set - { - color10 = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("Color 11")] - public Color Color11 - { - get => color11; - set - { - color11 = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("Color 12")] - public Color Color12 - { - get => color12; - set - { - color12 = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("Color 13")] - public Color Color13 - { - get => color13; - set - { - color13 = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("Color 14")] - public Color Color14 - { - get => color14; - set - { - color14 = value; - base.Invalidate(); - } - } - - protected override void OnMouseDown(MouseEventArgs e) - { - base.OnMouseDown(e); - if (e.X > 0 && e.Y < base.Height) - { - selectedColor = color2; - } - if (e.X > 0 && e.Y < base.Height / 2) - { - selectedColor = color1; - } - if (e.X > Increment && e.Y < base.Height) - { - selectedColor = color4; - } - if (e.X > Increment && e.Y < base.Height / 2) - { - selectedColor = color3; - } - if (e.X > Increment * 2 && e.Y < base.Height) - { - selectedColor = color6; - } - if (e.X > Increment * 2 && e.Y < base.Height / 2) - { - selectedColor = color5; - } - if (e.X > Increment * 3 && e.Y < base.Height) - { - selectedColor = color8; - } - if (e.X > Increment * 3 && e.Y < base.Height / 2) - { - selectedColor = color7; - } - if (e.X > Increment * 4 && e.Y < base.Height) - { - selectedColor = color10; - } - if (e.X > Increment * 4 && e.Y < base.Height / 2) - { - selectedColor = color9; - } - if (e.X > Increment * 5 && e.Y < base.Height) - { - selectedColor = color12; - } - if (e.X > Increment * 5 && e.Y < base.Height / 2) - { - selectedColor = color11; - } - if (e.X > Increment * 6 && e.Y < base.Height) - { - selectedColor = color14; - } - if (e.X > Increment * 6 && e.Y < base.Height / 2) - { - selectedColor = color13; - } - OnColorChange(); - } - - public event EventHandler ColorChanged; - - protected virtual void OnColorChange() - { - ColorChanged?.Invoke(this, EventArgs.Empty); - } - - protected override void OnPaint(PaintEventArgs e) - { - base.OnPaint(e); - - Increment = base.Width / 7; - - e.Graphics.FillRectangle(new SolidBrush(color1), 0, 0, Increment, base.Height / 2); - e.Graphics.FillRectangle(new SolidBrush(color2), 0, base.Height / 2, Increment, base.Height); - e.Graphics.FillRectangle(new SolidBrush(color3), Increment, 0, Increment, base.Height / 2); - e.Graphics.FillRectangle(new SolidBrush(color4), Increment, base.Height / 2, Increment, base.Height); - e.Graphics.FillRectangle(new SolidBrush(color5), Increment * 2, 0, Increment, base.Height / 2); - e.Graphics.FillRectangle(new SolidBrush(color6), Increment * 2, base.Height / 2, Increment, base.Height); - e.Graphics.FillRectangle(new SolidBrush(color7), Increment * 3, 0, Increment, base.Height / 2); - e.Graphics.FillRectangle(new SolidBrush(color8), Increment * 3, base.Height / 2, Increment, base.Height); - e.Graphics.FillRectangle(new SolidBrush(color9), Increment * 4, 0, Increment, base.Height / 2); - e.Graphics.FillRectangle(new SolidBrush(color10), Increment * 4, base.Height / 2, Increment, base.Height); - e.Graphics.FillRectangle(new SolidBrush(color11), Increment * 5, 0, Increment, base.Height / 2); - e.Graphics.FillRectangle(new SolidBrush(color12), Increment * 5, base.Height / 2, Increment, base.Height); - e.Graphics.FillRectangle(new SolidBrush(color13), Increment * 6, 0, Increment, base.Height / 2); - e.Graphics.FillRectangle(new SolidBrush(color14), Increment * 6, base.Height / 2, Increment, base.Height); - - if (showGrid) - { - e.Graphics.DrawRectangle(new Pen(gridColor, 1f), 0, 0, Increment * 7 - 1, base.Height - 1); - e.Graphics.DrawLine(new Pen(gridColor, 1f), Increment, 0, Increment, base.Height); - e.Graphics.DrawLine(new Pen(gridColor, 1f), Increment * 2, 0, Increment * 2, base.Height); - e.Graphics.DrawLine(new Pen(gridColor, 1f), Increment * 3, 0, Increment * 3, base.Height); - e.Graphics.DrawLine(new Pen(gridColor, 1f), Increment * 4, 0, Increment * 4, base.Height); - e.Graphics.DrawLine(new Pen(gridColor, 1f), Increment * 5, 0, Increment * 5, base.Height); - e.Graphics.DrawLine(new Pen(gridColor, 1f), Increment * 6, 0, Increment * 6, base.Height); - e.Graphics.DrawLine(new Pen(gridColor, 1f), 0, base.Height / 2, Increment * 7 - 1, base.Height / 2); - } - } - - private int Increment; - - private Color selectedColor; - - private Color gridColor = Color.FromArgb(15, 15, 15); - - private bool showGrid = true; - - private Color color1 = Color.FromArgb(30, 33, 38); - - private Color color2 = Color.FromArgb(37, 40, 49); - - private Color color3 = Color.FromArgb(24, 11, 56); - - private Color color4 = Color.FromArgb(48, 36, 76); - - private Color color5 = Color.FromArgb(1, 119, 215); - - private Color color6 = Color.FromArgb(26, 169, 219); - - private Color color7 = Color.FromArgb(24, 202, 142); - - private Color color8 = Color.FromArgb(102, 217, 174); - - private Color color9 = Color.FromArgb(230, 71, 89); - - private Color color10 = Color.FromArgb(234, 129, 136); - - private Color color11 = Color.FromArgb(159, 133, 255); - - private Color color12 = Color.FromArgb(188, 170, 252); - - private Color color13 = Color.FromArgb(228, 216, 54); - - private Color color14 = Color.FromArgb(235, 227, 120); - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Panel/CrEaTiiOn_FlatPanel.cs b/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Panel/CrEaTiiOn_FlatPanel.cs deleted file mode 100644 index efb3e24..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Panel/CrEaTiiOn_FlatPanel.cs +++ /dev/null @@ -1,126 +0,0 @@ -#region Imports -using System; -using System.ComponentModel; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Windows.Forms; -#endregion - -namespace CBH.Controls -{ - public class CrEaTiiOn_FlatPanel : Panel - { - private int borderSize = 0; - private int borderRadius = 6; - private Color borderColor = Color.FromArgb(250, 36, 38); - - public CrEaTiiOn_FlatPanel() - { - this.Size = new Size(150, 40); - this.BackColor = Color.Transparent; - this.ForeColor = Color.White; - this.Resize += new EventHandler(this.Panel_Resize); - } - - private void Panel_Resize(object sender, EventArgs e) - { - if (this.borderRadius <= this.Height) - return; - this.borderRadius = this.Height; - } - - private GraphicsPath GetFigurePath(Rectangle rect, float radius) - { - GraphicsPath figurePath = new GraphicsPath(); - float num = radius * 2f; - figurePath.StartFigure(); - figurePath.AddArc((float)rect.X, (float)rect.Y, num, num, 180f, 90f); - figurePath.AddArc((float)rect.Right - num, (float)rect.Y, num, num, 270f, 90f); - figurePath.AddArc((float)rect.Right - num, (float)rect.Bottom - num, num, num, 0.0f, 90f); - figurePath.AddArc((float)rect.X, (float)rect.Bottom - num, num, num, 90f, 90f); - figurePath.CloseFigure(); - return figurePath; - } - - protected override void OnPaint(PaintEventArgs pevent) - { - base.OnPaint(pevent); - Rectangle clientRectangle = this.ClientRectangle; - Rectangle rect = Rectangle.Inflate(clientRectangle, -this.borderSize, -this.borderSize); - int width = 2; - if (this.borderSize > 0) - width = this.borderSize; - if (this.borderRadius > 2) - { - using (GraphicsPath figurePath1 = this.GetFigurePath(clientRectangle, (float)this.borderRadius)) - { - using (GraphicsPath figurePath2 = this.GetFigurePath(rect, (float)(this.borderRadius - this.borderSize))) - { - using (Pen pen1 = new Pen(this.Parent.BackColor, (float)width)) - { - using (Pen pen2 = new Pen(this.borderColor, (float)this.borderSize)) - { - pevent.Graphics.SmoothingMode = SmoothingMode.AntiAlias; - this.Region = new Region(figurePath1); - pevent.Graphics.DrawPath(pen1, figurePath1); - if (this.borderSize < 1) - return; - pevent.Graphics.DrawPath(pen2, figurePath2); - } - } - } - } - } - else - { - pevent.Graphics.SmoothingMode = SmoothingMode.None; - this.Region = new Region(clientRectangle); - if (this.borderSize >= 1) - { - using (Pen pen = new Pen(this.borderColor, (float)this.borderSize)) - { - pen.Alignment = PenAlignment.Inset; - pevent.Graphics.DrawRectangle(pen, 0, 0, this.Width - 1, this.Height - 1); - } - } - } - } - - [Category("Sipaa")] - public int BorderSize - { - get => this.borderSize; - set - { - this.borderSize = value; - this.Invalidate(); - } - } - - [Category("Sipaa")] - public int BorderRadius - { - get => this.borderRadius; - set - { - this.borderRadius = value; - this.Invalidate(); - } - } - - protected override void OnHandleCreated(EventArgs e) => base.OnHandleCreated(e); - - private void Container_BackColorChanged(object sender, EventArgs e) => this.Invalidate(); - - [Category("Sipaa")] - public Color BorderColor - { - get => this.borderColor; - set - { - this.borderColor = value; - this.Invalidate(); - } - } - } -} diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Panel/CrEaTiiOn_ModernPanel.cs b/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Panel/CrEaTiiOn_ModernPanel.cs deleted file mode 100644 index 8870ae4..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Panel/CrEaTiiOn_ModernPanel.cs +++ /dev/null @@ -1,98 +0,0 @@ -#region Imports - -using System; -using System.ComponentModel; -using System.Drawing; -using System.Windows.Forms; - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_ModernPanel - - public class CrEaTiiOn_ModernPanel : System.Windows.Forms.Panel - { - #region Enum - - public enum PanelSide - { - Left, - Right - } - - #endregion - - #region Properties - - [Browsable(false)] - [Description("The background color of the component.")] - public override Color BackColor { get; set; } - - private PanelSide _Side = PanelSide.Left; - public PanelSide Side - { - get => _Side; - set - { - _Side = value; - if (_Side == PanelSide.Left) - { - BackColor = LeftSideColor; - } - else - { - BackColor = RightSideColor; - } - - Invalidate(); - } - } - - private Color _LeftSideColor = ColorTranslator.FromHtml("#F25D59"); - public Color LeftSideColor - { - get => _LeftSideColor; - set - { - _LeftSideColor = value; - Invalidate(); - } - } - - private Color _RightSideColor = ColorTranslator.FromHtml("#292C3D"); - public Color RightSideColor - { - get => _RightSideColor; - set - { - _RightSideColor = value; - Invalidate(); - } - } - - #endregion - - protected override void OnClick(EventArgs e) - { - Focus(); - base.OnClick(e); - } - - public CrEaTiiOn_ModernPanel() - { - DoubleBuffered = true; - - SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.UserPaint, true); - - UpdateStyles(); - - ForeColor = ColorTranslator.FromHtml("#FFFFFF"); - BackColor = Color.Transparent; - - BorderStyle = BorderStyle.None; - } - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Panel/CrEaTiiOn_Panel.cs b/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Panel/CrEaTiiOn_Panel.cs deleted file mode 100644 index fa398bd..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Panel/CrEaTiiOn_Panel.cs +++ /dev/null @@ -1,82 +0,0 @@ -#region Imports - -using System; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Windows.Forms; - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_Panel - - public class CrEaTiiOn_Panel : ContainerControl - { - private GraphicsPath Shape; - - private SmoothingMode _SmoothingType = SmoothingMode.HighQuality; - public SmoothingMode SmoothingType - { - get => _SmoothingType; - set - { - _SmoothingType = value; - Invalidate(); - } - } - - private Color _EdgeColor = Color.Transparent; - public Color EdgeColor - { - get => _EdgeColor; - set - { - _EdgeColor = value; - Invalidate(); - } - } - - public CrEaTiiOn_Panel() - { - SetStyle(ControlStyles.SupportsTransparentBackColor, true); - SetStyle(ControlStyles.UserPaint, true); - - BackColor = Color.Transparent; - Size = new(187, 117); - Padding = new Padding(5, 5, 5, 5); - DoubleBuffered = true; - } - - protected override void OnResize(EventArgs e) - { - base.OnResize(e); - - Shape = new(); - Shape.AddArc(0, 0, 10, 10, 180, 90); - Shape.AddArc(Width - 11, 0, 10, 10, -90, 90); - Shape.AddArc(Width - 11, Height - 11, 10, 10, 0, 90); - Shape.AddArc(0, Height - 11, 10, 10, 90, 90); - Shape.CloseAllFigures(); - } - - protected override void OnPaint(PaintEventArgs e) - { - base.OnPaint(e); - Bitmap B = new(Width, Height); - Graphics G = Graphics.FromImage(B); - - G.SmoothingMode = SmoothingType; - - G.Clear(EdgeColor); // Set control background to transparent - G.FillPath(new SolidBrush(BackColor), Shape); // Draw RTB background - G.DrawPath(new(BackColor), Shape); // Draw border - - G.Dispose(); - e.Graphics.DrawImage((Image)(B.Clone()), 0, 0); - B.Dispose(); - } - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Panel/CrEaTiiOn_WidgetPanel.cs b/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Panel/CrEaTiiOn_WidgetPanel.cs deleted file mode 100644 index a867d43..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Panel/CrEaTiiOn_WidgetPanel.cs +++ /dev/null @@ -1,63 +0,0 @@ -#region Imports - -using System.ComponentModel; -using System.Drawing; -using System.Windows.Forms; - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_WidgetPanel - - public class CrEaTiiOn_WidgetPanel : System.Windows.Forms.Panel - { - protected override void OnControlAdded(ControlEventArgs e) - { - base.OnControlAdded(e); - if (!ControlsAsWidgets) - { - foreach (object obj in base.Controls) - { - Control control = (Control)obj; - control.MouseDown += WidgetDown; - control.MouseUp += WidgetUp; - control.MouseMove += WidgetMove; - } - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("Reat controls as widgets")] - public bool ControlsAsWidgets - { - get => controlsAsWidgets; - set => controlsAsWidgets = value; - } - - private void WidgetDown(object sender, MouseEventArgs e) - { - isDragging = true; - } - - private void WidgetUp(object sender, MouseEventArgs e) - { - isDragging = false; - } - - private void WidgetMove(object sender, MouseEventArgs e) - { - if (isDragging) - { - ((Control)sender).Location = new Point(e.X, e.Y); - } - } - - private bool controlsAsWidgets; - - private bool isDragging; - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Picker/CrEaTiiOn_ColorPicker.Designer.cs b/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Picker/CrEaTiiOn_ColorPicker.Designer.cs deleted file mode 100644 index d76c09d..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Picker/CrEaTiiOn_ColorPicker.Designer.cs +++ /dev/null @@ -1,133 +0,0 @@ -namespace CBH.Controls -{ - partial class CrEaTiiOn_ColorPicker - { - /// - /// Обязательная переменная конструктора. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Освободить все используемые ресурсы. - /// - /// истинно, если управляемый ресурс должен быть удален; иначе ложно. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Код, автоматически созданный конструктором компонентов - - /// - /// Требуемый метод для поддержки конструктора — не изменяйте - /// содержимое этого метода с помощью редактора кода. - /// - private void InitializeComponent() - { - this.pictureBox1 = new System.Windows.Forms.PictureBox(); - this.pictureBox2 = new System.Windows.Forms.PictureBox(); - this.label1 = new System.Windows.Forms.Label(); - this.pictureBox3 = new System.Windows.Forms.PictureBox(); - this.label2 = new System.Windows.Forms.Label(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).BeginInit(); - this.SuspendLayout(); - // - // pictureBox1 - // - this.pictureBox1.Location = new System.Drawing.Point(4, 3); - this.pictureBox1.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.pictureBox1.Name = "pictureBox1"; - this.pictureBox1.Size = new System.Drawing.Size(175, 173); - this.pictureBox1.TabIndex = 8; - this.pictureBox1.TabStop = false; - this.pictureBox1.Click += new System.EventHandler(this.pictureBox1_Click_1); - this.pictureBox1.Paint += new System.Windows.Forms.PaintEventHandler(this.pictureBox1_Paint); - this.pictureBox1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pictureBox1_MouseDown); - this.pictureBox1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pictureBox1_MouseMove); - this.pictureBox1.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pictureBox1_MouseUp); - // - // pictureBox2 - // - this.pictureBox2.Location = new System.Drawing.Point(192, 134); - this.pictureBox2.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.pictureBox2.Name = "pictureBox2"; - this.pictureBox2.Size = new System.Drawing.Size(20, 43); - this.pictureBox2.TabIndex = 9; - this.pictureBox2.TabStop = false; - // - // label1 - // - this.label1.AutoSize = true; - this.label1.BackColor = System.Drawing.Color.Transparent; - this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - this.label1.ForeColor = System.Drawing.Color.WhiteSmoke; - this.label1.Location = new System.Drawing.Point(55, 187); - this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(72, 16); - this.label1.TabIndex = 12; - this.label1.Text = "RGB: none"; - // - // pictureBox3 - // - this.pictureBox3.Location = new System.Drawing.Point(192, 3); - this.pictureBox3.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.pictureBox3.Name = "pictureBox3"; - this.pictureBox3.Size = new System.Drawing.Size(20, 123); - this.pictureBox3.TabIndex = 13; - this.pictureBox3.TabStop = false; - this.pictureBox3.Paint += new System.Windows.Forms.PaintEventHandler(this.pictureBox3_Paint); - this.pictureBox3.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pictureBox3_MouseDown); - this.pictureBox3.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pictureBox3_MouseMove); - this.pictureBox3.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pictureBox3_MouseUp); - // - // label2 - // - this.label2.AutoSize = true; - this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - this.label2.ForeColor = System.Drawing.Color.WhiteSmoke; - this.label2.Location = new System.Drawing.Point(55, 210); - this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(70, 16); - this.label2.TabIndex = 16; - this.label2.Text = "HEX: none"; - // - // ColorPicker - // - this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.BackColor = System.Drawing.Color.Transparent; - this.Controls.Add(this.label2); - this.Controls.Add(this.pictureBox3); - this.Controls.Add(this.label1); - this.Controls.Add(this.pictureBox2); - this.Controls.Add(this.pictureBox1); - this.ForeColor = System.Drawing.Color.Black; - this.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.Name = "ColorPicker"; - this.Size = new System.Drawing.Size(216, 242); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).EndInit(); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.PictureBox pictureBox1; - private System.Windows.Forms.PictureBox pictureBox2; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.PictureBox pictureBox3; - private System.Windows.Forms.Label label2; - private System.EventHandler pictureBox1_Click; - } -} diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Picker/CrEaTiiOn_ColorPicker.cs b/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Picker/CrEaTiiOn_ColorPicker.cs deleted file mode 100644 index 1118a63..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Picker/CrEaTiiOn_ColorPicker.cs +++ /dev/null @@ -1,247 +0,0 @@ -#region Imports -using System; -using System.ComponentModel; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Windows.Forms; -#endregion - -namespace CBH.Controls -{ - public partial class CrEaTiiOn_ColorPicker : UserControl - { - #region ПЕРЕМЕННЫЕ - private class ValueBox - { - public float Value = 1F; - public Color Color = Color.White; - } - private bool ValueBoxMD; - private PointF CursorPos; - private bool ColorPickerMD; - #endregion - - #region НАСТРОЙКИ - public delegate void EventHandler(Color color); - [Category("FC_UI")] - [Description("Событие возникает, когда в Control изменяется значение свойства Text.")] - public event EventHandler ColorChanged = delegate { }; - - private Color tmp_selectedcolor; - [Category("CrEaTiiOn")] - [Description("Выбранный цвет")] - public Color SelectedColor - { - get => tmp_selectedcolor; - set - { - tmp_selectedcolor = value; - ColorChanged(value); - } - } - #endregion - - #region ЗАГРУЗКА - public CrEaTiiOn_ColorPicker() - { - InitializeComponent(); - - Tag = "FC_UI"; - pictureBox1.Tag = new PointF((float)pictureBox1.Width / 2, (float)pictureBox1.Height / 2); - pictureBox3.Tag = new ValueBox(); - - Bitmap Wheel = new Bitmap(pictureBox1.Width, pictureBox1.Height); - Graphics g = Graphics.FromImage(Wheel); - g.InterpolationMode = InterpolationMode.HighQualityBicubic; - g.SmoothingMode = SmoothingMode.AntiAlias; - DrawWheel((float)Wheel.Width / 2, g); - pictureBox1.Image = Wheel; - CursorPos = new PointF((float)pictureBox1.Height / 2, (float)pictureBox1.Height / 2); - } - #endregion - - #region СОБЫТИЯ - private void pictureBox1_MouseDown(object sender, MouseEventArgs e) - { - ColorPickerMD = true; - PickColor(e.X, e.Y); - } - private void pictureBox1_MouseMove(object sender, MouseEventArgs e) - { - if (ColorPickerMD) PickColor(e.X, e.Y); - } - private void pictureBox1_MouseUp(object sender, MouseEventArgs e) - { - ColorPickerMD = false; - PickColor(e.X, e.Y); - } - private void pictureBox1_Paint(object sender, PaintEventArgs e) - { - e.Graphics.SmoothingMode = SmoothingMode.AntiAlias; - e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic; - e.Graphics.DrawEllipse(new Pen(Color.DarkGray, 1F), CursorPos.X - 4, CursorPos.Y - 4, 8, 8); - } - private void pictureBox3_Paint(object sender, PaintEventArgs e) - { - LinearGradientBrush Brush = new LinearGradientBrush(new Point(0, 0), new Point(0, pictureBox3.Height), ((ValueBox)pictureBox3.Tag).Color, Color.Black); - e.Graphics.FillRectangle(Brush, pictureBox3.ClientRectangle); - e.Graphics.FillRectangle(new SolidBrush(Color.DarkGray), 0, pictureBox3.Height * (1 - ((ValueBox)pictureBox3.Tag).Value) - 2, pictureBox3.Width, 4); - } - private void pictureBox3_MouseDown(object sender, MouseEventArgs e) - { - ValueBoxMD = true; - if (e.Y > pictureBox3.Height || e.Y < 0) return; - ((ValueBox)pictureBox3.Tag).Value = (float)(pictureBox3.Height - e.Y) / pictureBox3.Height; - PickColor(((PointF)pictureBox1.Tag).X, ((PointF)pictureBox1.Tag).Y); - } - private void pictureBox3_MouseMove(object sender, MouseEventArgs e) - { - if (ValueBoxMD) - { - if (e.Y > pictureBox3.Height || e.Y < 0) return; - ((ValueBox)pictureBox3.Tag).Value = (float)(pictureBox3.Height - e.Y) / pictureBox3.Height; - PickColor(((PointF)pictureBox1.Tag).X, ((PointF)pictureBox1.Tag).Y); - } - } - private void pictureBox3_MouseUp(object sender, MouseEventArgs e) => ValueBoxMD = false; - #endregion - - #region МЕТОДЫ РИСОВАНИЯ - private void DrawWheel(float radius, Graphics graphics) - { - GraphicsPath FillPath = new GraphicsPath(); - FillPath.AddEllipse(0, 0, radius * 2, radius * 2); - FillPath.Flatten(); - - GraphicsPath BrushPath = new GraphicsPath(); - BrushPath.AddEllipse(-1, -1, radius * 2 + 2, radius * 2 + 2); - BrushPath.Flatten(); - - graphics.FillPath(GetBrush(BrushPath), FillPath); - } - private Brush GetBrush(GraphicsPath graphicsPath) - { - PathGradientBrush Brush = new PathGradientBrush(graphicsPath) { CenterColor = Color.White }; - - Color[] Colors = new Color[graphicsPath.PointCount]; - for (int Angle = 0; Angle < Colors.Length; Angle++) - { - Colors[Angle] = HSVtoRGB((float)Angle / Colors.Length, 1, 1); - } - Brush.SurroundColors = Colors; - - return Brush; - } - private Color GetPixelColor(float x, float y, float value, float radius) - { - float R = (float)Math.Sqrt(Math.Pow(x, 2) + Math.Pow(y, 2)); - float S = (float)(R / radius); - if (S > 1) return Color.Transparent; - - double Angle; - if (x > 0 && y > 0) Angle = Math.Asin(y / R); - else if (x <= 0 && y > 0) Angle = Math.Acos(y / R) + Math.PI / 2; - else if (x <= 0 && y <= 0) Angle = Math.Asin(-y / R) + Math.PI; - else Angle = Math.Acos(-y / R) + 3 * Math.PI / 2; - float H = (float)(Angle / Math.PI / 2); - - return HSVtoRGB(H, S, value); - } - private Color PickColor(float x, float y) - { - float x1 = x - (float)pictureBox1.Width / 2; - float y1 = y - (float)pictureBox1.Height / 2; - float Radius = (float)Math.Sqrt(Math.Pow(x1, 2) + Math.Pow(y1, 2)); - if (Radius > (float)pictureBox1.Width / 2) - { - float mult = (float)pictureBox1.Width / 2 / Radius; - x1 *= mult; - y1 *= mult; - } - Color Color = GetPixelColor(x1, y1, ((ValueBox)pictureBox3.Tag).Value, (float)pictureBox1.Width / 2); - if (Color == Color.Transparent) return Color.Empty; - - label1.Text = $"RGB: {Color.R}, {Color.G}, {Color.B}"; - label2.Text = $"HEX: #{Color.ToArgb():X}"; - CursorPos = new PointF(x1 + (float)pictureBox1.Width / 2, y1 + (float)pictureBox1.Height / 2); - pictureBox2.BackColor = Color; - ((ValueBox)pictureBox3.Tag).Color = Color; - pictureBox1.Tag = new PointF(x, y); - pictureBox1.Invalidate(); - pictureBox2.Invalidate(); - pictureBox3.Invalidate(); - - SelectedColor = Color; - return Color; - } - - private Color HSVtoRGB(double H, double S, double V) - { - double R, G, B; - if (S == 0) - { - R = V * 255; - G = V * 255; - B = V * 255; - } - else - { - double H1 = H * 6; - if (H1 == 6) H1 = 0; - - int i = (int)Math.Floor(H1); - - double i1 = V * (1 - S); - double i2 = V * (1 - S * (H1 - i)); - double i3 = V * (1 - S * (1 - (H1 - i))); - - switch (i) - { - case 0: - R = V; - G = i3; - B = i1; - break; - case 1: - R = i2; - G = V; - B = i1; - break; - case 2: - R = i1; - G = V; - B = i3; - break; - case 3: - R = i1; - G = i2; - B = V; - break; - case 4: - R = i3; - G = i1; - B = V; - break; - default: - R = V; - G = i1; - B = i2; - break; - } - - R *= 255; - G *= 255; - B *= 255; - } - return Color.FromArgb((int)R, (int)G, (int)B); - } - #endregion - - #region Click - private void pictureBox1_Click_1(object sender, EventArgs e) - { - - } - #endregion - } -} diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Picker/CrEaTiiOn_ColorPicker.resx b/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Picker/CrEaTiiOn_ColorPicker.resx deleted file mode 100644 index f298a7b..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Picker/CrEaTiiOn_ColorPicker.resx +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Progress/CrEaTiiOn_FlatProgressBar.cs b/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Progress/CrEaTiiOn_FlatProgressBar.cs deleted file mode 100644 index a3d2e08..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Progress/CrEaTiiOn_FlatProgressBar.cs +++ /dev/null @@ -1,350 +0,0 @@ -#region Imports - -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Drawing.Text; -using System.Windows.Forms; - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_FlatProgressBar - - public class CrEaTiiOn_FlatProgressBar : Control - { - public CrEaTiiOn_FlatProgressBar() - { - base.SetStyle(ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, true); - base.Size = new Size(300, 5); - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The progress bar style")] - public Style BarStyle - { - get => barStyle; - set - { - barStyle = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The progress value")] - public int Value - { - get => value; - set - { - this.value = value; - if (this.value < 0) - { - this.value = 0; - } - if (this.value > maxValue) - { - this.value = maxValue; - } - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The progress complete color")] - public Color CompleteColor - { - get => completeColor; - set - { - completeColor = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The progress complete ios back color")] - public Color CompleteBackColor - { - get => completeBackColor; - set - { - completeBackColor = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The progress bar border color")] - public Color BorderColor - { - get => borderColor; - set - { - borderColor = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("Show the progress bar border")] - public bool ShowBorder - { - get => showBorder; - set - { - showBorder = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The progress incompleted color")] - public Color InocmpletedColor - { - get => incompletedColor; - set - { - incompletedColor = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The progress incompleted ios back color")] - public Color IncompletedBackColor - { - get => incompletedBackColor; - set - { - incompletedBackColor = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The maximum value")] - public int MaxValue - { - get => maxValue; - set - { - maxValue = value; - if (Value > maxValue) - { - Value = maxValue; - } - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The positions")] - public List Positions - { - get => _Positions; - set - { - _Positions = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The colors")] - public List Colors - { - get => _Colors; - set - { - _Colors = value; - base.Invalidate(); - } - } - - private SmoothingMode _SmoothingType = SmoothingMode.HighQuality; - [Category("CrEaTiiOn")] - [Browsable(true)] - public SmoothingMode SmoothingType - { - get => _SmoothingType; - set - { - _SmoothingType = value; - Invalidate(); - } - } - - private PixelOffsetMode _PixelOffsetType = PixelOffsetMode.HighQuality; - [Category("CrEaTiiOn")] - [Browsable(true)] - public PixelOffsetMode PixelOffsetType - { - get => _PixelOffsetType; - set - { - _PixelOffsetType = value; - Invalidate(); - } - } - - private CompositingQuality _CompositingQualityType = CompositingQuality.HighQuality; - [Category("CrEaTiiOn")] - [Browsable(true)] - public CompositingQuality CompositingQualityType - { - get => _CompositingQualityType; - set - { - _CompositingQualityType = value; - Invalidate(); - } - } - - private TextRenderingHint _TextRenderingType = TextRenderingHint.ClearTypeGridFit; - [Category("CrEaTiiOn")] - [Browsable(true)] - public TextRenderingHint TextRenderingType - { - get => _TextRenderingType; - set - { - _TextRenderingType = value; - Invalidate(); - } - } - - private InterpolationMode _InterpolationType = InterpolationMode.HighQualityBilinear; - [Category("CrEaTiiOn")] - [Browsable(true)] - public InterpolationMode InterpolationType - { - get => _InterpolationType; - set - { - _InterpolationType = value; - Invalidate(); - } - } - - protected override void OnPaint(PaintEventArgs e) - { - BufferedGraphicsContext bufferedGraphicsContext = BufferedGraphicsManager.Current; - bufferedGraphicsContext.MaximumBuffer = new Size(base.Width + 1, base.Height + 1); - bufferedGraphics = bufferedGraphicsContext.Allocate(base.CreateGraphics(), base.ClientRectangle); - - bufferedGraphics.Graphics.SmoothingMode = SmoothingType; - bufferedGraphics.Graphics.InterpolationMode = InterpolationType; - bufferedGraphics.Graphics.CompositingQuality = CompositingQualityType; - bufferedGraphics.Graphics.PixelOffsetMode = PixelOffsetType; - bufferedGraphics.Graphics.TextRenderingHint = TextRenderingType; - - bufferedGraphics.Graphics.Clear(BackColor); - - if (barStyle == Style.Flat) - { - bufferedGraphics.Graphics.FillRectangle(new SolidBrush(incompletedColor), 0, 0, base.Width, base.Height); - bufferedGraphics.Graphics.FillRectangle(new SolidBrush(completeColor), 0, 0, value * base.Width / maxValue, base.Height); - } - - if (barStyle == Style.IOS) - { - bufferedGraphics.Graphics.FillRectangle(new SolidBrush(incompletedBackColor), 0, 0, base.Width, base.Height); - bufferedGraphics.Graphics.FillRectangle(new SolidBrush(completeBackColor), 0, 0, value * base.Width / maxValue, base.Height); - } - - if (barStyle == Style.Material && Positions.Count == Colors.Count) - { - LinearGradientBrush linearGradientBrush = new(new Rectangle(0, 0, base.Width, base.Height), Color.Black, Color.Black, 0f, false) - { - InterpolationColors = new ColorBlend - { - Positions = Positions.ToArray(), - Colors = Colors.ToArray() - } - }; - - linearGradientBrush.RotateTransform(1f); - bufferedGraphics.Graphics.FillRectangle(linearGradientBrush, new Rectangle(0, 0, base.Width, base.Height)); - bufferedGraphics.Graphics.FillRectangle(new SolidBrush(incompletedColor), value * base.Width / maxValue, 0, base.Width - value * base.Width / maxValue, base.Height); - } - - if (ShowBorder) - { - bufferedGraphics.Graphics.DrawRectangle(new Pen(BorderColor, 1f), new Rectangle(1, 1, base.Width - 2, base.Height - 2)); - } - - bufferedGraphics.Render(e.Graphics); - base.OnPaint(e); - } - - protected override void OnSizeChanged(EventArgs e) - { - base.Invalidate(); - } - - private BufferedGraphics bufferedGraphics; - - private Style barStyle = Style.Material; - - private int value = 50; - - private Color completeColor = Color.FromArgb(250, 36, 38); - - private Color completeBackColor = Color.FromArgb(15, 15, 15); - - private Color borderColor = Color.FromArgb(20, 20, 20); - - private bool showBorder = true; - - private Color incompletedColor = Color.DarkGray; - - private Color incompletedBackColor = Color.FromArgb(100, 100, 100); - - private int maxValue = 100; - - private List _Positions = new() - { - 0f, - 0.2f, - 0.4f, - 0.6f, - 0.8f, - 1f - }; - - private List _Colors = new() - { - Color.FromArgb(76, 217, 100), - Color.FromArgb(85, 205, 205), - Color.FromArgb(2, 124, 255), - Color.FromArgb(130, 75, 180), - Color.FromArgb(255, 0, 150), - Color.FromArgb(255, 45, 85) - }; - - public enum Style - { - Flat, - Material, - IOS - } - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Progress/CrEaTiiOn_FlatRoundProgressBar.cs b/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Progress/CrEaTiiOn_FlatRoundProgressBar.cs deleted file mode 100644 index a565737..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Progress/CrEaTiiOn_FlatRoundProgressBar.cs +++ /dev/null @@ -1,94 +0,0 @@ -#region Imports -using CBH_Ultimate_Theme_Library.Theme.Helpers; -using System; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Drawing.Text; -using System.Windows.Forms; -#endregion - -namespace CBH.Controls -{ - public class CrEaTiiOn_FlatRoundProgressBar : Control - { - #region 变量 - #endregion - - private int tempValue = 0; - private int _valueNumber = 0; - public int ValueNumber - { - get { return _valueNumber; } - set - { - _valueNumber = value > 100 ? 100 : (value < 0 ? 0 : value); - Invalidate(); - } - } - - private float _roundWidth = 6; - - private bool _isError = false; - public bool IsError - { - get { return _isError; } - set - { - _isError = value; - Invalidate(); - } - } - - #region 事件 - protected override void OnResize(EventArgs e) - { - base.OnResize(e); - Width = Height; - } - #endregion - - protected override void OnPaint(PaintEventArgs e) - { - Graphics graphics = e.Graphics; - graphics.SmoothingMode = SmoothingMode.HighQuality; - graphics.PixelOffsetMode = PixelOffsetMode.HighQuality; - graphics.TextRenderingHint = TextRenderingHint.ClearTypeGridFit; - graphics.Clear(Parent.BackColor); - - graphics.FillEllipse(new SolidBrush(ThemeColors.OneLevelBorder), new Rectangle(0, 0, Width, Height)); - - if(_isError) - { - //绘制扇形 - graphics.FillPie(new SolidBrush(ThemeColors.Danger), new Rectangle(0, 0, Width, Width), 0, _valueNumber * 3.6f); - //绘制文字 - graphics.FillEllipse(new SolidBrush(Color.FromArgb(20, 20, 20)), new RectangleF(_roundWidth, _roundWidth, Width - _roundWidth * 2, Width - _roundWidth * 2)); - graphics.DrawLine(new Pen(ThemeColors.Danger, 2f), Width / 2 - 6, Height / 2 - 6, Width / 2 + 6, Height / 2 + 6); - graphics.DrawLine(new Pen(ThemeColors.Danger, 2f), Width / 2 - 6, Height / 2 + 6, Width / 2 + 6, Height / 2 - 6); - } - else - { - if(_valueNumber==100) - { - graphics.FillPie(new SolidBrush(ThemeColors.Success), new Rectangle(0, 0, Width, Width), 0, _valueNumber * 3.6f); - graphics.FillEllipse(new SolidBrush(Color.FromArgb(20, 20, 20)), new RectangleF(_roundWidth, _roundWidth, Width - _roundWidth * 2, Width - _roundWidth * 2)); - graphics.DrawLine(new Pen(ThemeColors.Success, 2f), Width / 2 - 6, Height / 2, Width / 2-3, Height / 2 + 6); - graphics.DrawLine(new Pen(ThemeColors.Success, 2f), Width / 2 + 6, Height / 2 - 6, Width / 2-3, Height / 2 + 6); - } - else - { - graphics.FillPie(new SolidBrush(ThemeColors.PrimaryColor), new Rectangle(0, 0, Width, Width), 0, _valueNumber * 3.6f); - graphics.FillEllipse(new SolidBrush(Color.White), new RectangleF(_roundWidth, _roundWidth, Width - _roundWidth * 2, Width - _roundWidth * 2)); - graphics.DrawString(_valueNumber.ToString()+"%", new Font("微软雅黑", 12f), new SolidBrush(ThemeColors.PrimaryColor), new RectangleF(_roundWidth, _roundWidth, Width - (_roundWidth * 2), Width - (_roundWidth * 2)), StringAlign.Center); - } - } - } - - public CrEaTiiOn_FlatRoundProgressBar() - { - SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.OptimizedDoubleBuffer | ControlStyles.SupportsTransparentBackColor, true); - DoubleBuffered = true; - Font = new Font("Segoe UI", 10F, FontStyle.Bold); - } - } -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Progress/CrEaTiiOn_ModernProgressBar.cs b/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Progress/CrEaTiiOn_ModernProgressBar.cs deleted file mode 100644 index 439927d..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Progress/CrEaTiiOn_ModernProgressBar.cs +++ /dev/null @@ -1,279 +0,0 @@ -#region Imports -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.ComponentModel; -using CBH.RJControls; -#endregion - -namespace CBH.Controls -{ - public enum TextPosition - { - Left, - Right, - Center, - Sliding, - None - } - - class CrEaTiiOn_ModernProgressBar : CrEaTiiOn_ProgressBar - { - //Fields - //-> Appearance - private Color channelColor = Color.FromArgb(255, 150, 151); - private Color sliderColor = Color.FromArgb(250, 36, 38); - private Color foreBackColor = Color.FromArgb(20,20, 20); - private int channelHeight = 6; - private int sliderHeight = 6; - private TextPosition showValue = TextPosition.Right; - private string symbolBefore = ""; - private string symbolAfter = ""; - private bool showMaximun = false; - - //-> Others - private bool paintedBack = false; - private bool stopPainting = false; - - //Constructor - public CrEaTiiOn_ModernProgressBar() - { - this.SetStyle(ControlStyles.UserPaint, true); - this.ForeColor = Color.White; - } - - //Propertiesfff - [Category("RJ Code Advance")] - public Color ChannelColor - { - get { return channelColor; } - set - { - channelColor = value; - this.Invalidate(); - } - } - - [Category("RJ Code Advance")] - public Color SliderColor - { - get { return sliderColor; } - set - { - sliderColor = value; - this.Invalidate(); - } - } - - [Category("RJ Code Advance")] - public Color ForeBackColor - { - get { return foreBackColor; } - set - { - foreBackColor = value; - this.Invalidate(); - } - } - - [Category("RJ Code Advance")] - public int ChannelHeight - { - get { return channelHeight; } - set - { - channelHeight = value; - this.Invalidate(); - } - } - - [Category("RJ Code Advance")] - public int SliderHeight - { - get { return sliderHeight; } - set - { - sliderHeight = value; - this.Invalidate(); - } - } - - [Category("RJ Code Advance")] - public TextPosition ShowValue - { - get { return showValue; } - set - { - showValue = value; - this.Invalidate(); - } - } - - [Category("RJ Code Advance")] - public string SymbolBefore - { - get { return symbolBefore; } - set - { - symbolBefore = value; - this.Invalidate(); - } - } - - [Category("RJ Code Advance")] - public string SymbolAfter - { - get { return symbolAfter; } - set - { - symbolAfter = value; - this.Invalidate(); - } - } - - [Category("RJ Code Advance")] - public bool ShowMaximun - { - get { return showMaximun; } - set - { - showMaximun = value; - this.Invalidate(); - } - } - - [Category("RJ Code Advance")] - [Browsable(true)] - [EditorBrowsable(EditorBrowsableState.Always)] - public override Font Font - { - get { return base.Font; } - set - { - base.Font = value; - } - } - - [Category("RJ Code Advance")] - public override Color ForeColor - { - get { return base.ForeColor; } - set - { - base.ForeColor = value; - } - } - - //-> Paint the background & channel - protected override void OnPaintBackground(PaintEventArgs pevent) - { - if (stopPainting == false) - { - if (paintedBack == false) - { - //Fields - Graphics graph = pevent.Graphics; - Rectangle rectChannel = new Rectangle(0, 0, this.Width, ChannelHeight); - using (var brushChannel = new SolidBrush(channelColor)) - { - if (channelHeight >= sliderHeight) - rectChannel.Y = this.Height - channelHeight; - else rectChannel.Y = this.Height - ((channelHeight + sliderHeight) / 2); - - //Painting - graph.Clear(this.Parent.BackColor);//Surface - graph.FillRectangle(brushChannel, rectChannel);//Channel - - //Stop painting the back & Channel - if (this.DesignMode == false) - paintedBack = true; - } - } - //Reset painting the back & channel - if (this.Value == this.Maximum || this.Value == this.Minimum) - paintedBack = false; - } - } - //-> Paint slider - protected override void OnPaint(PaintEventArgs e) - { - if (stopPainting == false) - { - //Fields - Graphics graph = e.Graphics; - double scaleFactor = (((double)this.Value - this.Minimum) / ((double)this.Maximum - this.Minimum)); - int sliderWidth = (int)(this.Width * scaleFactor); - Rectangle rectSlider = new Rectangle(0, 0, sliderWidth, sliderHeight); - using (var brushSlider = new SolidBrush(sliderColor)) - { - if (sliderHeight >= channelHeight) - rectSlider.Y = this.Height - sliderHeight; - else rectSlider.Y = this.Height - ((sliderHeight + channelHeight) / 2); - - //Painting - if (sliderWidth > 1) //Slider - graph.FillRectangle(brushSlider, rectSlider); - if (showValue != TextPosition.None) //Text - DrawValueText(graph, sliderWidth, rectSlider); - } - } - if (this.Value == this.Maximum) stopPainting = true;//Stop painting - else stopPainting = false; //Keep painting - } - - //-> Paint value text - private void DrawValueText(Graphics graph, int sliderWidth, Rectangle rectSlider) - { - //Fields - string text = symbolBefore + this.Value.ToString() + symbolAfter; - if (showMaximun) text = text + "/" + symbolBefore + this.Maximum.ToString() + symbolAfter; - var textSize = TextRenderer.MeasureText(text, this.Font); - var rectText = new Rectangle(0, 0, textSize.Width, textSize.Height + 2); - using (var brushText = new SolidBrush(this.ForeColor)) - using (var brushTextBack = new SolidBrush(foreBackColor)) - using (var textFormat = new StringFormat()) - { - switch (showValue) - { - case TextPosition.Left: - rectText.X = 0; - textFormat.Alignment = StringAlignment.Near; - break; - - case TextPosition.Right: - rectText.X = this.Width - textSize.Width; - textFormat.Alignment = StringAlignment.Far; - break; - - case TextPosition.Center: - rectText.X = (this.Width - textSize.Width) / 2; - textFormat.Alignment = StringAlignment.Center; - break; - - case TextPosition.Sliding: - rectText.X = sliderWidth - textSize.Width; - textFormat.Alignment = StringAlignment.Center; - //Clean previous text surface - using (var brushClear = new SolidBrush(this.Parent.BackColor)) - { - var rect = rectSlider; - rect.Y = rectText.Y; - rect.Height = rectText.Height; - graph.FillRectangle(brushClear, rect); - } - break; - } - //Painting - graph.FillRectangle(brushTextBack, rectText); - graph.DrawString(text, this.Font, brushText, rectText, textFormat); - } - } - - - } -} diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/RadioButton/CrEaTiiOn_MetroRadioButton.cs b/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/RadioButton/CrEaTiiOn_MetroRadioButton.cs deleted file mode 100644 index 76fb3f6..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/RadioButton/CrEaTiiOn_MetroRadioButton.cs +++ /dev/null @@ -1,220 +0,0 @@ -#region Imports - -using System; -using System.ComponentModel; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Drawing.Text; -using System.Windows.Forms; - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_MetroRadioButton - - [DefaultEvent("CheckedChanged")] - public class CrEaTiiOn_MetroRadioButton : Control - { - #region " Control Help - MouseState & Flicker Control" - protected override void OnResize(EventArgs e) - { - base.OnResize(e); - Height = 16; - } - - protected override void OnTextChanged(EventArgs e) - { - base.OnTextChanged(e); - Invalidate(); - } - - private bool _Checked; - public bool Checked - { - get => _Checked; - set - { - _Checked = value; - InvalidateControls(); - CheckedChanged?.Invoke(this); - Invalidate(); - } - } - - protected override void OnClick(EventArgs e) - { - if (!_Checked) - { - @Checked = true; - } - else - { - @Checked = false; - } - - base.OnClick(e); - } - - public event CheckedChangedEventHandler CheckedChanged; - public delegate void CheckedChangedEventHandler(object sender); - protected override void OnCreateControl() - { - base.OnCreateControl(); - InvalidateControls(); - } - - private void InvalidateControls() - { - if (!IsHandleCreated || !_Checked) - { - return; - } - - foreach (Control C in Parent.Controls) - { - if (!object.ReferenceEquals(C, this) && C is CrEaTiiOn_MetroRadioButton button) - { - button.Checked = false; - } - } - } - - private SmoothingMode _SmoothingType = SmoothingMode.HighQuality; - public SmoothingMode SmoothingType - { - get => _SmoothingType; - set - { - _SmoothingType = value; - Invalidate(); - } - } - - private CompositingQuality _CompositingQualityType = CompositingQuality.HighQuality; - public CompositingQuality CompositingQualityType - { - get => _CompositingQualityType; - set - { - _CompositingQualityType = value; - Invalidate(); - } - } - - private TextRenderingHint _TextRenderingType = TextRenderingHint.AntiAliasGridFit; - public TextRenderingHint TextRenderingType - { - get => _TextRenderingType; - set - { - _TextRenderingType = value; - Invalidate(); - } - } - - private Color _CheckedColor = Color.FromArgb(250, 36, 38); - public Color CheckedColor - { - get => _CheckedColor; - set - { - _CheckedColor = value; - Invalidate(); - } - } - - private Color _CircleBorderColor = Color.FromArgb(20, 20, 20); - public Color CircleBorderColor - { - get => _CircleBorderColor; - set - { - _CircleBorderColor = value; - Invalidate(); - } - } - - private Color _CircleEdgeColor = Color.White; - public Color CircleEdgeColor - { - get => _CircleEdgeColor; - set - { - _CircleEdgeColor = value; - Invalidate(); - } - } - - private Color _CheckedBorderColorA = Color.FromArgb(250, 36, 38); - public Color CheckedBorderColorA - { - get => _CheckedBorderColorA; - set - { - _CheckedBorderColorA = value; - Invalidate(); - } - } - - private Color _CheckedBorderColorB = Color.FromArgb(250, 36, 38); - public Color CheckedBorderColorB - { - get => _CheckedBorderColorB; - set - { - _CheckedBorderColorB = value; - Invalidate(); - } - } - #endregion - - public CrEaTiiOn_MetroRadioButton() : base() - { - SetStyle(ControlStyles.UserPaint | ControlStyles.SupportsTransparentBackColor, true); - BackColor = Color.Transparent; - ForeColor = Color.White; - Size = new(133, 16); - DoubleBuffered = true; - Cursor = Cursors.Hand; - Font = new("Segoe UI", 8, FontStyle.Bold); - } - - protected override void OnPaint(PaintEventArgs e) - { - Bitmap B = new(Width, Height); - Graphics G = Graphics.FromImage(B); - Rectangle radioBtnRectangle = new(0, 0, Height, Height - 1); - Rectangle Inner = new(1, 1, Height - 2, Height - 3); - - G.SmoothingMode = SmoothingType; - G.CompositingQuality = CompositingQualityType; - G.TextRenderingHint = TextRenderingType; - - G.Clear(BackColor); - - LinearGradientBrush bgGrad = new(radioBtnRectangle, CheckedBorderColorA, CheckedBorderColorB, 90F); - G.FillEllipse(bgGrad, radioBtnRectangle); - - G.DrawEllipse(new(CircleBorderColor), radioBtnRectangle); - G.DrawEllipse(new(CircleEdgeColor), Inner); - - if (Checked) - { - G.DrawString("n", new Font("Marlett", 8, FontStyle.Bold), new SolidBrush(CheckedColor), 0, 3); - } - - G.DrawString(Text, Font, new SolidBrush(ForeColor), new Point(18, 8), new StringFormat - { - Alignment = StringAlignment.Near, - LineAlignment = StringAlignment.Center - }); - - e.Graphics.DrawImage(B, 0, 0); - G.Dispose(); - B.Dispose(); - } - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/RichTextBoxEdit/CrEaTiiOn_RichTextBoxEdit.cs b/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/RichTextBoxEdit/CrEaTiiOn_RichTextBoxEdit.cs deleted file mode 100644 index a203e76..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/RichTextBoxEdit/CrEaTiiOn_RichTextBoxEdit.cs +++ /dev/null @@ -1,252 +0,0 @@ -#region Imports - -using System; -using System.ComponentModel; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Windows.Forms; - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_RichTextBoxEdit - - [DefaultEvent("TextChanged")] - public class CrEaTiiOn_RichTextBoxEdit : Control - { - #region Variables - - public System.Windows.Forms.RichTextBox RT_RTB = new(); - private bool _ReadOnly; - private bool _WordWrap; - private bool _AutoWordSelection; - private GraphicsPath Shape; - private SmoothingMode _SmoothingType = SmoothingMode.AntiAlias; - private Color _BaseColor = Color.Transparent; - private Color _EdgeColor = Color.White; - private Color _BorderColor = Color.FromArgb(180, 180, 180); - private Color _TextBackColor = Color.White; - private Font _TextFont = new("Tahoma", 10); - private BorderStyle _TextBorderStyle = BorderStyle.None; - - #endregion - - #region Properties - - public override string Text - { - get => RT_RTB.Text; - set - { - RT_RTB.Text = value; - Invalidate(); - } - } - - public bool ReadOnly - { - get => _ReadOnly; - set - { - _ReadOnly = value; - if (RT_RTB != null) - { - RT_RTB.ReadOnly = value; - } - } - } - - public bool WordWrap - { - get => _WordWrap; - set - { - _WordWrap = value; - if (RT_RTB != null) - { - RT_RTB.WordWrap = value; - } - } - } - - public bool AutoWordSelection - { - get => _AutoWordSelection; - set - { - _AutoWordSelection = value; - if (RT_RTB != null) - { - RT_RTB.AutoWordSelection = value; - } - } - } - - public SmoothingMode SmoothingType - { - get => _SmoothingType; - set - { - _SmoothingType = value; - Invalidate(); - } - } - - public Color BaseColor - { - get => _BaseColor; - set - { - _BaseColor = value; - Invalidate(); - } - } - - public Color EdgeColor - { - get => _EdgeColor; - set - { - _EdgeColor = value; - Invalidate(); - } - } - - public Color BorderColor - { - get => _BorderColor; - set - { - _BorderColor = value; - Invalidate(); - } - } - - public Color TextBackColor - { - get => _TextBackColor; - set - { - _TextBackColor = value; - Invalidate(); - } - } - - public Font TextFont - { - get => _TextFont; - set - { - _TextFont = value; - Invalidate(); - } - } - - public BorderStyle TextBorderStyle - { - get => _TextBorderStyle; - set - { - _TextBorderStyle = value; - Invalidate(); - } - } - #endregion - - #region EventArgs - - protected override void OnForeColorChanged(EventArgs e) - { - base.OnForeColorChanged(e); - RT_RTB.ForeColor = ForeColor; - Invalidate(); - } - - protected override void OnFontChanged(EventArgs e) - { - base.OnFontChanged(e); - RT_RTB.Font = Font; - } - protected override void OnPaintBackground(PaintEventArgs e) - { - base.OnPaintBackground(e); - } - - protected override void OnSizeChanged(EventArgs e) - { - base.OnSizeChanged(e); - RT_RTB.Size = new(Width - 13, Height - 11); - } - - - protected override void OnResize(EventArgs e) - { - base.OnResize(e); - - Shape = new(); - GraphicsPath _Shape = Shape; - _Shape.AddArc(0, 0, 10, 10, 180, 90); - _Shape.AddArc(Width - 11, 0, 10, 10, -90, 90); - _Shape.AddArc(Width - 11, Height - 11, 10, 10, 0, 90); - _Shape.AddArc(0, Height - 11, 10, 10, 90, 90); - _Shape.CloseAllFigures(); - } - - public void _TextChanged(object s, EventArgs e) - { - RT_RTB.Text = Text; - } - - #endregion - - public void AddRichTextBox() - { - System.Windows.Forms.RichTextBox _RTB = RT_RTB; - _RTB.BackColor = TextBackColor; - _RTB.Size = new(Width - 10, 100); - _RTB.Location = new(7, 5); - _RTB.Text = string.Empty; - _RTB.BorderStyle = TextBorderStyle; - _RTB.Font = TextFont; - _RTB.Multiline = true; - } - - public CrEaTiiOn_RichTextBoxEdit() : base() - { - - SetStyle(ControlStyles.SupportsTransparentBackColor, true); - SetStyle(ControlStyles.UserPaint, true); - - AddRichTextBox(); - Controls.Add(RT_RTB); - BackColor = Color.Transparent; - ForeColor = Color.DimGray; - - Text = null; - Font = new("Tahoma", 10); - Size = new(150, 100); - WordWrap = true; - AutoWordSelection = false; - DoubleBuffered = true; - - TextChanged += _TextChanged; - } - - protected override void OnPaint(PaintEventArgs e) - { - base.OnPaint(e); - Bitmap B = new(Width, Height); - Graphics G = Graphics.FromImage(B); - G.SmoothingMode = SmoothingType; - G.Clear(BaseColor); - G.FillPath(new SolidBrush(EdgeColor), Shape); - G.DrawPath(new(BorderColor), Shape); - G.Dispose(); - e.Graphics.DrawImage((Image)B.Clone(), 0, 0); - B.Dispose(); - } - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Sleeper/CrEaTiiOn_Sleeper.cs b/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Sleeper/CrEaTiiOn_Sleeper.cs deleted file mode 100644 index 71b08ad..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Sleeper/CrEaTiiOn_Sleeper.cs +++ /dev/null @@ -1,27 +0,0 @@ -#region Imports - -using System; -using System.ComponentModel; -using System.Windows.Forms; - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_Sleeper - - public class CrEaTiiOn_Sleeper : Component - { - public void Sleep(int Milliseconds) - { - DateTime Time = DateTime.Now.AddMilliseconds(Milliseconds); - - while (DateTime.Now < Time) - { - Application.DoEvents(); - } - } - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/StatusBar/CrEaTiiOn_FlatStatusBar.cs b/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/StatusBar/CrEaTiiOn_FlatStatusBar.cs deleted file mode 100644 index bb14c27..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/StatusBar/CrEaTiiOn_FlatStatusBar.cs +++ /dev/null @@ -1,253 +0,0 @@ -#region Imports -using CBH_Ultimate_Theme_Library.Theme.Helpers; -using System; -using System.ComponentModel; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Drawing.Text; -using System.Windows.Forms; -#endregion - -namespace CBH.Controls -{ - public class CrEaTiiOn_FlatStatusBar : ContainerControl - { - private bool mouseFlag = false;//鼠标状态 - private Point mousePoint;//鼠标位置 - private Rectangle minRectangle;//最小化按钮区域 - private Rectangle maxRectangle;//最大化按钮区域 - private Rectangle closeRectangle;//关闭按钮区域 - - private Color _themeColor = ThemeColors.LightPrimary;//主题颜色 - private Image _iconImage = null;//应用图标 - #region 属性 - - [Category("背景颜色")] - public Color ThemeColor - { - get { return _themeColor; } - set - { - _themeColor = value; - Invalidate(); - } - } - - /// - /// 是否显示最小化 - /// - [DefaultValue(true)] - [Category("获取或设置一个值,该值指示是否在窗体的标题栏中显示“最小化”按钮。")] - public bool MinimizeBox - { - get - { - return ParentForm.MinimizeBox; - } - } - - /// - /// 是否显示最大化 - /// - [DefaultValue(true)] - [Category("获取或设置一个值,该值指示是否在窗体的标题栏中显示“最大化”按钮。")] - public bool MaximizeBox - { - get - { - return ParentForm.MaximizeBox; - } - } - - /// - /// 控件框是否显示在标题中 - /// - [DefaultValue(true)] - [Category("获取或设置一个值,该值指示控件框是否显示在标题中")] - public bool ControlBox - { - get - { - return ParentForm.ControlBox; - } - } - #endregion - - #region 事件 - protected override void OnMouseDown(MouseEventArgs e) - { - base.OnMouseDown(e); - if (e.Button == MouseButtons.Left) - { - mouseFlag = true; - mousePoint = e.Location; - } - } - - protected override void OnMouseMove(MouseEventArgs e) - { - base.OnMouseMove(e); - if (mouseFlag) - { - Parent.Location = new Point( - MousePosition.X - mousePoint.X, - MousePosition.Y - mousePoint.Y); - } - else - { - mousePoint = e.Location; - Invalidate(); - } - } - - protected override void OnMouseUp(MouseEventArgs e) - { - base.OnMouseUp(e); - mouseFlag = false; - } - - protected override void OnClick(EventArgs e) - { - base.OnClick(e); - if (minRectangle.Contains(mousePoint)) - { - ParentForm.WindowState = FormWindowState.Minimized; - } - if (maxRectangle.Contains(mousePoint)) - { - if (ParentForm.WindowState == FormWindowState.Maximized) - { - ParentForm.WindowState = FormWindowState.Normal; - } - else - { - ParentForm.WindowState = FormWindowState.Maximized; - } - } - if (closeRectangle.Contains(mousePoint)) - { - Environment.Exit(0); - } - } - - protected override void OnResize(EventArgs e) - { - base.OnResize(e); - Height = 40; - } - - protected override void OnCreateControl() - { - base.OnCreateControl(); - ParentForm.FormBorderStyle = FormBorderStyle.None; - ParentForm.AllowTransparency = false; - ParentForm.FindForm().StartPosition = FormStartPosition.CenterScreen; - ParentForm.MaximumSize = Screen.PrimaryScreen.WorkingArea.Size; - Invalidate(); - } - #endregion - - protected override void OnPaint(PaintEventArgs e) - { - base.OnPaint(e); - Location = new Point(0, 0); - Width = ParentForm.Width; - - Bitmap bitmap = new Bitmap(Width, Height); - Graphics graphics = Graphics.FromImage(bitmap); - - graphics.SmoothingMode = SmoothingMode.HighQuality;//消除锯齿 - graphics.PixelOffsetMode = PixelOffsetMode.HighQuality;//高质量显示 - graphics.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;//最高质量显示文本 - graphics.Clear(_themeColor); - - var icoFont = new Font("Marlett", 12); - // - //绘制应用图标 - // - if (_iconImage != null) - { - graphics.DrawImage(_iconImage, new Rectangle(10, 10, 25, 25)); - // - //绘制标题 - // - graphics.DrawString(Text, new Font("Segoe UI", 12f), new SolidBrush(ThemeColors.FourLevelBorder), new Rectangle(45, 1, Width - 100, Height), StringAlign.Left); - } - else - { - // - //绘制标题 - // - graphics.DrawString(Text, new Font("微软雅黑", 12f), new SolidBrush(ThemeColors.FourLevelBorder), new Rectangle(15, 1, Width - 100, Height), StringAlign.Left); - } - - if (ControlBox) - { - if (MinimizeBox) - { - minRectangle = new Rectangle(Width - 54 - (MaximizeBox ? 1 : 0) * 22, (Height - 16) / 2, 18, 18); - // - //最小化按钮 - // - if (minRectangle.Contains(mousePoint)) - { - graphics.DrawString("0", icoFont, new SolidBrush(ThemeColors.TwoLevelBorder), minRectangle, StringAlign.Center); - } - else - { - graphics.DrawString("0", icoFont, new SolidBrush(Color.White), minRectangle, StringAlign.Center); - } - } - if (MaximizeBox) - { - maxRectangle = new Rectangle(Width - 54, (Height - 16) / 2, 18, 18); - // - //最大化按钮 - // - if (maxRectangle.Contains(mousePoint)) - { - if (ParentForm.WindowState == FormWindowState.Normal) - graphics.DrawString("1", icoFont, new SolidBrush(ThemeColors.TwoLevelBorder), maxRectangle, StringAlign.Center); - else - graphics.DrawString("2", icoFont, new SolidBrush(ThemeColors.TwoLevelBorder), maxRectangle, StringAlign.Center); - } - else - { - if (ParentForm.WindowState == FormWindowState.Normal) - graphics.DrawString("1", icoFont, new SolidBrush(Color.White), maxRectangle, StringAlign.Center); - else - graphics.DrawString("2", icoFont, new SolidBrush(Color.White), maxRectangle, StringAlign.Center); - } - } - - closeRectangle = new Rectangle(Width - 32, (Height - 16) / 2, 18, 18); - // - //关闭按钮 - // - if (closeRectangle.Contains(mousePoint)) - { - graphics.DrawString("r", icoFont, new SolidBrush(ThemeColors.Danger), closeRectangle, StringAlign.Center); - } - else - { - graphics.DrawString("r", icoFont, new SolidBrush(Color.White), closeRectangle, StringAlign.Center); - } - } - - base.OnPaint(e); - graphics.Dispose(); - e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic; - e.Graphics.DrawImageUnscaled(bitmap, 0, 0); - bitmap.Dispose(); - } - - public CrEaTiiOn_FlatStatusBar() - { - SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.OptimizedDoubleBuffer | ControlStyles.SupportsTransparentBackColor, true); - DoubleBuffered = true; - Font = new Font("Segoe UI", 12); - Height = 40; - Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top; - } - } -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Stick/CrEaTiiOn_JoyStick.cs b/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Stick/CrEaTiiOn_JoyStick.cs deleted file mode 100644 index 4c4cc2f..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Stick/CrEaTiiOn_JoyStick.cs +++ /dev/null @@ -1,482 +0,0 @@ -#region Imports - -using System; -using System.ComponentModel; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Windows.Forms; - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_JoyStick - - public class CrEaTiiOn_JoyStick : Control - { - public CrEaTiiOn_JoyStick() - { - base.Size = new Size(122, 122); - BackColor = Color.FromArgb(20, 20, 20); - BackgroundImage = new Bitmap(base.Width, base.Height); - ng = base.CreateGraphics(); - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - public Direction JoystickDirection => joystickDirection; - - [Category("CrEaTiiOn")] - [Browsable(true)] - public Control MovableObject - { - get => movableObject; - set => movableObject = value; - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - public bool KeepOnScreen - { - get => keepOnScreen; - set => keepOnScreen = value; - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - public int Sensitivity - { - get => sensitivity; - set - { - sensitivity = value; - - if (sensitivity > 10) - { - sensitivity = 10; - } - - if (sensitivity < 1) - { - sensitivity = 1; - } - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - public override Image BackgroundImage - { - get => backgroundImage; - set - { - backgroundImage = value; - backgroundImage = new Bitmap(BackgroundImage, new Size(base.Width, base.Height)); - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - public Color JoyStickColor - { - get => joyStickColor; - set - { - joyStickColor = value; - base.Invalidate(); - } - } - - private SmoothingMode _SmoothingType = SmoothingMode.AntiAlias; - [Category("CrEaTiiOn")] - [Browsable(true)] - public SmoothingMode SmoothingType - { - get => _SmoothingType; - set - { - _SmoothingType = value; - Invalidate(); - } - } - - protected override void OnMouseDown(MouseEventArgs e) - { - moveStick = true; - base.OnMouseDown(e); - } - - protected override void OnMouseMove(MouseEventArgs e) - { - if (moveStick) - { - int num; - - if (e.X - base.Width / 6 * 2 / 2 < 0) - { - num = 0; - } - else if (e.X - base.Width / 6 * 2 / 2 + base.Width / 6 * 2 > base.Width) - { - num = base.Width - base.Width / 6 * 2; - } - else - { - num = e.X - base.Width / 6 * 2 / 2; - } - - int num2; - - if (e.Y - base.Width / 6 * 2 / 2 < 0) - { - num2 = 0; - } - else if (e.Y - base.Width / 6 * 2 / 2 + base.Height / 6 * 2 > base.Height) - { - num2 = base.Height - base.Height / 6 * 2; - } - else - { - num2 = e.Y - base.Height / 6 * 2 / 2; - } - - int num3 = num + base.Width / 6; - int num4 = num2 + base.Height / 6; - - if (num4 < base.Height / 3 * 3) - { - if (num3 < base.Width / 3 * 3) - { - joystickDirection = Direction.LowerRight; - } - - if (num3 < base.Width / 3 * 2) - { - joystickDirection = Direction.LowerCenter; - } - - if (num3 < base.Width / 3) - { - joystickDirection = Direction.LowerLeft; - } - } - - if (num4 < base.Height / 3 * 2) - { - if (num3 < base.Width / 3 * 3) - { - joystickDirection = Direction.MiddleRight; - } - - if (num3 < base.Width / 3 * 2) - { - joystickDirection = Direction.MiddleCenter; - } - - if (num3 < base.Width / 3) - { - joystickDirection = Direction.MiddleLeft; - } - } - if (num4 < base.Height / 3) - { - if (num3 < base.Width / 3 * 3) - { - joystickDirection = Direction.UpperRight; - } - - if (num3 < base.Width / 3 * 2) - { - joystickDirection = Direction.UpperCenter; - } - - if (num3 < base.Width / 3) - { - joystickDirection = Direction.UpperLeft; - } - } - - OnDirectionChanged(); - - Image image = new Bitmap(base.Width, base.Height); - Graphics graphics = Graphics.FromImage(image); - - graphics.SmoothingMode = SmoothingType; - - graphics.FillRectangle(new SolidBrush(BackColor), -1, -1, base.Width + 1, base.Height + 1); - graphics.DrawImage(new Bitmap(BackgroundImage, new Size(base.Width, base.Height)), 0, 0); - graphics.FillPie(new SolidBrush(joyStickColor), new Rectangle(num, num2, base.Width / 6 * 2, base.Height / 6 * 2), 0f, 360f); - - ng.DrawImage(image, 0, 0); - - MoveObject(); - } - - base.OnMouseMove(e); - } - - protected override void OnMouseUp(MouseEventArgs e) - { - moveStick = false; - - joystickDirection = Direction.MiddleCenter; - - OnDirectionChanged(); - - Image image = new Bitmap(base.Width, base.Height); - Graphics graphics = Graphics.FromImage(image); - - graphics.SmoothingMode = SmoothingType; - - graphics.FillRectangle(new SolidBrush(BackColor), -1, -1, base.Width + 1, base.Height + 1); - graphics.DrawImage(new Bitmap(BackgroundImage, new Size(base.Width, base.Height)), 0, 0); - graphics.FillPie(new SolidBrush(joyStickColor), new Rectangle(base.Width / 6 * 2, base.Height / 6 * 2, base.Width / 6 * 2, base.Height / 6 * 2), 0f, 360f); - - ng.DrawImage(image, 0, 0); - - base.OnMouseUp(e); - } - - protected override void OnPaint(PaintEventArgs e) - { - Image image = new Bitmap(base.Width, base.Height); - Graphics graphics = Graphics.FromImage(image); - - graphics.SmoothingMode = SmoothingType; - - graphics.FillRectangle(new SolidBrush(BackColor), -1, -1, base.Width + 1, base.Height + 1); - graphics.DrawImage(new Bitmap(BackgroundImage, new Size(base.Width, base.Height)), 0, 0); - graphics.FillPie(new SolidBrush(joyStickColor), new Rectangle(base.Width / 6 * 2, base.Height / 6 * 2, base.Width / 6 * 2, base.Height / 6 * 2), 0f, 360f); - - graphics.DrawImage(image, 0, 0); - - e.Graphics.DrawImage(image, 0, 0); - - base.OnPaint(e); - } - - public event EventHandler DirectionChanged; - - protected virtual void OnDirectionChanged() - { - DirectionChanged?.Invoke(this, EventArgs.Empty); - } - - private void MoveObject() - { - if (movableObject != null) - { - if (keepOnScreen) - { - if (joystickDirection == Direction.UpperLeft) - { - if (movableObject.Location.X - sensitivity > -1) - { - movableObject.Location = new Point(movableObject.Location.X - sensitivity, movableObject.Location.Y); - } - else - { - movableObject.Location = new Point(0, movableObject.Location.Y); - } - - if (movableObject.Location.Y - sensitivity > -1) - { - movableObject.Location = new Point(movableObject.Location.X, movableObject.Location.Y - sensitivity); - } - else - { - movableObject.Location = new Point(movableObject.Location.X, 0); - } - } - - if (joystickDirection == Direction.UpperCenter) - { - if (movableObject.Location.Y - sensitivity > -1) - { - movableObject.Location = new Point(movableObject.Location.X, movableObject.Location.Y - sensitivity); - } - else - { - movableObject.Location = new Point(movableObject.Location.X, 0); - } - } - - if (joystickDirection == Direction.UpperRight) - { - if (movableObject.Location.X + movableObject.Width + sensitivity < movableObject.Parent.Width - 1) - { - movableObject.Location = new Point(movableObject.Location.X + sensitivity, movableObject.Location.Y); - } - else - { - movableObject.Location = new Point(movableObject.Parent.Width - movableObject.Width, movableObject.Location.Y); - } - - if (movableObject.Location.Y - sensitivity > -1) - { - movableObject.Location = new Point(movableObject.Location.X, movableObject.Location.Y - sensitivity); - } - else - { - movableObject.Location = new Point(movableObject.Location.X, 0); - } - } - - if (joystickDirection == Direction.MiddleLeft) - { - if (movableObject.Location.X - sensitivity > -1) - { - movableObject.Location = new Point(movableObject.Location.X - sensitivity, movableObject.Location.Y); - } - else - { - movableObject.Location = new Point(0, movableObject.Location.Y); - } - } - - if (joystickDirection == Direction.MiddleRight) - { - if (movableObject.Location.X + movableObject.Width + sensitivity < movableObject.Parent.Width - 1) - { - movableObject.Location = new Point(movableObject.Location.X + sensitivity, movableObject.Location.Y); - } - else - { - movableObject.Location = new Point(movableObject.Parent.Width - movableObject.Width, movableObject.Location.Y); - } - } - - if (joystickDirection == Direction.LowerLeft) - { - if (movableObject.Location.X - sensitivity > -1) - { - movableObject.Location = new Point(movableObject.Location.X - sensitivity, movableObject.Location.Y); - } - else - { - movableObject.Location = new Point(0, movableObject.Location.Y); - } - - if (movableObject.Location.Y + movableObject.Height + sensitivity < movableObject.Parent.Height - 1) - { - movableObject.Location = new Point(movableObject.Location.X, movableObject.Location.Y + sensitivity); - } - else - { - movableObject.Location = new Point(movableObject.Location.X, movableObject.Parent.Height - movableObject.Height); - } - } - - if (joystickDirection == Direction.LowerCenter) - { - if (movableObject.Location.Y + movableObject.Height + sensitivity < movableObject.Parent.Height - 1) - { - movableObject.Location = new Point(movableObject.Location.X, movableObject.Location.Y + sensitivity); - } - else - { - movableObject.Location = new Point(movableObject.Location.X, movableObject.Parent.Height - movableObject.Height); - } - } - - if (joystickDirection == Direction.LowerRight) - { - if (movableObject.Location.X + movableObject.Width + sensitivity < movableObject.Parent.Width - 1) - { - movableObject.Location = new Point(movableObject.Location.X + sensitivity, movableObject.Location.Y); - } - else - { - movableObject.Location = new Point(movableObject.Parent.Width - movableObject.Width, movableObject.Location.Y); - } - - if (movableObject.Location.Y + movableObject.Height + sensitivity < movableObject.Parent.Height - 1) - { - movableObject.Location = new Point(movableObject.Location.X, movableObject.Location.Y + sensitivity); - } - else - { - movableObject.Location = new Point(movableObject.Location.X, movableObject.Parent.Height - movableObject.Height); - } - } - } - else - { - if (joystickDirection == Direction.UpperCenter) - { - movableObject.Location = new Point(movableObject.Location.X, movableObject.Location.Y - sensitivity); - } - - if (joystickDirection == Direction.UpperLeft) - { - movableObject.Location = new Point(movableObject.Location.X - sensitivity, movableObject.Location.Y - sensitivity); - } - - if (joystickDirection == Direction.UpperRight) - { - movableObject.Location = new Point(movableObject.Location.X + sensitivity, movableObject.Location.Y - sensitivity); - } - - if (joystickDirection == Direction.MiddleLeft) - { - movableObject.Location = new Point(movableObject.Location.X - sensitivity, movableObject.Location.Y); - } - - if (joystickDirection == Direction.MiddleRight) - { - movableObject.Location = new Point(movableObject.Location.X + sensitivity, movableObject.Location.Y); - } - - if (joystickDirection == Direction.LowerLeft) - { - movableObject.Location = new Point(movableObject.Location.X - sensitivity, movableObject.Location.Y + sensitivity); - } - - if (joystickDirection == Direction.LowerCenter) - { - movableObject.Location = new Point(movableObject.Location.X, movableObject.Location.Y + sensitivity); - } - - if (joystickDirection == Direction.LowerRight) - { - movableObject.Location = new Point(movableObject.Location.X + sensitivity, movableObject.Location.Y + sensitivity); - } - } - - movableObject.Refresh(); - } - } - - private readonly Graphics ng; - - private Direction joystickDirection = Direction.MiddleCenter; - - private Control movableObject; - - private bool keepOnScreen = true; - - private int sensitivity = 3; - - private Image backgroundImage; - - private Color joyStickColor = Color.FromArgb(250, 36, 38); - - private bool moveStick; - - public enum Direction - { - UpperLeft, - MiddleLeft, - LowerLeft, - UpperCenter, - MiddleCenter, - LowerCenter, - UpperRight, - MiddleRight, - LowerRight - } - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Strip/CrEaTiiOn_ContextMenuStrip.cs b/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Strip/CrEaTiiOn_ContextMenuStrip.cs deleted file mode 100644 index 8750d64..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Strip/CrEaTiiOn_ContextMenuStrip.cs +++ /dev/null @@ -1,96 +0,0 @@ -#region Imports -using Microsoft.VisualBasic; -using System; -using System.Collections; -using System.Collections.Generic; -using System.Data; -using System.Diagnostics; -using System.Drawing.Drawing2D; -using System.Windows.Forms; -using System.Drawing; -using System.ComponentModel; -#endregion - -namespace CBH.Controls -{ - public class CrEaTiiOn_ContextMenuStrip : System.Windows.Forms.ContextMenuStrip - { - private Rectangle Rect; - - private Graphics G; - public CrEaTiiOn_ContextMenuStrip() - { - base.Renderer = Renderer; - } - - public CrEaTiiOn_ContextMenuStrip(IContainer container) : base(container) - { - } - - private void Renderer_PaintMenuBackground(object sender, ToolStripRenderEventArgs e) - { - G = e.Graphics; - - G.Clear(Color.FromArgb(44, 44, 43)); - } - - - private void Renderer_PaintMenuBorder(object sender, ToolStripRenderEventArgs e) - { - G = e.Graphics; - - using (Pen Border = new Pen(Color.FromArgb(42, 42, 41))) - { - G.DrawRectangle(Border, new Rectangle(e.AffectedBounds.X, e.AffectedBounds.Y, e.AffectedBounds.Width - 1, e.AffectedBounds.Height - 1)); - } - } - - private void Renderer_PaintItemArrow(object sender, ToolStripArrowRenderEventArgs e) - { - G = e.Graphics; - - using (Font TextFont = new Font("Marlett", 12)) - { - using (SolidBrush TextBrush = new SolidBrush(Color.FromArgb(200, 200, 200))) - { - G.DrawString("8", TextFont, TextBrush, new Point(e.ArrowRectangle.X - 2, e.ArrowRectangle.Y + 1)); - } - } - } - - private void Renderer_PaintItemImage(object sender, ToolStripItemImageRenderEventArgs e) - { - G = e.Graphics; - - G.DrawImage(e.Image, new Rectangle(4, 1, 16, 16)); - } - - private void Renderer_PaintItemText(object sender, ToolStripItemTextRenderEventArgs e) - { - G = e.Graphics; - - using (Font ItemFont = new Font("Segoe UI", 9)) - { - using (SolidBrush ItemBrush = new SolidBrush(Color.FromArgb(220, 220, 220))) - { - G.DrawString(e.Text, ItemFont, ItemBrush, new Point(e.TextRectangle.X, e.TextRectangle.Y)); - } - } - } - - private void Renderer_PaintItemBackground(object sender, ToolStripItemRenderEventArgs e) - { - G = e.Graphics; - - Rect = e.Item.ContentRectangle; - - if (e.Item.Selected) - { - using (SolidBrush Fill = new SolidBrush(Color.FromArgb(54, 54, 53))) - { - G.FillRectangle(Fill, new Rectangle(Rect.X - 1, Rect.Y - 1, Rect.Width + 4, Rect.Height - 1)); - } - } - } - } -} diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Strip/CrEaTiiOn_FlatContextMenuStrip.cs b/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Strip/CrEaTiiOn_FlatContextMenuStrip.cs deleted file mode 100644 index 7f65d30..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Strip/CrEaTiiOn_FlatContextMenuStrip.cs +++ /dev/null @@ -1,70 +0,0 @@ -#region Imports -using System; -using System.ComponentModel; -using System.Drawing; -using System.Drawing.Text; -using System.Windows.Forms; -#endregion - -namespace CBH.Controls -{ - public class CrEaTiiOn_FlatContextMenuStrip : ContextMenuStrip - { - protected override void OnTextChanged( EventArgs e ) - { - base.OnTextChanged( e ); - Invalidate(); - } - - public CrEaTiiOn_FlatContextMenuStrip() - : base() - { - Renderer = new ToolStripProfessionalRenderer( new TColorTable() ); - ShowImageMargin = false; - ForeColor = Color.White; - Font = new Font( "Tahoma", 8 ); - } - - protected override void OnPaint( PaintEventArgs e ) - { - base.OnPaint( e ); - e.Graphics.TextRenderingHint = TextRenderingHint.ClearTypeGridFit; - } - - public class TColorTable : ProfessionalColorTable - { - [Category( "Colors" )] - public Color _BackColor { get; set; } = Color.FromArgb( 24, 22, 43 ); - - [Category( "Colors" )] - public Color _CheckedColor { get; set; } = Color.FromArgb(250, 36, 38); - - [Category( "Colors" )] - public Color _BorderColor { get; set; } = Color.FromArgb( 53, 58, 60 ); - - public override Color ButtonSelectedBorder => _BackColor; - - public override Color CheckBackground => _CheckedColor; - - public override Color CheckPressedBackground => _CheckedColor; - - public override Color CheckSelectedBackground => _CheckedColor; - - public override Color ImageMarginGradientBegin => _CheckedColor; - - public override Color ImageMarginGradientEnd => _CheckedColor; - - public override Color ImageMarginGradientMiddle => _CheckedColor; - - public override Color MenuBorder => _BorderColor; - - public override Color MenuItemBorder => _BorderColor; - - public override Color MenuItemSelected => _CheckedColor; - - public override Color SeparatorDark => _BorderColor; - - public override Color ToolStripDropDownBackground => _BackColor; - } - } -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Strip/Support/StripRenderer.cs b/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Strip/Support/StripRenderer.cs deleted file mode 100644 index 8c61f4d..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Strip/Support/StripRenderer.cs +++ /dev/null @@ -1,108 +0,0 @@ -using Microsoft.VisualBasic; -using System; -using System.Collections; -using System.Collections.Generic; -using System.Data; -using System.Diagnostics; -using System.Drawing.Drawing2D; -using System.Windows.Forms; -using System.Drawing; - -namespace CBH_Ultimate_Theme_Library.Theme.Controls.Strip.Support -{ - public class cStripRenderer : ToolStripRenderer - { - - public event PaintMenuBackgroundEventHandler PaintMenuBackground; - public delegate void PaintMenuBackgroundEventHandler(object sender, ToolStripRenderEventArgs e); - public event PaintMenuBorderEventHandler PaintMenuBorder; - public delegate void PaintMenuBorderEventHandler(object sender, ToolStripRenderEventArgs e); - public event PaintMenuImageMarginEventHandler PaintMenuImageMargin; - public delegate void PaintMenuImageMarginEventHandler(object sender, ToolStripRenderEventArgs e); - public event PaintItemCheckEventHandler PaintItemCheck; - public delegate void PaintItemCheckEventHandler(object sender, ToolStripItemImageRenderEventArgs e); - public event PaintItemImageEventHandler PaintItemImage; - public delegate void PaintItemImageEventHandler(object sender, ToolStripItemImageRenderEventArgs e); - public event PaintItemTextEventHandler PaintItemText; - public delegate void PaintItemTextEventHandler(object sender, ToolStripItemTextRenderEventArgs e); - public event PaintItemBackgroundEventHandler PaintItemBackground; - public delegate void PaintItemBackgroundEventHandler(object sender, ToolStripItemRenderEventArgs e); - public event PaintItemArrowEventHandler PaintItemArrow; - public delegate void PaintItemArrowEventHandler(object sender, ToolStripArrowRenderEventArgs e); - public event PaintSeparatorEventHandler PaintSeparator; - public delegate void PaintSeparatorEventHandler(object sender, ToolStripSeparatorRenderEventArgs e); - - protected override void OnRenderToolStripBackground(ToolStripRenderEventArgs e) - { - if (PaintMenuBackground != null) - { - PaintMenuBackground(this, e); - } - } - - protected override void OnRenderImageMargin(ToolStripRenderEventArgs e) - { - if (PaintMenuImageMargin != null) - { - PaintMenuImageMargin(this, e); - } - } - - protected override void OnRenderToolStripBorder(ToolStripRenderEventArgs e) - { - if (PaintMenuBorder != null) - { - PaintMenuBorder(this, e); - } - } - - protected override void OnRenderItemCheck(ToolStripItemImageRenderEventArgs e) - { - if (PaintItemCheck != null) - { - PaintItemCheck(this, e); - } - } - - protected override void OnRenderItemImage(ToolStripItemImageRenderEventArgs e) - { - if (PaintItemImage != null) - { - PaintItemImage(this, e); - } - } - - protected override void OnRenderItemText(ToolStripItemTextRenderEventArgs e) - { - if (PaintItemText != null) - { - PaintItemText(this, e); - } - } - - protected override void OnRenderMenuItemBackground(ToolStripItemRenderEventArgs e) - { - if (PaintItemBackground != null) - { - PaintItemBackground(this, e); - } - } - - protected override void OnRenderArrow(ToolStripArrowRenderEventArgs e) - { - if (PaintItemArrow != null) - { - PaintItemArrow(this, e); - } - } - - protected override void OnRenderSeparator(ToolStripSeparatorRenderEventArgs e) - { - if (PaintSeparator != null) - { - PaintSeparator(this, e); - } - } - - } -} diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/TabControl/CrEaTiiOn_FlatTabControl.cs b/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/TabControl/CrEaTiiOn_FlatTabControl.cs deleted file mode 100644 index 824b811..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/TabControl/CrEaTiiOn_FlatTabControl.cs +++ /dev/null @@ -1,111 +0,0 @@ -#region Imports -using CBH_Ultimate_Theme_Library.Theme.Helpers; -using System; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Drawing.Text; -using System.Windows.Forms; -#endregion - -namespace CBH.Controls -{ - public class CrEaTiiOn_FlatTabControl : TabControl - { - #region 变量 - int enterIndex; - bool enterFlag = false; - - #endregion - - #region 属性 - - private Color _themeColor = ThemeColors.PrimaryColor; - public Color ThemeColor - { - get { return _themeColor; } - set - { - _themeColor = value; - Invalidate(); - } - } - #endregion - - public override Rectangle DisplayRectangle - { - get - { - Rectangle rect = base.DisplayRectangle; - return new Rectangle(rect.Left - 4, rect.Top - 4, rect.Width + 8, rect.Height + 8); - } - } - - protected override CreateParams CreateParams - { - get - { - CreateParams cp = base.CreateParams; - cp.ExStyle |= 0x02000000; - return cp; - } - } - - protected override void OnMouseMove(MouseEventArgs e) - { - base.OnMouseMove(e); - enterFlag = true; - for (int i = 0; i < TabCount; i++) - { - var tempRect = GetTabRect(i); - if (tempRect.Contains(e.Location)) - { - enterIndex = i; - } - } - Invalidate(); - } - - protected override void OnMouseLeave(EventArgs e) - { - base.OnMouseLeave(e); - enterFlag = false; - Invalidate(); - } - - protected override void OnPaint(PaintEventArgs e) - { - var graphics = e.Graphics; - graphics.SmoothingMode = SmoothingMode.HighQuality; - graphics.PixelOffsetMode = PixelOffsetMode.HighQuality; - graphics.TextRenderingHint = TextRenderingHint.ClearTypeGridFit; - graphics.Clear(Parent.BackColor); - - for (int i = 0; i < TabCount; i++) - { - if (i == SelectedIndex) - { - graphics.FillRectangle(new SolidBrush(_themeColor), GetTabRect(i).X + 3, ItemSize.Height - 3, ItemSize.Width - 6, 3); - graphics.DrawString(TabPages[i].Text.ToUpper(), Font, new SolidBrush(_themeColor), GetTabRect(i), StringAlign.Center); - } - else - { - if (i == enterIndex && enterFlag) - { - graphics.FillRectangle(new SolidBrush(Color.FromArgb(250, 36, 38)), GetTabRect(i).X + 3, ItemSize.Height - 3, ItemSize.Width - 6, 3); - } - - graphics.DrawString(TabPages[i].Text.ToUpper(), Font, new SolidBrush(Color.Black), GetTabRect(i), StringAlign.Center); - } - } - } - - public CrEaTiiOn_FlatTabControl() - { - SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.OptimizedDoubleBuffer, true); - DoubleBuffered = true; - Font = new Font("Segoe UI", 12F); - SizeMode = TabSizeMode.Fixed; - ItemSize = new Size(120, 40); - } - } -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/TabControl/CrEaTiiOn_MetroTabControl.cs b/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/TabControl/CrEaTiiOn_MetroTabControl.cs deleted file mode 100644 index 73f10f7..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/TabControl/CrEaTiiOn_MetroTabControl.cs +++ /dev/null @@ -1,90 +0,0 @@ -#region Imports -using System; -using System.Drawing.Drawing2D; -using System.Drawing; -using System.Windows.Forms; -using System.Runtime.InteropServices; - -#endregion - -namespace Zeroit.Framework.UIThemes.AdvancedCore -{ - - public class CrEaTiiOn_MetroTabControl : TabControl - { - [DllImport("Gdi32.dll", EntryPoint = "CreateRoundRectRgn")] - private static extern IntPtr CreateRoundRectRgn - ( - int nLeftRect, // x-coordinate of upper-left corner - int nTopRect, // y-coordinate of upper-left corner - int nRightRect, // x-coordinate of lower-right corner - int nBottomRect, // y-coordinate of lower-right corner - int nWidthEllipse, // width of ellipse - int nHeightEllipse // height of ellipse - ); - - public CrEaTiiOn_MetroTabControl() - { - SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.ResizeRedraw | ControlStyles.UserPaint | ControlStyles.DoubleBuffer, true); - ItemSize = new Size(0, 34); - Padding = new Point(24, 0); - Font = new Font("Segoe UI", 12); - } - - protected override void CreateHandle() - { - base.CreateHandle(); - Alignment = TabAlignment.Top; - } - - protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) - { - base.OnPaint(e); - - Graphics G = e.Graphics; - - G.SmoothingMode = SmoothingMode.HighQuality; - G.Clear(Parent.BackColor); - - Color FontColor = new Color(); - - - for (int i = 0; i <= TabCount - 1; i++) - { - Rectangle mainRect = GetTabRect(i); - - if (i == SelectedIndex) - { - FontColor = Color.White; - G.DrawLine(new Pen(Color.FromArgb(250, 36, 38)), new Point(mainRect.X - 2, mainRect.Height - 1), new Point(mainRect.X + mainRect.Width - 2, mainRect.Height - 1)); - G.DrawLine(new Pen(Color.FromArgb(250, 36, 38)), new Point(mainRect.X - 2, mainRect.Height), new Point(mainRect.X + mainRect.Width - 2, mainRect.Height)); - } - else - { - FontColor = Color.White; - G.DrawLine(new Pen(Color.FromArgb(250, 36, 38)), new Point(mainRect.X - 2, mainRect.Height - 1), new Point(mainRect.X + mainRect.Width - 2, mainRect.Height - 1)); - G.DrawLine(new Pen(Color.FromArgb(250, 36, 38)), new Point(mainRect.X - 2, mainRect.Height), new Point(mainRect.X + mainRect.Width - 2, mainRect.Height)); - } - - if (i != 0) - { - G.DrawLine(new Pen(Color.FromArgb(250, 36, 38)), new Point(mainRect.X - 4, mainRect.Height - 7), new Point(mainRect.X + 4, mainRect.Y + 6)); - } - - int titleX = (mainRect.Location.X + mainRect.Width / 2) - Convert.ToInt32((G.MeasureString(TabPages[i].Text, Font).Width / 2)); - int titleY = (mainRect.Location.Y + mainRect.Height / 2) - Convert.ToInt32((G.MeasureString(TabPages[i].Text, Font).Height / 2)); - G.DrawString(TabPages[i].Text, Font, new SolidBrush(FontColor), new Point(titleX, titleY)); - - try - { - TabPages[i].BackColor = Parent.BackColor; - } - catch - { - } - - } - Region = System.Drawing.Region.FromHrgn(CreateRoundRectRgn(0, 0, Width, Height, 10, 10)); - } - } -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/TabControl/CrEaTiiOn_ModernTabControl.cs b/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/TabControl/CrEaTiiOn_ModernTabControl.cs deleted file mode 100644 index 92f645f..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/TabControl/CrEaTiiOn_ModernTabControl.cs +++ /dev/null @@ -1,102 +0,0 @@ -#region Imports -using Microsoft.VisualBasic; -using System; -using System.Collections; -using System.Collections.Generic; -using System.Data; -using System.Diagnostics; -using System.Drawing.Drawing2D; -using System.Windows.Forms; -using System.Drawing; -#endregion - -namespace CBH.Controls -{ - public class CrEaTiiOn_ModernTabControl : TabControl - { - - private Graphics G; - - private Rectangle Rect; - public CrEaTiiOn_ModernTabControl() - { - DoubleBuffered = true; - SizeMode = TabSizeMode.Fixed; - Alignment = TabAlignment.Left; - ItemSize = new Size(40, 170); - SetStyle(ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.Opaque | ControlStyles.OptimizedDoubleBuffer, true); - } - - protected override void OnHandleCreated(EventArgs e) - { - foreach (CrEaTiiOn_ModernTabPage T in TabPages) - { - T.Font = new Font("Segoe UI", 9); - T.ForeColor = Color.FromArgb(220, 220, 220); - T.BackColor = Color.FromArgb(20, 20, 20); - } - - base.OnHandleCreated(e); - } - - protected override void OnPaint(PaintEventArgs e) - { - G = e.Graphics; - - G.Clear(Color.FromArgb(20, 20, 20)); - - using (Pen Right = new Pen(Color.FromArgb(250, 36, 38))) - { - G.DrawLine(Right, ItemSize.Height + 3, 4, ItemSize.Height + 3, Height - 5); - } - - for (int T = 0; T <= TabPages.Count - 1; T++) - { - Rect = GetTabRect(T); - - if (SelectedIndex == T) - { - using (SolidBrush Selection = new SolidBrush(Color.FromArgb(250, 36, 38))) - { - G.FillRectangle(Selection, new Rectangle(Rect.X - 4, Rect.Y + 2, Rect.Width + 6, Rect.Height - 2)); - } - - using (SolidBrush TextBrush = new SolidBrush(Color.FromArgb(220, 220, 219))) - { - using (Font TextFont = new Font("Segoe UI", 10)) - { - G.DrawString(TabPages[T].Text, TextFont, TextBrush, new Point(Rect.X + 45, Rect.Y + 11)); - } - } - - using (Pen Line = new Pen(Color.FromArgb(250, 36, 38))) - { - G.DrawLine(Line, Rect.X - 2, Rect.Y + 1, Rect.Width + 4, Rect.Y + 1); - G.DrawLine(Line, Rect.X - 2, Rect.Y + 39, Rect.Width + 4, Rect.Y + 39); - } - - } - else - { - using (SolidBrush TextBrush = new SolidBrush(Color.FromArgb(180, 180, 179))) - { - using (Font TextFont = new Font("Segoe UI", 10)) - { - G.DrawString(TabPages[T].Text, TextFont, TextBrush, new Point(Rect.X + 45, Rect.Y + 11)); - } - } - } - - if ((ImageList != null)) - { - if (!(TabPages[T].ImageIndex < 0)) - { - G.DrawImage(ImageList.Images[TabPages[T].ImageIndex], new Rectangle(Rect.X + 18, Rect.Y + 12, 16, 16)); - } - } - } - - base.OnPaint(e); - } - } -} diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/TabPage/CrEaTiiOn_TabPage.cs b/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/TabPage/CrEaTiiOn_TabPage.cs deleted file mode 100644 index a8473d5..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/TabPage/CrEaTiiOn_TabPage.cs +++ /dev/null @@ -1,162 +0,0 @@ -#region Imports - -using System.Drawing; -using System.Windows.Forms; - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_TabPage - - public class CrEaTiiOn_TabPage : TabControl - { - public CrEaTiiOn_TabPage() - { - SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.ResizeRedraw | ControlStyles.UserPaint | ControlStyles.DoubleBuffer, true); - DoubleBuffered = true; - SizeMode = TabSizeMode.Fixed; - ItemSize = new(30, 115); - } - protected override void CreateHandle() - { - base.CreateHandle(); - Alignment = TabAlignment.Left; - } - - private Color C1 = Color.FromArgb(250, 36, 38); - public Color SquareColor - { - get => C1; - set - { - C1 = value; - Invalidate(); - } - } - - private bool OB = false; - public bool ShowOuterBorders - { - get => OB; - set - { - OB = value; - Invalidate(); - } - } - - protected override void OnPaint(PaintEventArgs e) - { - Bitmap B = new(Width, Height); - Graphics G = Graphics.FromImage(B); - try - { - SelectedTab.BackColor = Color.FromArgb(15, 15, 15); - } - catch - { - } - G.Clear(Color.FromArgb(20, 20, 20)); - for (int i = 0; i <= TabCount - 1; i++) - { - Rectangle x2 = new(new Point(GetTabRect(i).Location.X - 2, GetTabRect(i).Location.Y - 2), new Size(GetTabRect(i).Width + 3, GetTabRect(i).Height - 1)); - Rectangle textrectangle = new(x2.Location.X + 20, x2.Location.Y, x2.Width - 20, x2.Height); - if (i == SelectedIndex) - { - G.FillRectangle(new SolidBrush(C1), new Rectangle(x2.Location, new Size(9, x2.Height))); - - - if (ImageList != null) - { - try - { - if (ImageList.Images[TabPages[i].ImageIndex] != null) - { - G.DrawImage(ImageList.Images[TabPages[i].ImageIndex], new Point(textrectangle.Location.X + 8, textrectangle.Location.Y + 6)); - G.DrawString(" " + TabPages[i].Text, Font, Brushes.White, textrectangle, new StringFormat - { - LineAlignment = StringAlignment.Center, - Alignment = StringAlignment.Near - }); - } - else - { - G.DrawString(TabPages[i].Text, Font, Brushes.White, textrectangle, new StringFormat - { - LineAlignment = StringAlignment.Center, - Alignment = StringAlignment.Near - }); - } - } - catch - { - G.DrawString(TabPages[i].Text, Font, Brushes.White, textrectangle, new StringFormat - { - LineAlignment = StringAlignment.Center, - Alignment = StringAlignment.Near - }); - } - } - else - { - G.DrawString(TabPages[i].Text, Font, Brushes.White, textrectangle, new StringFormat - { - LineAlignment = StringAlignment.Center, - Alignment = StringAlignment.Near - }); - } - - } - else - { - if (ImageList != null) - { - try - { - if (ImageList.Images[TabPages[i].ImageIndex] != null) - { - G.DrawImage(ImageList.Images[TabPages[i].ImageIndex], new Point(textrectangle.Location.X + 8, textrectangle.Location.Y + 6)); - G.DrawString(" " + TabPages[i].Text, Font, Brushes.White, textrectangle, new StringFormat - { - LineAlignment = StringAlignment.Center, - Alignment = StringAlignment.Near - }); - } - else - { - G.DrawString(TabPages[i].Text, Font, Brushes.White, textrectangle, new StringFormat - { - LineAlignment = StringAlignment.Center, - Alignment = StringAlignment.Near - }); - } - } - catch - { - G.DrawString(TabPages[i].Text, Font, Brushes.White, textrectangle, new StringFormat - { - LineAlignment = StringAlignment.Center, - Alignment = StringAlignment.Near - }); - } - } - else - { - G.DrawString(TabPages[i].Text, Font, Brushes.White, textrectangle, new StringFormat - { - LineAlignment = StringAlignment.Center, - Alignment = StringAlignment.Near - }); - } - } - } - - e.Graphics.DrawImage((Image)B.Clone(), 0, 0); - G.Dispose(); - B.Dispose(); - } - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/TextBox/CrEaTiiOn_ModernTextBox.Designer.cs b/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/TextBox/CrEaTiiOn_ModernTextBox.Designer.cs deleted file mode 100644 index 6aa411e..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/TextBox/CrEaTiiOn_ModernTextBox.Designer.cs +++ /dev/null @@ -1,72 +0,0 @@ -namespace CBH.RJControls -{ - partial class CrEaTiiOn_ModernTextBox - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Component Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.textBox1 = new System.Windows.Forms.TextBox(); - this.SuspendLayout(); - // - // textBox1 - // - this.textBox1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20))))); - this.textBox1.BorderStyle = System.Windows.Forms.BorderStyle.None; - this.textBox1.Dock = System.Windows.Forms.DockStyle.Fill; - this.textBox1.ForeColor = System.Drawing.Color.White; - this.textBox1.Location = new System.Drawing.Point(7, 7); - this.textBox1.Name = "textBox1"; - this.textBox1.Size = new System.Drawing.Size(236, 15); - this.textBox1.TabIndex = 0; - this.textBox1.Click += new System.EventHandler(this.textBox1_Click); - this.textBox1.TextChanged += new System.EventHandler(this.textBox1_TextChanged); - this.textBox1.Enter += new System.EventHandler(this.textBox1_Enter); - this.textBox1.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBox1_KeyPress); - this.textBox1.Leave += new System.EventHandler(this.textBox1_Leave); - this.textBox1.MouseEnter += new System.EventHandler(this.textBox1_MouseEnter); - this.textBox1.MouseLeave += new System.EventHandler(this.textBox1_MouseLeave); - // - // CrEaTiiOn_ModernTextBox - // - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; - this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20))))); - this.Controls.Add(this.textBox1); - this.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - this.ForeColor = System.Drawing.Color.White; - this.Margin = new System.Windows.Forms.Padding(4); - this.Name = "CrEaTiiOn_ModernTextBox"; - this.Padding = new System.Windows.Forms.Padding(7); - this.Size = new System.Drawing.Size(250, 30); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.TextBox textBox1; - } -} diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/TextBoxEdit/CrEaTiiOn_TextPosition.cs b/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/TextBoxEdit/CrEaTiiOn_TextPosition.cs deleted file mode 100644 index 4eaa960..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/TextBoxEdit/CrEaTiiOn_TextPosition.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace CBH.Controls -{ - public enum CrEaTiiOn_TextPosition - { - Left, - Right, - Center, - Sliding, - None, - } -} diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Toggle/CrEaTiiOn_ModernToggleButton.cs b/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Toggle/CrEaTiiOn_ModernToggleButton.cs deleted file mode 100644 index 744faa7..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Toggle/CrEaTiiOn_ModernToggleButton.cs +++ /dev/null @@ -1,165 +0,0 @@ -#region Imports -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.ComponentModel; -#endregion - -namespace CBH.Controls -{ - public class CrEaTiiOn_ModernToggleButton : CheckBox - { - //Fields - private Color onBackColor = Color.FromArgb(250, 36, 38); - private Color onToggleColor = Color.WhiteSmoke; - private Color offBackColor = Color.Gray; - private Color offToggleColor = Color.Gainsboro; - private bool solidStyle = true; - - //Properties - [Category("CrEaTiiOn")] - public Color OnBackColor - { - get - { - return onBackColor; - } - - set - { - onBackColor = value; - this.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - public Color OnToggleColor - { - get - { - return onToggleColor; - } - - set - { - onToggleColor = value; - this.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - public Color OffBackColor - { - get - { - return offBackColor; - } - - set - { - offBackColor = value; - this.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - public Color OffToggleColor - { - get - { - return offToggleColor; - } - - set - { - offToggleColor = value; - this.Invalidate(); - } - } - - [Browsable(false)] - public override string Text - { - get - { - return base.Text; - } - - set - { - - } - } - - [Category("CrEaTiiOn")] - [DefaultValue(true)] - public bool SolidStyle - { - get - { - return solidStyle; - } - - set - { - solidStyle = value; - this.Invalidate(); - } - } - - //Constructor - public CrEaTiiOn_ModernToggleButton() - { - this.MinimumSize = new Size(45, 22); - } - - //Methods - private GraphicsPath GetFigurePath() - { - int arcSize = this.Height - 1; - Rectangle leftArc = new Rectangle(0, 0, arcSize, arcSize); - Rectangle rightArc = new Rectangle(this.Width - arcSize - 2, 0, arcSize, arcSize); - - GraphicsPath path = new GraphicsPath(); - path.StartFigure(); - path.AddArc(leftArc, 90, 180); - path.AddArc(rightArc, 270, 180); - path.CloseFigure(); - - return path; - } - - protected override void OnPaint(PaintEventArgs pevent) - { - int toggleSize = this.Height - 5; - pevent.Graphics.SmoothingMode = SmoothingMode.AntiAlias; - pevent.Graphics.Clear(this.Parent.BackColor); - - if (this.Checked) //ON - { - //Draw the control surface - if (solidStyle) - pevent.Graphics.FillPath(new SolidBrush(onBackColor), GetFigurePath()); - else pevent.Graphics.DrawPath(new Pen(onBackColor,2), GetFigurePath()); - //Draw the toggle - pevent.Graphics.FillEllipse(new SolidBrush(onToggleColor), - new Rectangle(this.Width - this.Height + 1, 2, toggleSize, toggleSize)); - } - else //OFF - { - //Draw the control surface - if(solidStyle) - pevent.Graphics.FillPath(new SolidBrush(offBackColor), GetFigurePath()); - else pevent.Graphics.DrawPath(new Pen(offBackColor, 2), GetFigurePath()); - //Draw the toggle - pevent.Graphics.FillEllipse(new SolidBrush(offToggleColor), - new Rectangle(2, 2, toggleSize, toggleSize)); - } - } - } -} diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Toggle/CrEaTiiOn_ToggleButton.cs b/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Toggle/CrEaTiiOn_ToggleButton.cs deleted file mode 100644 index c007ad2..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Toggle/CrEaTiiOn_ToggleButton.cs +++ /dev/null @@ -1,121 +0,0 @@ -#region Imports -using System.ComponentModel; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Windows.Forms; -#endregion - -namespace CBH.Controls -{ - public class CrEaTiiOn_Ultimate_ToggleButton : CheckBox - { - private Color onBackColor = Color.FromArgb(250, 36, 38); - private Color onToggleColor = Color.Black; - private Color offBackColor = Color.Gray; - private Color offToggleColor = Color.Gainsboro; - private bool solidStyle = true; - - [Category("CrEaTiiOn")] - public Color OnBackColor - { - get => this.onBackColor; - set - { - this.onBackColor = value; - this.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - public Color OnToggleColor - { - get => this.onToggleColor; - set - { - this.onToggleColor = value; - this.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - public Color OffBackColor - { - get => this.offBackColor; - set - { - this.offBackColor = value; - this.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - public Color OffToggleColor - { - get => this.offToggleColor; - set - { - this.offToggleColor = value; - this.Invalidate(); - } - } - - [Browsable(false)] - public override string Text - { - get => base.Text; - set - { - } - } - - [Category("CrEaTiiOn")] - [DefaultValue(true)] - public bool SolidStyle - { - get => this.solidStyle; - set - { - this.solidStyle = value; - this.Invalidate(); - } - } - - public CrEaTiiOn_Ultimate_ToggleButton() => this.MinimumSize = new Size(45, 22); - - private GraphicsPath GetFigurePath() - { - int num = this.Height - 1; - Rectangle rect1 = new Rectangle(0, 0, num, num); - Rectangle rect2 = new Rectangle(this.Width - num - 2, 0, num, num); - GraphicsPath figurePath = new GraphicsPath(); - figurePath.StartFigure(); - figurePath.AddArc(rect1, 90f, 180f); - figurePath.AddArc(rect2, 270f, 180f); - figurePath.CloseFigure(); - return figurePath; - } - - protected override void OnPaint(PaintEventArgs pevent) - { - int num = this.Height - 5; - pevent.Graphics.SmoothingMode = SmoothingMode.AntiAlias; - pevent.Graphics.Clear(this.Parent.BackColor); - if (this.Checked) - { - if (this.solidStyle) - pevent.Graphics.FillPath((Brush) new SolidBrush(this.onBackColor), this.GetFigurePath()); - else - pevent.Graphics.DrawPath(new Pen(this.onBackColor, 2f), this.GetFigurePath()); - pevent.Graphics.FillEllipse((Brush) new SolidBrush(this.onToggleColor), new Rectangle(this.Width - this.Height + 1, 2, num, num)); - } - else - { - if (this.solidStyle) - pevent.Graphics.FillPath((Brush) new SolidBrush(this.offBackColor), this.GetFigurePath()); - else - pevent.Graphics.DrawPath(new Pen(this.offBackColor, 2f), this.GetFigurePath()); - pevent.Graphics.FillEllipse((Brush) new SolidBrush(this.offToggleColor), new Rectangle(2, 2, num, num)); - } - } - } -} diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Watcher/CrEaTiiOn_ExtendedFileSystemWatcher.cs b/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Watcher/CrEaTiiOn_ExtendedFileSystemWatcher.cs deleted file mode 100644 index c9f0c04..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Watcher/CrEaTiiOn_ExtendedFileSystemWatcher.cs +++ /dev/null @@ -1,268 +0,0 @@ -#region Imports - -using System; -using System.ComponentModel; -using System.IO; -using System.Windows.Forms; -using SysAction = System.Action; - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_ExtendedFileSystemWatcher - - public class CrEaTiiOn_ExtendedFileSystemWatcher : Component - { - public CrEaTiiOn_ExtendedFileSystemWatcher() - { - watcher.NotifyFilter = NotifyFilters.FileName | NotifyFilters.DirectoryName | NotifyFilters.Attributes | NotifyFilters.Size | NotifyFilters.LastWrite | NotifyFilters.LastAccess | NotifyFilters.CreationTime | NotifyFilters.Security; - watcher.Filter = "*.*"; - watcher.IncludeSubdirectories = true; - watcher.Created += OnCreated; - watcher.Changed += OnChanged; - watcher.Deleted += OnDeleted; - watcher.Renamed += OnRenamed; - watcher.EnableRaisingEvents = false; - watcher.InternalBufferSize = 131072; - } - - public event EventHandler ServiceStarted; - - protected virtual void OnServiceStarted() - { - ServiceStarted?.Invoke(this, null); - } - - public event EventHandler ServiceStopped; - - protected virtual void OnServiceStopped(FileSystemEventArgs e) - { - ServiceStopped?.Invoke(this, null); - } - - public event FileSystemEventHandler FileCreated; - - protected virtual void OnFileCreated(FileSystemEventArgs e) - { - FileCreated?.Invoke(this, e); - } - - public event FileSystemEventHandler FileDeleted; - - protected virtual void OnFileDeleted(FileSystemEventArgs e) - { - FileDeleted?.Invoke(this, e); - } - - public event FileSystemEventHandler FileChanged; - - protected virtual void OnFileChanged(FileSystemEventArgs e) - { - FileChanged?.Invoke(this, e); - } - - public event RenamedEventHandler FileRenamed; - - protected virtual void OnFileRenamed(RenamedEventArgs e) - { - FileRenamed?.Invoke(this, e); - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("Choose when the watcher updates")] - public NotifyFilters UpdateOn - { - get => watcher.NotifyFilter; - set => watcher.NotifyFilter = value; - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("Watch subdirectories")] - public bool WatchSubdirectories - { - get => watcher.IncludeSubdirectories; - set => watcher.IncludeSubdirectories = value; - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The path to watch")] - public string WatchPath - { - get => watcher.Path; - set - { - if (Directory.Exists(value)) - { - watcher.Path = value; - return; - } - if (File.Exists(value)) - { - watcher.Path = Path.GetDirectoryName(value); - watcher.Filter = Path.GetFileName(value); - } - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("Filter for certin files")] - public string Filters - { - get => watcher.Filter; - set => watcher.Filter = value; - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The control to output to(via Text)")] - public Control OutputControl - { - get => outputControl; - set => outputControl = value; - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("Remove WatchPath from output")] - public bool SlimOutput - { - get => slimOutput; - set => slimOutput = value; - } - - public void StartService() - { - ServiceStarted(this, null); - if (!watcher.EnableRaisingEvents) - { - watcher.EnableRaisingEvents = true; - } - } - - public void StopService() - { - ServiceStopped(this, null); - if (watcher.EnableRaisingEvents) - { - watcher.EnableRaisingEvents = false; - } - } - - private void OnChanged(object source, FileSystemEventArgs e) - { - DateTime lastWriteTime = File.GetLastWriteTime(e.FullPath); - if (lastWriteTime != lastRead && File.Exists(e.FullPath)) - { - lastRead = lastWriteTime; - if (slimOutput) - { - outputControl.Invoke(new SysAction(delegate () - { - outputControl.Text = outputControl.Text + "\nChanged: " + e.FullPath.Replace(watcher.Path, ""); - })); - } - else - { - outputControl.Invoke(new SysAction(delegate () - { - outputControl.Text = outputControl.Text + "\nChanged: " + e.FullPath; - })); - } - OnFileChanged(e); - } - } - - private void OnDeleted(object source, FileSystemEventArgs e) - { - DateTime lastWriteTime = File.GetLastWriteTime(e.FullPath); - lastRead = lastWriteTime; - if (slimOutput) - { - if (outputControl.InvokeRequired) - { - outputControl.Invoke(new SysAction(delegate () - { - outputControl.Text = outputControl.Text + "\nDeleted: " + e.FullPath.Replace(watcher.Path, ""); - })); - } - } - else if (outputControl.InvokeRequired) - { - outputControl.Invoke(new SysAction(delegate () - { - outputControl.Text = outputControl.Text + "\nDeleted: " + e.FullPath; - })); - } - OnFileDeleted(e); - } - - private void OnCreated(object source, FileSystemEventArgs e) - { - DateTime lastWriteTime = File.GetLastWriteTime(e.FullPath); - if (lastWriteTime != lastRead) - { - lastRead = lastWriteTime; - if (slimOutput) - { - if (outputControl.InvokeRequired) - { - outputControl.Invoke(new SysAction(delegate () - { - outputControl.Text = outputControl.Text + "\nCreated: " + e.FullPath.Replace(watcher.Path, ""); - })); - } - } - else if (outputControl.InvokeRequired) - { - outputControl.Invoke(new SysAction(delegate () - { - outputControl.Text = outputControl.Text + "\nCreated: " + e.FullPath; - })); - } - OnFileCreated(e); - } - } - - public void OnRenamed(object source, RenamedEventArgs e) - { - DateTime lastWriteTime = File.GetLastWriteTime(e.FullPath); - if (lastWriteTime != lastRead) - { - lastRead = lastWriteTime; - if (slimOutput) - { - if (outputControl.InvokeRequired) - { - outputControl.Invoke(new SysAction(delegate () - { - outputControl.Text = outputControl.Text + "\nRenamed: " + e.FullPath.Replace(watcher.Path, ""); - })); - } - } - else if (outputControl.InvokeRequired) - { - outputControl.Invoke(new SysAction(delegate () - { - outputControl.Text = outputControl.Text + "\nRenamed: " + e.FullPath; - })); - } - OnFileRenamed(e); - } - } - - private readonly FileSystemWatcher watcher = new(); - - private DateTime lastRead = DateTime.MinValue; - - private Control outputControl; - - private bool slimOutput = true; - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Helpers/Main/Helper/ThemeContainer.cs b/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Helpers/Main/Helper/ThemeContainer.cs deleted file mode 100644 index 0c3bccb..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Helpers/Main/Helper/ThemeContainer.cs +++ /dev/null @@ -1,148 +0,0 @@ -#region Imports -using System; -using System.Drawing.Drawing2D; -using System.ComponentModel; -using System.Drawing; -using System.Windows.Forms; -using CBH_Ultimate_Theme_Library.Theme.Helpers; -#endregion - -namespace CBH_Ultimate_Theme_Library -{ - - [ToolboxItem(false)] - public class ASCThemeContainer : ContainerControl - { - - private int moveHeight = 38; - private bool formCanMove = false; - private int mouseX; - private int mouseY; - private bool overExit; - - private bool overMin; - public override string Text { - get { return base.Text; } - set { - base.Text = value; - Invalidate(); - } - } - - public ASCThemeContainer() - { - SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.UserPaint | ControlStyles.ResizeRedraw, true); - Dock = DockStyle.Fill; - Font = new Font("Arial", 12, FontStyle.Bold | FontStyle.Italic); - BackColor = Color.FromArgb(15, 15, 15); - } - - protected override void CreateHandle() - { - base.CreateHandle(); - Parent.FindForm().FormBorderStyle = FormBorderStyle.None; - if (Parent.FindForm().TransparencyKey == null) - Parent.FindForm().TransparencyKey = Color.Fuchsia; - } - - protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) - { - base.OnPaint(e); - - Graphics G = e.Graphics; - G.Clear(Parent.FindForm().TransparencyKey); - - int slope = 8; - - Rectangle mainRect = new Rectangle(0, 0, Width - 1, Height - 1); - GraphicsPath mainPath = Drawing.RoundRect(mainRect, slope); - G.FillPath(new SolidBrush(BackColor), mainPath); - G.DrawPath(new Pen(Color.FromArgb(30, 35, 45)), mainPath); - G.FillPath(new SolidBrush(Color.FromArgb(30, 30, 40)), Drawing.RoundRect(new Rectangle(0, 0, Width - 1, moveHeight - slope), slope)); - G.FillRectangle(new SolidBrush(Color.FromArgb(30, 30, 40)), new Rectangle(0, moveHeight - (slope * 2), Width - 1, slope * 2)); - G.DrawLine(new Pen(Color.FromArgb(60, 60, 60)), new Point(1, moveHeight), new Point(Width - 2, moveHeight)); - G.SmoothingMode = SmoothingMode.HighQuality; - - int textX = 6; - int textY = (moveHeight / 2) - Convert.ToInt32((G.MeasureString(Text, Font).Height / 2)) + 1; - Size textSize = new Size(Convert.ToInt32(G.MeasureString(Text, Font).Width), Convert.ToInt32(G.MeasureString(Text, Font).Height)); - Rectangle textRect = new Rectangle(textX, textY, textSize.Width, textSize.Height); - LinearGradientBrush textBrush = new LinearGradientBrush(textRect, Color.FromArgb(185, 190, 195), Color.FromArgb(125, 125, 125), 90f); - G.DrawString(Text, Font, textBrush, new Point(textX, textY)); - - if (overExit) { - G.DrawString("r", new Font("Marlett", 12, FontStyle.Bold), new SolidBrush(Color.FromArgb(25, 100, 140)), new Point(Width - 27, 11)); - } else { - G.DrawString("r", new Font("Marlett", 12, FontStyle.Bold), new SolidBrush(Color.FromArgb(205, 210, 215)), new Point(Width - 27, 11)); - } - if (overMin) { - G.DrawString("0", new Font("Marlett", 12, FontStyle.Bold), new SolidBrush(Color.FromArgb(25, 100, 140)), new Point(Width - 47, 10)); - } else { - G.DrawString("0", new Font("Marlett", 12, FontStyle.Bold), new SolidBrush(Color.FromArgb(205, 210, 215)), new Point(Width - 47, 10)); - } - - if (DesignMode) - - Prevent.Prevents(G, Width, Height); - - } - - protected override void OnMouseMove(System.Windows.Forms.MouseEventArgs e) - { - base.OnMouseMove(e); - - if (formCanMove == true) { - Parent.FindForm().Location = new Point(MousePosition.X - mouseX, MousePosition.Y - mouseY); - } - - if (e.Y > 11 && e.Y < 24) { - if (e.X > Width - 23 && e.X < Width - 10) - overExit = true; - else - overExit = false; - if (e.X > Width - 44 && e.X < Width - 31) - overMin = true; - else - overMin = false; - } else { - overExit = false; - overMin = false; - } - - Invalidate(); - - } - - protected override void OnMouseDown(System.Windows.Forms.MouseEventArgs e) - { - base.OnMouseDown(e); - - mouseX = e.X; - mouseY = e.Y; - - if (e.Y <= moveHeight && overExit == false && overMin == false) - formCanMove = true; - - if (overExit) { - Parent.FindForm().Close(); - } else if (overMin) { - Parent.FindForm().WindowState = FormWindowState.Minimized; - overExit = false; - overMin = false; - } else { - Focus(); - } - - Invalidate(); - - } - - protected override void OnMouseUp(System.Windows.Forms.MouseEventArgs e) - { - base.OnMouseUp(e); - formCanMove = false; - } - - } - -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_FancyComboBox.cs b/CBH-Ultimate-Theme-Library-NET-Framework/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_FancyComboBox.cs deleted file mode 100644 index 8e690c3..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_FancyComboBox.cs +++ /dev/null @@ -1,203 +0,0 @@ -using System; -using System.ComponentModel; -using System.Drawing; -using System.Drawing.Design; -using System.Drawing.Drawing2D; -using System.Windows.Forms; - -namespace CBH.Ultimate.Controls -{ - [DefaultEvent("OnSelectedIndexChanged")] - public sealed class CrEaTiiOn_Ultimate_FancyComboBox : UserControl - { - private Color _backColor = Color.FromArgb(20, 20, 20); - private Color _iconColor = Color.White; - private Color _listBackColor = Color.FromArgb(15, 15, 15); - private Color _listForeColor = Color.White; - private Color _borderColor = Color.FromArgb(250, 36, 38); - private int _borderSize = 1; - - private ComboBox _comboList; - private Label _labelString; - private Button _buttonIcon; - - [Category("CrEaTiiOn")] - public new Color BackColor { get => _backColor; set { _backColor = value; _labelString.BackColor = _backColor; _buttonIcon.BackColor = _backColor; } } - [Category("CrEaTiiOn")] - public Color IconColor { get => _iconColor; set { _iconColor = value; _buttonIcon.Invalidate(); } } - [Category("CrEaTiiOn")] - public Color ListBackColor { get => _listBackColor; set { _listBackColor = value; _comboList.BackColor = _listBackColor; } } - [Category("CrEaTiiOn")] - public Color ListForeColor { get => _listForeColor; set { _listForeColor = value; _comboList.ForeColor = _listForeColor; } } - [Category("CrEaTiiOn")] - public Color BorderColor { get => _borderColor; set { _borderColor = value; base.BackColor = _borderColor; } } - [Category("CrEaTiiOn")] - public int BorderSize { get => _borderSize; set { _borderSize = value; Padding = new Padding(_borderSize); AdjustComboBoxDimensions(); } } - [Category("CrEaTiiOn")] - public override Color ForeColor { get => base.ForeColor; set { base.ForeColor = value; _labelString.ForeColor = value; } } - [Category("CrEaTiiOn")] - public override Font Font { get => base.Font; set { base.Font = value; _labelString.Font = value; _comboList.Font = value; } } - [Category("CrEaTiiOn")] - public string String { get => _labelString.Text; set => _labelString.Text = value; } - [Category("CrEaTiiOn")] - public ComboBoxStyle DropDownStyle { get => _comboList.DropDownStyle; set { if(_comboList.DropDownStyle != ComboBoxStyle.Simple) _comboList.DropDownStyle = value; } } - - [Category("CrEaTiiOn")] - [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] - [Editor("System.Windows.Forms.Design.ListControlStringCollectionEditor, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(UITypeEditor))] - [Localizable(true)] - [MergableProperty(false)] - public ComboBox.ObjectCollection Items => _comboList.Items; - - [Category("CrEaTiiOn")] - [AttributeProvider(typeof(IListSource))] - [DefaultValue(null)] - public object DataSource { get => _comboList.DataSource; set => _comboList.DataSource = value; } - [Category("CrEaTiiOn")] - [Browsable(true)] - [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] - [Editor("System.Windows.Forms.Design.ListControlStringCollectionEditor, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(UITypeEditor))] - [EditorBrowsable(EditorBrowsableState.Always)] - [Localizable(true)] - public AutoCompleteStringCollection AutoCompleteCustomSource { get => _comboList.AutoCompleteCustomSource; set => _comboList.AutoCompleteCustomSource = value; } - [Category("CrEaTiiOn")] - [Browsable(true)] - [DefaultValue(AutoCompleteSource.None)] - [EditorBrowsable(EditorBrowsableState.Always)] - public AutoCompleteSource AutoCompleteSource { get => _comboList.AutoCompleteSource; set => _comboList.AutoCompleteSource = value; } - [Category("CrEaTiiOn")] - [Browsable(true)] - [DefaultValue(AutoCompleteMode.None)] - [EditorBrowsable(EditorBrowsableState.Always)] - public AutoCompleteMode AutoCompleteMode { get => _comboList.AutoCompleteMode; set => _comboList.AutoCompleteMode = value; } - [Category("CrEaTiiOn")] - [Bindable(true)] - [Browsable(false)] - [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public object SelectedItem { get => _comboList.SelectedItem; set => _comboList.SelectedItem = value; } - [Category("CrEaTiiOn")] - [Browsable(false)] - [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public int SelectedIndex { get => _comboList.SelectedIndex; set => _comboList.SelectedIndex = value; } - [Category("CrEaTiiOn")] - [DefaultValue("")] - [Editor("System.Windows.Forms.Design.DataMemberFieldEditor, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(UITypeEditor))] - [TypeConverter("System.Windows.Forms.Design.DataMemberFieldConverter, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")] - public string DisplayMember { get => _comboList.DisplayMember; set => _comboList.DisplayMember = value; } - [Category("CrEaTiiOn")] - [DefaultValue("")] - [Editor("System.Windows.Forms.Design.DataMemberFieldEditor, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(UITypeEditor))] - public string ValueMember { get => _comboList.ValueMember; set => _comboList.ValueMember = value; } - - public event EventHandler OnSelectedIndexChanged; - - public CrEaTiiOn_Ultimate_FancyComboBox() - { - _comboList = new ComboBox(); - _labelString = new Label(); - _buttonIcon = new Button(); - SuspendLayout(); - - _comboList.BackColor = ListBackColor; - _comboList.Font = new Font(Font.Name, 10f); - _comboList.ForeColor = ListForeColor; - _comboList.SelectedIndexChanged += ComboBox_SelectedIndexChanged; - _comboList.TextChanged += ComboBox_StringChanged; - - _buttonIcon.Dock = DockStyle.Right; - _buttonIcon.FlatStyle = FlatStyle.Flat; - _buttonIcon.FlatAppearance.BorderSize = 0; - _buttonIcon.BackColor = BackColor; - _buttonIcon.Size = new Size(30, 30); - _buttonIcon.Cursor = Cursors.Hand; - _buttonIcon.Click += Icon_Click; - _buttonIcon.Paint += Icon_Paint; - - _labelString.Dock = DockStyle.Fill; - _labelString.AutoSize = false; - _labelString.BackColor = BackColor; - _labelString.TextAlign = ContentAlignment.MiddleLeft; - _labelString.Padding = new Padding(8, 0, 0, 0); - _labelString.Font = new Font(Font.Name, 10f); - _labelString.Click += Surface_Click; - _labelString.MouseEnter += Surface_MouseEnter; - _labelString.MouseLeave += Surface_MouseLeave; - - Controls.Add(_labelString); - Controls.Add(_buttonIcon); - Controls.Add(_comboList); - MinimumSize = new Size(200, 30); - Size = new Size(200, 30); - ForeColor = Color.DimGray; - Padding = new Padding(BorderSize); - base.BackColor = BorderColor; - ResumeLayout(); - AdjustComboBoxDimensions(); - } - - private void Surface_MouseLeave(object sender, EventArgs e) - { - OnMouseLeave(e); - } - - private void Surface_MouseEnter(object sender, EventArgs e) - { - OnMouseEnter(e); - } - - private void AdjustComboBoxDimensions() - { - _comboList.Width = _labelString.Width; - _comboList.Location = new Point(Width - Padding.Right - _comboList.Width, _labelString.Bottom - _comboList.Height); - } - - private void Surface_Click(object sender, EventArgs e) - { - OnClick(e); - _comboList.Select(); - if (_comboList.DropDownStyle == ComboBoxStyle.DropDownList) - _comboList.DroppedDown = true; - } - - private void Icon_Paint(object sender, PaintEventArgs e) - { - int iconWidth = 14; - int iconHeight = 6; - var rectIcon = new Rectangle((_buttonIcon.Width - iconWidth) / 2, (_buttonIcon.Height - iconHeight) / 2, iconWidth, iconHeight); - Graphics graphics = e.Graphics; - - using(GraphicsPath path = new GraphicsPath()) - using (Pen pen = new Pen(IconColor, 2)) - { - graphics.SmoothingMode = SmoothingMode.AntiAlias; - path.AddLine(rectIcon.X, rectIcon.Y, rectIcon.X + (iconWidth / 2), rectIcon.Bottom); - path.AddLine(rectIcon.X + (iconWidth / 2), rectIcon.Bottom, rectIcon.Right, rectIcon.Y); - graphics.DrawPath(pen, path); - } - } - - private void Icon_Click(object sender, EventArgs e) - { - _comboList.Select(); - _comboList.DroppedDown = true; - } - - private void ComboBox_StringChanged(object sender, EventArgs e) - { - _labelString.Text = _comboList.Text; - } - - private void ComboBox_SelectedIndexChanged(object sender, EventArgs e) - { - if (OnSelectedIndexChanged != null) - OnSelectedIndexChanged.Invoke(sender, e); - _labelString.Text = _comboList.Text; - } - - protected override void OnResize(EventArgs e) - { - base.OnResize(e); - AdjustComboBoxDimensions(); - } - } -} diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientNumericUpDown.cs b/CBH-Ultimate-Theme-Library-NET-Framework/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientNumericUpDown.cs deleted file mode 100644 index 80478ab..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientNumericUpDown.cs +++ /dev/null @@ -1,146 +0,0 @@ -using System; -using System.ComponentModel; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Drawing.Text; -using System.Windows.Forms; - -namespace CBH.Ultimate.Controls -{ - public sealed class CrEaTiiOn_Ultimate_GradientNumericUpDown : Control - { - private int _w; - private int _h; - private int _x; - private int _y; - private long _value; - private long _min; - private long _max; - private bool _bool; - - private Color _baseColor = Color.FromArgb(15, 15, 15); - private Color _gradientColorPrimary = Color.FromArgb(250, 36, 38); - private Color _gradientColorSecondary = Color.FromArgb(45, 45, 45); - private Color _stringColor = Color.White; - - public long Value { get => _value; set { if (value <= _max & value >= _min) _value = value; Invalidate(); } } - public long Maximum { get => _max; set { if (value > _min) _max = value; if (_value > _max) _value = _max; Invalidate(); } } - public long Minimum { get => _min; set { if (value < _max) _min = value; if (_value < _min) _value = Minimum; Invalidate(); } } - - [Category("CrEaTiiOn")] - public Color BaseColor { get { return _baseColor; } set { _baseColor = value; Invalidate(); } } - [Category("CrEaTiiOn")] - public Color GradientColorPrimary { get => _gradientColorPrimary; set { _gradientColorPrimary = value; Invalidate(); } } - [Category("CrEaTiiOn")] - public Color GradientColorSecondary { get => _gradientColorSecondary; set { _gradientColorSecondary = value; Invalidate(); } } - [Category("CrEaTiiOn")] - public Color StringColor { get => _stringColor; set => _stringColor = value; } - - public CrEaTiiOn_Ultimate_GradientNumericUpDown() - { - SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.OptimizedDoubleBuffer | ControlStyles.SupportsTransparentBackColor, true); - DoubleBuffered = true; - _min = 0; - _max = 9999999; - } - - protected override void OnMouseMove(MouseEventArgs e) - { - base.OnMouseMove(e); - _x = e.Location.X; - _y = e.Location.Y; - Invalidate(); - Cursor = e.X < Width - 23 ? Cursors.IBeam : Cursors.Hand; - } - - protected override void OnMouseDown(MouseEventArgs e) - { - base.OnMouseDown(e); - if (_x > Width - 21 && _x < Width - 3) - { - if (_y < 15) - { - if ((Value + 1) <= _max) - _value += 1; - } - else - { - if ((Value - 1) >= _min) - _value -= 1; - } - } - else - { - _bool = !_bool; - Focus(); - } - Invalidate(); - } - - protected override void OnKeyPress(KeyPressEventArgs e) - { - base.OnKeyPress(e); - try - { - if (_bool) - _value = Convert.ToInt64(_value + e.KeyChar.ToString()); - if (_value > _max) - _value = _max; - Invalidate(); - } - catch - { - // ignored - } - } - - protected override void OnKeyDown(KeyEventArgs e) - { - base.OnKeyDown(e); - if (e.KeyCode == Keys.Back) - { - Value = 0; - } - } - - protected override void OnResize(EventArgs e) - { - base.OnResize(e); - Height = 30; - } - - public static readonly StringFormat CenterSf = new StringFormat - { - Alignment = StringAlignment.Center, - LineAlignment = StringAlignment.Center - }; - - - protected override void OnPaint(PaintEventArgs e) - { - var bitmap = new Bitmap(Width, Height); - var graphics = Graphics.FromImage(bitmap); - _w = Width; - _h = Height; - - var rectBase = new Rectangle(0, 0, _w, _h); - - graphics.SmoothingMode = SmoothingMode.AntiAlias; - graphics.PixelOffsetMode = PixelOffsetMode.HighQuality; - graphics.TextRenderingHint = TextRenderingHint.AntiAlias; - graphics.Clear(BackColor); - - graphics.FillRectangle(new SolidBrush(_baseColor), rectBase); - graphics.FillRectangle(new LinearGradientBrush(new PointF(0, Height / 2f), new PointF(Width, Height / 2f), _gradientColorPrimary, _gradientColorSecondary), new Rectangle(Width - 24, 0, 24, _h)); - graphics.DrawString("+", Font, new SolidBrush(_stringColor), new Point(Width - 12, 8), CenterSf); - graphics.DrawString("-", Font, new SolidBrush(_stringColor), new Point(Width - 12, 22), CenterSf); - graphics.DrawString(Value.ToString(), Font, new SolidBrush(_stringColor), new Rectangle(5, 1, _w, _h), new StringFormat { LineAlignment = StringAlignment.Center }); - - base.OnPaint(e); - graphics.Dispose(); - e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic; - e.Graphics.DrawImageUnscaled(bitmap, 0, 0); - bitmap.Dispose(); - } - } -} diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GroupBox.cs b/CBH-Ultimate-Theme-Library-NET-Framework/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GroupBox.cs deleted file mode 100644 index 6741e67..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GroupBox.cs +++ /dev/null @@ -1,65 +0,0 @@ -using System.ComponentModel; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Windows.Forms; - -namespace CBH.Ultimate.Controls -{ - public sealed class CrEaTiiOn_Ultimate_GroupBox : GroupBox - { - private Color _backgroundColor = Color.FromArgb(15, 15, 15); - private Color _titleBackColor = Color.FromArgb(15, 15, 15); - private Color _titleForeColor = Color.White; - private Font _titleFont; - private int _radius = 20; - - [Category("CrEaTiiOn")] - public Color TitleBackColor { get => _titleBackColor; set { _titleBackColor = value; Invalidate(); } } - [Category("CrEaTiiOn")] - public Color TitleForeColor { get => _titleForeColor; set { _titleForeColor = value; Invalidate(); } } - [Category("CrEaTiiOn")] - public Font TitleFont { get => _titleFont; set { _titleFont = value; Invalidate(); } } - [Category("CrEaTiiOn")] - public int Radius { get => _radius; set { _radius = value; Invalidate(); } } - [Category("CrEaTiiOn")] - public Color BackgroundColor { get => _backgroundColor; set { _backgroundColor = value; Invalidate();} } - - public CrEaTiiOn_Ultimate_GroupBox() - { - DoubleBuffered = true; - TitleFont = new Font(Font.FontFamily, Font.Size , FontStyle.Regular); - } - - private GraphicsPath GetFigurePath(RectangleF rect, float radius) - { - var path = new GraphicsPath(); - path.StartFigure(); - path.AddArc(rect.X, rect.Y, radius, radius, 180, 90); - path.AddArc(rect.X + rect.Width - radius - 1, rect.Y, radius, radius, 270, 90); - path.AddArc(rect.X + rect.Width - radius - 1, rect.Y + rect.Height - radius - 1, radius, radius, 0, 90); - path.AddArc(rect.X, rect.Y + rect.Height - radius - 1, radius, radius, 90, 90); - path.CloseAllFigures(); - return path; - } - - protected override void OnPaint(PaintEventArgs e) - { - base.OnPaint(e); - GroupBoxRenderer.DrawParentBackground(e.Graphics, ClientRectangle, this); - var rect = ClientRectangle; - using (var path = GetFigurePath(ClientRectangle, Radius)) - { - e.Graphics.SmoothingMode = SmoothingMode.AntiAlias; - rect = new Rectangle(0, 0, rect.Width, _titleFont.Height + Padding.Bottom + Padding.Top); - if (_backgroundColor != Color.Transparent) using (var brush = new SolidBrush(_backgroundColor)) e.Graphics.FillPath(brush, path); - var clip = e.Graphics.ClipBounds; - e.Graphics.SetClip(rect); - using (var brush = new SolidBrush(_titleBackColor)) e.Graphics.FillPath(brush, path); - //using (var pen = new Pen(_titleBackColor, 1)) e.Graphics.DrawPath(pen, path); - TextRenderer.DrawText(e.Graphics, Text, _titleFont, rect, _titleForeColor); - e.Graphics.SetClip(clip); - // using (var pen = new Pen(_titleBackColor, 1)) e.Graphics.DrawPath(pen, path); - } - } - } -} diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_NumericUpDown.cs b/CBH-Ultimate-Theme-Library-NET-Framework/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_NumericUpDown.cs deleted file mode 100644 index 6aaf8da..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_NumericUpDown.cs +++ /dev/null @@ -1,143 +0,0 @@ -using System; -using System.ComponentModel; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Drawing.Text; -using System.Windows.Forms; - -namespace CBH.Ultimate.Controls -{ - public sealed class CrEaTiiOn_Ultimate_NumericUpDown : Control - { - private int _w; - private int _h; - private int _x; - private int _y; - private long _value; - private long _min; - private long _max; - private bool _bool; - - private Color _baseColor = Color.FromArgb(15, 15, 15); - private Color _buttonColor = Color.FromArgb(250, 36, 38); - private Color _stringColor = Color.White; - - public long Value { get => _value; set { if (value <= _max & value >= _min) _value = value; Invalidate(); } } - public long Maximum { get => _max; set { if (value > _min) _max = value; if (_value > _max) _value = _max; Invalidate(); } } - public long Minimum { get => _min; set { if (value < _max) _min = value; if (_value < _min) _value = Minimum; Invalidate(); } } - - [Category("CrEaTiiOn")] - public Color BaseColor { get { return _baseColor; } set { _baseColor = value; Invalidate(); } } - [Category("CrEaTiiOn")] - public Color ButtonColor { get { return _buttonColor; } set { _buttonColor = value; Invalidate(); } } - [Category("CrEaTiiOn")] - public Color StringColor { get => _stringColor; set => _stringColor = value; } - - public CrEaTiiOn_Ultimate_NumericUpDown() - { - SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.OptimizedDoubleBuffer | ControlStyles.SupportsTransparentBackColor, true); - DoubleBuffered = true; - _min = 0; - _max = 9999999; - } - - protected override void OnMouseMove(MouseEventArgs e) - { - base.OnMouseMove(e); - _x = e.Location.X; - _y = e.Location.Y; - Invalidate(); - Cursor = e.X < Width - 23 ? Cursors.IBeam : Cursors.Hand; - } - - protected override void OnMouseDown(MouseEventArgs e) - { - base.OnMouseDown(e); - if (_x > Width - 21 && _x < Width - 3) - { - if (_y < 15) - { - if ((Value + 1) <= _max) - _value += 1; - } - else - { - if ((Value - 1) >= _min) - _value -= 1; - } - } - else - { - _bool = !_bool; - Focus(); - } - Invalidate(); - } - - protected override void OnKeyPress(KeyPressEventArgs e) - { - base.OnKeyPress(e); - try - { - if (_bool) - _value = Convert.ToInt64(_value + e.KeyChar.ToString()); - if (_value > _max) - _value = _max; - Invalidate(); - } - catch - { - // ignored - } - } - - protected override void OnKeyDown(KeyEventArgs e) - { - base.OnKeyDown(e); - if (e.KeyCode == Keys.Back) - { - Value = 0; - } - } - - protected override void OnResize(EventArgs e) - { - base.OnResize(e); - Height = 30; - } - - public static readonly StringFormat CenterSf = new StringFormat - { - Alignment = StringAlignment.Center, - LineAlignment = StringAlignment.Center - }; - - - protected override void OnPaint(PaintEventArgs e) - { - var bitmap = new Bitmap(Width, Height); - var graphics = Graphics.FromImage(bitmap); - _w = Width; - _h = Height; - - var rectBase = new Rectangle(0, 0, _w, _h); - - graphics.SmoothingMode = SmoothingMode.AntiAlias; - graphics.PixelOffsetMode = PixelOffsetMode.HighQuality; - graphics.TextRenderingHint = TextRenderingHint.AntiAlias; - graphics.Clear(BackColor); - - graphics.FillRectangle(new SolidBrush(_baseColor), rectBase); - graphics.FillRectangle(new SolidBrush(_buttonColor), new Rectangle(Width - 24, 0, 24, _h)); - graphics.DrawString("+", Font, new SolidBrush(_stringColor), new Point(Width - 12, 8), CenterSf); - graphics.DrawString("-", Font, new SolidBrush(_stringColor), new Point(Width - 12, 22), CenterSf); - graphics.DrawString(Value.ToString(), Font, new SolidBrush(_stringColor), new Rectangle(5, 1, _w, _h), new StringFormat { LineAlignment = StringAlignment.Center }); - - base.OnPaint(e); - graphics.Dispose(); - e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic; - e.Graphics.DrawImageUnscaled(bitmap, 0, 0); - bitmap.Dispose(); - } - } -} diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_PictureBox.cs b/CBH-Ultimate-Theme-Library-NET-Framework/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_PictureBox.cs deleted file mode 100644 index 9abbdb6..0000000 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_PictureBox.cs +++ /dev/null @@ -1,73 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; - -namespace CBH.Ultimate.Controls -{ - public sealed class CrEaTiiOn_Ultimate_PictureBox : PictureBox - { - private int _borderSize = 2; - private Color _gradientColorPrimary = Color.FromArgb(250, 36, 38); - private Color _gradientColorSecondary = Color.FromArgb(25, 25, 25); - private DashStyle _borderLineStyle = DashStyle.Solid; - private DashCap _borderCapStyle = DashCap.Flat; - private float _gradientAngle = 50f; - - public CrEaTiiOn_Ultimate_PictureBox() - { - Size = new Size(100, 100); - SizeMode = PictureBoxSizeMode.StretchImage; - - } - - [Category("CrEaTiiOn")] - public int BorderSize { get => _borderSize; set { _borderSize = value; Invalidate(); } } - [Category("CrEaTiiOn")] - public Color GradientColorPrimary { get => _gradientColorPrimary; set { _gradientColorPrimary = value; Invalidate(); } } - [Category("CrEaTiiOn")] - public Color GradientColorSecondary { get => _gradientColorSecondary; set { _gradientColorSecondary = value; Invalidate(); } } - [Category("CrEaTiiOn")] - public DashStyle BorderLineStyle { get => _borderLineStyle; set { _borderLineStyle = value; Invalidate(); } } - [Category("CrEaTiiOn")] - public DashCap BorderCapStyle { get => _borderCapStyle; set { _borderCapStyle = value; Invalidate(); } } - [Category("CrEaTiiOn")] - public float GradientAngle { get => _gradientAngle; set { _gradientAngle = value; Invalidate(); } } - - protected override void OnResize(EventArgs e) - { - base.OnResize(e); - Size = new Size(Width, Width); - } - - protected override void OnPaint(PaintEventArgs pe) - { - base.OnPaint(pe); - var graphics = pe.Graphics; - var rectContourSmooth = Rectangle.Inflate(ClientRectangle, -1, -1); - var rectBorder = Rectangle.Inflate(ClientRectangle, -_borderSize, -_borderSize); - var smoothSize = _borderSize > 0 ? _borderSize * 3 : 1; - - using (var borderGradientColor = new LinearGradientBrush(rectBorder, _gradientColorPrimary, _gradientColorSecondary, _gradientAngle)) - using (var pathRegion = new GraphicsPath()) - using (var penSmooth = new Pen(Parent.BackColor, smoothSize)) - using (var penBorder = new Pen(borderGradientColor, _borderSize)) - { - penBorder.DashStyle = _borderLineStyle; - penBorder.DashCap = _borderCapStyle; - pathRegion.AddEllipse(rectContourSmooth); - Region = new Region(pathRegion); - graphics.SmoothingMode = SmoothingMode.AntiAlias; - - graphics.DrawEllipse(penSmooth, rectContourSmooth); - if(_borderSize > 0) - graphics.DrawEllipse(penBorder, rectBorder); - } - } - } -} diff --git a/CBH-Ultimate-Theme-Library/CBH-Ultimate-Theme-Library.csproj b/CBH-Ultimate-Theme-Library/CBH-Ultimate-Theme-Library.csproj deleted file mode 100644 index bb8701c..0000000 --- a/CBH-Ultimate-Theme-Library/CBH-Ultimate-Theme-Library.csproj +++ /dev/null @@ -1,31 +0,0 @@ - - - - WinExe - net6.0-windows - CBH_Ultimate_Theme_Library - enable - true - enable - True - - - - - True - True - Resources.resx - - - Component - - - - - - ResXFileCodeGenerator - Resources.Designer.cs - - - - \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/MainForm.cs b/CBH-Ultimate-Theme-Library/MainForm.cs deleted file mode 100644 index 1e2db1d..0000000 --- a/CBH-Ultimate-Theme-Library/MainForm.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; - -namespace CBH_Ultimate_Theme_Library -{ - public partial class MainForm : Form - { - public MainForm() - { - InitializeComponent(); - } - } -} diff --git a/CBH-Ultimate-Theme-Library/MainForm.resx b/CBH-Ultimate-Theme-Library/MainForm.resx deleted file mode 100644 index f298a7b..0000000 --- a/CBH-Ultimate-Theme-Library/MainForm.resx +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Program.cs b/CBH-Ultimate-Theme-Library/Program.cs deleted file mode 100644 index c14f6f0..0000000 --- a/CBH-Ultimate-Theme-Library/Program.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace CBH_Ultimate_Theme_Library -{ - internal static class Program - { - /// - /// The main entry point for the application. - /// - [STAThread] - static void Main() - { - // To customize application configuration such as set high DPI settings or default font, - // see https://aka.ms/applicationconfiguration. - ApplicationConfiguration.Initialize(); - Application.Run(new MainForm()); - } - } -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Properties/Resources.resx b/CBH-Ultimate-Theme-Library/Properties/Resources.resx deleted file mode 100644 index 1af7de1..0000000 --- a/CBH-Ultimate-Theme-Library/Properties/Resources.resx +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/Badge/CrEaTiiOn_Badge.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/Badge/CrEaTiiOn_Badge.cs deleted file mode 100644 index 80e9a0f..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/Badge/CrEaTiiOn_Badge.cs +++ /dev/null @@ -1,125 +0,0 @@ -#region Imports - -using System.Drawing.Drawing2D; - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_Badge - - public class CrEaTiiOn_Badge : Control - { - #region Variables - - private int _Value = 0; - private int _Maximum = 99; - private Color _BorderColor = Color.FromArgb(250, 36, 38); - private Color _BGColorA = Color.FromArgb(15, 15, 15); - private Color _BGColorB = Color.FromArgb(15, 15, 15); - - #endregion - - #region Properties - - public int Value - { - get - { - if (_Value == 0) - { - return 0; - } - - return _Value; - } - set - { - if (value > _Maximum) - { - value = _Maximum; - } - - _Value = value; - Invalidate(); - } - } - - public int Maximum - { - get => _Maximum; - set - { - if (value < _Value) - { - _Value = value; - } - - _Maximum = value; - Invalidate(); - } - } - - public Color BorderColor - { - get => _BorderColor; - set { _BorderColor = value; Invalidate(); } - } - - public Color BGColorA - { - get => _BGColorA; - set { _BGColorA = value; Invalidate(); } - } - - public Color BGColorB - { - get => _BGColorB; - set { _BGColorB = value; Invalidate(); } - } - - #endregion - - public CrEaTiiOn_Badge() - { - SetStyle(ControlStyles.SupportsTransparentBackColor, true); - SetStyle(ControlStyles.UserPaint, true); - - Text = null; - DoubleBuffered = true; - ForeColor = Color.White; - Font = new("Segoe UI", 8, FontStyle.Bold); - } - - protected override void OnResize(EventArgs e) - { - base.OnResize(e); - Height = 20; - Width = 20; - } - - protected override void OnPaint(PaintEventArgs e) - { - base.OnPaint(e); - Graphics _G = e.Graphics; - string myString = _Value.ToString(); - _G.Clear(BackColor); - _G.SmoothingMode = SmoothingMode.AntiAlias; - LinearGradientBrush LGB = new(new Rectangle(new Point(0, 0), new Size(18, 20)), _BGColorA, _BGColorB, 90f); - - // Fills the body with LGB gradient - _G.FillEllipse(LGB, new Rectangle(new Point(0, 0), new Size(18, 18))); - // Draw border - _G.DrawEllipse(new(_BorderColor), new Rectangle(new Point(0, 0), new Size(18, 18))); - _G.DrawString(myString, Font, new SolidBrush(ForeColor), new Rectangle(0, 0, Width - 2, Height), new StringFormat - { - Alignment = StringAlignment.Center, - LineAlignment = StringAlignment.Center - }); - e.Dispose(); - } - - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/Banner/CrEaTiiOn_Banner.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/Banner/CrEaTiiOn_Banner.cs deleted file mode 100644 index 56135f9..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/Banner/CrEaTiiOn_Banner.cs +++ /dev/null @@ -1,149 +0,0 @@ -#region Imports - -using System.ComponentModel; -using System.Drawing.Drawing2D; -using System.Drawing.Text; - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_Banner - - public class CrEaTiiOn_Banner : Control - { - public CrEaTiiOn_Banner() - { - base.Size = new Size(100, 20); - base.SetStyle(ControlStyles.SupportsTransparentBackColor, true); - BackColor = Color.Transparent; - Text = base.Name; - ForeColor = Color.White; - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The banner border color")] - public Color BorderColor - { - get => borderColor; - set - { - borderColor = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The color of the banner")] - public Color BannerColor - { - get => bannerColor; - set - { - bannerColor = value; - base.Invalidate(); - } - } - - private PixelOffsetMode _PixelOffsetType = PixelOffsetMode.HighQuality; - [Category("CrEaTiiOn")] - [Browsable(true)] - public PixelOffsetMode PixelOffsetType - { - get => _PixelOffsetType; - set - { - _PixelOffsetType = value; - Invalidate(); - } - } - - private TextRenderingHint _TextRenderingType = TextRenderingHint.ClearTypeGridFit; - [Category("CrEaTiiOn")] - [Browsable(true)] - public TextRenderingHint TextRenderingType - { - get => _TextRenderingType; - set - { - _TextRenderingType = value; - Invalidate(); - } - } - - protected override void OnPaint(PaintEventArgs e) - { - List list = new(); - List list2 = new(); - list.Add(new Point(0, base.Height / 10 * 5)); - list.Add(new Point(base.Height / 10, base.Height / 10 * 4)); - list.Add(new Point(base.Height / 10 * 2, base.Height / 10 * 3)); - list.Add(new Point(base.Height / 10 * 3, base.Height / 10 * 2)); - list.Add(new Point(base.Height / 10 * 4, base.Height / 10)); - list.Add(new Point(base.Height / 10 * 5, 0)); - list.Add(new Point(base.Width - base.Height / 10 * 5, 0)); - list.Add(new Point(base.Width - base.Height / 10 * 4, base.Height / 10)); - list.Add(new Point(base.Width - base.Height / 10 * 3, base.Height / 10 * 2)); - list.Add(new Point(base.Width - base.Height / 10 * 2, base.Height / 10 * 3)); - list.Add(new Point(base.Width - base.Height / 10, base.Height / 10 * 4)); - list.Add(new Point(base.Width, base.Height / 10 * 5)); - list.Add(new Point(base.Width - base.Height / 10, base.Height / 10 * 6)); - list.Add(new Point(base.Width - base.Height / 10 * 2, base.Height / 10 * 7)); - list.Add(new Point(base.Width - base.Height / 10 * 3, base.Height / 10 * 8)); - list.Add(new Point(base.Width - base.Height / 10 * 4, base.Height / 10 * 9)); - list.Add(new Point(base.Width - base.Height / 10 * 5, base.Height / 10 * 10)); - list.Add(new Point(base.Height / 10 * 5, base.Height / 10 * 10)); - list.Add(new Point(base.Height / 10 * 4, base.Height / 10 * 9)); - list.Add(new Point(base.Height / 10 * 3, base.Height / 10 * 8)); - list.Add(new Point(base.Height / 10 * 2, base.Height / 10 * 7)); - list.Add(new Point(base.Height / 10, base.Height / 10 * 6)); - list.Add(new Point(0, base.Height / 10 * 5)); - SolidBrush brush = new(bannerColor); - e.Graphics.FillPolygon(brush, list.ToArray()); - list2.Add(new Point(0, base.Height / 10 * 5)); - list2.Add(new Point(base.Height / 10, base.Height / 10 * 4)); - list2.Add(new Point(base.Height / 10 * 2, base.Height / 10 * 3)); - list2.Add(new Point(base.Height / 10 * 3, base.Height / 10 * 2)); - list2.Add(new Point(base.Height / 10 * 4, base.Height / 10)); - list2.Add(new Point(base.Height / 10 * 5, 0)); - list2.Add(new Point(base.Width - base.Height / 10 * 5 - 1, 0)); - list2.Add(new Point(base.Width - base.Height / 10 * 4 - 1, base.Height / 10)); - list2.Add(new Point(base.Width - base.Height / 10 * 3 - 1, base.Height / 10 * 2)); - list2.Add(new Point(base.Width - base.Height / 10 * 2 - 1, base.Height / 10 * 3)); - list2.Add(new Point(base.Width - base.Height / 10 - 1, base.Height / 10 * 4)); - list2.Add(new Point(base.Width - 1, base.Height / 10 * 5)); - list2.Add(new Point(base.Width - base.Height / 10 - 1, base.Height / 10 * 6)); - list2.Add(new Point(base.Width - base.Height / 10 * 2 - 1, base.Height / 10 * 7)); - list2.Add(new Point(base.Width - base.Height / 10 * 3 - 1, base.Height / 10 * 8)); - list2.Add(new Point(base.Width - base.Height / 10 * 4 - 1, base.Height / 10 * 9)); - list2.Add(new Point(base.Width - base.Height / 10 * 5, base.Height / 10 * 10 - 1)); - list2.Add(new Point(base.Height / 10 * 5 - 1, base.Height / 10 * 10 - 1)); - list2.Add(new Point(base.Height / 10 * 4, base.Height / 10 * 9)); - list2.Add(new Point(base.Height / 10 * 3, base.Height / 10 * 8)); - list2.Add(new Point(base.Height / 10 * 2, base.Height / 10 * 7)); - list2.Add(new Point(base.Height / 10, base.Height / 10 * 6)); - list2.Add(new Point(0, base.Height / 10 * 5)); - Pen pen = new Pen(borderColor, 1f); - e.Graphics.DrawPolygon(pen, list2.ToArray()); - StringFormat stringFormat = new() - { - LineAlignment = StringAlignment.Center, - Alignment = StringAlignment.Center - }; - SolidBrush brush2 = new(ForeColor); - RectangleF layoutRectangle = new(0f, 0f, Width, Height); - e.Graphics.PixelOffsetMode = PixelOffsetType; - e.Graphics.TextRenderingHint = TextRenderingType; - e.Graphics.DrawString(Text, Font, brush2, layoutRectangle, stringFormat); - base.OnPaint(e); - } - - private Color borderColor = Color.FromArgb(250, 36, 38); - - private Color bannerColor = Color.FromArgb(15, 15, 15); - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/Bubble/CrEaTiiOn_ChatBubbleLeft.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/Bubble/CrEaTiiOn_ChatBubbleLeft.cs deleted file mode 100644 index 526f57f..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/Bubble/CrEaTiiOn_ChatBubbleLeft.cs +++ /dev/null @@ -1,168 +0,0 @@ -#region Imports - -using System.Drawing.Drawing2D; - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_ChatBubbleLeft - - public class CrEaTiiOn_ChatBubbleLeft : Control - { - #region Variables - - private GraphicsPath Shape; - private Color _TextColor = Color.White; - private Color _BubbleColor = Color.FromArgb(250, 36, 38); - private bool _DrawBubbleArrow = true; - private bool _SizeAuto = true; - private bool _SizeAutoW = true; - private bool _SizeAutoH = true; - - #endregion - - #region Properties - - public override Color ForeColor - { - get => _TextColor; - set - { - _TextColor = value; - Invalidate(); - } - } - - public Color BubbleColor - { - get => _BubbleColor; - set - { - _BubbleColor = value; - Invalidate(); - } - } - - public bool DrawBubbleArrow - { - get => _DrawBubbleArrow; - set - { - _DrawBubbleArrow = value; - Invalidate(); - } - } - - public bool SizeAuto - { - get => _SizeAuto; - set - { - _SizeAuto = value; - Invalidate(); - } - } - - public bool SizeAutoW - { - get => _SizeAutoW; - set - { - _SizeAutoW = value; - Invalidate(); - } - } - - public bool SizeAutoH - { - get => _SizeAutoH; - set - { - _SizeAutoH = value; - Invalidate(); - } - } - - #endregion - - public CrEaTiiOn_ChatBubbleLeft() - { - SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.SupportsTransparentBackColor | ControlStyles.UserPaint, true); - DoubleBuffered = true; - Size = new(120, 40); - BackColor = Color.Transparent; - ForeColor = Color.White; - Font = new("Segoe UI", 10); - } - - protected override void OnResize(System.EventArgs e) - { - Shape = new(); - - GraphicsPath _Shape = Shape; - _Shape.AddArc(9, 0, 10, 10, 180, 90); - _Shape.AddArc(Width - 11, 0, 10, 10, -90, 90); - _Shape.AddArc(Width - 11, Height - 11, 10, 10, 0, 90); - _Shape.AddArc(9, Height - 11, 10, 10, 90, 90); - _Shape.CloseAllFigures(); - - Invalidate(); - base.OnResize(e); - } - - protected override void OnPaint(PaintEventArgs e) - { - base.OnPaint(e); - - if (_SizeAuto) - { - if (_SizeAutoW && _SizeAutoH) - { - Width = TextRenderer.MeasureText(Text, Font).Width + 15; - Height = TextRenderer.MeasureText(Text, Font).Height + 15; - } - else if (_SizeAutoW) - { - Width = TextRenderer.MeasureText(Text, Font).Width + 15; - } - else - { - Height = TextRenderer.MeasureText(Text, Font).Height + 15; - } - } - - Bitmap B = new(Width, Height); - Graphics G = Graphics.FromImage(B); - - Graphics _G = G; - _G.SmoothingMode = SmoothingMode.HighQuality; - _G.PixelOffsetMode = PixelOffsetMode.HighQuality; - _G.Clear(BackColor); - - // Fill the body of the bubble with the specified color - _G.FillPath(new SolidBrush(_BubbleColor), Shape); - // Draw the string specified in 'Text' property - _G.DrawString(Text, Font, new SolidBrush(ForeColor), new Rectangle(15, 7, Width - 17, Height - 5)); - - // Draw a polygon on the right side of the bubble - if (_DrawBubbleArrow == true) - { - Point[] p = - { - new Point(9, Height - 19), - new Point(0, Height - 25), - new Point(9, Height - 30) - }; - _G.FillPolygon(new SolidBrush(_BubbleColor), p); - _G.DrawPolygon(new(new SolidBrush(_BubbleColor)), p); - } - G.Dispose(); - e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic; - e.Graphics.DrawImageUnscaled(B, 0, 0); - B.Dispose(); - } - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/Bubble/CrEaTiiOn_ChatBubbleRight.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/Bubble/CrEaTiiOn_ChatBubbleRight.cs deleted file mode 100644 index 98c82ca..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/Bubble/CrEaTiiOn_ChatBubbleRight.cs +++ /dev/null @@ -1,190 +0,0 @@ -#region Imports - -using System.Drawing.Drawing2D; - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_ChatBubbleRight - - public class CrEaTiiOn_ChatBubbleRight : Control - { - - #region Variables - - private GraphicsPath Shape; - private Color _TextColor = Color.White; - private Color _BubbleColor = Color.FromArgb(250, 36, 38); - private bool _DrawBubbleArrow = true; - private bool _SizeAuto = true; - private bool _SizeAutoW = true; - private bool _SizeAutoH = true; - private bool _SizeWidthLeft = false; - - #endregion - - #region Properties - - public override Color ForeColor - { - get => _TextColor; - set - { - _TextColor = value; - Invalidate(); - } - } - - public Color BubbleColor - { - get => _BubbleColor; - set - { - _BubbleColor = value; - Invalidate(); - } - } - - public bool DrawBubbleArrow - { - get => _DrawBubbleArrow; - set - { - _DrawBubbleArrow = value; - Invalidate(); - } - } - - public bool SizeAuto - { - get => _SizeAuto; - set - { - _SizeAuto = value; - Invalidate(); - } - } - - public bool SizeAutoW - { - get => _SizeAutoW; - set - { - _SizeAutoW = value; - Invalidate(); - } - } - - public bool SizeAutoH - { - get => _SizeAutoH; - set - { - _SizeAutoH = value; - Invalidate(); - } - } - - public bool SizeWidthLeft - { - get => _SizeWidthLeft; - set - { - _SizeWidthLeft = value; - Invalidate(); - } - } - - #endregion - - public CrEaTiiOn_ChatBubbleRight() - { - SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.SupportsTransparentBackColor | ControlStyles.UserPaint, true); - DoubleBuffered = true; - Size = new(130, 40); - BackColor = Color.Transparent; - ForeColor = Color.White; - Font = new("Segoe UI", 10); - } - - protected override void OnResize(System.EventArgs e) - { - base.OnResize(e); - Shape = new(); - - GraphicsPath _with1 = Shape; - _with1.AddArc(0, 0, 10, 10, 180, 90); - _with1.AddArc(Width - 18, 0, 10, 10, -90, 90); - _with1.AddArc(Width - 18, Height - 11, 10, 10, 0, 90); - _with1.AddArc(0, Height - 11, 10, 10, 90, 90); - _with1.CloseAllFigures(); - - Invalidate(); - } - - protected override void OnPaint(PaintEventArgs e) - { - base.OnPaint(e); - - if (_SizeAuto) - { - int WW = Width; - if (_SizeAutoW && _SizeAutoH) - { - Width = TextRenderer.MeasureText(Text, Font).Width + 15; - Height = TextRenderer.MeasureText(Text, Font).Height + 15; - if (_SizeWidthLeft) - { - Location = new(Location.X - (Width - WW), Location.Y); - } - } - else if (_SizeAutoW) - { - Width = TextRenderer.MeasureText(Text, Font).Width + 15; - if (_SizeWidthLeft) - { - Location = new(Location.X - (Width - WW), Location.Y); - } - } - else - { - Height = TextRenderer.MeasureText(Text, Font).Height + 15; - } - } - - Bitmap B = new(Width, Height); - Graphics G = Graphics.FromImage(B); - - Graphics _G = G; - _G.SmoothingMode = SmoothingMode.HighQuality; - _G.PixelOffsetMode = PixelOffsetMode.HighQuality; - _G.Clear(BackColor); - - // Fill the body of the bubble with the specified color - _G.FillPath(new SolidBrush(_BubbleColor), Shape); - // Draw the string specified in 'Text' property - _G.DrawString(Text, Font, new SolidBrush(ForeColor), new Rectangle(6, 7, Width - 15, Height)); - - // Draw a polygon on the right side of the bubble - if (_DrawBubbleArrow == true) - { - Point[] p = - { - new Point(Width - 8, Height - 19), - new Point(Width, Height - 25), - new Point(Width - 8, Height - 30) - }; - _G.FillPolygon(new SolidBrush(_BubbleColor), p); - _G.DrawPolygon(new(new SolidBrush(_BubbleColor)), p); - } - - G.Dispose(); - e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic; - e.Graphics.DrawImageUnscaled(B, 0, 0); - B.Dispose(); - } - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/Button/CrEaTiiOn_Button.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/Button/CrEaTiiOn_Button.cs deleted file mode 100644 index 44d5b13..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/Button/CrEaTiiOn_Button.cs +++ /dev/null @@ -1,157 +0,0 @@ -#region Imports - -using System.ComponentModel; -using System.Drawing.Drawing2D; - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_Button - - public class CrEaTiiOn_Button : Button - { - //Fields - private int borderSize = 2; - private int borderRadius = 3; - private Color borderColor = Color.FromArgb(250, 36, 38); - - //Properties - [Category("CrEaTiiOn")] - public int BorderSize - { - get { return borderSize; } - set - { - borderSize = value; - this.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - public int BorderRadius - { - get { return borderRadius; } - set - { - borderRadius = value; - this.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - public Color BorderColor - { - get { return borderColor; } - set - { - borderColor = value; - this.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - public Color BackgroundColor - { - get { return this.BackColor; } - set { this.BackColor = value; } - } - - [Category("CrEaTiiOn")] - public Color TextColor - { - get { return this.ForeColor; } - set { this.ForeColor = value; } - } - - //Constructor - public CrEaTiiOn_Button() - { - this.FlatStyle = FlatStyle.Flat; - this.FlatAppearance.BorderSize = 0; - this.Size = new Size(150, 40); - this.BackColor = Color.FromArgb(15, 15, 15); - this.ForeColor = Color.White; - this.Resize += new EventHandler(Button_Resize); - } - - //Methods - private GraphicsPath GetFigurePath(Rectangle rect, int radius) - { - GraphicsPath path = new GraphicsPath(); - float curveSize = radius * 2F; - - path.StartFigure(); - path.AddArc(rect.X, rect.Y, curveSize, curveSize, 180, 90); - path.AddArc(rect.Right - curveSize, rect.Y, curveSize, curveSize, 270, 90); - path.AddArc(rect.Right - curveSize, rect.Bottom - curveSize, curveSize, curveSize, 0, 90); - path.AddArc(rect.X, rect.Bottom - curveSize, curveSize, curveSize, 90, 90); - path.CloseFigure(); - return path; - } - - protected override void OnPaint(PaintEventArgs pevent) - { - base.OnPaint(pevent); - - - Rectangle rectSurface = this.ClientRectangle; - Rectangle rectBorder = Rectangle.Inflate(rectSurface, -borderSize, -borderSize); - int smoothSize = 2; - if (borderSize > 0) - smoothSize = borderSize; - - if (borderRadius > 2) //Rounded button - { - using (GraphicsPath pathSurface = GetFigurePath(rectSurface, borderRadius)) - using (GraphicsPath pathBorder = GetFigurePath(rectBorder, borderRadius - borderSize)) - using (Pen penSurface = new Pen(this.Parent.BackColor, smoothSize)) - using (Pen penBorder = new Pen(borderColor, borderSize)) - { - pevent.Graphics.SmoothingMode = SmoothingMode.AntiAlias; - //Button surface - this.Region = new Region(pathSurface); - //Draw surface border for HD result - pevent.Graphics.DrawPath(penSurface, pathSurface); - - //Button border - if (borderSize >= 1) - //Draw control border - pevent.Graphics.DrawPath(penBorder, pathBorder); - } - } - else //Normal button - { - pevent.Graphics.SmoothingMode = SmoothingMode.None; - //Button surface - this.Region = new Region(rectSurface); - //Button border - if (borderSize >= 1) - { - using (Pen penBorder = new Pen(borderColor, borderSize)) - { - penBorder.Alignment = PenAlignment.Inset; - pevent.Graphics.DrawRectangle(penBorder, 0, 0, this.Width - 1, this.Height - 1); - } - } - } - } - protected override void OnHandleCreated(EventArgs e) - { - base.OnHandleCreated(e); - this.Parent.BackColorChanged += new EventHandler(Container_BackColorChanged); - } - - private void Container_BackColorChanged(object sender, EventArgs e) - { - this.Invalidate(); - } - private void Button_Resize(object sender, EventArgs e) - { - if (borderRadius > this.Height) - borderRadius = this.Height; - } - } - - #endregion -} diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/Button/CrEaTiiOn_DescriptiveButton.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/Button/CrEaTiiOn_DescriptiveButton.cs deleted file mode 100644 index 36a41bf..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/Button/CrEaTiiOn_DescriptiveButton.cs +++ /dev/null @@ -1,172 +0,0 @@ -#region Imports -using CBH_Ultimate_Theme_Library.Theme.Helpers; -using System; -using System.Collections.Generic; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Windows.Forms; -#endregion - -namespace CBH.Controls -{ - public class CrEaTiiOn_DescriptiveButton : Control - { - protected override void OnPaint(PaintEventArgs e) - { - base.OnPaint(e); - - Graphics g = e.Graphics; - g.SmoothingMode = SmoothingMode.HighQuality; - g.Clear(Parent.BackColor); - - DrawingHelper dh = new DrawingHelper(); - MultiLineHandler mlh = new MultiLineHandler(); - int slope = Adjustments.Roundness; - - Rectangle mainRect = new Rectangle(0, 0, Width - 1, Height - 1); - GraphicsPath mainPath = dh.RoundRect(mainRect, slope); - - ColorBlend backCB = new ColorBlend(3); - backCB.Colors = new[] { Color.FromArgb(15, 15, 15), Color.FromArgb(15, 15, 15), Color.FromArgb(15, 15, 15) }; - backCB.Positions = new[] { 0.0f, 0.75f, 1.0f }; - LinearGradientBrush backLGB = new LinearGradientBrush(mainRect, Color.Black, Color.Black, 90.0F); - backLGB.InterpolationColors = backCB; - g.FillPath(backLGB, mainPath); - - SolidBrush textBrush = new SolidBrush(Color.White); - - if (_image != null) - { - Rectangle imageRect = new Rectangle(12, 12, 48, 48); - g.DrawImage(_image, imageRect); - g.DrawString(_title, _titleFont, textBrush, new Point(12 + 48 + 4, (int)(12 + (48 / 2.0) - (g.MeasureString(_title, _titleFont).Height / 2.0)))); - } - else - { - g.DrawString(_title, _titleFont, textBrush, new Point(12, (int)(12 + (48 / 2.0) - (g.MeasureString(_title, _titleFont).Height / 2.0)))); - } - - int descY = 12 + 48 + 14; - textBrush = new SolidBrush(Color.FromArgb(120, 120, 120)); - - foreach (string line in mlh.GetLines(g, Text, Font, Width - 24)) - { - g.DrawString(line, Font, textBrush, new Point(12, descY)); - descY += 13; - } - - if (state == MouseState.Over) - { - g.FillPath(new SolidBrush(Color.FromArgb(10, Color.Black)), mainPath); - } - else if (state == MouseState.Down) - { - g.FillPath(new SolidBrush(Color.FromArgb(18, Color.Black)), mainPath); - } - - LinearGradientBrush borderLGB = new LinearGradientBrush(new Rectangle(0, 0, Width, Height), Color.FromArgb(250, 36, 38), Color.FromArgb(250, 36, 38), 90.0F); - g.DrawPath(new Pen(borderLGB), mainPath); - - } - - public CrEaTiiOn_DescriptiveButton() - { - SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.UserPaint, true); - Font = new Font(Adjustments.DefaultFontFamily, 8); - Size = new Size(200, 130); - Cursor = Cursors.Hand; - } - - private Image _image; - public Image Image - { - get - { - return _image; - } - set - { - _image = value; - Invalidate(); - } - } - - private string _title = "Title"; - public string Title - { - get - { - return _title; - } - set - { - _title = value; - Invalidate(); - } - } - - private Font _titleFont = new Font(Adjustments.DefaultFontFamily, 14); - public Font TitleFont - { - get - { - return _titleFont; - } - set - { - _titleFont = value; - Invalidate(); - } - } - - public enum MouseState - { - None, - Over, - Down - } - - private MouseState state = MouseState.None; - - protected override void OnMouseEnter(EventArgs e) - { - base.OnMouseEnter(e); - state = MouseState.Over; - Invalidate(); - } - - protected override void OnMouseLeave(EventArgs e) - { - base.OnMouseLeave(e); - state = MouseState.None; - Invalidate(); - } - - protected override void OnMouseDown(MouseEventArgs e) - { - base.OnMouseDown(e); - state = MouseState.Down; - Invalidate(); - } - - protected override void OnMouseUp(MouseEventArgs e) - { - base.OnMouseUp(e); - state = MouseState.Over; - Invalidate(); - } - - protected override void OnTextChanged(EventArgs e) - { - base.OnTextChanged(e); - Invalidate(); - } - - protected override void OnFontChanged(EventArgs e) - { - base.OnFontChanged(e); - Font = new Font(Font.FontFamily, 8); - } - - } -} diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/Button/CrEaTiiOn_FlatButton.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/Button/CrEaTiiOn_FlatButton.cs deleted file mode 100644 index 072f9af..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/Button/CrEaTiiOn_FlatButton.cs +++ /dev/null @@ -1,360 +0,0 @@ -#region Imports - -using System.Drawing.Drawing2D; - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_FlatButton - - public class CrEaTiiOn_FlatButton : Control - { - #region Variables - - private int MouseState; - private GraphicsPath Shape; - private LinearGradientBrush InactiveGB; - private Color _InactiveColor = Color.FromArgb(15, 15, 15); - private LinearGradientBrush PressedGB; - private Color _PressedColor = Color.FromArgb(20, 20, 20); - private LinearGradientBrush EnteredGB; - private Color _EnteredColor = Color.FromArgb(25, 25, 25); - private Rectangle R1; - private readonly Pen P1; - private readonly Pen P3; - private Image _Image; - private Size _ImageSize; - private StringAlignment _TextAlignment = StringAlignment.Center; - private Color _TextColor; // VBConversions Note: Initial value cannot be assigned here since it is non-static. Assignment has been moved to the class constructors. - private ContentAlignment _ImageAlign = ContentAlignment.MiddleLeft; - - #endregion - - #region Image Designer - - private static PointF ImageLocation(StringFormat SF, SizeF Area, SizeF ImageArea) - { - PointF MyPoint = new(); - switch (SF.Alignment) - { - case StringAlignment.Center: - MyPoint.X = (float)((Area.Width - ImageArea.Width) / 2); - break; - case StringAlignment.Near: - MyPoint.X = 2; - break; - case StringAlignment.Far: - MyPoint.X = Area.Width - ImageArea.Width - 2; - break; - - } - - switch (SF.LineAlignment) - { - case StringAlignment.Center: - MyPoint.Y = (float)((Area.Height - ImageArea.Height) / 2); - break; - case StringAlignment.Near: - MyPoint.Y = 2; - break; - case StringAlignment.Far: - MyPoint.Y = Area.Height - ImageArea.Height - 2; - break; - } - return MyPoint; - } - - private StringFormat GetStringFormat(ContentAlignment _ContentAlignment) - { - StringFormat SF = new(); - switch (_ContentAlignment) - { - case ContentAlignment.MiddleCenter: - SF.LineAlignment = StringAlignment.Center; - SF.Alignment = StringAlignment.Center; - break; - case ContentAlignment.MiddleLeft: - SF.LineAlignment = StringAlignment.Center; - SF.Alignment = StringAlignment.Near; - break; - case ContentAlignment.MiddleRight: - SF.LineAlignment = StringAlignment.Center; - SF.Alignment = StringAlignment.Far; - break; - case ContentAlignment.TopCenter: - SF.LineAlignment = StringAlignment.Near; - SF.Alignment = StringAlignment.Center; - break; - case ContentAlignment.TopLeft: - SF.LineAlignment = StringAlignment.Near; - SF.Alignment = StringAlignment.Near; - break; - case ContentAlignment.TopRight: - SF.LineAlignment = StringAlignment.Near; - SF.Alignment = StringAlignment.Far; - break; - case ContentAlignment.BottomCenter: - SF.LineAlignment = StringAlignment.Far; - SF.Alignment = StringAlignment.Center; - break; - case ContentAlignment.BottomLeft: - SF.LineAlignment = StringAlignment.Far; - SF.Alignment = StringAlignment.Near; - break; - case ContentAlignment.BottomRight: - SF.LineAlignment = StringAlignment.Far; - SF.Alignment = StringAlignment.Far; - break; - } - return SF; - } - - #endregion - - #region Properties - - public Image Image - { - get => _Image; - set - { - if (value == null) - { - _ImageSize = Size.Empty; - } - else - { - _ImageSize = value.Size; - } - - _Image = value; - Invalidate(); - } - } - - protected Size ImageSize => _ImageSize; - - public ContentAlignment ImageAlign - { - get => _ImageAlign; - set - { - _ImageAlign = value; - Invalidate(); - } - } - - public StringAlignment TextAlignment - { - get => _TextAlignment; - set - { - _TextAlignment = value; - Invalidate(); - } - } - - public override Color ForeColor - { - get => _TextColor; - set - { - _TextColor = value; - Invalidate(); - } - } - - public Color InactiveColor - { - get => _InactiveColor; - set => _InactiveColor = value; - } - - public Color PressedColor - { - get => _PressedColor; - set => _PressedColor = value; - } - - public Color EnteredColor - { - get => _EnteredColor; - set => _EnteredColor = value; - } - - #endregion - - #region EventArgs - - protected override void OnMouseUp(MouseEventArgs e) - { - MouseState = 2; - Invalidate(); - base.OnMouseUp(e); - } - - /*protected override void OnMouseMove(MouseEventArgs e) - { - if (Enabled == true) - Cursor = Cursors.Hand; - else - Cursor = Cursors.No; - base.OnMouseMove(e); - }*/ - - protected override void OnMouseEnter(EventArgs e) - { - MouseState = 2; - Invalidate(); - base.OnMouseEnter(e); - } - - protected override void OnMouseDown(MouseEventArgs e) - { - MouseState = 1; - Focus(); - Invalidate(); - base.OnMouseDown(e); - } - - protected override void OnMouseLeave(EventArgs e) - { - MouseState = 0; - Invalidate(); - base.OnMouseLeave(e); - } - - protected override void OnTextChanged(EventArgs e) - { - Invalidate(); - base.OnTextChanged(e); - } - - #endregion - - public CrEaTiiOn_FlatButton() - { - SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.SupportsTransparentBackColor | ControlStyles.UserPaint, true); - - BackColor = Color.Transparent; - Cursor = Cursors.Hand; - DoubleBuffered = true; - Font = new("Segoe UI", 12); - ForeColor = Color.White; - Size = new(120, 40); - _TextAlignment = StringAlignment.Center; - P1 = new(Color.FromArgb(250, 36, 38)); // P1 = Border color - P3 = new(Color.FromArgb(250, 36, 38)); // P3 = Border color when pressed - } - - protected override void OnResize(EventArgs e) - { - base.OnResize(e); - if (Width > 0 && Height > 0) - { - Shape = new(); - R1 = new(0, 0, Width, Height); - - InactiveGB = new(new Rectangle(0, 0, Width, Height), _InactiveColor, _InactiveColor, 90.0F); - PressedGB = new(new Rectangle(0, 0, Width, Height), _PressedColor, _PressedColor, 90.0F); - EnteredGB = new(new Rectangle(0, 0, Width, Height), _EnteredColor, _EnteredColor, 90.0F); - } - - Shape.AddArc(0, 0, 10, 10, 180, 90); - Shape.AddArc(Width - 11, 0, 10, 10, -90, 90); - Shape.AddArc(Width - 11, Height - 11, 10, 10, 0, 90); - Shape.AddArc(0, Height - 11, 10, 10, 90, 90); - Shape.CloseAllFigures(); - Invalidate(); - } - - protected override void OnPaint(PaintEventArgs e) - { - Graphics G = e.Graphics; - G.SmoothingMode = SmoothingMode.HighQuality; - PointF ipt = ImageLocation(GetStringFormat(ImageAlign), Size, ImageSize); - - switch (MouseState) - { - case 0: - //Inactive - G.FillPath(InactiveGB, Shape); - // Fill button body with InactiveGB color gradient - G.DrawPath(P1, Shape); - // Draw button border [InactiveGB] - if ((Image == null)) - { - G.DrawString(Text, Font, new SolidBrush(ForeColor), R1, new StringFormat - { - Alignment = _TextAlignment, - LineAlignment = StringAlignment.Center - }); - } - else - { - G.DrawImage(_Image, ipt.X, ipt.Y, ImageSize.Width, ImageSize.Height); - G.DrawString(Text, Font, new SolidBrush(ForeColor), R1, new StringFormat - { - Alignment = _TextAlignment, - LineAlignment = StringAlignment.Center - }); - } - break; - case 1: - //Pressed - G.FillPath(PressedGB, Shape); - // Fill button body with PressedGB color gradient - G.DrawPath(P3, Shape); - // Draw button border [PressedGB] - - if ((Image == null)) - { - G.DrawString(Text, Font, new SolidBrush(ForeColor), R1, new StringFormat - { - Alignment = _TextAlignment, - LineAlignment = StringAlignment.Center - }); - } - else - { - G.DrawImage(_Image, ipt.X, ipt.Y, ImageSize.Width, ImageSize.Height); - G.DrawString(Text, Font, new SolidBrush(ForeColor), R1, new StringFormat - { - Alignment = _TextAlignment, - LineAlignment = StringAlignment.Center - }); - } - break; - case 2: - //Entered - G.FillPath(EnteredGB, Shape); - // Fill button body with EnteredGB color gradient - G.DrawPath(P3, Shape); - // Draw button border [EnteredGB] - - if ((Image == null)) - { - G.DrawString(Text, Font, new SolidBrush(ForeColor), R1, new StringFormat - { - Alignment = _TextAlignment, - LineAlignment = StringAlignment.Center - }); - } - else - { - G.DrawImage(_Image, ipt.X, ipt.Y, ImageSize.Width, ImageSize.Height); - G.DrawString(Text, Font, new SolidBrush(ForeColor), R1, new StringFormat - { - Alignment = _TextAlignment, - LineAlignment = StringAlignment.Center - }); - } - break; - } - base.OnPaint(e); - } - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/Button/CrEaTiiOn_LightButton.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/Button/CrEaTiiOn_LightButton.cs deleted file mode 100644 index dac9b34..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/Button/CrEaTiiOn_LightButton.cs +++ /dev/null @@ -1,196 +0,0 @@ -#region Imports -using System; -using System.Drawing.Drawing2D; -using System.Drawing; -using System.Windows.Forms; -#endregion - -namespace CBH.Controls -{ - public class CrEaTiiOn_LightButton : Control - { - - #region "CreateRound" - private GraphicsPath CreateRoundPath; - - private Rectangle CreateRoundRectangle; - public GraphicsPath CreateRound(int x, int y, int width, int height, int slope) - { - CreateRoundRectangle = new Rectangle(x, y, width, height); - return CreateRound(CreateRoundRectangle, slope); - } - - public GraphicsPath CreateRound(Rectangle r, int slope) - { - CreateRoundPath = new GraphicsPath(FillMode.Winding); - CreateRoundPath.AddArc(r.X, r.Y, slope, slope, 180f, 90f); - CreateRoundPath.AddArc(r.Right - slope, r.Y, slope, slope, 270f, 90f); - CreateRoundPath.AddArc(r.Right - slope, r.Bottom - slope, slope, slope, 0f, 90f); - CreateRoundPath.AddArc(r.X, r.Bottom - slope, slope, slope, 90f, 90f); - CreateRoundPath.CloseFigure(); - return CreateRoundPath; - } - #endregion - - #region "Mouse states" - private MouseStates State; - public enum MouseStates - { - None = 0, - Over = 1, - Down = 2 - } - - protected override void OnMouseEnter(EventArgs e) - { - State = MouseStates.Over; - Invalidate(); - base.OnMouseEnter(e); - } - - protected override void OnMouseLeave(EventArgs e) - { - State = MouseStates.None; - Invalidate(); - base.OnMouseEnter(e); - } - - protected override void OnMouseDown(MouseEventArgs e) - { - State = MouseStates.Down; - Invalidate(); - base.OnMouseDown(e); - } - - protected override void OnMouseUp(MouseEventArgs e) - { - State = MouseStates.Over; - Invalidate(); - if (e.Button == MouseButtons.Left) - base.OnClick(null); - //This fixes some fucked up lag you get... - base.OnMouseDown(e); - } - - //Do nothing here or it fires twice - protected override void OnClick(EventArgs e) - { - } - #endregion - - #region "Properties" - - public enum ImageAlignments - { - Left = 0, - Center = 1, - Right = 2 - } - - ImageAlignments _ImageAlignment = ImageAlignments.Left; - public ImageAlignments ImageAlignment - { - get { return _ImageAlignment; } - set - { - _ImageAlignment = value; - Invalidate(); - } - } - - Image _Image; - public Image Image - { - get { return _Image; } - set - { - _Image = value; - Invalidate(); - } - } - - #endregion - - public CrEaTiiOn_LightButton() - { - Size = new Size(120, 31); - DoubleBuffered = true; - SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.SupportsTransparentBackColor, true); - BackColor = Color.FromArgb(250, 36, 38); - Font = new Font("Segoe UI", 9); - } - - protected override void OnPaint(PaintEventArgs e) - { - e.Graphics.SmoothingMode = SmoothingMode.HighQuality; - - Brush LGB = default(Brush); - - switch (State) - { - case MouseStates.None: - LGB = new LinearGradientBrush(new Rectangle(0, 0, Width - 1, Height - 1), Color.FromArgb(20, 20, 20), Color.FromArgb(25, 25, 25), 90f); - break; - case MouseStates.Over: - LGB = new LinearGradientBrush(new Rectangle(0, 0, Width - 1, Height - 1), Color.FromArgb(20, 20, 20), Color.FromArgb(25, 25, 25), 90f); - break; - default: - LGB = new LinearGradientBrush(new Rectangle(0, 0, Width - 1, Height - 1), Color.FromArgb(20, 20, 20), Color.FromArgb(18, 18, 18), 90f); - break; - } - if (!Enabled) - { - LGB = new SolidBrush(Color.FromArgb(20, 20, 20)); - } - e.Graphics.FillPath(LGB, CreateRound(0, 0, Width - 1, Height - 1, 6)); - - if ((_Image == null)) - { - e.Graphics.DrawString(Text, Font, Brushes.White, new Rectangle(3, 2, Width - 7, Height - 5), new StringFormat - { - Alignment = StringAlignment.Center, - LineAlignment = StringAlignment.Center, - Trimming = StringTrimming.EllipsisCharacter - }); - } - else - { - e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic; - switch (_ImageAlignment) - { - case ImageAlignments.Left: - Rectangle ImageRect = new Rectangle(9, 6, Height - 13, Height - 13); - e.Graphics.DrawImage(_Image, ImageRect); - e.Graphics.DrawString(Text, Font, Brushes.White, new Rectangle(ImageRect.X + ImageRect.Width + 6, 2, Width - ImageRect.Width - 22, Height - 5), new StringFormat - { - Alignment = StringAlignment.Center, - LineAlignment = StringAlignment.Center, - Trimming = StringTrimming.EllipsisCharacter - }); - break; - case ImageAlignments.Center: - Rectangle ImageRect1 = new Rectangle(((Width - 1) / 2) - (Height - 13) / 2, 6, Height - 13, Height - 13); - e.Graphics.DrawImage(_Image, ImageRect1); - break; - case ImageAlignments.Right: - Rectangle ImageRect2 = new Rectangle(Width - Height + 3, 6, Height - 13, Height - 13); - e.Graphics.DrawImage(_Image, ImageRect2); - e.Graphics.DrawString(Text, Font, Brushes.White, new Rectangle(3, 2, Width - ImageRect2.Width - 22, Height - 5), new StringFormat - { - Alignment = StringAlignment.Center, - LineAlignment = StringAlignment.Center, - Trimming = StringTrimming.EllipsisCharacter - }); - break; - } - } - - base.OnPaint(e); - } - - public void PerformClick() - { - base.OnClick(null); - } - } -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/Button/CrEaTiiOn_ModernButton.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/Button/CrEaTiiOn_ModernButton.cs deleted file mode 100644 index 433bd82..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/Button/CrEaTiiOn_ModernButton.cs +++ /dev/null @@ -1,331 +0,0 @@ -using CBH_Ultimate_Theme_Library.Theme.Helpers; - -namespace CBH.Controls -{ - #region CrEaTiiOn_ModernButton - - public class CrEaTiiOn_ModernButton : Button - { - private Graphics G; - - private Helpers.MouseState State; - - private Schemes SchemeClone = Schemes.Black; - public Schemes Scheme - { - get { return SchemeClone; } - set - { - SchemeClone = value; - Invalidate(); - } - } - - public enum Schemes : byte - { - Black = 0, - Green = 1, - Red = 2, - Blue = 3 - } - - public CrEaTiiOn_ModernButton() - { - DoubleBuffered = true; - SetStyle(ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.Opaque | ControlStyles.OptimizedDoubleBuffer, true); - } - - protected override void OnPaint(PaintEventArgs e) - { - G = e.Graphics; - - base.OnPaint(e); - - G.Clear(Parent.BackColor); - - switch (Scheme) - { - - case Schemes.Black: - - - if (Enabled) - { - - if (State == Helpers.MouseState.None) - { - using (SolidBrush Background = new SolidBrush(Color.FromArgb(20, 20, 20))) - { - using (Pen Border = new Pen(Color.FromArgb(250, 36, 38))) - { - G.FillPath(Background, Helpers.RoundRect(new Rectangle(0, 0, Width - 1, Height - 1), 2)); - G.DrawPath(Border, Helpers.RoundRect(new Rectangle(0, 0, Width - 1, Height - 1), 2)); - } - } - - - } - else if (State == Helpers.MouseState.Over) - { - using (SolidBrush Background = new SolidBrush(Color.FromArgb(58, 58, 57))) - { - using (Pen Border = new Pen(Color.FromArgb(46, 46, 45))) - { - G.FillPath(Background, Helpers.RoundRect(new Rectangle(0, 0, Width - 1, Height - 1), 2)); - G.DrawPath(Border, Helpers.RoundRect(new Rectangle(0, 0, Width - 1, Height - 1), 2)); - } - } - - - } - else if (State == Helpers.MouseState.Down) - { - using (SolidBrush Background = new SolidBrush(Color.FromArgb(50, 50, 49))) - { - using (Pen Border = new Pen(Color.FromArgb(38, 38, 37))) - { - G.FillPath(Background, Helpers.RoundRect(new Rectangle(0, 0, Width - 1, Height - 1), 2)); - G.DrawPath(Border, Helpers.RoundRect(new Rectangle(0, 0, Width - 1, Height - 1), 2)); - } - } - - } - - - } - else - { - using (SolidBrush Background = new SolidBrush(Color.FromArgb(40, 40, 39))) - { - using (Pen Border = new Pen(Color.FromArgb(38, 38, 37))) - { - G.FillPath(Background, Helpers.RoundRect(new Rectangle(0, 0, Width - 1, Height - 1), 2)); - G.DrawPath(Border, Helpers.RoundRect(new Rectangle(0, 0, Width - 1, Height - 1), 2)); - } - } - - } - - break; - case Schemes.Green: - - - if (State == Helpers.MouseState.None) - { - using (SolidBrush Background = new SolidBrush(Color.FromArgb(123, 164, 93))) - { - using (Pen Border = new Pen(Color.FromArgb(119, 160, 89))) - { - G.FillPath(Background, Helpers.RoundRect(new Rectangle(0, 0, Width - 1, Height - 1), 2)); - G.DrawPath(Border, Helpers.RoundRect(new Rectangle(0, 0, Width - 1, Height - 1), 2)); - } - } - - - } - else if (State == Helpers.MouseState.Over) - { - using (SolidBrush Background = new SolidBrush(Color.FromArgb(127, 168, 97))) - { - using (Pen Border = new Pen(Color.FromArgb(123, 164, 93))) - { - G.FillPath(Background, Helpers.RoundRect(new Rectangle(0, 0, Width - 1, Height - 1), 2)); - G.DrawPath(Border, Helpers.RoundRect(new Rectangle(0, 0, Width - 1, Height - 1), 2)); - } - } - - - } - else if (State == Helpers.MouseState.Down) - { - using (SolidBrush Background = new SolidBrush(Color.FromArgb(119, 160, 93))) - { - using (Pen Border = new Pen(Color.FromArgb(115, 156, 85))) - { - G.FillPath(Background, Helpers.RoundRect(new Rectangle(0, 0, Width - 1, Height - 1), 2)); - G.DrawPath(Border, Helpers.RoundRect(new Rectangle(0, 0, Width - 1, Height - 1), 2)); - } - } - - } - - break; - case Schemes.Red: - - - if (State == Helpers.MouseState.None) - { - using (SolidBrush Background = new SolidBrush(Color.FromArgb(164, 93, 93))) - { - using (Pen Border = new Pen(Color.FromArgb(160, 89, 89))) - { - G.FillPath(Background, Helpers.RoundRect(new Rectangle(0, 0, Width - 1, Height - 1), 2)); - G.DrawPath(Border, Helpers.RoundRect(new Rectangle(0, 0, Width - 1, Height - 1), 2)); - } - } - - - } - else if (State == Helpers.MouseState.Over) - { - using (SolidBrush Background = new SolidBrush(Color.FromArgb(168, 97, 97))) - { - using (Pen Border = new Pen(Color.FromArgb(164, 93, 93))) - { - G.FillPath(Background, Helpers.RoundRect(new Rectangle(0, 0, Width - 1, Height - 1), 2)); - G.DrawPath(Border, Helpers.RoundRect(new Rectangle(0, 0, Width - 1, Height - 1), 2)); - } - } - - - } - else if (State == Helpers.MouseState.Down) - { - using (SolidBrush Background = new SolidBrush(Color.FromArgb(160, 89, 89))) - { - using (Pen Border = new Pen(Color.FromArgb(156, 85, 85))) - { - G.FillPath(Background, Helpers.RoundRect(new Rectangle(0, 0, Width - 1, Height - 1), 2)); - G.DrawPath(Border, Helpers.RoundRect(new Rectangle(0, 0, Width - 1, Height - 1), 2)); - } - } - - } - - break; - case Schemes.Blue: - - - if (State == Helpers.MouseState.None) - { - using (SolidBrush Background = new SolidBrush(Color.FromArgb(93, 154, 164))) - { - using (Pen Border = new Pen(Color.FromArgb(89, 150, 160))) - { - G.FillPath(Background, Helpers.RoundRect(new Rectangle(0, 0, Width - 1, Height - 1), 2)); - G.DrawPath(Border, Helpers.RoundRect(new Rectangle(0, 0, Width - 1, Height - 1), 2)); - } - } - - - } - else if (State == Helpers.MouseState.Over) - { - using (SolidBrush Background = new SolidBrush(Color.FromArgb(97, 160, 168))) - { - using (Pen Border = new Pen(Color.FromArgb(93, 154, 164))) - { - G.FillPath(Background, Helpers.RoundRect(new Rectangle(0, 0, Width - 1, Height - 1), 2)); - G.DrawPath(Border, Helpers.RoundRect(new Rectangle(0, 0, Width - 1, Height - 1), 2)); - } - } - - - } - else if (State == Helpers.MouseState.Down) - { - using (SolidBrush Background = new SolidBrush(Color.FromArgb(89, 150, 160))) - { - using (Pen Border = new Pen(Color.FromArgb(85, 146, 156))) - { - G.FillPath(Background, Helpers.RoundRect(new Rectangle(0, 0, Width - 1, Height - 1), 2)); - G.DrawPath(Border, Helpers.RoundRect(new Rectangle(0, 0, Width - 1, Height - 1), 2)); - } - } - - } - - break; - } - - - if (Scheme == Schemes.Black) - { - if (Enabled) - { - using (SolidBrush TextBrush = new SolidBrush(Color.FromArgb(220, 220, 219))) - { - using (Font TextFont = new Font("Segoe UI", 9)) - { - using (StringFormat SF = new StringFormat { Alignment = StringAlignment.Center }) - { - G.DrawString(Text, TextFont, TextBrush, new Rectangle(0, Height / 2 - 9, Width, Height), SF); - } - } - } - - - } - else - { - using (SolidBrush TextBrush = new SolidBrush(Color.FromArgb(140, 140, 139))) - { - using (Font TextFont = new Font("Segoe UI", 9)) - { - using (StringFormat SF = new StringFormat { Alignment = StringAlignment.Center }) - { - G.DrawString(Text, TextFont, TextBrush, new Rectangle(0, Height / 2 - 9, Width, Height), SF); - } - } - } - - } - - - } - else - { - if (!Enabled) - { - Scheme = Schemes.Black; - } - - using (SolidBrush TextBrush = new SolidBrush(Color.FromArgb(250, 250, 249))) - { - using (Font TextFont = new Font("Segoe UI", 9)) - { - using (StringFormat SF = new StringFormat { Alignment = StringAlignment.Center }) - { - G.DrawString(Text, TextFont, TextBrush, new Rectangle(0, Height / 2 - 9, Width, Height), SF); - } - } - } - - } - - - - } - - protected override void OnMouseEnter(EventArgs e) - { - State = Helpers.MouseState.Over; - Invalidate(); - base.OnMouseEnter(e); - } - - protected override void OnMouseLeave(EventArgs e) - { - State = Helpers.MouseState.None; - Invalidate(); - base.OnMouseLeave(e); - } - - protected override void OnMouseUp(MouseEventArgs e) - { - State = Helpers.MouseState.Over; - Invalidate(); - base.OnMouseUp(e); - } - - protected override void OnMouseDown(MouseEventArgs e) - { - State = Helpers.MouseState.Down; - Invalidate(); - base.OnMouseDown(e); - } - - } - - #endregion -} diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/Button/CrEaTiiOn_PillButton.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/Button/CrEaTiiOn_PillButton.cs deleted file mode 100644 index 0f322eb..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/Button/CrEaTiiOn_PillButton.cs +++ /dev/null @@ -1,312 +0,0 @@ -#region Imports - -using CBH_Ultimate_Theme_Library.Theme.Helpers; -using System.ComponentModel; -using System.Drawing.Drawing2D; - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_PillButton - - [Description("Text")] - public class CrEaTiiOn_PillButton : Control, IButtonControl - { - #region Variables - int radius; - bool transparency; - MouseState state; - RoundedRectangleF roundedRect; - Color inactive1, inactive2, active1, active2; - private Color strokeColor; - private bool stroke; - - public bool Stroke - { - get { return stroke; } - set - { - stroke = value; - Invalidate(); - } - } - - public Color StrokeColor - { - get { return strokeColor; } - set - { - strokeColor = value; - Invalidate(); - } - } - #endregion - - #region AltoButton - public CrEaTiiOn_PillButton() - { - Width = 65; - Height = 30; - stroke = false; - strokeColor = Color.Gray; - inactive1 = Color.FromArgb(250, 36, 38); - inactive2 = Color.FromArgb(250, 36, 38); - active1 = Color.FromArgb(230, 16, 18); - active2 = Color.FromArgb(230, 16, 18); - - radius = 10; - roundedRect = new RoundedRectangleF(Width, Height, radius); - - SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | - ControlStyles.ResizeRedraw | ControlStyles.SupportsTransparentBackColor | - ControlStyles.UserPaint, true); - BackColor = Color.Transparent; - ForeColor = Color.White; - Font = new System.Drawing.Font("Segoe UI", 10, FontStyle.Bold); - state = MouseState.Leave; - transparency = false; - } - #endregion - - #region Events - protected override void OnPaint(PaintEventArgs e) - { - #region Transparency - if (transparency) - Transparenter.MakeTransparent(this, e.Graphics); - #endregion - - #region Drawing - e.Graphics.SmoothingMode = SmoothingMode.HighQuality; - roundedRect = new RoundedRectangleF(Width, Height, radius); - e.Graphics.FillRectangle(Brushes.Transparent, this.ClientRectangle); - - int R1 = (active1.R + inactive1.R) / 2; - int G1 = (active1.G + inactive1.G) / 2; - int B1 = (active1.B + inactive1.B) / 2; - - int R2 = (active2.R + inactive2.R) / 2; - int G2 = (active2.G + inactive2.G) / 2; - int B2 = (active2.B + inactive2.B) / 2; - - Rectangle rect = new Rectangle(0, 0, Width, Height); - - if (this.Enabled) - { - if (state == MouseState.Leave) - using (LinearGradientBrush inactiveGB = new LinearGradientBrush(rect, inactive1, inactive2, 90f)) - e.Graphics.FillPath(inactiveGB, roundedRect.Path); - else if (state == MouseState.Enter) - using (LinearGradientBrush activeGB = new LinearGradientBrush(rect, active1, active2, 90f)) - e.Graphics.FillPath(activeGB, roundedRect.Path); - else if (state == MouseState.Down) - using (LinearGradientBrush downGB = new LinearGradientBrush(rect, Color.FromArgb(R1, G1, B1), Color.FromArgb(R2, G2, B2), 90f)) - e.Graphics.FillPath(downGB, roundedRect.Path); - if (stroke) - using (Pen pen = new Pen(strokeColor, 1)) - using (GraphicsPath path = new RoundedRectangleF(Width - (radius > 0 ? 0 : 1), Height - (radius > 0 ? 0 : 1), radius).Path) - e.Graphics.DrawPath(pen, path); - } - else - { - Color linear1 = Color.FromArgb(190, 190, 190); - Color linear2 = Color.FromArgb(210, 210, 210); - using (LinearGradientBrush inactiveGB = new LinearGradientBrush(rect, linear1, linear2, 90f)) - { - e.Graphics.FillPath(inactiveGB, roundedRect.Path); - e.Graphics.DrawPath(new Pen(inactiveGB), roundedRect.Path); - } - } - - - #endregion - - #region Text Drawing - using (StringFormat sf = new StringFormat() - { - LineAlignment = StringAlignment.Center, - Alignment = StringAlignment.Center - }) - using (Brush brush = new SolidBrush(ForeColor)) - e.Graphics.DrawString(Text, Font, brush, this.ClientRectangle, sf); - #endregion - base.OnPaint(e); - } - protected override void OnMouseDoubleClick(MouseEventArgs e) - { - base.OnMouseDoubleClick(e); - base.OnClick(e); - } - protected override void OnClick(EventArgs e) - { - base.OnClick(e); - } - protected override void OnEnabledChanged(EventArgs e) - { - Invalidate(); - base.OnEnabledChanged(e); - } - protected override void OnResize(EventArgs e) - { - Invalidate(); - base.OnResize(e); - } - protected override void OnMouseEnter(EventArgs e) - { - state = MouseState.Enter; - base.OnMouseEnter(e); - Invalidate(); - } - protected override void OnMouseLeave(EventArgs e) - { - state = MouseState.Leave; - base.OnMouseLeave(e); - Invalidate(); - } - protected override void OnMouseDown(MouseEventArgs e) - { - Capture = false; - state = MouseState.Down; - base.OnMouseDown(e); - Invalidate(); - } - protected override void OnMouseUp(MouseEventArgs e) - { - if (state != MouseState.Leave) - state = MouseState.Enter; - base.OnMouseUp(e); - Invalidate(); - } - #endregion - - #region Properties - - - public int Radius - { - get - { - return radius; - } - set - { - radius = value; - Invalidate(); - } - } - public Color Inactive1 - { - get - { - return inactive1; - } - set - { - inactive1 = value; - Invalidate(); - } - } - public Color Inactive2 - { - get - { - return inactive2; - } - set - { - inactive2 = value; - Invalidate(); - } - } - public Color Active1 - { - get - { - return active1; - } - set - { - active1 = value; - Invalidate(); - } - } - public Color Active2 - { - get - { - return active2; - } - set - { - active2 = value; - Invalidate(); - } - } - public bool Transparency - { - get - { - return transparency; - } - set - { - transparency = value; - } - } - public override string Text - { - get - { - return base.Text; - } - set - { - base.Text = value; - Invalidate(); - } - } - public override Color ForeColor - { - get - { - return base.ForeColor; - } - set - { - base.ForeColor = value; - Invalidate(); - } - } - - public DialogResult DialogResult - { - get - { - return System.Windows.Forms.DialogResult.OK; - } - set - { - } - } - - public void NotifyDefault(bool value) - { - } - - public void PerformClick() - { - OnClick(EventArgs.Empty); - } - #endregion - } - public enum MouseState - { - Enter, - Leave, - Down, - Up, - } - - #endregion -} diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/Card/CrEaTiiOn_GradientCard.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/Card/CrEaTiiOn_GradientCard.cs deleted file mode 100644 index 9a5fafa..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/Card/CrEaTiiOn_GradientCard.cs +++ /dev/null @@ -1,166 +0,0 @@ -#region Imports - -using System.ComponentModel; -using System.Drawing.Drawing2D; -using System.Drawing.Text; - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_GradientCard - - public class CrEaTiiOn_GradientCard : Control - { - public CrEaTiiOn_GradientCard() - { - base.SetStyle(ControlStyles.ResizeRedraw | ControlStyles.SupportsTransparentBackColor, true); - base.Size = new Size(320, 170); - BackColor = Color.Transparent; - ForeColor = Color.White; - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The 1st half color of he gradient")] - public Color Color1 - { - get => color1; - set - { - color1 = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The 2nd half color of he gradient")] - public Color Color2 - { - get => color2; - set - { - color2 = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The 1st text")] - public string Text1 - { - get => text1; - set - { - text1 = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The 2nd text")] - public string Text2 - { - get => text2; - set - { - text2 = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The 3rd text")] - public string Text3 - { - get => text3; - set - { - text3 = value; - base.Invalidate(); - } - } - - private PixelOffsetMode _PixelOffsetType = PixelOffsetMode.HighQuality; - [Category("CrEaTiiOn")] - [Browsable(true)] - public PixelOffsetMode PixelOffsetType - { - get => _PixelOffsetType; - set - { - _PixelOffsetType = value; - Invalidate(); - } - } - - private TextRenderingHint _TextRenderingType = TextRenderingHint.ClearTypeGridFit; - [Category("CrEaTiiOn")] - [Browsable(true)] - public TextRenderingHint TextRenderingType - { - get => _TextRenderingType; - set - { - _TextRenderingType = value; - Invalidate(); - } - } - - protected override void OnPaint(PaintEventArgs e) - { - base.OnPaint(e); - e.Graphics.SmoothingMode = SmoothingMode.HighQuality; - e.Graphics.TextRenderingHint = TextRenderingHint.AntiAliasGridFit; - if (base.Width > base.Height) - { - int width = base.Width; - } - else - { - int height = base.Height; - } - Brush brush = new LinearGradientBrush(base.ClientRectangle, color1, color2, 135f); - using (GraphicsPath graphicsPath = new()) - { - graphicsPath.AddArc(base.Width - 10 - 2, 0, 10, 10, 250f, 90f); - graphicsPath.AddArc(base.Width - 10 - 2, base.Height - 10, 10, 8, 0f, 90f); - graphicsPath.AddArc(0, base.Height - 10 - 2, 8, 10, 90f, 90f); - graphicsPath.AddArc(0, 0, 10, 10, 180f, 90f); - graphicsPath.CloseFigure(); - e.Graphics.FillPath(brush, graphicsPath); - } - StringFormat stringFormat = new() - { - LineAlignment = StringAlignment.Center, - Alignment = StringAlignment.Near - }; - e.Graphics.PixelOffsetMode = PixelOffsetType; - e.Graphics.TextRenderingHint = TextRenderingType; - Rectangle r = new Rectangle(2, 6, base.Width - 4, 26); - e.Graphics.DrawString(text1, new Font(Font.FontFamily, Font.Size + 4f), new SolidBrush(ForeColor), r, stringFormat); - stringFormat.Alignment = StringAlignment.Near; - r = new Rectangle(2, base.Height / 2, base.Width - 4, base.Height / 4); - e.Graphics.DrawString(text2, new Font(Font.FontFamily, Font.Size * 2f + 2f), new SolidBrush(ForeColor), r, stringFormat); - stringFormat.Alignment = StringAlignment.Near; - r = new Rectangle(2, base.Height / 2 + base.Height / 4, base.Width - 4, base.Height / 4); - e.Graphics.DrawString(text3, new Font(Font.FontFamily, Font.Size + 2f), new SolidBrush(ForeColor), r, stringFormat); - } - - private Color color1 = Color.FromArgb(20, 20, 20); - - private Color color2 = Color.FromArgb(250, 36, 38); - - private string text1 = "CrEaTiiOn Brotherhood"; - - private string text2 = "Enter a message"; - - private string text3 = "Theme by EternalModz"; - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/CheckBox/CrEaTiiOn_CheckBox.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/CheckBox/CrEaTiiOn_CheckBox.cs deleted file mode 100644 index 92d26c0..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/CheckBox/CrEaTiiOn_CheckBox.cs +++ /dev/null @@ -1,89 +0,0 @@ -using CBH_Ultimate_Theme_Library.Theme.Helpers; - -namespace CBH.Controls -{ - public class CrEaTiiOn_CheckBox : CheckBox - { - private Graphics G; - public CrEaTiiOn_CheckBox() - { - DoubleBuffered = true; - Font = new Font("Segoe UI", 9); - SetStyle(ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.Opaque | ControlStyles.OptimizedDoubleBuffer, true); - } - - protected override void OnPaint(PaintEventArgs e) - { - G = e.Graphics; - - base.OnPaint(e); - - G.Clear(Parent.BackColor); - - if (Enabled) - { - using (SolidBrush Back = new SolidBrush(Color.Transparent)) - { - G.FillPath(Back, Helpers.RoundRect(new Rectangle(0, 0, 16, 16), 1)); - } - - using (Pen Border = new Pen(Color.FromArgb(250, 36, 38))) - { - G.DrawPath(Border, Helpers.RoundRect(new Rectangle(0, 0, 16, 16), 1)); - } - - using (SolidBrush TextBrush = new SolidBrush(Color.White)) - { - using (Font TextFont = new Font("Segoe UI", 9)) - { - G.DrawString(Text, TextFont, TextBrush, new Point(22, 0)); - } - } - - if (Checked) - { - using (SolidBrush TextBrush = new SolidBrush(Color.FromArgb(20, 20, 20))) - { - using (Font TextFont = new Font("Marlett", 12)) - { - G.DrawString("b", TextFont, TextBrush, new Point(-2, 1)); - } - } - - } - - } - else - { - using (SolidBrush Back = new SolidBrush(Color.FromArgb(20, 20, 20))) - { - G.FillPath(Back, Helpers.RoundRect(new Rectangle(0, 0, 16, 16), 1)); - } - - using (Pen Border = new Pen(Color.FromArgb(36, 36, 35))) - { - G.DrawPath(Border, Helpers.RoundRect(new Rectangle(0, 0, 16, 16), 1)); - } - - using (SolidBrush TextBrush = new SolidBrush(Color.FromArgb(20, 20, 20))) - { - using (Font TextFont = new Font("Segoe UI", 9)) - { - G.DrawString(Text, TextFont, TextBrush, new Point(22, 0)); - } - } - - if (Checked) - { - using (SolidBrush TextBrush = new SolidBrush(Color.FromArgb(20, 20, 20))) - { - using (Font TextFont = new Font("Marlett", 12)) - { - G.DrawString("b", TextFont, TextBrush, new Point(-2, 1)); - } - } - } - } - } - } -} diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/CheckBox/CrEaTiiOn_CustomCheckBox.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/CheckBox/CrEaTiiOn_CustomCheckBox.cs deleted file mode 100644 index aabd652..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/CheckBox/CrEaTiiOn_CustomCheckBox.cs +++ /dev/null @@ -1,265 +0,0 @@ -#region Imports - -using System.ComponentModel; -using System.Drawing.Drawing2D; -using System.Drawing.Text; - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_CheckBox - - public class CrEaTiiOn_CustomCheckBox : Control - { - public CrEaTiiOn_CustomCheckBox() - { - base.Size = new Size(100, 20); - Text = base.Name; - ForeColor = Color.White; - currentColor = checkboxColor; - Cursor = Cursors.Hand; - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("Checked or unchecked")] - public bool Checked - { - get => isChecked; - set - { - isChecked = value; - OnCheckedStateChanged(); - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("Thickness of the tick when checked")] - public int TickThickness - { - get => tickThickness; - set - { - tickThickness = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("Checkbox color")] - public Color CheckboxColor - { - get => checkboxColor; - set - { - checkboxColor = value; - currentColor = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("Checkbox color")] - public Color CheckboxCheckColor - { - get => checkboxCheckColor; - set - { - checkboxCheckColor = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("Checkbox ios border color")] - public Color BorderColor - { - get => borderColor; - set - { - borderColor = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("Checkbox ios badge color")] - public Color BadgeColor - { - get => badgeColor; - set - { - badgeColor = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("Checkbox color when hovering")] - public Color CheckboxHoverColor - { - get => checkboxHoverColor; - set - { - checkboxHoverColor = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The Checkbox style")] - public Style CheckboxStyle - { - get => checkboxStyle; - set - { - checkboxStyle = value; - base.Invalidate(); - } - } - - private SmoothingMode _SmoothingType = SmoothingMode.AntiAlias; - [Category("CrEaTiiOn")] - [Browsable(true)] - public SmoothingMode SmoothingType - { - get => _SmoothingType; - set - { - _SmoothingType = value; - Invalidate(); - } - } - - private PixelOffsetMode _PixelOffsetType = PixelOffsetMode.HighQuality; - [Category("CrEaTiiOn")] - [Browsable(true)] - public PixelOffsetMode PixelOffsetType - { - get => _PixelOffsetType; - set - { - _PixelOffsetType = value; - Invalidate(); - } - } - - private TextRenderingHint _TextRenderingType = TextRenderingHint.ClearTypeGridFit; - [Category("CrEaTiiOn")] - [Browsable(true)] - public TextRenderingHint TextRenderingType - { - get => _TextRenderingType; - set - { - _TextRenderingType = value; - Invalidate(); - } - } - - public event EventHandler CheckedStateChanged; - - protected virtual void OnCheckedStateChanged() - { - CheckedStateChanged?.Invoke(this, new EventArgs()); - } - - protected override void OnMouseEnter(EventArgs e) - { - base.OnMouseEnter(e); - currentColor = checkboxHoverColor; - base.Invalidate(); - } - - protected override void OnMouseLeave(EventArgs e) - { - base.OnMouseLeave(e); - currentColor = checkboxColor; - base.Invalidate(); - } - - protected override void OnClick(EventArgs e) - { - base.OnClick(e); - if (!Checked) - { - Checked = true; - return; - } - Checked = false; - } - - protected override void OnPaint(PaintEventArgs e) - { - e.Graphics.SmoothingMode = SmoothingType; - if (checkboxStyle == Style.Material) - { - e.Graphics.FillRectangle(new SolidBrush(currentColor), 1, 1, base.Height - 2, base.Height - 2); - if (isChecked) - { - e.Graphics.DrawLine(new Pen(checkboxCheckColor, tickThickness), 2, base.Height / 3 * 2, base.Height / 2, base.Height - 2); - e.Graphics.DrawLine(new Pen(checkboxCheckColor, tickThickness), base.Height / 2, base.Height - 2, base.Height - 2, 1); - } - } - if (checkboxStyle == Style.iOS) - { - if (!isChecked) - { - e.Graphics.DrawEllipse(new Pen(BorderColor), 2, 2, base.Height - 4, base.Height - 4); - } - if (isChecked) - { - e.Graphics.FillEllipse(new SolidBrush(BadgeColor), 1, 1, base.Height - 2, base.Height - 2); - e.Graphics.DrawLine(new Pen(checkboxCheckColor, tickThickness), base.Height / 5, base.Height / 2, base.Height / 2, base.Height / 4 * 3); - e.Graphics.DrawLine(new Pen(checkboxCheckColor, tickThickness), base.Height / 2, base.Height / 4 * 3, base.Height / 5 * 4, base.Height / 4); - } - } - StringFormat stringFormat = new() - { - LineAlignment = StringAlignment.Center, - Alignment = StringAlignment.Near - }; - SolidBrush brush = new(ForeColor); - RectangleF layoutRectangle = new(base.Height + 3, 0f, base.Width - base.Height - 2, Height); - e.Graphics.PixelOffsetMode = PixelOffsetType; - e.Graphics.TextRenderingHint = TextRenderingType; - e.Graphics.DrawString(Text, Font, brush, layoutRectangle, stringFormat); - base.OnPaint(e); - } - - private bool isChecked; - - private int tickThickness = 2; - - private Color checkboxColor = Color.FromArgb(15, 15, 15); - - private Color checkboxCheckColor = Color.FromArgb(250, 36, 38); - - private Color checkboxHoverColor = Color.FromArgb(155, 41, 43); - - private Style checkboxStyle = Style.Material; - - private Color currentColor; - - private Color borderColor = Color.FromArgb(20, 20, 20); - - private Color badgeColor = Color.FromArgb(10, 10, 10); - - public enum Style - { - iOS, - Material - } - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/CheckBox/CrEaTiiOn_FlatCheckBox.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/CheckBox/CrEaTiiOn_FlatCheckBox.cs deleted file mode 100644 index b3b64e8..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/CheckBox/CrEaTiiOn_FlatCheckBox.cs +++ /dev/null @@ -1,173 +0,0 @@ -#region Imports - -using System.ComponentModel; -using System.Drawing.Drawing2D; - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_FlatCheckBox - - [DefaultEvent("CheckedChanged")] - public class CrEaTiiOn_FlatCheckBox : Control - { - #region Variables - - private int X; - private bool _Enable = true; - private bool _Checked = false; - private GraphicsPath Shape; - private Color _CheckedEnabledColor = Color.FromArgb(250, 36, 38); - private Color _CheckedDisabledColor = Color.Gray; - private Color _CheckedBorderColor = Color.FromArgb(250, 36, 38); - private Color _CheckedBackColor = Color.FromArgb(20, 20, 20); - - #endregion - - #region Properties - - public bool Checked - { - get => _Checked; - set - { - _Checked = value; - CheckedChangedEvent?.Invoke(this); - Invalidate(); - } - } - - public bool Enable - { - get => _Enable; - set - { - _Enable = value; - Invalidate(); - } - } - - public Color CheckedEnabledColor - { - get => _CheckedEnabledColor; - set => _CheckedEnabledColor = value; - } - - public Color CheckedDisabledColor - { - get => _CheckedDisabledColor; - set => _CheckedDisabledColor = value; - } - - public Color CheckedBorderColor - { - get => _CheckedBorderColor; - set => _CheckedBorderColor = value; - } - - public Color CheckedBackColor - { - get => _CheckedBackColor; - set => _CheckedBackColor = value; - } - - #endregion - - #region EventArgs - - public delegate void CheckedChangedEventHandler(object sender); - private CheckedChangedEventHandler CheckedChangedEvent; - - public event CheckedChangedEventHandler CheckedChanged - { - add => CheckedChangedEvent = (CheckedChangedEventHandler)Delegate.Combine(CheckedChangedEvent, value); - remove => CheckedChangedEvent = (CheckedChangedEventHandler)Delegate.Remove(CheckedChangedEvent, value); - } - - - protected override void OnMouseMove(MouseEventArgs e) - { - base.OnMouseMove(e); - X = e.Location.X; - Invalidate(); - } - - protected override void OnMouseDown(MouseEventArgs e) - { - if (_Enable) - { - Checked = !Checked; - Focus(); - base.OnMouseDown(e); - } - } - - protected override void OnResize(EventArgs e) - { - base.OnResize(e); - - Height = 16; - - Shape = new(); - Shape.AddArc(0, 0, 10, 10, 180, 90); - Shape.AddArc(Width - 11, 0, 10, 10, -90, 90); - Shape.AddArc(Width - 11, Height - 11, 10, 10, 0, 90); - Shape.AddArc(0, Height - 11, 10, 10, 90, 90); - Shape.CloseAllFigures(); - Invalidate(); - } - - #endregion - - public CrEaTiiOn_FlatCheckBox() - { - Width = 85; - Height = 16; - Font = new("Segoe UI", 9); - DoubleBuffered = true; - Cursor = Cursors.Hand; - ForeColor = Color.White; - } - - protected override void OnPaint(PaintEventArgs e) - { - base.OnPaint(e); - Graphics G = e.Graphics; - G.Clear(BackColor); - - if (_Checked) - { - G.FillRectangle(new SolidBrush(_CheckedBorderColor), new Rectangle(0, 0, 16, 16)); - G.FillRectangle(new SolidBrush(_CheckedBackColor), new Rectangle(1, 1, 16 - 2, 16 - 2)); - } - else - { - G.FillRectangle(new SolidBrush(_CheckedBorderColor), new Rectangle(0, 0, 16, 16)); - G.FillRectangle(new SolidBrush(_CheckedBackColor), new Rectangle(1, 1, 16 - 2, 16 - 2)); - } - - if (_Enable) - { - if (_Checked) - { - G.DrawString("a", new Font("Marlett", 16), new SolidBrush(_CheckedEnabledColor), new Point(-5, -3)); - } - - Cursor = Cursors.Hand; - } - else - { - if (_Checked) - { - G.DrawString("a", new Font("Marlett", 16), new SolidBrush(_CheckedDisabledColor), new Point(-5, -3)); - } - - Cursor = Cursors.Default; - } - - G.DrawString(Text, Font, new SolidBrush(ForeColor), new Point(20, 0)); - } - } - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/CheckBox/CrEaTiiOn_LightCheckBox.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/CheckBox/CrEaTiiOn_LightCheckBox.cs deleted file mode 100644 index 1f24fef..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/CheckBox/CrEaTiiOn_LightCheckBox.cs +++ /dev/null @@ -1,186 +0,0 @@ -#region Imports -using System; -using System.Drawing.Drawing2D; -using System.ComponentModel; -using System.Drawing; -using System.Windows.Forms; -#endregion - -namespace CBH.Controls -{ - [DefaultEvent("CheckedChanged")] - public class CrEaTiiOn_LightCheckBox : Control - { - - #region "CreateRound" - private GraphicsPath CreateRoundPath; - - private Rectangle CreateRoundRectangle; - public GraphicsPath CreateRound(int x, int y, int width, int height, int slope) - { - CreateRoundRectangle = new Rectangle(x, y, width, height); - return CreateRound(CreateRoundRectangle, slope); - } - - public GraphicsPath CreateRound(Rectangle r, int slope) - { - CreateRoundPath = new GraphicsPath(FillMode.Winding); - CreateRoundPath.AddArc(r.X, r.Y, slope, slope, 180f, 90f); - CreateRoundPath.AddArc(r.Right - slope, r.Y, slope, slope, 270f, 90f); - CreateRoundPath.AddArc(r.Right - slope, r.Bottom - slope, slope, slope, 0f, 90f); - CreateRoundPath.AddArc(r.X, r.Bottom - slope, slope, slope, 90f, 90f); - CreateRoundPath.CloseFigure(); - return CreateRoundPath; - } - #endregion - - #region "Mouse states" - private MouseStates State; - private int X; - public enum MouseStates - { - None = 0, - Over = 1, - Down = 2 - } - - protected override void OnMouseEnter(EventArgs e) - { - State = MouseStates.Over; - Invalidate(); - base.OnMouseEnter(e); - } - - protected override void OnMouseLeave(EventArgs e) - { - State = MouseStates.None; - X = -1; - Invalidate(); - base.OnMouseEnter(e); - } - - protected override void OnMouseDown(MouseEventArgs e) - { - State = MouseStates.Down; - Invalidate(); - base.OnMouseDown(e); - } - - protected override void OnMouseMove(MouseEventArgs e) - { - X = e.X; - Invalidate(); - base.OnMouseMove(e); - } - - protected override void OnMouseUp(MouseEventArgs e) - { - State = MouseStates.Over; - Invalidate(); - if (e.Button == MouseButtons.Left) - { - base.OnClick(null); - _Checked = !_Checked; - Invalidate(); - } - - base.OnMouseDown(e); - } - - //Do nothing here or it fires twice - protected override void OnClick(EventArgs e) - { - } - #endregion - - #region "Properties" - - public event CheckedChangedEventHandler CheckedChanged; - public delegate void CheckedChangedEventHandler(object sender); - - private bool _Checked; - public bool Checked - { - get { return _Checked; } - set - { - _Checked = value; - if (CheckedChanged != null) - { - CheckedChanged(this); - } - Invalidate(); - } - } - - public enum SliderLocations - { - Left = 0, - Right = 1 - } - - private SliderLocations _SliderLocation = SliderLocations.Right; - public SliderLocations SliderLocation - { - get { return _SliderLocation; } - set - { - _SliderLocation = value; - Invalidate(); - } - } - - #endregion - - public CrEaTiiOn_LightCheckBox() - { - DoubleBuffered = true; - SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.SupportsTransparentBackColor, true); - Font = new Font("Segoe UI", 9); - ForeColor = Color.White; - BackColor = Color.Transparent; - Size = new Size(150, 21); - } - - protected override void OnPaint(PaintEventArgs e) - { - e.Graphics.SmoothingMode = SmoothingMode.HighQuality; - - Brush LGB = default(Brush); - - if (X >= 0 & X < 17) - { - switch (State) - { - case MouseStates.None: - LGB = new LinearGradientBrush(new Rectangle(0, 0, Width - 1, Height - 1), Color.FromArgb(20, 20, 20), Color.FromArgb(25, 25, 25), 90f); - break; - case MouseStates.Over: - LGB = new LinearGradientBrush(new Rectangle(0, 0, Width - 1, Height - 1), Color.FromArgb(20, 20, 20), Color.FromArgb(25, 25, 25), 90f); - break; - default: - LGB = new LinearGradientBrush(new Rectangle(0, 0, Width - 1, Height - 1), Color.FromArgb(20, 20, 20), Color.FromArgb(10, 10, 10), 90f); - break; - } - } - else - { - LGB = new LinearGradientBrush(new Rectangle(0, 0, Width - 1, Height - 1), Color.FromArgb(20, 20, 20), Color.FromArgb(25, 25, 25), 90f); - } - e.Graphics.FillPath(LGB, CreateRound(1, 2, 15, 15, 7)); - - if (_Checked) - { - e.Graphics.DrawString("a", new Font("Marlett", 13), Brushes.Red, new Point(-2, 1)); - } - - e.Graphics.DrawString(Text, Font, new SolidBrush(ForeColor), new Rectangle(20, 0, Width - 21, Height - 1), new StringFormat - { - Alignment = StringAlignment.Near, - LineAlignment = StringAlignment.Center, - Trimming = StringTrimming.EllipsisCharacter - }); - base.OnPaint(e); - } - } -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/CheckBox/CrEaTiiOn_MetroCheckBox5.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/CheckBox/CrEaTiiOn_MetroCheckBox5.cs deleted file mode 100644 index 09b5028..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/CheckBox/CrEaTiiOn_MetroCheckBox5.cs +++ /dev/null @@ -1,216 +0,0 @@ -#region Imports - -using System.ComponentModel; -using System.Drawing.Drawing2D; -using System.Drawing.Text; - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_MetroCheckBox - - [DefaultEvent("CheckedChanged")] - public class CrEaTiiOn_MetroCheckBox : Control - { - - #region " Control Help - MouseState & Flicker Control" - protected override void OnTextChanged(EventArgs e) - { - base.OnTextChanged(e); - Invalidate(); - } - - private bool _Checked = false; - public bool Checked - { - get => _Checked; - set - { - _Checked = value; - CheckedChangedEvent?.Invoke(this); - Invalidate(); - } - } - - private SmoothingMode _SmoothingType = SmoothingMode.HighQuality; - public SmoothingMode SmoothingType - { - get => _SmoothingType; - set - { - _SmoothingType = value; - Invalidate(); - } - } - - private CompositingQuality _CompositingQualityType = CompositingQuality.HighQuality; - public CompositingQuality CompositingQualityType - { - get => _CompositingQualityType; - set - { - _CompositingQualityType = value; - Invalidate(); - } - } - - private TextRenderingHint _TextRenderingType = TextRenderingHint.AntiAliasGridFit; - public TextRenderingHint TextRenderingType - { - get => _TextRenderingType; - set - { - _TextRenderingType = value; - Invalidate(); - } - } - - private Color _BaseColor = Color.Transparent; - public Color BaseColor - { - get => _BaseColor; - set - { - _BaseColor = value; - Invalidate(); - } - } - - private Color _CheckedColor = Color.FromArgb(250, 36, 38); - public Color CheckedColor - { - get => _CheckedColor; - set - { - _CheckedColor = value; - Invalidate(); - } - } - - private Color _CheckBorderColorA = Color.FromArgb(20, 20, 20); - public Color CheckBorderColorA - { - get => _CheckBorderColorA; - set - { - _CheckBorderColorA = value; - Invalidate(); - } - } - - private Color _CheckBorderColorB = Color.FromArgb(20, 20, 20); - public Color CheckBorderColorB - { - get => _CheckBorderColorB; - set - { - _CheckBorderColorB = value; - Invalidate(); - } - } - - private Color _CheckBackColorA = Color.Transparent; - public Color CheckBackColorA - { - get => _CheckBackColorA; - set - { - _CheckBackColorA = value; - Invalidate(); - } - } - - private Color _CheckBackColorB = Color.Transparent; - public Color CheckBackColorB - { - get => _CheckBackColorB; - set - { - _CheckBackColorB = value; - Invalidate(); - } - } - - protected override void OnResize(EventArgs e) - { - base.OnResize(e); - Height = 14; - Invalidate(); - } - - protected override void OnMouseMove(MouseEventArgs e) - { - base.OnMouseMove(e); - Invalidate(); - } - - protected override void OnMouseDown(MouseEventArgs e) - { - Checked = !Checked; - Focus(); - base.OnMouseDown(e); - } - - public delegate void CheckedChangedEventHandler(object sender); - private CheckedChangedEventHandler CheckedChangedEvent; - - public event CheckedChangedEventHandler CheckedChanged - { - add => CheckedChangedEvent = (CheckedChangedEventHandler)Delegate.Combine(CheckedChangedEvent, value); - remove => CheckedChangedEvent = (CheckedChangedEventHandler)Delegate.Remove(CheckedChangedEvent, value); - } - #endregion - - public CrEaTiiOn_MetroCheckBox() : base() - { - SetStyle(ControlStyles.UserPaint | ControlStyles.SupportsTransparentBackColor | ControlStyles.OptimizedDoubleBuffer, true); - BackColor = Color.Transparent; - ForeColor = Color.White; - Size = new(120, 16); - DoubleBuffered = true; - Font = new("Segoe UI", 8, FontStyle.Bold); - Cursor = Cursors.Hand; - } - - protected override void OnPaint(PaintEventArgs e) - { - base.OnPaint(e); - Bitmap B = new(Width, Height); - Graphics G = Graphics.FromImage(B); - Rectangle checkBoxRectangle = new(0, 0, Height, Height - 1); - Rectangle Inner = new(1, 1, Height - 2, Height - 3); - - G.SmoothingMode = SmoothingType; - G.CompositingQuality = CompositingQualityType; - G.TextRenderingHint = TextRenderingType; - - G.Clear(BaseColor); - - LinearGradientBrush bodyGrad = new(checkBoxRectangle, CheckBackColorA, CheckBackColorB, 90); - G.FillRectangle(bodyGrad, bodyGrad.Rectangle); - G.DrawRectangle(new(CheckBorderColorA), checkBoxRectangle); - G.DrawRectangle(new(CheckBorderColorB), Inner); - - if (Checked) - { - Font t = new("Marlett", 10, FontStyle.Regular); - G.DrawString("a", t, new SolidBrush(CheckedColor), -1.5F, 0F); - } - - G.DrawString(Text, Font, new SolidBrush(ForeColor), new Point(18, 7), new StringFormat - { - Alignment = StringAlignment.Near, - LineAlignment = StringAlignment.Center - }); - - e.Graphics.DrawImage(B, 0, 0); - G.Dispose(); - B.Dispose(); - - } - - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/CheckBox/CrEaTiiOn_ModernCheckBox.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/CheckBox/CrEaTiiOn_ModernCheckBox.cs deleted file mode 100644 index d36a392..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/CheckBox/CrEaTiiOn_ModernCheckBox.cs +++ /dev/null @@ -1,150 +0,0 @@ -#region Imports - -using System; -using System.ComponentModel; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Windows.Forms; - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_ModernCheckBox - - [DefaultEvent("CheckedChanged")] - public class CrEaTiiOn_ModernCheckBox : Control - { - - #region Variables - - private GraphicsPath Shape; - private LinearGradientBrush GB; - private Rectangle R1; - private Rectangle R2; - private bool _Checked; - private Color _CheckedColor = Color.FromArgb(250, 36, 38); - private Color _CheckedBackColorA = Color.FromArgb(20, 20, 20); - private Color _CheckedBackColorB = Color.FromArgb(15, 15, 15); - private Color _CheckedBorderColor = Color.FromArgb(250, 36, 38); - public event CheckedChangedEventHandler CheckedChanged; - public delegate void CheckedChangedEventHandler(object sender); - - #endregion - - #region Properties - - public bool Checked - { - get => _Checked; - set - { - _Checked = value; - CheckedChanged?.Invoke(this); - Invalidate(); - } - } - - public Color CheckedColor - { - get => _CheckedColor; - set => _CheckedColor = value; - } - - public Color CheckedBackColorA - { - get => _CheckedBackColorA; - set => _CheckedBackColorA = value; - } - - public Color CheckedBackColorB - { - get => _CheckedBackColorB; - set => _CheckedBackColorB = value; - } - - public Color CheckedBorderColor - { - get => _CheckedBorderColor; - set => _CheckedBorderColor = value; - } - - #endregion - - public CrEaTiiOn_ModernCheckBox() - { - SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.SupportsTransparentBackColor | ControlStyles.UserPaint, true); - - BackColor = Color.Transparent; - DoubleBuffered = true; - // Reduce control flicker - Font = new("Segoe UI", 12); - Size = new(160, 26); - ForeColor = Color.White; - Cursor = Cursors.Hand; - } - - protected override void OnClick(EventArgs e) - { - _Checked = !_Checked; - CheckedChanged?.Invoke(this); - Focus(); - Invalidate(); - base.OnClick(e); - } - - protected override void OnTextChanged(EventArgs e) - { - Invalidate(); - base.OnTextChanged(e); - } - - protected override void OnResize(EventArgs e) - { - if (Width > 0 && Height > 0) - { - Shape = new(); - - R1 = new(17, 0, Width, Height + 1); - R2 = new(0, 0, Width, Height); - GB = new(new Rectangle(0, 0, 25, 25), _CheckedBackColorA, _CheckedBackColorB, 90); - - GraphicsPath MyDrawer = Shape; - MyDrawer.AddArc(0, 0, 7, 7, 180, 90); - MyDrawer.AddArc(7, 0, 7, 7, -90, 90); - MyDrawer.AddArc(7, 7, 7, 7, 0, 90); - MyDrawer.AddArc(0, 7, 7, 7, 90, 90); - MyDrawer.CloseAllFigures(); - Height = 15; - } - - Invalidate(); - base.OnResize(e); - } - - protected override void OnPaint(PaintEventArgs e) - { - base.OnPaint(e); - - Graphics MyDrawer = e.Graphics; - MyDrawer.Clear(BackColor); - MyDrawer.SmoothingMode = SmoothingMode.AntiAlias; - - MyDrawer.FillPath(GB, Shape); - // Fill the body of the CheckBox - MyDrawer.DrawPath(new(_CheckedBorderColor), Shape); - // Draw the border - - MyDrawer.DrawString(Text, Font, new SolidBrush(ForeColor), new Rectangle(17, 0, Width, Height - 1), new StringFormat { LineAlignment = StringAlignment.Center }); - - if (Checked) - { - MyDrawer.DrawString("ü", new Font("Wingdings", 12), new SolidBrush(_CheckedColor), new Rectangle(-2, 1, Width, Height + 2), new StringFormat { LineAlignment = StringAlignment.Center }); - } - - e.Dispose(); - } - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/CheckBox/CrEaTiiOn_RoundCheckBox.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/CheckBox/CrEaTiiOn_RoundCheckBox.cs deleted file mode 100644 index 303a283..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/CheckBox/CrEaTiiOn_RoundCheckBox.cs +++ /dev/null @@ -1,75 +0,0 @@ -#region Imports -using System; -using System.Drawing.Drawing2D; -using System.ComponentModel; -using System.Drawing; -using System.Windows.Forms; -#endregion - -namespace CBH.Controls -{ - - [DefaultEvent("CheckedChanged")] - public class CrEaTiiOn_RoundCheckBox : Control - { - - public event CheckedChangedEventHandler CheckedChanged; - public delegate void CheckedChangedEventHandler(object sender); - - private bool _checked; - public bool Checked { - get { return _checked; } - set { - _checked = value; - Invalidate(); - } - } - - public CrEaTiiOn_RoundCheckBox() - { - SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.UserPaint | ControlStyles.ResizeRedraw, true); - Size = new Size(120, 17); - Font = new Font("Segoe UI", 9); - } - - protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) - { - base.OnPaint(e); - - Graphics G = e.Graphics; - G.SmoothingMode = SmoothingMode.HighQuality; - G.Clear(Parent.BackColor); - - Height = 17; - - Rectangle boxRect = new Rectangle(1, 1, Height - 3, Height - 3); - G.DrawEllipse(new Pen(Color.FromArgb(250, 36, 38), 2), boxRect); - - int textY = ((Height - 1) / 2) - Convert.ToInt32((G.MeasureString(Text, Font).Height / 2)); - G.DrawString(Text, Font, new SolidBrush(Color.FromArgb(160, 160, 160)), new Point((Height - 1) + 4, textY)); - - if (_checked) - G.DrawString("a", new Font("Marlett", 17), new SolidBrush(Color.FromArgb(120, 180, 255)), new Point(-3, -5)); - - } - - protected override void OnMouseDown(System.Windows.Forms.MouseEventArgs e) - { - base.OnMouseDown(e); - - if (_checked) { - _checked = false; - } else { - _checked = true; - } - - if (CheckedChanged != null) { - CheckedChanged(this); - } - Invalidate(); - - } - - } - -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/Combobox/CrEaTiiOn_ComboBox.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/Combobox/CrEaTiiOn_ComboBox.cs deleted file mode 100644 index c22ebf1..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/Combobox/CrEaTiiOn_ComboBox.cs +++ /dev/null @@ -1,380 +0,0 @@ -#region Imports -using System.ComponentModel; -using System.Drawing.Design; -using System.Drawing.Drawing2D; -#endregion - -namespace CBH.Controls -{ - [DefaultEvent("OnSelectedIndexChanged")] - public class CrEaTiiOn_ComboBox : UserControl - { - //Fields - private Color backColor = Color.FromArgb(20, 20, 20); - private Color iconColor = Color.FromArgb(250, 36, 38); - private Color listBackColor = Color.FromArgb(15, 15, 15); - private Color listTextColor = Color.Silver; - private Color borderColor = Color.FromArgb(250, 36, 38); - private int borderSize = 1; - - //Items - private System.Windows.Forms.ComboBox cmbList; - private System.Windows.Forms.Label lblText; - private Button btnIcon; - - //Events - public event EventHandler OnSelectedIndexChanged;//Default event - - //Constructor - public CrEaTiiOn_ComboBox() - { - cmbList = new System.Windows.Forms.ComboBox(); - lblText = new System.Windows.Forms.Label(); - btnIcon = new Button(); - this.SuspendLayout(); - - //ComboBox: Dropdown list - cmbList.BackColor = listBackColor; - cmbList.Font = new Font(this.Font.Name, 10F); - cmbList.ForeColor = listTextColor; - cmbList.SelectedIndexChanged += new EventHandler(ComboBox_SelectedIndexChanged);//Default event - cmbList.TextChanged += new EventHandler(ComboBox_TextChanged);//Refresh text - - //Button: Icon - btnIcon.Dock = DockStyle.Right; - btnIcon.FlatStyle = FlatStyle.Flat; - btnIcon.FlatAppearance.BorderSize = 0; - btnIcon.BackColor = backColor; - btnIcon.Size = new Size(30, 30); - btnIcon.Cursor = Cursors.Hand; - btnIcon.Click += new EventHandler(Icon_Click);//Open dropdown list - btnIcon.Paint += new PaintEventHandler(Icon_Paint);//Draw icon - - //Label: Text - lblText.Dock = DockStyle.Fill; - lblText.AutoSize = false; - lblText.BackColor = backColor; - lblText.TextAlign = ContentAlignment.MiddleLeft; - lblText.Padding = new Padding(8, 0, 0, 0); - lblText.Font = new Font(this.Font.Name, 10F); - //->Attach label events to user control event - lblText.Click += new EventHandler(Surface_Click);//Select combo box - lblText.MouseEnter += new EventHandler(Surface_MouseEnter); - lblText.MouseLeave += new EventHandler(Surface_MouseLeave); - - //User Control - this.Controls.Add(lblText);//2 - this.Controls.Add(btnIcon);//1 - this.Controls.Add(cmbList);//0 - this.MinimumSize = new Size(200, 30); - this.Size = new Size(200, 30); - this.ForeColor = Color.DimGray; - this.Padding = new Padding(borderSize);//Border Size - this.Font = new Font(this.Font.Name, 10F); - base.BackColor = borderColor; //Border Color - this.ResumeLayout(); - AdjustComboBoxDimensions(); - } - - //Properties - //-> Appearance - [Category("CrEaTiiOn")] - public new Color BackColor - { - get { return backColor; } - set - { - backColor = value; - lblText.BackColor = backColor; - btnIcon.BackColor = backColor; - } - } - - [Category("CrEaTiiOn")] - public Color IconColor - { - get { return iconColor; } - set - { - iconColor = value; - btnIcon.Invalidate();//Redraw icon - } - } - - [Category("CrEaTiiOn")] - public Color ListBackColor - { - get { return listBackColor; } - set - { - listBackColor = value; - cmbList.BackColor = listBackColor; - } - } - - [Category("CrEaTiiOn")] - public Color ListTextColor - { - get { return listTextColor; } - set - { - listTextColor = value; - cmbList.ForeColor = listTextColor; - } - } - - [Category("CrEaTiiOn")] - public Color BorderColor - { - get { return borderColor; } - set - { - borderColor = value; - base.BackColor = borderColor; //Border Color - } - } - - [Category("CrEaTiiOn")] - public int BorderSize - { - get { return borderSize; } - set - { - borderSize = value; - this.Padding = new Padding(borderSize);//Border Size - AdjustComboBoxDimensions(); - } - } - - [Category("CrEaTiiOn")] - public override Color ForeColor - { - get { return base.ForeColor; } - set - { - base.ForeColor = value; - lblText.ForeColor = value; - } - } - - [Category("CrEaTiiOn")] - public override Font Font - { - get { return base.Font; } - set - { - base.Font = value; - lblText.Font = value; - cmbList.Font = value;//Optional - } - } - - [Category("CrEaTiiOn")] - public string Texts - { - get { return lblText.Text; } - set { lblText.Text = value; } - } - - [Category("CrEaTiiOn")] - public ComboBoxStyle DropDownStyle - { - get { return cmbList.DropDownStyle; } - set - { - if (cmbList.DropDownStyle != ComboBoxStyle.Simple) - cmbList.DropDownStyle = value; - } - } - //Properties - //-> Data - [Category("RJ Code - Data")] - [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] - [Editor("System.Windows.Forms.Design.ListControlStringCollectionEditor, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(UITypeEditor))] - [Localizable(true)] - [MergableProperty(false)] - public System.Windows.Forms.ComboBox.ObjectCollection Items - { - get { return cmbList.Items; } - } - - [Category("RJ Code - Data")] - [AttributeProvider(typeof(IListSource))] - [DefaultValue(null)] - public object DataSource - { - get { return cmbList.DataSource; } - set { cmbList.DataSource = value; } - } - - [Category("RJ Code - Data")] - [Browsable(true)] - [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] - [Editor("System.Windows.Forms.Design.ListControlStringCollectionEditor, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(UITypeEditor))] - [EditorBrowsable(EditorBrowsableState.Always)] - [Localizable(true)] - public AutoCompleteStringCollection AutoCompleteCustomSource - { - get { return cmbList.AutoCompleteCustomSource; } - set { cmbList.AutoCompleteCustomSource = value; } - } - - [Category("RJ Code - Data")] - [Browsable(true)] - [DefaultValue(AutoCompleteSource.None)] - [EditorBrowsable(EditorBrowsableState.Always)] - public AutoCompleteSource AutoCompleteSource - { - get { return cmbList.AutoCompleteSource; } - set { cmbList.AutoCompleteSource = value; } - } - - [Category("RJ Code - Data")] - [Browsable(true)] - [DefaultValue(AutoCompleteMode.None)] - [EditorBrowsable(EditorBrowsableState.Always)] - public AutoCompleteMode AutoCompleteMode - { - get { return cmbList.AutoCompleteMode; } - set { cmbList.AutoCompleteMode = value; } - } - - [Category("RJ Code - Data")] - [Bindable(true)] - [Browsable(false)] - [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public object SelectedItem - { - get { return cmbList.SelectedItem; } - set { cmbList.SelectedItem = value; } - } - - [Category("RJ Code - Data")] - [Browsable(false)] - [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public int SelectedIndex - { - get { return cmbList.SelectedIndex; } - set { cmbList.SelectedIndex = value; } - } - - [Category("RJ Code - Data")] - [DefaultValue("")] - [Editor("System.Windows.Forms.Design.DataMemberFieldEditor, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(UITypeEditor))] - [TypeConverter("System.Windows.Forms.Design.DataMemberFieldConverter, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")] - public string DisplayMember - { - get { return cmbList.DisplayMember; } - set { cmbList.DisplayMember = value; } - } - - [Category("RJ Code - Data")] - [DefaultValue("")] - [Editor("System.Windows.Forms.Design.DataMemberFieldEditor, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(UITypeEditor))] - public string ValueMember - { - get { return cmbList.ValueMember; } - set { cmbList.ValueMember = value; } - } - - //Private methods - private void AdjustComboBoxDimensions() - { - cmbList.Width = lblText.Width; - cmbList.Location = new Point() - { - X = this.Width - this.Padding.Right - cmbList.Width, - Y = lblText.Bottom - cmbList.Height - }; - } - - //Event methods - - //-> Default event - private void ComboBox_SelectedIndexChanged(object sender, EventArgs e) - { - if (OnSelectedIndexChanged != null) - OnSelectedIndexChanged.Invoke(sender, e); - //Refresh text - lblText.Text = cmbList.Text; - } - - //-> Draw icon - private void Icon_Paint(object sender, PaintEventArgs e) - { - //Fields - int iconWidht = 14; - int iconHeight = 6; - var rectIcon = new Rectangle((btnIcon.Width - iconWidht) / 2, (btnIcon.Height - iconHeight) / 2, iconWidht, iconHeight); - Graphics graph = e.Graphics; - - //Draw arrow down icon - using (GraphicsPath path = new GraphicsPath()) - using (Pen pen = new Pen(iconColor, 2)) - { - graph.SmoothingMode = SmoothingMode.AntiAlias; - path.AddLine(rectIcon.X, rectIcon.Y, rectIcon.X + (iconWidht / 2), rectIcon.Bottom); - path.AddLine(rectIcon.X + (iconWidht / 2), rectIcon.Bottom, rectIcon.Right, rectIcon.Y); - graph.DrawPath(pen, path); - } - } - - //-> Items actions - private void Icon_Click(object sender, EventArgs e) - { - //Open dropdown list - cmbList.Select(); - cmbList.DroppedDown = true; - } - private void Surface_Click(object sender, EventArgs e) - { - //Attach label click to user control click - this.OnClick(e); - //Select combo box - cmbList.Select(); - if (cmbList.DropDownStyle == ComboBoxStyle.DropDownList) - cmbList.DroppedDown = true;//Open dropdown list - } - private void ComboBox_TextChanged(object sender, EventArgs e) - { - //Refresh text - lblText.Text = cmbList.Text; - } - - //->Attach label events to user control event - private void Surface_MouseLeave(object sender, EventArgs e) - { - this.OnMouseLeave(e); - } - - private void Surface_MouseEnter(object sender, EventArgs e) - { - this.OnMouseEnter(e); - } - //::::+ - - //Overridden methods - protected override void OnResize(EventArgs e) - { - base.OnResize(e); - AdjustComboBoxDimensions(); - } - - private void InitializeComponent() - { - this.SuspendLayout(); - // - // ComboBox - // - this.Name = "ComboBox"; - this.Load += new System.EventHandler(this.ComboBox_Load); - this.ResumeLayout(false); - - } - - private void ComboBox_Load(object sender, EventArgs e) - { - - } - } -} diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/Combobox/CrEaTiiOn_ComboBox.resx b/CBH-Ultimate-Theme-Library/Theme/Controls/Combobox/CrEaTiiOn_ComboBox.resx deleted file mode 100644 index f298a7b..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/Combobox/CrEaTiiOn_ComboBox.resx +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/ControlBox/CrEaTiiOn_ControlBox.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/ControlBox/CrEaTiiOn_ControlBox.cs deleted file mode 100644 index 2817233..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/ControlBox/CrEaTiiOn_ControlBox.cs +++ /dev/null @@ -1,334 +0,0 @@ -#region Imports - - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_ControlBox - - public class CrEaTiiOn_ControlBox : Control - { - #region Enums - - public enum ButtonHoverState - { - Minimize, - Maximize, - Close, - None - } - - #endregion - - #region Variables - - private ButtonHoverState ButtonHState = ButtonHoverState.None; - - #endregion - - #region Properties - - private bool _DefaultLocation = true; - public bool DefaultLocation - { - get => _DefaultLocation; - set - { - _DefaultLocation = value; - Invalidate(); - } - } - - private bool _EnableMaximize = true; - public bool EnableMaximizeButton - { - get => _EnableMaximize; - set - { - _EnableMaximize = value; - Invalidate(); - } - } - - private bool _EnableMinimize = true; - public bool EnableMinimizeButton - { - get => _EnableMinimize; - set - { - _EnableMinimize = value; - Invalidate(); - } - } - - private bool _EnableHoverHighlight = false; - public bool EnableHoverHighlight - { - get => _EnableHoverHighlight; - set - { - _EnableHoverHighlight = value; - Invalidate(); - } - } - - private Color _MinimizeHoverColor = Color.FromArgb(63, 63, 65); - public Color MinimizeHoverColor - { - get => _MinimizeHoverColor; - set => _MinimizeHoverColor = value; - } - - private Color _MaximizeHoverColor = Color.FromArgb(74, 74, 74); - public Color MaximizeHoverColor - { - get => _MaximizeHoverColor; - set => _MaximizeHoverColor = value; - } - - private Color _CloseHoverColor = Color.FromArgb(230, 17, 35); - public Color CloseHoverColor - { - get => _CloseHoverColor; - set => _CloseHoverColor = value; - } - - #endregion - - #region EventArgs - - protected override void OnResize(EventArgs e) - { - base.OnResize(e); - Size = new(90, 25); - } - - protected override void OnMouseMove(MouseEventArgs e) - { - base.OnMouseMove(e); - int X = e.Location.X; - int Y = e.Location.Y; - if (Y > 0 && Y < Height) - { - if (X >= 0 && X <= 30) - { - ButtonHState = ButtonHoverState.Minimize; - if (_EnableMinimize == true) - { - Cursor = Cursors.Hand; - } - else - { - Cursor = Cursors.No; - } - } - else if (X > 30 && X <= 60) - { - ButtonHState = ButtonHoverState.Maximize; - if (_EnableMaximize == true) - { - Cursor = Cursors.Hand; - } - else - { - Cursor = Cursors.No; - } - } - else if (X > 60 && X < Width) - { - ButtonHState = ButtonHoverState.Close; - Cursor = Cursors.Hand; - } - else - { - ButtonHState = ButtonHoverState.None; - Cursor = Cursors.Hand; - } - } - else - { - ButtonHState = ButtonHoverState.None; - Cursor = Cursors.Hand; - } - Invalidate(); - } - - protected override void OnMouseUp(MouseEventArgs e) - { - base.OnMouseDown(e); - switch (ButtonHState) - { - case ButtonHoverState.Close: - Parent.FindForm().Close(); - break; - case ButtonHoverState.Minimize: - if (_EnableMinimize == true) - { - Parent.FindForm().WindowState = FormWindowState.Minimized; - /*foreach (Form Form in Application.OpenForms) - Form.WindowState = FormWindowState.Minimized;*/ - } - break; - case ButtonHoverState.Maximize: - if (_EnableMaximize == true) - { - if (Parent.FindForm().WindowState == FormWindowState.Normal) - { - Parent.FindForm().WindowState = FormWindowState.Maximized; - } - else - { - Parent.FindForm().WindowState = FormWindowState.Normal; - } - } - break; - } - } - - protected override void OnMouseLeave(EventArgs e) - { - base.OnMouseLeave(e); - ButtonHState = ButtonHoverState.None; - Invalidate(); - } - - protected override void OnMouseDown(MouseEventArgs e) - { - base.OnMouseDown(e); - Focus(); - } - - #endregion - - public CrEaTiiOn_ControlBox() : base() - { - DoubleBuffered = true; - EnableHoverHighlight = true; - Anchor = AnchorStyles.Top | AnchorStyles.Right; - Cursor = Cursors.Hand; - BackColor = Color.FromArgb(15, 15, 15); - ForeColor = Color.FromArgb(155, 155, 155); - } - - protected override void OnCreateControl() - { - base.OnCreateControl(); - try - { - if (DefaultLocation) - { - Location = new(Parent.Width - 100, 18); - } - } - catch (Exception) - { - // - } - } - - protected override void OnPaint(PaintEventArgs e) - { - base.OnPaint(e); - Graphics G = e.Graphics; - G.Clear(base.BackColor); - - //Close - G.DrawString("r", new Font("Marlett", 12), new SolidBrush(base.ForeColor), new Point(75, 5), new StringFormat { Alignment = StringAlignment.Center }); - - //Maximize - switch (Parent.FindForm().WindowState) - { - case FormWindowState.Maximized: - if (_EnableMaximize == true) - { - G.DrawString("2", new Font("Marlett", 12), new SolidBrush(base.ForeColor), new Point(46, 4), new StringFormat { Alignment = StringAlignment.Center }); - } - else - { - G.DrawString("2", new Font("Marlett", 12), new SolidBrush(Color.FromArgb(55, 60, 50)), new Point(46, 4), new StringFormat { Alignment = StringAlignment.Center }); - } - - break; - case FormWindowState.Normal: - if (_EnableMaximize == true) - { - G.DrawString("1", new Font("Marlett", 12), new SolidBrush(base.ForeColor), new Point(46, 4), new StringFormat { Alignment = StringAlignment.Center }); - } - else - { - G.DrawString("1", new Font("Marlett", 12), new SolidBrush(Color.FromArgb(55, 60, 50)), new Point(46, 4), new StringFormat { Alignment = StringAlignment.Center }); - } - - break; - } - - //Minimize - if (_EnableMinimize == true) - { - G.DrawString("0", new Font("Marlett", 12), new SolidBrush(base.ForeColor), new Point(17, 0), new StringFormat { Alignment = StringAlignment.Center }); - } - else - { - G.DrawString("0", new Font("Marlett", 12), new SolidBrush(Color.FromArgb(55, 60, 50)), new Point(17, 0), new StringFormat { Alignment = StringAlignment.Center }); - } - - if (_EnableHoverHighlight == true) - { - switch (ButtonHState) - { - /*case ButtonHoverState.None: - G.Clear(base.BackColor); - break;*/ - case ButtonHoverState.Minimize: - if (_EnableMinimize == true) - { - G.FillRectangle(new SolidBrush(_MinimizeHoverColor), new Rectangle(0, 0, 30, Height)); - G.DrawString("0", new Font("Marlett", 12), new SolidBrush(Color.White), new Point(17, 0), new StringFormat { Alignment = StringAlignment.Center }); - } - else - { - G.DrawString("0", new Font("Marlett", 12), new SolidBrush(Color.FromArgb(55, 60, 50)), new Point(17, 0), new StringFormat { Alignment = StringAlignment.Center }); - } - - break; - case ButtonHoverState.Maximize: - switch (Parent.FindForm().WindowState) - { - case FormWindowState.Maximized: - if (_EnableMaximize == true) - { - G.FillRectangle(new SolidBrush(_MaximizeHoverColor), new Rectangle(30, 0, 30, Height)); - G.DrawString("2", new Font("Marlett", 12), new SolidBrush(Color.White), new Point(46, 4), new StringFormat { Alignment = StringAlignment.Center }); - } - else - { - G.DrawString("2", new Font("Marlett", 12), new SolidBrush(Color.FromArgb(55, 60, 50)), new Point(46, 4), new StringFormat { Alignment = StringAlignment.Center }); - } - - break; - case FormWindowState.Normal: - if (_EnableMaximize == true) - { - G.FillRectangle(new SolidBrush(_MaximizeHoverColor), new Rectangle(30, 0, 30, Height)); - G.DrawString("1", new Font("Marlett", 12), new SolidBrush(Color.White), new Point(46, 4), new StringFormat { Alignment = StringAlignment.Center }); - } - else - { - G.DrawString("1", new Font("Marlett", 12), new SolidBrush(Color.FromArgb(55, 60, 50)), new Point(46, 4), new StringFormat { Alignment = StringAlignment.Center }); - } - - break; - } - break; - case ButtonHoverState.Close: - G.FillRectangle(new SolidBrush(_CloseHoverColor), new Rectangle(60, 0, 30, Height)); - G.DrawString("r", new Font("Marlett", 12), new SolidBrush(Color.White), new Point(75, 5), new StringFormat { Alignment = StringAlignment.Center }); - break; - } - } - } - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/ControlBox/CrEaTiiOn_FlatControlBox.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/ControlBox/CrEaTiiOn_FlatControlBox.cs deleted file mode 100644 index 88e577d..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/ControlBox/CrEaTiiOn_FlatControlBox.cs +++ /dev/null @@ -1,189 +0,0 @@ -#region Imports -using System; -using System.Drawing; -using System.Windows.Forms; -#endregion - -namespace Zeroit.CBH.Controls -{ - public class CrEaTiiOn_FlatControlBox : Control - { - public enum ColorSchemes - { - Dark - } - public event ColorSchemeChangedEventHandler ColorSchemeChanged; - public delegate void ColorSchemeChangedEventHandler(); - private ColorSchemes _ColorScheme; - public ColorSchemes ColorScheme - { - get { return _ColorScheme; } - set - { - _ColorScheme = value; - if (ColorSchemeChanged != null) - { - ColorSchemeChanged(); - } - } - } - protected void OnColorSchemeChanged() - { - Invalidate(); - switch (ColorScheme) - { - case ColorSchemes.Dark: - BackColor = Color.FromArgb(15, 15, 15); - ForeColor = Color.White; - AccentColor = Color.FromArgb(60, 60, 60); - break; - } - } - private Color _AccentColor; - public Color AccentColor - { - get { return _AccentColor; } - set - { - _AccentColor = value; - Invalidate(); - } - } - - public CrEaTiiOn_FlatControlBox() : base() - { - ColorSchemeChanged += OnColorSchemeChanged; - DoubleBuffered = true; - SetStyle(ControlStyles.AllPaintingInWmPaint, true); - SetStyle(ControlStyles.UserPaint, true); - SetStyle(ControlStyles.ResizeRedraw, true); - SetStyle(ControlStyles.OptimizedDoubleBuffer, true); - ForeColor = Color.FromArgb(50, 50, 50); - BackColor = Color.FromArgb(15, 15, 15); - AccentColor = Color.FromArgb(250, 36, 38); - ColorScheme = ColorSchemes.Dark; - Anchor = AnchorStyles.Top | AnchorStyles.Right; - } - protected override void OnResize(EventArgs e) - { - base.OnResize(e); - Size = new Size(100, 25); - } - public enum ButtonHover - { - Minimize, - Maximize, - Close, - None - } - ButtonHover ButtonState = ButtonHover.None; - protected override void OnMouseMove(MouseEventArgs e) - { - base.OnMouseMove(e); - int X = e.Location.X; - int Y = e.Location.Y; - if (Y > 0 && Y < (Height - 2)) - { - if (X > 0 && X < 34) - { - ButtonState = ButtonHover.Minimize; - } - else if (X > 33 && X < 65) - { - ButtonState = ButtonHover.Maximize; - } - else if (X > 64 && X < Width) - { - ButtonState = ButtonHover.Close; - } - else - { - ButtonState = ButtonHover.None; - } - } - else - { - ButtonState = ButtonHover.None; - } - Invalidate(); - } - protected override void OnPaint(PaintEventArgs e) - { - Bitmap B = new Bitmap(Width, Height); - Graphics G = Graphics.FromImage(B); - base.OnPaint(e); - - G.Clear(BackColor); - switch (ButtonState) - { - case ButtonHover.None: - G.Clear(BackColor); - break; - case ButtonHover.Minimize: - G.FillRectangle(new SolidBrush(_AccentColor), new Rectangle(3, 0, 30, Height)); - break; - case ButtonHover.Maximize: - G.FillRectangle(new SolidBrush(_AccentColor), new Rectangle(34, 0, 30, Height)); - break; - case ButtonHover.Close: - G.FillRectangle(new SolidBrush(_AccentColor), new Rectangle(65, 0, 35, Height)); - break; - } - - Font ButtonFont = new Font("Marlett", 9.75f); - //Close - G.DrawString("r", ButtonFont, new SolidBrush(Color.FromArgb(210, 210, 210)), new Point(Width - 16, 7), new StringFormat { Alignment = StringAlignment.Center }); - //Maximize - switch (Parent.FindForm().WindowState) - { - case FormWindowState.Maximized: - G.DrawString("2", ButtonFont, new SolidBrush(Color.FromArgb(210, 210, 210)), new Point(51, 7), new StringFormat { Alignment = StringAlignment.Center }); - break; - case FormWindowState.Normal: - G.DrawString("1", ButtonFont, new SolidBrush(Color.FromArgb(210, 210, 210)), new Point(51, 7), new StringFormat { Alignment = StringAlignment.Center }); - break; - } - //Minimize - G.DrawString("0", ButtonFont, new SolidBrush(Color.FromArgb(210, 210, 210)), new Point(20, 7), new StringFormat { Alignment = StringAlignment.Center }); - - - e.Graphics.DrawImage(B, new Point(0, 0)); - G.Dispose(); - B.Dispose(); - } - protected override void OnMouseUp(MouseEventArgs e) - { - base.OnMouseDown(e); - switch (ButtonState) - { - case ButtonHover.Close: - Parent.FindForm().Close(); - break; - case ButtonHover.Minimize: - Parent.FindForm().WindowState = FormWindowState.Minimized; - break; - case ButtonHover.Maximize: - if (Parent.FindForm().WindowState == FormWindowState.Normal) - { - Parent.FindForm().WindowState = FormWindowState.Maximized; - } - else - { - Parent.FindForm().WindowState = FormWindowState.Normal; - } - - break; - } - } - protected override void OnMouseLeave(EventArgs e) - { - base.OnMouseLeave(e); - ButtonState = ButtonHover.None; - Invalidate(); - } - } - - -} - - diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/ControlBox/CrEaTiiOn_ModernControlBox.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/ControlBox/CrEaTiiOn_ModernControlBox.cs deleted file mode 100644 index daf5910..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/ControlBox/CrEaTiiOn_ModernControlBox.cs +++ /dev/null @@ -1,448 +0,0 @@ -#region Imports - -using System.ComponentModel; - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_ModernControlBox - - public class CrEaTiiOn_ModernControlBox : Control - { - #region Fields - - private bool hover_min, hover_max, hover_close; - - #endregion - - #region Custom Properties - - private bool _EnableMaximize = true; - [Browsable(true)] - [Description("Determines whether the control should enable the use of the maximize button.")] - public bool EnableMaximizeButton - { - get => _EnableMaximize; - set - { - _EnableMaximize = value; - Invalidate(); - } - } - - private bool _EnableMinimize = true; - [Browsable(true)] - [Description("Determines whether the control should enable the use of the minimize button.")] - public bool EnableMinimizeButton - { - get => _EnableMinimize; - set - { - _EnableMinimize = value; - Invalidate(); - } - } - - private bool _DefaultLocation = true; - [Browsable(true)] - [Description("ControlBox set location to default.")] - public bool DefaultLocation - { - get => _DefaultLocation; - set - { - _DefaultLocation = value; - Invalidate(); - } - } - - private Color _EnableMinimizeColor = ColorTranslator.FromHtml("#A0A0A0"); - [Browsable(true)] - [Description("Enabled is Minimize ForeColor.")] - public Color EnableMinimizeColor - { - get => _EnableMinimizeColor; - set - { - _EnableMinimizeColor = value; - Invalidate(); - } - } - - private Color _DisableMinimizeColor = ColorTranslator.FromHtml("#696969"); - [Browsable(true)] - [Description("Disabled is Minimize ForeColor.")] - public Color DisableMinimizeColor - { - get => _DisableMinimizeColor; - set - { - _DisableMinimizeColor = value; - Invalidate(); - } - } - - private Color _MinimizeHoverColor = Color.FromArgb(15, Color.White); - [Browsable(true)] - [Description("Minimize is HoverColor.")] - public Color MinimizeHoverColor - { - get => _MinimizeHoverColor; - set - { - _MinimizeHoverColor = value; - Invalidate(); - } - } - - private Color _MinimizeHoverForeColor = Color.White; - [Browsable(true)] - [Description("Minimize is HoverForeColor.")] - public Color MinimizeHoverForeColor - { - get => _MinimizeHoverForeColor; - set - { - _MinimizeHoverForeColor = value; - Invalidate(); - } - } - - private Color _EnableMaximizeColor = ColorTranslator.FromHtml("#A0A0A0"); - [Browsable(true)] - [Description("Enabled is Maximize ForeColor.")] - public Color EnableMaximizeColor - { - get => _EnableMaximizeColor; - set - { - _EnableMaximizeColor = value; - Invalidate(); - } - } - - private Color _DisableMaximizeColor = ColorTranslator.FromHtml("#696969"); - [Browsable(true)] - [Description("Disabled is Maximize ForeColor.")] - public Color DisableMaximizeColor - { - get => _DisableMaximizeColor; - set - { - _DisableMaximizeColor = value; - Invalidate(); - } - } - - private Color _MaximizeHoverColor = Color.FromArgb(15, Color.White); - [Browsable(true)] - [Description("Maximize is HoverColor.")] - public Color MaximizeHoverColor - { - get => _MaximizeHoverColor; - set - { - _MaximizeHoverColor = value; - Invalidate(); - } - } - - private Color _MaximizeHoverForeColor = Color.White; - [Browsable(true)] - [Description("Maximize is HoverForeColor.")] - public Color MaximizeHoverForeColor - { - get => _MaximizeHoverForeColor; - set - { - _MaximizeHoverForeColor = value; - Invalidate(); - } - } - - private Color _EnableCloseColor = ColorTranslator.FromHtml("#A0A0A0"); - [Browsable(true)] - [Description("Enabled is Close ForeColor.")] - public Color EnableCloseColor - { - get => _EnableCloseColor; - set - { - _EnableCloseColor = value; - Invalidate(); - } - } - - private Color _CloseHoverColor = ColorTranslator.FromHtml("#C75050"); - [Browsable(true)] - [Description("Close is HoverColor.")] - public Color CloseHoverColor - { - get => _CloseHoverColor; - set - { - _CloseHoverColor = value; - Invalidate(); - } - } - - private Color _CloseHoverForeColor = Color.White; - [Browsable(true)] - [Description("Close is HoverForeColor.")] - public Color CloseHoverForeColor - { - get => _CloseHoverForeColor; - set - { - _CloseHoverForeColor = value; - Invalidate(); - } - } - - #endregion - - #region Hidden Properties - - [Bindable(false), EditorBrowsable(EditorBrowsableState.Never)] - [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public new Color ForeColor { get; set; } - - [Bindable(false), EditorBrowsable(EditorBrowsableState.Never)] - [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public new ImageLayout BackgroundImageLayout { get; set; } - - [Bindable(false), EditorBrowsable(EditorBrowsableState.Never)] - [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public new Image BackgroundImage { get; set; } - - [Bindable(false), EditorBrowsable(EditorBrowsableState.Never)] - [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public new RightToLeft RightToLeft { get; set; } - - [Bindable(false), EditorBrowsable(EditorBrowsableState.Never)] - [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public new System.Windows.Forms.ContextMenuStrip ContextMenuStrip { get; set; } - - [Bindable(false), EditorBrowsable(EditorBrowsableState.Never)] - [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public new Size MinimumSize { get; set; } - - [Bindable(false), EditorBrowsable(EditorBrowsableState.Never)] - [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public new Size MaximumSize { get; set; } - - [Bindable(false), EditorBrowsable(EditorBrowsableState.Never)] - [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public new Font Font { get; set; } - - [Bindable(false), EditorBrowsable(EditorBrowsableState.Never)] - [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public new Padding Padding { get; set; } - - [Bindable(false), EditorBrowsable(EditorBrowsableState.Never)] - [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public new Padding Margin { get; set; } - - [Bindable(false), EditorBrowsable(EditorBrowsableState.Never)] - [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public new string Tag { get; set; } - - [Bindable(false), EditorBrowsable(EditorBrowsableState.Never)] - [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public new string Text { get; set; } - - #endregion - - #region EventArgs - - protected override void OnResize(EventArgs e) - { - base.OnResize(e); - Size = new(139, 31); - } - - protected override void OnMouseMove(MouseEventArgs e) - { - base.OnMouseMove(e); - if (e.X > 0 && e.X < 47 && e.Y > 0 && e.Y < 31) - { - hover_min = true; - hover_max = false; - hover_close = false; - } - else if (e.X > 46 && e.X < 94 && e.Y > 0 && e.Y < 31) - { - hover_min = false; - hover_max = true; - hover_close = false; - } - else if (e.X > 93 && e.X < 150 && e.Y > 0 && e.Y < 31) - { - hover_min = false; - hover_max = false; - hover_close = true; - } - else - { - hover_min = false; - hover_max = false; - hover_close = false; - } - - Invalidate(); - } - - protected override void OnMouseLeave(EventArgs e) - { - base.OnMouseLeave(e); - hover_min = false; - hover_max = false; - hover_close = false; - - Invalidate(); - } - - protected override void OnMouseDown(MouseEventArgs e) - { - base.OnMouseDown(e); - Focus(); - Invalidate(); - } - - protected override void OnMouseUp(MouseEventArgs e) - { - base.OnMouseUp(e); - - // Parent form - Form pf = FindForm(); - - if (_EnableMaximize) - { - if (hover_max & e.Button == MouseButtons.Left) - { - switch (pf.WindowState) - { - case FormWindowState.Normal: - pf.WindowState = FormWindowState.Maximized; - break; - case FormWindowState.Maximized: - pf.WindowState = FormWindowState.Normal; - break; - } - } - } - - if (_EnableMinimize) - { - if (hover_min & e.Button == MouseButtons.Left) - { - pf.WindowState = FormWindowState.Minimized; - } - } - - if (hover_close & e.Button == MouseButtons.Left) - { - Application.Exit(); - } - } - - #endregion - - public CrEaTiiOn_ModernControlBox() - { - SetStyle(ControlStyles.SupportsTransparentBackColor, true); - BackColor = Color.Transparent; - DoubleBuffered = true; - Anchor = AnchorStyles.Top | AnchorStyles.Right; - Cursor = Cursors.Hand; - } - - protected override void OnCreateControl() - { - base.OnCreateControl(); - try - { - if (DefaultLocation) - { - Location = new(Parent.Width - 139, 0); //Location = new(FindForm().Width - 139, 0); - } - } - catch (Exception) - { - // - } - } - - protected override void OnPaint(PaintEventArgs e) - { - Graphics g = e.Graphics; - - // This defines the size of the background that is drawn when - // the mouse moves over one of the three ControlBox buttons - Size btnBackgroundSize = new(46, Height); - - // Minimize button - Font minimizeBtnFont = new("Tahoma", 12); - Point minimizeBtnPoint = new(15, 5); - SolidBrush minimizeBtnBrush = new(_EnableMinimize ? _EnableMinimizeColor : _DisableMinimizeColor); - - if (hover_min && _EnableMinimize) - { - using (SolidBrush backColor = new(_MinimizeHoverColor)) - { - g.FillRectangle(backColor, new Rectangle(new Point(1, 0), btnBackgroundSize)); - } - - minimizeBtnBrush = new(_MinimizeHoverForeColor); - } - - g.DrawString("\u2212", minimizeBtnFont, minimizeBtnBrush, minimizeBtnPoint); - minimizeBtnBrush.Dispose(); - minimizeBtnFont.Dispose(); - - // Maxmize button - Font maximizeBtnFont = new("Marlett", 9); - Point maximizeBtnPoint = new(63, 10); - SolidBrush maximizeBtnBrush = new(_EnableMaximize ? _EnableMaximizeColor : _DisableMaximizeColor); - - if (hover_max && _EnableMaximize) - { - using (SolidBrush backColor = new(_MaximizeHoverColor)) - { - g.FillRectangle(backColor, new Rectangle(new Point(47, 0), btnBackgroundSize)); - } - - maximizeBtnBrush = new(_MaximizeHoverForeColor); - } - - g.DrawString(FindForm().WindowState != FormWindowState.Maximized ? "1" : "2", maximizeBtnFont, maximizeBtnBrush, maximizeBtnPoint); - - maximizeBtnBrush.Dispose(); - maximizeBtnFont.Dispose(); - - // Close button - Font closeBtnFont = new("Tahoma", 11); - Point closeBtnPoint = new(107, 6); - SolidBrush closeBtnBrush = new(_EnableCloseColor); - - if (hover_close) - { - using (SolidBrush backColor = new(_CloseHoverColor)) - { - g.FillRectangle(backColor, new Rectangle(new Point(93, 0), btnBackgroundSize)); - } - - closeBtnBrush = new(_CloseHoverForeColor); - } - - g.DrawString("\u2A09", closeBtnFont, closeBtnBrush, closeBtnPoint); - closeBtnBrush.Dispose(); - closeBtnFont.Dispose(); - - base.OnPaint(e); - } - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/Controller/CrEaTiiOn_DragControl.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/Controller/CrEaTiiOn_DragControl.cs deleted file mode 100644 index b97cce8..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/Controller/CrEaTiiOn_DragControl.cs +++ /dev/null @@ -1,36 +0,0 @@ -#region Imports -using System.ComponentModel; -using System.Runtime.InteropServices; -#endregion - -namespace CBH.Controls -{ - internal class CrEaTiiOn_DragControl : Component - { - private Control controler; - - [DllImport("user32.dll")] - private static extern int SendMessage(IntPtr o, int msg, int wParams, int IParam); - - [DllImport("user32.dll")] - public static extern bool ReleaseCapture(); - - public Control TargetControl - { - get => this.controler; - set - { - this.controler = value; - this.controler.MouseDown += new MouseEventHandler(this.Controler_MouseDown); - } - } - - private void Controler_MouseDown(object sender, MouseEventArgs e) - { - if (e.Button != MouseButtons.Left) - return; - CrEaTiiOn_DragControl.ReleaseCapture(); - CrEaTiiOn_DragControl.SendMessage(this.TargetControl.FindForm().Handle, 161, 2, 0); - } - } -} diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/Controller/CrEaTiiOn_VolumeController.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/Controller/CrEaTiiOn_VolumeController.cs deleted file mode 100644 index 21a96e8..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/Controller/CrEaTiiOn_VolumeController.cs +++ /dev/null @@ -1,71 +0,0 @@ -#region Imports - -using System.ComponentModel; -using System.Runtime.InteropServices; - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_VolumeController - - public class CrEaTiiOn_VolumeController : Component - { - [DllImport("user32.dll")] - private static extern void keybd_event(byte bVk, byte bScan, uint dwFlags, uint dwExtraInfo); - - [DllImport("user32.dll")] - private static extern byte MapVirtualKey(uint uCode, uint uMapType); - - public void VolumeUp() - { - keybd_event(VK_VOLUME_UP, MapVirtualKey(VK_VOLUME_UP_U, KEYEVENTF_NONKEY), KEYEVENTF_EXTENDEDKEY, KEYEVENTF_NONKEY); - keybd_event(VK_VOLUME_UP, MapVirtualKey(VK_VOLUME_UP_U, KEYEVENTF_NONKEY), KEYEVENTF_TOPUP, KEYEVENTF_NONKEY); - } - - public void VolumeDown() - { - keybd_event(VK_VOLUME_DOWN, MapVirtualKey(VK_VOLUME_DOWN_U, KEYEVENTF_NONKEY), KEYEVENTF_EXTENDEDKEY, KEYEVENTF_NONKEY); - keybd_event(VK_VOLUME_DOWN, MapVirtualKey(VK_VOLUME_DOWN_U, KEYEVENTF_NONKEY), KEYEVENTF_TOPUP, KEYEVENTF_NONKEY); - } - - public void Mute() - { - keybd_event(VK_VOLUME_MUTE, MapVirtualKey(VK_VOLUME_MUTE_U, KEYEVENTF_NONKEY), KEYEVENTF_EXTENDEDKEY, KEYEVENTF_NONKEY); - keybd_event(VK_VOLUME_MUTE, MapVirtualKey(VK_VOLUME_MUTE_U, KEYEVENTF_NONKEY), KEYEVENTF_TOPUP, KEYEVENTF_NONKEY); - } - - public void SetVolume(int value) - { - for (int num = 0; num != 50; num++) - { - keybd_event(VK_VOLUME_DOWN, MapVirtualKey(VK_VOLUME_DOWN_U, KEYEVENTF_NONKEY), KEYEVENTF_EXTENDEDKEY, KEYEVENTF_NONKEY); - keybd_event(VK_VOLUME_DOWN, MapVirtualKey(VK_VOLUME_DOWN_U, KEYEVENTF_NONKEY), KEYEVENTF_TOPUP, KEYEVENTF_NONKEY); - } - if (value > 0) - { - for (int num = 0; num != value / 2; num++) - { - keybd_event(VK_VOLUME_UP, MapVirtualKey(VK_VOLUME_UP_U, KEYEVENTF_NONKEY), KEYEVENTF_EXTENDEDKEY, KEYEVENTF_NONKEY); - keybd_event(VK_VOLUME_UP, MapVirtualKey(VK_VOLUME_UP_U, KEYEVENTF_NONKEY), KEYEVENTF_TOPUP, KEYEVENTF_NONKEY); - } - } - } - - private const byte VK_VOLUME_MUTE = 173; - private const uint VK_VOLUME_MUTE_U = 173U; - - private const byte VK_VOLUME_DOWN = 174; - private const uint VK_VOLUME_DOWN_U = 174U; - - private const byte VK_VOLUME_UP = 175; - private const uint VK_VOLUME_UP_U = 175U; - - private const uint KEYEVENTF_NONKEY = 0U; - private const uint KEYEVENTF_EXTENDEDKEY = 1U; - private const uint KEYEVENTF_KEYUP = 2U; - private const uint KEYEVENTF_TOPUP = 3U; - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/DatePicker/CrEaTiiOn_DatePicker.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/DatePicker/CrEaTiiOn_DatePicker.cs deleted file mode 100644 index e6cdd4a..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/DatePicker/CrEaTiiOn_DatePicker.cs +++ /dev/null @@ -1,310 +0,0 @@ -#region Imports -using CBH_Ultimate_Theme_Library.Theme.Helpers; -using System.Drawing.Drawing2D; -using System.Drawing.Text; -#endregion - -namespace CBH.Controls -{ - public partial class CrEaTiiOn_DatePicker : Control - { - public new Color BackColor { get { return ThemeColors.PrimaryColor; } set { } } - - private RectangleF TopDateRect;//顶部日期区域 - private RectangleF WeekRect;//显示星期区域 - - private List> DateRectangles;//显示日期区域 - - private RectangleF PreviousMonthRect;//上一月区域 - private RectangleF NextMonthRect;//下一月区域 - private RectangleF PreviousYearRect;//上一年区域 - private RectangleF NextYearRect;//下一年区域 - - private DateTime CurrentDate; - public DateTime Date { get { return CurrentDate; } set { CurrentDate = value; Invalidate(); } } - - - private int DateRectDefaultSize; - private int HoverX; - private int HoverY; - private int SelectedX; - private int SelectedY; - - private bool previousYearHovered; - private bool previousMonthHovered; - private bool nextMonthHovered; - private bool nextYearHovered; - - #region 事件 - public delegate void DateChanged(DateTime newDateTime); - public event DateChanged onDateChanged; - #endregion - - #region 重写事件 - protected override void OnMouseMove(MouseEventArgs e) - { - base.OnMouseMove(e); - - for (int i = 0; i < 7; i++) - { - for (int j = 0; j < 7; j++) - { - if (DateRectangles[i][j].Drawn) - { - if (DateRectangles[i][j].Rect.Contains(e.Location)) - { - if (HoverX != i || HoverY != j) - { - HoverX = i; - previousYearHovered = false; - nextYearHovered = false; - HoverY = j; - Invalidate(); - } - return; - } - } - } - } - - if (PreviousYearRect.Contains(e.Location)) - { - previousYearHovered = true; - HoverX = -1; - Invalidate(); - return; - } - if (PreviousMonthRect.Contains(e.Location)) - { - previousMonthHovered = true; - HoverX = -1; - Invalidate(); - return; - } - if (NextMonthRect.Contains(e.Location)) - { - nextMonthHovered = true; - HoverX = -1; - Invalidate(); - return; - } - if (NextYearRect.Contains(e.Location)) - { - nextYearHovered = true; - HoverX = -1; - Invalidate(); - return; - } - if (HoverX >= 0 || previousYearHovered || previousMonthHovered || nextMonthHovered || nextYearHovered) - { - HoverX = -1; - previousYearHovered = false; - previousMonthHovered = false; - nextMonthHovered = false; - nextYearHovered = false; - Invalidate(); - } - } - - protected override void OnMouseUp(MouseEventArgs e) - { - if (HoverX >= 0) - { - SelectedX = HoverX; - SelectedY = HoverY; - CurrentDate = DateRectangles[SelectedX][SelectedY].Date; - Invalidate(); - if (onDateChanged != null) - { - onDateChanged(CurrentDate); - } - return; - } - - if (PreviousYearRect.Contains(e.Location)) - CurrentDate = FirstDayOfMonth(CurrentDate.AddYears(-1)); - if (PreviousMonthRect.Contains(e.Location)) - CurrentDate = FirstDayOfMonth(CurrentDate.AddMonths(-1)); - if (NextMonthRect.Contains(e.Location)) - CurrentDate = FirstDayOfMonth(CurrentDate.AddMonths(1)); - if (NextYearRect.Contains(e.Location)) - CurrentDate = FirstDayOfMonth(CurrentDate.AddYears(1)); - CalculateRectangles(); - Invalidate(); - if (onDateChanged != null) - { - onDateChanged(CurrentDate); - } - base.OnMouseUp(e); - } - - protected override void OnMouseLeave(EventArgs e) - { - HoverX = -1; - HoverY = -1; - previousYearHovered = false; - previousMonthHovered = false; - nextMonthHovered = false; - nextYearHovered = false; - Invalidate(); - base.OnMouseLeave(e); - } - - #endregion - - private void CalculateRectangles() - { - //日期位置List - DateRectangles = new List>(); - for (int i = 0; i < 7; i++) - { - DateRectangles.Add(new List()); - for (int j = 0; j < 7; j++) - { - DateRectangles[i].Add(new DateRect(new RectangleF(10 + (j * (Width - 20) / 7), WeekRect.Y + WeekRect.Height + (i * DateRectDefaultSize), DateRectDefaultSize, DateRectDefaultSize))); - } - } - DateTime FirstDay = FirstDayOfMonth(CurrentDate); - var temp = 0; - for (int i = FirstDay.DayOfWeek == DayOfWeek.Sunday ? 6 : (int)FirstDay.DayOfWeek - 1; i > 0; i--, temp++) - { - DateRectangles[temp / 7][temp % 7].Drawn = false; - DateRectangles[temp / 7][temp % 7].Date = FirstDay.AddDays(0 - i); - } - for (DateTime date = FirstDay; date <= LastDayOfMonth(CurrentDate); date = date.AddDays(1), temp++) - { - if (date.DayOfYear == CurrentDate.DayOfYear && date.Year == CurrentDate.Year) - { - SelectedX = temp / 7; - SelectedY = temp % 7; - } - DateRectangles[temp / 7][temp % 7].Drawn = true; - DateRectangles[temp / 7][temp % 7].Date = date; - } - DateTime LastDay = LastDayOfMonth(CurrentDate); - for (int i = 0; temp < 42; i++, temp++) - { - DateRectangles[temp / 7][temp % 7].Drawn = false; - DateRectangles[temp / 7][temp % 7].Date = LastDay.AddDays(i + 1); - } - } - - - protected override void OnResize(EventArgs e) - { - Width = 250; - Height = 270; - } - - public CrEaTiiOn_DatePicker() - { - SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.OptimizedDoubleBuffer, true); - DoubleBuffered = true; - Width = 250; - Height = 260; - - DateRectDefaultSize = (Width - 20) / 7; - TopDateRect = new RectangleF(20, 5, Width - 40, DateRectDefaultSize); - WeekRect = new RectangleF(0, TopDateRect.Y + TopDateRect.Height, DateRectDefaultSize, DateRectDefaultSize); - - PreviousYearRect = new RectangleF(10, TopDateRect.Y, 20, DateRectDefaultSize); - PreviousMonthRect = new RectangleF(35, TopDateRect.Y + 1, 20, DateRectDefaultSize); - NextMonthRect = new RectangleF(Width - 55, TopDateRect.Y + 1, 20, DateRectDefaultSize); - NextYearRect = new RectangleF(Width - 30, TopDateRect.Y, 20, DateRectDefaultSize); - - CurrentDate = DateTime.Now; - - HoverX = -1; - HoverY = -1; - CalculateRectangles(); - } - - protected override void OnPaint(PaintEventArgs e) - { - base.OnPaint(e); - - var graphics = e.Graphics; - graphics.PixelOffsetMode = PixelOffsetMode.HighQuality; - graphics.SmoothingMode = SmoothingMode.HighQuality; - graphics.TextRenderingHint = TextRenderingHint.ClearTypeGridFit; - graphics.Clear(Parent.BackColor); - - //绘制背景边框 - var bg = DrawHelper.CreateRoundRect(1f, 1f, Width - 2, Height - 2, 3); - graphics.FillPath(new SolidBrush(Color.FromArgb(20, 20, 20)), bg); - graphics.DrawPath(new Pen(ThemeColors.OneLevelBorder), bg); - - //绘制年月 - graphics.DrawString(string.Format("{0}年{1,2}月", CurrentDate.Year, CurrentDate.Month), new Font("微软雅黑", 12f), new SolidBrush(ThemeColors.MainText), TopDateRect, StringAlign.Center); - //绘制年月选择区域 - graphics.DrawString("7", new Font("Segoe UI", 12f), new SolidBrush(previousYearHovered ? ThemeColors.PrimaryColor : ThemeColors.PlaceholderText), PreviousYearRect, StringAlign.Center); - graphics.DrawString("3", new Font("Segoe UI", 12f), new SolidBrush(previousMonthHovered ? ThemeColors.PrimaryColor : ThemeColors.PlaceholderText), PreviousMonthRect, StringAlign.Center); - graphics.DrawString("4", new Font("Segoe UI", 12f), new SolidBrush(nextMonthHovered ? ThemeColors.PrimaryColor : ThemeColors.PlaceholderText), NextMonthRect, StringAlign.Center); - graphics.DrawString("8", new Font("Segoe UI", 12f), new SolidBrush(nextYearHovered ? ThemeColors.PrimaryColor : ThemeColors.PlaceholderText), NextYearRect, StringAlign.Center); - - //绘制星期 - string s = "一二三四五六日"; - for (int i = 0; i < 7; i++) - { - graphics.DrawString(s[i].ToString(), new Font("微软雅黑", 10f), new SolidBrush(ThemeColors.RegularText), new RectangleF(10 + i * (Width - 20) / 7, WeekRect.Y, WeekRect.Width, WeekRect.Height), StringAlign.Center); - } - - //绘制分割线 - graphics.DrawLine(new Pen(ThemeColors.TwoLevelBorder, 0.5f), 10, WeekRect.Y + WeekRect.Height, Width - 10, WeekRect.Y + WeekRect.Height); - - //绘制日期 - DateTime FirstDay = FirstDayOfMonth(CurrentDate); - for (int i = 0; i < 42; i++) - { - var tempDate = DateRectangles[i / 7][i % 7]; - var brush = new SolidBrush(ThemeColors.MainText); - //突出显示鼠标所指 - if (HoverX == i / 7 && HoverY == i % 7) - { - var rect1 = tempDate.Rect; - var bg1 = DrawHelper.CreateRoundRect(rect1.X + 2, rect1.Y + 2, rect1.Width - 4, rect1.Width - 4, 3); - graphics.FillPath(new SolidBrush(ThemeColors.ThreeLevelBorder), bg1); - //graphics.FillRectangle(new SolidBrush(ThemeColors.ThreeLevelBorder), new RectangleF(rect1.X + 3, rect1.Y + 3, rect1.Width - 6, rect1.Width - 6)); - } - //突出显示今天 - if (tempDate.Date == DateTime.Today) - { - brush = new SolidBrush(ThemeColors.DarkPrimary); - } - //突出显示所选日期 - if (tempDate.Date == Date) - { - var rect1 = tempDate.Rect; - var bg1 = DrawHelper.CreateRoundRect(rect1.X + 2, rect1.Y + 2, rect1.Width - 4, rect1.Width - 4, 3); - graphics.FillPath(new SolidBrush(ThemeColors.PrimaryColor), bg1); - - //graphics.FillRectangle(new SolidBrush(ThemeColors.PrimaryColor), new RectangleF(rect1.X+3,rect1.Y+3,rect1.Width-6,rect1.Width-6)); - brush = new SolidBrush(Color.White); - } - graphics.DrawString(DateRectangles[i / 7][i % 7].Date.Day.ToString(), Font, DateRectangles[i / 7][i % 7].Drawn ? brush : new SolidBrush(ThemeColors.SecondaryText), DateRectangles[i / 7][i % 7].Rect, StringAlign.Center); - } - } - - public DateTime FirstDayOfMonth(DateTime value) - { - return new DateTime(value.Year, value.Month, 1); - } - - public DateTime LastDayOfMonth(DateTime value) - { - return new DateTime(value.Year, value.Month, DateTime.DaysInMonth(value.Year, value.Month)); - } - - private class DateRect - { - public RectangleF Rect; - public bool Drawn = false; - public DateTime Date; - - public DateRect(RectangleF pRect) - { - Rect = pRect; - } - } - } -} diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/DropDown/CrEaTiiOn_ClasicDropdownMenu.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/DropDown/CrEaTiiOn_ClasicDropdownMenu.cs deleted file mode 100644 index b320d75..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/DropDown/CrEaTiiOn_ClasicDropdownMenu.cs +++ /dev/null @@ -1,87 +0,0 @@ -#region Imports -using System.ComponentModel; -using System.Windows.Forms.Layout; -#endregion - -namespace CBH.Controls -{ - public class CrEaTiiOn_ClasicDropdownMenu : CrEaTiiOn_ContextMenuStrip - { - private bool isMainMenu; - private int menuItemHeight = 25; - private Color menuItemTextColor = Color.Empty; - private Color primaryColor = Color.FromArgb(20, 20, 20); - private Bitmap menuItemHeaderSize; - - public CrEaTiiOn_ClasicDropdownMenu(IContainer container) - : base(container) - { - } - - [Browsable(false)] - public bool IsMainMenu - { - get => this.isMainMenu; - set => this.isMainMenu = value; - } - - [Browsable(false)] - public int MenuItemHeight - { - get => this.menuItemHeight; - set => this.menuItemHeight = value; - } - - [Browsable(false)] - public Color MenuItemTextColor - { - get => this.menuItemTextColor; - set => this.menuItemTextColor = value; - } - - [Browsable(false)] - public Color PrimaryColor - { - get => this.primaryColor; - set => this.primaryColor = value; - } - - private void LoadMenuItemHeight() - { - this.menuItemHeaderSize = !this.isMainMenu ? new Bitmap(20, this.menuItemHeight) : new Bitmap(25, 45); - foreach (ToolStripMenuItem toolStripMenuItem in (ArrangedElementCollection)this.Items) - { - toolStripMenuItem.ImageScaling = ToolStripItemImageScaling.None; - if (toolStripMenuItem.Image == null) - toolStripMenuItem.Image = (Image)this.menuItemHeaderSize; - foreach (ToolStripMenuItem dropDownItem1 in (ArrangedElementCollection)toolStripMenuItem.DropDownItems) - { - dropDownItem1.ImageScaling = ToolStripItemImageScaling.None; - if (dropDownItem1.Image == null) - dropDownItem1.Image = (Image)this.menuItemHeaderSize; - foreach (ToolStripMenuItem dropDownItem2 in (ArrangedElementCollection)dropDownItem1.DropDownItems) - { - dropDownItem2.ImageScaling = ToolStripItemImageScaling.None; - if (dropDownItem2.Image == null) - dropDownItem2.Image = (Image)this.menuItemHeaderSize; - foreach (ToolStripMenuItem dropDownItem3 in (ArrangedElementCollection)dropDownItem2.DropDownItems) - { - dropDownItem3.ImageScaling = ToolStripItemImageScaling.None; - if (dropDownItem3.Image == null) - dropDownItem3.Image = (Image)this.menuItemHeaderSize; - } - } - } - } - } - - protected override void OnHandleCreated(EventArgs e) - { - base.OnHandleCreated(e); - if (this.DesignMode) - return; - this.Renderer = (ToolStripRenderer)new MenuRenderer(this.isMainMenu, this.primaryColor, this.menuItemTextColor); - this.LoadMenuItemHeight(); - } - } -} diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/DropDown/CrEaTiiOn_DropdownMenu.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/DropDown/CrEaTiiOn_DropdownMenu.cs deleted file mode 100644 index 64f0032..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/DropDown/CrEaTiiOn_DropdownMenu.cs +++ /dev/null @@ -1,100 +0,0 @@ -#region Imports -using System.ComponentModel; -#endregion - -namespace CBH.Controls -{ - public class CrEaTiiOn_DropdownMenu : CrEaTiiOn_ContextMenuStrip - { - //Fields - private bool isMainMenu; - private int menuItemHeight = 25; - private Color menuItemTextColor = Color.Empty;//No color, The default color is set in the MenuRenderer class - private Color primaryColor = Color.Empty;//No color, The default color is set in the MenuRenderer class - - private Bitmap menuItemHeaderSize; - - //Constructor - public CrEaTiiOn_DropdownMenu(IContainer container) - : base(container) - { - - } - - //Properties - //Optionally, hide the properties in the toolbox to avoid the problem of displaying and/or - //saving control property changes in the designer at design time in Visual Studio. - //If the problem I mention does not occur you can expose the properties and manipulate them from the toolbox. - [Browsable(false)] - public bool IsMainMenu - { - get { return isMainMenu; } - set { isMainMenu = value; } - } - - [Browsable(false)] - public int MenuItemHeight - { - get { return menuItemHeight; } - set { menuItemHeight = value; } - } - - [Browsable(false)] - public Color MenuItemTextColor - { - get { return menuItemTextColor; } - set { menuItemTextColor = value; } - } - - [Browsable(false)] - public Color PrimaryColor - { - get { return primaryColor; } - set { primaryColor = value; } - } - - //Private methods - private void LoadMenuItemHeight() - { - if (isMainMenu) - menuItemHeaderSize = new Bitmap(25, 45); - else menuItemHeaderSize = new Bitmap(20, menuItemHeight); - - foreach (ToolStripMenuItem menuItemL1 in this.Items) - { - menuItemL1.ImageScaling = ToolStripItemImageScaling.None; - if (menuItemL1.Image == null) menuItemL1.Image = menuItemHeaderSize; - - foreach (ToolStripMenuItem menuItemL2 in menuItemL1.DropDownItems) - { - menuItemL2.ImageScaling = ToolStripItemImageScaling.None; - if (menuItemL2.Image == null) menuItemL2.Image = menuItemHeaderSize; - - foreach (ToolStripMenuItem menuItemL3 in menuItemL2.DropDownItems) - { - menuItemL3.ImageScaling = ToolStripItemImageScaling.None; - if (menuItemL3.Image == null) menuItemL3.Image = menuItemHeaderSize; - - foreach (ToolStripMenuItem menuItemL4 in menuItemL3.DropDownItems) - { - menuItemL4.ImageScaling = ToolStripItemImageScaling.None; - if (menuItemL4.Image == null) menuItemL4.Image = menuItemHeaderSize; - ///Level 5++ - } - } - } - } - } - - //Overrides - protected override void OnHandleCreated(EventArgs e) - { - base.OnHandleCreated(e); - if (this.DesignMode == false) - { - this.Renderer = new MenuRenderer(isMainMenu, primaryColor, menuItemTextColor); - LoadMenuItemHeight(); - } - } - } -} diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/Ellipse/CrEaTiiOn_Ellipse.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/Ellipse/CrEaTiiOn_Ellipse.cs deleted file mode 100644 index b7d4f7c..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/Ellipse/CrEaTiiOn_Ellipse.cs +++ /dev/null @@ -1,44 +0,0 @@ -#region Imports -using System.ComponentModel; -using System.Runtime.InteropServices; -#endregion - -namespace CBH.Controls -{ - public class CrEaTiiOn_Ellipse : Component - { - private Control control; - private int cornerRadius = 6; - - [DllImport("gdi32.dll")] - private static extern IntPtr CreateRoundRectRgn( - int nL, - int nT, - int nR, - int nB, - int nWidthEllipse, - int nHeightEllipse); - - public Control TargetControl - { - get => this.control; - set - { - this.control = value; - this.control.SizeChanged += (EventHandler)((sender, eventArgs) => this.control.Region = Region.FromHrgn(CrEaTiiOn_Ellipse.CreateRoundRectRgn(0, 0, this.control.Width, this.control.Height, this.cornerRadius, this.cornerRadius))); - } - } - - public int CornerRadius - { - get => this.cornerRadius; - set - { - this.cornerRadius = value; - if (this.control == null) - return; - this.control.Region = Region.FromHrgn(CrEaTiiOn_Ellipse.CreateRoundRectRgn(0, 0, this.control.Width, this.control.Height, this.cornerRadius, this.cornerRadius)); - } - } - } -} diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/Ellipse/CrEaTiiOn_ObjectEllipse.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/Ellipse/CrEaTiiOn_ObjectEllipse.cs deleted file mode 100644 index 5cbdddc..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/Ellipse/CrEaTiiOn_ObjectEllipse.cs +++ /dev/null @@ -1,238 +0,0 @@ -#region Imports - -using System.ComponentModel; -using System.ComponentModel.Design; -using System.Runtime.InteropServices; - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_ObjectEllipse - - public class CrEaTiiOn_ObjectEllipse : Component - { - public CrEaTiiOn_ObjectEllipse() - { - UpdateControl(); - UpdateForm(); - } - - public override ISite Site - { - get => base.Site; - set - { - base.Site = value; - - if (value == null) - { - return; - } - - IDesignerHost designerHost = value.GetService(typeof(IDesignerHost)) as IDesignerHost; - - if (designerHost != null) - { - IComponent rootComponent = designerHost.RootComponent; - - if (rootComponent is ContainerControl && rootComponent is not Form) - { - effectedControl = rootComponent as ContainerControl; - - DefaultControl = rootComponent as ContainerControl; - - if (DefaultControl != null) - { - DefaultControlRegion = DefaultControl.Region; - } - } - - if (rootComponent is Form) - { - effectedForm = rootComponent as Form; - - DefaultForm = rootComponent as Form; - - if (DefaultForm != null) - { - DefaultFormRegion = DefaultForm.Region; - DefaultStyle = DefaultForm.FormBorderStyle; - } - } - } - } - } - - private void SetCustomRegion() - { - if (effectedControl != null) - { - effectedControl.Region = Region.FromHrgn(CreateRoundRectRgn(0, 0, effectedControl.Width, effectedControl.Height, cornerRadius, cornerRadius)); - effectedControl.SizeChanged += Container_SizeChanged; - } - - if (effectedForm != null) - { - effectedForm.FormBorderStyle = FormBorderStyle.None; - - effectedForm.Region = Region.FromHrgn(CreateRoundRectRgn(0, 0, effectedForm.Width, effectedForm.Height, cornerRadius, cornerRadius)); - effectedForm.SizeChanged += Container_SizeChanged; - } - } - - private void UpdateControl() - { - if (DefaultControl != null) - { - DefaultControl.Region = DefaultControlRegion; - } - - if (effectedControl != null) - { - DefaultControl = effectedControl; - - DefaultControlRegion = effectedControl.Region; - - SetCustomRegion(); - } - } - - private void UpdateForm() - { - if (DefaultForm != null) - { - DefaultForm.FormBorderStyle = DefaultStyle; - - DefaultForm.Region = DefaultFormRegion; - } - - if (effectedForm != null) - { - DefaultForm = effectedForm; - - DefaultFormRegion = effectedForm.Region; - - DefaultStyle = effectedForm.FormBorderStyle; - - SetCustomRegion(); - } - } - - protected override void Dispose(bool disposing) - { - base.Dispose(disposing); - - if (effectedControl != null) - { - effectedControl.Region = DefaultControlRegion; - } - - if (effectedForm != null) - { - effectedForm.FormBorderStyle = DefaultStyle; - - effectedForm.Region = DefaultFormRegion; - } - } - - private void Container_SizeChanged(object sender, EventArgs e) - { - if (effectedControl != null) - { - effectedControl.Region = Region.FromHrgn(CreateRoundRectRgn(0, 0, effectedControl.Width, effectedControl.Height, cornerRadius, cornerRadius)); - } - - if (effectedForm != null) - { - effectedForm.Region = Region.FromHrgn(CreateRoundRectRgn(0, 0, effectedForm.Width, effectedForm.Height, cornerRadius, cornerRadius)); - } - } - - [Category("Parrot")] - [Browsable(true)] - [Description("The corner radius")] - public int CornerRadius - { - get => cornerRadius; - set - { - cornerRadius = value; - SetCustomRegion(); - } - } - - [Category("Parrot")] - [Browsable(true)] - [Description("The effected control")] - public Control EffectedControl - { - get - { - if (effectedControl != null) - { - return effectedControl; - } - else - { - return null; - } - } - set - { - if (value != EffectedForm || value == null) - { - effectedControl = value; - UpdateControl(); - } - } - } - - [Category("Parrot")] - [Browsable(true)] - [Description("The effected form(will remove ellipse from effected control)")] - public Form EffectedForm - { - get - { - if (effectedForm != null) - { - return effectedForm; - } - else - { - return null; - } - } - set - { - if (value != EffectedControl || value == null) - { - effectedForm = value; - UpdateForm(); - } - } - } - - [DllImport("Gdi32.dll")] - private static extern IntPtr CreateRoundRectRgn(int nLeftRect, int nTopRect, int nRightRect, int nBottomRect, int nWidthEllipse, int nHeightEllipse); - - private Control DefaultControl = null; - - private Form DefaultForm = null; - - private FormBorderStyle DefaultStyle; - - private Region DefaultControlRegion = null; - - private Region DefaultFormRegion = null; - - private int cornerRadius = 10; - - private Control effectedControl = null; - - private Form effectedForm = null; - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/Gauge/CrEaTiiOn_Gauge.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/Gauge/CrEaTiiOn_Gauge.cs deleted file mode 100644 index a80e68d..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/Gauge/CrEaTiiOn_Gauge.cs +++ /dev/null @@ -1,237 +0,0 @@ -#region Imports - -using System.ComponentModel; -using System.Drawing.Drawing2D; - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_Gauge - - public class CrEaTiiOn_Gauge : Control - { - public CrEaTiiOn_Gauge() - { - base.SetStyle(ControlStyles.SupportsTransparentBackColor, true); - base.Size = new Size(140, 70); - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The gauge style")] - public Style GaugeStyle - { - get => gaugeStyle; - set - { - gaugeStyle = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The gauge thickness")] - public int Thickness - { - get => thickness; - set - { - thickness = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The gauge dial thickness")] - public int DialThickness - { - get => dialThickness; - set - { - dialThickness = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The gauge percentage")] - public int Percentage - { - get => percentage; - set - { - percentage = value; - if (value < 0) - { - percentage = 0; - } - if (value > 100) - { - percentage = 100; - } - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The gauge percentage")] - public Color DialColor - { - get => dialColor; - set - { - dialColor = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The gauge unfilled color")] - public Color UnfilledColor - { - get => unfilledColor; - set - { - unfilledColor = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The gauge filled color")] - public Color FilledColor - { - get => filledColor; - set - { - filledColor = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The gauge consumption color")] - public Color ConsumptionColor - { - get => consumptionColor; - set - { - consumptionColor = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The gauge bar color")] - public List BarColor - { - get => barColor; - set - { - barColor = value; - base.Invalidate(); - } - } - - private SmoothingMode _SmoothingType = SmoothingMode.AntiAlias; - [Category("CrEaTiiOn")] - [Browsable(true)] - public SmoothingMode SmoothingType - { - get => _SmoothingType; - set - { - _SmoothingType = value; - Invalidate(); - } - } - - protected override void OnPaint(PaintEventArgs e) - { - e.Graphics.SmoothingMode = SmoothingType; - if (BarColor.Count == 7) - { - if (gaugeStyle == Style.Standard) - { - Rectangle rect = new(1 + thickness / 2, 1 + thickness / 2, base.Width - 2 - thickness, base.Height * 2 - thickness); - e.Graphics.DrawArc(new Pen(BarColor[0], thickness / 4), rect, 180f, 44f); - e.Graphics.DrawArc(new Pen(BarColor[1], thickness / 4 * 2), rect, 226f, 44f); - e.Graphics.DrawArc(new Pen(BarColor[2], thickness / 4 * 3), rect, 272f, 44f); - e.Graphics.DrawArc(new Pen(BarColor[3], thickness), rect, 318f, 44f); - rect.Inflate(0 - thickness, 0 - thickness); - e.Graphics.FillPie(new SolidBrush(dialColor), new Rectangle(base.Width / 2 - thickness, base.Height - thickness, thickness * 2, thickness * 2), 0f, 360f); - if (percentage <= 5) - { - e.Graphics.FillPie(new SolidBrush(ConsumptionColor), rect, 180 + dialThickness * 2 - 2, dialThickness); - } - else if (percentage >= 95) - { - e.Graphics.FillPie(new SolidBrush(ConsumptionColor), rect, 360 - dialThickness * 2, dialThickness); - } - else - { - e.Graphics.FillPie(new SolidBrush(dialColor), rect, 180 + (int)(percentage * 1.8) - dialThickness / 2, dialThickness); - } - } - if (gaugeStyle == Style.Material) - { - Rectangle rect2 = new(1 + thickness / 2, 1 + thickness / 2, base.Width - 2 - thickness, base.Height * 2 - thickness); - e.Graphics.DrawArc(new Pen(new LinearGradientBrush(new Rectangle(0, 0, base.Width, base.Height), BarColor[4], BarColor[5], 1f), thickness), rect2, 180f, (int)(percentage * 1.8) - 1); - e.Graphics.DrawArc(new Pen(BarColor[6], thickness), rect2, 180 + (int)(percentage * 1.8) + 1, 180 - (int)(percentage * 1.8) + 5); - } - if (gaugeStyle == Style.Flat) - { - Rectangle rect3 = new(1 + thickness / 2, 1 + thickness / 2, base.Width - 2 - thickness, base.Height * 2 - thickness); - e.Graphics.DrawArc(new Pen(filledColor, thickness), rect3, 180f, (int)(percentage * 1.8) - 1); - e.Graphics.DrawArc(new Pen(unfilledColor, thickness), rect3, 180 + (int)(percentage * 1.8) + 1, 180 - (int)(percentage * 1.8) + 5); - } - } - base.OnPaint(e); - } - - public Style gaugeStyle = Style.Material; - - public int thickness = 8; - - public int dialThickness = 5; - - public int percentage = 75; - - public Color dialColor = Color.Gray; - - public Color unfilledColor = Color.Gray; - - public Color consumptionColor = Color.Black; - - public List barColor = new() - { - Color.FromArgb(255, 220, 0), - Color.FromArgb(255, 150, 0), - Color.FromArgb(250, 90, 0), - Color.FromArgb(255, 0, 0), - Color.FromArgb(249, 55, 98), - Color.FromArgb(0, 162, 250), - Color.FromArgb(0, 162, 250) - }; - - public Color filledColor = Color.FromArgb(0, 162, 250); - - public enum Style - { - Standard, - Material, - Flat - } - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/GroupBox/CrEaTiiOn_FlatGroupBox.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/GroupBox/CrEaTiiOn_FlatGroupBox.cs deleted file mode 100644 index eb96436..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/GroupBox/CrEaTiiOn_FlatGroupBox.cs +++ /dev/null @@ -1,50 +0,0 @@ -#region Imports -using CBH_Ultimate_Theme_Library.Theme.Helpers; -using System.ComponentModel; -using System.Drawing.Drawing2D; -using System.Drawing.Text; -#endregion - -namespace CBH.Controls -{ - public class CrEaTiiOn_FlatGroupBox : GroupBox - { - #region 属性 - - [RefreshProperties(RefreshProperties.Repaint)] - public Color ThemeColor { get; set; } = ThemeColors.PrimaryColor; - - [Description("是否显示控件文本")] - [RefreshProperties(RefreshProperties.Repaint)] - public bool ShowText { get; set; } = false; - - #endregion - - protected override void OnPaint(PaintEventArgs e) - { - base.OnPaint(e); - Graphics graphics = e.Graphics; - graphics.SmoothingMode = SmoothingMode.HighQuality;//消除锯齿 - graphics.PixelOffsetMode = PixelOffsetMode.HighQuality;//高质量显示 - graphics.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;//最高质量显示文本 - graphics.Clear(Parent.BackColor); - - var BG = DrawHelper.CreateRoundRect(1, 1, Width - 2, Height - 2, 3); - graphics.FillPath(new SolidBrush(BackColor), BG); - graphics.DrawPath(new Pen(ThemeColors.OneLevelBorder), BG); - - if (ShowText) - { - graphics.DrawLine(new Pen(ThemeColors.OneLevelBorder, 1), 0, 38, Width, 38); - graphics.DrawString(Text, new Font("Segoe UI", 12F), new SolidBrush(ThemeColors.MainText), new RectangleF(15, 0, Width - 50, 38), StringAlign.Left); - } - } - - public CrEaTiiOn_FlatGroupBox() - { - SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.OptimizedDoubleBuffer, true); - DoubleBuffered = true; - Font = new Font("Segoe UI", 12); - } - } -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/GroupBox/CrEaTiiOn_ModernGroupBox.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/GroupBox/CrEaTiiOn_ModernGroupBox.cs deleted file mode 100644 index 9f620fe..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/GroupBox/CrEaTiiOn_ModernGroupBox.cs +++ /dev/null @@ -1,91 +0,0 @@ -#region Imports -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Runtime.InteropServices; -using System.Windows.Forms; -using CBH_Ultimate_Theme_Library; -#endregion - -namespace CBH.Controls -{ - public class CrEaTiiOn_ModernGroupBox : ThemeContainer154 - { - [DllImport("Gdi32.dll", EntryPoint = "CreateRoundRectRgn")] - private static extern IntPtr CreateRoundRectRgn - ( - int nLeftRect, // x-coordinate of upper-left corner - int nTopRect, // y-coordinate of upper-left corner - int nRightRect, // x-coordinate of lower-right corner - int nBottomRect, // y-coordinate of lower-right corner - int nWidthEllipse, // width of ellipse - int nHeightEllipse // height of ellipse - ); - - public CrEaTiiOn_ModernGroupBox() - { - ControlMode = true; - Header = 26; - TextColor = Color.White; - Size = new Size(205, 120); - Font = new Font("Segoe UI", 8); - } - - protected override void ColorHook() - { - } - private Color _ForeColor; - public Color TextColor - { - get { return _ForeColor; } - set { _ForeColor = value; } - } - private ColorBlend LBlend = new ColorBlend(); - - private ColorBlend LBlend2 = new ColorBlend(); - protected override void PaintHook() - { - LBlend.Positions = new float[] { - 0f, - 0.15f, - 0.85f, - 1f - }; - LBlend2.Positions = new float[] { - 0f, - 0.15f, - 0.5f, - 0.85f, - 1f - }; - LBlend.Colors = new Color[] { - Color.Transparent, - Color.FromArgb(250, 36, 38), - Color.FromArgb(250, 36, 38), - Color.Transparent - }; - LBlend2.Colors = new Color[] { - Color.Transparent, - Color.FromArgb(10, 10, 10), - Color.FromArgb(250, 36, 38), - Color.FromArgb(10, 10, 10), - Color.Transparent - }; - - G.Clear(Color.FromArgb(15, 15, 15)); - - if (Text == null) - { - } - else - { - DrawGradient(LBlend, 0, 23, Width, 1, 0f); - DrawGradient(LBlend2, 0, 24, Width, 1, 0f); - } - - G.DrawLine(new Pen(Color.FromArgb(15, 15, 15)), 1, 1, Width - 2, 1); - - DrawText(new SolidBrush(TextColor), HorizontalAlignment.Center, 0, 0); - Region = System.Drawing.Region.FromHrgn(CreateRoundRectRgn(0, 0, Width, Height, 15, 15)); - } - } -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/Handle/CrEaTiiOn_FormHandle.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/Handle/CrEaTiiOn_FormHandle.cs deleted file mode 100644 index 0a5c0e5..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/Handle/CrEaTiiOn_FormHandle.cs +++ /dev/null @@ -1,70 +0,0 @@ -#region Imports - -using System.ComponentModel; -using System.Runtime.InteropServices; - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_FormHandle - - public class CrEaTiiOn_FormHandle : Component - { - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The handleControl")] - public Control HandleControl - { - get => handleControl; - set - { - handleControl = value; - handleControl.MouseDown += DragForm_MouseDown; - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("Maximize when dragged to top")] - public bool DockAtTop - { - get => dockAtTop; - set => dockAtTop = value; - } - - [DllImport("user32.dll")] - public static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam); - - [DllImport("user32.dll")] - public static extern bool ReleaseCapture(); - - private void DragForm_MouseDown(object sender, MouseEventArgs e) - { - if (e.Button == MouseButtons.Left) - { - ReleaseCapture(); - SendMessage(HandleControl.FindForm().Handle, 161, 2, 0); - if (dockAtTop && handleControl.FindForm().FormBorderStyle == FormBorderStyle.None) - { - if (HandleControl.FindForm().WindowState != FormWindowState.Maximized && Cursor.Position.Y <= 3) - { - HandleControl.FindForm().WindowState = FormWindowState.Maximized; - return; - } - HandleControl.FindForm().WindowState = FormWindowState.Normal; - } - } - } - - private Control handleControl; - - private bool dockAtTop = true; - - public const int WM_NCLBUTTONDOWN = 161; - - public const int HT_CAPTION = 2; - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/Icon/CrEaTiiOn_InfoIcon.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/Icon/CrEaTiiOn_InfoIcon.cs deleted file mode 100644 index 5b78243..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/Icon/CrEaTiiOn_InfoIcon.cs +++ /dev/null @@ -1,66 +0,0 @@ -#region Imports - -using System.Drawing.Drawing2D; -using System.Drawing.Text; - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_InfoIcon - - public class CrEaTiiOn_InfoIcon : Control - { - #region Settings - - private Color _BaseColor = Color.FromArgb(246, 246, 246); - public Color BaseColor - { - get => _BaseColor; - set => _BaseColor = value; - } - - private Color _CircleColor = Color.Gray; - public Color CircleColor - { - get => _CircleColor; - set => _CircleColor = value; - } - - private string _String = "¡"; - public string String - { - get => _String; - set => _String = value; - } - - #endregion - - public CrEaTiiOn_InfoIcon() - { - ForeColor = Color.DimGray; - BackColor = Color.FromArgb(20, 20, 20); - ForeColor = Color.White; - Font = new("Segoe UI", 25, FontStyle.Bold); - Size = new(33, 33); - DoubleBuffered = true; - } - - protected override void OnPaint(PaintEventArgs e) - { - e.Graphics.SmoothingMode = SmoothingMode.HighQuality; - e.Graphics.TextRenderingHint = TextRenderingHint.ClearTypeGridFit; - - e.Graphics.FillEllipse(new SolidBrush(_CircleColor), new Rectangle(1, 1, 29, 29)); - e.Graphics.FillEllipse(new SolidBrush(_BaseColor), new Rectangle(3, 3, 25, 25)); - - e.Graphics.DrawString(_String, Font, new SolidBrush(ForeColor), new Rectangle(4, -14, Width, 43), new StringFormat - { - Alignment = StringAlignment.Near, - LineAlignment = StringAlignment.Near - }); - } - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/Icon/CrEaTiiOn_TickIcon.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/Icon/CrEaTiiOn_TickIcon.cs deleted file mode 100644 index 3514c20..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/Icon/CrEaTiiOn_TickIcon.cs +++ /dev/null @@ -1,66 +0,0 @@ -#region Imports - -using System.Drawing.Drawing2D; -using System.Drawing.Text; - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_TickIcon - - public class CrEaTiiOn_TickIcon : Control - { - #region Settings - - private Color _BaseColor = Color.FromArgb(246, 246, 246); - public Color BaseColor - { - get => _BaseColor; - set => _BaseColor = value; - } - - private Color _CircleColor = Color.Gray; - public Color CircleColor - { - get => _CircleColor; - set => _CircleColor = value; - } - - private string _String = "ü"; - public string String - { - get => _String; - set => _String = value; - } - - #endregion - - public CrEaTiiOn_TickIcon() - { - ForeColor = Color.White; - BackColor = Color.Transparent; - ForeColor = Color.Gray; - Font = new("Wingdings", 25, FontStyle.Bold); - Size = new(33, 33); - DoubleBuffered = true; - } - - protected override void OnPaint(PaintEventArgs e) - { - e.Graphics.SmoothingMode = SmoothingMode.HighQuality; - e.Graphics.TextRenderingHint = TextRenderingHint.ClearTypeGridFit; - - e.Graphics.FillEllipse(new SolidBrush(_CircleColor), new Rectangle(1, 1, 29, 29)); - e.Graphics.FillEllipse(new SolidBrush(_BaseColor), new Rectangle(3, 3, 25, 25)); - - e.Graphics.DrawString(_String, Font, new SolidBrush(ForeColor), new Rectangle(0, -3, Width, 43), new StringFormat - { - Alignment = StringAlignment.Near, - LineAlignment = StringAlignment.Near - }); - } - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/Label/CrEaTiiOn_AirLabel.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/Label/CrEaTiiOn_AirLabel.cs deleted file mode 100644 index ec74852..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/Label/CrEaTiiOn_AirLabel.cs +++ /dev/null @@ -1,20 +0,0 @@ -#region Imports - - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_AirLabel - - public class CrEaTiiOn_AirLabel : System.Windows.Forms.Label - { - public CrEaTiiOn_AirLabel() : base() - { - Font = new("Segoe UI", 6.75f, FontStyle.Bold); - ForeColor = Color.White; - } - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/Label/CrEaTiiOn_BigLabel.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/Label/CrEaTiiOn_BigLabel.cs deleted file mode 100644 index f30b3ee..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/Label/CrEaTiiOn_BigLabel.cs +++ /dev/null @@ -1,21 +0,0 @@ -#region Imports - - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_BigLabel - - public class CrEaTiiOn_BigLabel : System.Windows.Forms.Label - { - public CrEaTiiOn_BigLabel() - { - Font = new("Segoe UI", 25, FontStyle.Regular); - ForeColor = Color.White; - BackColor = Color.Transparent; - } - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/Label/CrEaTiiOn_ClasicHeaderLabel.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/Label/CrEaTiiOn_ClasicHeaderLabel.cs deleted file mode 100644 index 82fc9b2..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/Label/CrEaTiiOn_ClasicHeaderLabel.cs +++ /dev/null @@ -1,22 +0,0 @@ -#region Imports - - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_ClasicHeaderLabel - - public class CrEaTiiOn_ClasicHeaderLabel : System.Windows.Forms.Label - { - - public CrEaTiiOn_ClasicHeaderLabel() - { - Font = new("Segoe UI", 11, FontStyle.Bold); - ForeColor = Color.White; - BackColor = Color.Transparent; - } - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/Label/CrEaTiiOn_ClasicLabel.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/Label/CrEaTiiOn_ClasicLabel.cs deleted file mode 100644 index c8b334e..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/Label/CrEaTiiOn_ClasicLabel.cs +++ /dev/null @@ -1,27 +0,0 @@ -#region Imports - - -#endregion - -namespace CBH.Controls -{ - #region Label5 - - public class CrEaTiiOn_ClasicLabel : System.Windows.Forms.Label - { - public CrEaTiiOn_ClasicLabel() - { - Font = new("Segoe UI", 9, FontStyle.Regular); - BackColor = Color.Transparent; - ForeColor = ColorTranslator.FromHtml("#FFFFFF"); - } - - protected override void OnMouseDown(MouseEventArgs e) - { - base.OnMouseDown(e); - Focus(); - } - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/Label/CrEaTiiOn_FancyLabel.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/Label/CrEaTiiOn_FancyLabel.cs deleted file mode 100644 index 4f7f704..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/Label/CrEaTiiOn_FancyLabel.cs +++ /dev/null @@ -1,43 +0,0 @@ -#region Imports - -using System.Drawing.Drawing2D; - -#endregion - -namespace CBH.Controls -{ - #region Label7 - - public class CrEaTiiOn_FancyLabel : Control - { - public CrEaTiiOn_FancyLabel() - { - SetStyle(ControlStyles.SupportsTransparentBackColor, true); - SetStyle(ControlStyles.UserPaint, true); - BackColor = Color.Transparent; - ForeColor = Color.White; - DoubleBuffered = true; - Size = new(96, 16); - } - - protected override void OnPaint(PaintEventArgs e) - { - Bitmap B = new(Width, Height); - Graphics G = Graphics.FromImage(B); - //Rectangle ClientRectangle = new(0, 0, Width - 1, Height - 1); - base.OnPaint(e); - G.Clear(BackColor); - Font drawFont = new("", 9, FontStyle.Bold); - StringFormat format = new() { Alignment = StringAlignment.Near, LineAlignment = StringAlignment.Center }; - G.CompositingQuality = CompositingQuality.HighQuality; - G.SmoothingMode = SmoothingMode.HighQuality; - G.DrawString(Text, drawFont, new SolidBrush(Color.FromArgb(5, 5, 5)), new Rectangle(1, 0, Width - 1, Height - 1), format); - G.DrawString(Text, drawFont, new SolidBrush(ForeColor), new Rectangle(0, -1, Width - 1, Height - 1), format); - e.Graphics.DrawImage((Image)B.Clone(), 0, 0); - G.Dispose(); - B.Dispose(); - } - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/Label/CrEaTiiOn_FlatLabel.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/Label/CrEaTiiOn_FlatLabel.cs deleted file mode 100644 index 8fd5cd6..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/Label/CrEaTiiOn_FlatLabel.cs +++ /dev/null @@ -1,22 +0,0 @@ -#region Imports - - -#endregion - -namespace CBH.Controls -{ - #region Label2 - - public class CrEaTiiOn_FlatLabel : System.Windows.Forms.Label - { - - public CrEaTiiOn_FlatLabel() - { - Font = new("Segoe UI", 11); - ForeColor = Color.White; - BackColor = Color.Transparent; - } - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/Label/CrEaTiiOn_HeaderLabel.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/Label/CrEaTiiOn_HeaderLabel.cs deleted file mode 100644 index d0b700f..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/Label/CrEaTiiOn_HeaderLabel.cs +++ /dev/null @@ -1,21 +0,0 @@ -#region Imports - - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_HeaderLabel - - public class CrEaTiiOn_HeaderLabel : System.Windows.Forms.Label - { - public CrEaTiiOn_HeaderLabel() - { - Font = new("Segoe UI", 11, FontStyle.Bold); - ForeColor = Color.FromArgb(255, 255, 255); - BackColor = Color.Transparent; - } - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/Label/CrEaTiiOn_Label.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/Label/CrEaTiiOn_Label.cs deleted file mode 100644 index aede15d..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/Label/CrEaTiiOn_Label.cs +++ /dev/null @@ -1,113 +0,0 @@ -#region Imports - -using System.ComponentModel; - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_Label - - public class CrEaTiiOn_Label : System.Windows.Forms.Label - { - #region Field Region - - private bool _autoUpdateHeight; - private bool _isGrowing; - - #endregion - - #region Property Region - - [Category("Layout")] - [Description("Enables automatic height sizing based on the contents of the label.")] - [DefaultValue(false)] - public bool AutoUpdateHeight - { - get => _autoUpdateHeight; - set - { - _autoUpdateHeight = value; - - if (_autoUpdateHeight) - { - AutoSize = false; - ResizeLabel(); - } - } - } - - public new bool AutoSize - { - get => base.AutoSize; - set - { - base.AutoSize = value; - - if (AutoSize) - { - AutoUpdateHeight = false; - } - } - } - - #endregion - - #region Constructor Region - - public CrEaTiiOn_Label() - { - ForeColor = Color.White; - } - - #endregion - - #region Method Region - - private void ResizeLabel() - { - if (!_autoUpdateHeight || _isGrowing) - { - return; - } - - try - { - _isGrowing = true; - Size sz = new(Width, int.MaxValue); - sz = TextRenderer.MeasureText(Text, Font, sz, TextFormatFlags.WordBreak); - Height = sz.Height + Padding.Vertical; - } - finally - { - _isGrowing = false; - } - } - - #endregion - - #region Event Handler Region - - protected override void OnTextChanged(EventArgs e) - { - base.OnTextChanged(e); - ResizeLabel(); - } - - protected override void OnFontChanged(EventArgs e) - { - base.OnFontChanged(e); - ResizeLabel(); - } - - protected override void OnSizeChanged(EventArgs e) - { - base.OnSizeChanged(e); - ResizeLabel(); - } - - #endregion - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/Label/CrEaTiiOn_MetroLabel.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/Label/CrEaTiiOn_MetroLabel.cs deleted file mode 100644 index 05403f3..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/Label/CrEaTiiOn_MetroLabel.cs +++ /dev/null @@ -1,20 +0,0 @@ -namespace CBH.Controls -{ - public class CrEaTiiOn_MetroLabel : Label - { - protected override void OnTextChanged(EventArgs e) - { - base.OnTextChanged(e); - Invalidate(); - } - - public CrEaTiiOn_MetroLabel() - { - SetStyle(ControlStyles.SupportsTransparentBackColor, true); - Font = new Font("Segoe UI", 10); - ForeColor = Color.White; - BackColor = Color.Transparent; - Text = Text; - } - } -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/Label/CrEaTiiOn_ModernHeaderLabel.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/Label/CrEaTiiOn_ModernHeaderLabel.cs deleted file mode 100644 index 3262d4f..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/Label/CrEaTiiOn_ModernHeaderLabel.cs +++ /dev/null @@ -1,108 +0,0 @@ -#region Imports - -using System.ComponentModel; -using System.Drawing.Text; - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_ModernHeaderLabel - - public class CrEaTiiOn_ModernHeaderLabel : System.Windows.Forms.Label - { - #region Properties - - private PanelSide _Side; - [Browsable(true)] - [Description("Determines the foreground color of the label according to which side it is placed on.")] - public PanelSide Side - { - get => _Side; - set - { - _Side = value; - switch (value) - { - case PanelSide.LeftPanel: - ForeColor = _LeftSideForeColor; - break; - case PanelSide.RightPanel: - ForeColor = _RightSideForeColor; - break; - } - Invalidate(); - } - } - - private Color _LeftSideForeColor = ColorTranslator.FromHtml("#FAFAFA"); - public Color LeftSideForeColor - { - get => _LeftSideForeColor; - set - { - _LeftSideForeColor = value; - Invalidate(); - } - } - - private Color _RightSideForeColor = ColorTranslator.FromHtml("#AAABB0"); - public Color RightSideForeColor - { - get => _RightSideForeColor; - set - { - _RightSideForeColor = value; - Invalidate(); - } - } - - private TextRenderingHint _TextRenderingHint = TextRenderingHint.AntiAliasGridFit; - [Browsable(true)] - [Description("Specifies the quality of text rendering.")] - public TextRenderingHint TextRenderingHint - { - get => _TextRenderingHint; - set - { - _TextRenderingHint = value; - Invalidate(); - } - } - - #endregion - - #region Enum - - public enum PanelSide - { - LeftPanel, - RightPanel - }; - - #endregion - - public CrEaTiiOn_ModernHeaderLabel() - { - Font = new("Segoe UI", 22, FontStyle.Regular, GraphicsUnit.Point); - TextAlign = ContentAlignment.MiddleCenter; - ForeColor = _RightSideForeColor; - BackColor = Color.Transparent; - UseCompatibleTextRendering = true; - } - - protected override void OnMouseDown(MouseEventArgs e) - { - base.OnMouseDown(e); - Focus(); - } - - protected override void OnPaint(PaintEventArgs e) - { - e.Graphics.TextRenderingHint = _TextRenderingHint; - base.OnPaint(e); - } - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/Label/CrEaTiiOn_ModernLabel.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/Label/CrEaTiiOn_ModernLabel.cs deleted file mode 100644 index 9198edf..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/Label/CrEaTiiOn_ModernLabel.cs +++ /dev/null @@ -1,29 +0,0 @@ -#region Imports - - -#endregion - -namespace CBH.Controls -{ - #region Label3 - - public class CrEaTiiOn_ModernLabel : System.Windows.Forms.Label - { - protected override void OnTextChanged(EventArgs e) - { - base.OnTextChanged(e); - Invalidate(); - } - - public CrEaTiiOn_ModernLabel() - { - SetStyle(ControlStyles.SupportsTransparentBackColor, true); - Font = new("Segoe UI", 8); - ForeColor = Color.LightGray; - BackColor = Color.Transparent; - Text = Text; - } - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/Label/CrEaTiiOn_SmallLabel.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/Label/CrEaTiiOn_SmallLabel.cs deleted file mode 100644 index 261123f..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/Label/CrEaTiiOn_SmallLabel.cs +++ /dev/null @@ -1,21 +0,0 @@ -#region Imports - - -#endregion - -namespace CBH.Controls -{ - #region SmallLabel - - public class CrEaTiiOn_SmallLabel : System.Windows.Forms.Label - { - public CrEaTiiOn_SmallLabel() - { - Font = new("Segoe UI", 8); - ForeColor = Color.FromArgb(142, 142, 142); - BackColor = Color.Transparent; - } - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/LabelEdit/CrEaTiiOn_LabelEdit.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/LabelEdit/CrEaTiiOn_LabelEdit.cs deleted file mode 100644 index 82eea5a..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/LabelEdit/CrEaTiiOn_LabelEdit.cs +++ /dev/null @@ -1,21 +0,0 @@ -#region Imports - - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_LabelEdit - - public class CrEaTiiOn_LabelEdit : System.Windows.Forms.Label - { - public CrEaTiiOn_LabelEdit() - { - Font = new("Microsoft Sans Serif", 9); - ForeColor = Color.FromArgb(116, 125, 132); - BackColor = Color.Transparent; - } - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/LinkLabel/CrEaTiiOn_LinkLabel.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/LinkLabel/CrEaTiiOn_LinkLabel.cs deleted file mode 100644 index 4aedb52..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/LinkLabel/CrEaTiiOn_LinkLabel.cs +++ /dev/null @@ -1,24 +0,0 @@ -#region Imports - - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_LinkLabel - - public class CrEaTiiOn_LinkLabel : System.Windows.Forms.LinkLabel - { - public CrEaTiiOn_LinkLabel() - { - Font = new("Segoe UI", 11, FontStyle.Regular); - BackColor = Color.Transparent; - LinkColor = Color.FromArgb(240, 119, 70); - ActiveLinkColor = Color.FromArgb(221, 72, 20); - VisitedLinkColor = Color.FromArgb(240, 119, 70); - LinkBehavior = LinkBehavior.AlwaysUnderline; - } - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/LinkLabelEdit/CrEaTiiOn_LinkLabelEdit.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/LinkLabelEdit/CrEaTiiOn_LinkLabelEdit.cs deleted file mode 100644 index 0e29b04..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/LinkLabelEdit/CrEaTiiOn_LinkLabelEdit.cs +++ /dev/null @@ -1,24 +0,0 @@ -#region Imports - - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_LinkLabelEdit - - public class CrEaTiiOn_LinkLabelEdit : System.Windows.Forms.LinkLabel - { - public CrEaTiiOn_LinkLabelEdit() - { - Font = new("Microsoft Sans Serif", 9, FontStyle.Regular); - BackColor = Color.Transparent; - LinkColor = Color.FromArgb(32, 34, 37); - ActiveLinkColor = Color.FromArgb(153, 34, 34); - VisitedLinkColor = Color.FromArgb(32, 34, 37); - LinkBehavior = LinkBehavior.NeverUnderline; - } - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/ListBox/CrEaTiiOn_ListBox.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/ListBox/CrEaTiiOn_ListBox.cs deleted file mode 100644 index 7257681..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/ListBox/CrEaTiiOn_ListBox.cs +++ /dev/null @@ -1,77 +0,0 @@ -#region Imports - -using System.Drawing.Drawing2D; - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_ListBox - - public class CrEaTiiOn_ListBox : System.Windows.Forms.ListBox - { - - public CrEaTiiOn_ListBox() - { - SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.UserPaint, true); - DrawMode = DrawMode.OwnerDrawFixed; - IntegralHeight = false; - ItemHeight = 18; - Font = new("Seoge UI", 11, FontStyle.Regular); - } - - protected override void OnDrawItem(DrawItemEventArgs e) - { - base.OnDrawItem(e); - e.DrawBackground(); - LinearGradientBrush LGB = new(e.Bounds, Color.FromArgb(250, 36, 38), Color.FromArgb(20, 20, 20), 90.0F); - if (Convert.ToInt32((e.State & DrawItemState.Selected)) == (int)DrawItemState.Selected) - { - e.Graphics.FillRectangle(LGB, e.Bounds); - } - - using (SolidBrush b = new(e.ForeColor)) - { - if (base.Items.Count == 0) - { - return; - } - else - { - e.Graphics.DrawString(base.GetItemText(base.Items[e.Index]), e.Font, b, e.Bounds); - } - } - - LGB.Dispose(); - } - protected override void OnPaint(PaintEventArgs e) - { - base.OnPaint(e); - Region MyRegion = new(e.ClipRectangle); - e.Graphics.FillRegion(new SolidBrush(BackColor), MyRegion); - - if (Items.Count > 0) - { - for (int i = 0; i <= Items.Count - 1; i++) - { - System.Drawing.Rectangle RegionRect = GetItemRectangle(i); - if (e.ClipRectangle.IntersectsWith(RegionRect)) - { - if ((SelectionMode == SelectionMode.One && SelectedIndex == i) || (SelectionMode == SelectionMode.MultiSimple && SelectedIndices.Contains(i)) || (SelectionMode == SelectionMode.MultiExtended && SelectedIndices.Contains(i))) - { - OnDrawItem(new DrawItemEventArgs(e.Graphics, Font, RegionRect, i, DrawItemState.Selected, ForeColor, BackColor)); - } - else - { - OnDrawItem(new DrawItemEventArgs(e.Graphics, Font, RegionRect, i, DrawItemState.Default, Color.FromArgb(15, 15, 15), BackColor)); - } - - MyRegion.Complement(RegionRect); - } - } - } - } - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/Menu/CrEaTiiOn_MenuColorTable.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/Menu/CrEaTiiOn_MenuColorTable.cs deleted file mode 100644 index de5b597..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/Menu/CrEaTiiOn_MenuColorTable.cs +++ /dev/null @@ -1,52 +0,0 @@ -#region Imports -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; -using System.Drawing; -#endregion - -namespace CBH.Controls -{ - public class CrEaTiiOn_MenuColorTable : ProfessionalColorTable - { - //Fields - private Color backColor; - private Color leftColumnColor; - private Color borderColor; - private Color menuItemBorderColor; - private Color menuItemSelectedColor; - - //Constructor - public CrEaTiiOn_MenuColorTable(bool isMainMenu, Color primaryColor) - { - if (isMainMenu) - { - backColor = Color.FromArgb(37, 39, 60); - leftColumnColor = Color.FromArgb(32, 33, 51); - borderColor = Color.FromArgb(32, 33, 51); - menuItemBorderColor = primaryColor; - menuItemSelectedColor = primaryColor; - } - else - { - backColor = Color.White; - leftColumnColor = Color.LightGray; - borderColor = Color.LightGray; - menuItemBorderColor = primaryColor; - menuItemSelectedColor = primaryColor; - } - } - - //Overrides - public override Color ToolStripDropDownBackground { get { return backColor; } } - public override Color MenuBorder { get { return borderColor; } } - public override Color MenuItemBorder { get { return menuItemBorderColor; } } - public override Color MenuItemSelected { get { return menuItemSelectedColor; } } - public override Color ImageMarginGradientBegin { get { return leftColumnColor; } } - public override Color ImageMarginGradientMiddle { get { return leftColumnColor; } } - public override Color ImageMarginGradientEnd { get { return leftColumnColor; } } - } -} diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/Menu/CrEaTiiOn_MenuRenderer.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/Menu/CrEaTiiOn_MenuRenderer.cs deleted file mode 100644 index 9b5e22c..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/Menu/CrEaTiiOn_MenuRenderer.cs +++ /dev/null @@ -1,72 +0,0 @@ -#region Imports -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; -using System.Drawing; -using System.Drawing.Drawing2D; -using CBH.RJControls; -#endregion - -namespace CBH.Controls -{ - public class CrEaTiiOn_MenuRenderer : ToolStripProfessionalRenderer - { - //Fields - private Color primaryColor; - private Color textColor; - private int arrowThickness; - - //Constructor - public CrEaTiiOn_MenuRenderer(bool isMainMenu, Color primaryColor, Color textColor) - : base(new CrEaTiiOn_MenuColorTable(isMainMenu, primaryColor)) - { - this.primaryColor = primaryColor; - if (isMainMenu) - { - arrowThickness = 3; - if (textColor == Color.Empty) //Set Default Color - this.textColor = Color.Gainsboro; - else//Set custom text color - this.textColor = textColor; - } - else - { - arrowThickness = 2; - if (textColor == Color.Empty) //Set Default Color - this.textColor = Color.DimGray; - else//Set custom text color - this.textColor = textColor; - } - } - - //Overrides - protected override void OnRenderItemText(ToolStripItemTextRenderEventArgs e) - { - base.OnRenderItemText(e); - e.Item.ForeColor = e.Item.Selected ? Color.White : textColor; - } - - protected override void OnRenderArrow(ToolStripArrowRenderEventArgs e) - { - //Fields - var graph = e.Graphics; - var arrowSize = new Size(5, 12); - var arrowColor = e.Item.Selected ? Color.White : primaryColor; - var rect = new Rectangle(e.ArrowRectangle.Location.X, (e.ArrowRectangle.Height - arrowSize.Height) / 2, - arrowSize.Width, arrowSize.Height); - using (GraphicsPath path = new GraphicsPath()) - using (Pen pen = new Pen(arrowColor, arrowThickness)) - { - //Drawing - graph.SmoothingMode = SmoothingMode.AntiAlias; - path.AddLine(rect.Left, rect.Top, rect.Right, rect.Top + rect.Height / 2); - path.AddLine(rect.Right, rect.Top + rect.Height / 2, rect.Left, rect.Top + rect.Height); - graph.DrawPath(pen, path); - } - } - - } -} diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/Menu/Support/MenuColorTable.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/Menu/Support/MenuColorTable.cs deleted file mode 100644 index c687fff..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/Menu/Support/MenuColorTable.cs +++ /dev/null @@ -1,50 +0,0 @@ -#region Imports -using System.Drawing; -using System.Windows.Forms; -#endregion - -namespace CBH.Controls -{ - public class MenuColorTable : ProfessionalColorTable - { - private Color backColor; - private Color leftColumnColor; - private Color borderColor; - private Color menuItemBorderColor; - private Color menuItemSelectedColor; - - public MenuColorTable(bool isMainMenu, Color primaryColor) - { - if (isMainMenu) - { - this.backColor = Color.FromArgb(37, 39, 60); - this.leftColumnColor = Color.FromArgb(32, 33, 51); - this.borderColor = Color.FromArgb(32, 33, 51); - this.menuItemBorderColor = primaryColor; - this.menuItemSelectedColor = primaryColor; - } - else - { - this.backColor = Color.White; - this.leftColumnColor = Color.LightGray; - this.borderColor = Color.LightGray; - this.menuItemBorderColor = primaryColor; - this.menuItemSelectedColor = primaryColor; - } - } - - public override Color ToolStripDropDownBackground => this.backColor; - - public override Color MenuBorder => this.borderColor; - - public override Color MenuItemBorder => this.menuItemBorderColor; - - public override Color MenuItemSelected => this.menuItemSelectedColor; - - public override Color ImageMarginGradientBegin => this.leftColumnColor; - - public override Color ImageMarginGradientMiddle => this.leftColumnColor; - - public override Color ImageMarginGradientEnd => this.leftColumnColor; - } -} diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/Menu/Support/MenuRenderer.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/Menu/Support/MenuRenderer.cs deleted file mode 100644 index 23a5a5c..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/Menu/Support/MenuRenderer.cs +++ /dev/null @@ -1,58 +0,0 @@ -#region Imports -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Windows.Forms; -#endregion - -namespace CBH.Controls -{ - public class MenuRenderer : ToolStripProfessionalRenderer - { - private Color primaryColor; - private Color textColor; - private int arrowThickness; - - public MenuRenderer(bool isMainMenu, Color primaryColor, Color textColor) - : base((ProfessionalColorTable) new MenuColorTable(isMainMenu, primaryColor)) - { - this.primaryColor = primaryColor; - if (isMainMenu) - { - this.arrowThickness = 3; - if (textColor == Color.Empty) - this.textColor = Color.Gainsboro; - else - this.textColor = textColor; - } - else - { - this.arrowThickness = 2; - this.textColor = !(textColor == Color.Empty) ? textColor : Color.DimGray; - } - } - - protected override void OnRenderItemText(ToolStripItemTextRenderEventArgs e) - { - base.OnRenderItemText(e); - e.Item.ForeColor = e.Item.Selected ? Color.Black : this.textColor; - } - - protected override void OnRenderArrow(ToolStripArrowRenderEventArgs e) - { - Graphics graphics = e.Graphics; - Size size = new Size(5, 12); - Color color = e.Item.Selected ? Color.Blue : this.primaryColor; - Rectangle rectangle = new Rectangle(e.ArrowRectangle.Location.X, (e.ArrowRectangle.Height - size.Height) / 2, size.Width, size.Height); - using (GraphicsPath path = new GraphicsPath()) - { - using (Pen pen = new Pen(color, (float) this.arrowThickness)) - { - graphics.SmoothingMode = SmoothingMode.AntiAlias; - path.AddLine(rectangle.Left, rectangle.Top, rectangle.Right, rectangle.Top + rectangle.Height / 2); - path.AddLine(rectangle.Right, rectangle.Top + rectangle.Height / 2, rectangle.Left, rectangle.Top + rectangle.Height); - graphics.DrawPath(pen, path); - } - } - } - } -} diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/Notify/CrEaTiiOn_NotificationBox.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/Notify/CrEaTiiOn_NotificationBox.cs deleted file mode 100644 index 6d7d314..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/Notify/CrEaTiiOn_NotificationBox.cs +++ /dev/null @@ -1,473 +0,0 @@ -#region Imports - -using System.Drawing.Drawing2D; -using System.Drawing.Text; - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_NotificationBox - - public class CrEaTiiOn_NotificationBox : Control - { - #region Variables - - private Point CloseCoordinates; - private bool IsOverClose; - private int _BorderCurve = 8; - private GraphicsPath CreateRoundPath; - private string NotificationText = null; - private Type _NotificationType; - private bool _RoundedCorners; - private bool _ShowCloseButton; - private Image _Image; - private Size _ImageSize; - private SmoothingMode _SmoothingType = SmoothingMode.HighQuality; - private TextRenderingHint _TextRenderingType = TextRenderingHint.ClearTypeGridFit; - private Color _CloseForeColor = Color.Black; - private Color _ErrorBackColor = Color.Crimson; - private Color _ErrorForeColor = Color.White; - private Color _ErrorBorderColor = Color.Crimson; - private Color _SuccessBackColor = Color.SeaGreen; - private Color _SuccessForeColor = Color.White; - private Color _SuccessBorderColor = Color.SeaGreen; - private Color _WarningBackColor = Color.FromArgb(255, 128, 0); - private Color _WarningForeColor = Color.White; - private Color _WarningBorderColor = Color.FromArgb(255, 128, 0); - private Color _NoticeBackColor = Color.FromArgb(20, 20, 20); - private Color _NoticeForeColor = Color.White; - private Color _NoticeBorderColor = Color.FromArgb(250, 36, 38); - private string _ErrorTitleText = "ERROR!"; - private string _SuccessTitleText = "SUCCESS!"; - private string _WarningTitleText = "WARNING!"; - private string _NoticeTitleText = "NOTICE!"; - - #endregion - - #region Enums - - // Create a list of Notification Types - public enum Type - { - @Notice, - @Success, - @Warning, - @Error - } - - #endregion - - #region Custom Properties - - // Create a NotificationType property and add the Type enum to it - public Type NotificationType - { - get => _NotificationType; - set - { - _NotificationType = value; - Invalidate(); - } - } - - // Boolean value to determine whether the control should use border radius - public bool RoundCorners - { - get => _RoundedCorners; - set - { - _RoundedCorners = value; - Invalidate(); - } - } - - // Boolean value to determine whether the control should draw the close button - public bool ShowCloseButton - { - get => _ShowCloseButton; - set - { - _ShowCloseButton = value; - Invalidate(); - } - } - - // Integer value to determine the curve level of the borders - public int BorderCurve - { - get => _BorderCurve; - set - { - _BorderCurve = value; - Invalidate(); - } - } - - // Image value to determine whether the control should draw an image before the header - public Image Image - { - get => _Image; - set - { - if (value == null) - { - _ImageSize = Size.Empty; - } - else - { - _ImageSize = value.Size; - } - - _Image = value; - Invalidate(); - } - } - // Size value - returns the image size - protected Size ImageSize => _ImageSize; - - public SmoothingMode SmoothingType - { - get => _SmoothingType; - set - { - _SmoothingType = value; - Invalidate(); - } - } - - public TextRenderingHint TextRenderingType - { - get => _TextRenderingType; - set - { - _TextRenderingType = value; - Invalidate(); - } - } - - public Color CloseForeColor - { - get => _CloseForeColor; - set - { - _CloseForeColor = value; - Invalidate(); - } - } - - public Color ErrorBackColor - { - get => _ErrorBackColor; - set - { - _ErrorBackColor = value; - Invalidate(); - } - } - - public Color ErrorForeColor - { - get => _ErrorForeColor; - set - { - _ErrorForeColor = value; - Invalidate(); - } - } - - public Color ErrorBorderColor - { - get => _ErrorBorderColor; - set - { - _ErrorBorderColor = value; - Invalidate(); - } - } - - public Color SuccessBackColor - { - get => _SuccessBackColor; - set - { - _SuccessBackColor = value; - Invalidate(); - } - } - - public Color SuccessForeColor - { - get => _SuccessForeColor; - set - { - _SuccessForeColor = value; - Invalidate(); - } - } - - public Color SuccessBorderColor - { - get => _SuccessBorderColor; - set - { - _SuccessBorderColor = value; - Invalidate(); - } - } - - public Color WarningBackColor - { - get => _WarningBackColor; - set - { - _WarningBackColor = value; - Invalidate(); - } - } - - public Color WarningForeColor - { - get => _WarningForeColor; - set - { - _WarningForeColor = value; - Invalidate(); - } - } - - public Color WarningBorderColor - { - get => _WarningBorderColor; - set - { - _WarningBorderColor = value; - Invalidate(); - } - } - - public Color NoticeBackColor - { - get => _NoticeBackColor; - set - { - _NoticeBackColor = value; - Invalidate(); - } - } - - public Color NoticeForeColor - { - get => _NoticeForeColor; - set - { - _NoticeForeColor = value; - Invalidate(); - } - } - - public Color NoticeBorderColor - { - get => _NoticeBorderColor; - set - { - _NoticeBorderColor = value; - Invalidate(); - } - } - - public string ErrorTitleText - { - get => _ErrorTitleText; - set - { - _ErrorTitleText = value; - Invalidate(); - } - } - - public string SuccessTitleText - { - get => _SuccessTitleText; - set - { - _SuccessTitleText = value; - Invalidate(); - } - } - - public string WarningTitleText - { - get => _WarningTitleText; - set - { - _WarningTitleText = value; - Invalidate(); - } - } - - public string NoticeTitleText - { - get => _NoticeTitleText; - set - { - _NoticeTitleText = value; - Invalidate(); - } - } - - #endregion - - #region EventArgs - - protected override void OnMouseMove(MouseEventArgs e) - { - base.OnMouseMove(e); - - // Decides the location of the drawn ellipse. If mouse is over the correct coordinates, "IsOverClose" boolean will be triggered to draw the ellipse - if (e.X >= Width - 19 && e.X <= Width - 10 && e.Y > CloseCoordinates.Y && e.Y < CloseCoordinates.Y + 12 && ShowCloseButton) - { - IsOverClose = true; - Cursor = Cursors.Hand; - } - else - { - IsOverClose = false; - Cursor = Cursors.Default; - } - // Updates the control - Invalidate(); - } - protected override void OnMouseDown(MouseEventArgs e) - { - base.OnMouseDown(e); - - // Disposes the control when the close button is clicked - if (_ShowCloseButton == true) - { - if (IsOverClose) - { - Dispose(); - } - } - } - - #endregion - - internal GraphicsPath CreateRoundRect(Rectangle r, int curve) - { - // Draw a border radius - try - { - CreateRoundPath = new(FillMode.Winding); - CreateRoundPath.AddArc(r.X, r.Y, curve, curve, 180.0F, 90.0F); - CreateRoundPath.AddArc(r.Right - curve, r.Y, curve, curve, 270.0F, 90.0F); - CreateRoundPath.AddArc(r.Right - curve, r.Bottom - curve, curve, curve, 0.0F, 90.0F); - CreateRoundPath.AddArc(r.X, r.Bottom - curve, curve, curve, 90.0F, 90.0F); - CreateRoundPath.CloseFigure(); - } - catch (Exception ex) - { - System.Windows.Forms.MessageBox.Show(ex.Message + Environment.NewLine + Environment.NewLine + "Value must be either \'1\' or higher", "Invalid Integer", MessageBoxButtons.OK, MessageBoxIcon.Warning); - // Return to the default border curve if the parameter is less than "1" - _BorderCurve = 8; - BorderCurve = 8; - } - return CreateRoundPath; - } - - public CrEaTiiOn_NotificationBox() - { - SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw, true); - Font = new("Tahoma", 9); - MinimumSize = new(100, 40); - RoundCorners = false; - Size = new(130, 40); - ShowCloseButton = true; - } - - protected override void OnPaint(PaintEventArgs e) - { - base.OnPaint(e); - - // Declare Graphics to draw the control - Graphics GFX = e.Graphics; - // Declare Color to paint the control's Text, Background and Border - Color ForeColor = new(); - Color BackgroundColor = new(); - Color BorderColor = new(); - // Determine the header Notification Type font - Font TypeFont = new(Font.FontFamily, Font.Size, FontStyle.Bold); - // Decalre a new rectangle to draw the control inside it - Rectangle MainRectangle = new(0, 0, Width - 1, Height - 1); - // Declare a GraphicsPath to create a border radius - GraphicsPath CrvBorderPath = CreateRoundRect(MainRectangle, _BorderCurve); - - GFX.SmoothingMode = SmoothingType; - GFX.TextRenderingHint = TextRenderingType; - GFX.Clear(Parent.BackColor); - - switch (_NotificationType) - { - case Type.Notice: - NotificationText = NoticeTitleText; - BackgroundColor = NoticeBackColor; - BorderColor = NoticeBorderColor; - ForeColor = NoticeForeColor; - break; - case Type.Success: - NotificationText = SuccessTitleText; - BackgroundColor = SuccessBackColor; - BorderColor = SuccessBorderColor; - ForeColor = SuccessForeColor; - break; - case Type.Warning: - NotificationText = WarningTitleText; - BackgroundColor = WarningBackColor; - BorderColor = WarningBorderColor; - ForeColor = WarningForeColor; - break; - case Type.Error: - NotificationText = ErrorTitleText; - BackgroundColor = ErrorBackColor; - BorderColor = ErrorBorderColor; - ForeColor = ErrorForeColor; - break; - } - - if (_RoundedCorners) - { - GFX.FillPath(new SolidBrush(BackgroundColor), CrvBorderPath); - GFX.DrawPath(new(BorderColor), CrvBorderPath); - } - else - { - GFX.FillRectangle(new SolidBrush(BackgroundColor), MainRectangle); - GFX.DrawRectangle(new(BorderColor), MainRectangle); - } - - if (Image == null) - { - GFX.DrawString(NotificationText, TypeFont, new SolidBrush(ForeColor), new Point(10, 5)); - GFX.DrawString(Text, Font, new SolidBrush(ForeColor), new Rectangle(10, 21, Width - 17, Height - 5)); - } - else - { - GFX.DrawImage(_Image, 12, 4, 16, 16); - GFX.DrawString(NotificationText, TypeFont, new SolidBrush(ForeColor), new Point(30, 5)); - GFX.DrawString(Text, Font, new SolidBrush(ForeColor), new Rectangle(10, 21, Width - 17, Height - 5)); - } - - CloseCoordinates = new(Width - 26, 4); - - if (_ShowCloseButton) - { - GFX.DrawString("r", new Font("Marlett", 7, FontStyle.Regular), new SolidBrush(CloseForeColor), new Rectangle(Width - 20, 10, Width, Height), new StringFormat() { Alignment = StringAlignment.Near, LineAlignment = StringAlignment.Near }); // Draw the close button - } - - CrvBorderPath.Dispose(); - } - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/Numeric/CrEaTiiOn_Numeric.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/Numeric/CrEaTiiOn_Numeric.cs deleted file mode 100644 index e20df05..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/Numeric/CrEaTiiOn_Numeric.cs +++ /dev/null @@ -1,338 +0,0 @@ -#region Imports - -using System.Drawing.Drawing2D; - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_Numeric - - public class CrEaTiiOn_Numeric : Control - { - #region " Properties & Flicker Control " - private int X; - private int Y; - private long _Value; - private long _Max; - private long _Min; - private bool Typing; - - public long Value - { - get => _Value; - set - { - if (value <= _Max & value >= _Min) - { - _Value = value; - } - - Invalidate(); - } - } - - public long Maximum - { - get => _Max; - set - { - if (value > _Min) - { - _Max = value; - } - - if (_Value > _Max) - { - _Value = _Max; - } - - Invalidate(); - } - } - - public long Minimum - { - get => _Min; - set - { - if (value < _Max) - { - _Min = value; - } - - if (_Value < _Min) - { - _Value = _Min; - } - - Invalidate(); - } - } - protected override void OnMouseMove(MouseEventArgs e) - { - base.OnMouseMove(e); - X = e.Location.X; - Y = e.Location.Y; - Invalidate(); - if (e.X < Width - 23) - { - Cursor = Cursors.Default; - } - else - { - Cursor = Cursors.Hand; - } - } - - protected override void OnResize(EventArgs e) - { - base.OnResize(e); - Height = 30; - } - - protected override void OnMouseDown(MouseEventArgs e) - { - base.OnMouseClick(e); - if (X > Width - 21 && X < Width - 3) - { - if (Y < 15) - { - if ((Value + 1) <= _Max) - { - _Value += 1; - } - } - else - { - if ((Value - 1) >= _Min) - { - _Value -= 1; - } - } - } - else - { - Typing = !Typing; - Focus(); - } - Invalidate(); - } - - protected override void OnKeyPress(KeyPressEventArgs e) - { - base.OnKeyPress(e); - try - { - if (Typing) - { - _Value = Convert.ToInt32(Convert.ToString(Convert.ToString(_Value) + e.KeyChar.ToString())); - } - - if (_Value > _Max) { _Value = _Max; } - - } - catch - { - } - } - - protected override void OnKeyUp(KeyEventArgs e) - { - base.OnKeyUp(e); - if (e.KeyCode == Keys.Up) - { - if ((Value + 1) <= _Max) - { - _Value += 1; - } - - Invalidate(); - } - else if (e.KeyCode == Keys.Down) - { - if ((Value - 1) >= _Min) - { - _Value -= 1; - } - } - else if (e.KeyCode == Keys.Back) - { - string tmp = _Value.ToString(); - tmp = tmp.Remove(Convert.ToInt32(tmp.Length - 1)); - if (tmp.Length == 0) { tmp = "0"; } - _Value = Convert.ToInt32(tmp); - } - Invalidate(); - } - - protected void DrawTriangle(Color Clr, Point FirstPoint, Point SecondPoint, Point ThirdPoint, Graphics G) - { - List points = new() - { - FirstPoint, - SecondPoint, - ThirdPoint - }; - G.FillPolygon(new SolidBrush(Clr), points.ToArray()); - } - #endregion - - #region Variables - private SmoothingMode _SmoothingType = SmoothingMode.HighQuality; - private Color _TopTriangleColor = Color.FromArgb(255, 255, 255); - private Color _BotTriangleColor = Color.FromArgb(255, 255, 255); - private Color _BorderColorA = Color.FromArgb(250, 36, 38); - private Color _BorderColorB = Color.FromArgb(250, 36, 38); - private Color _BorderColorC = Color.FromArgb(250, 36, 38); - private Color _BorderColorD = Color.FromArgb(250, 36, 38); - private Color _ButtonBackColorA = Color.FromArgb(20, 20, 20); - private Color _ButtonBackColorB = Color.FromArgb(15, 15, 15); - private Color _ButtonBorderColorA = Color.FromArgb(250, 36, 38); - private Color _ButtonBorderColorB = Color.FromArgb(250, 36, 38); - private Color _ButtonBorderColorC = Color.FromArgb(250, 36, 38); - private Color _ButtonBorderColorD = Color.FromArgb(250, 36, 38); - private Color _ButtonBorderColorE = Color.FromArgb(250, 36, 38); - #endregion - - #region Settings - public SmoothingMode SmoothingType - { - get => _SmoothingType; - set - { - _SmoothingType = value; - Invalidate(); - } - } - - public Color TopTriangleColor - { - get => _TopTriangleColor; - set => _TopTriangleColor = value; - } - - public Color BotTriangleColor - { - get => _BotTriangleColor; - set => _BotTriangleColor = value; - } - - public Color BorderColorA - { - get => _BorderColorA; - set => _BorderColorA = value; - } - - public Color BorderColorB - { - get => _BorderColorB; - set => _BorderColorB = value; - } - - public Color BorderColorC - { - get => _BorderColorC; - set => _BorderColorC = value; - } - - public Color BorderColorD - { - get => _BorderColorD; - set => _BorderColorD = value; - } - - public Color ButtonBackColorA - { - get => _ButtonBackColorA; - set => _ButtonBackColorA = value; - } - - public Color ButtonBackColorB - { - get => _ButtonBackColorB; - set => _ButtonBackColorB = value; - } - - public Color ButtonBorderColorA - { - get => _ButtonBorderColorA; - set => _ButtonBorderColorA = value; - } - - public Color ButtonBorderColorB - { - get => _ButtonBorderColorB; - set => _ButtonBorderColorB = value; - } - - public Color ButtonBorderColorC - { - get => _ButtonBorderColorC; - set => _ButtonBorderColorC = value; - } - - public Color ButtonBorderColorD - { - get => _ButtonBorderColorD; - set => _ButtonBorderColorD = value; - } - - public Color ButtonBorderColorE - { - get => _ButtonBorderColorE; - set => _ButtonBorderColorE = value; - } - #endregion - - public CrEaTiiOn_Numeric() - { - _Max = 9999999; - _Min = 0; - Cursor = Cursors.IBeam; - SetStyle(ControlStyles.UserPaint | ControlStyles.SupportsTransparentBackColor, true); - BackColor = Color.FromArgb(20, 20, 20); - ForeColor = Color.White; - DoubleBuffered = true; - Font = new("Segoe UI", 6.75f, FontStyle.Bold); - } - - protected override void OnPaint(PaintEventArgs e) - { - Bitmap B = new(Width, Height); - Graphics G = Graphics.FromImage(B); - - G.Clear(BackColor); - G.SmoothingMode = SmoothingType; - - LinearGradientBrush innerBorderBrush = new(new Rectangle(1, 1, Width - 3, Height - 3), BorderColorA, BorderColorB, 90); - Pen innerBorderPen = new(innerBorderBrush); - G.DrawRectangle(innerBorderPen, new Rectangle(1, 1, Width - 3, Height - 3)); - G.DrawLine(new(BorderColorC), new Point(1, 1), new Point(Width - 3, 1)); - - G.DrawRectangle(new(BorderColorD), new Rectangle(0, 0, Width - 1, Height - 1)); - - LinearGradientBrush buttonGradient = new(new Rectangle(Width - 23, 4, 19, 21), ButtonBackColorA, ButtonBackColorB, 90); - G.FillRectangle(buttonGradient, buttonGradient.Rectangle); - G.DrawRectangle(new(ButtonBorderColorA), new Rectangle(Width - 22, 5, 17, 19)); - G.DrawRectangle(new(ButtonBorderColorB), new Rectangle(Width - 23, 4, 19, 21)); - G.DrawLine(new(ButtonBorderColorC), new Point(Width - 22, Height - 4), new Point(Width - 5, Height - 4)); - G.DrawLine(new(ButtonBorderColorD), new Point(Width - 22, Height - 16), new Point(Width - 5, Height - 16)); - G.DrawLine(new(ButtonBorderColorE), new Point(Width - 22, Height - 15), new Point(Width - 5, Height - 15)); - - //Top Triangle - DrawTriangle(TopTriangleColor, new Point(Width - 17, 18), new Point(Width - 9, 18), new Point(Width - 13, 21), G); - - //Bottom Triangle - DrawTriangle(BotTriangleColor, new Point(Width - 17, 10), new Point(Width - 9, 10), new Point(Width - 13, 7), G); - - G.DrawString(Value.ToString(), Font, new SolidBrush(ForeColor), new Rectangle(5, 0, Width - 1, Height - 1), new StringFormat { LineAlignment = StringAlignment.Center }); - - e.Graphics.DrawImage(B, 0, 0); - G.Dispose(); - B.Dispose(); - } - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/Palette/CrEaTiiOn_ColorPalette.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/Palette/CrEaTiiOn_ColorPalette.cs deleted file mode 100644 index 1b1ba26..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/Palette/CrEaTiiOn_ColorPalette.cs +++ /dev/null @@ -1,390 +0,0 @@ -#region Imports - -using System.ComponentModel; - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_ColorPalette - - public class CrEaTiiOn_ColorPalette : Control - { - public CrEaTiiOn_ColorPalette() - { - base.Size = new Size(175, 50); - Increment = base.Width / 7; - Cursor = Cursors.Hand; - } - - [Browsable(false)] - [EditorBrowsable(EditorBrowsableState.Never)] - public new Color BackColor { get; set; } - - [Browsable(false)] - [EditorBrowsable(EditorBrowsableState.Never)] - public new Color ForeColor { get; set; } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The selected color")] - public Color SelectedColor - { - get => selectedColor; - set - { - selectedColor = value; - OnColorChange(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The color of the grid")] - public Color GridColor - { - get => gridColor; - set - { - gridColor = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("Show gridlines")] - public bool ShowGrid - { - get => showGrid; - set - { - showGrid = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("Color 1")] - public Color Color1 - { - get => color1; - set - { - color1 = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("Color 2")] - public Color Color2 - { - get => color2; - set - { - color2 = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("Color 3")] - public Color Color3 - { - get => color3; - set - { - color3 = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("Color 4")] - public Color Color4 - { - get => color4; - set - { - color4 = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("Color 5")] - public Color Color5 - { - get => color5; - set - { - color5 = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("Color 6")] - public Color Color6 - { - get => color6; - set - { - color6 = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("Color 7")] - public Color Color7 - { - get => color7; - set - { - color7 = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("Color 8")] - public Color Color8 - { - get => color8; - set - { - color8 = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("Color 9")] - public Color Color9 - { - get => color9; - set - { - color9 = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("Color 10")] - public Color Color10 - { - get => color10; - set - { - color10 = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("Color 11")] - public Color Color11 - { - get => color11; - set - { - color11 = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("Color 12")] - public Color Color12 - { - get => color12; - set - { - color12 = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("Color 13")] - public Color Color13 - { - get => color13; - set - { - color13 = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("Color 14")] - public Color Color14 - { - get => color14; - set - { - color14 = value; - base.Invalidate(); - } - } - - protected override void OnMouseDown(MouseEventArgs e) - { - base.OnMouseDown(e); - if (e.X > 0 && e.Y < base.Height) - { - selectedColor = color2; - } - if (e.X > 0 && e.Y < base.Height / 2) - { - selectedColor = color1; - } - if (e.X > Increment && e.Y < base.Height) - { - selectedColor = color4; - } - if (e.X > Increment && e.Y < base.Height / 2) - { - selectedColor = color3; - } - if (e.X > Increment * 2 && e.Y < base.Height) - { - selectedColor = color6; - } - if (e.X > Increment * 2 && e.Y < base.Height / 2) - { - selectedColor = color5; - } - if (e.X > Increment * 3 && e.Y < base.Height) - { - selectedColor = color8; - } - if (e.X > Increment * 3 && e.Y < base.Height / 2) - { - selectedColor = color7; - } - if (e.X > Increment * 4 && e.Y < base.Height) - { - selectedColor = color10; - } - if (e.X > Increment * 4 && e.Y < base.Height / 2) - { - selectedColor = color9; - } - if (e.X > Increment * 5 && e.Y < base.Height) - { - selectedColor = color12; - } - if (e.X > Increment * 5 && e.Y < base.Height / 2) - { - selectedColor = color11; - } - if (e.X > Increment * 6 && e.Y < base.Height) - { - selectedColor = color14; - } - if (e.X > Increment * 6 && e.Y < base.Height / 2) - { - selectedColor = color13; - } - OnColorChange(); - } - - public event EventHandler ColorChanged; - - protected virtual void OnColorChange() - { - ColorChanged?.Invoke(this, EventArgs.Empty); - } - - protected override void OnPaint(PaintEventArgs e) - { - base.OnPaint(e); - - Increment = base.Width / 7; - - e.Graphics.FillRectangle(new SolidBrush(color1), 0, 0, Increment, base.Height / 2); - e.Graphics.FillRectangle(new SolidBrush(color2), 0, base.Height / 2, Increment, base.Height); - e.Graphics.FillRectangle(new SolidBrush(color3), Increment, 0, Increment, base.Height / 2); - e.Graphics.FillRectangle(new SolidBrush(color4), Increment, base.Height / 2, Increment, base.Height); - e.Graphics.FillRectangle(new SolidBrush(color5), Increment * 2, 0, Increment, base.Height / 2); - e.Graphics.FillRectangle(new SolidBrush(color6), Increment * 2, base.Height / 2, Increment, base.Height); - e.Graphics.FillRectangle(new SolidBrush(color7), Increment * 3, 0, Increment, base.Height / 2); - e.Graphics.FillRectangle(new SolidBrush(color8), Increment * 3, base.Height / 2, Increment, base.Height); - e.Graphics.FillRectangle(new SolidBrush(color9), Increment * 4, 0, Increment, base.Height / 2); - e.Graphics.FillRectangle(new SolidBrush(color10), Increment * 4, base.Height / 2, Increment, base.Height); - e.Graphics.FillRectangle(new SolidBrush(color11), Increment * 5, 0, Increment, base.Height / 2); - e.Graphics.FillRectangle(new SolidBrush(color12), Increment * 5, base.Height / 2, Increment, base.Height); - e.Graphics.FillRectangle(new SolidBrush(color13), Increment * 6, 0, Increment, base.Height / 2); - e.Graphics.FillRectangle(new SolidBrush(color14), Increment * 6, base.Height / 2, Increment, base.Height); - - if (showGrid) - { - e.Graphics.DrawRectangle(new Pen(gridColor, 1f), 0, 0, Increment * 7 - 1, base.Height - 1); - e.Graphics.DrawLine(new Pen(gridColor, 1f), Increment, 0, Increment, base.Height); - e.Graphics.DrawLine(new Pen(gridColor, 1f), Increment * 2, 0, Increment * 2, base.Height); - e.Graphics.DrawLine(new Pen(gridColor, 1f), Increment * 3, 0, Increment * 3, base.Height); - e.Graphics.DrawLine(new Pen(gridColor, 1f), Increment * 4, 0, Increment * 4, base.Height); - e.Graphics.DrawLine(new Pen(gridColor, 1f), Increment * 5, 0, Increment * 5, base.Height); - e.Graphics.DrawLine(new Pen(gridColor, 1f), Increment * 6, 0, Increment * 6, base.Height); - e.Graphics.DrawLine(new Pen(gridColor, 1f), 0, base.Height / 2, Increment * 7 - 1, base.Height / 2); - } - } - - private int Increment; - - private Color selectedColor; - - private Color gridColor = Color.FromArgb(15, 15, 15); - - private bool showGrid = true; - - private Color color1 = Color.FromArgb(30, 33, 38); - - private Color color2 = Color.FromArgb(37, 40, 49); - - private Color color3 = Color.FromArgb(24, 11, 56); - - private Color color4 = Color.FromArgb(48, 36, 76); - - private Color color5 = Color.FromArgb(1, 119, 215); - - private Color color6 = Color.FromArgb(26, 169, 219); - - private Color color7 = Color.FromArgb(24, 202, 142); - - private Color color8 = Color.FromArgb(102, 217, 174); - - private Color color9 = Color.FromArgb(230, 71, 89); - - private Color color10 = Color.FromArgb(234, 129, 136); - - private Color color11 = Color.FromArgb(159, 133, 255); - - private Color color12 = Color.FromArgb(188, 170, 252); - - private Color color13 = Color.FromArgb(228, 216, 54); - - private Color color14 = Color.FromArgb(235, 227, 120); - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/Panel/CrEaTiiOn_FlatPanel.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/Panel/CrEaTiiOn_FlatPanel.cs deleted file mode 100644 index aad8403..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/Panel/CrEaTiiOn_FlatPanel.cs +++ /dev/null @@ -1,123 +0,0 @@ -#region Imports -using System.ComponentModel; -using System.Drawing.Drawing2D; -#endregion - -namespace CBH.Controls -{ - public class CrEaTiiOn_FlatPanel : Panel - { - private int borderSize = 0; - private int borderRadius = 6; - private Color borderColor = Color.FromArgb(250, 36, 38); - - public CrEaTiiOn_FlatPanel() - { - this.Size = new Size(150, 40); - this.BackColor = Color.Transparent; - this.ForeColor = Color.White; - this.Resize += new EventHandler(this.Panel_Resize); - } - - private void Panel_Resize(object sender, EventArgs e) - { - if (this.borderRadius <= this.Height) - return; - this.borderRadius = this.Height; - } - - private GraphicsPath GetFigurePath(Rectangle rect, float radius) - { - GraphicsPath figurePath = new GraphicsPath(); - float num = radius * 2f; - figurePath.StartFigure(); - figurePath.AddArc((float)rect.X, (float)rect.Y, num, num, 180f, 90f); - figurePath.AddArc((float)rect.Right - num, (float)rect.Y, num, num, 270f, 90f); - figurePath.AddArc((float)rect.Right - num, (float)rect.Bottom - num, num, num, 0.0f, 90f); - figurePath.AddArc((float)rect.X, (float)rect.Bottom - num, num, num, 90f, 90f); - figurePath.CloseFigure(); - return figurePath; - } - - protected override void OnPaint(PaintEventArgs pevent) - { - base.OnPaint(pevent); - Rectangle clientRectangle = this.ClientRectangle; - Rectangle rect = Rectangle.Inflate(clientRectangle, -this.borderSize, -this.borderSize); - int width = 2; - if (this.borderSize > 0) - width = this.borderSize; - if (this.borderRadius > 2) - { - using (GraphicsPath figurePath1 = this.GetFigurePath(clientRectangle, (float)this.borderRadius)) - { - using (GraphicsPath figurePath2 = this.GetFigurePath(rect, (float)(this.borderRadius - this.borderSize))) - { - using (Pen pen1 = new Pen(this.Parent.BackColor, (float)width)) - { - using (Pen pen2 = new Pen(this.borderColor, (float)this.borderSize)) - { - pevent.Graphics.SmoothingMode = SmoothingMode.AntiAlias; - this.Region = new Region(figurePath1); - pevent.Graphics.DrawPath(pen1, figurePath1); - if (this.borderSize < 1) - return; - pevent.Graphics.DrawPath(pen2, figurePath2); - } - } - } - } - } - else - { - pevent.Graphics.SmoothingMode = SmoothingMode.None; - this.Region = new Region(clientRectangle); - if (this.borderSize >= 1) - { - using (Pen pen = new Pen(this.borderColor, (float)this.borderSize)) - { - pen.Alignment = PenAlignment.Inset; - pevent.Graphics.DrawRectangle(pen, 0, 0, this.Width - 1, this.Height - 1); - } - } - } - } - - [Category("Sipaa")] - public int BorderSize - { - get => this.borderSize; - set - { - this.borderSize = value; - this.Invalidate(); - } - } - - [Category("Sipaa")] - public int BorderRadius - { - get => this.borderRadius; - set - { - this.borderRadius = value; - this.Invalidate(); - } - } - - protected override void OnHandleCreated(EventArgs e) => base.OnHandleCreated(e); - - private void Container_BackColorChanged(object sender, EventArgs e) => this.Invalidate(); - - [Category("Sipaa")] - public Color BorderColor - { - get => this.borderColor; - set - { - this.borderColor = value; - this.Invalidate(); - } - } - } -} diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/Panel/CrEaTiiOn_ModernPanel.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/Panel/CrEaTiiOn_ModernPanel.cs deleted file mode 100644 index 487020f..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/Panel/CrEaTiiOn_ModernPanel.cs +++ /dev/null @@ -1,95 +0,0 @@ -#region Imports - -using System.ComponentModel; - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_ModernPanel - - public class CrEaTiiOn_ModernPanel : System.Windows.Forms.Panel - { - #region Enum - - public enum PanelSide - { - Left, - Right - } - - #endregion - - #region Properties - - [Browsable(false)] - [Description("The background color of the component.")] - public override Color BackColor { get; set; } - - private PanelSide _Side = PanelSide.Left; - public PanelSide Side - { - get => _Side; - set - { - _Side = value; - if (_Side == PanelSide.Left) - { - BackColor = LeftSideColor; - } - else - { - BackColor = RightSideColor; - } - - Invalidate(); - } - } - - private Color _LeftSideColor = ColorTranslator.FromHtml("#F25D59"); - public Color LeftSideColor - { - get => _LeftSideColor; - set - { - _LeftSideColor = value; - Invalidate(); - } - } - - private Color _RightSideColor = ColorTranslator.FromHtml("#292C3D"); - public Color RightSideColor - { - get => _RightSideColor; - set - { - _RightSideColor = value; - Invalidate(); - } - } - - #endregion - - protected override void OnClick(EventArgs e) - { - Focus(); - base.OnClick(e); - } - - public CrEaTiiOn_ModernPanel() - { - DoubleBuffered = true; - - SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.UserPaint, true); - - UpdateStyles(); - - ForeColor = ColorTranslator.FromHtml("#FFFFFF"); - BackColor = Color.Transparent; - - BorderStyle = BorderStyle.None; - } - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/Panel/CrEaTiiOn_Panel.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/Panel/CrEaTiiOn_Panel.cs deleted file mode 100644 index 9b4814c..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/Panel/CrEaTiiOn_Panel.cs +++ /dev/null @@ -1,79 +0,0 @@ -#region Imports - -using System.Drawing.Drawing2D; - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_Panel - - public class CrEaTiiOn_Panel : ContainerControl - { - private GraphicsPath Shape; - - private SmoothingMode _SmoothingType = SmoothingMode.HighQuality; - public SmoothingMode SmoothingType - { - get => _SmoothingType; - set - { - _SmoothingType = value; - Invalidate(); - } - } - - private Color _EdgeColor = Color.Transparent; - public Color EdgeColor - { - get => _EdgeColor; - set - { - _EdgeColor = value; - Invalidate(); - } - } - - public CrEaTiiOn_Panel() - { - SetStyle(ControlStyles.SupportsTransparentBackColor, true); - SetStyle(ControlStyles.UserPaint, true); - - BackColor = Color.Transparent; - Size = new(187, 117); - Padding = new Padding(5, 5, 5, 5); - DoubleBuffered = true; - } - - protected override void OnResize(EventArgs e) - { - base.OnResize(e); - - Shape = new(); - Shape.AddArc(0, 0, 10, 10, 180, 90); - Shape.AddArc(Width - 11, 0, 10, 10, -90, 90); - Shape.AddArc(Width - 11, Height - 11, 10, 10, 0, 90); - Shape.AddArc(0, Height - 11, 10, 10, 90, 90); - Shape.CloseAllFigures(); - } - - protected override void OnPaint(PaintEventArgs e) - { - base.OnPaint(e); - Bitmap B = new(Width, Height); - Graphics G = Graphics.FromImage(B); - - G.SmoothingMode = SmoothingType; - - G.Clear(EdgeColor); // Set control background to transparent - G.FillPath(new SolidBrush(BackColor), Shape); // Draw RTB background - G.DrawPath(new(BackColor), Shape); // Draw border - - G.Dispose(); - e.Graphics.DrawImage((Image)(B.Clone()), 0, 0); - B.Dispose(); - } - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/Panel/CrEaTiiOn_WidgetPanel.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/Panel/CrEaTiiOn_WidgetPanel.cs deleted file mode 100644 index 821d038..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/Panel/CrEaTiiOn_WidgetPanel.cs +++ /dev/null @@ -1,61 +0,0 @@ -#region Imports - -using System.ComponentModel; - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_WidgetPanel - - public class CrEaTiiOn_WidgetPanel : System.Windows.Forms.Panel - { - protected override void OnControlAdded(ControlEventArgs e) - { - base.OnControlAdded(e); - if (!ControlsAsWidgets) - { - foreach (object obj in base.Controls) - { - Control control = (Control)obj; - control.MouseDown += WidgetDown; - control.MouseUp += WidgetUp; - control.MouseMove += WidgetMove; - } - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("Reat controls as widgets")] - public bool ControlsAsWidgets - { - get => controlsAsWidgets; - set => controlsAsWidgets = value; - } - - private void WidgetDown(object sender, MouseEventArgs e) - { - isDragging = true; - } - - private void WidgetUp(object sender, MouseEventArgs e) - { - isDragging = false; - } - - private void WidgetMove(object sender, MouseEventArgs e) - { - if (isDragging) - { - ((Control)sender).Location = new Point(e.X, e.Y); - } - } - - private bool controlsAsWidgets; - - private bool isDragging; - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/Picker/CrEaTiiOn_ColorPicker.Designer.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/Picker/CrEaTiiOn_ColorPicker.Designer.cs deleted file mode 100644 index d76c09d..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/Picker/CrEaTiiOn_ColorPicker.Designer.cs +++ /dev/null @@ -1,133 +0,0 @@ -namespace CBH.Controls -{ - partial class CrEaTiiOn_ColorPicker - { - /// - /// Обязательная переменная конструктора. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Освободить все используемые ресурсы. - /// - /// истинно, если управляемый ресурс должен быть удален; иначе ложно. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Код, автоматически созданный конструктором компонентов - - /// - /// Требуемый метод для поддержки конструктора — не изменяйте - /// содержимое этого метода с помощью редактора кода. - /// - private void InitializeComponent() - { - this.pictureBox1 = new System.Windows.Forms.PictureBox(); - this.pictureBox2 = new System.Windows.Forms.PictureBox(); - this.label1 = new System.Windows.Forms.Label(); - this.pictureBox3 = new System.Windows.Forms.PictureBox(); - this.label2 = new System.Windows.Forms.Label(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).BeginInit(); - this.SuspendLayout(); - // - // pictureBox1 - // - this.pictureBox1.Location = new System.Drawing.Point(4, 3); - this.pictureBox1.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.pictureBox1.Name = "pictureBox1"; - this.pictureBox1.Size = new System.Drawing.Size(175, 173); - this.pictureBox1.TabIndex = 8; - this.pictureBox1.TabStop = false; - this.pictureBox1.Click += new System.EventHandler(this.pictureBox1_Click_1); - this.pictureBox1.Paint += new System.Windows.Forms.PaintEventHandler(this.pictureBox1_Paint); - this.pictureBox1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pictureBox1_MouseDown); - this.pictureBox1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pictureBox1_MouseMove); - this.pictureBox1.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pictureBox1_MouseUp); - // - // pictureBox2 - // - this.pictureBox2.Location = new System.Drawing.Point(192, 134); - this.pictureBox2.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.pictureBox2.Name = "pictureBox2"; - this.pictureBox2.Size = new System.Drawing.Size(20, 43); - this.pictureBox2.TabIndex = 9; - this.pictureBox2.TabStop = false; - // - // label1 - // - this.label1.AutoSize = true; - this.label1.BackColor = System.Drawing.Color.Transparent; - this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - this.label1.ForeColor = System.Drawing.Color.WhiteSmoke; - this.label1.Location = new System.Drawing.Point(55, 187); - this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(72, 16); - this.label1.TabIndex = 12; - this.label1.Text = "RGB: none"; - // - // pictureBox3 - // - this.pictureBox3.Location = new System.Drawing.Point(192, 3); - this.pictureBox3.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.pictureBox3.Name = "pictureBox3"; - this.pictureBox3.Size = new System.Drawing.Size(20, 123); - this.pictureBox3.TabIndex = 13; - this.pictureBox3.TabStop = false; - this.pictureBox3.Paint += new System.Windows.Forms.PaintEventHandler(this.pictureBox3_Paint); - this.pictureBox3.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pictureBox3_MouseDown); - this.pictureBox3.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pictureBox3_MouseMove); - this.pictureBox3.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pictureBox3_MouseUp); - // - // label2 - // - this.label2.AutoSize = true; - this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - this.label2.ForeColor = System.Drawing.Color.WhiteSmoke; - this.label2.Location = new System.Drawing.Point(55, 210); - this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(70, 16); - this.label2.TabIndex = 16; - this.label2.Text = "HEX: none"; - // - // ColorPicker - // - this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.BackColor = System.Drawing.Color.Transparent; - this.Controls.Add(this.label2); - this.Controls.Add(this.pictureBox3); - this.Controls.Add(this.label1); - this.Controls.Add(this.pictureBox2); - this.Controls.Add(this.pictureBox1); - this.ForeColor = System.Drawing.Color.Black; - this.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.Name = "ColorPicker"; - this.Size = new System.Drawing.Size(216, 242); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).EndInit(); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.PictureBox pictureBox1; - private System.Windows.Forms.PictureBox pictureBox2; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.PictureBox pictureBox3; - private System.Windows.Forms.Label label2; - private System.EventHandler pictureBox1_Click; - } -} diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/Picker/CrEaTiiOn_ColorPicker.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/Picker/CrEaTiiOn_ColorPicker.cs deleted file mode 100644 index 1118a63..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/Picker/CrEaTiiOn_ColorPicker.cs +++ /dev/null @@ -1,247 +0,0 @@ -#region Imports -using System; -using System.ComponentModel; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Windows.Forms; -#endregion - -namespace CBH.Controls -{ - public partial class CrEaTiiOn_ColorPicker : UserControl - { - #region ПЕРЕМЕННЫЕ - private class ValueBox - { - public float Value = 1F; - public Color Color = Color.White; - } - private bool ValueBoxMD; - private PointF CursorPos; - private bool ColorPickerMD; - #endregion - - #region НАСТРОЙКИ - public delegate void EventHandler(Color color); - [Category("FC_UI")] - [Description("Событие возникает, когда в Control изменяется значение свойства Text.")] - public event EventHandler ColorChanged = delegate { }; - - private Color tmp_selectedcolor; - [Category("CrEaTiiOn")] - [Description("Выбранный цвет")] - public Color SelectedColor - { - get => tmp_selectedcolor; - set - { - tmp_selectedcolor = value; - ColorChanged(value); - } - } - #endregion - - #region ЗАГРУЗКА - public CrEaTiiOn_ColorPicker() - { - InitializeComponent(); - - Tag = "FC_UI"; - pictureBox1.Tag = new PointF((float)pictureBox1.Width / 2, (float)pictureBox1.Height / 2); - pictureBox3.Tag = new ValueBox(); - - Bitmap Wheel = new Bitmap(pictureBox1.Width, pictureBox1.Height); - Graphics g = Graphics.FromImage(Wheel); - g.InterpolationMode = InterpolationMode.HighQualityBicubic; - g.SmoothingMode = SmoothingMode.AntiAlias; - DrawWheel((float)Wheel.Width / 2, g); - pictureBox1.Image = Wheel; - CursorPos = new PointF((float)pictureBox1.Height / 2, (float)pictureBox1.Height / 2); - } - #endregion - - #region СОБЫТИЯ - private void pictureBox1_MouseDown(object sender, MouseEventArgs e) - { - ColorPickerMD = true; - PickColor(e.X, e.Y); - } - private void pictureBox1_MouseMove(object sender, MouseEventArgs e) - { - if (ColorPickerMD) PickColor(e.X, e.Y); - } - private void pictureBox1_MouseUp(object sender, MouseEventArgs e) - { - ColorPickerMD = false; - PickColor(e.X, e.Y); - } - private void pictureBox1_Paint(object sender, PaintEventArgs e) - { - e.Graphics.SmoothingMode = SmoothingMode.AntiAlias; - e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic; - e.Graphics.DrawEllipse(new Pen(Color.DarkGray, 1F), CursorPos.X - 4, CursorPos.Y - 4, 8, 8); - } - private void pictureBox3_Paint(object sender, PaintEventArgs e) - { - LinearGradientBrush Brush = new LinearGradientBrush(new Point(0, 0), new Point(0, pictureBox3.Height), ((ValueBox)pictureBox3.Tag).Color, Color.Black); - e.Graphics.FillRectangle(Brush, pictureBox3.ClientRectangle); - e.Graphics.FillRectangle(new SolidBrush(Color.DarkGray), 0, pictureBox3.Height * (1 - ((ValueBox)pictureBox3.Tag).Value) - 2, pictureBox3.Width, 4); - } - private void pictureBox3_MouseDown(object sender, MouseEventArgs e) - { - ValueBoxMD = true; - if (e.Y > pictureBox3.Height || e.Y < 0) return; - ((ValueBox)pictureBox3.Tag).Value = (float)(pictureBox3.Height - e.Y) / pictureBox3.Height; - PickColor(((PointF)pictureBox1.Tag).X, ((PointF)pictureBox1.Tag).Y); - } - private void pictureBox3_MouseMove(object sender, MouseEventArgs e) - { - if (ValueBoxMD) - { - if (e.Y > pictureBox3.Height || e.Y < 0) return; - ((ValueBox)pictureBox3.Tag).Value = (float)(pictureBox3.Height - e.Y) / pictureBox3.Height; - PickColor(((PointF)pictureBox1.Tag).X, ((PointF)pictureBox1.Tag).Y); - } - } - private void pictureBox3_MouseUp(object sender, MouseEventArgs e) => ValueBoxMD = false; - #endregion - - #region МЕТОДЫ РИСОВАНИЯ - private void DrawWheel(float radius, Graphics graphics) - { - GraphicsPath FillPath = new GraphicsPath(); - FillPath.AddEllipse(0, 0, radius * 2, radius * 2); - FillPath.Flatten(); - - GraphicsPath BrushPath = new GraphicsPath(); - BrushPath.AddEllipse(-1, -1, radius * 2 + 2, radius * 2 + 2); - BrushPath.Flatten(); - - graphics.FillPath(GetBrush(BrushPath), FillPath); - } - private Brush GetBrush(GraphicsPath graphicsPath) - { - PathGradientBrush Brush = new PathGradientBrush(graphicsPath) { CenterColor = Color.White }; - - Color[] Colors = new Color[graphicsPath.PointCount]; - for (int Angle = 0; Angle < Colors.Length; Angle++) - { - Colors[Angle] = HSVtoRGB((float)Angle / Colors.Length, 1, 1); - } - Brush.SurroundColors = Colors; - - return Brush; - } - private Color GetPixelColor(float x, float y, float value, float radius) - { - float R = (float)Math.Sqrt(Math.Pow(x, 2) + Math.Pow(y, 2)); - float S = (float)(R / radius); - if (S > 1) return Color.Transparent; - - double Angle; - if (x > 0 && y > 0) Angle = Math.Asin(y / R); - else if (x <= 0 && y > 0) Angle = Math.Acos(y / R) + Math.PI / 2; - else if (x <= 0 && y <= 0) Angle = Math.Asin(-y / R) + Math.PI; - else Angle = Math.Acos(-y / R) + 3 * Math.PI / 2; - float H = (float)(Angle / Math.PI / 2); - - return HSVtoRGB(H, S, value); - } - private Color PickColor(float x, float y) - { - float x1 = x - (float)pictureBox1.Width / 2; - float y1 = y - (float)pictureBox1.Height / 2; - float Radius = (float)Math.Sqrt(Math.Pow(x1, 2) + Math.Pow(y1, 2)); - if (Radius > (float)pictureBox1.Width / 2) - { - float mult = (float)pictureBox1.Width / 2 / Radius; - x1 *= mult; - y1 *= mult; - } - Color Color = GetPixelColor(x1, y1, ((ValueBox)pictureBox3.Tag).Value, (float)pictureBox1.Width / 2); - if (Color == Color.Transparent) return Color.Empty; - - label1.Text = $"RGB: {Color.R}, {Color.G}, {Color.B}"; - label2.Text = $"HEX: #{Color.ToArgb():X}"; - CursorPos = new PointF(x1 + (float)pictureBox1.Width / 2, y1 + (float)pictureBox1.Height / 2); - pictureBox2.BackColor = Color; - ((ValueBox)pictureBox3.Tag).Color = Color; - pictureBox1.Tag = new PointF(x, y); - pictureBox1.Invalidate(); - pictureBox2.Invalidate(); - pictureBox3.Invalidate(); - - SelectedColor = Color; - return Color; - } - - private Color HSVtoRGB(double H, double S, double V) - { - double R, G, B; - if (S == 0) - { - R = V * 255; - G = V * 255; - B = V * 255; - } - else - { - double H1 = H * 6; - if (H1 == 6) H1 = 0; - - int i = (int)Math.Floor(H1); - - double i1 = V * (1 - S); - double i2 = V * (1 - S * (H1 - i)); - double i3 = V * (1 - S * (1 - (H1 - i))); - - switch (i) - { - case 0: - R = V; - G = i3; - B = i1; - break; - case 1: - R = i2; - G = V; - B = i1; - break; - case 2: - R = i1; - G = V; - B = i3; - break; - case 3: - R = i1; - G = i2; - B = V; - break; - case 4: - R = i3; - G = i1; - B = V; - break; - default: - R = V; - G = i1; - B = i2; - break; - } - - R *= 255; - G *= 255; - B *= 255; - } - return Color.FromArgb((int)R, (int)G, (int)B); - } - #endregion - - #region Click - private void pictureBox1_Click_1(object sender, EventArgs e) - { - - } - #endregion - } -} diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/Picker/CrEaTiiOn_ColorPicker.resx b/CBH-Ultimate-Theme-Library/Theme/Controls/Picker/CrEaTiiOn_ColorPicker.resx deleted file mode 100644 index f298a7b..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/Picker/CrEaTiiOn_ColorPicker.resx +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/PictureBox/CrEaTiiOn_CircularPictureBox.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/PictureBox/CrEaTiiOn_CircularPictureBox.cs deleted file mode 100644 index eb38188..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/PictureBox/CrEaTiiOn_CircularPictureBox.cs +++ /dev/null @@ -1,127 +0,0 @@ -#region Imports -using System.ComponentModel; -using System.Drawing.Drawing2D; -#endregion - -namespace CBH.Controls -{ - internal class CrEaTiiOn_CircularPictureBox : CrEaTiiOn_Ultimate_PictureBox - { - private int borderSize = 2; - private Color borderColor = Color.RoyalBlue; - private Color borderColor2 = Color.HotPink; - private DashStyle borderLineStyle = DashStyle.Solid; - private DashCap borderCapStyle = DashCap.Flat; - private float gradientAngle = 50f; - - public CrEaTiiOn_CircularPictureBox() - { - this.Size = new Size(100, 100); - this.SizeMode = PictureBoxSizeMode.StretchImage; - } - - [Category("Sipaa")] - public int BorderSize - { - get => this.borderSize; - set - { - this.borderSize = value; - this.Invalidate(); - } - } - - [Category("Sipaa")] - public Color BorderColor - { - get => this.borderColor; - set - { - this.borderColor = value; - this.Invalidate(); - } - } - - [Category("Sipaa")] - public Color BorderColor2 - { - get => this.borderColor2; - set - { - this.borderColor2 = value; - this.Invalidate(); - } - } - - [Category("Sipaa")] - public DashStyle BorderLineStyle - { - get => this.borderLineStyle; - set - { - this.borderLineStyle = value; - this.Invalidate(); - } - } - - [Category("Sipaa")] - public DashCap BorderCapStyle - { - get => this.borderCapStyle; - set - { - this.borderCapStyle = value; - this.Invalidate(); - } - } - - [Category("Sipaa")] - public float GradientAngle - { - get => this.gradientAngle; - set - { - this.gradientAngle = value; - this.Invalidate(); - } - } - - public PictureBoxSizeMode SizeMode { get; private set; } - - protected override void OnResize(EventArgs e) - { - base.OnResize(e); - this.Size = new Size(this.Width, this.Width); - } - - protected override void OnPaint(PaintEventArgs pe) - { - base.OnPaint(pe); - Graphics graphics = pe.Graphics; - Rectangle rect1 = Rectangle.Inflate(this.ClientRectangle, -1, -1); - Rectangle rect2 = Rectangle.Inflate(rect1, -this.borderSize, -this.borderSize); - int width = this.borderSize > 0 ? this.borderSize * 3 : 1; - using (LinearGradientBrush linearGradientBrush = new LinearGradientBrush(rect2, this.borderColor, this.borderColor2, this.gradientAngle)) - { - using (GraphicsPath path = new GraphicsPath()) - { - using (Pen pen1 = new Pen(this.Parent.BackColor, (float)width)) - { - using (Pen pen2 = new Pen((Brush)linearGradientBrush, (float)this.borderSize)) - { - graphics.SmoothingMode = SmoothingMode.AntiAlias; - pen2.DashStyle = this.borderLineStyle; - pen2.DashCap = this.borderCapStyle; - path.AddEllipse(rect1); - this.Region = new Region(path); - graphics.DrawEllipse(pen1, rect1); - if (this.borderSize <= 0) - return; - graphics.DrawEllipse(pen2, rect2); - } - } - } - } - } - } -} diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/PictureBox/CrEaTiiOn_ModernPictureBox.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/PictureBox/CrEaTiiOn_ModernPictureBox.cs deleted file mode 100644 index 9de9280..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/PictureBox/CrEaTiiOn_ModernPictureBox.cs +++ /dev/null @@ -1,129 +0,0 @@ -#region Imports -using System.ComponentModel; -using System.Drawing.Drawing2D; -using CBH.RJControls; -#endregion - -namespace CBH.Controls -{ - class CrEaTiiOn_ModernPictureBox : CrEaTiiOn_Ultimate_PictureBox - { - //Fields - private int borderSize = 2; - private Color borderColor = Color.FromArgb(250, 36, 38); - private Color borderColor2 = Color.FromArgb(250, 36, 38); - private DashStyle borderLineStyle = DashStyle.Solid; - private DashCap borderCapStyle = DashCap.Flat; - private float gradientAngle = 50F; - - //Constructor - public CrEaTiiOn_ModernPictureBox() - { - this.Size = new Size(100, 100); - this.SizeMode = PictureBoxSizeMode.StretchImage; - } - - //Properties - [Category("RJ Code Advance")] - public int BorderSize - { - get { return borderSize; } - set - { - borderSize = value; - this.Invalidate(); - } - } - - [Category("RJ Code Advance")] - public Color BorderColor - { - get { return borderColor; } - set - { - borderColor = value; - this.Invalidate(); - } - } - - [Category("RJ Code Advance")] - public Color BorderColor2 - { - get { return borderColor2; } - set - { - borderColor2 = value; - this.Invalidate(); - } - } - - [Category("RJ Code Advance")] - public DashStyle BorderLineStyle - { - get { return borderLineStyle; } - set - { - borderLineStyle = value; - this.Invalidate(); - } - } - - [Category("RJ Code Advance")] - public DashCap BorderCapStyle - { - get { return borderCapStyle; } - set - { - borderCapStyle = value; - this.Invalidate(); - } - } - - [Category("RJ Code Advance")] - public float GradientAngle - { - get { return gradientAngle; } - set - { - gradientAngle = value; - this.Invalidate(); - } - } - - public PictureBoxSizeMode SizeMode { get; private set; } - - //Overridden methods - protected override void OnResize(EventArgs e) - { - base.OnResize(e); - this.Size = new Size(this.Width, this.Width); - } - - protected override void OnPaint(PaintEventArgs pe) - { - base.OnPaint(pe); - //Fields - var graph = pe.Graphics; - var rectContourSmooth = Rectangle.Inflate(this.ClientRectangle, -1, -1); - var rectBorder = Rectangle.Inflate(rectContourSmooth, -borderSize, -borderSize); - var smoothSize = borderSize > 0 ? borderSize * 3 : 1; - using (var borderGColor = new LinearGradientBrush(rectBorder, borderColor, borderColor2, gradientAngle)) - using (var pathRegion = new GraphicsPath()) - using (var penSmooth = new Pen(this.Parent.BackColor, smoothSize)) - using (var penBorder = new Pen(borderGColor, borderSize)) - { - graph.SmoothingMode = SmoothingMode.AntiAlias; - penBorder.DashStyle = borderLineStyle; - penBorder.DashCap = borderCapStyle; - pathRegion.AddEllipse(rectContourSmooth); - //Set rounded region - this.Region = new Region(pathRegion); - - //Drawing - graph.DrawEllipse(penSmooth, rectContourSmooth);//Draw contour smoothing - if (borderSize > 0) //Draw border - graph.DrawEllipse(penBorder, rectBorder); - } - } - } -} diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/PictureBox/CrEaTiiOn_PictureBox.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/PictureBox/CrEaTiiOn_PictureBox.cs deleted file mode 100644 index 933e014..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/PictureBox/CrEaTiiOn_PictureBox.cs +++ /dev/null @@ -1,282 +0,0 @@ -#region Imports - -using System.ComponentModel; -using System.Drawing.Drawing2D; -using System.Drawing.Text; - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_PictureBox - - public class CrEaTiiOn_Ultimate_PictureBox : Control - { - public CrEaTiiOn_Ultimate_PictureBox() - { - base.SetStyle(ControlStyles.SupportsTransparentBackColor, true); - base.Size = new Size(150, 150); - base.SetStyle(ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, true); - x = 0 - base.Width / 2; - y = 0 - base.Height / 2; - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("Is the image eliptical")] - public bool IsElipse - { - get => isElipse; - set - { - isElipse = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("Is the image")] - public Image Image - { - get => image; - set - { - image = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("Is the image paralax zoom")] - public bool IsParallax - { - get => isParallax; - set - { - isParallax = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("Enable filters")] - public bool FilterEnabled - { - get => filterEnabled; - set - { - filterEnabled = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("Filter color left")] - public Color ColorLeft - { - get => colorLeft; - set - { - colorLeft = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("Filter color right")] - public Color ColorRight - { - get => colorRight; - set - { - colorRight = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("Filter alpha")] - public int FilterAlpha - { - get => filterAlpha; - set - { - filterAlpha = value; - base.Invalidate(); - } - } - - private SmoothingMode _SmoothingType = SmoothingMode.AntiAlias; - [Category("CrEaTiiOn")] - [Browsable(true)] - public SmoothingMode SmoothingType - { - get => _SmoothingType; - set - { - _SmoothingType = value; - Invalidate(); - } - } - - private PixelOffsetMode _PixelOffsetType = PixelOffsetMode.HighQuality; - [Category("CrEaTiiOn")] - [Browsable(true)] - public PixelOffsetMode PixelOffsetType - { - get => _PixelOffsetType; - set - { - _PixelOffsetType = value; - Invalidate(); - } - } - - private CompositingQuality _CompositingQualityType = CompositingQuality.HighQuality; - [Category("CrEaTiiOn")] - [Browsable(true)] - public CompositingQuality CompositingQualityType - { - get => _CompositingQualityType; - set - { - _CompositingQualityType = value; - Invalidate(); - } - } - - private TextRenderingHint _TextRenderingType = TextRenderingHint.ClearTypeGridFit; - [Category("CrEaTiiOn")] - [Browsable(true)] - public TextRenderingHint TextRenderingType - { - get => _TextRenderingType; - set - { - _TextRenderingType = value; - Invalidate(); - } - } - - private InterpolationMode _InterpolationType = InterpolationMode.HighQualityBilinear; - [Category("CrEaTiiOn")] - [Browsable(true)] - public InterpolationMode InterpolationType - { - get => _InterpolationType; - set - { - _InterpolationType = value; - Invalidate(); - } - } - - protected override void OnPaint(PaintEventArgs e) - { - base.OnPaint(e); - BufferedGraphicsContext bufferedGraphicsContext = BufferedGraphicsManager.Current; - bufferedGraphicsContext.MaximumBuffer = new Size(base.Width, base.Height); - bufferedGraphics = bufferedGraphicsContext.Allocate(base.CreateGraphics(), base.ClientRectangle); - bufferedGraphics.Graphics.SmoothingMode = SmoothingType; - bufferedGraphics.Graphics.InterpolationMode = InterpolationType; - bufferedGraphics.Graphics.CompositingQuality = CompositingQualityType; - bufferedGraphics.Graphics.PixelOffsetMode = PixelOffsetType; - bufferedGraphics.Graphics.TextRenderingHint = TextRenderingType; - bufferedGraphics.Graphics.Clear(BackColor); - e.Graphics.SmoothingMode = SmoothingType; - e.Graphics.InterpolationMode = InterpolationType; - e.Graphics.CompositingQuality = CompositingQualityType; - e.Graphics.PixelOffsetMode = PixelOffsetType; - if (image != null) - { - if (!isParallax) - { - if (isElipse) - { - Brush brush = new TextureBrush(new Bitmap(image, base.Width, base.Height), new Rectangle(0, 0, base.Width, base.Height)); - e.Graphics.FillEllipse(brush, 0, 0, base.Width, base.Height); - if (filterEnabled) - { - Brush brush2 = new LinearGradientBrush(base.ClientRectangle, Color.FromArgb(filterAlpha, colorRight), Color.FromArgb(filterAlpha, colorLeft), 180f); - e.Graphics.FillEllipse(brush2, 0, 0, base.Width, base.Height); - return; - } - } - else - { - e.Graphics.DrawImage(new Bitmap(image, base.Width, base.Height), 0, 0); - if (filterEnabled) - { - Brush brush3 = new LinearGradientBrush(base.ClientRectangle, Color.FromArgb(filterAlpha, colorRight), Color.FromArgb(filterAlpha, colorLeft), 180f); - e.Graphics.FillRectangle(brush3, 0, 0, base.Width, base.Height); - return; - } - } - } - else if (isParallax) - { - try - { - bufferedGraphics.Graphics.DrawImage(new Bitmap(image, base.Width * 2, base.Height * 2), x, y); - bufferedGraphics.Render(e.Graphics); - } - catch - { - } - } - } - } - - private void updateParallax() - { - try - { - bufferedGraphics.Graphics.Clear(BackColor); - bufferedGraphics.Graphics.DrawImage(new Bitmap(image, base.Width * 2, base.Height * 2), x, y); - bufferedGraphics.Render(base.CreateGraphics()); - } - catch - { - } - } - - protected override void OnMouseMove(MouseEventArgs e) - { - base.OnMouseMove(e); - if (isParallax) - { - x = e.X - base.Width; - y = e.Y - base.Height; - base.Invalidate(); - } - } - - private int x; - - private int y; - - private BufferedGraphics bufferedGraphics; - - private bool isElipse; - - private Image image; - - private bool isParallax; - - private bool filterEnabled = true; - - private Color colorLeft = Color.FromArgb(250, 36, 38); - - private Color colorRight = Color.FromArgb(250, 36, 38); - - private int filterAlpha = 200; - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/Progress/CrEaTiiOn_CircleProgressBar.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/Progress/CrEaTiiOn_CircleProgressBar.cs deleted file mode 100644 index 5ec6650..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/Progress/CrEaTiiOn_CircleProgressBar.cs +++ /dev/null @@ -1,197 +0,0 @@ -#region Imports - -using System; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Windows.Forms; - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_CircleProgressBar - - public class CrEaTiiOn_CircleProgressBar : Control - { - - #region Enums - - public enum _ProgressShape - { - Round, - Flat - } - - #endregion - - #region Variables - - private long _Value; - private long _Maximum = 100; - private Color _PercentColor = Color.White; - private Color _ProgressColor1 = Color.FromArgb(250, 36, 38); - private Color _ProgressColor2 = Color.FromArgb(250, 36, 38); - private _ProgressShape ProgressShapeVal; - - #endregion - - #region Custom Properties - - public long Value - { - get => _Value; - set - { - if (value > _Maximum) - { - value = _Maximum; - } - - _Value = value; - Invalidate(); - } - } - - public long Maximum - { - get => _Maximum; - set - { - if (value < 1) - { - value = 1; - } - - _Maximum = value; - Invalidate(); - } - } - - public Color PercentColor - { - get => _PercentColor; - set - { - _PercentColor = value; - Invalidate(); - } - } - - public Color ProgressColor1 - { - get => _ProgressColor1; - set - { - _ProgressColor1 = value; - Invalidate(); - } - } - - public Color ProgressColor2 - { - get => _ProgressColor2; - set - { - _ProgressColor2 = value; - Invalidate(); - } - } - - public _ProgressShape ProgressShape - { - get => ProgressShapeVal; - set - { - ProgressShapeVal = value; - Invalidate(); - } - } - - #endregion - - #region EventArgs - - protected override void OnResize(EventArgs e) - { - base.OnResize(e); - SetStandardSize(); - } - - protected override void OnSizeChanged(EventArgs e) - { - base.OnSizeChanged(e); - SetStandardSize(); - } - - protected override void OnPaintBackground(PaintEventArgs p) - { - base.OnPaintBackground(p); - } - - #endregion - - public CrEaTiiOn_CircleProgressBar() - { - Size = new(130, 130); - Font = new("Segoe UI", 15); - MinimumSize = new(100, 100); - DoubleBuffered = true; - } - - private void SetStandardSize() - { - int _Size = Math.Max(Width, Height); - Size = new(_Size, _Size); - } - - public void Increment(int Val) - { - _Value += Val; - Invalidate(); - } - - public void Decrement(int Val) - { - _Value -= Val; - Invalidate(); - } - - protected override void OnPaint(PaintEventArgs e) - { - base.OnPaint(e); - using Bitmap bitmap = new(Width, Height); - using Graphics graphics = Graphics.FromImage(bitmap); - graphics.SmoothingMode = SmoothingMode.AntiAlias; - graphics.Clear(BackColor); - using (LinearGradientBrush brush = new(ClientRectangle, _ProgressColor1, _ProgressColor2, LinearGradientMode.ForwardDiagonal)) - { - using Pen pen = new(brush, 14f); - switch (ProgressShapeVal) - { - case _ProgressShape.Round: - pen.StartCap = LineCap.Round; - pen.EndCap = LineCap.Round; - break; - - case _ProgressShape.Flat: - pen.StartCap = LineCap.Flat; - pen.EndCap = LineCap.Flat; - break; - } - graphics.DrawArc(pen, 0x12, 0x12, (Width - 0x23) - 2, (Height - 0x23) - 2, -90, (int)Math.Round((double)((360.0 / _Maximum) * _Value))); - } - using (LinearGradientBrush brush2 = new(ClientRectangle, Color.FromArgb(0x34, 0x34, 0x34), Color.FromArgb(0x34, 0x34, 0x34), LinearGradientMode.Vertical)) - { - graphics.FillEllipse(brush2, 0x18, 0x18, (Width - 0x30) - 1, (Height - 0x30) - 1); - } - - SizeF MS = graphics.MeasureString(Convert.ToString(Convert.ToInt32((100 / _Maximum) * _Value)), Font); - graphics.DrawString(Convert.ToString(Convert.ToInt32((100 / _Maximum) * _Value)), Font, new SolidBrush(_PercentColor), Convert.ToInt32(Width / 2 - MS.Width / 2), Convert.ToInt32(Height / 2 - MS.Height / 2)); - e.Graphics.DrawImage(bitmap, 0, 0); - graphics.Dispose(); - bitmap.Dispose(); - } - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/Progress/CrEaTiiOn_FancyProgressBar.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/Progress/CrEaTiiOn_FancyProgressBar.cs deleted file mode 100644 index 488f70b..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/Progress/CrEaTiiOn_FancyProgressBar.cs +++ /dev/null @@ -1,110 +0,0 @@ -#region Imports -using System; -using System.Drawing; -using System.Windows.Forms; -#endregion - -namespace CBH.Controls -{ - public class CrEaTiiOn_FancyProgressBar : Control - { - int value; - int maxValue; - int minValue; - int old, current; - Color prColor; - System.Windows.Forms.Timer timer; - - public CrEaTiiOn_FancyProgressBar() - { - prColor = Color.LightBlue; - maxValue = 100; - minValue = 0; - SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.UserPaint, true); - Width = 100; - Height = 20; - timer = new System.Windows.Forms.Timer(); - timer.Interval = 1; - timer.Tick += timer_Tick; - timer.Enabled = true; - } - void timer_Tick(object sender, EventArgs e) - { - for (int i = 0; i < 3; i++) - { - int a = current - old; - int k = maxValue / 100; - int art = k < 1 ? 1 : k; - old += Math.Abs(a) < 2 ? a : art * Math.Sign(a); - this.value = old; - Invalidate(); - } - } - protected override void OnPaint(PaintEventArgs e) - { - int length = Width * value / maxValue; - e.Graphics.DrawRectangle(Pens.Silver, 0, 0, Width - 1, Height - 1); - using (SolidBrush brush = new SolidBrush(prColor)) - e.Graphics.FillRectangle(brush, 1, 1, length - 2, Height - 2); - - Size textSize = TextRenderer.MeasureText(value + "", this.Font); - int x = (Width - textSize.Width) / 2; - int y = (Height - textSize.Height) / 2; - using (SolidBrush textBrush = new SolidBrush(this.ForeColor)) - e.Graphics.DrawString("%" + (value * 100 / maxValue), this.Font, textBrush, x, y); - base.OnPaint(e); - } - public int Value - { - get - { - return current; - } - set - { - old = this.value; - if (value > maxValue) - throw new Exception("The value is greater than the maximum value of progress"); - if (value < minValue) - throw new Exception("The value is lower than the maximum value of progress"); - current = value; - } - } - public int MaxValue - { - get - { - return maxValue; - } - set - { - maxValue = value; - Invalidate(); - } - } - public int MinValue - { - get - { - return minValue; - } - set - { - minValue = value; - Invalidate(); - } - } - public Color ProgressColor - { - get - { - return prColor; - } - set - { - prColor = value; - Invalidate(); - } - } - } -} diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/Progress/CrEaTiiOn_FlatProgressBar.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/Progress/CrEaTiiOn_FlatProgressBar.cs deleted file mode 100644 index a3d2e08..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/Progress/CrEaTiiOn_FlatProgressBar.cs +++ /dev/null @@ -1,350 +0,0 @@ -#region Imports - -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Drawing.Text; -using System.Windows.Forms; - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_FlatProgressBar - - public class CrEaTiiOn_FlatProgressBar : Control - { - public CrEaTiiOn_FlatProgressBar() - { - base.SetStyle(ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, true); - base.Size = new Size(300, 5); - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The progress bar style")] - public Style BarStyle - { - get => barStyle; - set - { - barStyle = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The progress value")] - public int Value - { - get => value; - set - { - this.value = value; - if (this.value < 0) - { - this.value = 0; - } - if (this.value > maxValue) - { - this.value = maxValue; - } - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The progress complete color")] - public Color CompleteColor - { - get => completeColor; - set - { - completeColor = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The progress complete ios back color")] - public Color CompleteBackColor - { - get => completeBackColor; - set - { - completeBackColor = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The progress bar border color")] - public Color BorderColor - { - get => borderColor; - set - { - borderColor = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("Show the progress bar border")] - public bool ShowBorder - { - get => showBorder; - set - { - showBorder = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The progress incompleted color")] - public Color InocmpletedColor - { - get => incompletedColor; - set - { - incompletedColor = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The progress incompleted ios back color")] - public Color IncompletedBackColor - { - get => incompletedBackColor; - set - { - incompletedBackColor = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The maximum value")] - public int MaxValue - { - get => maxValue; - set - { - maxValue = value; - if (Value > maxValue) - { - Value = maxValue; - } - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The positions")] - public List Positions - { - get => _Positions; - set - { - _Positions = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The colors")] - public List Colors - { - get => _Colors; - set - { - _Colors = value; - base.Invalidate(); - } - } - - private SmoothingMode _SmoothingType = SmoothingMode.HighQuality; - [Category("CrEaTiiOn")] - [Browsable(true)] - public SmoothingMode SmoothingType - { - get => _SmoothingType; - set - { - _SmoothingType = value; - Invalidate(); - } - } - - private PixelOffsetMode _PixelOffsetType = PixelOffsetMode.HighQuality; - [Category("CrEaTiiOn")] - [Browsable(true)] - public PixelOffsetMode PixelOffsetType - { - get => _PixelOffsetType; - set - { - _PixelOffsetType = value; - Invalidate(); - } - } - - private CompositingQuality _CompositingQualityType = CompositingQuality.HighQuality; - [Category("CrEaTiiOn")] - [Browsable(true)] - public CompositingQuality CompositingQualityType - { - get => _CompositingQualityType; - set - { - _CompositingQualityType = value; - Invalidate(); - } - } - - private TextRenderingHint _TextRenderingType = TextRenderingHint.ClearTypeGridFit; - [Category("CrEaTiiOn")] - [Browsable(true)] - public TextRenderingHint TextRenderingType - { - get => _TextRenderingType; - set - { - _TextRenderingType = value; - Invalidate(); - } - } - - private InterpolationMode _InterpolationType = InterpolationMode.HighQualityBilinear; - [Category("CrEaTiiOn")] - [Browsable(true)] - public InterpolationMode InterpolationType - { - get => _InterpolationType; - set - { - _InterpolationType = value; - Invalidate(); - } - } - - protected override void OnPaint(PaintEventArgs e) - { - BufferedGraphicsContext bufferedGraphicsContext = BufferedGraphicsManager.Current; - bufferedGraphicsContext.MaximumBuffer = new Size(base.Width + 1, base.Height + 1); - bufferedGraphics = bufferedGraphicsContext.Allocate(base.CreateGraphics(), base.ClientRectangle); - - bufferedGraphics.Graphics.SmoothingMode = SmoothingType; - bufferedGraphics.Graphics.InterpolationMode = InterpolationType; - bufferedGraphics.Graphics.CompositingQuality = CompositingQualityType; - bufferedGraphics.Graphics.PixelOffsetMode = PixelOffsetType; - bufferedGraphics.Graphics.TextRenderingHint = TextRenderingType; - - bufferedGraphics.Graphics.Clear(BackColor); - - if (barStyle == Style.Flat) - { - bufferedGraphics.Graphics.FillRectangle(new SolidBrush(incompletedColor), 0, 0, base.Width, base.Height); - bufferedGraphics.Graphics.FillRectangle(new SolidBrush(completeColor), 0, 0, value * base.Width / maxValue, base.Height); - } - - if (barStyle == Style.IOS) - { - bufferedGraphics.Graphics.FillRectangle(new SolidBrush(incompletedBackColor), 0, 0, base.Width, base.Height); - bufferedGraphics.Graphics.FillRectangle(new SolidBrush(completeBackColor), 0, 0, value * base.Width / maxValue, base.Height); - } - - if (barStyle == Style.Material && Positions.Count == Colors.Count) - { - LinearGradientBrush linearGradientBrush = new(new Rectangle(0, 0, base.Width, base.Height), Color.Black, Color.Black, 0f, false) - { - InterpolationColors = new ColorBlend - { - Positions = Positions.ToArray(), - Colors = Colors.ToArray() - } - }; - - linearGradientBrush.RotateTransform(1f); - bufferedGraphics.Graphics.FillRectangle(linearGradientBrush, new Rectangle(0, 0, base.Width, base.Height)); - bufferedGraphics.Graphics.FillRectangle(new SolidBrush(incompletedColor), value * base.Width / maxValue, 0, base.Width - value * base.Width / maxValue, base.Height); - } - - if (ShowBorder) - { - bufferedGraphics.Graphics.DrawRectangle(new Pen(BorderColor, 1f), new Rectangle(1, 1, base.Width - 2, base.Height - 2)); - } - - bufferedGraphics.Render(e.Graphics); - base.OnPaint(e); - } - - protected override void OnSizeChanged(EventArgs e) - { - base.Invalidate(); - } - - private BufferedGraphics bufferedGraphics; - - private Style barStyle = Style.Material; - - private int value = 50; - - private Color completeColor = Color.FromArgb(250, 36, 38); - - private Color completeBackColor = Color.FromArgb(15, 15, 15); - - private Color borderColor = Color.FromArgb(20, 20, 20); - - private bool showBorder = true; - - private Color incompletedColor = Color.DarkGray; - - private Color incompletedBackColor = Color.FromArgb(100, 100, 100); - - private int maxValue = 100; - - private List _Positions = new() - { - 0f, - 0.2f, - 0.4f, - 0.6f, - 0.8f, - 1f - }; - - private List _Colors = new() - { - Color.FromArgb(76, 217, 100), - Color.FromArgb(85, 205, 205), - Color.FromArgb(2, 124, 255), - Color.FromArgb(130, 75, 180), - Color.FromArgb(255, 0, 150), - Color.FromArgb(255, 45, 85) - }; - - public enum Style - { - Flat, - Material, - IOS - } - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/Progress/CrEaTiiOn_FlatRoundProgressBar.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/Progress/CrEaTiiOn_FlatRoundProgressBar.cs deleted file mode 100644 index a565737..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/Progress/CrEaTiiOn_FlatRoundProgressBar.cs +++ /dev/null @@ -1,94 +0,0 @@ -#region Imports -using CBH_Ultimate_Theme_Library.Theme.Helpers; -using System; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Drawing.Text; -using System.Windows.Forms; -#endregion - -namespace CBH.Controls -{ - public class CrEaTiiOn_FlatRoundProgressBar : Control - { - #region 变量 - #endregion - - private int tempValue = 0; - private int _valueNumber = 0; - public int ValueNumber - { - get { return _valueNumber; } - set - { - _valueNumber = value > 100 ? 100 : (value < 0 ? 0 : value); - Invalidate(); - } - } - - private float _roundWidth = 6; - - private bool _isError = false; - public bool IsError - { - get { return _isError; } - set - { - _isError = value; - Invalidate(); - } - } - - #region 事件 - protected override void OnResize(EventArgs e) - { - base.OnResize(e); - Width = Height; - } - #endregion - - protected override void OnPaint(PaintEventArgs e) - { - Graphics graphics = e.Graphics; - graphics.SmoothingMode = SmoothingMode.HighQuality; - graphics.PixelOffsetMode = PixelOffsetMode.HighQuality; - graphics.TextRenderingHint = TextRenderingHint.ClearTypeGridFit; - graphics.Clear(Parent.BackColor); - - graphics.FillEllipse(new SolidBrush(ThemeColors.OneLevelBorder), new Rectangle(0, 0, Width, Height)); - - if(_isError) - { - //绘制扇形 - graphics.FillPie(new SolidBrush(ThemeColors.Danger), new Rectangle(0, 0, Width, Width), 0, _valueNumber * 3.6f); - //绘制文字 - graphics.FillEllipse(new SolidBrush(Color.FromArgb(20, 20, 20)), new RectangleF(_roundWidth, _roundWidth, Width - _roundWidth * 2, Width - _roundWidth * 2)); - graphics.DrawLine(new Pen(ThemeColors.Danger, 2f), Width / 2 - 6, Height / 2 - 6, Width / 2 + 6, Height / 2 + 6); - graphics.DrawLine(new Pen(ThemeColors.Danger, 2f), Width / 2 - 6, Height / 2 + 6, Width / 2 + 6, Height / 2 - 6); - } - else - { - if(_valueNumber==100) - { - graphics.FillPie(new SolidBrush(ThemeColors.Success), new Rectangle(0, 0, Width, Width), 0, _valueNumber * 3.6f); - graphics.FillEllipse(new SolidBrush(Color.FromArgb(20, 20, 20)), new RectangleF(_roundWidth, _roundWidth, Width - _roundWidth * 2, Width - _roundWidth * 2)); - graphics.DrawLine(new Pen(ThemeColors.Success, 2f), Width / 2 - 6, Height / 2, Width / 2-3, Height / 2 + 6); - graphics.DrawLine(new Pen(ThemeColors.Success, 2f), Width / 2 + 6, Height / 2 - 6, Width / 2-3, Height / 2 + 6); - } - else - { - graphics.FillPie(new SolidBrush(ThemeColors.PrimaryColor), new Rectangle(0, 0, Width, Width), 0, _valueNumber * 3.6f); - graphics.FillEllipse(new SolidBrush(Color.White), new RectangleF(_roundWidth, _roundWidth, Width - _roundWidth * 2, Width - _roundWidth * 2)); - graphics.DrawString(_valueNumber.ToString()+"%", new Font("微软雅黑", 12f), new SolidBrush(ThemeColors.PrimaryColor), new RectangleF(_roundWidth, _roundWidth, Width - (_roundWidth * 2), Width - (_roundWidth * 2)), StringAlign.Center); - } - } - } - - public CrEaTiiOn_FlatRoundProgressBar() - { - SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.OptimizedDoubleBuffer | ControlStyles.SupportsTransparentBackColor, true); - DoubleBuffered = true; - Font = new Font("Segoe UI", 10F, FontStyle.Bold); - } - } -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/Progress/CrEaTiiOn_ProcessingControl.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/Progress/CrEaTiiOn_ProcessingControl.cs deleted file mode 100644 index 6349be0..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/Progress/CrEaTiiOn_ProcessingControl.cs +++ /dev/null @@ -1,154 +0,0 @@ -#region Imports -using CBH_Ultimate_Theme_Library.Theme.Helpers; -using System; -using System.Drawing; -using System.Windows.Forms; -#endregion - -namespace CBH.Controls -{ - public class CrEaTiiOn_ProcessingControl : Control - { - #region Variables - int n, circleIndex, radius, interval; - bool spin; - System.Windows.Forms.Timer timer; - Color other, index; - #endregion - - #region ProcessingControl - public CrEaTiiOn_ProcessingControl() - { - Width = 85; - Height = 85; - n = 6; - circleIndex = 0; - interval = 100; - radius = 10; - spin = true; - other = Color.LightGray; - index = Color.Gray; - timer = new System.Windows.Forms.Timer(); - timer.Interval = interval; - timer.Tick += timer_Tick; - SetStyle(ControlStyles.SupportsTransparentBackColor | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.UserPaint, true); - timer.Enabled = spin; - BackColor = Color.Transparent; - } - #endregion - - #region Events - - - protected override void OnPaint(PaintEventArgs e) - { - Transparenter.MakeTransparent(this, e.Graphics); - #region Drawing - e.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality; - int length = Math.Min(Width, Height); - PointF center = new PointF(length / 2, length / 2); - int bigRadius = length / 2 - radius; - float unitAngle = 360 / n; - if (spin) - { - circleIndex++; - circleIndex = circleIndex >= n ? circleIndex % n : circleIndex; - } - for (int i = 0; i < n; i++) - { - float c1X = center.X + (float)(bigRadius * Math.Cos(unitAngle * i * Math.PI / 180)); - float c1Y = center.Y + (float)(bigRadius * Math.Sin(unitAngle * i * Math.PI / 180)); - PointF loc1 = new PointF(c1X - radius, c1Y - radius); - if (i == circleIndex) - using (SolidBrush brush = new SolidBrush(index)) - e.Graphics.FillEllipse(brush, loc1.X, loc1.Y, 2 * radius, 2 * radius); - else - using (SolidBrush brush = new SolidBrush(other)) - e.Graphics.FillEllipse(brush, loc1.X, loc1.Y, 2 * radius, 2 * radius); - } - #endregion - } - void timer_Tick(object sender, EventArgs e) - { - Invalidate(); - if (!spin) timer.Stop(); - } - #endregion - - #region Properties - public int NCircle - { - get - { - return n; - } - set - { - n = value > 1 ? value : 2; - Invalidate(); - } - } - public int Interval - { - get - { - return interval; - } - set - { - interval = value >= 1 ? value : 1; - timer.Interval = interval; - } - } - public bool Spin - { - get - { - return spin; - } - set - { - spin = value; - timer.Enabled = spin; - } - } - public int Radius - { - get - { - return radius; - } - set - { - radius = value >= 1 ? value : 1; - Invalidate(); - - } - } - public Color Others - { - get - { - return other; - } - set - { - other = value; - if (!spin) Invalidate(); - } - } - public Color IndexColor - { - get - { - return index; - } - set - { - index = value; - if (!spin) Invalidate(); - } - } - #endregion - } -} diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/Progress/CrEaTiiOn_ProgressBar.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/Progress/CrEaTiiOn_ProgressBar.cs deleted file mode 100644 index db3467c..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/Progress/CrEaTiiOn_ProgressBar.cs +++ /dev/null @@ -1,120 +0,0 @@ -#region Imports - -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Windows.Forms; - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_ProgressBar - - public class CrEaTiiOn_ProgressBar : System.Windows.Forms.ProgressBar - { - private int _Value; - public int Value - { - get => _Value; - set - { - _Value = value; - Invalidate(); - } - } - - private int _Maximum = 100; - public int Maximum - { - get => _Maximum; - set - { - if (value == 0) - { - value = 1; - } - - _Maximum = value; - Invalidate(); - } - } - - public CrEaTiiOn_ProgressBar() - { - Value = 50; - } - - private Color _ColorA = Color.FromArgb(31, 31, 31); - public Color ColorA - { - get => _ColorA; - set => _ColorA = value; - } - - private Color _ColorB = Color.FromArgb(41, 41, 41); - public Color ColorB - { - get => _ColorB; - set => _ColorB = value; - } - - private Color _ColorC = Color.FromArgb(51, 51, 51); - public Color ColorC - { - get => _ColorC; - set => _ColorC = value; - } - - private Color _ColorD = Color.FromArgb(0, 0, 0, 0); - public Color ColorD - { - get => _ColorD; - set => _ColorD = value; - } - - private Color _ColorE = Color.FromArgb(25, 255, 255, 255); - public Color ColorE - { - get => _ColorE; - set => _ColorE = value; - } - - - protected override void OnPaintBackground(PaintEventArgs e) - { - // - } - - protected override void OnPaint(PaintEventArgs e) - { - base.OnPaint(e); - int V = Width * _Value / _Maximum; - using Bitmap B = new(Width, Height); - using Graphics G = Graphics.FromImage(B); - Rectangle R1 = new(1, 1, Width - 2, Height - 2); - Rectangle R2 = new(2, 2, V - 4, Height - 4); - Brush GB1 = new LinearGradientBrush(R1, _ColorB, _ColorC, 90.0F); - Brush GB2 = new LinearGradientBrush(R2, _ColorC, _ColorB, 30.0F); - G.FillRectangle(GB1, R1); - G.FillRectangle(GB2, R2); - // Draw.Gradient(G, _ColorB, _ColorC, 1, 1, Width - 2, Height - 2) - G.DrawRectangle(new(_ColorB), 1, 1, V - 3, Height - 3); - // Draw.Gradient(G, _ColorC, _ColorB, 2, 2, V - 4, Height - 4) - - G.DrawRectangle(new(_ColorA), 0, 0, Width - 1, Height - 1); - Bitmap B1 = B; - e.Graphics.DrawImage(B1, 0, 0); - /* - Draw.Gradient(G, _ColorB, _ColorC, 1, 1, Width - 2, Height - 2) - G.DrawRectangle(new(_ColorB), 1, 1, V - 3, Height - 3) - Draw.Gradient(G, _ColorC, _ColorB, 2, 2, V - 4, Height - 4) - - G.DrawRectangle(new(_ColorA), 0, 0, Width - 1, Height - 1) - - e.Graphics.DrawImage(B.Clone, 0, 0) - */ - } - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/Progress/CrEaTiiOn_SpinningCircles.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/Progress/CrEaTiiOn_SpinningCircles.cs deleted file mode 100644 index 75de952..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/Progress/CrEaTiiOn_SpinningCircles.cs +++ /dev/null @@ -1,113 +0,0 @@ -#region Imports -using CBH_Ultimate_Theme_Library.Theme.Helpers; -using System; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Windows.Forms; -#endregion - -namespace CBH.Controls -{ - public class CrEaTiiOn_SpinningCircles : Control - { - bool fullTransparency = true; - float increment = 1f; - float radius = 2.5f; - int n = 8; - int next = 0; - System.Windows.Forms.Timer timer; - public CrEaTiiOn_SpinningCircles() - { - Width = 90; - Height = 100; - timer = new System.Windows.Forms.Timer(); - timer.Tick += timer_Tick; - timer.Enabled = false; - SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.UserPaint | ControlStyles.SupportsTransparentBackColor, true); - BackColor = Color.Transparent; - } - void timer_Tick(object sender, EventArgs e) - { - Invalidate(); - } - protected override void OnPaint(PaintEventArgs e) - { - if (fullTransparency) - { - Transparenter.MakeTransparent(this, e.Graphics); - } - e.Graphics.SmoothingMode = SmoothingMode.HighQuality; - int length = Math.Min(Width, Height); - PointF center = new PointF(length / 2, length / 2); - float bigRadius = length / 2 - radius - (n - 1) * increment; - float unitAngle = 360 / n; - next++; - next = next >= n ? 0 : next; - int a = 0; - for (int i = next; i < next + n; i++) - { - int factor = i % n; - float c1X = center.X + (float)(bigRadius * Math.Cos(unitAngle * factor * Math.PI / 180)); - float c1Y = center.Y + (float)(bigRadius * Math.Sin(unitAngle * factor * Math.PI / 180)); - float currRad = radius + a * increment; - PointF c1 = new PointF(c1X - currRad, c1Y - currRad); - e.Graphics.FillEllipse(Brushes.Black, c1.X, c1.Y, 2 * currRad, 2 * currRad); - using (Pen pen = new Pen(Color.White, 2)) - e.Graphics.DrawEllipse(pen, c1.X, c1.Y, 2 * currRad, 2 * currRad); - a++; - } - } - protected override void OnVisibleChanged(EventArgs e) - { - timer.Enabled = Visible; - base.OnVisibleChanged(e); - } - public bool FullTransparent - { - get - { - return fullTransparency; - } - set - { - fullTransparency = value; - } - } - public int N - { - get - { - return n; - } - set - { - n = value >= 2 ? value : 2; - Invalidate(); - } - } - public float Increment - { - get - { - return increment; - } - set - { - increment = value >= 0 ? value : 0; - Invalidate(); - } - } - public float Radius - { - get - { - return radius; - } - set - { - radius = value >= 1 ? value : 1; - Invalidate(); - } - } - } -} diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/RadioButton/CrEaTiiOn_AirRadioButton.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/RadioButton/CrEaTiiOn_AirRadioButton.cs deleted file mode 100644 index ad2873b..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/RadioButton/CrEaTiiOn_AirRadioButton.cs +++ /dev/null @@ -1,216 +0,0 @@ -#region Imports - -using System; -using System.ComponentModel; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Drawing.Text; -using System.Windows.Forms; - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_AirRadioButton - - public class CrEaTiiOn_AirRadioButton : Control - { - public CrEaTiiOn_AirRadioButton() - { - base.Size = new Size(100, 16); - Text = base.Name; - ForeColor = Color.White; - currentColor = radioColor; - Cursor = Cursors.Hand; - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("Checked or unchecked")] - public bool Checked - { - get => isChecked; - set - { - isChecked = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("Radio color")] - public Color RadioColor - { - get => radioColor; - set - { - radioColor = value; - currentColor = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("Radio color when hovering")] - public Color RadioHoverColor - { - get => radioHoverColor; - set - { - radioHoverColor = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The radio style")] - public Style RadioStyle - { - get => radioStyle; - set - { - radioStyle = value; - base.Invalidate(); - } - } - - private SmoothingMode _SmoothingType = SmoothingMode.AntiAlias; - [Category("CrEaTiiOn")] - [Browsable(true)] - public SmoothingMode SmoothingType - { - get => _SmoothingType; - set - { - _SmoothingType = value; - Invalidate(); - } - } - - private PixelOffsetMode _PixelOffsetType = PixelOffsetMode.HighQuality; - [Category("CrEaTiiOn")] - [Browsable(true)] - public PixelOffsetMode PixelOffsetType - { - get => _PixelOffsetType; - set - { - _PixelOffsetType = value; - Invalidate(); - } - } - - private TextRenderingHint _TextRenderingType = TextRenderingHint.ClearTypeGridFit; - [Category("CrEaTiiOn")] - [Browsable(true)] - public TextRenderingHint TextRenderingType - { - get => _TextRenderingType; - set - { - _TextRenderingType = value; - Invalidate(); - } - } - - protected override void OnMouseEnter(EventArgs e) - { - base.OnMouseEnter(e); - currentColor = radioHoverColor; - base.Invalidate(); - } - - protected override void OnMouseLeave(EventArgs e) - { - base.OnMouseLeave(e); - currentColor = radioColor; - base.Invalidate(); - } - - protected override void OnClick(EventArgs e) - { - base.OnClick(e); - foreach (object obj in base.Parent.Controls) - { - Control control = (Control)obj; - if (control is System.Windows.Forms.RadioButton) - { - ((CrEaTiiOn_Ultimate_RadioButton)control).Checked = false; - } - if (control is CrEaTiiOn_AirRadioButton button) - { - button.Checked = false; - } - } - isChecked = true; - base.Invalidate(); - } - - protected override void OnPaint(PaintEventArgs e) - { - e.Graphics.SmoothingMode = SmoothingType; - if (radioStyle == Style.Material) - { - e.Graphics.DrawEllipse(new Pen(currentColor, 2f), 2, 2, base.Height - 4, base.Height - 4); - if (isChecked) - { - e.Graphics.FillPie(new SolidBrush(currentColor), new Rectangle(5, 5, base.Height - 2 - 8, base.Height - 2 - 8), 0f, 360f); - } - e.Graphics.FillPie(new SolidBrush(currentColor), new Rectangle(1, 1, base.Height - 2, base.Height - 2), 0f, 360f); - if (isChecked) - { - e.Graphics.FillPie(new SolidBrush(Color.White), new Rectangle(4, 4, base.Height - 2 - 6, base.Height - 2 - 6), 0f, 360f); - } - } - if (radioStyle == Style.iOS) - { - e.Graphics.DrawEllipse(new Pen(Color.FromArgb(250, 36, 38), 2f), 2, 2, base.Height - 4, base.Height - 4); - if (isChecked) - { - e.Graphics.FillPie(new SolidBrush(Color.FromArgb(250, 36, 38)), new Rectangle(5, 5, base.Height - 2 - 8, base.Height - 2 - 8), 0f, 360f); - } - } - if (radioStyle == Style.Android) - { - e.Graphics.DrawEllipse(new Pen(Color.FromArgb(255, 0, 0), 2f), 2, 2, base.Height - 4, base.Height - 4); - if (isChecked) - { - e.Graphics.FillPie(new SolidBrush(Color.FromArgb(255, 0, 0)), new Rectangle(5, 5, base.Height - 2 - 8, base.Height - 2 - 8), 0f, 360f); - } - } - StringFormat stringFormat = new() - { - LineAlignment = StringAlignment.Center, - Alignment = StringAlignment.Near - }; - SolidBrush brush = new(ForeColor); - RectangleF layoutRectangle = new(base.Height + 3, 0f, base.Width - base.Height - 2, Height); - e.Graphics.PixelOffsetMode = PixelOffsetType; - e.Graphics.TextRenderingHint = TextRenderingType; - e.Graphics.DrawString(Text, Font, brush, layoutRectangle, stringFormat); - base.OnPaint(e); - } - - private bool isChecked; - - private Color radioColor = Color.FromArgb(15, 15, 15); - - private Color radioHoverColor = Color.FromArgb(155, 31, 33); - - private Style radioStyle = Style.Material; - - private Color currentColor; - - public enum Style - { - iOS, - Android, - Material - } - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/RadioButton/CrEaTiiOn_ClasicRadioButton.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/RadioButton/CrEaTiiOn_ClasicRadioButton.cs deleted file mode 100644 index d61eaec..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/RadioButton/CrEaTiiOn_ClasicRadioButton.cs +++ /dev/null @@ -1,192 +0,0 @@ -#region Imports - -using System; -using System.ComponentModel; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Windows.Forms; - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_ClasicRadioButton - - [DefaultEvent("CheckedChanged")] - public class CrEaTiiOn_ClasicRadioButton : Control - { - #region " Control Help - MouseState & Flicker Control" - private Point mouse = new(0, 0); - protected override void OnResize(EventArgs e) - { - base.OnResize(e); - Height = 14; - } - - protected override void OnMouseMove(MouseEventArgs e) - { - mouse = e.Location; - base.OnMouseMove(e); - } - - protected override void OnTextChanged(EventArgs e) - { - base.OnTextChanged(e); - Invalidate(); - } - - private bool _Checked; - public bool Checked - { - get => _Checked; - set - { - _Checked = value; - InvalidateControls(); - CheckedChanged?.Invoke(this); - Invalidate(); - } - } - - protected override void OnClick(EventArgs e) - { - if (mouse.X <= Height - 1 || mouse.Y <= Width - 1) - { - if (!_Checked) - { - Checked = true; - } - - Invalidate(); - } - base.OnClick(e); - } - - public event CheckedChangedEventHandler CheckedChanged; - public delegate void CheckedChangedEventHandler(object sender); - - protected override void OnCreateControl() - { - base.OnCreateControl(); - InvalidateControls(); - } - - private void InvalidateControls() - { - if (!IsHandleCreated || !_Checked) - { - return; - } - - foreach (Control C in Parent.Controls) - { - if (!object.ReferenceEquals(C, this) && C is CrEaTiiOn_ClasicRadioButton button) - { - button.Checked = false; - } - } - } - #endregion - - #region Variables - private SmoothingMode _SmoothingType = SmoothingMode.HighQuality; - private Color _EllipseBorderColorA = Color.FromArgb(15, 15, 15); - private Color _EllipseBorderColorB = Color.FromArgb(15, 15, 15); - private Color _EllipseBackColorA = Color.Transparent; - private Color _EllipseBackColorB = Color.Transparent; - private Color _CheckedColorA = Color.FromArgb(250, 36, 38); - private Color _CheckedColorB = Color.FromArgb(250, 36, 38); - #endregion - - #region Settings - public SmoothingMode SmoothingType - { - get => _SmoothingType; - set - { - _SmoothingType = value; - Invalidate(); - } - } - - public Color EllipseBorderColorA - { - get => _EllipseBorderColorA; - set => _EllipseBorderColorA = value; - } - - public Color EllipseBorderColorB - { - get => _EllipseBorderColorB; - set => _EllipseBorderColorB = value; - } - - public Color EllipseBackColorA - { - get => _EllipseBackColorA; - set => _EllipseBackColorA = value; - } - - public Color EllipseBackColorB - { - get => _EllipseBackColorB; - set => _EllipseBackColorB = value; - } - - public Color CheckedColorA - { - get => _CheckedColorA; - set => _CheckedColorA = value; - } - - public Color CheckedColorB - { - get => _CheckedColorB; - set => _CheckedColorB = value; - } - #endregion - - public CrEaTiiOn_ClasicRadioButton() : base() - { - SetStyle(ControlStyles.UserPaint | ControlStyles.SupportsTransparentBackColor, true); - BackColor = Color.Transparent; - ForeColor = Color.White; - Font = new("Segoe UI", 6.75f, FontStyle.Bold); - Size = new(105, 14); - DoubleBuffered = true; - Cursor = Cursors.Hand; - } - - protected override void OnPaint(PaintEventArgs e) - { - Bitmap B = new(Width, Height); - Graphics G = Graphics.FromImage(B); - - G.SmoothingMode = SmoothingType; - G.Clear(Parent.FindForm().BackColor); - - G.DrawEllipse(new(EllipseBorderColorA), new Rectangle(0, 0, Height - 2, Height - 1)); - LinearGradientBrush bgGrad = new(new Rectangle(0, 0, Height - 2, Height - 2), EllipseBackColorA, EllipseBackColorB, 90); - G.FillEllipse(bgGrad, new Rectangle(0, 0, Height - 2, Height - 2)); - G.DrawEllipse(new(EllipseBorderColorB), new Rectangle(1, 1, Height - 4, Height - 4)); - - if (Checked) - { - G.FillEllipse(new SolidBrush(CheckedColorA), new Rectangle(3, 3, Height - 8, Height - 8)); - G.FillEllipse(new SolidBrush(CheckedColorB), new Rectangle(4, 4, Height - 10, Height - 10)); - } - - G.DrawString(Text, Font, new SolidBrush(ForeColor), new Point(16, 1), new StringFormat - { - Alignment = StringAlignment.Near, - LineAlignment = StringAlignment.Near - }); - - e.Graphics.DrawImage(B, 0, 0); - G.Dispose(); - B.Dispose(); - } - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/RadioButton/CrEaTiiOn_MetroRadioButton.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/RadioButton/CrEaTiiOn_MetroRadioButton.cs deleted file mode 100644 index 76fb3f6..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/RadioButton/CrEaTiiOn_MetroRadioButton.cs +++ /dev/null @@ -1,220 +0,0 @@ -#region Imports - -using System; -using System.ComponentModel; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Drawing.Text; -using System.Windows.Forms; - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_MetroRadioButton - - [DefaultEvent("CheckedChanged")] - public class CrEaTiiOn_MetroRadioButton : Control - { - #region " Control Help - MouseState & Flicker Control" - protected override void OnResize(EventArgs e) - { - base.OnResize(e); - Height = 16; - } - - protected override void OnTextChanged(EventArgs e) - { - base.OnTextChanged(e); - Invalidate(); - } - - private bool _Checked; - public bool Checked - { - get => _Checked; - set - { - _Checked = value; - InvalidateControls(); - CheckedChanged?.Invoke(this); - Invalidate(); - } - } - - protected override void OnClick(EventArgs e) - { - if (!_Checked) - { - @Checked = true; - } - else - { - @Checked = false; - } - - base.OnClick(e); - } - - public event CheckedChangedEventHandler CheckedChanged; - public delegate void CheckedChangedEventHandler(object sender); - protected override void OnCreateControl() - { - base.OnCreateControl(); - InvalidateControls(); - } - - private void InvalidateControls() - { - if (!IsHandleCreated || !_Checked) - { - return; - } - - foreach (Control C in Parent.Controls) - { - if (!object.ReferenceEquals(C, this) && C is CrEaTiiOn_MetroRadioButton button) - { - button.Checked = false; - } - } - } - - private SmoothingMode _SmoothingType = SmoothingMode.HighQuality; - public SmoothingMode SmoothingType - { - get => _SmoothingType; - set - { - _SmoothingType = value; - Invalidate(); - } - } - - private CompositingQuality _CompositingQualityType = CompositingQuality.HighQuality; - public CompositingQuality CompositingQualityType - { - get => _CompositingQualityType; - set - { - _CompositingQualityType = value; - Invalidate(); - } - } - - private TextRenderingHint _TextRenderingType = TextRenderingHint.AntiAliasGridFit; - public TextRenderingHint TextRenderingType - { - get => _TextRenderingType; - set - { - _TextRenderingType = value; - Invalidate(); - } - } - - private Color _CheckedColor = Color.FromArgb(250, 36, 38); - public Color CheckedColor - { - get => _CheckedColor; - set - { - _CheckedColor = value; - Invalidate(); - } - } - - private Color _CircleBorderColor = Color.FromArgb(20, 20, 20); - public Color CircleBorderColor - { - get => _CircleBorderColor; - set - { - _CircleBorderColor = value; - Invalidate(); - } - } - - private Color _CircleEdgeColor = Color.White; - public Color CircleEdgeColor - { - get => _CircleEdgeColor; - set - { - _CircleEdgeColor = value; - Invalidate(); - } - } - - private Color _CheckedBorderColorA = Color.FromArgb(250, 36, 38); - public Color CheckedBorderColorA - { - get => _CheckedBorderColorA; - set - { - _CheckedBorderColorA = value; - Invalidate(); - } - } - - private Color _CheckedBorderColorB = Color.FromArgb(250, 36, 38); - public Color CheckedBorderColorB - { - get => _CheckedBorderColorB; - set - { - _CheckedBorderColorB = value; - Invalidate(); - } - } - #endregion - - public CrEaTiiOn_MetroRadioButton() : base() - { - SetStyle(ControlStyles.UserPaint | ControlStyles.SupportsTransparentBackColor, true); - BackColor = Color.Transparent; - ForeColor = Color.White; - Size = new(133, 16); - DoubleBuffered = true; - Cursor = Cursors.Hand; - Font = new("Segoe UI", 8, FontStyle.Bold); - } - - protected override void OnPaint(PaintEventArgs e) - { - Bitmap B = new(Width, Height); - Graphics G = Graphics.FromImage(B); - Rectangle radioBtnRectangle = new(0, 0, Height, Height - 1); - Rectangle Inner = new(1, 1, Height - 2, Height - 3); - - G.SmoothingMode = SmoothingType; - G.CompositingQuality = CompositingQualityType; - G.TextRenderingHint = TextRenderingType; - - G.Clear(BackColor); - - LinearGradientBrush bgGrad = new(radioBtnRectangle, CheckedBorderColorA, CheckedBorderColorB, 90F); - G.FillEllipse(bgGrad, radioBtnRectangle); - - G.DrawEllipse(new(CircleBorderColor), radioBtnRectangle); - G.DrawEllipse(new(CircleEdgeColor), Inner); - - if (Checked) - { - G.DrawString("n", new Font("Marlett", 8, FontStyle.Bold), new SolidBrush(CheckedColor), 0, 3); - } - - G.DrawString(Text, Font, new SolidBrush(ForeColor), new Point(18, 8), new StringFormat - { - Alignment = StringAlignment.Near, - LineAlignment = StringAlignment.Center - }); - - e.Graphics.DrawImage(B, 0, 0); - G.Dispose(); - B.Dispose(); - } - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/RadioButton/CrEaTiiOn_ModernRadioButton.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/RadioButton/CrEaTiiOn_ModernRadioButton.cs deleted file mode 100644 index 1899a92..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/RadioButton/CrEaTiiOn_ModernRadioButton.cs +++ /dev/null @@ -1,112 +0,0 @@ -#region Imports -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; -using System.Drawing; -using System.Drawing.Drawing2D; -#endregion - -namespace CBH.Controls -{ - class CrEaTiiOn_ModernRadioButton : CrEaTiiOn_Ultimate_RadioButton - { - //Fields - private Color checkedColor = Color.FromArgb(250, 36, 38); - private Color unCheckedColor = Color.Gray; - - //Properties - public Color CheckedColor - { - get - { - return checkedColor; - } - - set - { - checkedColor = value; - this.Invalidate(); - } - } - - public Color UnCheckedColor - { - get - { - return unCheckedColor; - } - - set - { - unCheckedColor = value; - this.Invalidate(); - } - } - - //Constructor - public CrEaTiiOn_ModernRadioButton() - { - this.MinimumSize = new Size(0, 21); - //Add a padding of 10 to the left to have a considerable distance between the text and the RadioButton. - this.Padding = new Padding(10,0,0,0); - } - - //Overridden methods - protected override void OnPaint(PaintEventArgs pevent) - { - //Fields - Graphics graphics = pevent.Graphics; - graphics.SmoothingMode = SmoothingMode.AntiAlias; - float rbBorderSize = 18F; - float rbCheckSize = 12F; - RectangleF rectRbBorder = new RectangleF() - { - X = 0.5F, - Y = (this.Height - rbBorderSize) / 2, //Center - Width = rbBorderSize, - Height = rbBorderSize - }; - RectangleF rectRbCheck = new RectangleF() - { - X = rectRbBorder.X + ((rectRbBorder.Width - rbCheckSize) / 2), //Center - Y = (this.Height - rbCheckSize) / 2, //Center - Width = rbCheckSize, - Height = rbCheckSize - }; - - //Drawing - using (Pen penBorder = new Pen(checkedColor, 1.6F)) - using (SolidBrush brushRbCheck = new SolidBrush(checkedColor)) - using (SolidBrush brushText = new SolidBrush(this.ForeColor)) - { - //Draw surface - graphics.Clear(this.BackColor); - //Draw Radio Button - if (this.Checked) - { - graphics.DrawEllipse(penBorder, rectRbBorder);//Circle border - graphics.FillEllipse(brushRbCheck, rectRbCheck); //Circle Radio Check - } - else - { - penBorder.Color = unCheckedColor; - graphics.DrawEllipse(penBorder, rectRbBorder); //Circle border - } - //Draw text - graphics.DrawString(this.Text, this.Font, brushText, - rbBorderSize + 8, (this.Height - TextRenderer.MeasureText(this.Text, this.Font).Height) / 2);//Y=Center - } - } - - //X-> Obsolete code, this was replaced by the Padding property in the constructor - //(this.Padding = new Padding(10,0,0,0);) - //protected override void OnResize(EventArgs e) - //{ - // base.OnResize(e); - // this.Width = TextRenderer.MeasureText(this.Text, this.Font).Width + 30; - //} - } -} diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/RadioButton/CrEaTiiOn_RadioButton.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/RadioButton/CrEaTiiOn_RadioButton.cs deleted file mode 100644 index 9452b52..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/RadioButton/CrEaTiiOn_RadioButton.cs +++ /dev/null @@ -1,165 +0,0 @@ -#region Imports - -using System; -using System.ComponentModel; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Windows.Forms; - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_RadioButton - - [DefaultEvent("CheckedChanged")] - public class CrEaTiiOn_Ultimate_RadioButton : Control - { - #region Variables - - private int X; - private bool _Checked; - private Color _CheckedColor = Color.FromArgb(250, 36, 38); - private Color _CircleColor = Color.FromArgb(15, 15, 15); - private SmoothingMode _SmoothingType = SmoothingMode.HighQuality; - - #endregion - - #region Properties - - public bool Checked - { - get => _Checked; - set - { - _Checked = value; - InvalidateControls(); - CheckedChangedEvent?.Invoke(this); - Invalidate(); - } - } - - public SmoothingMode SmoothingType - { - get => _SmoothingType; - set - { - _SmoothingType = value; - Invalidate(); - } - } - - public Color CircleColor - { - get => _CircleColor; - set - { - _CircleColor = value; - Invalidate(); - } - } - - public Color CheckedColor - { - get => _CheckedColor; - set - { - _CheckedColor = value; - Invalidate(); - } - } - - #endregion - - #region EventArgs - - public delegate void CheckedChangedEventHandler(object sender); - private CheckedChangedEventHandler CheckedChangedEvent; - - public event CheckedChangedEventHandler CheckedChanged - { - add => CheckedChangedEvent = (CheckedChangedEventHandler)Delegate.Combine(CheckedChangedEvent, value); - remove => CheckedChangedEvent = (CheckedChangedEventHandler)Delegate.Remove(CheckedChangedEvent, value); - } - - protected override void OnMouseDown(MouseEventArgs e) - { - if (!_Checked) - { - @Checked = true; - } - else - { - @Checked = false; - } - - Focus(); - base.OnMouseDown(e); - } - - protected override void OnMouseMove(MouseEventArgs e) - { - base.OnMouseMove(e); - X = e.X; - Invalidate(); - } - - protected override void OnTextChanged(EventArgs e) - { - base.OnTextChanged(e); - //Width = 20 + (int)CreateGraphics().MeasureString(Text, Font).Width; - //Width = 20 + (int)TextRenderer.MeasureText(Text, Font).Width; - } - - protected override void OnResize(EventArgs e) - { - base.OnResize(e); - Height = 17; - } - - #endregion - - public CrEaTiiOn_Ultimate_RadioButton() - { - Size = new(120, 17); - DoubleBuffered = true; - Cursor = Cursors.Hand; - ForeColor = Color.White; - } - - private void InvalidateControls() - { - if (!IsHandleCreated || !_Checked) - { - return; - } - - foreach (Control _Control in Parent.Controls) - { - if (_Control != this && _Control is CrEaTiiOn_Ultimate_RadioButton button) - { - button.Checked = false; - } - } - } - - protected override void OnPaint(PaintEventArgs e) - { - base.OnPaint(e); - Graphics G = e.Graphics; - G.Clear(Parent.BackColor); - G.SmoothingMode = SmoothingType; - - G.FillEllipse(new SolidBrush(CircleColor), new Rectangle(0, 0, 16, 16)); - - if (_Checked) - { - G.DrawString("a", new Font("Marlett", 15), new SolidBrush(CheckedColor), new Point(-3, -2)); - } - - G.DrawString(Text, Font, new SolidBrush(ForeColor), new Point(20, -3)); - } - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/RichTextBox/CrEaTiiOn_RichTextBox.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/RichTextBox/CrEaTiiOn_RichTextBox.cs deleted file mode 100644 index 4b3724b..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/RichTextBox/CrEaTiiOn_RichTextBox.cs +++ /dev/null @@ -1,207 +0,0 @@ -#region Imports - -using System; -using System.ComponentModel; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Windows.Forms; - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_RichTextBox - - [DefaultEvent("TextChanged")] - public class CrEaTiiOn_RichTextBox : Control - { - #region Variables - - public System.Windows.Forms.RichTextBox DungeonRTB = new(); - private bool _ReadOnly; - private bool _WordWrap; - private bool _AutoWordSelection; - private GraphicsPath Shape; - private Pen P1; - private Color _BorderColor = Color.FromArgb(250, 36, 38); - private Color _EdgeColor = Color.FromArgb(15, 15, 15); - private Color _TextBackColor = Color.FromArgb(15, 15, 15); - - #endregion - - #region Properties - - public Color BorderColor - { - get => _BorderColor; - set => _BorderColor = value; - } - - public Color EdgeColor - { - get => _EdgeColor; - set => _EdgeColor = value; - } - - public Color TextBackColor - { - get => _TextBackColor; - set => _TextBackColor = value; - } - - public override string Text - { - get => DungeonRTB.Text; - set - { - DungeonRTB.Text = value; - Invalidate(); - } - } - public bool ReadOnly - { - get => _ReadOnly; - set - { - _ReadOnly = value; - if (DungeonRTB != null) - { - DungeonRTB.ReadOnly = value; - } - } - } - public bool WordWrap - { - get => _WordWrap; - set - { - _WordWrap = value; - if (DungeonRTB != null) - { - DungeonRTB.WordWrap = value; - } - } - } - public bool AutoWordSelection - { - get => _AutoWordSelection; - set - { - _AutoWordSelection = value; - if (DungeonRTB != null) - { - DungeonRTB.AutoWordSelection = value; - } - } - } - #endregion - - #region EventArgs - - protected override void OnForeColorChanged(System.EventArgs e) - { - base.OnForeColorChanged(e); - DungeonRTB.ForeColor = ForeColor; - Invalidate(); - } - - protected override void OnFontChanged(System.EventArgs e) - { - base.OnFontChanged(e); - DungeonRTB.Font = Font; - } - protected override void OnPaintBackground(PaintEventArgs e) - { - base.OnPaintBackground(e); - } - - protected override void OnSizeChanged(System.EventArgs e) - { - base.OnSizeChanged(e); - DungeonRTB.Size = new(Width - 13, Height - 11); - } - - private void _Enter(object Obj, EventArgs e) - { - P1 = new(Color.FromArgb(205, 87, 40)); - Refresh(); - } - - private void _Leave(object Obj, EventArgs e) - { - P1 = new(Color.FromArgb(180, 180, 180)); - Refresh(); - } - - protected override void OnResize(System.EventArgs e) - { - base.OnResize(e); - - Shape = new(); - GraphicsPath _Shape = Shape; - _Shape.AddArc(0, 0, 10, 10, 180, 90); - _Shape.AddArc(Width - 11, 0, 10, 10, -90, 90); - _Shape.AddArc(Width - 11, Height - 11, 10, 10, 0, 90); - _Shape.AddArc(0, Height - 11, 10, 10, 90, 90); - _Shape.CloseAllFigures(); - } - - public void _TextChanged(object s, EventArgs e) - { - DungeonRTB.Text = Text; - } - - #endregion - - public void AddRichTextBox() - { - System.Windows.Forms.RichTextBox _RTB = DungeonRTB; - _RTB.BackColor = _TextBackColor; - _RTB.Size = new(Width - 10, 100); - _RTB.Location = new(7, 5); - _RTB.Text = string.Empty; - _RTB.BorderStyle = BorderStyle.None; - _RTB.Font = Font; - _RTB.Multiline = true; - } - - public CrEaTiiOn_RichTextBox() : base() - { - SetStyle(ControlStyles.SupportsTransparentBackColor, true); - SetStyle(ControlStyles.UserPaint, true); - - AddRichTextBox(); - Controls.Add(DungeonRTB); - BackColor = Color.Transparent; - ForeColor = Color.White; - - P1 = new(_BorderColor); - Text = null; - Font = new("Tahoma", 10); - Size = new(150, 100); - WordWrap = true; - AutoWordSelection = false; - DoubleBuffered = true; - - DungeonRTB.Enter += _Enter; - DungeonRTB.Leave += _Leave; - TextChanged += _TextChanged; - } - - protected override void OnPaint(PaintEventArgs e) - { - base.OnPaint(e); - Bitmap B = new(Width, Height); - Graphics G = Graphics.FromImage(B); - G.SmoothingMode = SmoothingMode.AntiAlias; - G.Clear(BackColor); - G.FillPath(new SolidBrush(_EdgeColor), Shape); - G.DrawPath(P1, Shape); - G.Dispose(); - e.Graphics.DrawImage((Image)B.Clone(), 0, 0); - B.Dispose(); - } - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/Segment/CrEaTiiOn_Segment.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/Segment/CrEaTiiOn_Segment.cs deleted file mode 100644 index 37c9d68..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/Segment/CrEaTiiOn_Segment.cs +++ /dev/null @@ -1,448 +0,0 @@ -#region Imports - -using System; -using System.ComponentModel; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Drawing.Text; -using System.Windows.Forms; - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_Segment - - public class CrEaTiiOn_Segment : Control - { - public CrEaTiiOn_Segment() - { - base.Size = new Size(240, 30); - Cursor = Cursors.Hand; - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The items, split by ','.")] - public string Items - { - get => items; - set - { - items = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The selected index")] - public int SelectedIndex - { - get => selectedIndex; - set - { - selectedIndex = value; - OnIndexChanged(); - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The segment style")] - public Style SegmentStyle - { - get => segmentStyle; - set - { - segmentStyle = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The segment selected base color")] - public Color SegmentColor - { - get => segmentColor; - set - { - segmentColor = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The segment back color")] - public Color SegmentBackColor - { - get => segmentBackColor; - set - { - segmentBackColor = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The active segment text color")] - public Color SegmentActiveTextColor - { - get => segmentActiveTextColor; - set - { - segmentActiveTextColor = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The active segment android font color")] - public Color SegmentActiveFontColor - { - get => segmentActiveFontColor; - set - { - segmentActiveFontColor = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("Theinactive segment android font color")] - public Color SegmentInactiveFontColor - { - get => segmentInactiveFontColor; - set - { - segmentInactiveFontColor = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The active segment ios back color")] - public Color SegmentActiveBackColor - { - get => segmentActiveBackColor; - set - { - segmentActiveBackColor = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("Theinactive segment text color")] - public Color SegmentInactiveTextColor - { - get => segmentInactiveTextColor; - set - { - segmentInactiveTextColor = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("Theinactive segment ios border color")] - public Color SegmentInactiveBorderColor - { - get => segmentInactiveBorderColor; - set - { - segmentInactiveBorderColor = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("Theinactive segment android normal color")] - public Color SegmentNormalBackColor - { - get => segmentNormalBackColor; - set - { - segmentNormalBackColor = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The active segment android line color")] - public Color SegmentActiveLineColor - { - get => segmentActiveLineColor; - set - { - segmentActiveLineColor = value; - base.Invalidate(); - } - } - - private InterpolationMode _InterpolationType = InterpolationMode.HighQualityBilinear; - [Category("CrEaTiiOn")] - [Browsable(true)] - public InterpolationMode InterpolationType - { - get => _InterpolationType; - set - { - _InterpolationType = value; - Invalidate(); - } - } - - private CompositingQuality _CompositingQualityType = CompositingQuality.HighQuality; - [Category("CrEaTiiOn")] - [Browsable(true)] - public CompositingQuality CompositingQualityType - { - get => _CompositingQualityType; - set - { - _CompositingQualityType = value; - Invalidate(); - } - } - - private TextRenderingHint _TextRenderingType = TextRenderingHint.ClearTypeGridFit; - [Category("CrEaTiiOn")] - [Browsable(true)] - public TextRenderingHint TextRenderingType - { - get => _TextRenderingType; - set - { - _TextRenderingType = value; - Invalidate(); - } - } - - public event EventHandler IndexChanged; - - protected virtual void OnIndexChanged() - { - IndexChanged?.Invoke(this, new EventArgs()); - } - - protected override void OnPaint(PaintEventArgs e) - { - base.OnPaint(e); - e.Graphics.InterpolationMode = InterpolationType; - e.Graphics.CompositingQuality = CompositingQualityType; - e.Graphics.TextRenderingHint = TextRenderingType; - int num = 0; - foreach (string text in items.Split(new char[] - { - ',' - })) - { - num++; - } - int num2 = base.Width / num; - int num3 = 0; - int num4 = 0; - if (segmentStyle == Style.iOS) - { - foreach (string s in items.Split(new char[] - { - ',' - })) - { - if (num3 <= num) - { - Rectangle r = new(num4, 0, num2, base.Height); - StringFormat stringFormat = new() - { - LineAlignment = StringAlignment.Center, - Alignment = StringAlignment.Center - }; - e.Graphics.DrawRectangle(new Pen(SegmentInactiveBorderColor, 1f), 0, 0, base.Width - 1, base.Height - 1); - if (selectedIndex == num3) - { - e.Graphics.FillRectangle(new SolidBrush(SegmentActiveBackColor), num4, 0, num2, base.Height); - e.Graphics.DrawString(s, Font, new SolidBrush(SegmentActiveTextColor), r, stringFormat); - } - else - { - e.Graphics.DrawRectangle(new Pen(SegmentInactiveBorderColor, 1f), num4, 0, num4 + num2, base.Height - 1); - e.Graphics.DrawString(s, Font, new SolidBrush(SegmentInactiveBorderColor), r, stringFormat); - } - } - num4 += num2; - num3++; - } - } - if (segmentStyle == Style.Android) - { - e.Graphics.FillRectangle(new SolidBrush(SegmentNormalBackColor), 0, 0, base.Width, base.Height); - foreach (string s2 in items.Split(new char[] - { - ',' - })) - { - if (num3 <= num) - { - Rectangle r2 = new(num4, 0, num2, base.Height - 5); - StringFormat stringFormat2 = new() - { - LineAlignment = StringAlignment.Center, - Alignment = StringAlignment.Center - }; - if (selectedIndex == num3) - { - e.Graphics.FillRectangle(new SolidBrush(SegmentActiveLineColor), num4, base.Height - 3, num2, 3); - e.Graphics.DrawString(s2, Font, new SolidBrush(SegmentActiveFontColor), r2, stringFormat2); - } - else - { - e.Graphics.DrawString(s2, Font, new SolidBrush(SegmentInactiveFontColor), r2, stringFormat2); - } - } - num4 += num2; - num3++; - } - } - if (segmentStyle == Style.Material) - { - e.Graphics.FillRectangle(new SolidBrush(segmentBackColor), 0, 0, base.Width, base.Height); - foreach (string s3 in items.Split(new char[] - { - ',' - })) - { - if (num3 <= num) - { - Rectangle r3 = new(num4, 0, num2, base.Height - 5); - StringFormat stringFormat3 = new() - { - LineAlignment = StringAlignment.Center, - Alignment = StringAlignment.Center - }; - if (selectedIndex == num3) - { - e.Graphics.FillRectangle(new SolidBrush(segmentColor), num4, base.Height - 3, num2, 3); - e.Graphics.DrawString(s3, Font, new SolidBrush(segmentActiveTextColor), r3, stringFormat3); - } - else - { - e.Graphics.DrawString(s3, Font, new SolidBrush(segmentInactiveTextColor), r3, stringFormat3); - } - } - num4 += num2; - num3++; - } - } - } - - protected override void OnMouseDown(MouseEventArgs e) - { - base.OnMouseDown(e); - int num = 0; - int num2 = 0; - foreach (string text in items.Split(new char[] - { - ',' - })) - { - num2++; - } - int num3 = base.Width / num2; - if (e.X > 0) - { - num = 0; - } - if (e.X > num3) - { - num = 1; - } - if (e.X > num3 * 2) - { - num = 2; - } - if (e.X > num3 * 3) - { - num = 3; - } - if (e.X > num3 * 4) - { - num = 4; - } - if (e.X > num3 * 5) - { - num = 5; - } - if (e.X > num3 * 6) - { - num = 6; - } - if (e.X > num3 * 7) - { - num = 7; - } - if (e.X > num3 * 8) - { - num = 8; - } - if (e.X > num3 * 9) - { - num = 9; - } - if (e.X > num3 * 10) - { - num = 10; - } - if (num != selectedIndex) - { - SelectedIndex = num; - } - } - - private string items = "Contacts, Recents, Messages, Dialer"; - - private int selectedIndex; - - private Style segmentStyle = Style.Material; - - private Color segmentColor = Color.White; - - private Color segmentBackColor = Color.FromArgb(0, 150, 135); - - private Color segmentActiveTextColor = Color.White; - - private Color segmentActiveFontColor = Color.FromArgb(65, 130, 205); - - private Color segmentActiveBackColor = Color.FromArgb(0, 120, 255); - - private Color segmentActiveLineColor = Color.FromArgb(65, 130, 205); - - private Color segmentInactiveTextColor = Color.FromArgb(150, 210, 210); - - private Color segmentInactiveFontColor = Color.FromArgb(153, 153, 153); - - private Color segmentInactiveBorderColor = Color.FromArgb(0, 120, 255); - - private Color segmentNormalBackColor = Color.White; - - public enum Style - { - iOS, - Android, - Material - } - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/Separator/CrEaTiiOn_LightSeperator.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/Separator/CrEaTiiOn_LightSeperator.cs deleted file mode 100644 index a78f3d9..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/Separator/CrEaTiiOn_LightSeperator.cs +++ /dev/null @@ -1,58 +0,0 @@ -#region Imports -using System; -using System.Collections.Generic; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Windows.Forms; -#endregion - -namespace CBH.Controls -{ - public class CrEaTiiOn_LightSeperator : Control - { - protected override void OnPaint(PaintEventArgs e) - { - base.OnPaint(e); - - Graphics g = e.Graphics; - g.SmoothingMode = SmoothingMode.HighQuality; - g.Clear(Parent.BackColor); - - Point p1 = new Point(); - Point p2 = new Point(); - p1 = new Point(0, (Height - 1) / 2); - p2 = new Point(Width, (Height - 1) / 2); - - ColorBlend lineCB = new ColorBlend(3); - lineCB.Colors = new[] { Color.Transparent, _lineColor, Color.Transparent }; - lineCB.Positions = new[] { 0.0F, 0.5F, 1.0F }; - - LinearGradientBrush lineLGB = new LinearGradientBrush(p1, p2, Color.Transparent, Color.Transparent); - lineLGB.InterpolationColors = lineCB; - - g.DrawLine(new Pen(lineLGB), p1, p2); - - } - - public CrEaTiiOn_LightSeperator() - { - SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.UserPaint, true); - Size = new Size(400, 9); - } - - private Color _lineColor = Color.Silver; - public Color LineColor - { - get - { - return _lineColor; - } - set - { - _lineColor = value; - Invalidate(); - } - } - - } -} diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/Separator/CrEaTiiOn_ModernSeperator.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/Separator/CrEaTiiOn_ModernSeperator.cs deleted file mode 100644 index 1e8adc1..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/Separator/CrEaTiiOn_ModernSeperator.cs +++ /dev/null @@ -1,99 +0,0 @@ -#region Imports -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Windows.Forms; -using CBH_Ultimate_Theme_Library; -#endregion - -namespace CBH.Controls -{ - - public class CrEaTiiOn_ModernSeperator : ThemeControl154 - { - - private Orientation _Orientation; - public Orientation Orientation - { - get { return _Orientation; } - set - { - _Orientation = value; - - if (value == Orientation.Vertical) - { - LockHeight = 0; - LockWidth = 14; - } - else - { - LockHeight = 14; - LockWidth = 0; - } - - Invalidate(); - } - } - - public CrEaTiiOn_ModernSeperator() - { - Transparent = true; - BackColor = Color.Transparent; - - LockHeight = 14; - } - - - protected override void ColorHook() - { - } - - protected override void PaintHook() - { - G.Clear(BackColor); - - ColorBlend BL1 = new ColorBlend(); - ColorBlend BL2 = new ColorBlend(); - BL1.Positions = new float[] { - 0f, - 0.15f, - 0.85f, - 1f - }; - BL2.Positions = new float[] { - 0f, - 0.15f, - 0.5f, - 0.85f, - 1f - }; - - BL1.Colors = new Color[] { - Color.Transparent, - Color.Black, - Color.Black, - Color.Transparent - }; - BL2.Colors = new Color[] { - Color.Transparent, - Color.FromArgb(35, 35, 35), - Color.FromArgb(45, 45, 45), - Color.FromArgb(35, 35, 35), - Color.Transparent - }; - - if (_Orientation == Orientation.Vertical) - { - DrawGradient(BL1, 6, 0, 1, Height); - DrawGradient(BL2, 7, 0, 1, Height); - } - else - { - DrawGradient(BL1, 0, 6, Width, 1, 0f); - DrawGradient(BL2, 0, 7, Width, 1, 0f); - } - - } - - } - -} diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/Separator/CrEaTiiOn_Separator.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/Separator/CrEaTiiOn_Separator.cs deleted file mode 100644 index bb3ded3..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/Separator/CrEaTiiOn_Separator.cs +++ /dev/null @@ -1,43 +0,0 @@ -#region Imports - -using System.Drawing; -using System.Windows.Forms; - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_Separator - - public class CrEaTiiOn_Separator : Control - { - #region Properties - - private Color _LineColor = Color.Gray; - public Color LineColor - { - get => _LineColor; - set - { - _LineColor = value; - Invalidate(); - } - } - - #endregion - - public CrEaTiiOn_Separator() - { - SetStyle(ControlStyles.ResizeRedraw, true); - Size = new(120, 10); - } - - protected override void OnPaint(PaintEventArgs e) - { - base.OnPaint(e); - e.Graphics.DrawLine(new(LineColor), 0, 5, Width, 5); - } - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/Sleeper/CrEaTiiOn_Sleeper.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/Sleeper/CrEaTiiOn_Sleeper.cs deleted file mode 100644 index 71b08ad..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/Sleeper/CrEaTiiOn_Sleeper.cs +++ /dev/null @@ -1,27 +0,0 @@ -#region Imports - -using System; -using System.ComponentModel; -using System.Windows.Forms; - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_Sleeper - - public class CrEaTiiOn_Sleeper : Component - { - public void Sleep(int Milliseconds) - { - DateTime Time = DateTime.Now.AddMilliseconds(Milliseconds); - - while (DateTime.Now < Time) - { - Application.DoEvents(); - } - } - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/Slider/CrEaTiiOn_FlatSliderBar.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/Slider/CrEaTiiOn_FlatSliderBar.cs deleted file mode 100644 index b62903d..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/Slider/CrEaTiiOn_FlatSliderBar.cs +++ /dev/null @@ -1,164 +0,0 @@ -#region Imports -using CBH_Ultimate_Theme_Library.Theme.Helpers; -using System; -using System.ComponentModel; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Drawing.Text; -using System.Windows.Forms; -#endregion - -namespace CBH.Controls -{ - public class CrEaTiiOn_FlatSliderBar : Control - { - #region 变量 - private RectangleF valueBar = new RectangleF(7, 5, 0, 6); - private RectangleF valueRect = new RectangleF(0, 1, 14, 14); - private bool mouseFlat = false; - - #endregion - - #region 属性 - private Color _themeColor = ThemeColors.PrimaryColor; - [Description("主题颜色")] - public Color ThemeColor - { - get { return _themeColor; } - set - { - _themeColor = value; - Invalidate(); - } - } - - private int _minValue = 0; - [Description("Slider的最小值")] - public int MinValue - { - get { return _minValue; } - set - { - if (value > _maxValue || value > _value) return; - _minValue = value; - Invalidate(); - } - } - - private int _maxValue = 10; - [Description("Slider的最大值")] - public int MaxValue - { - get { return _maxValue; } - set - { - if (value < _minValue || value < _value) return; - _maxValue = value; - Invalidate(); - } - } - - private int _value = 0; - [Description("Slider的当前值")] - public int Value - { - get { return _value; } - set - { - _value = value >= _minValue && value <= _maxValue ? value : _minValue; - Invalidate(); - } - } - - private bool _showValue = false; - [Description("是否显示数值")] - public bool ShowValue - { - get { return _showValue; } - set - { - _showValue = value; - Invalidate(); - } - } - - private int ValueWidth - { - get { return Convert.ToInt32(_value * (Width - 30) / (_maxValue - _minValue)); } - } - - #endregion - - #region 事件 - protected override void OnResize(EventArgs e) - { - base.OnResize(e); - Height = _showValue ? 45 : 16; - } - - protected override void OnMouseDown(MouseEventArgs e) - { - base.OnMouseDown(e); - if (e.Button == MouseButtons.Left) - { - mouseFlat = new RectangleF(ValueWidth + 7, Height - 15, 14, 14).Contains(e.Location); - Invalidate(); - } - } - - protected override void OnMouseMove(MouseEventArgs e) - { - base.OnMouseMove(e); - if (mouseFlat && e.X > -1 && e.X < (Width + 1)) - { - _value = _minValue + Convert.ToInt32((float)(_maxValue - _minValue) * ((float)e.X / (float)Width)); - Invalidate(); - } - } - - protected override void OnMouseUp(MouseEventArgs e) - { - base.OnMouseUp(e); - mouseFlat = false; - Invalidate(); - } - - #endregion - - protected override void OnPaint(PaintEventArgs e) - { - Graphics graphics = e.Graphics; - graphics.SmoothingMode = SmoothingMode.HighQuality; - graphics.PixelOffsetMode = PixelOffsetMode.HighQuality; - graphics.TextRenderingHint = TextRenderingHint.ClearTypeGridFit; - graphics.Clear(Parent.BackColor); - - if (ShowValue && mouseFlat) - { - graphics.FillEllipse(new SolidBrush(_themeColor), new RectangleF(ValueWidth - 2 + 5, 1, 18, 18)); - graphics.FillPolygon(new SolidBrush(_themeColor), new PointF[] - { - new PointF(ValueWidth+1.305F-2+5,13.5F+1), - new PointF(ValueWidth+7.794F+9-2+5,13.5F+1), - new PointF(ValueWidth+9-2+5,28F) - }); - graphics.DrawString(_value.ToString(), Font, new SolidBrush(Color.White), new RectangleF(ValueWidth - 2 + 5, 2, 18, 18), StringAlign.Center); - } - - graphics.FillRectangle(new SolidBrush(DrawHelper.BackColor), new RectangleF(15, Height - 10, Width - 30, 4)); - graphics.FillRectangle(new SolidBrush(Color.White), new RectangleF(15, Height - 10, ValueWidth, 4)); - graphics.FillRectangle(new SolidBrush(_themeColor), new RectangleF(15, Height - 10, ValueWidth, 4)); - graphics.FillEllipse(new SolidBrush(_themeColor), new RectangleF(ValueWidth + 5, Height - 17, 16, 16)); - graphics.FillEllipse(new SolidBrush(Color.White), new RectangleF(ValueWidth + 8, Height - 14, 10, 10)); - } - - - public CrEaTiiOn_FlatSliderBar() - { - SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.OptimizedDoubleBuffer, true); - DoubleBuffered = true; - Height = 45; - Font = new Font("Segoe UI", 8F); - } - } -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/Slider/CrEaTiiOn_ModernSlider.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/Slider/CrEaTiiOn_ModernSlider.cs deleted file mode 100644 index 6c478e3..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/Slider/CrEaTiiOn_ModernSlider.cs +++ /dev/null @@ -1,445 +0,0 @@ -#region Imports - -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Windows.Forms; - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_ModernSlider - - public class CrEaTiiOn_ModernSlider : Control - { - public CrEaTiiOn_ModernSlider() - { - base.Size = new Size(250, 20); - base.SetStyle(ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, true); - barRectangle = new(base.Height / 2 + 1, 1, base.Width - base.Height, base.Height - 1); - Cursor = Cursors.Hand; - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The bar thickness")] - public int BarThickness - { - get => barThickness; - set - { - barThickness = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The increment incresed or decreased when not clicking in the handle")] - public int BigStepIncrement - { - get => bigStepIncrement; - set - { - bigStepIncrement = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The default percentage")] - public int Percentage - { - get => percentage; - set - { - percentage = value; - OnScroll(); - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The max percentage")] - public int Max - { - get => max; - set - { - max = value; - OnScroll(); - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The filled color")] - public Color FilledColor - { - get => filledColor; - set - { - filledColor = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The unfilled color")] - public Color UnfilledColor - { - get => unfilledColor; - set - { - unfilledColor = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The knob color")] - public Color KnobColor - { - get => knobColor; - set - { - knobColor = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The knob image")] - public Image KnobImage - { - get => knobImage; - set - { - knobImage = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("Allow instantly jumping to the position clicked")] - public bool QuickHopping - { - get => quickHopping; - set - { - quickHopping = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The slider style")] - public Style SliderStyle - { - get => sliderStyle; - set - { - sliderStyle = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The positions")] - public List Positions - { - get => _Positions; - set - { - _Positions = value; - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The colors")] - public List Colors - { - get => _Colors; - set - { - _Colors = value; - base.Invalidate(); - } - } - - private SmoothingMode _SmoothingType = SmoothingMode.AntiAlias; - [Category("CrEaTiiOn")] - [Browsable(true)] - public SmoothingMode SmoothingType - { - get => _SmoothingType; - set - { - _SmoothingType = value; - Invalidate(); - } - } - - private PixelOffsetMode _PixelOffsetType = PixelOffsetMode.HighQuality; - [Category("CrEaTiiOn")] - [Browsable(true)] - public PixelOffsetMode PixelOffsetType - { - get => _PixelOffsetType; - set - { - _PixelOffsetType = value; - Invalidate(); - } - } - - private CompositingQuality _CompositingQualityType = CompositingQuality.HighQuality; - [Category("CrEaTiiOn")] - [Browsable(true)] - public CompositingQuality CompositingQualityType - { - get => _CompositingQualityType; - set - { - _CompositingQualityType = value; - Invalidate(); - } - } - - private InterpolationMode _InterpolationType = InterpolationMode.HighQualityBilinear; - [Category("CrEaTiiOn")] - [Browsable(true)] - public InterpolationMode InterpolationType - { - get => _InterpolationType; - set - { - _InterpolationType = value; - Invalidate(); - } - } - - public event EventHandler Scroll; - - protected virtual void OnScroll() - { - Scroll?.Invoke(this, EventArgs.Empty); - } - - protected override void OnMouseDown(MouseEventArgs e) - { - base.OnMouseDown(e); - if (quickHopping) - { - Percentage = (int)Math.Round(max * e.X / (double)base.Width); - onHandle = true; - return; - } - - int num = Percentage * base.Width / max; - - if (e.X > num - base.Height / 2 && e.X < num + base.Height / 2) - { - onHandle = true; - return; - } - - if (e.X < num - base.Height / 2) - { - Percentage -= bigStepIncrement; - if (Percentage < 0) - { - Percentage = 0; - } - base.Invalidate(); - return; - } - - if (e.X > num + base.Height / 2) - { - Percentage += bigStepIncrement; - if (Percentage > max) - { - Percentage = max; - } - base.Invalidate(); - } - } - - protected override void OnMouseMove(MouseEventArgs e) - { - base.OnMouseMove(e); - if (onHandle) - { - Percentage = (int)Math.Round(max * e.X / (double)base.Width); - if (Percentage < 0) - { - Percentage = 0; - } - if (Percentage > max) - { - Percentage = max; - } - base.Invalidate(); - } - } - - protected override void OnMouseUp(MouseEventArgs e) - { - base.OnMouseUp(e); - onHandle = false; - } - - protected override void OnPaint(PaintEventArgs e) - { - base.OnPaint(e); - - BufferedGraphicsContext bufferedGraphicsContext = BufferedGraphicsManager.Current; - bufferedGraphicsContext.MaximumBuffer = new Size(base.Width + 1, base.Height + 1); - - bufferedGraphics = bufferedGraphicsContext.Allocate(base.CreateGraphics(), base.ClientRectangle); - - bufferedGraphics.Graphics.SmoothingMode = SmoothingType; - bufferedGraphics.Graphics.InterpolationMode = InterpolationType; - bufferedGraphics.Graphics.CompositingQuality = CompositingQualityType; - bufferedGraphics.Graphics.PixelOffsetMode = PixelOffsetType; - - int num = Percentage * base.Width / max; - int num2 = Percentage * barRectangle.Width / max; - - bufferedGraphics.Graphics.Clear(BackColor); - - if (sliderStyle == Style.Flat) - { - bufferedGraphics.Graphics.FillRectangle(new SolidBrush(unfilledColor), base.Height / 2 + 1, base.Height / 2 - barThickness / 2, base.Width - base.Height - 2, barThickness); - bufferedGraphics.Graphics.FillRectangle(new SolidBrush(filledColor), 1 + base.Height / 2, base.Height / 2 - barThickness / 2, num2 - 2, barThickness); - - if (knobImage == null) - { - bufferedGraphics.Graphics.FillEllipse(new SolidBrush(knobColor), num2 + 1, 1, base.Height - 2, base.Height - 2); - } - else - { - bufferedGraphics.Graphics.DrawImage(new Bitmap(knobImage, base.Height - 2, base.Height - 2), num2 + 1, 1); - } - } - - if (sliderStyle == Style.MacOS) - { - bufferedGraphics.Graphics.FillRectangle(new SolidBrush(Color.FromArgb(185, 185, 185)), base.Height / 2 + 1, base.Height / 2 - barThickness / 2, base.Width - base.Height - 2, barThickness); - bufferedGraphics.Graphics.FillRectangle(new SolidBrush(Color.FromArgb(80, 150, 230)), 1 + base.Height / 2, base.Height / 2 - barThickness / 2, num2 - 2, barThickness); - bufferedGraphics.Graphics.FillEllipse(new SolidBrush(Color.White), num2 + 1, 1, base.Height - 2, base.Height - 2); - bufferedGraphics.Graphics.DrawEllipse(new Pen(Color.FromArgb(190, 200, 200)), num2 + 1, 1, base.Height - 2, base.Height - 2); - } - - if (sliderStyle == Style.Windows10) - { - bufferedGraphics.Graphics.FillRectangle(new SolidBrush(Color.FromArgb(146, 147, 148)), base.Height / 2 + 1, base.Height / 2 - barThickness / 2, base.Width - base.Height - 2, barThickness); - bufferedGraphics.Graphics.FillRectangle(new SolidBrush(Color.FromArgb(65, 155, 225)), 1 + base.Height / 2, base.Height / 2 - barThickness / 2, num2 - 2, barThickness); - bufferedGraphics.Graphics.FillRectangle(new SolidBrush(Color.FromArgb(0, 120, 215)), num2 + 1 + base.Height / 3, 3, base.Height / 2 - 2, base.Height - 6); - bufferedGraphics.Graphics.FillEllipse(new SolidBrush(Color.FromArgb(0, 120, 215)), num2 + 1 + base.Height / 3, 0, base.Height / 2 - 2, 4); - bufferedGraphics.Graphics.FillEllipse(new SolidBrush(Color.FromArgb(0, 120, 215)), num2 + 1 + base.Height / 3, base.Height - 5, base.Height / 2 - 2, 4); - } - - if (sliderStyle == Style.Android) - { - bufferedGraphics.Graphics.FillRectangle(new SolidBrush(Color.FromArgb(20, 20, 20)), base.Height / 2 + 1, base.Height / 2 - barThickness / 2, base.Width - base.Height - 2, barThickness); - bufferedGraphics.Graphics.FillRectangle(new SolidBrush(Color.FromArgb(250, 36, 38)), 1 + base.Height / 2, base.Height / 2 - barThickness / 2, num2 - 2, barThickness); - bufferedGraphics.Graphics.FillEllipse(new SolidBrush(Color.FromArgb(250, 36, 38)), num2 + 1 + barThickness / 3 * 5, base.Height / 2 - barThickness / 3 * 4, barThickness * 2, barThickness * 2); - bufferedGraphics.Graphics.FillEllipse(new SolidBrush(Color.FromArgb(20, 20, 20)), num2 + 1, 1, base.Height - 2, base.Height - 2); - } - - if (sliderStyle == Style.Material && Positions.Count == Colors.Count) - { - LinearGradientBrush linearGradientBrush = new(new Rectangle(0, 0, base.Width, base.Height), Color.Black, Color.Black, 0f, false) - { - InterpolationColors = new ColorBlend - { - Positions = Positions.ToArray(), - Colors = Colors.ToArray() - } - }; - - linearGradientBrush.RotateTransform(1f); - - bufferedGraphics.Graphics.FillRectangle(linearGradientBrush, base.Height / 2 + 1, base.Height / 2 - barThickness / 2, base.Width - base.Height - 2, barThickness); - bufferedGraphics.Graphics.FillRectangle(new SolidBrush(Color.LightGray), 1 + base.Height / 2 + num2, base.Height / 2 - barThickness / 2, base.Width - base.Height - 2 - num2, barThickness); - bufferedGraphics.Graphics.FillEllipse(new SolidBrush(Color.White), num2 + 1, 1, base.Height - 2, base.Height - 2); - bufferedGraphics.Graphics.DrawEllipse(new Pen(Color.FromArgb(200, 200, 200)), num2 + 1, 1, base.Height - 2, base.Height - 2); - } - - bufferedGraphics.Render(e.Graphics); - } - - private Rectangle barRectangle; - - private BufferedGraphics bufferedGraphics; - - private bool onHandle; - - private int barThickness = 4; - - private int bigStepIncrement = 10; - - private int max = 100; - - private int percentage = 50; - - private Color filledColor = Color.FromArgb(1, 119, 215); - - private Color unfilledColor = Color.FromArgb(26, 169, 219); - - private Color knobColor = Color.Gray; - - private Image knobImage; - - private bool quickHopping; - - private Style sliderStyle = Style.Windows10; - - private List _Positions = new() - { - 0f, - 0.2f, - 0.4f, - 0.6f, - 0.8f, - 1f - }; - - private List _Colors = new() - { - Color.FromArgb(76, 217, 100), - Color.FromArgb(85, 205, 205), - Color.FromArgb(2, 124, 255), - Color.FromArgb(130, 75, 180), - Color.FromArgb(255, 0, 150), - Color.FromArgb(255, 45, 85) - }; - - public enum Style - { - Flat, - Material, - MacOS, - Android, - Windows10 - } - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/StatusBar/CrEaTiiOn_FlatStatusBar.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/StatusBar/CrEaTiiOn_FlatStatusBar.cs deleted file mode 100644 index bb14c27..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/StatusBar/CrEaTiiOn_FlatStatusBar.cs +++ /dev/null @@ -1,253 +0,0 @@ -#region Imports -using CBH_Ultimate_Theme_Library.Theme.Helpers; -using System; -using System.ComponentModel; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Drawing.Text; -using System.Windows.Forms; -#endregion - -namespace CBH.Controls -{ - public class CrEaTiiOn_FlatStatusBar : ContainerControl - { - private bool mouseFlag = false;//鼠标状态 - private Point mousePoint;//鼠标位置 - private Rectangle minRectangle;//最小化按钮区域 - private Rectangle maxRectangle;//最大化按钮区域 - private Rectangle closeRectangle;//关闭按钮区域 - - private Color _themeColor = ThemeColors.LightPrimary;//主题颜色 - private Image _iconImage = null;//应用图标 - #region 属性 - - [Category("背景颜色")] - public Color ThemeColor - { - get { return _themeColor; } - set - { - _themeColor = value; - Invalidate(); - } - } - - /// - /// 是否显示最小化 - /// - [DefaultValue(true)] - [Category("获取或设置一个值,该值指示是否在窗体的标题栏中显示“最小化”按钮。")] - public bool MinimizeBox - { - get - { - return ParentForm.MinimizeBox; - } - } - - /// - /// 是否显示最大化 - /// - [DefaultValue(true)] - [Category("获取或设置一个值,该值指示是否在窗体的标题栏中显示“最大化”按钮。")] - public bool MaximizeBox - { - get - { - return ParentForm.MaximizeBox; - } - } - - /// - /// 控件框是否显示在标题中 - /// - [DefaultValue(true)] - [Category("获取或设置一个值,该值指示控件框是否显示在标题中")] - public bool ControlBox - { - get - { - return ParentForm.ControlBox; - } - } - #endregion - - #region 事件 - protected override void OnMouseDown(MouseEventArgs e) - { - base.OnMouseDown(e); - if (e.Button == MouseButtons.Left) - { - mouseFlag = true; - mousePoint = e.Location; - } - } - - protected override void OnMouseMove(MouseEventArgs e) - { - base.OnMouseMove(e); - if (mouseFlag) - { - Parent.Location = new Point( - MousePosition.X - mousePoint.X, - MousePosition.Y - mousePoint.Y); - } - else - { - mousePoint = e.Location; - Invalidate(); - } - } - - protected override void OnMouseUp(MouseEventArgs e) - { - base.OnMouseUp(e); - mouseFlag = false; - } - - protected override void OnClick(EventArgs e) - { - base.OnClick(e); - if (minRectangle.Contains(mousePoint)) - { - ParentForm.WindowState = FormWindowState.Minimized; - } - if (maxRectangle.Contains(mousePoint)) - { - if (ParentForm.WindowState == FormWindowState.Maximized) - { - ParentForm.WindowState = FormWindowState.Normal; - } - else - { - ParentForm.WindowState = FormWindowState.Maximized; - } - } - if (closeRectangle.Contains(mousePoint)) - { - Environment.Exit(0); - } - } - - protected override void OnResize(EventArgs e) - { - base.OnResize(e); - Height = 40; - } - - protected override void OnCreateControl() - { - base.OnCreateControl(); - ParentForm.FormBorderStyle = FormBorderStyle.None; - ParentForm.AllowTransparency = false; - ParentForm.FindForm().StartPosition = FormStartPosition.CenterScreen; - ParentForm.MaximumSize = Screen.PrimaryScreen.WorkingArea.Size; - Invalidate(); - } - #endregion - - protected override void OnPaint(PaintEventArgs e) - { - base.OnPaint(e); - Location = new Point(0, 0); - Width = ParentForm.Width; - - Bitmap bitmap = new Bitmap(Width, Height); - Graphics graphics = Graphics.FromImage(bitmap); - - graphics.SmoothingMode = SmoothingMode.HighQuality;//消除锯齿 - graphics.PixelOffsetMode = PixelOffsetMode.HighQuality;//高质量显示 - graphics.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;//最高质量显示文本 - graphics.Clear(_themeColor); - - var icoFont = new Font("Marlett", 12); - // - //绘制应用图标 - // - if (_iconImage != null) - { - graphics.DrawImage(_iconImage, new Rectangle(10, 10, 25, 25)); - // - //绘制标题 - // - graphics.DrawString(Text, new Font("Segoe UI", 12f), new SolidBrush(ThemeColors.FourLevelBorder), new Rectangle(45, 1, Width - 100, Height), StringAlign.Left); - } - else - { - // - //绘制标题 - // - graphics.DrawString(Text, new Font("微软雅黑", 12f), new SolidBrush(ThemeColors.FourLevelBorder), new Rectangle(15, 1, Width - 100, Height), StringAlign.Left); - } - - if (ControlBox) - { - if (MinimizeBox) - { - minRectangle = new Rectangle(Width - 54 - (MaximizeBox ? 1 : 0) * 22, (Height - 16) / 2, 18, 18); - // - //最小化按钮 - // - if (minRectangle.Contains(mousePoint)) - { - graphics.DrawString("0", icoFont, new SolidBrush(ThemeColors.TwoLevelBorder), minRectangle, StringAlign.Center); - } - else - { - graphics.DrawString("0", icoFont, new SolidBrush(Color.White), minRectangle, StringAlign.Center); - } - } - if (MaximizeBox) - { - maxRectangle = new Rectangle(Width - 54, (Height - 16) / 2, 18, 18); - // - //最大化按钮 - // - if (maxRectangle.Contains(mousePoint)) - { - if (ParentForm.WindowState == FormWindowState.Normal) - graphics.DrawString("1", icoFont, new SolidBrush(ThemeColors.TwoLevelBorder), maxRectangle, StringAlign.Center); - else - graphics.DrawString("2", icoFont, new SolidBrush(ThemeColors.TwoLevelBorder), maxRectangle, StringAlign.Center); - } - else - { - if (ParentForm.WindowState == FormWindowState.Normal) - graphics.DrawString("1", icoFont, new SolidBrush(Color.White), maxRectangle, StringAlign.Center); - else - graphics.DrawString("2", icoFont, new SolidBrush(Color.White), maxRectangle, StringAlign.Center); - } - } - - closeRectangle = new Rectangle(Width - 32, (Height - 16) / 2, 18, 18); - // - //关闭按钮 - // - if (closeRectangle.Contains(mousePoint)) - { - graphics.DrawString("r", icoFont, new SolidBrush(ThemeColors.Danger), closeRectangle, StringAlign.Center); - } - else - { - graphics.DrawString("r", icoFont, new SolidBrush(Color.White), closeRectangle, StringAlign.Center); - } - } - - base.OnPaint(e); - graphics.Dispose(); - e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic; - e.Graphics.DrawImageUnscaled(bitmap, 0, 0); - bitmap.Dispose(); - } - - public CrEaTiiOn_FlatStatusBar() - { - SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.OptimizedDoubleBuffer | ControlStyles.SupportsTransparentBackColor, true); - DoubleBuffered = true; - Font = new Font("Segoe UI", 12); - Height = 40; - Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top; - } - } -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/Stick/CrEaTiiOn_JoyStick.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/Stick/CrEaTiiOn_JoyStick.cs deleted file mode 100644 index 4c4cc2f..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/Stick/CrEaTiiOn_JoyStick.cs +++ /dev/null @@ -1,482 +0,0 @@ -#region Imports - -using System; -using System.ComponentModel; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Windows.Forms; - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_JoyStick - - public class CrEaTiiOn_JoyStick : Control - { - public CrEaTiiOn_JoyStick() - { - base.Size = new Size(122, 122); - BackColor = Color.FromArgb(20, 20, 20); - BackgroundImage = new Bitmap(base.Width, base.Height); - ng = base.CreateGraphics(); - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - public Direction JoystickDirection => joystickDirection; - - [Category("CrEaTiiOn")] - [Browsable(true)] - public Control MovableObject - { - get => movableObject; - set => movableObject = value; - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - public bool KeepOnScreen - { - get => keepOnScreen; - set => keepOnScreen = value; - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - public int Sensitivity - { - get => sensitivity; - set - { - sensitivity = value; - - if (sensitivity > 10) - { - sensitivity = 10; - } - - if (sensitivity < 1) - { - sensitivity = 1; - } - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - public override Image BackgroundImage - { - get => backgroundImage; - set - { - backgroundImage = value; - backgroundImage = new Bitmap(BackgroundImage, new Size(base.Width, base.Height)); - base.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - public Color JoyStickColor - { - get => joyStickColor; - set - { - joyStickColor = value; - base.Invalidate(); - } - } - - private SmoothingMode _SmoothingType = SmoothingMode.AntiAlias; - [Category("CrEaTiiOn")] - [Browsable(true)] - public SmoothingMode SmoothingType - { - get => _SmoothingType; - set - { - _SmoothingType = value; - Invalidate(); - } - } - - protected override void OnMouseDown(MouseEventArgs e) - { - moveStick = true; - base.OnMouseDown(e); - } - - protected override void OnMouseMove(MouseEventArgs e) - { - if (moveStick) - { - int num; - - if (e.X - base.Width / 6 * 2 / 2 < 0) - { - num = 0; - } - else if (e.X - base.Width / 6 * 2 / 2 + base.Width / 6 * 2 > base.Width) - { - num = base.Width - base.Width / 6 * 2; - } - else - { - num = e.X - base.Width / 6 * 2 / 2; - } - - int num2; - - if (e.Y - base.Width / 6 * 2 / 2 < 0) - { - num2 = 0; - } - else if (e.Y - base.Width / 6 * 2 / 2 + base.Height / 6 * 2 > base.Height) - { - num2 = base.Height - base.Height / 6 * 2; - } - else - { - num2 = e.Y - base.Height / 6 * 2 / 2; - } - - int num3 = num + base.Width / 6; - int num4 = num2 + base.Height / 6; - - if (num4 < base.Height / 3 * 3) - { - if (num3 < base.Width / 3 * 3) - { - joystickDirection = Direction.LowerRight; - } - - if (num3 < base.Width / 3 * 2) - { - joystickDirection = Direction.LowerCenter; - } - - if (num3 < base.Width / 3) - { - joystickDirection = Direction.LowerLeft; - } - } - - if (num4 < base.Height / 3 * 2) - { - if (num3 < base.Width / 3 * 3) - { - joystickDirection = Direction.MiddleRight; - } - - if (num3 < base.Width / 3 * 2) - { - joystickDirection = Direction.MiddleCenter; - } - - if (num3 < base.Width / 3) - { - joystickDirection = Direction.MiddleLeft; - } - } - if (num4 < base.Height / 3) - { - if (num3 < base.Width / 3 * 3) - { - joystickDirection = Direction.UpperRight; - } - - if (num3 < base.Width / 3 * 2) - { - joystickDirection = Direction.UpperCenter; - } - - if (num3 < base.Width / 3) - { - joystickDirection = Direction.UpperLeft; - } - } - - OnDirectionChanged(); - - Image image = new Bitmap(base.Width, base.Height); - Graphics graphics = Graphics.FromImage(image); - - graphics.SmoothingMode = SmoothingType; - - graphics.FillRectangle(new SolidBrush(BackColor), -1, -1, base.Width + 1, base.Height + 1); - graphics.DrawImage(new Bitmap(BackgroundImage, new Size(base.Width, base.Height)), 0, 0); - graphics.FillPie(new SolidBrush(joyStickColor), new Rectangle(num, num2, base.Width / 6 * 2, base.Height / 6 * 2), 0f, 360f); - - ng.DrawImage(image, 0, 0); - - MoveObject(); - } - - base.OnMouseMove(e); - } - - protected override void OnMouseUp(MouseEventArgs e) - { - moveStick = false; - - joystickDirection = Direction.MiddleCenter; - - OnDirectionChanged(); - - Image image = new Bitmap(base.Width, base.Height); - Graphics graphics = Graphics.FromImage(image); - - graphics.SmoothingMode = SmoothingType; - - graphics.FillRectangle(new SolidBrush(BackColor), -1, -1, base.Width + 1, base.Height + 1); - graphics.DrawImage(new Bitmap(BackgroundImage, new Size(base.Width, base.Height)), 0, 0); - graphics.FillPie(new SolidBrush(joyStickColor), new Rectangle(base.Width / 6 * 2, base.Height / 6 * 2, base.Width / 6 * 2, base.Height / 6 * 2), 0f, 360f); - - ng.DrawImage(image, 0, 0); - - base.OnMouseUp(e); - } - - protected override void OnPaint(PaintEventArgs e) - { - Image image = new Bitmap(base.Width, base.Height); - Graphics graphics = Graphics.FromImage(image); - - graphics.SmoothingMode = SmoothingType; - - graphics.FillRectangle(new SolidBrush(BackColor), -1, -1, base.Width + 1, base.Height + 1); - graphics.DrawImage(new Bitmap(BackgroundImage, new Size(base.Width, base.Height)), 0, 0); - graphics.FillPie(new SolidBrush(joyStickColor), new Rectangle(base.Width / 6 * 2, base.Height / 6 * 2, base.Width / 6 * 2, base.Height / 6 * 2), 0f, 360f); - - graphics.DrawImage(image, 0, 0); - - e.Graphics.DrawImage(image, 0, 0); - - base.OnPaint(e); - } - - public event EventHandler DirectionChanged; - - protected virtual void OnDirectionChanged() - { - DirectionChanged?.Invoke(this, EventArgs.Empty); - } - - private void MoveObject() - { - if (movableObject != null) - { - if (keepOnScreen) - { - if (joystickDirection == Direction.UpperLeft) - { - if (movableObject.Location.X - sensitivity > -1) - { - movableObject.Location = new Point(movableObject.Location.X - sensitivity, movableObject.Location.Y); - } - else - { - movableObject.Location = new Point(0, movableObject.Location.Y); - } - - if (movableObject.Location.Y - sensitivity > -1) - { - movableObject.Location = new Point(movableObject.Location.X, movableObject.Location.Y - sensitivity); - } - else - { - movableObject.Location = new Point(movableObject.Location.X, 0); - } - } - - if (joystickDirection == Direction.UpperCenter) - { - if (movableObject.Location.Y - sensitivity > -1) - { - movableObject.Location = new Point(movableObject.Location.X, movableObject.Location.Y - sensitivity); - } - else - { - movableObject.Location = new Point(movableObject.Location.X, 0); - } - } - - if (joystickDirection == Direction.UpperRight) - { - if (movableObject.Location.X + movableObject.Width + sensitivity < movableObject.Parent.Width - 1) - { - movableObject.Location = new Point(movableObject.Location.X + sensitivity, movableObject.Location.Y); - } - else - { - movableObject.Location = new Point(movableObject.Parent.Width - movableObject.Width, movableObject.Location.Y); - } - - if (movableObject.Location.Y - sensitivity > -1) - { - movableObject.Location = new Point(movableObject.Location.X, movableObject.Location.Y - sensitivity); - } - else - { - movableObject.Location = new Point(movableObject.Location.X, 0); - } - } - - if (joystickDirection == Direction.MiddleLeft) - { - if (movableObject.Location.X - sensitivity > -1) - { - movableObject.Location = new Point(movableObject.Location.X - sensitivity, movableObject.Location.Y); - } - else - { - movableObject.Location = new Point(0, movableObject.Location.Y); - } - } - - if (joystickDirection == Direction.MiddleRight) - { - if (movableObject.Location.X + movableObject.Width + sensitivity < movableObject.Parent.Width - 1) - { - movableObject.Location = new Point(movableObject.Location.X + sensitivity, movableObject.Location.Y); - } - else - { - movableObject.Location = new Point(movableObject.Parent.Width - movableObject.Width, movableObject.Location.Y); - } - } - - if (joystickDirection == Direction.LowerLeft) - { - if (movableObject.Location.X - sensitivity > -1) - { - movableObject.Location = new Point(movableObject.Location.X - sensitivity, movableObject.Location.Y); - } - else - { - movableObject.Location = new Point(0, movableObject.Location.Y); - } - - if (movableObject.Location.Y + movableObject.Height + sensitivity < movableObject.Parent.Height - 1) - { - movableObject.Location = new Point(movableObject.Location.X, movableObject.Location.Y + sensitivity); - } - else - { - movableObject.Location = new Point(movableObject.Location.X, movableObject.Parent.Height - movableObject.Height); - } - } - - if (joystickDirection == Direction.LowerCenter) - { - if (movableObject.Location.Y + movableObject.Height + sensitivity < movableObject.Parent.Height - 1) - { - movableObject.Location = new Point(movableObject.Location.X, movableObject.Location.Y + sensitivity); - } - else - { - movableObject.Location = new Point(movableObject.Location.X, movableObject.Parent.Height - movableObject.Height); - } - } - - if (joystickDirection == Direction.LowerRight) - { - if (movableObject.Location.X + movableObject.Width + sensitivity < movableObject.Parent.Width - 1) - { - movableObject.Location = new Point(movableObject.Location.X + sensitivity, movableObject.Location.Y); - } - else - { - movableObject.Location = new Point(movableObject.Parent.Width - movableObject.Width, movableObject.Location.Y); - } - - if (movableObject.Location.Y + movableObject.Height + sensitivity < movableObject.Parent.Height - 1) - { - movableObject.Location = new Point(movableObject.Location.X, movableObject.Location.Y + sensitivity); - } - else - { - movableObject.Location = new Point(movableObject.Location.X, movableObject.Parent.Height - movableObject.Height); - } - } - } - else - { - if (joystickDirection == Direction.UpperCenter) - { - movableObject.Location = new Point(movableObject.Location.X, movableObject.Location.Y - sensitivity); - } - - if (joystickDirection == Direction.UpperLeft) - { - movableObject.Location = new Point(movableObject.Location.X - sensitivity, movableObject.Location.Y - sensitivity); - } - - if (joystickDirection == Direction.UpperRight) - { - movableObject.Location = new Point(movableObject.Location.X + sensitivity, movableObject.Location.Y - sensitivity); - } - - if (joystickDirection == Direction.MiddleLeft) - { - movableObject.Location = new Point(movableObject.Location.X - sensitivity, movableObject.Location.Y); - } - - if (joystickDirection == Direction.MiddleRight) - { - movableObject.Location = new Point(movableObject.Location.X + sensitivity, movableObject.Location.Y); - } - - if (joystickDirection == Direction.LowerLeft) - { - movableObject.Location = new Point(movableObject.Location.X - sensitivity, movableObject.Location.Y + sensitivity); - } - - if (joystickDirection == Direction.LowerCenter) - { - movableObject.Location = new Point(movableObject.Location.X, movableObject.Location.Y + sensitivity); - } - - if (joystickDirection == Direction.LowerRight) - { - movableObject.Location = new Point(movableObject.Location.X + sensitivity, movableObject.Location.Y + sensitivity); - } - } - - movableObject.Refresh(); - } - } - - private readonly Graphics ng; - - private Direction joystickDirection = Direction.MiddleCenter; - - private Control movableObject; - - private bool keepOnScreen = true; - - private int sensitivity = 3; - - private Image backgroundImage; - - private Color joyStickColor = Color.FromArgb(250, 36, 38); - - private bool moveStick; - - public enum Direction - { - UpperLeft, - MiddleLeft, - LowerLeft, - UpperCenter, - MiddleCenter, - LowerCenter, - UpperRight, - MiddleRight, - LowerRight - } - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/Strip/CrEaTiiOn_ContextMenuStrip.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/Strip/CrEaTiiOn_ContextMenuStrip.cs deleted file mode 100644 index 8750d64..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/Strip/CrEaTiiOn_ContextMenuStrip.cs +++ /dev/null @@ -1,96 +0,0 @@ -#region Imports -using Microsoft.VisualBasic; -using System; -using System.Collections; -using System.Collections.Generic; -using System.Data; -using System.Diagnostics; -using System.Drawing.Drawing2D; -using System.Windows.Forms; -using System.Drawing; -using System.ComponentModel; -#endregion - -namespace CBH.Controls -{ - public class CrEaTiiOn_ContextMenuStrip : System.Windows.Forms.ContextMenuStrip - { - private Rectangle Rect; - - private Graphics G; - public CrEaTiiOn_ContextMenuStrip() - { - base.Renderer = Renderer; - } - - public CrEaTiiOn_ContextMenuStrip(IContainer container) : base(container) - { - } - - private void Renderer_PaintMenuBackground(object sender, ToolStripRenderEventArgs e) - { - G = e.Graphics; - - G.Clear(Color.FromArgb(44, 44, 43)); - } - - - private void Renderer_PaintMenuBorder(object sender, ToolStripRenderEventArgs e) - { - G = e.Graphics; - - using (Pen Border = new Pen(Color.FromArgb(42, 42, 41))) - { - G.DrawRectangle(Border, new Rectangle(e.AffectedBounds.X, e.AffectedBounds.Y, e.AffectedBounds.Width - 1, e.AffectedBounds.Height - 1)); - } - } - - private void Renderer_PaintItemArrow(object sender, ToolStripArrowRenderEventArgs e) - { - G = e.Graphics; - - using (Font TextFont = new Font("Marlett", 12)) - { - using (SolidBrush TextBrush = new SolidBrush(Color.FromArgb(200, 200, 200))) - { - G.DrawString("8", TextFont, TextBrush, new Point(e.ArrowRectangle.X - 2, e.ArrowRectangle.Y + 1)); - } - } - } - - private void Renderer_PaintItemImage(object sender, ToolStripItemImageRenderEventArgs e) - { - G = e.Graphics; - - G.DrawImage(e.Image, new Rectangle(4, 1, 16, 16)); - } - - private void Renderer_PaintItemText(object sender, ToolStripItemTextRenderEventArgs e) - { - G = e.Graphics; - - using (Font ItemFont = new Font("Segoe UI", 9)) - { - using (SolidBrush ItemBrush = new SolidBrush(Color.FromArgb(220, 220, 220))) - { - G.DrawString(e.Text, ItemFont, ItemBrush, new Point(e.TextRectangle.X, e.TextRectangle.Y)); - } - } - } - - private void Renderer_PaintItemBackground(object sender, ToolStripItemRenderEventArgs e) - { - G = e.Graphics; - - Rect = e.Item.ContentRectangle; - - if (e.Item.Selected) - { - using (SolidBrush Fill = new SolidBrush(Color.FromArgb(54, 54, 53))) - { - G.FillRectangle(Fill, new Rectangle(Rect.X - 1, Rect.Y - 1, Rect.Width + 4, Rect.Height - 1)); - } - } - } - } -} diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/Strip/CrEaTiiOn_FlatContextMenuStrip.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/Strip/CrEaTiiOn_FlatContextMenuStrip.cs deleted file mode 100644 index 7f65d30..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/Strip/CrEaTiiOn_FlatContextMenuStrip.cs +++ /dev/null @@ -1,70 +0,0 @@ -#region Imports -using System; -using System.ComponentModel; -using System.Drawing; -using System.Drawing.Text; -using System.Windows.Forms; -#endregion - -namespace CBH.Controls -{ - public class CrEaTiiOn_FlatContextMenuStrip : ContextMenuStrip - { - protected override void OnTextChanged( EventArgs e ) - { - base.OnTextChanged( e ); - Invalidate(); - } - - public CrEaTiiOn_FlatContextMenuStrip() - : base() - { - Renderer = new ToolStripProfessionalRenderer( new TColorTable() ); - ShowImageMargin = false; - ForeColor = Color.White; - Font = new Font( "Tahoma", 8 ); - } - - protected override void OnPaint( PaintEventArgs e ) - { - base.OnPaint( e ); - e.Graphics.TextRenderingHint = TextRenderingHint.ClearTypeGridFit; - } - - public class TColorTable : ProfessionalColorTable - { - [Category( "Colors" )] - public Color _BackColor { get; set; } = Color.FromArgb( 24, 22, 43 ); - - [Category( "Colors" )] - public Color _CheckedColor { get; set; } = Color.FromArgb(250, 36, 38); - - [Category( "Colors" )] - public Color _BorderColor { get; set; } = Color.FromArgb( 53, 58, 60 ); - - public override Color ButtonSelectedBorder => _BackColor; - - public override Color CheckBackground => _CheckedColor; - - public override Color CheckPressedBackground => _CheckedColor; - - public override Color CheckSelectedBackground => _CheckedColor; - - public override Color ImageMarginGradientBegin => _CheckedColor; - - public override Color ImageMarginGradientEnd => _CheckedColor; - - public override Color ImageMarginGradientMiddle => _CheckedColor; - - public override Color MenuBorder => _BorderColor; - - public override Color MenuItemBorder => _BorderColor; - - public override Color MenuItemSelected => _CheckedColor; - - public override Color SeparatorDark => _BorderColor; - - public override Color ToolStripDropDownBackground => _BackColor; - } - } -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/Strip/Support/StripRenderer.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/Strip/Support/StripRenderer.cs deleted file mode 100644 index 8c61f4d..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/Strip/Support/StripRenderer.cs +++ /dev/null @@ -1,108 +0,0 @@ -using Microsoft.VisualBasic; -using System; -using System.Collections; -using System.Collections.Generic; -using System.Data; -using System.Diagnostics; -using System.Drawing.Drawing2D; -using System.Windows.Forms; -using System.Drawing; - -namespace CBH_Ultimate_Theme_Library.Theme.Controls.Strip.Support -{ - public class cStripRenderer : ToolStripRenderer - { - - public event PaintMenuBackgroundEventHandler PaintMenuBackground; - public delegate void PaintMenuBackgroundEventHandler(object sender, ToolStripRenderEventArgs e); - public event PaintMenuBorderEventHandler PaintMenuBorder; - public delegate void PaintMenuBorderEventHandler(object sender, ToolStripRenderEventArgs e); - public event PaintMenuImageMarginEventHandler PaintMenuImageMargin; - public delegate void PaintMenuImageMarginEventHandler(object sender, ToolStripRenderEventArgs e); - public event PaintItemCheckEventHandler PaintItemCheck; - public delegate void PaintItemCheckEventHandler(object sender, ToolStripItemImageRenderEventArgs e); - public event PaintItemImageEventHandler PaintItemImage; - public delegate void PaintItemImageEventHandler(object sender, ToolStripItemImageRenderEventArgs e); - public event PaintItemTextEventHandler PaintItemText; - public delegate void PaintItemTextEventHandler(object sender, ToolStripItemTextRenderEventArgs e); - public event PaintItemBackgroundEventHandler PaintItemBackground; - public delegate void PaintItemBackgroundEventHandler(object sender, ToolStripItemRenderEventArgs e); - public event PaintItemArrowEventHandler PaintItemArrow; - public delegate void PaintItemArrowEventHandler(object sender, ToolStripArrowRenderEventArgs e); - public event PaintSeparatorEventHandler PaintSeparator; - public delegate void PaintSeparatorEventHandler(object sender, ToolStripSeparatorRenderEventArgs e); - - protected override void OnRenderToolStripBackground(ToolStripRenderEventArgs e) - { - if (PaintMenuBackground != null) - { - PaintMenuBackground(this, e); - } - } - - protected override void OnRenderImageMargin(ToolStripRenderEventArgs e) - { - if (PaintMenuImageMargin != null) - { - PaintMenuImageMargin(this, e); - } - } - - protected override void OnRenderToolStripBorder(ToolStripRenderEventArgs e) - { - if (PaintMenuBorder != null) - { - PaintMenuBorder(this, e); - } - } - - protected override void OnRenderItemCheck(ToolStripItemImageRenderEventArgs e) - { - if (PaintItemCheck != null) - { - PaintItemCheck(this, e); - } - } - - protected override void OnRenderItemImage(ToolStripItemImageRenderEventArgs e) - { - if (PaintItemImage != null) - { - PaintItemImage(this, e); - } - } - - protected override void OnRenderItemText(ToolStripItemTextRenderEventArgs e) - { - if (PaintItemText != null) - { - PaintItemText(this, e); - } - } - - protected override void OnRenderMenuItemBackground(ToolStripItemRenderEventArgs e) - { - if (PaintItemBackground != null) - { - PaintItemBackground(this, e); - } - } - - protected override void OnRenderArrow(ToolStripArrowRenderEventArgs e) - { - if (PaintItemArrow != null) - { - PaintItemArrow(this, e); - } - } - - protected override void OnRenderSeparator(ToolStripSeparatorRenderEventArgs e) - { - if (PaintSeparator != null) - { - PaintSeparator(this, e); - } - } - - } -} diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/TabControl/CrEaTiiOn_BarTabControl.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/TabControl/CrEaTiiOn_BarTabControl.cs deleted file mode 100644 index d899135..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/TabControl/CrEaTiiOn_BarTabControl.cs +++ /dev/null @@ -1,288 +0,0 @@ -#region -using System; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Windows.Forms; -#endregion - -namespace CBH.Controls -{ - public class CrEaTiiOn_BarTabControl : TabControl - { - - public CrEaTiiOn_BarTabControl() - { - SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.ResizeRedraw | ControlStyles.UserPaint | ControlStyles.DoubleBuffer, true); - DoubleBuffered = true; - SizeMode = TabSizeMode.Fixed; - ItemSize = new Size(44, 136); - } - - protected override void CreateHandle() - { - base.CreateHandle(); - Alignment = TabAlignment.Left; - } - - public Pen ToPen(Color color) - { - return new Pen(color); - } - - public Brush ToBrush(Color color) - { - return new SolidBrush(color); - } - - protected override void OnPaint(PaintEventArgs e) - { - Bitmap B = new Bitmap(Width, Height); - Graphics G = Graphics.FromImage(B); - try - { - SelectedTab.BackColor = Color.FromArgb(15, 15, 15); - } - catch - { - } - G.Clear(Color.FromArgb(15, 15, 15)); - G.FillRectangle(new SolidBrush(Color.FromArgb(15, 15, 15)), new Rectangle(0, 0, ItemSize.Height + 4, Height)); - G.DrawLine(new Pen(Color.FromArgb(10, 10, 10)), new Point(ItemSize.Height + 3, 0), new Point(ItemSize.Height + 3, 999)); - for (int i = 0; i <= TabCount - 1; i++) - { - if (i == SelectedIndex) - { - Rectangle x2 = new Rectangle(new Point(GetTabRect(i).Location.X - 2, GetTabRect(i).Location.Y - 2), new Size(GetTabRect(i).Width + 3, GetTabRect(i).Height - 1)); - ColorBlend myBlend = new ColorBlend(); - myBlend.Colors = new Color[] { - Color.FromArgb(250, 36, 38), - Color.FromArgb(250, 36, 38), - Color.FromArgb(250, 36, 38) - }; - myBlend.Positions = new float[] { - 0f, - 0.5f, - 1f - }; - LinearGradientBrush lgBrush = new LinearGradientBrush(x2, Color.Black, Color.Black, 90f); - lgBrush.InterpolationColors = myBlend; - G.FillRectangle(lgBrush, x2); - G.DrawRectangle(new Pen(Color.FromArgb(15, 15, 15)), x2); - - G.SmoothingMode = SmoothingMode.HighQuality; - Point[] p = { - new Point(ItemSize.Height - 3, GetTabRect(i).Location.Y + 20), - new Point(ItemSize.Height + 4, GetTabRect(i).Location.Y + 14), - new Point(ItemSize.Height + 4, GetTabRect(i).Location.Y + 27) - }; - - if (ImageList != null) - { - try - { - - if (ImageList.Images[TabPages[i].ImageIndex] != null) - { - G.DrawImage(ImageList.Images[TabPages[i].ImageIndex], new Point(x2.Location.X + 8, x2.Location.Y + 6)); - G.DrawString(" " + TabPages[i].Text, Font, Brushes.Black, x2, new StringFormat - { - LineAlignment = StringAlignment.Center, - Alignment = StringAlignment.Center - }); - } - else - { - G.DrawString(TabPages[i].Text, new Font(Font.FontFamily, Font.Size, FontStyle.Bold), Brushes.Black, x2, new StringFormat - { - LineAlignment = StringAlignment.Center, - Alignment = StringAlignment.Center - }); - } - } - catch (Exception ex) - { - G.DrawString(TabPages[i].Text, new Font(Font.FontFamily, Font.Size, FontStyle.Bold), Brushes.Black, x2, new StringFormat - { - LineAlignment = StringAlignment.Center, - Alignment = StringAlignment.Center - }); - } - } - else - { - G.DrawString(TabPages[i].Text, new Font(Font.FontFamily, Font.Size, FontStyle.Bold), Brushes.Black, x2, new StringFormat - { - LineAlignment = StringAlignment.Center, - Alignment = StringAlignment.Center - }); - } - - G.DrawLine(new Pen(Color.FromArgb(250, 36, 38)), new Point(x2.Location.X - 1, x2.Location.Y - 1), new Point(x2.Location.X, x2.Location.Y)); - G.DrawLine(new Pen(Color.FromArgb(250, 36, 38)), new Point(x2.Location.X - 1, x2.Bottom - 1), new Point(x2.Location.X, x2.Bottom)); - } - else - { - Rectangle x2 = new Rectangle(new Point(GetTabRect(i).Location.X - 2, GetTabRect(i).Location.Y - 2), new Size(GetTabRect(i).Width + 3, GetTabRect(i).Height - 1)); - G.FillRectangle(new SolidBrush(Color.FromArgb(15, 15, 15)), x2); - G.DrawLine(new Pen(Color.FromArgb(15, 15, 15)), new Point(x2.Right, x2.Top), new Point(x2.Right, x2.Bottom)); - if (ImageList != null) - { - try - { - if (ImageList.Images[TabPages[i].ImageIndex] != null) - { - G.DrawImage(ImageList.Images[TabPages[i].ImageIndex], new Point(x2.Location.X + 8, x2.Location.Y + 6)); - G.DrawString(" " + TabPages[i].Text, Font, Brushes.DimGray, x2, new StringFormat - { - LineAlignment = StringAlignment.Center, - Alignment = StringAlignment.Center - }); - } - else - { - G.DrawString(TabPages[i].Text, Font, Brushes.DimGray, x2, new StringFormat - { - LineAlignment = StringAlignment.Center, - Alignment = StringAlignment.Center - }); - } - } - catch (Exception ex) - { - G.DrawString(TabPages[i].Text, Font, Brushes.DimGray, x2, new StringFormat - { - LineAlignment = StringAlignment.Center, - Alignment = StringAlignment.Center - }); - } - } - else - { - G.DrawString(TabPages[i].Text, Font, Brushes.DimGray, x2, new StringFormat - { - LineAlignment = StringAlignment.Center, - Alignment = StringAlignment.Center - }); - } - } - } - - e.Graphics.DrawImage((Bitmap)B.Clone(), 0, 0); - G.Dispose(); - B.Dispose(); - } - - - int OldIndex; - private int _Speed = 8; - public int Speed - { - get { return _Speed; } - set - { - if (value > 20 | value < -20) - { - MessageBox.Show("Speed needs to be in between -20 and 20."); - } - else - { - _Speed = value; - } - } - } - - public void DoAnimationScrollLeft(Control Control1, Control Control2) - { - Graphics G = Control1.CreateGraphics(); - Bitmap P1 = new Bitmap(Control1.Width, Control1.Height); - Bitmap P2 = new Bitmap(Control2.Width, Control2.Height); - Control1.DrawToBitmap(P1, new Rectangle(0, 0, Control1.Width, Control1.Height)); - Control2.DrawToBitmap(P2, new Rectangle(0, 0, Control2.Width, Control2.Height)); - - foreach (Control c in Control1.Controls) - { - c.Hide(); - } - - int Slide = Control1.Width - (Control1.Width % _Speed); - - int a = 0; - for (a = 0; a <= Slide; a += _Speed) - { - G.DrawImage(P1, new Rectangle(a, 0, Control1.Width, Control1.Height)); - G.DrawImage(P2, new Rectangle(a - Control2.Width, 0, Control2.Width, Control2.Height)); - } - a = Control1.Width; - G.DrawImage(P1, new Rectangle(a, 0, Control1.Width, Control1.Height)); - G.DrawImage(P2, new Rectangle(a - Control2.Width, 0, Control2.Width, Control2.Height)); - - SelectedTab = (TabPage)Control2; - - foreach (Control c in Control2.Controls) - { - c.Show(); - } - - foreach (Control c in Control1.Controls) - { - c.Show(); - } - } - - protected override void OnSelecting(System.Windows.Forms.TabControlCancelEventArgs e) - { - if (OldIndex < e.TabPageIndex) - { - DoAnimationScrollRight(TabPages[OldIndex], TabPages[e.TabPageIndex]); - } - else - { - DoAnimationScrollLeft(TabPages[OldIndex], TabPages[e.TabPageIndex]); - } - } - - protected override void OnDeselecting(System.Windows.Forms.TabControlCancelEventArgs e) - { - OldIndex = e.TabPageIndex; - } - - public void DoAnimationScrollRight(Control Control1, Control Control2) - { - Graphics G = Control1.CreateGraphics(); - Bitmap P1 = new Bitmap(Control1.Width, Control1.Height); - Bitmap P2 = new Bitmap(Control2.Width, Control2.Height); - Control1.DrawToBitmap(P1, new Rectangle(0, 0, Control1.Width, Control1.Height)); - Control2.DrawToBitmap(P2, new Rectangle(0, 0, Control2.Width, Control2.Height)); - - foreach (Control c in Control1.Controls) - { - c.Hide(); - } - - int Slide = Control1.Width - (Control1.Width % _Speed); - - int a = 0; - for (a = 0; a >= -Slide; a += -_Speed) - { - G.DrawImage(P1, new Rectangle(a, 0, Control1.Width, Control1.Height)); - G.DrawImage(P2, new Rectangle(a + Control2.Width, 0, Control2.Width, Control2.Height)); - } - a = Control1.Width; - G.DrawImage(P1, new Rectangle(a, 0, Control1.Width, Control1.Height)); - G.DrawImage(P2, new Rectangle(a + Control2.Width, 0, Control2.Width, Control2.Height)); - - SelectedTab = (TabPage)Control2; - - foreach (Control c in Control2.Controls) - { - c.Show(); - } - - foreach (Control c in Control1.Controls) - { - c.Show(); - } - } - } - -} diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/TabControl/CrEaTiiOn_MetroTabControl.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/TabControl/CrEaTiiOn_MetroTabControl.cs deleted file mode 100644 index 73f10f7..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/TabControl/CrEaTiiOn_MetroTabControl.cs +++ /dev/null @@ -1,90 +0,0 @@ -#region Imports -using System; -using System.Drawing.Drawing2D; -using System.Drawing; -using System.Windows.Forms; -using System.Runtime.InteropServices; - -#endregion - -namespace Zeroit.Framework.UIThemes.AdvancedCore -{ - - public class CrEaTiiOn_MetroTabControl : TabControl - { - [DllImport("Gdi32.dll", EntryPoint = "CreateRoundRectRgn")] - private static extern IntPtr CreateRoundRectRgn - ( - int nLeftRect, // x-coordinate of upper-left corner - int nTopRect, // y-coordinate of upper-left corner - int nRightRect, // x-coordinate of lower-right corner - int nBottomRect, // y-coordinate of lower-right corner - int nWidthEllipse, // width of ellipse - int nHeightEllipse // height of ellipse - ); - - public CrEaTiiOn_MetroTabControl() - { - SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.ResizeRedraw | ControlStyles.UserPaint | ControlStyles.DoubleBuffer, true); - ItemSize = new Size(0, 34); - Padding = new Point(24, 0); - Font = new Font("Segoe UI", 12); - } - - protected override void CreateHandle() - { - base.CreateHandle(); - Alignment = TabAlignment.Top; - } - - protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) - { - base.OnPaint(e); - - Graphics G = e.Graphics; - - G.SmoothingMode = SmoothingMode.HighQuality; - G.Clear(Parent.BackColor); - - Color FontColor = new Color(); - - - for (int i = 0; i <= TabCount - 1; i++) - { - Rectangle mainRect = GetTabRect(i); - - if (i == SelectedIndex) - { - FontColor = Color.White; - G.DrawLine(new Pen(Color.FromArgb(250, 36, 38)), new Point(mainRect.X - 2, mainRect.Height - 1), new Point(mainRect.X + mainRect.Width - 2, mainRect.Height - 1)); - G.DrawLine(new Pen(Color.FromArgb(250, 36, 38)), new Point(mainRect.X - 2, mainRect.Height), new Point(mainRect.X + mainRect.Width - 2, mainRect.Height)); - } - else - { - FontColor = Color.White; - G.DrawLine(new Pen(Color.FromArgb(250, 36, 38)), new Point(mainRect.X - 2, mainRect.Height - 1), new Point(mainRect.X + mainRect.Width - 2, mainRect.Height - 1)); - G.DrawLine(new Pen(Color.FromArgb(250, 36, 38)), new Point(mainRect.X - 2, mainRect.Height), new Point(mainRect.X + mainRect.Width - 2, mainRect.Height)); - } - - if (i != 0) - { - G.DrawLine(new Pen(Color.FromArgb(250, 36, 38)), new Point(mainRect.X - 4, mainRect.Height - 7), new Point(mainRect.X + 4, mainRect.Y + 6)); - } - - int titleX = (mainRect.Location.X + mainRect.Width / 2) - Convert.ToInt32((G.MeasureString(TabPages[i].Text, Font).Width / 2)); - int titleY = (mainRect.Location.Y + mainRect.Height / 2) - Convert.ToInt32((G.MeasureString(TabPages[i].Text, Font).Height / 2)); - G.DrawString(TabPages[i].Text, Font, new SolidBrush(FontColor), new Point(titleX, titleY)); - - try - { - TabPages[i].BackColor = Parent.BackColor; - } - catch - { - } - - } - Region = System.Drawing.Region.FromHrgn(CreateRoundRectRgn(0, 0, Width, Height, 10, 10)); - } - } -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/TabControl/CrEaTiiOn_ModernTabControl.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/TabControl/CrEaTiiOn_ModernTabControl.cs deleted file mode 100644 index 92f645f..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/TabControl/CrEaTiiOn_ModernTabControl.cs +++ /dev/null @@ -1,102 +0,0 @@ -#region Imports -using Microsoft.VisualBasic; -using System; -using System.Collections; -using System.Collections.Generic; -using System.Data; -using System.Diagnostics; -using System.Drawing.Drawing2D; -using System.Windows.Forms; -using System.Drawing; -#endregion - -namespace CBH.Controls -{ - public class CrEaTiiOn_ModernTabControl : TabControl - { - - private Graphics G; - - private Rectangle Rect; - public CrEaTiiOn_ModernTabControl() - { - DoubleBuffered = true; - SizeMode = TabSizeMode.Fixed; - Alignment = TabAlignment.Left; - ItemSize = new Size(40, 170); - SetStyle(ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.Opaque | ControlStyles.OptimizedDoubleBuffer, true); - } - - protected override void OnHandleCreated(EventArgs e) - { - foreach (CrEaTiiOn_ModernTabPage T in TabPages) - { - T.Font = new Font("Segoe UI", 9); - T.ForeColor = Color.FromArgb(220, 220, 220); - T.BackColor = Color.FromArgb(20, 20, 20); - } - - base.OnHandleCreated(e); - } - - protected override void OnPaint(PaintEventArgs e) - { - G = e.Graphics; - - G.Clear(Color.FromArgb(20, 20, 20)); - - using (Pen Right = new Pen(Color.FromArgb(250, 36, 38))) - { - G.DrawLine(Right, ItemSize.Height + 3, 4, ItemSize.Height + 3, Height - 5); - } - - for (int T = 0; T <= TabPages.Count - 1; T++) - { - Rect = GetTabRect(T); - - if (SelectedIndex == T) - { - using (SolidBrush Selection = new SolidBrush(Color.FromArgb(250, 36, 38))) - { - G.FillRectangle(Selection, new Rectangle(Rect.X - 4, Rect.Y + 2, Rect.Width + 6, Rect.Height - 2)); - } - - using (SolidBrush TextBrush = new SolidBrush(Color.FromArgb(220, 220, 219))) - { - using (Font TextFont = new Font("Segoe UI", 10)) - { - G.DrawString(TabPages[T].Text, TextFont, TextBrush, new Point(Rect.X + 45, Rect.Y + 11)); - } - } - - using (Pen Line = new Pen(Color.FromArgb(250, 36, 38))) - { - G.DrawLine(Line, Rect.X - 2, Rect.Y + 1, Rect.Width + 4, Rect.Y + 1); - G.DrawLine(Line, Rect.X - 2, Rect.Y + 39, Rect.Width + 4, Rect.Y + 39); - } - - } - else - { - using (SolidBrush TextBrush = new SolidBrush(Color.FromArgb(180, 180, 179))) - { - using (Font TextFont = new Font("Segoe UI", 10)) - { - G.DrawString(TabPages[T].Text, TextFont, TextBrush, new Point(Rect.X + 45, Rect.Y + 11)); - } - } - } - - if ((ImageList != null)) - { - if (!(TabPages[T].ImageIndex < 0)) - { - G.DrawImage(ImageList.Images[TabPages[T].ImageIndex], new Rectangle(Rect.X + 18, Rect.Y + 12, 16, 16)); - } - } - } - - base.OnPaint(e); - } - } -} diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/TabPage/CrEaTiiOn_ModernTabPage.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/TabPage/CrEaTiiOn_ModernTabPage.cs deleted file mode 100644 index c7afcb8..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/TabPage/CrEaTiiOn_ModernTabPage.cs +++ /dev/null @@ -1,302 +0,0 @@ -#region Imports - -using System.Collections; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Windows.Forms; - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_ModernTabPage - - public class CrEaTiiOn_ModernTabPage : TabControl - { - private SmoothingMode _SmoothingType = SmoothingMode.HighSpeed; - public SmoothingMode SmoothingType - { - get => _SmoothingType; - set - { - _SmoothingType = value; - Invalidate(); - } - } - - private CompositingQuality _CompositingQualityType = CompositingQuality.HighSpeed; - public CompositingQuality CompositingQualityType - { - get => _CompositingQualityType; - set - { - _CompositingQualityType = value; - Invalidate(); - } - } - - private CompositingMode _CompositingType = CompositingMode.SourceOver; - public CompositingMode CompositingType - { - get => _CompositingType; - set - { - _CompositingType = value; - Invalidate(); - } - } - - private InterpolationMode _InterpolationType = InterpolationMode.HighQualityBicubic; - public InterpolationMode InterpolationType - { - get => _InterpolationType; - set - { - _InterpolationType = value; - Invalidate(); - } - } - - private StringAlignment _StringType = StringAlignment.Near; - public StringAlignment StringType - { - get => _StringType; - set - { - _StringType = value; - Invalidate(); - } - } - - private Color _FrameColor = Color.FromArgb(20, 20, 20); - public Color FrameColor - { - get => _FrameColor; - set - { - _FrameColor = value; - Invalidate(); - } - } - - private Color _PageColor = Color.FromArgb(20, 20, 20); - public Color PageColor - { - get => _PageColor; - set - { - _PageColor = value; - Invalidate(); - } - } - - private Color _ActiveForeColor = Color.FromArgb(250, 36, 38); - public Color ActiveForeColor - { - get => _ActiveForeColor; - set - { - _ActiveForeColor = value; - Invalidate(); - } - } - - private Color _NormalForeColor = Color.White; - public Color NormalForeColor - { - get => _NormalForeColor; - set - { - _NormalForeColor = value; - Invalidate(); - } - } - - private Color _ControlBackColor = Color.FromArgb(15, 15, 15); - public Color ControlBackColor - { - get => _ControlBackColor; - set - { - _ControlBackColor = value; - Invalidate(); - } - } - - private Color _LineColor = Color.FromArgb(250, 36, 38); - public Color LineColor - { - get => _LineColor; - set - { - _LineColor = value; - Invalidate(); - } - } - - private Color _ActiveTabColor = Color.FromArgb(15, 15, 15); - public Color ActiveTabColor - { - get => _ActiveTabColor; - set - { - _ActiveTabColor = value; - Invalidate(); - } - } - - private Color _TabColor = Color.FromArgb(20, 20, 20); - public Color TabColor - { - get => _TabColor; - set - { - _TabColor = value; - Invalidate(); - } - } - - private Color _ActiveLineTabColor = Color.FromArgb(250, 36, 38); - public Color ActiveLineTabColor - { - get => _ActiveLineTabColor; - set - { - _ActiveLineTabColor = value; - Invalidate(); - } - } - - private Color _LineTabColor = Color.FromArgb(20, 20, 20); - public Color LineTabColor - { - get => _LineTabColor; - set - { - _LineTabColor = value; - Invalidate(); - } - } - - public CrEaTiiOn_ModernTabPage() - { - SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.DoubleBuffer, true); - - DoubleBuffered = true; - SizeMode = TabSizeMode.Fixed; - ItemSize = new(44, 135); - DrawMode = TabDrawMode.OwnerDrawFixed; - } - - protected override void CreateHandle() - { - base.CreateHandle(); - - base.DoubleBuffered = true; - SizeMode = TabSizeMode.Fixed; - Appearance = TabAppearance.Normal; - Alignment = TabAlignment.Left; - } - - protected override void OnControlAdded(ControlEventArgs e) - { - base.OnControlAdded(e); - if (e.Control is CrEaTiiOn_ModernTabPage) - { - IEnumerator Enumerator; - try - { - Enumerator = Controls.GetEnumerator(); - while (Enumerator.MoveNext()) - { - CrEaTiiOn_ModernTabPage Current = (CrEaTiiOn_ModernTabPage)Enumerator.Current; - Current = new CrEaTiiOn_ModernTabPage(); - } - } - finally - { - e.Control.BackColor = FrameColor; - } - } - } - - protected override void OnPaint(PaintEventArgs e) - { - base.OnPaint(e); - Bitmap B = new(Width, Height); - Graphics G = Graphics.FromImage(B); - - Graphics _Graphics = G; - - _Graphics.Clear(FrameColor); - _Graphics.SmoothingMode = SmoothingType; - _Graphics.CompositingQuality = CompositingQualityType; - _Graphics.CompositingMode = CompositingType; - - // Draw tab selector background - _Graphics.FillRectangle(new SolidBrush(ControlBackColor), new Rectangle(-5, 0, ItemSize.Height + 4, Height)); - // Draw vertical line at the end of the tab selector rectangle - _Graphics.DrawLine(new(LineColor), ItemSize.Height - 1, 0, ItemSize.Height - 1, Height); - - for (int TabIndex = 0; TabIndex <= TabCount - 1; TabIndex++) - { - if (TabIndex == SelectedIndex) - { - Rectangle TabRect = new(new Point(GetTabRect(TabIndex).Location.X - 2, GetTabRect(TabIndex).Location.Y - 2), new Size(GetTabRect(TabIndex).Width + 3, GetTabRect(TabIndex).Height - 8)); - - // Draw background of the selected tab - _Graphics.FillRectangle(new SolidBrush(ActiveTabColor), TabRect.X, TabRect.Y, TabRect.Width - 4, TabRect.Height + 3); - // Draw a tab highlighter on the background of the selected tab - Rectangle TabHighlighter = new(new Point(GetTabRect(TabIndex).X - 2, GetTabRect(TabIndex).Location.Y - (TabIndex == 0 ? 1 : 1)), new Size(4, GetTabRect(TabIndex).Height - 7)); - _Graphics.FillRectangle(new SolidBrush(ActiveLineTabColor), TabHighlighter); - // Draw tab text - _Graphics.DrawString(TabPages[TabIndex].Text, new Font(Font.FontFamily, Font.Size, Font.Style), new SolidBrush(ActiveForeColor), new Rectangle(TabRect.Left + 40, TabRect.Top + 8, TabRect.Width - 40, TabRect.Height), new StringFormat { Alignment = StringType }); - - if (ImageList != null) - { - int Index = TabPages[TabIndex].ImageIndex; - if (!(Index == -1)) - { - _Graphics.DrawImage(ImageList.Images[TabPages[TabIndex].ImageIndex], TabRect.X + 9, TabRect.Y + 6, 24, 24); - } - } - } - else - { - Rectangle TabRect = new(new Point(GetTabRect(TabIndex).Location.X - 2, GetTabRect(TabIndex).Location.Y - 2), new Size(GetTabRect(TabIndex).Width + 3, GetTabRect(TabIndex).Height - 8)); - - // Draw background of the tab - _Graphics.FillRectangle(new SolidBrush(TabColor), TabRect.X, TabRect.Y, TabRect.Width - 4, TabRect.Height + 3); - // Draw a tab highlighter on the background of the tab - Rectangle TabHighlighter = new(new Point(GetTabRect(TabIndex).X - 2, GetTabRect(TabIndex).Location.Y - (TabIndex == 0 ? 1 : 1)), new Size(4, GetTabRect(TabIndex).Height - 7)); - _Graphics.FillRectangle(new SolidBrush(LineTabColor), TabHighlighter); - - _Graphics.DrawString(TabPages[TabIndex].Text, new Font(Font.FontFamily, Font.Size, Font.Style), new SolidBrush(NormalForeColor), new Rectangle(TabRect.Left + 40, TabRect.Top + 8, TabRect.Width - 40, TabRect.Height), new StringFormat { Alignment = StringType }); - - if (ImageList != null) - { - int Index = TabPages[TabIndex].ImageIndex; - if (!(Index == -1)) - { - _Graphics.DrawImage(ImageList.Images[TabPages[TabIndex].ImageIndex], TabRect.X + 9, TabRect.Y + 6, 24, 24); - } - } - - } - } - e.Graphics.SmoothingMode = SmoothingMode.HighQuality; - e.Graphics.InterpolationMode = InterpolationType; - e.Graphics.CompositingQuality = CompositingQuality.HighQuality; - e.Graphics.DrawImage((Image)B.Clone(), 0, 0); - G.Dispose(); - B.Dispose(); - - foreach (System.Windows.Forms.TabPage Page in TabPages) - { - Page.BackColor = PageColor; - } - } - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/TabPage/CrEaTiiOn_TabPage.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/TabPage/CrEaTiiOn_TabPage.cs deleted file mode 100644 index a8473d5..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/TabPage/CrEaTiiOn_TabPage.cs +++ /dev/null @@ -1,162 +0,0 @@ -#region Imports - -using System.Drawing; -using System.Windows.Forms; - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_TabPage - - public class CrEaTiiOn_TabPage : TabControl - { - public CrEaTiiOn_TabPage() - { - SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.ResizeRedraw | ControlStyles.UserPaint | ControlStyles.DoubleBuffer, true); - DoubleBuffered = true; - SizeMode = TabSizeMode.Fixed; - ItemSize = new(30, 115); - } - protected override void CreateHandle() - { - base.CreateHandle(); - Alignment = TabAlignment.Left; - } - - private Color C1 = Color.FromArgb(250, 36, 38); - public Color SquareColor - { - get => C1; - set - { - C1 = value; - Invalidate(); - } - } - - private bool OB = false; - public bool ShowOuterBorders - { - get => OB; - set - { - OB = value; - Invalidate(); - } - } - - protected override void OnPaint(PaintEventArgs e) - { - Bitmap B = new(Width, Height); - Graphics G = Graphics.FromImage(B); - try - { - SelectedTab.BackColor = Color.FromArgb(15, 15, 15); - } - catch - { - } - G.Clear(Color.FromArgb(20, 20, 20)); - for (int i = 0; i <= TabCount - 1; i++) - { - Rectangle x2 = new(new Point(GetTabRect(i).Location.X - 2, GetTabRect(i).Location.Y - 2), new Size(GetTabRect(i).Width + 3, GetTabRect(i).Height - 1)); - Rectangle textrectangle = new(x2.Location.X + 20, x2.Location.Y, x2.Width - 20, x2.Height); - if (i == SelectedIndex) - { - G.FillRectangle(new SolidBrush(C1), new Rectangle(x2.Location, new Size(9, x2.Height))); - - - if (ImageList != null) - { - try - { - if (ImageList.Images[TabPages[i].ImageIndex] != null) - { - G.DrawImage(ImageList.Images[TabPages[i].ImageIndex], new Point(textrectangle.Location.X + 8, textrectangle.Location.Y + 6)); - G.DrawString(" " + TabPages[i].Text, Font, Brushes.White, textrectangle, new StringFormat - { - LineAlignment = StringAlignment.Center, - Alignment = StringAlignment.Near - }); - } - else - { - G.DrawString(TabPages[i].Text, Font, Brushes.White, textrectangle, new StringFormat - { - LineAlignment = StringAlignment.Center, - Alignment = StringAlignment.Near - }); - } - } - catch - { - G.DrawString(TabPages[i].Text, Font, Brushes.White, textrectangle, new StringFormat - { - LineAlignment = StringAlignment.Center, - Alignment = StringAlignment.Near - }); - } - } - else - { - G.DrawString(TabPages[i].Text, Font, Brushes.White, textrectangle, new StringFormat - { - LineAlignment = StringAlignment.Center, - Alignment = StringAlignment.Near - }); - } - - } - else - { - if (ImageList != null) - { - try - { - if (ImageList.Images[TabPages[i].ImageIndex] != null) - { - G.DrawImage(ImageList.Images[TabPages[i].ImageIndex], new Point(textrectangle.Location.X + 8, textrectangle.Location.Y + 6)); - G.DrawString(" " + TabPages[i].Text, Font, Brushes.White, textrectangle, new StringFormat - { - LineAlignment = StringAlignment.Center, - Alignment = StringAlignment.Near - }); - } - else - { - G.DrawString(TabPages[i].Text, Font, Brushes.White, textrectangle, new StringFormat - { - LineAlignment = StringAlignment.Center, - Alignment = StringAlignment.Near - }); - } - } - catch - { - G.DrawString(TabPages[i].Text, Font, Brushes.White, textrectangle, new StringFormat - { - LineAlignment = StringAlignment.Center, - Alignment = StringAlignment.Near - }); - } - } - else - { - G.DrawString(TabPages[i].Text, Font, Brushes.White, textrectangle, new StringFormat - { - LineAlignment = StringAlignment.Center, - Alignment = StringAlignment.Near - }); - } - } - } - - e.Graphics.DrawImage((Image)B.Clone(), 0, 0); - G.Dispose(); - B.Dispose(); - } - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/TextBox/CrEaTiiOn_AirTextBox.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/TextBox/CrEaTiiOn_AirTextBox.cs deleted file mode 100644 index c84914f..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/TextBox/CrEaTiiOn_AirTextBox.cs +++ /dev/null @@ -1,60 +0,0 @@ -#region Imports - -using System.Drawing; -using System.Windows.Forms; - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_AirTextBox - - public class CrEaTiiOn_AirTextBox : System.Windows.Forms.TextBox - { - private Color _BorderColor = Color.FromArgb(250, 36, 38); - public Color BorderColor - { - get => _BorderColor; - set - { - _BorderColor = value; - Invalidate(); - } - } - - protected override void WndProc(ref Message m) - { - switch (m.Msg) - { - case 15: - Invalidate(); - base.WndProc(ref m); - CustomPaint(); - break; // TODO: might not be correct. Was : Exit Select - default: - base.WndProc(ref m); - break; // TODO: might not be correct. Was : Exit Select - } - } - - public CrEaTiiOn_AirTextBox() - { - Font = new("Segoe UI", 8); - ForeColor = Color.Gray; - BackColor = Color.FromArgb(15, 15, 15); - BorderStyle = BorderStyle.FixedSingle; - Size = new(76, 20); - } - - private void CustomPaint() - { - Pen p = new(new SolidBrush(BorderColor)); - CreateGraphics().DrawLine(p, 0, 0, Width, 0); - CreateGraphics().DrawLine(p, 0, Height - 1, Width, Height - 1); - CreateGraphics().DrawLine(p, 0, 0, 0, Height - 1); - CreateGraphics().DrawLine(p, Width - 1, 0, Width - 1, Height - 1); - } - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/TextBox/CrEaTiiOn_ModernTextBox.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/TextBox/CrEaTiiOn_ModernTextBox.cs deleted file mode 100644 index fe61729..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/TextBox/CrEaTiiOn_ModernTextBox.cs +++ /dev/null @@ -1,218 +0,0 @@ -#region Imports -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Drawing; -using System.Data; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; -#endregion - -namespace CBH.RJControls -{ - [DefaultEvent("_TextChanged")] - public partial class CrEaTiiOn_ModernTextBox : UserControl - { - //Fields - private Color borderColor = Color.FromArgb(250, 36, 38); - private int borderSize = 2; - private bool underlinedStyle = false; - private Color borderFocusColor = Color.FromArgb(250, 36, 38); - private bool isFocused = false; - - //Constructor - public CrEaTiiOn_ModernTextBox() - { - InitializeComponent(); - } - - //Events - public event EventHandler _TextChanged; - - //Properties - [Category("CrEaTiiOn")] - public Color BorderColor - { - get { return borderColor; } - set - { - borderColor = value; - this.Invalidate(); - } - } - [Category("CrEaTiiOn")] - public int BorderSize - { - get { return borderSize; } - set - { - borderSize = value; - this.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - public bool UnderlinedStyle - { - get { return underlinedStyle; } - set - { - underlinedStyle = value; - this.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - public bool PasswordChar - { - get { return textBox1.UseSystemPasswordChar; } - set { textBox1.UseSystemPasswordChar = value; } - } - - [Category("CrEaTiiOn")] - public bool Multiline - { - get { return textBox1.Multiline; } - set { textBox1.Multiline = value; } - } - - [Category("CrEaTiiOn")] - public override Color BackColor - { - get { return base.BackColor; } - set - { - base.BackColor = value; - textBox1.BackColor = value; - } - } - - [Category("CrEaTiiOn")] - public override Color ForeColor - { - get { return base.ForeColor; } - set - { - base.ForeColor = value; - textBox1.ForeColor = value; - } - } - - [Category("CrEaTiiOn")] - public override Font Font - { - get { return base.Font; } - set - { - base.Font = value; - textBox1.Font = value; - if (this.DesignMode) - UpdateControlHeight(); - } - } - - [Category("CrEaTiiOn")] - public string Texts - { - get { return textBox1.Text; } - set { textBox1.Text = value; } - } - - [Category("CrEaTiiOn")] - public Color BorderFocusColor - { - get { return borderFocusColor; } - set { borderFocusColor = value; } - } - - //Overridden methods - - protected override void OnPaint(PaintEventArgs e) - { - base.OnPaint(e); - Graphics graph = e.Graphics; - - //Draw border - using (Pen penBorder = new Pen(borderColor, borderSize)) - { - penBorder.Alignment = System.Drawing.Drawing2D.PenAlignment.Inset; - if (isFocused) penBorder.Color = borderFocusColor; - - if (underlinedStyle) //Line Style - graph.DrawLine(penBorder, 0, this.Height - 1, this.Width, this.Height - 1); - else //Normal Style - graph.DrawRectangle(penBorder, 0, 0, this.Width - 0.5F, this.Height - 0.5F); - } - } - - protected override void OnResize(EventArgs e) - { - base.OnResize(e); - if (this.DesignMode) - UpdateControlHeight(); - } - - protected override void OnLoad(EventArgs e) - { - base.OnLoad(e); - UpdateControlHeight(); - } - - //Private methods - private void UpdateControlHeight() - { - if (textBox1.Multiline == false) - { - int txtHeight = TextRenderer.MeasureText("Text", this.Font).Height + 1; - textBox1.Multiline = true; - textBox1.MinimumSize = new Size(0, txtHeight); - textBox1.Multiline = false; - - this.Height = textBox1.Height + this.Padding.Top + this.Padding.Bottom; - } - } - - //TextBox events - private void textBox1_TextChanged(object sender, EventArgs e) - { - if (_TextChanged != null) - _TextChanged.Invoke(sender, e); - } - - private void textBox1_Click(object sender, EventArgs e) - { - this.OnClick(e); - } - - private void textBox1_MouseEnter(object sender, EventArgs e) - { - this.OnMouseEnter(e); - } - - private void textBox1_MouseLeave(object sender, EventArgs e) - { - this.OnMouseLeave(e); - } - - private void textBox1_KeyPress(object sender, KeyPressEventArgs e) - { - this.OnKeyPress(e); - } - - private void textBox1_Enter(object sender, EventArgs e) - { - isFocused = true; - this.Invalidate(); - } - - private void textBox1_Leave(object sender, EventArgs e) - { - isFocused = false; - this.Invalidate(); - } - - ///::::+ - } -} diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/TextBox/CrEaTiiOn_ModernTextBox.resx b/CBH-Ultimate-Theme-Library/Theme/Controls/TextBox/CrEaTiiOn_ModernTextBox.resx deleted file mode 100644 index f298a7b..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/TextBox/CrEaTiiOn_ModernTextBox.resx +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/TextBoxEdit/CrEaTiiOn_TextPosition.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/TextBoxEdit/CrEaTiiOn_TextPosition.cs deleted file mode 100644 index 4eaa960..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/TextBoxEdit/CrEaTiiOn_TextPosition.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace CBH.Controls -{ - public enum CrEaTiiOn_TextPosition - { - Left, - Right, - Center, - Sliding, - None, - } -} diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/Toggle/CrEaTiiOn_ModernToggleButton.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/Toggle/CrEaTiiOn_ModernToggleButton.cs deleted file mode 100644 index 744faa7..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/Toggle/CrEaTiiOn_ModernToggleButton.cs +++ /dev/null @@ -1,165 +0,0 @@ -#region Imports -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.ComponentModel; -#endregion - -namespace CBH.Controls -{ - public class CrEaTiiOn_ModernToggleButton : CheckBox - { - //Fields - private Color onBackColor = Color.FromArgb(250, 36, 38); - private Color onToggleColor = Color.WhiteSmoke; - private Color offBackColor = Color.Gray; - private Color offToggleColor = Color.Gainsboro; - private bool solidStyle = true; - - //Properties - [Category("CrEaTiiOn")] - public Color OnBackColor - { - get - { - return onBackColor; - } - - set - { - onBackColor = value; - this.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - public Color OnToggleColor - { - get - { - return onToggleColor; - } - - set - { - onToggleColor = value; - this.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - public Color OffBackColor - { - get - { - return offBackColor; - } - - set - { - offBackColor = value; - this.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - public Color OffToggleColor - { - get - { - return offToggleColor; - } - - set - { - offToggleColor = value; - this.Invalidate(); - } - } - - [Browsable(false)] - public override string Text - { - get - { - return base.Text; - } - - set - { - - } - } - - [Category("CrEaTiiOn")] - [DefaultValue(true)] - public bool SolidStyle - { - get - { - return solidStyle; - } - - set - { - solidStyle = value; - this.Invalidate(); - } - } - - //Constructor - public CrEaTiiOn_ModernToggleButton() - { - this.MinimumSize = new Size(45, 22); - } - - //Methods - private GraphicsPath GetFigurePath() - { - int arcSize = this.Height - 1; - Rectangle leftArc = new Rectangle(0, 0, arcSize, arcSize); - Rectangle rightArc = new Rectangle(this.Width - arcSize - 2, 0, arcSize, arcSize); - - GraphicsPath path = new GraphicsPath(); - path.StartFigure(); - path.AddArc(leftArc, 90, 180); - path.AddArc(rightArc, 270, 180); - path.CloseFigure(); - - return path; - } - - protected override void OnPaint(PaintEventArgs pevent) - { - int toggleSize = this.Height - 5; - pevent.Graphics.SmoothingMode = SmoothingMode.AntiAlias; - pevent.Graphics.Clear(this.Parent.BackColor); - - if (this.Checked) //ON - { - //Draw the control surface - if (solidStyle) - pevent.Graphics.FillPath(new SolidBrush(onBackColor), GetFigurePath()); - else pevent.Graphics.DrawPath(new Pen(onBackColor,2), GetFigurePath()); - //Draw the toggle - pevent.Graphics.FillEllipse(new SolidBrush(onToggleColor), - new Rectangle(this.Width - this.Height + 1, 2, toggleSize, toggleSize)); - } - else //OFF - { - //Draw the control surface - if(solidStyle) - pevent.Graphics.FillPath(new SolidBrush(offBackColor), GetFigurePath()); - else pevent.Graphics.DrawPath(new Pen(offBackColor, 2), GetFigurePath()); - //Draw the toggle - pevent.Graphics.FillEllipse(new SolidBrush(offToggleColor), - new Rectangle(2, 2, toggleSize, toggleSize)); - } - } - } -} diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/Toggle/CrEaTiiOn_ToggleButton.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/Toggle/CrEaTiiOn_ToggleButton.cs deleted file mode 100644 index c007ad2..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/Toggle/CrEaTiiOn_ToggleButton.cs +++ /dev/null @@ -1,121 +0,0 @@ -#region Imports -using System.ComponentModel; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Windows.Forms; -#endregion - -namespace CBH.Controls -{ - public class CrEaTiiOn_Ultimate_ToggleButton : CheckBox - { - private Color onBackColor = Color.FromArgb(250, 36, 38); - private Color onToggleColor = Color.Black; - private Color offBackColor = Color.Gray; - private Color offToggleColor = Color.Gainsboro; - private bool solidStyle = true; - - [Category("CrEaTiiOn")] - public Color OnBackColor - { - get => this.onBackColor; - set - { - this.onBackColor = value; - this.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - public Color OnToggleColor - { - get => this.onToggleColor; - set - { - this.onToggleColor = value; - this.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - public Color OffBackColor - { - get => this.offBackColor; - set - { - this.offBackColor = value; - this.Invalidate(); - } - } - - [Category("CrEaTiiOn")] - public Color OffToggleColor - { - get => this.offToggleColor; - set - { - this.offToggleColor = value; - this.Invalidate(); - } - } - - [Browsable(false)] - public override string Text - { - get => base.Text; - set - { - } - } - - [Category("CrEaTiiOn")] - [DefaultValue(true)] - public bool SolidStyle - { - get => this.solidStyle; - set - { - this.solidStyle = value; - this.Invalidate(); - } - } - - public CrEaTiiOn_Ultimate_ToggleButton() => this.MinimumSize = new Size(45, 22); - - private GraphicsPath GetFigurePath() - { - int num = this.Height - 1; - Rectangle rect1 = new Rectangle(0, 0, num, num); - Rectangle rect2 = new Rectangle(this.Width - num - 2, 0, num, num); - GraphicsPath figurePath = new GraphicsPath(); - figurePath.StartFigure(); - figurePath.AddArc(rect1, 90f, 180f); - figurePath.AddArc(rect2, 270f, 180f); - figurePath.CloseFigure(); - return figurePath; - } - - protected override void OnPaint(PaintEventArgs pevent) - { - int num = this.Height - 5; - pevent.Graphics.SmoothingMode = SmoothingMode.AntiAlias; - pevent.Graphics.Clear(this.Parent.BackColor); - if (this.Checked) - { - if (this.solidStyle) - pevent.Graphics.FillPath((Brush) new SolidBrush(this.onBackColor), this.GetFigurePath()); - else - pevent.Graphics.DrawPath(new Pen(this.onBackColor, 2f), this.GetFigurePath()); - pevent.Graphics.FillEllipse((Brush) new SolidBrush(this.onToggleColor), new Rectangle(this.Width - this.Height + 1, 2, num, num)); - } - else - { - if (this.solidStyle) - pevent.Graphics.FillPath((Brush) new SolidBrush(this.offBackColor), this.GetFigurePath()); - else - pevent.Graphics.DrawPath(new Pen(this.offBackColor, 2f), this.GetFigurePath()); - pevent.Graphics.FillEllipse((Brush) new SolidBrush(this.offToggleColor), new Rectangle(2, 2, num, num)); - } - } - } -} diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/TrackBar/CrEaTiiOn_TrackBar.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/TrackBar/CrEaTiiOn_TrackBar.cs deleted file mode 100644 index 61976c5..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/TrackBar/CrEaTiiOn_TrackBar.cs +++ /dev/null @@ -1,254 +0,0 @@ -#region Imports - -using System; -using System.ComponentModel; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Windows.Forms; - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_TrackBar - - [DefaultEvent("ValueChanged")] - public class CrEaTiiOn_TrackBar : Control - { - - #region Enums - - public enum ValueDivisor - { - By1 = 1, - By10 = 10, - By100 = 100, - By1000 = 1000 - } - - #endregion - - #region Variables - - private Rectangle FillValue; - private Rectangle PipeBorder; - private Rectangle TrackBarHandleRect; - private bool Cap; - private int ValueDrawer; - - private Size ThumbSize = new(14, 14); - private Rectangle TrackThumb; - - private int _Minimum = 0; - private int _Maximum = 10; - private int _Value = 0; - - private bool _JumpToMouse = false; - private ValueDivisor DividedValue = ValueDivisor.By1; - - #endregion - - #region Properties - - public int Minimum - { - get => _Minimum; - set - { - - if (value >= _Maximum) - { - value = _Maximum - 10; - } - - if (_Value < value) - { - _Value = value; - } - - _Minimum = value; - Invalidate(); - } - } - - public int Maximum - { - get => _Maximum; - set - { - - if (value <= _Minimum) - { - value = _Minimum + 10; - } - - if (_Value > value) - { - _Value = value; - } - - _Maximum = value; - Invalidate(); - } - } - - public delegate void ValueChangedEventHandler(); - private ValueChangedEventHandler ValueChangedEvent; - - public event ValueChangedEventHandler ValueChanged - { - add => ValueChangedEvent = (ValueChangedEventHandler)System.Delegate.Combine(ValueChangedEvent, value); - remove => ValueChangedEvent = (ValueChangedEventHandler)System.Delegate.Remove(ValueChangedEvent, value); - } - - public int Value - { - get => _Value; - set - { - if (_Value != value) - { - if (value < _Minimum) - { - _Value = _Minimum; - } - else - { - if (value > _Maximum) - { - _Value = _Maximum; - } - else - { - _Value = value; - } - } - Invalidate(); - ValueChangedEvent?.Invoke(); - } - } - } - - public ValueDivisor ValueDivison - { - get => DividedValue; - set - { - DividedValue = value; - Invalidate(); - } - } - - [Browsable(false)] - public float ValueToSet - { - get => _Value / (int)DividedValue; - set => Value = (int)(value * (int)DividedValue); - } - - public bool JumpToMouse - { - get => _JumpToMouse; - set - { - _JumpToMouse = value; - Invalidate(); - } - } - - #endregion - - #region EventArgs - - protected override void OnMouseMove(MouseEventArgs e) - { - base.OnMouseMove(e); - checked - { - bool flag = Cap && e.X > -1 && e.X < Width + 1; - if (flag) - { - Value = _Minimum + (int)Math.Round((_Maximum - _Minimum) * (e.X / (double)Width)); - } - } - } - - protected override void OnMouseDown(MouseEventArgs e) - { - base.OnMouseDown(e); - if (e.Button == MouseButtons.Left) - { - ValueDrawer = (int)Math.Round(((_Value - _Minimum) / (double)(_Maximum - _Minimum)) * (Width - 11)); - TrackBarHandleRect = new(ValueDrawer, 0, 25, 25); - Cap = TrackBarHandleRect.Contains(e.Location); - Focus(); - if (_JumpToMouse) - { - Value = _Minimum + (int)Math.Round((_Maximum - _Minimum) * (e.X / (double)Width)); - } - } - } - - protected override void OnMouseUp(MouseEventArgs e) - { - base.OnMouseUp(e); - Cap = false; - } - - #endregion - - public CrEaTiiOn_TrackBar() - { - SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.DoubleBuffer, true); - - Size = new(80, 22); - MinimumSize = new(47, 22); - } - - protected override void OnResize(EventArgs e) - { - base.OnResize(e); - Height = 22; - } - - protected override void OnPaint(PaintEventArgs e) - { - base.OnPaint(e); - Graphics G = e.Graphics; - - G.Clear(Parent.BackColor); - G.SmoothingMode = SmoothingMode.AntiAlias; - TrackThumb = new(7, 10, Width - 16, 2); - PipeBorder = new(1, 10, Width - 3, 2); - - try - { - ValueDrawer = (int)Math.Round(((_Value - _Minimum) / (double)(_Maximum - _Minimum)) * Width); - } - catch (Exception) - { - // - } - - TrackBarHandleRect = new(ValueDrawer, 0, 3, 20); - - G.FillRectangle(new SolidBrush(Color.FromArgb(124, 131, 137)), PipeBorder); - FillValue = new(0, 10, TrackBarHandleRect.X + TrackBarHandleRect.Width - 4, 3); - - G.ResetClip(); - - G.SmoothingMode = SmoothingMode.Default; - G.DrawRectangle(new(Color.FromArgb(120, 120, 120)), PipeBorder); // Draw pipe border - G.FillRectangle(new SolidBrush(Color.FromArgb(15, 15, 15)), FillValue); - - G.ResetClip(); - - G.SmoothingMode = SmoothingMode.HighQuality; - - G.FillEllipse(new SolidBrush(Color.FromArgb(15, 15, 15)), TrackThumb.X + (int)Math.Round(unchecked(TrackThumb.Width * (Value / (double)Maximum))) - (int)Math.Round(ThumbSize.Width / 2.0), TrackThumb.Y + (int)Math.Round(TrackThumb.Height / 2.0) - (int)Math.Round(ThumbSize.Height / 2.0), ThumbSize.Width, ThumbSize.Height); - G.DrawEllipse(new(Color.FromArgb(15, 15, 15)), TrackThumb.X + (int)Math.Round(unchecked(TrackThumb.Width * (Value / (double)Maximum))) - (int)Math.Round(ThumbSize.Width / 2.0), TrackThumb.Y + (int)Math.Round(TrackThumb.Height / 2.0) - (int)Math.Round(ThumbSize.Height / 2.0), ThumbSize.Width, ThumbSize.Height); - } - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/Watcher/CrEaTiiOn_ExtendedFileSystemWatcher.cs b/CBH-Ultimate-Theme-Library/Theme/Controls/Watcher/CrEaTiiOn_ExtendedFileSystemWatcher.cs deleted file mode 100644 index c9f0c04..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/Watcher/CrEaTiiOn_ExtendedFileSystemWatcher.cs +++ /dev/null @@ -1,268 +0,0 @@ -#region Imports - -using System; -using System.ComponentModel; -using System.IO; -using System.Windows.Forms; -using SysAction = System.Action; - -#endregion - -namespace CBH.Controls -{ - #region CrEaTiiOn_ExtendedFileSystemWatcher - - public class CrEaTiiOn_ExtendedFileSystemWatcher : Component - { - public CrEaTiiOn_ExtendedFileSystemWatcher() - { - watcher.NotifyFilter = NotifyFilters.FileName | NotifyFilters.DirectoryName | NotifyFilters.Attributes | NotifyFilters.Size | NotifyFilters.LastWrite | NotifyFilters.LastAccess | NotifyFilters.CreationTime | NotifyFilters.Security; - watcher.Filter = "*.*"; - watcher.IncludeSubdirectories = true; - watcher.Created += OnCreated; - watcher.Changed += OnChanged; - watcher.Deleted += OnDeleted; - watcher.Renamed += OnRenamed; - watcher.EnableRaisingEvents = false; - watcher.InternalBufferSize = 131072; - } - - public event EventHandler ServiceStarted; - - protected virtual void OnServiceStarted() - { - ServiceStarted?.Invoke(this, null); - } - - public event EventHandler ServiceStopped; - - protected virtual void OnServiceStopped(FileSystemEventArgs e) - { - ServiceStopped?.Invoke(this, null); - } - - public event FileSystemEventHandler FileCreated; - - protected virtual void OnFileCreated(FileSystemEventArgs e) - { - FileCreated?.Invoke(this, e); - } - - public event FileSystemEventHandler FileDeleted; - - protected virtual void OnFileDeleted(FileSystemEventArgs e) - { - FileDeleted?.Invoke(this, e); - } - - public event FileSystemEventHandler FileChanged; - - protected virtual void OnFileChanged(FileSystemEventArgs e) - { - FileChanged?.Invoke(this, e); - } - - public event RenamedEventHandler FileRenamed; - - protected virtual void OnFileRenamed(RenamedEventArgs e) - { - FileRenamed?.Invoke(this, e); - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("Choose when the watcher updates")] - public NotifyFilters UpdateOn - { - get => watcher.NotifyFilter; - set => watcher.NotifyFilter = value; - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("Watch subdirectories")] - public bool WatchSubdirectories - { - get => watcher.IncludeSubdirectories; - set => watcher.IncludeSubdirectories = value; - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The path to watch")] - public string WatchPath - { - get => watcher.Path; - set - { - if (Directory.Exists(value)) - { - watcher.Path = value; - return; - } - if (File.Exists(value)) - { - watcher.Path = Path.GetDirectoryName(value); - watcher.Filter = Path.GetFileName(value); - } - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("Filter for certin files")] - public string Filters - { - get => watcher.Filter; - set => watcher.Filter = value; - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The control to output to(via Text)")] - public Control OutputControl - { - get => outputControl; - set => outputControl = value; - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("Remove WatchPath from output")] - public bool SlimOutput - { - get => slimOutput; - set => slimOutput = value; - } - - public void StartService() - { - ServiceStarted(this, null); - if (!watcher.EnableRaisingEvents) - { - watcher.EnableRaisingEvents = true; - } - } - - public void StopService() - { - ServiceStopped(this, null); - if (watcher.EnableRaisingEvents) - { - watcher.EnableRaisingEvents = false; - } - } - - private void OnChanged(object source, FileSystemEventArgs e) - { - DateTime lastWriteTime = File.GetLastWriteTime(e.FullPath); - if (lastWriteTime != lastRead && File.Exists(e.FullPath)) - { - lastRead = lastWriteTime; - if (slimOutput) - { - outputControl.Invoke(new SysAction(delegate () - { - outputControl.Text = outputControl.Text + "\nChanged: " + e.FullPath.Replace(watcher.Path, ""); - })); - } - else - { - outputControl.Invoke(new SysAction(delegate () - { - outputControl.Text = outputControl.Text + "\nChanged: " + e.FullPath; - })); - } - OnFileChanged(e); - } - } - - private void OnDeleted(object source, FileSystemEventArgs e) - { - DateTime lastWriteTime = File.GetLastWriteTime(e.FullPath); - lastRead = lastWriteTime; - if (slimOutput) - { - if (outputControl.InvokeRequired) - { - outputControl.Invoke(new SysAction(delegate () - { - outputControl.Text = outputControl.Text + "\nDeleted: " + e.FullPath.Replace(watcher.Path, ""); - })); - } - } - else if (outputControl.InvokeRequired) - { - outputControl.Invoke(new SysAction(delegate () - { - outputControl.Text = outputControl.Text + "\nDeleted: " + e.FullPath; - })); - } - OnFileDeleted(e); - } - - private void OnCreated(object source, FileSystemEventArgs e) - { - DateTime lastWriteTime = File.GetLastWriteTime(e.FullPath); - if (lastWriteTime != lastRead) - { - lastRead = lastWriteTime; - if (slimOutput) - { - if (outputControl.InvokeRequired) - { - outputControl.Invoke(new SysAction(delegate () - { - outputControl.Text = outputControl.Text + "\nCreated: " + e.FullPath.Replace(watcher.Path, ""); - })); - } - } - else if (outputControl.InvokeRequired) - { - outputControl.Invoke(new SysAction(delegate () - { - outputControl.Text = outputControl.Text + "\nCreated: " + e.FullPath; - })); - } - OnFileCreated(e); - } - } - - public void OnRenamed(object source, RenamedEventArgs e) - { - DateTime lastWriteTime = File.GetLastWriteTime(e.FullPath); - if (lastWriteTime != lastRead) - { - lastRead = lastWriteTime; - if (slimOutput) - { - if (outputControl.InvokeRequired) - { - outputControl.Invoke(new SysAction(delegate () - { - outputControl.Text = outputControl.Text + "\nRenamed: " + e.FullPath.Replace(watcher.Path, ""); - })); - } - } - else if (outputControl.InvokeRequired) - { - outputControl.Invoke(new SysAction(delegate () - { - outputControl.Text = outputControl.Text + "\nRenamed: " + e.FullPath; - })); - } - OnFileRenamed(e); - } - } - - private readonly FileSystemWatcher watcher = new(); - - private DateTime lastRead = DateTime.MinValue; - - private Control outputControl; - - private bool slimOutput = true; - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Helpers/Helpers.cs b/CBH-Ultimate-Theme-Library/Theme/Helpers/Helpers.cs deleted file mode 100644 index f512c46..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Helpers/Helpers.cs +++ /dev/null @@ -1,878 +0,0 @@ -#region Imports -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Drawing.Drawing2D; -using System.Drawing.Text; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -#endregion - -namespace CBH_Ultimate_Theme_Library.Theme.Helpers -{ - #region Extension Methods - public static class ExtensionMethods - { - public static Color FromHex(this string hex) - { - return ColorTranslator.FromHtml(hex); - } - } - #endregion - - #region Rounded Rectangle - public class RoundedRectangleF - { - - Point location; - float radius; - GraphicsPath grPath; - float x, y; - float width, height; - - - public RoundedRectangleF(float width, float height, float radius, float x = 0, float y = 0) - { - - location = new Point(0, 0); - this.radius = radius; - this.x = x; - this.y = y; - this.width = width; - this.height = height; - grPath = new GraphicsPath(); - if (radius <= 0) - { - grPath.AddRectangle(new RectangleF(x, y, width, height)); - return; - } - RectangleF upperLeftRect = new RectangleF(x, y, 2 * radius, 2 * radius); - RectangleF upperRightRect = new RectangleF(width - 2 * radius - 1, x, 2 * radius, 2 * radius); - RectangleF lowerLeftRect = new RectangleF(x, height - 2 * radius - 1, 2 * radius, 2 * radius); - RectangleF lowerRightRect = new RectangleF(width - 2 * radius - 1, height - 2 * radius - 1, 2 * radius, 2 * radius); - - grPath.AddArc(upperLeftRect, 180, 90); - grPath.AddArc(upperRightRect, 270, 90); - grPath.AddArc(lowerRightRect, 0, 90); - grPath.AddArc(lowerLeftRect, 90, 90); - grPath.CloseAllFigures(); - - } - public RoundedRectangleF() - { - } - public GraphicsPath Path - { - get - { - return grPath; - } - } - public RectangleF Rect - { - get - { - return new RectangleF(x, y, width, height); - } - } - public float Radius - { - get - { - return radius; - } - set - { - radius = value; - } - } - - } - #endregion - - #region Transparent - public class Transparenter - { - public static void MakeTransparent(Control control, Graphics g) - { - var parent = control.Parent; - if (parent == null) return; - var bounds = control.Bounds; - var siblings = parent.Controls; - int index = siblings.IndexOf(control); - Bitmap behind = null; - for (int i = siblings.Count - 1; i > index; i--) - { - var c = siblings[i]; - if (!c.Bounds.IntersectsWith(bounds)) continue; - if (behind == null) - behind = new Bitmap(control.Parent.ClientSize.Width, control.Parent.ClientSize.Height); - c.DrawToBitmap(behind, c.Bounds); - } - if (behind == null) return; - g.DrawImage(behind, control.ClientRectangle, bounds, GraphicsUnit.Pixel); - behind.Dispose(); - } - } - #endregion - - #region Helpers - public static class Helpers - { - public static Color C1_F = ColorFromHex("#007196"); - public static Color C1_B = ColorFromHex("#00BFFF"); - - public static Color C2_F = ColorFromHex("#D15A4D"); - public static Color C2_B = ColorFromHex("#FFCFCA"); - - public static Color C3_F = ColorFromHex("#54AB54"); - public static Color C3_B = ColorFromHex("#CAFFCA"); - - public static Color C4_F = ColorFromHex("#ADA200"); - public static Color C4_B = ColorFromHex("#FCF47E"); - - public static Color C5_F = ColorFromHex("#E800CD"); - public static Color C5_B = ColorFromHex("#FFBFF7"); - - public static Color C6_F = ColorFromHex("#0EADAD"); - public static Color C6_B = ColorFromHex("#9CFFFF"); - - public static Color ColorFromHex(string Hex) - { - return Color.FromArgb(Convert.ToInt32(long.Parse(string.Format("FFFFFFFFFF{0}", Hex.StartsWith("#") ? Hex.Substring(1) : Hex), System.Globalization.NumberStyles.HexNumber))); - } - public enum MouseState : byte - { - None = 0, - Over = 1, - Down = 2 - } - - public enum RoundingStyle : byte - { - All = 0, - Top = 1, - Bottom = 2, - Left = 3, - Right = 4, - TopRight = 5, - BottomRight = 6 - } - - public static GraphicsPath RoundRect(Rectangle Rect, int Rounding, RoundingStyle Style = RoundingStyle.All) - { - - GraphicsPath GP = new GraphicsPath(); - int AW = Rounding * 2; - - GP.StartFigure(); - - if (Rounding == 0) - { - GP.AddRectangle(Rect); - GP.CloseAllFigures(); - return GP; - } - - switch (Style) - { - case RoundingStyle.All: - GP.AddArc(new Rectangle(Rect.X, Rect.Y, AW, AW), -180, 90); - GP.AddArc(new Rectangle(Rect.Width - AW + Rect.X, Rect.Y, AW, AW), -90, 90); - GP.AddArc(new Rectangle(Rect.Width - AW + Rect.X, Rect.Height - AW + Rect.Y, AW, AW), 0, 90); - GP.AddArc(new Rectangle(Rect.X, Rect.Height - AW + Rect.Y, AW, AW), 90, 90); - break; - case RoundingStyle.Top: - GP.AddArc(new Rectangle(Rect.X, Rect.Y, AW, AW), -180, 90); - GP.AddArc(new Rectangle(Rect.Width - AW + Rect.X, Rect.Y, AW, AW), -90, 90); - GP.AddLine(new Point(Rect.X + Rect.Width, Rect.Y + Rect.Height), new Point(Rect.X, Rect.Y + Rect.Height)); - break; - case RoundingStyle.Bottom: - GP.AddLine(new Point(Rect.X, Rect.Y), new Point(Rect.X + Rect.Width, Rect.Y)); - GP.AddArc(new Rectangle(Rect.Width - AW + Rect.X, Rect.Height - AW + Rect.Y, AW, AW), 0, 90); - GP.AddArc(new Rectangle(Rect.X, Rect.Height - AW + Rect.Y, AW, AW), 90, 90); - break; - case RoundingStyle.Left: - GP.AddArc(new Rectangle(Rect.X, Rect.Y, AW, AW), -180, 90); - GP.AddLine(new Point(Rect.X + Rect.Width, Rect.Y), new Point(Rect.X + Rect.Width, Rect.Y + Rect.Height)); - GP.AddArc(new Rectangle(Rect.X, Rect.Height - AW + Rect.Y, AW, AW), 90, 90); - break; - case RoundingStyle.Right: - GP.AddLine(new Point(Rect.X, Rect.Y + Rect.Height), new Point(Rect.X, Rect.Y)); - GP.AddArc(new Rectangle(Rect.Width - AW + Rect.X, Rect.Y, AW, AW), -90, 90); - GP.AddArc(new Rectangle(Rect.Width - AW + Rect.X, Rect.Height - AW + Rect.Y, AW, AW), 0, 90); - break; - case RoundingStyle.TopRight: - GP.AddLine(new Point(Rect.X, Rect.Y + 1), new Point(Rect.X, Rect.Y)); - GP.AddArc(new Rectangle(Rect.Width - AW + Rect.X, Rect.Y, AW, AW), -90, 90); - GP.AddLine(new Point(Rect.X + Rect.Width, Rect.Y + Rect.Height - 1), new Point(Rect.X + Rect.Width, Rect.Y + Rect.Height)); - GP.AddLine(new Point(Rect.X + 1, Rect.Y + Rect.Height), new Point(Rect.X, Rect.Y + Rect.Height)); - break; - case RoundingStyle.BottomRight: - GP.AddLine(new Point(Rect.X, Rect.Y + 1), new Point(Rect.X, Rect.Y)); - GP.AddLine(new Point(Rect.X + Rect.Width - 1, Rect.Y), new Point(Rect.X + Rect.Width, Rect.Y)); - GP.AddArc(new Rectangle(Rect.Width - AW + Rect.X, Rect.Height - AW + Rect.Y, AW, AW), 0, 90); - GP.AddLine(new Point(Rect.X + 1, Rect.Y + Rect.Height), new Point(Rect.X, Rect.Y + Rect.Height)); - break; - } - - GP.CloseAllFigures(); - - return GP; - - } - - } - #endregion - - #region Draw Helpers - public static class DrawHelper - { - public static GraphicsPath CreateRoundRect(float x, float y, float width, float height, float radius) - { - GraphicsPath gp = new GraphicsPath(); - gp.AddLine(x + radius, y, x + width - (radius * 2), y); - gp.AddArc(x + width - (radius * 2), y, radius * 2, radius * 2, 270, 90); - - gp.AddLine(x + width, y + radius, x + width, y + height - (radius * 2)); - gp.AddArc(x + width - (radius * 2), y + height - (radius * 2), radius * 2, radius * 2, 0, 90); - - gp.AddLine(x + width - (radius * 2), y + height, x + radius, y + height); - gp.AddArc(x, y + height - (radius * 2), radius * 2, radius * 2, 90, 90); - - gp.AddLine(x, y + height - (radius * 2), x, y + radius); - gp.AddArc(x, y, radius * 2, radius * 2, 180, 90); - - gp.CloseFigure(); - return gp; - } - public static GraphicsPath CreateUpRoundRect(float x, float y, float width, float height, float radius) - { - GraphicsPath gp = new GraphicsPath(); - - gp.AddLine(x + radius, y, x + width - (radius * 2), y); - gp.AddArc(x + width - (radius * 2), y, radius * 2, radius * 2, 270, 90); - - gp.AddLine(x + width, y + radius, x + width, y + height - (radius * 2) + 1); - gp.AddArc(x + width - (radius * 2), y + height - (radius * 2), radius * 2, 2, 0, 90); - - gp.AddLine(x + width, y + height, x + radius, y + height); - gp.AddArc(x, y + height - (radius * 2) + 1, radius * 2, 1, 90, 90); - - gp.AddLine(x, y + height, x, y + radius); - gp.AddArc(x, y, radius * 2, radius * 2, 180, 90); - - gp.CloseFigure(); - return gp; - } - public static GraphicsPath CreateLeftRoundRect(float x, float y, float width, float height, float radius) - { - GraphicsPath gp = new GraphicsPath(); - gp.AddLine(x + radius, y, x + width - (radius * 2), y); - gp.AddArc(x + width - (radius * 2), y, radius * 2, radius * 2, 270, 90); - - gp.AddLine(x + width, y + 0, x + width, y + height); - gp.AddArc(x + width - (radius * 2), y + height - (1), radius * 2, 1, 0, 90); - - gp.AddLine(x + width - (radius * 2), y + height, x + radius, y + height); - gp.AddArc(x, y + height - (radius * 2), radius * 2, radius * 2, 90, 90); - - gp.AddLine(x, y + height - (radius * 2), x, y + radius); - gp.AddArc(x, y, radius * 2, radius * 2, 180, 90); - - gp.CloseFigure(); - return gp; - } - public static Color BlendColor(Color backgroundColor, Color frontColor) - { - double ratio = 0 / 255d; - double invRatio = 1d - ratio; - int r = (int)((backgroundColor.R * invRatio) + (frontColor.R * ratio)); - int g = (int)((backgroundColor.G * invRatio) + (frontColor.G * ratio)); - int b = (int)((backgroundColor.B * invRatio) + (frontColor.B * ratio)); - return Color.FromArgb(r, g, b); - } - - public static Color BackColor = ColorTranslator.FromHtml("#dadcdf");//bcbfc4 - public static Color DarkBackColor = ColorTranslator.FromHtml("#90949a"); - public static Color LightBackColor = ColorTranslator.FromHtml("#F5F5F5"); - } - #endregion - - #region String Alignment Helpers - public static class StringAlign - { - /// - /// 左上 - /// - public static StringFormat TopLeft { get => new StringFormat { Alignment = StringAlignment.Near, LineAlignment = StringAlignment.Near }; } - /// - /// 中上 - /// - public static StringFormat TopCenter { get => new StringFormat { Alignment = StringAlignment.Center, LineAlignment = StringAlignment.Near }; } - /// - /// 右上 - /// - public static StringFormat TopRight { get => new StringFormat { Alignment = StringAlignment.Far, LineAlignment = StringAlignment.Near }; } - /// - /// 左中 - /// - public static StringFormat Left { get => new StringFormat { Alignment = StringAlignment.Near, LineAlignment = StringAlignment.Center }; } - /// - /// 正中 - /// - public static StringFormat Center { get => new StringFormat { Alignment = StringAlignment.Center, LineAlignment = StringAlignment.Center }; } - /// - /// 右中 - /// - public static StringFormat Right { get => new StringFormat { Alignment = StringAlignment.Far, LineAlignment = StringAlignment.Center }; } - /// - /// 左下 - /// - public static StringFormat BottomLeft { get => new StringFormat { Alignment = StringAlignment.Near, LineAlignment = StringAlignment.Far }; } - /// - /// 中下 - /// - public static StringFormat BottomCenter { get => new StringFormat { Alignment = StringAlignment.Center, LineAlignment = StringAlignment.Far }; } - /// - /// 右下 - /// - public static StringFormat BottomRight { get => new StringFormat { Alignment = StringAlignment.Far, LineAlignment = StringAlignment.Far }; } - } - #endregion - - #region Theme Color Helpers - public static class ThemeColors - { - /// - /// 主色 - /// - public static Color PrimaryColor = Color.FromArgb(250, 36, 38); - public static Color LightPrimary = Color.FromArgb(250, 36, 38); - public static Color DarkPrimary = Color.FromArgb(250, 36, 38); - - #region 辅助色 - /// - /// 成功 - /// - public static Color Success = ColorTranslator.FromHtml("#67c23a"); - /// - /// 警告 - /// - public static Color Warning = ColorTranslator.FromHtml("#e6a23c"); - /// - /// 危险 - /// - public static Color Danger = ColorTranslator.FromHtml("#f56c6c"); - /// - /// 信息 - /// - public static Color Info = ColorTranslator.FromHtml("#909399"); - #endregion - - #region 文字颜色 - /// - /// 主要文字 - /// - public static Color MainText = ColorTranslator.FromHtml("#303133"); - /// - /// 常规文字 - /// - public static Color RegularText = ColorTranslator.FromHtml("#606266"); - /// - /// 次要文字 - /// - public static Color SecondaryText = ColorTranslator.FromHtml("#909399"); - /// - /// 占位文字 - /// - public static Color PlaceholderText = ColorTranslator.FromHtml("#c0c4cc"); - #endregion - - #region 边框颜色 - /// - /// 一级边框 - /// - public static Color OneLevelBorder = ColorTranslator.FromHtml("#dcdfe6"); - /// - /// 二级边框 - /// - public static Color TwoLevelBorder = ColorTranslator.FromHtml("#e4e7ed"); - /// - /// 三级边框 - /// - public static Color ThreeLevelBorder = ColorTranslator.FromHtml("#ebeef5"); - /// - /// 四级边框 - /// - public static Color FourLevelBorder = ColorTranslator.FromHtml("#f2f6fc"); - #endregion - } - #endregion - - #region External Utilities - internal class Adjustments - { - - //Default FontFamily that will be used throughout the entire theme - public static readonly FontFamily DefaultFontFamily = new FontFamily("Segoe UI"); - - //Roundness of the corners of most controls. Higher = more circular - public static readonly int Roundness = 4; - - } - - internal class DrawingHelper - { - - public enum RoundingStyle - { - All, - Top, - Bottom, - Left, - Right - } - - public GraphicsPath RoundRect(Rectangle rect, int slope, RoundingStyle style = RoundingStyle.All) - { - - GraphicsPath gp = new GraphicsPath(); - int arcWidth = slope * 2; - - switch (style) - { - case RoundingStyle.All: - gp.AddArc(new Rectangle(rect.X, rect.Y, arcWidth, arcWidth), -180F, 90F); - gp.AddArc(new Rectangle(rect.Width - arcWidth + rect.X, rect.Y, arcWidth, arcWidth), -90F, 90F); - gp.AddArc(new Rectangle(rect.Width - arcWidth + rect.X, rect.Height - arcWidth + rect.Y, arcWidth, arcWidth), 0F, 90F); - gp.AddArc(new Rectangle(rect.X, rect.Height - arcWidth + rect.Y, arcWidth, arcWidth), 90F, 90F); - break; - case RoundingStyle.Top: - gp.AddArc(new Rectangle(rect.X, rect.Y, arcWidth, arcWidth), -180F, 90F); - gp.AddArc(new Rectangle(rect.Width - arcWidth + rect.X, rect.Y, arcWidth, arcWidth), -90F, 90F); - gp.AddLine(new Point(rect.X + rect.Width, rect.Y + rect.Height), new Point(rect.X, rect.Y + rect.Height)); - break; - case RoundingStyle.Bottom: - gp.AddLine(new Point(rect.X, rect.Y), new Point(rect.X + rect.Width, rect.Y)); - gp.AddArc(new Rectangle(rect.Width - arcWidth + rect.X, rect.Height - arcWidth + rect.Y, arcWidth, arcWidth), 0F, 90F); - gp.AddArc(new Rectangle(rect.X, rect.Height - arcWidth + rect.Y, arcWidth, arcWidth), 90F, 90F); - break; - case RoundingStyle.Left: - gp.AddArc(new Rectangle(rect.X, rect.Y, arcWidth, arcWidth), -180F, 90F); - gp.AddLine(new Point(rect.X + rect.Width, rect.Y), new Point(rect.X + rect.Width, rect.Y + rect.Height)); - gp.AddArc(new Rectangle(rect.X, rect.Height - arcWidth + rect.Y, arcWidth, arcWidth), 90F, 90F); - break; - case RoundingStyle.Right: - gp.AddLine(new Point(rect.X, rect.Y + rect.Height), new Point(rect.X, rect.Y)); - gp.AddArc(new Rectangle(rect.Width - arcWidth + rect.X, rect.Y, arcWidth, arcWidth), -90F, 90F); - gp.AddArc(new Rectangle(rect.Width - arcWidth + rect.X, rect.Height - arcWidth + rect.Y, arcWidth, arcWidth), 0F, 90F); - break; - } - - gp.CloseAllFigures(); - - return gp; - - } - - public enum ColorAdjustmentType - { - Lighten, - Darken - } - - public Color AdjustColor(Color c, int intensity, ColorAdjustmentType adjustment, bool keepAlpha = true) - { - - int r = 0; - int g = 0; - int b = 0; - - if (intensity < 1) - { - intensity = 1; - } - else if (intensity > 255) - { - intensity = 255; - } - - if (adjustment == ColorAdjustmentType.Lighten) - { - r = Convert.ToInt32(IncrementValue(c.R, intensity)); - g = Convert.ToInt32(IncrementValue(c.G, intensity)); - b = Convert.ToInt32(IncrementValue(c.B, intensity)); - } - else - { - r = Convert.ToInt32(DecrementValue(c.R, intensity)); - g = Convert.ToInt32(DecrementValue(c.G, intensity)); - b = Convert.ToInt32(DecrementValue(c.B, intensity)); - } - - if (keepAlpha) - { - return Color.FromArgb(c.A, r, g, b); - } - else - { - return Color.FromArgb(255, r, g, b); - } - - - } - - private object IncrementValue(int initialValue, int intensity, int maximum = 255) - { - if (initialValue + intensity < maximum) - { - return initialValue + intensity; - } - else - { - return maximum; - } - } - - private object DecrementValue(int initialValue, int intensity, int minimum = 0) - { - if (initialValue - intensity > minimum) - { - return initialValue - intensity; - } - else - { - return minimum; - } - } - - } - - internal class MultiLineHandler - { - - public List GetLines(Graphics g, string str, Font font, int maxLength) - { - - List result = new List(); - System.Text.StringBuilder sb = new System.Text.StringBuilder(); - - str = str.Replace("\r", "").Replace("\n", ""); - - string[] words = null; - if (str.Contains(" ")) - { - words = str.Replace(Environment.NewLine, null).Split(' '); - } - else - { - result.Add(str); - return result; - } - - for (var i = 0; i < words.Length; i++) - { - - if (i == words.Length - 1) - { - if (g.MeasureString(sb.ToString() + " " + words[i], font).Width < maxLength) - { - sb.Append(words[i]); - result.Add(sb.ToString()); - } - else - { - result.Add(sb.ToString()); - result.Add(words[i]); - } - } - else if (g.MeasureString(sb.ToString() + " " + words[i], font).Width > maxLength) - { - result.Add(sb.ToString()); - sb.Clear(); - sb.Append(words[i] + " "); - } - else - { - sb.Append(words[i] + " "); - } - - } - - return result; - - } - - } - #endregion - - #region External Helpers - static class Drawing - { - - public static GraphicsPath RoundRect(Rectangle rect, int slope) - { - GraphicsPath gp = new GraphicsPath(); - int arcWidth = slope * 2; - gp.AddArc(new Rectangle(rect.X, rect.Y, arcWidth, arcWidth), -180, 90); - gp.AddArc(new Rectangle(rect.Width - arcWidth + rect.X, rect.Y, arcWidth, arcWidth), -90, 90); - gp.AddArc(new Rectangle(rect.Width - arcWidth + rect.X, rect.Height - arcWidth + rect.Y, arcWidth, arcWidth), 0, 90); - gp.AddArc(new Rectangle(rect.X, rect.Height - arcWidth + rect.Y, arcWidth, arcWidth), 90, 90); - gp.CloseAllFigures(); - return gp; - } - - } - - public static class Prevent - { - - public static void Prevents(Graphics g, int w, int h) - { - string txt = System.Text.Encoding.UTF8.GetString(Convert.FromBase64String("VGhlbWUlMjBjcmVhdGVkJTIwYnklMjBIYXdrJTIwSEY=")).Replace("%20", " "); - Size txtSize = new Size(Convert.ToInt32(g.MeasureString(txt, new Font("Segoe UI", 8)).Width), Convert.ToInt32(g.MeasureString(txt, new Font("Segoe UI", 8)).Height)); - g.DrawString(txt, new Font("Segoe UI", 8), new SolidBrush(Color.FromArgb(125, 125, 125)), new Point(w - txtSize.Width - 6, h - txtSize.Height - 4)); - } - - } - #endregion - - #region Theme Containers - [ToolboxItem(false)] - public class ASCThemeContainer : ContainerControl - { - - private int moveHeight = 38; - private bool formCanMove = false; - private int mouseX; - private int mouseY; - private bool overExit; - - private bool overMin; - public override string Text - { - get { return base.Text; } - set - { - base.Text = value; - Invalidate(); - } - } - - public ASCThemeContainer() - { - SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.UserPaint | ControlStyles.ResizeRedraw, true); - Dock = DockStyle.Fill; - Font = new Font("Segoe UI", 12, FontStyle.Bold | FontStyle.Italic); - BackColor = Color.FromArgb(15, 15, 15); - } - - protected override void CreateHandle() - { - base.CreateHandle(); - Parent.FindForm().FormBorderStyle = FormBorderStyle.None; - if (Parent.FindForm().TransparencyKey == null) - Parent.FindForm().TransparencyKey = Color.Fuchsia; - } - - protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) - { - base.OnPaint(e); - - Graphics G = e.Graphics; - G.Clear(Parent.FindForm().TransparencyKey); - - int slope = 8; - - Rectangle mainRect = new Rectangle(0, 0, Width - 1, Height - 1); - GraphicsPath mainPath = Drawing.RoundRect(mainRect, slope); - G.FillPath(new SolidBrush(BackColor), mainPath); - G.DrawPath(new Pen(Color.FromArgb(30, 35, 45)), mainPath); - G.FillPath(new SolidBrush(Color.FromArgb(30, 30, 40)), Drawing.RoundRect(new Rectangle(0, 0, Width - 1, moveHeight - slope), slope)); - G.FillRectangle(new SolidBrush(Color.FromArgb(30, 30, 40)), new Rectangle(0, moveHeight - (slope * 2), Width - 1, slope * 2)); - G.DrawLine(new Pen(Color.FromArgb(60, 60, 60)), new Point(1, moveHeight), new Point(Width - 2, moveHeight)); - G.SmoothingMode = SmoothingMode.HighQuality; - - int textX = 6; - int textY = (moveHeight / 2) - Convert.ToInt32((G.MeasureString(Text, Font).Height / 2)) + 1; - Size textSize = new Size(Convert.ToInt32(G.MeasureString(Text, Font).Width), Convert.ToInt32(G.MeasureString(Text, Font).Height)); - Rectangle textRect = new Rectangle(textX, textY, textSize.Width, textSize.Height); - LinearGradientBrush textBrush = new LinearGradientBrush(textRect, Color.FromArgb(185, 190, 195), Color.FromArgb(125, 125, 125), 90f); - G.DrawString(Text, Font, textBrush, new Point(textX, textY)); - - if (overExit) - { - G.DrawString("r", new Font("Marlett", 12, FontStyle.Bold), new SolidBrush(Color.FromArgb(25, 100, 140)), new Point(Width - 27, 11)); - } - else - { - G.DrawString("r", new Font("Marlett", 12, FontStyle.Bold), new SolidBrush(Color.FromArgb(205, 210, 215)), new Point(Width - 27, 11)); - } - if (overMin) - { - G.DrawString("0", new Font("Marlett", 12, FontStyle.Bold), new SolidBrush(Color.FromArgb(25, 100, 140)), new Point(Width - 47, 10)); - } - else - { - G.DrawString("0", new Font("Marlett", 12, FontStyle.Bold), new SolidBrush(Color.FromArgb(205, 210, 215)), new Point(Width - 47, 10)); - } - - if (DesignMode) - - Prevent.Prevents(G, Width, Height); - - } - - protected override void OnMouseMove(System.Windows.Forms.MouseEventArgs e) - { - base.OnMouseMove(e); - - if (formCanMove == true) - { - Parent.FindForm().Location = new Point(MousePosition.X - mouseX, MousePosition.Y - mouseY); - } - - if (e.Y > 11 && e.Y < 24) - { - if (e.X > Width - 23 && e.X < Width - 10) - overExit = true; - else - overExit = false; - if (e.X > Width - 44 && e.X < Width - 31) - overMin = true; - else - overMin = false; - } - else - { - overExit = false; - overMin = false; - } - - Invalidate(); - - } - - protected override void OnMouseDown(System.Windows.Forms.MouseEventArgs e) - { - base.OnMouseDown(e); - - mouseX = e.X; - mouseY = e.Y; - - if (e.Y <= moveHeight && overExit == false && overMin == false) - formCanMove = true; - - if (overExit) - { - Parent.FindForm().Close(); - } - else if (overMin) - { - Parent.FindForm().WindowState = FormWindowState.Minimized; - overExit = false; - overMin = false; - } - else - { - Focus(); - } - - Invalidate(); - - } - - protected override void OnMouseUp(System.Windows.Forms.MouseEventArgs e) - { - base.OnMouseUp(e); - formCanMove = false; - } - - } - #endregion - - #region Help Engines - internal class HelpEngine - { - /// - /// Вызывает MessageBox.Show(...) с готовыми параметрами. - /// - /// - /// - /// Текст сообщения MessageBox - /// - public static void MSB_Error(string text) => System.Windows.Forms.MessageBox.Show(text, "FC-UI", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error); - - /// - /// Создает новый объект Font - /// - /// - /// - /// Имя шрифта. - /// - /// - /// Размер шрифта. - /// - /// - /// Стиль шрифта. - /// - /// - /// Этот метод возвращает новый объект Font, который является стандартным шрифтом FC_UI или же шрифтом по заданным параметрам. - public static Font GetDefaultFont( - string familyName = "Segoe UI", - float emSize = 11.0F, - FontStyle fontStyle = FontStyle.Regular) => new Font(familyName, emSize, fontStyle); - - /// - /// Создает новый объект Graphics на основе ссылочного Bitmap. - /// - /// - /// - /// Режим сглаживания для линий и границ. - /// - /// - /// Качество отрисовки текста. - /// - /// - /// Этот метод возвращает новый объект Graphics по заданным параметрам. - public static Graphics GetGraphics(ref Bitmap bitmap, SmoothingMode SmoothingMode, TextRenderingHint TextRenderingHint) - { - Graphics graphics = Graphics.FromImage(bitmap); - graphics.SmoothingMode = SmoothingMode; - graphics.TextRenderingHint = TextRenderingHint; - - return graphics; - } - - /// - /// Класс GetRandom, который имеет готовый объект Random и готовые методы для работы с ним. - /// - public class GetRandom - { - private readonly System.Random random = new System.Random(System.Environment.TickCount); - - /// - /// Создает объект Color. - /// - /// - /// - /// Альфа (0..255) - /// - /// - /// Этот метод возвращает новый объект Color по случайным параметрам. - public Color ColorArgb(int alpha = 255) => Color.FromArgb(alpha, Int(0, 255), Int(0, 255), Int(0, 255)); - - /// Этот метод возвращает случайное целое число в указанном диапазоне. - public int Int(int min, int max) => random.Next(min, max); - - /// Этот метод возвращает случайное число с плавающей запятой в указанном диапазоне. - public float Float(int min, int max) => random.Next(min * 100, max * 100) / 100; - - /// Этот метод возвращает true или false. - public bool Bool() => Int(0, 2) == 1; - } - } - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/Helpers/Main/Helper/Theme.cs b/CBH-Ultimate-Theme-Library/Theme/Helpers/Main/Helper/Theme.cs deleted file mode 100644 index 2923b84..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Helpers/Main/Helper/Theme.cs +++ /dev/null @@ -1,2465 +0,0 @@ -#region Imports -using System; -using System.Collections.Generic; -#endregion - -namespace CBH_Ultimate_Theme_Library -{ - - #region Theme Base - - #region Imports - - using System.IO; - using System.Drawing; - using System.Drawing.Drawing2D; - using System.ComponentModel; - using System.Windows.Forms; - using System.Runtime.InteropServices; - using System.Drawing.Imaging; - - #endregion - - - public abstract class ThemeContainer154 : ContainerControl - { - - #region " Initialization " - - protected Graphics G; - - protected Bitmap B; - public ThemeContainer154() - { - SetStyle((ControlStyles)139270, true); - - _ImageSize = Size.Empty; - Font = new Font("Verdana", 8); - - MeasureBitmap = new Bitmap(1, 1); - MeasureGraphics = Graphics.FromImage(MeasureBitmap); - - DrawRadialPath = new GraphicsPath(); - - InvalidateCustimization(); - } - - protected override sealed void OnHandleCreated(EventArgs e) - { - if (DoneCreation) - InitializeMessages(); - - InvalidateCustimization(); - ColorHook(); - - if (!(_LockWidth == 0)) - Width = _LockWidth; - if (!(_LockHeight == 0)) - Height = _LockHeight; - if (!_ControlMode) - base.Dock = DockStyle.Fill; - - Transparent = _Transparent; - if (_Transparent && _BackColor) - BackColor = Color.Transparent; - - base.OnHandleCreated(e); - } - - private bool DoneCreation; - protected override sealed void OnParentChanged(EventArgs e) - { - base.OnParentChanged(e); - - if (Parent == null) - return; - _IsParentForm = Parent is Form; - - if (!_ControlMode) - { - InitializeMessages(); - - if (_IsParentForm) - { - ParentForm.FormBorderStyle = _BorderStyle; - ParentForm.TransparencyKey = _TransparencyKey; - - if (!DesignMode) - { - ParentForm.Shown += FormShown; - } - } - - Parent.BackColor = BackColor; - } - - OnCreation(); - DoneCreation = true; - InvalidateTimer(); - } - - #endregion - - private void DoAnimation(bool i) - { - OnAnimation(); - if (i) - Invalidate(); - } - - protected override sealed void OnPaint(PaintEventArgs e) - { - if (Width == 0 || Height == 0) - return; - - if (_Transparent && _ControlMode) - { - PaintHook(); - e.Graphics.DrawImage(B, 0, 0); - } - else - { - G = e.Graphics; - PaintHook(); - } - } - - protected override void OnHandleDestroyed(EventArgs e) - { - ThemeShare.RemoveAnimationCallback(DoAnimation); - base.OnHandleDestroyed(e); - } - - private bool HasShown; - private void FormShown(object sender, EventArgs e) - { - if (_ControlMode || HasShown) - return; - - if (_StartPosition == FormStartPosition.CenterParent || _StartPosition == FormStartPosition.CenterScreen) - { - Rectangle SB = Screen.PrimaryScreen.Bounds; - Rectangle CB = ParentForm.Bounds; - ParentForm.Location = new Point(SB.Width / 2 - CB.Width / 2, SB.Height / 2 - CB.Width / 2); - } - - HasShown = true; - } - - - #region " Size Handling " - - private Rectangle Frame; - protected override sealed void OnSizeChanged(EventArgs e) - { - if (_Movable && !_ControlMode) - { - Frame = new Rectangle(7, 7, Width - 14, _Header - 7); - } - - InvalidateBitmap(); - Invalidate(); - - base.OnSizeChanged(e); - } - - protected override void SetBoundsCore(int x, int y, int width, int height, BoundsSpecified specified) - { - if (!(_LockWidth == 0)) - width = _LockWidth; - if (!(_LockHeight == 0)) - height = _LockHeight; - base.SetBoundsCore(x, y, width, height, specified); - } - - #endregion - - #region " State Handling " - - protected MouseState State; - private void SetState(MouseState current) - { - State = current; - Invalidate(); - } - - protected override void OnMouseMove(MouseEventArgs e) - { - if (!(_IsParentForm && ParentForm.WindowState == FormWindowState.Maximized)) - { - if (_Sizable && !_ControlMode) - InvalidateMouse(); - } - - base.OnMouseMove(e); - } - - protected override void OnEnabledChanged(EventArgs e) - { - if (Enabled) - SetState(MouseState.None); - else - SetState(MouseState.Block); - base.OnEnabledChanged(e); - } - - protected override void OnMouseEnter(EventArgs e) - { - SetState(MouseState.Over); - base.OnMouseEnter(e); - } - - protected override void OnMouseUp(MouseEventArgs e) - { - SetState(MouseState.Over); - base.OnMouseUp(e); - } - - protected override void OnMouseLeave(EventArgs e) - { - SetState(MouseState.None); - - if (GetChildAtPoint(PointToClient(MousePosition)) != null) - { - if (_Sizable && !_ControlMode) - { - Cursor = Cursors.Default; - Previous = 0; - } - } - - base.OnMouseLeave(e); - } - - protected override void OnMouseDown(MouseEventArgs e) - { - if (e.Button == System.Windows.Forms.MouseButtons.Left) - SetState(MouseState.Down); - - if (!(_IsParentForm && ParentForm.WindowState == FormWindowState.Maximized || _ControlMode)) - { - if (_Movable && Frame.Contains(e.Location)) - { - Capture = false; - WM_LMBUTTONDOWN = true; - DefWndProc(ref Messages[0]); - } - else if (_Sizable && !(Previous == 0)) - { - Capture = false; - WM_LMBUTTONDOWN = true; - DefWndProc(ref Messages[Previous]); - } - } - - base.OnMouseDown(e); - } - - private bool WM_LMBUTTONDOWN; - protected override void WndProc(ref Message m) - { - base.WndProc(ref m); - - if (WM_LMBUTTONDOWN && m.Msg == 513) - { - WM_LMBUTTONDOWN = false; - - SetState(MouseState.Over); - if (!_SmartBounds) - return; - - if (IsParentMdi) - { - CorrectBounds(new Rectangle(Point.Empty, Parent.Parent.Size)); - } - else - { - CorrectBounds(Screen.FromControl(Parent).WorkingArea); - } - } - } - - private Point GetIndexPoint; - private bool B1; - private bool B2; - private bool B3; - private bool B4; - private int GetIndex() - { - GetIndexPoint = PointToClient(MousePosition); - B1 = GetIndexPoint.X < 7; - B2 = GetIndexPoint.X > Width - 7; - B3 = GetIndexPoint.Y < 7; - B4 = GetIndexPoint.Y > Height - 7; - - if (B1 && B3) - return 4; - if (B1 && B4) - return 7; - if (B2 && B3) - return 5; - if (B2 && B4) - return 8; - if (B1) - return 1; - if (B2) - return 2; - if (B3) - return 3; - if (B4) - return 6; - return 0; - } - - private int Current; - private int Previous; - private void InvalidateMouse() - { - Current = GetIndex(); - if (Current == Previous) - return; - - Previous = Current; - switch (Previous) - { - case 0: - Cursor = Cursors.Default; - break; - case 1: - case 2: - Cursor = Cursors.SizeWE; - break; - case 3: - case 6: - Cursor = Cursors.SizeNS; - break; - case 4: - case 8: - Cursor = Cursors.SizeNWSE; - break; - case 5: - case 7: - Cursor = Cursors.SizeNESW; - break; - } - } - - private Message[] Messages = new Message[9]; - private void InitializeMessages() - { - Messages[0] = Message.Create(Parent.Handle, 161, new IntPtr(2), IntPtr.Zero); - for (int I = 1; I <= 8; I++) - { - Messages[I] = Message.Create(Parent.Handle, 161, new IntPtr(I + 9), IntPtr.Zero); - } - } - - private void CorrectBounds(Rectangle bounds) - { - if (Parent.Width > bounds.Width) - Parent.Width = bounds.Width; - if (Parent.Height > bounds.Height) - Parent.Height = bounds.Height; - - int X = Parent.Location.X; - int Y = Parent.Location.Y; - - if (X < bounds.X) - X = bounds.X; - if (Y < bounds.Y) - Y = bounds.Y; - - int Width = bounds.X + bounds.Width; - int Height = bounds.Y + bounds.Height; - - if (X + Parent.Width > Width) - X = Width - Parent.Width; - if (Y + Parent.Height > Height) - Y = Height - Parent.Height; - - Parent.Location = new Point(X, Y); - } - - #endregion - - - #region " Base Properties " - - public override DockStyle Dock - { - get { return base.Dock; } - set - { - if (!_ControlMode) - return; - base.Dock = value; - } - } - - private bool _BackColor; - [Category("Misc")] - public override Color BackColor - { - get { return base.BackColor; } - set - { - if (value == base.BackColor) - return; - - if (!IsHandleCreated && _ControlMode && value == Color.Transparent) - { - _BackColor = true; - return; - } - - base.BackColor = value; - if (Parent != null) - { - if (!_ControlMode) - Parent.BackColor = value; - ColorHook(); - } - } - } - - public override Size MinimumSize - { - get { return base.MinimumSize; } - set - { - base.MinimumSize = value; - if (Parent != null) - Parent.MinimumSize = value; - } - } - - public override Size MaximumSize - { - get { return base.MaximumSize; } - set - { - base.MaximumSize = value; - if (Parent != null) - Parent.MaximumSize = value; - } - } - - public override string Text - { - get { return base.Text; } - set - { - base.Text = value; - Invalidate(); - } - } - - public override Font Font - { - get { return base.Font; } - set - { - base.Font = value; - Invalidate(); - } - } - - [Browsable(false), EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public override Color ForeColor - { - get { return Color.Empty; } - set { } - } - [Browsable(false), EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public override Image BackgroundImage - { - get { return null; } - set { } - } - [Browsable(false), EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public override ImageLayout BackgroundImageLayout - { - get { return ImageLayout.None; } - set { } - } - - #endregion - - #region " Public Properties " - - private bool _SmartBounds = true; - public bool SmartBounds - { - get { return _SmartBounds; } - set { _SmartBounds = value; } - } - - private bool _Movable = true; - public bool Movable - { - get { return _Movable; } - set { _Movable = value; } - } - - private bool _Sizable = true; - public bool Sizable - { - get { return _Sizable; } - set { _Sizable = value; } - } - - private Color _TransparencyKey; - public Color TransparencyKey - { - get - { - if (_IsParentForm && !_ControlMode) - return ParentForm.TransparencyKey; - else - return _TransparencyKey; - } - set - { - if (value == _TransparencyKey) - return; - _TransparencyKey = value; - - if (_IsParentForm && !_ControlMode) - { - ParentForm.TransparencyKey = value; - ColorHook(); - } - } - } - - private FormBorderStyle _BorderStyle; - public FormBorderStyle BorderStyle - { - get - { - if (_IsParentForm && !_ControlMode) - return ParentForm.FormBorderStyle; - else - return _BorderStyle; - } - set - { - _BorderStyle = value; - - if (_IsParentForm && !_ControlMode) - { - ParentForm.FormBorderStyle = value; - - if (!(value == FormBorderStyle.None)) - { - Movable = false; - Sizable = false; - } - } - } - } - - private FormStartPosition _StartPosition; - public FormStartPosition StartPosition - { - get - { - if (_IsParentForm && !_ControlMode) - return ParentForm.StartPosition; - else - return _StartPosition; - } - set - { - _StartPosition = value; - - if (_IsParentForm && !_ControlMode) - { - ParentForm.StartPosition = value; - } - } - } - - private bool _NoRounding; - public bool NoRounding - { - get { return _NoRounding; } - set - { - _NoRounding = value; - Invalidate(); - } - } - - private Image _Image; - public Image Image - { - get { return _Image; } - set - { - if (value == null) - _ImageSize = Size.Empty; - else - _ImageSize = value.Size; - - _Image = value; - Invalidate(); - } - } - - private Dictionary Items = new Dictionary(); - public Bloom[] Colors - { - get - { - List T = new List(); - Dictionary.Enumerator E = Items.GetEnumerator(); - - while (E.MoveNext()) - { - T.Add(new Bloom(E.Current.Key, E.Current.Value)); - } - - return T.ToArray(); - } - set - { - foreach (Bloom B in value) - { - if (Items.ContainsKey(B.Name)) - Items[B.Name] = B.Value; - } - - InvalidateCustimization(); - ColorHook(); - Invalidate(); - } - } - - private string _Customization; - public string Customization - { - get { return _Customization; } - set - { - if (value == _Customization) - return; - - byte[] Data = null; - Bloom[] Items = Colors; - - try - { - Data = Convert.FromBase64String(value); - for (int I = 0; I <= Items.Length - 1; I++) - { - Items[I].Value = Color.FromArgb(BitConverter.ToInt32(Data, I * 4)); - } - } - catch - { - return; - } - - _Customization = value; - - Colors = Items; - ColorHook(); - Invalidate(); - } - } - - private bool _Transparent; - public bool Transparent - { - get { return _Transparent; } - set - { - _Transparent = value; - if (!(IsHandleCreated || _ControlMode)) - return; - - if (!value && !(BackColor.A == 255)) - { - throw new Exception("Unable to change value to false while a transparent BackColor is in use."); - } - - SetStyle(ControlStyles.Opaque, !value); - SetStyle(ControlStyles.SupportsTransparentBackColor, value); - - InvalidateBitmap(); - Invalidate(); - } - } - - #endregion - - #region " Private Properties " - - private Size _ImageSize; - protected Size ImageSize - { - get { return _ImageSize; } - } - - private bool _IsParentForm; - protected bool IsParentForm - { - get { return _IsParentForm; } - } - - protected bool IsParentMdi - { - get - { - if (Parent == null) - return false; - return Parent.Parent != null; - } - } - - private int _LockWidth; - protected int LockWidth - { - get { return _LockWidth; } - set - { - _LockWidth = value; - if (!(LockWidth == 0) && IsHandleCreated) - Width = LockWidth; - } - } - - private int _LockHeight; - protected int LockHeight - { - get { return _LockHeight; } - set - { - _LockHeight = value; - if (!(LockHeight == 0) && IsHandleCreated) - Height = LockHeight; - } - } - - private int _Header = 24; - protected int Header - { - get { return _Header; } - set - { - _Header = value; - - if (!_ControlMode) - { - Frame = new Rectangle(7, 7, Width - 14, value - 7); - Invalidate(); - } - } - } - - private bool _ControlMode; - protected bool ControlMode - { - get { return _ControlMode; } - set - { - _ControlMode = value; - - Transparent = _Transparent; - if (_Transparent && _BackColor) - BackColor = Color.Transparent; - - InvalidateBitmap(); - Invalidate(); - } - } - - private bool _IsAnimated; - protected bool IsAnimated - { - get { return _IsAnimated; } - set - { - _IsAnimated = value; - InvalidateTimer(); - } - } - - #endregion - - - #region " Property Helpers " - - protected Pen GetPen(string name) - { - return new Pen(Items[name]); - } - protected Pen GetPen(string name, float width) - { - return new Pen(Items[name], width); - } - - protected SolidBrush GetBrush(string name) - { - return new SolidBrush(Items[name]); - } - - protected Color GetColor(string name) - { - return Items[name]; - } - - protected void SetColor(string name, Color value) - { - if (Items.ContainsKey(name)) - Items[name] = value; - else - Items.Add(name, value); - } - protected void SetColor(string name, byte r, byte g, byte b) - { - SetColor(name, Color.FromArgb(r, g, b)); - } - protected void SetColor(string name, byte a, byte r, byte g, byte b) - { - SetColor(name, Color.FromArgb(a, r, g, b)); - } - protected void SetColor(string name, byte a, Color value) - { - SetColor(name, Color.FromArgb(a, value)); - } - - private void InvalidateBitmap() - { - if (_Transparent && _ControlMode) - { - if (Width == 0 || Height == 0) - return; - B = new Bitmap(Width, Height, PixelFormat.Format32bppPArgb); - G = Graphics.FromImage(B); - } - else - { - G = null; - B = null; - } - } - - private void InvalidateCustimization() - { - MemoryStream M = new MemoryStream(Items.Count * 4); - - foreach (Bloom B in Colors) - { - M.Write(BitConverter.GetBytes(B.Value.ToArgb()), 0, 4); - } - - M.Close(); - _Customization = Convert.ToBase64String(M.ToArray()); - } - - private void InvalidateTimer() - { - if (DesignMode || !DoneCreation) - return; - - if (_IsAnimated) - { - ThemeShare.AddAnimationCallback(DoAnimation); - } - else - { - ThemeShare.RemoveAnimationCallback(DoAnimation); - } - } - - #endregion - - - #region " User Hooks " - - protected abstract void ColorHook(); - protected abstract void PaintHook(); - - protected virtual void OnCreation() - { - } - - protected virtual void OnAnimation() - { - } - - #endregion - - - #region " Offset " - - private Rectangle OffsetReturnRectangle; - protected Rectangle Offset(Rectangle r, int amount) - { - OffsetReturnRectangle = new Rectangle(r.X + amount, r.Y + amount, r.Width - (amount * 2), r.Height - (amount * 2)); - return OffsetReturnRectangle; - } - - private Size OffsetReturnSize; - protected Size Offset(Size s, int amount) - { - OffsetReturnSize = new Size(s.Width + amount, s.Height + amount); - return OffsetReturnSize; - } - - private Point OffsetReturnPoint; - protected Point Offset(Point p, int amount) - { - OffsetReturnPoint = new Point(p.X + amount, p.Y + amount); - return OffsetReturnPoint; - } - - #endregion - - #region " Center " - - - private Point CenterReturn; - protected Point Center(Rectangle p, Rectangle c) - { - CenterReturn = new Point((p.Width / 2 - c.Width / 2) + p.X + c.X, (p.Height / 2 - c.Height / 2) + p.Y + c.Y); - return CenterReturn; - } - protected Point Center(Rectangle p, Size c) - { - CenterReturn = new Point((p.Width / 2 - c.Width / 2) + p.X, (p.Height / 2 - c.Height / 2) + p.Y); - return CenterReturn; - } - - protected Point Center(Rectangle child) - { - return Center(Width, Height, child.Width, child.Height); - } - protected Point Center(Size child) - { - return Center(Width, Height, child.Width, child.Height); - } - protected Point Center(int childWidth, int childHeight) - { - return Center(Width, Height, childWidth, childHeight); - } - - protected Point Center(Size p, Size c) - { - return Center(p.Width, p.Height, c.Width, c.Height); - } - - protected Point Center(int pWidth, int pHeight, int cWidth, int cHeight) - { - CenterReturn = new Point(pWidth / 2 - cWidth / 2, pHeight / 2 - cHeight / 2); - return CenterReturn; - } - - #endregion - - #region " Measure " - - private Bitmap MeasureBitmap; - - private Graphics MeasureGraphics; - protected Size Measure() - { - lock (MeasureGraphics) - { - return MeasureGraphics.MeasureString(Text, Font, Width).ToSize(); - } - } - protected Size Measure(string text) - { - lock (MeasureGraphics) - { - return MeasureGraphics.MeasureString(text, Font, Width).ToSize(); - } - } - - #endregion - - - #region " DrawPixel " - - - private SolidBrush DrawPixelBrush; - protected void DrawPixel(Color c1, int x, int y) - { - if (_Transparent) - { - B.SetPixel(x, y, c1); - } - else - { - DrawPixelBrush = new SolidBrush(c1); - G.FillRectangle(DrawPixelBrush, x, y, 1, 1); - } - } - - #endregion - - #region " DrawCorners " - - - private SolidBrush DrawCornersBrush; - protected void DrawCorners(Color c1, int offset) - { - DrawCorners(c1, 0, 0, Width, Height, offset); - } - protected void DrawCorners(Color c1, Rectangle r1, int offset) - { - DrawCorners(c1, r1.X, r1.Y, r1.Width, r1.Height, offset); - } - protected void DrawCorners(Color c1, int x, int y, int width, int height, int offset) - { - DrawCorners(c1, x + offset, y + offset, width - (offset * 2), height - (offset * 2)); - } - - protected void DrawCorners(Color c1) - { - DrawCorners(c1, 0, 0, Width, Height); - } - protected void DrawCorners(Color c1, Rectangle r1) - { - DrawCorners(c1, r1.X, r1.Y, r1.Width, r1.Height); - } - protected void DrawCorners(Color c1, int x, int y, int width, int height) - { - if (_NoRounding) - return; - - if (_Transparent) - { - B.SetPixel(x, y, c1); - B.SetPixel(x + (width - 1), y, c1); - B.SetPixel(x, y + (height - 1), c1); - B.SetPixel(x + (width - 1), y + (height - 1), c1); - } - else - { - DrawCornersBrush = new SolidBrush(c1); - G.FillRectangle(DrawCornersBrush, x, y, 1, 1); - G.FillRectangle(DrawCornersBrush, x + (width - 1), y, 1, 1); - G.FillRectangle(DrawCornersBrush, x, y + (height - 1), 1, 1); - G.FillRectangle(DrawCornersBrush, x + (width - 1), y + (height - 1), 1, 1); - } - } - - #endregion - - #region " DrawBorders " - - protected void DrawBorders(Pen p1, int offset) - { - DrawBorders(p1, 0, 0, Width, Height, offset); - } - protected void DrawBorders(Pen p1, Rectangle r, int offset) - { - DrawBorders(p1, r.X, r.Y, r.Width, r.Height, offset); - } - protected void DrawBorders(Pen p1, int x, int y, int width, int height, int offset) - { - DrawBorders(p1, x + offset, y + offset, width - (offset * 2), height - (offset * 2)); - } - - protected void DrawBorders(Pen p1) - { - DrawBorders(p1, 0, 0, Width, Height); - } - protected void DrawBorders(Pen p1, Rectangle r) - { - DrawBorders(p1, r.X, r.Y, r.Width, r.Height); - } - protected void DrawBorders(Pen p1, int x, int y, int width, int height) - { - G.DrawRectangle(p1, x, y, width - 1, height - 1); - } - - #endregion - - #region " DrawText " - - private Point DrawTextPoint; - - private Size DrawTextSize; - protected void DrawText(Brush b1, HorizontalAlignment a, int x, int y) - { - DrawText(b1, Text, a, x, y); - } - protected void DrawText(Brush b1, string text, HorizontalAlignment a, int x, int y) - { - if (text.Length == 0) - return; - - DrawTextSize = Measure(text); - DrawTextPoint = new Point(Width / 2 - DrawTextSize.Width / 2, Header / 2 - DrawTextSize.Height / 2); - - switch (a) - { - case HorizontalAlignment.Left: - G.DrawString(text, Font, b1, x, DrawTextPoint.Y + y); - break; - case HorizontalAlignment.Center: - G.DrawString(text, Font, b1, DrawTextPoint.X + x, DrawTextPoint.Y + y); - break; - case HorizontalAlignment.Right: - G.DrawString(text, Font, b1, Width - DrawTextSize.Width - x, DrawTextPoint.Y + y); - break; - } - } - - protected void DrawText(Brush b1, Point p1) - { - if (Text.Length == 0) - return; - G.DrawString(Text, Font, b1, p1); - } - protected void DrawText(Brush b1, int x, int y) - { - if (Text.Length == 0) - return; - G.DrawString(Text, Font, b1, x, y); - } - - #endregion - - #region " DrawImage " - - - private Point DrawImagePoint; - protected void DrawImage(HorizontalAlignment a, int x, int y) - { - DrawImage(_Image, a, x, y); - } - protected void DrawImage(Image image, HorizontalAlignment a, int x, int y) - { - if (image == null) - return; - DrawImagePoint = new Point(Width / 2 - image.Width / 2, Header / 2 - image.Height / 2); - - switch (a) - { - case HorizontalAlignment.Left: - G.DrawImage(image, x, DrawImagePoint.Y + y, image.Width, image.Height); - break; - case HorizontalAlignment.Center: - G.DrawImage(image, DrawImagePoint.X + x, DrawImagePoint.Y + y, image.Width, image.Height); - break; - case HorizontalAlignment.Right: - G.DrawImage(image, Width - image.Width - x, DrawImagePoint.Y + y, image.Width, image.Height); - break; - } - } - - protected void DrawImage(Point p1) - { - DrawImage(_Image, p1.X, p1.Y); - } - protected void DrawImage(int x, int y) - { - DrawImage(_Image, x, y); - } - - protected void DrawImage(Image image, Point p1) - { - DrawImage(image, p1.X, p1.Y); - } - protected void DrawImage(Image image, int x, int y) - { - if (image == null) - return; - G.DrawImage(image, x, y, image.Width, image.Height); - } - - #endregion - - #region " DrawGradient " - - private LinearGradientBrush DrawGradientBrush; - - private Rectangle DrawGradientRectangle; - protected void DrawGradient(ColorBlend blend, int x, int y, int width, int height) - { - DrawGradientRectangle = new Rectangle(x, y, width, height); - DrawGradient(blend, DrawGradientRectangle); - } - protected void DrawGradient(ColorBlend blend, int x, int y, int width, int height, float angle) - { - DrawGradientRectangle = new Rectangle(x, y, width, height); - DrawGradient(blend, DrawGradientRectangle, angle); - } - - protected void DrawGradient(ColorBlend blend, Rectangle r) - { - DrawGradientBrush = new LinearGradientBrush(r, Color.Empty, Color.Empty, 90f); - DrawGradientBrush.InterpolationColors = blend; - G.FillRectangle(DrawGradientBrush, r); - } - protected void DrawGradient(ColorBlend blend, Rectangle r, float angle) - { - DrawGradientBrush = new LinearGradientBrush(r, Color.Empty, Color.Empty, angle); - DrawGradientBrush.InterpolationColors = blend; - G.FillRectangle(DrawGradientBrush, r); - } - - - protected void DrawGradient(Color c1, Color c2, int x, int y, int width, int height) - { - DrawGradientRectangle = new Rectangle(x, y, width, height); - DrawGradient(c1, c2, DrawGradientRectangle); - } - protected void DrawGradient(Color c1, Color c2, int x, int y, int width, int height, float angle) - { - DrawGradientRectangle = new Rectangle(x, y, width, height); - DrawGradient(c1, c2, DrawGradientRectangle, angle); - } - - protected void DrawGradient(Color c1, Color c2, Rectangle r) - { - DrawGradientBrush = new LinearGradientBrush(r, c1, c2, 90f); - G.FillRectangle(DrawGradientBrush, r); - } - protected void DrawGradient(Color c1, Color c2, Rectangle r, float angle) - { - DrawGradientBrush = new LinearGradientBrush(r, c1, c2, angle); - G.FillRectangle(DrawGradientBrush, r); - } - - #endregion - - #region " DrawRadial " - - private GraphicsPath DrawRadialPath; - private PathGradientBrush DrawRadialBrush1; - private LinearGradientBrush DrawRadialBrush2; - - private Rectangle DrawRadialRectangle; - public void DrawRadial(ColorBlend blend, int x, int y, int width, int height) - { - DrawRadialRectangle = new Rectangle(x, y, width, height); - DrawRadial(blend, DrawRadialRectangle, width / 2, height / 2); - } - public void DrawRadial(ColorBlend blend, int x, int y, int width, int height, Point center) - { - DrawRadialRectangle = new Rectangle(x, y, width, height); - DrawRadial(blend, DrawRadialRectangle, center.X, center.Y); - } - public void DrawRadial(ColorBlend blend, int x, int y, int width, int height, int cx, int cy) - { - DrawRadialRectangle = new Rectangle(x, y, width, height); - DrawRadial(blend, DrawRadialRectangle, cx, cy); - } - - public void DrawRadial(ColorBlend blend, Rectangle r) - { - DrawRadial(blend, r, r.Width / 2, r.Height / 2); - } - public void DrawRadial(ColorBlend blend, Rectangle r, Point center) - { - DrawRadial(blend, r, center.X, center.Y); - } - public void DrawRadial(ColorBlend blend, Rectangle r, int cx, int cy) - { - DrawRadialPath.Reset(); - DrawRadialPath.AddEllipse(r.X, r.Y, r.Width - 1, r.Height - 1); - - DrawRadialBrush1 = new PathGradientBrush(DrawRadialPath); - DrawRadialBrush1.CenterPoint = new Point(r.X + cx, r.Y + cy); - DrawRadialBrush1.InterpolationColors = blend; - - if (G.SmoothingMode == SmoothingMode.AntiAlias) - { - G.FillEllipse(DrawRadialBrush1, r.X + 1, r.Y + 1, r.Width - 3, r.Height - 3); - } - else - { - G.FillEllipse(DrawRadialBrush1, r); - } - } - - - protected void DrawRadial(Color c1, Color c2, int x, int y, int width, int height) - { - DrawRadialRectangle = new Rectangle(x, y, width, height); - DrawRadial(c1, c2, DrawGradientRectangle); - } - protected void DrawRadial(Color c1, Color c2, int x, int y, int width, int height, float angle) - { - DrawRadialRectangle = new Rectangle(x, y, width, height); - DrawRadial(c1, c2, DrawGradientRectangle, angle); - } - - protected void DrawRadial(Color c1, Color c2, Rectangle r) - { - DrawRadialBrush2 = new LinearGradientBrush(r, c1, c2, 90f); - G.FillRectangle(DrawGradientBrush, r); - } - protected void DrawRadial(Color c1, Color c2, Rectangle r, float angle) - { - DrawRadialBrush2 = new LinearGradientBrush(r, c1, c2, angle); - G.FillEllipse(DrawGradientBrush, r); - } - - #endregion - - #region " CreateRound " - - private GraphicsPath CreateRoundPath; - - private Rectangle CreateRoundRectangle; - public GraphicsPath CreateRound(int x, int y, int width, int height, int slope) - { - CreateRoundRectangle = new Rectangle(x, y, width, height); - return CreateRound(CreateRoundRectangle, slope); - } - - public GraphicsPath CreateRound(Rectangle r, int slope) - { - CreateRoundPath = new GraphicsPath(FillMode.Winding); - CreateRoundPath.AddArc(r.X, r.Y, slope, slope, 180f, 90f); - CreateRoundPath.AddArc(r.Right - slope, r.Y, slope, slope, 270f, 90f); - CreateRoundPath.AddArc(r.Right - slope, r.Bottom - slope, slope, slope, 0f, 90f); - CreateRoundPath.AddArc(r.X, r.Bottom - slope, slope, slope, 90f, 90f); - CreateRoundPath.CloseFigure(); - return CreateRoundPath; - } - - #endregion - - } - - public abstract class ThemeControl154 : Control - { - - - #region " Initialization " - - protected Graphics G; - - protected Bitmap B; - public ThemeControl154() - { - SetStyle((ControlStyles)139270, true); - - _ImageSize = Size.Empty; - Font = new Font("Verdana", 8); - - MeasureBitmap = new Bitmap(1, 1); - MeasureGraphics = Graphics.FromImage(MeasureBitmap); - - DrawRadialPath = new GraphicsPath(); - - InvalidateCustimization(); - //Remove? - } - - protected override sealed void OnHandleCreated(EventArgs e) - { - InvalidateCustimization(); - ColorHook(); - - if (!(_LockWidth == 0)) - Width = _LockWidth; - if (!(_LockHeight == 0)) - Height = _LockHeight; - - Transparent = _Transparent; - if (_Transparent && _BackColor) - BackColor = Color.Transparent; - - base.OnHandleCreated(e); - } - - private bool DoneCreation; - protected override sealed void OnParentChanged(EventArgs e) - { - if (Parent != null) - { - OnCreation(); - DoneCreation = true; - InvalidateTimer(); - } - - base.OnParentChanged(e); - } - - #endregion - - private void DoAnimation(bool i) - { - OnAnimation(); - if (i) - Invalidate(); - } - - protected override sealed void OnPaint(PaintEventArgs e) - { - if (Width == 0 || Height == 0) - return; - - if (_Transparent) - { - PaintHook(); - e.Graphics.DrawImage(B, 0, 0); - } - else - { - G = e.Graphics; - PaintHook(); - } - } - - protected override void OnHandleDestroyed(EventArgs e) - { - ThemeShare.RemoveAnimationCallback(DoAnimation); - base.OnHandleDestroyed(e); - } - - #region " Size Handling " - - protected override sealed void OnSizeChanged(EventArgs e) - { - if (_Transparent) - { - InvalidateBitmap(); - } - - Invalidate(); - base.OnSizeChanged(e); - } - - protected override void SetBoundsCore(int x, int y, int width, int height, BoundsSpecified specified) - { - if (!(_LockWidth == 0)) - width = _LockWidth; - if (!(_LockHeight == 0)) - height = _LockHeight; - base.SetBoundsCore(x, y, width, height, specified); - } - - #endregion - - #region " State Handling " - - private bool InPosition; - protected override void OnMouseEnter(EventArgs e) - { - InPosition = true; - SetState(MouseState.Over); - base.OnMouseEnter(e); - } - - protected override void OnMouseUp(MouseEventArgs e) - { - if (InPosition) - SetState(MouseState.Over); - base.OnMouseUp(e); - } - - protected override void OnMouseDown(MouseEventArgs e) - { - if (e.Button == System.Windows.Forms.MouseButtons.Left) - SetState(MouseState.Down); - base.OnMouseDown(e); - } - - protected override void OnMouseLeave(EventArgs e) - { - InPosition = false; - SetState(MouseState.None); - base.OnMouseLeave(e); - } - - protected override void OnEnabledChanged(EventArgs e) - { - if (Enabled) - SetState(MouseState.None); - else - SetState(MouseState.Block); - base.OnEnabledChanged(e); - } - - protected MouseState State; - private void SetState(MouseState current) - { - State = current; - Invalidate(); - } - - #endregion - - - #region " Base Properties " - - [Browsable(false), EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public override Color ForeColor - { - get { return Color.Empty; } - set { } - } - [Browsable(false), EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public override Image BackgroundImage - { - get { return null; } - set { } - } - [Browsable(false), EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public override ImageLayout BackgroundImageLayout - { - get { return ImageLayout.None; } - set { } - } - - public override string Text - { - get { return base.Text; } - set - { - base.Text = value; - Invalidate(); - } - } - public override Font Font - { - get { return base.Font; } - set - { - base.Font = value; - Invalidate(); - } - } - - private bool _BackColor; - [Category("Misc")] - public override Color BackColor - { - get { return base.BackColor; } - set - { - if (!IsHandleCreated && value == Color.Transparent) - { - _BackColor = true; - return; - } - - base.BackColor = value; - if (Parent != null) - ColorHook(); - } - } - - #endregion - - #region " Public Properties " - - private bool _NoRounding; - public bool NoRounding - { - get { return _NoRounding; } - set - { - _NoRounding = value; - Invalidate(); - } - } - - private Image _Image; - public Image Image - { - get { return _Image; } - set - { - if (value == null) - { - _ImageSize = Size.Empty; - } - else - { - _ImageSize = value.Size; - } - - _Image = value; - Invalidate(); - } - } - - private bool _Transparent; - public bool Transparent - { - get { return _Transparent; } - set - { - _Transparent = value; - if (!IsHandleCreated) - return; - - if (!value && !(BackColor.A == 255)) - { - throw new Exception("Unable to change value to false while a transparent BackColor is in use."); - } - - SetStyle(ControlStyles.Opaque, !value); - SetStyle(ControlStyles.SupportsTransparentBackColor, value); - - if (value) - InvalidateBitmap(); - else - B = null; - Invalidate(); - } - } - - private Dictionary Items = new Dictionary(); - public Bloom[] Colors - { - get - { - List T = new List(); - Dictionary.Enumerator E = Items.GetEnumerator(); - - while (E.MoveNext()) - { - T.Add(new Bloom(E.Current.Key, E.Current.Value)); - } - - return T.ToArray(); - } - set - { - foreach (Bloom B in value) - { - if (Items.ContainsKey(B.Name)) - Items[B.Name] = B.Value; - } - - InvalidateCustimization(); - ColorHook(); - Invalidate(); - } - } - - private string _Customization; - public string Customization - { - get { return _Customization; } - set - { - if (value == _Customization) - return; - - byte[] Data = null; - Bloom[] Items = Colors; - - try - { - Data = Convert.FromBase64String(value); - for (int I = 0; I <= Items.Length - 1; I++) - { - Items[I].Value = Color.FromArgb(BitConverter.ToInt32(Data, I * 4)); - } - } - catch - { - return; - } - - _Customization = value; - - Colors = Items; - ColorHook(); - Invalidate(); - } - } - - #endregion - - #region " Private Properties " - - private Size _ImageSize; - protected Size ImageSize - { - get { return _ImageSize; } - } - - private int _LockWidth; - protected int LockWidth - { - get { return _LockWidth; } - set - { - _LockWidth = value; - if (!(LockWidth == 0) && IsHandleCreated) - Width = LockWidth; - } - } - - private int _LockHeight; - protected int LockHeight - { - get { return _LockHeight; } - set - { - _LockHeight = value; - if (!(LockHeight == 0) && IsHandleCreated) - Height = LockHeight; - } - } - - private bool _IsAnimated; - protected bool IsAnimated - { - get { return _IsAnimated; } - set - { - _IsAnimated = value; - InvalidateTimer(); - } - } - - #endregion - - - #region " Property Helpers " - - protected Pen GetPen(string name) - { - return new Pen(Items[name]); - } - protected Pen GetPen(string name, float width) - { - return new Pen(Items[name], width); - } - - protected SolidBrush GetBrush(string name) - { - return new SolidBrush(Items[name]); - } - - protected Color GetColor(string name) - { - return Items[name]; - } - - protected void SetColor(string name, Color value) - { - if (Items.ContainsKey(name)) - Items[name] = value; - else - Items.Add(name, value); - } - protected void SetColor(string name, byte r, byte g, byte b) - { - SetColor(name, Color.FromArgb(r, g, b)); - } - protected void SetColor(string name, byte a, byte r, byte g, byte b) - { - SetColor(name, Color.FromArgb(a, r, g, b)); - } - protected void SetColor(string name, byte a, Color value) - { - SetColor(name, Color.FromArgb(a, value)); - } - - private void InvalidateBitmap() - { - if (Width == 0 || Height == 0) - return; - B = new Bitmap(Width, Height, PixelFormat.Format32bppPArgb); - G = Graphics.FromImage(B); - } - - private void InvalidateCustimization() - { - MemoryStream M = new MemoryStream(Items.Count * 4); - - foreach (Bloom B in Colors) - { - M.Write(BitConverter.GetBytes(B.Value.ToArgb()), 0, 4); - } - - M.Close(); - _Customization = Convert.ToBase64String(M.ToArray()); - } - - private void InvalidateTimer() - { - if (DesignMode || !DoneCreation) - return; - - if (_IsAnimated) - { - ThemeShare.AddAnimationCallback(DoAnimation); - } - else - { - ThemeShare.RemoveAnimationCallback(DoAnimation); - } - } - #endregion - - - #region " User Hooks " - - protected abstract void ColorHook(); - protected abstract void PaintHook(); - - protected virtual void OnCreation() - { - } - - protected virtual void OnAnimation() - { - } - - #endregion - - - #region " Offset " - - private Rectangle OffsetReturnRectangle; - protected Rectangle Offset(Rectangle r, int amount) - { - OffsetReturnRectangle = new Rectangle(r.X + amount, r.Y + amount, r.Width - (amount * 2), r.Height - (amount * 2)); - return OffsetReturnRectangle; - } - - private Size OffsetReturnSize; - protected Size Offset(Size s, int amount) - { - OffsetReturnSize = new Size(s.Width + amount, s.Height + amount); - return OffsetReturnSize; - } - - private Point OffsetReturnPoint; - protected Point Offset(Point p, int amount) - { - OffsetReturnPoint = new Point(p.X + amount, p.Y + amount); - return OffsetReturnPoint; - } - - #endregion - - #region " Center " - - - private Point CenterReturn; - protected Point Center(Rectangle p, Rectangle c) - { - CenterReturn = new Point((p.Width / 2 - c.Width / 2) + p.X + c.X, (p.Height / 2 - c.Height / 2) + p.Y + c.Y); - return CenterReturn; - } - protected Point Center(Rectangle p, Size c) - { - CenterReturn = new Point((p.Width / 2 - c.Width / 2) + p.X, (p.Height / 2 - c.Height / 2) + p.Y); - return CenterReturn; - } - - protected Point Center(Rectangle child) - { - return Center(Width, Height, child.Width, child.Height); - } - protected Point Center(Size child) - { - return Center(Width, Height, child.Width, child.Height); - } - protected Point Center(int childWidth, int childHeight) - { - return Center(Width, Height, childWidth, childHeight); - } - - protected Point Center(Size p, Size c) - { - return Center(p.Width, p.Height, c.Width, c.Height); - } - - protected Point Center(int pWidth, int pHeight, int cWidth, int cHeight) - { - CenterReturn = new Point(pWidth / 2 - cWidth / 2, pHeight / 2 - cHeight / 2); - return CenterReturn; - } - - #endregion - - #region " Measure " - - private Bitmap MeasureBitmap; - //TODO: Potential issues during multi-threading. - private Graphics MeasureGraphics; - - protected Size Measure() - { - return MeasureGraphics.MeasureString(Text, Font, Width).ToSize(); - } - protected Size Measure(string text) - { - return MeasureGraphics.MeasureString(text, Font, Width).ToSize(); - } - - #endregion - - - #region " DrawPixel " - - - private SolidBrush DrawPixelBrush; - protected void DrawPixel(Color c1, int x, int y) - { - if (_Transparent) - { - B.SetPixel(x, y, c1); - } - else - { - DrawPixelBrush = new SolidBrush(c1); - G.FillRectangle(DrawPixelBrush, x, y, 1, 1); - } - } - - #endregion - - #region " DrawCorners " - - - private SolidBrush DrawCornersBrush; - protected void DrawCorners(Color c1, int offset) - { - DrawCorners(c1, 0, 0, Width, Height, offset); - } - protected void DrawCorners(Color c1, Rectangle r1, int offset) - { - DrawCorners(c1, r1.X, r1.Y, r1.Width, r1.Height, offset); - } - protected void DrawCorners(Color c1, int x, int y, int width, int height, int offset) - { - DrawCorners(c1, x + offset, y + offset, width - (offset * 2), height - (offset * 2)); - } - - protected void DrawCorners(Color c1) - { - DrawCorners(c1, 0, 0, Width, Height); - } - protected void DrawCorners(Color c1, Rectangle r1) - { - DrawCorners(c1, r1.X, r1.Y, r1.Width, r1.Height); - } - protected void DrawCorners(Color c1, int x, int y, int width, int height) - { - if (_NoRounding) - return; - - if (_Transparent) - { - B.SetPixel(x, y, c1); - B.SetPixel(x + (width - 1), y, c1); - B.SetPixel(x, y + (height - 1), c1); - B.SetPixel(x + (width - 1), y + (height - 1), c1); - } - else - { - DrawCornersBrush = new SolidBrush(c1); - G.FillRectangle(DrawCornersBrush, x, y, 1, 1); - G.FillRectangle(DrawCornersBrush, x + (width - 1), y, 1, 1); - G.FillRectangle(DrawCornersBrush, x, y + (height - 1), 1, 1); - G.FillRectangle(DrawCornersBrush, x + (width - 1), y + (height - 1), 1, 1); - } - } - - #endregion - - #region " DrawBorders " - - protected void DrawBorders(Pen p1, int offset) - { - DrawBorders(p1, 0, 0, Width, Height, offset); - } - protected void DrawBorders(Pen p1, Rectangle r, int offset) - { - DrawBorders(p1, r.X, r.Y, r.Width, r.Height, offset); - } - protected void DrawBorders(Pen p1, int x, int y, int width, int height, int offset) - { - DrawBorders(p1, x + offset, y + offset, width - (offset * 2), height - (offset * 2)); - } - - protected void DrawBorders(Pen p1) - { - DrawBorders(p1, 0, 0, Width, Height); - } - protected void DrawBorders(Pen p1, Rectangle r) - { - DrawBorders(p1, r.X, r.Y, r.Width, r.Height); - } - protected void DrawBorders(Pen p1, int x, int y, int width, int height) - { - G.DrawRectangle(p1, x, y, width - 1, height - 1); - } - - #endregion - - #region " DrawText " - - private Point DrawTextPoint; - - private Size DrawTextSize; - protected void DrawText(Brush b1, HorizontalAlignment a, int x, int y) - { - DrawText(b1, Text, a, x, y); - } - protected void DrawText(Brush b1, string text, HorizontalAlignment a, int x, int y) - { - if (text.Length == 0) - return; - - DrawTextSize = Measure(text); - DrawTextPoint = Center(DrawTextSize); - - switch (a) - { - case HorizontalAlignment.Left: - G.DrawString(text, Font, b1, x, DrawTextPoint.Y + y); - break; - case HorizontalAlignment.Center: - G.DrawString(text, Font, b1, DrawTextPoint.X + x, DrawTextPoint.Y + y); - break; - case HorizontalAlignment.Right: - G.DrawString(text, Font, b1, Width - DrawTextSize.Width - x, DrawTextPoint.Y + y); - break; - } - } - - protected void DrawText(Brush b1, Point p1) - { - if (Text.Length == 0) - return; - G.DrawString(Text, Font, b1, p1); - } - protected void DrawText(Brush b1, int x, int y) - { - if (Text.Length == 0) - return; - G.DrawString(Text, Font, b1, x, y); - } - - #endregion - - #region " DrawImage " - - - private Point DrawImagePoint; - protected void DrawImage(HorizontalAlignment a, int x, int y) - { - DrawImage(_Image, a, x, y); - } - protected void DrawImage(Image image, HorizontalAlignment a, int x, int y) - { - if (image == null) - return; - DrawImagePoint = Center(image.Size); - - switch (a) - { - case HorizontalAlignment.Left: - G.DrawImage(image, x, DrawImagePoint.Y + y, image.Width, image.Height); - break; - case HorizontalAlignment.Center: - G.DrawImage(image, DrawImagePoint.X + x, DrawImagePoint.Y + y, image.Width, image.Height); - break; - case HorizontalAlignment.Right: - G.DrawImage(image, Width - image.Width - x, DrawImagePoint.Y + y, image.Width, image.Height); - break; - } - } - - protected void DrawImage(Point p1) - { - DrawImage(_Image, p1.X, p1.Y); - } - protected void DrawImage(int x, int y) - { - DrawImage(_Image, x, y); - } - - protected void DrawImage(Image image, Point p1) - { - DrawImage(image, p1.X, p1.Y); - } - protected void DrawImage(Image image, int x, int y) - { - if (image == null) - return; - G.DrawImage(image, x, y, image.Width, image.Height); - } - - #endregion - - #region " DrawGradient " - - private LinearGradientBrush DrawGradientBrush; - - private Rectangle DrawGradientRectangle; - protected void DrawGradient(ColorBlend blend, int x, int y, int width, int height) - { - DrawGradientRectangle = new Rectangle(x, y, width, height); - DrawGradient(blend, DrawGradientRectangle); - } - protected void DrawGradient(ColorBlend blend, int x, int y, int width, int height, float angle) - { - DrawGradientRectangle = new Rectangle(x, y, width, height); - DrawGradient(blend, DrawGradientRectangle, angle); - } - - protected void DrawGradient(ColorBlend blend, Rectangle r) - { - DrawGradientBrush = new LinearGradientBrush(r, Color.Empty, Color.Empty, 90f); - DrawGradientBrush.InterpolationColors = blend; - G.FillRectangle(DrawGradientBrush, r); - } - protected void DrawGradient(ColorBlend blend, Rectangle r, float angle) - { - DrawGradientBrush = new LinearGradientBrush(r, Color.Empty, Color.Empty, angle); - DrawGradientBrush.InterpolationColors = blend; - G.FillRectangle(DrawGradientBrush, r); - } - - - protected void DrawGradient(Color c1, Color c2, int x, int y, int width, int height) - { - DrawGradientRectangle = new Rectangle(x, y, width, height); - DrawGradient(c1, c2, DrawGradientRectangle); - } - protected void DrawGradient(Color c1, Color c2, int x, int y, int width, int height, float angle) - { - DrawGradientRectangle = new Rectangle(x, y, width, height); - DrawGradient(c1, c2, DrawGradientRectangle, angle); - } - - protected void DrawGradient(Color c1, Color c2, Rectangle r) - { - DrawGradientBrush = new LinearGradientBrush(r, c1, c2, 90f); - G.FillRectangle(DrawGradientBrush, r); - } - protected void DrawGradient(Color c1, Color c2, Rectangle r, float angle) - { - DrawGradientBrush = new LinearGradientBrush(r, c1, c2, angle); - G.FillRectangle(DrawGradientBrush, r); - } - - #endregion - - #region " DrawRadial " - - private GraphicsPath DrawRadialPath; - private PathGradientBrush DrawRadialBrush1; - private LinearGradientBrush DrawRadialBrush2; - - private Rectangle DrawRadialRectangle; - public void DrawRadial(ColorBlend blend, int x, int y, int width, int height) - { - DrawRadialRectangle = new Rectangle(x, y, width, height); - DrawRadial(blend, DrawRadialRectangle, width / 2, height / 2); - } - public void DrawRadial(ColorBlend blend, int x, int y, int width, int height, Point center) - { - DrawRadialRectangle = new Rectangle(x, y, width, height); - DrawRadial(blend, DrawRadialRectangle, center.X, center.Y); - } - public void DrawRadial(ColorBlend blend, int x, int y, int width, int height, int cx, int cy) - { - DrawRadialRectangle = new Rectangle(x, y, width, height); - DrawRadial(blend, DrawRadialRectangle, cx, cy); - } - - public void DrawRadial(ColorBlend blend, Rectangle r) - { - DrawRadial(blend, r, r.Width / 2, r.Height / 2); - } - public void DrawRadial(ColorBlend blend, Rectangle r, Point center) - { - DrawRadial(blend, r, center.X, center.Y); - } - public void DrawRadial(ColorBlend blend, Rectangle r, int cx, int cy) - { - DrawRadialPath.Reset(); - DrawRadialPath.AddEllipse(r.X, r.Y, r.Width - 1, r.Height - 1); - - DrawRadialBrush1 = new PathGradientBrush(DrawRadialPath); - DrawRadialBrush1.CenterPoint = new Point(r.X + cx, r.Y + cy); - DrawRadialBrush1.InterpolationColors = blend; - - if (G.SmoothingMode == SmoothingMode.AntiAlias) - { - G.FillEllipse(DrawRadialBrush1, r.X + 1, r.Y + 1, r.Width - 3, r.Height - 3); - } - else - { - G.FillEllipse(DrawRadialBrush1, r); - } - } - - - protected void DrawRadial(Color c1, Color c2, int x, int y, int width, int height) - { - DrawRadialRectangle = new Rectangle(x, y, width, height); - DrawRadial(c1, c2, DrawRadialRectangle); - } - protected void DrawRadial(Color c1, Color c2, int x, int y, int width, int height, float angle) - { - DrawRadialRectangle = new Rectangle(x, y, width, height); - DrawRadial(c1, c2, DrawRadialRectangle, angle); - } - - protected void DrawRadial(Color c1, Color c2, Rectangle r) - { - DrawRadialBrush2 = new LinearGradientBrush(r, c1, c2, 90f); - G.FillEllipse(DrawRadialBrush2, r); - } - protected void DrawRadial(Color c1, Color c2, Rectangle r, float angle) - { - DrawRadialBrush2 = new LinearGradientBrush(r, c1, c2, angle); - G.FillEllipse(DrawRadialBrush2, r); - } - - #endregion - - #region " CreateRound " - - private GraphicsPath CreateRoundPath; - - private Rectangle CreateRoundRectangle; - public GraphicsPath CreateRound(int x, int y, int width, int height, int slope) - { - CreateRoundRectangle = new Rectangle(x, y, width, height); - return CreateRound(CreateRoundRectangle, slope); - } - - public GraphicsPath CreateRound(Rectangle r, int slope) - { - CreateRoundPath = new GraphicsPath(FillMode.Winding); - CreateRoundPath.AddArc(r.X, r.Y, slope, slope, 180f, 90f); - CreateRoundPath.AddArc(r.Right - slope, r.Y, slope, slope, 270f, 90f); - CreateRoundPath.AddArc(r.Right - slope, r.Bottom - slope, slope, slope, 0f, 90f); - CreateRoundPath.AddArc(r.X, r.Bottom - slope, slope, slope, 90f, 90f); - CreateRoundPath.CloseFigure(); - return CreateRoundPath; - } - - #endregion - - } - - public static class ThemeShare - { - - #region " Animation " - - private static int Frames; - private static bool Invalidate; - - public static PrecisionTimer ThemeTimer = new PrecisionTimer(); - //1000 / 50 = 20 FPS - private const int FPS = 50; - - private const int Rate = 10; - public delegate void AnimationDelegate(bool invalidate); - - - private static List Callbacks = new List(); - private static void HandleCallbacks(IntPtr state, bool reserve) - { - Invalidate = (Frames >= FPS); - if (Invalidate) - Frames = 0; - - lock (Callbacks) - { - for (int I = 0; I <= Callbacks.Count - 1; I++) - { - Callbacks[I].Invoke(Invalidate); - } - } - - Frames += Rate; - } - - private static void InvalidateThemeTimer() - { - if (Callbacks.Count == 0) - { - ThemeTimer.Delete(); - } - else - { - ThemeTimer.Create(0, Rate, HandleCallbacks); - } - } - - public static void AddAnimationCallback(AnimationDelegate callback) - { - lock (Callbacks) - { - if (Callbacks.Contains(callback)) - return; - - Callbacks.Add(callback); - InvalidateThemeTimer(); - } - } - - public static void RemoveAnimationCallback(AnimationDelegate callback) - { - lock (Callbacks) - { - if (!Callbacks.Contains(callback)) - return; - - Callbacks.Remove(callback); - InvalidateThemeTimer(); - } - } - - #endregion - - } - - public enum MouseState : byte - { - None = 0, - Over = 1, - Down = 2, - Block = 3 - } - - public struct Bloom - { - - public string _Name; - public string Name - { - get { return _Name; } - } - - private Color _Value; - public Color Value - { - get { return _Value; } - set { _Value = value; } - } - - public string ValueHex - { - get { return string.Concat("#", _Value.R.ToString("X2", null), _Value.G.ToString("X2", null), _Value.B.ToString("X2", null)); } - set - { - try - { - _Value = ColorTranslator.FromHtml(value); - } - catch - { - return; - } - } - } - - - public Bloom(string name, Color value) - { - _Name = name; - _Value = value; - } - } - - - public class PrecisionTimer : IDisposable - { - - private bool _Enabled; - public bool Enabled - { - get { return _Enabled; } - } - - private IntPtr Handle; - - private TimerDelegate TimerCallback; - [DllImport("kernel32.dll", EntryPoint = "CreateTimerQueueTimer")] - private static extern bool CreateTimerQueueTimer(ref IntPtr handle, IntPtr queue, TimerDelegate callback, IntPtr state, uint dueTime, uint period, uint flags); - - [DllImport("kernel32.dll", EntryPoint = "DeleteTimerQueueTimer")] - private static extern bool DeleteTimerQueueTimer(IntPtr queue, IntPtr handle, IntPtr callback); - - public delegate void TimerDelegate(IntPtr r1, bool r2); - - public void Create(uint dueTime, uint period, TimerDelegate callback) - { - if (_Enabled) - return; - - TimerCallback = callback; - bool Success = CreateTimerQueueTimer(ref Handle, IntPtr.Zero, TimerCallback, IntPtr.Zero, dueTime, period, 0); - - if (!Success) - ThrowNewException("CreateTimerQueueTimer"); - _Enabled = Success; - } - - public void Delete() - { - if (!_Enabled) - return; - bool Success = DeleteTimerQueueTimer(IntPtr.Zero, Handle, IntPtr.Zero); - - if (!Success && !(Marshal.GetLastWin32Error() == 997)) - { - ThrowNewException("DeleteTimerQueueTimer"); - } - - _Enabled = !Success; - } - - private void ThrowNewException(string name) - { - throw new Exception(string.Format("{0} failed. Win32Error: {1}", name, Marshal.GetLastWin32Error())); - } - - public void Dispose() - { - Delete(); - } - } - - #endregion - - [ToolboxItem(false)] - public class AVGTheme : ThemeContainer154 - { - public AVGTheme() - { - BackColor = BackColorOk; - Font = new Font("Arial", 14); - SetColor("Border", Color.DimGray); - SetColor("Text", Color.WhiteSmoke); - } - Color BackColorOk = new Color(); - Color Border; - Brush TextBrush; - protected override void ColorHook() - { - BackColorOk = Color.FromArgb(39, 43, 57); - Border = GetColor("Border"); - TextBrush = GetBrush("Text"); - } - protected override void PaintHook() - { - G.Clear(Border); - G.FillRectangle(new SolidBrush(BackColorOk), new Rectangle(1, 1, Width - 2, Height - 2)); - G.DrawString(Parent.FindForm().Text, Font, TextBrush, new Point(40, 20)); - G.DrawIcon(Parent.FindForm().Icon, new Rectangle(9, 18, 25, 25)); - } - } - -} - diff --git a/CBH-Ultimate-Theme-Library/Theme/Helpers/Main/Helper/ThemeContainer.cs b/CBH-Ultimate-Theme-Library/Theme/Helpers/Main/Helper/ThemeContainer.cs deleted file mode 100644 index 0c3bccb..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/Helpers/Main/Helper/ThemeContainer.cs +++ /dev/null @@ -1,148 +0,0 @@ -#region Imports -using System; -using System.Drawing.Drawing2D; -using System.ComponentModel; -using System.Drawing; -using System.Windows.Forms; -using CBH_Ultimate_Theme_Library.Theme.Helpers; -#endregion - -namespace CBH_Ultimate_Theme_Library -{ - - [ToolboxItem(false)] - public class ASCThemeContainer : ContainerControl - { - - private int moveHeight = 38; - private bool formCanMove = false; - private int mouseX; - private int mouseY; - private bool overExit; - - private bool overMin; - public override string Text { - get { return base.Text; } - set { - base.Text = value; - Invalidate(); - } - } - - public ASCThemeContainer() - { - SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.UserPaint | ControlStyles.ResizeRedraw, true); - Dock = DockStyle.Fill; - Font = new Font("Arial", 12, FontStyle.Bold | FontStyle.Italic); - BackColor = Color.FromArgb(15, 15, 15); - } - - protected override void CreateHandle() - { - base.CreateHandle(); - Parent.FindForm().FormBorderStyle = FormBorderStyle.None; - if (Parent.FindForm().TransparencyKey == null) - Parent.FindForm().TransparencyKey = Color.Fuchsia; - } - - protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) - { - base.OnPaint(e); - - Graphics G = e.Graphics; - G.Clear(Parent.FindForm().TransparencyKey); - - int slope = 8; - - Rectangle mainRect = new Rectangle(0, 0, Width - 1, Height - 1); - GraphicsPath mainPath = Drawing.RoundRect(mainRect, slope); - G.FillPath(new SolidBrush(BackColor), mainPath); - G.DrawPath(new Pen(Color.FromArgb(30, 35, 45)), mainPath); - G.FillPath(new SolidBrush(Color.FromArgb(30, 30, 40)), Drawing.RoundRect(new Rectangle(0, 0, Width - 1, moveHeight - slope), slope)); - G.FillRectangle(new SolidBrush(Color.FromArgb(30, 30, 40)), new Rectangle(0, moveHeight - (slope * 2), Width - 1, slope * 2)); - G.DrawLine(new Pen(Color.FromArgb(60, 60, 60)), new Point(1, moveHeight), new Point(Width - 2, moveHeight)); - G.SmoothingMode = SmoothingMode.HighQuality; - - int textX = 6; - int textY = (moveHeight / 2) - Convert.ToInt32((G.MeasureString(Text, Font).Height / 2)) + 1; - Size textSize = new Size(Convert.ToInt32(G.MeasureString(Text, Font).Width), Convert.ToInt32(G.MeasureString(Text, Font).Height)); - Rectangle textRect = new Rectangle(textX, textY, textSize.Width, textSize.Height); - LinearGradientBrush textBrush = new LinearGradientBrush(textRect, Color.FromArgb(185, 190, 195), Color.FromArgb(125, 125, 125), 90f); - G.DrawString(Text, Font, textBrush, new Point(textX, textY)); - - if (overExit) { - G.DrawString("r", new Font("Marlett", 12, FontStyle.Bold), new SolidBrush(Color.FromArgb(25, 100, 140)), new Point(Width - 27, 11)); - } else { - G.DrawString("r", new Font("Marlett", 12, FontStyle.Bold), new SolidBrush(Color.FromArgb(205, 210, 215)), new Point(Width - 27, 11)); - } - if (overMin) { - G.DrawString("0", new Font("Marlett", 12, FontStyle.Bold), new SolidBrush(Color.FromArgb(25, 100, 140)), new Point(Width - 47, 10)); - } else { - G.DrawString("0", new Font("Marlett", 12, FontStyle.Bold), new SolidBrush(Color.FromArgb(205, 210, 215)), new Point(Width - 47, 10)); - } - - if (DesignMode) - - Prevent.Prevents(G, Width, Height); - - } - - protected override void OnMouseMove(System.Windows.Forms.MouseEventArgs e) - { - base.OnMouseMove(e); - - if (formCanMove == true) { - Parent.FindForm().Location = new Point(MousePosition.X - mouseX, MousePosition.Y - mouseY); - } - - if (e.Y > 11 && e.Y < 24) { - if (e.X > Width - 23 && e.X < Width - 10) - overExit = true; - else - overExit = false; - if (e.X > Width - 44 && e.X < Width - 31) - overMin = true; - else - overMin = false; - } else { - overExit = false; - overMin = false; - } - - Invalidate(); - - } - - protected override void OnMouseDown(System.Windows.Forms.MouseEventArgs e) - { - base.OnMouseDown(e); - - mouseX = e.X; - mouseY = e.Y; - - if (e.Y <= moveHeight && overExit == false && overMin == false) - formCanMove = true; - - if (overExit) { - Parent.FindForm().Close(); - } else if (overMin) { - Parent.FindForm().WindowState = FormWindowState.Minimized; - overExit = false; - overMin = false; - } else { - Focus(); - } - - Invalidate(); - - } - - protected override void OnMouseUp(System.Windows.Forms.MouseEventArgs e) - { - base.OnMouseUp(e); - formCanMove = false; - } - - } - -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/ThemeBase/Shadow Controls/CrEaTiiOn_Shadow_Controls.cs b/CBH-Ultimate-Theme-Library/Theme/ThemeBase/Shadow Controls/CrEaTiiOn_Shadow_Controls.cs deleted file mode 100644 index e6e61ab..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/ThemeBase/Shadow Controls/CrEaTiiOn_Shadow_Controls.cs +++ /dev/null @@ -1,3166 +0,0 @@ -#region Imports -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Drawing.Imaging; -using System.Drawing.Text; -using System.IO; -using System.Runtime.InteropServices; -using System.Windows.Forms; -using System.Timers; -#endregion - -namespace CBH.Shadow.Controls -{ - #region Controls - class CrEaTiiOn_Shadow_Button : ThemeControl154 - { - - public CrEaTiiOn_Shadow_Button() - { - Cursor = Cursors.Hand; - Size = new Size(100, 25); - Font = new Font("Segoe UI", 8); - } - - protected override void ColorHook() - { - } - - protected override void PaintHook() - { - G.Clear(Color.FromArgb(20, 20, 20)); - //Background - ColorBlend bg_cblend = new ColorBlend(3); - bg_cblend.Colors[0] = Color.FromArgb(15, 15, 15); - bg_cblend.Colors[1] = Color.FromArgb(15, 15, 15); - bg_cblend.Colors[2] = Color.FromArgb(15, 15, 15); - bg_cblend.Positions = new [] {0,(float)0.6,1 }; - DrawGradient(bg_cblend, new Rectangle(1, 1, Width - 2, Height - 2)); - //MouseState - Point[] backPoints = { - new Point(0, 1), - new Point(1, 0), - new Point(Width - 2, 0), - new Point(Width - 1, 1), - new Point(Width - 1, Height - 2), - new Point(Width - 2, Height - 1), - new Point(1, Height - 1), - new Point(0, Height - 2) - }; - Rectangle innerRect = new Rectangle(1, 1, Width - 2, Height - 2); - switch (State) - { - case MouseState.None: - DrawGradient(bg_cblend, new Rectangle(1, 1, Width - 2, Height - 2)); - G.DrawPolygon(Pens.Black, backPoints); - break; - case MouseState.Over: - DrawGradient(bg_cblend, new Rectangle(1, 1, Width - 2, Height - 2)); - G.FillRectangle(new SolidBrush(Color.FromArgb(10, Color.White)), innerRect); - G.DrawPolygon(Pens.WhiteSmoke, backPoints); - break; - case MouseState.Down: - DrawGradient(bg_cblend, new Rectangle(1, 1, Width - 2, Height - 2)); - G.FillRectangle(new SolidBrush(Color.FromArgb(30, Color.White)), innerRect); - G.DrawPolygon(Pens.WhiteSmoke, backPoints); - break; - } - int textWidth = (int)CreateGraphics().MeasureString(Text, Font).Width; - int textHeight = (int)CreateGraphics().MeasureString(Text, Font).Height; - SolidBrush textShadow = new SolidBrush(Color.FromArgb(15, 15, 15)); - Rectangle textRect = new Rectangle(3, 3, textWidth + 10, textHeight); - Point textPoint = new Point((Width / 2) - (textWidth / 2), (Height / 2) - (textHeight / 2)); - Point textShadowPoint = new Point((Width / 2) - (textWidth / 2) + 1, (Height / 2) - (textHeight / 2) + 1); - G.DrawString(Text, Font, textShadow, textShadowPoint); - G.DrawString(Text, Font, Brushes.White, textPoint); - } - } - - class CrEaTiiOn_Shadow_ProgressBar : ThemeControl154 - { - private int _Maximum = 100; - private int _Value; - - private int Progress; - public int Maximum - { - get { return _Maximum; } - set - { - if (value < 1) - value = 1; - if (value < _Value) - _Value = value; - _Maximum = value; - Invalidate(); - } - } - public int Value - { - get { return _Value; } - set - { - if (value > _Maximum) - value = Maximum; - _Value = value; - Invalidate(); - } - } - - public CrEaTiiOn_Shadow_ProgressBar() - { - Size = new Size(200, 25); - } - - protected override void ColorHook() - { - } - - protected override void PaintHook() - { - G.Clear(Color.FromArgb(20, 20, 20)); - //Background - ColorBlend bg_cblend = new ColorBlend(3); - bg_cblend.Colors[0] = Color.FromArgb(250, 36, 38); - bg_cblend.Colors[1] = Color.FromArgb(15, 15, 15); - bg_cblend.Colors[2] = Color.FromArgb(250, 36, 38); - bg_cblend.Positions = new [] {0,(float)0.5,1}; - DrawGradient(bg_cblend, new Rectangle(1, 1, Width - 2, Height - 2)); - //Bar - ColorBlend bar_cblend = new ColorBlend(3); - bar_cblend.Colors[0] = Color.FromArgb(250, 36, 38); - bar_cblend.Colors[1] = Color.FromArgb(15, 15, 15); - bar_cblend.Colors[2] = Color.FromArgb(250, 36, 38); - bar_cblend.Positions = new[] {0,(float)0.5, 1 }; - DrawGradient(bar_cblend, new Rectangle(1, 1, Convert.ToInt32(((Width / _Maximum) * _Value) - 2), Height - 2)); - //Border - Point[] borderPoints = { - new Point(0, 2), - new Point(2, 0), - new Point(Width - 3, 0), - new Point(Width - 1, 2), - new Point(Width - 1, Height - 3), - new Point(Width - 3, Height - 1), - new Point(2, Height - 1), - new Point(0, Height - 3) - }; - G.DrawPolygon(Pens.Black, borderPoints); - } - } - - class CrEaTiiOn_Shadow_GroupBox : ThemeContainer154 - { - public System.Timers.Timer RainbowTimer = new System.Timers.Timer(); - int Red = (0); - int Green = (255); - int Blue = (0); - - void RainbowTimer_Tick(object sender, EventArgs e) - { - if (Red == 255 && Green == 0 && Blue <= 255 && Blue > 0) - { - Blue--; - } - - else if (Red == 255 && Green >= 0 && Green < 255 && Blue == 0) - { - Green++; - } - - else if (Red <= 255 && Red > 0 && Green == 255 && Blue == 0) - { - Red--; - } - - else if (Red == 0 && Green == 255 && Blue >= 0 && Blue < 255) - { - Blue++; - } - - else if (Red == 0 && Green > 0 && Green <= 255 && Blue == 255) - { - Green--; - } - - else - { - Red++; - } - } - - int x = 1; - - bool gR = true; - public bool Animated - { - get { return IsAnimated; } - set - { - IsAnimated = value; - Invalidate(); - } - } - - public CrEaTiiOn_Shadow_GroupBox() - { - RainbowTimer.Elapsed += new ElapsedEventHandler(RainbowTimer_Tick); - RainbowTimer.Enabled = (true); - RainbowTimer.Interval = (1); - - ControlMode = true; - Font = new Font("Segoe UI", 9); - Size = new Size(150, 100); - Animated = true; - } - - protected override void OnAnimation() - { - base.OnAnimation(); - if (gR == true) - { - x += 1; - } - else { - x -= 1; - } - if (x >= this.Width - 1) - { - x = -39; - } - else if (x <= 1) - { - gR = true; - } - Invalidate(); - } - - protected override void ColorHook() - { - } - - protected override void PaintHook() - { - G.Clear(Color.FromArgb(20, 20, 20)); - int textWidth = (int)CreateGraphics().MeasureString(Text, Font).Width; - int textHeight = (int)CreateGraphics().MeasureString(Text, Font).Height; - //Borders - Point[] borderPoints = { - new Point(0, 1), - new Point(1, 0), - new Point(Width - 2, 0), - new Point(Width - 1, 1), - new Point(Width - 1, Height - 2), - new Point(Width - 2, Height - 1), - new Point(1, Height - 1), - new Point(0, Height - 2) - }; - G.DrawPolygon(Pens.Black, borderPoints); - G.DrawLine(Pens.Black, new Point(0, textHeight + 4), new Point(Width - 1, textHeight + 4)); - //GroupArea - Rectangle groupRect = new Rectangle(1, textHeight + 5, Width - 2, Height - (textHeight + 6)); - G.FillRectangle(new SolidBrush(Color.FromArgb(20, 20, 20)), groupRect); - G.DrawRectangle(new Pen(new SolidBrush(Color.FromArgb(12, 12, 12))), new Rectangle(1, textHeight + 6, Width - 3, Height - (textHeight + 6) - 2)); - //TextArea - Rectangle textRect = new Rectangle(1, 1, Width - 2, textHeight + 5); - G.FillRectangle(new SolidBrush(Color.FromArgb(15, 15, 15)), textRect); - //TextArea Glow - if (Animated == true) - { - Rectangle glowRect = new Rectangle(x, 1, 40, textHeight + 4); - ColorBlend text_cblend = new ColorBlend(3); - text_cblend.Colors[0] = Color.FromArgb(15, 15, 15); - text_cblend.Colors[1] = Color.FromArgb(Red, Green, Blue); - text_cblend.Colors[2] = Color.FromArgb(15, 15, 15); - text_cblend.Positions = new[] {0,(float) 0.5,(float)1.0}; - DrawGradient(text_cblend, glowRect, 0f); - //Reinforce Borders - G.DrawPolygon(Pens.Black, borderPoints); - } - G.DrawLine(Pens.Black, new Point(0, (textHeight + 5)), new Point((Width - 1), (textHeight + 5))); - //Text - int h = (Width - 1) / 2; - G.DrawString(Text, Font, Brushes.Black, new Point(h - (textWidth / 2), 4)); - G.DrawString(Text, Font, Brushes.White, new Point(h - (textWidth / 2), 3)); - } - } - - class CrEaTiiOn_Shadow_ControlBox : ThemeControl154 - { - int X; - bool minOver; - - bool xOver; - public CrEaTiiOn_Shadow_ControlBox() - { - this.Size = new Size(44, 20); - IsAnimated = true; - } - - protected override void ColorHook() - { - } - - protected override void OnMouseMove(System.Windows.Forms.MouseEventArgs e) - { - base.OnMouseMove(e); - X = e.X; - Invalidate(); - } - - protected override void OnClick(System.EventArgs e) - { - base.OnClick(e); - if (X <= 22) - { - FindForm().WindowState = FormWindowState.Minimized; - } - else { - FindForm().Close(); - } - } - - protected override void OnAnimation() - { - base.OnAnimation(); - } - - protected override void PaintHook() - { - G.Clear(Color.FromArgb(20, 20, 20)); - Rectangle minRect = new Rectangle(0, 0, (Width / 2), Height - 1); - Rectangle xRect = new Rectangle((Width / 2), 0, (Width / 2) - 1, Height - 1); - Rectangle allRect = new Rectangle(0, 0, Width - 1, Height - 1); - //MousePosition - LinearGradientBrush bgLGB = new LinearGradientBrush(allRect, Color.FromArgb(20, 20, 20), Color.FromArgb(35, 35, 35), 90f); - switch (State) - { - case MouseState.Over: - if (X < 22) - { - G.FillRectangle(new SolidBrush(Color.FromArgb(50, Color.White)), minRect); - } - else if (X > 22) - { - G.FillRectangle(new SolidBrush(Color.FromArgb(50, Color.White)), xRect); - } - else if (X == 22) - { - X = -1; - G.FillRectangle(bgLGB, allRect); - } - break; - case MouseState.None: - G.FillRectangle(bgLGB, allRect); - break; - } - //OuterRects - G.DrawRectangles(Pens.Black,new [] {minRect,xRect}); - //Characters - G.DrawString("0", new Font("Marlett", (float)8.25,FontStyle.Regular), Brushes.White, new Point(5, 5)); - G.DrawString("r", new Font("Marlett", 10), Brushes.White, new Point(26, 4)); - } - } - - [DefaultEvent("CheckedChanged")] - class CrEaTiiOn_Shadow_CheckBox : ThemeControl154 - { - - int X; - - int Y; - public CrEaTiiOn_Shadow_CheckBox() - { - Size = new Size(120, 20); - LockHeight = 20; - } - - protected override void OnMouseMove(System.Windows.Forms.MouseEventArgs e) - { - base.OnMouseMove(e); - X = e.Location.X; - Y = e.Location.Y; - Invalidate(); - } - - protected override void ColorHook() - { - } - - protected override void PaintHook() - { - G.Clear(Color.FromArgb(20, 20, 20)); - Point[] cbPoints = { - new Point(3, 5), - new Point(5, 3), - new Point(14, 3), - new Point(16, 5), - new Point(16, 14), - new Point(14, 16), - new Point(5, 16), - new Point(3, 14) - }; - Point[] innerpoints = { - new Point(4, 6), - new Point(6, 4), - new Point(13, 4), - new Point(15, 6), - new Point(15, 13), - new Point(13, 15), - new Point(6, 15), - new Point(4, 13) - }; - G.DrawPolygon(Pens.Black, cbPoints); - ColorBlend checked_cblend = new ColorBlend(3); - checked_cblend.Colors[0] = Color.FromArgb(255, 255, 255); - checked_cblend.Colors[1] = Color.FromArgb(255, 255, 255); - checked_cblend.Colors[2] = Color.FromArgb(255, 255, 255); - checked_cblend.Positions = new[] {0,(float)0.7,1}; - ColorBlend bg_cblend = new ColorBlend(3); - bg_cblend.Colors[0] = Color.FromArgb(14, 14, 14); - bg_cblend.Colors[1] = Color.FromArgb(12, 12, 12); - bg_cblend.Colors[2] = Color.FromArgb(16, 16, 16); - bg_cblend.Positions = new[] {0,(float)0.5,1 }; - //Checked - if (_Checked == true) - { - DrawGradient(checked_cblend, new Rectangle(4, 4, 12, 12), -45f); - G.DrawPolygon(new Pen(new SolidBrush(Color.FromArgb(255, 255, 255))), innerpoints); - G.DrawPolygon(Pens.Black, cbPoints); - } - else { - DrawGradient(bg_cblend, new Rectangle(4, 4, 12, 12), -45f); - G.DrawPolygon(Pens.Black, cbPoints); - } - //Highlight On MouseOver - if (State == MouseState.Over && X <= 16 && Y >= 4 && Y <= 16) - { - G.DrawPolygon(new Pen(new SolidBrush(Color.FromArgb(210, 210, 210))), cbPoints); - } - else if (State == MouseState.Down) - { - G.DrawPolygon(new Pen(new SolidBrush(Color.FromArgb(210, 210, 210))), cbPoints); - } - //Text - DrawText(Brushes.Black, HorizontalAlignment.Left, 20, 1); - DrawText(Brushes.White, HorizontalAlignment.Left, 19, 0); - } - - private bool _Checked; - public bool Checked - { - get { return _Checked; } - set - { - _Checked = value; - Invalidate(); - } - } - - protected override void OnMouseDown(System.Windows.Forms.MouseEventArgs e) - { - base.OnMouseDown(e); - if (X <= 16 && Y >= 4 && Y <= 16) - { - _Checked = !_Checked; - if (CheckedChanged != null) - { - CheckedChanged(this); - } - } - } - - public event CheckedChangedEventHandler CheckedChanged; - public delegate void CheckedChangedEventHandler(object sender); - } - - //The remaining controls were coded by Mavamaarten~ - [DefaultEvent("TextChanged")] - class CrEaTiiOn_Shadow_TextBodx : ThemeControl154 - { - - private HorizontalAlignment _TextAlign = HorizontalAlignment.Left; - public HorizontalAlignment TextAlign - { - get { return _TextAlign; } - set - { - _TextAlign = value; - if (Base != null) - { - Base.TextAlign = value; - } - } - } - private int _MaxLength = 32767; - public int MaxLength - { - get { return _MaxLength; } - set - { - _MaxLength = value; - if (Base != null) - { - Base.MaxLength = value; - } - } - } - private bool _ReadOnly; - public bool ReadOnly - { - get { return _ReadOnly; } - set - { - _ReadOnly = value; - if (Base != null) - { - Base.ReadOnly = value; - } - } - } - private bool _UseSystemPasswordChar; - public bool UseSystemPasswordChar - { - get { return _UseSystemPasswordChar; } - set - { - _UseSystemPasswordChar = value; - if (Base != null) - { - Base.UseSystemPasswordChar = value; - } - } - } - private bool _Multiline; - public bool Multiline - { - get { return _Multiline; } - set - { - _Multiline = value; - if (Base != null) - { - Base.Multiline = value; - - if (value) - { - LockHeight = 0; - Base.Height = Height - 11; - } - else { - LockHeight = Base.Height + 11; - } - } - } - } - public override string Text - { - get { return base.Text; } - set - { - base.Text = value; - if (Base != null) - { - Base.Text = value; - } - } - } - public override Font Font - { - get { return base.Font; } - set - { - base.Font = value; - if (Base != null) - { - Base.Font = value; - Base.Location = new Point(3, 5); - Base.Width = Width - 6; - - if (!_Multiline) - { - LockHeight = Base.Height + 11; - } - } - } - } - protected override void OnCreation() - { - if (!Controls.Contains(Base)) - { - Controls.Add(Base); - } - } - - private TextBox Base; - public CrEaTiiOn_Shadow_TextBodx() - { - Base = new TextBox(); - Base.Font = Font; - Base.Text = Text; - Base.MaxLength = _MaxLength; - Base.Multiline = _Multiline; - Base.ReadOnly = _ReadOnly; - Base.UseSystemPasswordChar = _UseSystemPasswordChar; - Base.BorderStyle = BorderStyle.None; - Base.Location = new Point(4, 4); - Base.Width = Width - 10; - if (_Multiline) - { - Base.Height = Height - 11; - } - else { - LockHeight = Base.Height + 11; - } - Base.TextChanged += OnBaseTextChanged; - Base.KeyDown += OnBaseKeyDown; - } - - private Color BG; - - private Pen P1; - protected override void ColorHook() - { - Base.ForeColor = Color.White; - Base.BackColor = Color.FromArgb(12, 12, 12); - } - - protected override void PaintHook() - { - G.Clear(Color.FromArgb(20, 20, 20)); - G.FillRectangle(new SolidBrush(Color.FromArgb(12, 12, 12)), new Rectangle(0, 0, Width - 1, Height - 1)); - DrawBorders(Pens.Black); - } - private void OnBaseTextChanged(object s, EventArgs e) - { - Text = Base.Text; - } - private void OnBaseKeyDown(object s, KeyEventArgs e) - { - if (e.Control && e.KeyCode == Keys.A) - { - Base.SelectAll(); - e.SuppressKeyPress = true; - } - } - protected override void OnResize(EventArgs e) - { - Base.Location = new Point(4, 5); - Base.Width = Width - 8; - - if (_Multiline) - { - Base.Height = Height - 5; - } - - - base.OnResize(e); - } - - } - - class CrEaTiiOn_Shadow_TabControl : TabControl - { - - private Color _BG; - public Color Backcolor - { - get { return _BG; } - set { _BG = value; } - } - - public CrEaTiiOn_Shadow_TabControl() - { - SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.ResizeRedraw | ControlStyles.UserPaint | ControlStyles.DoubleBuffer, true); - DoubleBuffered = true; - Backcolor = Color.FromArgb(20, 20, 20); - } - protected override void CreateHandle() - { - base.CreateHandle(); - Alignment = TabAlignment.Top; - } - - public Pen ToPen(Color color) - { - return new Pen(color); - } - - public Brush ToBrush(Color color) - { - return new SolidBrush(color); - } - - protected override void OnPaint(PaintEventArgs e) - { - Bitmap B = new Bitmap(Width, Height); - Graphics G = Graphics.FromImage(B); - try - { - SelectedTab.BackColor = Backcolor; - } - catch - { - } - G.Clear(Backcolor); - for (int i = 0; i <= TabCount - 1; i++) - { - if (i == SelectedIndex) - { - Rectangle x2 = new Rectangle(GetTabRect(i).X - 2, GetTabRect(i).Y, GetTabRect(i).Width, GetTabRect(i).Height - 2); - Rectangle x3 = new Rectangle(GetTabRect(i).X - 2, GetTabRect(i).Y, GetTabRect(i).Width, GetTabRect(i).Height - 1); - Rectangle x4 = new Rectangle(GetTabRect(i).X - 2, GetTabRect(i).Y, GetTabRect(i).Width, GetTabRect(i).Height); - LinearGradientBrush G1 = new LinearGradientBrush(x3, Color.FromArgb(10, 0, 0, 0), Color.FromArgb(35, 35, 35), 90f); - HatchBrush HB = new HatchBrush(HatchStyle.LightDownwardDiagonal, Color.FromArgb(10, Color.Black), Color.Transparent); - - G.FillRectangle(HB, x3); - HB.Dispose(); - G.FillRectangle(G1, x3); - G1.Dispose(); - G.DrawLine(new Pen(Color.FromArgb(10, 10, 10)), x2.Location, new Point(x2.Location.X, x2.Location.Y + x2.Height)); - G.DrawLine(new Pen(Color.FromArgb(10, 10, 10)), new Point(x2.Location.X + x2.Width, x2.Location.Y), new Point(x2.Location.X + x2.Width, x2.Location.Y + x2.Height)); - G.DrawLine(new Pen(Color.FromArgb(10, 10, 10)), new Point(x2.Location.X, x2.Location.Y), new Point(x2.Location.X + x2.Width, x2.Location.Y)); - G.DrawString(TabPages[i].Text, Font, new SolidBrush(Color.White), x4, new StringFormat - { - LineAlignment = StringAlignment.Center, - Alignment = StringAlignment.Center - }); - } - else { - Rectangle x2 = new Rectangle(GetTabRect(i).X - 2, GetTabRect(i).Y + 3, GetTabRect(i).Width, GetTabRect(i).Height - 5); - LinearGradientBrush G1 = new LinearGradientBrush(x2, Color.FromArgb(20, 20, 20), Color.FromArgb(35, 35, 35), -90f); - G.FillRectangle(G1, x2); - G1.Dispose(); - G.DrawRectangle(new Pen(Color.FromArgb(15, 15, 15)), x2); - G.DrawString(TabPages[i].Text, Font, new SolidBrush(Color.Black), x2, new StringFormat - { - LineAlignment = StringAlignment.Center, - Alignment = StringAlignment.Center - }); - } - } - G.DrawRectangle(new Pen(new SolidBrush(Color.FromArgb(10, 10, 10))), new Rectangle(0, 21, Width - 1, Height - 22)); - - e.Graphics.DrawImage((Bitmap)B.Clone(), 0, 0); - G.DrawRectangle(Pens.Black, new Rectangle(0, 0, Width - 1, Height - 1)); - G.Dispose(); - B.Dispose(); - } - } - #endregion - - #region Helpers and version history - //------------------ - //Creator: aeonhack - //Site: elitevs.net - //Created: 08/02/2011 - //Changed: 12/06/2011 - //Version: 1.5.4 - //------------------ - - abstract class ThemeContainer154 : ContainerControl - { - - #region " Initialization " - - protected Graphics G; - - protected Bitmap B; - public ThemeContainer154() - { - SetStyle((ControlStyles)139270, true); - - _ImageSize = Size.Empty; - Font = new Font("Verdana", 8); - - MeasureBitmap = new Bitmap(1, 1); - MeasureGraphics = Graphics.FromImage(MeasureBitmap); - - DrawRadialPath = new GraphicsPath(); - - InvalidateCustimization(); - } - - protected override sealed void OnHandleCreated(EventArgs e) - { - if (DoneCreation) - InitializeMessages(); - - InvalidateCustimization(); - ColorHook(); - - if (!(_LockWidth == 0)) - Width = _LockWidth; - if (!(_LockHeight == 0)) - Height = _LockHeight; - if (!_ControlMode) - base.Dock = DockStyle.Fill; - - Transparent = _Transparent; - if (_Transparent && _BackColor) - BackColor = Color.Transparent; - - base.OnHandleCreated(e); - } - - private bool DoneCreation; - protected override sealed void OnParentChanged(EventArgs e) - { - base.OnParentChanged(e); - - if (Parent == null) - return; - _IsParentForm = Parent is Form; - - if (!_ControlMode) - { - InitializeMessages(); - - if (_IsParentForm) - { - ParentForm.FormBorderStyle = _BorderStyle; - ParentForm.TransparencyKey = _TransparencyKey; - - if (!DesignMode) - { - ParentForm.Shown += FormShown; - } - } - - Parent.BackColor = BackColor; - } - - OnCreation(); - DoneCreation = true; - InvalidateTimer(); - } - - #endregion - - private void DoAnimation(bool i) - { - OnAnimation(); - if (i) - Invalidate(); - } - - protected override sealed void OnPaint(PaintEventArgs e) - { - if (Width == 0 || Height == 0) - return; - - if (_Transparent && _ControlMode) - { - PaintHook(); - e.Graphics.DrawImage(B, 0, 0); - } - else { - G = e.Graphics; - PaintHook(); - } - } - - protected override void OnHandleDestroyed(EventArgs e) - { - ThemeShare.RemoveAnimationCallback(DoAnimation); - base.OnHandleDestroyed(e); - } - - private bool HasShown; - private void FormShown(object sender, EventArgs e) - { - if (_ControlMode || HasShown) - return; - - if (_StartPosition == FormStartPosition.CenterParent || _StartPosition == FormStartPosition.CenterScreen) - { - Rectangle SB = Screen.PrimaryScreen.Bounds; - Rectangle CB = ParentForm.Bounds; - ParentForm.Location = new Point(SB.Width / 2 - CB.Width / 2, SB.Height / 2 - CB.Width / 2); - } - - HasShown = true; - } - - - #region " Size Handling " - - private Rectangle Frame; - protected override sealed void OnSizeChanged(EventArgs e) - { - if (_Movable && !_ControlMode) - { - Frame = new Rectangle(7, 7, Width - 14, _Header - 7); - } - - InvalidateBitmap(); - Invalidate(); - - base.OnSizeChanged(e); - } - - protected override void SetBoundsCore(int x, int y, int width, int height, BoundsSpecified specified) - { - if (!(_LockWidth == 0)) - width = _LockWidth; - if (!(_LockHeight == 0)) - height = _LockHeight; - base.SetBoundsCore(x, y, width, height, specified); - } - - #endregion - - #region " State Handling " - - protected MouseState State; - private void SetState(MouseState current) - { - State = current; - Invalidate(); - } - - protected override void OnMouseMove(MouseEventArgs e) - { - if (!(_IsParentForm && ParentForm.WindowState == FormWindowState.Maximized)) - { - if (_Sizable && !_ControlMode) - InvalidateMouse(); - } - - base.OnMouseMove(e); - } - - protected override void OnEnabledChanged(EventArgs e) - { - if (Enabled) - SetState(MouseState.None); - else - SetState(MouseState.Block); - base.OnEnabledChanged(e); - } - - protected override void OnMouseEnter(EventArgs e) - { - SetState(MouseState.Over); - base.OnMouseEnter(e); - } - - protected override void OnMouseUp(MouseEventArgs e) - { - SetState(MouseState.Over); - base.OnMouseUp(e); - } - - protected override void OnMouseLeave(EventArgs e) - { - SetState(MouseState.None); - - if (GetChildAtPoint(PointToClient(MousePosition)) != null) - { - if (_Sizable && !_ControlMode) - { - Cursor = Cursors.Default; - Previous = 0; - } - } - - base.OnMouseLeave(e); - } - - protected override void OnMouseDown(MouseEventArgs e) - { - if (e.Button == MouseButtons.Left) - SetState(MouseState.Down); - - if (!(_IsParentForm && ParentForm.WindowState == FormWindowState.Maximized || _ControlMode)) - { - if (_Movable && Frame.Contains(e.Location)) - { - Capture = false; - WM_LMBUTTONDOWN = true; - DefWndProc(ref Messages[0]); - } - else if (_Sizable && !(Previous == 0)) - { - Capture = false; - WM_LMBUTTONDOWN = true; - DefWndProc(ref Messages[Previous]); - } - } - - base.OnMouseDown(e); - } - - private bool WM_LMBUTTONDOWN; - protected override void WndProc(ref Message m) - { - base.WndProc(ref m); - - if (WM_LMBUTTONDOWN && m.Msg == 513) - { - WM_LMBUTTONDOWN = false; - - SetState(MouseState.Over); - if (!_SmartBounds) - return; - - if (IsParentMdi) - { - CorrectBounds(new Rectangle(Point.Empty, Parent.Parent.Size)); - } - else { - CorrectBounds(Screen.FromControl(Parent).WorkingArea); - } - } - } - - private Point GetIndexPoint; - private bool B1; - private bool B2; - private bool B3; - private bool B4; - private int GetIndex() - { - GetIndexPoint = PointToClient(MousePosition); - B1 = GetIndexPoint.X < 7; - B2 = GetIndexPoint.X > Width - 7; - B3 = GetIndexPoint.Y < 7; - B4 = GetIndexPoint.Y > Height - 7; - - if (B1 && B3) - return 4; - if (B1 && B4) - return 7; - if (B2 && B3) - return 5; - if (B2 && B4) - return 8; - if (B1) - return 1; - if (B2) - return 2; - if (B3) - return 3; - if (B4) - return 6; - return 0; - } - - private int Current; - private int Previous; - private void InvalidateMouse() - { - Current = GetIndex(); - if (Current == Previous) - return; - - Previous = Current; - switch (Previous) - { - case 0: - Cursor = Cursors.Default; - break; - case 1: - case 2: - Cursor = Cursors.SizeWE; - break; - case 3: - case 6: - Cursor = Cursors.SizeNS; - break; - case 4: - case 8: - Cursor = Cursors.SizeNWSE; - break; - case 5: - case 7: - Cursor = Cursors.SizeNESW; - break; - } - } - - private Message[] Messages = new Message[9]; - private void InitializeMessages() - { - Messages[0] = Message.Create(Parent.Handle, 161, new IntPtr(2), IntPtr.Zero); - for (int I = 1; I <= 8; I++) - { - Messages[I] = Message.Create(Parent.Handle, 161, new IntPtr(I + 9), IntPtr.Zero); - } - } - - private void CorrectBounds(Rectangle bounds) - { - if (Parent.Width > bounds.Width) - Parent.Width = bounds.Width; - if (Parent.Height > bounds.Height) - Parent.Height = bounds.Height; - - int X = Parent.Location.X; - int Y = Parent.Location.Y; - - if (X < bounds.X) - X = bounds.X; - if (Y < bounds.Y) - Y = bounds.Y; - - int Width = bounds.X + bounds.Width; - int Height = bounds.Y + bounds.Height; - - if (X + Parent.Width > Width) - X = Width - Parent.Width; - if (Y + Parent.Height > Height) - Y = Height - Parent.Height; - - Parent.Location = new Point(X, Y); - } - - #endregion - - - #region " Base Properties " - - public override DockStyle Dock - { - get { return base.Dock; } - set - { - if (!_ControlMode) - return; - base.Dock = value; - } - } - - private bool _BackColor; - [Category("Misc")] - public override Color BackColor - { - get { return base.BackColor; } - set - { - if (value == base.BackColor) - return; - - if (!IsHandleCreated && _ControlMode && value == Color.Transparent) - { - _BackColor = true; - return; - } - - base.BackColor = value; - if (Parent != null) - { - if (!_ControlMode) - Parent.BackColor = value; - ColorHook(); - } - } - } - - public override Size MinimumSize - { - get { return base.MinimumSize; } - set - { - base.MinimumSize = value; - if (Parent != null) - Parent.MinimumSize = value; - } - } - - public override Size MaximumSize - { - get { return base.MaximumSize; } - set - { - base.MaximumSize = value; - if (Parent != null) - Parent.MaximumSize = value; - } - } - - public override string Text - { - get { return base.Text; } - set - { - base.Text = value; - Invalidate(); - } - } - - public override Font Font - { - get { return base.Font; } - set - { - base.Font = value; - Invalidate(); - } - } - - [Browsable(false), EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public override Color ForeColor - { - get { return Color.Empty; } - set { } - } - [Browsable(false), EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public override Image BackgroundImage - { - get { return null; } - set { } - } - [Browsable(false), EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public override ImageLayout BackgroundImageLayout - { - get { return ImageLayout.None; } - set { } - } - - #endregion - - #region " Public Properties " - - private bool _SmartBounds = true; - public bool SmartBounds - { - get { return _SmartBounds; } - set { _SmartBounds = value; } - } - - private bool _Movable = true; - public bool Movable - { - get { return _Movable; } - set { _Movable = value; } - } - - private bool _Sizable = true; - public bool Sizable - { - get { return _Sizable; } - set { _Sizable = value; } - } - - private Color _TransparencyKey; - public Color TransparencyKey - { - get - { - if (_IsParentForm && !_ControlMode) - return ParentForm.TransparencyKey; - else - return _TransparencyKey; - } - set - { - if (value == _TransparencyKey) - return; - _TransparencyKey = value; - - if (_IsParentForm && !_ControlMode) - { - ParentForm.TransparencyKey = value; - ColorHook(); - } - } - } - - private FormBorderStyle _BorderStyle; - public FormBorderStyle BorderStyle - { - get - { - if (_IsParentForm && !_ControlMode) - return ParentForm.FormBorderStyle; - else - return _BorderStyle; - } - set - { - _BorderStyle = value; - - if (_IsParentForm && !_ControlMode) - { - ParentForm.FormBorderStyle = value; - - if (!(value == FormBorderStyle.None)) - { - Movable = false; - Sizable = false; - } - } - } - } - - private FormStartPosition _StartPosition; - public FormStartPosition StartPosition - { - get - { - if (_IsParentForm && !_ControlMode) - return ParentForm.StartPosition; - else - return _StartPosition; - } - set - { - _StartPosition = value; - - if (_IsParentForm && !_ControlMode) - { - ParentForm.StartPosition = value; - } - } - } - - private bool _NoRounding; - public bool NoRounding - { - get { return _NoRounding; } - set - { - _NoRounding = value; - Invalidate(); - } - } - - private Image _Image; - public Image Image - { - get { return _Image; } - set - { - if (value == null) - _ImageSize = Size.Empty; - else - _ImageSize = value.Size; - - _Image = value; - Invalidate(); - } - } - - private Dictionary Items = new Dictionary(); - public Bloom[] Colors - { - get - { - List T = new List(); - Dictionary.Enumerator E = Items.GetEnumerator(); - - while (E.MoveNext()) - { - T.Add(new Bloom(E.Current.Key, E.Current.Value)); - } - - return T.ToArray(); - } - set - { - foreach (Bloom B in value) - { - if (Items.ContainsKey(B.Name)) - Items[B.Name] = B.Value; - } - - InvalidateCustimization(); - ColorHook(); - Invalidate(); - } - } - - private string _Customization; - public string Customization - { - get { return _Customization; } - set - { - if (value == _Customization) - return; - - byte[] Data = null; - Bloom[] Items = Colors; - - try - { - Data = Convert.FromBase64String(value); - for (int I = 0; I <= Items.Length - 1; I++) - { - Items[I].Value = Color.FromArgb(BitConverter.ToInt32(Data, I * 4)); - } - } - catch - { - return; - } - - _Customization = value; - - Colors = Items; - ColorHook(); - Invalidate(); - } - } - - private bool _Transparent; - public bool Transparent - { - get { return _Transparent; } - set - { - _Transparent = value; - if (!(IsHandleCreated || _ControlMode)) - return; - - if (!value && !(BackColor.A == 255)) - { - throw new Exception("Unable to change value to false while a transparent BackColor is in use."); - } - - SetStyle(ControlStyles.Opaque, !value); - SetStyle(ControlStyles.SupportsTransparentBackColor, value); - - InvalidateBitmap(); - Invalidate(); - } - } - - #endregion - - #region " Private Properties " - - private Size _ImageSize; - protected Size ImageSize - { - get { return _ImageSize; } - } - - private bool _IsParentForm; - protected bool IsParentForm - { - get { return _IsParentForm; } - } - - protected bool IsParentMdi - { - get - { - if (Parent == null) - return false; - return Parent.Parent != null; - } - } - - private int _LockWidth; - protected int LockWidth - { - get { return _LockWidth; } - set - { - _LockWidth = value; - if (!(LockWidth == 0) && IsHandleCreated) - Width = LockWidth; - } - } - - private int _LockHeight; - protected int LockHeight - { - get { return _LockHeight; } - set - { - _LockHeight = value; - if (!(LockHeight == 0) && IsHandleCreated) - Height = LockHeight; - } - } - - private int _Header = 24; - protected int Header - { - get { return _Header; } - set - { - _Header = value; - - if (!_ControlMode) - { - Frame = new Rectangle(7, 7, Width - 14, value - 7); - Invalidate(); - } - } - } - - private bool _ControlMode; - protected bool ControlMode - { - get { return _ControlMode; } - set - { - _ControlMode = value; - - Transparent = _Transparent; - if (_Transparent && _BackColor) - BackColor = Color.Transparent; - - InvalidateBitmap(); - Invalidate(); - } - } - - private bool _IsAnimated; - protected bool IsAnimated - { - get { return _IsAnimated; } - set - { - _IsAnimated = value; - InvalidateTimer(); - } - } - - #endregion - - - #region " Property Helpers " - - protected Pen GetPen(string name) - { - return new Pen(Items[name]); - } - protected Pen GetPen(string name, float width) - { - return new Pen(Items[name], width); - } - - protected SolidBrush GetBrush(string name) - { - return new SolidBrush(Items[name]); - } - - protected Color GetColor(string name) - { - return Items[name]; - } - - protected void SetColor(string name, Color value) - { - if (Items.ContainsKey(name)) - Items[name] = value; - else - Items.Add(name, value); - } - protected void SetColor(string name, byte r, byte g, byte b) - { - SetColor(name, Color.FromArgb(r, g, b)); - } - protected void SetColor(string name, byte a, byte r, byte g, byte b) - { - SetColor(name, Color.FromArgb(a, r, g, b)); - } - protected void SetColor(string name, byte a, Color value) - { - SetColor(name, Color.FromArgb(a, value)); - } - - private void InvalidateBitmap() - { - if (_Transparent && _ControlMode) - { - if (Width == 0 || Height == 0) - return; - B = new Bitmap(Width, Height, PixelFormat.Format32bppPArgb); - G = Graphics.FromImage(B); - } - else { - G = null; - B = null; - } - } - - private void InvalidateCustimization() - { - MemoryStream M = new MemoryStream(Items.Count * 4); - - foreach (Bloom B in Colors) - { - M.Write(BitConverter.GetBytes(B.Value.ToArgb()), 0, 4); - } - - M.Close(); - _Customization = Convert.ToBase64String(M.ToArray()); - } - - private void InvalidateTimer() - { - if (DesignMode || !DoneCreation) - return; - - if (_IsAnimated) - { - ThemeShare.AddAnimationCallback(DoAnimation); - } - else { - ThemeShare.RemoveAnimationCallback(DoAnimation); - } - } - - #endregion - - - #region " User Hooks " - - protected abstract void ColorHook(); - protected abstract void PaintHook(); - - protected virtual void OnCreation() - { - } - - protected virtual void OnAnimation() - { - } - - #endregion - - - #region " Offset " - - private Rectangle OffsetReturnRectangle; - protected Rectangle Offset(Rectangle r, int amount) - { - OffsetReturnRectangle = new Rectangle(r.X + amount, r.Y + amount, r.Width - (amount * 2), r.Height - (amount * 2)); - return OffsetReturnRectangle; - } - - private Size OffsetReturnSize; - protected Size Offset(Size s, int amount) - { - OffsetReturnSize = new Size(s.Width + amount, s.Height + amount); - return OffsetReturnSize; - } - - private Point OffsetReturnPoint; - protected Point Offset(Point p, int amount) - { - OffsetReturnPoint = new Point(p.X + amount, p.Y + amount); - return OffsetReturnPoint; - } - - #endregion - - #region " Center " - - - private Point CenterReturn; - protected Point Center(Rectangle p, Rectangle c) - { - CenterReturn = new Point((p.Width / 2 - c.Width / 2) + p.X + c.X, (p.Height / 2 - c.Height / 2) + p.Y + c.Y); - return CenterReturn; - } - protected Point Center(Rectangle p, Size c) - { - CenterReturn = new Point((p.Width / 2 - c.Width / 2) + p.X, (p.Height / 2 - c.Height / 2) + p.Y); - return CenterReturn; - } - - protected Point Center(Rectangle child) - { - return Center(Width, Height, child.Width, child.Height); - } - protected Point Center(Size child) - { - return Center(Width, Height, child.Width, child.Height); - } - protected Point Center(int childWidth, int childHeight) - { - return Center(Width, Height, childWidth, childHeight); - } - - protected Point Center(Size p, Size c) - { - return Center(p.Width, p.Height, c.Width, c.Height); - } - - protected Point Center(int pWidth, int pHeight, int cWidth, int cHeight) - { - CenterReturn = new Point(pWidth / 2 - cWidth / 2, pHeight / 2 - cHeight / 2); - return CenterReturn; - } - - #endregion - - #region " Measure " - - private Bitmap MeasureBitmap; - - private Graphics MeasureGraphics; - protected Size Measure() - { - lock (MeasureGraphics) - { - return MeasureGraphics.MeasureString(Text, Font, Width).ToSize(); - } - } - protected Size Measure(string text) - { - lock (MeasureGraphics) - { - return MeasureGraphics.MeasureString(text, Font, Width).ToSize(); - } - } - - #endregion - - - #region " DrawPixel " - - - private SolidBrush DrawPixelBrush; - protected void DrawPixel(Color c1, int x, int y) - { - if (_Transparent) - { - B.SetPixel(x, y, c1); - } - else { - DrawPixelBrush = new SolidBrush(c1); - G.FillRectangle(DrawPixelBrush, x, y, 1, 1); - } - } - - #endregion - - #region " DrawCorners " - - - private SolidBrush DrawCornersBrush; - protected void DrawCorners(Color c1, int offset) - { - DrawCorners(c1, 0, 0, Width, Height, offset); - } - protected void DrawCorners(Color c1, Rectangle r1, int offset) - { - DrawCorners(c1, r1.X, r1.Y, r1.Width, r1.Height, offset); - } - protected void DrawCorners(Color c1, int x, int y, int width, int height, int offset) - { - DrawCorners(c1, x + offset, y + offset, width - (offset * 2), height - (offset * 2)); - } - - protected void DrawCorners(Color c1) - { - DrawCorners(c1, 0, 0, Width, Height); - } - protected void DrawCorners(Color c1, Rectangle r1) - { - DrawCorners(c1, r1.X, r1.Y, r1.Width, r1.Height); - } - protected void DrawCorners(Color c1, int x, int y, int width, int height) - { - if (_NoRounding) - return; - - if (_Transparent) - { - B.SetPixel(x, y, c1); - B.SetPixel(x + (width - 1), y, c1); - B.SetPixel(x, y + (height - 1), c1); - B.SetPixel(x + (width - 1), y + (height - 1), c1); - } - else { - DrawCornersBrush = new SolidBrush(c1); - G.FillRectangle(DrawCornersBrush, x, y, 1, 1); - G.FillRectangle(DrawCornersBrush, x + (width - 1), y, 1, 1); - G.FillRectangle(DrawCornersBrush, x, y + (height - 1), 1, 1); - G.FillRectangle(DrawCornersBrush, x + (width - 1), y + (height - 1), 1, 1); - } - } - - #endregion - - #region " DrawBorders " - - protected void DrawBorders(Pen p1, int offset) - { - DrawBorders(p1, 0, 0, Width, Height, offset); - } - protected void DrawBorders(Pen p1, Rectangle r, int offset) - { - DrawBorders(p1, r.X, r.Y, r.Width, r.Height, offset); - } - protected void DrawBorders(Pen p1, int x, int y, int width, int height, int offset) - { - DrawBorders(p1, x + offset, y + offset, width - (offset * 2), height - (offset * 2)); - } - - protected void DrawBorders(Pen p1) - { - DrawBorders(p1, 0, 0, Width, Height); - } - protected void DrawBorders(Pen p1, Rectangle r) - { - DrawBorders(p1, r.X, r.Y, r.Width, r.Height); - } - protected void DrawBorders(Pen p1, int x, int y, int width, int height) - { - G.DrawRectangle(p1, x, y, width - 1, height - 1); - } - - #endregion - - #region " DrawText " - - private Point DrawTextPoint; - - private Size DrawTextSize; - protected void DrawText(Brush b1, HorizontalAlignment a, int x, int y) - { - DrawText(b1, Text, a, x, y); - } - protected void DrawText(Brush b1, string text, HorizontalAlignment a, int x, int y) - { - if (text.Length == 0) - return; - - DrawTextSize = Measure(text); - DrawTextPoint = new Point(Width / 2 - DrawTextSize.Width / 2, Header / 2 - DrawTextSize.Height / 2); - - switch (a) - { - case HorizontalAlignment.Left: - G.DrawString(text, Font, b1, x, DrawTextPoint.Y + y); - break; - case HorizontalAlignment.Center: - G.DrawString(text, Font, b1, DrawTextPoint.X + x, DrawTextPoint.Y + y); - break; - case HorizontalAlignment.Right: - G.DrawString(text, Font, b1, Width - DrawTextSize.Width - x, DrawTextPoint.Y + y); - break; - } - } - - protected void DrawText(Brush b1, Point p1) - { - if (Text.Length == 0) - return; - G.DrawString(Text, Font, b1, p1); - } - protected void DrawText(Brush b1, int x, int y) - { - if (Text.Length == 0) - return; - G.DrawString(Text, Font, b1, x, y); - } - - #endregion - - #region " DrawImage " - - - private Point DrawImagePoint; - protected void DrawImage(HorizontalAlignment a, int x, int y) - { - DrawImage(_Image, a, x, y); - } - protected void DrawImage(Image image, HorizontalAlignment a, int x, int y) - { - if (image == null) - return; - DrawImagePoint = new Point(Width / 2 - image.Width / 2, Header / 2 - image.Height / 2); - - switch (a) - { - case HorizontalAlignment.Left: - G.DrawImage(image, x, DrawImagePoint.Y + y, image.Width, image.Height); - break; - case HorizontalAlignment.Center: - G.DrawImage(image, DrawImagePoint.X + x, DrawImagePoint.Y + y, image.Width, image.Height); - break; - case HorizontalAlignment.Right: - G.DrawImage(image, Width - image.Width - x, DrawImagePoint.Y + y, image.Width, image.Height); - break; - } - } - - protected void DrawImage(Point p1) - { - DrawImage(_Image, p1.X, p1.Y); - } - protected void DrawImage(int x, int y) - { - DrawImage(_Image, x, y); - } - - protected void DrawImage(Image image, Point p1) - { - DrawImage(image, p1.X, p1.Y); - } - protected void DrawImage(Image image, int x, int y) - { - if (image == null) - return; - G.DrawImage(image, x, y, image.Width, image.Height); - } - - #endregion - - #region " DrawGradient " - - private LinearGradientBrush DrawGradientBrush; - - private Rectangle DrawGradientRectangle; - protected void DrawGradient(ColorBlend blend, int x, int y, int width, int height) - { - DrawGradientRectangle = new Rectangle(x, y, width, height); - DrawGradient(blend, DrawGradientRectangle); - } - protected void DrawGradient(ColorBlend blend, int x, int y, int width, int height, float angle) - { - DrawGradientRectangle = new Rectangle(x, y, width, height); - DrawGradient(blend, DrawGradientRectangle, angle); - } - - protected void DrawGradient(ColorBlend blend, Rectangle r) - { - DrawGradientBrush = new LinearGradientBrush(r, Color.Empty, Color.Empty, 90f); - DrawGradientBrush.InterpolationColors = blend; - G.FillRectangle(DrawGradientBrush, r); - } - protected void DrawGradient(ColorBlend blend, Rectangle r, float angle) - { - DrawGradientBrush = new LinearGradientBrush(r, Color.Empty, Color.Empty, angle); - DrawGradientBrush.InterpolationColors = blend; - G.FillRectangle(DrawGradientBrush, r); - } - - - protected void DrawGradient(Color c1, Color c2, int x, int y, int width, int height) - { - DrawGradientRectangle = new Rectangle(x, y, width, height); - DrawGradient(c1, c2, DrawGradientRectangle); - } - protected void DrawGradient(Color c1, Color c2, int x, int y, int width, int height, float angle) - { - DrawGradientRectangle = new Rectangle(x, y, width, height); - DrawGradient(c1, c2, DrawGradientRectangle, angle); - } - - protected void DrawGradient(Color c1, Color c2, Rectangle r) - { - DrawGradientBrush = new LinearGradientBrush(r, c1, c2, 90f); - G.FillRectangle(DrawGradientBrush, r); - } - protected void DrawGradient(Color c1, Color c2, Rectangle r, float angle) - { - DrawGradientBrush = new LinearGradientBrush(r, c1, c2, angle); - G.FillRectangle(DrawGradientBrush, r); - } - - #endregion - - #region " DrawRadial " - - private GraphicsPath DrawRadialPath; - private PathGradientBrush DrawRadialBrush1; - private LinearGradientBrush DrawRadialBrush2; - - private Rectangle DrawRadialRectangle; - public void DrawRadial(ColorBlend blend, int x, int y, int width, int height) - { - DrawRadialRectangle = new Rectangle(x, y, width, height); - DrawRadial(blend, DrawRadialRectangle, width / 2, height / 2); - } - public void DrawRadial(ColorBlend blend, int x, int y, int width, int height, Point center) - { - DrawRadialRectangle = new Rectangle(x, y, width, height); - DrawRadial(blend, DrawRadialRectangle, center.X, center.Y); - } - public void DrawRadial(ColorBlend blend, int x, int y, int width, int height, int cx, int cy) - { - DrawRadialRectangle = new Rectangle(x, y, width, height); - DrawRadial(blend, DrawRadialRectangle, cx, cy); - } - - public void DrawRadial(ColorBlend blend, Rectangle r) - { - DrawRadial(blend, r, r.Width / 2, r.Height / 2); - } - public void DrawRadial(ColorBlend blend, Rectangle r, Point center) - { - DrawRadial(blend, r, center.X, center.Y); - } - public void DrawRadial(ColorBlend blend, Rectangle r, int cx, int cy) - { - DrawRadialPath.Reset(); - DrawRadialPath.AddEllipse(r.X, r.Y, r.Width - 1, r.Height - 1); - - DrawRadialBrush1 = new PathGradientBrush(DrawRadialPath); - DrawRadialBrush1.CenterPoint = new Point(r.X + cx, r.Y + cy); - DrawRadialBrush1.InterpolationColors = blend; - - if (G.SmoothingMode == SmoothingMode.AntiAlias) - { - G.FillEllipse(DrawRadialBrush1, r.X + 1, r.Y + 1, r.Width - 3, r.Height - 3); - } - else { - G.FillEllipse(DrawRadialBrush1, r); - } - } - - - protected void DrawRadial(Color c1, Color c2, int x, int y, int width, int height) - { - DrawRadialRectangle = new Rectangle(x, y, width, height); - DrawRadial(c1, c2, DrawGradientRectangle); - } - protected void DrawRadial(Color c1, Color c2, int x, int y, int width, int height, float angle) - { - DrawRadialRectangle = new Rectangle(x, y, width, height); - DrawRadial(c1, c2, DrawGradientRectangle, angle); - } - - protected void DrawRadial(Color c1, Color c2, Rectangle r) - { - DrawRadialBrush2 = new LinearGradientBrush(r, c1, c2, 90f); - G.FillRectangle(DrawGradientBrush, r); - } - protected void DrawRadial(Color c1, Color c2, Rectangle r, float angle) - { - DrawRadialBrush2 = new LinearGradientBrush(r, c1, c2, angle); - G.FillEllipse(DrawGradientBrush, r); - } - - #endregion - - #region " CreateRound " - - private GraphicsPath CreateRoundPath; - - private Rectangle CreateRoundRectangle; - public GraphicsPath CreateRound(int x, int y, int width, int height, int slope) - { - CreateRoundRectangle = new Rectangle(x, y, width, height); - return CreateRound(CreateRoundRectangle, slope); - } - - public GraphicsPath CreateRound(Rectangle r, int slope) - { - CreateRoundPath = new GraphicsPath(FillMode.Winding); - CreateRoundPath.AddArc(r.X, r.Y, slope, slope, 180f, 90f); - CreateRoundPath.AddArc(r.Right - slope, r.Y, slope, slope, 270f, 90f); - CreateRoundPath.AddArc(r.Right - slope, r.Bottom - slope, slope, slope, 0f, 90f); - CreateRoundPath.AddArc(r.X, r.Bottom - slope, slope, slope, 90f, 90f); - CreateRoundPath.CloseFigure(); - return CreateRoundPath; - } - - #endregion - - } - - abstract class ThemeControl154 : Control - { - - - #region " Initialization " - - protected Graphics G; - - protected Bitmap B; - public ThemeControl154() - { - SetStyle((ControlStyles)139270, true); - - _ImageSize = Size.Empty; - Font = new Font("Verdana", 8); - - MeasureBitmap = new Bitmap(1, 1); - MeasureGraphics = Graphics.FromImage(MeasureBitmap); - - DrawRadialPath = new GraphicsPath(); - - InvalidateCustimization(); - //Remove? - } - - protected override sealed void OnHandleCreated(EventArgs e) - { - InvalidateCustimization(); - ColorHook(); - - if (!(_LockWidth == 0)) - Width = _LockWidth; - if (!(_LockHeight == 0)) - Height = _LockHeight; - - Transparent = _Transparent; - if (_Transparent && _BackColor) - BackColor = Color.Transparent; - - base.OnHandleCreated(e); - } - - private bool DoneCreation; - protected override sealed void OnParentChanged(EventArgs e) - { - if (Parent != null) - { - OnCreation(); - DoneCreation = true; - InvalidateTimer(); - } - - base.OnParentChanged(e); - } - - #endregion - - private void DoAnimation(bool i) - { - OnAnimation(); - if (i) - Invalidate(); - } - - protected override sealed void OnPaint(PaintEventArgs e) - { - if (Width == 0 || Height == 0) - return; - - if (_Transparent) - { - PaintHook(); - e.Graphics.DrawImage(B, 0, 0); - } - else { - G = e.Graphics; - PaintHook(); - } - } - - protected override void OnHandleDestroyed(EventArgs e) - { - ThemeShare.RemoveAnimationCallback(DoAnimation); - base.OnHandleDestroyed(e); - } - - #region " Size Handling " - - protected override sealed void OnSizeChanged(EventArgs e) - { - if (_Transparent) - { - InvalidateBitmap(); - } - - Invalidate(); - base.OnSizeChanged(e); - } - - protected override void SetBoundsCore(int x, int y, int width, int height, BoundsSpecified specified) - { - if (!(_LockWidth == 0)) - width = _LockWidth; - if (!(_LockHeight == 0)) - height = _LockHeight; - base.SetBoundsCore(x, y, width, height, specified); - } - - #endregion - - #region " State Handling " - - private bool InPosition; - protected override void OnMouseEnter(EventArgs e) - { - InPosition = true; - SetState(MouseState.Over); - base.OnMouseEnter(e); - } - - protected override void OnMouseUp(MouseEventArgs e) - { - if (InPosition) - SetState(MouseState.Over); - base.OnMouseUp(e); - } - - protected override void OnMouseDown(MouseEventArgs e) - { - if (e.Button == MouseButtons.Left) - SetState(MouseState.Down); - base.OnMouseDown(e); - } - - protected override void OnMouseLeave(EventArgs e) - { - InPosition = false; - SetState(MouseState.None); - base.OnMouseLeave(e); - } - - protected override void OnEnabledChanged(EventArgs e) - { - if (Enabled) - SetState(MouseState.None); - else - SetState(MouseState.Block); - base.OnEnabledChanged(e); - } - - protected MouseState State; - private void SetState(MouseState current) - { - State = current; - Invalidate(); - } - - #endregion - - - #region " Base Properties " - - [Browsable(false), EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public override Color ForeColor - { - get { return Color.Empty; } - set { } - } - [Browsable(false), EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public override Image BackgroundImage - { - get { return null; } - set { } - } - [Browsable(false), EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public override ImageLayout BackgroundImageLayout - { - get { return ImageLayout.None; } - set { } - } - - public override string Text - { - get { return base.Text; } - set - { - base.Text = value; - Invalidate(); - } - } - public override Font Font - { - get { return base.Font; } - set - { - base.Font = value; - Invalidate(); - } - } - - private bool _BackColor; - [Category("Misc")] - public override Color BackColor - { - get { return base.BackColor; } - set - { - if (!IsHandleCreated && value == Color.Transparent) - { - _BackColor = true; - return; - } - - base.BackColor = value; - if (Parent != null) - ColorHook(); - } - } - - #endregion - - #region " Public Properties " - - private bool _NoRounding; - public bool NoRounding - { - get { return _NoRounding; } - set - { - _NoRounding = value; - Invalidate(); - } - } - - private Image _Image; - public Image Image - { - get { return _Image; } - set - { - if (value == null) - { - _ImageSize = Size.Empty; - } - else { - _ImageSize = value.Size; - } - - _Image = value; - Invalidate(); - } - } - - private bool _Transparent; - public bool Transparent - { - get { return _Transparent; } - set - { - _Transparent = value; - if (!IsHandleCreated) - return; - - if (!value && !(BackColor.A == 255)) - { - throw new Exception("Unable to change value to false while a transparent BackColor is in use."); - } - - SetStyle(ControlStyles.Opaque, !value); - SetStyle(ControlStyles.SupportsTransparentBackColor, value); - - if (value) - InvalidateBitmap(); - else - B = null; - Invalidate(); - } - } - - private Dictionary Items = new Dictionary(); - public Bloom[] Colors - { - get - { - List T = new List(); - Dictionary.Enumerator E = Items.GetEnumerator(); - - while (E.MoveNext()) - { - T.Add(new Bloom(E.Current.Key, E.Current.Value)); - } - - return T.ToArray(); - } - set - { - foreach (Bloom B in value) - { - if (Items.ContainsKey(B.Name)) - Items[B.Name] = B.Value; - } - - InvalidateCustimization(); - ColorHook(); - Invalidate(); - } - } - - private string _Customization; - public string Customization - { - get { return _Customization; } - set - { - if (value == _Customization) - return; - - byte[] Data = null; - Bloom[] Items = Colors; - - try - { - Data = Convert.FromBase64String(value); - for (int I = 0; I <= Items.Length - 1; I++) - { - Items[I].Value = Color.FromArgb(BitConverter.ToInt32(Data, I * 4)); - } - } - catch - { - return; - } - - _Customization = value; - - Colors = Items; - ColorHook(); - Invalidate(); - } - } - - #endregion - - #region " Private Properties " - - private Size _ImageSize; - protected Size ImageSize - { - get { return _ImageSize; } - } - - private int _LockWidth; - protected int LockWidth - { - get { return _LockWidth; } - set - { - _LockWidth = value; - if (!(LockWidth == 0) && IsHandleCreated) - Width = LockWidth; - } - } - - private int _LockHeight; - protected int LockHeight - { - get { return _LockHeight; } - set - { - _LockHeight = value; - if (!(LockHeight == 0) && IsHandleCreated) - Height = LockHeight; - } - } - - private bool _IsAnimated; - protected bool IsAnimated - { - get { return _IsAnimated; } - set - { - _IsAnimated = value; - InvalidateTimer(); - } - } - - #endregion - - - #region " Property Helpers " - - protected Pen GetPen(string name) - { - return new Pen(Items[name]); - } - protected Pen GetPen(string name, float width) - { - return new Pen(Items[name], width); - } - - protected SolidBrush GetBrush(string name) - { - return new SolidBrush(Items[name]); - } - - protected Color GetColor(string name) - { - return Items[name]; - } - - protected void SetColor(string name, Color value) - { - if (Items.ContainsKey(name)) - Items[name] = value; - else - Items.Add(name, value); - } - protected void SetColor(string name, byte r, byte g, byte b) - { - SetColor(name, Color.FromArgb(r, g, b)); - } - protected void SetColor(string name, byte a, byte r, byte g, byte b) - { - SetColor(name, Color.FromArgb(a, r, g, b)); - } - protected void SetColor(string name, byte a, Color value) - { - SetColor(name, Color.FromArgb(a, value)); - } - - private void InvalidateBitmap() - { - if (Width == 0 || Height == 0) - return; - B = new Bitmap(Width, Height, PixelFormat.Format32bppPArgb); - G = Graphics.FromImage(B); - } - - private void InvalidateCustimization() - { - MemoryStream M = new MemoryStream(Items.Count * 4); - - foreach (Bloom B in Colors) - { - M.Write(BitConverter.GetBytes(B.Value.ToArgb()), 0, 4); - } - - M.Close(); - _Customization = Convert.ToBase64String(M.ToArray()); - } - - private void InvalidateTimer() - { - if (DesignMode || !DoneCreation) - return; - - if (_IsAnimated) - { - ThemeShare.AddAnimationCallback(DoAnimation); - } - else { - ThemeShare.RemoveAnimationCallback(DoAnimation); - } - } - #endregion - - - #region " User Hooks " - - protected abstract void ColorHook(); - protected abstract void PaintHook(); - - protected virtual void OnCreation() - { - } - - protected virtual void OnAnimation() - { - } - - #endregion - - - #region " Offset " - - private Rectangle OffsetReturnRectangle; - protected Rectangle Offset(Rectangle r, int amount) - { - OffsetReturnRectangle = new Rectangle(r.X + amount, r.Y + amount, r.Width - (amount * 2), r.Height - (amount * 2)); - return OffsetReturnRectangle; - } - - private Size OffsetReturnSize; - protected Size Offset(Size s, int amount) - { - OffsetReturnSize = new Size(s.Width + amount, s.Height + amount); - return OffsetReturnSize; - } - - private Point OffsetReturnPoint; - protected Point Offset(Point p, int amount) - { - OffsetReturnPoint = new Point(p.X + amount, p.Y + amount); - return OffsetReturnPoint; - } - - #endregion - - #region " Center " - - - private Point CenterReturn; - protected Point Center(Rectangle p, Rectangle c) - { - CenterReturn = new Point((p.Width / 2 - c.Width / 2) + p.X + c.X, (p.Height / 2 - c.Height / 2) + p.Y + c.Y); - return CenterReturn; - } - protected Point Center(Rectangle p, Size c) - { - CenterReturn = new Point((p.Width / 2 - c.Width / 2) + p.X, (p.Height / 2 - c.Height / 2) + p.Y); - return CenterReturn; - } - - protected Point Center(Rectangle child) - { - return Center(Width, Height, child.Width, child.Height); - } - protected Point Center(Size child) - { - return Center(Width, Height, child.Width, child.Height); - } - protected Point Center(int childWidth, int childHeight) - { - return Center(Width, Height, childWidth, childHeight); - } - - protected Point Center(Size p, Size c) - { - return Center(p.Width, p.Height, c.Width, c.Height); - } - - protected Point Center(int pWidth, int pHeight, int cWidth, int cHeight) - { - CenterReturn = new Point(pWidth / 2 - cWidth / 2, pHeight / 2 - cHeight / 2); - return CenterReturn; - } - - #endregion - - #region " Measure " - - private Bitmap MeasureBitmap; - //TODO: Potential issues during multi-threading. - private Graphics MeasureGraphics; - - protected Size Measure() - { - return MeasureGraphics.MeasureString(Text, Font, Width).ToSize(); - } - protected Size Measure(string text) - { - return MeasureGraphics.MeasureString(text, Font, Width).ToSize(); - } - - #endregion - - - #region " DrawPixel " - - - private SolidBrush DrawPixelBrush; - protected void DrawPixel(Color c1, int x, int y) - { - if (_Transparent) - { - B.SetPixel(x, y, c1); - } - else { - DrawPixelBrush = new SolidBrush(c1); - G.FillRectangle(DrawPixelBrush, x, y, 1, 1); - } - } - - #endregion - - #region " DrawCorners " - - - private SolidBrush DrawCornersBrush; - protected void DrawCorners(Color c1, int offset) - { - DrawCorners(c1, 0, 0, Width, Height, offset); - } - protected void DrawCorners(Color c1, Rectangle r1, int offset) - { - DrawCorners(c1, r1.X, r1.Y, r1.Width, r1.Height, offset); - } - protected void DrawCorners(Color c1, int x, int y, int width, int height, int offset) - { - DrawCorners(c1, x + offset, y + offset, width - (offset * 2), height - (offset * 2)); - } - - protected void DrawCorners(Color c1) - { - DrawCorners(c1, 0, 0, Width, Height); - } - protected void DrawCorners(Color c1, Rectangle r1) - { - DrawCorners(c1, r1.X, r1.Y, r1.Width, r1.Height); - } - protected void DrawCorners(Color c1, int x, int y, int width, int height) - { - if (_NoRounding) - return; - - if (_Transparent) - { - B.SetPixel(x, y, c1); - B.SetPixel(x + (width - 1), y, c1); - B.SetPixel(x, y + (height - 1), c1); - B.SetPixel(x + (width - 1), y + (height - 1), c1); - } - else { - DrawCornersBrush = new SolidBrush(c1); - G.FillRectangle(DrawCornersBrush, x, y, 1, 1); - G.FillRectangle(DrawCornersBrush, x + (width - 1), y, 1, 1); - G.FillRectangle(DrawCornersBrush, x, y + (height - 1), 1, 1); - G.FillRectangle(DrawCornersBrush, x + (width - 1), y + (height - 1), 1, 1); - } - } - - #endregion - - #region " DrawBorders " - - protected void DrawBorders(Pen p1, int offset) - { - DrawBorders(p1, 0, 0, Width, Height, offset); - } - protected void DrawBorders(Pen p1, Rectangle r, int offset) - { - DrawBorders(p1, r.X, r.Y, r.Width, r.Height, offset); - } - protected void DrawBorders(Pen p1, int x, int y, int width, int height, int offset) - { - DrawBorders(p1, x + offset, y + offset, width - (offset * 2), height - (offset * 2)); - } - - protected void DrawBorders(Pen p1) - { - DrawBorders(p1, 0, 0, Width, Height); - } - protected void DrawBorders(Pen p1, Rectangle r) - { - DrawBorders(p1, r.X, r.Y, r.Width, r.Height); - } - protected void DrawBorders(Pen p1, int x, int y, int width, int height) - { - G.DrawRectangle(p1, x, y, width - 1, height - 1); - } - - #endregion - - #region " DrawText " - - private Point DrawTextPoint; - - private Size DrawTextSize; - protected void DrawText(Brush b1, HorizontalAlignment a, int x, int y) - { - DrawText(b1, Text, a, x, y); - } - protected void DrawText(Brush b1, string text, HorizontalAlignment a, int x, int y) - { - if (text.Length == 0) - return; - - DrawTextSize = Measure(text); - DrawTextPoint = Center(DrawTextSize); - - switch (a) - { - case HorizontalAlignment.Left: - G.DrawString(text, Font, b1, x, DrawTextPoint.Y + y); - break; - case HorizontalAlignment.Center: - G.DrawString(text, Font, b1, DrawTextPoint.X + x, DrawTextPoint.Y + y); - break; - case HorizontalAlignment.Right: - G.DrawString(text, Font, b1, Width - DrawTextSize.Width - x, DrawTextPoint.Y + y); - break; - } - } - - protected void DrawText(Brush b1, Point p1) - { - if (Text.Length == 0) - return; - G.DrawString(Text, Font, b1, p1); - } - protected void DrawText(Brush b1, int x, int y) - { - if (Text.Length == 0) - return; - G.DrawString(Text, Font, b1, x, y); - } - - #endregion - - #region " DrawImage " - - - private Point DrawImagePoint; - protected void DrawImage(HorizontalAlignment a, int x, int y) - { - DrawImage(_Image, a, x, y); - } - protected void DrawImage(Image image, HorizontalAlignment a, int x, int y) - { - if (image == null) - return; - DrawImagePoint = Center(image.Size); - - switch (a) - { - case HorizontalAlignment.Left: - G.DrawImage(image, x, DrawImagePoint.Y + y, image.Width, image.Height); - break; - case HorizontalAlignment.Center: - G.DrawImage(image, DrawImagePoint.X + x, DrawImagePoint.Y + y, image.Width, image.Height); - break; - case HorizontalAlignment.Right: - G.DrawImage(image, Width - image.Width - x, DrawImagePoint.Y + y, image.Width, image.Height); - break; - } - } - - protected void DrawImage(Point p1) - { - DrawImage(_Image, p1.X, p1.Y); - } - protected void DrawImage(int x, int y) - { - DrawImage(_Image, x, y); - } - - protected void DrawImage(Image image, Point p1) - { - DrawImage(image, p1.X, p1.Y); - } - protected void DrawImage(Image image, int x, int y) - { - if (image == null) - return; - G.DrawImage(image, x, y, image.Width, image.Height); - } - - #endregion - - #region " DrawGradient " - - private LinearGradientBrush DrawGradientBrush; - - private Rectangle DrawGradientRectangle; - protected void DrawGradient(ColorBlend blend, int x, int y, int width, int height) - { - DrawGradientRectangle = new Rectangle(x, y, width, height); - DrawGradient(blend, DrawGradientRectangle); - } - protected void DrawGradient(ColorBlend blend, int x, int y, int width, int height, float angle) - { - DrawGradientRectangle = new Rectangle(x, y, width, height); - DrawGradient(blend, DrawGradientRectangle, angle); - } - - protected void DrawGradient(ColorBlend blend, Rectangle r) - { - DrawGradientBrush = new LinearGradientBrush(r, Color.Empty, Color.Empty, 90f); - DrawGradientBrush.InterpolationColors = blend; - G.FillRectangle(DrawGradientBrush, r); - } - protected void DrawGradient(ColorBlend blend, Rectangle r, float angle) - { - DrawGradientBrush = new LinearGradientBrush(r, Color.Empty, Color.Empty, angle); - DrawGradientBrush.InterpolationColors = blend; - G.FillRectangle(DrawGradientBrush, r); - } - - - protected void DrawGradient(Color c1, Color c2, int x, int y, int width, int height) - { - DrawGradientRectangle = new Rectangle(x, y, width, height); - DrawGradient(c1, c2, DrawGradientRectangle); - } - protected void DrawGradient(Color c1, Color c2, int x, int y, int width, int height, float angle) - { - DrawGradientRectangle = new Rectangle(x, y, width, height); - DrawGradient(c1, c2, DrawGradientRectangle, angle); - } - - protected void DrawGradient(Color c1, Color c2, Rectangle r) - { - DrawGradientBrush = new LinearGradientBrush(r, c1, c2, 90f); - G.FillRectangle(DrawGradientBrush, r); - } - protected void DrawGradient(Color c1, Color c2, Rectangle r, float angle) - { - DrawGradientBrush = new LinearGradientBrush(r, c1, c2, angle); - G.FillRectangle(DrawGradientBrush, r); - } - - #endregion - - #region " DrawRadial " - - private GraphicsPath DrawRadialPath; - private PathGradientBrush DrawRadialBrush1; - private LinearGradientBrush DrawRadialBrush2; - - private Rectangle DrawRadialRectangle; - public void DrawRadial(ColorBlend blend, int x, int y, int width, int height) - { - DrawRadialRectangle = new Rectangle(x, y, width, height); - DrawRadial(blend, DrawRadialRectangle, width / 2, height / 2); - } - public void DrawRadial(ColorBlend blend, int x, int y, int width, int height, Point center) - { - DrawRadialRectangle = new Rectangle(x, y, width, height); - DrawRadial(blend, DrawRadialRectangle, center.X, center.Y); - } - public void DrawRadial(ColorBlend blend, int x, int y, int width, int height, int cx, int cy) - { - DrawRadialRectangle = new Rectangle(x, y, width, height); - DrawRadial(blend, DrawRadialRectangle, cx, cy); - } - - public void DrawRadial(ColorBlend blend, Rectangle r) - { - DrawRadial(blend, r, r.Width / 2, r.Height / 2); - } - public void DrawRadial(ColorBlend blend, Rectangle r, Point center) - { - DrawRadial(blend, r, center.X, center.Y); - } - public void DrawRadial(ColorBlend blend, Rectangle r, int cx, int cy) - { - DrawRadialPath.Reset(); - DrawRadialPath.AddEllipse(r.X, r.Y, r.Width - 1, r.Height - 1); - - DrawRadialBrush1 = new PathGradientBrush(DrawRadialPath); - DrawRadialBrush1.CenterPoint = new Point(r.X + cx, r.Y + cy); - DrawRadialBrush1.InterpolationColors = blend; - - if (G.SmoothingMode == SmoothingMode.AntiAlias) - { - G.FillEllipse(DrawRadialBrush1, r.X + 1, r.Y + 1, r.Width - 3, r.Height - 3); - } - else { - G.FillEllipse(DrawRadialBrush1, r); - } - } - - - protected void DrawRadial(Color c1, Color c2, int x, int y, int width, int height) - { - DrawRadialRectangle = new Rectangle(x, y, width, height); - DrawRadial(c1, c2, DrawRadialRectangle); - } - protected void DrawRadial(Color c1, Color c2, int x, int y, int width, int height, float angle) - { - DrawRadialRectangle = new Rectangle(x, y, width, height); - DrawRadial(c1, c2, DrawRadialRectangle, angle); - } - - protected void DrawRadial(Color c1, Color c2, Rectangle r) - { - DrawRadialBrush2 = new LinearGradientBrush(r, c1, c2, 90f); - G.FillEllipse(DrawRadialBrush2, r); - } - protected void DrawRadial(Color c1, Color c2, Rectangle r, float angle) - { - DrawRadialBrush2 = new LinearGradientBrush(r, c1, c2, angle); - G.FillEllipse(DrawRadialBrush2, r); - } - - #endregion - - #region " CreateRound " - - private GraphicsPath CreateRoundPath; - - private Rectangle CreateRoundRectangle; - public GraphicsPath CreateRound(int x, int y, int width, int height, int slope) - { - CreateRoundRectangle = new Rectangle(x, y, width, height); - return CreateRound(CreateRoundRectangle, slope); - } - - public GraphicsPath CreateRound(Rectangle r, int slope) - { - CreateRoundPath = new GraphicsPath(FillMode.Winding); - CreateRoundPath.AddArc(r.X, r.Y, slope, slope, 180f, 90f); - CreateRoundPath.AddArc(r.Right - slope, r.Y, slope, slope, 270f, 90f); - CreateRoundPath.AddArc(r.Right - slope, r.Bottom - slope, slope, slope, 0f, 90f); - CreateRoundPath.AddArc(r.X, r.Bottom - slope, slope, slope, 90f, 90f); - CreateRoundPath.CloseFigure(); - return CreateRoundPath; - } - - #endregion - - } - - static class ThemeShare - { - - #region " Animation " - - private static int Frames; - private static bool Invalidate; - - public static PrecisionTimer ThemeTimer = new PrecisionTimer(); - //1000 / 50 = 20 FPS - private const int FPS = 50; - - private const int Rate = 10; - public delegate void AnimationDelegate(bool invalidate); - - - private static List Callbacks = new List(); - private static void HandleCallbacks(IntPtr state, bool reserve) - { - Invalidate = (Frames >= FPS); - if (Invalidate) - Frames = 0; - - lock (Callbacks) - { - for (int I = 0; I <= Callbacks.Count - 1; I++) - { - Callbacks[I].Invoke(Invalidate); - } - } - - Frames += Rate; - } - - private static void InvalidateThemeTimer() - { - if (Callbacks.Count == 0) - { - ThemeTimer.Delete(); - } - else { - ThemeTimer.Create(0, Rate, HandleCallbacks); - } - } - - public static void AddAnimationCallback(AnimationDelegate callback) - { - lock (Callbacks) - { - if (Callbacks.Contains(callback)) - return; - - Callbacks.Add(callback); - InvalidateThemeTimer(); - } - } - - public static void RemoveAnimationCallback(AnimationDelegate callback) - { - lock (Callbacks) - { - if (!Callbacks.Contains(callback)) - return; - - Callbacks.Remove(callback); - InvalidateThemeTimer(); - } - } - - #endregion - - } - - enum MouseState : byte - { - None = 0, - Over = 1, - Down = 2, - Block = 3 - } - - struct Bloom - { - - public string _Name; - public string Name - { - get { return _Name; } - } - - private Color _Value; - public Color Value - { - get { return _Value; } - set { _Value = value; } - } - - public string ValueHex - { - get { return string.Concat("#", _Value.R.ToString("X2", null), _Value.G.ToString("X2", null), _Value.B.ToString("X2", null)); } - set - { - try - { - _Value = ColorTranslator.FromHtml(value); - } - catch - { - return; - } - } - } - - - public Bloom(string name, Color value) - { - _Name = name; - _Value = value; - } - } - - //------------------ - //Creator: aeonhack - //Site: elitevs.net - //Created: 11/30/2011 - //Changed: 11/30/2011 - //Version: 1.0.0 - //------------------ - class PrecisionTimer : IDisposable - { - - private bool _Enabled; - public bool Enabled - { - get { return _Enabled; } - } - - private IntPtr Handle; - - private TimerDelegate TimerCallback; - [DllImport("kernel32.dll", EntryPoint = "CreateTimerQueueTimer")] - private static extern bool CreateTimerQueueTimer(ref IntPtr handle, IntPtr queue, TimerDelegate callback, IntPtr state, uint dueTime, uint period, uint flags); - - [DllImport("kernel32.dll", EntryPoint = "DeleteTimerQueueTimer")] - private static extern bool DeleteTimerQueueTimer(IntPtr queue, IntPtr handle, IntPtr callback); - - public delegate void TimerDelegate(IntPtr r1, bool r2); - - public void Create(uint dueTime, uint period, TimerDelegate callback) - { - if (_Enabled) - return; - - TimerCallback = callback; - bool Success = CreateTimerQueueTimer(ref Handle, IntPtr.Zero, TimerCallback, IntPtr.Zero, dueTime, period, 0); - - if (!Success) - ThrowNewException("CreateTimerQueueTimer"); - _Enabled = Success; - } - - public void Delete() - { - if (!_Enabled) - return; - bool Success = DeleteTimerQueueTimer(IntPtr.Zero, Handle, IntPtr.Zero); - - if (!Success && !(Marshal.GetLastWin32Error() == 997)) - { - ThrowNewException("DeleteTimerQueueTimer"); - } - - _Enabled = !Success; - } - - private void ThrowNewException(string name) - { - throw new Exception(string.Format("{0} failed. Win32Error: {1}", name, Marshal.GetLastWin32Error())); - } - - public void Dispose() - { - Delete(); - } - } - #endregion - //These were developed by Hawk & LordVirus (TheOnlyLordVirus) -} diff --git a/CBH-Ultimate-Theme-Library/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_FancyButton.cs b/CBH-Ultimate-Theme-Library/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_FancyButton.cs deleted file mode 100644 index 0c5c1fd..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_FancyButton.cs +++ /dev/null @@ -1,109 +0,0 @@ -using System; -using System.ComponentModel; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Windows.Forms; - -namespace CBH.Ultimate.Controls -{ - public sealed class CrEaTiiOn_Ultimate_FancyButton : Button - { - private int _borderSize; - private int _borderRadius = 25; - private Color _borderColor = Color.FromArgb(250, 36, 38); - - [Category("CrEaTiiOn")] - public int BorderSize { get => _borderSize; set { _borderSize = value; Invalidate(); } } - [Category("CrEaTiiOn")] - public int BorderRadius { get => _borderRadius; set { if(value <= this.Height) _borderRadius = value; else BorderRadius = this.Height; Invalidate(); } } - [Category("CrEaTiiOn")] - public Color BorderColor { get => _borderColor; set { _borderColor = value; Invalidate(); } } - [Category("CrEaTiiOn")] - public Color BackgroundColor { get => BackColor; set => BackColor = value; } - [Category("CrEaTiiOn")] - public Color TextColor { get => ForeColor; set => ForeColor = value; } - [Category("CrEaTiiOn")] - public Color HoverOverColor { get => FlatAppearance.MouseOverBackColor; set { FlatAppearance.MouseOverBackColor = value; Invalidate(); } } - [Category("CrEaTiiOn")] - public Color ClickedColor { get => FlatAppearance.MouseDownBackColor; set { FlatAppearance.MouseDownBackColor = value; Invalidate(); } } - - public CrEaTiiOn_Ultimate_FancyButton() - { - FlatStyle = FlatStyle.Flat; - FlatAppearance.BorderSize = 0; - Size = new Size(150, 40); - BackColor = Color.FromArgb(15, 15, 15); - ForeColor = Color.White; - FlatAppearance.MouseOverBackColor = Color.FromArgb(15, 15, 15); - FlatAppearance.MouseDownBackColor = Color.FromArgb(25, 25, 25); - Resize += OnResize; - } - - private void OnResize(object sender, EventArgs e) - { - if (_borderRadius > Height) - BorderRadius = Height; - - } - - private GraphicsPath GetFigurePath(RectangleF rect, float radius) - { - var path = new GraphicsPath(); - path.StartFigure(); - path.AddArc(rect.X, rect.Y, radius, radius, 180, 90); - path.AddArc(rect.Width - radius, rect.Y, radius, radius, 270, 90); - path.AddArc(rect.Width - radius, rect.Height - radius, radius, radius, 0, 90); - path.AddArc(rect.X, rect.Height - radius, radius, radius, 90, 90); - path.CloseFigure(); - return path; - } - - protected override void OnPaint(PaintEventArgs pevent) - { - base.OnPaint(pevent); - pevent.Graphics.SmoothingMode = SmoothingMode.AntiAlias; - - var rectSurface = new RectangleF(0, 0, Width, Height); - var rectBorder = new RectangleF(1, 1, Width - 0.8f, Height - 1); - - if (BorderRadius > 2) - { - using(var pathSurface = GetFigurePath(rectSurface, BorderRadius)) - using(var pathBorder = GetFigurePath(rectBorder, BorderRadius - 1)) - using (var penSurface = new Pen(Parent.BackColor, 2)) - using (var penBorder = new Pen(BorderColor, BorderSize)) - { - penBorder.Alignment = PenAlignment.Inset; - Region = new Region(pathSurface); - pevent.Graphics.DrawPath(penSurface, pathSurface); - if (BorderSize >= 1) - pevent.Graphics.DrawPath(penBorder, pathBorder); - } - } - else - { - Region = new Region(rectSurface); - if (BorderSize >= 1) - { - using (var penBorder = new Pen(BorderColor, BorderSize)) - { - penBorder.Alignment = PenAlignment.Inset; - pevent.Graphics.DrawRectangle(penBorder, 0, 0, Width - 1, Height - 1); - } - } - } - } - - protected override void OnHandleCreated(EventArgs e) - { - base.OnHandleCreated(e); - Parent.BackColorChanged += ParentOnBackColorChanged; - } - - private void ParentOnBackColorChanged(object sender, EventArgs e) - { - if(DesignMode) - Invalidate(); - } - } -} diff --git a/CBH-Ultimate-Theme-Library/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_FancyTextBox.resx b/CBH-Ultimate-Theme-Library/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_FancyTextBox.resx deleted file mode 100644 index f298a7b..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_FancyTextBox.resx +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientButton.cs b/CBH-Ultimate-Theme-Library/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientButton.cs deleted file mode 100644 index 0464489..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientButton.cs +++ /dev/null @@ -1,113 +0,0 @@ -using System; -using System.ComponentModel; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Windows.Forms; - -namespace CBH.Ultimate.Controls -{ - public sealed class CrEaTiiOn_Ultimate_GradientButton : Button - { - private int _borderSize = 1; - private int _borderRadius = 25; - private Color _gradientColorPrimary = Color.FromArgb(250, 36, 38); - private Color _gradientColorSecondary = Color.FromArgb(75, 75, 75); - - [Category("CrEaTiiOn")] - public int BorderSize { get => _borderSize; set { _borderSize = value; Invalidate(); } } - [Category("CrEaTiiOn")] - public int BorderRadius { get => _borderRadius; set { if (value <= Height) _borderRadius = value; else BorderRadius = Height; Invalidate(); } } - [Category("CrEaTiiOn")] - public Color BackgroundColor { get => BackColor; set => BackColor = value; } - [Category("CrEaTiiOn")] - public Color TextColor { get => ForeColor; set => ForeColor = value; } - [Category("CrEaTiiOn")] - public Color GradientColorPrimary { get => _gradientColorPrimary; set { _gradientColorPrimary = value; Invalidate(); } } - [Category("CrEaTiiOn")] - public Color GradientColorSecondary { get => _gradientColorSecondary; set { _gradientColorSecondary = value; Invalidate(); } } - [Category("CrEaTiiOn")] - public Color HoverOverColor { get => FlatAppearance.MouseOverBackColor; set { FlatAppearance.MouseOverBackColor = value; Invalidate(); } } - [Category("CrEaTiiOn")] - public Color ClickedColor { get => FlatAppearance.MouseDownBackColor; set { FlatAppearance.MouseDownBackColor = value; Invalidate(); } } - - public CrEaTiiOn_Ultimate_GradientButton() - { - FlatStyle = FlatStyle.Flat; - FlatAppearance.BorderSize = 0; - Size = new Size(150, 40); - BackColor = Color.Transparent; - ForeColor = Color.White; - FlatAppearance.MouseOverBackColor = Color.FromArgb(25, 25, 25); - FlatAppearance.MouseDownBackColor = Color.FromArgb(15, 15, 15); - Resize += OnResize; - } - - private void OnResize(object sender, EventArgs e) - { - if (_borderRadius > Height) - BorderRadius = Height; - - } - - private GraphicsPath GetFigurePath(RectangleF rect, float radius) - { - var path = new GraphicsPath(); - path.StartFigure(); - path.AddArc(rect.X, rect.Y, radius, radius, 180, 90); - path.AddArc(rect.Width - radius, rect.Y, radius, radius, 270, 90); - path.AddArc(rect.Width - radius, rect.Height - radius, radius, radius, 0, 90); - path.AddArc(rect.X, rect.Height - radius, radius, radius, 90, 90); - path.CloseFigure(); - return path; - } - - protected override void OnPaint(PaintEventArgs pevent) - { - base.OnPaint(pevent); - pevent.Graphics.SmoothingMode = SmoothingMode.AntiAlias; - - var rectSurface = new RectangleF(0, 0, Width, Height); - var rectBorder = new RectangleF(1, 1, Width - 0.8f, Height - 1); - - - if (BorderRadius > 2) - { - using (var pathSurface = GetFigurePath(rectSurface, BorderRadius)) - using (var pathBorder = GetFigurePath(rectBorder, BorderRadius - 1)) - using (var penSurface = new Pen(Parent.BackColor, 2)) - using (var penBorder = new Pen(new LinearGradientBrush(new PointF(0, Height / 2f), new PointF(Width, Height / 2f), _gradientColorPrimary, _gradientColorSecondary), BorderSize)) - { - penBorder.Alignment = PenAlignment.Inset; - Region = new Region(pathSurface); - pevent.Graphics.DrawPath(penSurface, pathSurface); - if (BorderSize >= 1) - pevent.Graphics.DrawPath(penBorder, pathBorder); - } - } - else - { - Region = new Region(rectSurface); - if (BorderSize >= 1) - { - using (var penBorder = new Pen(new LinearGradientBrush(new PointF(0, Height / 2f), new PointF(Width, Height / 2f), _gradientColorPrimary, _gradientColorSecondary), BorderSize)) - { - penBorder.Alignment = PenAlignment.Inset; - pevent.Graphics.DrawRectangle(penBorder, 0, 0, Width - 1, Height - 1); - } - } - } - } - - protected override void OnHandleCreated(EventArgs e) - { - base.OnHandleCreated(e); - Parent.BackColorChanged += ParentOnBackColorChanged; - } - - private void ParentOnBackColorChanged(object sender, EventArgs e) - { - if (DesignMode) - Invalidate(); - } - } -} diff --git a/CBH-Ultimate-Theme-Library/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientLabel.cs b/CBH-Ultimate-Theme-Library/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientLabel.cs deleted file mode 100644 index 4002423..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientLabel.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; - -namespace CBH.Ultimate.Controls -{ - public class CrEaTiiOn_Ultimate_GradientLabel: Label - { - - private Color _FirstColor = Color.FromArgb(250, 36, 38); - private Color _SecondColor = Color.FromArgb(75, 75, 75); - - [Category("CrEaTiiOn")] - public string String { get { return Text; } set { Text = value; } } - [Category("CrEaTiiOn")] - public override Font Font { get => base.Font; set { base.Font = value; base.Font = value; } } - - [Category("CrEaTiiOn")] - public Color FirstColor { get => _FirstColor; set { _FirstColor = value; Invalidate(); } } - - [Category("CrEaTiiOn")] - public Color SecondColor { get => _SecondColor; set { _SecondColor = value; Invalidate(); } } - - public CrEaTiiOn_Ultimate_GradientLabel() - { - - } - - protected override void OnPaint(PaintEventArgs e) - { - LinearGradientBrush brush = new LinearGradientBrush(new Rectangle(0, 0, Width, Height + 5), _FirstColor, _SecondColor, LinearGradientMode.Horizontal); - e.Graphics.DrawString(String, Font, brush, 0, 0); - } - - } -} diff --git a/CBH-Ultimate-Theme-Library/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientNumericUpDown.cs b/CBH-Ultimate-Theme-Library/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientNumericUpDown.cs deleted file mode 100644 index 80478ab..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientNumericUpDown.cs +++ /dev/null @@ -1,146 +0,0 @@ -using System; -using System.ComponentModel; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Drawing.Text; -using System.Windows.Forms; - -namespace CBH.Ultimate.Controls -{ - public sealed class CrEaTiiOn_Ultimate_GradientNumericUpDown : Control - { - private int _w; - private int _h; - private int _x; - private int _y; - private long _value; - private long _min; - private long _max; - private bool _bool; - - private Color _baseColor = Color.FromArgb(15, 15, 15); - private Color _gradientColorPrimary = Color.FromArgb(250, 36, 38); - private Color _gradientColorSecondary = Color.FromArgb(45, 45, 45); - private Color _stringColor = Color.White; - - public long Value { get => _value; set { if (value <= _max & value >= _min) _value = value; Invalidate(); } } - public long Maximum { get => _max; set { if (value > _min) _max = value; if (_value > _max) _value = _max; Invalidate(); } } - public long Minimum { get => _min; set { if (value < _max) _min = value; if (_value < _min) _value = Minimum; Invalidate(); } } - - [Category("CrEaTiiOn")] - public Color BaseColor { get { return _baseColor; } set { _baseColor = value; Invalidate(); } } - [Category("CrEaTiiOn")] - public Color GradientColorPrimary { get => _gradientColorPrimary; set { _gradientColorPrimary = value; Invalidate(); } } - [Category("CrEaTiiOn")] - public Color GradientColorSecondary { get => _gradientColorSecondary; set { _gradientColorSecondary = value; Invalidate(); } } - [Category("CrEaTiiOn")] - public Color StringColor { get => _stringColor; set => _stringColor = value; } - - public CrEaTiiOn_Ultimate_GradientNumericUpDown() - { - SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.OptimizedDoubleBuffer | ControlStyles.SupportsTransparentBackColor, true); - DoubleBuffered = true; - _min = 0; - _max = 9999999; - } - - protected override void OnMouseMove(MouseEventArgs e) - { - base.OnMouseMove(e); - _x = e.Location.X; - _y = e.Location.Y; - Invalidate(); - Cursor = e.X < Width - 23 ? Cursors.IBeam : Cursors.Hand; - } - - protected override void OnMouseDown(MouseEventArgs e) - { - base.OnMouseDown(e); - if (_x > Width - 21 && _x < Width - 3) - { - if (_y < 15) - { - if ((Value + 1) <= _max) - _value += 1; - } - else - { - if ((Value - 1) >= _min) - _value -= 1; - } - } - else - { - _bool = !_bool; - Focus(); - } - Invalidate(); - } - - protected override void OnKeyPress(KeyPressEventArgs e) - { - base.OnKeyPress(e); - try - { - if (_bool) - _value = Convert.ToInt64(_value + e.KeyChar.ToString()); - if (_value > _max) - _value = _max; - Invalidate(); - } - catch - { - // ignored - } - } - - protected override void OnKeyDown(KeyEventArgs e) - { - base.OnKeyDown(e); - if (e.KeyCode == Keys.Back) - { - Value = 0; - } - } - - protected override void OnResize(EventArgs e) - { - base.OnResize(e); - Height = 30; - } - - public static readonly StringFormat CenterSf = new StringFormat - { - Alignment = StringAlignment.Center, - LineAlignment = StringAlignment.Center - }; - - - protected override void OnPaint(PaintEventArgs e) - { - var bitmap = new Bitmap(Width, Height); - var graphics = Graphics.FromImage(bitmap); - _w = Width; - _h = Height; - - var rectBase = new Rectangle(0, 0, _w, _h); - - graphics.SmoothingMode = SmoothingMode.AntiAlias; - graphics.PixelOffsetMode = PixelOffsetMode.HighQuality; - graphics.TextRenderingHint = TextRenderingHint.AntiAlias; - graphics.Clear(BackColor); - - graphics.FillRectangle(new SolidBrush(_baseColor), rectBase); - graphics.FillRectangle(new LinearGradientBrush(new PointF(0, Height / 2f), new PointF(Width, Height / 2f), _gradientColorPrimary, _gradientColorSecondary), new Rectangle(Width - 24, 0, 24, _h)); - graphics.DrawString("+", Font, new SolidBrush(_stringColor), new Point(Width - 12, 8), CenterSf); - graphics.DrawString("-", Font, new SolidBrush(_stringColor), new Point(Width - 12, 22), CenterSf); - graphics.DrawString(Value.ToString(), Font, new SolidBrush(_stringColor), new Rectangle(5, 1, _w, _h), new StringFormat { LineAlignment = StringAlignment.Center }); - - base.OnPaint(e); - graphics.Dispose(); - e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic; - e.Graphics.DrawImageUnscaled(bitmap, 0, 0); - bitmap.Dispose(); - } - } -} diff --git a/CBH-Ultimate-Theme-Library/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientPanel.cs b/CBH-Ultimate-Theme-Library/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientPanel.cs deleted file mode 100644 index 377dcfd..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientPanel.cs +++ /dev/null @@ -1,251 +0,0 @@ -#region Imports - -using System.ComponentModel; -using System.Drawing.Drawing2D; -using System.Drawing.Text; -using System.Runtime.InteropServices; - -#endregion - -namespace CBH_Ultimate_Theme_Library.Theme.ThemeBase -{ - #region CrEaTiiOn_GradientPanel - - public class CrEaTiiOn_Ultimate_GradientPanel : Panel - { - [DllImport("Gdi32.dll", EntryPoint = "CreateRoundRectRgn")] - private static extern IntPtr CreateRoundRectRgn - ( - int nLeftRect, // x-coordinate of upper-left corner - int nTopRect, // y-coordinate of upper-left corner - int nRightRect, // x-coordinate of lower-right corner - int nBottomRect, // y-coordinate of lower-right corner - int nWidthEllipse, // width of ellipse - int nHeightEllipse // height of ellipse - ); - - public CrEaTiiOn_Ultimate_GradientPanel() - { - DoubleBuffered = true; - SetStyle(ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.AllPaintingInWmPaint, true); - BackColor = Color.White; - Size = new Size(200, 200); - } - - [Browsable(false)] - [EditorBrowsable(EditorBrowsableState.Never)] - public new Color BackColor { get; set; } - - [Browsable(false)] - [EditorBrowsable(EditorBrowsableState.Never)] - public new Color ForeColor { get; set; } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The primer color")] - public Color PrimerColor - { - get => primerColor; - set - { - primerColor = value; - Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The top left color")] - public Color TopLeft - { - get => topLeft; - set - { - topLeft = value; - Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The top right color")] - public Color TopRight - { - get => topRight; - set - { - topRight = value; - Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The bottom left color")] - public Color BottomLeft - { - get => bottomLeft; - set - { - bottomLeft = value; - Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The bottom right color")] - public Color BottomRight - { - get => bottomRight; - set - { - bottomRight = value; - Invalidate(); - } - } - - [Category("CrEaTiiOn")] - [Browsable(true)] - [Description("The gradient orientation")] - public GradientStyle Style - { - get => style; - set - { - style = value; - Refresh(); - } - } - - private SmoothingMode _SmoothingType = SmoothingMode.AntiAlias; - [Category("CrEaTiiOn")] - [Browsable(true)] - public SmoothingMode SmoothingType - { - get => _SmoothingType; - set - { - _SmoothingType = value; - Invalidate(); - } - } - - private InterpolationMode _InterpolationType = InterpolationMode.HighQualityBilinear; - [Category("CrEaTiiOn")] - [Browsable(true)] - public InterpolationMode InterpolationType - { - get => _InterpolationType; - set - { - _InterpolationType = value; - Invalidate(); - } - } - - private CompositingQuality _CompositingQualityType = CompositingQuality.HighQuality; - [Category("CrEaTiiOn")] - [Browsable(true)] - public CompositingQuality CompositingQualityType - { - get => _CompositingQualityType; - set - { - _CompositingQualityType = value; - Invalidate(); - } - } - - private PixelOffsetMode _PixelOffsetType = PixelOffsetMode.HighQuality; - [Category("CrEaTiiOn")] - [Browsable(true)] - public PixelOffsetMode PixelOffsetType - { - get => _PixelOffsetType; - set - { - _PixelOffsetType = value; - Invalidate(); - } - } - - private TextRenderingHint _TextRenderingType = TextRenderingHint.ClearTypeGridFit; - [Category("CrEaTiiOn")] - [Browsable(true)] - public TextRenderingHint TextRenderingType - { - get => _TextRenderingType; - set - { - _TextRenderingType = value; - Invalidate(); - } - } - - protected override void OnPaint(PaintEventArgs e) - { - base.OnPaint(e); - BufferedGraphicsContext bufferedGraphicsContext = BufferedGraphicsManager.Current; - bufferedGraphicsContext.MaximumBuffer = new Size(Width + 1, Height + 1); - bufferedGraphics = bufferedGraphicsContext.Allocate(CreateGraphics(), ClientRectangle); - bufferedGraphics.Graphics.SmoothingMode = SmoothingType; - bufferedGraphics.Graphics.InterpolationMode = InterpolationType; - bufferedGraphics.Graphics.CompositingQuality = CompositingQualityType; - bufferedGraphics.Graphics.PixelOffsetMode = PixelOffsetType; - bufferedGraphics.Graphics.TextRenderingHint = TextRenderingType; - bufferedGraphics.Graphics.Clear(primerColor); - if (style == GradientStyle.Corners) - { - LinearGradientBrush linearGradientBrush = new(new Rectangle(0, 0, Width, Height), TopLeft, Color.Transparent, 45f); - bufferedGraphics.Graphics.FillRectangle(linearGradientBrush, ClientRectangle); - linearGradientBrush = new(new Rectangle(0, 0, Width, Height), topRight, Color.Transparent, 135f); - bufferedGraphics.Graphics.FillRectangle(linearGradientBrush, ClientRectangle); - linearGradientBrush = new(new Rectangle(0, 0, Width, Height), bottomRight, Color.Transparent, 225f); - bufferedGraphics.Graphics.FillRectangle(linearGradientBrush, ClientRectangle); - linearGradientBrush = new(new Rectangle(0, 0, Width, Height), bottomLeft, Color.Transparent, 315f); - bufferedGraphics.Graphics.FillRectangle(linearGradientBrush, ClientRectangle); - linearGradientBrush.Dispose(); - } - else - { - Brush brush; - if (style == GradientStyle.Vertical) - { - brush = new LinearGradientBrush(ClientRectangle, topLeft, topRight, 720f); - } - else - { - brush = new LinearGradientBrush(ClientRectangle, topLeft, topRight, 90f); - } - bufferedGraphics.Graphics.FillRectangle(brush, ClientRectangle); - brush.Dispose(); - } - bufferedGraphics.Render(e.Graphics); - Region = Region.FromHrgn(CreateRoundRectRgn(0, 0, Width, Height, 10, 10)); - } - - private BufferedGraphics bufferedGraphics; - - private Color primerColor = Color.FromArgb(20, 20, 20); - - private Color topLeft = Color.FromArgb(250, 36, 38); - - private Color topRight = Color.FromArgb(250, 36, 38); - - private Color bottomLeft = Color.FromArgb(15, 15, 15); - - private Color bottomRight = Color.FromArgb(250, 36, 38); - - private GradientStyle style = GradientStyle.Corners; - - public enum GradientStyle - { - Horizontal, - Vertical, - Corners - } - } - - #endregion -} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientTextBox.Designer.cs b/CBH-Ultimate-Theme-Library/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientTextBox.Designer.cs deleted file mode 100644 index d25d413..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientTextBox.Designer.cs +++ /dev/null @@ -1,72 +0,0 @@ -namespace CBH.Ultimate.Controls -{ - partial class CrEaTiiOn_Ultimate_GradientTextBox - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Component Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.textBox1 = new System.Windows.Forms.TextBox(); - this.SuspendLayout(); - // - // textBox1 - // - this.textBox1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20))))); - this.textBox1.BorderStyle = System.Windows.Forms.BorderStyle.None; - this.textBox1.Dock = System.Windows.Forms.DockStyle.Fill; - this.textBox1.ForeColor = System.Drawing.Color.White; - this.textBox1.Location = new System.Drawing.Point(10, 7); - this.textBox1.Name = "textBox1"; - this.textBox1.Size = new System.Drawing.Size(230, 15); - this.textBox1.TabIndex = 1; - this.textBox1.Click += new System.EventHandler(this.textBox1_Click); - this.textBox1.TextChanged += new System.EventHandler(this.textBox1_TextChanged); - this.textBox1.Enter += new System.EventHandler(this.textBox1_Enter); - this.textBox1.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBox1_KeyPress); - this.textBox1.Leave += new System.EventHandler(this.textBox1_Leave); - this.textBox1.MouseEnter += new System.EventHandler(this.textBox1_MouseEnter); - this.textBox1.MouseLeave += new System.EventHandler(this.textBox1_MouseLeave); - // - // CrEaTiiOn_Ultimate_GradientTextBox - // - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; - this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20))))); - this.Controls.Add(this.textBox1); - this.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - this.ForeColor = System.Drawing.Color.White; - this.Margin = new System.Windows.Forms.Padding(4); - this.Name = "CrEaTiiOn_Ultimate_GradientTextBox"; - this.Padding = new System.Windows.Forms.Padding(10, 7, 10, 7); - this.Size = new System.Drawing.Size(250, 30); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.TextBox textBox1; - } -} diff --git a/CBH-Ultimate-Theme-Library/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientTextBox.cs b/CBH-Ultimate-Theme-Library/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientTextBox.cs deleted file mode 100644 index 3c19a17..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientTextBox.cs +++ /dev/null @@ -1,227 +0,0 @@ -using System; -using System.ComponentModel; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Windows.Forms; - -namespace CBH.Ultimate.Controls -{ - [DefaultEvent("TextHasChanged")] - public partial class CrEaTiiOn_Ultimate_GradientTextBox : UserControl - { - private Color _gradientColorPrimary = Color.FromArgb(250, 36, 38); - private Color _gradientColorSecondary = Color.FromArgb(75, 75, 75); - private int _borderSize = 2; - private bool _underlinedStyle; - private Color _borderFocusColor = Color.FromArgb(250, 36, 38); - private bool _isFocused; - private int _borderRadius; - private Color _placeholderColor = Color.FromArgb(15, 15, 15); - private string _placeholderText = string.Empty; - private bool _isPlaceholder; - private bool _isPasswordChar; - - public CrEaTiiOn_Ultimate_GradientTextBox() - { - InitializeComponent(); - - } - - public event EventHandler TextHasChanged; - - - [Category("CrEaTiiOn")] - public Color GradientColorPrimary { get => _gradientColorPrimary; set { _gradientColorPrimary = value; Invalidate(); } } - [Category("CrEaTiiOn")] - public Color GradientColorSecondary { get => _gradientColorSecondary; set { _gradientColorSecondary = value; Invalidate(); } } - [Category("CrEaTiiOn")] - public int BorderSize { get => _borderSize; set { _borderSize = value; Invalidate(); } } - [Category("CrEaTiiOn")] - public bool UnderlinedStyle { get => _underlinedStyle; set { _underlinedStyle = value; Invalidate(); } } - [Category("CrEaTiiOn")] - public bool PasswordChar { get => _isPasswordChar; set { _isPasswordChar = value; textBox1.UseSystemPasswordChar = value; } } - [Category("CrEaTiiOn")] - public bool Multiline { get => textBox1.Multiline; set => textBox1.Multiline = value; } - [Category("CrEaTiiOn")] - public string String { get { if (_isPlaceholder) return string.Empty; return textBox1.Text; } set { textBox1.Text = value; SetPlaceHolder(); } } - [Category("CrEaTiiOn")] - public override Color BackColor { get => base.BackColor; set { base.BackColor = value; textBox1.BackColor = value; } } - [Category("CrEaTiiOn")] - public override Color ForeColor { get => base.ForeColor; set { base.ForeColor = value; textBox1.ForeColor = value; } } - [Category("CrEaTiiOn")] - public override Font Font { get => base.Font; set { base.Font = value; textBox1.Font = value; if (DesignMode) UpdateControlHeight(); } } - [Category("CrEaTiiOn")] - public Color BorderFocusColor { get => _borderFocusColor; set => _borderFocusColor = value; } - [Category("CrEaTiiOn")] - public int BorderRadius { get => _borderRadius; set { if (value >= 0) _borderRadius = value; Invalidate(); } } - [Category("CrEaTiiOn")] - public Color PlaceholderColor { get => _placeholderColor; set { _placeholderColor = value; if (_isPlaceholder) textBox1.ForeColor = value; } } - [Category("CrEaTiiOn")] - public string PlaceholderText { get => _placeholderText; set { _placeholderText = value; textBox1.Text = String.Empty; SetPlaceHolder(); } } - - protected override void OnPaint(PaintEventArgs e) - { - base.OnPaint(e); - Graphics graphics = e.Graphics; - - if (_borderRadius > 1) - { - var rectBorderSmooth = ClientRectangle; - var rectBorder = Rectangle.Inflate(rectBorderSmooth, -_borderSize, -_borderSize); - int smoothSize = _borderSize > 0 ? _borderSize : 1; - - using (GraphicsPath pathBorderSmooth = GetFigurePath(rectBorderSmooth, _borderRadius)) - using (GraphicsPath pathBorder = GetFigurePath(rectBorder, _borderRadius - _borderSize)) - using (Pen penBorderSmooth = new Pen(Parent.BackColor, smoothSize)) - using (Pen penBorder = new Pen(new LinearGradientBrush(new PointF(0, Height / 2f), new PointF(Width, Height / 2f), _gradientColorPrimary, _gradientColorSecondary), _borderSize)) - { - Region = new Region(pathBorderSmooth); - if (_borderSize > 15) SetTextBoxRoundedRegion(); - graphics.SmoothingMode = SmoothingMode.AntiAlias; - penBorder.Alignment = PenAlignment.Center; - - if (_isFocused) - penBorder.Color = _borderFocusColor; - - if (_underlinedStyle) - { - graphics.DrawPath(penBorderSmooth, pathBorderSmooth); - graphics.SmoothingMode = SmoothingMode.None; - graphics.DrawLine(penBorder, 0, Height - 1, Width, Height - 1); - } - else - { - graphics.DrawPath(penBorderSmooth, pathBorderSmooth); - graphics.DrawPath(penBorder, pathBorder); - } - } - } - else - { - using (Pen penBorder = new Pen(new LinearGradientBrush(new PointF(0, Height / 2f), new PointF(Width, Height / 2f), _gradientColorPrimary, _gradientColorSecondary), _borderSize)) - { - Region = new Region(ClientRectangle); - penBorder.Alignment = PenAlignment.Inset; - - if (_isFocused) - penBorder.Color = _borderFocusColor; - - if (_underlinedStyle) - graphics.DrawLine(penBorder, 0, Height - 1, Width, Height - 1); - else - graphics.DrawRectangle(penBorder, 0, 0, Width - 0.5f, Height - 0.5f); - } - } - } - - private void SetTextBoxRoundedRegion() - { - GraphicsPath pathText; - - pathText = GetFigurePath(textBox1.ClientRectangle, Multiline ? _borderRadius - _borderSize : _borderRadius * 2); - textBox1.Region = new Region(pathText); - } - - private GraphicsPath GetFigurePath(RectangleF rect, float radius) - { - var path = new GraphicsPath(); - path.StartFigure(); - path.AddArc(rect.X, rect.Y, radius, radius, 180, 90); - path.AddArc(rect.Width - radius, rect.Y, radius, radius, 270, 90); - path.AddArc(rect.Width - radius, rect.Height - radius, radius, radius, 0, 90); - path.AddArc(rect.X, rect.Height - radius, radius, radius, 90, 90); - path.CloseFigure(); - return path; - } - - protected override void OnResize(EventArgs e) - { - base.OnResize(e); - if (DesignMode) - UpdateControlHeight(); - } - - protected override void OnLoad(EventArgs e) - { - base.OnLoad(e); - UpdateControlHeight(); - } - - private void UpdateControlHeight() - { - if (!textBox1.Multiline) - { - int textHeight = TextRenderer.MeasureText("Text", Font).Height + 1; - textBox1.Multiline = true; - textBox1.MinimumSize = new Size(0, textHeight); - textBox1.Multiline = false; - Height = textBox1.Height + Padding.Top + Padding.Bottom; - } - } - - private void SetPlaceHolder() - { - if (string.IsNullOrWhiteSpace(textBox1.Text) && _placeholderText != String.Empty) - { - _isPlaceholder = true; - textBox1.Text = _placeholderText; - textBox1.ForeColor = _placeholderColor; - if (_isPasswordChar) - textBox1.UseSystemPasswordChar = false; - - } - } - - private void RemovePlaceHolder() - { - if (_isPlaceholder && _placeholderText != String.Empty) - { - _isPlaceholder = false; - textBox1.Text = string.Empty; - textBox1.ForeColor = ForeColor; - if (_isPasswordChar) - textBox1.UseSystemPasswordChar = true; - - } - } - - private void textBox1_TextChanged(object sender, EventArgs e) - { - TextHasChanged?.Invoke(sender, e); - } - - private void textBox1_Click(object sender, EventArgs e) - { - OnClick(e); - } - - private void textBox1_MouseEnter(object sender, EventArgs e) - { - OnMouseEnter(e); - } - - private void textBox1_MouseLeave(object sender, EventArgs e) - { - OnMouseLeave(e); - } - - private void textBox1_KeyPress(object sender, KeyPressEventArgs e) - { - OnKeyPress(e); - } - - private void textBox1_Enter(object sender, EventArgs e) - { - _isFocused = true; - Invalidate(); - RemovePlaceHolder(); - } - - private void textBox1_Leave(object sender, EventArgs e) - { - _isFocused = false; - Invalidate(); - SetPlaceHolder(); - } - } -} diff --git a/CBH-Ultimate-Theme-Library/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientTextBox.resx b/CBH-Ultimate-Theme-Library/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientTextBox.resx deleted file mode 100644 index f298a7b..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientTextBox.resx +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientToggleButton.cs b/CBH-Ultimate-Theme-Library/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientToggleButton.cs deleted file mode 100644 index 26141a6..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientToggleButton.cs +++ /dev/null @@ -1,83 +0,0 @@ -using System.Windows.Forms; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.ComponentModel; - -namespace CBH.Ultimate.Controls -{ - public sealed class CrEaTiiOn_Ultimate_GradientToggleButton : CheckBox - { - - private Color _gradientColorPrimary = Color.FromArgb(250, 36, 38); - private Color _gradientColorSecondary = Color.Black; - private Color _onToggleColor = Color.Black; - private Color _offBackColor = Color.FromArgb(15, 15, 15); - private Color _offToggleColor = Color.White; - private bool _solidStyle = true; - - [Category("CrEaTiiOn")] - public Color GradientColorPrimary { get => _gradientColorPrimary; set { _gradientColorPrimary = value; Invalidate(); } } - [Category("CrEaTiiOn")] - public Color GradientColorSecondary { get => _gradientColorSecondary; set { _gradientColorSecondary = value; Invalidate(); } } - [Category("CrEaTiiOn")] - public Color OnToggleColor { get => _onToggleColor; set { _onToggleColor = value; Invalidate(); } } - [Category("CrEaTiiOn")] - public Color OffBackColor { get => _offBackColor; set { _offBackColor = value; Invalidate(); } } - [Category("CrEaTiiOn")] - public Color OffToggleColor { get => _offToggleColor; set { _offToggleColor = value; Invalidate(); } } - [Category("CrEaTiiOn")] - [DefaultValue(true)] - public bool SolidStyle { get => _solidStyle; set { _solidStyle = value; Invalidate(); } } - - public override string Text - { - get => base.Text; - set { } - } - - public CrEaTiiOn_Ultimate_GradientToggleButton() - { - MinimumSize = new Size(45, 22); - } - - private GraphicsPath GetFigurePath() - { - var arcSize = Height - 1; - var leftArc = new Rectangle(0, 0, arcSize, arcSize); - var rightArc = new Rectangle(Width - arcSize - 2, 0, arcSize, arcSize); - - var path = new GraphicsPath(); - path.StartFigure(); - path.AddArc(leftArc, 90, 180); - path.AddArc(rightArc, 270, 180); - path.CloseFigure(); - - return path; - } - - protected override void OnPaint(PaintEventArgs pevent) - { - var toggleSize = Height - 5; - pevent.Graphics.SmoothingMode = SmoothingMode.AntiAlias; - pevent.Graphics.Clear(BackColor); - - if (Checked) - { - if (_solidStyle) - pevent.Graphics.FillPath(new LinearGradientBrush(new PointF(0, Height / 2f), new PointF(Width, Height / 2f), _gradientColorPrimary, _gradientColorSecondary), GetFigurePath()); - else - pevent.Graphics.DrawPath(new Pen(new LinearGradientBrush(new PointF(0, Height / 2f), new PointF(Width, Height / 2f), _gradientColorPrimary, _gradientColorSecondary), 2), GetFigurePath()); - - pevent.Graphics.FillEllipse(new SolidBrush(_onToggleColor), new Rectangle(Width - Height + 1, 2, toggleSize, toggleSize)); - } - else - { - if (_solidStyle) - pevent.Graphics.FillPath(new SolidBrush(_offBackColor), GetFigurePath()); - else - pevent.Graphics.DrawPath(new Pen(_offBackColor), GetFigurePath()); - pevent.Graphics.FillEllipse(new SolidBrush(_offToggleColor), new Rectangle(2, 2, toggleSize, toggleSize)); - } - } - } -} diff --git a/CBH-Ultimate-Theme-Library/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_NumericUpDown.cs b/CBH-Ultimate-Theme-Library/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_NumericUpDown.cs deleted file mode 100644 index 6aaf8da..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_NumericUpDown.cs +++ /dev/null @@ -1,143 +0,0 @@ -using System; -using System.ComponentModel; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Drawing.Text; -using System.Windows.Forms; - -namespace CBH.Ultimate.Controls -{ - public sealed class CrEaTiiOn_Ultimate_NumericUpDown : Control - { - private int _w; - private int _h; - private int _x; - private int _y; - private long _value; - private long _min; - private long _max; - private bool _bool; - - private Color _baseColor = Color.FromArgb(15, 15, 15); - private Color _buttonColor = Color.FromArgb(250, 36, 38); - private Color _stringColor = Color.White; - - public long Value { get => _value; set { if (value <= _max & value >= _min) _value = value; Invalidate(); } } - public long Maximum { get => _max; set { if (value > _min) _max = value; if (_value > _max) _value = _max; Invalidate(); } } - public long Minimum { get => _min; set { if (value < _max) _min = value; if (_value < _min) _value = Minimum; Invalidate(); } } - - [Category("CrEaTiiOn")] - public Color BaseColor { get { return _baseColor; } set { _baseColor = value; Invalidate(); } } - [Category("CrEaTiiOn")] - public Color ButtonColor { get { return _buttonColor; } set { _buttonColor = value; Invalidate(); } } - [Category("CrEaTiiOn")] - public Color StringColor { get => _stringColor; set => _stringColor = value; } - - public CrEaTiiOn_Ultimate_NumericUpDown() - { - SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.OptimizedDoubleBuffer | ControlStyles.SupportsTransparentBackColor, true); - DoubleBuffered = true; - _min = 0; - _max = 9999999; - } - - protected override void OnMouseMove(MouseEventArgs e) - { - base.OnMouseMove(e); - _x = e.Location.X; - _y = e.Location.Y; - Invalidate(); - Cursor = e.X < Width - 23 ? Cursors.IBeam : Cursors.Hand; - } - - protected override void OnMouseDown(MouseEventArgs e) - { - base.OnMouseDown(e); - if (_x > Width - 21 && _x < Width - 3) - { - if (_y < 15) - { - if ((Value + 1) <= _max) - _value += 1; - } - else - { - if ((Value - 1) >= _min) - _value -= 1; - } - } - else - { - _bool = !_bool; - Focus(); - } - Invalidate(); - } - - protected override void OnKeyPress(KeyPressEventArgs e) - { - base.OnKeyPress(e); - try - { - if (_bool) - _value = Convert.ToInt64(_value + e.KeyChar.ToString()); - if (_value > _max) - _value = _max; - Invalidate(); - } - catch - { - // ignored - } - } - - protected override void OnKeyDown(KeyEventArgs e) - { - base.OnKeyDown(e); - if (e.KeyCode == Keys.Back) - { - Value = 0; - } - } - - protected override void OnResize(EventArgs e) - { - base.OnResize(e); - Height = 30; - } - - public static readonly StringFormat CenterSf = new StringFormat - { - Alignment = StringAlignment.Center, - LineAlignment = StringAlignment.Center - }; - - - protected override void OnPaint(PaintEventArgs e) - { - var bitmap = new Bitmap(Width, Height); - var graphics = Graphics.FromImage(bitmap); - _w = Width; - _h = Height; - - var rectBase = new Rectangle(0, 0, _w, _h); - - graphics.SmoothingMode = SmoothingMode.AntiAlias; - graphics.PixelOffsetMode = PixelOffsetMode.HighQuality; - graphics.TextRenderingHint = TextRenderingHint.AntiAlias; - graphics.Clear(BackColor); - - graphics.FillRectangle(new SolidBrush(_baseColor), rectBase); - graphics.FillRectangle(new SolidBrush(_buttonColor), new Rectangle(Width - 24, 0, 24, _h)); - graphics.DrawString("+", Font, new SolidBrush(_stringColor), new Point(Width - 12, 8), CenterSf); - graphics.DrawString("-", Font, new SolidBrush(_stringColor), new Point(Width - 12, 22), CenterSf); - graphics.DrawString(Value.ToString(), Font, new SolidBrush(_stringColor), new Rectangle(5, 1, _w, _h), new StringFormat { LineAlignment = StringAlignment.Center }); - - base.OnPaint(e); - graphics.Dispose(); - e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic; - e.Graphics.DrawImageUnscaled(bitmap, 0, 0); - bitmap.Dispose(); - } - } -} diff --git a/CBH-Ultimate-Theme-Library/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_RadioButton.cs b/CBH-Ultimate-Theme-Library/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_RadioButton.cs deleted file mode 100644 index 6ac1c10..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_RadioButton.cs +++ /dev/null @@ -1,74 +0,0 @@ -using System; -using System.ComponentModel; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Windows.Forms; - -namespace CBH.Ultimate.Controls -{ - public sealed class CrEaTiiOn_Ultimate_RadioButton : RadioButton - { - private Color _checkedColor = Color.FromArgb(250, 36, 38); - private Color _unCheckedColor = Color.FromArgb(15, 15, 15); - private Color _backgroundColor = Color.FromArgb(20, 20, 20); - - [Category("CrEaTiiOn")] - public Color CheckedColor { get => _checkedColor; set { _checkedColor = value; Invalidate(); } } - [Category("CrEaTiiOn")] - public Color UnCheckedColor { get => _unCheckedColor; set { _unCheckedColor = value; Invalidate(); } } - [Category("CrEaTiiOn")] - public Color BackgroundColor { get => _backgroundColor; set { _backgroundColor = value; Invalidate(); } } - - public CrEaTiiOn_Ultimate_RadioButton() - { - MinimumSize = new Size(0, 21); - } - - protected override void OnPaint(PaintEventArgs pevent) - { - var graphics = pevent.Graphics; - graphics.SmoothingMode = SmoothingMode.AntiAlias; - var rbBorderSize = 18f; - var rbCheckSize = 12f; - var rectRbBorder = new RectangleF() - { - X = 0.5f, - Y = (Height - rbBorderSize) / 2, - Width = rbBorderSize, - Height = rbBorderSize - }; - var rectRbCheck = new RectangleF() - { - X = rectRbBorder.X + (rectRbBorder.Width - rbCheckSize) / 2, - Y = (Height - rbCheckSize) / 2, - Width = rbCheckSize, - Height = rbCheckSize - }; - - using(var penBorder = new Pen(_checkedColor, 1.6f)) - using(var brushRbCheck = new SolidBrush(_checkedColor)) - using(var brushBgCheck = new SolidBrush(_backgroundColor)) - using (var brushText = new SolidBrush(ForeColor)) - { - graphics.Clear(_backgroundColor); - if (Checked) - { - graphics.DrawEllipse(penBorder, rectRbBorder); - graphics.FillEllipse(brushRbCheck, rectRbCheck); - } - else - { - penBorder.Color = _unCheckedColor; - graphics.DrawEllipse(penBorder, rectRbBorder); - } - graphics.DrawString(Text, Font, brushText, rbBorderSize + 8, (Height - TextRenderer.MeasureText(Text, Font).Height) / 2f); - } - } - - protected override void OnResize(EventArgs e) - { - base.OnResize(e); - Width = TextRenderer.MeasureText(Text, Font).Width + 30; - } - } -} diff --git a/CBH-Ultimate-Theme-Library/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_ToggleButton.cs b/CBH-Ultimate-Theme-Library/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_ToggleButton.cs deleted file mode 100644 index 2ef705d..0000000 --- a/CBH-Ultimate-Theme-Library/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_ToggleButton.cs +++ /dev/null @@ -1,76 +0,0 @@ -using System.Windows.Forms; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.ComponentModel; - -namespace CBH.Ultimate.Controls -{ - public sealed class CrEaTiiOn_Ultimate_ToggleButton : CheckBox - { - private Color _onBackColor = Color.FromArgb(250, 36, 38); - private Color _onToggleColor = Color.White; - private Color _offBackColor = Color.FromArgb(15, 15, 15); - private Color _offToggleColor = Color.White; - private bool _solidStyle = true; - - [Category("CrEaTiiOn")] - public Color OnBackColor { get => _onBackColor; set { _onBackColor = value; Invalidate(); } } - [Category("CrEaTiiOn")] - public Color OnToggleColor { get => _onToggleColor; set { _onToggleColor = value; Invalidate(); } } - [Category("CrEaTiiOn")] - public Color OffBackColor { get => _offBackColor; set { _offBackColor = value; Invalidate(); } } - [Category("CrEaTiiOn")] - public Color OffToggleColor { get => _offToggleColor; set { _offToggleColor = value; Invalidate(); } } - [Category("CrEaTiiOn")] - [DefaultValue(true)] - public bool SolidStyle { get => _solidStyle; set { _solidStyle = value; Invalidate(); } } - - public override string Text { get => base.Text; - set { } } - - public CrEaTiiOn_Ultimate_ToggleButton() - { - MinimumSize = new Size(45, 22); - } - - private GraphicsPath GetFigurePath() - { - var arcSize = Height - 1; - var leftArc = new Rectangle(0, 0, arcSize, arcSize); - var rightArc = new Rectangle(Width - arcSize-2, 0, arcSize, arcSize); - - var path = new GraphicsPath(); - path.StartFigure(); - path.AddArc(leftArc, 90, 180); - path.AddArc(rightArc, 270, 180); - path.CloseFigure(); - - return path; - } - - protected override void OnPaint(PaintEventArgs pevent) - { - var toggleSize = Height - 5; - pevent.Graphics.SmoothingMode = SmoothingMode.AntiAlias; - pevent.Graphics.Clear(BackColor); - - if (Checked) - { - if (_solidStyle) - pevent.Graphics.FillPath(new SolidBrush(OnBackColor), GetFigurePath()); - else - pevent.Graphics.DrawPath(new Pen(OnBackColor, 2), GetFigurePath()); - - pevent.Graphics.FillEllipse(new SolidBrush(_onToggleColor), new Rectangle(Width - Height + 1, 2, toggleSize, toggleSize)); - } - else - { - if(_solidStyle) - pevent.Graphics.FillPath(new SolidBrush(_offBackColor), GetFigurePath()); - else - pevent.Graphics.DrawPath(new Pen(_offBackColor), GetFigurePath()); - pevent.Graphics.FillEllipse(new SolidBrush(_offToggleColor), new Rectangle(2, 2, toggleSize, toggleSize)); - } - } - } -} diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/App.config b/CBH-WinForm-Theme-NET/App.config similarity index 59% rename from CBH-Ultimate-Theme-Library-NET-Framework/App.config rename to CBH-WinForm-Theme-NET/App.config index aee9adf..4bfa005 100644 --- a/CBH-Ultimate-Theme-Library-NET-Framework/App.config +++ b/CBH-WinForm-Theme-NET/App.config @@ -1,6 +1,6 @@ - + - + - \ No newline at end of file + diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/CBH-Ultimate-Theme-Library-NET-Framework.csproj b/CBH-WinForm-Theme-NET/CBH-WinForm-Theme-NET-.csproj similarity index 64% rename from CBH-Ultimate-Theme-Library-NET-Framework/CBH-Ultimate-Theme-Library-NET-Framework.csproj rename to CBH-WinForm-Theme-NET/CBH-WinForm-Theme-NET-.csproj index 9df0d4b..958a94c 100644 --- a/CBH-Ultimate-Theme-Library-NET-Framework/CBH-Ultimate-Theme-Library-NET-Framework.csproj +++ b/CBH-WinForm-Theme-NET/CBH-WinForm-Theme-NET-.csproj @@ -6,13 +6,14 @@ Debug AnyCPU {C3D7B16C-C047-4BAA-884F-7A2308619C33} - WinExe - CBH_Ultimate_Theme_Library_NET_Framework - CBH-Ultimate-Theme-Library-NET-Framework - v4.8.1 + Library + CBH_WinForm_Theme_Library_NET + CBH-WinForm-Theme-Library + v4.8 512 true true + AnyCPU @@ -33,6 +34,9 @@ prompt 4 + + + @@ -47,13 +51,6 @@ - - Form - - - MainForm.cs - - Component @@ -67,46 +64,38 @@ Component - - Component - - - Component - - - Component - - - Component - - + Component - + Component - + Component - - Component + + + + + + UserControl - - Component + + CrEaTiiOn_ColorBox2D.cs - - Component + + UserControl - - Component + + CrEaTiiOn_ColorHexagon.cs - - Component + + UserControl - - Component + + CrEaTiiOn_ColorSliderVertical.cs - + Component @@ -121,43 +110,13 @@ Component - - Component - - - Component - - - Component - - - Component - - - Component - - - Component - - - Component - Component - - Component - Component - - Component - - - Component - - + Component @@ -169,33 +128,12 @@ Component - - Component - - - Component - - - Component - - - Component - Component Component - - Component - - - Component - - - Component - Component @@ -208,40 +146,15 @@ Component - - - - Component Component - - Component - - - Component - - - Component - - - Component - Component - - Component - - - UserControl - - - CrEaTiiOn_ColorPicker.cs - Component @@ -257,12 +170,6 @@ Component - - Component - - - Component - Component @@ -281,9 +188,6 @@ Component - - Component - Component @@ -308,28 +212,12 @@ Component - - Component - Component Component - - Component - - - Component - - - Component - - - Component - - Component @@ -339,16 +227,12 @@ Component - - Component - Component Component - Component @@ -358,23 +242,14 @@ CrEaTiiOn_ModernTextBox.cs - - Component - - - Component - Component - - Component - - - + + Component - + Component @@ -422,9 +297,6 @@ Component - - MainForm.cs - ResXFileCodeGenerator Resources.Designer.cs @@ -433,13 +305,14 @@ True Resources.resx + True + + CrEaTiiOn_ColorSliderVertical.cs + CrEaTiiOn_ComboBox.cs - - CrEaTiiOn_ColorPicker.cs - CrEaTiiOn_ModernTextBox.cs @@ -463,10 +336,6 @@ - - - - - + \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/MainForm.resx b/CBH-WinForm-Theme-NET/MainForm.resx similarity index 100% rename from CBH-Ultimate-Theme-Library-NET-Framework/MainForm.resx rename to CBH-WinForm-Theme-NET/MainForm.resx diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Properties/AssemblyInfo.cs b/CBH-WinForm-Theme-NET/Properties/AssemblyInfo.cs similarity index 67% rename from CBH-Ultimate-Theme-Library-NET-Framework/Properties/AssemblyInfo.cs rename to CBH-WinForm-Theme-NET/Properties/AssemblyInfo.cs index 2f85227..b0e36d2 100644 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Properties/AssemblyInfo.cs +++ b/CBH-WinForm-Theme-NET/Properties/AssemblyInfo.cs @@ -5,13 +5,13 @@ // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly: AssemblyTitle("CBH-Ultimate-Theme-Library-NET-Framework")] -[assembly: AssemblyDescription("")] +[assembly: AssemblyTitle("CBH-WinForm-Theme-Library")] +[assembly: AssemblyDescription("A powerful and customizable set of controls for Windows Forms. This theme has been created by EternalModz.")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("CBH-Ultimate-Theme-Library-NET-Framework")] -[assembly: AssemblyCopyright("Copyright © 2022")] -[assembly: AssemblyTrademark("")] +[assembly: AssemblyCompany("CrEaTiiOn Brotherhood")] +[assembly: AssemblyProduct("CBH-WinForm-Theme-Library")] +[assembly: AssemblyCopyright("Copyright © CrEaTiiOn Brotherhood 2023")] +[assembly: AssemblyTrademark("EternalModz")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyVersion("3.0.0.0")] +[assembly: AssemblyFileVersion("2.0.0.0")] diff --git a/CBH-Ultimate-Theme-Library/Properties/Resources.Designer.cs b/CBH-WinForm-Theme-NET/Properties/Resources.Designer.cs similarity index 93% rename from CBH-Ultimate-Theme-Library/Properties/Resources.Designer.cs rename to CBH-WinForm-Theme-NET/Properties/Resources.Designer.cs index 1a6f4bf..9badab2 100644 --- a/CBH-Ultimate-Theme-Library/Properties/Resources.Designer.cs +++ b/CBH-WinForm-Theme-NET/Properties/Resources.Designer.cs @@ -8,7 +8,7 @@ // //------------------------------------------------------------------------------ -namespace CBH_Ultimate_Theme_Library.Properties { +namespace CBH_WinForm_Theme_Library_NET.Properties { using System; @@ -39,7 +39,7 @@ internal Resources() { internal static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CBH_Ultimate_Theme_Library.Properties.Resources", typeof(Resources).Assembly); + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CBH_WinForm_Theme_Library_NET.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Properties/Resources.resx b/CBH-WinForm-Theme-NET/Properties/Resources.resx similarity index 100% rename from CBH-Ultimate-Theme-Library-NET-Framework/Properties/Resources.resx rename to CBH-WinForm-Theme-NET/Properties/Resources.resx diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Properties/Settings.Designer.cs b/CBH-WinForm-Theme-NET/Properties/Settings.Designer.cs similarity index 80% rename from CBH-Ultimate-Theme-Library-NET-Framework/Properties/Settings.Designer.cs rename to CBH-WinForm-Theme-NET/Properties/Settings.Designer.cs index 9339a53..b510fb8 100644 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Properties/Settings.Designer.cs +++ b/CBH-WinForm-Theme-NET/Properties/Settings.Designer.cs @@ -8,21 +8,17 @@ // //------------------------------------------------------------------------------ -namespace CBH_Ultimate_Theme_Library_NET_Framework.Properties -{ - - +namespace CBH_WinForm_Theme_Library_NET.Properties { + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase - { - + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.5.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default - { - get - { + + public static Settings Default { + get { return defaultInstance; } } diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Properties/Settings.settings b/CBH-WinForm-Theme-NET/Properties/Settings.settings similarity index 100% rename from CBH-Ultimate-Theme-Library-NET-Framework/Properties/Settings.settings rename to CBH-WinForm-Theme-NET/Properties/Settings.settings diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Badge/CrEaTiiOn_Badge.cs b/CBH-WinForm-Theme-NET/Theme/Controls/Badge/CrEaTiiOn_Badge.cs similarity index 79% rename from CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Badge/CrEaTiiOn_Badge.cs rename to CBH-WinForm-Theme-NET/Theme/Controls/Badge/CrEaTiiOn_Badge.cs index 21518b1..b3eb65b 100644 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Badge/CrEaTiiOn_Badge.cs +++ b/CBH-WinForm-Theme-NET/Theme/Controls/Badge/CrEaTiiOn_Badge.cs @@ -11,7 +11,7 @@ namespace CBH.Controls { #region CrEaTiiOn_Badge - public class CrEaTiiOn_Badge : Control + public class CrEaTiiOnBadge : Control { #region Variables @@ -83,22 +83,20 @@ public Color BGColorB #endregion - public CrEaTiiOn_Badge() + public CrEaTiiOnBadge() { SetStyle(ControlStyles.SupportsTransparentBackColor, true); SetStyle(ControlStyles.UserPaint, true); - - Text = null; + BackColor = Color.Transparent; DoubleBuffered = true; ForeColor = Color.White; - Font = new("Segoe UI", 8, FontStyle.Bold); + Font = new Font("Segoe UI", 8, FontStyle.Bold); } protected override void OnResize(EventArgs e) { base.OnResize(e); - Height = 20; - Width = 20; + Height = Width = Math.Max(20, Math.Max(Width, Height)); } protected override void OnPaint(PaintEventArgs e) @@ -106,15 +104,14 @@ protected override void OnPaint(PaintEventArgs e) base.OnPaint(e); Graphics _G = e.Graphics; string myString = _Value.ToString(); - _G.Clear(BackColor); _G.SmoothingMode = SmoothingMode.AntiAlias; - LinearGradientBrush LGB = new(new Rectangle(new Point(0, 0), new Size(18, 20)), _BGColorA, _BGColorB, 90f); + LinearGradientBrush LGB = new LinearGradientBrush(new Rectangle(new Point(0, 0), new Size(Width - 2, Height - 2)), _BGColorA, _BGColorB, 90f); // Fills the body with LGB gradient - _G.FillEllipse(LGB, new Rectangle(new Point(0, 0), new Size(18, 18))); + _G.FillEllipse(LGB, new Rectangle(new Point(1, 1), new Size(Width - 3, Height - 3))); // Draw border - _G.DrawEllipse(new(_BorderColor), new Rectangle(new Point(0, 0), new Size(18, 18))); - _G.DrawString(myString, Font, new SolidBrush(ForeColor), new Rectangle(0, 0, Width - 2, Height), new StringFormat + _G.DrawEllipse(new Pen(_BorderColor), new Rectangle(new Point(1, 1), new Size(Width - 3, Height - 3))); + _G.DrawString(myString, Font, new SolidBrush(ForeColor), new Rectangle(1, 1, Width - 2, Height - 2), new StringFormat { Alignment = StringAlignment.Center, LineAlignment = StringAlignment.Center @@ -125,4 +122,4 @@ protected override void OnPaint(PaintEventArgs e) } #endregion -} \ No newline at end of file +} diff --git a/CBH-WinForm-Theme-NET/Theme/Controls/Banner/CrEaTiiOn_Banner.cs b/CBH-WinForm-Theme-NET/Theme/Controls/Banner/CrEaTiiOn_Banner.cs new file mode 100644 index 0000000..2c0d6e6 --- /dev/null +++ b/CBH-WinForm-Theme-NET/Theme/Controls/Banner/CrEaTiiOn_Banner.cs @@ -0,0 +1,89 @@ +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Drawing.Text; +using System.Windows.Forms; + +namespace CBH.Controls +{ + public class CrEaTiiOn_Banner : Control + { + public CrEaTiiOn_Banner() + { + Size = new Size(100, 20); + SetStyle(ControlStyles.SupportsTransparentBackColor, true); + BackColor = Color.Transparent; + ForeColor = Color.White; + BannerColor = Color.FromArgb(15, 15, 15); + } + + public Color BorderColor { get; set; } + public Color BannerColor { get; set; } + + private PixelOffsetMode _pixelOffsetType = PixelOffsetMode.HighQuality; + public PixelOffsetMode PixelOffsetType + { + get => _pixelOffsetType; + set + { + _pixelOffsetType = value; + Invalidate(); + } + } + + private TextRenderingHint _textRenderingType = TextRenderingHint.ClearTypeGridFit; + public TextRenderingHint TextRenderingType + { + get => _textRenderingType; + set + { + _textRenderingType = value; + Invalidate(); + } + } + + protected override void OnPaint(PaintEventArgs e) + { + base.OnPaint(e); + + // Draw the banner + var list = new[] + { + new Point(0, Height / 10 * 5), + new Point(Height / 10, Height / 10 * 4), + new Point(Height / 10 * 2, Height / 10 * 3), + new Point(Height / 10 * 3, Height / 10 * 2), + new Point(Height / 10 * 4, Height / 10), + new Point(Height / 10 * 5, 0), + new Point(Width - Height / 10 * 5, 0), + new Point(Width - Height / 10 * 4, Height / 10), + new Point(Width - Height / 10 * 3, Height / 10 * 2), + new Point(Width - Height / 10 * 2, Height / 10 * 3), + new Point(Width - Height / 10, Height / 10 * 4), + new Point(Width, Height / 10 * 5), + new Point(Width - Height / 10, Height / 10 * 6), + new Point(Width - Height / 10 * 2, Height / 10 * 7), + new Point(Width - Height / 10 * 3, Height / 10 * 8), + new Point(Width - Height / 10 * 4, Height / 10 * 9), + new Point(Width - Height / 10 * 5, Height / 10 * 10), + new Point(Height / 10 * 5, Height / 10 * 10), + new Point(Height / 10 * 4, Height / 10 * 9), + new Point(Height / 10 * 3, Height / 10 * 8), + new Point(Height / 10 * 2, Height / 10 * 7), + new Point(Height / 10, Height / 10 * 6), + new Point(0, Height / 10 * 5) + }; + var brush = new SolidBrush(BannerColor); + e.Graphics.FillPolygon(brush, list); + + // Draw the text + var font = new Font(FontFamily.GenericSansSerif, Height / 4); + var stringFormat = new StringFormat() + { + Alignment = StringAlignment.Center, + LineAlignment = StringAlignment.Center + }; + brush = new SolidBrush(ForeColor); + e.Graphics.DrawString(Text, font, brush, ClientRectangle, stringFormat); + } + } +} diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Bubble/CrEaTiiOn_ChatBubbleLeft.cs b/CBH-WinForm-Theme-NET/Theme/Controls/Bubble/CrEaTiiOn_ChatBubbleLeft.cs similarity index 99% rename from CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Bubble/CrEaTiiOn_ChatBubbleLeft.cs rename to CBH-WinForm-Theme-NET/Theme/Controls/Bubble/CrEaTiiOn_ChatBubbleLeft.cs index 14bb3b3..d29f839 100644 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Bubble/CrEaTiiOn_ChatBubbleLeft.cs +++ b/CBH-WinForm-Theme-NET/Theme/Controls/Bubble/CrEaTiiOn_ChatBubbleLeft.cs @@ -94,7 +94,7 @@ public CrEaTiiOn_ChatBubbleLeft() DoubleBuffered = true; Size = new(120, 40); BackColor = Color.Transparent; - ForeColor = Color.White; + ForeColor = Color.Black; Font = new("Segoe UI", 10); } diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Bubble/CrEaTiiOn_ChatBubbleRight.cs b/CBH-WinForm-Theme-NET/Theme/Controls/Bubble/CrEaTiiOn_ChatBubbleRight.cs similarity index 99% rename from CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Bubble/CrEaTiiOn_ChatBubbleRight.cs rename to CBH-WinForm-Theme-NET/Theme/Controls/Bubble/CrEaTiiOn_ChatBubbleRight.cs index a3621a0..8635554 100644 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Bubble/CrEaTiiOn_ChatBubbleRight.cs +++ b/CBH-WinForm-Theme-NET/Theme/Controls/Bubble/CrEaTiiOn_ChatBubbleRight.cs @@ -106,7 +106,7 @@ public CrEaTiiOn_ChatBubbleRight() DoubleBuffered = true; Size = new(130, 40); BackColor = Color.Transparent; - ForeColor = Color.White; + ForeColor = Color.Black; Font = new("Segoe UI", 10); } diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Card/CrEaTiiOn_GradientCard.cs b/CBH-WinForm-Theme-NET/Theme/Controls/Card/CrEaTiiOn_GradientCard.cs similarity index 100% rename from CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Card/CrEaTiiOn_GradientCard.cs rename to CBH-WinForm-Theme-NET/Theme/Controls/Card/CrEaTiiOn_GradientCard.cs diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/CheckBox/CrEaTiiOn_CustomCheckBox.cs b/CBH-WinForm-Theme-NET/Theme/Controls/CheckBox/CrEaTiiOn_CustomCheckBox.cs similarity index 100% rename from CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/CheckBox/CrEaTiiOn_CustomCheckBox.cs rename to CBH-WinForm-Theme-NET/Theme/Controls/CheckBox/CrEaTiiOn_CustomCheckBox.cs diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/CheckBox/CrEaTiiOn_ModernCheckBox.cs b/CBH-WinForm-Theme-NET/Theme/Controls/CheckBox/CrEaTiiOn_ModernCheckBox.cs similarity index 100% rename from CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/CheckBox/CrEaTiiOn_ModernCheckBox.cs rename to CBH-WinForm-Theme-NET/Theme/Controls/CheckBox/CrEaTiiOn_ModernCheckBox.cs diff --git a/CBH-WinForm-Theme-NET/Theme/Controls/Color Controls/Classes/ColorChangedEventArgs.cs b/CBH-WinForm-Theme-NET/Theme/Controls/Color Controls/Classes/ColorChangedEventArgs.cs new file mode 100644 index 0000000..b5381ec --- /dev/null +++ b/CBH-WinForm-Theme-NET/Theme/Controls/Color Controls/Classes/ColorChangedEventArgs.cs @@ -0,0 +1,39 @@ +using System; +using System.Drawing; + +namespace CBH.Controls +{ + public class ColorChangedEventArgs : EventArgs + { + private Color selectedColor; + private HslColor selectedHslColor; + + public ColorChangedEventArgs(Color selectedColor) + { + this.selectedColor = selectedColor; + this.selectedHslColor = HslColor.FromColor(selectedColor); + } + + public ColorChangedEventArgs(HslColor selectedHslColor) + { + this.selectedColor = selectedHslColor.RgbValue; + this.selectedHslColor = selectedHslColor; + } + + public Color SelectedColor + { + get + { + return this.selectedColor; + } + } + + public HslColor SelectedHslColor + { + get + { + return this.selectedHslColor; + } + } + } +} diff --git a/CBH-WinForm-Theme-NET/Theme/Controls/Color Controls/Classes/ColorModes.cs b/CBH-WinForm-Theme-NET/Theme/Controls/Color Controls/Classes/ColorModes.cs new file mode 100644 index 0000000..81d44b0 --- /dev/null +++ b/CBH-WinForm-Theme-NET/Theme/Controls/Color Controls/Classes/ColorModes.cs @@ -0,0 +1,13 @@ +namespace CBH.Controls +{ + public enum ColorModes + { + Red, + Green, + Blue, + Hue, + Saturation, + Luminance + } + +} diff --git a/CBH-WinForm-Theme-NET/Theme/Controls/Color Controls/Classes/HslColor.cs b/CBH-WinForm-Theme-NET/Theme/Controls/Color Controls/Classes/HslColor.cs new file mode 100644 index 0000000..0972f4e --- /dev/null +++ b/CBH-WinForm-Theme-NET/Theme/Controls/Color Controls/Classes/HslColor.cs @@ -0,0 +1,352 @@ +using System.ComponentModel; +using System.Drawing; +using System.Runtime.InteropServices; + +namespace CBH.Controls +{ + [StructLayout(LayoutKind.Sequential)] + public struct HslColor + { + public static readonly HslColor Empty; + private double hue; + private double saturation; + private double luminance; + private int alpha; + + public HslColor(int a, double h, double s, double l) + { + this.alpha = a; + this.hue = h; + this.saturation = s; + this.luminance = l; + this.A = a; + this.H = this.hue; + this.S = this.saturation; + this.L = this.luminance; + } + + public HslColor(double h, double s, double l) + { + this.alpha = 0xff; + this.hue = h; + this.saturation = s; + this.luminance = l; + } + + public HslColor(Color color) + { + this.alpha = color.A; + this.hue = 0.0; + this.saturation = 0.0; + this.luminance = 0.0; + this.RGBtoHSL(color); + } + + public static HslColor FromArgb(int a, int r, int g, int b) + { + return new HslColor(Color.FromArgb(a, r, g, b)); + } + + public static HslColor FromColor(Color color) + { + return new HslColor(color); + } + + public static HslColor FromAhsl(int a) + { + return new HslColor(a, 0.0, 0.0, 0.0); + } + + public static HslColor FromAhsl(int a, HslColor hsl) + { + return new HslColor(a, hsl.hue, hsl.saturation, hsl.luminance); + } + + public static HslColor FromAhsl(double h, double s, double l) + { + return new HslColor(0xff, h, s, l); + } + + public static HslColor FromAhsl(int a, double h, double s, double l) + { + return new HslColor(a, h, s, l); + } + + public static bool operator ==(HslColor left, HslColor right) + { + return (((left.A == right.A) && (left.H == right.H)) && ((left.S == right.S) && (left.L == right.L))); + } + + public static bool operator !=(HslColor left, HslColor right) + { + return !(left == right); + } + + public override bool Equals(object obj) + { + if (obj is HslColor) + { + HslColor color = (HslColor)obj; + if (((this.A == color.A) && (this.H == color.H)) && ((this.S == color.S) && (this.L == color.L))) + { + return true; + } + } + return false; + } + + public override int GetHashCode() + { + return (((this.alpha.GetHashCode() ^ this.hue.GetHashCode()) ^ this.saturation.GetHashCode()) ^ this.luminance.GetHashCode()); + } + + [DefaultValue((double)0.0), Category("Appearance"), Description("H Channel value")] + public double H + { + get + { + return this.hue; + } + set + { + this.hue = value; + this.hue = (this.hue > 1.0) ? 1.0 : ((this.hue < 0.0) ? 0.0 : this.hue); + } + } + [Category("Appearance"), Description("S Channel value"), DefaultValue((double)0.0)] + public double S + { + get + { + return this.saturation; + } + set + { + this.saturation = value; + this.saturation = (this.saturation > 1.0) ? 1.0 : ((this.saturation < 0.0) ? 0.0 : this.saturation); + } + } + [Category("Appearance"), Description("L Channel value"), DefaultValue((double)0.0)] + public double L + { + get + { + return this.luminance; + } + set + { + this.luminance = value; + this.luminance = (this.luminance > 1.0) ? 1.0 : ((this.luminance < 0.0) ? 0.0 : this.luminance); + } + } + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public Color RgbValue + { + get + { + return this.HSLtoRGB(); + } + set + { + this.RGBtoHSL(value); + } + } + public int A + { + get + { + return this.alpha; + } + set + { + this.alpha = (value > 0xff) ? 0xff : ((value < 0) ? 0 : value); + } + } + public bool IsEmpty + { + get + { + return ((((this.alpha == 0) && (this.H == 0.0)) && (this.S == 0.0)) && (this.L == 0.0)); + } + } + + public Color ToRgbColor() + { + return this.ToRgbColor(this.A); + } + + public Color ToRgbColor(int alpha) + { + double q; + if (this.L < 0.5) + { + q = this.L * (1 + this.S); + } + else + { + q = this.L + this.S - (this.L * this.S); + } + double p = 2 * this.L - q; + double hk = this.H / 360; + + // r,g,b colors + double[] tc = new[] + { + hk + (1d / 3d), hk, hk - (1d / 3d) + }; + double[] colors = new[] + { + 0.0, 0.0, 0.0 + }; + + for (int color = 0; color < colors.Length; color++) + { + if (tc[color] < 0) + { + tc[color] += 1; + } + if (tc[color] > 1) + { + tc[color] -= 1; + } + + if (tc[color] < (1d / 6d)) + { + colors[color] = p + ((q - p) * 6 * tc[color]); + } + else if (tc[color] >= (1d / 6d) && tc[color] < (1d / 2d)) + { + colors[color] = q; + } + else if (tc[color] >= (1d / 2d) && tc[color] < (2d / 3d)) + { + colors[color] = p + ((q - p) * 6 * (2d / 3d - tc[color])); + } + else + { + colors[color] = p; + } + + colors[color] *= 255; + } + + return Color.FromArgb(alpha, (int)colors[0], (int)colors[1], (int)colors[2]); + } + + private Color HSLtoRGB() + { + int num2; + int red = this.Round(this.luminance * 255.0); + int blue = this.Round(((1.0 - this.saturation) * (this.luminance / 1.0)) * 255.0); + double num4 = ((double)(red - blue)) / 255.0; + if ((this.hue >= 0.0) && (this.hue <= 0.16666666666666666)) + { + num2 = this.Round((((this.hue - 0.0) * num4) * 1530.0) + blue); + return Color.FromArgb(this.alpha, red, num2, blue); + } + if (this.hue <= 0.33333333333333331) + { + num2 = this.Round((-((this.hue - 0.16666666666666666) * num4) * 1530.0) + red); + return Color.FromArgb(this.alpha, num2, red, blue); + } + if (this.hue <= 0.5) + { + num2 = this.Round((((this.hue - 0.33333333333333331) * num4) * 1530.0) + blue); + return Color.FromArgb(this.alpha, blue, red, num2); + } + if (this.hue <= 0.66666666666666663) + { + num2 = this.Round((-((this.hue - 0.5) * num4) * 1530.0) + red); + return Color.FromArgb(this.alpha, blue, num2, red); + } + if (this.hue <= 0.83333333333333337) + { + num2 = this.Round((((this.hue - 0.66666666666666663) * num4) * 1530.0) + blue); + return Color.FromArgb(this.alpha, num2, blue, red); + } + if (this.hue <= 1.0) + { + num2 = this.Round((-((this.hue - 0.83333333333333337) * num4) * 1530.0) + red); + return Color.FromArgb(this.alpha, red, blue, num2); + } + return Color.FromArgb(this.alpha, 0, 0, 0); + } + + private void RGBtoHSL(Color color) + { + int r; + int g; + double num4; + this.alpha = color.A; + if (color.R > color.G) + { + r = color.R; + g = color.G; + } + else + { + r = color.G; + g = color.R; + } + if (color.B > r) + { + r = color.B; + } + else if (color.B < g) + { + g = color.B; + } + int num3 = r - g; + this.luminance = ((double)r) / 255.0; + if (r == 0) + { + this.saturation = 0.0; + } + else + { + this.saturation = ((double)num3) / ((double)r); + } + if (num3 == 0) + { + num4 = 0.0; + } + else + { + num4 = 60.0 / ((double)num3); + } + if (r == color.R) + { + if (color.G < color.B) + { + this.hue = (360.0 + (num4 * (color.G - color.B))) / 360.0; + } + else + { + this.hue = (num4 * (color.G - color.B)) / 360.0; + } + } + else if (r == color.G) + { + this.hue = (120.0 + (num4 * (color.B - color.R))) / 360.0; + } + else if (r == color.B) + { + this.hue = (240.0 + (num4 * (color.R - color.G))) / 360.0; + } + else + { + this.hue = 0.0; + } + } + + private int Round(double val) + { + return (int)(val + 0.5); + } + + static HslColor() + { + Empty = new HslColor(); + } + } +} diff --git a/CBH-WinForm-Theme-NET/Theme/Controls/Color Controls/Classes/MathExtensions.cs b/CBH-WinForm-Theme-NET/Theme/Controls/Color Controls/Classes/MathExtensions.cs new file mode 100644 index 0000000..f81413d --- /dev/null +++ b/CBH-WinForm-Theme-NET/Theme/Controls/Color Controls/Classes/MathExtensions.cs @@ -0,0 +1,23 @@ +namespace CBH.Controls +{ + internal static class MathExtensions + { + public static int Round(double val) + { + int num = (int)val; + int num2 = (int)(val * 100.0); + if ((num2 % 100) >= 50) + { + num++; + } + return num; + } + + public static int LimitToRange(int value, int inclusiveMinimum, int inclusiveMaximum) + { + if (value < inclusiveMinimum) { return inclusiveMinimum; } + if (value > inclusiveMaximum) { return inclusiveMaximum; } + return value; + } + } +} diff --git a/CBH-Ultimate-Theme-Library/MainForm.Designer.cs b/CBH-WinForm-Theme-NET/Theme/Controls/Color Controls/CrEaTiiOn_ColorBox2D.Designer.cs similarity index 50% rename from CBH-Ultimate-Theme-Library/MainForm.Designer.cs rename to CBH-WinForm-Theme-NET/Theme/Controls/Color Controls/CrEaTiiOn_ColorBox2D.Designer.cs index 9164d44..3266096 100644 --- a/CBH-Ultimate-Theme-Library/MainForm.Designer.cs +++ b/CBH-WinForm-Theme-NET/Theme/Controls/Color Controls/CrEaTiiOn_ColorBox2D.Designer.cs @@ -1,6 +1,6 @@ -namespace CBH_Ultimate_Theme_Library +namespace CBH.Controls { - partial class MainForm + partial class CrEaTiiOn_ColorBox2D { /// /// Required designer variable. @@ -20,33 +20,18 @@ protected override void Dispose(bool disposing) base.Dispose(disposing); } - #region Windows Form Designer generated code + #region Component Designer generated code /// - /// Required method for Designer support - do not modify + /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// private void InitializeComponent() { - this.SuspendLayout(); - // - // MainForm - // - this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); + components = new System.ComponentModel.Container(); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(25)))), ((int)(((byte)(25))))); - this.ClientSize = new System.Drawing.Size(800, 450); - this.ForeColor = System.Drawing.Color.White; - this.Name = "MainForm"; - this.Text = "Form1"; - this.ResumeLayout(false); - } #endregion - - private CBH.Controls.CrEaTiiOn_ExtendedFileSystemWatcher extendedFileSystemWatcher1; - private CBH.Controls.CrEaTiiOn_ControlBox crEaTiiOn_ControlBox1; - private Zeroit.CBH.Controls.CrEaTiiOn_FlatControlBox crEaTiiOn_FlatControlBox1; } -} \ No newline at end of file +} diff --git a/CBH-WinForm-Theme-NET/Theme/Controls/Color Controls/CrEaTiiOn_ColorBox2D.cs b/CBH-WinForm-Theme-NET/Theme/Controls/Color Controls/CrEaTiiOn_ColorBox2D.cs new file mode 100644 index 0000000..fb8df36 --- /dev/null +++ b/CBH-WinForm-Theme-NET/Theme/Controls/Color Controls/CrEaTiiOn_ColorBox2D.cs @@ -0,0 +1,308 @@ +using System.ComponentModel; +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Windows.Forms; + +namespace CBH.Controls +{ + [DefaultEvent("ColorChanged")] + public partial class CrEaTiiOn_ColorBox2D : UserControl + { + + #region Events + public delegate void ColorChangedEventHandler(object sender, ColorChangedEventArgs args); + public event ColorChangedEventHandler ColorChanged; + + #endregion + + #region Fields + + private HslColor colorHSL; + private ColorModes colorMode; + private Color colorRGB = Color.Empty; + private Point markerPoint = Point.Empty; + private bool mouseMoving; + + #endregion + + #region Properties + public ColorModes ColorMode + { + get { return this.colorMode; } + set + { + this.colorMode = value; + this.ResetMarker(); + this.Refresh(); + } + } + + public HslColor ColorHSL + { + get { return this.colorHSL; } + set + { + this.colorHSL = value; + this.colorRGB = this.colorHSL.RgbValue; + this.ResetMarker(); + this.Refresh(); + } + } + + public Color ColorRGB + { + get { return this.colorRGB; } + set + { + this.colorRGB = value; + this.colorHSL = HslColor.FromColor(this.colorRGB); + this.ResetMarker(); + this.Refresh(); + } + } + + #endregion + + #region Constructors + + public CrEaTiiOn_ColorBox2D() + { + InitializeComponent(); + base.SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint, true); + + this.colorHSL = HslColor.FromAhsl(1.0, 1.0, 1.0); + this.colorRGB = this.colorHSL.RgbValue; + this.colorMode = ColorModes.Hue; + } + + #endregion + + #region Overriden Methods + + protected override void OnMouseDown(MouseEventArgs e) + { + base.OnMouseDown(e); + this.mouseMoving = true; + this.SetMarker(e.X, e.Y); + } + + protected override void OnMouseMove(MouseEventArgs e) + { + base.OnMouseMove(e); + if (this.mouseMoving) + { + this.SetMarker(e.X, e.Y); + } + } + + protected override void OnMouseUp(MouseEventArgs e) + { + base.OnMouseUp(e); + this.mouseMoving = false; + } + + protected override void OnPaint(PaintEventArgs e) + { + base.OnPaint(e); + HslColor color = HslColor.FromAhsl(0xff); + HslColor color2 = HslColor.FromAhsl(0xff); + switch (this.ColorMode) + { + case ColorModes.Hue: + color.H = this.ColorHSL.H; + color2.H = this.ColorHSL.H; + color.S = 0.0; + color2.S = 1.0; + break; + + case ColorModes.Saturation: + color.S = this.ColorHSL.S; + color2.S = this.ColorHSL.S; + color.L = 1.0; + color2.L = 0.0; + break; + + case ColorModes.Luminance: + color.L = this.ColorHSL.L; + color2.L = this.ColorHSL.L; + color.S = 1.0; + color2.S = 0.0; + break; + } + for (int i = 0; i < (base.Height - 4); i++) + { + int green = MathExtensions.Round(255.0 - ((255.0 * i) / ((double)(base.Height - 4)))); + Color empty = Color.Empty; + Color rgbValue = Color.Empty; + switch (this.ColorMode) + { + case ColorModes.Red: + empty = Color.FromArgb(this.ColorRGB.R, green, 0); + rgbValue = Color.FromArgb(this.ColorRGB.R, green, 0xff); + break; + + case ColorModes.Green: + empty = Color.FromArgb(green, this.ColorRGB.G, 0); + rgbValue = Color.FromArgb(green, this.ColorRGB.G, 0xff); + break; + + case ColorModes.Blue: + empty = Color.FromArgb(0, green, this.ColorRGB.B); + rgbValue = Color.FromArgb(0xff, green, this.ColorRGB.B); + break; + + case ColorModes.Hue: + color2.L = color.L = 1.0 - (((double)i) / ((double)(base.Height - 4))); + empty = color.RgbValue; + rgbValue = color2.RgbValue; + break; + + case ColorModes.Saturation: + case ColorModes.Luminance: + color2.H = color.H = ((double)i) / ((double)(base.Width - 4)); + empty = color.RgbValue; + rgbValue = color2.RgbValue; + break; + } + + Rectangle rect = new Rectangle(2, 2, base.Width - 4, 1); + Rectangle rectangle2 = new Rectangle(2, i + 2, base.Width - 4, 1); + if ((this.ColorMode == ColorModes.Saturation) || (this.ColorMode == ColorModes.Luminance)) + { + rect = new Rectangle(2, 2, 1, base.Height - 4); + rectangle2 = new Rectangle(i + 2, 2, 1, base.Height - 4); + using (LinearGradientBrush brush = new LinearGradientBrush(rect, empty, rgbValue, 90f, false)) + { + e.Graphics.FillRectangle(brush, rectangle2); + continue; + } + } + using (LinearGradientBrush brush2 = new LinearGradientBrush(rect, empty, rgbValue, 0f, false)) + { + e.Graphics.FillRectangle(brush2, rectangle2); + } + } + Pen white = Pens.White; + if (this.colorHSL.L >= 0.78431372549019607) + { + if ((this.colorHSL.H < 0.072222222222222215) || (this.colorHSL.H > 0.55555555555555558)) + { + if (this.colorHSL.S <= 0.27450980392156865) + { + white = Pens.Black; + } + } + else + { + white = Pens.Black; + } + } + e.Graphics.DrawEllipse(white, this.markerPoint.X - 5, this.markerPoint.Y - 5, 10, 10); + } + + + #endregion + + #region Private Methods + + private HslColor GetColor(int x, int y) + { + int num; + int num2; + int num3; + HslColor color = HslColor.FromAhsl(0xff); + switch (this.ColorMode) + { + case ColorModes.Red: + num2 = MathExtensions.Round(255.0 * (1.0 - (((double)y) / ((double)(base.Height - 4))))); + num3 = MathExtensions.Round((255.0 * x) / ((double)(base.Width - 4))); + return HslColor.FromColor(Color.FromArgb(this.colorRGB.R, num2, num3)); + + case ColorModes.Green: + num = MathExtensions.Round(255.0 * (1.0 - (((double)y) / ((double)(base.Height - 4))))); + num3 = MathExtensions.Round((255.0 * x) / ((double)(base.Width - 4))); + return HslColor.FromColor(Color.FromArgb(num, this.colorRGB.G, num3)); + + case ColorModes.Blue: + num = MathExtensions.Round((255.0 * x) / ((double)(base.Width - 4))); + num2 = MathExtensions.Round(255.0 * (1.0 - (((double)y) / ((double)(base.Height - 4))))); + return HslColor.FromColor(Color.FromArgb(num, num2, this.colorRGB.B)); + + case ColorModes.Hue: + color.H = this.colorHSL.H; + color.S = ((double)x) / ((double)(base.Width - 4)); + color.L = 1.0 - (((double)y) / ((double)(base.Height - 4))); + return color; + + case ColorModes.Saturation: + color.S = this.colorHSL.S; + color.H = ((double)x) / ((double)(base.Width - 4)); + color.L = 1.0 - (((double)y) / ((double)(base.Height - 4))); + return color; + + case ColorModes.Luminance: + color.L = this.colorHSL.L; + color.H = ((double)x) / ((double)(base.Width - 4)); + color.S = 1.0 - (((double)y) / ((double)(base.Height - 4))); + return color; + } + return color; + } + + private void ResetMarker() + { + switch (this.colorMode) + { + case ColorModes.Red: + this.markerPoint.X = MathExtensions.Round(((base.Width - 4) * this.colorRGB.B) / 255.0); + this.markerPoint.Y = MathExtensions.Round((base.Height - 4) * (1.0 - (((double)this.colorRGB.G) / 255.0))); + return; + + case ColorModes.Green: + this.markerPoint.X = MathExtensions.Round(((base.Width - 4) * this.colorRGB.B) / 255.0); + this.markerPoint.Y = MathExtensions.Round((base.Height - 4) * (1.0 - (((double)this.colorRGB.R) / 255.0))); + return; + + case ColorModes.Blue: + this.markerPoint.X = MathExtensions.Round(((base.Width - 4) * this.colorRGB.R) / 255.0); + this.markerPoint.Y = MathExtensions.Round((base.Height - 4) * (1.0 - (((double)this.colorRGB.G) / 255.0))); + return; + + case ColorModes.Hue: + this.markerPoint.X = MathExtensions.Round((base.Width - 4) * this.colorHSL.S); + this.markerPoint.Y = MathExtensions.Round((base.Height - 4) * (1.0 - this.colorHSL.L)); + return; + + case ColorModes.Saturation: + this.markerPoint.X = MathExtensions.Round((base.Width - 4) * this.colorHSL.H); + this.markerPoint.Y = MathExtensions.Round((base.Height - 4) * (1.0 - this.colorHSL.L)); + return; + + case ColorModes.Luminance: + this.markerPoint.X = MathExtensions.Round((base.Width - 4) * this.colorHSL.H); + this.markerPoint.Y = MathExtensions.Round((base.Height - 4) * (1.0 - this.colorHSL.S)); + return; + } + } + + private void SetMarker(int x, int y) + { + x = MathExtensions.LimitToRange(x, 0, base.Width - 4); + y = MathExtensions.LimitToRange(y, 0, base.Height - 4); + if ((this.markerPoint.X != x) || (this.markerPoint.Y != y)) + { + this.markerPoint = new Point(x, y); + this.colorHSL = this.GetColor(x, y); + this.colorRGB = this.colorHSL.RgbValue; + this.Refresh(); + if (this.ColorChanged != null) + { + this.ColorChanged(this, new ColorChangedEventArgs(this.colorRGB)); + } + } + } + + #endregion + + } +} \ No newline at end of file diff --git a/CBH-WinForm-Theme-NET/Theme/Controls/Color Controls/CrEaTiiOn_ColorHexagon.Designer.cs b/CBH-WinForm-Theme-NET/Theme/Controls/Color Controls/CrEaTiiOn_ColorHexagon.Designer.cs new file mode 100644 index 0000000..cd11e22 --- /dev/null +++ b/CBH-WinForm-Theme-NET/Theme/Controls/Color Controls/CrEaTiiOn_ColorHexagon.Designer.cs @@ -0,0 +1,36 @@ +namespace CBH.Controls +{ + partial class CrEaTiiOn_ColorHexagon + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + components = new System.ComponentModel.Container(); + } + + #endregion + } +} diff --git a/CBH-WinForm-Theme-NET/Theme/Controls/Color Controls/CrEaTiiOn_ColorHexagon.cs b/CBH-WinForm-Theme-NET/Theme/Controls/Color Controls/CrEaTiiOn_ColorHexagon.cs new file mode 100644 index 0000000..0570fac --- /dev/null +++ b/CBH-WinForm-Theme-NET/Theme/Controls/Color Controls/CrEaTiiOn_ColorHexagon.cs @@ -0,0 +1,400 @@ +using System; +using System.ComponentModel; +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Windows.Forms; + +namespace CBH.Controls +{ + [DefaultEvent("ColorChanged")] + public partial class CrEaTiiOn_ColorHexagon : UserControl + { + # region Fields + private const float COEFFCIENT = 0.824f; + private ColorHexagonElement[] hexagonElements = new ColorHexagonElement[0x93]; + private float[] matrix1 = new float[] { -0.5f, -1f, -0.5f, 0.5f, 1f, 0.5f }; + private float[] matrix2 = new float[] { 0.824f, 0f, -0.824f, -0.824f, 0f, 0.824f }; + private int oldSelectedHexagonIndex = -1; + private int sectorMaximum = 7; + private int selectedHexagonIndex = -1; + #endregion + + #region Events + public delegate void ColorChangedEventHandler(object sender, ColorChangedEventArgs args); + public event ColorChangedEventHandler ColorChanged; + + #endregion + + #region Properties + public Color SelectedColor + { + get + { + if (this.selectedHexagonIndex < 0) + { + return Color.Empty; + } + return this.hexagonElements[this.selectedHexagonIndex].CurrentColor; + } + } + #endregion + + #region Constructors + public CrEaTiiOn_ColorHexagon() + { + base.SetStyle(ControlStyles.AllPaintingInWmPaint, true); + base.SetStyle(ControlStyles.UserPaint, true); + base.SetStyle(ControlStyles.Opaque, true); + base.SetStyle(ControlStyles.OptimizedDoubleBuffer, true); + base.SetStyle(ControlStyles.ResizeRedraw, true); + base.SetStyle(ControlStyles.SupportsTransparentBackColor, true); + for (int i = 0; i < this.hexagonElements.Length; i++) + { + this.hexagonElements[i] = new ColorHexagonElement(); + } + + InitializeComponent(); + } + #endregion + + #region Methods/Functions + private void DrawHexagonHighlighter(int selectedHexagonIndex) + { + if (selectedHexagonIndex != this.oldSelectedHexagonIndex) + { + if (this.oldSelectedHexagonIndex >= 0) + { + this.hexagonElements[this.oldSelectedHexagonIndex].IsHovered = false; + base.Invalidate(this.hexagonElements[this.oldSelectedHexagonIndex].BoundingRectangle); + } + this.oldSelectedHexagonIndex = selectedHexagonIndex; + if (this.oldSelectedHexagonIndex >= 0) + { + this.hexagonElements[this.oldSelectedHexagonIndex].IsHovered = true; + base.Invalidate(this.hexagonElements[this.oldSelectedHexagonIndex].BoundingRectangle); + } + } + } + + private int GetHexagonIndexFromCoordinates(int xCoordinate, int yCoordinate) + { + for (int i = 0; i < this.hexagonElements.Length; i++) + { + if (this.hexagonElements[i].BoundingRectangle.Contains(xCoordinate, yCoordinate)) + { + return i; + } + } + return -1; + } + + private int GetHexgaonWidth(int availableHeight) + { + int num = availableHeight / (2 * this.sectorMaximum); + if ((((int)Math.Floor((double)(((double)num) / 2.0))) * 2) < num) + { + num--; + } + return num; + } + + private void InitializeGrayscaleHexagons(ref Rectangle clientRectangle, int hexagonWidth, + ref int centerOfMiddleHexagonX, ref int centerOfMiddleHexagonY, + ref int index) + { + int red = 0xff; + int num4 = 0x11; + int num3 = 0x10; + int num5 = (((clientRectangle.Width - (7 * hexagonWidth)) / 2) + clientRectangle.X) - (hexagonWidth / 3); + + centerOfMiddleHexagonX = num5; + centerOfMiddleHexagonY = clientRectangle.Bottom; + for (int i = 0; i < num3; i++) + { + this.hexagonElements[index].CurrentColor = Color.FromArgb(red, red, red); + this.hexagonElements[index].SetHexagonPoints((float)centerOfMiddleHexagonX, (float)centerOfMiddleHexagonY, hexagonWidth); + centerOfMiddleHexagonX += hexagonWidth; + index++; + if (i == 7) + { + centerOfMiddleHexagonX = num5 + (hexagonWidth / 2); + centerOfMiddleHexagonY += (int)(hexagonWidth * 0.824f); + } + red -= num4; + } + } + + private void InitializeHexagons() + { + Rectangle clientRectangle = base.ClientRectangle; + clientRectangle.Offset(0, -8); + if (clientRectangle.Height < clientRectangle.Width) + { + clientRectangle.Inflate(-(clientRectangle.Width - clientRectangle.Height) / 2, 0); + } + else + { + clientRectangle.Inflate(0, -(clientRectangle.Height - clientRectangle.Width) / 2); + } + + int hexagonWidth = this.GetHexgaonWidth(Math.Min(clientRectangle.Height, clientRectangle.Width)); + int centerOfMiddleHexagonX = (clientRectangle.Left + clientRectangle.Right) / 2; + int centerOfMiddleHexagonY = (clientRectangle.Top + clientRectangle.Bottom) / 2; + + centerOfMiddleHexagonY -= hexagonWidth; + this.hexagonElements[0].CurrentColor = Color.White; + this.hexagonElements[0].SetHexagonPoints((float)centerOfMiddleHexagonX, (float)centerOfMiddleHexagonY, hexagonWidth); + int index = 1; + for (int i = 1; i < this.sectorMaximum; i++) + { + float yCoordinate = centerOfMiddleHexagonY; + float xCoordinate = centerOfMiddleHexagonX + (hexagonWidth * i); + for (int j = 0; j < (this.sectorMaximum - 1); j++) + { + int num9 = (int)(hexagonWidth * this.matrix2[j]); + int num10 = (int)(hexagonWidth * this.matrix1[j]); + for (int k = 0; k < i; k++) + { + double num12 = ((0.936 * (this.sectorMaximum - i)) / ((double)this.sectorMaximum)) + 0.12; + float colorQuotient = GetColorQuotient(xCoordinate - centerOfMiddleHexagonX, yCoordinate - centerOfMiddleHexagonY); + this.hexagonElements[index].SetHexagonPoints(xCoordinate, yCoordinate, hexagonWidth); + this.hexagonElements[index].CurrentColor = ColorFromRGBRatios((double)colorQuotient, num12, 1.0); + yCoordinate += num9; + xCoordinate += num10; + index++; + } + } + } + clientRectangle.Y -= hexagonWidth + (hexagonWidth / 2); + this.InitializeGrayscaleHexagons(ref clientRectangle, hexagonWidth, ref centerOfMiddleHexagonX, ref centerOfMiddleHexagonY, ref index); + } + + #endregion + + #region Overridden Methods + + protected override void OnMouseDown(MouseEventArgs e) + { + if (e.Button == MouseButtons.Left) + { + if (this.selectedHexagonIndex >= 0) + { + this.hexagonElements[this.selectedHexagonIndex].IsSelected = false; + base.Invalidate(this.hexagonElements[this.selectedHexagonIndex].BoundingRectangle); + } + this.selectedHexagonIndex = -1; + if (this.oldSelectedHexagonIndex >= 0) + { + this.selectedHexagonIndex = this.oldSelectedHexagonIndex; + this.hexagonElements[this.selectedHexagonIndex].IsSelected = true; + if (this.ColorChanged != null) + { + this.ColorChanged(this, new ColorChangedEventArgs(this.SelectedColor)); + } + base.Invalidate(this.hexagonElements[this.selectedHexagonIndex].BoundingRectangle); + } + } + base.OnMouseDown(e); + } + + protected override void OnMouseLeave(EventArgs e) + { + base.OnMouseLeave(e); + this.DrawHexagonHighlighter(-1); + } + + protected override void OnMouseMove(MouseEventArgs e) + { + base.OnMouseMove(e); + this.DrawHexagonHighlighter(this.GetHexagonIndexFromCoordinates(e.X, e.Y)); + } + + protected override void OnPaint(PaintEventArgs e) + { + if (this.BackColor == Color.Transparent) + { + base.OnPaintBackground(e); + } + + Graphics g = e.Graphics; + using (SolidBrush brush = new SolidBrush(this.BackColor)) + { + g.FillRectangle(brush, base.ClientRectangle); + } + + g.SmoothingMode = SmoothingMode.AntiAlias; + foreach (ColorHexagonElement element in this.hexagonElements) + { + element.Paint(g); + } + + if (this.oldSelectedHexagonIndex >= 0) + { + this.hexagonElements[this.oldSelectedHexagonIndex].Paint(g); + } + if (this.selectedHexagonIndex >= 0) + { + this.hexagonElements[this.selectedHexagonIndex].Paint(g); + } + base.OnPaint(e); + } + + protected override void OnResize(EventArgs e) + { + this.InitializeHexagons(); + base.OnResize(e); + } + + #endregion + + #region Color Helper Functions + private static float GetColorQuotient(float value1, float value2) + { + return (float)((Math.Atan2((double)value2, (double)value1) * 180.0) / 3.1415926535897931); + } + + private static int GetColorChannelValue(float value1, float value2, float value3) + { + if (value3 > 360f) + { + value3 -= 360f; + } + else if (value3 < 0f) + { + value3 += 360f; + } + if (value3 < 60f) + { + value1 += ((value2 - value1) * value3) / 60f; + } + else if (value3 < 180f) + { + value1 = value2; + } + else if (value3 < 240f) + { + value1 += ((value2 - value1) * (240f - value3)) / 60f; + } + return (int)(value1 * 255f); + } + + private static Color ColorFromRGBRatios(double value1, double value2, double value3) + { + int num; + int num2; + int num3; + if (value3 == 0.0) + { + num = num2 = num3 = (int)(value2 * 255.0); + } + else + { + float num4; + if (value2 <= 0.5) + { + num4 = (float)(value2 + (value2 * value3)); + } + else + { + num4 = (float)((value2 + value3) - (value2 * value3)); + } + float num5 = ((float)(2.0 * value2)) - num4; + num = GetColorChannelValue(num5, num4, (float)(value1 + 120.0)); + num2 = GetColorChannelValue(num5, num4, (float)value1); + num3 = GetColorChannelValue(num5, num4, (float)(value1 - 120.0)); + } + return Color.FromArgb(num, num2, num3); + } + #endregion + + } + + #region HexagaonElement Class + internal class ColorHexagonElement + { + #region Fields + + private Rectangle boundingRect = Rectangle.Empty; + private Color hexagonColor = Color.Empty; + private Point[] hexagonPoints = new Point[6]; + private bool isHovered; + private bool isSelected; + + #endregion + + #region Methods + + public void Paint(Graphics g) + { + GraphicsPath path = new GraphicsPath(); + path.AddPolygon(this.hexagonPoints); + path.CloseAllFigures(); + using (SolidBrush brush = new SolidBrush(this.hexagonColor)) + { + g.FillPath(brush, path); + } + if (this.isHovered || this.isSelected) + { + SmoothingMode smoothingMode = g.SmoothingMode; + g.SmoothingMode = SmoothingMode.AntiAlias; + using (Pen pen = new Pen(Color.FromArgb(0x2a, 0x5b, 150), 2f)) + { + g.DrawPath(pen, path); + } + using (Pen pen2 = new Pen(Color.FromArgb(150, 0xb1, 0xef), 1f)) + { + g.DrawPath(pen2, path); + } + g.SmoothingMode = smoothingMode; + } + path.Dispose(); + } + + public void SetHexagonPoints(float xCoordinate, float yCoordinate, int hexagonWidth) + { + float num = hexagonWidth * 0.5773503f; + this.hexagonPoints[0] = new Point((int)Math.Floor((double)(xCoordinate - (hexagonWidth / 2))), ((int)Math.Floor((double)(yCoordinate - (num / 2f)))) - 1); + this.hexagonPoints[1] = new Point((int)Math.Floor((double)xCoordinate), ((int)Math.Floor((double)(yCoordinate - (hexagonWidth / 2)))) - 1); + this.hexagonPoints[2] = new Point((int)Math.Floor((double)(xCoordinate + (hexagonWidth / 2))), ((int)Math.Floor((double)(yCoordinate - (num / 2f)))) - 1); + this.hexagonPoints[3] = new Point((int)Math.Floor((double)(xCoordinate + (hexagonWidth / 2))), ((int)Math.Floor((double)(yCoordinate + (num / 2f)))) + 1); + this.hexagonPoints[4] = new Point((int)Math.Floor((double)xCoordinate), ((int)Math.Floor((double)(yCoordinate + (hexagonWidth / 2)))) + 1); + this.hexagonPoints[5] = new Point((int)Math.Floor((double)(xCoordinate - (hexagonWidth / 2))), ((int)Math.Floor((double)(yCoordinate + (num / 2f)))) + 1); + using (GraphicsPath path = new GraphicsPath()) + { + path.AddPolygon(this.hexagonPoints); + this.boundingRect = Rectangle.Round(path.GetBounds()); + this.boundingRect.Inflate(2, 2); + } + } + + #endregion + + #region Properties + + public Rectangle BoundingRectangle + { + get { return this.boundingRect; } + } + + public Color CurrentColor + { + get { return this.hexagonColor; } + set { this.hexagonColor = value; } + } + + public bool IsHovered + { + get { return this.isHovered; } + set { this.isHovered = value; } + } + + public bool IsSelected + { + get { return this.isSelected; } + set { this.isSelected = value; } + } + + #endregion + } + #endregion +} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/MainForm.Designer.cs b/CBH-WinForm-Theme-NET/Theme/Controls/Color Controls/CrEaTiiOn_ColorSliderVertical.Designer.cs similarity index 62% rename from CBH-Ultimate-Theme-Library-NET-Framework/MainForm.Designer.cs rename to CBH-WinForm-Theme-NET/Theme/Controls/Color Controls/CrEaTiiOn_ColorSliderVertical.Designer.cs index 47a4d31..3d6f328 100644 --- a/CBH-Ultimate-Theme-Library-NET-Framework/MainForm.Designer.cs +++ b/CBH-WinForm-Theme-NET/Theme/Controls/Color Controls/CrEaTiiOn_ColorSliderVertical.Designer.cs @@ -1,13 +1,13 @@ -namespace CBH_Ultimate_Theme_Library_NET_Framework +namespace CBH.Controls { - partial class MainForm + partial class CrEaTiiOn_ColorSliderVertical { - /// + /// /// Required designer variable. /// private System.ComponentModel.IContainer components = null; - /// + /// /// Clean up any resources being used. /// /// true if managed resources should be disposed; otherwise, false. @@ -20,26 +20,22 @@ protected override void Dispose(bool disposing) base.Dispose(disposing); } - #region Windows Form Designer generated code + #region Component Designer generated code - /// - /// Required method for Designer support - do not modify + /// + /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// private void InitializeComponent() { this.SuspendLayout(); // - // MainForm + // ColorSlider // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20))))); - this.ClientSize = new System.Drawing.Size(800, 450); - this.Font = new System.Drawing.Font("Segoe UI", 8.25F); - this.ForeColor = System.Drawing.Color.White; - this.Name = "MainForm"; - this.Text = "Form1"; + this.Name = "ColorSlider"; + this.Size = new System.Drawing.Size(25, 150); this.ResumeLayout(false); } @@ -47,4 +43,3 @@ private void InitializeComponent() #endregion } } - diff --git a/CBH-WinForm-Theme-NET/Theme/Controls/Color Controls/CrEaTiiOn_ColorSliderVertical.cs b/CBH-WinForm-Theme-NET/Theme/Controls/Color Controls/CrEaTiiOn_ColorSliderVertical.cs new file mode 100644 index 0000000..b63b81b --- /dev/null +++ b/CBH-WinForm-Theme-NET/Theme/Controls/Color Controls/CrEaTiiOn_ColorSliderVertical.cs @@ -0,0 +1,319 @@ +using System.ComponentModel; +using System.Drawing; +using System.Windows.Forms; + +namespace CBH.Controls +{ + [DefaultEvent("ColorChanged")] + public partial class CrEaTiiOn_ColorSliderVertical : UserControl + { + #region Events + + public delegate void ColorChangedEventHandler(object sender, ColorChangedEventArgs args); + public event ColorChangedEventHandler ColorChanged; + + #endregion + + #region Fields + + private HslColor colorHSL = HslColor.FromAhsl(0xff); + private ColorModes colorMode; + private Color colorRGB = Color.Empty; + private bool mouseMoving; + private int position; + private bool setHueSilently; + private Color nubColor; + + #endregion + + #region Properties + + public Color ColorRGB + { + get { return this.colorRGB; } + set + { + this.colorRGB = value; + if (!this.setHueSilently) + { + this.colorHSL = HslColor.FromColor(this.ColorRGB); + } + this.ResetSlider(); + this.Refresh(); + } + } + + public HslColor ColorHSL + { + get { return this.colorHSL; } + set + { + this.colorHSL = value; + this.colorRGB = this.colorHSL.RgbValue; + this.ResetSlider(); + this.Refresh(); + } + } + + public ColorModes ColorMode + { + get { return this.colorMode; } + set + { + this.colorMode = value; + this.ResetSlider(); + this.Refresh(); + } + } + + /// + /// Gets or sets the color of the selection nub. + /// + /// + /// The color of the nub. + /// + [Category("Appearance")] + [DefaultValue(typeof(Color), "Black")] + public Color NubColor + { + get { return this.nubColor; } + set { this.nubColor = value; } + } + + /// + /// Gets or sets the position of the selection nub. + /// + /// + /// The position. + /// + public int Position + { + get { return this.position; } + set + { + int num = value; + num = MathExtensions.LimitToRange(num, 0, base.Height - 9); + if (num != this.position) + { + this.position = num; + this.ResetHSLRGB(); + this.Refresh(); + if (this.ColorChanged != null) + { + this.ColorChanged(this, new ColorChangedEventArgs(this.colorRGB)); + } + } + } + } + + #endregion + + #region Constructors + + public CrEaTiiOn_ColorSliderVertical() + { + InitializeComponent(); + base.SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint, true); + + this.colorHSL = HslColor.FromAhsl(1.0, 1.0, 1.0); + this.colorRGB = this.colorHSL.RgbValue; + this.colorMode = ColorModes.Hue; + } + + #endregion + + #region Overridden Methods + + protected override void OnMouseDown(MouseEventArgs e) + { + base.OnMouseDown(e); + this.mouseMoving = true; + this.Position = e.Y - 4; + } + + protected override void OnMouseUp(MouseEventArgs e) + { + base.OnMouseUp(e); + this.mouseMoving = false; + } + + protected override void OnMouseMove(MouseEventArgs e) + { + base.OnMouseMove(e); + if (this.mouseMoving) + { + this.Position = e.Y - 4; + } + } + + protected override void OnPaint(PaintEventArgs e) + { + base.OnPaint(e); + HslColor color = HslColor.FromAhsl(0xff); + switch (this.ColorMode) + { + case ColorModes.Hue: + color.L = color.S = 1.0; + break; + + case ColorModes.Saturation: + color.H = this.ColorHSL.H; + color.L = this.ColorHSL.L; + break; + + case ColorModes.Luminance: + color.H = this.ColorHSL.H; + color.S = this.ColorHSL.S; + break; + } + for (int i = 0; i < (base.Height - 8); i++) + { + double num2 = 0.0; + if (this.ColorMode < ColorModes.Hue) + { + num2 = 255.0 - MathExtensions.Round((255.0 * i) / (base.Height - 8.0)); + } + else + { + num2 = 1.0 - (((double)i) / ((double)(base.Height - 8))); + } + Color empty = Color.Empty; + switch (this.ColorMode) + { + case ColorModes.Red: + empty = Color.FromArgb((int)num2, this.ColorRGB.G, this.ColorRGB.B); + break; + + case ColorModes.Green: + empty = Color.FromArgb(this.ColorRGB.R, (int)num2, this.ColorRGB.B); + break; + + case ColorModes.Blue: + empty = Color.FromArgb(this.ColorRGB.R, this.ColorRGB.G, (int)num2); + break; + + case ColorModes.Hue: + color.H = num2; + empty = color.RgbValue; + break; + + case ColorModes.Saturation: + color.S = num2; + empty = color.RgbValue; + break; + + case ColorModes.Luminance: + color.L = num2; + empty = color.RgbValue; + break; + } + + using (Pen pen = new Pen(empty)) + { + e.Graphics.DrawLine(pen, 11, i + 4, base.Width - 11, i + 4); + } + } + this.DrawSlider(e.Graphics); + } + + + #endregion + + #region Private Methods + + private void DrawSlider(Graphics g) + { + using (Pen pen = new Pen(Color.FromArgb(0x74, 0x72, 0x6a))) + { + SolidBrush fill = new SolidBrush(this.nubColor); + Point[] points = new Point[] { new Point(1, this.position), new Point(3, this.position), new Point(7, this.position + 4), new Point(3, this.position + 8), new Point(1, this.position + 8), new Point(0, this.position + 7), new Point(0, this.position + 1) }; + g.FillPolygon(fill, points); + g.DrawPolygon(pen, points); + + points[0] = new Point(base.Width - 2, this.position); + points[1] = new Point(base.Width - 4, this.position); + points[2] = new Point(base.Width - 8, this.position + 4); + points[3] = new Point(base.Width - 4, this.position + 8); + points[4] = new Point(base.Width - 2, this.position + 8); + points[5] = new Point(base.Width - 1, this.position + 7); + points[6] = new Point(base.Width - 1, this.position + 1); + + g.FillPolygon(fill, points); + g.DrawPolygon(pen, points); + } + } + + private void ResetSlider() + { + double h = 0.0; + switch (this.ColorMode) + { + case ColorModes.Red: + h = ((double)this.colorRGB.R) / 255.0; + break; + + case ColorModes.Green: + h = ((double)this.colorRGB.G) / 255.0; + break; + + case ColorModes.Blue: + h = ((double)this.colorRGB.B) / 255.0; + break; + + case ColorModes.Hue: + h = this.colorHSL.H; + break; + + case ColorModes.Saturation: + h = this.colorHSL.S; + break; + + case ColorModes.Luminance: + h = this.colorHSL.L; + break; + } + this.position = (base.Height - 8) - MathExtensions.Round((base.Height - 8) * h); + } + + private void ResetHSLRGB() + { + this.setHueSilently = true; + switch (this.ColorMode) + { + case ColorModes.Red: + this.ColorRGB = Color.FromArgb(0xff - MathExtensions.Round((255.0 * this.position) / ((double)(base.Height - 9))), this.ColorRGB.G, this.ColorRGB.B); + this.ColorHSL = HslColor.FromColor(this.ColorRGB); + break; + + case ColorModes.Green: + this.ColorRGB = Color.FromArgb(this.ColorRGB.R, 0xff - MathExtensions.Round((255.0 * this.position) / ((double)(base.Height - 9))), this.ColorRGB.B); + this.ColorHSL = HslColor.FromColor(this.ColorRGB); + break; + + case ColorModes.Blue: + this.ColorRGB = Color.FromArgb(this.ColorRGB.R, this.ColorRGB.G, 0xff - MathExtensions.Round((255.0 * this.position) / ((double)(base.Height - 9)))); + this.ColorHSL = HslColor.FromColor(this.ColorRGB); + break; + + case ColorModes.Hue: + this.colorHSL.H = 1.0 - (((double)this.position) / ((double)(base.Height - 9))); + this.ColorRGB = this.ColorHSL.RgbValue; + break; + + case ColorModes.Saturation: + this.colorHSL.S = 1.0 - (((double)this.position) / ((double)(base.Height - 9))); + this.ColorRGB = this.ColorHSL.RgbValue; + break; + + case ColorModes.Luminance: + this.colorHSL.L = 1.0 - (((double)this.position) / ((double)(base.Height - 9))); + this.ColorRGB = this.ColorHSL.RgbValue; + break; + } + this.setHueSilently = false; + } + + #endregion + + } +} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_FancyComboBox.resx b/CBH-WinForm-Theme-NET/Theme/Controls/Color Controls/CrEaTiiOn_ColorSliderVertical.resx similarity index 100% rename from CBH-Ultimate-Theme-Library-NET-Framework/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_FancyComboBox.resx rename to CBH-WinForm-Theme-NET/Theme/Controls/Color Controls/CrEaTiiOn_ColorSliderVertical.resx diff --git a/CBH-WinForm-Theme-NET/Theme/Controls/Color Controls/CrEaTiiOn_ColorWheel.cs b/CBH-WinForm-Theme-NET/Theme/Controls/Color Controls/CrEaTiiOn_ColorWheel.cs new file mode 100644 index 0000000..fabc399 --- /dev/null +++ b/CBH-WinForm-Theme-NET/Theme/Controls/Color Controls/CrEaTiiOn_ColorWheel.cs @@ -0,0 +1,883 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Windows.Forms; + +namespace CBH.Controls +{ + + [DefaultProperty("Color")] + [DefaultEvent("ColorChanged")] + public partial class CrEaTiiOn_ColorWheel : Control + { + private const int PADDING = 10; + private const int INNER_RADIUS = 200; + private const int OUTER_RADIUS = INNER_RADIUS + 50; + + #region Fields + + private Brush _brush; + private PointF _centerPoint; + private Color _color; + private int _colorStep; + private bool _dragStartedWithinWheel; + private HslColor _hslColor; + private int _largeChange; + private float _radius; + private int _selectionSize; + private int _smallChange; + private int _updateCount; + + #endregion + + #region Constructors + + /// + /// Initializes a new instance of the class. + /// + public CrEaTiiOn_ColorWheel() + { + this.SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.Selectable | ControlStyles.StandardClick | ControlStyles.StandardDoubleClick, true); + this.Color = Color.Black; + this.ColorStep = 4; + this.SelectionSize = 10; + this.SmallChange = 1; + this.LargeChange = 5; + this.SelectionGlyph = this.CreateSelectionGlyph(); + } + + #endregion + + #region Events + + /// + /// Occurs when the Color property value changes + /// + [Category("Property Changed")] + public event EventHandler ColorChanged; + + /// + /// Occurs when the ColorStep property value changes + /// + [Category("Property Changed")] + public event EventHandler ColorStepChanged; + + /// + /// Occurs when the HslColor property value changes + /// + [Category("Property Changed")] + public event EventHandler HslColorChanged; + + /// + /// Occurs when the LargeChange property value changes + /// + [Category("Property Changed")] + public event EventHandler LargeChangeChanged; + + /// + /// Occurs when the SelectionSize property value changes + /// + [Category("Property Changed")] + public event EventHandler SelectionSizeChanged; + + /// + /// Occurs when the SmallChange property value changes + /// + [Category("Property Changed")] + public event EventHandler SmallChangeChanged; + + #endregion + + #region Overridden Methods + /// + /// Releases the unmanaged resources used by the and its child controls and optionally releases the managed resources. + /// + /// true to release both managed and unmanaged resources; false to release only unmanaged resources. + protected override void Dispose(bool disposing) + { + if (disposing) + { + if (_brush != null) + { + _brush.Dispose(); + } + + if (this.SelectionGlyph != null) + { + this.SelectionGlyph.Dispose(); + } + } + + base.Dispose(disposing); + } + + /// + /// Determines whether the specified key is a regular input key or a special key that requires preprocessing. + /// + /// One of the values. + /// true if the specified key is a regular input key; otherwise, false. + protected override bool IsInputKey(Keys keyData) + { + bool result; + + if ((keyData & Keys.Left) == Keys.Left || (keyData & Keys.Up) == Keys.Up || (keyData & Keys.Down) == Keys.Down || (keyData & Keys.Right) == Keys.Right || (keyData & Keys.PageUp) == Keys.PageUp || (keyData & Keys.PageDown) == Keys.PageDown) + { + result = true; + } + else + { + result = base.IsInputKey(keyData); + } + + return result; + } + /// + /// Raises the event. + /// + /// An that contains the event data. + protected override void OnGotFocus(EventArgs e) + { + base.OnGotFocus(e); + + this.Invalidate(); + } + + /// + /// Raises the event. + /// + /// A that contains the event data. + protected override void OnKeyDown(KeyEventArgs e) + { + HslColor color; + double hue; + int step; + + color = this.HslColor; + hue = color.H; + + step = e.Shift ? this.LargeChange : this.SmallChange; + + switch (e.KeyCode) + { + case Keys.Right: + case Keys.Up: + hue += step; + break; + case Keys.Left: + case Keys.Down: + hue -= step; + break; + case Keys.PageUp: + hue += this.LargeChange; + break; + case Keys.PageDown: + hue -= this.LargeChange; + break; + } + + if (hue >= 360) + { + hue = 0; + } + if (hue < 0) + { + hue = 359; + } + + if (hue != color.H) + { + color.H = hue; + + // As the Color and HslColor properties update each other, need to temporarily disable this and manually set both + // otherwise the wheel "sticks" due to imprecise conversion from RGB to HSL + this.LockUpdates = true; + this.Color = color.ToRgbColor(); + this.HslColor = color; + this.LockUpdates = false; + + e.Handled = true; + } + + base.OnKeyDown(e); + } + + /// + /// Raises the event. + /// + /// An that contains the event data. + protected override void OnLostFocus(EventArgs e) + { + base.OnLostFocus(e); + + this.Invalidate(); + } + + /// + /// Raises the event. + /// + /// A that contains the event data. + protected override void OnMouseDown(MouseEventArgs e) + { + base.OnMouseDown(e); + + if (!this.Focused && this.TabStop) + { + this.Focus(); + } + + if (e.Button == MouseButtons.Left && this.IsPointInWheel(e.Location)) + { + _dragStartedWithinWheel = true; + this.SetColor(e.Location); + } + } + + /// + /// Raises the event. + /// + /// A that contains the event data. + protected override void OnMouseMove(MouseEventArgs e) + { + base.OnMouseMove(e); + + if (e.Button == MouseButtons.Left && _dragStartedWithinWheel) + { + this.SetColor(e.Location); + } + } + + /// + /// Raises the event. + /// + /// A that contains the event data. + protected override void OnMouseUp(MouseEventArgs e) + { + base.OnMouseUp(e); + + _dragStartedWithinWheel = false; + } + + /// + /// Raises the event. + /// + /// A that contains the event data. + protected override void OnPaddingChanged(EventArgs e) + { + base.OnPaddingChanged(e); + + this.RefreshWheel(); + } + + /// + /// Raises the event. + /// + /// A that contains the event data. + protected override void OnPaint(PaintEventArgs e) + { + base.OnPaint(e); + + if (this.AllowPainting) + { + base.OnPaintBackground(e); + + if (this.BackgroundImage == null && this.Parent != null && (this.BackColor == this.Parent.BackColor || this.Parent.BackColor.A != 255)) + { + ButtonRenderer.DrawParentBackground(e.Graphics, this.DisplayRectangle, this); + } + + if (_brush != null) + { + e.Graphics.FillPie(_brush, this.ClientRectangle, 0, 360); + } + + // smooth out the edge of the wheel + e.Graphics.SmoothingMode = SmoothingMode.AntiAlias; + using (Pen pen = new Pen(this.BackColor, 2)) + { + e.Graphics.DrawEllipse(pen, new RectangleF(_centerPoint.X - _radius, _centerPoint.Y - _radius, _radius * 2, _radius * 2)); + } + + if (!this.Color.IsEmpty) + { + this.PaintCurrentColor(e); + } + } + } + + /// + /// Raises the event. + /// + /// An that contains the event data. + protected override void OnResize(EventArgs e) + { + base.OnResize(e); + + this.RefreshWheel(); + } + + #endregion + + #region Public Properties + + /// + /// Gets or sets the component color. + /// + /// The component color. + [Category("Appearance")] + [DefaultValue(typeof(Color), "Black")] + public virtual Color Color + { + get { return _color; } + set + { + if (this.Color != value) + { + _color = value; + + this.OnColorChanged(EventArgs.Empty); + } + } + } + + /// + /// Gets or sets the increment for rendering the color wheel. + /// + /// The color step. + /// Value must be between 1 and 359 + [Category("Appearance")] + [DefaultValue(4)] + public virtual int ColorStep + { + get { return _colorStep; } + set + { + if (value < 1 || value > 359) + { + throw new ArgumentOutOfRangeException("value", value, "Value must be between 1 and 359"); + } + + if (this.ColorStep != value) + { + _colorStep = value; + + this.OnColorStepChanged(EventArgs.Empty); + } + } + } + + /// + /// Gets or sets the component color. + /// + /// The component color. + [Category("Appearance")] + [DefaultValue(typeof(HslColor), "0, 0, 0")] + [Browsable(false) /* disable editing until I write a proper type convertor */] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public virtual HslColor HslColor + { + get { return _hslColor; } + set + { + if (this.HslColor != value) + { + _hslColor = value; + + this.OnHslColorChanged(EventArgs.Empty); + } + } + } + + /// + /// Gets or sets a value to be added to or subtracted from the property when the wheel selection is moved a large distance. + /// + /// A numeric value. The default value is 5. + [Category("Behavior")] + [DefaultValue(5)] + public virtual int LargeChange + { + get { return _largeChange; } + set + { + if (this.LargeChange != value) + { + _largeChange = value; + + this.OnLargeChangeChanged(EventArgs.Empty); + } + } + } + + /// + /// Gets or sets the size of the selection handle. + /// + /// The size of the selection handle. + [Category("Appearance")] + [DefaultValue(10)] + public virtual int SelectionSize + { + get { return _selectionSize; } + set + { + if (this.SelectionSize != value) + { + _selectionSize = value; + + this.OnSelectionSizeChanged(EventArgs.Empty); + } + } + } + + /// + /// Gets or sets a value to be added to or subtracted from the property when the wheel selection is moved a small distance. + /// + /// A numeric value. The default value is 1. + [Category("Behavior")] + [DefaultValue(1)] + public virtual int SmallChange + { + get { return _smallChange; } + set + { + if (this.SmallChange != value) + { + _smallChange = value; + + this.OnSmallChangeChanged(EventArgs.Empty); + } + } + } + + #endregion + + #region Protected Properties + + /// + /// Gets a value indicating whether painting of the control is allowed. + /// + /// + /// true if painting of the control is allowed; otherwise, false. + /// + protected virtual bool AllowPainting + { + get { return _updateCount == 0; } + } + + protected Color[] Colors { get; set; } + + protected bool LockUpdates { get; set; } + + protected PointF[] Points { get; set; } + + protected Image SelectionGlyph { get; set; } + + #endregion + + #region Public Members + + /// + /// Disables any redrawing of the image box + /// + public virtual void BeginUpdate() + { + _updateCount++; + } + + /// + /// Enables the redrawing of the image box + /// + public virtual void EndUpdate() + { + if (_updateCount > 0) + { + _updateCount--; + } + + if (this.AllowPainting) + { + this.Invalidate(); + } + } + + #endregion + + #region Protected Members + + /// + /// Calculates wheel attributes. + /// + protected virtual void CalculateWheel() + { + List points; + List colors; + + points = new List(); + colors = new List(); + + // Only define the points if the control is above a minimum size, otherwise if it's too small, + // you get an "out of memory" exceptions (of all things) when creating the brush + if (this.ClientSize.Width > 16 && this.ClientSize.Height > 16) + { + int w; + int h; + + w = this.ClientSize.Width; + h = this.ClientSize.Height; + + _centerPoint = new PointF(w / 2.0F, h / 2.0F); + _radius = this.GetRadius(_centerPoint); + + for (double angle = 0; angle < 360; angle += this.ColorStep) + { + double angleR; + PointF location; + + angleR = angle * (Math.PI / 180); + location = this.GetColorLocation(angleR, _radius); + + points.Add(location); + colors.Add(new HslColor(angle, 1.0, 0.5).ToRgbColor()); + } + } + + this.Points = points.ToArray(); + this.Colors = colors.ToArray(); + } + + /// + /// Creates the gradient brush used to paint the wheel. + /// + protected virtual Brush CreateGradientBrush() + { + Brush result; + + if (this.Points.Length != 0 && this.Points.Length == this.Colors.Length) + { + result = new PathGradientBrush(this.Points, WrapMode.Clamp) + { + CenterPoint = _centerPoint, + CenterColor = Color.White, + SurroundColors = this.Colors + }; + } + else + { + result = null; + } + + return result; + } + + /// + /// Creates the selection glyph. + /// + protected virtual Image CreateSelectionGlyph() + { + Image image; + int halfSize; + + halfSize = this.SelectionSize / 2; + image = new Bitmap(this.SelectionSize + 1, this.SelectionSize + 1); + + using (Graphics g = Graphics.FromImage(image)) + { + Point[] diamondOuter; + + diamondOuter = new[] + { + new Point(halfSize, 0), new Point(this.SelectionSize, halfSize), new Point(halfSize, this.SelectionSize), new Point(0, halfSize) + }; + + g.FillPolygon(SystemBrushes.Control, diamondOuter); + g.DrawPolygon(SystemPens.ControlDark, diamondOuter); + + using (Pen pen = new Pen(Color.FromArgb(128, SystemColors.ControlDark))) + { + g.DrawLine(pen, halfSize, 1, this.SelectionSize - 1, halfSize); + g.DrawLine(pen, halfSize, 2, this.SelectionSize - 2, halfSize); + g.DrawLine(pen, halfSize, this.SelectionSize - 1, this.SelectionSize - 2, halfSize + 1); + g.DrawLine(pen, halfSize, this.SelectionSize - 2, this.SelectionSize - 3, halfSize + 1); + } + + using (Pen pen = new Pen(Color.FromArgb(196, SystemColors.ControlLightLight))) + { + g.DrawLine(pen, halfSize, this.SelectionSize - 1, 1, halfSize); + } + + g.DrawLine(SystemPens.ControlLightLight, 1, halfSize, halfSize, 1); + } + + return image; + } + + /// + /// Gets the point within the wheel representing the source color. + /// + /// The color. + protected PointF GetColorLocation(Color color) + { + return this.GetColorLocation(new HslColor(color)); + } + + /// + /// Gets the point within the wheel representing the source color. + /// + /// The color. + protected virtual PointF GetColorLocation(HslColor color) + { + double angle; + double radius; + + angle = color.H * Math.PI / 180; + radius = _radius * color.S; + + return this.GetColorLocation(angle, radius); + } + + protected PointF GetColorLocation(double angleR, double radius) + { + double x; + double y; + + x = this.Padding.Left + _centerPoint.X + Math.Cos(angleR) * radius; + y = this.Padding.Top + _centerPoint.Y - Math.Sin(angleR) * radius; + + return new PointF((float)x, (float)y); + } + + protected float GetRadius(PointF centerPoint) + { + return Math.Min(centerPoint.X, centerPoint.Y) - (Math.Max(this.Padding.Horizontal, this.Padding.Vertical) + (this.SelectionSize / 2)); + } + + /// + /// Determines whether the specified point is within the bounds of the color wheel. + /// + /// The point. + /// true if the specified point is within the bounds of the color wheel; otherwise, false. + protected bool IsPointInWheel(Point point) + { + PointF normalized; + + // http://my.safaribooksonline.com/book/programming/csharp/9780672331985/graphics-with-windows-forms-and-gdiplus/ch17lev1sec21 + + normalized = new PointF(point.X - _centerPoint.X, point.Y - _centerPoint.Y); + + return (normalized.X * normalized.X + normalized.Y * normalized.Y) <= (_radius * _radius); + } + + /// + /// Raises the event. + /// + /// The instance containing the event data. + protected virtual void OnColorChanged(EventArgs e) + { + EventHandler handler; + + if (!this.LockUpdates) + { + this.HslColor = new HslColor(this.Color); + } + this.Refresh(); + + handler = this.ColorChanged; + + if (handler != null) + { + handler(this, e); + } + } + + /// + /// Raises the event. + /// + /// The instance containing the event data. + protected virtual void OnColorStepChanged(EventArgs e) + { + EventHandler handler; + + this.RefreshWheel(); + + handler = this.ColorStepChanged; + + if (handler != null) + { + handler(this, e); + } + } + + /// + /// Raises the event. + /// + /// The instance containing the event data. + protected virtual void OnHslColorChanged(EventArgs e) + { + EventHandler handler; + + if (!this.LockUpdates) + { + this.Color = this.HslColor.ToRgbColor(); + } + this.Invalidate(); + + handler = this.HslColorChanged; + + if (handler != null) + { + handler(this, e); + } + } + + /// + /// Raises the event. + /// + /// The instance containing the event data. + protected virtual void OnLargeChangeChanged(EventArgs e) + { + EventHandler handler; + + handler = this.LargeChangeChanged; + + if (handler != null) + { + handler(this, e); + } + } + + /// + /// Raises the event. + /// + /// The instance containing the event data. + protected virtual void OnSelectionSizeChanged(EventArgs e) + { + EventHandler handler; + + if (this.SelectionGlyph != null) + { + this.SelectionGlyph.Dispose(); + } + + this.SelectionGlyph = this.CreateSelectionGlyph(); + this.RefreshWheel(); + + handler = this.SelectionSizeChanged; + + if (handler != null) + { + handler(this, e); + } + } + + /// + /// Raises the event. + /// + /// The instance containing the event data. + protected virtual void OnSmallChangeChanged(EventArgs e) + { + EventHandler handler; + + handler = this.SmallChangeChanged; + + if (handler != null) + { + handler(this, e); + } + } + + protected void PaintColor(PaintEventArgs e, HslColor color) + { + this.PaintColor(e, color, false); + } + + protected virtual void PaintColor(PaintEventArgs e, HslColor color, bool includeFocus) + { + PointF location; + + location = this.GetColorLocation(color); + + if (!float.IsNaN(location.X) && !float.IsNaN(location.Y)) + { + int x; + int y; + + x = (int)location.X - (this.SelectionSize / 2); + y = (int)location.Y - (this.SelectionSize / 2); + + if (this.SelectionGlyph == null) + { + e.Graphics.DrawRectangle(Pens.Black, x, y, this.SelectionSize, this.SelectionSize); + } + else + { + e.Graphics.DrawImage(this.SelectionGlyph, x, y); + } + + if (this.Focused && includeFocus) + { + ControlPaint.DrawFocusRectangle(e.Graphics, new Rectangle(x - 1, y - 1, this.SelectionSize + 2, this.SelectionSize + 2)); + } + } + } + + protected virtual void PaintCurrentColor(PaintEventArgs e) + { + this.PaintColor(e, this.HslColor, true); + } + + protected virtual void SetColor(Point point) + { + double dx; + double dy; + double angle; + double distance; + double saturation; + + dx = Math.Abs(point.X - _centerPoint.X - this.Padding.Left); + dy = Math.Abs(point.Y - _centerPoint.Y - this.Padding.Top); + angle = Math.Atan(dy / dx) / Math.PI * 180; + distance = Math.Pow((Math.Pow(dx, 2) + (Math.Pow(dy, 2))), 0.5); + saturation = distance / _radius; + + if (distance < 6) + { + saturation = 0; // snap to center + } + + if (point.X < _centerPoint.X) + { + angle = 180 - angle; + } + if (point.Y > _centerPoint.Y) + { + angle = 360 - angle; + } + + this.LockUpdates = true; + this.HslColor = new HslColor(angle, saturation, 0.5); + this.Color = this.HslColor.ToRgbColor(); + this.LockUpdates = false; + } + + #endregion + + #region Private Members + + /// + /// Refreshes the wheel attributes and then repaints the control + /// + private void RefreshWheel() + { + if (_brush != null) + { + _brush.Dispose(); + } + + this.CalculateWheel(); + _brush = this.CreateGradientBrush(); + this.Invalidate(); + } + + #endregion + } +} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Combobox/CrEaTiiOn_ComboBox.cs b/CBH-WinForm-Theme-NET/Theme/Controls/Combobox/CrEaTiiOn_ComboBox.cs similarity index 97% rename from CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Combobox/CrEaTiiOn_ComboBox.cs rename to CBH-WinForm-Theme-NET/Theme/Controls/Combobox/CrEaTiiOn_ComboBox.cs index 8df65d3..1ac6bd8 100644 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Combobox/CrEaTiiOn_ComboBox.cs +++ b/CBH-WinForm-Theme-NET/Theme/Controls/Combobox/CrEaTiiOn_ComboBox.cs @@ -191,7 +191,7 @@ public ComboBoxStyle DropDownStyle } //Properties //-> Data - [Category("RJ Code - Data")] + [Category("CrEaTiiOn")] [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] [Editor("System.Windows.Forms.Design.ListControlStringCollectionEditor, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(UITypeEditor))] [Localizable(true)] @@ -201,7 +201,7 @@ public System.Windows.Forms.ComboBox.ObjectCollection Items get { return cmbList.Items; } } - [Category("RJ Code - Data")] + [Category("CrEaTiiOn")] [AttributeProvider(typeof(IListSource))] [DefaultValue(null)] public object DataSource @@ -210,7 +210,7 @@ public object DataSource set { cmbList.DataSource = value; } } - [Category("RJ Code - Data")] + [Category("CrEaTiiOn")] [Browsable(true)] [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] [Editor("System.Windows.Forms.Design.ListControlStringCollectionEditor, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(UITypeEditor))] @@ -222,7 +222,7 @@ public AutoCompleteStringCollection AutoCompleteCustomSource set { cmbList.AutoCompleteCustomSource = value; } } - [Category("RJ Code - Data")] + [Category("CrEaTiiOn")] [Browsable(true)] [DefaultValue(AutoCompleteSource.None)] [EditorBrowsable(EditorBrowsableState.Always)] @@ -232,7 +232,7 @@ public AutoCompleteSource AutoCompleteSource set { cmbList.AutoCompleteSource = value; } } - [Category("RJ Code - Data")] + [Category("CrEaTiiOn")] [Browsable(true)] [DefaultValue(AutoCompleteMode.None)] [EditorBrowsable(EditorBrowsableState.Always)] @@ -242,7 +242,7 @@ public AutoCompleteMode AutoCompleteMode set { cmbList.AutoCompleteMode = value; } } - [Category("RJ Code - Data")] + [Category("CrEaTiiOn")] [Bindable(true)] [Browsable(false)] [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] @@ -252,7 +252,7 @@ public object SelectedItem set { cmbList.SelectedItem = value; } } - [Category("RJ Code - Data")] + [Category("CrEaTiiOn")] [Browsable(false)] [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public int SelectedIndex @@ -261,7 +261,7 @@ public int SelectedIndex set { cmbList.SelectedIndex = value; } } - [Category("RJ Code - Data")] + [Category("CrEaTiiOn")] [DefaultValue("")] [Editor("System.Windows.Forms.Design.DataMemberFieldEditor, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(UITypeEditor))] [TypeConverter("System.Windows.Forms.Design.DataMemberFieldConverter, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")] @@ -271,7 +271,7 @@ public string DisplayMember set { cmbList.DisplayMember = value; } } - [Category("RJ Code - Data")] + [Category("CrEaTiiOn")] [DefaultValue("")] [Editor("System.Windows.Forms.Design.DataMemberFieldEditor, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(UITypeEditor))] public string ValueMember @@ -380,4 +380,4 @@ private void ComboBox_Load(object sender, EventArgs e) } } -} +} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Combobox/CrEaTiiOn_ComboBox.resx b/CBH-WinForm-Theme-NET/Theme/Controls/Combobox/CrEaTiiOn_ComboBox.resx similarity index 100% rename from CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Combobox/CrEaTiiOn_ComboBox.resx rename to CBH-WinForm-Theme-NET/Theme/Controls/Combobox/CrEaTiiOn_ComboBox.resx diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/ControlBox/CrEaTiiOn_ControlBox.cs b/CBH-WinForm-Theme-NET/Theme/Controls/ControlBox/CrEaTiiOn_ControlBox.cs similarity index 100% rename from CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/ControlBox/CrEaTiiOn_ControlBox.cs rename to CBH-WinForm-Theme-NET/Theme/Controls/ControlBox/CrEaTiiOn_ControlBox.cs diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/ControlBox/CrEaTiiOn_FlatControlBox.cs b/CBH-WinForm-Theme-NET/Theme/Controls/ControlBox/CrEaTiiOn_FlatControlBox.cs similarity index 100% rename from CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/ControlBox/CrEaTiiOn_FlatControlBox.cs rename to CBH-WinForm-Theme-NET/Theme/Controls/ControlBox/CrEaTiiOn_FlatControlBox.cs diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/ControlBox/CrEaTiiOn_ModernControlBox.cs b/CBH-WinForm-Theme-NET/Theme/Controls/ControlBox/CrEaTiiOn_ModernControlBox.cs similarity index 100% rename from CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/ControlBox/CrEaTiiOn_ModernControlBox.cs rename to CBH-WinForm-Theme-NET/Theme/Controls/ControlBox/CrEaTiiOn_ModernControlBox.cs diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Gauge/CrEaTiiOn_Gauge.cs b/CBH-WinForm-Theme-NET/Theme/Controls/Gauge/CrEaTiiOn_Gauge.cs similarity index 100% rename from CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Gauge/CrEaTiiOn_Gauge.cs rename to CBH-WinForm-Theme-NET/Theme/Controls/Gauge/CrEaTiiOn_Gauge.cs diff --git a/CBH-WinForm-Theme-NET/Theme/Controls/GroupBox/CrEaTiiOn_GradientGroupBox.cs b/CBH-WinForm-Theme-NET/Theme/Controls/GroupBox/CrEaTiiOn_GradientGroupBox.cs new file mode 100644 index 0000000..b727ab2 --- /dev/null +++ b/CBH-WinForm-Theme-NET/Theme/Controls/GroupBox/CrEaTiiOn_GradientGroupBox.cs @@ -0,0 +1,87 @@ +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Windows.Forms; + +namespace CBH.Controls +{ + public enum GradientDirection + { + Vertical, + Horizontal + } + + public class CrEaTiiOn_GradientGroupBox : Control + { + private int cornerRadius = 10; + private string headerText = "Header"; + private Color headerGradientStart = Color.FromArgb(64, 64, 64); + private Color headerGradientEnd = Color.FromArgb(32, 32, 32); + private GradientDirection headerGradientDirection = GradientDirection.Vertical; + + public int CornerRadius + { + get { return cornerRadius; } + set { cornerRadius = value; Invalidate(); } + } + + public string HeaderText + { + get { return headerText; } + set { headerText = value; Invalidate(); } + } + + public Color HeaderGradientStart + { + get { return headerGradientStart; } + set { headerGradientStart = value; Invalidate(); } + } + + public Color HeaderGradientEnd + { + get { return headerGradientEnd; } + set { headerGradientEnd = value; Invalidate(); } + } + + public GradientDirection HeaderGradientDirection + { + get { return headerGradientDirection; } + set { headerGradientDirection = value; Invalidate(); } + } + + protected override void OnPaint(PaintEventArgs e) + { + base.OnPaint(e); + + // Draw header gradient + Rectangle headerRect = new Rectangle(0, 0, Width, 30); + LinearGradientMode gradientMode = headerGradientDirection == GradientDirection.Vertical ? LinearGradientMode.Vertical : LinearGradientMode.Horizontal; + using (LinearGradientBrush brush = new LinearGradientBrush(headerRect, headerGradientStart, headerGradientEnd, gradientMode)) + { + e.Graphics.FillRectangle(brush, headerRect); + } + + // Draw header text + using (Font font = new Font(Font.FontFamily, 12f, FontStyle.Bold)) + { + SizeF textSize = e.Graphics.MeasureString(headerText, font); + PointF textPoint = new PointF((Width - textSize.Width) / 2, (headerRect.Height - textSize.Height) / 2); + e.Graphics.DrawString(headerText, font, Brushes.White, textPoint); + } + + // Draw rounded corners + GraphicsPath path = new GraphicsPath(); + int radius = cornerRadius; + path.AddArc(0, 0, radius * 2, radius * 2, 180, 90); + path.AddLine(radius, 0, Width - radius, 0); + path.AddArc(Width - radius * 2, 0, radius * 2, radius * 2, 270, 90); + path.AddLine(Width, radius, Width, Height - radius); + path.AddArc(Width - radius * 2, Height - radius * 2, radius * 2, radius * 2, 0, 90); + path.AddLine(Width - radius, Height, radius, Height); + path.AddArc(0, Height - radius * 2, radius * 2, radius * 2, 90, 90); + path.AddLine(0, Height - radius, 0, radius); + path.CloseFigure(); + + Region = new Region(path); + } + } +} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/GroupBox/CrEaTiiOn_ModernGroupBox.cs b/CBH-WinForm-Theme-NET/Theme/Controls/GroupBox/CrEaTiiOn_ModernGroupBox.cs similarity index 54% rename from CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/GroupBox/CrEaTiiOn_ModernGroupBox.cs rename to CBH-WinForm-Theme-NET/Theme/Controls/GroupBox/CrEaTiiOn_ModernGroupBox.cs index 9c09e63..78a3d15 100644 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/GroupBox/CrEaTiiOn_ModernGroupBox.cs +++ b/CBH-WinForm-Theme-NET/Theme/Controls/GroupBox/CrEaTiiOn_ModernGroupBox.cs @@ -1,10 +1,10 @@ #region Imports +using CBH_Ultimate_Theme_Library; using System; using System.Drawing; using System.Drawing.Drawing2D; using System.Runtime.InteropServices; using System.Windows.Forms; -using CBH_Ultimate_Theme_Library; #endregion namespace CBH.Controls @@ -29,50 +29,79 @@ public CrEaTiiOn_ModernGroupBox() TextColor = Color.White; Size = new Size(205, 120); Font = new Font("Segoe UI", 8); + CornerRadius = 15; + LBlendColor = Color.FromArgb(250, 36, 38); + GroupBoxBackColor = Color.FromArgb(15, 15, 15); + } + + private Color _groupBoxBackColor = Color.FromArgb(15, 15, 15); + public Color GroupBoxBackColor + { + get { return _groupBoxBackColor; } + set { _groupBoxBackColor = value; Invalidate(); } } protected override void ColorHook() { } + private Color _ForeColor; public Color TextColor { get { return _ForeColor; } set { _ForeColor = value; } } - private ColorBlend LBlend = new ColorBlend(); - private ColorBlend LBlend2 = new ColorBlend(); + private int _cornerRadius; + public int CornerRadius + { + get { return _cornerRadius; } + set { _cornerRadius = value; } + } + + private Color _lBlendColor; + public Color LBlendColor + { + get { return _lBlendColor; } + set { _lBlendColor = value; } + } + protected override void PaintHook() { + ColorBlend LBlend = new ColorBlend(); + ColorBlend LBlend2 = new ColorBlend(); + LBlend.Positions = new float[] { - 0f, - 0.15f, - 0.85f, - 1f - }; + 0f, + 0.15f, + 0.85f, + 1f + }; + LBlend2.Positions = new float[] { - 0f, - 0.15f, - 0.5f, - 0.85f, - 1f - }; + 0f, + 0.15f, + 0.5f, + 0.85f, + 1f + }; + LBlend.Colors = new Color[] { - Color.Transparent, - Color.FromArgb(250, 36, 38), - Color.FromArgb(250, 36, 38), - Color.Transparent - }; + Color.Transparent, + LBlendColor, + LBlendColor, + Color.Transparent + }; + LBlend2.Colors = new Color[] { - Color.Transparent, - Color.FromArgb(10, 10, 10), - Color.FromArgb(250, 36, 38), - Color.FromArgb(10, 10, 10), - Color.Transparent - }; + Color.Transparent, + Color.FromArgb(10, 10, 10), + LBlendColor, + Color.FromArgb(10, 10, 10), + Color.Transparent + }; - G.Clear(Color.FromArgb(15, 15, 15)); + G.Clear(_groupBoxBackColor); if (Text == null) { @@ -83,10 +112,10 @@ protected override void PaintHook() DrawGradient(LBlend2, 0, 24, Width, 1, 0f); } - G.DrawLine(new Pen(Color.FromArgb(15, 15, 15)), 1, 1, Width - 2, 1); + G.DrawLine(new Pen(_groupBoxBackColor), 1, 1, Width - 2, 1); DrawText(new SolidBrush(TextColor), HorizontalAlignment.Center, 0, 0); - Region = System.Drawing.Region.FromHrgn(CreateRoundRectRgn(0, 0, Width, Height, 15, 15)); + Region = System.Drawing.Region.FromHrgn(CreateRoundRectRgn(0, 0, Width, Height, CornerRadius, CornerRadius)); } } } \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Label/CrEaTiiOn_AirLabel.cs b/CBH-WinForm-Theme-NET/Theme/Controls/Label/CrEaTiiOn_AirLabel.cs similarity index 100% rename from CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Label/CrEaTiiOn_AirLabel.cs rename to CBH-WinForm-Theme-NET/Theme/Controls/Label/CrEaTiiOn_AirLabel.cs diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Label/CrEaTiiOn_BigLabel.cs b/CBH-WinForm-Theme-NET/Theme/Controls/Label/CrEaTiiOn_BigLabel.cs similarity index 100% rename from CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Label/CrEaTiiOn_BigLabel.cs rename to CBH-WinForm-Theme-NET/Theme/Controls/Label/CrEaTiiOn_BigLabel.cs diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Label/CrEaTiiOn_HeaderLabel.cs b/CBH-WinForm-Theme-NET/Theme/Controls/Label/CrEaTiiOn_HeaderLabel.cs similarity index 100% rename from CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Label/CrEaTiiOn_HeaderLabel.cs rename to CBH-WinForm-Theme-NET/Theme/Controls/Label/CrEaTiiOn_HeaderLabel.cs diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Label/CrEaTiiOn_Label.cs b/CBH-WinForm-Theme-NET/Theme/Controls/Label/CrEaTiiOn_Label.cs similarity index 100% rename from CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Label/CrEaTiiOn_Label.cs rename to CBH-WinForm-Theme-NET/Theme/Controls/Label/CrEaTiiOn_Label.cs diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Label/CrEaTiiOn_SmallLabel.cs b/CBH-WinForm-Theme-NET/Theme/Controls/Label/CrEaTiiOn_SmallLabel.cs similarity index 100% rename from CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Label/CrEaTiiOn_SmallLabel.cs rename to CBH-WinForm-Theme-NET/Theme/Controls/Label/CrEaTiiOn_SmallLabel.cs diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/LabelEdit/CrEaTiiOn_LabelEdit.cs b/CBH-WinForm-Theme-NET/Theme/Controls/LabelEdit/CrEaTiiOn_LabelEdit.cs similarity index 100% rename from CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/LabelEdit/CrEaTiiOn_LabelEdit.cs rename to CBH-WinForm-Theme-NET/Theme/Controls/LabelEdit/CrEaTiiOn_LabelEdit.cs diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/LinkLabel/CrEaTiiOn_LinkLabel.cs b/CBH-WinForm-Theme-NET/Theme/Controls/LinkLabel/CrEaTiiOn_LinkLabel.cs similarity index 100% rename from CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/LinkLabel/CrEaTiiOn_LinkLabel.cs rename to CBH-WinForm-Theme-NET/Theme/Controls/LinkLabel/CrEaTiiOn_LinkLabel.cs diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/LinkLabelEdit/CrEaTiiOn_LinkLabelEdit.cs b/CBH-WinForm-Theme-NET/Theme/Controls/LinkLabelEdit/CrEaTiiOn_LinkLabelEdit.cs similarity index 99% rename from CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/LinkLabelEdit/CrEaTiiOn_LinkLabelEdit.cs rename to CBH-WinForm-Theme-NET/Theme/Controls/LinkLabelEdit/CrEaTiiOn_LinkLabelEdit.cs index 3ae870f..1dbf41f 100644 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/LinkLabelEdit/CrEaTiiOn_LinkLabelEdit.cs +++ b/CBH-WinForm-Theme-NET/Theme/Controls/LinkLabelEdit/CrEaTiiOn_LinkLabelEdit.cs @@ -1,10 +1,9 @@ #region Imports +using System.Drawing; #endregion -using System.Drawing; - namespace CBH.Controls { #region CrEaTiiOn_LinkLabelEdit diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/ListBox/CrEaTiiOn_ListBox.cs b/CBH-WinForm-Theme-NET/Theme/Controls/ListBox/CrEaTiiOn_ListBox.cs similarity index 100% rename from CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/ListBox/CrEaTiiOn_ListBox.cs rename to CBH-WinForm-Theme-NET/Theme/Controls/ListBox/CrEaTiiOn_ListBox.cs diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/Message/CrEaTiiOn_Message.cs b/CBH-WinForm-Theme-NET/Theme/Controls/Message/CrEaTiiOn_Message.cs similarity index 99% rename from CBH-Ultimate-Theme-Library/Theme/Controls/Message/CrEaTiiOn_Message.cs rename to CBH-WinForm-Theme-NET/Theme/Controls/Message/CrEaTiiOn_Message.cs index b58757c..100f3c1 100644 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/Message/CrEaTiiOn_Message.cs +++ b/CBH-WinForm-Theme-NET/Theme/Controls/Message/CrEaTiiOn_Message.cs @@ -1,7 +1,6 @@ #region Imports using CBH_Ultimate_Theme_Library.Theme.Helpers; using System; -using System.Collections.Generic; using System.Drawing; using System.Drawing.Drawing2D; using System.Windows.Forms; @@ -131,6 +130,5 @@ protected override void OnFontChanged(EventArgs e) base.OnFontChanged(e); Font = new Font(Font.FontFamily, 8); } - } -} +} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Notify/CrEaTiiOn_NotificationBox.cs b/CBH-WinForm-Theme-NET/Theme/Controls/Notify/CrEaTiiOn_NotificationBox.cs similarity index 100% rename from CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Notify/CrEaTiiOn_NotificationBox.cs rename to CBH-WinForm-Theme-NET/Theme/Controls/Notify/CrEaTiiOn_NotificationBox.cs diff --git a/CBH-WinForm-Theme-NET/Theme/Controls/Panel/CrEaTiiOn_Panel.cs b/CBH-WinForm-Theme-NET/Theme/Controls/Panel/CrEaTiiOn_Panel.cs new file mode 100644 index 0000000..aa8d98f --- /dev/null +++ b/CBH-WinForm-Theme-NET/Theme/Controls/Panel/CrEaTiiOn_Panel.cs @@ -0,0 +1,95 @@ +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Windows.Forms; + +public class CrEaTiiOn_Panel : Panel +{ + private int _cornerRadius = 5; + private Color _gradientColor1 = Color.FromArgb(15, 15, 15); + private Color _gradientColor2 = Color.FromArgb(15, 15, 15); + private LinearGradientMode _gradientMode = LinearGradientMode.Vertical; + private float[] _gradientPositions = new float[] { 0.0f, 1.0f }; + + public int CornerRadius + { + get { return _cornerRadius; } + set + { + _cornerRadius = value; + Invalidate(); + } + } + + public Color GradientColor1 + { + get { return _gradientColor1; } + set + { + _gradientColor1 = value; + Invalidate(); + } + } + + public Color GradientColor2 + { + get { return _gradientColor2; } + set + { + _gradientColor2 = value; + Invalidate(); + } + } + + public LinearGradientMode GradientMode + { + get { return _gradientMode; } + set + { + _gradientMode = value; + Invalidate(); + } + } + + public float[] GradientPositions + { + get { return _gradientPositions; } + set + { + _gradientPositions = value; + Invalidate(); + } + } + + protected override void OnPaint(PaintEventArgs e) + { + RectangleF rect = new RectangleF(0, 0, Width, Height); + using (GraphicsPath path = GetRoundedRect(rect, _cornerRadius)) + { + e.Graphics.SmoothingMode = SmoothingMode.HighQuality; + using (LinearGradientBrush brush = new LinearGradientBrush(rect, _gradientColor1, _gradientColor2, _gradientMode)) + { + brush.InterpolationColors = new ColorBlend + { + Colors = new Color[] { _gradientColor1, _gradientColor2 }, + Positions = _gradientPositions + }; + e.Graphics.FillPath(brush, path); + } + } + } + + private GraphicsPath GetRoundedRect(RectangleF rect, float cornerRadius) + { + GraphicsPath roundedRect = new GraphicsPath(); + roundedRect.AddArc(rect.X, rect.Y, cornerRadius * 2, cornerRadius * 2, 180, 90); + roundedRect.AddLine(rect.X + cornerRadius, rect.Y, rect.Right - cornerRadius * 2, rect.Y); + roundedRect.AddArc(rect.X + rect.Width - cornerRadius * 2, rect.Y, cornerRadius * 2, cornerRadius * 2, 270, 90); + roundedRect.AddLine(rect.Right, rect.Y + cornerRadius * 2, rect.Right, rect.Bottom - cornerRadius * 2); + roundedRect.AddArc(rect.X + rect.Width - cornerRadius * 2, rect.Y + rect.Height - cornerRadius * 2, cornerRadius * 2, cornerRadius * 2, 0, 90); + roundedRect.AddLine(rect.Right - cornerRadius * 2, rect.Bottom, rect.X + cornerRadius * 2, rect.Bottom); + roundedRect.AddArc(rect.X, rect.Y + rect.Height - cornerRadius * 2, cornerRadius * 2, cornerRadius * 2, 90, 90); + roundedRect.AddLine(rect.X, rect.Bottom - cornerRadius * 2, rect.X, rect.Y + cornerRadius * 2); + roundedRect.CloseFigure(); + return roundedRect; + } +} diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/PictureBox/CrEaTiiOn_CircularPictureBox.cs b/CBH-WinForm-Theme-NET/Theme/Controls/PictureBox/CrEaTiiOn_CircularPictureBox.cs similarity index 100% rename from CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/PictureBox/CrEaTiiOn_CircularPictureBox.cs rename to CBH-WinForm-Theme-NET/Theme/Controls/PictureBox/CrEaTiiOn_CircularPictureBox.cs diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/PictureBox/CrEaTiiOn_ModernPictureBox.cs b/CBH-WinForm-Theme-NET/Theme/Controls/PictureBox/CrEaTiiOn_ModernPictureBox.cs similarity index 99% rename from CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/PictureBox/CrEaTiiOn_ModernPictureBox.cs rename to CBH-WinForm-Theme-NET/Theme/Controls/PictureBox/CrEaTiiOn_ModernPictureBox.cs index 6f1f074..8bc3fb3 100644 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/PictureBox/CrEaTiiOn_ModernPictureBox.cs +++ b/CBH-WinForm-Theme-NET/Theme/Controls/PictureBox/CrEaTiiOn_ModernPictureBox.cs @@ -4,7 +4,6 @@ using System.Drawing; using System.Drawing.Drawing2D; using System.Windows.Forms; -using CBH.RJControls; #endregion namespace CBH.Controls diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/PictureBox/CrEaTiiOn_PictureBox.cs b/CBH-WinForm-Theme-NET/Theme/Controls/PictureBox/CrEaTiiOn_PictureBox.cs similarity index 100% rename from CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/PictureBox/CrEaTiiOn_PictureBox.cs rename to CBH-WinForm-Theme-NET/Theme/Controls/PictureBox/CrEaTiiOn_PictureBox.cs diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Progress/CrEaTiiOn_CircleProgressBar.cs b/CBH-WinForm-Theme-NET/Theme/Controls/Progress/CrEaTiiOn_CircleProgressBar.cs similarity index 100% rename from CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Progress/CrEaTiiOn_CircleProgressBar.cs rename to CBH-WinForm-Theme-NET/Theme/Controls/Progress/CrEaTiiOn_CircleProgressBar.cs diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Progress/CrEaTiiOn_FancyProgressBar.cs b/CBH-WinForm-Theme-NET/Theme/Controls/Progress/CrEaTiiOn_FancyProgressBar.cs similarity index 100% rename from CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Progress/CrEaTiiOn_FancyProgressBar.cs rename to CBH-WinForm-Theme-NET/Theme/Controls/Progress/CrEaTiiOn_FancyProgressBar.cs diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/Progress/CrEaTiiOn_ModernProgressBar.cs b/CBH-WinForm-Theme-NET/Theme/Controls/Progress/CrEaTiiOn_ModernProgressBar.cs similarity index 92% rename from CBH-Ultimate-Theme-Library/Theme/Controls/Progress/CrEaTiiOn_ModernProgressBar.cs rename to CBH-WinForm-Theme-NET/Theme/Controls/Progress/CrEaTiiOn_ModernProgressBar.cs index 439927d..6c8f274 100644 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/Progress/CrEaTiiOn_ModernProgressBar.cs +++ b/CBH-WinForm-Theme-NET/Theme/Controls/Progress/CrEaTiiOn_ModernProgressBar.cs @@ -1,14 +1,7 @@ #region Imports -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; -using System.Drawing; -using System.Drawing.Drawing2D; using System.ComponentModel; -using CBH.RJControls; +using System.Drawing; +using System.Windows.Forms; #endregion namespace CBH.Controls @@ -28,7 +21,7 @@ class CrEaTiiOn_ModernProgressBar : CrEaTiiOn_ProgressBar //-> Appearance private Color channelColor = Color.FromArgb(255, 150, 151); private Color sliderColor = Color.FromArgb(250, 36, 38); - private Color foreBackColor = Color.FromArgb(20,20, 20); + private Color foreBackColor = Color.FromArgb(20, 20, 20); private int channelHeight = 6; private int sliderHeight = 6; private TextPosition showValue = TextPosition.Right; @@ -48,7 +41,7 @@ public CrEaTiiOn_ModernProgressBar() } //Propertiesfff - [Category("RJ Code Advance")] + [Category("CrEaTiiOn")] public Color ChannelColor { get { return channelColor; } @@ -59,7 +52,7 @@ public Color ChannelColor } } - [Category("RJ Code Advance")] + [Category("CrEaTiiOn")] public Color SliderColor { get { return sliderColor; } @@ -70,7 +63,7 @@ public Color SliderColor } } - [Category("RJ Code Advance")] + [Category("CrEaTiiOn")] public Color ForeBackColor { get { return foreBackColor; } @@ -81,7 +74,7 @@ public Color ForeBackColor } } - [Category("RJ Code Advance")] + [Category("CrEaTiiOn")] public int ChannelHeight { get { return channelHeight; } @@ -92,7 +85,7 @@ public int ChannelHeight } } - [Category("RJ Code Advance")] + [Category("CrEaTiiOn")] public int SliderHeight { get { return sliderHeight; } @@ -103,7 +96,7 @@ public int SliderHeight } } - [Category("RJ Code Advance")] + [Category("CrEaTiiOn")] public TextPosition ShowValue { get { return showValue; } @@ -114,7 +107,7 @@ public TextPosition ShowValue } } - [Category("RJ Code Advance")] + [Category("CrEaTiiOn")] public string SymbolBefore { get { return symbolBefore; } @@ -125,7 +118,7 @@ public string SymbolBefore } } - [Category("RJ Code Advance")] + [Category("CrEaTiiOn")] public string SymbolAfter { get { return symbolAfter; } @@ -136,7 +129,7 @@ public string SymbolAfter } } - [Category("RJ Code Advance")] + [Category("CrEaTiiOn")] public bool ShowMaximun { get { return showMaximun; } @@ -147,7 +140,7 @@ public bool ShowMaximun } } - [Category("RJ Code Advance")] + [Category("CrEaTiiOn")] [Browsable(true)] [EditorBrowsable(EditorBrowsableState.Always)] public override Font Font @@ -159,7 +152,7 @@ public override Font Font } } - [Category("RJ Code Advance")] + [Category("CrEaTiiOn")] public override Color ForeColor { get { return base.ForeColor; } diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Progress/CrEaTiiOn_ProcessingControl.cs b/CBH-WinForm-Theme-NET/Theme/Controls/Progress/CrEaTiiOn_ProcessingControl.cs similarity index 100% rename from CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Progress/CrEaTiiOn_ProcessingControl.cs rename to CBH-WinForm-Theme-NET/Theme/Controls/Progress/CrEaTiiOn_ProcessingControl.cs diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Progress/CrEaTiiOn_ProgressBar.cs b/CBH-WinForm-Theme-NET/Theme/Controls/Progress/CrEaTiiOn_ProgressBar.cs similarity index 100% rename from CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Progress/CrEaTiiOn_ProgressBar.cs rename to CBH-WinForm-Theme-NET/Theme/Controls/Progress/CrEaTiiOn_ProgressBar.cs diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Progress/CrEaTiiOn_SpinningCircles.cs b/CBH-WinForm-Theme-NET/Theme/Controls/Progress/CrEaTiiOn_SpinningCircles.cs similarity index 99% rename from CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Progress/CrEaTiiOn_SpinningCircles.cs rename to CBH-WinForm-Theme-NET/Theme/Controls/Progress/CrEaTiiOn_SpinningCircles.cs index 75de952..1fd1a13 100644 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Progress/CrEaTiiOn_SpinningCircles.cs +++ b/CBH-WinForm-Theme-NET/Theme/Controls/Progress/CrEaTiiOn_SpinningCircles.cs @@ -110,4 +110,4 @@ public float Radius } } } -} +} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/RadioButton/CrEaTiiOn_AirRadioButton.cs b/CBH-WinForm-Theme-NET/Theme/Controls/RadioButton/CrEaTiiOn_AirRadioButton.cs similarity index 100% rename from CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/RadioButton/CrEaTiiOn_AirRadioButton.cs rename to CBH-WinForm-Theme-NET/Theme/Controls/RadioButton/CrEaTiiOn_AirRadioButton.cs diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/RadioButton/CrEaTiiOn_ClasicRadioButton.cs b/CBH-WinForm-Theme-NET/Theme/Controls/RadioButton/CrEaTiiOn_ClasicRadioButton.cs similarity index 100% rename from CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/RadioButton/CrEaTiiOn_ClasicRadioButton.cs rename to CBH-WinForm-Theme-NET/Theme/Controls/RadioButton/CrEaTiiOn_ClasicRadioButton.cs diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/RadioButton/CrEaTiiOn_ModernRadioButton.cs b/CBH-WinForm-Theme-NET/Theme/Controls/RadioButton/CrEaTiiOn_ModernRadioButton.cs similarity index 95% rename from CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/RadioButton/CrEaTiiOn_ModernRadioButton.cs rename to CBH-WinForm-Theme-NET/Theme/Controls/RadioButton/CrEaTiiOn_ModernRadioButton.cs index 1899a92..f67e92c 100644 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/RadioButton/CrEaTiiOn_ModernRadioButton.cs +++ b/CBH-WinForm-Theme-NET/Theme/Controls/RadioButton/CrEaTiiOn_ModernRadioButton.cs @@ -1,12 +1,7 @@ #region Imports -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; using System.Drawing; using System.Drawing.Drawing2D; +using System.Windows.Forms; #endregion namespace CBH.Controls @@ -51,7 +46,7 @@ public CrEaTiiOn_ModernRadioButton() { this.MinimumSize = new Size(0, 21); //Add a padding of 10 to the left to have a considerable distance between the text and the RadioButton. - this.Padding = new Padding(10,0,0,0); + this.Padding = new Padding(10, 0, 0, 0); } //Overridden methods diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/RadioButton/CrEaTiiOn_RadioButton.cs b/CBH-WinForm-Theme-NET/Theme/Controls/RadioButton/CrEaTiiOn_RadioButton.cs similarity index 100% rename from CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/RadioButton/CrEaTiiOn_RadioButton.cs rename to CBH-WinForm-Theme-NET/Theme/Controls/RadioButton/CrEaTiiOn_RadioButton.cs diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/RichTextBox/CrEaTiiOn_RichTextBox.cs b/CBH-WinForm-Theme-NET/Theme/Controls/RichTextBox/CrEaTiiOn_RichTextBox.cs similarity index 100% rename from CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/RichTextBox/CrEaTiiOn_RichTextBox.cs rename to CBH-WinForm-Theme-NET/Theme/Controls/RichTextBox/CrEaTiiOn_RichTextBox.cs diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/RichTextBoxEdit/CrEaTiiOn_RichTextBoxEdit.cs b/CBH-WinForm-Theme-NET/Theme/Controls/RichTextBoxEdit/CrEaTiiOn_RichTextBoxEdit.cs similarity index 98% rename from CBH-Ultimate-Theme-Library/Theme/Controls/RichTextBoxEdit/CrEaTiiOn_RichTextBoxEdit.cs rename to CBH-WinForm-Theme-NET/Theme/Controls/RichTextBoxEdit/CrEaTiiOn_RichTextBoxEdit.cs index a203e76..3b90e89 100644 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/RichTextBoxEdit/CrEaTiiOn_RichTextBoxEdit.cs +++ b/CBH-WinForm-Theme-NET/Theme/Controls/RichTextBoxEdit/CrEaTiiOn_RichTextBoxEdit.cs @@ -24,9 +24,9 @@ public class CrEaTiiOn_RichTextBoxEdit : Control private GraphicsPath Shape; private SmoothingMode _SmoothingType = SmoothingMode.AntiAlias; private Color _BaseColor = Color.Transparent; - private Color _EdgeColor = Color.White; + private Color _EdgeColor = Color.Black; private Color _BorderColor = Color.FromArgb(180, 180, 180); - private Color _TextBackColor = Color.White; + private Color _TextBackColor = Color.Black; private Font _TextFont = new("Tahoma", 10); private BorderStyle _TextBorderStyle = BorderStyle.None; diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Segment/CrEaTiiOn_Segment.cs b/CBH-WinForm-Theme-NET/Theme/Controls/Segment/CrEaTiiOn_Segment.cs similarity index 100% rename from CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Segment/CrEaTiiOn_Segment.cs rename to CBH-WinForm-Theme-NET/Theme/Controls/Segment/CrEaTiiOn_Segment.cs diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Separator/CrEaTiiOn_LightSeperator.cs b/CBH-WinForm-Theme-NET/Theme/Controls/Separator/CrEaTiiOn_LightSeperator.cs similarity index 100% rename from CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Separator/CrEaTiiOn_LightSeperator.cs rename to CBH-WinForm-Theme-NET/Theme/Controls/Separator/CrEaTiiOn_LightSeperator.cs diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Separator/CrEaTiiOn_ModernSeperator.cs b/CBH-WinForm-Theme-NET/Theme/Controls/Separator/CrEaTiiOn_ModernSeperator.cs similarity index 100% rename from CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Separator/CrEaTiiOn_ModernSeperator.cs rename to CBH-WinForm-Theme-NET/Theme/Controls/Separator/CrEaTiiOn_ModernSeperator.cs diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Separator/CrEaTiiOn_Separator.cs b/CBH-WinForm-Theme-NET/Theme/Controls/Separator/CrEaTiiOn_Separator.cs similarity index 100% rename from CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Separator/CrEaTiiOn_Separator.cs rename to CBH-WinForm-Theme-NET/Theme/Controls/Separator/CrEaTiiOn_Separator.cs diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Slider/CrEaTiiOn_FlatSliderBar.cs b/CBH-WinForm-Theme-NET/Theme/Controls/Slider/CrEaTiiOn_FlatSliderBar.cs similarity index 98% rename from CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Slider/CrEaTiiOn_FlatSliderBar.cs rename to CBH-WinForm-Theme-NET/Theme/Controls/Slider/CrEaTiiOn_FlatSliderBar.cs index b62903d..8c9b189 100644 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Slider/CrEaTiiOn_FlatSliderBar.cs +++ b/CBH-WinForm-Theme-NET/Theme/Controls/Slider/CrEaTiiOn_FlatSliderBar.cs @@ -20,7 +20,7 @@ public class CrEaTiiOn_FlatSliderBar : Control #endregion #region 属性 - private Color _themeColor = ThemeColors.PrimaryColor; + private Color _themeColor = Color.FromArgb(250, 36, 38); [Description("主题颜色")] public Color ThemeColor { diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Slider/CrEaTiiOn_ModernSlider.cs b/CBH-WinForm-Theme-NET/Theme/Controls/Slider/CrEaTiiOn_ModernSlider.cs similarity index 100% rename from CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/Slider/CrEaTiiOn_ModernSlider.cs rename to CBH-WinForm-Theme-NET/Theme/Controls/Slider/CrEaTiiOn_ModernSlider.cs diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/TabControl/CrEaTiiOn_BarTabControl.cs b/CBH-WinForm-Theme-NET/Theme/Controls/TabControl/CrEaTiiOn_BarTabControl.cs similarity index 99% rename from CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/TabControl/CrEaTiiOn_BarTabControl.cs rename to CBH-WinForm-Theme-NET/Theme/Controls/TabControl/CrEaTiiOn_BarTabControl.cs index d899135..0212cdf 100644 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/TabControl/CrEaTiiOn_BarTabControl.cs +++ b/CBH-WinForm-Theme-NET/Theme/Controls/TabControl/CrEaTiiOn_BarTabControl.cs @@ -284,5 +284,4 @@ public void DoAnimationScrollRight(Control Control1, Control Control2) } } } - } diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/TabControl/CrEaTiiOn_FlatTabControl.cs b/CBH-WinForm-Theme-NET/Theme/Controls/TabControl/CrEaTiiOn_FlatTabControl.cs similarity index 60% rename from CBH-Ultimate-Theme-Library/Theme/Controls/TabControl/CrEaTiiOn_FlatTabControl.cs rename to CBH-WinForm-Theme-NET/Theme/Controls/TabControl/CrEaTiiOn_FlatTabControl.cs index 824b811..919ab85 100644 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/TabControl/CrEaTiiOn_FlatTabControl.cs +++ b/CBH-WinForm-Theme-NET/Theme/Controls/TabControl/CrEaTiiOn_FlatTabControl.cs @@ -1,25 +1,29 @@ -#region Imports -using CBH_Ultimate_Theme_Library.Theme.Helpers; +using CBH_Ultimate_Theme_Library.Theme.Helpers; using System; using System.Drawing; using System.Drawing.Drawing2D; using System.Drawing.Text; using System.Windows.Forms; -#endregion namespace CBH.Controls { public class CrEaTiiOn_FlatTabControl : TabControl { - #region 变量 - int enterIndex; - bool enterFlag = false; - - #endregion - - #region 属性 + private int enterIndex; + private bool enterFlag = false; + private Color _themeColor = Color.FromArgb(250, 36, 38); + public CrEaTiiOn_FlatTabControl() + { + SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.OptimizedDoubleBuffer, true); + DoubleBuffered = true; + Font = new Font("Segoe UI", 12F); + SizeMode = TabSizeMode.Fixed; + ItemSize = new Size(120, 40); + TabPageColor = Color.Transparent; + ThemeColor = Color.FromArgb(250, 36, 38); + TabPageForeColor = Color.White; + } - private Color _themeColor = ThemeColors.PrimaryColor; public Color ThemeColor { get { return _themeColor; } @@ -29,7 +33,28 @@ public Color ThemeColor Invalidate(); } } - #endregion + + private Color _tabPageColor = Color.White; + public Color TabPageColor + { + get { return _tabPageColor; } + set + { + _tabPageColor = value; + Invalidate(); + } + } + + private Color _tabPageForeColor = Color.Black; + public Color TabPageForeColor + { + get { return _tabPageForeColor; } + set + { + _tabPageForeColor = value; + Invalidate(); + } + } public override Rectangle DisplayRectangle { @@ -97,15 +122,32 @@ protected override void OnPaint(PaintEventArgs e) graphics.DrawString(TabPages[i].Text.ToUpper(), Font, new SolidBrush(Color.Black), GetTabRect(i), StringAlign.Center); } } - } - public CrEaTiiOn_FlatTabControl() - { - SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.OptimizedDoubleBuffer, true); - DoubleBuffered = true; - Font = new Font("Segoe UI", 12F); - SizeMode = TabSizeMode.Fixed; - ItemSize = new Size(120, 40); + for (int i = 0; i < TabCount; i++) + { + if (i == SelectedIndex) + { + graphics.FillRectangle(new SolidBrush(_themeColor), GetTabRect(i).X + 3, ItemSize.Height - 3, ItemSize.Width - 6, 3); + graphics.DrawString(TabPages[i].Text.ToUpper(), Font, new SolidBrush(_themeColor), GetTabRect(i), StringAlign.Center); + } + else + { + if (i == enterIndex && enterFlag) + { + graphics.FillRectangle(new SolidBrush(Color.FromArgb(250, 36, 38)), GetTabRect(i).X + 3, ItemSize.Height - 3, ItemSize.Width - 6, 3); + } + + // Draw the TabPage background color + Rectangle rect = GetTabRect(i); + rect.Inflate(-3, -3); + using (SolidBrush brush = new SolidBrush(_tabPageColor)) + { + graphics.FillRectangle(brush, rect); + } + + graphics.DrawString(TabPages[i].Text.ToUpper(), Font, new SolidBrush(_tabPageForeColor), GetTabRect(i), StringAlign.Center); + } + } } } } \ No newline at end of file diff --git a/CBH-WinForm-Theme-NET/Theme/Controls/TabControl/CrEaTiiOn_MetroTabControl.cs b/CBH-WinForm-Theme-NET/Theme/Controls/TabControl/CrEaTiiOn_MetroTabControl.cs new file mode 100644 index 0000000..66ba14a --- /dev/null +++ b/CBH-WinForm-Theme-NET/Theme/Controls/TabControl/CrEaTiiOn_MetroTabControl.cs @@ -0,0 +1,88 @@ +#region Imports +using System; +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Runtime.InteropServices; +using System.Windows.Forms; +#endregion + +namespace CBH.Controls +{ + public class CrEaTiiOn_MetroTabControl : TabControl + { + [DllImport("Gdi32.dll", EntryPoint = "CreateRoundRectRgn")] + private static extern IntPtr CreateRoundRectRgn + ( + int nLeftRect, // x-coordinate of upper-left corner + int nTopRect, // y-coordinate of upper-left corner + int nRightRect, // x-coordinate of lower-right corner + int nBottomRect, // y-coordinate of lower-right corner + int nWidthEllipse, // width of ellipse + int nHeightEllipse // height of ellipse + ); + + public CrEaTiiOn_MetroTabControl() + { + SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.ResizeRedraw | ControlStyles.UserPaint | ControlStyles.DoubleBuffer, true); + ItemSize = new Size(0, 34); + Padding = new Point(24, 0); + Font = new Font("Segoe UI", 12); + } + + protected override void CreateHandle() + { + base.CreateHandle(); + Alignment = TabAlignment.Top; + } + + protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) + { + base.OnPaint(e); + + Graphics G = e.Graphics; + + G.SmoothingMode = SmoothingMode.HighQuality; + G.Clear(Parent.BackColor); + + Color FontColor = new Color(); + + + for (int i = 0; i <= TabCount - 1; i++) + { + Rectangle mainRect = GetTabRect(i); + + if (i == SelectedIndex) + { + FontColor = Color.White; + G.DrawLine(new Pen(Color.FromArgb(250, 36, 38)), new Point(mainRect.X - 2, mainRect.Height - 1), new Point(mainRect.X + mainRect.Width - 2, mainRect.Height - 1)); + G.DrawLine(new Pen(Color.FromArgb(250, 36, 38)), new Point(mainRect.X - 2, mainRect.Height), new Point(mainRect.X + mainRect.Width - 2, mainRect.Height)); + } + else + { + FontColor = Color.White; + G.DrawLine(new Pen(Color.FromArgb(250, 36, 38)), new Point(mainRect.X - 2, mainRect.Height - 1), new Point(mainRect.X + mainRect.Width - 2, mainRect.Height - 1)); + G.DrawLine(new Pen(Color.FromArgb(250, 36, 38)), new Point(mainRect.X - 2, mainRect.Height), new Point(mainRect.X + mainRect.Width - 2, mainRect.Height)); + } + + if (i != 0) + { + G.DrawLine(new Pen(Color.FromArgb(250, 36, 38)), new Point(mainRect.X - 4, mainRect.Height - 7), new Point(mainRect.X + 4, mainRect.Y + 6)); + } + + int titleX = (mainRect.Location.X + mainRect.Width / 2) - Convert.ToInt32((G.MeasureString(TabPages[i].Text, Font).Width / 2)); + int titleY = (mainRect.Location.Y + mainRect.Height / 2) - Convert.ToInt32((G.MeasureString(TabPages[i].Text, Font).Height / 2)); + G.DrawString(TabPages[i].Text, Font, new SolidBrush(FontColor), new Point(titleX, titleY)); + + try + { + TabPages[i].BackColor = Parent.BackColor; + } + catch + { + } + + } + Region = System.Drawing.Region.FromHrgn(CreateRoundRectRgn(0, 0, Width, Height, 10, 10)); + } + } +} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/TabPage/CrEaTiiOn_ModernTabPage.cs b/CBH-WinForm-Theme-NET/Theme/Controls/TabPage/CrEaTiiOn_ModernTabPage.cs similarity index 100% rename from CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/TabPage/CrEaTiiOn_ModernTabPage.cs rename to CBH-WinForm-Theme-NET/Theme/Controls/TabPage/CrEaTiiOn_ModernTabPage.cs diff --git a/CBH-WinForm-Theme-NET/Theme/Controls/TabPage/CrEaTiiOn_TabPage.cs b/CBH-WinForm-Theme-NET/Theme/Controls/TabPage/CrEaTiiOn_TabPage.cs new file mode 100644 index 0000000..1e2c037 --- /dev/null +++ b/CBH-WinForm-Theme-NET/Theme/Controls/TabPage/CrEaTiiOn_TabPage.cs @@ -0,0 +1,107 @@ +#region Imports + +using System.Drawing; +using System.Windows.Forms; + +#endregion + +namespace CBH.Controls +{ + #region CrEaTiiOn_TabPage + + public class CrEaTiiOn_TabPage : TabControl + { + private Color _squareColor = Color.FromArgb(250, 36, 38); + private bool _showOuterBorders = false; + + public CrEaTiiOn_TabPage() + { + SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.ResizeRedraw | ControlStyles.UserPaint | ControlStyles.DoubleBuffer, true); + DoubleBuffered = true; + SizeMode = TabSizeMode.Fixed; + ItemSize = new Size(30, 115); + Alignment = TabAlignment.Left; + } + + public Color SquareColor + { + get { return _squareColor; } + set + { + _squareColor = value; + Invalidate(); + } + } + + public bool ShowOuterBorders + { + get { return _showOuterBorders; } + set + { + _showOuterBorders = value; + Invalidate(); + } + } + + protected override void OnPaint(PaintEventArgs e) + { + Bitmap bitmap = new Bitmap(Width, Height); + Graphics graphics = Graphics.FromImage(bitmap); + + try + { + SelectedTab.BackColor = Color.FromArgb(15, 15, 15); + } + catch { } + + graphics.Clear(Color.FromArgb(20, 20, 20)); + + for (int i = 0; i < TabCount; i++) + { + Rectangle tabRect = GetTabRect(i); + Rectangle tabRectWithBorders = new Rectangle(new Point(tabRect.Location.X - 2, tabRect.Location.Y - 2), new Size(tabRect.Width + 3, tabRect.Height - 1)); + Rectangle textRectangle = new Rectangle(tabRectWithBorders.Location.X + 20, tabRectWithBorders.Location.Y, tabRectWithBorders.Width - 20, tabRectWithBorders.Height); + + if (i == SelectedIndex) + { + graphics.FillRectangle(new SolidBrush(_squareColor), new Rectangle(tabRectWithBorders.Location, new Size(9, tabRectWithBorders.Height))); + + if (ImageList != null && ImageList.Images[TabPages[i].ImageIndex] != null) + { + graphics.DrawImage(ImageList.Images[TabPages[i].ImageIndex], new Point(textRectangle.Location.X + 8, textRectangle.Location.Y + 6)); + } + + graphics.DrawString(" " + TabPages[i].Text, Font, Brushes.White, textRectangle, new StringFormat + { + LineAlignment = StringAlignment.Center, + Alignment = StringAlignment.Near + }); + } + else + { + if (ImageList != null && ImageList.Images[TabPages[i].ImageIndex] != null) + { + graphics.DrawImage(ImageList.Images[TabPages[i].ImageIndex], new Point(textRectangle.Location.X + 8, textRectangle.Location.Y + 6)); + } + + graphics.DrawString(TabPages[i].Text, Font, Brushes.White, textRectangle, new StringFormat + { + LineAlignment = StringAlignment.Center, + Alignment = StringAlignment.Near + }); + } + + if (_showOuterBorders) + { + graphics.DrawRectangle(Pens.White, tabRectWithBorders); + } + } + + e.Graphics.DrawImage(bitmap, 0, 0); + graphics.Dispose(); + bitmap.Dispose(); + } + } + + #endregion +} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/TextBox/CrEaTiiOn_AirTextBox.cs b/CBH-WinForm-Theme-NET/Theme/Controls/TextBox/CrEaTiiOn_AirTextBox.cs similarity index 100% rename from CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/TextBox/CrEaTiiOn_AirTextBox.cs rename to CBH-WinForm-Theme-NET/Theme/Controls/TextBox/CrEaTiiOn_AirTextBox.cs diff --git a/CBH-Ultimate-Theme-Library/Theme/Controls/TextBox/CrEaTiiOn_ModernTextBox.Designer.cs b/CBH-WinForm-Theme-NET/Theme/Controls/TextBox/CrEaTiiOn_ModernTextBox.Designer.cs similarity index 99% rename from CBH-Ultimate-Theme-Library/Theme/Controls/TextBox/CrEaTiiOn_ModernTextBox.Designer.cs rename to CBH-WinForm-Theme-NET/Theme/Controls/TextBox/CrEaTiiOn_ModernTextBox.Designer.cs index 6aa411e..fa4a843 100644 --- a/CBH-Ultimate-Theme-Library/Theme/Controls/TextBox/CrEaTiiOn_ModernTextBox.Designer.cs +++ b/CBH-WinForm-Theme-NET/Theme/Controls/TextBox/CrEaTiiOn_ModernTextBox.Designer.cs @@ -1,4 +1,4 @@ -namespace CBH.RJControls +namespace CBH.Controls { partial class CrEaTiiOn_ModernTextBox { diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/TextBox/CrEaTiiOn_ModernTextBox.cs b/CBH-WinForm-Theme-NET/Theme/Controls/TextBox/CrEaTiiOn_ModernTextBox.cs similarity index 97% rename from CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/TextBox/CrEaTiiOn_ModernTextBox.cs rename to CBH-WinForm-Theme-NET/Theme/Controls/TextBox/CrEaTiiOn_ModernTextBox.cs index fe61729..e43b788 100644 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/TextBox/CrEaTiiOn_ModernTextBox.cs +++ b/CBH-WinForm-Theme-NET/Theme/Controls/TextBox/CrEaTiiOn_ModernTextBox.cs @@ -1,16 +1,11 @@ #region Imports using System; -using System.Collections.Generic; using System.ComponentModel; using System.Drawing; -using System.Data; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Windows.Forms; #endregion -namespace CBH.RJControls +namespace CBH.Controls { [DefaultEvent("_TextChanged")] public partial class CrEaTiiOn_ModernTextBox : UserControl @@ -213,6 +208,5 @@ private void textBox1_Leave(object sender, EventArgs e) this.Invalidate(); } - ///::::+ } -} +} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/TextBox/CrEaTiiOn_ModernTextBox.resx b/CBH-WinForm-Theme-NET/Theme/Controls/TextBox/CrEaTiiOn_ModernTextBox.resx similarity index 100% rename from CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/TextBox/CrEaTiiOn_ModernTextBox.resx rename to CBH-WinForm-Theme-NET/Theme/Controls/TextBox/CrEaTiiOn_ModernTextBox.resx diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/TrackBar/CrEaTiiOn_TrackBar.cs b/CBH-WinForm-Theme-NET/Theme/Controls/TrackBar/CrEaTiiOn_TrackBar.cs similarity index 100% rename from CBH-Ultimate-Theme-Library-NET-Framework/Theme/Controls/TrackBar/CrEaTiiOn_TrackBar.cs rename to CBH-WinForm-Theme-NET/Theme/Controls/TrackBar/CrEaTiiOn_TrackBar.cs diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Helpers/Helpers.cs b/CBH-WinForm-Theme-NET/Theme/ThemeBase/Helpers/Helpers.cs similarity index 59% rename from CBH-Ultimate-Theme-Library-NET-Framework/Theme/Helpers/Helpers.cs rename to CBH-WinForm-Theme-NET/Theme/ThemeBase/Helpers/Helpers.cs index 0b65db3..e4d6611 100644 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Helpers/Helpers.cs +++ b/CBH-WinForm-Theme-NET/Theme/ThemeBase/Helpers/Helpers.cs @@ -4,95 +4,11 @@ using System.ComponentModel; using System.Drawing; using System.Drawing.Drawing2D; -using System.Drawing.Text; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Windows.Forms; #endregion namespace CBH_Ultimate_Theme_Library.Theme.Helpers { - #region Extension Methods - public static class ExtensionMethods - { - public static Color FromHex(this string hex) - { - return ColorTranslator.FromHtml(hex); - } - } - #endregion - - #region Rounded Rectangle - public class RoundedRectangleF - { - - Point location; - float radius; - GraphicsPath grPath; - float x, y; - float width, height; - - - public RoundedRectangleF(float width, float height, float radius, float x = 0, float y = 0) - { - - location = new Point(0, 0); - this.radius = radius; - this.x = x; - this.y = y; - this.width = width; - this.height = height; - grPath = new GraphicsPath(); - if (radius <= 0) - { - grPath.AddRectangle(new RectangleF(x, y, width, height)); - return; - } - RectangleF upperLeftRect = new RectangleF(x, y, 2 * radius, 2 * radius); - RectangleF upperRightRect = new RectangleF(width - 2 * radius - 1, x, 2 * radius, 2 * radius); - RectangleF lowerLeftRect = new RectangleF(x, height - 2 * radius - 1, 2 * radius, 2 * radius); - RectangleF lowerRightRect = new RectangleF(width - 2 * radius - 1, height - 2 * radius - 1, 2 * radius, 2 * radius); - - grPath.AddArc(upperLeftRect, 180, 90); - grPath.AddArc(upperRightRect, 270, 90); - grPath.AddArc(lowerRightRect, 0, 90); - grPath.AddArc(lowerLeftRect, 90, 90); - grPath.CloseAllFigures(); - - } - public RoundedRectangleF() - { - } - public GraphicsPath Path - { - get - { - return grPath; - } - } - public RectangleF Rect - { - get - { - return new RectangleF(x, y, width, height); - } - } - public float Radius - { - get - { - return radius; - } - set - { - radius = value; - } - } - - } - #endregion - #region Transparent public class Transparenter { @@ -117,116 +33,7 @@ public static void MakeTransparent(Control control, Graphics g) behind.Dispose(); } } - #endregion - - #region Helpers - public static class Helpers - { - public static Color C1_F = ColorFromHex("#007196"); - public static Color C1_B = ColorFromHex("#00BFFF"); - - public static Color C2_F = ColorFromHex("#D15A4D"); - public static Color C2_B = ColorFromHex("#FFCFCA"); - - public static Color C3_F = ColorFromHex("#54AB54"); - public static Color C3_B = ColorFromHex("#CAFFCA"); - - public static Color C4_F = ColorFromHex("#ADA200"); - public static Color C4_B = ColorFromHex("#FCF47E"); - - public static Color C5_F = ColorFromHex("#E800CD"); - public static Color C5_B = ColorFromHex("#FFBFF7"); - - public static Color C6_F = ColorFromHex("#0EADAD"); - public static Color C6_B = ColorFromHex("#9CFFFF"); - - public static Color ColorFromHex(string Hex) - { - return Color.FromArgb(Convert.ToInt32(long.Parse(string.Format("FFFFFFFFFF{0}", Hex.StartsWith("#") ? Hex.Substring(1) : Hex), System.Globalization.NumberStyles.HexNumber))); - } - public enum MouseState : byte - { - None = 0, - Over = 1, - Down = 2 - } - - public enum RoundingStyle : byte - { - All = 0, - Top = 1, - Bottom = 2, - Left = 3, - Right = 4, - TopRight = 5, - BottomRight = 6 - } - - public static GraphicsPath RoundRect(Rectangle Rect, int Rounding, RoundingStyle Style = RoundingStyle.All) - { - - GraphicsPath GP = new GraphicsPath(); - int AW = Rounding * 2; - - GP.StartFigure(); - - if (Rounding == 0) - { - GP.AddRectangle(Rect); - GP.CloseAllFigures(); - return GP; - } - - switch (Style) - { - case RoundingStyle.All: - GP.AddArc(new Rectangle(Rect.X, Rect.Y, AW, AW), -180, 90); - GP.AddArc(new Rectangle(Rect.Width - AW + Rect.X, Rect.Y, AW, AW), -90, 90); - GP.AddArc(new Rectangle(Rect.Width - AW + Rect.X, Rect.Height - AW + Rect.Y, AW, AW), 0, 90); - GP.AddArc(new Rectangle(Rect.X, Rect.Height - AW + Rect.Y, AW, AW), 90, 90); - break; - case RoundingStyle.Top: - GP.AddArc(new Rectangle(Rect.X, Rect.Y, AW, AW), -180, 90); - GP.AddArc(new Rectangle(Rect.Width - AW + Rect.X, Rect.Y, AW, AW), -90, 90); - GP.AddLine(new Point(Rect.X + Rect.Width, Rect.Y + Rect.Height), new Point(Rect.X, Rect.Y + Rect.Height)); - break; - case RoundingStyle.Bottom: - GP.AddLine(new Point(Rect.X, Rect.Y), new Point(Rect.X + Rect.Width, Rect.Y)); - GP.AddArc(new Rectangle(Rect.Width - AW + Rect.X, Rect.Height - AW + Rect.Y, AW, AW), 0, 90); - GP.AddArc(new Rectangle(Rect.X, Rect.Height - AW + Rect.Y, AW, AW), 90, 90); - break; - case RoundingStyle.Left: - GP.AddArc(new Rectangle(Rect.X, Rect.Y, AW, AW), -180, 90); - GP.AddLine(new Point(Rect.X + Rect.Width, Rect.Y), new Point(Rect.X + Rect.Width, Rect.Y + Rect.Height)); - GP.AddArc(new Rectangle(Rect.X, Rect.Height - AW + Rect.Y, AW, AW), 90, 90); - break; - case RoundingStyle.Right: - GP.AddLine(new Point(Rect.X, Rect.Y + Rect.Height), new Point(Rect.X, Rect.Y)); - GP.AddArc(new Rectangle(Rect.Width - AW + Rect.X, Rect.Y, AW, AW), -90, 90); - GP.AddArc(new Rectangle(Rect.Width - AW + Rect.X, Rect.Height - AW + Rect.Y, AW, AW), 0, 90); - break; - case RoundingStyle.TopRight: - GP.AddLine(new Point(Rect.X, Rect.Y + 1), new Point(Rect.X, Rect.Y)); - GP.AddArc(new Rectangle(Rect.Width - AW + Rect.X, Rect.Y, AW, AW), -90, 90); - GP.AddLine(new Point(Rect.X + Rect.Width, Rect.Y + Rect.Height - 1), new Point(Rect.X + Rect.Width, Rect.Y + Rect.Height)); - GP.AddLine(new Point(Rect.X + 1, Rect.Y + Rect.Height), new Point(Rect.X, Rect.Y + Rect.Height)); - break; - case RoundingStyle.BottomRight: - GP.AddLine(new Point(Rect.X, Rect.Y + 1), new Point(Rect.X, Rect.Y)); - GP.AddLine(new Point(Rect.X + Rect.Width - 1, Rect.Y), new Point(Rect.X + Rect.Width, Rect.Y)); - GP.AddArc(new Rectangle(Rect.Width - AW + Rect.X, Rect.Height - AW + Rect.Y, AW, AW), 0, 90); - GP.AddLine(new Point(Rect.X + 1, Rect.Y + Rect.Height), new Point(Rect.X, Rect.Y + Rect.Height)); - break; - } - - GP.CloseAllFigures(); - - return GP; - - } - - } - #endregion + #endregion #region Draw Helpers public static class DrawHelper @@ -344,75 +151,6 @@ public static class StringAlign } #endregion - #region Theme Color Helpers - public static class ThemeColors - { - /// - /// 主色 - /// - public static Color PrimaryColor = Color.FromArgb(250, 36, 38); - public static Color LightPrimary = Color.FromArgb(250, 36, 38); - public static Color DarkPrimary = Color.FromArgb(250, 36, 38); - - #region 辅助色 - /// - /// 成功 - /// - public static Color Success = ColorTranslator.FromHtml("#67c23a"); - /// - /// 警告 - /// - public static Color Warning = ColorTranslator.FromHtml("#e6a23c"); - /// - /// 危险 - /// - public static Color Danger = ColorTranslator.FromHtml("#f56c6c"); - /// - /// 信息 - /// - public static Color Info = ColorTranslator.FromHtml("#909399"); - #endregion - - #region 文字颜色 - /// - /// 主要文字 - /// - public static Color MainText = ColorTranslator.FromHtml("#303133"); - /// - /// 常规文字 - /// - public static Color RegularText = ColorTranslator.FromHtml("#606266"); - /// - /// 次要文字 - /// - public static Color SecondaryText = ColorTranslator.FromHtml("#909399"); - /// - /// 占位文字 - /// - public static Color PlaceholderText = ColorTranslator.FromHtml("#c0c4cc"); - #endregion - - #region 边框颜色 - /// - /// 一级边框 - /// - public static Color OneLevelBorder = ColorTranslator.FromHtml("#dcdfe6"); - /// - /// 二级边框 - /// - public static Color TwoLevelBorder = ColorTranslator.FromHtml("#e4e7ed"); - /// - /// 三级边框 - /// - public static Color ThreeLevelBorder = ColorTranslator.FromHtml("#ebeef5"); - /// - /// 四级边框 - /// - public static Color FourLevelBorder = ColorTranslator.FromHtml("#f2f6fc"); - #endregion - } - #endregion - #region External Utilities internal class Adjustments { @@ -635,7 +373,7 @@ public static void Prevents(Graphics g, int w, int h) { string txt = System.Text.Encoding.UTF8.GetString(Convert.FromBase64String("VGhlbWUlMjBjcmVhdGVkJTIwYnklMjBIYXdrJTIwSEY=")).Replace("%20", " "); Size txtSize = new Size(Convert.ToInt32(g.MeasureString(txt, new Font("Segoe UI", 8)).Width), Convert.ToInt32(g.MeasureString(txt, new Font("Segoe UI", 8)).Height)); - g.DrawString(txt, new Font("Segoe UI", 8), new SolidBrush(Color.FromArgb(125, 125, 125)), new Point(w - txtSize.Width - 6, h - txtSize.Height - 4)); + g.DrawString(txt, new Font("Segoe UI", 8), new SolidBrush(Color.FromArgb(15, 15, 15)), new Point(w - txtSize.Width - 6, h - txtSize.Height - 4)); } } @@ -794,87 +532,4 @@ protected override void OnMouseUp(System.Windows.Forms.MouseEventArgs e) } #endregion - - #region Help Engines - internal class HelpEngine - { - /// - /// Вызывает MessageBox.Show(...) с готовыми параметрами. - /// - /// - /// - /// Текст сообщения MessageBox - /// - public static void MSB_Error(string text) => System.Windows.Forms.MessageBox.Show(text, "FC-UI", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error); - - /// - /// Создает новый объект Font - /// - /// - /// - /// Имя шрифта. - /// - /// - /// Размер шрифта. - /// - /// - /// Стиль шрифта. - /// - /// - /// Этот метод возвращает новый объект Font, который является стандартным шрифтом FC_UI или же шрифтом по заданным параметрам. - public static Font GetDefaultFont( - string familyName = "Segoe UI", - float emSize = 11.0F, - FontStyle fontStyle = FontStyle.Regular) => new Font(familyName, emSize, fontStyle); - - /// - /// Создает новый объект Graphics на основе ссылочного Bitmap. - /// - /// - /// - /// Режим сглаживания для линий и границ. - /// - /// - /// Качество отрисовки текста. - /// - /// - /// Этот метод возвращает новый объект Graphics по заданным параметрам. - public static Graphics GetGraphics(ref Bitmap bitmap, SmoothingMode SmoothingMode, TextRenderingHint TextRenderingHint) - { - Graphics graphics = Graphics.FromImage(bitmap); - graphics.SmoothingMode = SmoothingMode; - graphics.TextRenderingHint = TextRenderingHint; - - return graphics; - } - - /// - /// Класс GetRandom, который имеет готовый объект Random и готовые методы для работы с ним. - /// - public class GetRandom - { - private readonly System.Random random = new System.Random(System.Environment.TickCount); - - /// - /// Создает объект Color. - /// - /// - /// - /// Альфа (0..255) - /// - /// - /// Этот метод возвращает новый объект Color по случайным параметрам. - public Color ColorArgb(int alpha = 255) => Color.FromArgb(alpha, Int(0, 255), Int(0, 255), Int(0, 255)); - - /// Этот метод возвращает случайное целое число в указанном диапазоне. - public int Int(int min, int max) => random.Next(min, max); - - /// Этот метод возвращает случайное число с плавающей запятой в указанном диапазоне. - public float Float(int min, int max) => random.Next(min * 100, max * 100) / 100; - - /// Этот метод возвращает true или false. - public bool Bool() => Int(0, 2) == 1; - } - } - #endregion } \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Helpers/Main/Helper/Theme.cs b/CBH-WinForm-Theme-NET/Theme/ThemeBase/Helpers/Theme.cs similarity index 99% rename from CBH-Ultimate-Theme-Library-NET-Framework/Theme/Helpers/Main/Helper/Theme.cs rename to CBH-WinForm-Theme-NET/Theme/ThemeBase/Helpers/Theme.cs index 2923b84..c23ad97 100644 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/Helpers/Main/Helper/Theme.cs +++ b/CBH-WinForm-Theme-NET/Theme/ThemeBase/Helpers/Theme.cs @@ -10,17 +10,17 @@ namespace CBH_Ultimate_Theme_Library #region Imports - using System.IO; + using System.ComponentModel; using System.Drawing; using System.Drawing.Drawing2D; - using System.ComponentModel; - using System.Windows.Forms; - using System.Runtime.InteropServices; using System.Drawing.Imaging; + using System.IO; + using System.Runtime.InteropServices; + using System.Windows.Forms; #endregion - + public abstract class ThemeContainer154 : ContainerControl { @@ -2372,7 +2372,7 @@ public Bloom(string name, Color value) } } - + public class PrecisionTimer : IDisposable { @@ -2432,7 +2432,7 @@ public void Dispose() } #endregion - + [ToolboxItem(false)] public class AVGTheme : ThemeContainer154 { @@ -2460,6 +2460,6 @@ protected override void PaintHook() G.DrawIcon(Parent.FindForm().Icon, new Rectangle(9, 18, 25, 25)); } } - + } diff --git a/CBH-WinForm-Theme-NET/Theme/ThemeBase/Helpers/ThemeContainer.cs b/CBH-WinForm-Theme-NET/Theme/ThemeBase/Helpers/ThemeContainer.cs new file mode 100644 index 0000000..64ac740 --- /dev/null +++ b/CBH-WinForm-Theme-NET/Theme/ThemeBase/Helpers/ThemeContainer.cs @@ -0,0 +1,165 @@ +#region Imports +using CBH_Ultimate_Theme_Library.Theme.Helpers; +using System; +using System.ComponentModel; +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Windows.Forms; +#endregion + +namespace CBH_Ultimate_Theme_Library +{ + + [ToolboxItem(false)] + public class ASCThemeContainer : ContainerControl + { + + private int moveHeight = 38; + private bool formCanMove = false; + private int mouseX; + private int mouseY; + private bool overExit; + + private bool overMin; + public override string Text + { + get { return base.Text; } + set + { + base.Text = value; + Invalidate(); + } + } + + public ASCThemeContainer() + { + SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.UserPaint | ControlStyles.ResizeRedraw, true); + Dock = DockStyle.Fill; + Font = new Font("Arial", 12, FontStyle.Bold | FontStyle.Italic); + BackColor = Color.FromArgb(15, 15, 15); + } + + protected override void CreateHandle() + { + base.CreateHandle(); + Parent.FindForm().FormBorderStyle = FormBorderStyle.None; + if (Parent.FindForm().TransparencyKey == null) + Parent.FindForm().TransparencyKey = Color.Fuchsia; + } + + protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) + { + base.OnPaint(e); + + Graphics G = e.Graphics; + G.Clear(Parent.FindForm().TransparencyKey); + + int slope = 8; + + Rectangle mainRect = new Rectangle(0, 0, Width - 1, Height - 1); + GraphicsPath mainPath = Drawing.RoundRect(mainRect, slope); + G.FillPath(new SolidBrush(BackColor), mainPath); + G.DrawPath(new Pen(Color.FromArgb(30, 35, 45)), mainPath); + G.FillPath(new SolidBrush(Color.FromArgb(30, 30, 40)), Drawing.RoundRect(new Rectangle(0, 0, Width - 1, moveHeight - slope), slope)); + G.FillRectangle(new SolidBrush(Color.FromArgb(30, 30, 40)), new Rectangle(0, moveHeight - (slope * 2), Width - 1, slope * 2)); + G.DrawLine(new Pen(Color.FromArgb(60, 60, 60)), new Point(1, moveHeight), new Point(Width - 2, moveHeight)); + G.SmoothingMode = SmoothingMode.HighQuality; + + int textX = 6; + int textY = (moveHeight / 2) - Convert.ToInt32((G.MeasureString(Text, Font).Height / 2)) + 1; + Size textSize = new Size(Convert.ToInt32(G.MeasureString(Text, Font).Width), Convert.ToInt32(G.MeasureString(Text, Font).Height)); + Rectangle textRect = new Rectangle(textX, textY, textSize.Width, textSize.Height); + LinearGradientBrush textBrush = new LinearGradientBrush(textRect, Color.FromArgb(185, 190, 195), Color.FromArgb(125, 125, 125), 90f); + G.DrawString(Text, Font, textBrush, new Point(textX, textY)); + + if (overExit) + { + G.DrawString("r", new Font("Marlett", 12, FontStyle.Bold), new SolidBrush(Color.FromArgb(25, 100, 140)), new Point(Width - 27, 11)); + } + else + { + G.DrawString("r", new Font("Marlett", 12, FontStyle.Bold), new SolidBrush(Color.FromArgb(205, 210, 215)), new Point(Width - 27, 11)); + } + if (overMin) + { + G.DrawString("0", new Font("Marlett", 12, FontStyle.Bold), new SolidBrush(Color.FromArgb(25, 100, 140)), new Point(Width - 47, 10)); + } + else + { + G.DrawString("0", new Font("Marlett", 12, FontStyle.Bold), new SolidBrush(Color.FromArgb(205, 210, 215)), new Point(Width - 47, 10)); + } + + if (DesignMode) + + Prevent.Prevents(G, Width, Height); + + } + + protected override void OnMouseMove(System.Windows.Forms.MouseEventArgs e) + { + base.OnMouseMove(e); + + if (formCanMove == true) + { + Parent.FindForm().Location = new Point(MousePosition.X - mouseX, MousePosition.Y - mouseY); + } + + if (e.Y > 11 && e.Y < 24) + { + if (e.X > Width - 23 && e.X < Width - 10) + overExit = true; + else + overExit = false; + if (e.X > Width - 44 && e.X < Width - 31) + overMin = true; + else + overMin = false; + } + else + { + overExit = false; + overMin = false; + } + + Invalidate(); + + } + + protected override void OnMouseDown(System.Windows.Forms.MouseEventArgs e) + { + base.OnMouseDown(e); + + mouseX = e.X; + mouseY = e.Y; + + if (e.Y <= moveHeight && overExit == false && overMin == false) + formCanMove = true; + + if (overExit) + { + Parent.FindForm().Close(); + } + else if (overMin) + { + Parent.FindForm().WindowState = FormWindowState.Minimized; + overExit = false; + overMin = false; + } + else + { + Focus(); + } + + Invalidate(); + + } + + protected override void OnMouseUp(System.Windows.Forms.MouseEventArgs e) + { + base.OnMouseUp(e); + formCanMove = false; + } + + } + +} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/ThemeBase/Shadow Controls/CrEaTiiOn_Shadow_Controls.cs b/CBH-WinForm-Theme-NET/Theme/ThemeBase/Shadow Controls/CrEaTiiOn_Shadow_Controls.cs similarity index 98% rename from CBH-Ultimate-Theme-Library-NET-Framework/Theme/ThemeBase/Shadow Controls/CrEaTiiOn_Shadow_Controls.cs rename to CBH-WinForm-Theme-NET/Theme/ThemeBase/Shadow Controls/CrEaTiiOn_Shadow_Controls.cs index e6e61ab..0465184 100644 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/ThemeBase/Shadow Controls/CrEaTiiOn_Shadow_Controls.cs +++ b/CBH-WinForm-Theme-NET/Theme/ThemeBase/Shadow Controls/CrEaTiiOn_Shadow_Controls.cs @@ -5,15 +5,16 @@ using System.Drawing; using System.Drawing.Drawing2D; using System.Drawing.Imaging; -using System.Drawing.Text; using System.IO; using System.Runtime.InteropServices; -using System.Windows.Forms; using System.Timers; +using System.Windows.Forms; #endregion namespace CBH.Shadow.Controls { + //These were developed by Hawk & LordVirus (TheOnlyLordVirus) + //EternalMoz has cleaned these controls up and has made a few small changes / fixes #region Controls class CrEaTiiOn_Shadow_Button : ThemeControl154 { @@ -37,7 +38,7 @@ protected override void PaintHook() bg_cblend.Colors[0] = Color.FromArgb(15, 15, 15); bg_cblend.Colors[1] = Color.FromArgb(15, 15, 15); bg_cblend.Colors[2] = Color.FromArgb(15, 15, 15); - bg_cblend.Positions = new [] {0,(float)0.6,1 }; + bg_cblend.Positions = new[] { 0, (float)0.6, 1 }; DrawGradient(bg_cblend, new Rectangle(1, 1, Width - 2, Height - 2)); //MouseState Point[] backPoints = { @@ -127,14 +128,14 @@ protected override void PaintHook() bg_cblend.Colors[0] = Color.FromArgb(250, 36, 38); bg_cblend.Colors[1] = Color.FromArgb(15, 15, 15); bg_cblend.Colors[2] = Color.FromArgb(250, 36, 38); - bg_cblend.Positions = new [] {0,(float)0.5,1}; + bg_cblend.Positions = new[] { 0, (float)0.5, 1 }; DrawGradient(bg_cblend, new Rectangle(1, 1, Width - 2, Height - 2)); //Bar ColorBlend bar_cblend = new ColorBlend(3); bar_cblend.Colors[0] = Color.FromArgb(250, 36, 38); bar_cblend.Colors[1] = Color.FromArgb(15, 15, 15); bar_cblend.Colors[2] = Color.FromArgb(250, 36, 38); - bar_cblend.Positions = new[] {0,(float)0.5, 1 }; + bar_cblend.Positions = new[] { 0, (float)0.5, 1 }; DrawGradient(bar_cblend, new Rectangle(1, 1, Convert.ToInt32(((Width / _Maximum) * _Value) - 2), Height - 2)); //Border Point[] borderPoints = { @@ -223,7 +224,8 @@ protected override void OnAnimation() { x += 1; } - else { + else + { x -= 1; } if (x >= this.Width - 1) @@ -274,7 +276,7 @@ protected override void PaintHook() text_cblend.Colors[0] = Color.FromArgb(15, 15, 15); text_cblend.Colors[1] = Color.FromArgb(Red, Green, Blue); text_cblend.Colors[2] = Color.FromArgb(15, 15, 15); - text_cblend.Positions = new[] {0,(float) 0.5,(float)1.0}; + text_cblend.Positions = new[] { 0, (float)0.5, (float)1.0 }; DrawGradient(text_cblend, glowRect, 0f); //Reinforce Borders G.DrawPolygon(Pens.Black, borderPoints); @@ -317,7 +319,8 @@ protected override void OnClick(System.EventArgs e) { FindForm().WindowState = FormWindowState.Minimized; } - else { + else + { FindForm().Close(); } } @@ -357,9 +360,9 @@ protected override void PaintHook() break; } //OuterRects - G.DrawRectangles(Pens.Black,new [] {minRect,xRect}); + G.DrawRectangles(Pens.Black, new[] { minRect, xRect }); //Characters - G.DrawString("0", new Font("Marlett", (float)8.25,FontStyle.Regular), Brushes.White, new Point(5, 5)); + G.DrawString("0", new Font("Marlett", (float)8.25, FontStyle.Regular), Brushes.White, new Point(5, 5)); G.DrawString("r", new Font("Marlett", 10), Brushes.White, new Point(26, 4)); } } @@ -417,12 +420,12 @@ protected override void PaintHook() checked_cblend.Colors[0] = Color.FromArgb(255, 255, 255); checked_cblend.Colors[1] = Color.FromArgb(255, 255, 255); checked_cblend.Colors[2] = Color.FromArgb(255, 255, 255); - checked_cblend.Positions = new[] {0,(float)0.7,1}; + checked_cblend.Positions = new[] { 0, (float)0.7, 1 }; ColorBlend bg_cblend = new ColorBlend(3); bg_cblend.Colors[0] = Color.FromArgb(14, 14, 14); bg_cblend.Colors[1] = Color.FromArgb(12, 12, 12); bg_cblend.Colors[2] = Color.FromArgb(16, 16, 16); - bg_cblend.Positions = new[] {0,(float)0.5,1 }; + bg_cblend.Positions = new[] { 0, (float)0.5, 1 }; //Checked if (_Checked == true) { @@ -430,7 +433,8 @@ protected override void PaintHook() G.DrawPolygon(new Pen(new SolidBrush(Color.FromArgb(255, 255, 255))), innerpoints); G.DrawPolygon(Pens.Black, cbPoints); } - else { + else + { DrawGradient(bg_cblend, new Rectangle(4, 4, 12, 12), -45f); G.DrawPolygon(Pens.Black, cbPoints); } @@ -549,7 +553,8 @@ public bool Multiline LockHeight = 0; Base.Height = Height - 11; } - else { + else + { LockHeight = Base.Height + 11; } } @@ -611,7 +616,8 @@ public CrEaTiiOn_Shadow_TextBodx() { Base.Height = Height - 11; } - else { + else + { LockHeight = Base.Height + 11; } Base.TextChanged += OnBaseTextChanged; @@ -728,7 +734,8 @@ protected override void OnPaint(PaintEventArgs e) Alignment = StringAlignment.Center }); } - else { + else + { Rectangle x2 = new Rectangle(GetTabRect(i).X - 2, GetTabRect(i).Y + 3, GetTabRect(i).Width, GetTabRect(i).Height - 5); LinearGradientBrush G1 = new LinearGradientBrush(x2, Color.FromArgb(20, 20, 20), Color.FromArgb(35, 35, 35), -90f); G.FillRectangle(G1, x2); @@ -856,7 +863,8 @@ protected override sealed void OnPaint(PaintEventArgs e) PaintHook(); e.Graphics.DrawImage(B, 0, 0); } - else { + else + { G = e.Graphics; PaintHook(); } @@ -1010,7 +1018,8 @@ protected override void WndProc(ref Message m) { CorrectBounds(new Rectangle(Point.Empty, Parent.Parent.Size)); } - else { + else + { CorrectBounds(Screen.FromControl(Parent).WorkingArea); } } @@ -1576,7 +1585,8 @@ private void InvalidateBitmap() B = new Bitmap(Width, Height, PixelFormat.Format32bppPArgb); G = Graphics.FromImage(B); } - else { + else + { G = null; B = null; } @@ -1604,7 +1614,8 @@ private void InvalidateTimer() { ThemeShare.AddAnimationCallback(DoAnimation); } - else { + else + { ThemeShare.RemoveAnimationCallback(DoAnimation); } } @@ -1727,7 +1738,8 @@ protected void DrawPixel(Color c1, int x, int y) { B.SetPixel(x, y, c1); } - else { + else + { DrawPixelBrush = new SolidBrush(c1); G.FillRectangle(DrawPixelBrush, x, y, 1, 1); } @@ -1772,7 +1784,8 @@ protected void DrawCorners(Color c1, int x, int y, int width, int height) B.SetPixel(x, y + (height - 1), c1); B.SetPixel(x + (width - 1), y + (height - 1), c1); } - else { + else + { DrawCornersBrush = new SolidBrush(c1); G.FillRectangle(DrawCornersBrush, x, y, 1, 1); G.FillRectangle(DrawCornersBrush, x + (width - 1), y, 1, 1); @@ -2007,7 +2020,8 @@ public void DrawRadial(ColorBlend blend, Rectangle r, int cx, int cy) { G.FillEllipse(DrawRadialBrush1, r.X + 1, r.Y + 1, r.Width - 3, r.Height - 3); } - else { + else + { G.FillEllipse(DrawRadialBrush1, r); } } @@ -2137,7 +2151,8 @@ protected override sealed void OnPaint(PaintEventArgs e) PaintHook(); e.Graphics.DrawImage(B, 0, 0); } - else { + else + { G = e.Graphics; PaintHook(); } @@ -2307,7 +2322,8 @@ public Image Image { _ImageSize = Size.Empty; } - else { + else + { _ImageSize = value.Size; } @@ -2523,7 +2539,8 @@ private void InvalidateTimer() { ThemeShare.AddAnimationCallback(DoAnimation); } - else { + else + { ThemeShare.RemoveAnimationCallback(DoAnimation); } } @@ -2640,7 +2657,8 @@ protected void DrawPixel(Color c1, int x, int y) { B.SetPixel(x, y, c1); } - else { + else + { DrawPixelBrush = new SolidBrush(c1); G.FillRectangle(DrawPixelBrush, x, y, 1, 1); } @@ -2685,7 +2703,8 @@ protected void DrawCorners(Color c1, int x, int y, int width, int height) B.SetPixel(x, y + (height - 1), c1); B.SetPixel(x + (width - 1), y + (height - 1), c1); } - else { + else + { DrawCornersBrush = new SolidBrush(c1); G.FillRectangle(DrawCornersBrush, x, y, 1, 1); G.FillRectangle(DrawCornersBrush, x + (width - 1), y, 1, 1); @@ -2920,7 +2939,8 @@ public void DrawRadial(ColorBlend blend, Rectangle r, int cx, int cy) { G.FillEllipse(DrawRadialBrush1, r.X + 1, r.Y + 1, r.Width - 3, r.Height - 3); } - else { + else + { G.FillEllipse(DrawRadialBrush1, r); } } @@ -3016,7 +3036,8 @@ private static void InvalidateThemeTimer() { ThemeTimer.Delete(); } - else { + else + { ThemeTimer.Create(0, Rate, HandleCallbacks); } } @@ -3162,5 +3183,4 @@ public void Dispose() } } #endregion - //These were developed by Hawk & LordVirus (TheOnlyLordVirus) -} +} \ No newline at end of file diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_FancyButton.cs b/CBH-WinForm-Theme-NET/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_FancyButton.cs similarity index 93% rename from CBH-Ultimate-Theme-Library-NET-Framework/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_FancyButton.cs rename to CBH-WinForm-Theme-NET/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_FancyButton.cs index 0c5c1fd..607208d 100644 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_FancyButton.cs +++ b/CBH-WinForm-Theme-NET/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_FancyButton.cs @@ -15,7 +15,7 @@ public sealed class CrEaTiiOn_Ultimate_FancyButton : Button [Category("CrEaTiiOn")] public int BorderSize { get => _borderSize; set { _borderSize = value; Invalidate(); } } [Category("CrEaTiiOn")] - public int BorderRadius { get => _borderRadius; set { if(value <= this.Height) _borderRadius = value; else BorderRadius = this.Height; Invalidate(); } } + public int BorderRadius { get => _borderRadius; set { if (value <= this.Height) _borderRadius = value; else BorderRadius = this.Height; Invalidate(); } } [Category("CrEaTiiOn")] public Color BorderColor { get => _borderColor; set { _borderColor = value; Invalidate(); } } [Category("CrEaTiiOn")] @@ -68,8 +68,8 @@ protected override void OnPaint(PaintEventArgs pevent) if (BorderRadius > 2) { - using(var pathSurface = GetFigurePath(rectSurface, BorderRadius)) - using(var pathBorder = GetFigurePath(rectBorder, BorderRadius - 1)) + using (var pathSurface = GetFigurePath(rectSurface, BorderRadius)) + using (var pathBorder = GetFigurePath(rectBorder, BorderRadius - 1)) using (var penSurface = new Pen(Parent.BackColor, 2)) using (var penBorder = new Pen(BorderColor, BorderSize)) { @@ -102,7 +102,7 @@ protected override void OnHandleCreated(EventArgs e) private void ParentOnBackColorChanged(object sender, EventArgs e) { - if(DesignMode) + if (DesignMode) Invalidate(); } } diff --git a/CBH-Ultimate-Theme-Library/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_FancyComboBox.cs b/CBH-WinForm-Theme-NET/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_FancyComboBox.cs similarity index 98% rename from CBH-Ultimate-Theme-Library/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_FancyComboBox.cs rename to CBH-WinForm-Theme-NET/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_FancyComboBox.cs index 8e690c3..32dd219 100644 --- a/CBH-Ultimate-Theme-Library/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_FancyComboBox.cs +++ b/CBH-WinForm-Theme-NET/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_FancyComboBox.cs @@ -40,7 +40,7 @@ public sealed class CrEaTiiOn_Ultimate_FancyComboBox : UserControl [Category("CrEaTiiOn")] public string String { get => _labelString.Text; set => _labelString.Text = value; } [Category("CrEaTiiOn")] - public ComboBoxStyle DropDownStyle { get => _comboList.DropDownStyle; set { if(_comboList.DropDownStyle != ComboBoxStyle.Simple) _comboList.DropDownStyle = value; } } + public ComboBoxStyle DropDownStyle { get => _comboList.DropDownStyle; set { if (_comboList.DropDownStyle != ComboBoxStyle.Simple) _comboList.DropDownStyle = value; } } [Category("CrEaTiiOn")] [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] @@ -166,7 +166,7 @@ private void Icon_Paint(object sender, PaintEventArgs e) var rectIcon = new Rectangle((_buttonIcon.Width - iconWidth) / 2, (_buttonIcon.Height - iconHeight) / 2, iconWidth, iconHeight); Graphics graphics = e.Graphics; - using(GraphicsPath path = new GraphicsPath()) + using (GraphicsPath path = new GraphicsPath()) using (Pen pen = new Pen(IconColor, 2)) { graphics.SmoothingMode = SmoothingMode.AntiAlias; diff --git a/CBH-Ultimate-Theme-Library/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_FancyComboBox.resx b/CBH-WinForm-Theme-NET/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_FancyComboBox.resx similarity index 100% rename from CBH-Ultimate-Theme-Library/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_FancyComboBox.resx rename to CBH-WinForm-Theme-NET/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_FancyComboBox.resx diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_FancyTextBox.resx b/CBH-WinForm-Theme-NET/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_FancyTextBox.resx similarity index 100% rename from CBH-Ultimate-Theme-Library-NET-Framework/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_FancyTextBox.resx rename to CBH-WinForm-Theme-NET/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_FancyTextBox.resx diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientButton.cs b/CBH-WinForm-Theme-NET/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientButton.cs similarity index 100% rename from CBH-Ultimate-Theme-Library-NET-Framework/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientButton.cs rename to CBH-WinForm-Theme-NET/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientButton.cs diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientLabel.cs b/CBH-WinForm-Theme-NET/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientLabel.cs similarity index 84% rename from CBH-Ultimate-Theme-Library-NET-Framework/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientLabel.cs rename to CBH-WinForm-Theme-NET/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientLabel.cs index 4002423..089141e 100644 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientLabel.cs +++ b/CBH-WinForm-Theme-NET/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientLabel.cs @@ -1,16 +1,11 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; +using System.ComponentModel; using System.Drawing; using System.Drawing.Drawing2D; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Windows.Forms; namespace CBH.Ultimate.Controls { - public class CrEaTiiOn_Ultimate_GradientLabel: Label + public class CrEaTiiOn_Ultimate_GradientLabel : Label { private Color _FirstColor = Color.FromArgb(250, 36, 38); diff --git a/CBH-WinForm-Theme-NET/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientNumericUpDown.cs b/CBH-WinForm-Theme-NET/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientNumericUpDown.cs new file mode 100644 index 0000000..47802e6 --- /dev/null +++ b/CBH-WinForm-Theme-NET/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientNumericUpDown.cs @@ -0,0 +1,146 @@ +using System; +using System.ComponentModel; +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Drawing.Text; +using System.Windows.Forms; + +namespace CBH.Ultimate.Controls +{ + public sealed class CrEaTiiOn_Ultimate_GradientNumericUpDown : Control + { + private int _w; + private int _h; + private int _x; + private int _y; + private long _value; + private long _min; + private long _max; + private bool _bool; + + private Color _baseColor = Color.FromArgb(15, 15, 15); + private Color _gradientColorPrimary = Color.FromArgb(250, 36, 38); + private Color _gradientColorSecondary = Color.FromArgb(45, 45, 45); + private Color _stringColor = Color.White; + + public long Value { get => _value; set { if (value <= _max & value >= _min) _value = value; Invalidate(); } } + public long Maximum { get => _max; set { if (value > _min) _max = value; if (_value > _max) _value = _max; Invalidate(); } } + public long Minimum { get => _min; set { if (value < _max) _min = value; if (_value < _min) _value = Minimum; Invalidate(); } } + + [Category("CrEaTiiOn")] + public Color BaseColor { get { return _baseColor; } set { _baseColor = value; Invalidate(); } } + [Category("CrEaTiiOn")] + public Color GradientColorPrimary { get => _gradientColorPrimary; set { _gradientColorPrimary = value; Invalidate(); } } + [Category("CrEaTiiOn")] + public Color GradientColorSecondary { get => _gradientColorSecondary; set { _gradientColorSecondary = value; Invalidate(); } } + [Category("CrEaTiiOn")] + public Color StringColor { get => _stringColor; set => _stringColor = value; } + + public CrEaTiiOn_Ultimate_GradientNumericUpDown() + { + SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.OptimizedDoubleBuffer | ControlStyles.SupportsTransparentBackColor, true); + DoubleBuffered = true; + _min = 0; + _max = 9999999; + } + + protected override void OnMouseMove(MouseEventArgs e) + { + base.OnMouseMove(e); + _x = e.Location.X; + _y = e.Location.Y; + Invalidate(); + Cursor = e.X < Width - 23 ? Cursors.IBeam : Cursors.Hand; + } + + protected override void OnMouseDown(MouseEventArgs e) + { + base.OnMouseDown(e); + if (_x > Width - 21 && _x < Width - 3) + { + if (_y < 15) + { + if ((Value + 1) <= _max) + _value += 1; + } + else + { + if ((Value - 1) >= _min) + _value -= 1; + } + } + else + { + _bool = !_bool; + Focus(); + } + Invalidate(); + } + + protected override void OnKeyPress(KeyPressEventArgs e) + { + base.OnKeyPress(e); + try + { + if (_bool) + _value = Convert.ToInt64(_value + e.KeyChar.ToString()); + if (_value > _max) + _value = _max; + Invalidate(); + } + catch + { + // ignored + } + } + + protected override void OnKeyDown(KeyEventArgs e) + { + base.OnKeyDown(e); + if (e.KeyCode == Keys.Back) + { + Value = 0; + } + } + + protected override void OnResize(EventArgs e) + { + base.OnResize(e); + Height = 30; + } + + public static readonly StringFormat CenterSf = new StringFormat + { + Alignment = StringAlignment.Center, + LineAlignment = StringAlignment.Center + }; + + + protected override void OnPaint(PaintEventArgs e) + { + var bitmap = new Bitmap(Width, Height); + var graphics = Graphics.FromImage(bitmap); + _w = Width; + _h = Height; + + var rectBase = new Rectangle(0, 0, _w, _h); + + graphics.SmoothingMode = SmoothingMode.AntiAlias; + graphics.PixelOffsetMode = PixelOffsetMode.HighQuality; + graphics.TextRenderingHint = TextRenderingHint.AntiAlias; + graphics.Clear(BackColor); + + graphics.FillRectangle(new SolidBrush(_baseColor), rectBase); + graphics.FillRectangle(new LinearGradientBrush(new PointF(0, Height / 2f), new PointF(Width, Height / 2f), _gradientColorPrimary, _gradientColorSecondary), new Rectangle(Width - 24, 0, 24, _h)); + graphics.DrawString("+", Font, new SolidBrush(_stringColor), new Point(Width - 12, 8), CenterSf); + graphics.DrawString("-", Font, new SolidBrush(_stringColor), new Point(Width - 12, 22), CenterSf); + graphics.DrawString(Value.ToString(), Font, new SolidBrush(_stringColor), new Rectangle(5, 1, _w, _h), new StringFormat { LineAlignment = StringAlignment.Center }); + + base.OnPaint(e); + graphics.Dispose(); + e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic; + e.Graphics.DrawImageUnscaled(bitmap, 0, 0); + bitmap.Dispose(); + } + } +} diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientPanel.cs b/CBH-WinForm-Theme-NET/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientPanel.cs similarity index 100% rename from CBH-Ultimate-Theme-Library-NET-Framework/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientPanel.cs rename to CBH-WinForm-Theme-NET/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientPanel.cs diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientTextBox.Designer.cs b/CBH-WinForm-Theme-NET/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientTextBox.Designer.cs similarity index 100% rename from CBH-Ultimate-Theme-Library-NET-Framework/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientTextBox.Designer.cs rename to CBH-WinForm-Theme-NET/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientTextBox.Designer.cs diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientTextBox.cs b/CBH-WinForm-Theme-NET/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientTextBox.cs similarity index 100% rename from CBH-Ultimate-Theme-Library-NET-Framework/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientTextBox.cs rename to CBH-WinForm-Theme-NET/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientTextBox.cs diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientTextBox.resx b/CBH-WinForm-Theme-NET/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientTextBox.resx similarity index 100% rename from CBH-Ultimate-Theme-Library-NET-Framework/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientTextBox.resx rename to CBH-WinForm-Theme-NET/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientTextBox.resx diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientToggleButton.cs b/CBH-WinForm-Theme-NET/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientToggleButton.cs similarity index 98% rename from CBH-Ultimate-Theme-Library-NET-Framework/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientToggleButton.cs rename to CBH-WinForm-Theme-NET/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientToggleButton.cs index 26141a6..27c9892 100644 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientToggleButton.cs +++ b/CBH-WinForm-Theme-NET/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GradientToggleButton.cs @@ -1,7 +1,7 @@ -using System.Windows.Forms; +using System.ComponentModel; using System.Drawing; using System.Drawing.Drawing2D; -using System.ComponentModel; +using System.Windows.Forms; namespace CBH.Ultimate.Controls { diff --git a/CBH-Ultimate-Theme-Library/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GroupBox.cs b/CBH-WinForm-Theme-NET/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GroupBox.cs similarity index 92% rename from CBH-Ultimate-Theme-Library/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GroupBox.cs rename to CBH-WinForm-Theme-NET/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GroupBox.cs index 6741e67..1d0c4ca 100644 --- a/CBH-Ultimate-Theme-Library/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GroupBox.cs +++ b/CBH-WinForm-Theme-NET/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_GroupBox.cs @@ -22,12 +22,12 @@ public sealed class CrEaTiiOn_Ultimate_GroupBox : GroupBox [Category("CrEaTiiOn")] public int Radius { get => _radius; set { _radius = value; Invalidate(); } } [Category("CrEaTiiOn")] - public Color BackgroundColor { get => _backgroundColor; set { _backgroundColor = value; Invalidate();} } + public Color BackgroundColor { get => _backgroundColor; set { _backgroundColor = value; Invalidate(); } } public CrEaTiiOn_Ultimate_GroupBox() { DoubleBuffered = true; - TitleFont = new Font(Font.FontFamily, Font.Size , FontStyle.Regular); + TitleFont = new Font(Font.FontFamily, Font.Size, FontStyle.Regular); } private GraphicsPath GetFigurePath(RectangleF rect, float radius) @@ -58,7 +58,7 @@ protected override void OnPaint(PaintEventArgs e) //using (var pen = new Pen(_titleBackColor, 1)) e.Graphics.DrawPath(pen, path); TextRenderer.DrawText(e.Graphics, Text, _titleFont, rect, _titleForeColor); e.Graphics.SetClip(clip); - // using (var pen = new Pen(_titleBackColor, 1)) e.Graphics.DrawPath(pen, path); + // using (var pen = new Pen(_titleBackColor, 1)) e.Graphics.DrawPath(pen, path); } } } diff --git a/CBH-WinForm-Theme-NET/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_NumericUpDown.cs b/CBH-WinForm-Theme-NET/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_NumericUpDown.cs new file mode 100644 index 0000000..547119e --- /dev/null +++ b/CBH-WinForm-Theme-NET/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_NumericUpDown.cs @@ -0,0 +1,143 @@ +using System; +using System.ComponentModel; +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Drawing.Text; +using System.Windows.Forms; + +namespace CBH.Ultimate.Controls +{ + public sealed class CrEaTiiOn_Ultimate_NumericUpDown : Control + { + private int _w; + private int _h; + private int _x; + private int _y; + private long _value; + private long _min; + private long _max; + private bool _bool; + + private Color _baseColor = Color.FromArgb(15, 15, 15); + private Color _buttonColor = Color.FromArgb(250, 36, 38); + private Color _stringColor = Color.White; + + public long Value { get => _value; set { if (value <= _max & value >= _min) _value = value; Invalidate(); } } + public long Maximum { get => _max; set { if (value > _min) _max = value; if (_value > _max) _value = _max; Invalidate(); } } + public long Minimum { get => _min; set { if (value < _max) _min = value; if (_value < _min) _value = Minimum; Invalidate(); } } + + [Category("CrEaTiiOn")] + public Color BaseColor { get { return _baseColor; } set { _baseColor = value; Invalidate(); } } + [Category("CrEaTiiOn")] + public Color ButtonColor { get { return _buttonColor; } set { _buttonColor = value; Invalidate(); } } + [Category("CrEaTiiOn")] + public Color StringColor { get => _stringColor; set => _stringColor = value; } + + public CrEaTiiOn_Ultimate_NumericUpDown() + { + SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.OptimizedDoubleBuffer | ControlStyles.SupportsTransparentBackColor, true); + DoubleBuffered = true; + _min = 0; + _max = 9999999; + } + + protected override void OnMouseMove(MouseEventArgs e) + { + base.OnMouseMove(e); + _x = e.Location.X; + _y = e.Location.Y; + Invalidate(); + Cursor = e.X < Width - 23 ? Cursors.IBeam : Cursors.Hand; + } + + protected override void OnMouseDown(MouseEventArgs e) + { + base.OnMouseDown(e); + if (_x > Width - 21 && _x < Width - 3) + { + if (_y < 15) + { + if ((Value + 1) <= _max) + _value += 1; + } + else + { + if ((Value - 1) >= _min) + _value -= 1; + } + } + else + { + _bool = !_bool; + Focus(); + } + Invalidate(); + } + + protected override void OnKeyPress(KeyPressEventArgs e) + { + base.OnKeyPress(e); + try + { + if (_bool) + _value = Convert.ToInt64(_value + e.KeyChar.ToString()); + if (_value > _max) + _value = _max; + Invalidate(); + } + catch + { + // ignored + } + } + + protected override void OnKeyDown(KeyEventArgs e) + { + base.OnKeyDown(e); + if (e.KeyCode == Keys.Back) + { + Value = 0; + } + } + + protected override void OnResize(EventArgs e) + { + base.OnResize(e); + Height = 30; + } + + public static readonly StringFormat CenterSf = new StringFormat + { + Alignment = StringAlignment.Center, + LineAlignment = StringAlignment.Center + }; + + + protected override void OnPaint(PaintEventArgs e) + { + var bitmap = new Bitmap(Width, Height); + var graphics = Graphics.FromImage(bitmap); + _w = Width; + _h = Height; + + var rectBase = new Rectangle(0, 0, _w, _h); + + graphics.SmoothingMode = SmoothingMode.AntiAlias; + graphics.PixelOffsetMode = PixelOffsetMode.HighQuality; + graphics.TextRenderingHint = TextRenderingHint.AntiAlias; + graphics.Clear(BackColor); + + graphics.FillRectangle(new SolidBrush(_baseColor), rectBase); + graphics.FillRectangle(new SolidBrush(_buttonColor), new Rectangle(Width - 24, 0, 24, _h)); + graphics.DrawString("+", Font, new SolidBrush(_stringColor), new Point(Width - 12, 8), CenterSf); + graphics.DrawString("-", Font, new SolidBrush(_stringColor), new Point(Width - 12, 22), CenterSf); + graphics.DrawString(Value.ToString(), Font, new SolidBrush(_stringColor), new Rectangle(5, 1, _w, _h), new StringFormat { LineAlignment = StringAlignment.Center }); + + base.OnPaint(e); + graphics.Dispose(); + e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic; + e.Graphics.DrawImageUnscaled(bitmap, 0, 0); + bitmap.Dispose(); + } + } +} diff --git a/CBH-Ultimate-Theme-Library/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_PictureBox.cs b/CBH-WinForm-Theme-NET/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_PictureBox.cs similarity index 95% rename from CBH-Ultimate-Theme-Library/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_PictureBox.cs rename to CBH-WinForm-Theme-NET/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_PictureBox.cs index 9abbdb6..0c24354 100644 --- a/CBH-Ultimate-Theme-Library/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_PictureBox.cs +++ b/CBH-WinForm-Theme-NET/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_PictureBox.cs @@ -1,11 +1,7 @@ using System; -using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Drawing.Drawing2D; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Windows.Forms; namespace CBH.Ultimate.Controls @@ -65,7 +61,7 @@ protected override void OnPaint(PaintEventArgs pe) graphics.SmoothingMode = SmoothingMode.AntiAlias; graphics.DrawEllipse(penSmooth, rectContourSmooth); - if(_borderSize > 0) + if (_borderSize > 0) graphics.DrawEllipse(penBorder, rectBorder); } } diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_RadioButton.cs b/CBH-WinForm-Theme-NET/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_RadioButton.cs similarity index 92% rename from CBH-Ultimate-Theme-Library-NET-Framework/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_RadioButton.cs rename to CBH-WinForm-Theme-NET/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_RadioButton.cs index 6ac1c10..1a4946c 100644 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_RadioButton.cs +++ b/CBH-WinForm-Theme-NET/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_RadioButton.cs @@ -45,9 +45,9 @@ protected override void OnPaint(PaintEventArgs pevent) Height = rbCheckSize }; - using(var penBorder = new Pen(_checkedColor, 1.6f)) - using(var brushRbCheck = new SolidBrush(_checkedColor)) - using(var brushBgCheck = new SolidBrush(_backgroundColor)) + using (var penBorder = new Pen(_checkedColor, 1.6f)) + using (var brushRbCheck = new SolidBrush(_checkedColor)) + using (var brushBgCheck = new SolidBrush(_backgroundColor)) using (var brushText = new SolidBrush(ForeColor)) { graphics.Clear(_backgroundColor); diff --git a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_ToggleButton.cs b/CBH-WinForm-Theme-NET/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_ToggleButton.cs similarity index 90% rename from CBH-Ultimate-Theme-Library-NET-Framework/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_ToggleButton.cs rename to CBH-WinForm-Theme-NET/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_ToggleButton.cs index 2ef705d..8905d76 100644 --- a/CBH-Ultimate-Theme-Library-NET-Framework/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_ToggleButton.cs +++ b/CBH-WinForm-Theme-NET/Theme/ThemeBase/Ultimate Controls/CrEaTiiOn_Ultimate_ToggleButton.cs @@ -1,7 +1,7 @@ -using System.Windows.Forms; +using System.ComponentModel; using System.Drawing; using System.Drawing.Drawing2D; -using System.ComponentModel; +using System.Windows.Forms; namespace CBH.Ultimate.Controls { @@ -25,8 +25,11 @@ public sealed class CrEaTiiOn_Ultimate_ToggleButton : CheckBox [DefaultValue(true)] public bool SolidStyle { get => _solidStyle; set { _solidStyle = value; Invalidate(); } } - public override string Text { get => base.Text; - set { } } + public override string Text + { + get => base.Text; + set { } + } public CrEaTiiOn_Ultimate_ToggleButton() { @@ -37,7 +40,7 @@ private GraphicsPath GetFigurePath() { var arcSize = Height - 1; var leftArc = new Rectangle(0, 0, arcSize, arcSize); - var rightArc = new Rectangle(Width - arcSize-2, 0, arcSize, arcSize); + var rightArc = new Rectangle(Width - arcSize - 2, 0, arcSize, arcSize); var path = new GraphicsPath(); path.StartFigure(); @@ -60,12 +63,12 @@ protected override void OnPaint(PaintEventArgs pevent) pevent.Graphics.FillPath(new SolidBrush(OnBackColor), GetFigurePath()); else pevent.Graphics.DrawPath(new Pen(OnBackColor, 2), GetFigurePath()); - + pevent.Graphics.FillEllipse(new SolidBrush(_onToggleColor), new Rectangle(Width - Height + 1, 2, toggleSize, toggleSize)); } else { - if(_solidStyle) + if (_solidStyle) pevent.Graphics.FillPath(new SolidBrush(_offBackColor), GetFigurePath()); else pevent.Graphics.DrawPath(new Pen(_offBackColor), GetFigurePath());