1 // Written by Christopher E. Miller
2 // See the included license.txt for copyright and license details.
3 
4 
5 ///
6 module dfl.panel;
7 
8 private import dfl.control, dfl.base, dfl.internal.winapi;
9 
10 
11 ///
12 class Panel: ContainerControl // docmain
13 {
14 	///
15 	@property void borderStyle(BorderStyle bs) // setter
16 	{
17 		final switch(bs)
18 		{
19 			case BorderStyle.FIXED_3D:
20 				_style(_style() & ~WS_BORDER);
21 				_exStyle(_exStyle() | WS_EX_CLIENTEDGE);
22 				break;
23 				
24 			case BorderStyle.FIXED_SINGLE:
25 				_exStyle(_exStyle() & ~WS_EX_CLIENTEDGE);
26 				_style(_style() | WS_BORDER);
27 				break;
28 				
29 			case BorderStyle.NONE:
30 				_style(_style() & ~WS_BORDER);
31 				_exStyle(_exStyle() & ~WS_EX_CLIENTEDGE);
32 				break;
33 		}
34 		
35 		if(created)
36 		{
37 			redrawEntire();
38 		}
39 	}
40 	
41 	/// ditto
42 	@property BorderStyle borderStyle() // getter
43 	{
44 		if(_exStyle() & WS_EX_CLIENTEDGE)
45 			return BorderStyle.FIXED_3D;
46 		else if(_style() & WS_BORDER)
47 			return BorderStyle.FIXED_SINGLE;
48 		return BorderStyle.NONE;
49 	}
50 	
51 	
52 	this()
53 	{
54 		//ctrlStyle |= ControlStyles.SELECTABLE | ControlStyles.CONTAINER_CONTROL;
55 		ctrlStyle |= ControlStyles.CONTAINER_CONTROL;
56 		/+ wstyle |= WS_TABSTOP; +/ // Should WS_TABSTOP be set?
57 		//wexstyle |= WS_EX_CONTROLPARENT; // Allow tabbing through children. ?
58 	}
59 }
60