Get/SetTitle only for wxTopLevelWindow (wxGTK part).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36084 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: minifram.cpp
|
// Name: src/gtk/minifram.cpp
|
||||||
// Purpose:
|
// Purpose:
|
||||||
// Author: Robert Roebling
|
// Author: Robert Roebling
|
||||||
// Id: $Id$
|
// Id: $Id$
|
||||||
@@ -82,7 +82,7 @@ static void gtk_window_own_expose_callback( GtkWidget *widget, GdkEventExpose *g
|
|||||||
0, 0,
|
0, 0,
|
||||||
win->m_width, win->m_height );
|
win->m_width, win->m_height );
|
||||||
|
|
||||||
if (!win->GetTitle().IsEmpty() &&
|
if (!win->GetTitle().empty() &&
|
||||||
((win->GetWindowStyle() & wxCAPTION) ||
|
((win->GetWindowStyle() & wxCAPTION) ||
|
||||||
(win->GetWindowStyle() & wxTINY_CAPTION_HORIZ) ||
|
(win->GetWindowStyle() & wxTINY_CAPTION_HORIZ) ||
|
||||||
(win->GetWindowStyle() & wxTINY_CAPTION_VERT)))
|
(win->GetWindowStyle() & wxTINY_CAPTION_VERT)))
|
||||||
@@ -90,7 +90,7 @@ static void gtk_window_own_expose_callback( GtkWidget *widget, GdkEventExpose *g
|
|||||||
wxClientDC dc(win);
|
wxClientDC dc(win);
|
||||||
dc.SetFont( *wxSMALL_FONT );
|
dc.SetFont( *wxSMALL_FONT );
|
||||||
int height = dc.GetCharHeight();
|
int height = dc.GetCharHeight();
|
||||||
|
|
||||||
GdkGC *gc = gdk_gc_new( pizza->bin_window );
|
GdkGC *gc = gdk_gc_new( pizza->bin_window );
|
||||||
gdk_gc_set_foreground( gc, &widget->style->bg[GTK_STATE_SELECTED] );
|
gdk_gc_set_foreground( gc, &widget->style->bg[GTK_STATE_SELECTED] );
|
||||||
gdk_draw_rectangle( pizza->bin_window, gc, TRUE,
|
gdk_draw_rectangle( pizza->bin_window, gc, TRUE,
|
||||||
@@ -129,7 +129,7 @@ static void gtk_window_own_draw_callback( GtkWidget *widget, GdkRectangle *WXUNU
|
|||||||
0, 0,
|
0, 0,
|
||||||
win->m_width, win->m_height );
|
win->m_width, win->m_height );
|
||||||
|
|
||||||
if (!win->m_title.IsEmpty() &&
|
if (!win->GetTitle().empty() &&
|
||||||
((win->GetWindowStyle() & wxCAPTION) ||
|
((win->GetWindowStyle() & wxCAPTION) ||
|
||||||
(win->GetWindowStyle() & wxTINY_CAPTION_HORIZ) ||
|
(win->GetWindowStyle() & wxTINY_CAPTION_HORIZ) ||
|
||||||
(win->GetWindowStyle() & wxTINY_CAPTION_VERT)))
|
(win->GetWindowStyle() & wxTINY_CAPTION_VERT)))
|
||||||
@@ -137,7 +137,7 @@ static void gtk_window_own_draw_callback( GtkWidget *widget, GdkRectangle *WXUNU
|
|||||||
wxClientDC dc(win);
|
wxClientDC dc(win);
|
||||||
dc.SetFont( *wxSMALL_FONT );
|
dc.SetFont( *wxSMALL_FONT );
|
||||||
int height = dc.GetCharHeight();
|
int height = dc.GetCharHeight();
|
||||||
|
|
||||||
GdkGC *gc = gdk_gc_new( pizza->bin_window );
|
GdkGC *gc = gdk_gc_new( pizza->bin_window );
|
||||||
gdk_gc_set_foreground( gc, &widget->style->bg[GTK_STATE_SELECTED] );
|
gdk_gc_set_foreground( gc, &widget->style->bg[GTK_STATE_SELECTED] );
|
||||||
gdk_draw_rectangle( pizza->bin_window, gc, TRUE,
|
gdk_draw_rectangle( pizza->bin_window, gc, TRUE,
|
||||||
@@ -177,9 +177,9 @@ static gint gtk_window_button_press_callback( GtkWidget *widget, GdkEventButton
|
|||||||
wxClientDC dc(win);
|
wxClientDC dc(win);
|
||||||
dc.SetFont( *wxSMALL_FONT );
|
dc.SetFont( *wxSMALL_FONT );
|
||||||
int height = dc.GetCharHeight() + 1;
|
int height = dc.GetCharHeight() + 1;
|
||||||
|
|
||||||
if (gdk_event->y > height) return TRUE;
|
if (gdk_event->y > height) return TRUE;
|
||||||
|
|
||||||
gdk_window_raise( win->m_widget->window );
|
gdk_window_raise( win->m_widget->window );
|
||||||
|
|
||||||
gdk_pointer_grab( widget->window, FALSE,
|
gdk_pointer_grab( widget->window, FALSE,
|
||||||
@@ -200,7 +200,7 @@ static gint gtk_window_button_press_callback( GtkWidget *widget, GdkEventButton
|
|||||||
win->m_oldX = 0;
|
win->m_oldX = 0;
|
||||||
win->m_oldY = 0;
|
win->m_oldY = 0;
|
||||||
|
|
||||||
win->m_isDragging = TRUE;
|
win->m_isDragging = true;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@@ -332,7 +332,7 @@ bool wxMiniFrame::Create( wxWindow *parent, wxWindowID id, const wxString &title
|
|||||||
m_miniTitle = 13;
|
m_miniTitle = 13;
|
||||||
|
|
||||||
m_miniEdge = 3;
|
m_miniEdge = 3;
|
||||||
m_isDragging = FALSE;
|
m_isDragging = false;
|
||||||
m_oldX = -1;
|
m_oldX = -1;
|
||||||
m_oldY = -1;
|
m_oldY = -1;
|
||||||
m_diffX = 0;
|
m_diffX = 0;
|
||||||
@@ -344,7 +344,7 @@ bool wxMiniFrame::Create( wxWindow *parent, wxWindowID id, const wxString &title
|
|||||||
{
|
{
|
||||||
gtk_window_set_transient_for( GTK_WINDOW(m_widget), GTK_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)))
|
||||||
{
|
{
|
||||||
@@ -394,13 +394,13 @@ bool wxMiniFrame::Create( wxWindow *parent, wxWindowID id, const wxString &title
|
|||||||
gtk_signal_connect( GTK_OBJECT(m_mainWidget), "motion_notify_event",
|
gtk_signal_connect( GTK_OBJECT(m_mainWidget), "motion_notify_event",
|
||||||
GTK_SIGNAL_FUNC(gtk_window_motion_notify_callback), (gpointer)this );
|
GTK_SIGNAL_FUNC(gtk_window_motion_notify_callback), (gpointer)this );
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxMiniFrame::SetTitle( const wxString &title )
|
void wxMiniFrame::SetTitle( const wxString &title )
|
||||||
{
|
{
|
||||||
wxFrame::SetTitle( title );
|
wxFrame::SetTitle( title );
|
||||||
|
|
||||||
#ifdef __WXGTK20__
|
#ifdef __WXGTK20__
|
||||||
gdk_window_invalidate_rect( GTK_PIZZA(m_mainWidget)->bin_window, NULL, true );
|
gdk_window_invalidate_rect( GTK_PIZZA(m_mainWidget)->bin_window, NULL, true );
|
||||||
#else
|
#else
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: minifram.cpp
|
// Name: src/gtk/minifram.cpp
|
||||||
// Purpose:
|
// Purpose:
|
||||||
// Author: Robert Roebling
|
// Author: Robert Roebling
|
||||||
// Id: $Id$
|
// Id: $Id$
|
||||||
@@ -82,7 +82,7 @@ static void gtk_window_own_expose_callback( GtkWidget *widget, GdkEventExpose *g
|
|||||||
0, 0,
|
0, 0,
|
||||||
win->m_width, win->m_height );
|
win->m_width, win->m_height );
|
||||||
|
|
||||||
if (!win->GetTitle().IsEmpty() &&
|
if (!win->GetTitle().empty() &&
|
||||||
((win->GetWindowStyle() & wxCAPTION) ||
|
((win->GetWindowStyle() & wxCAPTION) ||
|
||||||
(win->GetWindowStyle() & wxTINY_CAPTION_HORIZ) ||
|
(win->GetWindowStyle() & wxTINY_CAPTION_HORIZ) ||
|
||||||
(win->GetWindowStyle() & wxTINY_CAPTION_VERT)))
|
(win->GetWindowStyle() & wxTINY_CAPTION_VERT)))
|
||||||
@@ -90,7 +90,7 @@ static void gtk_window_own_expose_callback( GtkWidget *widget, GdkEventExpose *g
|
|||||||
wxClientDC dc(win);
|
wxClientDC dc(win);
|
||||||
dc.SetFont( *wxSMALL_FONT );
|
dc.SetFont( *wxSMALL_FONT );
|
||||||
int height = dc.GetCharHeight();
|
int height = dc.GetCharHeight();
|
||||||
|
|
||||||
GdkGC *gc = gdk_gc_new( pizza->bin_window );
|
GdkGC *gc = gdk_gc_new( pizza->bin_window );
|
||||||
gdk_gc_set_foreground( gc, &widget->style->bg[GTK_STATE_SELECTED] );
|
gdk_gc_set_foreground( gc, &widget->style->bg[GTK_STATE_SELECTED] );
|
||||||
gdk_draw_rectangle( pizza->bin_window, gc, TRUE,
|
gdk_draw_rectangle( pizza->bin_window, gc, TRUE,
|
||||||
@@ -129,7 +129,7 @@ static void gtk_window_own_draw_callback( GtkWidget *widget, GdkRectangle *WXUNU
|
|||||||
0, 0,
|
0, 0,
|
||||||
win->m_width, win->m_height );
|
win->m_width, win->m_height );
|
||||||
|
|
||||||
if (!win->m_title.IsEmpty() &&
|
if (!win->GetTitle().empty() &&
|
||||||
((win->GetWindowStyle() & wxCAPTION) ||
|
((win->GetWindowStyle() & wxCAPTION) ||
|
||||||
(win->GetWindowStyle() & wxTINY_CAPTION_HORIZ) ||
|
(win->GetWindowStyle() & wxTINY_CAPTION_HORIZ) ||
|
||||||
(win->GetWindowStyle() & wxTINY_CAPTION_VERT)))
|
(win->GetWindowStyle() & wxTINY_CAPTION_VERT)))
|
||||||
@@ -137,7 +137,7 @@ static void gtk_window_own_draw_callback( GtkWidget *widget, GdkRectangle *WXUNU
|
|||||||
wxClientDC dc(win);
|
wxClientDC dc(win);
|
||||||
dc.SetFont( *wxSMALL_FONT );
|
dc.SetFont( *wxSMALL_FONT );
|
||||||
int height = dc.GetCharHeight();
|
int height = dc.GetCharHeight();
|
||||||
|
|
||||||
GdkGC *gc = gdk_gc_new( pizza->bin_window );
|
GdkGC *gc = gdk_gc_new( pizza->bin_window );
|
||||||
gdk_gc_set_foreground( gc, &widget->style->bg[GTK_STATE_SELECTED] );
|
gdk_gc_set_foreground( gc, &widget->style->bg[GTK_STATE_SELECTED] );
|
||||||
gdk_draw_rectangle( pizza->bin_window, gc, TRUE,
|
gdk_draw_rectangle( pizza->bin_window, gc, TRUE,
|
||||||
@@ -177,9 +177,9 @@ static gint gtk_window_button_press_callback( GtkWidget *widget, GdkEventButton
|
|||||||
wxClientDC dc(win);
|
wxClientDC dc(win);
|
||||||
dc.SetFont( *wxSMALL_FONT );
|
dc.SetFont( *wxSMALL_FONT );
|
||||||
int height = dc.GetCharHeight() + 1;
|
int height = dc.GetCharHeight() + 1;
|
||||||
|
|
||||||
if (gdk_event->y > height) return TRUE;
|
if (gdk_event->y > height) return TRUE;
|
||||||
|
|
||||||
gdk_window_raise( win->m_widget->window );
|
gdk_window_raise( win->m_widget->window );
|
||||||
|
|
||||||
gdk_pointer_grab( widget->window, FALSE,
|
gdk_pointer_grab( widget->window, FALSE,
|
||||||
@@ -200,7 +200,7 @@ static gint gtk_window_button_press_callback( GtkWidget *widget, GdkEventButton
|
|||||||
win->m_oldX = 0;
|
win->m_oldX = 0;
|
||||||
win->m_oldY = 0;
|
win->m_oldY = 0;
|
||||||
|
|
||||||
win->m_isDragging = TRUE;
|
win->m_isDragging = true;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@@ -332,7 +332,7 @@ bool wxMiniFrame::Create( wxWindow *parent, wxWindowID id, const wxString &title
|
|||||||
m_miniTitle = 13;
|
m_miniTitle = 13;
|
||||||
|
|
||||||
m_miniEdge = 3;
|
m_miniEdge = 3;
|
||||||
m_isDragging = FALSE;
|
m_isDragging = false;
|
||||||
m_oldX = -1;
|
m_oldX = -1;
|
||||||
m_oldY = -1;
|
m_oldY = -1;
|
||||||
m_diffX = 0;
|
m_diffX = 0;
|
||||||
@@ -344,7 +344,7 @@ bool wxMiniFrame::Create( wxWindow *parent, wxWindowID id, const wxString &title
|
|||||||
{
|
{
|
||||||
gtk_window_set_transient_for( GTK_WINDOW(m_widget), GTK_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)))
|
||||||
{
|
{
|
||||||
@@ -394,13 +394,13 @@ bool wxMiniFrame::Create( wxWindow *parent, wxWindowID id, const wxString &title
|
|||||||
gtk_signal_connect( GTK_OBJECT(m_mainWidget), "motion_notify_event",
|
gtk_signal_connect( GTK_OBJECT(m_mainWidget), "motion_notify_event",
|
||||||
GTK_SIGNAL_FUNC(gtk_window_motion_notify_callback), (gpointer)this );
|
GTK_SIGNAL_FUNC(gtk_window_motion_notify_callback), (gpointer)this );
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxMiniFrame::SetTitle( const wxString &title )
|
void wxMiniFrame::SetTitle( const wxString &title )
|
||||||
{
|
{
|
||||||
wxFrame::SetTitle( title );
|
wxFrame::SetTitle( title );
|
||||||
|
|
||||||
#ifdef __WXGTK20__
|
#ifdef __WXGTK20__
|
||||||
gdk_window_invalidate_rect( GTK_PIZZA(m_mainWidget)->bin_window, NULL, true );
|
gdk_window_invalidate_rect( GTK_PIZZA(m_mainWidget)->bin_window, NULL, true );
|
||||||
#else
|
#else
|
||||||
|
Reference in New Issue
Block a user