]> git.saurik.com Git - wxWidgets.git/commitdiff
wxCloseEvent::GetLoggingOff() is for [query] end session events only
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 22 May 2005 11:21:21 +0000 (11:21 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 22 May 2005 11:21:21 +0000 (11:21 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34239 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/latex/wx/closeevt.tex
include/wx/event.h

index 5e540e5afbf41932bb4ed054165b960414207f4c..0880be8144ad92a2cc74a10f813d1e0e39aad6b6 100644 (file)
@@ -48,12 +48,14 @@ This event applies to wxApp only.}
 
 \latexignore{\rtfignore{\wxheading{Members}}}
 
 
 \latexignore{\rtfignore{\wxheading{Members}}}
 
+
 \membersection{wxCloseEvent::wxCloseEvent}\label{wxcloseeventctor}
 
 \func{}{wxCloseEvent}{\param{WXTYPE}{ commandEventType = 0}, \param{int}{ id = 0}}
 
 Constructor.
 
 \membersection{wxCloseEvent::wxCloseEvent}\label{wxcloseeventctor}
 
 \func{}{wxCloseEvent}{\param{WXTYPE}{ commandEventType = 0}, \param{int}{ id = 0}}
 
 Constructor.
 
+
 \membersection{wxCloseEvent::CanVeto}\label{wxcloseeventcanveto}
 
 \func{bool}{CanVeto}{\void}
 \membersection{wxCloseEvent::CanVeto}\label{wxcloseeventcanveto}
 
 \func{bool}{CanVeto}{\void}
@@ -62,11 +64,15 @@ Returns true if you can veto a system shutdown or a window close event.
 Vetoing a window close event is not possible if the calling code wishes to
 force the application to exit, and so this function must be called to check this.
 
 Vetoing a window close event is not possible if the calling code wishes to
 force the application to exit, and so this function must be called to check this.
 
+
 \membersection{wxCloseEvent::GetLoggingOff}\label{wxcloseeventgetloggingoff}
 
 \constfunc{bool}{GetLoggingOff}{\void}
 
 \membersection{wxCloseEvent::GetLoggingOff}\label{wxcloseeventgetloggingoff}
 
 \constfunc{bool}{GetLoggingOff}{\void}
 
-Returns true if the user is logging off.
+Returns true if the user is just logging off or false if the system is
+shutting down. This method can only be called for end session and query end
+session events, it doesn't make sense for close window event.
+
 
 \membersection{wxCloseEvent::GetForce}\label{wxcloseeventgetforce}
 
 
 \membersection{wxCloseEvent::GetForce}\label{wxcloseeventgetforce}
 
@@ -75,24 +81,28 @@ Returns true if the user is logging off.
 Returns true if the application wishes to force the window to close.
 This will shortly be obsolete, replaced by CanVeto.
 
 Returns true if the application wishes to force the window to close.
 This will shortly be obsolete, replaced by CanVeto.
 
+
 \membersection{wxCloseEvent::SetCanVeto}\label{wxcloseeventsetcanveto}
 
 \func{void}{SetCanVeto}{\param{bool}{ canVeto}}
 
 Sets the 'can veto' flag.
 
 \membersection{wxCloseEvent::SetCanVeto}\label{wxcloseeventsetcanveto}
 
 \func{void}{SetCanVeto}{\param{bool}{ canVeto}}
 
 Sets the 'can veto' flag.
 
+
 \membersection{wxCloseEvent::SetForce}\label{wxcloseeventsetforce}
 
 \constfunc{void}{SetForce}{\param{bool}{ force}}
 
 Sets the 'force' flag.
 
 \membersection{wxCloseEvent::SetForce}\label{wxcloseeventsetforce}
 
 \constfunc{void}{SetForce}{\param{bool}{ force}}
 
 Sets the 'force' flag.
 
+
 \membersection{wxCloseEvent::SetLoggingOff}\label{wxcloseeventsetloggingoff}
 
 \constfunc{void}{SetLoggingOff}{\param{bool}{ loggingOff}}
 
 Sets the 'logging off' flag.
 
 \membersection{wxCloseEvent::SetLoggingOff}\label{wxcloseeventsetloggingoff}
 
 \constfunc{void}{SetLoggingOff}{\param{bool}{ loggingOff}}
 
 Sets the 'logging off' flag.
 
+
 \membersection{wxCloseEvent::Veto}\label{wxcloseeventveto}
 
 \func{void}{Veto}{\param{bool}{ veto = true}}
 \membersection{wxCloseEvent::Veto}\label{wxcloseeventveto}
 
 \func{void}{Veto}{\param{bool}{ veto = true}}
index 92b58526e1c6f92afd7c57a75b72b0cc87f41b88..de4c15edeb2803c3da292c91bf1b9aabbdc56ec0 100644 (file)
@@ -1389,7 +1389,15 @@ public:
         m_canVeto(event.m_canVeto) {}
 
     void SetLoggingOff(bool logOff) { m_loggingOff = logOff; }
         m_canVeto(event.m_canVeto) {}
 
     void SetLoggingOff(bool logOff) { m_loggingOff = logOff; }
-    bool GetLoggingOff() const { return m_loggingOff; }
+    bool GetLoggingOff() const
+    {
+        // m_loggingOff flag is only used by wxEVT_[QUERY_]END_SESSION, it
+        // doesn't make sense for wxEVT_CLOSE_WINDOW
+        wxASSERT_MSG( m_eventType != wxEVT_CLOSE_WINDOW,
+                      _T("this flag is for end session events only") );
+
+        return m_loggingOff;
+    }
 
     void Veto(bool veto = true)
     {
 
     void Veto(bool veto = true)
     {
@@ -1400,19 +1408,18 @@ public:
         m_veto = veto;
     }
     void SetCanVeto(bool canVeto) { m_canVeto = canVeto; }
         m_veto = veto;
     }
     void SetCanVeto(bool canVeto) { m_canVeto = canVeto; }
-    // No more asserts here please, the one you put here was wrong.
     bool CanVeto() const { return m_canVeto; }
     bool GetVeto() const { return m_canVeto && m_veto; }
 
     virtual wxEvent *Clone() const { return new wxCloseEvent(*this); }
 
 protected:
     bool CanVeto() const { return m_canVeto; }
     bool GetVeto() const { return m_canVeto && m_veto; }
 
     virtual wxEvent *Clone() const { return new wxCloseEvent(*this); }
 
 protected:
-    bool m_loggingOff;
-    bool m_veto, m_canVeto;
+    bool m_loggingOff,
+         m_veto,
+         m_canVeto;
 
 private:
     DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxCloseEvent)
 
 private:
     DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxCloseEvent)
-
 };
 
 /*
 };
 
 /*