UIfiedMaterialCFBase.ps1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 |
using namespace System.Collections.Generic using namespace System.Reflection using namespace ConsoleFramework using namespace ConsoleFramework.Core using namespace ConsoleFramework.Native using namespace ConsoleFramework.Controls using namespace ConsoleFramework.Events using namespace ConsoleFramework.Rendering # Font Creation https://www.calligraphr.com/ class MaterialCFHost : CFHost { } class MaterialCFWindow : CFWindow { MaterialCFWindow() { [CFCustomPanel]::DefaultBackgroundColor = [color]::White } } class MaterialCFStackPanel : CFStackPanel { } class MaterialCFLabel : CFLabel { MaterialCFLabel() { $this.NativeUI.Color = [Color]::DarkGray } } class MaterialCFIcon : CFIcon { } class MaterialCFButton : CFButton { MaterialCFButton() { $this.NativeUI.Style = "Primary" } } class MaterialCFTextBox : CFTextBox { MaterialCFTextBox() { $this.NativeUI.Style = "Flat" } } class MaterialCFCheckBox : CFCheckBox { MaterialCFCheckBox() { $this.NativeUI.Style = "Flat" } } class MaterialCFRadioButton : CFRadioButton { MaterialCFRadioButton() { $this.NativeUI.Style = "Flat" } } class MaterialCFRadioGroup : CFRadioGroup { } class MaterialCFList : CFList { MaterialCFList() { $this.NativeUI.BackgroundColor = [color]::White } } class MaterialCFListColumn : CFListColumn { } class MaterialCFTabItem : CFTabItem { } class MaterialCFTabControl : CFTabControl { MaterialCFTabControl() { $this.NativeUI.Style = "Flat" } } class MaterialCFModal : CFModal { } class MaterialCFTimer : CFTimer { } class MaterialCFDatePicker : CFDatePicker { MaterialCFDatePicker() { $this.NativeUI.Style = "Flat" } } class MaterialCFTimePicker : CFTimePicker { MaterialCFTimePicker() { $this.NativeUI.Style = "Flat" } } class MaterialCFBrowser : CFBrowser { [void] StyleEditionButtons([CFButton] $editButton, [CFButton] $deleteButton, [int] $rowIndex) { $editButton.Icon = [MaterialCFIcon] @{ Kind = "edit" } $editButton.NativeUI.Style = "Flat" $editButton.NativeUI.ForegroundColor = [Color]::DarkGreen $deleteButton.Icon = [MaterialCFIcon] @{ Kind = "delete" } $deleteButton.NativeUI.Style = "Flat" $deleteButton.NativeUI.ForegroundColor = [Color]::Red $editButton.NativeUI.MaxWidth = 5 $deleteButton.NativeUI.MaxWidth = 5 } [void] StyleComponents() { $this.FirstButton.Icon = [MaterialCFIcon] @{ Kind = "first_page" } $this.FirstButton.NativeUI.Style = "Flat" $this.FirstButton.NativeUI.ForegroundColor = [Color]::Magenta $this.PreviousButton.Icon = [MaterialCFIcon] @{ Kind = "chevron_left" } $this.PreviousButton.NativeUI.Style = "Flat" $this.PreviousButton.NativeUI.ForegroundColor = [Color]::Magenta $this.NextButton.Icon = [MaterialCFIcon] @{ Kind = "chevron_right" } $this.NextButton.NativeUI.Style = "Flat" $this.NextButton.NativeUI.ForegroundColor = [Color]::Magenta $this.LastButton.Icon = [MaterialCFIcon] @{ Kind = "last_page" } $this.LastButton.NativeUI.Style = "Flat" $this.LastButton.NativeUI.ForegroundColor = [Color]::Magenta $this.AddNewButton.Icon = [MaterialCFIcon] @{ Kind = "add" } $this.AddNewButton.NativeUI.Style = "Pill" $this.AddNewButton.NativeUI.ForegroundColor = [Color]::Black $this.AddNewButton.NativeUI.BackgroundColor = [Color]::Green $this.FirstButton.NativeUI.MaxWidth = 7 $this.PreviousButton.NativeUI.MaxWidth = 7 $this.NextButton.NativeUI.MaxWidth = 7 $this.LastButton.NativeUI.MaxWidth = 7 $this.AddNewButton.NativeUI.MaxWidth = 7 $this.AddNewButton.NativeUI.MaxHeight = 4 $this.AddNewButton.NativeUI.Margin = [Thickness]::new(6, 0, 0, 0) } } class MaterialCFMenuItem : CFMenuItem { MaterialCFMenuItem() { $this.NativeUI.BackgroundColor = [Color]::Magenta } } class MaterialCFDropDownMenu : CFDropDownMenu { MaterialCFDropDownMenu() { $this.NativeUI.Style = "Primary" } } class MaterialCFAutoComplete : CFAutoComplete { MaterialCFAutoComplete() { $this.NativeUI.Style = "Flat" } [void] StyleMenuItem($menuItem) { $menuItem.BackgroundColor = [Color]::Magenta } } class MaterialCFCard : CFCard { } class MaterialCFImage : CFImage { } class MaterialCFTextEditor : CFTextEditor { } class MaterialCFExpander : CFExpander { } class MaterialCFInteger : CFInteger { MaterialCFInteger() { $this.NativeUI.Style = "Flat" } } class MaterialCFDouble : CFDouble { MaterialCFDouble() { $this.NativeUI.Style = "Flat" } } class MaterialCFComboBoxItem : CFComboBoxItem { MaterialCFComboBoxItem() { $this.NativeUI.BackgroundColor = [Color]::Magenta } } class MaterialCFComboBox : CFComboBox { MaterialCFComboBox() { $this.NativeUI.Style = "Primary" } } |