From a71d815bbe669ebb9bdb9409926a272c37a5a9aa Mon Sep 17 00:00:00 2001 From: =?utf8?q?W=C5=82odzimierz=20Skiba?= Date: Mon, 19 Dec 2005 10:47:44 +0000 Subject: [PATCH] __WIN95__ removed (used to differ win3.1 vs. 'modern' 95 look, nowadays always defined for WXMSW so useless). Minor cleanings and corrections for correct #includes. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36466 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/changes.txt | 1 + docs/latex/wx/cppconst.tex | 1 - docs/tech/tn0010.htm | 6 +-- samples/controls/controls.cpp | 6 +-- samples/nativdlg/dialog1.rc | 13 ++----- samples/widgets/slider.cpp | 4 +- src/generic/statusbr.cpp | 4 +- src/msw/app.cpp | 11 +++--- src/msw/bmpbuttn.cpp | 70 ----------------------------------- src/msw/control.cpp | 9 ++--- src/msw/dcprint.cpp | 2 - src/msw/dirdlg.cpp | 4 +- src/msw/dragimag.cpp | 12 ++---- src/msw/frame.cpp | 2 - src/msw/helpbest.cpp | 6 +-- src/msw/helpchm.cpp | 7 ++-- src/msw/helpwin.cpp | 6 +-- src/msw/imaglist.cpp | 18 +++------ src/msw/listctrl.cpp | 2 +- src/msw/mdi.cpp | 15 ++------ src/msw/nativdlg.cpp | 7 +--- src/msw/scrolbar.cpp | 63 +++++++++++++------------------ src/msw/statbr95.cpp | 12 +++--- src/msw/tabctrl.cpp | 7 +--- src/msw/taskbar.cpp | 6 +-- src/msw/toplevel.cpp | 4 +- src/msw/wince/tbarwce.cpp | 19 ++++------ src/msw/window.cpp | 6 +-- 28 files changed, 92 insertions(+), 231 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index 41c9c13e1b..1efc7edcfb 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -46,6 +46,7 @@ wxMSW: - Switching page of a hidden notebook doesn't lose focus (Jamie Gadd). - Removed wxImageList *GetImageList(int) const. - Fixed MDI context menu problem. +- Removed __WIN95__ define wxGTK: diff --git a/docs/latex/wx/cppconst.tex b/docs/latex/wx/cppconst.tex index 4863cb479b..c573457828 100644 --- a/docs/latex/wx/cppconst.tex +++ b/docs/latex/wx/cppconst.tex @@ -23,7 +23,6 @@ always tested using \texttt{#ifdef} and not \texttt{#if}. \twocolitem{\_\_WINDOWS\_\_}{any Windows, yom may also use \_\_WXMSW\_\_} \twocolitem{\_\_WIN16\_\_}{Win16 API (not supported since wxWidgets 2.6)} \twocolitem{\_\_WIN32\_\_}{Win32 API} -\twocolitem{\_\_WIN95\_\_}{Windows 95 or NT 4.0 and above system (not NT 3.5x)} \twocolitem{\_\_WXBASE\_\_}{Only wxBase, no GUI features (same as \texttt{wxUSE\_GUI} $== 0$)} \twocolitem{\_\_WXCOCOA\_\_}{OS X using Cocoa API} \twocolitem{\_\_WXWINCE\_\_}{Windows CE} diff --git a/docs/tech/tn0010.htm b/docs/tech/tn0010.htm index 1302485940..ec13fa0440 100644 --- a/docs/tech/tn0010.htm +++ b/docs/tech/tn0010.htm @@ -63,13 +63,13 @@ The Preprocessor definitions field should contain the following symbols f
 WIN32,_DEBUG,_WINDOWS,__WINDOWS__,__WXMSW__,__WXDEBUG__,WXDEBUG=1,
-__WIN95__,__WIN32__,WINVER=0x0400,STRICT
+__WIN32__,WINVER=0x0400,STRICT
 

and these for Release:

-NDEBUG,WIN32,_WINDOWS,__WINDOWS__,__WXMSW__,__WIN95__,__WIN32__,
+NDEBUG,WIN32,_WINDOWS,__WINDOWS__,__WXMSW__,__WIN32__,
 WINVER=0x0400,STRICT

The Additional include directories field should contain the following:

@@ -160,7 +160,7 @@ and executable to be created in the project directory and not a subdirectory.

C/C++: Preprocessor
The Preprocessor definitions field should contain the following symbols:

-WIN32,_DEBUG,_WINDOWS,wx_msw,DEBUG=1,WIN95=1,WINVER=0x0400,STRICT
+WIN32,_DEBUG,_WINDOWS,wx_msw,DEBUG=1,WINVER=0x0400,STRICT
 

The Additional include directories field should contain the following:

diff --git a/samples/controls/controls.cpp b/samples/controls/controls.cpp index b113708fdb..e64bba7b1c 100644 --- a/samples/controls/controls.cpp +++ b/samples/controls/controls.cpp @@ -19,9 +19,7 @@ #include "wx/wx.h" #endif -#if !defined( __WXMSW__ ) || defined( __WIN95__ ) #include "wx/spinbutt.h" -#endif #include "wx/tglbtn.h" #include "wx/bookctrl.h" #include "wx/imaglist.h" @@ -882,7 +880,7 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) _T("This is also supposed to demonstrate how ") _T("to use static controls with line wrapping."), wxDefaultPosition, - wxSize(240, -1) + wxSize(240, wxDefaultCoord) ); #endif wrapping_sizer->Add( m_wrappingText ); @@ -915,7 +913,7 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) #endif // wxUSE_SPINBTN #if wxUSE_SPINCTRL - m_spinctrl = new wxSpinCtrl( panel, ID_SPINCTRL, _T(""), wxPoint(200, 160), wxSize(80, wxDefaultCoord) ); + m_spinctrl = new wxSpinCtrl( panel, ID_SPINCTRL, wxEmptyString, wxPoint(200, 160), wxSize(80, wxDefaultCoord) ); m_spinctrl->SetRange(10,30); m_spinctrl->SetValue(15); #endif // wxUSE_SPINCTRL diff --git a/samples/nativdlg/dialog1.rc b/samples/nativdlg/dialog1.rc index a794777617..3b008e6421 100644 --- a/samples/nativdlg/dialog1.rc +++ b/samples/nativdlg/dialog1.rc @@ -9,10 +9,6 @@ #define __WIN32__ #endif -#ifndef __WIN95__ -#define __WIN95__ -#endif - //#ifdef _MSC_VER #define __VISUALC__ _MSC_VER //#endif @@ -54,16 +50,16 @@ BEGIN GROUPBOX "wxStaticBox",IDC_STATIC,7,7,198,158 EDITTEXT IDC_EDIT1,64,23,125,14,ES_AUTOHSCROLL LTEXT "wxStaticText",IDC_STATIC,13,25,42,8 - CONTROL "wxCheckBox",IDC_CHECK1,"Button",BS_AUTOCHECKBOX | + CONTROL "wxCheckBox",IDC_CHECK1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,47,57,10 - COMBOBOX IDC_COMBO1,83,46,48,30,CBS_DROPDOWN | CBS_SORT | + COMBOBOX IDC_COMBO1,83,46,48,30,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP CONTROL "wxRadioButton",IDC_RADIO1,"Button",BS_AUTORADIOBUTTON, 141,47,64,10 - LISTBOX IDC_LIST1,14,69,86,40,LBS_SORT | LBS_NOINTEGRALHEIGHT | + LISTBOX IDC_LIST1,14,69,86,40,LBS_SORT | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP SCROLLBAR IDC_SCROLLBAR1,111,71,76,11 - CONTROL "Slider1",IDC_SLIDER1,"msctls_trackbar32",TBS_BOTH | + CONTROL "Slider1",IDC_SLIDER1,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,10,116,100,15 CONTROL "Spin1",IDC_SPIN1,"msctls_updown32",UDS_ARROWKEYS,111,90, 10,14 @@ -71,4 +67,3 @@ END #endif // English (U.K.) resources ///////////////////////////////////////////////////////////////////////////// - diff --git a/samples/widgets/slider.cpp b/samples/widgets/slider.cpp index 748049a4ef..b23a4a7453 100644 --- a/samples/widgets/slider.cpp +++ b/samples/widgets/slider.cpp @@ -562,11 +562,11 @@ void SliderWidgetsPage::OnUpdateUIRadioSides(wxUpdateUIEvent& event) void SliderWidgetsPage::OnUpdateUIBothSides(wxUpdateUIEvent& event) { -#if defined(__WIN95__) || defined(__WXUNIVERSAL__) +#if defined(__WXMSW__) || defined(__WXUNIVERSAL__) event.Enable( m_chkTicks->GetValue() ); #else event.Enable( false ); -#endif // defined(__WIN95__) || defined(__WXUNIVERSAL__) +#endif // defined(__WXMSW__) || defined(__WXUNIVERSAL__) } void SliderWidgetsPage::OnSlider(wxScrollEvent& event) diff --git a/src/generic/statusbr.cpp b/src/generic/statusbr.cpp index db33952a08..f098347991 100644 --- a/src/generic/statusbr.cpp +++ b/src/generic/statusbr.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: generic/statusbr.cpp +// Name: src/generic/statusbr.cpp // Purpose: wxStatusBarGeneric class implementation // Author: Julian Smart // Modified by: @@ -351,7 +351,7 @@ bool wxStatusBarGeneric::GetFieldRect(int n, wxRect& rect) const void wxStatusBarGeneric::InitColours() { // Shadow colours -#if defined(__WIN95__) || defined(__WXMAC__) +#if defined(__WXMSW__) || defined(__WXMAC__) wxColour mediumShadowColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DSHADOW)); m_mediumShadowPen = wxPen(mediumShadowColour, 1, wxSOLID); diff --git a/src/msw/app.cpp b/src/msw/app.cpp index b6cbc4c8a8..c56de63bc9 100644 --- a/src/msw/app.cpp +++ b/src/msw/app.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: app.cpp +// Name: src/msw/app.cpp // Purpose: wxApp // Author: Julian Smart // Modified by: @@ -292,9 +292,9 @@ bool wxApp::Initialize(int& argc, wxChar **argv) } #endif -#if defined(__WIN95__) && !defined(__WXMICROWIN__) +#if !defined(__WXMICROWIN__) InitCommonControls(); -#endif // __WIN95__ +#endif // !defined(__WXMICROWIN__) #if defined(__SMARTPHONE__) || defined(__POCKETPC__) SHInitExtraControls(); @@ -479,7 +479,7 @@ void wxApp::CleanUp() delete wxWinHandleHash; wxWinHandleHash = NULL; - + #ifdef __WXWINCE__ free( wxCanvasClassName ); free( wxCanvasClassNameNR ); @@ -723,7 +723,7 @@ terminate the program,\r\n\ \"Retry\" to exit the program normally and \"Ignore\" to try to continue."), _T("Unhandled exception"), MB_ABORTRETRYIGNORE | - MB_ICONERROR| + MB_ICONERROR| MB_TASKMODAL ) ) @@ -773,4 +773,3 @@ bool wxApp::ProcessMessage(WXMSG* pMsg) } #endif // WXWIN_COMPATIBILITY_2_4 - diff --git a/src/msw/bmpbuttn.cpp b/src/msw/bmpbuttn.cpp index 3ca9fe2050..3aef7085d1 100644 --- a/src/msw/bmpbuttn.cpp +++ b/src/msw/bmpbuttn.cpp @@ -331,8 +331,6 @@ bool wxBitmapButton::MSWOnDraw(WXDRAWITEMSTRUCT *item) // GRG Feb/2000, support for bmp buttons with Win95/98 standard LNF -#if defined(__WIN95__) - void wxBitmapButton::DrawFace( WXHDC dc, int left, int top, int right, int bottom, bool sel ) { @@ -388,73 +386,6 @@ void wxBitmapButton::DrawFace( WXHDC dc, int left, int top, DeleteObject(brushFace); } -#else - -void wxBitmapButton::DrawFace( WXHDC dc, int left, int top, - int right, int bottom, bool sel ) -{ - HPEN oldp; - HPEN penBorder; - HPEN penLight; - HPEN penShadow; - HBRUSH brushFace; - - // create needed pens and brush - penBorder = CreatePen(PS_SOLID, 0, GetSysColor(COLOR_WINDOWFRAME)); - penShadow = CreatePen(PS_SOLID, 0, GetSysColor(COLOR_BTNSHADOW)); - penLight = CreatePen(PS_SOLID, 0, GetSysColor(COLOR_BTNHIGHLIGHT)); - brushFace = CreateSolidBrush(COLOR_BTNFACE); - - // draw the rectangle - RECT rect; - rect.left = left; - rect.right = right; - rect.top = top; - rect.bottom = bottom; - FillRect((HDC) dc, &rect, brushFace); - - // draw the border - oldp = (HPEN) SelectObject( (HDC) dc, penBorder); - MoveToEx((HDC) dc,left+1,top,NULL);LineTo((HDC) dc,right-1,top); - MoveToEx((HDC) dc,left,top+1,NULL);LineTo((HDC) dc,left,bottom-1); - MoveToEx((HDC) dc,left+1,bottom-1,NULL);LineTo((HDC) dc,right-1,bottom-1); - MoveToEx((HDC) dc,right-1,top+1,NULL);LineTo((HDC) dc,right-1,bottom-1); - - SelectObject( (HDC) dc, penShadow); - if (sel) - { - MoveToEx((HDC) dc,left+1 ,bottom-2 ,NULL); - LineTo((HDC) dc, left+1 ,top+1); - LineTo((HDC) dc, right-2 ,top+1); - } - else - { - MoveToEx((HDC) dc,left+1 ,bottom-2 ,NULL); - LineTo((HDC) dc, right-2 ,bottom-2); - LineTo((HDC) dc, right-2 ,top); - - MoveToEx((HDC) dc,left+2 ,bottom-3 ,NULL); - LineTo((HDC) dc, right-3 ,bottom-3); - LineTo((HDC) dc, right-3 ,top+1); - - SelectObject( (HDC) dc, penLight); - - MoveToEx((HDC) dc,left+1 ,bottom-2 ,NULL); - LineTo((HDC) dc, left+1 ,top+1); - LineTo((HDC) dc, right-2 ,top+1); - } - - // delete allocated resources - SelectObject((HDC) dc,oldp); - DeleteObject(penBorder); - DeleteObject(penLight); - DeleteObject(penShadow); - DeleteObject(brushFace); -} - -#endif // defined(__WIN95__) - - void wxBitmapButton::DrawButtonFocus( WXHDC dc, int left, int top, int right, int bottom, bool WXUNUSED(sel) ) { @@ -532,4 +463,3 @@ wxSize wxBitmapButton::DoGetBestSize() const } #endif // wxUSE_BMPBUTTON - diff --git a/src/msw/control.cpp b/src/msw/control.cpp index 70451b1590..a5a7431b76 100644 --- a/src/msw/control.cpp +++ b/src/msw/control.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: msw/control.cpp +// Name: src/msw/control.cpp // Purpose: wxControl class // Author: Julian Smart // Modified by: @@ -43,9 +43,8 @@ #include "wx/msw/private.h" #include "wx/msw/uxtheme.h" -#if defined(__WIN95__) && !(defined(__GNUWIN32_OLD__) && !defined(__CYGWIN10__)) - #include -#endif +// include "properly" +#include "wx/msw/wrapcctl.h" // ---------------------------------------------------------------------------- // wxWin macros @@ -278,7 +277,6 @@ bool wxControl::ProcessCommand(wxCommandEvent& event) return GetEventHandler()->ProcessEvent(event); } -#ifdef __WIN95__ bool wxControl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM* result) @@ -326,7 +324,6 @@ bool wxControl::MSWOnNotify(int idCtrl, return GetEventHandler()->ProcessEvent(event); } -#endif // Win95 WXHBRUSH wxControl::DoMSWControlColor(WXHDC pDC, wxColour colBg, WXHWND hWnd) { diff --git a/src/msw/dcprint.cpp b/src/msw/dcprint.cpp index c1e1bbceca..3fbe8b2085 100644 --- a/src/msw/dcprint.cpp +++ b/src/msw/dcprint.cpp @@ -180,10 +180,8 @@ bool wxPrinterDC::StartDoc(const wxString& message) else docinfo.lpszOutput = (const wxChar *) filename; -#if defined(__WIN95__) docinfo.lpszDatatype = NULL; docinfo.fwType = 0; -#endif if (!m_hDC) return false; diff --git a/src/msw/dirdlg.cpp b/src/msw/dirdlg.cpp index 76520ea333..f5288c4597 100644 --- a/src/msw/dirdlg.cpp +++ b/src/msw/dirdlg.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: dirdlg.cpp +// Name: src/msw/dirdlg.cpp // Purpose: wxDirDialog // Author: Julian Smart // Modified by: @@ -26,7 +26,7 @@ #if wxUSE_DIRDLG && (!defined(__WXWINCE__) || defined(__HANDHELDPC__)) -#if defined(__WIN95__) && !defined(__GNUWIN32_OLD__) && wxUSE_OLE +#if !defined(__GNUWIN32_OLD__) && wxUSE_OLE #ifndef WX_PRECOMP #include "wx/utils.h" diff --git a/src/msw/dragimag.cpp b/src/msw/dragimag.cpp index f604cad75f..24e30dcc89 100644 --- a/src/msw/dragimag.cpp +++ b/src/msw/dragimag.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: dragimag.cpp +// Name: src/msw/dragimag.cpp // Purpose: wxDragImage // Author: Julian Smart // Modified by: @@ -26,8 +26,6 @@ #if wxUSE_DRAGIMAGE -#if defined(__WIN95__) - #ifndef WX_PRECOMP #include #include "wx/setup.h" @@ -51,9 +49,8 @@ #include "wx/msw/wince/missing.h" #endif // __WXWINCE__ -#if defined(__WIN95__) && !(defined(__GNUWIN32_OLD__) && !defined(__CYGWIN10__)) -#include -#endif +// include "properly" +#include "wx/msw/wrapcctl.h" // Wine doesn't have this yet #ifndef ListView_CreateDragImage @@ -453,7 +450,4 @@ bool wxDragImage::Hide() return ret; } -#endif - // __WIN95__ - #endif // wxUSE_DRAGIMAGE diff --git a/src/msw/frame.cpp b/src/msw/frame.cpp index 1f6b31bce7..ee8d22fd52 100644 --- a/src/msw/frame.cpp +++ b/src/msw/frame.cpp @@ -683,10 +683,8 @@ void wxFrame::IconizeChildFrames(bool bIconize) // them appear in the taskbar because they are, by virtue of this // style, not managed by the taskbar - instead leave Windows take care // of them -#ifdef __WIN95__ if ( win->GetWindowStyle() & wxFRAME_TOOL_WINDOW ) continue; -#endif // Win95 // the child MDI frames are a special case and should not be touched by // the parent frame - instead, they are managed by the user diff --git a/src/msw/helpbest.cpp b/src/msw/helpbest.cpp index 53244390bd..cb69551e1a 100644 --- a/src/msw/helpbest.cpp +++ b/src/msw/helpbest.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: helpbest.cpp +// Name: src/msw/helpbest.cpp // Purpose: Tries to load MS HTML Help, falls back to wxHTML upon failure // Author: Mattia Barbon // Modified by: @@ -23,7 +23,7 @@ #include "wx/filefn.h" #include "wx/log.h" -#if wxUSE_HELP && wxUSE_MS_HTML_HELP && defined(__WIN95__) \ +#if wxUSE_HELP && wxUSE_MS_HTML_HELP \ && wxUSE_WXHTML_HELP && !defined(__WXUNIVERSAL__) #include "wx/msw/helpchm.h" @@ -100,4 +100,4 @@ wxString wxBestHelpController::GetValidFilename( const wxString& filename ) cons } #endif - // wxUSE_HELP && wxUSE_MS_HTML_HELP && defined(__WIN95__) && wxUSE_WXHTML_HELP + // wxUSE_HELP && wxUSE_MS_HTML_HELP && wxUSE_WXHTML_HELP diff --git a/src/msw/helpchm.cpp b/src/msw/helpchm.cpp index 4bd7467b28..2d964b0011 100644 --- a/src/msw/helpchm.cpp +++ b/src/msw/helpchm.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: helpchm.cpp +// Name: src/msw/helpchm.cpp // Purpose: Help system: MS HTML Help implementation // Author: Julian Smart // Modified by: @@ -16,7 +16,7 @@ #pragma hdrstop #endif -#if wxUSE_HELP && wxUSE_MS_HTML_HELP && defined(__WIN95__) +#if wxUSE_HELP && wxUSE_MS_HTML_HELP #include "wx/filefn.h" #include "wx/msw/helpchm.h" @@ -75,7 +75,7 @@ static bool LoadHtmlHelpLibrary() static void UnloadHtmlHelpLibrary() { if ( gs_htmlHelp ) - { + { if (wxPluginManager::UnloadLibrary( _T("HHCTRL.OCX") )) gs_htmlHelp = 0; } @@ -245,4 +245,3 @@ wxCHMHelpController::~wxCHMHelpController() } #endif // wxUSE_HELP - diff --git a/src/msw/helpwin.cpp b/src/msw/helpwin.cpp index 1fa93f0fe6..e5739bad4f 100644 --- a/src/msw/helpwin.cpp +++ b/src/msw/helpwin.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: helpwin.cpp +// Name: src/msw/helpwin.cpp // Purpose: Help system: WinHelp implementation // Author: Julian Smart // Modified by: @@ -64,11 +64,7 @@ bool wxWinHelpController::DisplayContents(void) wxString str = GetValidFilename(m_helpFile); -#if defined(__WIN95__) return (WinHelp(GetSuitableHWND(this), (const wxChar*) str, HELP_FINDER, 0L) != 0); -#else - return (WinHelp(GetSuitableHWND(this), (const wxChar*) str, HELP_CONTENTS, 0L) != 0); -#endif } bool wxWinHelpController::DisplaySection(int section) diff --git a/src/msw/imaglist.cpp b/src/msw/imaglist.cpp index b873175b9b..7fab0d3724 100644 --- a/src/msw/imaglist.cpp +++ b/src/msw/imaglist.cpp @@ -24,8 +24,6 @@ #pragma hdrstop #endif -#if defined(__WIN95__) - #ifndef WX_PRECOMP #include "wx/window.h" #include "wx/icon.h" @@ -43,9 +41,8 @@ #include "wx/msw/imaglist.h" #include "wx/msw/private.h" -#if defined(__WIN95__) && !(defined(__GNUWIN32_OLD__) && !defined(__CYGWIN10__)) - #include -#endif +// include "properly" +#include "wx/msw/wrapcctl.h" // ---------------------------------------------------------------------------- // wxWin macros @@ -323,7 +320,7 @@ wxBitmap wxImageList::GetBitmap(int index) const image = bitmap.ConvertToImage(); image.SetMaskColour(r, g, b); bitmap = wxBitmap(image); - + return bitmap; } @@ -335,14 +332,14 @@ wxIcon wxImageList::GetIcon(int index) const { wxIcon icon; icon.SetHICON((WXHICON)hIcon); - + int iconW, iconH; GetSize(index, iconW, iconH); icon.SetSize(iconW, iconH); - + return icon; } - else + else return wxNullIcon; } @@ -391,6 +388,3 @@ static HBITMAP GetMaskForImage(const wxBitmap& bitmap, const wxBitmap& mask) return hbmpMaskInv; } - -#endif // Win95 - diff --git a/src/msw/listctrl.cpp b/src/msw/listctrl.cpp index 5a8c4e3363..4972854909 100644 --- a/src/msw/listctrl.cpp +++ b/src/msw/listctrl.cpp @@ -24,7 +24,7 @@ #pragma hdrstop #endif -#if wxUSE_LISTCTRL && defined(__WIN95__) +#if wxUSE_LISTCTRL #ifndef WX_PRECOMP #include "wx/app.h" diff --git a/src/msw/mdi.cpp b/src/msw/mdi.cpp index ac7afcc3be..89040acf21 100644 --- a/src/msw/mdi.cpp +++ b/src/msw/mdi.cpp @@ -1092,7 +1092,7 @@ bool wxMDIChildFrame::HandleMDIActivate(long WXUNUSED(activate), bool wxMDIChildFrame::HandleWindowPosChanging(void *pos) { WINDOWPOS *lpPos = (WINDOWPOS *)pos; -#if defined(__WIN95__) + if (!(lpPos->flags & SWP_NOSIZE)) { RECT rectClient; @@ -1114,7 +1114,6 @@ bool wxMDIChildFrame::HandleWindowPosChanging(void *pos) } #endif } -#endif // Win95 return false; } @@ -1132,14 +1131,14 @@ bool wxMDIChildFrame::HandleGetMinMaxInfo(void *mmInfo) minHeight = GetMinHeight(); // but allow GetSizeHints() to set the min size - if ( minWidth != -1 ) + if ( minWidth != wxDefaultCoord ) { info->ptMinTrackSize.x = minWidth; processed = true; } - if ( minHeight != -1 ) + if ( minHeight != wxDefaultCoord ) { info->ptMinTrackSize.y = minHeight; @@ -1200,10 +1199,10 @@ void wxMDIChildFrame::MSWDestroyWindow() // style when a child is maximised (a double border looks silly.) bool wxMDIChildFrame::ResetWindowStyle(void *vrect) { -#if defined(__WIN95__) RECT *rect = (RECT *)vrect; wxMDIParentFrame* pFrameWnd = (wxMDIParentFrame *)GetParent(); wxMDIChildFrame* pChild = pFrameWnd->GetActiveChild(); + if (!pChild || (pChild == this)) { HWND hwndClient = GetWinHwnd(pFrameWnd->GetClientWindow()); @@ -1235,7 +1234,6 @@ bool wxMDIChildFrame::ResetWindowStyle(void *vrect) return true; } } -#endif // Win95 return false; } @@ -1264,11 +1262,7 @@ bool wxMDIClientWindow::CreateClient(wxMDIParentFrame *parent, long style) if ( style & wxVSCROLL ) msStyle |= WS_VSCROLL; -#if defined(__WIN95__) DWORD exStyle = WS_EX_CLIENTEDGE; -#else - DWORD exStyle = 0; -#endif wxWindowCreationHook hook(this); m_hWnd = (WXHWND)::CreateWindowEx @@ -1486,4 +1480,3 @@ static void UnpackMDIActivate(WXWPARAM wParam, WXLPARAM lParam, } #endif // wxUSE_MDI && !defined(__WXUNIVERSAL__) - diff --git a/src/msw/nativdlg.cpp b/src/msw/nativdlg.cpp index e483c687ef..5e6ff9865a 100644 --- a/src/msw/nativdlg.cpp +++ b/src/msw/nativdlg.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: nativdlg.cpp +// Name: src/msw/nativdlg.cpp // Purpose: Native dialog loading code (part of wxWindow) // Author: Julian Smart // Modified by: @@ -30,9 +30,7 @@ #include "wx/wx.h" #endif -#if defined(__WIN95__) #include "wx/spinbutt.h" -#endif #include "wx/msw/private.h" // --------------------------------------------------------------------------- @@ -267,7 +265,7 @@ wxWindow* wxWindow::CreateWindowFromHWND(wxWindow* parent, WXHWND hWnd) win = new wxScrollBar; } #endif -#if defined(__WIN95__) && wxUSE_SPINBTN +#if wxUSE_SPINBTN else if (str == wxT("MSCTLS_UPDOWN32")) { win = new wxSpinButton; @@ -336,4 +334,3 @@ void wxWindow::AdoptAttributesFromHWND(void) if (style & WS_HSCROLL) m_windowStyle |= wxHSCROLL; } - diff --git a/src/msw/scrolbar.cpp b/src/msw/scrolbar.cpp index 99f318ec6b..20a45e346b 100644 --- a/src/msw/scrolbar.cpp +++ b/src/msw/scrolbar.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: msw/scrolbar.cpp +// Name: src/msw/scrolbar.cpp // Purpose: wxScrollBar // Author: Julian Smart // Modified by: @@ -146,13 +146,11 @@ bool wxScrollBar::MSWOnScroll(int WXUNUSED(orientation), WXWORD wParam, } #endif -#if defined(__WIN95__) // A page size greater than one has the effect of reducing the effective // range, therefore the range has already been boosted artificially - so // reduce it again. if ( m_pageSize > 1 ) maxPos -= (m_pageSize - 1); -#endif // __WIN95__ wxEventType scrollEvent = wxEVT_NULL; @@ -237,7 +235,6 @@ bool wxScrollBar::MSWOnScroll(int WXUNUSED(orientation), WXWORD wParam, void wxScrollBar::SetThumbPosition(int viewStart) { -#if defined(__WIN95__) SCROLLINFO info; info.cbSize = sizeof(SCROLLINFO); info.nPage = 0; @@ -246,9 +243,6 @@ void wxScrollBar::SetThumbPosition(int viewStart) info.fMask = SIF_POS ; ::SetScrollInfo((HWND) GetHWND(), SB_CTL, &info, TRUE); -#else - ::SetScrollPos((HWND) GetHWND(), SB_CTL, viewStart, TRUE); -#endif } int wxScrollBar::GetThumbPosition(void) const @@ -269,36 +263,31 @@ int wxScrollBar::GetThumbPosition(void) const void wxScrollBar::SetScrollbar(int position, int thumbSize, int range, int pageSize, bool refresh) { - m_viewSize = pageSize; - m_pageSize = thumbSize; - m_objectSize = range; - - // The range (number of scroll steps) is the - // object length minus the page size. - int range1 = wxMax((m_objectSize - m_pageSize), 0) ; - -#if defined(__WIN95__) - // Try to adjust the range to cope with page size > 1 - // (see comment for SetPageLength) - if ( m_pageSize > 1 ) - { - range1 += (m_pageSize - 1); - } - - SCROLLINFO info; - info.cbSize = sizeof(SCROLLINFO); - info.nPage = m_pageSize; - info.nMin = 0; - info.nMax = range1; - info.nPos = position; - - info.fMask = SIF_PAGE | SIF_RANGE | SIF_POS; - - ::SetScrollInfo((HWND) GetHWND(), SB_CTL, &info, refresh); -#else - ::SetScrollPos((HWND)m_hWnd, SB_CTL, position, refresh); - ::SetScrollRange((HWND)m_hWnd, SB_CTL, 0, range1, refresh); -#endif + m_viewSize = pageSize; + m_pageSize = thumbSize; + m_objectSize = range; + + // The range (number of scroll steps) is the + // object length minus the page size. + int range1 = wxMax((m_objectSize - m_pageSize), 0) ; + + // Try to adjust the range to cope with page size > 1 + // (see comment for SetPageLength) + if ( m_pageSize > 1 ) + { + range1 += (m_pageSize - 1); + } + + SCROLLINFO info; + info.cbSize = sizeof(SCROLLINFO); + info.nPage = m_pageSize; + info.nMin = 0; + info.nMax = range1; + info.nPos = position; + + info.fMask = SIF_PAGE | SIF_RANGE | SIF_POS; + + ::SetScrollInfo((HWND) GetHWND(), SB_CTL, &info, refresh); } void wxScrollBar::Command(wxCommandEvent& event) diff --git a/src/msw/statbr95.cpp b/src/msw/statbr95.cpp index 82773a5d17..64078bf0db 100644 --- a/src/msw/statbr95.cpp +++ b/src/msw/statbr95.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////////// -// Name: msw/statbr95.cpp +// Name: src/msw/statbr95.cpp // Purpose: native implementation of wxStatusBar // Author: Vadim Zeitlin // Modified by: @@ -23,7 +23,7 @@ #include "wx/dcclient.h" #endif -#if wxUSE_STATUSBAR && defined(__WIN95__) && wxUSE_NATIVE_STATUSBAR +#if wxUSE_STATUSBAR && wxUSE_NATIVE_STATUSBAR #include "wx/intl.h" #include "wx/log.h" @@ -32,9 +32,8 @@ #include "wx/msw/private.h" #include -#if defined(__WIN95__) && !(defined(__GNUWIN32_OLD__) && !defined(__CYGWIN10__)) - #include -#endif +// include "properly" +#include "wx/msw/wrapcctl.h" // ---------------------------------------------------------------------------- // macros @@ -386,5 +385,4 @@ wxStatusBar95::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam) return wxStatusBarBase::MSWWindowProc(nMsg, wParam, lParam); } -#endif // __WIN95__ && wxUSE_NATIVE_STATUSBAR - +#endif // wxUSE_STATUSBAR && wxUSE_NATIVE_STATUSBAR diff --git a/src/msw/tabctrl.cpp b/src/msw/tabctrl.cpp index 4cbce89aaa..b2a69f6e77 100644 --- a/src/msw/tabctrl.cpp +++ b/src/msw/tabctrl.cpp @@ -20,11 +20,10 @@ #include "wx/wx.h" #endif -#if defined(__WIN95__) - #include "wx/msw/private.h" -#include +// include "properly" +#include "wx/msw/wrapcctl.h" #include "wx/tabctrl.h" #include "wx/app.h" @@ -429,5 +428,3 @@ void wxMapBitmap(HBITMAP hBitmap, int width, int height) } #endif - -#endif // __WIN95__ diff --git a/src/msw/taskbar.cpp b/src/msw/taskbar.cpp index ac7491bef0..c5b9b9b5c1 100644 --- a/src/msw/taskbar.cpp +++ b/src/msw/taskbar.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// File: taskbar.cpp +// File: src/msw/taskbar.cpp // Purpose: Implements wxTaskBarIcon class for manipulating icons on // the Windows task bar. // Author: Julian Smart @@ -25,8 +25,6 @@ #include "wx/menu.h" #endif -#if defined(__WIN95__) - #include "wx/msw/private.h" #include "wx/msw/winundef.h" @@ -325,5 +323,3 @@ long wxTaskBarIcon::WindowProc(unsigned int msg, return 0; } - -#endif // __WIN95__ diff --git a/src/msw/toplevel.cpp b/src/msw/toplevel.cpp index f8897c0185..f5689a3aab 100644 --- a/src/msw/toplevel.cpp +++ b/src/msw/toplevel.cpp @@ -884,7 +884,7 @@ void wxTopLevelWindowMSW::SetIcons(const wxIconBundle& icons) { wxTopLevelWindowBase::SetIcons(icons); -#if defined(__WIN95__) && !defined(__WXMICROWIN__) +#if !defined(__WXMICROWIN__) const wxIcon& sml = icons.GetIcon( wxSize( 16, 16 ) ); if( sml.Ok() && sml.GetWidth() == 16 && sml.GetHeight() == 16 ) { @@ -898,7 +898,7 @@ void wxTopLevelWindowMSW::SetIcons(const wxIconBundle& icons) ::SendMessage( GetHwndOf( this ), WM_SETICON, ICON_BIG, (LPARAM)GetHiconOf(big) ); } -#endif // __WIN95__ +#endif // !__WXMICROWIN__ } bool wxTopLevelWindowMSW::EnableCloseButton(bool enable) diff --git a/src/msw/wince/tbarwce.cpp b/src/msw/wince/tbarwce.cpp index 5a410368c4..4d5f0e3f49 100644 --- a/src/msw/wince/tbarwce.cpp +++ b/src/msw/wince/tbarwce.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: msw/wince/tbarwce.cpp +// Name: src/msw/wince/tbarwce.cpp // Purpose: wxToolBar for Windows CE // Author: Julian Smart // Modified by: @@ -120,7 +120,7 @@ public: // a control in the toolbar void SetSeparatorsCount(size_t count) { m_nSepCount = count; } size_t GetSeparatorsCount() const { return m_nSepCount; } - + void SetBitmapIndex(int idx) { m_bitmapIndex = idx; } int GetBitmapIndex() const { return m_bitmapIndex; } @@ -163,8 +163,8 @@ wxToolBarToolBase *wxToolMenuBar::CreateTool(wxControl *control) void wxToolMenuBar::Init() { wxToolBar::Init(); - - m_nButtons = 0; + + m_nButtons = 0; m_menuBar = NULL; } @@ -397,7 +397,7 @@ bool wxToolMenuBar::Realize() break; case wxTOOL_STYLE_BUTTON: - + if ( HasFlag(wxTB_TEXT) ) { const wxString& label = tool->GetLabel(); @@ -589,10 +589,10 @@ bool wxToolBar::Create(wxWindow *parent, // satisfy other parts of wxWidgets. parent->AddChild(this); - + SetWindowStyle(style); SetName(name); - + return true; } @@ -637,7 +637,4 @@ void wxToolBar::DoSetToggle(wxToolBarToolBase *WXUNUSED(tool), bool WXUNUSED(tog #endif // !__SMARTPHONE__ - - -#endif // wxUSE_TOOLBAR && Win95 - +#endif // wxUSE_TOOLBAR diff --git a/src/msw/window.cpp b/src/msw/window.cpp index eeebee20c1..07f84ec60e 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -849,7 +849,7 @@ inline int GetScrollPosition(HWND hWnd, int wOrient) scrollInfo.cbSize = sizeof(SCROLLINFO); scrollInfo.fMask = SIF_POS; ::GetScrollInfo(hWnd, wOrient, &scrollInfo ); - + return scrollInfo.nPos; #endif @@ -3197,8 +3197,6 @@ bool wxWindowMSW::MSWCreate(const wxChar *wclass, // WM_NOTIFY // --------------------------------------------------------------------------- -#ifdef __WIN95__ - bool wxWindowMSW::HandleNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) { #ifndef __WXMICROWIN__ @@ -3342,8 +3340,6 @@ bool wxWindowMSW::MSWOnNotify(int WXUNUSED(idCtrl), return false; } -#endif // __WIN95__ - // --------------------------------------------------------------------------- // end session messages // --------------------------------------------------------------------------- -- 2.45.2