Skip to content

Commit 9b6bc77

Browse files
committed
Button: add Button.ButtonType enumeration
This adds the enumeration of the various styles of buttons that are available by default. This can be used to implement additional helper constructors for `Button`.
1 parent e29d08c commit 9b6bc77

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

Sources/SwiftWin32/Views and Controls/Button.swift

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,35 @@ private let SwiftButtonProc: SUBCLASSPROC = { (hWnd, uMsg, wParam, lParam, uIdSu
1616
return DefSubclassProc(hWnd, uMsg, wParam, lParam)
1717
}
1818

19+
extension Button {
20+
/// Specifies the style of a button.
21+
public enum ButtonType: Int {
22+
/// No button style.
23+
case custom
24+
25+
/// A system style button, such as those shown in navigation bars and
26+
/// toolbars.
27+
case system
28+
29+
/// A detail disclosure button.
30+
case detailDisclosure
31+
32+
/// An information button that has a light background.
33+
case infoLight
34+
35+
/// An information button that has a dark background.
36+
case infoDark
37+
38+
/// A contact add button.
39+
case contactAdd
40+
41+
/// A standard system button without a blurred background view.
42+
case plain
43+
44+
/// A close button to dismiss panels and views.
45+
case close
46+
}
47+
}
1948

2049
/// A control that executes your custom code in response to user interactions.
2150
public class Button: Control {

0 commit comments

Comments
 (0)