GetSize() and GetClientSize() changes

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1748 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
1999-02-22 11:01:13 +00:00
parent 1edddaf24c
commit bfc6fde4b1
80 changed files with 3467 additions and 3259 deletions

View File

@@ -290,7 +290,7 @@ void wxDialog::OnSize( wxSizeEvent &WXUNUSED(event) )
}
}
void wxDialog::SetSize( int x, int y, int width, int height, int sizeFlags )
void wxDialog::DoSetSize( int x, int y, int width, int height, int sizeFlags )
{
wxASSERT_MSG( (m_widget != NULL), "invalid dialog" );
wxASSERT_MSG( (m_wxwindow != NULL), "invalid dialog" );
@@ -350,11 +350,6 @@ void wxDialog::SetSize( int x, int y, int width, int height, int sizeFlags )
m_resizing = FALSE;
}
void wxDialog::SetSize( int width, int height )
{
SetSize( -1, -1, width, height, wxSIZE_USE_EXISTING );
}
void wxDialog::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y), int width, int height )
{
// due to a bug in gtk, x,y are always 0

View File

@@ -46,11 +46,11 @@ void gtk_filedialog_ok_callback( GtkWidget *WXUNUSED(widget), wxFileDialog *dial
{
int style = dialog->GetStyle();
if ((style&wxSAVE)&&(style&wxOVERWRITE_PROMPT))
{
char *filename = gtk_file_selection_get_filename(
GTK_FILE_SELECTION(dialog->m_widget) );
GtkFileSelection *filedlg = GTK_FILE_SELECTION(dialog->m_widget);
char *filename = gtk_file_selection_get_filename(filedlg);
if ( (style & wxSAVE) && ( style & wxOVERWRITE_PROMPT ) )
{
if (wxFileExists( filename ))
{
wxString msg;
@@ -61,10 +61,19 @@ void gtk_filedialog_ok_callback( GtkWidget *WXUNUSED(widget), wxFileDialog *dial
return;
}
}
else if ( (style & wxOPEN) && ( style & wxFILE_MUST_EXIST) )
{
if ( !wxFileExists( filename ) )
{
wxMessageBox(_("Please choose an existing file."), _("Error"), wxOK);
dialog->SetPath( gtk_file_selection_get_filename( GTK_FILE_SELECTION(dialog->m_widget) ) );
return;
}
}
wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED,wxID_OK);
dialog->SetPath( filename );
wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK);
event.SetEventObject( dialog );
dialog->GetEventHandler()->ProcessEvent( event );
}
@@ -76,7 +85,7 @@ void gtk_filedialog_ok_callback( GtkWidget *WXUNUSED(widget), wxFileDialog *dial
static
void gtk_filedialog_cancel_callback( GtkWidget *WXUNUSED(w), wxFileDialog *dialog )
{
wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED,wxID_CANCEL);
wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL);
event.SetEventObject( dialog );
dialog->GetEventHandler()->ProcessEvent( event );
}

View File

@@ -249,7 +249,7 @@ wxPoint wxFrame::GetClientAreaOrigin() const
return pt;
}
void wxFrame::SetSize( int x, int y, int width, int height, int sizeFlags )
void wxFrame::DoSetSize( int x, int y, int width, int height, int sizeFlags )
{
wxASSERT_MSG( (m_widget != NULL), "invalid frame" );
@@ -312,11 +312,6 @@ void wxFrame::SetSize( int x, int y, int width, int height, int sizeFlags )
m_resizing = FALSE;
}
void wxFrame::SetSize( int width, int height )
{
SetSize( -1, -1, width, height, wxSIZE_USE_EXISTING );
}
void wxFrame::Centre( int direction )
{
wxASSERT_MSG( (m_widget != NULL), "invalid frame" );
@@ -353,7 +348,7 @@ void wxFrame::GetClientSize( int *width, int *height ) const
}
}
void wxFrame::SetClientSize( int width, int height )
void wxFrame::DoSetClientSize( int width, int height )
{
wxASSERT_MSG( (m_widget != NULL), "invalid frame" );

View File

@@ -9,7 +9,7 @@
#ifdef __GNUG__
#pragma implementation "window.h"
#pragma implementation "window.h"
#endif
#include "wx/defs.h"
@@ -21,12 +21,15 @@
#include "wx/utils.h"
#include "wx/dialog.h"
#include "wx/msgdlg.h"
#if wxUSE_DRAG_AND_DROP
#include "wx/dnd.h"
#include "wx/dnd.h"
#endif
#if wxUSE_TOOLTIPS
#include "wx/tooltip.h"
#include "wx/tooltip.h"
#endif
#include "wx/menu.h"
#include "wx/statusbr.h"
#include "wx/intl.h"
@@ -1798,7 +1801,7 @@ void wxWindow::AdjustForParentClientOrigin( int& x, int& y, int sizeFlags )
}
}
void wxWindow::SetSize( int x, int y, int width, int height, int sizeFlags )
void wxWindow::DoSetSize( int x, int y, int width, int height, int sizeFlags )
{
wxASSERT_MSG( (m_widget != NULL), "invalid window" );
wxASSERT_MSG( (m_parent != NULL), "wxWindow::SetSize requires parent.\n" );
@@ -1883,16 +1886,6 @@ void wxWindow::OnInternalIdle()
UpdateWindowUI();
}
void wxWindow::SetSize( int width, int height )
{
SetSize( -1, -1, width, height, wxSIZE_USE_EXISTING );
}
void wxWindow::Move( int x, int y )
{
SetSize( x, y, -1, -1, wxSIZE_USE_EXISTING );
}
void wxWindow::GetSize( int *width, int *height ) const
{
wxCHECK_RET( (m_widget != NULL), "invalid window" );
@@ -1901,7 +1894,7 @@ void wxWindow::GetSize( int *width, int *height ) const
if (height) (*height) = m_height;
}
void wxWindow::SetClientSize( int width, int height )
void wxWindow::DoSetClientSize( int width, int height )
{
wxCHECK_RET( (m_widget != NULL), "invalid window" );