mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-09-23 05:18:08 +08:00
Warn against Microsoft <windows.h> min and max macro (#1084)
Warn users they have defined the min/max macros which is not compatible with other code from the standard library or FTXUI. Co-authored-by: Sylko Olzscher <sylko.olzscher@solostec.ch> Co-authored-by: ArthurSonzogni <sonzogniarthur@gmail.com>
This commit is contained in:
@@ -19,10 +19,11 @@ int main() {
|
||||
|
||||
// 1. Example of focusable renderer:
|
||||
auto renderer_focusable = Renderer([](bool focused) {
|
||||
if (focused)
|
||||
if (focused) {
|
||||
return text("FOCUSABLE RENDERER()") | center | bold | border;
|
||||
else
|
||||
} else {
|
||||
return text(" Focusable renderer() ") | center | border;
|
||||
}
|
||||
});
|
||||
|
||||
// 2. Examples of a non focusable renderer.
|
||||
@@ -33,10 +34,11 @@ int main() {
|
||||
// 3. Renderer can wrap other components to redefine their Render() function.
|
||||
auto button = Button("Wrapped quit button", screen.ExitLoopClosure());
|
||||
auto renderer_wrap = Renderer(button, [&] {
|
||||
if (button->Focused())
|
||||
if (button->Focused()) {
|
||||
return button->Render() | bold | color(Color::Red);
|
||||
else
|
||||
} else {
|
||||
return button->Render();
|
||||
}
|
||||
});
|
||||
|
||||
// Let's renderer everyone:
|
||||
|
Reference in New Issue
Block a user