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:
Julian Smart
1999-01-14 15:15:39 +00:00
parent 8de2e39c17
commit 2d120f8391
46 changed files with 9903 additions and 9564 deletions

View File

@@ -41,10 +41,6 @@ High Priority
- Get wxGLCanvas from 1.68 working.
- wxClipboard
- EVT_KEY_DOWN, EVT_KEY_UP events.
Low Priority
------------

View File

@@ -16,6 +16,8 @@ Please see also:
- Documentation: mention include files with each class.
- Document wxTime.
- Get Karsten to remove trashed CVS files:
include/wx/msw/magnif1.cur

View File

@@ -4,7 +4,7 @@
#if defined(__WXMSW__)
#include "wx/msw/ole/dataobj.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/dnd.h"
#include "wx/motif/dataobj.h"
#elif defined(__WXGTK__)
#include "wx/gtk/dataobj.h"
#elif defined(__WXQT__)

View File

@@ -23,17 +23,77 @@
#include "wx/setup.h"
#include "wx/list.h"
#include "wx/module.h"
bool WXDLLEXPORT wxOpenClipboard();
bool WXDLLEXPORT wxClipboardOpen();
bool WXDLLEXPORT wxCloseClipboard();
bool WXDLLEXPORT wxEmptyClipboard();
bool WXDLLEXPORT wxIsClipboardFormatAvailable(int dataFormat);
bool WXDLLEXPORT wxSetClipboardData(int dataFormat, wxObject *obj, int width = 0, int height = 0);
wxObject* WXDLLEXPORT wxGetClipboardData(int dataFormat, long *len = NULL);
int WXDLLEXPORT wxEnumClipboardFormats(int dataFormat);
int WXDLLEXPORT wxRegisterClipboardFormat(char *formatName);
bool WXDLLEXPORT wxGetClipboardFormatName(int dataFormat, char *formatName, int maxCount);
bool WXDLLEXPORT wxIsClipboardFormatAvailable(wxDataFormat dataFormat);
bool WXDLLEXPORT wxSetClipboardData(wxDataFormat dataFormat, wxObject *obj, int width = 0, int height = 0);
wxObject* WXDLLEXPORT wxGetClipboardData(wxDataFormat dataFormat, long *len = NULL);
wxDataFormat WXDLLEXPORT wxEnumClipboardFormats(wxDataFormat dataFormat);
wxDataFormat WXDLLEXPORT wxRegisterClipboardFormat(char *formatName);
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.
For plain text, a client is not necessary. */
@@ -100,5 +160,8 @@ void WXDLLEXPORT wxInitClipboard();
/* The clipboard */
WXDLLEXPORT_DATA(extern wxClipboard*) wxTheClipboard;
#endif
// Old clipboard class
#endif
// _WX_CLIPBRD_H_

View File

@@ -1,22 +1,27 @@
///////////////////////////////////////////////////////////////////////////////
// Name: dnd.h
// Purpose: Declaration of the wxDropTarget, wxDropSource class etc.
// Purpose: declaration of wxDropTarget, wxDropSource classes
// Author: Julian Smart
// RCS-ID: $Id$
// Copyright: (c) 1998 Julian Smart
// Copyright: (c) 1998 Vadim Zeitlin, Robert Roebling, Julian Smart
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_DND_H_
#define _WX_DND_H_
#ifdef __GNUG__
#pragma interface "dnd.h"
#pragma interface
#endif
#include "wx/defs.h"
#if wxUSE_DRAG_AND_DROP
#include "wx/object.h"
#include "wx/string.h"
#include "wx/dataobj.h"
#include "wx/cursor.h"
//-------------------------------------------------------------------------
@@ -25,119 +30,13 @@
class WXDLLEXPORT wxWindow;
class WXDLLEXPORT wxDataObject;
class WXDLLEXPORT wxTextDataObject;
class WXDLLEXPORT wxFileDataObject;
class WXDLLEXPORT wxDropTarget;
class WXDLLEXPORT wxTextDropTarget;
class WXDLLEXPORT wxFileDropTarget;
class WXDLLEXPORT wxPrivateDropTarget;
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
//-------------------------------------------------------------------------
@@ -151,16 +50,14 @@ class WXDLLEXPORT wxDropTarget: public wxObject
virtual void OnEnter() { }
virtual void OnLeave() { }
virtual bool OnDrop( long x, long y, const void *pData ) = 0;
// protected:
friend wxWindow;
virtual bool OnDrop( long x, long y, const void *data, size_t size ) = 0;
// Override these to indicate what kind of data you support:
virtual size_t GetFormatCount() const = 0;
virtual wxDataFormat GetFormat(size_t n) const = 0;
// implementation
};
//-------------------------------------------------------------------------
@@ -172,7 +69,7 @@ class WXDLLEXPORT wxTextDropTarget: public wxDropTarget
public:
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 );
protected:
@@ -181,6 +78,36 @@ class WXDLLEXPORT wxTextDropTarget: public wxDropTarget
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)
// ----------------------------------------------------------------------------
@@ -191,9 +118,9 @@ class WXDLLEXPORT wxFileDropTarget: public wxDropTarget
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,
size_t nFiles, const char * const aszFiles[]);
size_t nFiles, const char * const aszFiles[] );
protected:
@@ -205,14 +132,14 @@ class WXDLLEXPORT wxFileDropTarget: public wxDropTarget
// wxDropSource
//-------------------------------------------------------------------------
enum wxDragResult
{
enum wxDragResult
{
wxDragError, // error prevented the d&d operation from completing
wxDragNone, // drag target didn't accept the data
wxDragCopy, // the data was successfully copied
wxDragMove, // the data was successfully moved
wxDragCancel // the operation was cancelled by user (not an error)
};
};
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; };
protected:
// implementation
#if 0
void RegisterWindow(void);
void UnregisterWindow(void);
wxWindow *m_window;
wxDragResult m_retValue;
wxDataObject *m_data;
wxCursor m_defaultCursor;
wxCursor m_goaheadCursor;
#endif
};
#endif
// wxUSE_DRAG_AND_DROP
#endif
//_WX_DND_H_

View File

@@ -418,7 +418,6 @@ public:
void OnChar(wxKeyEvent& event);
void OnKeyDown(wxKeyEvent& event);
void OnKeyUp(wxKeyEvent& event);
void OnChar(wxKeyEvent& event);
void OnPaint(wxPaintEvent& event);
void OnIdle(wxIdleEvent& event);

View File

@@ -57,7 +57,7 @@ wxHashTable *wxWidgetHashTable = NULL;
#if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxApp, wxEvtHandler)
BEGIN_EVENT_TABLE(wxApp, wxEvtHandler)
EVT_IDLE(wxApp::OnIdle)
EVT_IDLE(wxApp::OnIdle)
END_EVENT_TABLE()
#endif
@@ -85,11 +85,11 @@ bool wxApp::Initialize()
// For PostScript printing
#if wxUSE_POSTSCRIPT
/* Done using wxModule now
/* Done using wxModule now
wxInitializePrintSetupData();
wxThePrintPaperDatabase = new wxPrintPaperDatabase;
wxThePrintPaperDatabase->CreateDatabase();
*/
*/
#endif
wxBitmap::InitStandardHandlers();
@@ -133,11 +133,11 @@ void wxApp::CleanUp()
wxTheColourDatabase = NULL;
#if wxUSE_POSTSCRIPT
/* Done using wxModule now
/* Done using wxModule now
wxInitializePrintSetupData(FALSE);
delete wxThePrintPaperDatabase;
wxThePrintPaperDatabase = NULL;
*/
*/
#endif
wxBitmap::CleanUpHandlers();
@@ -385,7 +385,7 @@ bool wxApp::Pending()
// Dispatch a message.
void wxApp::Dispatch()
{
// XtAppProcessEvent( (XtAppContext) wxTheApp->GetAppContext(), XtIMAll);
// XtAppProcessEvent( (XtAppContext) wxTheApp->GetAppContext(), XtIMAll);
XEvent event;
XtAppNextEvent((XtAppContext) GetAppContext(), &event);

View File

@@ -26,7 +26,6 @@
#include "wx/motif/private.h"
// TODO: correct symbol, path?
#if wxUSE_XPM
#include <X11/xpm.h>
#endif
@@ -355,8 +354,8 @@ wxBitmapHandler *wxBitmap::FindHandler(long bitmapType)
}
/*
* wxMask
*/
* wxMask
*/
wxMask::wxMask()
{
@@ -399,7 +398,7 @@ wxMask::~wxMask()
// Create a mask from a mono bitmap (copies the bitmap).
bool wxMask::Create(const wxBitmap& WXUNUSED(bitmap))
{
// TODO
// TODO
return FALSE;
}
@@ -407,7 +406,7 @@ bool wxMask::Create(const wxBitmap& WXUNUSED(bitmap))
// the transparent area
bool wxMask::Create(const wxBitmap& WXUNUSED(bitmap), int WXUNUSED(paletteIndex))
{
// TODO
// TODO
return FALSE;
}
@@ -415,13 +414,13 @@ bool wxMask::Create(const wxBitmap& WXUNUSED(bitmap), int WXUNUSED(paletteIndex)
// the transparent area
bool wxMask::Create(const wxBitmap& WXUNUSED(bitmap), const wxColour& WXUNUSED(colour))
{
// TODO
// TODO
return FALSE;
}
/*
* wxBitmapHandler
*/
* wxBitmapHandler
*/
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
{
@@ -653,7 +652,7 @@ bool wxXPMFileHandler::LoadFile( wxBitmap *bitmap, const wxString& name, long WX
return TRUE;
} else
{
// XpmDebugError(errorStatus, name);
// XpmDebugError(errorStatus, name);
M_BITMAPHANDLERDATA->m_ok = FALSE;
return FALSE;
}
@@ -764,7 +763,7 @@ bool wxXPMDataHandler::Create( wxBitmap *bitmap, void *data, long WXUNUSED(flags
}
else
{
// XpmDebugError(ErrorStatus, NULL);
// XpmDebugError(ErrorStatus, NULL);
M_BITMAPHANDLERDATA->m_ok = FALSE;
}
return M_BITMAPHANDLERDATA->m_ok ;
@@ -807,7 +806,7 @@ WXPixmap wxBitmap::GetLabelPixmap (WXWidget w)
Display *dpy = (Display*) M_BITMAPDATA->m_display;
#ifdef FOO
/*
/*
If we do:
if (labelPixmap) return labelPixmap;
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
SYNOPSIS
SYNOPSIS
Pixmap XCreateInsensitivePixmap( Display *display, Pixmap pixmap )
DESCRIPTION
DESCRIPTION
This function creates a grayed-out copy of the argument pixmap, suitable
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
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
default X error handler prints a diagnostic and calls exit().
SEE ALSO
SEE ALSO
XCopyArea(3), XCreateBitmapFromData(3), XCreateGC(3), XCreatePixmap(3),
XFillRectangle(3), exit(2)
AUTHOR
AUTHOR
John R Veregge - john@puente.jpl.nasa.gov
Advanced Engineering and Prototyping Group (AEG)
Information Systems Technology Section (395)
@@ -952,7 +951,7 @@ Pixmap
XCreateInsensitivePixmap( Display *display, Pixmap pixmap )
{
static
static
char stipple_data[] =
{
0x55, 0x55, 0xAA, 0xAA, 0x55, 0x55, 0xAA, 0xAA,

View File

@@ -56,12 +56,12 @@ bool wxBitmapButton::Create(wxWindow *parent, wxWindowID id, const wxBitmap& bit
m_marginX = 0;
m_marginY = 0;
/*
/*
int x = pos.x;
int y = pos.y;
int width = size.x;
int height = size.y;
*/
*/
if (id == -1)
m_windowId = NewControlId();
@@ -87,7 +87,7 @@ bool wxBitmapButton::Create(wxWindow *parent, wxWindowID id, const wxBitmap& bit
#else
xmPushButtonWidgetClass, parentWidget,
#endif
// XmNdefaultButtonShadowThickness, 1, // See comment for wxButton::SetDefault
// XmNdefaultButtonShadowThickness, 1, // See comment for wxButton::SetDefault
NULL);
m_mainWidget = (WXWidget) buttonWidget;

View File

@@ -70,7 +70,7 @@ bool wxButton::Create(wxWindow *parent, wxWindowID id, const wxString& label,
parentWidget,
XmNfontList, fontList,
XmNlabelString, text,
// XmNdefaultButtonShadowThickness, 1, // See comment for wxButton::SetDefault
// XmNdefaultButtonShadowThickness, 1, // See comment for wxButton::SetDefault
NULL);
XmStringFree (text);
@@ -116,7 +116,7 @@ void wxButton::SetDefault()
}
} // while
// XtVaSetValues((Widget)handle, XmNshowAsDefault, 1, NULL);
// XtVaSetValues((Widget)handle, XmNshowAsDefault, 1, NULL);
XtVaSetValues ((Widget) parent->GetMainWidget(), XmNdefaultButton, (Widget) GetMainWidget(), NULL);
}

View File

@@ -24,7 +24,7 @@
// ============================================================================
#if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxCheckListBox, wxListBox)
IMPLEMENT_DYNAMIC_CLASS(wxCheckListBox, wxListBox)
#endif
// ----------------------------------------------------------------------------

View File

@@ -85,7 +85,7 @@ bool wxChoice::Create(wxWindow *parent, wxWindowID id,
*/
m_menuWidget = (WXWidget) XmCreatePulldownMenu ((Widget) m_formWidget, "choiceMenu", NULL, 0);
// int i;
// int i;
if (n > 0)
{
int i;
@@ -141,7 +141,7 @@ wxChoice::~wxChoice()
// can cause crashes on some machines. It will
// be deleted implicitly by deleting the parent form
// anyway.
// XtDestroyWidget (menuWidget);
// XtDestroyWidget (menuWidget);
if (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());
event.SetEventObject(item);
event.m_commandInt = item->FindString (s);
// event.m_commandString = s;
// event.m_commandString = s;
item->ProcessCommand (event);
}
}

View File

@@ -20,77 +20,366 @@
#include "wx/utils.h"
#include "wx/metafile.h"
#include "wx/clipbrd.h"
#include "wx/dataobj.h"
#include <Xm/Xm.h>
#include <Xm/CutPaste.h>
#include <string.h>
#if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxClipboard, wxObject)
IMPLEMENT_ABSTRACT_CLASS(wxClipboardClient, wxObject)
// IMPLEMENT_DYNAMIC_CLASS(wxClipboard, wxObject)
// IMPLEMENT_ABSTRACT_CLASS(wxClipboardClient, wxObject)
#endif
static bool gs_clipboardIsOpen = FALSE;
bool wxOpenClipboard()
{
// TODO
if (!gs_clipboardIsOpen)
{
gs_clipboardIsOpen = TRUE;
return TRUE;
}
else
return FALSE;
}
bool wxCloseClipboard()
{
// TODO
if (gs_clipboardIsOpen)
{
gs_clipboardIsOpen = FALSE;
return TRUE;
}
else
return FALSE;
}
bool wxEmptyClipboard()
{
// TODO
return FALSE;
// No equivalent in Motif
return TRUE;
}
bool wxClipboardOpen()
{
// TODO
return FALSE;
return gs_clipboardIsOpen;
}
bool wxIsClipboardFormatAvailable(int dataFormat)
bool wxIsClipboardFormatAvailable(wxDataFormat dataFormat)
{
// TODO
// Only text is supported.
if (dataFormat != wxDF_TEXT)
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;
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;
}
int wxEnumClipboardFormats(int dataFormat)
wxDataFormat wxEnumClipboardFormats(wxDataFormat dataFormat)
{
// TODO
return 0;
// Only wxDF_TEXT supported
if (dataFormat == (wxDataFormat) 0)
return wxDF_TEXT;
else
return (wxDataFormat) 0;
}
int wxRegisterClipboardFormat(char *formatName)
wxDataFormat wxRegisterClipboardFormat(char *formatName)
{
// TODO
return 0;
// Not supported
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;
}
//-----------------------------------------------------------------------------
// 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;
@@ -234,4 +523,5 @@ char *wxClipboard::GetClipboardData(char *format, long *length, long time)
return receivedString;
}
}
#endif

View File

@@ -146,21 +146,21 @@ But in many cases, that is still better than always using black.
Chris Breeze <chris@hel.co.uk>
Improvements:
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
since we are only interested in the top 8-bits of R, G and B we
can perform integer arithmetic.
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
can perform integer arithmetic.
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.
Possible further improvements:
1) Scan the lookup table and sort the colour cells in order of
increasing
Possible further improvements:
1) Scan the lookup table and sort the colour cells in order of
increasing
distance from the desired colour. Then attempt to allocate a
read-only
read-only
colour starting from the nearest match.
2) Linear RGB distance is not a particularly good method of colour
matching
2) Linear RGB distance is not a particularly good method of colour
matching
(though it is quick). Converting the colour to HLS and then comparing
may give better matching.
-------------------------------------------*/

View File

@@ -72,7 +72,7 @@ wxDC::wxDC(void)
m_minY = m_minY = 100000;
m_logicalFunction = wxCOPY;
// m_textAlignment = wxALIGN_TOP_LEFT;
// m_textAlignment = wxALIGN_TOP_LEFT;
m_backgroundMode = wxTRANSPARENT;
m_textForegroundColour = *wxBLACK;
@@ -84,7 +84,7 @@ wxDC::wxDC(void)
m_isInteractive = FALSE;
// m_palette = wxAPP_COLOURMAP;
// m_palette = wxAPP_COLOURMAP;
};
wxDC::~wxDC(void)
@@ -103,7 +103,7 @@ void wxDC::DrawBitmap( const wxBitmap& bitmap, long x, long y, bool useMask )
wxMemoryDC memDC;
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.
if (useMask)
{
@@ -112,7 +112,7 @@ void wxDC::DrawBitmap( const wxBitmap& bitmap, long x, long y, bool useMask )
memDC.SetBackground(* GetBackground());
memDC.Clear();
}
*/
*/
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 )
{
// if (x) *x = m_externalDeviceOriginX;
// if (y) *y = m_externalDeviceOriginY;
// if (x) *x = m_externalDeviceOriginX;
// if (y) *y = m_externalDeviceOriginY;
if (x) *x = m_deviceOriginX;
if (y) *y = m_deviceOriginY;
};

View File

@@ -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
parameters. Therefore, it is impossible to independently maintain
@@ -59,7 +59,7 @@ static Pixmap bdiag, cdiag, fdiag, cross, horiz, verti;
#define RAD2DEG 57.2957795131
// Fudge factor. Obsolete?
// No. Robert Roebling
// No. Robert Roebling
#define WX_GC_CF 1
//-----------------------------------------------------------------------------
@@ -84,7 +84,7 @@ wxWindowDC::wxWindowDC(void)
m_currentPenDash = (char*) NULL;
m_currentStyle = -1;
m_currentFill = -1;
// m_currentBkMode = wxTRANSPARENT;
// m_currentBkMode = wxTRANSPARENT;
m_colour = wxColourDisplay();
m_display = (WXDisplay*) NULL;
m_currentRegion = (WXRegion) 0;
@@ -108,7 +108,7 @@ wxWindowDC::wxWindowDC( wxWindow *window )
m_currentPenDash = (char*) NULL;
m_currentStyle = -1;
m_currentFill = -1;
// m_currentBkMode = wxTRANSPARENT;
// m_currentBkMode = wxTRANSPARENT;
m_colour = wxColourDisplay();
m_currentRegion = (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;
// FreeGetPixelCache();
// FreeGetPixelCache();
int xx1 = XLOG2DEV (x1);
int yy1 = YLOG2DEV (y1);
@@ -373,7 +373,7 @@ void wxWindowDC::DrawPoint( long x, long y )
{
if (!Ok()) return;
// FreeGetPixelCache();
// FreeGetPixelCache();
if (m_pen.Ok() && m_autoSetting)
SetPen (m_pen);
@@ -389,7 +389,7 @@ void wxWindowDC::DrawLines( int n, wxPoint points[], long xoffset, long yoffset
{
if (!Ok()) return;
// FreeGetPixelCache();
// FreeGetPixelCache();
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[],
long xoffset, long yoffset, int fillStyle )
{
// FreeGetPixelCache();
// FreeGetPixelCache();
XPoint *xpoints1 = 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;
// FreeGetPixelCache();
// FreeGetPixelCache();
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;
// FreeGetPixelCache();
// FreeGetPixelCache();
// 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);
// Top-right
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);
// Bottom-right
XFillArc ((Display*) m_display, (Pixmap) m_pixmap, (GC) m_gc, xd + wd - rw_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);
// Bottom-left
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);
XFillArc ((Display*) m_display, (Pixmap) m_window->GetBackingPixmap(),(GC) m_gcBacking,
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);
XFillArc ((Display*) m_display, (Pixmap) m_window->GetBackingPixmap(),(GC) m_gcBacking,
xd2 + wd2 - rw_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);
XFillArc ((Display*) m_display, (Pixmap) m_window->GetBackingPixmap(),(GC) m_gcBacking,
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,
rw_d, rh_d, 90 * 64, 90 * 64);
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);
XDrawArc ((Display*) m_display, (Pixmap) m_pixmap, (GC) m_gc, xd + wd - rw_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);
XDrawArc ((Display*) m_display, (Pixmap) m_window->GetBackingPixmap(),(GC) m_gcBacking,
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);
XDrawArc ((Display*) m_display, (Pixmap) m_window->GetBackingPixmap(),(GC) m_gcBacking,
xd2 + wd2 - rw_d2,
@@ -734,7 +734,7 @@ void wxWindowDC::DrawEllipse( long x, long y, long width, long height )
width = - width ;
}
// FreeGetPixelCache();
// FreeGetPixelCache();
static const int angle = 23040;
@@ -778,8 +778,8 @@ bool wxWindowDC::CanDrawBitmap(void) const
};
/* 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,
Drawable src, Drawable dest,
@@ -838,7 +838,7 @@ static void XCopyRemote(Display *src_display, Display *dest_display,
all_cache = TRUE;
}
install:
install:
XPutPixel(destimage, i, j, pixel);
}
@@ -860,7 +860,7 @@ void wxWindowDC::DrawIcon( const wxIcon &icon, long x, long y)
DrawBitmap(icon, x, y, TRUE);
#if 0
// FreeGetPixelCache();
// FreeGetPixelCache();
// Be sure that foreground pixels (1) of
// 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;
// FreeGetPixelCache();
// FreeGetPixelCache();
// Be sure that foreground pixels (1) of
// 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())
{
// +++ 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)
{
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;
XTextExtents ((XFontStruct*) pFontStruct, "x", 1, &direction, &ascent,
&descent, &overall);
// return XDEV2LOGREL(overall.ascent + overall.descent);
// return XDEV2LOGREL(overall.ascent + overall.descent);
return XDEV2LOGREL(ascent + descent);
};
@@ -2026,7 +2026,7 @@ void wxWindowDC:: SetDCClipping ()
XIntersectRegion ((Region) m_userRegion, (Region) m_userRegion, (Region) m_currentRegion);
else if (m_window && m_window->GetUpdateRegion().Ok())
XIntersectRegion ((Region) m_window->GetUpdateRegion().GetXRegion(), (Region) m_window->GetUpdateRegion().GetXRegion(),
(Region) m_currentRegion);
(Region) m_currentRegion);
if (m_currentRegion)
{
@@ -2278,8 +2278,8 @@ void wxWindowDC::DrawSpline( wxList *points )
};
/*
* wxPaintDC
*/
* wxPaintDC
*/
wxPaintDC::wxPaintDC(wxWindow* win): wxWindowDC(win)
{

View File

@@ -67,12 +67,12 @@ extern wxList wxPendingDelete;
IMPLEMENT_DYNAMIC_CLASS(wxDialog, wxPanel)
BEGIN_EVENT_TABLE(wxDialog, wxPanel)
EVT_BUTTON(wxID_OK, wxDialog::OnOK)
EVT_BUTTON(wxID_APPLY, wxDialog::OnApply)
EVT_BUTTON(wxID_CANCEL, wxDialog::OnCancel)
EVT_CHAR_HOOK(wxDialog::OnCharHook)
EVT_SYS_COLOUR_CHANGED(wxDialog::OnSysColourChanged)
EVT_CLOSE(wxDialog::OnCloseWindow)
EVT_BUTTON(wxID_OK, wxDialog::OnOK)
EVT_BUTTON(wxID_APPLY, wxDialog::OnApply)
EVT_BUTTON(wxID_CANCEL, wxDialog::OnCancel)
EVT_CHAR_HOOK(wxDialog::OnCharHook)
EVT_SYS_COLOUR_CHANGED(wxDialog::OnSysColourChanged)
EVT_CLOSE(wxDialog::OnCloseWindow)
END_EVENT_TABLE()
#endif
@@ -328,14 +328,14 @@ void wxDialog::Iconize(bool WXUNUSED(iconize))
{
// Can't iconize a dialog in Motif, apparently
// 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
{
/*
Boolean iconic;
XtVaGetValues((Widget) m_mainWidget, XmNiconic, &iconic, NULL);
/*
Boolean iconic;
XtVaGetValues((Widget) m_mainWidget, XmNiconic, &iconic, NULL);
return iconic;
*/
@@ -486,7 +486,7 @@ int wxDialog::ShowModal()
// Loop until we signal that the dialog should be closed
while ((wxModalShowingStack.Number() > 0) && ((int)(wxModalShowingStack.First()->Data()) != 0))
{
// XtAppProcessEvent((XtAppContext) wxTheApp->GetAppContext(), XtIMAll);
// XtAppProcessEvent((XtAppContext) wxTheApp->GetAppContext(), XtIMAll);
XtAppNextEvent((XtAppContext) wxTheApp->GetAppContext(), &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) )
{
/* This gets called when the dialog is being shown, which
* defeats modal showing.
client->m_modalShowing = FALSE ;
client->m_isShown = FALSE;
/* This gets called when the dialog is being shown, which
* defeats modal showing.
client->m_modalShowing = FALSE ;
client->m_isShown = FALSE;
*/
}

View File

@@ -1,10 +1,8 @@
///////////////////////////////////////////////////////////////////////////////
// Name: dnd.cpp
// Purpose: wxDropTarget, wxDropSource, wxDataObject implementation
// Purpose: wxDropTarget, wxDropSource classes
// Author: Julian Smart
// Modified by:
// Created: 17/09/98
// RCS-ID: $Id$
// Id: $Id$
// Copyright: (c) 1998 Julian Smart
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
@@ -13,10 +11,19 @@
#pragma implementation "dnd.h"
#endif
#include "wx/setup.h"
#if wxUSE_DRAG_AND_DROP
#include "wx/dnd.h"
#include "wx/window.h"
#include "wx/app.h"
#include "wx/gdicmn.h"
#include "wx/intl.h"
#include "wx/utils.h"
#include "wx/log.h"
#include <X11/Xlib.h>
// ----------------------------------------------------------------------------
// global
@@ -28,28 +35,28 @@
wxDropTarget::wxDropTarget()
{
};
}
wxDropTarget::~wxDropTarget()
{
};
}
// ----------------------------------------------------------------------------
// 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;
};
}
bool wxTextDropTarget::OnDropText( long x, long y, const char *psz )
{
printf( "Got dropped text: %s.\n", psz );
printf( "At x: %d, y: %d.\n", (int)x, (int)y );
wxLogDebug( "Got dropped text: %s.", psz );
wxLogDebug( "At x: %d, y: %d.", (int)x, (int)y );
return TRUE;
};
}
size_t wxTextDropTarget::GetFormatCount() const
{
@@ -65,18 +72,41 @@ wxDataFormat wxTextDropTarget::GetFormat(size_t WXUNUSED(n)) const
// 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 );
printf( "At x: %d, y: %d.\n", (int)x, (int)y );
wxLogDebug( "Got %d dropped files.", (int)nFiles );
wxLogDebug( "At x: %d, y: %d.", (int)x, (int)y );
for (size_t i = 0; i < nFiles; i++)
{
wxLogDebug( aszFiles[i] );
}
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
@@ -93,41 +123,100 @@ wxDataFormat wxFileDropTarget::GetFormat(size_t WXUNUSED(n)) const
// wxDropSource
//-------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// drag request
wxDropSource::wxDropSource( wxWindow *win )
{
// TODO
// m_window = win;
m_data = NULL;
#if 0
m_window = win;
m_data = (wxDataObject *) NULL;
m_retValue = wxDragCancel;
// m_defaultCursor = wxCursor( wxCURSOR_NO_ENTRY );
// m_goaheadCursor = wxCursor( wxCURSOR_HAND );
};
m_defaultCursor = wxCursor( wxCURSOR_NO_ENTRY );
m_goaheadCursor = wxCursor( wxCURSOR_HAND );
#endif
}
wxDropSource::wxDropSource( wxDataObject &data, wxWindow *win )
{
// TODO
// m_window = win;
#if 0
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_defaultCursor = wxCursor( wxCURSOR_NO_ENTRY );
// m_goaheadCursor = wxCursor( wxCURSOR_HAND );
};
m_defaultCursor = wxCursor( wxCURSOR_NO_ENTRY );
m_goaheadCursor = wxCursor( wxCURSOR_HAND );
#endif
}
void wxDropSource::SetData( wxDataObject &data )
{
m_data = &data;
};
// m_data = &data;
}
wxDropSource::~wxDropSource(void)
{
};
// if (m_data) delete m_data;
}
wxDragResult wxDropSource::DoDragDrop( bool WXUNUSED(bAllowMove) )
{
// TODO
return wxDragError;
};
// wxASSERT_MSG( m_data, "wxDragSource: no data" );
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

View File

@@ -36,9 +36,9 @@ IMPLEMENT_CLASS(wxFileDialog, wxDialog)
#endif
#define DEFAULT_FILE_SELECTOR_SIZE 0
// Let Motif defines the size of File
// Selector Box (if 1), or fix it to
// wxFSB_WIDTH x wxFSB_HEIGHT (if 0)
// Let Motif defines the size of File
// Selector Box (if 1), or fix it to
// wxFSB_WIDTH x wxFSB_HEIGHT (if 0)
#define wxFSB_WIDTH 600
#define wxFSB_HEIGHT 500
@@ -148,7 +148,7 @@ int wxFileDialog::ShowModal()
{
wxBeginBusyCursor();
// static char fileBuf[512];
// static char fileBuf[512];
Widget parentWidget = (Widget) 0;
if (m_parent)
{
@@ -216,12 +216,12 @@ int wxFileDialog::ShowModal()
XtAddCallback(fileSel, XmNcancelCallback, (XtCallbackProc)wxFileSelCancel, (XtPointer)NULL);
XtAddCallback(fileSel, XmNokCallback, (XtCallbackProc)wxFileSelOk, (XtPointer)NULL);
//#if XmVersion > 1000
// I'm not sure about what you mean with XmVersion.
// If this is for Motif1.1/Motif1.2, then check XmVersion>=1200
// (Motif1.1.4 ==> XmVersion 1100 )
// Nevertheless, I put here a #define, so anyone can choose in (I)makefile...
//
//#if XmVersion > 1000
// I'm not sure about what you mean with XmVersion.
// If this is for Motif1.1/Motif1.2, then check XmVersion>=1200
// (Motif1.1.4 ==> XmVersion 1100 )
// Nevertheless, I put here a #define, so anyone can choose in (I)makefile...
//
#if !DEFAULT_FILE_SELECTOR_SIZE
int width = wxFSB_WIDTH;
int height = wxFSB_HEIGHT;
@@ -249,7 +249,7 @@ int wxFileDialog::ShowModal()
XmUpdateDisplay((Widget) wxTheApp->GetTopLevelWidget()); // Experimental
// XtDestroyWidget(fileSel);
// XtDestroyWidget(fileSel);
XtUnmapWidget(XtParent(fileSel));
XtDestroyWidget(XtParent(fileSel));

View File

@@ -65,12 +65,12 @@ static bool wxTopLevelUsed = FALSE;
#if !USE_SHARED_LIBRARY
BEGIN_EVENT_TABLE(wxFrame, wxWindow)
EVT_SIZE(wxFrame::OnSize)
EVT_ACTIVATE(wxFrame::OnActivate)
EVT_MENU_HIGHLIGHT_ALL(wxFrame::OnMenuHighlight)
EVT_SYS_COLOUR_CHANGED(wxFrame::OnSysColourChanged)
EVT_IDLE(wxFrame::OnIdle)
EVT_CLOSE(wxFrame::OnCloseWindow)
EVT_SIZE(wxFrame::OnSize)
EVT_ACTIVATE(wxFrame::OnActivate)
EVT_MENU_HIGHLIGHT_ALL(wxFrame::OnMenuHighlight)
EVT_SYS_COLOUR_CHANGED(wxFrame::OnSysColourChanged)
EVT_IDLE(wxFrame::OnIdle)
EVT_CLOSE(wxFrame::OnCloseWindow)
END_EVENT_TABLE()
IMPLEMENT_DYNAMIC_CLASS(wxFrame, wxWindow)
@@ -182,7 +182,7 @@ bool wxFrame::Create(wxWindow *parent,
XmNleftAttachment, XmATTACH_FORM,
XmNtopAttachment, XmATTACH_FORM,
XmNbottomAttachment, XmATTACH_FORM,
// XmNresizePolicy, XmRESIZE_ANY,
// XmNresizePolicy, XmRESIZE_ANY,
NULL);
XtVaSetValues((Widget) m_frameWidget,
@@ -289,7 +289,7 @@ wxFrame::~wxFrame()
{
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
GetMenuBar()->SetMainWidget((WXWidget) NULL);
#endif
@@ -305,7 +305,7 @@ wxFrame::~wxFrame()
DestroyChildren();
/*
/*
int i;
for (i = 0; i < wxMAX_STATUS; i++)
if (statusTextWidget[i])
@@ -336,7 +336,7 @@ wxFrame::~wxFrame()
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))
{
@@ -372,7 +372,7 @@ void wxFrame::GetClientSize(int *x, int *y) const
else
yy -= tbh;
}
/*
/*
if (GetMenuBar() != (wxMenuBar*) NULL)
{
// 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));
} else {
XtUnmapWidget((Widget) m_frameShell);
// XmUpdateDisplay(wxTheApp->topLevel); // Experimental: may be responsible for crashes
// XmUpdateDisplay(wxTheApp->topLevel); // Experimental: may be responsible for crashes
}
return TRUE;
}
@@ -655,7 +655,7 @@ void wxFrame::SetMenuBar(wxMenuBar *menuBar)
}
// 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)
{
@@ -718,12 +718,12 @@ void wxFrame::OnSysColourChanged(wxSysColourChangedEvent& event)
void wxFrame::OnSize(wxSizeEvent& event)
{
// if we're using constraints - do use them
#if wxUSE_CONSTRAINTS
#if wxUSE_CONSTRAINTS
if ( GetAutoLayout() ) {
Layout();
return;
}
#endif
#endif
// do we have _exactly_ one child?
wxWindow *child = NULL;
@@ -852,13 +852,13 @@ void wxFrame::ProcessCommand(int id)
if (!bar)
return;
/* TODO: check the menu item if required
/* TODO: check the menu item if required
wxMenuItem *item = bar->FindItemForId(id) ;
if (item && item->IsCheckable())
{
bar->Check(id,!bar->Checked(id)) ;
}
*/
*/
GetEventHandler()->ProcessEvent(commandEvent);
}

View File

@@ -25,28 +25,28 @@ IMPLEMENT_DYNAMIC_CLASS(wxGauge, wxControl)
// XmGauge copyright notice:
/*
* Copyright 1994 GROUPE BULL
*
* Permission to use, copy, modify, and distribute this software and its
* documentation for any purpose and without fee is hereby granted, provided
* that the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of GROUPE BULL not be used in advertising
* or publicity pertaining to distribution of the software without specific,
* written prior permission. GROUPE BULL makes no representations about the
* suitability of this software for any purpose. It is provided "as is"
* without express or implied warranty.
*
* GROUPE BULL disclaims all warranties with regard to this software,
* including all implied warranties of merchantability and fitness,
* in no event shall GROUPE BULL be liable for any special,
* indirect or consequential damages or any damages
* whatsoever resulting from loss of use, data or profits,
* whether in an action of contract, negligence or other tortious
* action, arising out of or in connection with the use
* or performance of this software.
*
*/
* Copyright 1994 GROUPE BULL
*
* Permission to use, copy, modify, and distribute this software and its
* documentation for any purpose and without fee is hereby granted, provided
* that the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of GROUPE BULL not be used in advertising
* or publicity pertaining to distribution of the software without specific,
* written prior permission. GROUPE BULL makes no representations about the
* suitability of this software for any purpose. It is provided "as is"
* without express or implied warranty.
*
* GROUPE BULL disclaims all warranties with regard to this software,
* including all implied warranties of merchantability and fitness,
* in no event shall GROUPE BULL be liable for any special,
* indirect or consequential damages or any damages
* whatsoever resulting from loss of use, data or profits,
* whether in an action of contract, negligence or other tortious
* action, arising out of or in connection with the use
* or performance of this software.
*
*/
//// PUBLIC XMGAUGE DECLARATIONS
typedef struct _XmGaugeClassRec* XmGaugeWidgetClass;
@@ -179,7 +179,7 @@ int wxGauge::GetRange() const
int r;
XtVaGetValues((Widget) m_mainWidget, XmNmaximum, &r, NULL);
return (int)r;
// return m_rangeMax;
// return m_rangeMax;
}
int wxGauge::GetValue() const
@@ -187,7 +187,7 @@ int wxGauge::GetValue() const
int pos;
XtVaGetValues((Widget) m_mainWidget, XmNvalue, &pos, NULL);
return pos;
// return m_gaugePos;
// return m_gaugePos;
}
void wxGauge::ChangeFont(bool keepOriginalSize)
@@ -263,7 +263,7 @@ static char translations[] =
"<Btn1Down>: GaugePick()\n\
<Btn1Motion>: GaugeDrag()\n\
<Btn1Up>: GaugeDrop()\n\
";
";
@@ -279,22 +279,22 @@ DrawSlider(XmGaugeWidget gw, Boolean clear)
#define THIS gw->gauge
int size, sht;
float ratio;
/***chubraev
/***chubraev
char string[20];
int len;
unsigned long backgr,foregr;
XRectangle rects[1];
***/
***/
sht = gw->primitive.shadow_thickness;
ratio = (float)THIS.value/
(float)(THIS.maximum - THIS.minimum);
/***chubraev
/***chubraev
sprintf(string,"%-d%%",(int)(ratio*100));
len=strlen(string);
XtVaGetValues(gw,XmNbackground,&backgr,XmNforeground,&foregr,NULL);
***/
***/
if(clear) {
XClearArea(XtDisplay(gw), XtWindow(gw), sht, sht,
@@ -305,7 +305,7 @@ DrawSlider(XmGaugeWidget gw, Boolean clear)
size = (int) ((gw->core.width - 2 * sht)*ratio);
/***chubraev
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) {
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);
XSetForeground(XtDisplay(gw), THIS.gc, backgr);
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;
@@ -342,7 +342,7 @@ gw->core.height - 2 * sht, string, len);
size = (int) ((gw->core.height - 2 * sht)*ratio);
/***chubraev
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) {
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);
XSetForeground(XtDisplay(gw), THIS.gc, backgr);
XDrawString(XtDisplay(gw), XtWindow(gw), THIS.gc, sht,
sht+gw->core.height/2, string,len);
sht+gw->core.height/2, string,len);
***/
break;
}
@@ -382,28 +382,28 @@ sht+gw->core.height/2, string,len);
}
/* Old code
*/
*/
#if 0
static void
DrawSlider(XmGaugeWidget gw, Boolean clear)
{
#define THIS gw->gauge
int size, sht;
/* float ratio; */
/* float ratio; */
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 -
(float)THIS.minimum) / (float)THIS.value;
*/
*/
if(clear) {
XClearArea(XtDisplay(gw), XtWindow(gw), sht, sht,
gw->core.width - 2 * sht, gw->core.height - 2 * sht, False);
}
switch(THIS.orientation) {
case XmHORIZONTAL:
/* size = (gw->core.width - 2 * sht) / ratio; */
/* A fix suggested by Dmitri Chubraev */
/* size = (gw->core.width - 2 * sht) / ratio; */
/* A fix suggested by Dmitri Chubraev */
size = (gw->core.width - 2 * sht) /((float)THIS.maximum-(float)THIS.minimum)*(float)THIS.value;
switch(THIS.processingDirection) {
case XmMAX_ON_RIGHT:
@@ -421,7 +421,7 @@ DrawSlider(XmGaugeWidget gw, Boolean clear)
break;
case XmVERTICAL:
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) {
case XmMAX_ON_RIGHT:
case XmMAX_ON_BOTTOM:
@@ -606,7 +606,7 @@ WidgetClass xmGaugeWidgetClass = (WidgetClass)&xmGaugeClassRec;
void
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
XmGaugeWidget gw = (XmGaugeWidget)w;
#define THIS gw->gauge
@@ -672,7 +672,7 @@ GaugePick(Widget w, XEvent *e, String *args, Cardinal *num_args)
void
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
XmGaugeWidget gw = (XmGaugeWidget)w;
#define THIS gw->gauge
@@ -741,7 +741,7 @@ GaugeDrag(Widget w, XEvent *e, String *args, Cardinal *num_args)
void
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
XmGaugeWidget gw = (XmGaugeWidget)w;
#define THIS gw->gauge

View File

@@ -18,5 +18,3 @@
#if !USE_SHARED_LIBRARIES
IMPLEMENT_DYNAMIC_CLASS(wxGDIObject, wxObject)
#endif
// TODO: Nothing to do, unless you want to.

View File

@@ -26,8 +26,8 @@ IMPLEMENT_DYNAMIC_CLASS(wxIcon, wxBitmap)
#endif
/*
* Icons
*/
* Icons
*/
wxIcon::wxIcon()
{

View File

@@ -23,7 +23,7 @@
#include "wx/motif/private.h"
#if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxListBox, wxControl)
IMPLEMENT_DYNAMIC_CLASS(wxListBox, wxControl)
#endif
void wxListBoxCallback (Widget w, XtPointer clientData,
@@ -195,7 +195,7 @@ void wxListBox::Append(const wxString& item)
int n;
XtVaGetValues (listBox, XmNitemCount, &n, NULL);
XmString text = XmStringCreateSimple ((char*) (const char*) item);
// XmListAddItem(listBox, text, n + 1);
// XmListAddItem(listBox, text, n + 1);
XmListAddItemUnselected (listBox, text, 0);
XmStringFree (text);
@@ -237,7 +237,7 @@ void wxListBox::Append(const wxString& item, char *clientData)
int n;
XtVaGetValues (listBox, XmNitemCount, &n, NULL);
XmString text = XmStringCreateSimple ((char*) (const char*) item);
// XmListAddItem(listBox, text, n + 1);
// XmListAddItem(listBox, text, n + 1);
XmListAddItemUnselected (listBox, text, 0);
XmStringFree (text);
@@ -280,14 +280,14 @@ void wxListBox::Set(int n, const wxString *choices, char** clientData)
if (managed)
XtUnmanageChild (listBox);
/***
/***
for (int i=0; i<n; i++)
{
XmString text = XmStringCreateSimple(choices[i]);
XmListAddItemUnselected(listBox, text, 0);
XmStringFree(text);
}
***/
***/
XmString *text = new XmString[n];
int i;
for (i = 0; i < n; i++)
@@ -370,7 +370,7 @@ void wxListBox::SetSelection(int N, bool select)
m_inSetValue = TRUE;
if (select)
{
/*
/*
if (m_windowStyle & wxLB_MULTIPLE)
{
int *selections = NULL;
@@ -390,7 +390,7 @@ void wxListBox::SetSelection(int N, bool select)
XtVaSetValues ((Widget) m_mainWidget, XmNselectionPolicy, XmEXTENDED_SELECT, NULL);
}
else
*/
*/
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];
int i;
// Steve Hammes: Motif 1.1 compatibility
// #if XmVersion > 1100
// Corrected by Sergey Krasnov from Steve Hammes' code
// #if XmVersion > 1100
// Corrected by Sergey Krasnov from Steve Hammes' code
#if XmVersion > 1001
for (i = 0; i < nItems; 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++)
{
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
}
#endif
@@ -603,7 +603,7 @@ void wxListBox::SetString(int N, const wxString& s)
XmStringFree(text);
/*
/*
// It seems that if the list is cleared, we must re-ask for
// selection policy!!
Arg args[3];
@@ -615,7 +615,7 @@ void wxListBox::SetString(int N, const wxString& s)
else
XtSetArg (args[1], XmNselectionPolicy, XmBROWSE_SELECT);
XtSetValues (listBox, args, 2);
*/
*/
GetSize (&width2, &height2);
// Correct for randomly resized listbox - bad boy, Motif!
@@ -725,9 +725,9 @@ void wxListBoxCallback (Widget w, XtPointer clientData,
}
/* Respond by getting the
* designated "default button" in the action area and activate it
* as if the user had selected it.
*/
* designated "default button" in the action area and activate it
* as if the user had selected it.
*/
void wxListBoxDefaultActionProc (Widget list_w, XtPointer client_data, XmListCallbackStruct * cbs)
{
wxListBox *lbox = (wxListBox *) client_data;

View File

@@ -87,6 +87,7 @@ LIB_CPP_SRC=\
combobox.cpp \
cursor.cpp \
data.cpp \
dataobj.cpp \
dc.cpp \
dcclient.cpp \
dcmemory.cpp \

View File

@@ -44,14 +44,14 @@ IMPLEMENT_DYNAMIC_CLASS(wxMDIChildFrame, wxFrame)
IMPLEMENT_DYNAMIC_CLASS(wxMDIClientWindow, wxNotebook)
BEGIN_EVENT_TABLE(wxMDIParentFrame, wxFrame)
EVT_SIZE(wxMDIParentFrame::OnSize)
EVT_ACTIVATE(wxMDIParentFrame::OnActivate)
EVT_SYS_COLOUR_CHANGED(wxMDIParentFrame::OnSysColourChanged)
EVT_SIZE(wxMDIParentFrame::OnSize)
EVT_ACTIVATE(wxMDIParentFrame::OnActivate)
EVT_SYS_COLOUR_CHANGED(wxMDIParentFrame::OnSysColourChanged)
END_EVENT_TABLE()
BEGIN_EVENT_TABLE(wxMDIClientWindow, wxNotebook)
EVT_SCROLL(wxMDIClientWindow::OnScroll)
EVT_NOTEBOOK_PAGE_CHANGED(wxID_NOTEBOOK_CLIENT_AREA, wxMDIClientWindow::OnPageChanged)
EVT_SCROLL(wxMDIClientWindow::OnScroll)
EVT_NOTEBOOK_PAGE_CHANGED(wxID_NOTEBOOK_CLIENT_AREA, wxMDIClientWindow::OnPageChanged)
END_EVENT_TABLE()
#endif
@@ -346,69 +346,6 @@ bool wxMDIChildFrame::Create(wxMDIParentFrame *parent,
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);
SetTitle(title);
@@ -540,10 +477,8 @@ void wxMDIChildFrame::SetIcon(const wxIcon& icon)
m_icon = icon;
if (m_icon.Ok())
{
/* TODO: doesn't work yet (crashes in XCopyArea)
Pixmap pixmap = (Pixmap) m_icon.GetPixmap();
m_mdiWindow->setPixmap(pixmap);
*/
// Not appropriate since there are no icons in
// a tabbed window
}
}

View File

@@ -379,12 +379,12 @@ void wxMenu::ProcessCommand(wxCommandEvent & event)
{
processed = GetEventHandler()->ProcessEvent(event);
}
/* TODO
/* TODO
// Try the window the menu was popped up from (and up
// through the hierarchy)
if ( !processed && GetInvokingWindow())
processed = GetInvokingWindow()->ProcessEvent(event);
*/
*/
}
bool wxWindow::PopupMenu(wxMenu *menu, int x, int y)
@@ -836,9 +836,9 @@ extern wxApp *wxTheApp;
static XtWorkProcId WorkProcMenuId;
/* Since PopupMenu under Motif stills grab right mouse button events
* after it was closed, we need to delete the associated widgets to
* allow next PopUpMenu to appear...
*/
* after it was closed, we need to delete the associated widgets to
* allow next PopUpMenu to appear...
*/
int PostDeletionOfMenu( XtPointer* clientData )
{
@@ -879,10 +879,10 @@ wxMenuPopdownCallback(Widget w, XtPointer clientData,
}
/*
* Create a popup or pulldown menu.
* Submenus of a popup will be pulldown.
*
*/
* Create a popup or pulldown menu.
* Submenus of a popup will be 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)
{
// lesstif 0.87 hangs when setting XmNfontList
// lesstif 0.87 hangs when setting XmNfontList
#ifndef LESSTIF_VERSION
if (!m_font.Ok() || !m_menuWidget)
return;

View File

@@ -46,7 +46,7 @@ void wxMenuItemDisarmCallback (Widget w, XtPointer clientData,
// ----------------------------------------------------------------------------
#if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxMenuItem, wxObject)
IMPLEMENT_DYNAMIC_CLASS(wxMenuItem, wxObject)
#endif //USE_SHARED_LIBRARY
// ----------------------------------------------------------------------------
@@ -60,9 +60,9 @@ wxMenuItem::wxMenuItem(wxMenu *pParentMenu, int id,
const wxString& strName, const wxString& strHelp,
bool bCheckable,
wxMenu *pSubMenu) :
m_strHelp(strHelp),
m_bCheckable(bCheckable),
m_strName(strName)
m_strHelp(strHelp),
m_bCheckable(bCheckable),
m_strName(strName)
{
wxASSERT( pParentMenu != NULL );
@@ -326,8 +326,7 @@ void wxMenuItemCallback (Widget w, XtPointer clientData,
}
}
void
wxMenuItemArmCallback (Widget w, XtPointer clientData,
void wxMenuItemArmCallback (Widget w, XtPointer clientData,
XtPointer ptr)
{
wxMenuItem *item = (wxMenuItem *) clientData;

View File

@@ -52,9 +52,9 @@ IMPLEMENT_DYNAMIC_CLASS(wxXPalette, wxObject)
#endif
/*
* Palette
*
*/
* Palette
*
*/
wxXPalette::wxXPalette()
{
@@ -86,7 +86,7 @@ wxPaletteRefData::~wxPaletteRefData()
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...
int i, j;
for(i=j=0; i<pix_array_n; i=j) {

View File

@@ -52,15 +52,15 @@ static void wxTextWindowActivateProc(Widget w, XtPointer clientData,
IMPLEMENT_DYNAMIC_CLASS(wxTextCtrl, wxControl)
BEGIN_EVENT_TABLE(wxTextCtrl, wxControl)
EVT_DROP_FILES(wxTextCtrl::OnDropFiles)
EVT_CHAR(wxTextCtrl::OnChar)
EVT_DROP_FILES(wxTextCtrl::OnDropFiles)
EVT_CHAR(wxTextCtrl::OnChar)
END_EVENT_TABLE()
#endif
// Text item
wxTextCtrl::wxTextCtrl()
#ifndef NO_TEXT_WINDOW_STREAM
:streambuf()
:streambuf()
#endif
{
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,
so the original wxWin-Code doesn't work. */
/*
/*
Widget textWidget = (Widget) handle;
return (long) XmTextXYToPos (textWidget, (Position) x, (Position) y);
*/
*/
/* Now a little workaround: */
long r=0;
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)
{
@@ -499,8 +499,8 @@ int wxTextCtrl::overflow(int c)
// Make sure there is a put area
if ( ! pptr() )
{
/* This doesn't seem to be fatal so comment out error message */
// wxError("Put area not opened","Internal error");
/* This doesn't seem to be fatal so comment out error message */
// wxError("Put area not opened","Internal error");
setp( base(), base() );
}
@@ -553,7 +553,7 @@ int wxTextCtrl::sync()
if ( pptr() && pptr() > pbase() ) return overflow(EOF);
return 0;
/* OLD CODE
/* OLD CODE
int len = pptr() - pbase();
char *txt = new char[len+1];
strncpy(txt, pbase(), len);
@@ -562,7 +562,7 @@ int wxTextCtrl::sync()
setp(pbase(), epptr());
delete[] txt;
return 0;
*/
*/
}
//=========================================================================

View File

@@ -263,11 +263,11 @@ static char *GetResourcePath(char *buf, const char *name, bool create = FALSE)
}
/*
* We have a cache for writing different resource files,
* which will only get flushed when we call wxFlushResources().
* Build up a list of resource databases waiting to be written.
*
*/
* We have a cache for writing different resource files,
* which will only get flushed when we call wxFlushResources().
* Build up a list of resource databases waiting to be written.
*
*/
wxList wxResourceCache (wxKEY_STRING);
@@ -504,9 +504,9 @@ void wxXMergeDatabases (wxApp * theApp, Display * display)
#if 0
/*
* Not yet used but may be useful.
*
*/
* Not yet used but may be useful.
*
*/
void
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
// 0
// 0
#endif // wxUSE_RESOURCES
@@ -804,13 +804,13 @@ char wxFindMnemonic (const 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')
s++;
if (*s == '\0')
return (NULL);
s++;
/*
/*
Now we need to format it as X standard:
input output
@@ -856,7 +856,7 @@ char * wxFindAccelerator (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')
s++;
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)
{
{
int h = hsv->h;
int s = hsv->s;
int v = hsv->v;
@@ -1162,10 +1162,10 @@ void wxHSVToXColor(wxHSV *hsv,XColor *rgb)
rgb->red = r << 8;
rgb->green = g << 8;
rgb->blue = b << 8;
}
}
void wxXColorToHSV(wxHSV *hsv,XColor *rgb)
{
{
int r = rgb->red >> 8;
int g = rgb->green >> 8;
int b = rgb->blue >> 8;
@@ -1191,10 +1191,10 @@ void wxXColorToHSV(wxHSV *hsv,XColor *rgb)
hsv->h = h;
hsv->s = (s * wxMAX_SV) / wxMAX_RGB;
hsv->v = (v * wxMAX_SV) / wxMAX_RGB;
}
}
void wxAllocNearestColor(Display *d,Colormap cmp,XColor *xc)
{
{
int llp;
int screen = DefaultScreen(d);
@@ -1228,16 +1228,16 @@ void wxAllocNearestColor(Display *d,Colormap cmp,XColor *xc)
cout << "wxAllocNearestColor : Warning : Cannot find nearest color !\n";
delete[] color_defs;
}
}
void wxAllocColor(Display *d,Colormap cmp,XColor *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);
}
}
}
// These functions duplicate those in wxWindow, but are needed

View File

@@ -53,7 +53,7 @@
#endif
#ifdef __SVR4__
#include <sys/systeminfo.h>
#include <sys/systeminfo.h>
#endif
#ifdef __SOLARIS__
@@ -140,7 +140,7 @@ long wxExecute(char **argv, bool sync, wxProcess *handler)
}
else if (pid == 0)
{
/* GUILHEM: Close all fds when sync == 0 */
/* GUILHEM: Close all fds when sync == 0 */
if (sync == 0)
for (int fd=0;fd<FD_SETSIZE;fd++) {
if (proc_link[1] != fd)
@@ -152,9 +152,9 @@ long wxExecute(char **argv, bool sync, wxProcess *handler)
#else
execvp (*argv, argv);
#endif
/* GUILHEM: Reopen output stream */
// open("/dev/console", O_WRONLY);
/* GUILHEM: End */
/* GUILHEM: Reopen output stream */
// open("/dev/console", O_WRONLY);
/* GUILHEM: End */
if (errno == ENOENT)
printf ("%s: command not found\n", *argv);
else

View File

@@ -69,13 +69,13 @@ extern wxList wxPendingDelete;
IMPLEMENT_DYNAMIC_CLASS(wxWindow, wxEvtHandler)
BEGIN_EVENT_TABLE(wxWindow, wxEvtHandler)
EVT_CHAR(wxWindow::OnChar)
EVT_KEY_DOWN(wxWindow::OnKeyDown)
EVT_KEY_UP(wxWindow::OnKeyUp)
EVT_ERASE_BACKGROUND(wxWindow::OnEraseBackground)
EVT_SYS_COLOUR_CHANGED(wxWindow::OnSysColourChanged)
EVT_INIT_DIALOG(wxWindow::OnInitDialog)
EVT_IDLE(wxWindow::OnIdle)
EVT_CHAR(wxWindow::OnChar)
EVT_KEY_DOWN(wxWindow::OnKeyDown)
EVT_KEY_UP(wxWindow::OnKeyUp)
EVT_ERASE_BACKGROUND(wxWindow::OnEraseBackground)
EVT_SYS_COLOUR_CHANGED(wxWindow::OnSysColourChanged)
EVT_INIT_DIALOG(wxWindow::OnInitDialog)
EVT_IDLE(wxWindow::OnIdle)
END_EVENT_TABLE()
#endif
@@ -342,19 +342,19 @@ bool wxWindow::Create(wxWindow *parent, wxWindowID id,
// New translations for getting mouse motion feedback
String translations =
"<Btn1Motion>: wxCanvasMotionEvent() DrawingAreaInput() ManagerGadgetButtonMotion()\n\
<Btn2Motion>: wxCanvasMotionEvent() DrawingAreaInput() ManagerGadgetButtonMotion()\n\
<Btn3Motion>: wxCanvasMotionEvent() DrawingAreaInput() ManagerGadgetButtonMotion()\n\
<BtnMotion>: wxCanvasMotionEvent() DrawingAreaInput() ManagerGadgetButtonMotion()\n\
<Btn1Down>: DrawingAreaInput() ManagerGadgetArm()\n\
<Btn2Down>: DrawingAreaInput() ManagerGadgetArm()\n\
<Btn3Down>: DrawingAreaInput() ManagerGadgetArm()\n\
<Btn1Up>: DrawingAreaInput() ManagerGadgetActivate()\n\
<Btn2Up>: DrawingAreaInput() ManagerGadgetActivate()\n\
<Btn3Up>: DrawingAreaInput() ManagerGadgetActivate()\n\
<Motion>: wxCanvasMotionEvent() DrawingAreaInput()\n\
<EnterWindow>: wxCanvasMotionEvent() DrawingAreaInput()\n\
<LeaveWindow>: wxCanvasMotionEvent() DrawingAreaInput()\n\
<Key>: DrawingAreaInput()";
<Btn2Motion>: wxCanvasMotionEvent() DrawingAreaInput() ManagerGadgetButtonMotion()\n\
<Btn3Motion>: wxCanvasMotionEvent() DrawingAreaInput() ManagerGadgetButtonMotion()\n\
<BtnMotion>: wxCanvasMotionEvent() DrawingAreaInput() ManagerGadgetButtonMotion()\n\
<Btn1Down>: DrawingAreaInput() ManagerGadgetArm()\n\
<Btn2Down>: DrawingAreaInput() ManagerGadgetArm()\n\
<Btn3Down>: DrawingAreaInput() ManagerGadgetArm()\n\
<Btn1Up>: DrawingAreaInput() ManagerGadgetActivate()\n\
<Btn2Up>: DrawingAreaInput() ManagerGadgetActivate()\n\
<Btn3Up>: DrawingAreaInput() ManagerGadgetActivate()\n\
<Motion>: wxCanvasMotionEvent() DrawingAreaInput()\n\
<EnterWindow>: wxCanvasMotionEvent() DrawingAreaInput()\n\
<LeaveWindow>: wxCanvasMotionEvent() DrawingAreaInput()\n\
<Key>: DrawingAreaInput()";
XtActionsRec actions[1];
actions[0].string = "wxCanvasMotionEvent";
@@ -380,7 +380,7 @@ bool wxWindow::Create(wxWindow *parent, wxWindowID id,
m_drawingArea = (WXWidget) XtVaCreateWidget ((char*) (const char*) name,
xmDrawingAreaWidgetClass, (Widget) m_scrolledWindow,
XmNunitType, XmPIXELS,
// XmNresizePolicy, XmRESIZE_ANY,
// XmNresizePolicy, XmRESIZE_ANY,
XmNresizePolicy, XmRESIZE_NONE,
XmNmarginHeight, 0,
XmNmarginWidth, 0,
@@ -917,7 +917,7 @@ int wxWindow::GetCharHeight() const
XCharStruct overall;
XTextExtents ((XFontStruct*) pFontStruct, "x", 1, &direction, &ascent,
&descent, &overall);
// return (overall.ascent + overall.descent);
// return (overall.ascent + overall.descent);
return (ascent + descent);
}
@@ -1174,7 +1174,7 @@ int wxWindow::GetScrollPos(int orient) const
return m_scrollPosX;
else
return m_scrollPosY;
/*
/*
Widget scrollBar = (Widget) ((orient == wxHORIZONTAL) ? m_hScrollBar : m_vScrollBar);
if (scrollBar)
{
@@ -1185,7 +1185,7 @@ int wxWindow::GetScrollPos(int orient) const
}
else
return 0;
*/
*/
}
// 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
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;
if (rect)
{
@@ -1475,15 +1475,15 @@ void wxWindow::ScrollWindow(int dx, int dy, const wxRect *rect)
void wxWindow::OnChar(wxKeyEvent& event)
{
/* ??
if ( event.KeyCode() == WXK_TAB ) {
// propagate the TABs to the parent - it's up to it to decide what
// to do with it
if ( GetParent() ) {
if ( GetParent()->ProcessEvent(event) )
return;
}
}
*/
if ( event.KeyCode() == WXK_TAB ) {
// propagate the TABs to the parent - it's up to it to decide what
// to do with it
if ( GetParent() ) {
if ( GetParent()->ProcessEvent(event) )
return;
}
}
*/
}
void wxWindow::OnKeyDown(wxKeyEvent& event)
@@ -1526,7 +1526,7 @@ bool wxWindow::TransferDataToWindow()
if ( child->GetValidator() &&
!child->GetValidator()->TransferToWindow() )
{
wxMessageBox("Application Error", "Could not transfer data to window", wxOK|wxICON_EXCLAMATION);
wxLogError("Could not transfer data to window.");
return FALSE;
}
@@ -1759,8 +1759,8 @@ void wxWindow::SetSizer(wxSizer *sizer)
}
/*
* New version
*/
* New version
*/
bool wxWindow::Layout()
{
@@ -2234,8 +2234,8 @@ bool wxWindow::IsExposed(const wxRect& rect) const
}
/*
* Allocates control IDs
*/
* Allocates control IDs
*/
int wxWindow::NewControlId()
{
@@ -2270,7 +2270,7 @@ void wxWidgetResizeProc(Widget w, XConfigureEvent *event, String args[], int *nu
bool wxAddWindowToTable(Widget w, wxWindow *win)
{
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)))
{
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)
// return ;
// ev = *((XEvent *) event); // Causes Purify error (copying too many bytes)
// ev = *((XEvent *) event); // Causes Purify error (copying too many bytes)
((XCrossingEvent &) ev) = *event;
cbs.reason = XmCR_INPUT;
@@ -2452,14 +2452,14 @@ void wxCanvasInputEvent (Widget drawingArea, XtPointer data, XmDrawingAreaCallba
//if (local_event.xcrossing.mode!=NotifyNormal)
// return ; // Ignore grab events
eventType = wxEVT_ENTER_WINDOW;
// canvas->GetEventHandler()->OnSetFocus();
// canvas->GetEventHandler()->OnSetFocus();
}
else if (local_event.xany.type == LeaveNotify)
{
//if (local_event.xcrossing.mode!=NotifyNormal)
// return ; // Ignore grab events
eventType = wxEVT_LEAVE_WINDOW;
// canvas->GetEventHandler()->OnKillFocus();
// canvas->GetEventHandler()->OnKillFocus();
}
else if (local_event.xany.type == MotionNotify)
{
@@ -2599,12 +2599,18 @@ void wxCanvasInputEvent (Widget drawingArea, XtPointer data, XmDrawingAreaCallba
case KeyPress:
{
KeySym keySym;
// XComposeStatus compose;
// (void) XLookupString ((XKeyEvent *) & local_event, wxBuffer, 20, &keySym, &compose);
// XComposeStatus compose;
// (void) XLookupString ((XKeyEvent *) & local_event, wxBuffer, 20, &keySym, &compose);
(void) XLookupString ((XKeyEvent *) & local_event, wxBuffer, 20, &keySym, NULL);
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)
event.m_shiftDown = TRUE;
@@ -2637,6 +2643,32 @@ void wxCanvasInputEvent (Widget drawingArea, XtPointer data, XmDrawingAreaCallba
}
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:
{
if (local_event.xfocus.detail != NotifyPointer)
@@ -3175,8 +3207,8 @@ bool wxTranslateKeyEvent(wxKeyEvent& wxevent, wxWindow *win, Widget widget, XEve
char buf[20];
KeySym keySym;
// XComposeStatus compose;
// (void) XLookupString ((XKeyEvent *) xevent, buf, 20, &keySym, &compose);
// XComposeStatus compose;
// (void) XLookupString ((XKeyEvent *) xevent, buf, 20, &keySym, &compose);
(void) XLookupString ((XKeyEvent *) xevent, buf, 20, &keySym, NULL);
int id = wxCharCodeXToWX (keySym);
@@ -3361,7 +3393,7 @@ void wxWindow::ChangeFont(bool keepOriginalSize)
int width, height, width1, height1;
GetSize(& width, & height);
// lesstif 0.87 hangs here
// lesstif 0.87 hangs here
#ifndef LESSTIF_VERSION
XtVaSetValues (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;

View File

@@ -323,10 +323,6 @@ bool wxGetClipboardFormatName(wxDataFormat dataFormat, char *formatName, int max
return (::GetClipboardFormatName((int) dataFormat, formatName, maxCount) > 0);
}
/*
* wxClipboard
*/
//-----------------------------------------------------------------------------
// wxClipboard
//-----------------------------------------------------------------------------