From 87d1e11fd413212a7eacc745bf28a583cc63e65b Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Sun, 8 Nov 1998 15:16:11 +0000 Subject: [PATCH] Minor changes git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@969 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- distrib/msw/generic.rsp | 24 ++++++++++++++++++++++++ docs/symbols.txt | 2 +- include/wx/motif/frame.h | 2 ++ include/wx/msw/frame.h | 2 ++ include/wx/stubs/frame.h | 2 ++ src/common/object.cpp | 2 +- src/common/valtext.cpp | 6 ++++++ src/motif/frame.cpp | 24 ++++++++++++++++++++++++ src/msw/frame.cpp | 24 ++++++++++++++++++++++++ src/msw/nativdlg.cpp | 2 +- src/msw/window.cpp | 25 +------------------------ src/stubs/frame.cpp | 24 ++++++++++++++++++++++++ 12 files changed, 112 insertions(+), 27 deletions(-) diff --git a/distrib/msw/generic.rsp b/distrib/msw/generic.rsp index 05d9001f46..cedfe8b6de 100644 --- a/distrib/msw/generic.rsp +++ b/distrib/msw/generic.rsp @@ -657,3 +657,27 @@ samples/png/*.ico samples/png/*.txt 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 + diff --git a/docs/symbols.txt b/docs/symbols.txt index bee97d122b..e0ec59f648 100644 --- a/docs/symbols.txt +++ b/docs/symbols.txt @@ -56,6 +56,6 @@ __XLC__ ?? compiler 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, ...) diff --git a/include/wx/motif/frame.h b/include/wx/motif/frame.h index c92ac4ba78..8c5da8f12f 100644 --- a/include/wx/motif/frame.h +++ b/include/wx/motif/frame.h @@ -60,6 +60,8 @@ public: void GetSize(int *width, int *height) const ; void GetPosition(int *x, int *y) const ; 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(); diff --git a/include/wx/msw/frame.h b/include/wx/msw/frame.h index 394e658f59..33dfa21c1d 100644 --- a/include/wx/msw/frame.h +++ b/include/wx/msw/frame.h @@ -60,6 +60,8 @@ public: void GetSize(int *width, int *height) const ; void GetPosition(int *x, int *y) const ; 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); diff --git a/include/wx/stubs/frame.h b/include/wx/stubs/frame.h index 705cc5cf24..fcd8689e56 100644 --- a/include/wx/stubs/frame.h +++ b/include/wx/stubs/frame.h @@ -60,6 +60,8 @@ public: void GetSize(int *width, int *height) const ; void GetPosition(int *x, int *y) const ; 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(); diff --git a/src/common/object.cpp b/src/common/object.cpp index 6950dc80cc..704c124ba9 100644 --- a/src/common/object.cpp +++ b/src/common/object.cpp @@ -118,7 +118,7 @@ void wxObject::operator delete (void * buf) // VC++ 6.0 #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); } diff --git a/src/common/valtext.cpp b/src/common/valtext.cpp index a14a082387..7da74055f5 100644 --- a/src/common/valtext.cpp +++ b/src/common/valtext.cpp @@ -134,6 +134,7 @@ bool wxTextValidator::Validate(wxWindow *parent) { if ( !m_includeList.Member(val) ) { + m_validatorWindow->SetFocus(); char buf[512]; sprintf(buf, _("%s is invalid."), (const char *)val); wxMessageBox(buf, _("Validation conflict"), wxOK | wxICON_EXCLAMATION, parent); @@ -144,6 +145,7 @@ bool wxTextValidator::Validate(wxWindow *parent) { if ( m_excludeList.Member(val) ) { + m_validatorWindow->SetFocus(); char buf[512]; sprintf(buf, _("%s is invalid."), (const char *)val); wxMessageBox(buf, _("Validation conflict"), wxOK | wxICON_EXCLAMATION, parent); @@ -152,6 +154,7 @@ bool wxTextValidator::Validate(wxWindow *parent) } if ( (m_validatorStyle & wxFILTER_ASCII) && !val.IsAscii() ) { + m_validatorWindow->SetFocus(); char buf[512]; sprintf(buf, _("%s should only contain ASCII characters."), (const char *)val); wxMessageBox(buf, _("Validation conflict"), wxOK | wxICON_EXCLAMATION, parent); @@ -159,6 +162,7 @@ bool wxTextValidator::Validate(wxWindow *parent) } if ( (m_validatorStyle & wxFILTER_ALPHA) && !wxIsAlpha(val) ) { + m_validatorWindow->SetFocus(); char buf[512]; sprintf(buf, _("%s should only contain alphabetic characters."), (const char *)val); wxMessageBox(buf, _("Validation conflict"), wxOK | wxICON_EXCLAMATION, parent); @@ -166,6 +170,7 @@ bool wxTextValidator::Validate(wxWindow *parent) } if ( (m_validatorStyle & wxFILTER_ALPHANUMERIC) && !wxIsAlphaNumeric(val)) { + m_validatorWindow->SetFocus(); char buf[512]; sprintf(buf, _("%s should only contain alphabetic or numeric characters."), (const char *)val); wxMessageBox(buf,_("Validation conflict"), wxOK | wxICON_EXCLAMATION, parent); @@ -174,6 +179,7 @@ bool wxTextValidator::Validate(wxWindow *parent) if ( (m_validatorStyle & wxFILTER_NUMERIC) && !wxIsNumeric(val)) { + m_validatorWindow->SetFocus(); char buf[512]; sprintf(buf, _("%s should be numeric."), (const char *)val); wxMessageBox(buf, _("Validation conflict"), wxOK | wxICON_EXCLAMATION, parent); diff --git a/src/motif/frame.cpp b/src/motif/frame.cpp index c294be1df8..1de5a6a5cd 100644 --- a/src/motif/frame.cpp +++ b/src/motif/frame.cpp @@ -886,6 +886,30 @@ wxPoint wxFrame::GetClientAreaOrigin() const 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) { wxCHECK_MSG( m_frameToolBar == NULL, FALSE, diff --git a/src/msw/frame.cpp b/src/msw/frame.cpp index 7f7b49f294..b4dfeb31e9 100644 --- a/src/msw/frame.cpp +++ b/src/msw/frame.cpp @@ -972,6 +972,30 @@ wxPoint wxFrame::GetClientAreaOrigin() const 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) { wxCHECK_MSG( m_frameToolBar == NULL, FALSE, diff --git a/src/msw/nativdlg.cpp b/src/msw/nativdlg.cpp index 9c3088c8bd..a8b9eb10cc 100644 --- a/src/msw/nativdlg.cpp +++ b/src/msw/nativdlg.cpp @@ -227,7 +227,7 @@ wxWindow* wxWindow::CreateWindowFromHWND(wxWindow* parent, WXHWND hWnd) #if defined(__WIN95__) else if (str == "MSCTLS_UPDOWN32") { - win == new wxSpinButton; + win = new wxSpinButton; } #endif else if (str == "MSCTLS_TRACKBAR32") diff --git a/src/msw/window.cpp b/src/msw/window.cpp index c11fc3d39b..8994821ca3 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -618,19 +618,8 @@ void wxWindow::ScreenToClient(int *x, int *y) const POINT pt; pt.x = *x; pt.y = *y; - ::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; - } - */ + ::ScreenToClient(hWnd, &pt); *x = pt.x; *y = pt.y; @@ -643,18 +632,6 @@ void wxWindow::ClientToScreen(int *x, int *y) const pt.x = *x; 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); *x = pt.x; diff --git a/src/stubs/frame.cpp b/src/stubs/frame.cpp index 591b59e4f4..8d9ed813ad 100644 --- a/src/stubs/frame.cpp +++ b/src/stubs/frame.cpp @@ -481,6 +481,30 @@ wxPoint wxFrame::GetClientAreaOrigin() const 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) { wxCHECK_MSG( m_frameToolBar == NULL, FALSE, -- 2.45.2