comparison dwtx/draw2d/SimpleLoweredBorder.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.SimpleLoweredBorder;
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 lowered border.
23 */
24 public final class SimpleLoweredBorder
25 : SchemeBorder
26 {
27
28 private static const Scheme DOUBLE;
29
30 static this(){
31 DOUBLE = new Scheme(
32 [ColorConstants.buttonDarkest, ColorConstants.buttonDarker],
33 [ColorConstants.buttonLightest, ColorConstants.button] );
34 }
35 /**
36 * Constructs a SimpleLoweredBorder with the predefined button-pressed Scheme set as
37 * default.
38 *
39 * @since 2.0
40 */
41 public this() {
42 super(SCHEMES.BUTTON_PRESSED);
43 }
44
45 /**
46 * Constructs a SimpleLoweredBorder with the width of all sides provided as input. If
47 * width is 2, this SimpleLoweredBorder will use the local DOUBLE Scheme, otherwise it
48 * will use the {@link SchemeBorder.SCHEMES#BUTTON_PRESSED} Scheme.
49 *
50 * @param width the width of all the sides of the border
51 * @since 2.0
52 */
53 public this(int width) {
54 super(width is 2 ? DOUBLE : SCHEMES.BUTTON_PRESSED);
55 }
56
57 }