1 /**
2  * Widget module.
3  *
4  * License:
5  *     MIT. See LICENSE for full details.
6  */
7 module tkd.widget.separator;
8 
9 /**
10  * Imports.
11  */
12 import std..string;
13 import tkd.element.uielement;
14 import tkd.widget.orientation;
15 import tkd.widget.widget;
16 
17 /**
18  * A separator widget displays a horizontal or vertical separator bar.
19  *
20  * Example:
21  * ---
22  * auto separator = new Separator()
23  * 	.pack(0, 0, GeometrySide.top, GeometryFill.x);
24  * ---
25  *
26  * Additional_Events:
27  *     Additional events that can also be bound to using the $(LINK2 ../element/uielement.html#UiElement.bind, bind) method.
28  *     $(P
29  *         <<PrevWindow>>,
30  *         <Alt-Key>,
31  *         <Key-F10>,
32  *         <Key-Tab>,
33  *     )
34  *
35  * See_Also:
36  *     $(LINK2 ./widget.html, tkd.widget.widget)
37  */
38 class Separator : Widget
39 {
40 	/**
41 	 * Construct the widget.
42 	 *
43 	 * Params:
44 	 *     parent = The parent of this widget.
45 	 *     orientation = The orientation of the widget.
46 	 *
47 	 * See_Also:
48 	 *     $(LINK2 ../element/uielement.html, tkd.element.UiElement) $(BR)
49 	 *     $(LINK2 ./orientation.html, tkd.widget.orientation) for orientations.
50 	 */
51 	public this(UiElement parent, string orientation = Orientation.horizontal)
52 	{
53 		super(parent);
54 		this._elementId = "separator";
55 
56 		this._tk.eval("ttk::separator %s -orient %s", this.id, orientation);
57 	}
58 
59 	/**
60 	 * Construct the widget.
61 	 *
62 	 * Params:
63 	 *     orientation = The orientation of the widget.
64 	 *
65 	 * See_Also:
66 	 *     $(LINK2 ./orientation.html, tkd.widget.orientation) for orientations.
67 	 */
68 	public this(string orientation = Orientation.horizontal)
69 	{
70 		this(null, orientation);
71 	}
72 }