Minor changes

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@969 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
1998-11-08 15:16:11 +00:00
parent df875e593f
commit 87d1e11fd4
12 changed files with 112 additions and 27 deletions

View File

@@ -657,3 +657,27 @@ samples/png/*.ico
samples/png/*.txt samples/png/*.txt
samples/png/*.png samples/png/*.png
samples/image/*.cpp
samples/image/*.h
samples/image/makefile*
samples/image/*.rc
samples/image/*.def
samples/image/*.bmp
samples/image/*.xpm
samples/image/*.xbm
samples/image/*.png
samples/image/*.ico
samples/image/*.txt
samples/thread/*.cpp
samples/thread/*.h
samples/thread/makefile*
samples/thread/*.rc
samples/thread/*.def
samples/thread/*.bmp
samples/thread/*.xpm
samples/thread/*.xbm
samples/thread/*.png
samples/thread/*.ico
samples/thread/*.txt

View File

@@ -56,6 +56,6 @@ __XLC__ ?? compiler
wxWindows modes: wxWindows modes:
---------------- ----------------
__WXDEBUG__ usage: #ifdef __DEBUG__ (=> debug mode, else => release) __WXDEBUG__ usage: #ifdef __WXDEBUG__ (=> debug mode, else => release)
WXDEBUG usage: #if DEBUG (0: release, 1: minimal debug code, ...) WXDEBUG usage: #if DEBUG (0: release, 1: minimal debug code, ...)

View File

@@ -60,6 +60,8 @@ public:
void GetSize(int *width, int *height) const ; void GetSize(int *width, int *height) const ;
void GetPosition(int *x, int *y) const ; void GetPosition(int *x, int *y) const ;
void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO); void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
void ClientToScreen(int *x, int *y) const;
void ScreenToClient(int *x, int *y) const;
virtual bool OnClose(); virtual bool OnClose();

View File

@@ -60,6 +60,8 @@ public:
void GetSize(int *width, int *height) const ; void GetSize(int *width, int *height) const ;
void GetPosition(int *x, int *y) const ; void GetPosition(int *x, int *y) const ;
void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO); void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
void ClientToScreen(int *x, int *y) const;
void ScreenToClient(int *x, int *y) const;
virtual bool OnClose(void); virtual bool OnClose(void);

View File

@@ -60,6 +60,8 @@ public:
void GetSize(int *width, int *height) const ; void GetSize(int *width, int *height) const ;
void GetPosition(int *x, int *y) const ; void GetPosition(int *x, int *y) const ;
void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO); void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
void ClientToScreen(int *x, int *y) const;
void ScreenToClient(int *x, int *y) const;
virtual bool OnClose(); virtual bool OnClose();

View File

@@ -118,7 +118,7 @@ void wxObject::operator delete (void * buf)
// VC++ 6.0 // VC++ 6.0
#if _MSC_VER >= 1200 #if _MSC_VER >= 1200
void operator wxObject::delete(void* pData, char* /* fileName */, int /* lineNum */) void wxObject::operator delete(void* pData, char* /* fileName */, int /* lineNum */)
{ {
::operator delete(pData); ::operator delete(pData);
} }

View File

@@ -134,6 +134,7 @@ bool wxTextValidator::Validate(wxWindow *parent)
{ {
if ( !m_includeList.Member(val) ) if ( !m_includeList.Member(val) )
{ {
m_validatorWindow->SetFocus();
char buf[512]; char buf[512];
sprintf(buf, _("%s is invalid."), (const char *)val); sprintf(buf, _("%s is invalid."), (const char *)val);
wxMessageBox(buf, _("Validation conflict"), wxOK | wxICON_EXCLAMATION, parent); wxMessageBox(buf, _("Validation conflict"), wxOK | wxICON_EXCLAMATION, parent);
@@ -144,6 +145,7 @@ bool wxTextValidator::Validate(wxWindow *parent)
{ {
if ( m_excludeList.Member(val) ) if ( m_excludeList.Member(val) )
{ {
m_validatorWindow->SetFocus();
char buf[512]; char buf[512];
sprintf(buf, _("%s is invalid."), (const char *)val); sprintf(buf, _("%s is invalid."), (const char *)val);
wxMessageBox(buf, _("Validation conflict"), wxOK | wxICON_EXCLAMATION, parent); wxMessageBox(buf, _("Validation conflict"), wxOK | wxICON_EXCLAMATION, parent);
@@ -152,6 +154,7 @@ bool wxTextValidator::Validate(wxWindow *parent)
} }
if ( (m_validatorStyle & wxFILTER_ASCII) && !val.IsAscii() ) if ( (m_validatorStyle & wxFILTER_ASCII) && !val.IsAscii() )
{ {
m_validatorWindow->SetFocus();
char buf[512]; char buf[512];
sprintf(buf, _("%s should only contain ASCII characters."), (const char *)val); sprintf(buf, _("%s should only contain ASCII characters."), (const char *)val);
wxMessageBox(buf, _("Validation conflict"), wxOK | wxICON_EXCLAMATION, parent); wxMessageBox(buf, _("Validation conflict"), wxOK | wxICON_EXCLAMATION, parent);
@@ -159,6 +162,7 @@ bool wxTextValidator::Validate(wxWindow *parent)
} }
if ( (m_validatorStyle & wxFILTER_ALPHA) && !wxIsAlpha(val) ) if ( (m_validatorStyle & wxFILTER_ALPHA) && !wxIsAlpha(val) )
{ {
m_validatorWindow->SetFocus();
char buf[512]; char buf[512];
sprintf(buf, _("%s should only contain alphabetic characters."), (const char *)val); sprintf(buf, _("%s should only contain alphabetic characters."), (const char *)val);
wxMessageBox(buf, _("Validation conflict"), wxOK | wxICON_EXCLAMATION, parent); wxMessageBox(buf, _("Validation conflict"), wxOK | wxICON_EXCLAMATION, parent);
@@ -166,6 +170,7 @@ bool wxTextValidator::Validate(wxWindow *parent)
} }
if ( (m_validatorStyle & wxFILTER_ALPHANUMERIC) && !wxIsAlphaNumeric(val)) if ( (m_validatorStyle & wxFILTER_ALPHANUMERIC) && !wxIsAlphaNumeric(val))
{ {
m_validatorWindow->SetFocus();
char buf[512]; char buf[512];
sprintf(buf, _("%s should only contain alphabetic or numeric characters."), (const char *)val); sprintf(buf, _("%s should only contain alphabetic or numeric characters."), (const char *)val);
wxMessageBox(buf,_("Validation conflict"), wxOK | wxICON_EXCLAMATION, parent); wxMessageBox(buf,_("Validation conflict"), wxOK | wxICON_EXCLAMATION, parent);
@@ -174,6 +179,7 @@ bool wxTextValidator::Validate(wxWindow *parent)
if ( (m_validatorStyle & wxFILTER_NUMERIC) && !wxIsNumeric(val)) if ( (m_validatorStyle & wxFILTER_NUMERIC) && !wxIsNumeric(val))
{ {
m_validatorWindow->SetFocus();
char buf[512]; char buf[512];
sprintf(buf, _("%s should be numeric."), (const char *)val); sprintf(buf, _("%s should be numeric."), (const char *)val);
wxMessageBox(buf, _("Validation conflict"), wxOK | wxICON_EXCLAMATION, parent); wxMessageBox(buf, _("Validation conflict"), wxOK | wxICON_EXCLAMATION, parent);

View File

@@ -886,6 +886,30 @@ wxPoint wxFrame::GetClientAreaOrigin() const
return pt; return pt;
} }
void wxFrame::ScreenToClient(int *x, int *y) const
{
wxWindow::ScreenToClient(x, y);
// We may be faking the client origin.
// So a window that's really at (0, 30) may appear
// (to wxWin apps) to be at (0, 0).
wxPoint pt(GetClientAreaOrigin());
*x -= pt.x;
*y -= pt.y;
}
void wxFrame::ClientToScreen(int *x, int *y) const
{
// We may be faking the client origin.
// So a window that's really at (0, 30) may appear
// (to wxWin apps) to be at (0, 0).
wxPoint pt1(GetClientAreaOrigin());
*x += pt1.x;
*y += pt1.y;
wxWindow::ClientToScreen(x, y);
}
wxToolBar* wxFrame::CreateToolBar(long style, wxWindowID id, const wxString& name) wxToolBar* wxFrame::CreateToolBar(long style, wxWindowID id, const wxString& name)
{ {
wxCHECK_MSG( m_frameToolBar == NULL, FALSE, wxCHECK_MSG( m_frameToolBar == NULL, FALSE,

View File

@@ -972,6 +972,30 @@ wxPoint wxFrame::GetClientAreaOrigin() const
return pt; return pt;
} }
void wxFrame::ScreenToClient(int *x, int *y) const
{
wxWindow::ScreenToClient(x, y);
// We may be faking the client origin.
// So a window that's really at (0, 30) may appear
// (to wxWin apps) to be at (0, 0).
wxPoint pt(GetClientAreaOrigin());
*x -= pt.x;
*y -= pt.y;
}
void wxFrame::ClientToScreen(int *x, int *y) const
{
// We may be faking the client origin.
// So a window that's really at (0, 30) may appear
// (to wxWin apps) to be at (0, 0).
wxPoint pt1(GetClientAreaOrigin());
*x += pt1.x;
*y += pt1.y;
wxWindow::ClientToScreen(x, y);
}
wxToolBar* wxFrame::CreateToolBar(long style, wxWindowID id, const wxString& name) wxToolBar* wxFrame::CreateToolBar(long style, wxWindowID id, const wxString& name)
{ {
wxCHECK_MSG( m_frameToolBar == NULL, FALSE, wxCHECK_MSG( m_frameToolBar == NULL, FALSE,

View File

@@ -227,7 +227,7 @@ wxWindow* wxWindow::CreateWindowFromHWND(wxWindow* parent, WXHWND hWnd)
#if defined(__WIN95__) #if defined(__WIN95__)
else if (str == "MSCTLS_UPDOWN32") else if (str == "MSCTLS_UPDOWN32")
{ {
win == new wxSpinButton; win = new wxSpinButton;
} }
#endif #endif
else if (str == "MSCTLS_TRACKBAR32") else if (str == "MSCTLS_TRACKBAR32")

View File

@@ -618,19 +618,8 @@ void wxWindow::ScreenToClient(int *x, int *y) const
POINT pt; POINT pt;
pt.x = *x; pt.x = *x;
pt.y = *y; pt.y = *y;
::ScreenToClient(hWnd, &pt);
/* ::ScreenToClient(hWnd, &pt);
// We may be faking the client origin.
// So a window that's really at (0, 30) may appear
// (to wxWin apps) to be at (0, 0).
if (GetParent())
{
wxPoint pt1(GetParent()->GetClientAreaOrigin());
pt.x -= pt1.x;
pt.y -= pt1.y;
}
*/
*x = pt.x; *x = pt.x;
*y = pt.y; *y = pt.y;
@@ -643,18 +632,6 @@ void wxWindow::ClientToScreen(int *x, int *y) const
pt.x = *x; pt.x = *x;
pt.y = *y; pt.y = *y;
/*
// We may be faking the client origin.
// So a window that's really at (0, 30) may appear
// (to wxWin apps) to be at (0, 0).
if (GetParent())
{
wxPoint pt1(GetParent()->GetClientAreaOrigin());
pt.x += pt1.x;
pt.y += pt1.y;
}
*/
::ClientToScreen(hWnd, &pt); ::ClientToScreen(hWnd, &pt);
*x = pt.x; *x = pt.x;

View File

@@ -481,6 +481,30 @@ wxPoint wxFrame::GetClientAreaOrigin() const
return pt; return pt;
} }
void wxFrame::ScreenToClient(int *x, int *y) const
{
wxWindow::ScreenToClient(x, y);
// We may be faking the client origin.
// So a window that's really at (0, 30) may appear
// (to wxWin apps) to be at (0, 0).
wxPoint pt(GetClientAreaOrigin());
*x -= pt.x;
*y -= pt.y;
}
void wxFrame::ClientToScreen(int *x, int *y) const
{
// We may be faking the client origin.
// So a window that's really at (0, 30) may appear
// (to wxWin apps) to be at (0, 0).
wxPoint pt1(GetClientAreaOrigin());
*x += pt1.x;
*y += pt1.y;
wxWindow::ClientToScreen(x, y);
}
wxToolBar* wxFrame::CreateToolBar(long style, wxWindowID id, const wxString& name) wxToolBar* wxFrame::CreateToolBar(long style, wxWindowID id, const wxString& name)
{ {
wxCHECK_MSG( m_frameToolBar == NULL, FALSE, wxCHECK_MSG( m_frameToolBar == NULL, FALSE,