libAlgAudio
v1.99-440-g08538e5-dirty
The development library for AlgAudio framework.
|
#include <MainWindow.hpp>
Public Types | |
enum | SaveAlertReply { SaveAlertReply::Cancel, SaveAlertReply::Discard, SaveAlertReply::Save } |
Public Member Functions | |
void | AskToSaveBeforeCalling (std::function< void()> f) |
void | New () |
void | Open () |
void | ProcessCloseEvent () override |
void | ProcessKeyboardEvent (KeyData data) override |
LateReturn< SaveAlertReply > | ShowDoYouWantToSaveAlert () |
LateReturn | ShowErrorAlert (std::string message, std::string button_text) override |
LateReturn< int > | ShowSimpleAlert (std::string message, std::string button1_text, std::string button2_text, AlertType type=AlertType::NONE, Color button1_color=Theme::Get("bg-button-neutral"), Color button2_color=Theme::Get("bg-button-neutral")) override |
bool | SaveAs () |
bool | Save () |
bool | Save (std::string path) |
Public Member Functions inherited from AlgAudio::Window | |
template<class W , typename... Args> | |
std::shared_ptr< W > | Create (Args...args) |
unsigned int | GetID () const |
SDL_Renderer * | GetRenderer () const |
std::shared_ptr< UIWidget > | GetRoot () const |
Size2D | GetSize () const |
SDL_Window * | GetWindow () const |
void | Insert (std::shared_ptr< UIWidget > child) |
Window & | operator= (const Window &)=delete |
void | ProcessEnterEvent () |
void | ProcessLeaveEvent () |
void | ProcessMotionEvent (Point2D) |
void | ProcessMouseButtonEvent (bool down, MouseButton button, Point2D) |
void | ProcessResizeEvent () |
void | ProcessWheelEvent (MouseButton button) |
void | Render () |
void | SetNeedsRedrawing () |
Window (const Window &)=delete | |
~Window () | |
Static Public Member Functions | |
static std::shared_ptr < MainWindow > | Create () |
Static Public Member Functions inherited from AlgAudio::Window | |
static std::shared_ptr< Window > | Create (std::string title="AlgAudio", int w=350, int h=300, bool centered=true, bool resizable=true) |
Additional Inherited Members | |
Public Attributes inherited from AlgAudio::Window | |
Signal | on_close |
Public Attributes inherited from AlgAudio::SubscriptionsManager | |
SubscriptionList | subscriptions |
Protected Member Functions inherited from AlgAudio::Window | |
Window (std::string title, int w, int h, bool centered=true, bool resizable=true) | |
|
strong |
void AlgAudio::MainWindow::AskToSaveBeforeCalling | ( | std::function< void()> | f | ) |
This helper method asks the user to save the file, potentially saves it, and afterwards invokes a function.
|
static |
void AlgAudio::MainWindow::New | ( | ) |
Asks the user to save their work, and clears the canvas.
void AlgAudio::MainWindow::Open | ( | ) |
Displays the open dialog and loads the selected file, if any.
|
overridevirtual |
Reimplemented from AlgAudio::Window.
|
overridevirtual |
Reimplemented from AlgAudio::Window.
bool AlgAudio::MainWindow::Save | ( | ) |
Returns true on a successful save.
bool AlgAudio::MainWindow::Save | ( | std::string | path | ) |
Returns true on a successful save.
bool AlgAudio::MainWindow::SaveAs | ( | ) |
Returns true on a successful save.
LateReturn<SaveAlertReply> AlgAudio::MainWindow::ShowDoYouWantToSaveAlert | ( | ) |
|
overridevirtual |
Reimplemented from AlgAudio::Window.
|
overridevirtual |
Returns 0 if the first button was clicked, 1, if the second.
Reimplemented from AlgAudio::Window.