projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
send wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED only once after end of dragging and...
[wxWidgets.git]
/
src
/
common
/
clipcmn.cpp
diff --git
a/src/common/clipcmn.cpp
b/src/common/clipcmn.cpp
index 94dbdd07efa63fa9fad928648059d7f36a0a9808..f253ccb9c1a1a6572cd49b5fdab4a691dad344e6 100644
(file)
--- a/
src/common/clipcmn.cpp
+++ b/
src/common/clipcmn.cpp
@@
-6,7
+6,7
@@
// Created: 28.06.99
// RCS-ID: $Id$
// Copyright: (c) Robert Roebling
// Created: 28.06.99
// RCS-ID: $Id$
// Copyright: (c) Robert Roebling
-// Licence: wxWindows licen
s
e
+// Licence: wxWindows licen
c
e
/////////////////////////////////////////////////////////////////////////////
// ============================================================================
/////////////////////////////////////////////////////////////////////////////
// ============================================================================
@@
-17,7
+17,7
@@
// headers
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
-#if
def __GNUG__
+#if
defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation "clipboardbase.h"
#endif
#pragma implementation "clipboardbase.h"
#endif
@@
-29,34
+29,36
@@
#endif
#include "wx/clipbrd.h"
#endif
#include "wx/clipbrd.h"
+#include "wx/module.h"
-//--------------------------------------------------------------------------
-// wxClipboardBase
-//--------------------------------------------------------------------------
+#if wxUSE_CLIPBOARD
-wxClipboardBase::wxClipboardBase()
+static wxClipboard *gs_clipboard = NULL;
+
+/*static*/ wxClipboard *wxClipboardBase::Get()
{
{
+ if ( !gs_clipboard )
+ {
+ gs_clipboard = new wxClipboard;
+ }
+ return gs_clipboard;
}
// ----------------------------------------------------------------------------
}
// ----------------------------------------------------------------------------
-// wxClipboardModule: module responsible for
initializ
ing the global clipboard
+// wxClipboardModule: module responsible for
destroy
ing the global clipboard
// object
// object
-//
// ----------------------------------------------------------------------------
class wxClipboardModule : public wxModule
{
public:
// ----------------------------------------------------------------------------
class wxClipboardModule : public wxModule
{
public:
- wxClipboardModule() { }
-
- bool OnInit()
- { wxTheClipboard = new wxClipboard; return TRUE; }
- void OnExit()
- { delete wxTheClipboard; wxTheClipboard = (wxClipboard *)NULL; }
+ bool OnInit() { return true; }
+ void OnExit() { wxDELETE(gs_clipboard); }
private:
DECLARE_DYNAMIC_CLASS(wxClipboardModule)
};
private:
DECLARE_DYNAMIC_CLASS(wxClipboardModule)
};
-IMPLEMENT_DYNAMIC_CLASS(wxClipboardModule,wxModule)
+IMPLEMENT_DYNAMIC_CLASS(wxClipboardModule,
wxModule)
+#endif // wxUSE_CLIPBOARD