Message Box

About


Akel’s message boxes are very simple and based on those of the SDL2 (they will be changed to use those of the system). They have a main message, an “Ok” button and a “More details” button which leads to a second message, this one saved by the logs system with the level of importance given to the box.

drawing drawing

Syntax


class CustomComponent : public Ak::Component
{
    public:
        void onAttach() override
        {
            Ak::messageBox(MESSAGE, "Main Message", "Second message (saved by the logs)");
            Ak::messageBox(WARNING, "Main Message", "Second message (saved by the logs)");
            Ak::messageBox(ERROR, "Main Message", "Second message (saved by the logs)");
            Ak::messageBox(FATAL_ERROR, "Main Message", "Second message (saved by the logs)");
        }
};

messageBox(enum LogType type, std::string message, std::string logReport)


Creates a new message box and send the second message to the logs with the importance level given.

// Prototype
void messageBox(enum LogType type, std::string message, std::string logReport);

// Usage
Ak::messageBox(MESSAGE, "Main Message", "Second message (saved by the logs)");
Ak::messageBox(WARNING, "Main Message", "Second message (saved by the logs)");
Ak::messageBox(ERROR, "Main Message", "Second message (saved by the logs)");
Ak::messageBox(FATAL_ERROR, "Main Message", "Second message (saved by the logs)");