Add wxTLW::SetModified to allow apps to set the TLW's dirty state. On Mac this gives us the dot in the close button, not implemented elsewhere yet.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62796 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -245,6 +245,9 @@ public :
|
|||||||
|
|
||||||
virtual bool IsActive();
|
virtual bool IsActive();
|
||||||
|
|
||||||
|
virtual void SetModified(bool modified);
|
||||||
|
virtual bool GetModified() const;
|
||||||
|
|
||||||
wxNonOwnedWindow* GetWXPeer() { return m_wxPeer; }
|
wxNonOwnedWindow* GetWXPeer() { return m_wxPeer; }
|
||||||
protected :
|
protected :
|
||||||
WX_wxNSWindow m_macWindow;
|
WX_wxNSWindow m_macWindow;
|
||||||
|
@@ -754,6 +754,9 @@ public :
|
|||||||
static wxNonOwnedWindowImpl* CreateNonOwnedWindow( wxNonOwnedWindow* wxpeer, wxWindow* parent, const wxPoint& pos, const wxSize& size,
|
static wxNonOwnedWindowImpl* CreateNonOwnedWindow( wxNonOwnedWindow* wxpeer, wxWindow* parent, const wxPoint& pos, const wxSize& size,
|
||||||
long style, long extraStyle, const wxString& name ) ;
|
long style, long extraStyle, const wxString& name ) ;
|
||||||
|
|
||||||
|
virtual void SetModified(bool WXUNUSED(modified)) { }
|
||||||
|
virtual bool GetModified() const { return false; }
|
||||||
|
|
||||||
protected :
|
protected :
|
||||||
wxNonOwnedWindow* m_wxPeer;
|
wxNonOwnedWindow* m_wxPeer;
|
||||||
DECLARE_ABSTRACT_CLASS(wxNonOwnedWindowImpl)
|
DECLARE_ABSTRACT_CLASS(wxNonOwnedWindowImpl)
|
||||||
|
@@ -75,6 +75,9 @@ public:
|
|||||||
virtual void SetTitle( const wxString& title);
|
virtual void SetTitle( const wxString& title);
|
||||||
virtual wxString GetTitle() const;
|
virtual wxString GetTitle() const;
|
||||||
|
|
||||||
|
virtual void SetModified(bool modified);
|
||||||
|
virtual bool GetModified() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// common part of all ctors
|
// common part of all ctors
|
||||||
void Init();
|
void Init();
|
||||||
|
@@ -257,6 +257,9 @@ public:
|
|||||||
virtual void SetMinSize(const wxSize& minSize);
|
virtual void SetMinSize(const wxSize& minSize);
|
||||||
virtual void SetMaxSize(const wxSize& maxSize);
|
virtual void SetMaxSize(const wxSize& maxSize);
|
||||||
|
|
||||||
|
virtual void SetModified(bool modified) { m_modified = modified; }
|
||||||
|
virtual bool GetModified() const { return m_modified; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// the frame client to screen translation should take account of the
|
// the frame client to screen translation should take account of the
|
||||||
// toolbar which may shift the origin of the client area
|
// toolbar which may shift the origin of the client area
|
||||||
@@ -305,6 +308,8 @@ protected:
|
|||||||
// a temporary override of m_winDefault, use the latter if NULL
|
// a temporary override of m_winDefault, use the latter if NULL
|
||||||
wxWindowRef m_winTmpDefault;
|
wxWindowRef m_winTmpDefault;
|
||||||
|
|
||||||
|
bool m_modified;
|
||||||
|
|
||||||
wxDECLARE_NO_COPY_CLASS(wxTopLevelWindowBase);
|
wxDECLARE_NO_COPY_CLASS(wxTopLevelWindowBase);
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
WX_DECLARE_CONTROL_CONTAINER();
|
WX_DECLARE_CONTROL_CONTAINER();
|
||||||
|
@@ -440,6 +440,18 @@ public:
|
|||||||
*/
|
*/
|
||||||
virtual bool ShouldPreventAppExit() const;
|
virtual bool ShouldPreventAppExit() const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
This function sets the wxTopLevelWindow's modified state, so that the
|
||||||
|
wxTopLevelWindow can change its GUI to reflect the current state. (e.g. on
|
||||||
|
Mac, the close button gets a black dot to reflect that there are unsaved changes)
|
||||||
|
*/
|
||||||
|
virtual void SetModified(bool modified);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Returns the current modified state of the wxTopLevelWindow.
|
||||||
|
*/
|
||||||
|
virtual bool GetModified() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Depending on the value of @a show parameter the window is either shown
|
Depending on the value of @a show parameter the window is either shown
|
||||||
full screen or restored to its normal state. @a style is a bit list
|
full screen or restored to its normal state. @a style is a bit list
|
||||||
|
@@ -727,6 +727,16 @@ bool wxNonOwnedWindowCocoaImpl::IsActive()
|
|||||||
return [m_macWindow isKeyWindow];
|
return [m_macWindow isKeyWindow];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void wxNonOwnedWindowCocoaImpl::SetModified(bool modified)
|
||||||
|
{
|
||||||
|
[m_macWindow setDocumentEdited:modified];
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxNonOwnedWindowCocoaImpl::GetModified() const
|
||||||
|
{
|
||||||
|
return [m_macWindow isDocumentEdited];
|
||||||
|
}
|
||||||
|
|
||||||
wxNonOwnedWindowImpl* wxNonOwnedWindowImpl::CreateNonOwnedWindow( wxNonOwnedWindow* wxpeer, wxWindow* parent, const wxPoint& pos, const wxSize& size,
|
wxNonOwnedWindowImpl* wxNonOwnedWindowImpl::CreateNonOwnedWindow( wxNonOwnedWindow* wxpeer, wxWindow* parent, const wxPoint& pos, const wxSize& size,
|
||||||
long style, long extraStyle, const wxString& name )
|
long style, long extraStyle, const wxString& name )
|
||||||
{
|
{
|
||||||
|
@@ -186,3 +186,13 @@ bool wxTopLevelWindowMac::IsActive()
|
|||||||
{
|
{
|
||||||
return m_nowpeer->IsActive();
|
return m_nowpeer->IsActive();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void wxTopLevelWindowMac::SetModified(bool modified)
|
||||||
|
{
|
||||||
|
m_nowpeer->SetModified(modified);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxTopLevelWindowMac::GetModified() const
|
||||||
|
{
|
||||||
|
return m_nowpeer->GetModified();
|
||||||
|
}
|
Reference in New Issue
Block a user