AUI Framework  master
Cross-platform base for C++ UI apps
Loading...
Searching...
No Matches
AMessageBox.h
    1/*
    2 * AUI Framework - Declarative UI toolkit for modern C++20
    3 * Copyright (C) 2020-2025 Alex2772 and Contributors
    4 *
    5 * SPDX-License-Identifier: MPL-2.0
    6 *
    7 * This Source Code Form is subject to the terms of the Mozilla Public
    8 * License, v. 2.0. If a copy of the MPL was not distributed with this
    9 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
   10 */
   11
   12#pragma once
   13#include "AUI/Views.h"
   14
   15class AString;
   16class AWindow;
   17
   46namespace AMessageBox {
   47
   51enum class Icon {
   58    NONE,
   59
   63    INFO,
   64
   69
   74};
   75
   79enum class Button {
   83    OK,
   84
   89
   93    YES_NO,
   94
   99};
  100
  104enum class ResultButton {
  109
  113    OK,
  114
  118    CANCEL,
  119
  123    YES,
  124
  128    NO,
  129};
  130
  140API_AUI_VIEWS ResultButton
  141show(AWindow* parent, const AString& title, const AString& message, Icon icon = Icon::NONE, Button b = Button::OK);
  142};   // namespace AMessageBox
Represents a Unicode character string.
Definition AString.h:38
Represents a window in the underlying windowing system.
Definition AWindow.h:45
Displaying native modal message dialogs.
Definition AMessageBox.h:46
API_AUI_VIEWS ResultButton show(AWindow *parent, const AString &title, const AString &message, Icon icon=Icon::NONE, Button b=Button::OK)
Displays a message box, blocking the caller thread until the user dismisses the message.
ResultButton
Button that the user has clicked.
Definition AMessageBox.h:104
@ CANCEL
Indicates the user clicked the Cancel button.
Definition AMessageBox.h:118
@ YES
Indicates the user clicked the Yes button.
Definition AMessageBox.h:123
@ NO
Indicates the user clicked the No button.
Definition AMessageBox.h:128
@ INVALID
Indicates an invalid or undefined result.
Definition AMessageBox.h:108
Button
Specifies button(s) to be displayed.
Definition AMessageBox.h:79
@ YES_NO_CANCEL
Display Yes, No and Cancel buttons.
Definition AMessageBox.h:98
@ YES_NO
Display Yes and No buttons.
Definition AMessageBox.h:93
@ OK_CANCEL
Display OK and Cancel buttons.
Definition AMessageBox.h:88
@ OK
Display OK button only.
Definition AMessageBox.h:83
Icon
Specifies icon to be displayed.
Definition AMessageBox.h:51
@ WARNING
Warning icon.
Definition AMessageBox.h:68
@ INFO
Information icon.
Definition AMessageBox.h:63
@ CRITICAL
Critical icon.
Definition AMessageBox.h:73
@ NONE
No icon is specified.
Definition AMessageBox.h:58