wxMaxima
Notification.h
Go to the documentation of this file.
1 // -*- mode: c++; c-file-style: "linux"; c-basic-offset: 2; indent-tabs-mode: nil -*-
2 //
3 // Copyright (C) 2004-2015 Andrej Vodopivec <andrej.vodopivec@gmail.com>
4 // (C) 2012-2013 Doug Ilijev <doug.ilijev@gmail.com>
5 // (C) 2015 Gunter Königsmann <wxMaxima@physikbuch.de>
6 //
7 // This program is free software; you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by
9 // the Free Software Foundation; either version 2 of the License, or
10 // (at your option) any later version.
11 //
12 // This program is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
16 //
17 //
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the Free Software
20 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 //
22 // SPDX-License-Identifier: GPL-2.0+
23 
31 #ifndef NOTIFICATION_H
32 #define NOTIFICATION_H
33 
34 #include "GroupCell.h"
35 #include "precomp.h"
36 #include <wx/notifmsg.h>
37 #include <wx/wx.h>
38 
39 #ifdef __WXOSX__
40 #define NOTIFI_OVERRIDE override
41 #else
42 #define NOTIFI_OVERRIDE
43 #endif
44 
51 class Notification final: public wxNotificationMessage
52 {
53 public:
55  Notification();
57  explicit Notification(const wxString &title,
58  const wxString &message = {},
59  wxWindow *parent=NULL,
60  int flags=wxICON_INFORMATION);
62  ~Notification() override { Notification::Close(); }
64  void SetGroup(wxWindow *parent);
66  wxWindow *GetGroup() { return m_parent; }
69 private:
71  wxWindow *m_parent;
72 protected:
74  void OnClick(wxCommandEvent &event);
75 };
76 
77 #undef NOTIFI_OVERRIDE
78 
79 #endif
Notification::~Notification
~Notification() override
A destructor that also closes the notification.
Definition: Notification.h:62
Notification
Definition: Notification.h:51
GroupCell.h
Notification::m_errorNotificationCell
GroupCell * m_errorNotificationCell
The cell we signal an error for.
Definition: Notification.h:68
Notification::OnClick
void OnClick(wxCommandEvent &event)
Called on clicking at the notification, if the OS supports that.
Definition: Notification.cpp:67
Notification::Notification
Notification()
A constructor that doesn't take any arguments.
Definition: Notification.cpp:32
Notification::GetGroup
wxWindow * GetGroup()
Returns a pointer to the main window or NULL, if no main window is set.
Definition: Notification.h:66
GroupCell
Definition: GroupCell.h:68
Notification::SetGroup
void SetGroup(wxWindow *parent)
Informs the notification which the main window is it notified for.
Definition: Notification.cpp:61