Another attempts at getting dialog positions right

Cursor fixes.

  This requires a recompile.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2287 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling 1999-04-26 15:14:33 +00:00
parent 227e5e99cd
commit 1b3667ab28
9 changed files with 35 additions and 69 deletions

View File

@ -452,7 +452,7 @@ public:
wxDropTarget *m_dropTarget;
#endif
wxWindowID m_windowId;
wxCursor *m_cursor;
wxCursor m_cursor;
wxFont m_font;
wxColour m_backgroundColour;
wxColour m_foregroundColour;

View File

@ -452,7 +452,7 @@ public:
wxDropTarget *m_dropTarget;
#endif
wxWindowID m_windowId;
wxCursor *m_cursor;
wxCursor m_cursor;
wxFont m_font;
wxColour m_backgroundColour;
wxColour m_foregroundColour;

View File

@ -224,14 +224,10 @@ void MyFrame::SetMinSize(wxCommandEvent& WXUNUSED(event) )
if ( str.IsEmpty() )
return;
/*
What is atoi in Unicode?
int minsize = atoi(str);
int minsize = wxStrtol( str, (wxChar**)NULL, 10 );
m_splitter->SetMinimumPaneSize(minsize);
str.Printf( _T("Min pane size = %d"), minsize);
SetStatusText(str, 1);
*/
}
void MyFrame::UpdateUIHorizontal(wxUpdateUIEvent& event)

View File

@ -465,7 +465,7 @@ void wxDialog::Centre( int direction )
void wxDialog::OnInternalIdle()
{
if (!m_sizeSet)
if (!m_sizeSet && GTK_WIDGET_REALIZED(m_wxwindow))
GtkOnSize( m_x, m_y, m_width, m_height );
}

View File

@ -196,18 +196,6 @@ gtk_frame_realized_callback( GtkWidget *widget, wxFrame *win )
return FALSE;
}
//-----------------------------------------------------------------------------
// "map" from m_widget
//-----------------------------------------------------------------------------
static gint
gtk_frame_map_callback( GtkWidget *widget, wxFrame *win )
{
gtk_widget_set_uposition( widget, win->m_x, win->m_y );
return FALSE;
}
//-----------------------------------------------------------------------------
// InsertChild for wxFrame
//-----------------------------------------------------------------------------
@ -358,11 +346,6 @@ bool wxFrame::Create( wxWindow *parent, wxWindowID id, const wxString &title,
gtk_signal_connect( GTK_OBJECT(m_widget), "realize",
GTK_SIGNAL_FUNC(gtk_frame_realized_callback), (gpointer) this );
/* we set the position of the window after the map event. setting it
before has no effect (with KWM) */
gtk_signal_connect( GTK_OBJECT(m_widget), "map",
GTK_SIGNAL_FUNC(gtk_frame_map_callback), (gpointer) this );
/* the user resized the frame by dragging etc. */
gtk_signal_connect( GTK_OBJECT(m_widget), "size_allocate",
GTK_SIGNAL_FUNC(gtk_frame_size_callback), (gpointer)this );
@ -708,7 +691,7 @@ void wxFrame::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y), int width, int height
void wxFrame::OnInternalIdle()
{
if (!m_sizeSet)
if (!m_sizeSet && GTK_WIDGET_REALIZED(m_wxwindow))
GtkOnSize( m_x, m_y, m_width, m_height );
DoMenuUpdates();

View File

@ -1033,8 +1033,8 @@ static gint gtk_window_enter_callback( GtkWidget *widget, GdkEventCrossing *gdk_
if (widget->window != gdk_event->window) return FALSE;
if ((widget->window) && (win->m_cursor))
gdk_window_set_cursor( widget->window, win->m_cursor->GetCursor() );
if ((widget->window) && (win->m_cursor.Ok()))
gdk_window_set_cursor( widget->window, win->m_cursor.GetCursor() );
/*
printf( "OnEnter from " );
@ -1083,7 +1083,7 @@ static gint gtk_window_leave_callback( GtkWidget *widget, GdkEventCrossing *gdk_
if (widget->window != gdk_event->window) return FALSE;
if ((widget->window) && (win->m_cursor))
if (widget->window)
gdk_window_set_cursor( widget->window, wxSTANDARD_CURSOR->GetCursor() );
/*
@ -1345,6 +1345,10 @@ gtk_window_realized_callback( GtkWidget *widget, wxWindow *win )
win->SetForegroundColour( fg );
}
wxCursor cursor( win->m_cursor );
win->m_cursor = wxNullCursor;
win->SetCursor( cursor );
return FALSE;
}
@ -1425,7 +1429,7 @@ void wxWindow::Init()
m_windowId = -1;
m_cursor = (wxCursor *) NULL;
m_cursor = *wxSTANDARD_CURSOR;
m_font = *wxSWISS_FONT;
m_windowStyle = 0;
m_windowName = "noname";
@ -1658,8 +1662,6 @@ wxWindow::~wxWindow()
if (m_widget) gtk_widget_destroy( m_widget );
if (m_cursor) delete m_cursor;
DeleteRelatedConstraints();
if (m_constraints)
{
@ -1740,7 +1742,7 @@ void wxWindow::PreCreation( wxWindow *parent, wxWindowID id,
m_sizeSet = FALSE;
m_cursor = new wxCursor( wxCURSOR_ARROW );
m_cursor = *wxSTANDARD_CURSOR;
m_font = *wxSWISS_FONT;
m_backgroundColour = wxSystemSettings::GetSystemColour( wxSYS_COLOUR_BTNFACE );
m_foregroundColour = *wxBLACK;
@ -2515,20 +2517,20 @@ void wxWindow::SetCursor( const wxCursor &cursor )
if (cursor.Ok())
{
if (cursor == *m_cursor) return;
*m_cursor = cursor;
if (cursor == m_cursor) return;
m_cursor = cursor;
}
else
{
*m_cursor = *wxSTANDARD_CURSOR;
m_cursor = *wxSTANDARD_CURSOR;
}
if (!m_widget->window) return;
gdk_window_set_cursor( m_widget->window, m_cursor->GetCursor() );
gdk_window_set_cursor( m_widget->window, m_cursor.GetCursor() );
if ((m_wxwindow) && (m_wxwindow->window))
gdk_window_set_cursor( m_wxwindow->window, m_cursor->GetCursor() );
gdk_window_set_cursor( m_wxwindow->window, m_cursor.GetCursor() );
}
void wxWindow::WarpPointer( int WXUNUSED(x), int WXUNUSED(y) )

View File

@ -465,7 +465,7 @@ void wxDialog::Centre( int direction )
void wxDialog::OnInternalIdle()
{
if (!m_sizeSet)
if (!m_sizeSet && GTK_WIDGET_REALIZED(m_wxwindow))
GtkOnSize( m_x, m_y, m_width, m_height );
}

View File

@ -196,18 +196,6 @@ gtk_frame_realized_callback( GtkWidget *widget, wxFrame *win )
return FALSE;
}
//-----------------------------------------------------------------------------
// "map" from m_widget
//-----------------------------------------------------------------------------
static gint
gtk_frame_map_callback( GtkWidget *widget, wxFrame *win )
{
gtk_widget_set_uposition( widget, win->m_x, win->m_y );
return FALSE;
}
//-----------------------------------------------------------------------------
// InsertChild for wxFrame
//-----------------------------------------------------------------------------
@ -358,11 +346,6 @@ bool wxFrame::Create( wxWindow *parent, wxWindowID id, const wxString &title,
gtk_signal_connect( GTK_OBJECT(m_widget), "realize",
GTK_SIGNAL_FUNC(gtk_frame_realized_callback), (gpointer) this );
/* we set the position of the window after the map event. setting it
before has no effect (with KWM) */
gtk_signal_connect( GTK_OBJECT(m_widget), "map",
GTK_SIGNAL_FUNC(gtk_frame_map_callback), (gpointer) this );
/* the user resized the frame by dragging etc. */
gtk_signal_connect( GTK_OBJECT(m_widget), "size_allocate",
GTK_SIGNAL_FUNC(gtk_frame_size_callback), (gpointer)this );
@ -708,7 +691,7 @@ void wxFrame::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y), int width, int height
void wxFrame::OnInternalIdle()
{
if (!m_sizeSet)
if (!m_sizeSet && GTK_WIDGET_REALIZED(m_wxwindow))
GtkOnSize( m_x, m_y, m_width, m_height );
DoMenuUpdates();

View File

@ -1033,8 +1033,8 @@ static gint gtk_window_enter_callback( GtkWidget *widget, GdkEventCrossing *gdk_
if (widget->window != gdk_event->window) return FALSE;
if ((widget->window) && (win->m_cursor))
gdk_window_set_cursor( widget->window, win->m_cursor->GetCursor() );
if ((widget->window) && (win->m_cursor.Ok()))
gdk_window_set_cursor( widget->window, win->m_cursor.GetCursor() );
/*
printf( "OnEnter from " );
@ -1083,7 +1083,7 @@ static gint gtk_window_leave_callback( GtkWidget *widget, GdkEventCrossing *gdk_
if (widget->window != gdk_event->window) return FALSE;
if ((widget->window) && (win->m_cursor))
if (widget->window)
gdk_window_set_cursor( widget->window, wxSTANDARD_CURSOR->GetCursor() );
/*
@ -1345,6 +1345,10 @@ gtk_window_realized_callback( GtkWidget *widget, wxWindow *win )
win->SetForegroundColour( fg );
}
wxCursor cursor( win->m_cursor );
win->m_cursor = wxNullCursor;
win->SetCursor( cursor );
return FALSE;
}
@ -1425,7 +1429,7 @@ void wxWindow::Init()
m_windowId = -1;
m_cursor = (wxCursor *) NULL;
m_cursor = *wxSTANDARD_CURSOR;
m_font = *wxSWISS_FONT;
m_windowStyle = 0;
m_windowName = "noname";
@ -1658,8 +1662,6 @@ wxWindow::~wxWindow()
if (m_widget) gtk_widget_destroy( m_widget );
if (m_cursor) delete m_cursor;
DeleteRelatedConstraints();
if (m_constraints)
{
@ -1740,7 +1742,7 @@ void wxWindow::PreCreation( wxWindow *parent, wxWindowID id,
m_sizeSet = FALSE;
m_cursor = new wxCursor( wxCURSOR_ARROW );
m_cursor = *wxSTANDARD_CURSOR;
m_font = *wxSWISS_FONT;
m_backgroundColour = wxSystemSettings::GetSystemColour( wxSYS_COLOUR_BTNFACE );
m_foregroundColour = *wxBLACK;
@ -2515,20 +2517,20 @@ void wxWindow::SetCursor( const wxCursor &cursor )
if (cursor.Ok())
{
if (cursor == *m_cursor) return;
*m_cursor = cursor;
if (cursor == m_cursor) return;
m_cursor = cursor;
}
else
{
*m_cursor = *wxSTANDARD_CURSOR;
m_cursor = *wxSTANDARD_CURSOR;
}
if (!m_widget->window) return;
gdk_window_set_cursor( m_widget->window, m_cursor->GetCursor() );
gdk_window_set_cursor( m_widget->window, m_cursor.GetCursor() );
if ((m_wxwindow) && (m_wxwindow->window))
gdk_window_set_cursor( m_wxwindow->window, m_cursor->GetCursor() );
gdk_window_set_cursor( m_wxwindow->window, m_cursor.GetCursor() );
}
void wxWindow::WarpPointer( int WXUNUSED(x), int WXUNUSED(y) )