second merge of the 2.2 branch (RL)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@7973 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Bryan Petty
2000-08-08 06:11:51 +00:00
parent 8fb3bfe20f
commit 3ca6a5f046
138 changed files with 4941 additions and 2278 deletions

View File

@@ -111,7 +111,11 @@ bool wxComboBox::Create( wxWindow *parent, wxWindowID id, const wxString& value,
m_widget = gtk_combo_new();
// make it more useable
gtk_combo_set_use_arrows_always(GTK_COMBO(m_widget), TRUE);
gtk_combo_set_use_arrows_always( GTK_COMBO(m_widget), TRUE );
// and case-sensitive
gtk_combo_set_case_sensitive( GTK_COMBO(m_widget), TRUE );
GtkWidget *list = GTK_COMBO(m_widget)->list;

View File

@@ -43,6 +43,10 @@
#include "cross.xbm"
#define num_hatches 6
#define IS_15_PIX_HATCH(s) ((s)==wxCROSSDIAG_HATCH || (s)==wxHORIZONTAL_HATCH || (s)==wxVERTICAL_HATCH)
#define IS_16_PIX_HATCH(s) ((s)!=wxCROSSDIAG_HATCH && (s)!=wxHORIZONTAL_HATCH && (s)!=wxVERTICAL_HATCH)
static GdkPixmap *hatches[num_hatches];
static GdkPixmap **hatch_bitmap = (GdkPixmap **) NULL;
@@ -491,6 +495,18 @@ void wxWindowDC::DoDrawArc( wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2,
gdk_draw_arc( m_window, m_textGC, TRUE, xxc-r, yyc-r, 2*r,2*r, alpha1, alpha2 );
gdk_gc_set_ts_origin( m_textGC, 0, 0 );
} else
if (IS_15_PIX_HATCH(m_brush.GetStyle()))
{
gdk_gc_set_ts_origin( m_brushGC, m_deviceOriginX % 15, m_deviceOriginY % 15 );
gdk_draw_arc( m_window, m_brushGC, TRUE, xxc-r, yyc-r, 2*r,2*r, alpha1, alpha2 );
gdk_gc_set_ts_origin( m_brushGC, 0, 0 );
} else
if (IS_16_PIX_HATCH(m_brush.GetStyle()))
{
gdk_gc_set_ts_origin( m_brushGC, m_deviceOriginX % 16, m_deviceOriginY % 16 );
gdk_draw_arc( m_window, m_brushGC, TRUE, xxc-r, yyc-r, 2*r,2*r, alpha1, alpha2 );
gdk_gc_set_ts_origin( m_brushGC, 0, 0 );
} else
if (m_brush.GetStyle() == wxSTIPPLE)
{
gdk_gc_set_ts_origin( m_brushGC,
@@ -541,6 +557,18 @@ void wxWindowDC::DoDrawEllipticArc( wxCoord x, wxCoord y, wxCoord width, wxCoord
gdk_draw_arc( m_window, m_textGC, TRUE, xx, yy, ww, hh, start, end );
gdk_gc_set_ts_origin( m_textGC, 0, 0 );
} else
if (IS_15_PIX_HATCH(m_brush.GetStyle()))
{
gdk_gc_set_ts_origin( m_brushGC, m_deviceOriginX % 15, m_deviceOriginY % 15 );
gdk_draw_arc( m_window, m_brushGC, TRUE, xx, yy, ww, hh, start, end );
gdk_gc_set_ts_origin( m_brushGC, 0, 0 );
} else
if (IS_16_PIX_HATCH(m_brush.GetStyle()))
{
gdk_gc_set_ts_origin( m_brushGC, m_deviceOriginX % 16, m_deviceOriginY % 16 );
gdk_draw_arc( m_window, m_brushGC, TRUE, xx, yy, ww, hh, start, end );
gdk_gc_set_ts_origin( m_brushGC, 0, 0 );
} else
if (m_brush.GetStyle() == wxSTIPPLE)
{
gdk_gc_set_ts_origin( m_brushGC,
@@ -624,6 +652,18 @@ void wxWindowDC::DoDrawPolygon( int n, wxPoint points[], wxCoord xoffset, wxCoor
gdk_draw_polygon( m_window, m_textGC, TRUE, gdkpoints, n );
gdk_gc_set_ts_origin( m_textGC, 0, 0 );
} else
if (IS_15_PIX_HATCH(m_brush.GetStyle()))
{
gdk_gc_set_ts_origin( m_brushGC, m_deviceOriginX % 15, m_deviceOriginY % 15 );
gdk_draw_polygon( m_window, m_brushGC, TRUE, gdkpoints, n );
gdk_gc_set_ts_origin( m_brushGC, 0, 0 );
} else
if (IS_16_PIX_HATCH(m_brush.GetStyle()))
{
gdk_gc_set_ts_origin( m_brushGC, m_deviceOriginX % 16, m_deviceOriginY % 16 );
gdk_draw_polygon( m_window, m_brushGC, TRUE, gdkpoints, n );
gdk_gc_set_ts_origin( m_brushGC, 0, 0 );
} else
if (m_brush.GetStyle() == wxSTIPPLE)
{
gdk_gc_set_ts_origin( m_brushGC,
@@ -681,8 +721,20 @@ void wxWindowDC::DoDrawRectangle( wxCoord x, wxCoord y, wxCoord width, wxCoord h
m_deviceOriginY % m_brush.GetStipple()->GetHeight() );
gdk_draw_rectangle( m_window, m_textGC, TRUE, xx, yy, ww, hh );
gdk_gc_set_ts_origin( m_textGC, 0, 0 );
}
else if (m_brush.GetStyle() == wxSTIPPLE)
} else
if (IS_15_PIX_HATCH(m_brush.GetStyle()))
{
gdk_gc_set_ts_origin( m_brushGC, m_deviceOriginX % 15, m_deviceOriginY % 15 );
gdk_draw_rectangle( m_window, m_brushGC, TRUE, xx, yy, ww, hh );
gdk_gc_set_ts_origin( m_brushGC, 0, 0 );
} else
if (IS_16_PIX_HATCH(m_brush.GetStyle()))
{
gdk_gc_set_ts_origin( m_brushGC, m_deviceOriginX % 16, m_deviceOriginY % 16 );
gdk_draw_rectangle( m_window, m_brushGC, TRUE, xx, yy, ww, hh );
gdk_gc_set_ts_origin( m_brushGC, 0, 0 );
} else
if (m_brush.GetStyle() == wxSTIPPLE)
{
gdk_gc_set_ts_origin( m_brushGC,
m_deviceOriginX % m_brush.GetStipple()->GetWidth(),
@@ -762,8 +814,30 @@ void wxWindowDC::DoDrawRoundedRectangle( wxCoord x, wxCoord y, wxCoord width, wx
gdk_draw_arc( m_window, m_textGC, TRUE, xx+ww-dd, yy+hh-dd, dd, dd, 270*64, 90*64 );
gdk_draw_arc( m_window, m_textGC, TRUE, xx, yy+hh-dd, dd, dd, 180*64, 90*64 );
gdk_gc_set_ts_origin( m_textGC, 0, 0 );
}
else if (m_brush.GetStyle() == wxSTIPPLE)
} else
if (IS_15_PIX_HATCH(m_brush.GetStyle()))
{
gdk_gc_set_ts_origin( m_brushGC, m_deviceOriginX % 15, m_deviceOriginY % 15 );
gdk_draw_rectangle( m_window, m_brushGC, TRUE, xx+rr, yy, ww-dd+1, hh );
gdk_draw_rectangle( m_window, m_brushGC, TRUE, xx, yy+rr, ww, hh-dd+1 );
gdk_draw_arc( m_window, m_brushGC, TRUE, xx, yy, dd, dd, 90*64, 90*64 );
gdk_draw_arc( m_window, m_brushGC, TRUE, xx+ww-dd, yy, dd, dd, 0, 90*64 );
gdk_draw_arc( m_window, m_brushGC, TRUE, xx+ww-dd, yy+hh-dd, dd, dd, 270*64, 90*64 );
gdk_draw_arc( m_window, m_brushGC, TRUE, xx, yy+hh-dd, dd, dd, 180*64, 90*64 );
gdk_gc_set_ts_origin( m_brushGC, 0, 0 );
} else
if (IS_16_PIX_HATCH(m_brush.GetStyle()))
{
gdk_gc_set_ts_origin( m_brushGC, m_deviceOriginX % 16, m_deviceOriginY % 16 );
gdk_draw_rectangle( m_window, m_brushGC, TRUE, xx+rr, yy, ww-dd+1, hh );
gdk_draw_rectangle( m_window, m_brushGC, TRUE, xx, yy+rr, ww, hh-dd+1 );
gdk_draw_arc( m_window, m_brushGC, TRUE, xx, yy, dd, dd, 90*64, 90*64 );
gdk_draw_arc( m_window, m_brushGC, TRUE, xx+ww-dd, yy, dd, dd, 0, 90*64 );
gdk_draw_arc( m_window, m_brushGC, TRUE, xx+ww-dd, yy+hh-dd, dd, dd, 270*64, 90*64 );
gdk_draw_arc( m_window, m_brushGC, TRUE, xx, yy+hh-dd, dd, dd, 180*64, 90*64 );
gdk_gc_set_ts_origin( m_brushGC, 0, 0 );
} else
if (m_brush.GetStyle() == wxSTIPPLE)
{
gdk_gc_set_ts_origin( m_brushGC,
m_deviceOriginX % m_brush.GetStipple()->GetWidth(),
@@ -789,10 +863,10 @@ void wxWindowDC::DoDrawRoundedRectangle( wxCoord x, wxCoord y, wxCoord width, wx
if (m_pen.GetStyle() != wxTRANSPARENT)
{
gdk_draw_line( m_window, m_penGC, xx+rr, yy, xx+ww-rr, yy );
gdk_draw_line( m_window, m_penGC, xx+rr, yy+hh, xx+ww-rr, yy+hh );
gdk_draw_line( m_window, m_penGC, xx, yy+rr, xx, yy+hh-rr );
gdk_draw_line( m_window, m_penGC, xx+ww, yy+rr, xx+ww, yy+hh-rr );
gdk_draw_line( m_window, m_penGC, xx+rr+1, yy, xx+ww-rr, yy );
gdk_draw_line( m_window, m_penGC, xx+rr+1, yy+hh, xx+ww-rr, yy+hh );
gdk_draw_line( m_window, m_penGC, xx, yy+rr+1, xx, yy+hh-rr );
gdk_draw_line( m_window, m_penGC, xx+ww, yy+rr+1, xx+ww, yy+hh-rr );
gdk_draw_arc( m_window, m_penGC, FALSE, xx, yy, dd, dd, 90*64, 90*64 );
gdk_draw_arc( m_window, m_penGC, FALSE, xx+ww-dd, yy, dd, dd, 0, 90*64 );
gdk_draw_arc( m_window, m_penGC, FALSE, xx+ww-dd, yy+hh-dd, dd, dd, 270*64, 90*64 );
@@ -829,8 +903,20 @@ void wxWindowDC::DoDrawEllipse( wxCoord x, wxCoord y, wxCoord width, wxCoord hei
m_deviceOriginY % m_brush.GetStipple()->GetHeight() );
gdk_draw_arc( m_window, m_textGC, TRUE, xx, yy, ww, hh, 0, 360*64 );
gdk_gc_set_ts_origin( m_textGC, 0, 0 );
}
else if (m_brush.GetStyle() == wxSTIPPLE)
} else
if (IS_15_PIX_HATCH(m_brush.GetStyle()))
{
gdk_gc_set_ts_origin( m_brushGC, m_deviceOriginX % 15, m_deviceOriginY % 15 );
gdk_draw_arc( m_window, m_brushGC, TRUE, xx, yy, ww, hh, 0, 360*64 );
gdk_gc_set_ts_origin( m_brushGC, 0, 0 );
} else
if (IS_16_PIX_HATCH(m_brush.GetStyle()))
{
gdk_gc_set_ts_origin( m_brushGC, m_deviceOriginX % 16, m_deviceOriginY % 16 );
gdk_draw_arc( m_window, m_brushGC, TRUE, xx, yy, ww, hh, 0, 360*64 );
gdk_gc_set_ts_origin( m_brushGC, 0, 0 );
} else
if (m_brush.GetStyle() == wxSTIPPLE)
{
gdk_gc_set_ts_origin( m_brushGC,
m_deviceOriginX % m_brush.GetStipple()->GetWidth(),

View File

@@ -567,7 +567,8 @@ static void gtk_menu_clicked_callback( GtkWidget *widget, wxMenu *menu )
wxCommandEvent event( wxEVT_COMMAND_MENU_SELECTED, id );
event.SetEventObject( menu );
event.SetInt(id );
if (item->IsCheckable())
event.SetInt( item->IsChecked() );
#if wxUSE_MENU_CALLBACK
if (menu->GetCallback())
@@ -948,8 +949,9 @@ bool wxMenu::GtkAppend(wxMenuItem *mitem)
// due to an apparent bug in GTK+, we have to use a static buffer here -
// otherwise GTK+ 1.2.2 manages to override the memory we pass to it
// somehow! (VZ)
static char s_accel[32]; // must be big enough for <control><alt><shift>F12
strncpy(s_accel, GetHotKey(*mitem).mb_str(), WXSIZEOF(s_accel));
static char s_accel[50]; // must be big enougg
wxString tmp( GetHotKey(*mitem) );
strncpy(s_accel, tmp.mb_str(), WXSIZEOF(s_accel));
entry.accelerator = s_accel;
#else // !wxUSE_ACCEL
entry.accelerator = (char*) NULL;
@@ -1090,6 +1092,20 @@ static wxString GetHotKey( const wxMenuItem& item )
case WXK_F12:
hotkey << wxT('F') << code - WXK_F1 + 1;
break;
// GTK seems to use XStringToKeySym here
case WXK_NUMPAD_INSERT:
hotkey << wxT("KP_Insert" );
break;
case WXK_NUMPAD_DELETE:
hotkey << wxT("KP_Delete" );
break;
case WXK_INSERT:
hotkey << wxT("Insert" );
break;
case WXK_DELETE:
hotkey << wxT("Delete" );
break;
// if there are any other keys wxGetAccelFromString() may return,
// we should process them here

View File

@@ -45,28 +45,28 @@ bool wxStaticLine::Create( wxWindow *parent, wxWindowID id,
!CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
{
wxFAIL_MSG( wxT("wxStaticLine creation failed") );
return FALSE;
return FALSE;
}
if ( IsVertical() )
{
m_widget = gtk_vseparator_new();
if (size.x == -1)
{
wxSize new_size( size );
new_size.x = 4;
SetSize( new_size );
}
if (size.x == -1)
{
wxSize new_size( size );
new_size.x = 4;
SetSize( new_size );
}
}
else
{
m_widget = gtk_hseparator_new();
if (size.y == -1)
{
wxSize new_size( size );
new_size.y = 4;
SetSize( new_size );
}
if (size.y == -1)
{
wxSize new_size( size );
new_size.y = 4;
SetSize( new_size );
}
}
m_parent->DoAddChild( this );

View File

@@ -98,6 +98,8 @@ END_EVENT_TABLE()
wxTextCtrl::wxTextCtrl()
{
m_modified = FALSE;
m_text =
m_vScrollbar = (GtkWidget *)NULL;
}
wxTextCtrl::wxTextCtrl( wxWindow *parent,

View File

@@ -77,13 +77,13 @@ static void gtk_pizza_adjust_allocations (GtkPizza *pizza,
gint dy);
/* unused */
#if 0
static void gtk_pizza_expose_area (GtkPizza *pizza,
gint x,
gint y,
gint width,
gint height);
/* unused */
#if 0
static void gtk_pizza_adjustment_changed (GtkAdjustment *adjustment,
GtkPizza *pizza);
#endif
@@ -981,6 +981,8 @@ gtk_pizza_adjust_allocations (GtkPizza *pizza,
/* Callbacks */
/* unused */
#if 0
/* Send a synthetic expose event to the widget
*/
static void
@@ -1006,6 +1008,7 @@ gtk_pizza_expose_area (GtkPizza *pizza,
gdk_window_unref (event.window);
}
}
#endif /* unused */
/* This function is used to find events to process while scrolling
*/