Some more drawing things,
Tried to make miniframe stay on top, doesn't work, Make radio box big enough for its title, Can't anylong close disabled toplevel windows, Minor other changes. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6438 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
f1567cddea
commit
a56fcaaf46
@ -392,6 +392,8 @@ void MyCanvas::DrawTestPoly( int x, int y,wxDC &dc,int transparent )
|
|||||||
dc.SetTextBackground(m_owner->m_colourBackground);
|
dc.SetTextBackground(m_owner->m_colourBackground);
|
||||||
dc.DrawRectangle( x+50, y+50, 200, 200 );
|
dc.DrawRectangle( x+50, y+50, 200, 200 );
|
||||||
|
|
||||||
|
dc.DrawCircle( x+400, y+50, 130 );
|
||||||
|
|
||||||
dc.SetBrush(wxNullBrush);
|
dc.SetBrush(wxNullBrush);
|
||||||
dc.SetPen(wxNullPen);
|
dc.SetPen(wxNullPen);
|
||||||
break;
|
break;
|
||||||
|
@ -203,7 +203,7 @@ wxHtmlWindow *html;
|
|||||||
// ... and attach this menu bar to the frame
|
// ... and attach this menu bar to the frame
|
||||||
SetMenuBar(menuBar);
|
SetMenuBar(menuBar);
|
||||||
|
|
||||||
CreateStatusBar(1);
|
CreateStatusBar(2);
|
||||||
|
|
||||||
html = new wxHtmlWindow(this);
|
html = new wxHtmlWindow(this);
|
||||||
html -> SetRelatedFrame(this, "VFS Demo: '%s'");
|
html -> SetRelatedFrame(this, "VFS Demo: '%s'");
|
||||||
|
@ -51,14 +51,6 @@ wxButton *button = (wxButton*) NULL;
|
|||||||
// main frame
|
// main frame
|
||||||
bool MyApp::OnInit()
|
bool MyApp::OnInit()
|
||||||
{
|
{
|
||||||
// Create the mini frame window
|
|
||||||
mini_frame = new MyMiniFrame((wxFrame *) NULL, -1, "wxMiniFrame sample",
|
|
||||||
wxPoint(100, 100), wxSize(220, 100));
|
|
||||||
mini_frame_exists = TRUE;
|
|
||||||
|
|
||||||
mini_frame->CreateToolBar(wxNO_BORDER|wxTB_HORIZONTAL|wxTB_FLAT, ID_TOOLBAR);
|
|
||||||
InitToolbar(mini_frame->GetToolBar());
|
|
||||||
|
|
||||||
// Create the main frame window
|
// Create the main frame window
|
||||||
main_frame = new MyMainFrame((wxFrame *) NULL, -1, "wxFrame sample",
|
main_frame = new MyMainFrame((wxFrame *) NULL, -1, "wxFrame sample",
|
||||||
wxPoint(100, 100), wxSize(300, 200));
|
wxPoint(100, 100), wxSize(300, 200));
|
||||||
@ -68,6 +60,14 @@ bool MyApp::OnInit()
|
|||||||
|
|
||||||
button = new wxButton( main_frame, ID_REPARENT, "Press to reparent!" );
|
button = new wxButton( main_frame, ID_REPARENT, "Press to reparent!" );
|
||||||
|
|
||||||
|
// Create the mini frame window
|
||||||
|
mini_frame = new MyMiniFrame( main_frame, -1, "wxMiniFrame sample",
|
||||||
|
wxPoint(100, 100), wxSize(220, 100));
|
||||||
|
mini_frame_exists = TRUE;
|
||||||
|
|
||||||
|
mini_frame->CreateToolBar(wxNO_BORDER|wxTB_HORIZONTAL|wxTB_FLAT, ID_TOOLBAR);
|
||||||
|
InitToolbar(mini_frame->GetToolBar());
|
||||||
|
|
||||||
#ifdef __WXMSW__
|
#ifdef __WXMSW__
|
||||||
main_frame->SetIcon(wxIcon("mondrian"));
|
main_frame->SetIcon(wxIcon("mondrian"));
|
||||||
mini_frame->SetIcon(wxIcon("mondrian"));
|
mini_frame->SetIcon(wxIcon("mondrian"));
|
||||||
|
@ -195,10 +195,12 @@ void wxPreviewCanvas::OnPaint(wxPaintEvent& WXUNUSED(event))
|
|||||||
wxPaintDC dc(this);
|
wxPaintDC dc(this);
|
||||||
PrepareDC( dc );
|
PrepareDC( dc );
|
||||||
|
|
||||||
|
/*
|
||||||
#ifdef __WXGTK__
|
#ifdef __WXGTK__
|
||||||
if (!GetUpdateRegion().IsEmpty())
|
if (!GetUpdateRegion().IsEmpty())
|
||||||
dc.SetClippingRegion( GetUpdateRegion() );
|
dc.SetClippingRegion( GetUpdateRegion() );
|
||||||
#endif
|
#endif
|
||||||
|
*/
|
||||||
|
|
||||||
if (m_printPreview)
|
if (m_printPreview)
|
||||||
{
|
{
|
||||||
|
@ -302,7 +302,6 @@ void wxWindowDC::SetUpDC()
|
|||||||
gdk_gc_set_background( m_penGC, bg_col );
|
gdk_gc_set_background( m_penGC, bg_col );
|
||||||
|
|
||||||
gdk_gc_set_line_attributes( m_penGC, 0, GDK_LINE_SOLID, GDK_CAP_NOT_LAST, GDK_JOIN_ROUND );
|
gdk_gc_set_line_attributes( m_penGC, 0, GDK_LINE_SOLID, GDK_CAP_NOT_LAST, GDK_JOIN_ROUND );
|
||||||
|
|
||||||
|
|
||||||
/* m_brushGC */
|
/* m_brushGC */
|
||||||
m_brush.GetColour().CalcPixel( m_cmap );
|
m_brush.GetColour().CalcPixel( m_cmap );
|
||||||
@ -311,7 +310,6 @@ void wxWindowDC::SetUpDC()
|
|||||||
|
|
||||||
gdk_gc_set_fill( m_brushGC, GDK_SOLID );
|
gdk_gc_set_fill( m_brushGC, GDK_SOLID );
|
||||||
|
|
||||||
|
|
||||||
/* m_bgGC */
|
/* m_bgGC */
|
||||||
gdk_gc_set_background( m_bgGC, bg_col );
|
gdk_gc_set_background( m_bgGC, bg_col );
|
||||||
gdk_gc_set_foreground( m_bgGC, bg_col );
|
gdk_gc_set_foreground( m_bgGC, bg_col );
|
||||||
@ -552,8 +550,6 @@ void wxWindowDC::DoDrawPolygon( int n, wxPoint points[], wxCoord xoffset, wxCoor
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// To do: Fillstyle
|
|
||||||
|
|
||||||
if (m_pen.GetStyle() != wxTRANSPARENT)
|
if (m_pen.GetStyle() != wxTRANSPARENT)
|
||||||
{
|
{
|
||||||
for (i = 0 ; i < n ; i++)
|
for (i = 0 ; i < n ; i++)
|
||||||
@ -666,12 +662,41 @@ void wxWindowDC::DoDrawRoundedRectangle( wxCoord x, wxCoord y, wxCoord width, wx
|
|||||||
|
|
||||||
if (m_brush.GetStyle() != wxTRANSPARENT)
|
if (m_brush.GetStyle() != wxTRANSPARENT)
|
||||||
{
|
{
|
||||||
gdk_draw_rectangle( m_window, m_brushGC, TRUE, xx+rr, yy, ww-dd+1, hh );
|
if ((m_brush.GetStyle() == wxSTIPPLE_MASK_OPAQUE) && (m_brush.GetStipple()->GetMask()))
|
||||||
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_gc_set_ts_origin( m_textGC,
|
||||||
gdk_draw_arc( m_window, m_brushGC, TRUE, xx+ww-dd, yy, dd, dd, 0, 90*64 );
|
m_deviceOriginX % m_brush.GetStipple()->GetWidth(),
|
||||||
gdk_draw_arc( m_window, m_brushGC, TRUE, xx+ww-dd, yy+hh-dd, dd, dd, 270*64, 90*64 );
|
m_deviceOriginY % m_brush.GetStipple()->GetHeight() );
|
||||||
gdk_draw_arc( m_window, m_brushGC, TRUE, xx, yy+hh-dd, dd, dd, 180*64, 90*64 );
|
gdk_draw_rectangle( m_window, m_textGC, TRUE, xx+rr, yy, ww-dd+1, hh );
|
||||||
|
gdk_draw_rectangle( m_window, m_textGC, TRUE, xx, yy+rr, ww, hh-dd+1 );
|
||||||
|
gdk_draw_arc( m_window, m_textGC, TRUE, xx, yy, dd, dd, 90*64, 90*64 );
|
||||||
|
gdk_draw_arc( m_window, m_textGC, TRUE, xx+ww-dd, yy, dd, dd, 0, 90*64 );
|
||||||
|
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)
|
||||||
|
{
|
||||||
|
gdk_gc_set_ts_origin( m_brushGC,
|
||||||
|
m_deviceOriginX % m_brush.GetStipple()->GetWidth(),
|
||||||
|
m_deviceOriginY % m_brush.GetStipple()->GetHeight() );
|
||||||
|
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
|
||||||
|
{
|
||||||
|
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 );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_pen.GetStyle() != wxTRANSPARENT)
|
if (m_pen.GetStyle() != wxTRANSPARENT)
|
||||||
@ -708,7 +733,28 @@ void wxWindowDC::DoDrawEllipse( wxCoord x, wxCoord y, wxCoord width, wxCoord hei
|
|||||||
if (m_window)
|
if (m_window)
|
||||||
{
|
{
|
||||||
if (m_brush.GetStyle() != wxTRANSPARENT)
|
if (m_brush.GetStyle() != wxTRANSPARENT)
|
||||||
gdk_draw_arc( m_window, m_brushGC, TRUE, xx, yy, ww, hh, 0, 360*64 );
|
{
|
||||||
|
if ((m_brush.GetStyle() == wxSTIPPLE_MASK_OPAQUE) && (m_brush.GetStipple()->GetMask()))
|
||||||
|
{
|
||||||
|
gdk_gc_set_ts_origin( m_textGC,
|
||||||
|
m_deviceOriginX % m_brush.GetStipple()->GetWidth(),
|
||||||
|
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)
|
||||||
|
{
|
||||||
|
gdk_gc_set_ts_origin( m_brushGC,
|
||||||
|
m_deviceOriginX % m_brush.GetStipple()->GetWidth(),
|
||||||
|
m_deviceOriginY % m_brush.GetStipple()->GetHeight() );
|
||||||
|
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
|
||||||
|
{
|
||||||
|
gdk_draw_arc( m_window, m_brushGC, TRUE, xx, yy, ww, hh, 0, 360*64 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (m_pen.GetStyle() != wxTRANSPARENT)
|
if (m_pen.GetStyle() != wxTRANSPARENT)
|
||||||
gdk_draw_arc( m_window, m_penGC, FALSE, xx, yy, ww, hh, 0, 360*64 );
|
gdk_draw_arc( m_window, m_penGC, FALSE, xx, yy, ww, hh, 0, 360*64 );
|
||||||
@ -798,14 +844,6 @@ void wxWindowDC::DoDrawBitmap( const wxBitmap &bitmap,
|
|||||||
gdk_gc_set_fill( gc, GDK_OPAQUE_STIPPLED );
|
gdk_gc_set_fill( gc, GDK_OPAQUE_STIPPLED );
|
||||||
gdk_gc_set_stipple( gc, mask );
|
gdk_gc_set_stipple( gc, mask );
|
||||||
gdk_draw_rectangle( new_mask, gc, TRUE, 0, 0, ww, hh );
|
gdk_draw_rectangle( new_mask, gc, TRUE, 0, 0, ww, hh );
|
||||||
/*
|
|
||||||
gdk_gc_set_clip_mask( m_brushGC, NULL );
|
|
||||||
gdk_gc_set_clip_mask( m_textGC, NULL );
|
|
||||||
SetBrush( *wxRED_BRUSH );
|
|
||||||
DrawRectangle( 70, 0, 70, 1000 );
|
|
||||||
gdk_draw_bitmap( m_window, m_textGC, new_mask, 0, 0, 100, 5, ww, hh );
|
|
||||||
gdk_draw_bitmap( m_window, m_textGC, mask, 0, 0, 80, 5, ww, hh );
|
|
||||||
*/
|
|
||||||
gdk_gc_unref( gc );
|
gdk_gc_unref( gc );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1060,27 +1098,21 @@ bool wxWindowDC::DoBlit( wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord he
|
|||||||
|
|
||||||
wxBitmap bitmap( width, height );
|
wxBitmap bitmap( width, height );
|
||||||
|
|
||||||
if (srcDC->m_isScreenDC)
|
/* copy including child window contents */
|
||||||
gdk_gc_set_subwindow( m_penGC, GDK_INCLUDE_INFERIORS );
|
gdk_gc_set_subwindow( m_penGC, GDK_INCLUDE_INFERIORS );
|
||||||
|
|
||||||
gdk_window_copy_area( bitmap.GetPixmap(), m_penGC, 0, 0,
|
gdk_window_copy_area( bitmap.GetPixmap(), m_penGC, 0, 0,
|
||||||
srcDC->GetWindow(),
|
srcDC->GetWindow(),
|
||||||
xsrc, ysrc, width, height );
|
xsrc, ysrc, width, height );
|
||||||
|
gdk_gc_set_subwindow( m_penGC, GDK_CLIP_BY_CHILDREN );
|
||||||
if (srcDC->m_isScreenDC)
|
|
||||||
gdk_gc_set_subwindow( m_penGC, GDK_CLIP_BY_CHILDREN );
|
|
||||||
|
|
||||||
/* scale image */
|
/* scale image */
|
||||||
|
|
||||||
wxImage image( bitmap );
|
wxImage image( bitmap );
|
||||||
image = image.Scale( ww, hh );
|
image = image.Scale( ww, hh );
|
||||||
|
|
||||||
/* convert to bitmap */
|
/* convert to bitmap */
|
||||||
|
|
||||||
bitmap = image.ConvertToBitmap();
|
bitmap = image.ConvertToBitmap();
|
||||||
|
|
||||||
/* draw scaled bitmap */
|
/* draw scaled bitmap */
|
||||||
|
|
||||||
gdk_draw_pixmap( m_window, m_penGC, bitmap.GetPixmap(), 0, 0, xx, yy, -1, -1 );
|
gdk_draw_pixmap( m_window, m_penGC, bitmap.GetPixmap(), 0, 0, xx, yy, -1, -1 );
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1088,15 +1120,12 @@ bool wxWindowDC::DoBlit( wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord he
|
|||||||
{
|
{
|
||||||
/* No scaling and not a memory dc with a mask either */
|
/* No scaling and not a memory dc with a mask either */
|
||||||
|
|
||||||
if (srcDC->m_isScreenDC)
|
/* copy including child window contents */
|
||||||
gdk_gc_set_subwindow( m_penGC, GDK_INCLUDE_INFERIORS );
|
gdk_gc_set_subwindow( m_penGC, GDK_INCLUDE_INFERIORS );
|
||||||
|
|
||||||
gdk_window_copy_area( m_window, m_penGC, xx, yy,
|
gdk_window_copy_area( m_window, m_penGC, xx, yy,
|
||||||
srcDC->GetWindow(),
|
srcDC->GetWindow(),
|
||||||
xsrc, ysrc, width, height );
|
xsrc, ysrc, width, height );
|
||||||
|
gdk_gc_set_subwindow( m_penGC, GDK_CLIP_BY_CHILDREN );
|
||||||
if (srcDC->m_isScreenDC)
|
|
||||||
gdk_gc_set_subwindow( m_penGC, GDK_CLIP_BY_CHILDREN );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,7 +59,8 @@ bool gtk_dialog_delete_callback( GtkWidget *WXUNUSED(widget), GdkEvent *WXUNUSED
|
|||||||
if (g_isIdle)
|
if (g_isIdle)
|
||||||
wxapp_install_idle_handler();
|
wxapp_install_idle_handler();
|
||||||
|
|
||||||
win->Close();
|
if (win->IsEnabled())
|
||||||
|
win->Close();
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -139,7 +139,7 @@ static gint gtk_frame_delete_callback( GtkWidget *WXUNUSED(widget), GdkEvent *WX
|
|||||||
if (g_isIdle)
|
if (g_isIdle)
|
||||||
wxapp_install_idle_handler();
|
wxapp_install_idle_handler();
|
||||||
|
|
||||||
if (g_openDialogs == 0)
|
if ((g_openDialogs == 0) && (win->IsEnabled()))
|
||||||
win->Close();
|
win->Close();
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -318,6 +318,9 @@ bool wxMiniFrame::Create( wxWindow *parent, wxWindowID id, const wxString &title
|
|||||||
|
|
||||||
wxFrame::Create( parent, id, title, pos, size, style, name );
|
wxFrame::Create( parent, id, title, pos, size, style, name );
|
||||||
|
|
||||||
|
if ((m_parent) && (GTK_IS_WINDOW(m_parent->m_widget)))
|
||||||
|
gtk_window_set_transient_for( GTK_WINDOW(m_widget), GTK_WINDOW(m_parent->m_widget) );
|
||||||
|
|
||||||
if ((style & wxSYSTEM_MENU) &&
|
if ((style & wxSYSTEM_MENU) &&
|
||||||
((style & wxCAPTION) || (style & wxTINY_CAPTION_HORIZ) || (style & wxTINY_CAPTION_VERT)))
|
((style & wxCAPTION) || (style & wxTINY_CAPTION_HORIZ) || (style & wxTINY_CAPTION_VERT)))
|
||||||
{
|
{
|
||||||
|
@ -192,6 +192,12 @@ bool wxRadioBox::Create( wxWindow *parent, wxWindowID id, const wxString& title,
|
|||||||
|
|
||||||
wxSize ls = LayoutItems();
|
wxSize ls = LayoutItems();
|
||||||
|
|
||||||
|
GtkRequisition req;
|
||||||
|
req.width = 2;
|
||||||
|
req.height = 2;
|
||||||
|
(* GTK_WIDGET_CLASS( GTK_OBJECT(m_widget)->klass )->size_request ) (m_widget, &req );
|
||||||
|
if (req.width > ls.x) ls.x = req.width;
|
||||||
|
|
||||||
wxSize newSize = size;
|
wxSize newSize = size;
|
||||||
if (newSize.x == -1) newSize.x = ls.x;
|
if (newSize.x == -1) newSize.x = ls.x;
|
||||||
if (newSize.y == -1) newSize.y = ls.y;
|
if (newSize.y == -1) newSize.y = ls.y;
|
||||||
|
@ -208,6 +208,8 @@ extern bool g_mainThreadLocked;
|
|||||||
// debug
|
// debug
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
#define DISABLE_STYLE_IF_BROKEN_THEME 1
|
||||||
|
|
||||||
#ifdef __WXDEBUG__
|
#ifdef __WXDEBUG__
|
||||||
|
|
||||||
#if wxUSE_THREADS
|
#if wxUSE_THREADS
|
||||||
@ -2157,10 +2159,11 @@ wxWindow::~wxWindow()
|
|||||||
|
|
||||||
if (m_widgetStyle)
|
if (m_widgetStyle)
|
||||||
{
|
{
|
||||||
|
#if DISABLE_STYLE_IF_BROKEN_THEME
|
||||||
// don't delete if it's a pixmap theme style
|
// don't delete if it's a pixmap theme style
|
||||||
if (!m_widgetStyle->engine_data)
|
if (!m_widgetStyle->engine_data)
|
||||||
gtk_style_unref( m_widgetStyle );
|
gtk_style_unref( m_widgetStyle );
|
||||||
|
#endif
|
||||||
m_widgetStyle = (GtkStyle*) NULL;
|
m_widgetStyle = (GtkStyle*) NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3053,6 +3056,7 @@ GtkStyle *wxWindow::GetWidgetStyle()
|
|||||||
|
|
||||||
void wxWindow::SetWidgetStyle()
|
void wxWindow::SetWidgetStyle()
|
||||||
{
|
{
|
||||||
|
#if DISABLE_STYLE_IF_BROKEN_THEM
|
||||||
if (m_widget->style->engine_data)
|
if (m_widget->style->engine_data)
|
||||||
{
|
{
|
||||||
static bool s_warningPrinted = FALSE;
|
static bool s_warningPrinted = FALSE;
|
||||||
@ -3064,6 +3068,7 @@ void wxWindow::SetWidgetStyle()
|
|||||||
m_widgetStyle = m_widget->style;
|
m_widgetStyle = m_widget->style;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
GtkStyle *style = GetWidgetStyle();
|
GtkStyle *style = GetWidgetStyle();
|
||||||
|
|
||||||
|
@ -302,7 +302,6 @@ void wxWindowDC::SetUpDC()
|
|||||||
gdk_gc_set_background( m_penGC, bg_col );
|
gdk_gc_set_background( m_penGC, bg_col );
|
||||||
|
|
||||||
gdk_gc_set_line_attributes( m_penGC, 0, GDK_LINE_SOLID, GDK_CAP_NOT_LAST, GDK_JOIN_ROUND );
|
gdk_gc_set_line_attributes( m_penGC, 0, GDK_LINE_SOLID, GDK_CAP_NOT_LAST, GDK_JOIN_ROUND );
|
||||||
|
|
||||||
|
|
||||||
/* m_brushGC */
|
/* m_brushGC */
|
||||||
m_brush.GetColour().CalcPixel( m_cmap );
|
m_brush.GetColour().CalcPixel( m_cmap );
|
||||||
@ -311,7 +310,6 @@ void wxWindowDC::SetUpDC()
|
|||||||
|
|
||||||
gdk_gc_set_fill( m_brushGC, GDK_SOLID );
|
gdk_gc_set_fill( m_brushGC, GDK_SOLID );
|
||||||
|
|
||||||
|
|
||||||
/* m_bgGC */
|
/* m_bgGC */
|
||||||
gdk_gc_set_background( m_bgGC, bg_col );
|
gdk_gc_set_background( m_bgGC, bg_col );
|
||||||
gdk_gc_set_foreground( m_bgGC, bg_col );
|
gdk_gc_set_foreground( m_bgGC, bg_col );
|
||||||
@ -552,8 +550,6 @@ void wxWindowDC::DoDrawPolygon( int n, wxPoint points[], wxCoord xoffset, wxCoor
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// To do: Fillstyle
|
|
||||||
|
|
||||||
if (m_pen.GetStyle() != wxTRANSPARENT)
|
if (m_pen.GetStyle() != wxTRANSPARENT)
|
||||||
{
|
{
|
||||||
for (i = 0 ; i < n ; i++)
|
for (i = 0 ; i < n ; i++)
|
||||||
@ -666,12 +662,41 @@ void wxWindowDC::DoDrawRoundedRectangle( wxCoord x, wxCoord y, wxCoord width, wx
|
|||||||
|
|
||||||
if (m_brush.GetStyle() != wxTRANSPARENT)
|
if (m_brush.GetStyle() != wxTRANSPARENT)
|
||||||
{
|
{
|
||||||
gdk_draw_rectangle( m_window, m_brushGC, TRUE, xx+rr, yy, ww-dd+1, hh );
|
if ((m_brush.GetStyle() == wxSTIPPLE_MASK_OPAQUE) && (m_brush.GetStipple()->GetMask()))
|
||||||
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_gc_set_ts_origin( m_textGC,
|
||||||
gdk_draw_arc( m_window, m_brushGC, TRUE, xx+ww-dd, yy, dd, dd, 0, 90*64 );
|
m_deviceOriginX % m_brush.GetStipple()->GetWidth(),
|
||||||
gdk_draw_arc( m_window, m_brushGC, TRUE, xx+ww-dd, yy+hh-dd, dd, dd, 270*64, 90*64 );
|
m_deviceOriginY % m_brush.GetStipple()->GetHeight() );
|
||||||
gdk_draw_arc( m_window, m_brushGC, TRUE, xx, yy+hh-dd, dd, dd, 180*64, 90*64 );
|
gdk_draw_rectangle( m_window, m_textGC, TRUE, xx+rr, yy, ww-dd+1, hh );
|
||||||
|
gdk_draw_rectangle( m_window, m_textGC, TRUE, xx, yy+rr, ww, hh-dd+1 );
|
||||||
|
gdk_draw_arc( m_window, m_textGC, TRUE, xx, yy, dd, dd, 90*64, 90*64 );
|
||||||
|
gdk_draw_arc( m_window, m_textGC, TRUE, xx+ww-dd, yy, dd, dd, 0, 90*64 );
|
||||||
|
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)
|
||||||
|
{
|
||||||
|
gdk_gc_set_ts_origin( m_brushGC,
|
||||||
|
m_deviceOriginX % m_brush.GetStipple()->GetWidth(),
|
||||||
|
m_deviceOriginY % m_brush.GetStipple()->GetHeight() );
|
||||||
|
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
|
||||||
|
{
|
||||||
|
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 );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_pen.GetStyle() != wxTRANSPARENT)
|
if (m_pen.GetStyle() != wxTRANSPARENT)
|
||||||
@ -708,7 +733,28 @@ void wxWindowDC::DoDrawEllipse( wxCoord x, wxCoord y, wxCoord width, wxCoord hei
|
|||||||
if (m_window)
|
if (m_window)
|
||||||
{
|
{
|
||||||
if (m_brush.GetStyle() != wxTRANSPARENT)
|
if (m_brush.GetStyle() != wxTRANSPARENT)
|
||||||
gdk_draw_arc( m_window, m_brushGC, TRUE, xx, yy, ww, hh, 0, 360*64 );
|
{
|
||||||
|
if ((m_brush.GetStyle() == wxSTIPPLE_MASK_OPAQUE) && (m_brush.GetStipple()->GetMask()))
|
||||||
|
{
|
||||||
|
gdk_gc_set_ts_origin( m_textGC,
|
||||||
|
m_deviceOriginX % m_brush.GetStipple()->GetWidth(),
|
||||||
|
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)
|
||||||
|
{
|
||||||
|
gdk_gc_set_ts_origin( m_brushGC,
|
||||||
|
m_deviceOriginX % m_brush.GetStipple()->GetWidth(),
|
||||||
|
m_deviceOriginY % m_brush.GetStipple()->GetHeight() );
|
||||||
|
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
|
||||||
|
{
|
||||||
|
gdk_draw_arc( m_window, m_brushGC, TRUE, xx, yy, ww, hh, 0, 360*64 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (m_pen.GetStyle() != wxTRANSPARENT)
|
if (m_pen.GetStyle() != wxTRANSPARENT)
|
||||||
gdk_draw_arc( m_window, m_penGC, FALSE, xx, yy, ww, hh, 0, 360*64 );
|
gdk_draw_arc( m_window, m_penGC, FALSE, xx, yy, ww, hh, 0, 360*64 );
|
||||||
@ -798,14 +844,6 @@ void wxWindowDC::DoDrawBitmap( const wxBitmap &bitmap,
|
|||||||
gdk_gc_set_fill( gc, GDK_OPAQUE_STIPPLED );
|
gdk_gc_set_fill( gc, GDK_OPAQUE_STIPPLED );
|
||||||
gdk_gc_set_stipple( gc, mask );
|
gdk_gc_set_stipple( gc, mask );
|
||||||
gdk_draw_rectangle( new_mask, gc, TRUE, 0, 0, ww, hh );
|
gdk_draw_rectangle( new_mask, gc, TRUE, 0, 0, ww, hh );
|
||||||
/*
|
|
||||||
gdk_gc_set_clip_mask( m_brushGC, NULL );
|
|
||||||
gdk_gc_set_clip_mask( m_textGC, NULL );
|
|
||||||
SetBrush( *wxRED_BRUSH );
|
|
||||||
DrawRectangle( 70, 0, 70, 1000 );
|
|
||||||
gdk_draw_bitmap( m_window, m_textGC, new_mask, 0, 0, 100, 5, ww, hh );
|
|
||||||
gdk_draw_bitmap( m_window, m_textGC, mask, 0, 0, 80, 5, ww, hh );
|
|
||||||
*/
|
|
||||||
gdk_gc_unref( gc );
|
gdk_gc_unref( gc );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1060,27 +1098,21 @@ bool wxWindowDC::DoBlit( wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord he
|
|||||||
|
|
||||||
wxBitmap bitmap( width, height );
|
wxBitmap bitmap( width, height );
|
||||||
|
|
||||||
if (srcDC->m_isScreenDC)
|
/* copy including child window contents */
|
||||||
gdk_gc_set_subwindow( m_penGC, GDK_INCLUDE_INFERIORS );
|
gdk_gc_set_subwindow( m_penGC, GDK_INCLUDE_INFERIORS );
|
||||||
|
|
||||||
gdk_window_copy_area( bitmap.GetPixmap(), m_penGC, 0, 0,
|
gdk_window_copy_area( bitmap.GetPixmap(), m_penGC, 0, 0,
|
||||||
srcDC->GetWindow(),
|
srcDC->GetWindow(),
|
||||||
xsrc, ysrc, width, height );
|
xsrc, ysrc, width, height );
|
||||||
|
gdk_gc_set_subwindow( m_penGC, GDK_CLIP_BY_CHILDREN );
|
||||||
if (srcDC->m_isScreenDC)
|
|
||||||
gdk_gc_set_subwindow( m_penGC, GDK_CLIP_BY_CHILDREN );
|
|
||||||
|
|
||||||
/* scale image */
|
/* scale image */
|
||||||
|
|
||||||
wxImage image( bitmap );
|
wxImage image( bitmap );
|
||||||
image = image.Scale( ww, hh );
|
image = image.Scale( ww, hh );
|
||||||
|
|
||||||
/* convert to bitmap */
|
/* convert to bitmap */
|
||||||
|
|
||||||
bitmap = image.ConvertToBitmap();
|
bitmap = image.ConvertToBitmap();
|
||||||
|
|
||||||
/* draw scaled bitmap */
|
/* draw scaled bitmap */
|
||||||
|
|
||||||
gdk_draw_pixmap( m_window, m_penGC, bitmap.GetPixmap(), 0, 0, xx, yy, -1, -1 );
|
gdk_draw_pixmap( m_window, m_penGC, bitmap.GetPixmap(), 0, 0, xx, yy, -1, -1 );
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1088,15 +1120,12 @@ bool wxWindowDC::DoBlit( wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord he
|
|||||||
{
|
{
|
||||||
/* No scaling and not a memory dc with a mask either */
|
/* No scaling and not a memory dc with a mask either */
|
||||||
|
|
||||||
if (srcDC->m_isScreenDC)
|
/* copy including child window contents */
|
||||||
gdk_gc_set_subwindow( m_penGC, GDK_INCLUDE_INFERIORS );
|
gdk_gc_set_subwindow( m_penGC, GDK_INCLUDE_INFERIORS );
|
||||||
|
|
||||||
gdk_window_copy_area( m_window, m_penGC, xx, yy,
|
gdk_window_copy_area( m_window, m_penGC, xx, yy,
|
||||||
srcDC->GetWindow(),
|
srcDC->GetWindow(),
|
||||||
xsrc, ysrc, width, height );
|
xsrc, ysrc, width, height );
|
||||||
|
gdk_gc_set_subwindow( m_penGC, GDK_CLIP_BY_CHILDREN );
|
||||||
if (srcDC->m_isScreenDC)
|
|
||||||
gdk_gc_set_subwindow( m_penGC, GDK_CLIP_BY_CHILDREN );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,7 +59,8 @@ bool gtk_dialog_delete_callback( GtkWidget *WXUNUSED(widget), GdkEvent *WXUNUSED
|
|||||||
if (g_isIdle)
|
if (g_isIdle)
|
||||||
wxapp_install_idle_handler();
|
wxapp_install_idle_handler();
|
||||||
|
|
||||||
win->Close();
|
if (win->IsEnabled())
|
||||||
|
win->Close();
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -139,7 +139,7 @@ static gint gtk_frame_delete_callback( GtkWidget *WXUNUSED(widget), GdkEvent *WX
|
|||||||
if (g_isIdle)
|
if (g_isIdle)
|
||||||
wxapp_install_idle_handler();
|
wxapp_install_idle_handler();
|
||||||
|
|
||||||
if (g_openDialogs == 0)
|
if ((g_openDialogs == 0) && (win->IsEnabled()))
|
||||||
win->Close();
|
win->Close();
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -318,6 +318,9 @@ bool wxMiniFrame::Create( wxWindow *parent, wxWindowID id, const wxString &title
|
|||||||
|
|
||||||
wxFrame::Create( parent, id, title, pos, size, style, name );
|
wxFrame::Create( parent, id, title, pos, size, style, name );
|
||||||
|
|
||||||
|
if ((m_parent) && (GTK_IS_WINDOW(m_parent->m_widget)))
|
||||||
|
gtk_window_set_transient_for( GTK_WINDOW(m_widget), GTK_WINDOW(m_parent->m_widget) );
|
||||||
|
|
||||||
if ((style & wxSYSTEM_MENU) &&
|
if ((style & wxSYSTEM_MENU) &&
|
||||||
((style & wxCAPTION) || (style & wxTINY_CAPTION_HORIZ) || (style & wxTINY_CAPTION_VERT)))
|
((style & wxCAPTION) || (style & wxTINY_CAPTION_HORIZ) || (style & wxTINY_CAPTION_VERT)))
|
||||||
{
|
{
|
||||||
|
@ -192,6 +192,12 @@ bool wxRadioBox::Create( wxWindow *parent, wxWindowID id, const wxString& title,
|
|||||||
|
|
||||||
wxSize ls = LayoutItems();
|
wxSize ls = LayoutItems();
|
||||||
|
|
||||||
|
GtkRequisition req;
|
||||||
|
req.width = 2;
|
||||||
|
req.height = 2;
|
||||||
|
(* GTK_WIDGET_CLASS( GTK_OBJECT(m_widget)->klass )->size_request ) (m_widget, &req );
|
||||||
|
if (req.width > ls.x) ls.x = req.width;
|
||||||
|
|
||||||
wxSize newSize = size;
|
wxSize newSize = size;
|
||||||
if (newSize.x == -1) newSize.x = ls.x;
|
if (newSize.x == -1) newSize.x = ls.x;
|
||||||
if (newSize.y == -1) newSize.y = ls.y;
|
if (newSize.y == -1) newSize.y = ls.y;
|
||||||
|
@ -208,6 +208,8 @@ extern bool g_mainThreadLocked;
|
|||||||
// debug
|
// debug
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
#define DISABLE_STYLE_IF_BROKEN_THEME 1
|
||||||
|
|
||||||
#ifdef __WXDEBUG__
|
#ifdef __WXDEBUG__
|
||||||
|
|
||||||
#if wxUSE_THREADS
|
#if wxUSE_THREADS
|
||||||
@ -2157,10 +2159,11 @@ wxWindow::~wxWindow()
|
|||||||
|
|
||||||
if (m_widgetStyle)
|
if (m_widgetStyle)
|
||||||
{
|
{
|
||||||
|
#if DISABLE_STYLE_IF_BROKEN_THEME
|
||||||
// don't delete if it's a pixmap theme style
|
// don't delete if it's a pixmap theme style
|
||||||
if (!m_widgetStyle->engine_data)
|
if (!m_widgetStyle->engine_data)
|
||||||
gtk_style_unref( m_widgetStyle );
|
gtk_style_unref( m_widgetStyle );
|
||||||
|
#endif
|
||||||
m_widgetStyle = (GtkStyle*) NULL;
|
m_widgetStyle = (GtkStyle*) NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3053,6 +3056,7 @@ GtkStyle *wxWindow::GetWidgetStyle()
|
|||||||
|
|
||||||
void wxWindow::SetWidgetStyle()
|
void wxWindow::SetWidgetStyle()
|
||||||
{
|
{
|
||||||
|
#if DISABLE_STYLE_IF_BROKEN_THEM
|
||||||
if (m_widget->style->engine_data)
|
if (m_widget->style->engine_data)
|
||||||
{
|
{
|
||||||
static bool s_warningPrinted = FALSE;
|
static bool s_warningPrinted = FALSE;
|
||||||
@ -3064,6 +3068,7 @@ void wxWindow::SetWidgetStyle()
|
|||||||
m_widgetStyle = m_widget->style;
|
m_widgetStyle = m_widget->style;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
GtkStyle *style = GetWidgetStyle();
|
GtkStyle *style = GetWidgetStyle();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user