xtd 0.2.0
Loading...
Searching...
No Matches
window_styles.h
Go to the documentation of this file.
1
4#pragma once
6#if !defined(__XTD_FORMS_NATIVE_LIBRARY__)
7#error "Do not include this file: Internal use only"
8#endif
10
11#include <cstddef>
12#include <xtd/string.h>
13
14// https://docs.microsoft.com/en-us/cpp/mfc/reference/styles-used-by-mfc
15
16#if !defined(WS_OVERLAPPED)
23constexpr size_t WS_OVERLAPPED = 0x00000000;
30constexpr size_t WS_MAXIMIZEBOX = 0x00010000;
37constexpr size_t WS_MINIMIZEBOX = 0x00020000;
44constexpr size_t WS_THICKFRAME = 0x00040000;
51constexpr size_t WS_SYSMENU = 0x00080000;
58constexpr size_t WS_HSCROLL = 0x00100000;
65constexpr size_t WS_VSCROLL = 0x00200000;
72constexpr size_t WS_DLGFRAME = 0x00400000;
79constexpr size_t WS_BORDER = 0x00800000;
87constexpr size_t WS_CAPTION = 0x00C00000; // WS_BORDER|WS_DLGFRAME
94constexpr size_t WS_MAXIMIZE = 0x01000000;
101constexpr size_t WS_CLIPCHILDREN = 0x02000000;
108constexpr size_t WS_CLIPSIBLINGS = 0x04000000;
115constexpr size_t WS_DISABLED = 0x08000000;
122constexpr size_t WS_VISIBLE = 0x10000000;
129constexpr size_t WS_MINIMIZE = 0x20000000;
136constexpr size_t WS_CHILD = 0x40000000;
143constexpr size_t WS_POPUP = 0x80000000;
144
151constexpr size_t WS_GROUP = 0x00020000;
158constexpr size_t WS_TABSTOP = 0x00010000;
159
160// Common Window Styles
161
182constexpr size_t WS_CHILDWINDOW = WS_CHILD;
183
184// Window Styles (next...)
185
192constexpr size_t WS_TILED = WS_OVERLAPPED;
199constexpr size_t WS_ICONIC = WS_MINIMIZE;
206constexpr size_t WS_SIZEBOX = WS_THICKFRAME;
214#endif
215
216inline static xtd::string __windows_style_to_string__(size_t style) {
217 xtd::string result = "WS_OVERLAPPED";
218
219 if ((style & WS_MAXIMIZEBOX) == WS_MAXIMIZEBOX) result += " | WS_MAXIMIZEBOX";
220 if ((style & WS_MINIMIZEBOX) == WS_MINIMIZEBOX) result += " | WS_MINIMIZEBOX";
221 if ((style & WS_THICKFRAME) == WS_THICKFRAME) result += " | WS_THICKFRAME";
222 if ((style & WS_SYSMENU) == WS_SYSMENU) result += " | WS_SYSMENU";
223 if ((style & WS_HSCROLL) == WS_HSCROLL) result += " | WS_HSCROLL";
224 if ((style & WS_VSCROLL) == WS_VSCROLL) result += " | WS_VSCROLL";
225 if ((style & WS_DLGFRAME) == WS_DLGFRAME) result += " | WS_DLGFRAME";
226 if ((style & WS_BORDER) == WS_BORDER) result += " | WS_BORDER";
227 if ((style & WS_CAPTION) == WS_CAPTION) result += " | WS_CAPTION";
228 if ((style & WS_MAXIMIZE) == WS_MAXIMIZE) result += " | WS_MAXIMIZE";
229 if ((style & WS_CLIPCHILDREN) == WS_CLIPCHILDREN) result += " | WS_CLIPCHILDREN";
230 if ((style & WS_CLIPSIBLINGS) == WS_CLIPSIBLINGS) result += " | WS_CLIPSIBLINGS";
231 if ((style & WS_DISABLED) == WS_DISABLED) result += " | WS_DISABLED";
232 if ((style & WS_VISIBLE) == WS_VISIBLE) result += " | WS_VISIBLE";
233 if ((style & WS_MINIMIZE) == WS_MINIMIZE) result += " | WS_MINIMIZE";
234 if ((style & WS_CHILD) == WS_CHILD) result += " | WS_CHILD";
235 if ((style & WS_POPUP) == WS_POPUP) result += " | WS_POPUP";
236 if ((style & WS_GROUP) == WS_GROUP) result += " | WS_GROUP";
237 if ((style & WS_TABSTOP) == WS_TABSTOP) result += " | WS_TABSTOP";
238 return result;
239}
Represents text as a sequence of character units.
Definition basic_string.h:79
constexpr size_t WS_TILED
Creates an overlapped window. An overlapped window has a title bar and a border. Same as the WS_OVERL...
Definition window_styles.h:192
constexpr size_t WS_GROUP
Specifies the first control of a group of controls in which the user can move from one control to the...
Definition window_styles.h:151
constexpr size_t WS_CHILDWINDOW
Same as the WS_CHILD style.
Definition window_styles.h:182
constexpr size_t WS_CAPTION
Creates a window that has a title bar (implies the WS_BORDER style). Cannot be used with the WS_DLGFR...
Definition window_styles.h:87
constexpr size_t WS_MINIMIZE
Creates a window that is initially minimized. For use with the WS_OVERLAPPED style only.
Definition window_styles.h:129
constexpr size_t WS_THICKFRAME
Creates a window with a thick frame that can be used to size the window.
Definition window_styles.h:44
constexpr size_t WS_CLIPSIBLINGS
Clips child windows relative to each other; that is, when a particular child window receives a paint ...
Definition window_styles.h:108
constexpr size_t WS_MAXIMIZE
Creates a window of maximum size.
Definition window_styles.h:94
constexpr size_t WS_MAXIMIZEBOX
Creates a window that has a Maximize button.
Definition window_styles.h:30
constexpr size_t WS_MINIMIZEBOX
Creates a window that has a Minimize button.
Definition window_styles.h:37
constexpr size_t WS_HSCROLL
Creates a window that has a horizontal scroll bar.
Definition window_styles.h:58
constexpr size_t WS_OVERLAPPEDWINDOW
Creates an overlapped window with the WS_OVERLAPPED, WS_CAPTION, WS_SYSMENU, WS_THICKFRAME,...
Definition window_styles.h:168
constexpr size_t WS_OVERLAPPED
Creates an overlapped window. An overlapped window usually has a caption and a border.
Definition window_styles.h:23
constexpr size_t WS_SIZEBOX
Creates a window that has a sizing border. Same as the WS_THICKFRAME style.
Definition window_styles.h:206
constexpr size_t WS_DISABLED
Creates a window that is initially disabled.
Definition window_styles.h:115
constexpr size_t WS_VSCROLL
Creates a window that has a vertical scroll bar.
Definition window_styles.h:65
constexpr size_t WS_POPUP
Creates a pop-up window. Cannot be used with the WS_CHILD style.
Definition window_styles.h:143
constexpr size_t WS_CHILD
Creates a child window. Cannot be used with the WS_POPUP style.
Definition window_styles.h:136
constexpr size_t WS_VISIBLE
Creates a window that is initially visible.
Definition window_styles.h:122
constexpr size_t WS_ICONIC
Creates a window that is initially minimized. Same as the WS_MINIMIZE style.
Definition window_styles.h:199
constexpr size_t WS_POPUPWINDOW
Creates a pop-up window with the WS_BORDER, WS_POPUP, and WS_SYSMENU styles. The WS_CAPTION style mus...
Definition window_styles.h:175
constexpr size_t WS_BORDER
Creates a window that has a border.
Definition window_styles.h:79
constexpr size_t WS_DLGFRAME
Creates a window with a double border but no title.
Definition window_styles.h:72
constexpr size_t WS_CLIPCHILDREN
Excludes the area occupied by child windows when you draw within the parent window....
Definition window_styles.h:101
constexpr size_t WS_TILEDWINDOW
Creates an overlapped window with the WS_OVERLAPPED, WS_CAPTION, WS_SYSMENU, WS_THICKFRAME,...
Definition window_styles.h:213
constexpr size_t WS_TABSTOP
Specifies one of any number of controls through which the user can move by using the TAB key....
Definition window_styles.h:158
constexpr size_t WS_SYSMENU
Creates a window that has a Control-menu box in its title bar. Used only for windows with title bars.
Definition window_styles.h:51
Contains xtd::string alias.