BGRAButton Gallery: what changed
Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.
| Old | New | Line | |
|---|---|---|---|
| 1 | - | ||
| 1 | + | ## Contents | |
| 2 | 2 | ||
| 3 | - | ||
| 3 | + | * 1 Overview | |
| 4 | + | * 2 Tips | |
| 5 | + | * 2.1 Sphere | |
| 6 | + | * 2.2 Only one state | |
| 7 | + | * 2.3 Button very slow | |
| 8 | + | * 2.4 Single gradient button | |
| 9 | + | * 2.5 Single color button | |
| 10 | + | * 2.6 How to avoid flickering | |
| 11 | + | * 2.7 Using as Label | |
| 12 | + | * 3 Like Web | |
| 13 | + | * 3.1 Facebook Menu | |
| 14 | + | * 3.2 Google Menu | |
| 15 | + | * 4 Like Windows Controls | |
| 16 | + | * 4.1 Windows 7 Button | |
| 17 | + | * 4.2 Windows 7 Explorer ToolBar | |
| 18 | + | * 4.3 Office 2010 Button | |
| 19 | + | * 5 Like Mac Controls | |
| 20 | + | * 5.1 macOS Lion Button | |
| 21 | + | * 6 Other | |
| 22 | + | * 6.1 Lazarus Custom Drawn | |
| 23 | + | * 7 Flash Player Setup | |
| 4 | 24 | ||
| 5 | - | ||
| 25 | + | ## Overview | |
| 6 | 26 | ||
| 7 | - | ||
| 8 | - | ||
| 9 | - | ||
| 10 | - | ||
| 27 | + | This is a gallery of creations with BGRAButton. See [[BGRAControls]] article for more information. | |
| 11 | 28 | ||
| 12 | - | ||
| 29 | + | Some of those examples can be found in _testbgracontrols_ project in [[BGRAControls]] package. | |
| 13 | 30 | ||
| 14 | - | ||
| 31 | + | [](</File:lainzbutton.png>) | |
| 15 | 32 | ||
| 16 | - | ||
| 33 | + | _You need BGRABitmapTypes unit to run this code._ | |
| 34 | + | ||
| 35 | + | Add a new BGRAButton, go OnPaint event and add this code: | |
| 36 | + | ``` | |
| 17 | 37 | procedure TForm1.FormCreate(Sender: TObject); | |
| 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 | - | ||
| 38 | + | begin | |
| 39 | + | Self.Color:=RGBToColor(230,230,230); | |
| 40 | + | // Lainz Button | |
| 41 | + | with BGRAButton1 do begin | |
| 42 | + | RoundX:=12; | |
| 43 | + | RoundY:=12; | |
| 44 | + | TextShadowOffsetX:=1; | |
| 45 | + | TextShadowOffsetY:=1; | |
| 46 | + | TextShadowRadius:=2; | |
| 47 | + | // Normal | |
| 48 | + | with BodyNormal do begin | |
| 49 | + | BorderStyle:=bboNone; | |
| 50 | + | Font.Color:=RGBToColor(230,230,255); | |
| 51 | + | Font.Style:=[fsBold]; | |
| 52 | + | Gradient1.EndColor:=RGBToColor(64,64,128); | |
| 53 | + | Gradient1.StartColor:=RGBToColor(0,0,64); | |
| 54 | + | Gradient1EndPercent:=60; | |
| 55 | + | // Gradient2 | |
| 56 | + | with Gradient2 do begin | |
| 57 | + | EndColor:=RGBToColor(0,0,64); | |
| 58 | + | GradientType:=gtRadial; | |
| 59 | + | Point1XPercent:=50; | |
| 60 | + | Point1YPercent:=100; | |
| 61 | + | Point2YPercent:=0; | |
| 62 | + | StartColor:=RGBToColor(64,64,128); | |
| 63 | + | end; | |
| 64 | + | end; | |
| 65 | + | // Hover | |
| 66 | + | with BodyHover do begin | |
| 67 | + | BorderStyle:=bboNone; | |
| 68 | + | Font.Color:=RGBToColor(255,255,255); | |
| 69 | + | Font.Style:=[fsBold]; | |
| 70 | + | Gradient1EndPercent:=100; | |
| 71 | + | // Gradient1 | |
| 72 | + | with Gradient1 do begin | |
| 73 | + | EndColor:=RGBToColor(0,64,128); | |
| 74 | + | GradientType:=gtRadial; | |
| 75 | + | Point1XPercent:=50; | |
| 76 | + | Point1YPercent:=100; | |
| 77 | + | Point2YPercent:=0; | |
| 78 | + | StartColor:=RGBToColor(0,128,255); | |
| 79 | + | end; | |
| 80 | + | end; | |
| 81 | + | // Clicked | |
| 82 | + | with BodyClicked do begin | |
| 83 | + | BorderStyle:=bboNone; | |
| 84 | + | Font.Color:=RGBToColor(230,230,255); | |
| 85 | + | Font.Style:=[fsBold]; | |
| 86 | + | Gradient1EndPercent:=100; | |
| 87 | + | // Gradient1 | |
| 88 | + | with Gradient1 do begin | |
| 89 | + | EndColor:=RGBToColor(0,0,64); | |
| 90 | + | GradientType:=gtRadial; | |
| 91 | + | Point1XPercent:=50; | |
| 92 | + | Point1YPercent:=100; | |
| 93 | + | Point2YPercent:=0; | |
| 94 | + | StartColor:=RGBToColor(0,64,128); | |
| 95 | + | end; | |
| 96 | + | end; | |
| 75 | 97 | end; | |
| 76 | 98 | end; | |
| 77 | - | ||
| 78 | - | ||
| 79 | 99 | ``` | |
| 80 | 100 | ||
| 81 | 101 | ## Tips | |
| 82 | 102 | ||
| 83 | - | ||
| 103 | + | Those are some tips and how-to's. | |
| 84 | 104 | ||
| 85 | 105 | ### Sphere | |
| 86 | 106 | ||
| 87 | - | ||
| 88 | - | ||
| 89 | - | ||
| 90 | - | ||
| 91 | - | ||
| 92 | - | ||
| 107 | + | [](</File:bgraspherebutton.png>) | |
| 93 | 108 | ||
| 94 | - | ||
| 109 | + | To create a sphere you need to set Width & Height to the same value and RoundX & RoundY a half of Width & a half of Height. Use this code to obtain a sphere like in the previous image: | |
| 110 | + | ``` | |
| 95 | 111 | BGRAButton1.Width:=200; | |
| 96 | - | ||
| 97 | - | ||
| 98 | - | ||
| 112 | + | BGRAButton1.Height:=200; | |
| 113 | + | BGRAButton.RoundX:=100; | |
| 114 | + | BGRAButton.RoundY:=100; | |
| 99 | 115 | ``` | |
| 100 | 116 | ||
| 101 | - | ||
| 102 | - | ||
| 103 | - | ||
| 117 | + | Or do it in this way: | |
| 118 | + | ``` | |
| 104 | 119 | // Square | |
| 105 | - | ||
| 106 | - | ||
| 107 | - | ||
| 108 | - | ||
| 109 | - | ||
| 110 | - | ||
| 111 | - | ||
| 112 | - | ||
| 113 | - | ||
| 114 | - | ||
| 120 | + | with BGRAButton1 do begin | |
| 121 | + | Width:= 200; | |
| 122 | + | Height:= Width; | |
| 123 | + | end; | |
| 124 | + | ||
| 125 | + | // Sphere | |
| 126 | + | with BGRAButton1 do begin | |
| 127 | + | RoundX:= Round(Width div 2); | |
| 128 | + | RoundY:= Round(Height div 2); | |
| 129 | + | end; | |
| 115 | 130 | ``` | |
| 116 | 131 | ||
| 117 | 132 | ### Only one state | |
| 118 | 133 | ||
| 119 | - | ||
| 120 | - | ||
| 121 | - | ||
| 134 | + | If you only want a solid button just with the state _BodyNormal_ you must set to true the property _StaticButton_. | |
| 135 | + | ``` | |
| 122 | 136 | BGRAButton1.StaticButton:=True; | |
| 123 | 137 | ``` | |
| 124 | 138 | ||
| 125 | 139 | ### Button very slow | |
| 126 | 140 | ||
| 127 | - | ||
| 128 | - | ||
| 129 | - | ||
| 141 | + | If the button is very slow you can disable _TextShadow_ to improve speed. | |
| 142 | + | ``` | |
| 130 | 143 | BGRAButton1.TextShadow:=False; | |
| 131 | 144 | ``` | |
| 132 | 145 | ||
| 133 | - | ||
| 146 | + | And you can improve speed using _Single gradient button_ or _Single color button_. | |
| 134 | 147 | ||
| 135 | 148 | ### Single gradient button | |
| 136 | 149 | ||
| 137 | - | ||
| 138 | - | ||
| 139 | - | ||
| 150 | + | You can use just only one gradient if you want. | |
| 151 | + | ``` | |
| 140 | 152 | BGRAButton1.Gradient1EndPercent:=100; // if you want to use only Gradient1 | |
| 141 | - | ||
| 153 | + | BGRAButton1.Gradient1EndPercent:=0; // if you want to use only Gradient2 | |
| 142 | 154 | ``` | |
| 143 | 155 | ||
| 144 | 156 | ### Single color button | |
| 145 | 157 | ||
| 146 | - | ||
| 147 | - | ||
| 148 | - | ||
| 158 | + | Changing the _Style_ of the button you can display just a single color as background. | |
| 159 | + | ``` | |
| 149 | 160 | BGRAButton1.BodyNormal.Style:=bbsColor; | |
| 150 | 161 | ``` | |
| 151 | 162 | ||
| 152 | 163 | ### How to avoid flickering | |
| 153 | 164 | ||
| 154 | - | ||
| 155 | - | ||
| 156 | - | ||
| 165 | + | The button will flicker if you are running Windows without themes (classic). To avoid this enable _DoubleBuffered_ OnCreate event of each Form. | |
| 166 | + | ``` | |
| 157 | 167 | procedure TForm1.FormCreate(Sender: TObject); | |
| 158 | - | ||
| 159 | - | ||
| 160 | - | ||
| 168 | + | begin | |
| 169 | + | Self.DoubleBuffered:=True; | |
| 170 | + | end; | |
| 161 | 171 | ``` | |
| 162 | 172 | ||
| 163 | 173 | ### Using as Label | |
| 164 | 174 | ||
| 165 | - | ||
| 166 | - | ||
| 167 | - | ||
| 175 | + | The easy way is set to true the property _StaticButton_. | |
| 176 | + | ``` | |
| 168 | 177 | BGRAButton1.StaticButton:=True; | |
| 169 | 178 | ``` | |
| 170 | 179 | ||
| 171 | - | ||
| 180 | + | Then set BodyNormal.Style to bbsClear and BodyNormal.BorderStyle to bboNone. | |
| 172 | 181 | ||
| 173 | 182 | ## Like Web | |
| 174 | 183 | ||
| 175 | - | ||
| 184 | + | Those are like websites, web apps. | |
| 176 | 185 | ||
| 177 | 186 | ### Facebook Menu | |
| 178 | 187 | ||
| 179 | - | ||
| 180 | - | ||
| 181 | - | ||
| 182 | - | ||
| 183 | - | ||
| 184 | - | ||
| 188 | + | [](</File:bgrafacebook.png>) | |
| 185 | 189 | ||
| 186 | - | ||
| 190 | + | Like Facebook Menu (2011), add a BGRAPanel with 2 BGRAButton inside, then go OnCreate event of Form1 and add this code: | |
| 191 | + | ``` | |
| 187 | 192 | procedure TForm1.FormCreate(Sender: TObject); | |
| 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 | - | ||
| 219 | - | ||
| 220 | - | ||
| 221 | - | ||
| 222 | - | ||
| 223 | - | ||
| 224 | - | ||
| 225 | - | ||
| 226 | - | ||
| 227 | - | ||
| 228 | - | ||
| 229 | - | ||
| 230 | - | ||
| 231 | - | ||
| 232 | - | ||
| 233 | - | ||
| 234 | - | ||
| 235 | - | ||
| 236 | - | ||
| 237 | - | ||
| 238 | - | ||
| 239 | - | ||
| 240 | - | ||
| 241 | - | ||
| 242 | - | ||
| 243 | - | ||
| 244 | - | ||
| 245 | - | ||
| 246 | - | ||
| 247 | - | ||
| 248 | - | ||
| 249 | - | ||
| 193 | + | begin | |
| 194 | + | // Panel | |
| 195 | + | with BGRAPanel1 do begin | |
| 196 | + | BackgroundStyle:=bpsColor; | |
| 197 | + | BevelOuter:=bvNone; | |
| 198 | + | //Color:=RGBToColor(98,122,173); // Light Background | |
| 199 | + | Color:=RGBToColor(59,89,152); // Dark Background | |
| 200 | + | end; | |
| 201 | + | // Light Menu | |
| 202 | + | with BGRAButton1 do begin | |
| 203 | + | TextShadow:=False; | |
| 204 | + | // Normal | |
| 205 | + | with BodyNormal do begin | |
| 206 | + | BorderColor:=RGBToColor(98,122,173); | |
| 207 | + | Color:=RGBToColor(98,122,173); | |
| 208 | + | Font.Color:=clWhite; | |
| 209 | + | Font.Style:=[fsBold]; | |
| 210 | + | Style:=bbsColor; | |
| 211 | + | end; | |
| 212 | + | // Hover | |
| 213 | + | with BodyHover do begin | |
| 214 | + | BorderColor:=RGBToColor(109,134,183); | |
| 215 | + | Color:=RGBToColor(109,134,183); | |
| 216 | + | Font.Color:=clWhite; | |
| 217 | + | Font.Style:=[fsBold]; | |
| 218 | + | Style:=bbsColor; | |
| 219 | + | end; | |
| 220 | + | // Clicked | |
| 221 | + | with BodyClicked do begin | |
| 222 | + | BorderColor:=clBlack; | |
| 223 | + | Color:=clWhite; | |
| 224 | + | Font.Color:=clBlack; | |
| 225 | + | Font.Style:=[fsBold]; | |
| 226 | + | Style:=bbsColor; | |
| 227 | + | end; | |
| 228 | + | end; | |
| 229 | + | // Dark Menu | |
| 230 | + | with BGRAButton2 do begin | |
| 231 | + | TextShadow:=False; | |
| 232 | + | // Normal | |
| 233 | + | with BodyNormal do begin | |
| 234 | + | BorderColor:=RGBToColor(59,89,152); | |
| 235 | + | Color:=RGBToColor(59,89,152); | |
| 236 | + | Font.Color:=RGBToColor(42,66,128); | |
| 237 | + | Font.Style:=[fsBold]; | |
| 238 | + | Style:=bbsColor; | |
| 239 | + | end; | |
| 240 | + | // Hover | |
| 241 | + | with BodyHover do begin | |
| 242 | + | BorderColor:=RGBToColor(75,103,161); | |
| 243 | + | Color:=RGBToColor(75,103,161); | |
| 244 | + | Font.Color:=RGBToColor(42,66,128); | |
| 245 | + | Font.Style:=[fsBold]; | |
| 246 | + | Style:=bbsColor; | |
| 247 | + | end; | |
| 248 | + | // Clicked | |
| 249 | + | with BodyClicked do begin | |
| 250 | + | BorderColor:=clBlack; | |
| 251 | + | Color:=clWhite; | |
| 252 | + | Font.Color:=RGBToColor(42,66,128); | |
| 253 | + | Font.Style:=[fsBold]; | |
| 254 | + | Style:=bbsColor; | |
| 255 | + | end; | |
| 256 | + | end; | |
| 250 | 257 | end; | |
| 251 | - | ||
| 252 | - | ||
| 253 | 258 | ``` | |
| 254 | 259 | ||
| 255 | - | ||
| 260 | + | You can set _Clicked_ properties same as _Hover_ for standard buttons (not menu's). | |
| 256 | 261 | ||
| 257 | 262 | ### Google Menu | |
| 258 | 263 | ||
| 259 | - | ||
| 260 | - | ||
| 261 | - | ||
| 262 | - | ||
| 263 | - | ||
| 264 | - | ||
| 264 | + | [](</File:bgragoogle.png>) | |
| 265 | 265 | ||
| 266 | - | ||
| 266 | + | Like Google Menu (2011), add a BGRAPanel with a BGRAButton inside and another BGRAButton in the Form, then go OnCreate event of Form1 and add this code: | |
| 267 | + | ``` | |
| 267 | 268 | procedure TForm1.FormCreate(Sender: TObject); | |
| 268 | - | ||
| 269 | - | ||
| 270 | - | ||
| 271 | - | ||
| 272 | - | ||
| 273 | - | ||
| 274 | - | ||
| 275 | - | ||
| 276 | - | ||
| 277 | - | ||
| 278 | - | ||
| 279 | - | ||
| 280 | - | ||
| 281 | - | ||
| 282 | - | ||
| 283 | - | ||
| 284 | - | ||
| 285 | - | ||
| 286 | - | ||
| 287 | - | ||
| 288 | - | ||
| 289 | - | ||
| 290 | - | ||
| 291 | - | ||
| 292 | - | ||
| 293 | - | ||
| 294 | - | ||
| 295 | - | ||
| 296 | - | ||
| 297 | - | ||
| 298 | - | ||
| 299 | - | ||
| 300 | - | ||
| 301 | - | ||
| 302 | - | ||
| 303 | - | ||
| 304 | - | ||
| 305 | - | ||
| 306 | - | ||
| 307 | - | ||
| 308 | - | ||
| 309 | - | ||
| 310 | - | ||
| 311 | - | ||
| 312 | - | ||
| 313 | - | ||
| 314 | - | ||
| 315 | - | ||
| 316 | - | ||
| 317 | - | ||
| 318 | - | ||
| 319 | - | ||
| 320 | - | ||
| 321 | - | ||
| 322 | - | ||
| 323 | - | ||
| 324 | - | ||
| 325 | - | ||
| 326 | - | ||
| 327 | - | ||
| 269 | + | begin | |
| 270 | + | // Background | |
| 271 | + | Self.Color:=clWhite; | |
| 272 | + | // Panel | |
| 273 | + | with BGRAPanel1 do begin | |
| 274 | + | BevelOuter:=bvNone; | |
| 275 | + | Gradient.StartColor:=clWhite; | |
| 276 | + | Gradient.EndColor:=RGBToColor(245,245,245); | |
| 277 | + | end; | |
| 278 | + | // Menu Button | |
| 279 | + | with BGRAButton1 do begin | |
| 280 | + | TextShadow:=False; | |
| 281 | + | // Normal | |
| 282 | + | with BodyNormal do begin | |
| 283 | + | BorderStyle:=bboNone; | |
| 284 | + | Font.Color:=RGBToColor(51,102,204); | |
| 285 | + | Style:=bbsClear; | |
| 286 | + | end; | |
| 287 | + | // Hover | |
| 288 | + | with BodyHover do begin | |
| 289 | + | BorderStyle:=bboNone; | |
| 290 | + | Gradient1.StartColor:=RGBToColor(227,234,248); | |
| 291 | + | Gradient1.EndColor:=RGBToColor(223,229,242); | |
| 292 | + | Font.Color:=RGBToColor(51,102,204); | |
| 293 | + | Gradient1EndPercent:=100; | |
| 294 | + | end; | |
| 295 | + | // Clicked | |
| 296 | + | with BodyClicked do begin | |
| 297 | + | BorderStyle:=bboNone; | |
| 298 | + | Gradient1.StartColor:=RGBToColor(227,234,248); | |
| 299 | + | Gradient1.EndColor:=RGBToColor(223,229,242); | |
| 300 | + | Font.Color:=RGBToColor(51,102,204); | |
| 301 | + | Gradient1EndPercent:=100; | |
| 302 | + | end; | |
| 303 | + | end; | |
| 304 | + | // Button | |
| 305 | + | with BGRAButton2 do begin | |
| 306 | + | TextShadow:=False; | |
| 307 | + | // Normal | |
| 308 | + | with BodyNormal do begin | |
| 309 | + | BorderColor:=RGBToColor(205,205,205); | |
| 310 | + | Gradient1.StartColor:=RGBToColor(241,241,241); | |
| 311 | + | Gradient1.EndColor:=RGBToColor(223,223,223); | |
| 312 | + | Font.Color:=clBlack; | |
| 313 | + | Gradient1EndPercent:=100; | |
| 314 | + | end; | |
| 315 | + | // Hover | |
| 316 | + | with BodyHover do begin | |
| 317 | + | BorderColor:=RGBToColor(205,205,205); | |
| 318 | + | Gradient1.StartColor:=RGBToColor(241,241,241); | |
| 319 | + | Gradient1.EndColor:=RGBToColor(223,223,223); | |
| 320 | + | Font.Color:=clBlack; | |
| 321 | + | Gradient1EndPercent:=100; | |
| 322 | + | end; | |
| 323 | + | // Clicked | |
| 324 | + | with BodyClicked do begin | |
| 325 | + | BorderColor:=RGBToColor(204,204,204); | |
| 326 | + | Color:=RGBToColor(204,204,204); | |
| 327 | + | Font.Color:=clBlack; | |
| 328 | + | Style:=bbsColor; | |
| 329 | + | end; | |
| 330 | + | end; | |
| 328 | 331 | end; | |
| 329 | - | ||
| 330 | - | ||
| 331 | 332 | ``` | |
| 332 | 333 | ||
| 333 | 334 | ## Like Windows Controls | |
| 334 | 335 | ||
| 335 | - | ||
| 336 | + | Those are like Windows Controls. | |
| 336 | 337 | ||
| 337 | 338 | ### Windows 7 Button | |
| 338 | 339 | ||
| 339 | - | ||
| 340 | - | ||
| 341 | - | ||
| 342 | - | ||
| 343 | - | ||
| 344 | - | ||
| 340 | + | [](</File:bgrabuttonwin7.png>) | |
| 345 | 341 | ||
| 346 | - | ||
| 342 | + | Like Windows 7 button, add a BGRAButton, then go OnCreate event of Form1 and add this code: | |
| 343 | + | ``` | |
| 347 | 344 | procedure TForm1.FormCreate(Sender: TObject); | |
| 348 | - | ||
| 349 | - | ||
| 350 | - | ||
| 351 | - | ||
| 352 | - | ||
| 353 | - | ||
| 354 | - | ||
| 355 | - | ||
| 356 | - | ||
| 357 | - | ||
| 358 | - | ||
| 359 | - | ||
| 360 | - | ||
| 361 | - | ||
| 362 | - | ||
| 363 | - | ||
| 364 | - | ||
| 365 | - | ||
| 366 | - | ||
| 367 | - | ||
| 368 | - | ||
| 369 | - | ||
| 370 | - | ||
| 371 | - | ||
| 372 | - | ||
| 373 | - | ||
| 374 | - | ||
| 375 | - | ||
| 376 | - | ||
| 377 | - | ||
| 378 | - | ||
| 379 | - | ||
| 380 | - | ||
| 381 | - | ||
| 382 | - | ||
| 345 | + | begin | |
| 346 | + | // Button | |
| 347 | + | with BGRAButton1 do begin | |
| 348 | + | TextShadow:=False; | |
| 349 | + | RoundX:=3; | |
| 350 | + | RoundY:=3; | |
| 351 | + | // Normal | |
| 352 | + | with BodyNormal do begin | |
| 353 | + | Font.Color:=clBlack; | |
| 354 | + | Gradient1EndPercent:=50; | |
| 355 | + | BorderColor:=RGBToColor(112,112,112); | |
| 356 | + | Gradient1.StartColor:=RGBToColor(242,242,242); | |
| 357 | + | Gradient1.EndColor:=RGBToColor(235,235,235); | |
| 358 | + | Gradient2.StartColor:=RGBToColor(221,221,221); | |
| 359 | + | Gradient2.EndColor:=RGBToColor(207,207,207); | |
| 360 | + | end; | |
| 361 | + | // Hover | |
| 362 | + | with BodyHover do begin | |
| 363 | + | Font.Color:=clBlack; | |
| 364 | + | Gradient1EndPercent:=50; | |
| 365 | + | BorderColor:=RGBToColor(60,127,177); | |
| 366 | + | Gradient1.StartColor:=RGBToColor(234,246,253); | |
| 367 | + | Gradient1.EndColor:=RGBToColor(217,240,252); | |
| 368 | + | Gradient2.StartColor:=RGBToColor(190,230,253); | |
| 369 | + | Gradient2.EndColor:=RGBToColor(167,217,245); | |
| 370 | + | end; | |
| 371 | + | // Clicked | |
| 372 | + | with BodyClicked do begin | |
| 373 | + | Font.Color:=clBlack; | |
| 374 | + | Gradient1EndPercent:=55; | |
| 375 | + | BorderColor:=RGBToColor(44,98,139); | |
| 376 | + | Gradient1.StartColor:=RGBToColor(229,244,252); | |
| 377 | + | Gradient1.EndColor:=RGBToColor(196,229,246); | |
| 378 | + | Gradient2.StartColor:=RGBToColor(152,209,239); | |
| 379 | + | Gradient2.EndColor:=RGBToColor(104,179,219); | |
| 380 | + | end; | |
| 381 | + | end; | |
| 383 | 382 | end; | |
| 384 | - | ||
| 385 | - | ||
| 386 | 383 | ``` | |
| 387 | 384 | ||
| 388 | 385 | ### Windows 7 Explorer ToolBar | |
| 389 | 386 | ||
| 390 | - | ||
| 391 | - | ||
| 392 | - | ||
| 393 | - | ||
| 394 | - | ||
| 395 | - | ||
| 387 | + | [](</File:bgratoolwin7.png>) | |
| 396 | 388 | ||
| 397 | - | ||
| 389 | + | Like Windows 7 explorer toolbar button, add a BGRAVirtualScreen with a BGRAButton inside, then go OnCreate event of Form1 and add this code: | |
| 390 | + | ``` | |
| 398 | 391 | procedure TForm1.FormCreate(Sender: TObject); | |
| 399 | - | ||
| 400 | - | ||
| 401 | - | ||
| 402 | - | ||
| 403 | - | ||
| 404 | - | ||
| 405 | - | ||
| 406 | - | ||
| 407 | - | ||
| 408 | - | ||
| 409 | - | ||
| 410 | - | ||
| 411 | - | ||
| 412 | - | ||
| 413 | - | ||
| 414 | - | ||
| 415 | - | ||
| 416 | - | ||
| 417 | - | ||
| 418 | - | ||
| 419 | - | ||
| 420 | - | ||
| 421 | - | ||
| 422 | - | ||
| 423 | - | ||
| 424 | - | ||
| 425 | - | ||
| 426 | - | ||
| 427 | - | ||
| 428 | - | ||
| 429 | - | ||
| 392 | + | begin | |
| 393 | + | // Button | |
| 394 | + | with BGRAButton1 do begin | |
| 395 | + | TextShadow:=False; | |
| 396 | + | RoundX:=2; | |
| 397 | + | RoundY:=2; | |
| 398 | + | // Normal | |
| 399 | + | with BodyNormal do begin | |
| 400 | + | Font.Color:=clBlack; | |
| 401 | + | BorderStyle:=bboNone; | |
| 402 | + | Style:=bbsClear; | |
| 403 | + | end; | |
| 404 | + | // Hover | |
| 405 | + | with BodyHover do begin | |
| 406 | + | Font.Color:=clBlack; | |
| 407 | + | Gradient1EndPercent:=50; | |
| 408 | + | BorderColor:=RGBToColor(187,202,219); | |
| 409 | + | Gradient1.StartColor:=RGBToColor(248,251,254); | |
| 410 | + | Gradient1.EndColor:=RGBToColor(237,242,250); | |
| 411 | + | Gradient2.StartColor:=RGBToColor(215,228,244); | |
| 412 | + | Gradient2.EndColor:=RGBToColor(193,210,232); | |
| 413 | + | end; | |
| 414 | + | // Clicked | |
| 415 | + | with BodyClicked do begin | |
| 416 | + | Font.Color:=clBlack; | |
| 417 | + | Gradient1EndPercent:=55; | |
| 418 | + | BorderColor:=RGBToColor(187,202,219); | |
| 419 | + | Gradient1.StartColor:=RGBToColor(226,236,245); | |
| 420 | + | Gradient1.EndColor:=RGBToColor(216,228,241); | |
| 421 | + | Gradient2.StartColor:=RGBToColor(207,219,236); | |
| 422 | + | Gradient2.EndColor:=RGBToColor(207,220,237); | |
| 423 | + | end; | |
| 424 | + | end; | |
| 430 | 425 | end; | |
| 431 | - | ||
| 432 | - | ||
| 433 | 426 | ``` | |
| 434 | 427 | ||
| 435 | - | ||
| 436 | - | ||
| 437 | - | ||
| 428 | + | Go to OnRedraw of BGRAVirtualScreen and add this code: | |
| 429 | + | ``` | |
| 438 | 430 | procedure TForm1.BGRAVirtualScreen1Redraw(Sender: TObject; Bitmap: TBGRABitmap); | |
| 439 | - | ||
| 440 | - | ||
| 441 | - | ||
| 442 | - | ||
| 443 | - | ||
| 444 | - | ||
| 445 | - | ||
| 446 | - | ||
| 447 | - | ||
| 448 | - | ||
| 449 | - | ||
| 450 | - | ||
| 451 | - | ||
| 452 | - | ||
| 453 | - | ||
| 431 | + | var | |
| 432 | + | gradBitmap: TBGRABitmap; | |
| 433 | + | begin | |
| 434 | + | with BGRAVirtualScreen1 do begin | |
| 435 | + | gradBitmap:= DoubleGradientAlphaFill(ClientRect,BGRA(245,250,255,255),BGRA(230,240,250,255), | |
| 436 | + | BGRA(220,230,244,255),BGRA(221,233,247,255),gdVertical,gdVertical,gdVertical,0.50); | |
| 437 | + | end; | |
| 438 | + | with Bitmap do begin | |
| 439 | + | PutImage(0,0,gradBitmap,dmSet); | |
| 440 | + | gradBitmap.Free; | |
| 441 | + | Rectangle(0,0,Width,Height-2,BGRA(255,255,255,100),dmDrawWithTransparency); | |
| 442 | + | SetHorizLine(0,Height-1,Width-1,BGRA(160,175,195,255)); | |
| 443 | + | SetHorizLine(0,Height-2,Width-1,BGRA(205,218,234,255)); | |
| 444 | + | end; | |
| 445 | + | end; | |
| 454 | 446 | ``` | |
| 455 | 447 | ||
| 456 | 448 | ### Office 2010 Button | |
| 457 | 449 | ||
| 458 | - | ||
| 459 | - | ||
| 460 | - | ||
| 461 | - | ||
| 462 | - | ||
| 463 | - | ||
| 450 | + | [](</File:bgraofficebutton.png>) | |
| 464 | 451 | ||
| 465 | - | ||
| 452 | + | Like Office 2010 button, add a BGRAButton, then go OnCreate event of Form1 and add this code: | |
| 453 | + | ``` | |
| 466 | 454 | procedure TForm1.FormCreate(Sender: TObject); | |
| 467 | - | ||
| 468 | - | ||
| 469 | - | ||
| 470 | - | ||
| 471 | - | ||
| 472 | - | ||
| 473 | - | ||
| 474 | - | ||
| 475 | - | ||
| 476 | - | ||
| 477 | - | ||
| 478 | - | ||
| 479 | - | ||
| 480 | - | ||
| 481 | - | ||
| 482 | - | ||
| 483 | - | ||
| 484 | - | ||
| 485 | - | ||
| 486 | - | ||
| 487 | - | ||
| 488 | - | ||
| 489 | - | ||
| 490 | - | ||
| 491 | - | ||
| 492 | - | ||
| 493 | - | ||
| 494 | - | ||
| 495 | - | ||
| 496 | - | ||
| 497 | - | ||
| 498 | - | ||
| 499 | - | ||
| 500 | - | ||
| 455 | + | begin | |
| 456 | + | Self.Color:=clWhite; | |
| 457 | + | // Button | |
| 458 | + | with BGRAButton1 do begin | |
| 459 | + | RoundX:=3; | |
| 460 | + | RoundY:=3; | |
| 461 | + | TextShadow:=False; | |
| 462 | + | // Normal | |
| 463 | + | with BodyNormal do begin | |
| 464 | + | BorderColor:=RGBToColor(207,208,210); | |
| 465 | + | Font.Color:=clBlack; | |
| 466 | + | Gradient1.StartColor:=RGBToColor(255,255,255); | |
| 467 | + | Gradient1.EndColor:=RGBToColor(237,239,241); | |
| 468 | + | Gradient1EndPercent:=100; | |
| 469 | + | end; | |
| 470 | + | // Hover | |
| 471 | + | with BodyHover do begin | |
| 472 | + | BorderColor:=RGBToColor(244,210,81); | |
| 473 | + | Font.Color:=clBlack; | |
| 474 | + | Gradient1.StartColor:=RGBToColor(254,241,189); | |
| 475 | + | Gradient1.EndColor:=RGBToColor(254,228,134); | |
| 476 | + | Gradient1EndPercent:=50; | |
| 477 | + | Gradient2.StartColor:=RGBToColor(254,228,134); | |
| 478 | + | Gradient2.EndColor:=RGBToColor(254,248,196); | |
| 479 | + | end; | |
| 480 | + | // Clicked | |
| 481 | + | with BodyClicked do begin | |
| 482 | + | BorderColor:=RGBToColor(194,161,63); | |
| 483 | + | Font.Color:=clBlack; | |
| 484 | + | Gradient1.StartColor:=RGBToColor(255,229,117); | |
| 485 | + | Gradient1.EndColor:=RGBToColor(255,216,107); | |
| 486 | + | Gradient1EndPercent:=50; | |
| 487 | + | Gradient2.StartColor:=RGBToColor(255,216,107); | |
| 488 | + | Gradient2.EndColor:=RGBToColor(255,239,129); | |
| 489 | + | end; | |
| 490 | + | end; | |
| 501 | 491 | end; | |
| 502 | - | ||
| 503 | - | ||
| 504 | 492 | ``` | |
| 505 | 493 | ||
| 506 | 494 | ## Like Mac Controls | |
| 507 | 495 | ||
| 508 | - | ||
| 496 | + | Those are like Mac Controls. | |
| 509 | 497 | ||
| 510 | 498 | ### macOS Lion Button | |
| 511 | 499 | ||
| 512 | - | ||
| 513 | - | ||
| 514 | - | ||
| 515 | - | ||
| 516 | - | ||
| 517 | - | ||
| 500 | + | [](</File:bgrabuttonosxlion.png>) | |
| 518 | 501 | ||
| 519 | - | ||
| 502 | + | Like macOS Lion button, add a BGRAButton, then go OnCreate event of Form1 and add this code: | |
| 503 | + | ``` | |
| 520 | 504 | procedure TForm1.FormCreate(Sender: TObject); | |
| 521 | - | ||
| 522 | - | ||
| 523 | - | ||
| 524 | - | ||
| 525 | - | ||
| 526 | - | ||
| 527 | - | ||
| 528 | - | ||
| 529 | - | ||
| 530 | - | ||
| 531 | - | ||
| 532 | - | ||
| 533 | - | ||
| 534 | - | ||
| 535 | - | ||
| 536 | - | ||
| 537 | - | ||
| 538 | - | ||
| 539 | - | ||
| 540 | - | ||
| 541 | - | ||
| 542 | - | ||
| 543 | - | ||
| 544 | - | ||
| 545 | - | ||
| 546 | - | ||
| 547 | - | ||
| 548 | - | ||
| 549 | - | ||
| 550 | - | ||
| 551 | - | ||
| 552 | - | ||
| 553 | - | ||
| 554 | - | ||
| 555 | - | ||
| 505 | + | begin | |
| 506 | + | // Button | |
| 507 | + | with BGRAButton1 do begin | |
| 508 | + | TextShadow:=False; | |
| 509 | + | RoundX:=3; | |
| 510 | + | RoundY:=3; | |
| 511 | + | // Normal | |
| 512 | + | with BodyNormal do begin | |
| 513 | + | Font.Color:=clBlack; | |
| 514 | + | Gradient1EndPercent:=50; | |
| 515 | + | BorderColor:=RGBToColor(154,154,154); | |
| 516 | + | Gradient1.StartColor:=RGBToColor(255,255,255); | |
| 517 | + | Gradient1.EndColor:=RGBToColor(243,243,243); | |
| 518 | + | Gradient2.StartColor:=RGBToColor(236,236,236); | |
| 519 | + | Gradient2.EndColor:=RGBToColor(235,235,235); | |
| 520 | + | end; | |
| 521 | + | // Hover | |
| 522 | + | with BodyHover do begin | |
| 523 | + | Font.Color:=clBlack; | |
| 524 | + | Gradient1EndPercent:=50; | |
| 525 | + | BorderColor:=RGBToColor(86,87,143); | |
| 526 | + | Gradient1.StartColor:=RGBToColor(204,229,252); | |
| 527 | + | Gradient1.EndColor:=RGBToColor(161,209,249); | |
| 528 | + | Gradient2.StartColor:=RGBToColor(143,202,251); | |
| 529 | + | Gradient2.EndColor:=RGBToColor(207,245,253); | |
| 530 | + | end; | |
| 531 | + | // Clicked | |
| 532 | + | with BodyClicked do begin | |
| 533 | + | Font.Color:=clBlack; | |
| 534 | + | Gradient1EndPercent:=55; | |
| 535 | + | BorderColor:=RGBToColor(86,87,143); | |
| 536 | + | Gradient1.StartColor:=RGBToColor(144,195,241); | |
| 537 | + | Gradient1.EndColor:=RGBToColor(113,180,239); | |
| 538 | + | Gradient2.StartColor:=RGBToColor(97,173,240); | |
| 539 | + | Gradient2.EndColor:=RGBToColor(147,206,241); | |
| 540 | + | end; | |
| 541 | + | end; | |
| 556 | 542 | end; | |
| 557 | - | ||
| 558 | - | ||
| 559 | 543 | ``` | |
| 560 | 544 | ||
| 561 | 545 | ## Other | |
| 562 | 546 | ||
| 563 | - | ||
| 547 | + | Other stuff. | |
| 564 | 548 | ||
| 565 | 549 | ### Lazarus Custom Drawn | |
| 566 | 550 | ||
| 567 | - | ||
| 568 | - | ||
| 569 | - | ||
| 570 | - | ||
| 571 | - | ||
| 572 | - | ||
| 551 | + | [](</File:bgracustomdrawn.png>) | |
| 573 | 552 | ||
| 574 | - | ||
| 553 | + | _dsAndroid, dsGrad, dsWinCE, dsXPTaskBar_ | |
| 575 | 554 | ||
| 576 | - | ||
| 555 | + | Like [[Lazarus Custom Drawn Controls]]. Add 4 BGRAButton, then go OnCreate event of Form1 and add this code: | |
| 556 | + | ``` | |
| 577 | 557 | procedure TForm1.FormCreate(Sender: TObject); | |
| 578 | - | ||
| 579 | - | ||
| 580 | - | ||
| 581 | - | ||
| 582 | - | ||
| 583 | - | ||
| 584 | - | ||
| 585 | - | ||
| 586 | - | ||
| 587 | - | ||
| 588 | - | ||
| 589 | - | ||
| 590 | - | ||
| 591 | - | ||
| 592 | - | ||
| 593 | - | ||
| 594 | - | ||
| 595 | - | ||
| 596 | - | ||
| 597 | - | ||
| 598 | - | ||
| 599 | - | ||
| 600 | - | ||
| 601 | - | ||
| 602 | - | ||
| 603 | - | ||
| 604 | - | ||
| 605 | - | ||
| 606 | - | ||
| 607 | - | ||
| 608 | - | ||
| 609 | - | ||
| 610 | - | ||
| 611 | - | ||
| 612 | - | ||
| 613 | - | ||
| 614 | - | ||
| 615 | - | ||
| 616 | - | ||
| 617 | - | ||
| 618 | - | ||
| 619 | - | ||
| 620 | - | ||
| 621 | - | ||
| 622 | - | ||
| 623 | - | ||
| 624 | - | ||
| 625 | - | ||
| 626 | - | ||
| 627 | - | ||
| 628 | - | ||
| 629 | - | ||
| 630 | - | ||
| 631 | - | ||
| 632 | - | ||
| 633 | - | ||
| 634 | - | ||
| 635 | - | ||
| 636 | - | ||
| 637 | - | ||
| 638 | - | ||
| 639 | - | ||
| 640 | - | ||
| 641 | - | ||
| 642 | - | ||
| 643 | - | ||
| 644 | - | ||
| 645 | - | ||
| 646 | - | ||
| 647 | - | ||
| 648 | - | ||
| 649 | - | ||
| 650 | - | ||
| 651 | - | ||
| 652 | - | ||
| 653 | - | ||
| 654 | - | ||
| 655 | - | ||
| 656 | - | ||
| 657 | - | ||
| 658 | - | ||
| 659 | - | ||
| 660 | - | ||
| 661 | - | ||
| 662 | - | ||
| 663 | - | ||
| 664 | - | ||
| 665 | - | ||
| 666 | - | ||
| 667 | - | ||
| 668 | - | ||
| 669 | - | ||
| 670 | - | ||
| 671 | - | ||
| 672 | - | ||
| 673 | - | ||
| 674 | - | ||
| 675 | - | ||
| 676 | - | ||
| 677 | - | ||
| 678 | - | ||
| 679 | - | ||
| 680 | - | ||
| 681 | - | ||
| 682 | - | ||
| 683 | - | ||
| 558 | + | begin | |
| 559 | + | // dsAndroid | |
| 560 | + | with BGRAButton1 do begin | |
| 561 | + | TextShadow:=False; | |
| 562 | + | RoundX:=4; | |
| 563 | + | RoundY:=4; | |
| 564 | + | with BodyNormal do begin | |
| 565 | + | BorderStyle:=bboNone; | |
| 566 | + | Font.Color:=clBlack; | |
| 567 | + | Gradient1EndPercent:=100; | |
| 568 | + | Gradient1.EndColor:=RGBToColor(202,202,198); | |
| 569 | + | Gradient1.StartColor:=RGBToColor(235,235,231); | |
| 570 | + | Gradient1.Point1YPercent:=70; | |
| 571 | + | end; | |
| 572 | + | with BodyHover do begin | |
| 573 | + | BorderStyle:=bboNone; | |
| 574 | + | Font.Color:=clBlack; | |
| 575 | + | Gradient1EndPercent:=100; | |
| 576 | + | Gradient1.EndColor:=RGBToColor(202,202,198); | |
| 577 | + | Gradient1.StartColor:=RGBToColor(235,235,231); | |
| 578 | + | Gradient1.Point1YPercent:=70; | |
| 579 | + | end; | |
| 580 | + | with BodyClicked do begin | |
| 581 | + | Color:=RGBToColor(227,227,224); | |
| 582 | + | BorderColor:=RGBToColor(172,172,170); | |
| 583 | + | Font.Color:=clBlack; | |
| 584 | + | Style:=bbsColor; | |
| 585 | + | end; | |
| 586 | + | end; | |
| 587 | + | ||
| 588 | + | // dsGrad | |
| 589 | + | with BGRAButton2 do begin | |
| 590 | + | TextShadow:=False; | |
| 591 | + | RoundX:=4; | |
| 592 | + | RoundY:=4; | |
| 593 | + | with BodyNormal do begin | |
| 594 | + | BorderStyle:=bboNone; | |
| 595 | + | Font.Color:=clBlack; | |
| 596 | + | Gradient1EndPercent:=100; | |
| 597 | + | Gradient1.EndColor:=RGBToColor(245,245,241); | |
| 598 | + | Gradient1.StartColor:=RGBToColor(253,253,253); | |
| 599 | + | end; | |
| 600 | + | with BodyHover do begin | |
| 601 | + | BorderStyle:=bboNone; | |
| 602 | + | Font.Color:=clBlack; | |
| 603 | + | Gradient1EndPercent:=100; | |
| 604 | + | Gradient1.EndColor:=RGBToColor(245,245,241); | |
| 605 | + | Gradient1.StartColor:=RGBToColor(253,253,253); | |
| 606 | + | end; | |
| 607 | + | with BodyClicked do begin | |
| 608 | + | Color:=RGBToColor(227,227,224); | |
| 609 | + | BorderColor:=RGBToColor(172,172,170); | |
| 610 | + | Font.Color:=clBlack; | |
| 611 | + | Style:=bbsColor; | |
| 612 | + | end; | |
| 613 | + | end; | |
| 614 | + | ||
| 615 | + | // dsWinCE | |
| 616 | + | with BGRAButton3 do begin | |
| 617 | + | TextShadow:=False; | |
| 618 | + | with BodyNormal do begin | |
| 619 | + | Color:=RGBToColor(245,245,241); | |
| 620 | + | BorderColor:=clBlack; | |
| 621 | + | Font.Color:=clBlack; | |
| 622 | + | Style:=bbsColor; | |
| 623 | + | end; | |
| 624 | + | with BodyHover do begin | |
| 625 | + | Color:=RGBToColor(245,245,241); | |
| 626 | + | BorderColor:=clBlack; | |
| 627 | + | Font.Color:=clBlack; | |
| 628 | + | Style:=bbsColor; | |
| 629 | + | end; | |
| 630 | + | with BodyClicked do begin | |
| 631 | + | Color:=RGBToColor(220,220,216); | |
| 632 | + | BorderColor:=clBlack; | |
| 633 | + | Font.Color:=clBlack; | |
| 634 | + | Style:=bbsColor; | |
| 635 | + | end; | |
| 636 | + | end; | |
| 637 | + | ||
| 638 | + | // dsXPTaskBar | |
| 639 | + | with BGRAButton4 do begin | |
| 640 | + | TextShadow:=False; | |
| 641 | + | RoundX:=4; | |
| 642 | + | RoundY:=4; | |
| 643 | + | with BodyNormal do begin | |
| 644 | + | BorderColor:=RGBToColor(219,219,215); | |
| 645 | + | Font.Color:=clBlack; | |
| 646 | + | Gradient1EndPercent:=100; | |
| 647 | + | Gradient1.EndColor:=RGBToColor(232,232,228); | |
| 648 | + | Gradient1.StartColor:=RGBToColor(245,245,241); | |
| 649 | + | Gradient1.Point1YPercent:=85; | |
| 650 | + | end; | |
| 651 | + | with BodyHover do begin | |
| 652 | + | BorderColor:=RGBToColor(219,219,215); | |
| 653 | + | Font.Color:=clBlack; | |
| 654 | + | Gradient1EndPercent:=100; | |
| 655 | + | Gradient1.EndColor:=RGBToColor(232,232,228); | |
| 656 | + | Gradient1.StartColor:=RGBToColor(245,245,241); | |
| 657 | + | Gradient1.Point1YPercent:=85; | |
| 658 | + | end; | |
| 659 | + | with BodyClicked do begin | |
| 660 | + | Color:=RGBToColor(227,227,224); | |
| 661 | + | BorderColor:=RGBToColor(172,172,170); | |
| 662 | + | Font.Color:=clBlack; | |
| 663 | + | Style:=bbsColor; | |
| 664 | + | end; | |
| 665 | + | end; | |
| 684 | 666 | end; | |
| 685 | - | ||
| 686 | - | ||
| 687 | 667 | ``` | |
| 688 | 668 | ||
| 689 | 669 | ## Flash Player Setup | |
| 690 | 670 | ||
| 691 | - | ||
| 692 | - | ||
| 693 | - | ||
| 694 | - | ||
| 695 | - | ||
| 696 | - | ||
| 671 | + | [](</File:bgraflashplayersetup.png>) | |
| 697 | 672 | ||
| 698 | - | ||
| 673 | + | Like Flash Player Setup, add 2 BGRAPanel, the first with a BGRAButton inside, then go OnPaint event of Form1 and add this code: | |
| 674 | + | ``` | |
| 699 | 675 | procedure TForm1.FormCreate(Sender: TObject); | |
| 700 | - | ||
| 701 | - | ||
| 702 | - | ||
| 703 | - | ||
| 704 | - | ||
| 705 | - | ||
| 706 | - | ||
| 707 | - | ||
| 708 | - | ||
| 709 | - | ||
| 710 | - | ||
| 711 | - | ||
| 712 | - | ||
| 713 | - | ||
| 714 | - | ||
| 715 | - | ||
| 716 | - | ||
| 717 | - | ||
| 718 | - | ||
| 719 | - | ||
| 720 | - | ||
| 721 | - | ||
| 722 | - | ||
| 723 | - | ||
| 724 | - | ||
| 725 | - | ||
| 726 | - | ||
| 727 | - | ||
| 728 | - | ||
| 729 | - | ||
| 730 | - | ||
| 731 | - | ||
| 732 | - | ||
| 733 | - | ||
| 734 | - | ||
| 735 | - | ||
| 736 | - | ||
| 737 | - | ||
| 738 | - | ||
| 739 | - | ||
| 740 | - | ||
| 741 | - | ||
| 742 | - | ||
| 743 | - | ||
| 744 | - | ||
| 745 | - | ||
| 746 | - | ||
| 747 | - | ||
| 748 | - | ||
| 676 | + | begin | |
| 677 | + | // Background | |
| 678 | + | Self.Color:=RGBToColor(62,62,62); | |
| 679 | + | ||
| 680 | + | // Panel | |
| 681 | + | with BGRAPanel2 do begin | |
| 682 | + | BevelOuter:=bvNone; | |
| 683 | + | With Gradient do begin | |
| 684 | + | StartColor:=RGBToColor(203,19,23); | |
| 685 | + | EndColor:=RGBToColor(110,3,20); | |
| 686 | + | end; | |
| 749 | 687 | end; | |
| 750 | - | ||
| 751 | - | ||
| 752 | - | ||
| 753 | - | ||
| 754 | - | ||
| 755 | - | ||
| 756 | - | ||
| 757 | - | ||
| 688 | + | ||
| 689 | + | // Bottom Panel | |
| 690 | + | with BGRAPanel1 do begin | |
| 691 | + | BevelOuter:=bvNone; | |
| 692 | + | BackGroundStyle:=bpsColor; | |
| 693 | + | Color:=RGBToColor(76,76,76); | |
| 758 | 694 | end; | |
| 759 | - | ||
| 760 | - | ||
| 761 | - | ||
| 695 | + | ||
| 696 | + | // Button | |
| 697 | + | with BGRAButton1 do begin | |
| 698 | + | TextShadowOffSetX:=1; | |
| 699 | + | TextShadowOffSetY:=1; | |
| 700 | + | TextShadowRadius:=2; | |
| 701 | + | // Normal | |
| 702 | + | with BodyNormal do begin | |
| 703 | + | BorderColor:=RGBToColor(24,24,24); | |
| 704 | + | Font.Color:=clWhite; | |
| 705 | + | with Gradient1 do begin | |
| 706 | + | StartColor:=RGBToColor(104,104,104); | |
| 707 | + | EndColor:=RGBToColor(104,104,104); | |
| 708 | + | end; | |
| 709 | + | with Gradient2 do begin | |
| 710 | + | StartColor:=RGBToColor(103,103,103); | |
| 711 | + | EndColor:=RGBToColor(71,71,71); | |
| 712 | + | end; | |
| 713 | + | end; | |
| 714 | + | // Hover | |
| 715 | + | with BodyHover do begin | |
| 716 | + | BorderColor:=RGBToColor(24,24,24); | |
| 717 | + | Font.Color:=clWhite; | |
| 718 | + | with Gradient1 do begin | |
| 719 | + | StartColor:=RGBToColor(118,118,118); | |
| 720 | + | EndColor:=RGBToColor(118,118,118); | |
| 721 | + | end; | |
| 722 | + | with Gradient2 do begin | |
| 723 | + | StartColor:=RGBToColor(117,117,117); | |
| 724 | + | EndColor:=RGBToColor(81,81,81); | |
| 725 | + | end; | |
| 726 | + | end; | |
| 727 | + | // Clicked | |
| 728 | + | with BodyClicked do begin | |
| 729 | + | BorderColor:=RGBToColor(24,24,24); | |
| 730 | + | Font.Color:=clWhite; | |
| 731 | + | with Gradient1 do begin | |
| 732 | + | StartColor:=RGBToColor(92,92,92); | |
| 733 | + | EndColor:=RGBToColor(92,92,92); | |
| 734 | + | end; | |
| 735 | + | with Gradient2 do begin | |
| 736 | + | StartColor:=RGBToColor(91,91,91); | |
| 737 | + | EndColor:=RGBToColor(62,62,62); | |
| 738 | + | end; | |
| 739 | + | end; | |
| 762 | 740 | end; | |
| 741 | + | ||
| 763 | 742 | end; | |
| 764 | - | ||
| 765 | - | ||
| 766 | - | ||
| 767 | 743 | ``` | |
| 768 | 744 | ||
| 769 | 745 | --- | |
| 770 | - | ||
| 771 | - | ||
| 746 | + | *From the Free Pascal wiki, page "BGRAButton Gallery", as the Internet Archive kept it on 2024-10-07. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).* |
