1. many, many, many warnings fixed (from HP-UX build log; 50% are still left)
2. attempt (failed) at compiling wxGTK with GTK+ 1.3.0 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5152 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
18
configure.in
18
configure.in
@@ -1445,6 +1445,7 @@ GUI_TK_LIBRARY=
|
|||||||
GUI_TK_LINK=
|
GUI_TK_LINK=
|
||||||
|
|
||||||
WXGTK12=
|
WXGTK12=
|
||||||
|
WXGTK13=
|
||||||
|
|
||||||
WXWINE=
|
WXWINE=
|
||||||
|
|
||||||
@@ -1488,9 +1489,17 @@ if test "$wxUSE_CYGWIN" = 1 || test "$wxUSE_MINGW" = 1 ; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if test "$wxUSE_GTK" = 1; then
|
if test "$wxUSE_GTK" = 1; then
|
||||||
dnl avoid calling AM_PATH_GTK twice, so check first for the newer version and
|
dnl avoid calling AM_PATH_GTK twice, so check first for the newer version
|
||||||
dnl only then, if it wasn't found, for an older one
|
dnl and only then, if it wasn't found, for an older one
|
||||||
AM_PATH_GTK(1.2.1, WXGTK12=1, AC_MSG_ERROR(Is gtk-config in path and GTK+ is version 1.2.1 or above?))
|
AM_PATH_GTK(1.2.1, WXGTK12=1, AC_MSG_ERROR(Is gtk-config in path and GTK+ is version 1.2.1 or above?))
|
||||||
|
dnl it doesn't really work with 1.3.0 now...
|
||||||
|
dnl AM_PATH_GTK(1.3.0,
|
||||||
|
dnl WXGTK13=1,
|
||||||
|
dnl AM_PATH_GTK(1.2.1,
|
||||||
|
dnl WXGTK12=1,
|
||||||
|
dnl AC_MSG_ERROR(Is gtk-config in path and GTK+ is version 1.2.1 or above?)
|
||||||
|
dnl )
|
||||||
|
dnl )
|
||||||
|
|
||||||
TOOLKIT_INCLUDE="$GTK_CFLAGS"
|
TOOLKIT_INCLUDE="$GTK_CFLAGS"
|
||||||
GUI_TK_LIBRARY="$GTK_LIBS -lgthread"
|
GUI_TK_LIBRARY="$GTK_LIBS -lgthread"
|
||||||
@@ -2234,6 +2243,11 @@ else
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if test "$WXGTK13" = 1 ; then
|
||||||
|
AC_DEFINE_UNQUOTED(__WXGTK13__,$WXGTK13)
|
||||||
|
WXGTK12=1
|
||||||
|
fi
|
||||||
|
|
||||||
if test "$WXGTK12" = 1 ; then
|
if test "$WXGTK12" = 1 ; then
|
||||||
AC_DEFINE_UNQUOTED(__WXGTK12__,$WXGTK12)
|
AC_DEFINE_UNQUOTED(__WXGTK12__,$WXGTK12)
|
||||||
fi
|
fi
|
||||||
|
@@ -287,7 +287,8 @@ wxDateTime& wxDateTime::operator+=(const wxDateSpan& diff)
|
|||||||
wxDateTime wxDateTime::ToTimezone(const wxDateTime::TimeZone& tz,
|
wxDateTime wxDateTime::ToTimezone(const wxDateTime::TimeZone& tz,
|
||||||
bool noDST) const
|
bool noDST) const
|
||||||
{
|
{
|
||||||
return wxDateTime(*this).MakeTimezone(tz, noDST);
|
wxDateTime dt(*this);
|
||||||
|
return dt.MakeTimezone(tz, noDST);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
@@ -1794,9 +1794,15 @@ typedef struct _GdkColor GdkColor;
|
|||||||
typedef struct _GdkColormap GdkColormap;
|
typedef struct _GdkColormap GdkColormap;
|
||||||
typedef struct _GdkFont GdkFont;
|
typedef struct _GdkFont GdkFont;
|
||||||
typedef struct _GdkGC GdkGC;
|
typedef struct _GdkGC GdkGC;
|
||||||
|
#ifdef __WXGTK13__
|
||||||
|
typedef struct _GdkDrawable GdkWindow;
|
||||||
|
typedef struct _GdkDrawable GdkBitmap;
|
||||||
|
typedef struct _GdkDrawable GdkPixmap;
|
||||||
|
#else
|
||||||
typedef struct _GdkWindow GdkWindow;
|
typedef struct _GdkWindow GdkWindow;
|
||||||
typedef struct _GdkWindow GdkBitmap;
|
typedef struct _GdkWindow GdkBitmap;
|
||||||
typedef struct _GdkWindow GdkPixmap;
|
typedef struct _GdkWindow GdkPixmap;
|
||||||
|
#endif
|
||||||
typedef struct _GdkCursor GdkCursor;
|
typedef struct _GdkCursor GdkCursor;
|
||||||
typedef struct _GdkRegion GdkRegion;
|
typedef struct _GdkRegion GdkRegion;
|
||||||
typedef struct _GdkDragContext GdkDragContext;
|
typedef struct _GdkDragContext GdkDragContext;
|
||||||
|
@@ -29,13 +29,22 @@ class wxTextCtrl: public wxTextCtrlBase
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxTextCtrl();
|
wxTextCtrl();
|
||||||
wxTextCtrl( wxWindow *parent, wxWindowID id, const wxString &value = "",
|
wxTextCtrl(wxWindow *parent,
|
||||||
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
|
wxWindowID id,
|
||||||
int style = 0, const wxValidator& validator = wxDefaultValidator,
|
const wxString &value = wxEmptyString,
|
||||||
|
const wxPoint &pos = wxDefaultPosition,
|
||||||
|
const wxSize &size = wxDefaultSize,
|
||||||
|
long style = 0,
|
||||||
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
const wxString &name = wxTextCtrlNameStr);
|
const wxString &name = wxTextCtrlNameStr);
|
||||||
bool Create( wxWindow *parent, wxWindowID id, const wxString &value = "",
|
|
||||||
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
|
bool Create(wxWindow *parent,
|
||||||
int style = 0, const wxValidator& validator = wxDefaultValidator,
|
wxWindowID id,
|
||||||
|
const wxString &value = wxEmptyString,
|
||||||
|
const wxPoint &pos = wxDefaultPosition,
|
||||||
|
const wxSize &size = wxDefaultSize,
|
||||||
|
long style = 0,
|
||||||
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
const wxString &name = wxTextCtrlNameStr);
|
const wxString &name = wxTextCtrlNameStr);
|
||||||
|
|
||||||
// implement base class pure virtuals
|
// implement base class pure virtuals
|
||||||
|
@@ -29,13 +29,22 @@ class wxTextCtrl: public wxTextCtrlBase
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxTextCtrl();
|
wxTextCtrl();
|
||||||
wxTextCtrl( wxWindow *parent, wxWindowID id, const wxString &value = "",
|
wxTextCtrl(wxWindow *parent,
|
||||||
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
|
wxWindowID id,
|
||||||
int style = 0, const wxValidator& validator = wxDefaultValidator,
|
const wxString &value = wxEmptyString,
|
||||||
|
const wxPoint &pos = wxDefaultPosition,
|
||||||
|
const wxSize &size = wxDefaultSize,
|
||||||
|
long style = 0,
|
||||||
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
const wxString &name = wxTextCtrlNameStr);
|
const wxString &name = wxTextCtrlNameStr);
|
||||||
bool Create( wxWindow *parent, wxWindowID id, const wxString &value = "",
|
|
||||||
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
|
bool Create(wxWindow *parent,
|
||||||
int style = 0, const wxValidator& validator = wxDefaultValidator,
|
wxWindowID id,
|
||||||
|
const wxString &value = wxEmptyString,
|
||||||
|
const wxPoint &pos = wxDefaultPosition,
|
||||||
|
const wxSize &size = wxDefaultSize,
|
||||||
|
long style = 0,
|
||||||
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
const wxString &name = wxTextCtrlNameStr);
|
const wxString &name = wxTextCtrlNameStr);
|
||||||
|
|
||||||
// implement base class pure virtuals
|
// implement base class pure virtuals
|
||||||
|
@@ -188,12 +188,12 @@ public:
|
|||||||
wxListItemAttr *GetAttributes() const { return m_attr; }
|
wxListItemAttr *GetAttributes() const { return m_attr; }
|
||||||
bool HasAttributes() const { return m_attr != NULL; }
|
bool HasAttributes() const { return m_attr != NULL; }
|
||||||
|
|
||||||
const wxColour& GetTextColour() const
|
wxColour GetTextColour() const
|
||||||
{ return HasAttributes() ? m_attr->GetTextColour() : wxNullColour; }
|
{ return HasAttributes() ? m_attr->GetTextColour() : wxNullColour; }
|
||||||
const wxColour& GetBackgroundColour() const
|
wxColour GetBackgroundColour() const
|
||||||
{ return HasAttributes() ? m_attr->GetBackgroundColour()
|
{ return HasAttributes() ? m_attr->GetBackgroundColour()
|
||||||
: wxNullColour; }
|
: wxNullColour; }
|
||||||
const wxFont& GetFont() const
|
wxFont GetFont() const
|
||||||
{ return HasAttributes() ? m_attr->GetFont() : wxNullFont; }
|
{ return HasAttributes() ? m_attr->GetFont() : wxNullFont; }
|
||||||
|
|
||||||
// these members are public for compatibility
|
// these members are public for compatibility
|
||||||
|
@@ -58,7 +58,8 @@
|
|||||||
// both warning and pragma warning are not portable, but at least an
|
// both warning and pragma warning are not portable, but at least an
|
||||||
// unknown pragma should never be an error.
|
// unknown pragma should never be an error.
|
||||||
// Err, actually, Watcom C++ doesn't like it.
|
// Err, actually, Watcom C++ doesn't like it.
|
||||||
#ifndef __WATCOMC__
|
// (well, if the compilers are _that_ broken, I'm removing it (VZ))
|
||||||
|
#if 0 //ndef __WATCOMC__
|
||||||
#pragma warning "Your compiler does not appear to support 64 bit "\
|
#pragma warning "Your compiler does not appear to support 64 bit "\
|
||||||
"integers, using emulation class instead."
|
"integers, using emulation class instead."
|
||||||
#endif
|
#endif
|
||||||
|
@@ -58,8 +58,12 @@
|
|||||||
/* Define if lex declares yytext as a char * by default, not a char[]. */
|
/* Define if lex declares yytext as a char * by default, not a char[]. */
|
||||||
#undef YYTEXT_POINTER
|
#undef YYTEXT_POINTER
|
||||||
|
|
||||||
|
/* Define this if your version of GTK+ is greater than 1.2 */
|
||||||
#undef __WXGTK12__
|
#undef __WXGTK12__
|
||||||
|
|
||||||
|
/* Define this if your version of GTK+ is greater than 1.3 */
|
||||||
|
#undef __WXGTK13__
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Define to 1 for Unix[-like] system
|
* Define to 1 for Unix[-like] system
|
||||||
*/
|
*/
|
||||||
|
@@ -1147,9 +1147,6 @@ wxDateTime& wxDateTime::ResetTime()
|
|||||||
|
|
||||||
wxDateTime::Tm wxDateTime::GetTm(const TimeZone& tz) const
|
wxDateTime::Tm wxDateTime::GetTm(const TimeZone& tz) const
|
||||||
{
|
{
|
||||||
#ifdef __VMS__
|
|
||||||
int time2;
|
|
||||||
#endif
|
|
||||||
wxASSERT_MSG( IsValid(), _T("invalid wxDateTime") );
|
wxASSERT_MSG( IsValid(), _T("invalid wxDateTime") );
|
||||||
|
|
||||||
time_t time = GetTicks();
|
time_t time = GetTicks();
|
||||||
@@ -1167,9 +1164,9 @@ wxDateTime::Tm wxDateTime::GetTm(const TimeZone& tz) const
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
time += tz.GetOffset();
|
time += (time_t)tz.GetOffset();
|
||||||
#ifdef __VMS__ // time is unsigned so avoid warning
|
#ifdef __VMS__ // time is unsigned so avoid warning
|
||||||
time2 = (int) time;
|
int time2 = (int) time;
|
||||||
if ( time2 >= 0 )
|
if ( time2 >= 0 )
|
||||||
#else
|
#else
|
||||||
if ( time >= 0 )
|
if ( time >= 0 )
|
||||||
@@ -1679,9 +1676,6 @@ wxDateTime& wxDateTime::MakeTimezone(const TimeZone& tz, bool noDST)
|
|||||||
|
|
||||||
wxString wxDateTime::Format(const wxChar *format, const TimeZone& tz) const
|
wxString wxDateTime::Format(const wxChar *format, const TimeZone& tz) const
|
||||||
{
|
{
|
||||||
#ifdef __VMS__
|
|
||||||
int time2;
|
|
||||||
#endif
|
|
||||||
wxCHECK_MSG( format, _T(""), _T("NULL format in wxDateTime::Format") );
|
wxCHECK_MSG( format, _T(""), _T("NULL format in wxDateTime::Format") );
|
||||||
|
|
||||||
time_t time = GetTicks();
|
time_t time = GetTicks();
|
||||||
@@ -1701,8 +1695,8 @@ wxString wxDateTime::Format(const wxChar *format, const TimeZone& tz) const
|
|||||||
{
|
{
|
||||||
time += tz.GetOffset();
|
time += tz.GetOffset();
|
||||||
|
|
||||||
#ifdef __VMS__ /* time is unsigned so VMS gives a warning on the original */
|
#ifdef __VMS__ // time is unsigned so avoid the warning
|
||||||
time2 = (int) time;
|
int time2 = (int) time;
|
||||||
if ( time2 >= 0 )
|
if ( time2 >= 0 )
|
||||||
#else
|
#else
|
||||||
if ( time >= 0 )
|
if ( time >= 0 )
|
||||||
|
@@ -86,20 +86,15 @@ double wxDataInputStream::ReadDouble()
|
|||||||
|
|
||||||
wxString wxDataInputStream::ReadString()
|
wxString wxDataInputStream::ReadString()
|
||||||
{
|
{
|
||||||
wxString wx_string;
|
wxString s;
|
||||||
char *string;
|
size_t len;
|
||||||
unsigned long len;
|
|
||||||
|
|
||||||
len = Read32();
|
len = Read32();
|
||||||
string = new char[len+1];
|
|
||||||
|
|
||||||
m_input->Read(string, len);
|
m_input->Read(s.GetWriteBuf(len), len);
|
||||||
|
s.UngetWriteBuf();
|
||||||
|
|
||||||
string[len] = 0;
|
return s;
|
||||||
wx_string = string;
|
|
||||||
delete string;
|
|
||||||
|
|
||||||
return wx_string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
wxDataInputStream& wxDataInputStream::operator>>(wxString& s)
|
wxDataInputStream& wxDataInputStream::operator>>(wxString& s)
|
||||||
|
@@ -588,7 +588,7 @@ int wxGIFDecoder::ReadGIF()
|
|||||||
ppimg = &pimg->next;
|
ppimg = &pimg->next;
|
||||||
|
|
||||||
/* allocate memory for image and palette */
|
/* allocate memory for image and palette */
|
||||||
pimg->p = (unsigned char *) malloc(size);
|
pimg->p = (unsigned char *) malloc((size_t)size);
|
||||||
pimg->pal = (unsigned char *) malloc(768);
|
pimg->pal = (unsigned char *) malloc(768);
|
||||||
|
|
||||||
if ((!pimg->p) || (!pimg->pal))
|
if ((!pimg->p) || (!pimg->pal))
|
||||||
|
@@ -90,13 +90,17 @@ _tiffSizeProc(thandle_t handle)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
_tiffMapProc(thandle_t WXUNUSED(handle), tdata_t* pbase, toff_t* psize)
|
_tiffMapProc(thandle_t WXUNUSED(handle),
|
||||||
|
tdata_t* WXUNUSED(pbase),
|
||||||
|
toff_t* WXUNUSED(psize))
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_tiffUnmapProc(thandle_t WXUNUSED(handle), tdata_t base, toff_t size)
|
_tiffUnmapProc(thandle_t WXUNUSED(handle),
|
||||||
|
tdata_t WXUNUSED(base),
|
||||||
|
toff_t WXUNUSED(size))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -141,7 +145,7 @@ bool wxTIFFHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbos
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint32 w, h;
|
uint32 w, h;
|
||||||
size_t npixels;
|
uint32 npixels;
|
||||||
uint32 *raster;
|
uint32 *raster;
|
||||||
|
|
||||||
TIFFGetField( tif, TIFFTAG_IMAGEWIDTH, &w );
|
TIFFGetField( tif, TIFFTAG_IMAGEWIDTH, &w );
|
||||||
|
@@ -535,7 +535,7 @@ const wxChar *wxSysErrorMsg(unsigned long nErrCode)
|
|||||||
wxConvCurrent->MB2WC(s_szBuf, strerror(nErrCode), WXSIZEOF(s_szBuf) -1);
|
wxConvCurrent->MB2WC(s_szBuf, strerror(nErrCode), WXSIZEOF(s_szBuf) -1);
|
||||||
return s_szBuf;
|
return s_szBuf;
|
||||||
#else
|
#else
|
||||||
return strerror(nErrCode);
|
return strerror((int)nErrCode);
|
||||||
#endif
|
#endif
|
||||||
#endif // Win/Unix
|
#endif // Win/Unix
|
||||||
}
|
}
|
||||||
|
@@ -279,7 +279,7 @@ wxLongLongWx& wxLongLongWx::operator-=(const wxLongLongWx& ll)
|
|||||||
if (previous < ll.m_lo)
|
if (previous < ll.m_lo)
|
||||||
m_hi--;
|
m_hi--;
|
||||||
|
|
||||||
return *this;;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
// pre decrement
|
// pre decrement
|
||||||
@@ -571,14 +571,14 @@ void *wxLongLongWx::asArray(void) const
|
|||||||
{
|
{
|
||||||
static unsigned char temp[8];
|
static unsigned char temp[8];
|
||||||
|
|
||||||
temp[0] = (m_hi >> 24) & 0xFF;
|
temp[0] = (char)((m_hi >> 24) & 0xFF);
|
||||||
temp[1] = (m_hi >> 16) & 0xFF;
|
temp[1] = (char)((m_hi >> 16) & 0xFF);
|
||||||
temp[2] = (m_hi >> 8) & 0xFF;
|
temp[2] = (char)((m_hi >> 8) & 0xFF);
|
||||||
temp[3] = (m_hi >> 0) & 0xFF;
|
temp[3] = (char)((m_hi >> 0) & 0xFF);
|
||||||
temp[4] = (m_lo >> 24) & 0xFF;
|
temp[4] = (char)((m_lo >> 24) & 0xFF);
|
||||||
temp[5] = (m_lo >> 16) & 0xFF;
|
temp[5] = (char)((m_lo >> 16) & 0xFF);
|
||||||
temp[6] = (m_lo >> 8) & 0xFF;
|
temp[6] = (char)((m_lo >> 8) & 0xFF);
|
||||||
temp[7] = (m_lo >> 0) & 0xFF;
|
temp[7] = (char)((m_lo >> 0) & 0xFF);
|
||||||
|
|
||||||
return temp;
|
return temp;
|
||||||
}
|
}
|
||||||
|
@@ -643,7 +643,7 @@ wxItemResource *wxResourceInterpretDialog(wxResourceTable& table, wxExpr *expr,
|
|||||||
if (useDefaults != 0)
|
if (useDefaults != 0)
|
||||||
dialogItem->SetResourceStyle(dialogItem->GetResourceStyle() | wxRESOURCE_USE_DEFAULTS);
|
dialogItem->SetResourceStyle(dialogItem->GetResourceStyle() | wxRESOURCE_USE_DEFAULTS);
|
||||||
|
|
||||||
long id = 0;
|
int id = 0;
|
||||||
expr->GetAttributeValue(wxT("id"), id);
|
expr->GetAttributeValue(wxT("id"), id);
|
||||||
dialogItem->SetId(id);
|
dialogItem->SetId(id);
|
||||||
|
|
||||||
@@ -2190,8 +2190,8 @@ wxBitmap wxResourceCreateBitmap(const wxString& resource, wxResourceTable *table
|
|||||||
return wxBitmap(item->GetValue1(), (int)item->GetValue2(), (int)item->GetValue3()) ;
|
return wxBitmap(item->GetValue1(), (int)item->GetValue2(), (int)item->GetValue3()) ;
|
||||||
#else
|
#else
|
||||||
wxLogWarning(_("No XBM facility available!"));
|
wxLogWarning(_("No XBM facility available!"));
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
case wxBITMAP_TYPE_XPM_DATA:
|
case wxBITMAP_TYPE_XPM_DATA:
|
||||||
{
|
{
|
||||||
@@ -2206,13 +2206,12 @@ wxBitmap wxResourceCreateBitmap(const wxString& resource, wxResourceTable *table
|
|||||||
return wxBitmap((char **)item->GetValue1());
|
return wxBitmap((char **)item->GetValue1());
|
||||||
#else
|
#else
|
||||||
wxLogWarning(_("No XPM facility available!"));
|
wxLogWarning(_("No XPM facility available!"));
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
return wxBitmap(name, bitmapType);
|
return wxBitmap(name, bitmapType);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return wxNullBitmap;
|
return wxNullBitmap;
|
||||||
@@ -2345,8 +2344,8 @@ wxIcon wxResourceCreateIcon(const wxString& resource, wxResourceTable *table)
|
|||||||
return wxIcon((const char **)item->GetValue1(), (int)item->GetValue2(), (int)item->GetValue3());
|
return wxIcon((const char **)item->GetValue1(), (int)item->GetValue2(), (int)item->GetValue3());
|
||||||
#else
|
#else
|
||||||
wxLogWarning(_("No XBM facility available!"));
|
wxLogWarning(_("No XBM facility available!"));
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
case wxBITMAP_TYPE_XPM_DATA:
|
case wxBITMAP_TYPE_XPM_DATA:
|
||||||
{
|
{
|
||||||
|
@@ -56,7 +56,7 @@ void WXSERIAL(wxList)::StoreObject(wxObjectOutputStream& s)
|
|||||||
|
|
||||||
if (lst_object->GetKeyType() == wxKEY_INTEGER) {
|
if (lst_object->GetKeyType() == wxKEY_INTEGER) {
|
||||||
while (node) {
|
while (node) {
|
||||||
data_s.Write32(node->GetKeyInteger());
|
data_s.Write32((size_t)node->GetKeyInteger());
|
||||||
node = node->Next();
|
node = node->Next();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@@ -413,7 +413,7 @@ void wxBoxSizer::RecalcSizes()
|
|||||||
|
|
||||||
if (m_orient == wxVERTICAL)
|
if (m_orient == wxVERTICAL)
|
||||||
{
|
{
|
||||||
long height = size.y;
|
wxCoord height = size.y;
|
||||||
if (item->GetOption())
|
if (item->GetOption())
|
||||||
{
|
{
|
||||||
height = (delta * weight) + extra;
|
height = (delta * weight) + extra;
|
||||||
@@ -438,7 +438,7 @@ void wxBoxSizer::RecalcSizes()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
long width = size.x;
|
wxCoord width = size.x;
|
||||||
if (item->GetOption())
|
if (item->GetOption())
|
||||||
{
|
{
|
||||||
width = (delta * weight) + extra;
|
width = (delta * weight) + extra;
|
||||||
|
@@ -360,8 +360,13 @@ wxString::wxString(const wchar_t *pwz)
|
|||||||
// allocates memory needed to store a C string of length nLen
|
// allocates memory needed to store a C string of length nLen
|
||||||
void wxString::AllocBuffer(size_t nLen)
|
void wxString::AllocBuffer(size_t nLen)
|
||||||
{
|
{
|
||||||
wxASSERT( nLen > 0 ); //
|
// allocating 0 sized buffer doesn't make sense, all empty strings should
|
||||||
wxASSERT( nLen <= INT_MAX-1 ); // max size (enough room for 1 extra)
|
// reuse g_strEmpty
|
||||||
|
wxASSERT( nLen > 0 );
|
||||||
|
|
||||||
|
// make sure that we don't overflow
|
||||||
|
wxASSERT( nLen < (INT_MAX / sizeof(wxChar)) -
|
||||||
|
(sizeof(wxStringData) + EXTRA_ALLOC + 1) );
|
||||||
|
|
||||||
STATISTICS_ADD(Length, nLen);
|
STATISTICS_ADD(Length, nLen);
|
||||||
|
|
||||||
|
@@ -147,15 +147,15 @@ void wxCalendarCtrl::Init()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxCalendarCtrl::Create(wxWindow *parent,
|
bool wxCalendarCtrl::Create(wxWindow * WXUNUSED(parent),
|
||||||
wxWindowID id,
|
wxWindowID WXUNUSED(id),
|
||||||
const wxDateTime& date,
|
const wxDateTime& date,
|
||||||
const wxPoint& pos,
|
const wxPoint& WXUNUSED(pos),
|
||||||
const wxSize& size,
|
const wxSize& size,
|
||||||
long style,
|
long style,
|
||||||
const wxString& name)
|
const wxString& WXUNUSED(name))
|
||||||
{
|
{
|
||||||
SetWindowStyle(style | (wxBORDER | wxWANTS_CHARS));
|
SetWindowStyle(style | (wxRAISED_BORDER | wxWANTS_CHARS));
|
||||||
|
|
||||||
m_date = date.IsValid() ? date : wxDateTime::Today();
|
m_date = date.IsValid() ? date : wxDateTime::Today();
|
||||||
|
|
||||||
@@ -422,7 +422,7 @@ void wxCalendarCtrl::RecalcGeometry()
|
|||||||
// drawing
|
// drawing
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
void wxCalendarCtrl::OnPaint(wxPaintEvent& event)
|
void wxCalendarCtrl::OnPaint(wxPaintEvent& WXUNUSED(event))
|
||||||
{
|
{
|
||||||
wxPaintDC dc(this);
|
wxPaintDC dc(this);
|
||||||
|
|
||||||
@@ -614,7 +614,7 @@ void wxCalendarCtrl::OnYearChange(wxSpinEvent& event)
|
|||||||
{
|
{
|
||||||
wxDateTime::Tm tm = m_date.GetTm();
|
wxDateTime::Tm tm = m_date.GetTm();
|
||||||
|
|
||||||
int year = event.GetInt();
|
int year = (int)event.GetInt();
|
||||||
if ( tm.mday > wxDateTime::GetNumberOfDays(tm.mon, year) )
|
if ( tm.mday > wxDateTime::GetNumberOfDays(tm.mon, year) )
|
||||||
{
|
{
|
||||||
tm.mday = wxDateTime::GetNumberOfDays(tm.mon, year);
|
tm.mday = wxDateTime::GetNumberOfDays(tm.mon, year);
|
||||||
|
@@ -431,7 +431,7 @@ void wxFileCtrl::MakeDir()
|
|||||||
wxListItem item;
|
wxListItem item;
|
||||||
item.m_itemId = 0;
|
item.m_itemId = 0;
|
||||||
item.m_col = 0;
|
item.m_col = 0;
|
||||||
int id = Add( fd, item );
|
long id = Add( fd, item );
|
||||||
|
|
||||||
if (id != -1)
|
if (id != -1)
|
||||||
{
|
{
|
||||||
@@ -450,7 +450,7 @@ void wxFileCtrl::GoToParentDir()
|
|||||||
m_dirName = wxPathOnly( m_dirName );
|
m_dirName = wxPathOnly( m_dirName );
|
||||||
if (m_dirName.IsEmpty()) m_dirName = wxT("/");
|
if (m_dirName.IsEmpty()) m_dirName = wxT("/");
|
||||||
Update();
|
Update();
|
||||||
int id = FindItem( 0, fname );
|
long id = FindItem( 0, fname );
|
||||||
if (id != -1)
|
if (id != -1)
|
||||||
{
|
{
|
||||||
SetItemState( id, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED );
|
SetItemState( id, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED );
|
||||||
@@ -715,9 +715,10 @@ wxFileDialog::~wxFileDialog()
|
|||||||
|
|
||||||
void wxFileDialog::OnChoice( wxCommandEvent &event )
|
void wxFileDialog::OnChoice( wxCommandEvent &event )
|
||||||
{
|
{
|
||||||
wxString *str = (wxString*) m_choice->GetClientData( event.GetInt() );
|
int index = (int)event.GetInt();
|
||||||
|
wxString *str = (wxString*) m_choice->GetClientData( index );
|
||||||
m_list->SetWild( *str );
|
m_list->SetWild( *str );
|
||||||
m_filterIndex = event.GetInt();
|
m_filterIndex = index;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxFileDialog::OnCheck( wxCommandEvent &event )
|
void wxFileDialog::OnCheck( wxCommandEvent &event )
|
||||||
|
@@ -295,7 +295,7 @@ void wxListLineData::CalculateSize( wxDC *dc, int spacing )
|
|||||||
{
|
{
|
||||||
wxListItemData *item = (wxListItemData*)node->Data();
|
wxListItemData *item = (wxListItemData*)node->Data();
|
||||||
wxString s = item->GetText();
|
wxString s = item->GetText();
|
||||||
long lw,lh;
|
wxCoord lw,lh;
|
||||||
dc->GetTextExtent( s, &lw, &lh );
|
dc->GetTextExtent( s, &lw, &lh );
|
||||||
if (lw > m_spacing) m_bound_all.width = lw;
|
if (lw > m_spacing) m_bound_all.width = lw;
|
||||||
}
|
}
|
||||||
@@ -308,14 +308,14 @@ void wxListLineData::CalculateSize( wxDC *dc, int spacing )
|
|||||||
{
|
{
|
||||||
wxListItemData *item = (wxListItemData*)node->Data();
|
wxListItemData *item = (wxListItemData*)node->Data();
|
||||||
wxString s = item->GetText();
|
wxString s = item->GetText();
|
||||||
long lw,lh;
|
wxCoord lw,lh;
|
||||||
dc->GetTextExtent( s, &lw, &lh );
|
dc->GetTextExtent( s, &lw, &lh );
|
||||||
m_bound_all.width = lw;
|
m_bound_all.width = lw;
|
||||||
m_bound_all.height = lh;
|
m_bound_all.height = lh;
|
||||||
if (item->HasImage())
|
if (item->HasImage())
|
||||||
{
|
{
|
||||||
int w = 0;
|
wxCoord w = 0;
|
||||||
int h = 0;
|
wxCoord h = 0;
|
||||||
m_owner->GetImageSize( item->GetImage(), w, h );
|
m_owner->GetImageSize( item->GetImage(), w, h );
|
||||||
m_bound_all.width += 4 + w;
|
m_bound_all.width += 4 + w;
|
||||||
if (h > m_bound_all.height) m_bound_all.height = h;
|
if (h > m_bound_all.height) m_bound_all.height = h;
|
||||||
@@ -334,7 +334,7 @@ void wxListLineData::CalculateSize( wxDC *dc, int spacing )
|
|||||||
wxString s;
|
wxString s;
|
||||||
item->GetText( s );
|
item->GetText( s );
|
||||||
if (s.IsNull()) s = "H";
|
if (s.IsNull()) s = "H";
|
||||||
long lw,lh;
|
wxCoord lw,lh;
|
||||||
dc->GetTextExtent( s, &lw, &lh );
|
dc->GetTextExtent( s, &lw, &lh );
|
||||||
item->SetSize( item->GetWidth(), lh );
|
item->SetSize( item->GetWidth(), lh );
|
||||||
m_bound_all.width += lw;
|
m_bound_all.width += lw;
|
||||||
@@ -384,7 +384,7 @@ void wxListLineData::SetPosition( wxDC *dc, int x, int y, int window_width )
|
|||||||
{
|
{
|
||||||
wxString s;
|
wxString s;
|
||||||
item->GetText( s );
|
item->GetText( s );
|
||||||
long lw,lh;
|
wxCoord lw,lh;
|
||||||
dc->GetTextExtent( s, &lw, &lh );
|
dc->GetTextExtent( s, &lw, &lh );
|
||||||
if (m_bound_all.width > m_spacing)
|
if (m_bound_all.width > m_spacing)
|
||||||
m_bound_label.x = m_bound_all.x;
|
m_bound_label.x = m_bound_all.x;
|
||||||
@@ -432,7 +432,7 @@ void wxListLineData::SetPosition( wxDC *dc, int x, int y, int window_width )
|
|||||||
}
|
}
|
||||||
case wxLC_REPORT:
|
case wxLC_REPORT:
|
||||||
{
|
{
|
||||||
long lw,lh;
|
wxCoord lw,lh;
|
||||||
dc->GetTextExtent( "H", &lw, &lh );
|
dc->GetTextExtent( "H", &lw, &lh );
|
||||||
m_bound_all.x = 0;
|
m_bound_all.x = 0;
|
||||||
m_bound_all.y -= 0;
|
m_bound_all.y -= 0;
|
||||||
@@ -448,7 +448,7 @@ void wxListLineData::SetPosition( wxDC *dc, int x, int y, int window_width )
|
|||||||
wxString s;
|
wxString s;
|
||||||
item->GetText( s );
|
item->GetText( s );
|
||||||
if (s.IsEmpty()) s = wxT("H");
|
if (s.IsEmpty()) s = wxT("H");
|
||||||
long lw,lh;
|
wxCoord lw,lh;
|
||||||
dc->GetTextExtent( s, &lw, &lh );
|
dc->GetTextExtent( s, &lw, &lh );
|
||||||
m_bound_label.width = lw;
|
m_bound_label.width = lw;
|
||||||
m_bound_label.height = lh;
|
m_bound_label.height = lh;
|
||||||
@@ -1828,8 +1828,8 @@ void wxListMainWindow::GetImageSize( int index, int &width, int &height )
|
|||||||
int wxListMainWindow::GetTextLength( wxString &s )
|
int wxListMainWindow::GetTextLength( wxString &s )
|
||||||
{
|
{
|
||||||
wxClientDC dc( this );
|
wxClientDC dc( this );
|
||||||
long lw = 0;
|
wxCoord lw = 0;
|
||||||
long lh = 0;
|
wxCoord lh = 0;
|
||||||
dc.GetTextExtent( s, &lw, &lh );
|
dc.GetTextExtent( s, &lw, &lh );
|
||||||
return lw + 6;
|
return lw + 6;
|
||||||
}
|
}
|
||||||
@@ -1909,7 +1909,7 @@ void wxListMainWindow::SetColumnWidth( int col, int width )
|
|||||||
{
|
{
|
||||||
wxListItemData *item = (wxListItemData*)n->Data();
|
wxListItemData *item = (wxListItemData*)n->Data();
|
||||||
int current = 0, ix = 0, iy = 0;
|
int current = 0, ix = 0, iy = 0;
|
||||||
long lx = 0, ly = 0;
|
wxCoord lx = 0, ly = 0;
|
||||||
if (item->HasImage())
|
if (item->HasImage())
|
||||||
{
|
{
|
||||||
GetImageSize( item->GetImage(), ix, iy );
|
GetImageSize( item->GetImage(), ix, iy );
|
||||||
|
@@ -19,7 +19,14 @@
|
|||||||
|
|
||||||
#include <gdk/gdk.h>
|
#include <gdk/gdk.h>
|
||||||
#include <gdk/gdkprivate.h>
|
#include <gdk/gdkprivate.h>
|
||||||
|
|
||||||
|
// in GTK+ 1.3 gdk_root_parent was renamed into gdk_parent_root
|
||||||
|
#ifdef __WXGTK13__
|
||||||
|
#define gdk_root_parent gdk_parent_root
|
||||||
|
#else // GTK+ <= 1.2
|
||||||
|
// need to get the declaration of gdk_root_parent from private header
|
||||||
#include <gdk/gdkx.h>
|
#include <gdk/gdkx.h>
|
||||||
|
#endif // GTK+ 1.3/1.2
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// wxMask
|
// wxMask
|
||||||
|
@@ -463,7 +463,7 @@ void wxComboBox::Copy()
|
|||||||
wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") );
|
wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") );
|
||||||
|
|
||||||
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
|
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
|
||||||
#if (GTK_MINOR_VERSION > 0)
|
#if defined(__WXGTK13__) || (GTK_MINOR_VERSION > 0)
|
||||||
gtk_editable_copy_clipboard( GTK_EDITABLE(entry) );
|
gtk_editable_copy_clipboard( GTK_EDITABLE(entry) );
|
||||||
#else
|
#else
|
||||||
gtk_editable_copy_clipboard( GTK_EDITABLE(entry), 0 );
|
gtk_editable_copy_clipboard( GTK_EDITABLE(entry), 0 );
|
||||||
@@ -475,7 +475,7 @@ void wxComboBox::Cut()
|
|||||||
wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") );
|
wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") );
|
||||||
|
|
||||||
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
|
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
|
||||||
#if (GTK_MINOR_VERSION > 0)
|
#if defined(__WXGTK13__) || (GTK_MINOR_VERSION > 0)
|
||||||
gtk_editable_cut_clipboard( GTK_EDITABLE(entry) );
|
gtk_editable_cut_clipboard( GTK_EDITABLE(entry) );
|
||||||
#else
|
#else
|
||||||
gtk_editable_cut_clipboard( GTK_EDITABLE(entry), 0 );
|
gtk_editable_cut_clipboard( GTK_EDITABLE(entry), 0 );
|
||||||
@@ -487,7 +487,7 @@ void wxComboBox::Paste()
|
|||||||
wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") );
|
wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") );
|
||||||
|
|
||||||
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
|
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
|
||||||
#if (GTK_MINOR_VERSION > 0)
|
#if defined(__WXGTK13__) || (GTK_MINOR_VERSION > 0)
|
||||||
gtk_editable_paste_clipboard( GTK_EDITABLE(entry) );
|
gtk_editable_paste_clipboard( GTK_EDITABLE(entry) );
|
||||||
#else
|
#else
|
||||||
gtk_editable_paste_clipboard( GTK_EDITABLE(entry), 0 );
|
gtk_editable_paste_clipboard( GTK_EDITABLE(entry), 0 );
|
||||||
|
@@ -792,13 +792,13 @@ void wxWindowDC::DoDrawText( const wxString &text, wxCoord x, wxCoord y )
|
|||||||
properties (see wxXt implementation) */
|
properties (see wxXt implementation) */
|
||||||
if (m_font.GetUnderlined())
|
if (m_font.GetUnderlined())
|
||||||
{
|
{
|
||||||
long width = gdk_string_width( font, text.mbc_str() );
|
wxCoord width = gdk_string_width( font, text.mbc_str() );
|
||||||
long ul_y = y + font->ascent;
|
wxCoord ul_y = y + font->ascent;
|
||||||
if (font->descent > 0) ul_y++;
|
if (font->descent > 0) ul_y++;
|
||||||
gdk_draw_line( m_window, m_textGC, x, ul_y, x + width, ul_y);
|
gdk_draw_line( m_window, m_textGC, x, ul_y, x + width, ul_y);
|
||||||
}
|
}
|
||||||
|
|
||||||
long w, h;
|
wxCoord w, h;
|
||||||
GetTextExtent (text, &w, &h);
|
GetTextExtent (text, &w, &h);
|
||||||
CalcBoundingBox (x + w, y + h);
|
CalcBoundingBox (x + w, y + h);
|
||||||
CalcBoundingBox (x, y);
|
CalcBoundingBox (x, y);
|
||||||
@@ -821,8 +821,8 @@ void wxWindowDC::DoDrawRotatedText( const wxString &text, wxCoord x, wxCoord y,
|
|||||||
wxCHECK_RET( font, wxT("invalid font") );
|
wxCHECK_RET( font, wxT("invalid font") );
|
||||||
|
|
||||||
// the size of the text
|
// the size of the text
|
||||||
int w = gdk_string_width( font, text.mbc_str() );
|
wxCoord w = gdk_string_width( font, text.mbc_str() );
|
||||||
int h = font->ascent + font->descent;
|
wxCoord h = font->ascent + font->descent;
|
||||||
|
|
||||||
// draw the string normally
|
// draw the string normally
|
||||||
wxBitmap src(w, h);
|
wxBitmap src(w, h);
|
||||||
|
@@ -208,7 +208,7 @@ static gint gtk_window_button_release_callback( GtkWidget *widget, GdkEventButto
|
|||||||
int y = (int)gdk_event->y;
|
int y = (int)gdk_event->y;
|
||||||
|
|
||||||
DrawFrame( widget, win->m_oldX, win->m_oldY, win->m_width, win->m_height );
|
DrawFrame( widget, win->m_oldX, win->m_oldY, win->m_width, win->m_height );
|
||||||
gdk_pointer_ungrab ( GDK_CURRENT_TIME );
|
gdk_pointer_ungrab ( (guint32)GDK_CURRENT_TIME );
|
||||||
int org_x = 0;
|
int org_x = 0;
|
||||||
int org_y = 0;
|
int org_y = 0;
|
||||||
gdk_window_get_origin( widget->window, &org_x, &org_y );
|
gdk_window_get_origin( widget->window, &org_x, &org_y );
|
||||||
|
@@ -100,17 +100,27 @@ wxTextCtrl::wxTextCtrl()
|
|||||||
m_modified = FALSE;
|
m_modified = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxTextCtrl::wxTextCtrl( wxWindow *parent, wxWindowID id, const wxString &value,
|
wxTextCtrl::wxTextCtrl( wxWindow *parent,
|
||||||
const wxPoint &pos, const wxSize &size,
|
wxWindowID id,
|
||||||
int style, const wxValidator& validator, const wxString &name )
|
const wxString &value,
|
||||||
|
const wxPoint &pos,
|
||||||
|
const wxSize &size,
|
||||||
|
long style,
|
||||||
|
const wxValidator& validator,
|
||||||
|
const wxString &name )
|
||||||
{
|
{
|
||||||
m_modified = FALSE;
|
m_modified = FALSE;
|
||||||
Create( parent, id, value, pos, size, style, validator, name );
|
Create( parent, id, value, pos, size, style, validator, name );
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxTextCtrl::Create( wxWindow *parent, wxWindowID id, const wxString &value,
|
bool wxTextCtrl::Create( wxWindow *parent,
|
||||||
const wxPoint &pos, const wxSize &size,
|
wxWindowID id,
|
||||||
int style, const wxValidator& validator, const wxString &name )
|
const wxString &value,
|
||||||
|
const wxPoint &pos,
|
||||||
|
const wxSize &size,
|
||||||
|
long style,
|
||||||
|
const wxValidator& validator,
|
||||||
|
const wxString &name )
|
||||||
{
|
{
|
||||||
m_needParent = TRUE;
|
m_needParent = TRUE;
|
||||||
m_acceptsFocus = TRUE;
|
m_acceptsFocus = TRUE;
|
||||||
|
@@ -944,8 +944,8 @@ static gint gtk_window_button_press_callback( GtkWidget *widget, GdkEventButton
|
|||||||
event.m_middleDown = (gdk_event->state & GDK_BUTTON2_MASK);
|
event.m_middleDown = (gdk_event->state & GDK_BUTTON2_MASK);
|
||||||
event.m_rightDown = (gdk_event->state & GDK_BUTTON3_MASK);
|
event.m_rightDown = (gdk_event->state & GDK_BUTTON3_MASK);
|
||||||
|
|
||||||
event.m_x = (long)gdk_event->x;
|
event.m_x = (wxCoord)gdk_event->x;
|
||||||
event.m_y = (long)gdk_event->y;
|
event.m_y = (wxCoord)gdk_event->y;
|
||||||
|
|
||||||
// Some control don't have their own X window and thus cannot get
|
// Some control don't have their own X window and thus cannot get
|
||||||
// any events.
|
// any events.
|
||||||
@@ -1071,8 +1071,8 @@ static gint gtk_window_button_release_callback( GtkWidget *widget, GdkEventButto
|
|||||||
event.m_leftDown = (gdk_event->state & GDK_BUTTON1_MASK);
|
event.m_leftDown = (gdk_event->state & GDK_BUTTON1_MASK);
|
||||||
event.m_middleDown = (gdk_event->state & GDK_BUTTON2_MASK);
|
event.m_middleDown = (gdk_event->state & GDK_BUTTON2_MASK);
|
||||||
event.m_rightDown = (gdk_event->state & GDK_BUTTON3_MASK);
|
event.m_rightDown = (gdk_event->state & GDK_BUTTON3_MASK);
|
||||||
event.m_x = (long)gdk_event->x;
|
event.m_x = (wxCoord)gdk_event->x;
|
||||||
event.m_y = (long)gdk_event->y;
|
event.m_y = (wxCoord)gdk_event->y;
|
||||||
|
|
||||||
// Some control don't have their own X window and thus cannot get
|
// Some control don't have their own X window and thus cannot get
|
||||||
// any events.
|
// any events.
|
||||||
@@ -1191,8 +1191,8 @@ static gint gtk_window_motion_notify_callback( GtkWidget *widget, GdkEventMotion
|
|||||||
event.m_middleDown = (gdk_event->state & GDK_BUTTON2_MASK);
|
event.m_middleDown = (gdk_event->state & GDK_BUTTON2_MASK);
|
||||||
event.m_rightDown = (gdk_event->state & GDK_BUTTON3_MASK);
|
event.m_rightDown = (gdk_event->state & GDK_BUTTON3_MASK);
|
||||||
|
|
||||||
event.m_x = (long)gdk_event->x;
|
event.m_x = (wxCoord)gdk_event->x;
|
||||||
event.m_y = (long)gdk_event->y;
|
event.m_y = (wxCoord)gdk_event->y;
|
||||||
|
|
||||||
// Some control don't have their own X window and thus cannot get
|
// Some control don't have their own X window and thus cannot get
|
||||||
// any events.
|
// any events.
|
||||||
@@ -1406,8 +1406,8 @@ static gint gtk_window_enter_callback( GtkWidget *widget, GdkEventCrossing *gdk_
|
|||||||
event.m_middleDown = (state & GDK_BUTTON2_MASK);
|
event.m_middleDown = (state & GDK_BUTTON2_MASK);
|
||||||
event.m_rightDown = (state & GDK_BUTTON3_MASK);
|
event.m_rightDown = (state & GDK_BUTTON3_MASK);
|
||||||
|
|
||||||
event.m_x = (long)x;
|
event.m_x = x;
|
||||||
event.m_y = (long)y;
|
event.m_y = y;
|
||||||
|
|
||||||
if (win->GetEventHandler()->ProcessEvent( event ))
|
if (win->GetEventHandler()->ProcessEvent( event ))
|
||||||
{
|
{
|
||||||
@@ -1452,8 +1452,8 @@ static gint gtk_window_leave_callback( GtkWidget *widget, GdkEventCrossing *gdk_
|
|||||||
event.m_middleDown = (state & GDK_BUTTON2_MASK);
|
event.m_middleDown = (state & GDK_BUTTON2_MASK);
|
||||||
event.m_rightDown = (state & GDK_BUTTON3_MASK);
|
event.m_rightDown = (state & GDK_BUTTON3_MASK);
|
||||||
|
|
||||||
event.m_x = (long)x;
|
event.m_x = x;
|
||||||
event.m_y = (long)y;
|
event.m_y = y;
|
||||||
|
|
||||||
if (win->GetEventHandler()->ProcessEvent( event ))
|
if (win->GetEventHandler()->ProcessEvent( event ))
|
||||||
{
|
{
|
||||||
|
@@ -19,7 +19,14 @@
|
|||||||
|
|
||||||
#include <gdk/gdk.h>
|
#include <gdk/gdk.h>
|
||||||
#include <gdk/gdkprivate.h>
|
#include <gdk/gdkprivate.h>
|
||||||
|
|
||||||
|
// in GTK+ 1.3 gdk_root_parent was renamed into gdk_parent_root
|
||||||
|
#ifdef __WXGTK13__
|
||||||
|
#define gdk_root_parent gdk_parent_root
|
||||||
|
#else // GTK+ <= 1.2
|
||||||
|
// need to get the declaration of gdk_root_parent from private header
|
||||||
#include <gdk/gdkx.h>
|
#include <gdk/gdkx.h>
|
||||||
|
#endif // GTK+ 1.3/1.2
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// wxMask
|
// wxMask
|
||||||
|
@@ -463,7 +463,7 @@ void wxComboBox::Copy()
|
|||||||
wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") );
|
wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") );
|
||||||
|
|
||||||
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
|
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
|
||||||
#if (GTK_MINOR_VERSION > 0)
|
#if defined(__WXGTK13__) || (GTK_MINOR_VERSION > 0)
|
||||||
gtk_editable_copy_clipboard( GTK_EDITABLE(entry) );
|
gtk_editable_copy_clipboard( GTK_EDITABLE(entry) );
|
||||||
#else
|
#else
|
||||||
gtk_editable_copy_clipboard( GTK_EDITABLE(entry), 0 );
|
gtk_editable_copy_clipboard( GTK_EDITABLE(entry), 0 );
|
||||||
@@ -475,7 +475,7 @@ void wxComboBox::Cut()
|
|||||||
wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") );
|
wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") );
|
||||||
|
|
||||||
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
|
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
|
||||||
#if (GTK_MINOR_VERSION > 0)
|
#if defined(__WXGTK13__) || (GTK_MINOR_VERSION > 0)
|
||||||
gtk_editable_cut_clipboard( GTK_EDITABLE(entry) );
|
gtk_editable_cut_clipboard( GTK_EDITABLE(entry) );
|
||||||
#else
|
#else
|
||||||
gtk_editable_cut_clipboard( GTK_EDITABLE(entry), 0 );
|
gtk_editable_cut_clipboard( GTK_EDITABLE(entry), 0 );
|
||||||
@@ -487,7 +487,7 @@ void wxComboBox::Paste()
|
|||||||
wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") );
|
wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") );
|
||||||
|
|
||||||
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
|
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
|
||||||
#if (GTK_MINOR_VERSION > 0)
|
#if defined(__WXGTK13__) || (GTK_MINOR_VERSION > 0)
|
||||||
gtk_editable_paste_clipboard( GTK_EDITABLE(entry) );
|
gtk_editable_paste_clipboard( GTK_EDITABLE(entry) );
|
||||||
#else
|
#else
|
||||||
gtk_editable_paste_clipboard( GTK_EDITABLE(entry), 0 );
|
gtk_editable_paste_clipboard( GTK_EDITABLE(entry), 0 );
|
||||||
|
@@ -792,13 +792,13 @@ void wxWindowDC::DoDrawText( const wxString &text, wxCoord x, wxCoord y )
|
|||||||
properties (see wxXt implementation) */
|
properties (see wxXt implementation) */
|
||||||
if (m_font.GetUnderlined())
|
if (m_font.GetUnderlined())
|
||||||
{
|
{
|
||||||
long width = gdk_string_width( font, text.mbc_str() );
|
wxCoord width = gdk_string_width( font, text.mbc_str() );
|
||||||
long ul_y = y + font->ascent;
|
wxCoord ul_y = y + font->ascent;
|
||||||
if (font->descent > 0) ul_y++;
|
if (font->descent > 0) ul_y++;
|
||||||
gdk_draw_line( m_window, m_textGC, x, ul_y, x + width, ul_y);
|
gdk_draw_line( m_window, m_textGC, x, ul_y, x + width, ul_y);
|
||||||
}
|
}
|
||||||
|
|
||||||
long w, h;
|
wxCoord w, h;
|
||||||
GetTextExtent (text, &w, &h);
|
GetTextExtent (text, &w, &h);
|
||||||
CalcBoundingBox (x + w, y + h);
|
CalcBoundingBox (x + w, y + h);
|
||||||
CalcBoundingBox (x, y);
|
CalcBoundingBox (x, y);
|
||||||
@@ -821,8 +821,8 @@ void wxWindowDC::DoDrawRotatedText( const wxString &text, wxCoord x, wxCoord y,
|
|||||||
wxCHECK_RET( font, wxT("invalid font") );
|
wxCHECK_RET( font, wxT("invalid font") );
|
||||||
|
|
||||||
// the size of the text
|
// the size of the text
|
||||||
int w = gdk_string_width( font, text.mbc_str() );
|
wxCoord w = gdk_string_width( font, text.mbc_str() );
|
||||||
int h = font->ascent + font->descent;
|
wxCoord h = font->ascent + font->descent;
|
||||||
|
|
||||||
// draw the string normally
|
// draw the string normally
|
||||||
wxBitmap src(w, h);
|
wxBitmap src(w, h);
|
||||||
|
@@ -208,7 +208,7 @@ static gint gtk_window_button_release_callback( GtkWidget *widget, GdkEventButto
|
|||||||
int y = (int)gdk_event->y;
|
int y = (int)gdk_event->y;
|
||||||
|
|
||||||
DrawFrame( widget, win->m_oldX, win->m_oldY, win->m_width, win->m_height );
|
DrawFrame( widget, win->m_oldX, win->m_oldY, win->m_width, win->m_height );
|
||||||
gdk_pointer_ungrab ( GDK_CURRENT_TIME );
|
gdk_pointer_ungrab ( (guint32)GDK_CURRENT_TIME );
|
||||||
int org_x = 0;
|
int org_x = 0;
|
||||||
int org_y = 0;
|
int org_y = 0;
|
||||||
gdk_window_get_origin( widget->window, &org_x, &org_y );
|
gdk_window_get_origin( widget->window, &org_x, &org_y );
|
||||||
|
@@ -100,17 +100,27 @@ wxTextCtrl::wxTextCtrl()
|
|||||||
m_modified = FALSE;
|
m_modified = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxTextCtrl::wxTextCtrl( wxWindow *parent, wxWindowID id, const wxString &value,
|
wxTextCtrl::wxTextCtrl( wxWindow *parent,
|
||||||
const wxPoint &pos, const wxSize &size,
|
wxWindowID id,
|
||||||
int style, const wxValidator& validator, const wxString &name )
|
const wxString &value,
|
||||||
|
const wxPoint &pos,
|
||||||
|
const wxSize &size,
|
||||||
|
long style,
|
||||||
|
const wxValidator& validator,
|
||||||
|
const wxString &name )
|
||||||
{
|
{
|
||||||
m_modified = FALSE;
|
m_modified = FALSE;
|
||||||
Create( parent, id, value, pos, size, style, validator, name );
|
Create( parent, id, value, pos, size, style, validator, name );
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxTextCtrl::Create( wxWindow *parent, wxWindowID id, const wxString &value,
|
bool wxTextCtrl::Create( wxWindow *parent,
|
||||||
const wxPoint &pos, const wxSize &size,
|
wxWindowID id,
|
||||||
int style, const wxValidator& validator, const wxString &name )
|
const wxString &value,
|
||||||
|
const wxPoint &pos,
|
||||||
|
const wxSize &size,
|
||||||
|
long style,
|
||||||
|
const wxValidator& validator,
|
||||||
|
const wxString &name )
|
||||||
{
|
{
|
||||||
m_needParent = TRUE;
|
m_needParent = TRUE;
|
||||||
m_acceptsFocus = TRUE;
|
m_acceptsFocus = TRUE;
|
||||||
|
@@ -944,8 +944,8 @@ static gint gtk_window_button_press_callback( GtkWidget *widget, GdkEventButton
|
|||||||
event.m_middleDown = (gdk_event->state & GDK_BUTTON2_MASK);
|
event.m_middleDown = (gdk_event->state & GDK_BUTTON2_MASK);
|
||||||
event.m_rightDown = (gdk_event->state & GDK_BUTTON3_MASK);
|
event.m_rightDown = (gdk_event->state & GDK_BUTTON3_MASK);
|
||||||
|
|
||||||
event.m_x = (long)gdk_event->x;
|
event.m_x = (wxCoord)gdk_event->x;
|
||||||
event.m_y = (long)gdk_event->y;
|
event.m_y = (wxCoord)gdk_event->y;
|
||||||
|
|
||||||
// Some control don't have their own X window and thus cannot get
|
// Some control don't have their own X window and thus cannot get
|
||||||
// any events.
|
// any events.
|
||||||
@@ -1071,8 +1071,8 @@ static gint gtk_window_button_release_callback( GtkWidget *widget, GdkEventButto
|
|||||||
event.m_leftDown = (gdk_event->state & GDK_BUTTON1_MASK);
|
event.m_leftDown = (gdk_event->state & GDK_BUTTON1_MASK);
|
||||||
event.m_middleDown = (gdk_event->state & GDK_BUTTON2_MASK);
|
event.m_middleDown = (gdk_event->state & GDK_BUTTON2_MASK);
|
||||||
event.m_rightDown = (gdk_event->state & GDK_BUTTON3_MASK);
|
event.m_rightDown = (gdk_event->state & GDK_BUTTON3_MASK);
|
||||||
event.m_x = (long)gdk_event->x;
|
event.m_x = (wxCoord)gdk_event->x;
|
||||||
event.m_y = (long)gdk_event->y;
|
event.m_y = (wxCoord)gdk_event->y;
|
||||||
|
|
||||||
// Some control don't have their own X window and thus cannot get
|
// Some control don't have their own X window and thus cannot get
|
||||||
// any events.
|
// any events.
|
||||||
@@ -1191,8 +1191,8 @@ static gint gtk_window_motion_notify_callback( GtkWidget *widget, GdkEventMotion
|
|||||||
event.m_middleDown = (gdk_event->state & GDK_BUTTON2_MASK);
|
event.m_middleDown = (gdk_event->state & GDK_BUTTON2_MASK);
|
||||||
event.m_rightDown = (gdk_event->state & GDK_BUTTON3_MASK);
|
event.m_rightDown = (gdk_event->state & GDK_BUTTON3_MASK);
|
||||||
|
|
||||||
event.m_x = (long)gdk_event->x;
|
event.m_x = (wxCoord)gdk_event->x;
|
||||||
event.m_y = (long)gdk_event->y;
|
event.m_y = (wxCoord)gdk_event->y;
|
||||||
|
|
||||||
// Some control don't have their own X window and thus cannot get
|
// Some control don't have their own X window and thus cannot get
|
||||||
// any events.
|
// any events.
|
||||||
@@ -1406,8 +1406,8 @@ static gint gtk_window_enter_callback( GtkWidget *widget, GdkEventCrossing *gdk_
|
|||||||
event.m_middleDown = (state & GDK_BUTTON2_MASK);
|
event.m_middleDown = (state & GDK_BUTTON2_MASK);
|
||||||
event.m_rightDown = (state & GDK_BUTTON3_MASK);
|
event.m_rightDown = (state & GDK_BUTTON3_MASK);
|
||||||
|
|
||||||
event.m_x = (long)x;
|
event.m_x = x;
|
||||||
event.m_y = (long)y;
|
event.m_y = y;
|
||||||
|
|
||||||
if (win->GetEventHandler()->ProcessEvent( event ))
|
if (win->GetEventHandler()->ProcessEvent( event ))
|
||||||
{
|
{
|
||||||
@@ -1452,8 +1452,8 @@ static gint gtk_window_leave_callback( GtkWidget *widget, GdkEventCrossing *gdk_
|
|||||||
event.m_middleDown = (state & GDK_BUTTON2_MASK);
|
event.m_middleDown = (state & GDK_BUTTON2_MASK);
|
||||||
event.m_rightDown = (state & GDK_BUTTON3_MASK);
|
event.m_rightDown = (state & GDK_BUTTON3_MASK);
|
||||||
|
|
||||||
event.m_x = (long)x;
|
event.m_x = x;
|
||||||
event.m_y = (long)y;
|
event.m_y = y;
|
||||||
|
|
||||||
if (win->GetEventHandler()->ProcessEvent( event ))
|
if (win->GetEventHandler()->ProcessEvent( event ))
|
||||||
{
|
{
|
||||||
|
@@ -313,7 +313,7 @@ wxDialUpManagerImpl::Dial(const wxString &isp,
|
|||||||
if ( async )
|
if ( async )
|
||||||
{
|
{
|
||||||
m_DialProcess = new wxDialProcess(this);
|
m_DialProcess = new wxDialProcess(this);
|
||||||
m_DialPId = wxExecute(cmd, FALSE, m_DialProcess);
|
m_DialPId = (int)wxExecute(cmd, FALSE, m_DialProcess);
|
||||||
if(m_DialPId == 0)
|
if(m_DialPId == 0)
|
||||||
{
|
{
|
||||||
delete m_DialProcess;
|
delete m_DialProcess;
|
||||||
@@ -533,6 +533,9 @@ wxDialUpManagerImpl::CheckIfconfig(void)
|
|||||||
cmd << " -a";
|
cmd << " -a";
|
||||||
#elif defined(__LINUX__) || defined (__FREEBSD__) || defined(__SGI__)
|
#elif defined(__LINUX__) || defined (__FREEBSD__) || defined(__SGI__)
|
||||||
// nothing to be added to ifconfig
|
// nothing to be added to ifconfig
|
||||||
|
#elif defined(__HPUX__)
|
||||||
|
// VZ: a wild guess (but without it, ifconfig fails completely)
|
||||||
|
cmd << _T(" ppp0");
|
||||||
#else
|
#else
|
||||||
# pragma warning "No ifconfig information for this OS."
|
# pragma warning "No ifconfig information for this OS."
|
||||||
m_CanUseIfconfig = 0;
|
m_CanUseIfconfig = 0;
|
||||||
@@ -564,6 +567,9 @@ wxDialUpManagerImpl::CheckIfconfig(void)
|
|||||||
|| strstr(output,"pl"); // plip
|
|| strstr(output,"pl"); // plip
|
||||||
#elif defined(__SGI__) // IRIX
|
#elif defined(__SGI__) // IRIX
|
||||||
rc = strstr(output, "ppp"); // PPP
|
rc = strstr(output, "ppp"); // PPP
|
||||||
|
#elif defined(__HPUX__)
|
||||||
|
// if could run ifconfig on interface, then it exists
|
||||||
|
rc = TRUE;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
file.Close();
|
file.Close();
|
||||||
@@ -575,6 +581,7 @@ wxDialUpManagerImpl::CheckIfconfig(void)
|
|||||||
m_CanUseIfconfig = 0; // don<6F>t try again
|
m_CanUseIfconfig = 0; // don<6F>t try again
|
||||||
(void) wxRemoveFile(tmpfile);
|
(void) wxRemoveFile(tmpfile);
|
||||||
}
|
}
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -607,6 +614,8 @@ wxDialUpManagerImpl::CheckPing(void)
|
|||||||
// nothing to add to ping command
|
// nothing to add to ping command
|
||||||
#elif defined(__LINUX__)
|
#elif defined(__LINUX__)
|
||||||
cmd << "-c 1 "; // only ping once
|
cmd << "-c 1 "; // only ping once
|
||||||
|
#elif defined(__HPUX__)
|
||||||
|
cmd << "64 1 "; // only ping once (need also specify the packet size)
|
||||||
#else
|
#else
|
||||||
# pragma warning "No Ping information for this OS."
|
# pragma warning "No Ping information for this OS."
|
||||||
m_CanUsePing = 0;
|
m_CanUsePing = 0;
|
||||||
|
@@ -97,7 +97,7 @@ void wxUsleep(unsigned long milliseconds)
|
|||||||
{
|
{
|
||||||
#if defined(HAVE_NANOSLEEP)
|
#if defined(HAVE_NANOSLEEP)
|
||||||
timespec tmReq;
|
timespec tmReq;
|
||||||
tmReq.tv_sec = milliseconds / 1000;
|
tmReq.tv_sec = (time_t)(milliseconds / 1000);
|
||||||
tmReq.tv_nsec = (milliseconds % 1000) * 1000 * 1000;
|
tmReq.tv_nsec = (milliseconds % 1000) * 1000 * 1000;
|
||||||
|
|
||||||
// we're not interested in remaining time nor in return value
|
// we're not interested in remaining time nor in return value
|
||||||
@@ -126,7 +126,7 @@ void wxUsleep(unsigned long milliseconds)
|
|||||||
|
|
||||||
int wxKill(long pid, wxSignal sig)
|
int wxKill(long pid, wxSignal sig)
|
||||||
{
|
{
|
||||||
return kill(pid, (int)sig);
|
return kill((pid_t)pid, (int)sig);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define WXEXECUTE_NARGS 127
|
#define WXEXECUTE_NARGS 127
|
||||||
|
Reference in New Issue
Block a user