Mercurial > projects > dwt-addons
comparison dwtx/draw2d/SimpleRaisedBorder.d @ 98:95307ad235d9
Added Draw2d code, still work in progress
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sun, 03 Aug 2008 00:52:14 +0200 |
parents | |
children | 2d6540440fe6 |
comparison
equal
deleted
inserted
replaced
96:b492ba44e44d | 98:95307ad235d9 |
---|---|
1 /******************************************************************************* | |
2 * Copyright (c) 2000, 2005 IBM Corporation and others. | |
3 * All rights reserved. This program and the accompanying materials | |
4 * are made available under the terms of the Eclipse Public License v1.0 | |
5 * which accompanies this distribution, and is available at | |
6 * http://www.eclipse.org/legal/epl-v10.html | |
7 * | |
8 * Contributors: | |
9 * IBM Corporation - initial API and implementation | |
10 * Port to the D programming language: | |
11 * Frank Benoit <benoit@tionex.de> | |
12 *******************************************************************************/ | |
13 module dwtx.draw2d.SimpleRaisedBorder; | |
14 | |
15 import dwt.dwthelper.utils; | |
16 | |
17 import dwt.graphics.Color; | |
18 import dwtx.draw2d.SchemeBorder; | |
19 import dwtx.draw2d.ColorConstants; | |
20 | |
21 /** | |
22 * Provides a raised border. | |
23 */ | |
24 public class SimpleRaisedBorder | |
25 : SchemeBorder | |
26 { | |
27 | |
28 private static const Scheme DOUBLE; | |
29 static this(){ | |
30 DOUBLE = new Scheme( | |
31 [ColorConstants.buttonLightest, ColorConstants.button], | |
32 [ColorConstants.buttonDarkest, ColorConstants.buttonDarker] | |
33 ); | |
34 } | |
35 | |
36 /** | |
37 * Constructs a SimpleRaisedBorder with the predefined {@link SchemeBorder.SCHEMES#BUTTON_RAISED} | |
38 * Scheme set as default. | |
39 * | |
40 * @since 2.0 | |
41 */ | |
42 public this() { | |
43 super(SCHEMES.BUTTON_RAISED); | |
44 } | |
45 | |
46 /** | |
47 * Constructs a SimpleRaisedBorder with the width of all sides provided as input. If | |
48 * width is 2, this SimpleRaisedBorder will use the local DOUBLE Scheme, otherwise it will | |
49 * use the {@link SchemeBorder.SCHEMES#BUTTON_RAISED} Scheme. | |
50 * | |
51 * @param width the width of all the sides of the border | |
52 * @since 2.0 | |
53 */ | |
54 public this(int width) { | |
55 super(width is 2 ? DOUBLE : SCHEMES.BUTTON_RAISED); | |
56 } | |
57 | |
58 } |