Added some tentative wxMotif clipboard code; did some file formatting
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1408 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -41,10 +41,6 @@ High Priority
|
|||||||
|
|
||||||
- Get wxGLCanvas from 1.68 working.
|
- Get wxGLCanvas from 1.68 working.
|
||||||
|
|
||||||
- wxClipboard
|
|
||||||
|
|
||||||
- EVT_KEY_DOWN, EVT_KEY_UP events.
|
|
||||||
|
|
||||||
Low Priority
|
Low Priority
|
||||||
------------
|
------------
|
||||||
|
|
||||||
|
@@ -16,6 +16,8 @@ Please see also:
|
|||||||
|
|
||||||
- Documentation: mention include files with each class.
|
- Documentation: mention include files with each class.
|
||||||
|
|
||||||
|
- Document wxTime.
|
||||||
|
|
||||||
- Get Karsten to remove trashed CVS files:
|
- Get Karsten to remove trashed CVS files:
|
||||||
|
|
||||||
include/wx/msw/magnif1.cur
|
include/wx/msw/magnif1.cur
|
||||||
|
@@ -4,7 +4,7 @@
|
|||||||
#if defined(__WXMSW__)
|
#if defined(__WXMSW__)
|
||||||
#include "wx/msw/ole/dataobj.h"
|
#include "wx/msw/ole/dataobj.h"
|
||||||
#elif defined(__WXMOTIF__)
|
#elif defined(__WXMOTIF__)
|
||||||
#include "wx/motif/dnd.h"
|
#include "wx/motif/dataobj.h"
|
||||||
#elif defined(__WXGTK__)
|
#elif defined(__WXGTK__)
|
||||||
#include "wx/gtk/dataobj.h"
|
#include "wx/gtk/dataobj.h"
|
||||||
#elif defined(__WXQT__)
|
#elif defined(__WXQT__)
|
||||||
|
@@ -23,17 +23,77 @@
|
|||||||
#include "wx/setup.h"
|
#include "wx/setup.h"
|
||||||
|
|
||||||
#include "wx/list.h"
|
#include "wx/list.h"
|
||||||
|
#include "wx/module.h"
|
||||||
|
|
||||||
bool WXDLLEXPORT wxOpenClipboard();
|
bool WXDLLEXPORT wxOpenClipboard();
|
||||||
bool WXDLLEXPORT wxClipboardOpen();
|
bool WXDLLEXPORT wxClipboardOpen();
|
||||||
bool WXDLLEXPORT wxCloseClipboard();
|
bool WXDLLEXPORT wxCloseClipboard();
|
||||||
bool WXDLLEXPORT wxEmptyClipboard();
|
bool WXDLLEXPORT wxEmptyClipboard();
|
||||||
bool WXDLLEXPORT wxIsClipboardFormatAvailable(int dataFormat);
|
bool WXDLLEXPORT wxIsClipboardFormatAvailable(wxDataFormat dataFormat);
|
||||||
bool WXDLLEXPORT wxSetClipboardData(int dataFormat, wxObject *obj, int width = 0, int height = 0);
|
bool WXDLLEXPORT wxSetClipboardData(wxDataFormat dataFormat, wxObject *obj, int width = 0, int height = 0);
|
||||||
wxObject* WXDLLEXPORT wxGetClipboardData(int dataFormat, long *len = NULL);
|
wxObject* WXDLLEXPORT wxGetClipboardData(wxDataFormat dataFormat, long *len = NULL);
|
||||||
int WXDLLEXPORT wxEnumClipboardFormats(int dataFormat);
|
wxDataFormat WXDLLEXPORT wxEnumClipboardFormats(wxDataFormat dataFormat);
|
||||||
int WXDLLEXPORT wxRegisterClipboardFormat(char *formatName);
|
wxDataFormat WXDLLEXPORT wxRegisterClipboardFormat(char *formatName);
|
||||||
bool WXDLLEXPORT wxGetClipboardFormatName(int dataFormat, char *formatName, int maxCount);
|
bool WXDLLEXPORT wxGetClipboardFormatName(wxDataFormat dataFormat, char *formatName, int maxCount);
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// wxClipboard
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class WXDLLEXPORT wxDataObject;
|
||||||
|
class WXDLLEXPORT wxClipboard: public wxObject
|
||||||
|
{
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxClipboard)
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
wxClipboard();
|
||||||
|
~wxClipboard();
|
||||||
|
|
||||||
|
// open the clipboard before SetData() and GetData()
|
||||||
|
virtual bool Open();
|
||||||
|
|
||||||
|
// close the clipboard after SetData() and GetData()
|
||||||
|
virtual void Close();
|
||||||
|
|
||||||
|
// can be called several times
|
||||||
|
virtual bool SetData( wxDataObject *data );
|
||||||
|
|
||||||
|
// format available on the clipboard ?
|
||||||
|
// supply ID if private format, the same as wxPrivateDataObject::SetId()
|
||||||
|
virtual bool IsSupportedFormat( wxDataFormat format, const wxString &id = wxEmptyString );
|
||||||
|
|
||||||
|
// fill data with data on the clipboard (if available)
|
||||||
|
virtual bool GetData( wxDataObject *data );
|
||||||
|
|
||||||
|
// clears wxTheClipboard and the system's clipboard if possible
|
||||||
|
virtual void Clear();
|
||||||
|
|
||||||
|
// implementation
|
||||||
|
|
||||||
|
bool m_open;
|
||||||
|
wxList m_data;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* The clipboard */
|
||||||
|
WXDLLEXPORT_DATA(extern wxClipboard*) wxTheClipboard;
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// wxClipboardModule
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class wxClipboardModule: public wxModule
|
||||||
|
{
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxClipboardModule)
|
||||||
|
|
||||||
|
public:
|
||||||
|
wxClipboardModule() {}
|
||||||
|
bool OnInit();
|
||||||
|
void OnExit();
|
||||||
|
};
|
||||||
|
|
||||||
|
// This is the old, 1.68 implementation
|
||||||
|
#if 0
|
||||||
|
|
||||||
/* A clipboard client holds data belonging to the clipboard.
|
/* A clipboard client holds data belonging to the clipboard.
|
||||||
For plain text, a client is not necessary. */
|
For plain text, a client is not necessary. */
|
||||||
@@ -100,5 +160,8 @@ void WXDLLEXPORT wxInitClipboard();
|
|||||||
/* The clipboard */
|
/* The clipboard */
|
||||||
WXDLLEXPORT_DATA(extern wxClipboard*) wxTheClipboard;
|
WXDLLEXPORT_DATA(extern wxClipboard*) wxTheClipboard;
|
||||||
|
|
||||||
|
#endif
|
||||||
|
// Old clipboard class
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
// _WX_CLIPBRD_H_
|
// _WX_CLIPBRD_H_
|
||||||
|
@@ -1,22 +1,27 @@
|
|||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: dnd.h
|
// Name: dnd.h
|
||||||
// Purpose: Declaration of the wxDropTarget, wxDropSource class etc.
|
// Purpose: declaration of wxDropTarget, wxDropSource classes
|
||||||
// Author: Julian Smart
|
// Author: Julian Smart
|
||||||
// RCS-ID: $Id$
|
// RCS-ID: $Id$
|
||||||
// Copyright: (c) 1998 Julian Smart
|
// Copyright: (c) 1998 Vadim Zeitlin, Robert Roebling, Julian Smart
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
#ifndef _WX_DND_H_
|
#ifndef _WX_DND_H_
|
||||||
#define _WX_DND_H_
|
#define _WX_DND_H_
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma interface "dnd.h"
|
#pragma interface
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/defs.h"
|
#include "wx/defs.h"
|
||||||
|
|
||||||
|
#if wxUSE_DRAG_AND_DROP
|
||||||
|
|
||||||
#include "wx/object.h"
|
#include "wx/object.h"
|
||||||
#include "wx/string.h"
|
#include "wx/string.h"
|
||||||
|
#include "wx/dataobj.h"
|
||||||
#include "wx/cursor.h"
|
#include "wx/cursor.h"
|
||||||
|
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
@@ -25,119 +30,13 @@
|
|||||||
|
|
||||||
class WXDLLEXPORT wxWindow;
|
class WXDLLEXPORT wxWindow;
|
||||||
|
|
||||||
class WXDLLEXPORT wxDataObject;
|
|
||||||
class WXDLLEXPORT wxTextDataObject;
|
|
||||||
class WXDLLEXPORT wxFileDataObject;
|
|
||||||
|
|
||||||
class WXDLLEXPORT wxDropTarget;
|
class WXDLLEXPORT wxDropTarget;
|
||||||
class WXDLLEXPORT wxTextDropTarget;
|
class WXDLLEXPORT wxTextDropTarget;
|
||||||
class WXDLLEXPORT wxFileDropTarget;
|
class WXDLLEXPORT wxFileDropTarget;
|
||||||
|
class WXDLLEXPORT wxPrivateDropTarget;
|
||||||
|
|
||||||
class WXDLLEXPORT wxDropSource;
|
class WXDLLEXPORT wxDropSource;
|
||||||
|
|
||||||
//-------------------------------------------------------------------------
|
|
||||||
// wxDataObject
|
|
||||||
//-------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class WXDLLEXPORT wxDataObject: public wxObject
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
// all data formats (values are the same as in windows.h, do not change!)
|
|
||||||
enum StdFormat
|
|
||||||
{
|
|
||||||
Invalid,
|
|
||||||
Text,
|
|
||||||
Bitmap,
|
|
||||||
MetafilePict,
|
|
||||||
Sylk,
|
|
||||||
Dif,
|
|
||||||
Tiff,
|
|
||||||
OemText,
|
|
||||||
Dib,
|
|
||||||
Palette,
|
|
||||||
Pendata,
|
|
||||||
Riff,
|
|
||||||
Wave,
|
|
||||||
UnicodeText,
|
|
||||||
EnhMetafile,
|
|
||||||
Hdrop,
|
|
||||||
Locale,
|
|
||||||
Max
|
|
||||||
};
|
|
||||||
|
|
||||||
// function to return symbolic name of clipboard format (debug messages)
|
|
||||||
static const char *GetFormatName(wxDataFormat format);
|
|
||||||
|
|
||||||
// ctor & dtor
|
|
||||||
wxDataObject() {};
|
|
||||||
~wxDataObject() {};
|
|
||||||
|
|
||||||
// pure virtuals to override
|
|
||||||
// get the best suited format for our data
|
|
||||||
virtual wxDataFormat GetPreferredFormat() const = 0;
|
|
||||||
// decide if we support this format (should be one of values of
|
|
||||||
// StdFormat enumerations or a user-defined format)
|
|
||||||
virtual bool IsSupportedFormat(wxDataFormat format) const = 0;
|
|
||||||
// get the (total) size of data
|
|
||||||
virtual size_t GetDataSize() const = 0;
|
|
||||||
// copy raw data to provided pointer
|
|
||||||
virtual void GetDataHere(void *pBuf) const = 0;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
|
||||||
// wxTextDataObject is a specialization of wxDataObject for text data
|
|
||||||
// ----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class WXDLLEXPORT wxTextDataObject : public wxDataObject
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
// ctors
|
|
||||||
wxTextDataObject() { }
|
|
||||||
wxTextDataObject(const wxString& strText) : m_strText(strText) { }
|
|
||||||
void Init(const wxString& strText) { m_strText = strText; }
|
|
||||||
|
|
||||||
// implement base class pure virtuals
|
|
||||||
virtual wxDataFormat GetPreferredFormat() const
|
|
||||||
{ return wxDF_TEXT; }
|
|
||||||
virtual bool IsSupportedFormat(wxDataFormat format) const
|
|
||||||
{ return format == wxDF_TEXT; }
|
|
||||||
virtual size_t GetDataSize() const
|
|
||||||
{ return m_strText.Len() + 1; } // +1 for trailing '\0'of course
|
|
||||||
virtual void GetDataHere(void *pBuf) const
|
|
||||||
{ memcpy(pBuf, m_strText.c_str(), GetDataSize()); }
|
|
||||||
|
|
||||||
private:
|
|
||||||
wxString m_strText;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
|
||||||
// wxFileDataObject is a specialization of wxDataObject for file names
|
|
||||||
// ----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class WXDLLEXPORT wxFileDataObject : public wxDataObject
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
wxFileDataObject(void) { }
|
|
||||||
void AddFile( const wxString &file )
|
|
||||||
{ m_files += file; m_files += ";"; }
|
|
||||||
|
|
||||||
// implement base class pure virtuals
|
|
||||||
virtual wxDataFormat GetPreferredFormat() const
|
|
||||||
{ return wxDF_FILENAME; }
|
|
||||||
virtual bool IsSupportedFormat(wxDataFormat format) const
|
|
||||||
{ return format == wxDF_FILENAME; }
|
|
||||||
virtual size_t GetDataSize() const
|
|
||||||
{ return m_files.Len() + 1; } // +1 for trailing '\0'of course
|
|
||||||
virtual void GetDataHere(void *pBuf) const
|
|
||||||
{ memcpy(pBuf, m_files.c_str(), GetDataSize()); }
|
|
||||||
|
|
||||||
private:
|
|
||||||
wxString m_files;
|
|
||||||
|
|
||||||
};
|
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
// wxDropTarget
|
// wxDropTarget
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
@@ -151,16 +50,14 @@ class WXDLLEXPORT wxDropTarget: public wxObject
|
|||||||
|
|
||||||
virtual void OnEnter() { }
|
virtual void OnEnter() { }
|
||||||
virtual void OnLeave() { }
|
virtual void OnLeave() { }
|
||||||
virtual bool OnDrop( long x, long y, const void *pData ) = 0;
|
virtual bool OnDrop( long x, long y, const void *data, size_t size ) = 0;
|
||||||
|
|
||||||
// protected:
|
|
||||||
|
|
||||||
friend wxWindow;
|
|
||||||
|
|
||||||
// Override these to indicate what kind of data you support:
|
// Override these to indicate what kind of data you support:
|
||||||
|
|
||||||
virtual size_t GetFormatCount() const = 0;
|
virtual size_t GetFormatCount() const = 0;
|
||||||
virtual wxDataFormat GetFormat(size_t n) const = 0;
|
virtual wxDataFormat GetFormat(size_t n) const = 0;
|
||||||
|
|
||||||
|
// implementation
|
||||||
};
|
};
|
||||||
|
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
@@ -172,7 +69,7 @@ class WXDLLEXPORT wxTextDropTarget: public wxDropTarget
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
wxTextDropTarget() {};
|
wxTextDropTarget() {};
|
||||||
virtual bool OnDrop( long x, long y, const void *pData );
|
virtual bool OnDrop( long x, long y, const void *data, size_t size );
|
||||||
virtual bool OnDropText( long x, long y, const char *psz );
|
virtual bool OnDropText( long x, long y, const char *psz );
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@@ -181,6 +78,36 @@ class WXDLLEXPORT wxTextDropTarget: public wxDropTarget
|
|||||||
virtual wxDataFormat GetFormat(size_t n) const;
|
virtual wxDataFormat GetFormat(size_t n) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------
|
||||||
|
// wxPrivateDropTarget
|
||||||
|
//-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class WXDLLEXPORT wxPrivateDropTarget: public wxDropTarget
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
wxPrivateDropTarget();
|
||||||
|
|
||||||
|
// you have to override OnDrop to get at the data
|
||||||
|
|
||||||
|
// the string ID identifies the format of clipboard or DnD data. a word
|
||||||
|
// processor would e.g. add a wxTextDataObject and a wxPrivateDataObject
|
||||||
|
// to the clipboard - the latter with the Id "WXWORD_FORMAT".
|
||||||
|
|
||||||
|
void SetId( const wxString& id )
|
||||||
|
{ m_id = id; }
|
||||||
|
|
||||||
|
wxString GetId()
|
||||||
|
{ return m_id; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
virtual size_t GetFormatCount() const;
|
||||||
|
virtual wxDataFormat GetFormat(size_t n) const;
|
||||||
|
|
||||||
|
wxString m_id;
|
||||||
|
};
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// A drop target which accepts files (dragged from File Manager or Explorer)
|
// A drop target which accepts files (dragged from File Manager or Explorer)
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -191,9 +118,9 @@ class WXDLLEXPORT wxFileDropTarget: public wxDropTarget
|
|||||||
|
|
||||||
wxFileDropTarget() {};
|
wxFileDropTarget() {};
|
||||||
|
|
||||||
virtual bool OnDrop(long x, long y, const void *pData);
|
virtual bool OnDrop( long x, long y, const void *data, size_t size );
|
||||||
virtual bool OnDropFiles( long x, long y,
|
virtual bool OnDropFiles( long x, long y,
|
||||||
size_t nFiles, const char * const aszFiles[]);
|
size_t nFiles, const char * const aszFiles[] );
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
@@ -205,14 +132,14 @@ class WXDLLEXPORT wxFileDropTarget: public wxDropTarget
|
|||||||
// wxDropSource
|
// wxDropSource
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
|
|
||||||
enum wxDragResult
|
enum wxDragResult
|
||||||
{
|
{
|
||||||
wxDragError, // error prevented the d&d operation from completing
|
wxDragError, // error prevented the d&d operation from completing
|
||||||
wxDragNone, // drag target didn't accept the data
|
wxDragNone, // drag target didn't accept the data
|
||||||
wxDragCopy, // the data was successfully copied
|
wxDragCopy, // the data was successfully copied
|
||||||
wxDragMove, // the data was successfully moved
|
wxDragMove, // the data was successfully moved
|
||||||
wxDragCancel // the operation was cancelled by user (not an error)
|
wxDragCancel // the operation was cancelled by user (not an error)
|
||||||
};
|
};
|
||||||
|
|
||||||
class WXDLLEXPORT wxDropSource: public wxObject
|
class WXDLLEXPORT wxDropSource: public wxObject
|
||||||
{
|
{
|
||||||
@@ -228,11 +155,24 @@ class WXDLLEXPORT wxDropSource: public wxObject
|
|||||||
|
|
||||||
virtual bool GiveFeedback( wxDragResult WXUNUSED(effect), bool WXUNUSED(bScrolling) ) { return TRUE; };
|
virtual bool GiveFeedback( wxDragResult WXUNUSED(effect), bool WXUNUSED(bScrolling) ) { return TRUE; };
|
||||||
|
|
||||||
protected:
|
// implementation
|
||||||
|
#if 0
|
||||||
|
void RegisterWindow(void);
|
||||||
|
void UnregisterWindow(void);
|
||||||
|
|
||||||
|
wxWindow *m_window;
|
||||||
|
wxDragResult m_retValue;
|
||||||
wxDataObject *m_data;
|
wxDataObject *m_data;
|
||||||
|
|
||||||
|
wxCursor m_defaultCursor;
|
||||||
|
wxCursor m_goaheadCursor;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// wxUSE_DRAG_AND_DROP
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
//_WX_DND_H_
|
//_WX_DND_H_
|
||||||
|
|
||||||
|
@@ -418,7 +418,6 @@ public:
|
|||||||
void OnChar(wxKeyEvent& event);
|
void OnChar(wxKeyEvent& event);
|
||||||
void OnKeyDown(wxKeyEvent& event);
|
void OnKeyDown(wxKeyEvent& event);
|
||||||
void OnKeyUp(wxKeyEvent& event);
|
void OnKeyUp(wxKeyEvent& event);
|
||||||
void OnChar(wxKeyEvent& event);
|
|
||||||
void OnPaint(wxPaintEvent& event);
|
void OnPaint(wxPaintEvent& event);
|
||||||
void OnIdle(wxIdleEvent& event);
|
void OnIdle(wxIdleEvent& event);
|
||||||
|
|
||||||
|
@@ -57,7 +57,7 @@ wxHashTable *wxWidgetHashTable = NULL;
|
|||||||
#if !USE_SHARED_LIBRARY
|
#if !USE_SHARED_LIBRARY
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxApp, wxEvtHandler)
|
IMPLEMENT_DYNAMIC_CLASS(wxApp, wxEvtHandler)
|
||||||
BEGIN_EVENT_TABLE(wxApp, wxEvtHandler)
|
BEGIN_EVENT_TABLE(wxApp, wxEvtHandler)
|
||||||
EVT_IDLE(wxApp::OnIdle)
|
EVT_IDLE(wxApp::OnIdle)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -85,11 +85,11 @@ bool wxApp::Initialize()
|
|||||||
|
|
||||||
// For PostScript printing
|
// For PostScript printing
|
||||||
#if wxUSE_POSTSCRIPT
|
#if wxUSE_POSTSCRIPT
|
||||||
/* Done using wxModule now
|
/* Done using wxModule now
|
||||||
wxInitializePrintSetupData();
|
wxInitializePrintSetupData();
|
||||||
wxThePrintPaperDatabase = new wxPrintPaperDatabase;
|
wxThePrintPaperDatabase = new wxPrintPaperDatabase;
|
||||||
wxThePrintPaperDatabase->CreateDatabase();
|
wxThePrintPaperDatabase->CreateDatabase();
|
||||||
*/
|
*/
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
wxBitmap::InitStandardHandlers();
|
wxBitmap::InitStandardHandlers();
|
||||||
@@ -133,11 +133,11 @@ void wxApp::CleanUp()
|
|||||||
wxTheColourDatabase = NULL;
|
wxTheColourDatabase = NULL;
|
||||||
|
|
||||||
#if wxUSE_POSTSCRIPT
|
#if wxUSE_POSTSCRIPT
|
||||||
/* Done using wxModule now
|
/* Done using wxModule now
|
||||||
wxInitializePrintSetupData(FALSE);
|
wxInitializePrintSetupData(FALSE);
|
||||||
delete wxThePrintPaperDatabase;
|
delete wxThePrintPaperDatabase;
|
||||||
wxThePrintPaperDatabase = NULL;
|
wxThePrintPaperDatabase = NULL;
|
||||||
*/
|
*/
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
wxBitmap::CleanUpHandlers();
|
wxBitmap::CleanUpHandlers();
|
||||||
@@ -385,7 +385,7 @@ bool wxApp::Pending()
|
|||||||
// Dispatch a message.
|
// Dispatch a message.
|
||||||
void wxApp::Dispatch()
|
void wxApp::Dispatch()
|
||||||
{
|
{
|
||||||
// XtAppProcessEvent( (XtAppContext) wxTheApp->GetAppContext(), XtIMAll);
|
// XtAppProcessEvent( (XtAppContext) wxTheApp->GetAppContext(), XtIMAll);
|
||||||
|
|
||||||
XEvent event;
|
XEvent event;
|
||||||
XtAppNextEvent((XtAppContext) GetAppContext(), &event);
|
XtAppNextEvent((XtAppContext) GetAppContext(), &event);
|
||||||
|
@@ -26,7 +26,6 @@
|
|||||||
|
|
||||||
#include "wx/motif/private.h"
|
#include "wx/motif/private.h"
|
||||||
|
|
||||||
// TODO: correct symbol, path?
|
|
||||||
#if wxUSE_XPM
|
#if wxUSE_XPM
|
||||||
#include <X11/xpm.h>
|
#include <X11/xpm.h>
|
||||||
#endif
|
#endif
|
||||||
@@ -355,8 +354,8 @@ wxBitmapHandler *wxBitmap::FindHandler(long bitmapType)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* wxMask
|
* wxMask
|
||||||
*/
|
*/
|
||||||
|
|
||||||
wxMask::wxMask()
|
wxMask::wxMask()
|
||||||
{
|
{
|
||||||
@@ -399,7 +398,7 @@ wxMask::~wxMask()
|
|||||||
// Create a mask from a mono bitmap (copies the bitmap).
|
// Create a mask from a mono bitmap (copies the bitmap).
|
||||||
bool wxMask::Create(const wxBitmap& WXUNUSED(bitmap))
|
bool wxMask::Create(const wxBitmap& WXUNUSED(bitmap))
|
||||||
{
|
{
|
||||||
// TODO
|
// TODO
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -407,7 +406,7 @@ bool wxMask::Create(const wxBitmap& WXUNUSED(bitmap))
|
|||||||
// the transparent area
|
// the transparent area
|
||||||
bool wxMask::Create(const wxBitmap& WXUNUSED(bitmap), int WXUNUSED(paletteIndex))
|
bool wxMask::Create(const wxBitmap& WXUNUSED(bitmap), int WXUNUSED(paletteIndex))
|
||||||
{
|
{
|
||||||
// TODO
|
// TODO
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -415,13 +414,13 @@ bool wxMask::Create(const wxBitmap& WXUNUSED(bitmap), int WXUNUSED(paletteIndex)
|
|||||||
// the transparent area
|
// the transparent area
|
||||||
bool wxMask::Create(const wxBitmap& WXUNUSED(bitmap), const wxColour& WXUNUSED(colour))
|
bool wxMask::Create(const wxBitmap& WXUNUSED(bitmap), const wxColour& WXUNUSED(colour))
|
||||||
{
|
{
|
||||||
// TODO
|
// TODO
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* wxBitmapHandler
|
* wxBitmapHandler
|
||||||
*/
|
*/
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxBitmapHandler, wxObject)
|
IMPLEMENT_DYNAMIC_CLASS(wxBitmapHandler, wxObject)
|
||||||
|
|
||||||
@@ -444,8 +443,8 @@ bool wxBitmapHandler::SaveFile(wxBitmap *WXUNUSED(bitmap), const wxString& WXUNU
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Standard handlers
|
* Standard handlers
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class WXDLLEXPORT wxXBMFileHandler: public wxBitmapHandler
|
class WXDLLEXPORT wxXBMFileHandler: public wxBitmapHandler
|
||||||
{
|
{
|
||||||
@@ -653,7 +652,7 @@ bool wxXPMFileHandler::LoadFile( wxBitmap *bitmap, const wxString& name, long WX
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
// XpmDebugError(errorStatus, name);
|
// XpmDebugError(errorStatus, name);
|
||||||
M_BITMAPHANDLERDATA->m_ok = FALSE;
|
M_BITMAPHANDLERDATA->m_ok = FALSE;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@@ -764,7 +763,7 @@ bool wxXPMDataHandler::Create( wxBitmap *bitmap, void *data, long WXUNUSED(flags
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// XpmDebugError(ErrorStatus, NULL);
|
// XpmDebugError(ErrorStatus, NULL);
|
||||||
M_BITMAPHANDLERDATA->m_ok = FALSE;
|
M_BITMAPHANDLERDATA->m_ok = FALSE;
|
||||||
}
|
}
|
||||||
return M_BITMAPHANDLERDATA->m_ok ;
|
return M_BITMAPHANDLERDATA->m_ok ;
|
||||||
@@ -807,7 +806,7 @@ WXPixmap wxBitmap::GetLabelPixmap (WXWidget w)
|
|||||||
Display *dpy = (Display*) M_BITMAPDATA->m_display;
|
Display *dpy = (Display*) M_BITMAPDATA->m_display;
|
||||||
|
|
||||||
#ifdef FOO
|
#ifdef FOO
|
||||||
/*
|
/*
|
||||||
If we do:
|
If we do:
|
||||||
if (labelPixmap) return labelPixmap;
|
if (labelPixmap) return labelPixmap;
|
||||||
things can be wrong, because colors can have been changed.
|
things can be wrong, because colors can have been changed.
|
||||||
@@ -918,29 +917,29 @@ WXPixmap wxBitmap::GetInsensPixmap (WXWidget w)
|
|||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|
||||||
NAME
|
NAME
|
||||||
XCreateInsensitivePixmap - create a grayed-out copy of a pixmap
|
XCreateInsensitivePixmap - create a grayed-out copy of a pixmap
|
||||||
|
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
Pixmap XCreateInsensitivePixmap( Display *display, Pixmap pixmap )
|
Pixmap XCreateInsensitivePixmap( Display *display, Pixmap pixmap )
|
||||||
|
|
||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
This function creates a grayed-out copy of the argument pixmap, suitable
|
This function creates a grayed-out copy of the argument pixmap, suitable
|
||||||
for use as a XmLabel's XmNlabelInsensitivePixmap resource.
|
for use as a XmLabel's XmNlabelInsensitivePixmap resource.
|
||||||
|
|
||||||
RETURN VALUES
|
RETURN VALUES
|
||||||
The return value is the new Pixmap id or zero on error. Errors include
|
The return value is the new Pixmap id or zero on error. Errors include
|
||||||
a NULL display argument or an invalid Pixmap argument.
|
a NULL display argument or an invalid Pixmap argument.
|
||||||
|
|
||||||
ERRORS
|
ERRORS
|
||||||
If one of the XLib functions fail, it will produce a X error. The
|
If one of the XLib functions fail, it will produce a X error. The
|
||||||
default X error handler prints a diagnostic and calls exit().
|
default X error handler prints a diagnostic and calls exit().
|
||||||
|
|
||||||
SEE ALSO
|
SEE ALSO
|
||||||
XCopyArea(3), XCreateBitmapFromData(3), XCreateGC(3), XCreatePixmap(3),
|
XCopyArea(3), XCreateBitmapFromData(3), XCreateGC(3), XCreatePixmap(3),
|
||||||
XFillRectangle(3), exit(2)
|
XFillRectangle(3), exit(2)
|
||||||
|
|
||||||
AUTHOR
|
AUTHOR
|
||||||
John R Veregge - john@puente.jpl.nasa.gov
|
John R Veregge - john@puente.jpl.nasa.gov
|
||||||
Advanced Engineering and Prototyping Group (AEG)
|
Advanced Engineering and Prototyping Group (AEG)
|
||||||
Information Systems Technology Section (395)
|
Information Systems Technology Section (395)
|
||||||
@@ -952,7 +951,7 @@ Pixmap
|
|||||||
XCreateInsensitivePixmap( Display *display, Pixmap pixmap )
|
XCreateInsensitivePixmap( Display *display, Pixmap pixmap )
|
||||||
|
|
||||||
{
|
{
|
||||||
static
|
static
|
||||||
char stipple_data[] =
|
char stipple_data[] =
|
||||||
{
|
{
|
||||||
0x55, 0x55, 0xAA, 0xAA, 0x55, 0x55, 0xAA, 0xAA,
|
0x55, 0x55, 0xAA, 0xAA, 0x55, 0x55, 0xAA, 0xAA,
|
||||||
|
@@ -56,12 +56,12 @@ bool wxBitmapButton::Create(wxWindow *parent, wxWindowID id, const wxBitmap& bit
|
|||||||
m_marginX = 0;
|
m_marginX = 0;
|
||||||
m_marginY = 0;
|
m_marginY = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
int x = pos.x;
|
int x = pos.x;
|
||||||
int y = pos.y;
|
int y = pos.y;
|
||||||
int width = size.x;
|
int width = size.x;
|
||||||
int height = size.y;
|
int height = size.y;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (id == -1)
|
if (id == -1)
|
||||||
m_windowId = NewControlId();
|
m_windowId = NewControlId();
|
||||||
@@ -87,7 +87,7 @@ bool wxBitmapButton::Create(wxWindow *parent, wxWindowID id, const wxBitmap& bit
|
|||||||
#else
|
#else
|
||||||
xmPushButtonWidgetClass, parentWidget,
|
xmPushButtonWidgetClass, parentWidget,
|
||||||
#endif
|
#endif
|
||||||
// XmNdefaultButtonShadowThickness, 1, // See comment for wxButton::SetDefault
|
// XmNdefaultButtonShadowThickness, 1, // See comment for wxButton::SetDefault
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
m_mainWidget = (WXWidget) buttonWidget;
|
m_mainWidget = (WXWidget) buttonWidget;
|
||||||
|
@@ -70,7 +70,7 @@ bool wxButton::Create(wxWindow *parent, wxWindowID id, const wxString& label,
|
|||||||
parentWidget,
|
parentWidget,
|
||||||
XmNfontList, fontList,
|
XmNfontList, fontList,
|
||||||
XmNlabelString, text,
|
XmNlabelString, text,
|
||||||
// XmNdefaultButtonShadowThickness, 1, // See comment for wxButton::SetDefault
|
// XmNdefaultButtonShadowThickness, 1, // See comment for wxButton::SetDefault
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
XmStringFree (text);
|
XmStringFree (text);
|
||||||
@@ -116,7 +116,7 @@ void wxButton::SetDefault()
|
|||||||
}
|
}
|
||||||
} // while
|
} // while
|
||||||
|
|
||||||
// XtVaSetValues((Widget)handle, XmNshowAsDefault, 1, NULL);
|
// XtVaSetValues((Widget)handle, XmNshowAsDefault, 1, NULL);
|
||||||
XtVaSetValues ((Widget) parent->GetMainWidget(), XmNdefaultButton, (Widget) GetMainWidget(), NULL);
|
XtVaSetValues ((Widget) parent->GetMainWidget(), XmNdefaultButton, (Widget) GetMainWidget(), NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -24,7 +24,7 @@
|
|||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
|
||||||
#if !USE_SHARED_LIBRARY
|
#if !USE_SHARED_LIBRARY
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxCheckListBox, wxListBox)
|
IMPLEMENT_DYNAMIC_CLASS(wxCheckListBox, wxListBox)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
@@ -85,7 +85,7 @@ bool wxChoice::Create(wxWindow *parent, wxWindowID id,
|
|||||||
*/
|
*/
|
||||||
m_menuWidget = (WXWidget) XmCreatePulldownMenu ((Widget) m_formWidget, "choiceMenu", NULL, 0);
|
m_menuWidget = (WXWidget) XmCreatePulldownMenu ((Widget) m_formWidget, "choiceMenu", NULL, 0);
|
||||||
|
|
||||||
// int i;
|
// int i;
|
||||||
if (n > 0)
|
if (n > 0)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
@@ -141,7 +141,7 @@ wxChoice::~wxChoice()
|
|||||||
// can cause crashes on some machines. It will
|
// can cause crashes on some machines. It will
|
||||||
// be deleted implicitly by deleting the parent form
|
// be deleted implicitly by deleting the parent form
|
||||||
// anyway.
|
// anyway.
|
||||||
// XtDestroyWidget (menuWidget);
|
// XtDestroyWidget (menuWidget);
|
||||||
if (m_widgetList)
|
if (m_widgetList)
|
||||||
delete[] m_widgetList;
|
delete[] m_widgetList;
|
||||||
|
|
||||||
@@ -423,7 +423,7 @@ void wxChoiceCallback (Widget w, XtPointer clientData, XtPointer WXUNUSED(ptr))
|
|||||||
wxCommandEvent event (wxEVT_COMMAND_CHOICE_SELECTED, item->GetId());
|
wxCommandEvent event (wxEVT_COMMAND_CHOICE_SELECTED, item->GetId());
|
||||||
event.SetEventObject(item);
|
event.SetEventObject(item);
|
||||||
event.m_commandInt = item->FindString (s);
|
event.m_commandInt = item->FindString (s);
|
||||||
// event.m_commandString = s;
|
// event.m_commandString = s;
|
||||||
item->ProcessCommand (event);
|
item->ProcessCommand (event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -20,77 +20,366 @@
|
|||||||
#include "wx/utils.h"
|
#include "wx/utils.h"
|
||||||
#include "wx/metafile.h"
|
#include "wx/metafile.h"
|
||||||
#include "wx/clipbrd.h"
|
#include "wx/clipbrd.h"
|
||||||
|
#include "wx/dataobj.h"
|
||||||
|
|
||||||
|
#include <Xm/Xm.h>
|
||||||
|
#include <Xm/CutPaste.h>
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#if !USE_SHARED_LIBRARY
|
#if !USE_SHARED_LIBRARY
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxClipboard, wxObject)
|
// IMPLEMENT_DYNAMIC_CLASS(wxClipboard, wxObject)
|
||||||
IMPLEMENT_ABSTRACT_CLASS(wxClipboardClient, wxObject)
|
// IMPLEMENT_ABSTRACT_CLASS(wxClipboardClient, wxObject)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static bool gs_clipboardIsOpen = FALSE;
|
||||||
|
|
||||||
bool wxOpenClipboard()
|
bool wxOpenClipboard()
|
||||||
{
|
{
|
||||||
// TODO
|
if (!gs_clipboardIsOpen)
|
||||||
|
{
|
||||||
|
gs_clipboardIsOpen = TRUE;
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
else
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxCloseClipboard()
|
bool wxCloseClipboard()
|
||||||
{
|
{
|
||||||
// TODO
|
if (gs_clipboardIsOpen)
|
||||||
|
{
|
||||||
|
gs_clipboardIsOpen = FALSE;
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
else
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxEmptyClipboard()
|
bool wxEmptyClipboard()
|
||||||
{
|
{
|
||||||
// TODO
|
// No equivalent in Motif
|
||||||
return FALSE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxClipboardOpen()
|
bool wxClipboardOpen()
|
||||||
{
|
{
|
||||||
// TODO
|
return gs_clipboardIsOpen;
|
||||||
return FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxIsClipboardFormatAvailable(int dataFormat)
|
bool wxIsClipboardFormatAvailable(wxDataFormat dataFormat)
|
||||||
{
|
{
|
||||||
// TODO
|
// Only text is supported.
|
||||||
|
if (dataFormat != wxDF_TEXT)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
unsigned long numBytes = 0;
|
||||||
|
long privateId = 0;
|
||||||
|
|
||||||
|
Window window = (Window) 0;
|
||||||
|
if (wxTheApp->GetTopWindow())
|
||||||
|
window = XtWindow( (Widget) wxTheApp->GetTopWindow()->GetTopWidget() );
|
||||||
|
|
||||||
|
int success = XmClipboardRetrieve((Display*) wxGetDisplay(),
|
||||||
|
window, "TEXT", (XtPointer) 0, 0, & numBytes, & privateId) ;
|
||||||
|
|
||||||
|
// Assume only text is supported. If we have anything at all,
|
||||||
|
// or the clipboard is locked so we're not sure, we say we support it.
|
||||||
|
if (success == ClipboardNoData)
|
||||||
|
return FALSE;
|
||||||
|
else
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxSetClipboardData(int dataFormat, wxObject *obj, int width, int height)
|
bool wxSetClipboardData(wxDataFormat dataFormat, wxObject *obj, int width, int height)
|
||||||
{
|
{
|
||||||
// TODO
|
if (dataFormat != wxDF_TEXT)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
char* data = (char*) obj;
|
||||||
|
|
||||||
|
XmString text = XmStringCreateSimple ("CLIPBOARD");
|
||||||
|
Window window = (Window) 0;
|
||||||
|
if (wxTheApp->GetTopWindow())
|
||||||
|
window = XtWindow( (Widget) wxTheApp->GetTopWindow()->GetTopWidget() );
|
||||||
|
|
||||||
|
long itemId = 0;
|
||||||
|
int result = 0;
|
||||||
|
|
||||||
|
while ((result =
|
||||||
|
XmClipboardStartCopy((Display*) wxGetDisplay(),
|
||||||
|
window,
|
||||||
|
text,
|
||||||
|
XtLastTimestampProcessed((Display*) wxGetDisplay()),
|
||||||
|
(Widget) 0,
|
||||||
|
(XmCutPasteProc) 0,
|
||||||
|
& itemId)) != ClipboardSuccess)
|
||||||
|
|
||||||
|
;
|
||||||
|
|
||||||
|
XmStringFree (text);
|
||||||
|
|
||||||
|
long dataId = 0;
|
||||||
|
while ((result =
|
||||||
|
XmClipboardCopy((Display*) wxGetDisplay(),
|
||||||
|
window,
|
||||||
|
itemId,
|
||||||
|
"TEXT",
|
||||||
|
(XtPointer) data,
|
||||||
|
strlen(data) + 1,
|
||||||
|
0,
|
||||||
|
& dataId)) != ClipboardSuccess)
|
||||||
|
|
||||||
|
;
|
||||||
|
|
||||||
|
while (( result =
|
||||||
|
XmClipboardEndCopy((Display*) wxGetDisplay(),
|
||||||
|
window, itemId) ) != ClipboardSuccess)
|
||||||
|
|
||||||
|
;
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxObject *wxGetClipboardData(int dataFormat, long *len)
|
wxObject *wxGetClipboardData(wxDataFormat dataFormat, long *len)
|
||||||
{
|
{
|
||||||
// TODO
|
if (dataFormat != wxDF_TEXT)
|
||||||
|
return (wxObject*) NULL;
|
||||||
|
|
||||||
|
bool done = FALSE;
|
||||||
|
long id = 0;
|
||||||
|
unsigned long numBytes = 0;
|
||||||
|
int result = 0;
|
||||||
|
Window window = (Window) 0;
|
||||||
|
if (wxTheApp->GetTopWindow())
|
||||||
|
window = XtWindow( (Widget) wxTheApp->GetTopWindow()->GetTopWidget() );
|
||||||
|
|
||||||
|
int currentDataSize = 256;
|
||||||
|
char* data = new char[currentDataSize];
|
||||||
|
|
||||||
|
while (!done)
|
||||||
|
{
|
||||||
|
if (result == ClipboardTruncate)
|
||||||
|
{
|
||||||
|
delete[] data;
|
||||||
|
currentDataSize = 2*currentDataSize;
|
||||||
|
data = new char[currentDataSize];
|
||||||
|
}
|
||||||
|
result = XmClipboardRetrieve((Display*) wxGetDisplay(),
|
||||||
|
window,
|
||||||
|
"TEXT",
|
||||||
|
(XtPointer) data,
|
||||||
|
currentDataSize,
|
||||||
|
&numBytes,
|
||||||
|
&id);
|
||||||
|
|
||||||
|
switch (result)
|
||||||
|
{
|
||||||
|
case ClipboardSuccess:
|
||||||
|
{
|
||||||
|
if (len)
|
||||||
|
*len = strlen(data) + 1;
|
||||||
|
return (wxObject*) data;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case ClipboardTruncate:
|
||||||
|
case ClipboardLocked:
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
case ClipboardNoData:
|
||||||
|
{
|
||||||
|
return (wxObject*) NULL;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
int wxEnumClipboardFormats(int dataFormat)
|
wxDataFormat wxEnumClipboardFormats(wxDataFormat dataFormat)
|
||||||
{
|
{
|
||||||
// TODO
|
// Only wxDF_TEXT supported
|
||||||
return 0;
|
if (dataFormat == (wxDataFormat) 0)
|
||||||
|
return wxDF_TEXT;
|
||||||
|
else
|
||||||
|
return (wxDataFormat) 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int wxRegisterClipboardFormat(char *formatName)
|
wxDataFormat wxRegisterClipboardFormat(char *formatName)
|
||||||
{
|
{
|
||||||
// TODO
|
// Not supported
|
||||||
return 0;
|
return (wxDataFormat) 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxGetClipboardFormatName(int dataFormat, char *formatName, int maxCount)
|
bool wxGetClipboardFormatName(wxDataFormat dataFormat, char *formatName, int maxCount)
|
||||||
{
|
{
|
||||||
// TODO
|
// Only wxDF_TEXT supported
|
||||||
|
if (dataFormat == wxDF_TEXT)
|
||||||
|
{
|
||||||
|
strcpy(formatName, "TEXT");
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
else
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// wxClipboard
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
IMPLEMENT_DYNAMIC_CLASS(wxClipboard,wxObject)
|
||||||
|
|
||||||
|
wxClipboard* wxTheClipboard = (wxClipboard*) NULL;
|
||||||
|
|
||||||
|
wxClipboard::wxClipboard()
|
||||||
|
{
|
||||||
|
m_open = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
wxClipboard::~wxClipboard()
|
||||||
|
{
|
||||||
|
Clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxClipboard::Clear()
|
||||||
|
{
|
||||||
|
wxNode* node = m_data.First();
|
||||||
|
while (node)
|
||||||
|
{
|
||||||
|
wxDataObject* data = (wxDataObject*) node->Data();
|
||||||
|
delete data;
|
||||||
|
node = node->Next();
|
||||||
|
}
|
||||||
|
m_data.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxClipboard::Open()
|
||||||
|
{
|
||||||
|
wxCHECK_MSG( !m_open, FALSE, "clipboard already open" );
|
||||||
|
|
||||||
|
m_open = TRUE;
|
||||||
|
|
||||||
|
return wxOpenClipboard();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxClipboard::SetData( wxDataObject *data )
|
||||||
|
{
|
||||||
|
wxCHECK_MSG( data, FALSE, "data is invalid" );
|
||||||
|
wxCHECK_MSG( m_open, FALSE, "clipboard not open" );
|
||||||
|
|
||||||
|
switch (data->GetFormat())
|
||||||
|
{
|
||||||
|
case wxDF_TEXT:
|
||||||
|
case wxDF_OEMTEXT:
|
||||||
|
{
|
||||||
|
wxTextDataObject* textDataObject = (wxTextDataObject*) data;
|
||||||
|
wxString str(textDataObject->GetText());
|
||||||
|
return wxSetClipboardData(data->GetFormat(), (wxObject*) (const char*) str);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case wxDF_BITMAP:
|
||||||
|
case wxDF_DIB:
|
||||||
|
{
|
||||||
|
wxBitmapDataObject* bitmapDataObject = (wxBitmapDataObject*) data;
|
||||||
|
wxBitmap bitmap(bitmapDataObject->GetBitmap());
|
||||||
|
return wxSetClipboardData(data->GetFormat(), & bitmap);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxClipboard::Close()
|
||||||
|
{
|
||||||
|
wxCHECK_RET( m_open, "clipboard not open" );
|
||||||
|
|
||||||
|
m_open = FALSE;
|
||||||
|
wxCloseClipboard();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxClipboard::IsSupportedFormat( wxDataFormat format, const wxString& WXUNUSED(id) )
|
||||||
|
{
|
||||||
|
return wxIsClipboardFormatAvailable(format);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxClipboard::GetData( wxDataObject *data )
|
||||||
|
{
|
||||||
|
wxCHECK_MSG( m_open, FALSE, "clipboard not open" );
|
||||||
|
|
||||||
|
switch (data->GetFormat())
|
||||||
|
{
|
||||||
|
case wxDF_TEXT:
|
||||||
|
case wxDF_OEMTEXT:
|
||||||
|
{
|
||||||
|
wxTextDataObject* textDataObject = (wxTextDataObject*) data;
|
||||||
|
char* s = (char*) wxGetClipboardData(data->GetFormat());
|
||||||
|
if (s)
|
||||||
|
{
|
||||||
|
textDataObject->SetText(s);
|
||||||
|
delete[] s;
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return FALSE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case wxDF_BITMAP:
|
||||||
|
case wxDF_DIB:
|
||||||
|
{
|
||||||
|
wxBitmapDataObject* bitmapDataObject = (wxBitmapDataObject*) data;
|
||||||
|
wxBitmap* bitmap = (wxBitmap*) wxGetClipboardData(data->GetFormat());
|
||||||
|
if (bitmap)
|
||||||
|
{
|
||||||
|
bitmapDataObject->SetBitmap(* bitmap);
|
||||||
|
delete bitmap;
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return FALSE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// wxClipboardModule
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
IMPLEMENT_DYNAMIC_CLASS(wxClipboardModule,wxModule)
|
||||||
|
|
||||||
|
bool wxClipboardModule::OnInit()
|
||||||
|
{
|
||||||
|
wxTheClipboard = new wxClipboard();
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxClipboardModule::OnExit()
|
||||||
|
{
|
||||||
|
if (wxTheClipboard) delete wxTheClipboard;
|
||||||
|
wxTheClipboard = (wxClipboard*) NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Generalized clipboard implementation by Matthew Flatt
|
* Old clipboard implementation by Matthew Flatt
|
||||||
*/
|
*/
|
||||||
|
|
||||||
wxClipboard *wxTheClipboard = NULL;
|
wxClipboard *wxTheClipboard = NULL;
|
||||||
|
|
||||||
@@ -234,4 +523,5 @@ char *wxClipboard::GetClipboardData(char *format, long *length, long time)
|
|||||||
return receivedString;
|
return receivedString;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
@@ -146,21 +146,21 @@ But in many cases, that is still better than always using black.
|
|||||||
Chris Breeze <chris@hel.co.uk>
|
Chris Breeze <chris@hel.co.uk>
|
||||||
Improvements:
|
Improvements:
|
||||||
1) More efficient calculation of RGB distance of colour cell from
|
1) More efficient calculation of RGB distance of colour cell from
|
||||||
the desired colour. There is no need to take the sqrt of 'dist', and
|
the desired colour. There is no need to take the sqrt of 'dist', and
|
||||||
since we are only interested in the top 8-bits of R, G and B we
|
since we are only interested in the top 8-bits of R, G and B we
|
||||||
can perform integer arithmetic.
|
can perform integer arithmetic.
|
||||||
2) Attempt to allocate a read-only colour when a close match is found.
|
2) Attempt to allocate a read-only colour when a close match is found.
|
||||||
A read-only colour will not change.
|
A read-only colour will not change.
|
||||||
3) Fall back to the closest match if no read-only colours are available.
|
3) Fall back to the closest match if no read-only colours are available.
|
||||||
|
|
||||||
Possible further improvements:
|
Possible further improvements:
|
||||||
1) Scan the lookup table and sort the colour cells in order of
|
1) Scan the lookup table and sort the colour cells in order of
|
||||||
increasing
|
increasing
|
||||||
distance from the desired colour. Then attempt to allocate a
|
distance from the desired colour. Then attempt to allocate a
|
||||||
read-only
|
read-only
|
||||||
colour starting from the nearest match.
|
colour starting from the nearest match.
|
||||||
2) Linear RGB distance is not a particularly good method of colour
|
2) Linear RGB distance is not a particularly good method of colour
|
||||||
matching
|
matching
|
||||||
(though it is quick). Converting the colour to HLS and then comparing
|
(though it is quick). Converting the colour to HLS and then comparing
|
||||||
may give better matching.
|
may give better matching.
|
||||||
-------------------------------------------*/
|
-------------------------------------------*/
|
||||||
|
@@ -72,7 +72,7 @@ wxDC::wxDC(void)
|
|||||||
m_minY = m_minY = 100000;
|
m_minY = m_minY = 100000;
|
||||||
|
|
||||||
m_logicalFunction = wxCOPY;
|
m_logicalFunction = wxCOPY;
|
||||||
// m_textAlignment = wxALIGN_TOP_LEFT;
|
// m_textAlignment = wxALIGN_TOP_LEFT;
|
||||||
m_backgroundMode = wxTRANSPARENT;
|
m_backgroundMode = wxTRANSPARENT;
|
||||||
|
|
||||||
m_textForegroundColour = *wxBLACK;
|
m_textForegroundColour = *wxBLACK;
|
||||||
@@ -84,7 +84,7 @@ wxDC::wxDC(void)
|
|||||||
|
|
||||||
m_isInteractive = FALSE;
|
m_isInteractive = FALSE;
|
||||||
|
|
||||||
// m_palette = wxAPP_COLOURMAP;
|
// m_palette = wxAPP_COLOURMAP;
|
||||||
};
|
};
|
||||||
|
|
||||||
wxDC::~wxDC(void)
|
wxDC::~wxDC(void)
|
||||||
@@ -103,7 +103,7 @@ void wxDC::DrawBitmap( const wxBitmap& bitmap, long x, long y, bool useMask )
|
|||||||
wxMemoryDC memDC;
|
wxMemoryDC memDC;
|
||||||
memDC.SelectObject(bitmap);
|
memDC.SelectObject(bitmap);
|
||||||
|
|
||||||
/* Not sure if we need this. The mask should leave the
|
/* Not sure if we need this. The mask should leave the
|
||||||
* masked areas as per the original background of this DC.
|
* masked areas as per the original background of this DC.
|
||||||
if (useMask)
|
if (useMask)
|
||||||
{
|
{
|
||||||
@@ -112,7 +112,7 @@ void wxDC::DrawBitmap( const wxBitmap& bitmap, long x, long y, bool useMask )
|
|||||||
memDC.SetBackground(* GetBackground());
|
memDC.SetBackground(* GetBackground());
|
||||||
memDC.Clear();
|
memDC.Clear();
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Blit(x, y, bitmap.GetWidth(), bitmap.GetHeight(), & memDC, 0, 0, wxCOPY, useMask);
|
Blit(x, y, bitmap.GetWidth(), bitmap.GetHeight(), & memDC, 0, 0, wxCOPY, useMask);
|
||||||
|
|
||||||
@@ -312,8 +312,8 @@ void wxDC::SetDeviceOrigin( long x, long y )
|
|||||||
|
|
||||||
void wxDC::GetDeviceOrigin( long *x, long *y )
|
void wxDC::GetDeviceOrigin( long *x, long *y )
|
||||||
{
|
{
|
||||||
// if (x) *x = m_externalDeviceOriginX;
|
// if (x) *x = m_externalDeviceOriginX;
|
||||||
// if (y) *y = m_externalDeviceOriginY;
|
// if (y) *y = m_externalDeviceOriginY;
|
||||||
if (x) *x = m_deviceOriginX;
|
if (x) *x = m_deviceOriginX;
|
||||||
if (y) *y = m_deviceOriginY;
|
if (y) *y = m_deviceOriginY;
|
||||||
};
|
};
|
||||||
|
@@ -10,7 +10,7 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
/*
|
/*
|
||||||
About pens, brushes, and the autoSetting flag:
|
About pens, brushes, and the autoSetting flag:
|
||||||
|
|
||||||
Under X, pens and brushes control some of the same X drawing
|
Under X, pens and brushes control some of the same X drawing
|
||||||
parameters. Therefore, it is impossible to independently maintain
|
parameters. Therefore, it is impossible to independently maintain
|
||||||
@@ -59,7 +59,7 @@ static Pixmap bdiag, cdiag, fdiag, cross, horiz, verti;
|
|||||||
#define RAD2DEG 57.2957795131
|
#define RAD2DEG 57.2957795131
|
||||||
|
|
||||||
// Fudge factor. Obsolete?
|
// Fudge factor. Obsolete?
|
||||||
// No. Robert Roebling
|
// No. Robert Roebling
|
||||||
#define WX_GC_CF 1
|
#define WX_GC_CF 1
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@@ -84,7 +84,7 @@ wxWindowDC::wxWindowDC(void)
|
|||||||
m_currentPenDash = (char*) NULL;
|
m_currentPenDash = (char*) NULL;
|
||||||
m_currentStyle = -1;
|
m_currentStyle = -1;
|
||||||
m_currentFill = -1;
|
m_currentFill = -1;
|
||||||
// m_currentBkMode = wxTRANSPARENT;
|
// m_currentBkMode = wxTRANSPARENT;
|
||||||
m_colour = wxColourDisplay();
|
m_colour = wxColourDisplay();
|
||||||
m_display = (WXDisplay*) NULL;
|
m_display = (WXDisplay*) NULL;
|
||||||
m_currentRegion = (WXRegion) 0;
|
m_currentRegion = (WXRegion) 0;
|
||||||
@@ -108,7 +108,7 @@ wxWindowDC::wxWindowDC( wxWindow *window )
|
|||||||
m_currentPenDash = (char*) NULL;
|
m_currentPenDash = (char*) NULL;
|
||||||
m_currentStyle = -1;
|
m_currentStyle = -1;
|
||||||
m_currentFill = -1;
|
m_currentFill = -1;
|
||||||
// m_currentBkMode = wxTRANSPARENT;
|
// m_currentBkMode = wxTRANSPARENT;
|
||||||
m_colour = wxColourDisplay();
|
m_colour = wxColourDisplay();
|
||||||
m_currentRegion = (WXRegion) 0;
|
m_currentRegion = (WXRegion) 0;
|
||||||
m_userRegion = (WXRegion) 0;
|
m_userRegion = (WXRegion) 0;
|
||||||
@@ -245,7 +245,7 @@ void wxWindowDC::DrawArc( long x1, long y1, long x2, long y2, long xc, long yc )
|
|||||||
{
|
{
|
||||||
if (!Ok()) return;
|
if (!Ok()) return;
|
||||||
|
|
||||||
// FreeGetPixelCache();
|
// FreeGetPixelCache();
|
||||||
|
|
||||||
int xx1 = XLOG2DEV (x1);
|
int xx1 = XLOG2DEV (x1);
|
||||||
int yy1 = YLOG2DEV (y1);
|
int yy1 = YLOG2DEV (y1);
|
||||||
@@ -373,7 +373,7 @@ void wxWindowDC::DrawPoint( long x, long y )
|
|||||||
{
|
{
|
||||||
if (!Ok()) return;
|
if (!Ok()) return;
|
||||||
|
|
||||||
// FreeGetPixelCache();
|
// FreeGetPixelCache();
|
||||||
|
|
||||||
if (m_pen.Ok() && m_autoSetting)
|
if (m_pen.Ok() && m_autoSetting)
|
||||||
SetPen (m_pen);
|
SetPen (m_pen);
|
||||||
@@ -389,7 +389,7 @@ void wxWindowDC::DrawLines( int n, wxPoint points[], long xoffset, long yoffset
|
|||||||
{
|
{
|
||||||
if (!Ok()) return;
|
if (!Ok()) return;
|
||||||
|
|
||||||
// FreeGetPixelCache();
|
// FreeGetPixelCache();
|
||||||
|
|
||||||
if (m_pen.Ok() && m_pen.GetStyle () != wxTRANSPARENT)
|
if (m_pen.Ok() && m_pen.GetStyle () != wxTRANSPARENT)
|
||||||
{
|
{
|
||||||
@@ -441,7 +441,7 @@ void wxWindowDC::DrawLines( wxList *list, long xoffset, long yoffset )
|
|||||||
void wxWindowDC::DrawPolygon( int n, wxPoint points[],
|
void wxWindowDC::DrawPolygon( int n, wxPoint points[],
|
||||||
long xoffset, long yoffset, int fillStyle )
|
long xoffset, long yoffset, int fillStyle )
|
||||||
{
|
{
|
||||||
// FreeGetPixelCache();
|
// FreeGetPixelCache();
|
||||||
|
|
||||||
XPoint *xpoints1 = new XPoint[n + 1];
|
XPoint *xpoints1 = new XPoint[n + 1];
|
||||||
XPoint *xpoints2 = new XPoint[n + 1];
|
XPoint *xpoints2 = new XPoint[n + 1];
|
||||||
@@ -512,7 +512,7 @@ void wxWindowDC::DrawRectangle( long x, long y, long width, long height )
|
|||||||
{
|
{
|
||||||
if (!Ok()) return;
|
if (!Ok()) return;
|
||||||
|
|
||||||
// FreeGetPixelCache();
|
// FreeGetPixelCache();
|
||||||
|
|
||||||
int xd, yd, wfd, hfd, wd, hd;
|
int xd, yd, wfd, hfd, wd, hd;
|
||||||
|
|
||||||
@@ -557,7 +557,7 @@ void wxWindowDC::DrawRoundedRectangle( long x, long y, long width, long height,
|
|||||||
{
|
{
|
||||||
if (!Ok()) return;
|
if (!Ok()) return;
|
||||||
|
|
||||||
// FreeGetPixelCache();
|
// FreeGetPixelCache();
|
||||||
|
|
||||||
// If radius is negative, it's a proportion of the smaller dimension.
|
// If radius is negative, it's a proportion of the smaller dimension.
|
||||||
|
|
||||||
@@ -622,12 +622,12 @@ void wxWindowDC::DrawRoundedRectangle( long x, long y, long width, long height,
|
|||||||
rw_d, rh_d, 90 * 64, 90 * 64);
|
rw_d, rh_d, 90 * 64, 90 * 64);
|
||||||
// Top-right
|
// Top-right
|
||||||
XFillArc ((Display*) m_display, (Pixmap) m_pixmap, (GC) m_gc, xd + wd - rw_d, yd,
|
XFillArc ((Display*) m_display, (Pixmap) m_pixmap, (GC) m_gc, xd + wd - rw_d, yd,
|
||||||
// rw_d, rh_d, 0, 90 * 64);
|
// rw_d, rh_d, 0, 90 * 64);
|
||||||
rw_d, rh_d, 0, 91 * 64);
|
rw_d, rh_d, 0, 91 * 64);
|
||||||
// Bottom-right
|
// Bottom-right
|
||||||
XFillArc ((Display*) m_display, (Pixmap) m_pixmap, (GC) m_gc, xd + wd - rw_d,
|
XFillArc ((Display*) m_display, (Pixmap) m_pixmap, (GC) m_gc, xd + wd - rw_d,
|
||||||
yd + hd - rh_d,
|
yd + hd - rh_d,
|
||||||
// rw_d, rh_d, 270 * 64, 90 * 64);
|
// rw_d, rh_d, 270 * 64, 90 * 64);
|
||||||
rw_d, rh_d, 269 * 64, 92 * 64);
|
rw_d, rh_d, 269 * 64, 92 * 64);
|
||||||
// Bottom-left
|
// Bottom-left
|
||||||
XFillArc ((Display*) m_display, (Pixmap) m_pixmap, (GC) m_gc, xd, yd + hd - rh_d,
|
XFillArc ((Display*) m_display, (Pixmap) m_pixmap, (GC) m_gc, xd, yd + hd - rh_d,
|
||||||
@@ -644,12 +644,12 @@ void wxWindowDC::DrawRoundedRectangle( long x, long y, long width, long height,
|
|||||||
xd2, yd2, rw_d2, rh_d2, 90 * 64, 90 * 64);
|
xd2, yd2, rw_d2, rh_d2, 90 * 64, 90 * 64);
|
||||||
XFillArc ((Display*) m_display, (Pixmap) m_window->GetBackingPixmap(),(GC) m_gcBacking,
|
XFillArc ((Display*) m_display, (Pixmap) m_window->GetBackingPixmap(),(GC) m_gcBacking,
|
||||||
xd2 + wd2 - rw_d2, yd2,
|
xd2 + wd2 - rw_d2, yd2,
|
||||||
// rw_d2, rh_d2, 0, 90 * 64);
|
// rw_d2, rh_d2, 0, 90 * 64);
|
||||||
rw_d2, rh_d2, 0, 91 * 64);
|
rw_d2, rh_d2, 0, 91 * 64);
|
||||||
XFillArc ((Display*) m_display, (Pixmap) m_window->GetBackingPixmap(),(GC) m_gcBacking,
|
XFillArc ((Display*) m_display, (Pixmap) m_window->GetBackingPixmap(),(GC) m_gcBacking,
|
||||||
xd2 + wd2 - rw_d2,
|
xd2 + wd2 - rw_d2,
|
||||||
yd2 + hd2 - rh_d2,
|
yd2 + hd2 - rh_d2,
|
||||||
// rw_d2, rh_d2, 270 * 64, 90 * 64);
|
// rw_d2, rh_d2, 270 * 64, 90 * 64);
|
||||||
rw_d2, rh_d2, 269 * 64, 92 * 64);
|
rw_d2, rh_d2, 269 * 64, 92 * 64);
|
||||||
XFillArc ((Display*) m_display, (Pixmap) m_window->GetBackingPixmap(),(GC) m_gcBacking,
|
XFillArc ((Display*) m_display, (Pixmap) m_window->GetBackingPixmap(),(GC) m_gcBacking,
|
||||||
xd2, yd2 + hd2 - rh_d2,
|
xd2, yd2 + hd2 - rh_d2,
|
||||||
@@ -672,7 +672,7 @@ void wxWindowDC::DrawRoundedRectangle( long x, long y, long width, long height,
|
|||||||
XDrawArc ((Display*) m_display, (Pixmap) m_pixmap, (GC) m_gc, xd, yd,
|
XDrawArc ((Display*) m_display, (Pixmap) m_pixmap, (GC) m_gc, xd, yd,
|
||||||
rw_d, rh_d, 90 * 64, 90 * 64);
|
rw_d, rh_d, 90 * 64, 90 * 64);
|
||||||
XDrawArc ((Display*) m_display, (Pixmap) m_pixmap, (GC) m_gc, xd + wd - rw_d, yd,
|
XDrawArc ((Display*) m_display, (Pixmap) m_pixmap, (GC) m_gc, xd + wd - rw_d, yd,
|
||||||
// rw_d, rh_d, 0, 90 * 64);
|
// rw_d, rh_d, 0, 90 * 64);
|
||||||
rw_d, rh_d, 0, 91 * 64);
|
rw_d, rh_d, 0, 91 * 64);
|
||||||
XDrawArc ((Display*) m_display, (Pixmap) m_pixmap, (GC) m_gc, xd + wd - rw_d,
|
XDrawArc ((Display*) m_display, (Pixmap) m_pixmap, (GC) m_gc, xd + wd - rw_d,
|
||||||
yd + hd - rh_d,
|
yd + hd - rh_d,
|
||||||
@@ -700,7 +700,7 @@ void wxWindowDC::DrawRoundedRectangle( long x, long y, long width, long height,
|
|||||||
rw_d2, rh_d2, 90 * 64, 90 * 64);
|
rw_d2, rh_d2, 90 * 64, 90 * 64);
|
||||||
XDrawArc ((Display*) m_display, (Pixmap) m_window->GetBackingPixmap(),(GC) m_gcBacking,
|
XDrawArc ((Display*) m_display, (Pixmap) m_window->GetBackingPixmap(),(GC) m_gcBacking,
|
||||||
xd2 + wd2 - rw_d2, yd2,
|
xd2 + wd2 - rw_d2, yd2,
|
||||||
// rw_d2, rh_d2, 0, 90 * 64);
|
// rw_d2, rh_d2, 0, 90 * 64);
|
||||||
rw_d2, rh_d2, 0, 91 * 64);
|
rw_d2, rh_d2, 0, 91 * 64);
|
||||||
XDrawArc ((Display*) m_display, (Pixmap) m_window->GetBackingPixmap(),(GC) m_gcBacking,
|
XDrawArc ((Display*) m_display, (Pixmap) m_window->GetBackingPixmap(),(GC) m_gcBacking,
|
||||||
xd2 + wd2 - rw_d2,
|
xd2 + wd2 - rw_d2,
|
||||||
@@ -734,7 +734,7 @@ void wxWindowDC::DrawEllipse( long x, long y, long width, long height )
|
|||||||
width = - width ;
|
width = - width ;
|
||||||
}
|
}
|
||||||
|
|
||||||
// FreeGetPixelCache();
|
// FreeGetPixelCache();
|
||||||
|
|
||||||
static const int angle = 23040;
|
static const int angle = 23040;
|
||||||
|
|
||||||
@@ -778,8 +778,8 @@ bool wxWindowDC::CanDrawBitmap(void) const
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* Used when copying between drawables on different (Display*) m_displays.
|
/* Used when copying between drawables on different (Display*) m_displays.
|
||||||
Not very fast, but better than giving up.
|
Not very fast, but better than giving up.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static void XCopyRemote(Display *src_display, Display *dest_display,
|
static void XCopyRemote(Display *src_display, Display *dest_display,
|
||||||
Drawable src, Drawable dest,
|
Drawable src, Drawable dest,
|
||||||
@@ -838,7 +838,7 @@ static void XCopyRemote(Display *src_display, Display *dest_display,
|
|||||||
all_cache = TRUE;
|
all_cache = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
install:
|
install:
|
||||||
XPutPixel(destimage, i, j, pixel);
|
XPutPixel(destimage, i, j, pixel);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -860,7 +860,7 @@ void wxWindowDC::DrawIcon( const wxIcon &icon, long x, long y)
|
|||||||
DrawBitmap(icon, x, y, TRUE);
|
DrawBitmap(icon, x, y, TRUE);
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
// FreeGetPixelCache();
|
// FreeGetPixelCache();
|
||||||
|
|
||||||
// Be sure that foreground pixels (1) of
|
// Be sure that foreground pixels (1) of
|
||||||
// the Icon will be painted with pen colour. [m_pen.SetColour()]
|
// the Icon will be painted with pen colour. [m_pen.SetColour()]
|
||||||
@@ -926,7 +926,7 @@ bool wxWindowDC::Blit( long xdest, long ydest, long width, long height,
|
|||||||
|
|
||||||
wxWindowDC* sourceDC = (wxWindowDC*) source;
|
wxWindowDC* sourceDC = (wxWindowDC*) source;
|
||||||
|
|
||||||
// FreeGetPixelCache();
|
// FreeGetPixelCache();
|
||||||
|
|
||||||
// Be sure that foreground pixels (1) of
|
// Be sure that foreground pixels (1) of
|
||||||
// the Icon will be painted with pen colour. [m_pen.SetColour()]
|
// the Icon will be painted with pen colour. [m_pen.SetColour()]
|
||||||
@@ -986,7 +986,7 @@ bool wxWindowDC::Blit( long xdest, long ydest, long width, long height,
|
|||||||
{
|
{
|
||||||
if (m_window && m_window->GetBackingPixmap())
|
if (m_window && m_window->GetBackingPixmap())
|
||||||
{
|
{
|
||||||
// +++ MARKUS (mho@comnets.rwth-aachen): error on blitting bitmaps with depth 1
|
// +++ MARKUS (mho@comnets.rwth-aachen): error on blitting bitmaps with depth 1
|
||||||
if (source->IsKindOf(CLASSINFO(wxMemoryDC)) && ((wxMemoryDC*) source)->GetBitmap().GetDepth() == 1)
|
if (source->IsKindOf(CLASSINFO(wxMemoryDC)) && ((wxMemoryDC*) source)->GetBitmap().GetDepth() == 1)
|
||||||
{
|
{
|
||||||
XCopyPlane ((Display*) m_display, (Pixmap) sourceDC->m_pixmap, (Pixmap) m_window->GetBackingPixmap(),(GC) m_gcBacking,
|
XCopyPlane ((Display*) m_display, (Pixmap) sourceDC->m_pixmap, (Pixmap) m_window->GetBackingPixmap(),(GC) m_gcBacking,
|
||||||
@@ -1293,7 +1293,7 @@ long wxWindowDC::GetCharHeight(void)
|
|||||||
XCharStruct overall;
|
XCharStruct overall;
|
||||||
XTextExtents ((XFontStruct*) pFontStruct, "x", 1, &direction, &ascent,
|
XTextExtents ((XFontStruct*) pFontStruct, "x", 1, &direction, &ascent,
|
||||||
&descent, &overall);
|
&descent, &overall);
|
||||||
// return XDEV2LOGREL(overall.ascent + overall.descent);
|
// return XDEV2LOGREL(overall.ascent + overall.descent);
|
||||||
return XDEV2LOGREL(ascent + descent);
|
return XDEV2LOGREL(ascent + descent);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -2026,7 +2026,7 @@ void wxWindowDC:: SetDCClipping ()
|
|||||||
XIntersectRegion ((Region) m_userRegion, (Region) m_userRegion, (Region) m_currentRegion);
|
XIntersectRegion ((Region) m_userRegion, (Region) m_userRegion, (Region) m_currentRegion);
|
||||||
else if (m_window && m_window->GetUpdateRegion().Ok())
|
else if (m_window && m_window->GetUpdateRegion().Ok())
|
||||||
XIntersectRegion ((Region) m_window->GetUpdateRegion().GetXRegion(), (Region) m_window->GetUpdateRegion().GetXRegion(),
|
XIntersectRegion ((Region) m_window->GetUpdateRegion().GetXRegion(), (Region) m_window->GetUpdateRegion().GetXRegion(),
|
||||||
(Region) m_currentRegion);
|
(Region) m_currentRegion);
|
||||||
|
|
||||||
if (m_currentRegion)
|
if (m_currentRegion)
|
||||||
{
|
{
|
||||||
@@ -2278,8 +2278,8 @@ void wxWindowDC::DrawSpline( wxList *points )
|
|||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* wxPaintDC
|
* wxPaintDC
|
||||||
*/
|
*/
|
||||||
|
|
||||||
wxPaintDC::wxPaintDC(wxWindow* win): wxWindowDC(win)
|
wxPaintDC::wxPaintDC(wxWindow* win): wxWindowDC(win)
|
||||||
{
|
{
|
||||||
|
@@ -67,12 +67,12 @@ extern wxList wxPendingDelete;
|
|||||||
IMPLEMENT_DYNAMIC_CLASS(wxDialog, wxPanel)
|
IMPLEMENT_DYNAMIC_CLASS(wxDialog, wxPanel)
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(wxDialog, wxPanel)
|
BEGIN_EVENT_TABLE(wxDialog, wxPanel)
|
||||||
EVT_BUTTON(wxID_OK, wxDialog::OnOK)
|
EVT_BUTTON(wxID_OK, wxDialog::OnOK)
|
||||||
EVT_BUTTON(wxID_APPLY, wxDialog::OnApply)
|
EVT_BUTTON(wxID_APPLY, wxDialog::OnApply)
|
||||||
EVT_BUTTON(wxID_CANCEL, wxDialog::OnCancel)
|
EVT_BUTTON(wxID_CANCEL, wxDialog::OnCancel)
|
||||||
EVT_CHAR_HOOK(wxDialog::OnCharHook)
|
EVT_CHAR_HOOK(wxDialog::OnCharHook)
|
||||||
EVT_SYS_COLOUR_CHANGED(wxDialog::OnSysColourChanged)
|
EVT_SYS_COLOUR_CHANGED(wxDialog::OnSysColourChanged)
|
||||||
EVT_CLOSE(wxDialog::OnCloseWindow)
|
EVT_CLOSE(wxDialog::OnCloseWindow)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -328,14 +328,14 @@ void wxDialog::Iconize(bool WXUNUSED(iconize))
|
|||||||
{
|
{
|
||||||
// Can't iconize a dialog in Motif, apparently
|
// Can't iconize a dialog in Motif, apparently
|
||||||
// TODO: try using the parent of m_mainShell.
|
// TODO: try using the parent of m_mainShell.
|
||||||
// XtVaSetValues((Widget) m_mainWidget, XmNiconic, iconize, NULL);
|
// XtVaSetValues((Widget) m_mainWidget, XmNiconic, iconize, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxDialog::IsIconized() const
|
bool wxDialog::IsIconized() const
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
Boolean iconic;
|
Boolean iconic;
|
||||||
XtVaGetValues((Widget) m_mainWidget, XmNiconic, &iconic, NULL);
|
XtVaGetValues((Widget) m_mainWidget, XmNiconic, &iconic, NULL);
|
||||||
|
|
||||||
return iconic;
|
return iconic;
|
||||||
*/
|
*/
|
||||||
@@ -486,7 +486,7 @@ int wxDialog::ShowModal()
|
|||||||
// Loop until we signal that the dialog should be closed
|
// Loop until we signal that the dialog should be closed
|
||||||
while ((wxModalShowingStack.Number() > 0) && ((int)(wxModalShowingStack.First()->Data()) != 0))
|
while ((wxModalShowingStack.Number() > 0) && ((int)(wxModalShowingStack.First()->Data()) != 0))
|
||||||
{
|
{
|
||||||
// XtAppProcessEvent((XtAppContext) wxTheApp->GetAppContext(), XtIMAll);
|
// XtAppProcessEvent((XtAppContext) wxTheApp->GetAppContext(), XtIMAll);
|
||||||
|
|
||||||
XtAppNextEvent((XtAppContext) wxTheApp->GetAppContext(), &event);
|
XtAppNextEvent((XtAppContext) wxTheApp->GetAppContext(), &event);
|
||||||
wxTheApp->ProcessXEvent((WXEvent*) &event);
|
wxTheApp->ProcessXEvent((WXEvent*) &event);
|
||||||
@@ -710,10 +710,10 @@ static void wxDialogBoxEventHandler (Widget wid,
|
|||||||
|
|
||||||
static void wxUnmapBulletinBoard(Widget WXUNUSED(dialog), wxDialog *WXUNUSED(client), XtPointer WXUNUSED(call) )
|
static void wxUnmapBulletinBoard(Widget WXUNUSED(dialog), wxDialog *WXUNUSED(client), XtPointer WXUNUSED(call) )
|
||||||
{
|
{
|
||||||
/* This gets called when the dialog is being shown, which
|
/* This gets called when the dialog is being shown, which
|
||||||
* defeats modal showing.
|
* defeats modal showing.
|
||||||
client->m_modalShowing = FALSE ;
|
client->m_modalShowing = FALSE ;
|
||||||
client->m_isShown = FALSE;
|
client->m_isShown = FALSE;
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: dnd.cpp
|
// Name: dnd.cpp
|
||||||
// Purpose: wxDropTarget, wxDropSource, wxDataObject implementation
|
// Purpose: wxDropTarget, wxDropSource classes
|
||||||
// Author: Julian Smart
|
// Author: Julian Smart
|
||||||
// Modified by:
|
// Id: $Id$
|
||||||
// Created: 17/09/98
|
|
||||||
// RCS-ID: $Id$
|
|
||||||
// Copyright: (c) 1998 Julian Smart
|
// Copyright: (c) 1998 Julian Smart
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
@@ -13,10 +11,19 @@
|
|||||||
#pragma implementation "dnd.h"
|
#pragma implementation "dnd.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "wx/setup.h"
|
||||||
|
|
||||||
|
#if wxUSE_DRAG_AND_DROP
|
||||||
|
|
||||||
#include "wx/dnd.h"
|
#include "wx/dnd.h"
|
||||||
#include "wx/window.h"
|
#include "wx/window.h"
|
||||||
#include "wx/app.h"
|
#include "wx/app.h"
|
||||||
#include "wx/gdicmn.h"
|
#include "wx/gdicmn.h"
|
||||||
|
#include "wx/intl.h"
|
||||||
|
#include "wx/utils.h"
|
||||||
|
#include "wx/log.h"
|
||||||
|
|
||||||
|
#include <X11/Xlib.h>
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// global
|
// global
|
||||||
@@ -28,28 +35,28 @@
|
|||||||
|
|
||||||
wxDropTarget::wxDropTarget()
|
wxDropTarget::wxDropTarget()
|
||||||
{
|
{
|
||||||
};
|
}
|
||||||
|
|
||||||
wxDropTarget::~wxDropTarget()
|
wxDropTarget::~wxDropTarget()
|
||||||
{
|
{
|
||||||
};
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// wxTextDropTarget
|
// wxTextDropTarget
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
bool wxTextDropTarget::OnDrop( long x, long y, const void *pData )
|
bool wxTextDropTarget::OnDrop( long x, long y, const void *data, size_t WXUNUSED(size) )
|
||||||
{
|
{
|
||||||
OnDropText( x, y, (const char*)pData );
|
OnDropText( x, y, (const char*)data );
|
||||||
return TRUE;
|
return TRUE;
|
||||||
};
|
}
|
||||||
|
|
||||||
bool wxTextDropTarget::OnDropText( long x, long y, const char *psz )
|
bool wxTextDropTarget::OnDropText( long x, long y, const char *psz )
|
||||||
{
|
{
|
||||||
printf( "Got dropped text: %s.\n", psz );
|
wxLogDebug( "Got dropped text: %s.", psz );
|
||||||
printf( "At x: %d, y: %d.\n", (int)x, (int)y );
|
wxLogDebug( "At x: %d, y: %d.", (int)x, (int)y );
|
||||||
return TRUE;
|
return TRUE;
|
||||||
};
|
}
|
||||||
|
|
||||||
size_t wxTextDropTarget::GetFormatCount() const
|
size_t wxTextDropTarget::GetFormatCount() const
|
||||||
{
|
{
|
||||||
@@ -65,18 +72,41 @@ wxDataFormat wxTextDropTarget::GetFormat(size_t WXUNUSED(n)) const
|
|||||||
// wxFileDropTarget
|
// wxFileDropTarget
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
bool wxFileDropTarget::OnDropFiles( long x, long y, size_t nFiles, const char * const WXUNUSED(aszFiles)[] )
|
bool wxFileDropTarget::OnDropFiles( long x, long y, size_t nFiles, const char * const aszFiles[] )
|
||||||
{
|
{
|
||||||
printf( "Got %d dropped files.\n", (int)nFiles );
|
wxLogDebug( "Got %d dropped files.", (int)nFiles );
|
||||||
printf( "At x: %d, y: %d.\n", (int)x, (int)y );
|
wxLogDebug( "At x: %d, y: %d.", (int)x, (int)y );
|
||||||
|
for (size_t i = 0; i < nFiles; i++)
|
||||||
|
{
|
||||||
|
wxLogDebug( aszFiles[i] );
|
||||||
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxFileDropTarget::OnDrop(long x, long y, const void *WXUNUSED(pData) )
|
bool wxFileDropTarget::OnDrop(long x, long y, const void *data, size_t size )
|
||||||
{
|
{
|
||||||
char *str = "/this/is/a/path.txt";
|
size_t number = 0;
|
||||||
|
char *text = (char*) data;
|
||||||
|
for (size_t i = 0; i < size; i++)
|
||||||
|
if (text[i] == 0) number++;
|
||||||
|
|
||||||
return OnDropFiles(x, y, 1, &str );
|
if (number == 0) return TRUE;
|
||||||
|
|
||||||
|
char **files = new char*[number];
|
||||||
|
|
||||||
|
text = (char*) data;
|
||||||
|
for (size_t i = 0; i < number; i++)
|
||||||
|
{
|
||||||
|
files[i] = text;
|
||||||
|
int len = strlen( text );
|
||||||
|
text += len+1;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ret = OnDropFiles( x, y, 1, files );
|
||||||
|
|
||||||
|
free( files );
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t wxFileDropTarget::GetFormatCount() const
|
size_t wxFileDropTarget::GetFormatCount() const
|
||||||
@@ -93,41 +123,100 @@ wxDataFormat wxFileDropTarget::GetFormat(size_t WXUNUSED(n)) const
|
|||||||
// wxDropSource
|
// wxDropSource
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// drag request
|
|
||||||
|
|
||||||
wxDropSource::wxDropSource( wxWindow *win )
|
wxDropSource::wxDropSource( wxWindow *win )
|
||||||
{
|
{
|
||||||
// TODO
|
#if 0
|
||||||
// m_window = win;
|
m_window = win;
|
||||||
m_data = NULL;
|
m_data = (wxDataObject *) NULL;
|
||||||
|
m_retValue = wxDragCancel;
|
||||||
|
|
||||||
// m_defaultCursor = wxCursor( wxCURSOR_NO_ENTRY );
|
m_defaultCursor = wxCursor( wxCURSOR_NO_ENTRY );
|
||||||
// m_goaheadCursor = wxCursor( wxCURSOR_HAND );
|
m_goaheadCursor = wxCursor( wxCURSOR_HAND );
|
||||||
};
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
wxDropSource::wxDropSource( wxDataObject &data, wxWindow *win )
|
wxDropSource::wxDropSource( wxDataObject &data, wxWindow *win )
|
||||||
{
|
{
|
||||||
// TODO
|
#if 0
|
||||||
// m_window = win;
|
g_blockEventsOnDrag = TRUE;
|
||||||
|
|
||||||
|
m_window = win;
|
||||||
|
m_widget = win->m_widget;
|
||||||
|
if (win->m_wxwindow) m_widget = win->m_wxwindow;
|
||||||
|
m_retValue = wxDragCancel;
|
||||||
|
|
||||||
m_data = &data;
|
m_data = &data;
|
||||||
|
|
||||||
// m_defaultCursor = wxCursor( wxCURSOR_NO_ENTRY );
|
m_defaultCursor = wxCursor( wxCURSOR_NO_ENTRY );
|
||||||
// m_goaheadCursor = wxCursor( wxCURSOR_HAND );
|
m_goaheadCursor = wxCursor( wxCURSOR_HAND );
|
||||||
};
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
void wxDropSource::SetData( wxDataObject &data )
|
void wxDropSource::SetData( wxDataObject &data )
|
||||||
{
|
{
|
||||||
m_data = &data;
|
// m_data = &data;
|
||||||
};
|
}
|
||||||
|
|
||||||
wxDropSource::~wxDropSource(void)
|
wxDropSource::~wxDropSource(void)
|
||||||
{
|
{
|
||||||
};
|
// if (m_data) delete m_data;
|
||||||
|
}
|
||||||
|
|
||||||
wxDragResult wxDropSource::DoDragDrop( bool WXUNUSED(bAllowMove) )
|
wxDragResult wxDropSource::DoDragDrop( bool WXUNUSED(bAllowMove) )
|
||||||
{
|
{
|
||||||
// TODO
|
// wxASSERT_MSG( m_data, "wxDragSource: no data" );
|
||||||
return wxDragError;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
return wxDragNone;
|
||||||
|
#if 0
|
||||||
|
if (!m_data) return (wxDragResult) wxDragNone;
|
||||||
|
if (m_data->GetDataSize() == 0) return (wxDragResult) wxDragNone;
|
||||||
|
|
||||||
|
RegisterWindow();
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
|
||||||
|
UnregisterWindow();
|
||||||
|
|
||||||
|
g_blockEventsOnDrag = FALSE;
|
||||||
|
|
||||||
|
return m_retValue;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
void wxDropSource::RegisterWindow(void)
|
||||||
|
{
|
||||||
|
if (!m_data) return;
|
||||||
|
|
||||||
|
wxString formats;
|
||||||
|
|
||||||
|
wxDataFormat df = m_data->GetPreferredFormat();
|
||||||
|
|
||||||
|
switch (df)
|
||||||
|
{
|
||||||
|
case wxDF_TEXT:
|
||||||
|
formats += "text/plain";
|
||||||
|
break;
|
||||||
|
case wxDF_FILENAME:
|
||||||
|
formats += "file:ALL";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
char *str = WXSTRINGCAST formats;
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxDropSource::UnregisterWindow(void)
|
||||||
|
{
|
||||||
|
if (!m_widget) return;
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
||||||
|
// wxUSE_DRAG_AND_DROP
|
||||||
|
@@ -36,9 +36,9 @@ IMPLEMENT_CLASS(wxFileDialog, wxDialog)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define DEFAULT_FILE_SELECTOR_SIZE 0
|
#define DEFAULT_FILE_SELECTOR_SIZE 0
|
||||||
// Let Motif defines the size of File
|
// Let Motif defines the size of File
|
||||||
// Selector Box (if 1), or fix it to
|
// Selector Box (if 1), or fix it to
|
||||||
// wxFSB_WIDTH x wxFSB_HEIGHT (if 0)
|
// wxFSB_WIDTH x wxFSB_HEIGHT (if 0)
|
||||||
#define wxFSB_WIDTH 600
|
#define wxFSB_WIDTH 600
|
||||||
#define wxFSB_HEIGHT 500
|
#define wxFSB_HEIGHT 500
|
||||||
|
|
||||||
@@ -148,7 +148,7 @@ int wxFileDialog::ShowModal()
|
|||||||
{
|
{
|
||||||
wxBeginBusyCursor();
|
wxBeginBusyCursor();
|
||||||
|
|
||||||
// static char fileBuf[512];
|
// static char fileBuf[512];
|
||||||
Widget parentWidget = (Widget) 0;
|
Widget parentWidget = (Widget) 0;
|
||||||
if (m_parent)
|
if (m_parent)
|
||||||
{
|
{
|
||||||
@@ -216,12 +216,12 @@ int wxFileDialog::ShowModal()
|
|||||||
XtAddCallback(fileSel, XmNcancelCallback, (XtCallbackProc)wxFileSelCancel, (XtPointer)NULL);
|
XtAddCallback(fileSel, XmNcancelCallback, (XtCallbackProc)wxFileSelCancel, (XtPointer)NULL);
|
||||||
XtAddCallback(fileSel, XmNokCallback, (XtCallbackProc)wxFileSelOk, (XtPointer)NULL);
|
XtAddCallback(fileSel, XmNokCallback, (XtCallbackProc)wxFileSelOk, (XtPointer)NULL);
|
||||||
|
|
||||||
//#if XmVersion > 1000
|
//#if XmVersion > 1000
|
||||||
// I'm not sure about what you mean with XmVersion.
|
// I'm not sure about what you mean with XmVersion.
|
||||||
// If this is for Motif1.1/Motif1.2, then check XmVersion>=1200
|
// If this is for Motif1.1/Motif1.2, then check XmVersion>=1200
|
||||||
// (Motif1.1.4 ==> XmVersion 1100 )
|
// (Motif1.1.4 ==> XmVersion 1100 )
|
||||||
// Nevertheless, I put here a #define, so anyone can choose in (I)makefile...
|
// Nevertheless, I put here a #define, so anyone can choose in (I)makefile...
|
||||||
//
|
//
|
||||||
#if !DEFAULT_FILE_SELECTOR_SIZE
|
#if !DEFAULT_FILE_SELECTOR_SIZE
|
||||||
int width = wxFSB_WIDTH;
|
int width = wxFSB_WIDTH;
|
||||||
int height = wxFSB_HEIGHT;
|
int height = wxFSB_HEIGHT;
|
||||||
@@ -249,7 +249,7 @@ int wxFileDialog::ShowModal()
|
|||||||
|
|
||||||
XmUpdateDisplay((Widget) wxTheApp->GetTopLevelWidget()); // Experimental
|
XmUpdateDisplay((Widget) wxTheApp->GetTopLevelWidget()); // Experimental
|
||||||
|
|
||||||
// XtDestroyWidget(fileSel);
|
// XtDestroyWidget(fileSel);
|
||||||
XtUnmapWidget(XtParent(fileSel));
|
XtUnmapWidget(XtParent(fileSel));
|
||||||
XtDestroyWidget(XtParent(fileSel));
|
XtDestroyWidget(XtParent(fileSel));
|
||||||
|
|
||||||
|
@@ -65,12 +65,12 @@ static bool wxTopLevelUsed = FALSE;
|
|||||||
|
|
||||||
#if !USE_SHARED_LIBRARY
|
#if !USE_SHARED_LIBRARY
|
||||||
BEGIN_EVENT_TABLE(wxFrame, wxWindow)
|
BEGIN_EVENT_TABLE(wxFrame, wxWindow)
|
||||||
EVT_SIZE(wxFrame::OnSize)
|
EVT_SIZE(wxFrame::OnSize)
|
||||||
EVT_ACTIVATE(wxFrame::OnActivate)
|
EVT_ACTIVATE(wxFrame::OnActivate)
|
||||||
EVT_MENU_HIGHLIGHT_ALL(wxFrame::OnMenuHighlight)
|
EVT_MENU_HIGHLIGHT_ALL(wxFrame::OnMenuHighlight)
|
||||||
EVT_SYS_COLOUR_CHANGED(wxFrame::OnSysColourChanged)
|
EVT_SYS_COLOUR_CHANGED(wxFrame::OnSysColourChanged)
|
||||||
EVT_IDLE(wxFrame::OnIdle)
|
EVT_IDLE(wxFrame::OnIdle)
|
||||||
EVT_CLOSE(wxFrame::OnCloseWindow)
|
EVT_CLOSE(wxFrame::OnCloseWindow)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxFrame, wxWindow)
|
IMPLEMENT_DYNAMIC_CLASS(wxFrame, wxWindow)
|
||||||
@@ -182,7 +182,7 @@ bool wxFrame::Create(wxWindow *parent,
|
|||||||
XmNleftAttachment, XmATTACH_FORM,
|
XmNleftAttachment, XmATTACH_FORM,
|
||||||
XmNtopAttachment, XmATTACH_FORM,
|
XmNtopAttachment, XmATTACH_FORM,
|
||||||
XmNbottomAttachment, XmATTACH_FORM,
|
XmNbottomAttachment, XmATTACH_FORM,
|
||||||
// XmNresizePolicy, XmRESIZE_ANY,
|
// XmNresizePolicy, XmRESIZE_ANY,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
XtVaSetValues((Widget) m_frameWidget,
|
XtVaSetValues((Widget) m_frameWidget,
|
||||||
@@ -289,7 +289,7 @@ wxFrame::~wxFrame()
|
|||||||
{
|
{
|
||||||
m_frameMenuBar->DestroyMenuBar();
|
m_frameMenuBar->DestroyMenuBar();
|
||||||
|
|
||||||
// Hack to stop core dump on Ultrix, OSF, for some strange reason.
|
// Hack to stop core dump on Ultrix, OSF, for some strange reason.
|
||||||
#if MOTIF_MENUBAR_DELETE_FIX
|
#if MOTIF_MENUBAR_DELETE_FIX
|
||||||
GetMenuBar()->SetMainWidget((WXWidget) NULL);
|
GetMenuBar()->SetMainWidget((WXWidget) NULL);
|
||||||
#endif
|
#endif
|
||||||
@@ -305,7 +305,7 @@ wxFrame::~wxFrame()
|
|||||||
|
|
||||||
DestroyChildren();
|
DestroyChildren();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < wxMAX_STATUS; i++)
|
for (i = 0; i < wxMAX_STATUS; i++)
|
||||||
if (statusTextWidget[i])
|
if (statusTextWidget[i])
|
||||||
@@ -336,7 +336,7 @@ wxFrame::~wxFrame()
|
|||||||
|
|
||||||
SetMainWidget((WXWidget) NULL);
|
SetMainWidget((WXWidget) NULL);
|
||||||
|
|
||||||
/* Check if it's the last top-level window */
|
/* Check if it's the last top-level window */
|
||||||
|
|
||||||
if (wxTheApp && (wxTopLevelWindows.Number() == 0))
|
if (wxTheApp && (wxTopLevelWindows.Number() == 0))
|
||||||
{
|
{
|
||||||
@@ -372,7 +372,7 @@ void wxFrame::GetClientSize(int *x, int *y) const
|
|||||||
else
|
else
|
||||||
yy -= tbh;
|
yy -= tbh;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
if (GetMenuBar() != (wxMenuBar*) NULL)
|
if (GetMenuBar() != (wxMenuBar*) NULL)
|
||||||
{
|
{
|
||||||
// it seems that if a frame holds a panel, the menu bar size
|
// it seems that if a frame holds a panel, the menu bar size
|
||||||
@@ -500,7 +500,7 @@ bool wxFrame::Show(bool show)
|
|||||||
XRaiseWindow(XtDisplay((Widget) m_frameShell), XtWindow((Widget) m_frameShell));
|
XRaiseWindow(XtDisplay((Widget) m_frameShell), XtWindow((Widget) m_frameShell));
|
||||||
} else {
|
} else {
|
||||||
XtUnmapWidget((Widget) m_frameShell);
|
XtUnmapWidget((Widget) m_frameShell);
|
||||||
// XmUpdateDisplay(wxTheApp->topLevel); // Experimental: may be responsible for crashes
|
// XmUpdateDisplay(wxTheApp->topLevel); // Experimental: may be responsible for crashes
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@@ -655,7 +655,7 @@ void wxFrame::SetMenuBar(wxMenuBar *menuBar)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Currently can't set it twice
|
// Currently can't set it twice
|
||||||
// wxASSERT_MSG( (m_frameMenuBar == (wxMenuBar*) NULL), "Cannot set the menubar more than once");
|
// wxASSERT_MSG( (m_frameMenuBar == (wxMenuBar*) NULL), "Cannot set the menubar more than once");
|
||||||
|
|
||||||
if (m_frameMenuBar)
|
if (m_frameMenuBar)
|
||||||
{
|
{
|
||||||
@@ -718,12 +718,12 @@ void wxFrame::OnSysColourChanged(wxSysColourChangedEvent& event)
|
|||||||
void wxFrame::OnSize(wxSizeEvent& event)
|
void wxFrame::OnSize(wxSizeEvent& event)
|
||||||
{
|
{
|
||||||
// if we're using constraints - do use them
|
// if we're using constraints - do use them
|
||||||
#if wxUSE_CONSTRAINTS
|
#if wxUSE_CONSTRAINTS
|
||||||
if ( GetAutoLayout() ) {
|
if ( GetAutoLayout() ) {
|
||||||
Layout();
|
Layout();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// do we have _exactly_ one child?
|
// do we have _exactly_ one child?
|
||||||
wxWindow *child = NULL;
|
wxWindow *child = NULL;
|
||||||
@@ -852,13 +852,13 @@ void wxFrame::ProcessCommand(int id)
|
|||||||
if (!bar)
|
if (!bar)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* TODO: check the menu item if required
|
/* TODO: check the menu item if required
|
||||||
wxMenuItem *item = bar->FindItemForId(id) ;
|
wxMenuItem *item = bar->FindItemForId(id) ;
|
||||||
if (item && item->IsCheckable())
|
if (item && item->IsCheckable())
|
||||||
{
|
{
|
||||||
bar->Check(id,!bar->Checked(id)) ;
|
bar->Check(id,!bar->Checked(id)) ;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
GetEventHandler()->ProcessEvent(commandEvent);
|
GetEventHandler()->ProcessEvent(commandEvent);
|
||||||
}
|
}
|
||||||
|
@@ -25,28 +25,28 @@ IMPLEMENT_DYNAMIC_CLASS(wxGauge, wxControl)
|
|||||||
// XmGauge copyright notice:
|
// XmGauge copyright notice:
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright 1994 GROUPE BULL
|
* Copyright 1994 GROUPE BULL
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify, and distribute this software and its
|
* Permission to use, copy, modify, and distribute this software and its
|
||||||
* documentation for any purpose and without fee is hereby granted, provided
|
* documentation for any purpose and without fee is hereby granted, provided
|
||||||
* that the above copyright notice appear in all copies and that both that
|
* that the above copyright notice appear in all copies and that both that
|
||||||
* copyright notice and this permission notice appear in supporting
|
* copyright notice and this permission notice appear in supporting
|
||||||
* documentation, and that the name of GROUPE BULL not be used in advertising
|
* documentation, and that the name of GROUPE BULL not be used in advertising
|
||||||
* or publicity pertaining to distribution of the software without specific,
|
* or publicity pertaining to distribution of the software without specific,
|
||||||
* written prior permission. GROUPE BULL makes no representations about the
|
* written prior permission. GROUPE BULL makes no representations about the
|
||||||
* suitability of this software for any purpose. It is provided "as is"
|
* suitability of this software for any purpose. It is provided "as is"
|
||||||
* without express or implied warranty.
|
* without express or implied warranty.
|
||||||
*
|
*
|
||||||
* GROUPE BULL disclaims all warranties with regard to this software,
|
* GROUPE BULL disclaims all warranties with regard to this software,
|
||||||
* including all implied warranties of merchantability and fitness,
|
* including all implied warranties of merchantability and fitness,
|
||||||
* in no event shall GROUPE BULL be liable for any special,
|
* in no event shall GROUPE BULL be liable for any special,
|
||||||
* indirect or consequential damages or any damages
|
* indirect or consequential damages or any damages
|
||||||
* whatsoever resulting from loss of use, data or profits,
|
* whatsoever resulting from loss of use, data or profits,
|
||||||
* whether in an action of contract, negligence or other tortious
|
* whether in an action of contract, negligence or other tortious
|
||||||
* action, arising out of or in connection with the use
|
* action, arising out of or in connection with the use
|
||||||
* or performance of this software.
|
* or performance of this software.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//// PUBLIC XMGAUGE DECLARATIONS
|
//// PUBLIC XMGAUGE DECLARATIONS
|
||||||
typedef struct _XmGaugeClassRec* XmGaugeWidgetClass;
|
typedef struct _XmGaugeClassRec* XmGaugeWidgetClass;
|
||||||
@@ -179,7 +179,7 @@ int wxGauge::GetRange() const
|
|||||||
int r;
|
int r;
|
||||||
XtVaGetValues((Widget) m_mainWidget, XmNmaximum, &r, NULL);
|
XtVaGetValues((Widget) m_mainWidget, XmNmaximum, &r, NULL);
|
||||||
return (int)r;
|
return (int)r;
|
||||||
// return m_rangeMax;
|
// return m_rangeMax;
|
||||||
}
|
}
|
||||||
|
|
||||||
int wxGauge::GetValue() const
|
int wxGauge::GetValue() const
|
||||||
@@ -187,7 +187,7 @@ int wxGauge::GetValue() const
|
|||||||
int pos;
|
int pos;
|
||||||
XtVaGetValues((Widget) m_mainWidget, XmNvalue, &pos, NULL);
|
XtVaGetValues((Widget) m_mainWidget, XmNvalue, &pos, NULL);
|
||||||
return pos;
|
return pos;
|
||||||
// return m_gaugePos;
|
// return m_gaugePos;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxGauge::ChangeFont(bool keepOriginalSize)
|
void wxGauge::ChangeFont(bool keepOriginalSize)
|
||||||
@@ -263,7 +263,7 @@ static char translations[] =
|
|||||||
"<Btn1Down>: GaugePick()\n\
|
"<Btn1Down>: GaugePick()\n\
|
||||||
<Btn1Motion>: GaugeDrag()\n\
|
<Btn1Motion>: GaugeDrag()\n\
|
||||||
<Btn1Up>: GaugeDrop()\n\
|
<Btn1Up>: GaugeDrop()\n\
|
||||||
";
|
";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -279,22 +279,22 @@ DrawSlider(XmGaugeWidget gw, Boolean clear)
|
|||||||
#define THIS gw->gauge
|
#define THIS gw->gauge
|
||||||
int size, sht;
|
int size, sht;
|
||||||
float ratio;
|
float ratio;
|
||||||
/***chubraev
|
/***chubraev
|
||||||
char string[20];
|
char string[20];
|
||||||
int len;
|
int len;
|
||||||
unsigned long backgr,foregr;
|
unsigned long backgr,foregr;
|
||||||
XRectangle rects[1];
|
XRectangle rects[1];
|
||||||
***/
|
***/
|
||||||
|
|
||||||
sht = gw->primitive.shadow_thickness;
|
sht = gw->primitive.shadow_thickness;
|
||||||
|
|
||||||
ratio = (float)THIS.value/
|
ratio = (float)THIS.value/
|
||||||
(float)(THIS.maximum - THIS.minimum);
|
(float)(THIS.maximum - THIS.minimum);
|
||||||
/***chubraev
|
/***chubraev
|
||||||
sprintf(string,"%-d%%",(int)(ratio*100));
|
sprintf(string,"%-d%%",(int)(ratio*100));
|
||||||
len=strlen(string);
|
len=strlen(string);
|
||||||
XtVaGetValues(gw,XmNbackground,&backgr,XmNforeground,&foregr,NULL);
|
XtVaGetValues(gw,XmNbackground,&backgr,XmNforeground,&foregr,NULL);
|
||||||
***/
|
***/
|
||||||
|
|
||||||
if(clear) {
|
if(clear) {
|
||||||
XClearArea(XtDisplay(gw), XtWindow(gw), sht, sht,
|
XClearArea(XtDisplay(gw), XtWindow(gw), sht, sht,
|
||||||
@@ -305,7 +305,7 @@ DrawSlider(XmGaugeWidget gw, Boolean clear)
|
|||||||
size = (int) ((gw->core.width - 2 * sht)*ratio);
|
size = (int) ((gw->core.width - 2 * sht)*ratio);
|
||||||
/***chubraev
|
/***chubraev
|
||||||
XDrawString(XtDisplay(gw), XtWindow(gw), THIS.gc, sht+gw->core.width/2,
|
XDrawString(XtDisplay(gw), XtWindow(gw), THIS.gc, sht+gw->core.width/2,
|
||||||
gw->core.height - 2 * sht, string, len);
|
gw->core.height - 2 * sht, string, len);
|
||||||
***/
|
***/
|
||||||
switch(THIS.processingDirection) {
|
switch(THIS.processingDirection) {
|
||||||
case XmMAX_ON_RIGHT:
|
case XmMAX_ON_RIGHT:
|
||||||
@@ -334,7 +334,7 @@ gw->core.height - 2 * sht, string, len);
|
|||||||
XSetClipRectangles(XtDisplay(gw), THIS.gc, 0, 0, rects, 1, Unsorted);
|
XSetClipRectangles(XtDisplay(gw), THIS.gc, 0, 0, rects, 1, Unsorted);
|
||||||
XSetForeground(XtDisplay(gw), THIS.gc, backgr);
|
XSetForeground(XtDisplay(gw), THIS.gc, backgr);
|
||||||
XDrawString(XtDisplay(gw), XtWindow(gw), THIS.gc, sht+gw->core.width/2,
|
XDrawString(XtDisplay(gw), XtWindow(gw), THIS.gc, sht+gw->core.width/2,
|
||||||
gw->core.height - 2 * sht, string, len);
|
gw->core.height - 2 * sht, string, len);
|
||||||
***/
|
***/
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@@ -342,7 +342,7 @@ gw->core.height - 2 * sht, string, len);
|
|||||||
size = (int) ((gw->core.height - 2 * sht)*ratio);
|
size = (int) ((gw->core.height - 2 * sht)*ratio);
|
||||||
/***chubraev
|
/***chubraev
|
||||||
XDrawString(XtDisplay(gw), XtWindow(gw), THIS.gc, sht,
|
XDrawString(XtDisplay(gw), XtWindow(gw), THIS.gc, sht,
|
||||||
sht+gw->core.height/2, string,len);
|
sht+gw->core.height/2, string,len);
|
||||||
***/
|
***/
|
||||||
switch(THIS.processingDirection) {
|
switch(THIS.processingDirection) {
|
||||||
case XmMAX_ON_RIGHT:
|
case XmMAX_ON_RIGHT:
|
||||||
@@ -370,7 +370,7 @@ sht+gw->core.height/2, string,len);
|
|||||||
XSetClipRectangles(XtDisplay(gw), THIS.gc, 0, 0, rects, 1, Unsorted);
|
XSetClipRectangles(XtDisplay(gw), THIS.gc, 0, 0, rects, 1, Unsorted);
|
||||||
XSetForeground(XtDisplay(gw), THIS.gc, backgr);
|
XSetForeground(XtDisplay(gw), THIS.gc, backgr);
|
||||||
XDrawString(XtDisplay(gw), XtWindow(gw), THIS.gc, sht,
|
XDrawString(XtDisplay(gw), XtWindow(gw), THIS.gc, sht,
|
||||||
sht+gw->core.height/2, string,len);
|
sht+gw->core.height/2, string,len);
|
||||||
***/
|
***/
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -382,28 +382,28 @@ sht+gw->core.height/2, string,len);
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Old code
|
/* Old code
|
||||||
*/
|
*/
|
||||||
#if 0
|
#if 0
|
||||||
static void
|
static void
|
||||||
DrawSlider(XmGaugeWidget gw, Boolean clear)
|
DrawSlider(XmGaugeWidget gw, Boolean clear)
|
||||||
{
|
{
|
||||||
#define THIS gw->gauge
|
#define THIS gw->gauge
|
||||||
int size, sht;
|
int size, sht;
|
||||||
/* float ratio; */
|
/* float ratio; */
|
||||||
|
|
||||||
sht = gw->primitive.shadow_thickness;
|
sht = gw->primitive.shadow_thickness;
|
||||||
/* See fix comment below: can cause divide by zero error.
|
/* See fix comment below: can cause divide by zero error.
|
||||||
ratio = (float)((float)THIS.maximum -
|
ratio = (float)((float)THIS.maximum -
|
||||||
(float)THIS.minimum) / (float)THIS.value;
|
(float)THIS.minimum) / (float)THIS.value;
|
||||||
*/
|
*/
|
||||||
if(clear) {
|
if(clear) {
|
||||||
XClearArea(XtDisplay(gw), XtWindow(gw), sht, sht,
|
XClearArea(XtDisplay(gw), XtWindow(gw), sht, sht,
|
||||||
gw->core.width - 2 * sht, gw->core.height - 2 * sht, False);
|
gw->core.width - 2 * sht, gw->core.height - 2 * sht, False);
|
||||||
}
|
}
|
||||||
switch(THIS.orientation) {
|
switch(THIS.orientation) {
|
||||||
case XmHORIZONTAL:
|
case XmHORIZONTAL:
|
||||||
/* size = (gw->core.width - 2 * sht) / ratio; */
|
/* size = (gw->core.width - 2 * sht) / ratio; */
|
||||||
/* A fix suggested by Dmitri Chubraev */
|
/* A fix suggested by Dmitri Chubraev */
|
||||||
size = (gw->core.width - 2 * sht) /((float)THIS.maximum-(float)THIS.minimum)*(float)THIS.value;
|
size = (gw->core.width - 2 * sht) /((float)THIS.maximum-(float)THIS.minimum)*(float)THIS.value;
|
||||||
switch(THIS.processingDirection) {
|
switch(THIS.processingDirection) {
|
||||||
case XmMAX_ON_RIGHT:
|
case XmMAX_ON_RIGHT:
|
||||||
@@ -421,7 +421,7 @@ DrawSlider(XmGaugeWidget gw, Boolean clear)
|
|||||||
break;
|
break;
|
||||||
case XmVERTICAL:
|
case XmVERTICAL:
|
||||||
size = (gw->core.height - 2 * sht) /((float)THIS.maximum-(float)THIS.minimum)*(float)THIS.value;
|
size = (gw->core.height - 2 * sht) /((float)THIS.maximum-(float)THIS.minimum)*(float)THIS.value;
|
||||||
/* size = (gw->core.height - 2 * sht)/ ratio; */
|
/* size = (gw->core.height - 2 * sht)/ ratio; */
|
||||||
switch(THIS.processingDirection) {
|
switch(THIS.processingDirection) {
|
||||||
case XmMAX_ON_RIGHT:
|
case XmMAX_ON_RIGHT:
|
||||||
case XmMAX_ON_BOTTOM:
|
case XmMAX_ON_BOTTOM:
|
||||||
@@ -606,7 +606,7 @@ WidgetClass xmGaugeWidgetClass = (WidgetClass)&xmGaugeClassRec;
|
|||||||
void
|
void
|
||||||
GaugePick(Widget w, XEvent *e, String *args, Cardinal *num_args)
|
GaugePick(Widget w, XEvent *e, String *args, Cardinal *num_args)
|
||||||
{
|
{
|
||||||
/* Commented out for a read-only gauge in wxWindows */
|
/* Commented out for a read-only gauge in wxWindows */
|
||||||
#if 0
|
#if 0
|
||||||
XmGaugeWidget gw = (XmGaugeWidget)w;
|
XmGaugeWidget gw = (XmGaugeWidget)w;
|
||||||
#define THIS gw->gauge
|
#define THIS gw->gauge
|
||||||
@@ -672,7 +672,7 @@ GaugePick(Widget w, XEvent *e, String *args, Cardinal *num_args)
|
|||||||
void
|
void
|
||||||
GaugeDrag(Widget w, XEvent *e, String *args, Cardinal *num_args)
|
GaugeDrag(Widget w, XEvent *e, String *args, Cardinal *num_args)
|
||||||
{
|
{
|
||||||
/* Commented out for a read-only gauge in wxWindows */
|
/* Commented out for a read-only gauge in wxWindows */
|
||||||
#if 0
|
#if 0
|
||||||
XmGaugeWidget gw = (XmGaugeWidget)w;
|
XmGaugeWidget gw = (XmGaugeWidget)w;
|
||||||
#define THIS gw->gauge
|
#define THIS gw->gauge
|
||||||
@@ -741,7 +741,7 @@ GaugeDrag(Widget w, XEvent *e, String *args, Cardinal *num_args)
|
|||||||
void
|
void
|
||||||
GaugeDrop(Widget w, XEvent *e, String *args, Cardinal *num_args)
|
GaugeDrop(Widget w, XEvent *e, String *args, Cardinal *num_args)
|
||||||
{
|
{
|
||||||
/* Commented out for a read-only gauge in wxWindows */
|
/* Commented out for a read-only gauge in wxWindows */
|
||||||
#if 0
|
#if 0
|
||||||
XmGaugeWidget gw = (XmGaugeWidget)w;
|
XmGaugeWidget gw = (XmGaugeWidget)w;
|
||||||
#define THIS gw->gauge
|
#define THIS gw->gauge
|
||||||
|
@@ -18,5 +18,3 @@
|
|||||||
#if !USE_SHARED_LIBRARIES
|
#if !USE_SHARED_LIBRARIES
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxGDIObject, wxObject)
|
IMPLEMENT_DYNAMIC_CLASS(wxGDIObject, wxObject)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// TODO: Nothing to do, unless you want to.
|
|
||||||
|
@@ -26,8 +26,8 @@ IMPLEMENT_DYNAMIC_CLASS(wxIcon, wxBitmap)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Icons
|
* Icons
|
||||||
*/
|
*/
|
||||||
|
|
||||||
wxIcon::wxIcon()
|
wxIcon::wxIcon()
|
||||||
{
|
{
|
||||||
|
@@ -23,7 +23,7 @@
|
|||||||
#include "wx/motif/private.h"
|
#include "wx/motif/private.h"
|
||||||
|
|
||||||
#if !USE_SHARED_LIBRARY
|
#if !USE_SHARED_LIBRARY
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxListBox, wxControl)
|
IMPLEMENT_DYNAMIC_CLASS(wxListBox, wxControl)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void wxListBoxCallback (Widget w, XtPointer clientData,
|
void wxListBoxCallback (Widget w, XtPointer clientData,
|
||||||
@@ -195,7 +195,7 @@ void wxListBox::Append(const wxString& item)
|
|||||||
int n;
|
int n;
|
||||||
XtVaGetValues (listBox, XmNitemCount, &n, NULL);
|
XtVaGetValues (listBox, XmNitemCount, &n, NULL);
|
||||||
XmString text = XmStringCreateSimple ((char*) (const char*) item);
|
XmString text = XmStringCreateSimple ((char*) (const char*) item);
|
||||||
// XmListAddItem(listBox, text, n + 1);
|
// XmListAddItem(listBox, text, n + 1);
|
||||||
XmListAddItemUnselected (listBox, text, 0);
|
XmListAddItemUnselected (listBox, text, 0);
|
||||||
XmStringFree (text);
|
XmStringFree (text);
|
||||||
|
|
||||||
@@ -237,7 +237,7 @@ void wxListBox::Append(const wxString& item, char *clientData)
|
|||||||
int n;
|
int n;
|
||||||
XtVaGetValues (listBox, XmNitemCount, &n, NULL);
|
XtVaGetValues (listBox, XmNitemCount, &n, NULL);
|
||||||
XmString text = XmStringCreateSimple ((char*) (const char*) item);
|
XmString text = XmStringCreateSimple ((char*) (const char*) item);
|
||||||
// XmListAddItem(listBox, text, n + 1);
|
// XmListAddItem(listBox, text, n + 1);
|
||||||
XmListAddItemUnselected (listBox, text, 0);
|
XmListAddItemUnselected (listBox, text, 0);
|
||||||
XmStringFree (text);
|
XmStringFree (text);
|
||||||
|
|
||||||
@@ -280,14 +280,14 @@ void wxListBox::Set(int n, const wxString *choices, char** clientData)
|
|||||||
|
|
||||||
if (managed)
|
if (managed)
|
||||||
XtUnmanageChild (listBox);
|
XtUnmanageChild (listBox);
|
||||||
/***
|
/***
|
||||||
for (int i=0; i<n; i++)
|
for (int i=0; i<n; i++)
|
||||||
{
|
{
|
||||||
XmString text = XmStringCreateSimple(choices[i]);
|
XmString text = XmStringCreateSimple(choices[i]);
|
||||||
XmListAddItemUnselected(listBox, text, 0);
|
XmListAddItemUnselected(listBox, text, 0);
|
||||||
XmStringFree(text);
|
XmStringFree(text);
|
||||||
}
|
}
|
||||||
***/
|
***/
|
||||||
XmString *text = new XmString[n];
|
XmString *text = new XmString[n];
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < n; i++)
|
for (i = 0; i < n; i++)
|
||||||
@@ -370,7 +370,7 @@ void wxListBox::SetSelection(int N, bool select)
|
|||||||
m_inSetValue = TRUE;
|
m_inSetValue = TRUE;
|
||||||
if (select)
|
if (select)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
if (m_windowStyle & wxLB_MULTIPLE)
|
if (m_windowStyle & wxLB_MULTIPLE)
|
||||||
{
|
{
|
||||||
int *selections = NULL;
|
int *selections = NULL;
|
||||||
@@ -390,7 +390,7 @@ void wxListBox::SetSelection(int N, bool select)
|
|||||||
XtVaSetValues ((Widget) m_mainWidget, XmNselectionPolicy, XmEXTENDED_SELECT, NULL);
|
XtVaSetValues ((Widget) m_mainWidget, XmNselectionPolicy, XmEXTENDED_SELECT, NULL);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
*/
|
*/
|
||||||
XmListSelectPos ((Widget) m_mainWidget, N + 1, FALSE);
|
XmListSelectPos ((Widget) m_mainWidget, N + 1, FALSE);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -544,8 +544,8 @@ void wxListBox::InsertItems(int nItems, const wxString items[], int pos)
|
|||||||
XmString *text = new XmString[nItems];
|
XmString *text = new XmString[nItems];
|
||||||
int i;
|
int i;
|
||||||
// Steve Hammes: Motif 1.1 compatibility
|
// Steve Hammes: Motif 1.1 compatibility
|
||||||
// #if XmVersion > 1100
|
// #if XmVersion > 1100
|
||||||
// Corrected by Sergey Krasnov from Steve Hammes' code
|
// Corrected by Sergey Krasnov from Steve Hammes' code
|
||||||
#if XmVersion > 1001
|
#if XmVersion > 1001
|
||||||
for (i = 0; i < nItems; i++)
|
for (i = 0; i < nItems; i++)
|
||||||
text[i] = XmStringCreateSimple((char*) (const char*) items[i]);
|
text[i] = XmStringCreateSimple((char*) (const char*) items[i]);
|
||||||
@@ -554,7 +554,7 @@ void wxListBox::InsertItems(int nItems, const wxString items[], int pos)
|
|||||||
for (i = 0; i < nItems; i++)
|
for (i = 0; i < nItems; i++)
|
||||||
{
|
{
|
||||||
text[i] = XmStringCreateSimple((char*) (const char*) items[i]);
|
text[i] = XmStringCreateSimple((char*) (const char*) items[i]);
|
||||||
// XmListAddItemUnselected(listBox, text[i], i);
|
// XmListAddItemUnselected(listBox, text[i], i);
|
||||||
XmListAddItemUnselected(listBox, text[i], pos+i+1); // Another Sergey correction
|
XmListAddItemUnselected(listBox, text[i], pos+i+1); // Another Sergey correction
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -603,7 +603,7 @@ void wxListBox::SetString(int N, const wxString& s)
|
|||||||
|
|
||||||
XmStringFree(text);
|
XmStringFree(text);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
// It seems that if the list is cleared, we must re-ask for
|
// It seems that if the list is cleared, we must re-ask for
|
||||||
// selection policy!!
|
// selection policy!!
|
||||||
Arg args[3];
|
Arg args[3];
|
||||||
@@ -615,7 +615,7 @@ void wxListBox::SetString(int N, const wxString& s)
|
|||||||
else
|
else
|
||||||
XtSetArg (args[1], XmNselectionPolicy, XmBROWSE_SELECT);
|
XtSetArg (args[1], XmNselectionPolicy, XmBROWSE_SELECT);
|
||||||
XtSetValues (listBox, args, 2);
|
XtSetValues (listBox, args, 2);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
GetSize (&width2, &height2);
|
GetSize (&width2, &height2);
|
||||||
// Correct for randomly resized listbox - bad boy, Motif!
|
// Correct for randomly resized listbox - bad boy, Motif!
|
||||||
@@ -725,9 +725,9 @@ void wxListBoxCallback (Widget w, XtPointer clientData,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Respond by getting the
|
/* Respond by getting the
|
||||||
* designated "default button" in the action area and activate it
|
* designated "default button" in the action area and activate it
|
||||||
* as if the user had selected it.
|
* as if the user had selected it.
|
||||||
*/
|
*/
|
||||||
void wxListBoxDefaultActionProc (Widget list_w, XtPointer client_data, XmListCallbackStruct * cbs)
|
void wxListBoxDefaultActionProc (Widget list_w, XtPointer client_data, XmListCallbackStruct * cbs)
|
||||||
{
|
{
|
||||||
wxListBox *lbox = (wxListBox *) client_data;
|
wxListBox *lbox = (wxListBox *) client_data;
|
||||||
|
@@ -87,6 +87,7 @@ LIB_CPP_SRC=\
|
|||||||
combobox.cpp \
|
combobox.cpp \
|
||||||
cursor.cpp \
|
cursor.cpp \
|
||||||
data.cpp \
|
data.cpp \
|
||||||
|
dataobj.cpp \
|
||||||
dc.cpp \
|
dc.cpp \
|
||||||
dcclient.cpp \
|
dcclient.cpp \
|
||||||
dcmemory.cpp \
|
dcmemory.cpp \
|
||||||
|
@@ -44,14 +44,14 @@ IMPLEMENT_DYNAMIC_CLASS(wxMDIChildFrame, wxFrame)
|
|||||||
IMPLEMENT_DYNAMIC_CLASS(wxMDIClientWindow, wxNotebook)
|
IMPLEMENT_DYNAMIC_CLASS(wxMDIClientWindow, wxNotebook)
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(wxMDIParentFrame, wxFrame)
|
BEGIN_EVENT_TABLE(wxMDIParentFrame, wxFrame)
|
||||||
EVT_SIZE(wxMDIParentFrame::OnSize)
|
EVT_SIZE(wxMDIParentFrame::OnSize)
|
||||||
EVT_ACTIVATE(wxMDIParentFrame::OnActivate)
|
EVT_ACTIVATE(wxMDIParentFrame::OnActivate)
|
||||||
EVT_SYS_COLOUR_CHANGED(wxMDIParentFrame::OnSysColourChanged)
|
EVT_SYS_COLOUR_CHANGED(wxMDIParentFrame::OnSysColourChanged)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(wxMDIClientWindow, wxNotebook)
|
BEGIN_EVENT_TABLE(wxMDIClientWindow, wxNotebook)
|
||||||
EVT_SCROLL(wxMDIClientWindow::OnScroll)
|
EVT_SCROLL(wxMDIClientWindow::OnScroll)
|
||||||
EVT_NOTEBOOK_PAGE_CHANGED(wxID_NOTEBOOK_CLIENT_AREA, wxMDIClientWindow::OnPageChanged)
|
EVT_NOTEBOOK_PAGE_CHANGED(wxID_NOTEBOOK_CLIENT_AREA, wxMDIClientWindow::OnPageChanged)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -346,69 +346,6 @@ bool wxMDIChildFrame::Create(wxMDIParentFrame *parent,
|
|||||||
|
|
||||||
ChangeBackgroundColour();
|
ChangeBackgroundColour();
|
||||||
|
|
||||||
// Old stuff
|
|
||||||
#if 0
|
|
||||||
|
|
||||||
m_frameWidget = (WXWidget) XtVaCreateManagedWidget("main_window",
|
|
||||||
xmMainWindowWidgetClass, (Widget) clientWindow->GetTopWidget(),
|
|
||||||
XmNresizePolicy, XmRESIZE_NONE,
|
|
||||||
NULL);
|
|
||||||
|
|
||||||
// TODO: make sure this doesn't cause problems.
|
|
||||||
// I think ~wxFrame will do the right thing since it deletes m_frameWidget,
|
|
||||||
// then sets the main widget to NULL.
|
|
||||||
m_mainWidget = m_frameWidget;
|
|
||||||
|
|
||||||
m_workArea = (WXWidget) XtVaCreateWidget("form",
|
|
||||||
xmFormWidgetClass, (Widget) m_frameWidget,
|
|
||||||
XmNresizePolicy, XmRESIZE_NONE,
|
|
||||||
NULL);
|
|
||||||
|
|
||||||
m_clientArea = (WXWidget) XtVaCreateWidget("client",
|
|
||||||
xmBulletinBoardWidgetClass, (Widget) m_workArea,
|
|
||||||
XmNmarginWidth, 0,
|
|
||||||
XmNmarginHeight, 0,
|
|
||||||
XmNrightAttachment, XmATTACH_FORM,
|
|
||||||
XmNleftAttachment, XmATTACH_FORM,
|
|
||||||
XmNtopAttachment, XmATTACH_FORM,
|
|
||||||
XmNbottomAttachment, XmATTACH_FORM,
|
|
||||||
// XmNresizePolicy, XmRESIZE_ANY,
|
|
||||||
NULL);
|
|
||||||
|
|
||||||
XtVaSetValues((Widget) m_frameWidget,
|
|
||||||
XmNworkWindow, (Widget) m_workArea,
|
|
||||||
NULL);
|
|
||||||
|
|
||||||
XtManageChild((Widget) m_clientArea);
|
|
||||||
XtManageChild((Widget) m_workArea);
|
|
||||||
|
|
||||||
wxASSERT_MSG ((wxWidgetHashTable->Get((long)m_workArea) == (wxObject*) NULL), "Widget table clash in frame.cpp") ;
|
|
||||||
|
|
||||||
wxAddWindowToTable((Widget) m_workArea, this);
|
|
||||||
|
|
||||||
XtTranslations ptr ;
|
|
||||||
|
|
||||||
XtOverrideTranslations((Widget) m_workArea,
|
|
||||||
ptr = XtParseTranslationTable("<Configure>: resize()"));
|
|
||||||
|
|
||||||
XtFree((char *)ptr);
|
|
||||||
|
|
||||||
XtAddCallback((Widget) m_workArea, XmNfocusCallback,
|
|
||||||
(XtCallbackProc)wxFrameFocusProc, (XtPointer)this);
|
|
||||||
|
|
||||||
XtManageChild((Widget) m_mainWidget);
|
|
||||||
|
|
||||||
if (x > -1)
|
|
||||||
XtVaSetValues((Widget) m_mainWidget, XmNx, x, NULL);
|
|
||||||
if (y > -1)
|
|
||||||
XtVaSetValues((Widget) m_mainWidget, XmNy, y, NULL);
|
|
||||||
if (width > -1)
|
|
||||||
XtVaSetValues((Widget) m_mainWidget, XmNwidth, width, NULL);
|
|
||||||
if (height > -1)
|
|
||||||
XtVaSetValues((Widget) m_mainWidget, XmNheight, height, NULL);
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
XtManageChild((Widget) m_mainWidget);
|
XtManageChild((Widget) m_mainWidget);
|
||||||
|
|
||||||
SetTitle(title);
|
SetTitle(title);
|
||||||
@@ -540,10 +477,8 @@ void wxMDIChildFrame::SetIcon(const wxIcon& icon)
|
|||||||
m_icon = icon;
|
m_icon = icon;
|
||||||
if (m_icon.Ok())
|
if (m_icon.Ok())
|
||||||
{
|
{
|
||||||
/* TODO: doesn't work yet (crashes in XCopyArea)
|
// Not appropriate since there are no icons in
|
||||||
Pixmap pixmap = (Pixmap) m_icon.GetPixmap();
|
// a tabbed window
|
||||||
m_mdiWindow->setPixmap(pixmap);
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -379,12 +379,12 @@ void wxMenu::ProcessCommand(wxCommandEvent & event)
|
|||||||
{
|
{
|
||||||
processed = GetEventHandler()->ProcessEvent(event);
|
processed = GetEventHandler()->ProcessEvent(event);
|
||||||
}
|
}
|
||||||
/* TODO
|
/* TODO
|
||||||
// Try the window the menu was popped up from (and up
|
// Try the window the menu was popped up from (and up
|
||||||
// through the hierarchy)
|
// through the hierarchy)
|
||||||
if ( !processed && GetInvokingWindow())
|
if ( !processed && GetInvokingWindow())
|
||||||
processed = GetInvokingWindow()->ProcessEvent(event);
|
processed = GetInvokingWindow()->ProcessEvent(event);
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxWindow::PopupMenu(wxMenu *menu, int x, int y)
|
bool wxWindow::PopupMenu(wxMenu *menu, int x, int y)
|
||||||
@@ -836,9 +836,9 @@ extern wxApp *wxTheApp;
|
|||||||
static XtWorkProcId WorkProcMenuId;
|
static XtWorkProcId WorkProcMenuId;
|
||||||
|
|
||||||
/* Since PopupMenu under Motif stills grab right mouse button events
|
/* Since PopupMenu under Motif stills grab right mouse button events
|
||||||
* after it was closed, we need to delete the associated widgets to
|
* after it was closed, we need to delete the associated widgets to
|
||||||
* allow next PopUpMenu to appear...
|
* allow next PopUpMenu to appear...
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int PostDeletionOfMenu( XtPointer* clientData )
|
int PostDeletionOfMenu( XtPointer* clientData )
|
||||||
{
|
{
|
||||||
@@ -879,10 +879,10 @@ wxMenuPopdownCallback(Widget w, XtPointer clientData,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Create a popup or pulldown menu.
|
* Create a popup or pulldown menu.
|
||||||
* Submenus of a popup will be pulldown.
|
* Submenus of a popup will be pulldown.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
WXWidget wxMenu::CreateMenu (wxMenuBar * menuBar, WXWidget parent, wxMenu * topMenu, const wxString& title, bool pullDown)
|
WXWidget wxMenu::CreateMenu (wxMenuBar * menuBar, WXWidget parent, wxMenu * topMenu, const wxString& title, bool pullDown)
|
||||||
{
|
{
|
||||||
@@ -1053,7 +1053,7 @@ void wxMenu::SetForegroundColour(const wxColour& col)
|
|||||||
|
|
||||||
void wxMenu::ChangeFont(bool keepOriginalSize)
|
void wxMenu::ChangeFont(bool keepOriginalSize)
|
||||||
{
|
{
|
||||||
// lesstif 0.87 hangs when setting XmNfontList
|
// lesstif 0.87 hangs when setting XmNfontList
|
||||||
#ifndef LESSTIF_VERSION
|
#ifndef LESSTIF_VERSION
|
||||||
if (!m_font.Ok() || !m_menuWidget)
|
if (!m_font.Ok() || !m_menuWidget)
|
||||||
return;
|
return;
|
||||||
|
@@ -46,7 +46,7 @@ void wxMenuItemDisarmCallback (Widget w, XtPointer clientData,
|
|||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
#if !USE_SHARED_LIBRARY
|
#if !USE_SHARED_LIBRARY
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxMenuItem, wxObject)
|
IMPLEMENT_DYNAMIC_CLASS(wxMenuItem, wxObject)
|
||||||
#endif //USE_SHARED_LIBRARY
|
#endif //USE_SHARED_LIBRARY
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -60,9 +60,9 @@ wxMenuItem::wxMenuItem(wxMenu *pParentMenu, int id,
|
|||||||
const wxString& strName, const wxString& strHelp,
|
const wxString& strName, const wxString& strHelp,
|
||||||
bool bCheckable,
|
bool bCheckable,
|
||||||
wxMenu *pSubMenu) :
|
wxMenu *pSubMenu) :
|
||||||
m_strHelp(strHelp),
|
m_strHelp(strHelp),
|
||||||
m_bCheckable(bCheckable),
|
m_bCheckable(bCheckable),
|
||||||
m_strName(strName)
|
m_strName(strName)
|
||||||
{
|
{
|
||||||
wxASSERT( pParentMenu != NULL );
|
wxASSERT( pParentMenu != NULL );
|
||||||
|
|
||||||
@@ -326,8 +326,7 @@ void wxMenuItemCallback (Widget w, XtPointer clientData,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void wxMenuItemArmCallback (Widget w, XtPointer clientData,
|
||||||
wxMenuItemArmCallback (Widget w, XtPointer clientData,
|
|
||||||
XtPointer ptr)
|
XtPointer ptr)
|
||||||
{
|
{
|
||||||
wxMenuItem *item = (wxMenuItem *) clientData;
|
wxMenuItem *item = (wxMenuItem *) clientData;
|
||||||
|
@@ -52,9 +52,9 @@ IMPLEMENT_DYNAMIC_CLASS(wxXPalette, wxObject)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Palette
|
* Palette
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
wxXPalette::wxXPalette()
|
wxXPalette::wxXPalette()
|
||||||
{
|
{
|
||||||
@@ -86,7 +86,7 @@ wxPaletteRefData::~wxPaletteRefData()
|
|||||||
|
|
||||||
if (pix_array_n > 0)
|
if (pix_array_n > 0)
|
||||||
{
|
{
|
||||||
// XFreeColors(display, cmap, pix_array, pix_array_n, 0);
|
// XFreeColors(display, cmap, pix_array, pix_array_n, 0);
|
||||||
// Be careful not to free '0' pixels...
|
// Be careful not to free '0' pixels...
|
||||||
int i, j;
|
int i, j;
|
||||||
for(i=j=0; i<pix_array_n; i=j) {
|
for(i=j=0; i<pix_array_n; i=j) {
|
||||||
|
@@ -52,15 +52,15 @@ static void wxTextWindowActivateProc(Widget w, XtPointer clientData,
|
|||||||
IMPLEMENT_DYNAMIC_CLASS(wxTextCtrl, wxControl)
|
IMPLEMENT_DYNAMIC_CLASS(wxTextCtrl, wxControl)
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(wxTextCtrl, wxControl)
|
BEGIN_EVENT_TABLE(wxTextCtrl, wxControl)
|
||||||
EVT_DROP_FILES(wxTextCtrl::OnDropFiles)
|
EVT_DROP_FILES(wxTextCtrl::OnDropFiles)
|
||||||
EVT_CHAR(wxTextCtrl::OnChar)
|
EVT_CHAR(wxTextCtrl::OnChar)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Text item
|
// Text item
|
||||||
wxTextCtrl::wxTextCtrl()
|
wxTextCtrl::wxTextCtrl()
|
||||||
#ifndef NO_TEXT_WINDOW_STREAM
|
#ifndef NO_TEXT_WINDOW_STREAM
|
||||||
:streambuf()
|
:streambuf()
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
m_fileName = "";
|
m_fileName = "";
|
||||||
@@ -395,10 +395,10 @@ long wxTextCtrl::XYToPosition(long x, long y) const
|
|||||||
{
|
{
|
||||||
/* It seems, that there is a bug in some versions of the Motif library,
|
/* It seems, that there is a bug in some versions of the Motif library,
|
||||||
so the original wxWin-Code doesn't work. */
|
so the original wxWin-Code doesn't work. */
|
||||||
/*
|
/*
|
||||||
Widget textWidget = (Widget) handle;
|
Widget textWidget = (Widget) handle;
|
||||||
return (long) XmTextXYToPos (textWidget, (Position) x, (Position) y);
|
return (long) XmTextXYToPos (textWidget, (Position) x, (Position) y);
|
||||||
*/
|
*/
|
||||||
/* Now a little workaround: */
|
/* Now a little workaround: */
|
||||||
long r=0;
|
long r=0;
|
||||||
for (int i=0; i<y; i++) r+=(GetLineLength(i)+1);
|
for (int i=0; i<y; i++) r+=(GetLineLength(i)+1);
|
||||||
@@ -449,8 +449,8 @@ wxString wxTextCtrl::GetLineText(long lineNo) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Text item
|
* Text item
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void wxTextCtrl::Command(wxCommandEvent & event)
|
void wxTextCtrl::Command(wxCommandEvent & event)
|
||||||
{
|
{
|
||||||
@@ -499,8 +499,8 @@ int wxTextCtrl::overflow(int c)
|
|||||||
// Make sure there is a put area
|
// Make sure there is a put area
|
||||||
if ( ! pptr() )
|
if ( ! pptr() )
|
||||||
{
|
{
|
||||||
/* This doesn't seem to be fatal so comment out error message */
|
/* This doesn't seem to be fatal so comment out error message */
|
||||||
// wxError("Put area not opened","Internal error");
|
// wxError("Put area not opened","Internal error");
|
||||||
setp( base(), base() );
|
setp( base(), base() );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -553,7 +553,7 @@ int wxTextCtrl::sync()
|
|||||||
if ( pptr() && pptr() > pbase() ) return overflow(EOF);
|
if ( pptr() && pptr() > pbase() ) return overflow(EOF);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
/* OLD CODE
|
/* OLD CODE
|
||||||
int len = pptr() - pbase();
|
int len = pptr() - pbase();
|
||||||
char *txt = new char[len+1];
|
char *txt = new char[len+1];
|
||||||
strncpy(txt, pbase(), len);
|
strncpy(txt, pbase(), len);
|
||||||
@@ -562,7 +562,7 @@ int wxTextCtrl::sync()
|
|||||||
setp(pbase(), epptr());
|
setp(pbase(), epptr());
|
||||||
delete[] txt;
|
delete[] txt;
|
||||||
return 0;
|
return 0;
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
//=========================================================================
|
//=========================================================================
|
||||||
|
@@ -263,11 +263,11 @@ static char *GetResourcePath(char *buf, const char *name, bool create = FALSE)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We have a cache for writing different resource files,
|
* We have a cache for writing different resource files,
|
||||||
* which will only get flushed when we call wxFlushResources().
|
* which will only get flushed when we call wxFlushResources().
|
||||||
* Build up a list of resource databases waiting to be written.
|
* Build up a list of resource databases waiting to be written.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
wxList wxResourceCache (wxKEY_STRING);
|
wxList wxResourceCache (wxKEY_STRING);
|
||||||
|
|
||||||
@@ -504,9 +504,9 @@ void wxXMergeDatabases (wxApp * theApp, Display * display)
|
|||||||
#if 0
|
#if 0
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Not yet used but may be useful.
|
* Not yet used but may be useful.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
wxSetDefaultResources (const Widget w, const char **resourceSpec, const char *name)
|
wxSetDefaultResources (const Widget w, const char **resourceSpec, const char *name)
|
||||||
{
|
{
|
||||||
@@ -543,7 +543,7 @@ wxSetDefaultResources (const Widget w, const char **resourceSpec, const char *na
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
// 0
|
// 0
|
||||||
|
|
||||||
#endif // wxUSE_RESOURCES
|
#endif // wxUSE_RESOURCES
|
||||||
|
|
||||||
@@ -804,13 +804,13 @@ char wxFindMnemonic (const char *s)
|
|||||||
|
|
||||||
char * wxFindAccelerator (char *s)
|
char * wxFindAccelerator (char *s)
|
||||||
{
|
{
|
||||||
// The accelerator text is after the \t char.
|
// The accelerator text is after the \t char.
|
||||||
while (*s && *s != '\t')
|
while (*s && *s != '\t')
|
||||||
s++;
|
s++;
|
||||||
if (*s == '\0')
|
if (*s == '\0')
|
||||||
return (NULL);
|
return (NULL);
|
||||||
s++;
|
s++;
|
||||||
/*
|
/*
|
||||||
Now we need to format it as X standard:
|
Now we need to format it as X standard:
|
||||||
|
|
||||||
input output
|
input output
|
||||||
@@ -856,7 +856,7 @@ char * wxFindAccelerator (char *s)
|
|||||||
|
|
||||||
XmString wxFindAcceleratorText (char *s)
|
XmString wxFindAcceleratorText (char *s)
|
||||||
{
|
{
|
||||||
// The accelerator text is after the \t char.
|
// The accelerator text is after the \t char.
|
||||||
while (*s && *s != '\t')
|
while (*s && *s != '\t')
|
||||||
s++;
|
s++;
|
||||||
if (*s == '\0')
|
if (*s == '\0')
|
||||||
@@ -1130,11 +1130,11 @@ static char * GetIniFile (char *dest, const char *filename)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Some colour manipulation routines
|
* Some colour manipulation routines
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void wxHSVToXColor(wxHSV *hsv,XColor *rgb)
|
void wxHSVToXColor(wxHSV *hsv,XColor *rgb)
|
||||||
{
|
{
|
||||||
int h = hsv->h;
|
int h = hsv->h;
|
||||||
int s = hsv->s;
|
int s = hsv->s;
|
||||||
int v = hsv->v;
|
int v = hsv->v;
|
||||||
@@ -1162,10 +1162,10 @@ void wxHSVToXColor(wxHSV *hsv,XColor *rgb)
|
|||||||
rgb->red = r << 8;
|
rgb->red = r << 8;
|
||||||
rgb->green = g << 8;
|
rgb->green = g << 8;
|
||||||
rgb->blue = b << 8;
|
rgb->blue = b << 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxXColorToHSV(wxHSV *hsv,XColor *rgb)
|
void wxXColorToHSV(wxHSV *hsv,XColor *rgb)
|
||||||
{
|
{
|
||||||
int r = rgb->red >> 8;
|
int r = rgb->red >> 8;
|
||||||
int g = rgb->green >> 8;
|
int g = rgb->green >> 8;
|
||||||
int b = rgb->blue >> 8;
|
int b = rgb->blue >> 8;
|
||||||
@@ -1191,10 +1191,10 @@ void wxXColorToHSV(wxHSV *hsv,XColor *rgb)
|
|||||||
hsv->h = h;
|
hsv->h = h;
|
||||||
hsv->s = (s * wxMAX_SV) / wxMAX_RGB;
|
hsv->s = (s * wxMAX_SV) / wxMAX_RGB;
|
||||||
hsv->v = (v * wxMAX_SV) / wxMAX_RGB;
|
hsv->v = (v * wxMAX_SV) / wxMAX_RGB;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxAllocNearestColor(Display *d,Colormap cmp,XColor *xc)
|
void wxAllocNearestColor(Display *d,Colormap cmp,XColor *xc)
|
||||||
{
|
{
|
||||||
int llp;
|
int llp;
|
||||||
|
|
||||||
int screen = DefaultScreen(d);
|
int screen = DefaultScreen(d);
|
||||||
@@ -1228,16 +1228,16 @@ void wxAllocNearestColor(Display *d,Colormap cmp,XColor *xc)
|
|||||||
cout << "wxAllocNearestColor : Warning : Cannot find nearest color !\n";
|
cout << "wxAllocNearestColor : Warning : Cannot find nearest color !\n";
|
||||||
|
|
||||||
delete[] color_defs;
|
delete[] color_defs;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxAllocColor(Display *d,Colormap cmp,XColor *xc)
|
void wxAllocColor(Display *d,Colormap cmp,XColor *xc)
|
||||||
{
|
{
|
||||||
if (!XAllocColor(d,cmp,xc))
|
if (!XAllocColor(d,cmp,xc))
|
||||||
{
|
{
|
||||||
// cout << "wxAllocColor : Warning : Can not allocate color, attempt find nearest !\n";
|
// cout << "wxAllocColor : Warning : Can not allocate color, attempt find nearest !\n";
|
||||||
wxAllocNearestColor(d,cmp,xc);
|
wxAllocNearestColor(d,cmp,xc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// These functions duplicate those in wxWindow, but are needed
|
// These functions duplicate those in wxWindow, but are needed
|
||||||
|
@@ -53,7 +53,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __SVR4__
|
#ifdef __SVR4__
|
||||||
#include <sys/systeminfo.h>
|
#include <sys/systeminfo.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __SOLARIS__
|
#ifdef __SOLARIS__
|
||||||
@@ -140,7 +140,7 @@ long wxExecute(char **argv, bool sync, wxProcess *handler)
|
|||||||
}
|
}
|
||||||
else if (pid == 0)
|
else if (pid == 0)
|
||||||
{
|
{
|
||||||
/* GUILHEM: Close all fds when sync == 0 */
|
/* GUILHEM: Close all fds when sync == 0 */
|
||||||
if (sync == 0)
|
if (sync == 0)
|
||||||
for (int fd=0;fd<FD_SETSIZE;fd++) {
|
for (int fd=0;fd<FD_SETSIZE;fd++) {
|
||||||
if (proc_link[1] != fd)
|
if (proc_link[1] != fd)
|
||||||
@@ -152,9 +152,9 @@ long wxExecute(char **argv, bool sync, wxProcess *handler)
|
|||||||
#else
|
#else
|
||||||
execvp (*argv, argv);
|
execvp (*argv, argv);
|
||||||
#endif
|
#endif
|
||||||
/* GUILHEM: Reopen output stream */
|
/* GUILHEM: Reopen output stream */
|
||||||
// open("/dev/console", O_WRONLY);
|
// open("/dev/console", O_WRONLY);
|
||||||
/* GUILHEM: End */
|
/* GUILHEM: End */
|
||||||
if (errno == ENOENT)
|
if (errno == ENOENT)
|
||||||
printf ("%s: command not found\n", *argv);
|
printf ("%s: command not found\n", *argv);
|
||||||
else
|
else
|
||||||
|
@@ -69,13 +69,13 @@ extern wxList wxPendingDelete;
|
|||||||
IMPLEMENT_DYNAMIC_CLASS(wxWindow, wxEvtHandler)
|
IMPLEMENT_DYNAMIC_CLASS(wxWindow, wxEvtHandler)
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(wxWindow, wxEvtHandler)
|
BEGIN_EVENT_TABLE(wxWindow, wxEvtHandler)
|
||||||
EVT_CHAR(wxWindow::OnChar)
|
EVT_CHAR(wxWindow::OnChar)
|
||||||
EVT_KEY_DOWN(wxWindow::OnKeyDown)
|
EVT_KEY_DOWN(wxWindow::OnKeyDown)
|
||||||
EVT_KEY_UP(wxWindow::OnKeyUp)
|
EVT_KEY_UP(wxWindow::OnKeyUp)
|
||||||
EVT_ERASE_BACKGROUND(wxWindow::OnEraseBackground)
|
EVT_ERASE_BACKGROUND(wxWindow::OnEraseBackground)
|
||||||
EVT_SYS_COLOUR_CHANGED(wxWindow::OnSysColourChanged)
|
EVT_SYS_COLOUR_CHANGED(wxWindow::OnSysColourChanged)
|
||||||
EVT_INIT_DIALOG(wxWindow::OnInitDialog)
|
EVT_INIT_DIALOG(wxWindow::OnInitDialog)
|
||||||
EVT_IDLE(wxWindow::OnIdle)
|
EVT_IDLE(wxWindow::OnIdle)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -342,19 +342,19 @@ bool wxWindow::Create(wxWindow *parent, wxWindowID id,
|
|||||||
// New translations for getting mouse motion feedback
|
// New translations for getting mouse motion feedback
|
||||||
String translations =
|
String translations =
|
||||||
"<Btn1Motion>: wxCanvasMotionEvent() DrawingAreaInput() ManagerGadgetButtonMotion()\n\
|
"<Btn1Motion>: wxCanvasMotionEvent() DrawingAreaInput() ManagerGadgetButtonMotion()\n\
|
||||||
<Btn2Motion>: wxCanvasMotionEvent() DrawingAreaInput() ManagerGadgetButtonMotion()\n\
|
<Btn2Motion>: wxCanvasMotionEvent() DrawingAreaInput() ManagerGadgetButtonMotion()\n\
|
||||||
<Btn3Motion>: wxCanvasMotionEvent() DrawingAreaInput() ManagerGadgetButtonMotion()\n\
|
<Btn3Motion>: wxCanvasMotionEvent() DrawingAreaInput() ManagerGadgetButtonMotion()\n\
|
||||||
<BtnMotion>: wxCanvasMotionEvent() DrawingAreaInput() ManagerGadgetButtonMotion()\n\
|
<BtnMotion>: wxCanvasMotionEvent() DrawingAreaInput() ManagerGadgetButtonMotion()\n\
|
||||||
<Btn1Down>: DrawingAreaInput() ManagerGadgetArm()\n\
|
<Btn1Down>: DrawingAreaInput() ManagerGadgetArm()\n\
|
||||||
<Btn2Down>: DrawingAreaInput() ManagerGadgetArm()\n\
|
<Btn2Down>: DrawingAreaInput() ManagerGadgetArm()\n\
|
||||||
<Btn3Down>: DrawingAreaInput() ManagerGadgetArm()\n\
|
<Btn3Down>: DrawingAreaInput() ManagerGadgetArm()\n\
|
||||||
<Btn1Up>: DrawingAreaInput() ManagerGadgetActivate()\n\
|
<Btn1Up>: DrawingAreaInput() ManagerGadgetActivate()\n\
|
||||||
<Btn2Up>: DrawingAreaInput() ManagerGadgetActivate()\n\
|
<Btn2Up>: DrawingAreaInput() ManagerGadgetActivate()\n\
|
||||||
<Btn3Up>: DrawingAreaInput() ManagerGadgetActivate()\n\
|
<Btn3Up>: DrawingAreaInput() ManagerGadgetActivate()\n\
|
||||||
<Motion>: wxCanvasMotionEvent() DrawingAreaInput()\n\
|
<Motion>: wxCanvasMotionEvent() DrawingAreaInput()\n\
|
||||||
<EnterWindow>: wxCanvasMotionEvent() DrawingAreaInput()\n\
|
<EnterWindow>: wxCanvasMotionEvent() DrawingAreaInput()\n\
|
||||||
<LeaveWindow>: wxCanvasMotionEvent() DrawingAreaInput()\n\
|
<LeaveWindow>: wxCanvasMotionEvent() DrawingAreaInput()\n\
|
||||||
<Key>: DrawingAreaInput()";
|
<Key>: DrawingAreaInput()";
|
||||||
|
|
||||||
XtActionsRec actions[1];
|
XtActionsRec actions[1];
|
||||||
actions[0].string = "wxCanvasMotionEvent";
|
actions[0].string = "wxCanvasMotionEvent";
|
||||||
@@ -380,7 +380,7 @@ bool wxWindow::Create(wxWindow *parent, wxWindowID id,
|
|||||||
m_drawingArea = (WXWidget) XtVaCreateWidget ((char*) (const char*) name,
|
m_drawingArea = (WXWidget) XtVaCreateWidget ((char*) (const char*) name,
|
||||||
xmDrawingAreaWidgetClass, (Widget) m_scrolledWindow,
|
xmDrawingAreaWidgetClass, (Widget) m_scrolledWindow,
|
||||||
XmNunitType, XmPIXELS,
|
XmNunitType, XmPIXELS,
|
||||||
// XmNresizePolicy, XmRESIZE_ANY,
|
// XmNresizePolicy, XmRESIZE_ANY,
|
||||||
XmNresizePolicy, XmRESIZE_NONE,
|
XmNresizePolicy, XmRESIZE_NONE,
|
||||||
XmNmarginHeight, 0,
|
XmNmarginHeight, 0,
|
||||||
XmNmarginWidth, 0,
|
XmNmarginWidth, 0,
|
||||||
@@ -917,7 +917,7 @@ int wxWindow::GetCharHeight() const
|
|||||||
XCharStruct overall;
|
XCharStruct overall;
|
||||||
XTextExtents ((XFontStruct*) pFontStruct, "x", 1, &direction, &ascent,
|
XTextExtents ((XFontStruct*) pFontStruct, "x", 1, &direction, &ascent,
|
||||||
&descent, &overall);
|
&descent, &overall);
|
||||||
// return (overall.ascent + overall.descent);
|
// return (overall.ascent + overall.descent);
|
||||||
return (ascent + descent);
|
return (ascent + descent);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1174,7 +1174,7 @@ int wxWindow::GetScrollPos(int orient) const
|
|||||||
return m_scrollPosX;
|
return m_scrollPosX;
|
||||||
else
|
else
|
||||||
return m_scrollPosY;
|
return m_scrollPosY;
|
||||||
/*
|
/*
|
||||||
Widget scrollBar = (Widget) ((orient == wxHORIZONTAL) ? m_hScrollBar : m_vScrollBar);
|
Widget scrollBar = (Widget) ((orient == wxHORIZONTAL) ? m_hScrollBar : m_vScrollBar);
|
||||||
if (scrollBar)
|
if (scrollBar)
|
||||||
{
|
{
|
||||||
@@ -1185,7 +1185,7 @@ int wxWindow::GetScrollPos(int orient) const
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
return 0;
|
return 0;
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
// This now returns the whole range, not just the number
|
// This now returns the whole range, not just the number
|
||||||
@@ -1314,7 +1314,7 @@ void wxWindow::SetScrollbar(int orient, int pos, int thumbVisible,
|
|||||||
// Does a physical scroll
|
// Does a physical scroll
|
||||||
void wxWindow::ScrollWindow(int dx, int dy, const wxRect *rect)
|
void wxWindow::ScrollWindow(int dx, int dy, const wxRect *rect)
|
||||||
{
|
{
|
||||||
// cerr << "Scrolling. delta = " << dx << ", " << dy << endl;
|
// cerr << "Scrolling. delta = " << dx << ", " << dy << endl;
|
||||||
int x, y, w, h;
|
int x, y, w, h;
|
||||||
if (rect)
|
if (rect)
|
||||||
{
|
{
|
||||||
@@ -1475,15 +1475,15 @@ void wxWindow::ScrollWindow(int dx, int dy, const wxRect *rect)
|
|||||||
void wxWindow::OnChar(wxKeyEvent& event)
|
void wxWindow::OnChar(wxKeyEvent& event)
|
||||||
{
|
{
|
||||||
/* ??
|
/* ??
|
||||||
if ( event.KeyCode() == WXK_TAB ) {
|
if ( event.KeyCode() == WXK_TAB ) {
|
||||||
// propagate the TABs to the parent - it's up to it to decide what
|
// propagate the TABs to the parent - it's up to it to decide what
|
||||||
// to do with it
|
// to do with it
|
||||||
if ( GetParent() ) {
|
if ( GetParent() ) {
|
||||||
if ( GetParent()->ProcessEvent(event) )
|
if ( GetParent()->ProcessEvent(event) )
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindow::OnKeyDown(wxKeyEvent& event)
|
void wxWindow::OnKeyDown(wxKeyEvent& event)
|
||||||
@@ -1526,7 +1526,7 @@ bool wxWindow::TransferDataToWindow()
|
|||||||
if ( child->GetValidator() &&
|
if ( child->GetValidator() &&
|
||||||
!child->GetValidator()->TransferToWindow() )
|
!child->GetValidator()->TransferToWindow() )
|
||||||
{
|
{
|
||||||
wxMessageBox("Application Error", "Could not transfer data to window", wxOK|wxICON_EXCLAMATION);
|
wxLogError("Could not transfer data to window.");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1759,8 +1759,8 @@ void wxWindow::SetSizer(wxSizer *sizer)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* New version
|
* New version
|
||||||
*/
|
*/
|
||||||
|
|
||||||
bool wxWindow::Layout()
|
bool wxWindow::Layout()
|
||||||
{
|
{
|
||||||
@@ -2234,8 +2234,8 @@ bool wxWindow::IsExposed(const wxRect& rect) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Allocates control IDs
|
* Allocates control IDs
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int wxWindow::NewControlId()
|
int wxWindow::NewControlId()
|
||||||
{
|
{
|
||||||
@@ -2270,7 +2270,7 @@ void wxWidgetResizeProc(Widget w, XConfigureEvent *event, String args[], int *nu
|
|||||||
bool wxAddWindowToTable(Widget w, wxWindow *win)
|
bool wxAddWindowToTable(Widget w, wxWindow *win)
|
||||||
{
|
{
|
||||||
wxWindow *oldItem = NULL;
|
wxWindow *oldItem = NULL;
|
||||||
// printf("Adding widget %ld, name = %s\n", w, win->GetClassInfo()->GetClassName());
|
// printf("Adding widget %ld, name = %s\n", w, win->GetClassInfo()->GetClassName());
|
||||||
if ((oldItem = (wxWindow *)wxWidgetHashTable->Get ((long) w)))
|
if ((oldItem = (wxWindow *)wxWidgetHashTable->Get ((long) w)))
|
||||||
{
|
{
|
||||||
wxLogError("Widget table clash: new widget is %ld, %s", (long)w, win->GetClassInfo()->GetClassName());
|
wxLogError("Widget table clash: new widget is %ld, %s", (long)w, win->GetClassInfo()->GetClassName());
|
||||||
@@ -2374,7 +2374,7 @@ wxCanvasEnterLeave (Widget drawingArea, XtPointer clientData, XCrossingEvent * e
|
|||||||
//if (event->mode!=NotifyNormal)
|
//if (event->mode!=NotifyNormal)
|
||||||
// return ;
|
// return ;
|
||||||
|
|
||||||
// ev = *((XEvent *) event); // Causes Purify error (copying too many bytes)
|
// ev = *((XEvent *) event); // Causes Purify error (copying too many bytes)
|
||||||
((XCrossingEvent &) ev) = *event;
|
((XCrossingEvent &) ev) = *event;
|
||||||
|
|
||||||
cbs.reason = XmCR_INPUT;
|
cbs.reason = XmCR_INPUT;
|
||||||
@@ -2452,14 +2452,14 @@ void wxCanvasInputEvent (Widget drawingArea, XtPointer data, XmDrawingAreaCallba
|
|||||||
//if (local_event.xcrossing.mode!=NotifyNormal)
|
//if (local_event.xcrossing.mode!=NotifyNormal)
|
||||||
// return ; // Ignore grab events
|
// return ; // Ignore grab events
|
||||||
eventType = wxEVT_ENTER_WINDOW;
|
eventType = wxEVT_ENTER_WINDOW;
|
||||||
// canvas->GetEventHandler()->OnSetFocus();
|
// canvas->GetEventHandler()->OnSetFocus();
|
||||||
}
|
}
|
||||||
else if (local_event.xany.type == LeaveNotify)
|
else if (local_event.xany.type == LeaveNotify)
|
||||||
{
|
{
|
||||||
//if (local_event.xcrossing.mode!=NotifyNormal)
|
//if (local_event.xcrossing.mode!=NotifyNormal)
|
||||||
// return ; // Ignore grab events
|
// return ; // Ignore grab events
|
||||||
eventType = wxEVT_LEAVE_WINDOW;
|
eventType = wxEVT_LEAVE_WINDOW;
|
||||||
// canvas->GetEventHandler()->OnKillFocus();
|
// canvas->GetEventHandler()->OnKillFocus();
|
||||||
}
|
}
|
||||||
else if (local_event.xany.type == MotionNotify)
|
else if (local_event.xany.type == MotionNotify)
|
||||||
{
|
{
|
||||||
@@ -2599,12 +2599,18 @@ void wxCanvasInputEvent (Widget drawingArea, XtPointer data, XmDrawingAreaCallba
|
|||||||
case KeyPress:
|
case KeyPress:
|
||||||
{
|
{
|
||||||
KeySym keySym;
|
KeySym keySym;
|
||||||
// XComposeStatus compose;
|
// XComposeStatus compose;
|
||||||
// (void) XLookupString ((XKeyEvent *) & local_event, wxBuffer, 20, &keySym, &compose);
|
// (void) XLookupString ((XKeyEvent *) & local_event, wxBuffer, 20, &keySym, &compose);
|
||||||
(void) XLookupString ((XKeyEvent *) & local_event, wxBuffer, 20, &keySym, NULL);
|
(void) XLookupString ((XKeyEvent *) & local_event, wxBuffer, 20, &keySym, NULL);
|
||||||
int id = wxCharCodeXToWX (keySym);
|
int id = wxCharCodeXToWX (keySym);
|
||||||
|
|
||||||
wxKeyEvent event (wxEVT_CHAR);
|
wxEventType eventType = wxEVT_CHAR;
|
||||||
|
|
||||||
|
// TODO: Is this the correct criterion for wxEVT_KEY_DOWN down versus wxEVT_CHAR?
|
||||||
|
if (id > WXK_START) // Non-ASCII values
|
||||||
|
eventType = wxEVT_KEY_DOWN;
|
||||||
|
|
||||||
|
wxKeyEvent event (eventType);
|
||||||
|
|
||||||
if (local_event.xkey.state & ShiftMask)
|
if (local_event.xkey.state & ShiftMask)
|
||||||
event.m_shiftDown = TRUE;
|
event.m_shiftDown = TRUE;
|
||||||
@@ -2637,6 +2643,32 @@ void wxCanvasInputEvent (Widget drawingArea, XtPointer data, XmDrawingAreaCallba
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case KeyRelease:
|
||||||
|
{
|
||||||
|
KeySym keySym;
|
||||||
|
(void) XLookupString ((XKeyEvent *) & local_event, wxBuffer, 20, &keySym, NULL);
|
||||||
|
int id = wxCharCodeXToWX (keySym);
|
||||||
|
|
||||||
|
wxKeyEvent event (wxEVT_KEY_UP);
|
||||||
|
|
||||||
|
if (local_event.xkey.state & ShiftMask)
|
||||||
|
event.m_shiftDown = TRUE;
|
||||||
|
if (local_event.xkey.state & ControlMask)
|
||||||
|
event.m_controlDown = TRUE;
|
||||||
|
if (local_event.xkey.state & Mod3Mask)
|
||||||
|
event.m_altDown = TRUE;
|
||||||
|
if (local_event.xkey.state & Mod1Mask)
|
||||||
|
event.m_metaDown = TRUE;
|
||||||
|
event.SetEventObject(canvas);
|
||||||
|
event.m_keyCode = id;
|
||||||
|
event.SetTimestamp(local_event.xkey.time);
|
||||||
|
|
||||||
|
if (id > -1)
|
||||||
|
{
|
||||||
|
canvas->GetEventHandler()->ProcessEvent (event);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
case FocusIn:
|
case FocusIn:
|
||||||
{
|
{
|
||||||
if (local_event.xfocus.detail != NotifyPointer)
|
if (local_event.xfocus.detail != NotifyPointer)
|
||||||
@@ -3175,8 +3207,8 @@ bool wxTranslateKeyEvent(wxKeyEvent& wxevent, wxWindow *win, Widget widget, XEve
|
|||||||
char buf[20];
|
char buf[20];
|
||||||
|
|
||||||
KeySym keySym;
|
KeySym keySym;
|
||||||
// XComposeStatus compose;
|
// XComposeStatus compose;
|
||||||
// (void) XLookupString ((XKeyEvent *) xevent, buf, 20, &keySym, &compose);
|
// (void) XLookupString ((XKeyEvent *) xevent, buf, 20, &keySym, &compose);
|
||||||
(void) XLookupString ((XKeyEvent *) xevent, buf, 20, &keySym, NULL);
|
(void) XLookupString ((XKeyEvent *) xevent, buf, 20, &keySym, NULL);
|
||||||
int id = wxCharCodeXToWX (keySym);
|
int id = wxCharCodeXToWX (keySym);
|
||||||
|
|
||||||
@@ -3361,7 +3393,7 @@ void wxWindow::ChangeFont(bool keepOriginalSize)
|
|||||||
int width, height, width1, height1;
|
int width, height, width1, height1;
|
||||||
GetSize(& width, & height);
|
GetSize(& width, & height);
|
||||||
|
|
||||||
// lesstif 0.87 hangs here
|
// lesstif 0.87 hangs here
|
||||||
#ifndef LESSTIF_VERSION
|
#ifndef LESSTIF_VERSION
|
||||||
XtVaSetValues (w,
|
XtVaSetValues (w,
|
||||||
XmNfontList, (XmFontList) m_windowFont.GetFontList(1.0, XtDisplay(w)),
|
XmNfontList, (XmFontList) m_windowFont.GetFontList(1.0, XtDisplay(w)),
|
||||||
@@ -3463,8 +3495,8 @@ bool wxWindow::ProcessAccelerator(wxKeyEvent& event)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* wxNoOptimize: switch off size optimization
|
* wxNoOptimize: switch off size optimization
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int wxNoOptimize::m_count = 0;
|
int wxNoOptimize::m_count = 0;
|
||||||
|
|
||||||
|
@@ -323,10 +323,6 @@ bool wxGetClipboardFormatName(wxDataFormat dataFormat, char *formatName, int max
|
|||||||
return (::GetClipboardFormatName((int) dataFormat, formatName, maxCount) > 0);
|
return (::GetClipboardFormatName((int) dataFormat, formatName, maxCount) > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* wxClipboard
|
|
||||||
*/
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// wxClipboard
|
// wxClipboard
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
Reference in New Issue
Block a user