[Wx Widget] wxWidgets-2.8.12 code now compiles, still need to fix up linking

This commit is contained in:
zilmar 2015-10-19 08:09:49 +11:00
parent 2e5978ae89
commit 5582d83eec
179 changed files with 110820 additions and 107233 deletions

View File

@ -145,8 +145,6 @@
#ifdef _DEBUG
#pragma comment(lib,"wxbase28d")
#pragma comment(lib,"wxbase28d_net")
#pragma comment(lib,"wxbase28d_xml")
#if wxUSE_REGEX
#pragma comment(lib,"wxregexd")
#endif
@ -167,9 +165,7 @@
#if wxUSE_ZLIB
#pragma comment(lib,"wxzlibd")
#endif
#pragma comment(lib,"wxmsw28d_adv")
#pragma comment(lib,"wxmsw28d_core")
#pragma comment(lib,"wxmsw28d_html")
#if wxUSE_GLCANVAS
#pragma comment(lib,"wxmsw28d_gl")
#endif

View File

@ -31,7 +31,7 @@
# include <sys/types.h>
#endif
#if defined(__WXWINCE__) || defined(__CYGWIN__)
#if defined(__WXWINCE__) || defined(__CYGWIN__) || defined(__WXMSW__)
#include <winsock.h>
#endif

View File

@ -139,7 +139,7 @@
//
// Recommended setting: 1, it is compiled into a separate library so there
// is no overhead if you don't use it
#define wxUSE_DEBUGREPORT 1
#define wxUSE_DEBUGREPORT 0
// ----------------------------------------------------------------------------
// Unicode support
@ -520,7 +520,7 @@
//
// Recommended setting: 1 if your compiler supports it, if it doesn't please
// contribute us a makefile for src/regex for it
#define wxUSE_REGEX 1
#define wxUSE_REGEX 0
// wxSystemOptions class
#define wxUSE_SYSTEM_OPTIONS 1
@ -533,7 +533,7 @@
// Default is 1.
//
// Recommended setting: 1
#define wxUSE_MEDIACTRL 1
#define wxUSE_MEDIACTRL 0
// Use GStreamer for Unix (req a lot of dependancies)
//
@ -547,7 +547,7 @@
// Default is 1
//
// Recommended setting: 1 (requires wxUSE_XML)
#define wxUSE_XRC 1
#define wxUSE_XRC 0
// XML parsing classes. Note that their API will change in the future, so
// using wxXmlDocument and wxXmlNode in your app is not recommended.
@ -562,7 +562,7 @@
// Default is 1
//
// Recommended setting: 1
#define wxUSE_AUI 1
#define wxUSE_AUI 0
// Enable the new wxGraphicsPath and wxGraphicsContext classes for an advanced
@ -1011,7 +1011,7 @@
//
// Recommended setting: 1, set to 0 if you want compile a
// smaller library.
#define wxUSE_RICHTEXT 1
#define wxUSE_RICHTEXT 0
// ----------------------------------------------------------------------------
// Data transfer
@ -1170,25 +1170,25 @@
#define wxUSE_LIBJPEG 1
// Set to 1 for TIFF format support (requires libtiff)
#define wxUSE_LIBTIFF 1
#define wxUSE_LIBTIFF 0
// Set to 1 for TGA format support (loading only)
#define wxUSE_TGA 1
#define wxUSE_TGA 0
// Set to 1 for GIF format support
#define wxUSE_GIF 1
#define wxUSE_GIF 0
// Set to 1 for PNM format support
#define wxUSE_PNM 1
#define wxUSE_PNM 0
// Set to 1 for PCX format support
#define wxUSE_PCX 1
#define wxUSE_PCX 0
// Set to 1 for IFF format support (Amiga format)
#define wxUSE_IFF 0
// Set to 1 for XPM format support
#define wxUSE_XPM 1
#define wxUSE_XPM 0
// Set to 1 for MS Icons and Cursors format support
#define wxUSE_ICO_CUR 1

View File

@ -0,0 +1,20 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/private/browserhack28.h
// Purpose: Allows GUI library to override base wxLaunchDefaultBrowser.
// Author: David Elliott
// Modified by:
// Created: 2007-08-19
// RCS-ID: $Id: browserhack28.h 48184 2007-08-19 19:22:09Z DE $
// Copyright: (c) David Elliott
// Licence: wxWidgets licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_PRIVATE_BROWSERHACK28_H_
#define _WX_PRIVATE_BROWSERHACK28_H_
typedef bool (*wxLaunchDefaultBrowserImpl_t)(const wxString& url, int flags);
// Function the GUI library can call to provide a better implementation
WXDLLIMPEXP_BASE void wxSetLaunchDefaultBrowserImpl(wxLaunchDefaultBrowserImpl_t newImpl);
#endif //ndef _WX_PRIVATE_BROWSERHACK28_H_

View File

@ -8,7 +8,6 @@
// Copyright: (c) 1998 Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_UTILSH__
#define _WX_UTILSH__

View File

@ -139,7 +139,7 @@
//
// Recommended setting: 1, it is compiled into a separate library so there
// is no overhead if you don't use it
#define wxUSE_DEBUGREPORT 1
#define wxUSE_DEBUGREPORT 0
// ----------------------------------------------------------------------------
// Unicode support
@ -520,7 +520,7 @@
//
// Recommended setting: 1 if your compiler supports it, if it doesn't please
// contribute us a makefile for src/regex for it
#define wxUSE_REGEX 1
#define wxUSE_REGEX 0
// wxSystemOptions class
#define wxUSE_SYSTEM_OPTIONS 1
@ -533,7 +533,7 @@
// Default is 1.
//
// Recommended setting: 1
#define wxUSE_MEDIACTRL 1
#define wxUSE_MEDIACTRL 0
// Use GStreamer for Unix (req a lot of dependancies)
//
@ -547,7 +547,7 @@
// Default is 1
//
// Recommended setting: 1 (requires wxUSE_XML)
#define wxUSE_XRC 1
#define wxUSE_XRC 0
// XML parsing classes. Note that their API will change in the future, so
// using wxXmlDocument and wxXmlNode in your app is not recommended.
@ -562,7 +562,7 @@
// Default is 1
//
// Recommended setting: 1
#define wxUSE_AUI 1
#define wxUSE_AUI 0
// Enable the new wxGraphicsPath and wxGraphicsContext classes for an advanced
@ -1011,7 +1011,7 @@
//
// Recommended setting: 1, set to 0 if you want compile a
// smaller library.
#define wxUSE_RICHTEXT 1
#define wxUSE_RICHTEXT 0
// ----------------------------------------------------------------------------
// Data transfer
@ -1170,25 +1170,25 @@
#define wxUSE_LIBJPEG 1
// Set to 1 for TIFF format support (requires libtiff)
#define wxUSE_LIBTIFF 1
#define wxUSE_LIBTIFF 0
// Set to 1 for TGA format support (loading only)
#define wxUSE_TGA 1
#define wxUSE_TGA 0
// Set to 1 for GIF format support
#define wxUSE_GIF 1
#define wxUSE_GIF 0
// Set to 1 for PNM format support
#define wxUSE_PNM 1
#define wxUSE_PNM 0
// Set to 1 for PCX format support
#define wxUSE_PCX 1
#define wxUSE_PCX 0
// Set to 1 for IFF format support (Amiga format)
#define wxUSE_IFF 0
// Set to 1 for XPM format support
#define wxUSE_XPM 1
#define wxUSE_XPM 0
// Set to 1 for MS Icons and Cursors format support
#define wxUSE_ICO_CUR 1

View File

@ -139,7 +139,7 @@
//
// Recommended setting: 1, it is compiled into a separate library so there
// is no overhead if you don't use it
#define wxUSE_DEBUGREPORT 1
#define wxUSE_DEBUGREPORT 0
// ----------------------------------------------------------------------------
// Unicode support
@ -520,7 +520,7 @@
//
// Recommended setting: 1 if your compiler supports it, if it doesn't please
// contribute us a makefile for src/regex for it
#define wxUSE_REGEX 1
#define wxUSE_REGEX 0
// wxSystemOptions class
#define wxUSE_SYSTEM_OPTIONS 1
@ -533,7 +533,7 @@
// Default is 1.
//
// Recommended setting: 1
#define wxUSE_MEDIACTRL 1
#define wxUSE_MEDIACTRL 0
// Use GStreamer for Unix (req a lot of dependancies)
//
@ -547,7 +547,7 @@
// Default is 1
//
// Recommended setting: 1 (requires wxUSE_XML)
#define wxUSE_XRC 1
#define wxUSE_XRC 0
// XML parsing classes. Note that their API will change in the future, so
// using wxXmlDocument and wxXmlNode in your app is not recommended.
@ -562,7 +562,7 @@
// Default is 1
//
// Recommended setting: 1
#define wxUSE_AUI 1
#define wxUSE_AUI 0
// Enable the new wxGraphicsPath and wxGraphicsContext classes for an advanced
@ -1011,7 +1011,7 @@
//
// Recommended setting: 1, set to 0 if you want compile a
// smaller library.
#define wxUSE_RICHTEXT 1
#define wxUSE_RICHTEXT 0
// ----------------------------------------------------------------------------
// Data transfer
@ -1170,25 +1170,25 @@
#define wxUSE_LIBJPEG 1
// Set to 1 for TIFF format support (requires libtiff)
#define wxUSE_LIBTIFF 1
#define wxUSE_LIBTIFF 0
// Set to 1 for TGA format support (loading only)
#define wxUSE_TGA 1
#define wxUSE_TGA 0
// Set to 1 for GIF format support
#define wxUSE_GIF 1
#define wxUSE_GIF 0
// Set to 1 for PNM format support
#define wxUSE_PNM 1
#define wxUSE_PNM 0
// Set to 1 for PCX format support
#define wxUSE_PCX 1
#define wxUSE_PCX 0
// Set to 1 for IFF format support (Amiga format)
#define wxUSE_IFF 0
// Set to 1 for XPM format support
#define wxUSE_XPM 1
#define wxUSE_XPM 0
// Set to 1 for MS Icons and Cursors format support
#define wxUSE_ICO_CUR 1

View File

@ -52,10 +52,6 @@
#include "wx/msw/private.h" // includes windows.h for LOGFONT
#endif
#ifdef __WXMSW__
#include <WinSock.h>
#endif
#if defined(__WXMAC__)
#include "wx/mac/private.h"
#endif

View File

@ -0,0 +1,83 @@
///////////////////////////////////////////////////////////////////////////////
// Name: common/datacmn.cpp
// Purpose: contains definitions of various global wxWidgets variables
// Author: Vadim Zeitlin
// Modified by:
// Created: 10.04.03 (from src/*/data.cpp files)
// RCS-ID: $Id: datacmn.cpp 43874 2006-12-09 14:52:59Z VZ $
// Copyright: (c) 1997-2002 wxWidgets development team
// License: wxWindows license
///////////////////////////////////////////////////////////////////////////////
// ============================================================================
// declarations
// ============================================================================
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#ifndef WX_PRECOMP
#endif // WX_PRECOMP
#include "wx/accel.h"
// ============================================================================
// implementation
// ============================================================================
// 'Null' objects
#if wxUSE_ACCEL
wxAcceleratorTable wxNullAcceleratorTable;
#endif // wxUSE_ACCEL
// Default window names
extern WXDLLEXPORT_DATA(const wxChar) wxButtonNameStr[] = wxT("button");
extern WXDLLEXPORT_DATA(const wxChar) wxCheckBoxNameStr[] = wxT("check");
extern WXDLLEXPORT_DATA(const wxChar) wxComboBoxNameStr[] = wxT("comboBox");
extern WXDLLEXPORT_DATA(const wxChar) wxDialogNameStr[] = wxT("dialog");
extern WXDLLEXPORT_DATA(const wxChar) wxFrameNameStr[] = wxT("frame");
extern WXDLLEXPORT_DATA(const wxChar) wxStaticBoxNameStr[] = wxT("groupBox");
extern WXDLLEXPORT_DATA(const wxChar) wxListBoxNameStr[] = wxT("listBox");
extern WXDLLEXPORT_DATA(const wxChar) wxStaticLineNameStr[] = wxT("staticLine");
extern WXDLLEXPORT_DATA(const wxChar) wxStaticTextNameStr[] = wxT("staticText");
extern WXDLLEXPORT_DATA(const wxChar) wxStaticBitmapNameStr[] = wxT("staticBitmap");
extern WXDLLEXPORT_DATA(const wxChar) wxNotebookNameStr[] = wxT("notebook");
extern WXDLLEXPORT_DATA(const wxChar) wxPanelNameStr[] = wxT("panel");
extern WXDLLEXPORT_DATA(const wxChar) wxRadioBoxNameStr[] = wxT("radioBox");
extern WXDLLEXPORT_DATA(const wxChar) wxRadioButtonNameStr[] = wxT("radioButton");
extern WXDLLEXPORT_DATA(const wxChar) wxBitmapRadioButtonNameStr[] = wxT("radioButton");
extern WXDLLEXPORT_DATA(const wxChar) wxScrollBarNameStr[] = wxT("scrollBar");
extern WXDLLEXPORT_DATA(const wxChar) wxSliderNameStr[] = wxT("slider");
extern WXDLLEXPORT_DATA(const wxChar) wxStatusLineNameStr[] = wxT("status_line");
extern WXDLLEXPORT_DATA(const wxChar) wxTextCtrlNameStr[] = wxT("text");
extern WXDLLEXPORT_DATA(const wxChar) wxTreeCtrlNameStr[] = wxT("treeCtrl");
extern WXDLLEXPORT_DATA(const wxChar) wxToolBarNameStr[] = wxT("toolbar");
// Default messages
extern WXDLLEXPORT_DATA(const wxChar) wxMessageBoxCaptionStr[] = wxT("Message");
extern WXDLLEXPORT_DATA(const wxChar) wxFileSelectorPromptStr[] = wxT("Select a file");
extern WXDLLEXPORT_DATA(const wxChar) wxDirSelectorPromptStr[] = wxT("Select a directory");
// Other default strings
extern WXDLLEXPORT_DATA(const wxChar) wxFileSelectorDefaultWildcardStr[] =
#if defined(__WXMSW__) || defined(__OS2__)
wxT("*.*")
#else // Unix/Mac
wxT("*")
#endif
;
extern WXDLLEXPORT_DATA(const wxChar) wxDirDialogNameStr[] = wxT("wxDirCtrl");
extern WXDLLEXPORT_DATA(const wxChar) wxDirDialogDefaultFolderStr[] = wxT("/");
extern WXDLLEXPORT_DATA(const wxChar) wxFileDialogNameStr[] = wxT("filedlg");
#if defined(__WXMSW__) || defined(__OS2__)
WXDLLEXPORT_DATA(const wxChar *) wxUserResourceStr = wxT("TEXT");
#endif

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,180 @@
/////////////////////////////////////////////////////////////////////////////
// Name: src/generic/panelg.cpp
// Purpose: wxPanel and the keyboard handling code
// Author: Julian Smart, Robert Roebling, Vadim Zeitlin
// Modified by:
// Created: 04/01/98
// RCS-ID: $Id: panelg.cpp 40307 2006-07-25 01:31:13Z VZ $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// ============================================================================
// declarations
// ============================================================================
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#ifndef WX_PRECOMP
#include "wx/object.h"
#include "wx/font.h"
#include "wx/colour.h"
#include "wx/settings.h"
#include "wx/log.h"
#include "wx/panel.h"
#include "wx/containr.h"
#endif
// ----------------------------------------------------------------------------
// wxWin macros
// ----------------------------------------------------------------------------
#if wxUSE_EXTENDED_RTTI
WX_DEFINE_FLAGS( wxPanelStyle )
wxBEGIN_FLAGS( wxPanelStyle )
// new style border flags, we put them first to
// use them for streaming out
wxFLAGS_MEMBER(wxBORDER_SIMPLE)
wxFLAGS_MEMBER(wxBORDER_SUNKEN)
wxFLAGS_MEMBER(wxBORDER_DOUBLE)
wxFLAGS_MEMBER(wxBORDER_RAISED)
wxFLAGS_MEMBER(wxBORDER_STATIC)
wxFLAGS_MEMBER(wxBORDER_NONE)
// old style border flags
wxFLAGS_MEMBER(wxSIMPLE_BORDER)
wxFLAGS_MEMBER(wxSUNKEN_BORDER)
wxFLAGS_MEMBER(wxDOUBLE_BORDER)
wxFLAGS_MEMBER(wxRAISED_BORDER)
wxFLAGS_MEMBER(wxSTATIC_BORDER)
wxFLAGS_MEMBER(wxBORDER)
// standard window styles
wxFLAGS_MEMBER(wxTAB_TRAVERSAL)
wxFLAGS_MEMBER(wxCLIP_CHILDREN)
wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW)
wxFLAGS_MEMBER(wxWANTS_CHARS)
wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE)
wxFLAGS_MEMBER(wxALWAYS_SHOW_SB )
wxFLAGS_MEMBER(wxVSCROLL)
wxFLAGS_MEMBER(wxHSCROLL)
wxEND_FLAGS( wxPanelStyle )
IMPLEMENT_DYNAMIC_CLASS_XTI(wxPanel, wxWindow,"wx/panel.h")
wxBEGIN_PROPERTIES_TABLE(wxPanel)
wxPROPERTY_FLAGS( WindowStyle , wxPanelStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , EMPTY_MACROVALUE, 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style
// style wxTAB_TRAVERSAL
wxEND_PROPERTIES_TABLE()
wxBEGIN_HANDLERS_TABLE(wxPanel)
wxEND_HANDLERS_TABLE()
wxCONSTRUCTOR_5( wxPanel , wxWindow* , Parent , wxWindowID , Id , wxPoint , Position , wxSize , Size , long , WindowStyle )
#else
IMPLEMENT_DYNAMIC_CLASS(wxPanel, wxWindow)
#endif
BEGIN_EVENT_TABLE(wxPanel, wxWindow)
EVT_SIZE(wxPanel::OnSize)
WX_EVENT_TABLE_CONTROL_CONTAINER(wxPanel)
END_EVENT_TABLE()
// ============================================================================
// implementation
// ============================================================================
WX_DELEGATE_TO_CONTROL_CONTAINER(wxPanel, wxWindow)
// ----------------------------------------------------------------------------
// wxPanel creation
// ----------------------------------------------------------------------------
void wxPanel::Init()
{
m_container.SetContainerWindow(this);
}
bool wxPanel::Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,
long style,
const wxString& name)
{
if ( !wxWindow::Create(parent, id, pos, size, style, name) )
return false;
// so that non-solid background renders correctly under GTK+:
SetThemeEnabled(true);
#if defined(__WXWINCE__) && (defined(__POCKETPC__) || defined(__SMARTPHONE__))
// Required to get solid control backgrounds under WinCE
SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW));
#endif
return true;
}
wxPanel::~wxPanel()
{
}
void wxPanel::InitDialog()
{
wxInitDialogEvent event(GetId());
event.SetEventObject(this);
GetEventHandler()->ProcessEvent(event);
}
// ----------------------------------------------------------------------------
// event handlers
// ----------------------------------------------------------------------------
void wxPanel::OnSize(wxSizeEvent& event)
{
if (GetAutoLayout())
Layout();
#if wxUSE_CONSTRAINTS
#if defined(__WXPM__) && 0
else
{
// Need to properly move child windows under OS/2
PSWP pWinSwp = GetSwp();
if (pWinSwp->cx == 0 && pWinSwp->cy == 0 && pWinSwp->fl == 0)
{
// Uninitialized
::WinQueryWindowPos(GetHWND(), pWinSwp);
}
else
{
SWP vSwp;
int nYDiff;
::WinQueryWindowPos(GetHWND(), &vSwp);
nYDiff = pWinSwp->cy - vSwp.cy;
MoveChildren(nYDiff);
pWinSwp->cx = vSwp.cx;
pWinSwp->cy = vSwp.cy;
}
}
#endif
#endif // wxUSE_CONSTRAINTS
event.Skip();
}

View File

@ -0,0 +1,686 @@
/////////////////////////////////////////////////////////////////////////////
// Name: src/msw/slider.cpp
// Purpose: wxSlider, using the Win95 (and later) trackbar control
// Author: Julian Smart
// Modified by:
// Created: 04/01/98
// RCS-ID: $Id: slider95.cpp 41054 2006-09-07 19:01:45Z ABX $
// Copyright: (c) Julian Smart 1998
// Vadim Zeitlin 2004
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// ============================================================================
// declarations
// ============================================================================
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#if wxUSE_SLIDER
#include "wx/slider.h"
#ifndef WX_PRECOMP
#include "wx/msw/wrapcctl.h" // include <commctrl.h> "properly"
#include "wx/brush.h"
#endif
#include "wx/msw/subwin.h"
// ----------------------------------------------------------------------------
// constants
// ----------------------------------------------------------------------------
// indices of labels in wxSlider::m_labels
enum
{
SliderLabel_Min,
SliderLabel_Max,
SliderLabel_Value,
SliderLabel_Last
};
// the gap between the slider and the labels, in pixels
static const int HGAP = 5;
// ----------------------------------------------------------------------------
// XTI
// ----------------------------------------------------------------------------
#if wxUSE_EXTENDED_RTTI
WX_DEFINE_FLAGS( wxSliderStyle )
wxBEGIN_FLAGS( wxSliderStyle )
// new style border flags, we put them first to
// use them for streaming out
wxFLAGS_MEMBER(wxBORDER_SIMPLE)
wxFLAGS_MEMBER(wxBORDER_SUNKEN)
wxFLAGS_MEMBER(wxBORDER_DOUBLE)
wxFLAGS_MEMBER(wxBORDER_RAISED)
wxFLAGS_MEMBER(wxBORDER_STATIC)
wxFLAGS_MEMBER(wxBORDER_NONE)
// old style border flags
wxFLAGS_MEMBER(wxSIMPLE_BORDER)
wxFLAGS_MEMBER(wxSUNKEN_BORDER)
wxFLAGS_MEMBER(wxDOUBLE_BORDER)
wxFLAGS_MEMBER(wxRAISED_BORDER)
wxFLAGS_MEMBER(wxSTATIC_BORDER)
wxFLAGS_MEMBER(wxBORDER)
// standard window styles
wxFLAGS_MEMBER(wxTAB_TRAVERSAL)
wxFLAGS_MEMBER(wxCLIP_CHILDREN)
wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW)
wxFLAGS_MEMBER(wxWANTS_CHARS)
wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE)
wxFLAGS_MEMBER(wxALWAYS_SHOW_SB )
wxFLAGS_MEMBER(wxVSCROLL)
wxFLAGS_MEMBER(wxHSCROLL)
wxFLAGS_MEMBER(wxSL_HORIZONTAL)
wxFLAGS_MEMBER(wxSL_VERTICAL)
wxFLAGS_MEMBER(wxSL_AUTOTICKS)
wxFLAGS_MEMBER(wxSL_LABELS)
wxFLAGS_MEMBER(wxSL_LEFT)
wxFLAGS_MEMBER(wxSL_TOP)
wxFLAGS_MEMBER(wxSL_RIGHT)
wxFLAGS_MEMBER(wxSL_BOTTOM)
wxFLAGS_MEMBER(wxSL_BOTH)
wxFLAGS_MEMBER(wxSL_SELRANGE)
wxFLAGS_MEMBER(wxSL_INVERSE)
wxEND_FLAGS( wxSliderStyle )
IMPLEMENT_DYNAMIC_CLASS_XTI(wxSlider, wxControl,"wx/slider.h")
wxBEGIN_PROPERTIES_TABLE(wxSlider)
wxEVENT_RANGE_PROPERTY( Scroll , wxEVT_SCROLL_TOP , wxEVT_SCROLL_CHANGED , wxScrollEvent )
wxEVENT_PROPERTY( Updated , wxEVT_COMMAND_SLIDER_UPDATED , wxCommandEvent )
wxPROPERTY( Value , int , SetValue, GetValue , 0, 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
wxPROPERTY( Minimum , int , SetMin, GetMin, 0 , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
wxPROPERTY( Maximum , int , SetMax, GetMax, 0 , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
wxPROPERTY( PageSize , int , SetPageSize, GetLineSize, 1 , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
wxPROPERTY( LineSize , int , SetLineSize, GetLineSize, 1 , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
wxPROPERTY( ThumbLength , int , SetThumbLength, GetThumbLength, 1 , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
wxPROPERTY_FLAGS( WindowStyle , wxSliderStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style
wxEND_PROPERTIES_TABLE()
wxBEGIN_HANDLERS_TABLE(wxSlider)
wxEND_HANDLERS_TABLE()
wxCONSTRUCTOR_8( wxSlider , wxWindow* , Parent , wxWindowID , Id , int , Value , int , Minimum , int , Maximum , wxPoint , Position , wxSize , Size , long , WindowStyle )
#else
IMPLEMENT_DYNAMIC_CLASS(wxSlider, wxControl)
#endif
// ============================================================================
// wxSlider implementation
// ============================================================================
// ----------------------------------------------------------------------------
// construction
// ----------------------------------------------------------------------------
void wxSlider::Init()
{
m_labels = NULL;
m_pageSize = 1;
m_lineSize = 1;
m_rangeMax = 0;
m_rangeMin = 0;
m_tickFreq = 0;
m_isDragging = false;
}
bool
wxSlider::Create(wxWindow *parent,
wxWindowID id,
int value,
int minValue,
int maxValue,
const wxPoint& pos,
const wxSize& size,
long style,
const wxValidator& validator,
const wxString& name)
{
// our styles are redundant: wxSL_LEFT/RIGHT imply wxSL_VERTICAL and
// wxSL_TOP/BOTTOM imply wxSL_HORIZONTAL, but for backwards compatibility
// reasons we can't really change it, instead try to infer the orientation
// from the flags given to us here
switch ( style & (wxSL_LEFT | wxSL_RIGHT | wxSL_TOP | wxSL_BOTTOM) )
{
case wxSL_LEFT:
case wxSL_RIGHT:
style |= wxSL_VERTICAL;
break;
case wxSL_TOP:
case wxSL_BOTTOM:
style |= wxSL_HORIZONTAL;
break;
case 0:
// no specific direction, do we have at least the orientation?
if ( !(style & (wxSL_HORIZONTAL | wxSL_VERTICAL)) )
{
// no, choose default
style |= wxSL_BOTTOM | wxSL_HORIZONTAL;
}
};
wxASSERT_MSG( !(style & wxSL_VERTICAL) || !(style & wxSL_HORIZONTAL),
_T("incompatible slider direction and orientation") );
// initialize everything
if ( !CreateControl(parent, id, pos, size, style, validator, name) )
return false;
// ensure that we have correct values for GetLabelsSize()
m_rangeMin = minValue;
m_rangeMax = maxValue;
// create the labels first, so that our DoGetBestSize() could take them
// into account
//
// note that we could simply create 3 wxStaticTexts here but it could
// result in some observable side effects at wx level (e.g. the parent of
// wxSlider would have 3 more children than expected) and so we prefer not
// to do it like this
if ( m_windowStyle & wxSL_LABELS )
{
m_labels = new wxSubwindows(SliderLabel_Last);
HWND hwndParent = GetHwndOf(parent);
for ( size_t n = 0; n < SliderLabel_Last; n++ )
{
(*m_labels)[n] = ::CreateWindow
(
wxT("STATIC"),
NULL,
WS_CHILD | WS_VISIBLE | SS_CENTER,
0, 0, 0, 0,
hwndParent,
(HMENU)NewControlId(),
wxGetInstance(),
NULL
);
}
m_labels->SetFont(GetFont());
}
// now create the main control too
if ( !MSWCreateControl(TRACKBAR_CLASS, wxEmptyString, pos, size) )
return false;
// and initialize everything
SetRange(minValue, maxValue);
SetValue(value);
SetPageSize((maxValue - minValue)/10);
// we need to position the labels correctly if we have them and if
// SetSize() hadn't been called before (when best size was determined by
// MSWCreateControl()) as in this case they haven't been put in place yet
if ( m_labels && size.x != wxDefaultCoord && size.y != wxDefaultCoord )
{
SetSize(size);
}
return true;
}
WXDWORD wxSlider::MSWGetStyle(long style, WXDWORD *exstyle) const
{
WXDWORD msStyle = wxControl::MSWGetStyle(style, exstyle);
// TBS_HORZ, TBS_RIGHT and TBS_BOTTOM are 0 but do include them for clarity
msStyle |= style & wxSL_VERTICAL ? TBS_VERT : TBS_HORZ;
if ( style & wxSL_BOTH )
{
// this fully specifies the style combined with TBS_VERT/HORZ above
msStyle |= TBS_BOTH;
}
else // choose one direction
{
if ( style & wxSL_LEFT )
msStyle |= TBS_LEFT;
else if ( style & wxSL_RIGHT )
msStyle |= TBS_RIGHT;
else if ( style & wxSL_TOP )
msStyle |= TBS_TOP;
else if ( style & wxSL_BOTTOM )
msStyle |= TBS_BOTTOM;
}
if ( style & wxSL_AUTOTICKS )
msStyle |= TBS_AUTOTICKS;
else
msStyle |= TBS_NOTICKS;
if ( style & wxSL_SELRANGE )
msStyle |= TBS_ENABLESELRANGE;
return msStyle;
}
wxSlider::~wxSlider()
{
delete m_labels;
}
// ----------------------------------------------------------------------------
// event handling
// ----------------------------------------------------------------------------
bool wxSlider::MSWOnScroll(int WXUNUSED(orientation),
WXWORD wParam,
WXWORD WXUNUSED(pos),
WXHWND control)
{
wxEventType scrollEvent;
switch ( wParam )
{
case SB_TOP:
scrollEvent = wxEVT_SCROLL_TOP;
break;
case SB_BOTTOM:
scrollEvent = wxEVT_SCROLL_BOTTOM;
break;
case SB_LINEUP:
scrollEvent = wxEVT_SCROLL_LINEUP;
break;
case SB_LINEDOWN:
scrollEvent = wxEVT_SCROLL_LINEDOWN;
break;
case SB_PAGEUP:
scrollEvent = wxEVT_SCROLL_PAGEUP;
break;
case SB_PAGEDOWN:
scrollEvent = wxEVT_SCROLL_PAGEDOWN;
break;
case SB_THUMBTRACK:
scrollEvent = wxEVT_SCROLL_THUMBTRACK;
m_isDragging = true;
break;
case SB_THUMBPOSITION:
if ( m_isDragging )
{
scrollEvent = wxEVT_SCROLL_THUMBRELEASE;
m_isDragging = false;
}
else
{
// this seems to only happen when the mouse wheel is used: in
// this case, as it might be unexpected to get THUMBRELEASE
// without preceding THUMBTRACKs, we don't generate it at all
// but generate CHANGED event because the control itself does
// not send us SB_ENDSCROLL for whatever reason when mouse
// wheel is used
scrollEvent = wxEVT_SCROLL_CHANGED;
}
break;
case SB_ENDSCROLL:
scrollEvent = wxEVT_SCROLL_CHANGED;
break;
default:
// unknown scroll event?
return false;
}
int newPos = ValueInvertOrNot((int) ::SendMessage((HWND) control, TBM_GETPOS, 0, 0));
if ( (newPos < GetMin()) || (newPos > GetMax()) )
{
// out of range - but we did process it
return true;
}
SetValue(newPos);
wxScrollEvent event(scrollEvent, m_windowId);
event.SetPosition(newPos);
event.SetEventObject( this );
GetEventHandler()->ProcessEvent(event);
wxCommandEvent cevent( wxEVT_COMMAND_SLIDER_UPDATED, GetId() );
cevent.SetInt( newPos );
cevent.SetEventObject( this );
return GetEventHandler()->ProcessEvent( cevent );
}
void wxSlider::Command (wxCommandEvent & event)
{
SetValue (event.GetInt());
ProcessCommand (event);
}
// ----------------------------------------------------------------------------
// geometry stuff
// ----------------------------------------------------------------------------
wxRect wxSlider::GetBoundingBox() const
{
// take care not to call our own functions which would call us recursively
int x, y, w, h;
wxSliderBase::DoGetPosition(&x, &y);
wxSliderBase::DoGetSize(&w, &h);
wxRect rect(x, y, w, h);
if ( m_labels )
{
wxRect lrect = m_labels->GetBoundingBox();
GetParent()->ScreenToClient(&lrect.x, &lrect.y);
rect.Union(lrect);
}
return rect;
}
void wxSlider::DoGetSize(int *width, int *height) const
{
wxRect rect = GetBoundingBox();
if ( width )
*width = rect.width;
if ( height )
*height = rect.height;
}
void wxSlider::DoGetPosition(int *x, int *y) const
{
wxRect rect = GetBoundingBox();
if ( x )
*x = rect.x;
if ( y )
*y = rect.y;
}
int wxSlider::GetLabelsSize(int *width) const
{
int cy;
if ( width )
{
// find the max label width
int wLabelMin, wLabelMax;
GetTextExtent(Format(m_rangeMin), &wLabelMin, &cy);
GetTextExtent(Format(m_rangeMax), &wLabelMax, &cy);
*width = wxMax(wLabelMin, wLabelMax);
}
else
{
cy = GetCharHeight();
}
return EDIT_HEIGHT_FROM_CHAR_HEIGHT(cy);
}
void wxSlider::DoMoveWindow(int x, int y, int width, int height)
{
// all complications below are because we need to position the labels,
// without them everything is easy
if ( !m_labels )
{
wxSliderBase::DoMoveWindow(x, y, width, height);
return;
}
// be careful to position the slider itself after moving the labels as
// otherwise our GetBoundingBox(), which is called from WM_SIZE handler,
// would return a wrong result and wrong size would be cached internally
if ( HasFlag(wxSL_VERTICAL) )
{
int wLabel;
int hLabel = GetLabelsSize(&wLabel);
int xLabel = HasFlag(wxSL_LEFT) ? x + width - wLabel : x;
// position all labels: min at the top, value in the middle and max at
// the bottom
DoMoveSibling((HWND)(*m_labels)[SliderLabel_Min],
xLabel, y, wLabel, hLabel);
DoMoveSibling((HWND)(*m_labels)[SliderLabel_Value],
xLabel, y + (height - hLabel)/2, wLabel, hLabel);
DoMoveSibling((HWND)(*m_labels)[SliderLabel_Max],
xLabel, y + height - hLabel, wLabel, hLabel);
// position the slider itself along the left/right edge
wxSliderBase::DoMoveWindow(HasFlag(wxSL_LEFT) ? x : x + wLabel + HGAP,
y + hLabel/2,
width - wLabel - HGAP,
height - hLabel);
}
else // horizontal
{
int wLabel;
int hLabel = GetLabelsSize(&wLabel);
int yLabel = HasFlag(wxSL_TOP) ? y + height - hLabel : y;
// position all labels: min on the left, value in the middle and max to
// the right
DoMoveSibling((HWND)(*m_labels)[SliderLabel_Min],
x, yLabel, wLabel, hLabel);
DoMoveSibling((HWND)(*m_labels)[SliderLabel_Value],
x + (width - wLabel)/2, yLabel, wLabel, hLabel);
DoMoveSibling((HWND)(*m_labels)[SliderLabel_Max],
x + width - wLabel, yLabel, wLabel, hLabel);
// position the slider itself along the top/bottom edge
wxSliderBase::DoMoveWindow(x,
HasFlag(wxSL_TOP) ? y : y + hLabel,
width,
height - hLabel);
}
}
wxSize wxSlider::DoGetBestSize() const
{
// these values are arbitrary
static const int length = 100;
static const int thumb = 24;
static const int ticks = 8;
int *width;
wxSize size;
if ( HasFlag(wxSL_VERTICAL) )
{
size.x = thumb;
size.y = length;
width = &size.x;
if ( m_labels )
{
int wLabel;
int hLabel = GetLabelsSize(&wLabel);
// account for the labels
size.x += HGAP + wLabel;
// labels are indented relative to the slider itself
size.y += hLabel;
}
}
else // horizontal
{
size.x = length;
size.y = thumb;
width = &size.y;
if ( m_labels )
{
// labels add extra height
size.y += GetLabelsSize();
}
}
// need extra space to show ticks
if ( HasFlag(wxSL_TICKS) )
{
*width += ticks;
// and maybe twice as much if we show them on both sides
if ( HasFlag(wxSL_BOTH) )
*width += ticks;
}
return size;
}
// ----------------------------------------------------------------------------
// slider-specific methods
// ----------------------------------------------------------------------------
int wxSlider::GetValue() const
{
return ValueInvertOrNot(::SendMessage(GetHwnd(), TBM_GETPOS, 0, 0));
}
void wxSlider::SetValue(int value)
{
::SendMessage(GetHwnd(), TBM_SETPOS, (WPARAM)TRUE, (LPARAM)ValueInvertOrNot(value));
if ( m_labels )
{
::SetWindowText((*m_labels)[SliderLabel_Value], Format(value));
}
}
void wxSlider::SetRange(int minValue, int maxValue)
{
m_rangeMin = minValue;
m_rangeMax = maxValue;
::SendMessage(GetHwnd(), TBM_SETRANGEMIN, TRUE, m_rangeMin);
::SendMessage(GetHwnd(), TBM_SETRANGEMAX, TRUE, m_rangeMax);
if ( m_labels )
{
::SetWindowText((*m_labels)[SliderLabel_Min], Format(ValueInvertOrNot(m_rangeMin)));
::SetWindowText((*m_labels)[SliderLabel_Max], Format(ValueInvertOrNot(m_rangeMax)));
}
}
void wxSlider::SetTickFreq(int n, int pos)
{
m_tickFreq = n;
::SendMessage( GetHwnd(), TBM_SETTICFREQ, (WPARAM) n, (LPARAM) pos );
}
void wxSlider::SetPageSize(int pageSize)
{
::SendMessage( GetHwnd(), TBM_SETPAGESIZE, (WPARAM) 0, (LPARAM) pageSize );
m_pageSize = pageSize;
}
int wxSlider::GetPageSize() const
{
return m_pageSize;
}
void wxSlider::ClearSel()
{
::SendMessage(GetHwnd(), TBM_CLEARSEL, (WPARAM) TRUE, (LPARAM) 0);
}
void wxSlider::ClearTicks()
{
::SendMessage(GetHwnd(), TBM_CLEARTICS, (WPARAM) TRUE, (LPARAM) 0);
}
void wxSlider::SetLineSize(int lineSize)
{
m_lineSize = lineSize;
::SendMessage(GetHwnd(), TBM_SETLINESIZE, (WPARAM) 0, (LPARAM) lineSize);
}
int wxSlider::GetLineSize() const
{
return (int)::SendMessage(GetHwnd(), TBM_GETLINESIZE, 0, 0);
}
int wxSlider::GetSelEnd() const
{
return (int)::SendMessage(GetHwnd(), TBM_GETSELEND, 0, 0);
}
int wxSlider::GetSelStart() const
{
return (int)::SendMessage(GetHwnd(), TBM_GETSELSTART, 0, 0);
}
void wxSlider::SetSelection(int minPos, int maxPos)
{
::SendMessage(GetHwnd(), TBM_SETSEL,
(WPARAM) TRUE /* redraw */,
(LPARAM) MAKELONG( minPos, maxPos) );
}
void wxSlider::SetThumbLength(int len)
{
::SendMessage(GetHwnd(), TBM_SETTHUMBLENGTH, (WPARAM) len, (LPARAM) 0);
}
int wxSlider::GetThumbLength() const
{
return (int)::SendMessage( GetHwnd(), TBM_GETTHUMBLENGTH, 0, 0);
}
void wxSlider::SetTick(int tickPos)
{
::SendMessage( GetHwnd(), TBM_SETTIC, (WPARAM) 0, (LPARAM) tickPos );
}
// ----------------------------------------------------------------------------
// composite control methods
// ----------------------------------------------------------------------------
WXHWND wxSlider::GetStaticMin() const
{
return m_labels ? (WXHWND)(*m_labels)[SliderLabel_Min] : NULL;
}
WXHWND wxSlider::GetStaticMax() const
{
return m_labels ? (WXHWND)(*m_labels)[SliderLabel_Max] : NULL;
}
WXHWND wxSlider::GetEditValue() const
{
return m_labels ? (WXHWND)(*m_labels)[SliderLabel_Value] : NULL;
}
WX_FORWARD_STD_METHODS_TO_SUBWINDOWS(wxSlider, wxSliderBase, m_labels)
#endif // wxUSE_SLIDER

View File

@ -0,0 +1,417 @@
///////////////////////////////////////////////////////////////////////////////
// Name: src/msw/statbr95.cpp
// Purpose: native implementation of wxStatusBar
// Author: Vadim Zeitlin
// Modified by:
// Created: 04.04.98
// RCS-ID: $Id: statbr95.cpp 48670 2007-09-14 07:15:51Z JS $
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
// for compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#if wxUSE_STATUSBAR && wxUSE_NATIVE_STATUSBAR
#include "wx/statusbr.h"
#ifndef WX_PRECOMP
#include "wx/msw/wrapcctl.h" // include <commctrl.h> "properly"
#include "wx/frame.h"
#include "wx/settings.h"
#include "wx/dcclient.h"
#include "wx/intl.h"
#include "wx/log.h"
#endif
#include "wx/msw/private.h"
#include <windowsx.h>
#if wxUSE_UXTHEME
#include "wx/msw/uxtheme.h"
#endif
// ----------------------------------------------------------------------------
// macros
// ----------------------------------------------------------------------------
// windowsx.h and commctrl.h don't define those, so we do it here
#define StatusBar_SetParts(h, n, w) SendMessage(h, SB_SETPARTS, (WPARAM)n, (LPARAM)w)
#define StatusBar_SetText(h, n, t) SendMessage(h, SB_SETTEXT, (WPARAM)n, (LPARAM)(LPCTSTR)t)
#define StatusBar_GetTextLen(h, n) LOWORD(SendMessage(h, SB_GETTEXTLENGTH, (WPARAM)n, 0))
#define StatusBar_GetText(h, n, s) LOWORD(SendMessage(h, SB_GETTEXT, (WPARAM)n, (LPARAM)(LPTSTR)s))
// ============================================================================
// implementation
// ============================================================================
// ----------------------------------------------------------------------------
// wxStatusBar95 class
// ----------------------------------------------------------------------------
wxStatusBar95::wxStatusBar95()
{
SetParent(NULL);
m_hWnd = 0;
m_windowId = 0;
}
bool wxStatusBar95::Create(wxWindow *parent,
wxWindowID id,
long style,
const wxString& name)
{
wxCHECK_MSG( parent, false, wxT("status bar must have a parent") );
// Avoid giving the status bar a themed window
style = (style & ~wxBORDER_MASK) | wxBORDER_NONE;
SetName(name);
SetWindowStyleFlag(style);
SetParent(parent);
parent->AddChild(this);
m_windowId = id == wxID_ANY ? NewControlId() : id;
DWORD wstyle = WS_CHILD | WS_VISIBLE;
if ( style & wxCLIP_SIBLINGS )
wstyle |= WS_CLIPSIBLINGS;
// setting SBARS_SIZEGRIP is perfectly useless: it's always on by default
// (at least in the version of comctl32.dll I'm using), and the only way to
// turn it off is to use CCS_TOP style - as we position the status bar
// manually anyhow (see DoMoveWindow), use CCS_TOP style if wxST_SIZEGRIP
// is not given
if ( !(style & wxST_SIZEGRIP) )
{
wstyle |= CCS_TOP;
}
else
{
#ifndef __WXWINCE__
// may be some versions of comctl32.dll do need it - anyhow, it won't
// do any harm
wstyle |= SBARS_SIZEGRIP;
#endif
}
m_hWnd = (WXHWND)CreateStatusWindow(wstyle,
wxEmptyString,
GetHwndOf(parent),
m_windowId);
if ( m_hWnd == 0 )
{
wxLogSysError(_("Failed to create a status bar."));
return false;
}
SetFieldsCount(1);
SubclassWin(m_hWnd);
InheritAttributes();
SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_MENUBAR));
// we must refresh the frame size when the statusbar is created, because
// its client area might change
wxFrame *frame = wxDynamicCast(GetParent(), wxFrame);
if ( frame )
{
frame->SendSizeEvent();
}
return true;
}
wxStatusBar95::~wxStatusBar95()
{
// we must refresh the frame size when the statusbar is deleted but the
// frame is not - otherwise statusbar leaves a hole in the place it used to
// occupy
wxFrame *frame = wxDynamicCast(GetParent(), wxFrame);
if ( frame && !frame->IsBeingDeleted() )
{
frame->SendSizeEvent();
}
}
void wxStatusBar95::SetFieldsCount(int nFields, const int *widths)
{
// this is a Windows limitation
wxASSERT_MSG( (nFields > 0) && (nFields < 255), _T("too many fields") );
wxStatusBarBase::SetFieldsCount(nFields, widths);
SetFieldsWidth();
}
void wxStatusBar95::SetStatusWidths(int n, const int widths[])
{
wxStatusBarBase::SetStatusWidths(n, widths);
SetFieldsWidth();
}
void wxStatusBar95::SetFieldsWidth()
{
if ( !m_nFields )
return;
int aBorders[3];
SendMessage(GetHwnd(), SB_GETBORDERS, 0, (LPARAM)aBorders);
int extraWidth = aBorders[2]; // space between fields
wxArrayInt widthsAbs =
CalculateAbsWidths(GetClientSize().x - extraWidth*(m_nFields - 1));
int *pWidths = new int[m_nFields];
int nCurPos = 0;
for ( int i = 0; i < m_nFields; i++ ) {
nCurPos += widthsAbs[i] + extraWidth;
pWidths[i] = nCurPos;
}
if ( !StatusBar_SetParts(GetHwnd(), m_nFields, pWidths) ) {
wxLogLastError(wxT("StatusBar_SetParts"));
}
delete [] pWidths;
}
void wxStatusBar95::SetStatusText(const wxString& strText, int nField)
{
wxCHECK_RET( (nField >= 0) && (nField < m_nFields),
_T("invalid statusbar field index") );
if ( strText == GetStatusText(nField) )
{
// don't call StatusBar_SetText() to avoid flicker
return;
}
// Get field style, if any
int style;
if (m_statusStyles)
{
switch(m_statusStyles[nField])
{
case wxSB_RAISED:
style = SBT_POPOUT;
break;
case wxSB_FLAT:
style = SBT_NOBORDERS;
break;
case wxSB_NORMAL:
default:
style = 0;
break;
}
}
else
style = 0;
// Pass both field number and style. MSDN library doesn't mention
// that nField and style have to be 'ORed'
if ( !StatusBar_SetText(GetHwnd(), nField | style, strText) )
{
wxLogLastError(wxT("StatusBar_SetText"));
}
}
wxString wxStatusBar95::GetStatusText(int nField) const
{
wxCHECK_MSG( (nField >= 0) && (nField < m_nFields), wxEmptyString,
_T("invalid statusbar field index") );
wxString str;
int len = StatusBar_GetTextLen(GetHwnd(), nField);
if ( len > 0 )
{
StatusBar_GetText(GetHwnd(), nField, wxStringBuffer(str, len));
}
return str;
}
int wxStatusBar95::GetBorderX() const
{
int aBorders[3];
SendMessage(GetHwnd(), SB_GETBORDERS, 0, (LPARAM)aBorders);
return aBorders[0];
}
int wxStatusBar95::GetBorderY() const
{
int aBorders[3];
SendMessage(GetHwnd(), SB_GETBORDERS, 0, (LPARAM)aBorders);
return aBorders[1];
}
void wxStatusBar95::SetMinHeight(int height)
{
SendMessage(GetHwnd(), SB_SETMINHEIGHT, height + 2*GetBorderY(), 0);
// have to send a (dummy) WM_SIZE to redraw it now
SendMessage(GetHwnd(), WM_SIZE, 0, 0);
}
bool wxStatusBar95::GetFieldRect(int i, wxRect& rect) const
{
wxCHECK_MSG( (i >= 0) && (i < m_nFields), false,
_T("invalid statusbar field index") );
RECT r;
if ( !::SendMessage(GetHwnd(), SB_GETRECT, i, (LPARAM)&r) )
{
wxLogLastError(wxT("SendMessage(SB_GETRECT)"));
}
#if wxUSE_UXTHEME
wxUxThemeHandle theme((wxStatusBar95 *)this, L"Status"); // const_cast
if ( theme )
{
// by default Windows has a 2 pixel border to the right of the left
// divider (or it could be a bug) but it looks wrong so remove it
if ( i != 0 )
{
r.left -= 2;
}
wxUxThemeEngine::Get()->GetThemeBackgroundContentRect(theme, NULL,
1 /* SP_PANE */, 0,
&r, &r);
}
#endif
wxCopyRECTToRect(r, rect);
return true;
}
void wxStatusBar95::DoMoveWindow(int x, int y, int width, int height)
{
if ( GetParent()->IsSizeDeferred() )
{
wxWindowMSW::DoMoveWindow(x, y, width, height);
}
else
{
// parent pos/size isn't deferred so do it now but don't send
// WM_WINDOWPOSCHANGING since we don't want to change pos/size later
// we must use SWP_NOCOPYBITS here otherwise it paints incorrectly
// if other windows are size deferred
::SetWindowPos(GetHwnd(), NULL, x, y, width, height,
SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOACTIVATE
#ifndef __WXWINCE__
| SWP_NOCOPYBITS | SWP_NOSENDCHANGING
#endif
);
}
// adjust fields widths to the new size
SetFieldsWidth();
// we have to trigger wxSizeEvent if there are children window in status
// bar because GetFieldRect returned incorrect (not updated) values up to
// here, which almost certainly resulted in incorrectly redrawn statusbar
if ( m_children.GetCount() > 0 )
{
wxSizeEvent event(GetClientSize(), m_windowId);
event.SetEventObject(this);
GetEventHandler()->ProcessEvent(event);
}
}
void wxStatusBar95::SetStatusStyles(int n, const int styles[])
{
wxStatusBarBase::SetStatusStyles(n, styles);
if (n != m_nFields)
return;
for (int i = 0; i < n; i++)
{
int style;
switch(styles[i])
{
case wxSB_RAISED:
style = SBT_POPOUT;
break;
case wxSB_FLAT:
style = SBT_NOBORDERS;
break;
case wxSB_NORMAL:
default:
style = 0;
break;
}
// The SB_SETTEXT message is both used to set the field's text as well as
// the fields' styles. MSDN library doesn't mention
// that nField and style have to be 'ORed'
wxString text = GetStatusText(i);
if (!StatusBar_SetText(GetHwnd(), style | i, text))
{
wxLogLastError(wxT("StatusBar_SetText"));
}
}
}
WXLRESULT
wxStatusBar95::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
{
#ifndef __WXWINCE__
if ( nMsg == WM_WINDOWPOSCHANGING )
{
WINDOWPOS *lpPos = (WINDOWPOS *)lParam;
int x, y, w, h;
GetPosition(&x, &y);
GetSize(&w, &h);
// we need real window coords and not wx client coords
AdjustForParentClientOrigin(x, y);
lpPos->x = x;
lpPos->y = y;
lpPos->cx = w;
lpPos->cy = h;
return 0;
}
if ( nMsg == WM_NCLBUTTONDOWN )
{
// if hit-test is on gripper then send message to TLW to begin
// resizing. It is possible to send this message to any window.
if ( wParam == HTBOTTOMRIGHT )
{
wxWindow *win;
for ( win = GetParent(); win; win = win->GetParent() )
{
if ( win->IsTopLevel() )
{
SendMessage(GetHwndOf(win), WM_NCLBUTTONDOWN,
wParam, lParam);
return 0;
}
}
}
}
#endif
return wxStatusBarBase::MSWWindowProc(nMsg, wParam, lParam);
}
#endif // wxUSE_STATUSBAR && wxUSE_NATIVE_STATUSBAR

View File

@ -25,7 +25,6 @@
# define DYNAMIC_CRC_TABLE
# endif /* !DYNAMIC_CRC_TABLE */
#endif /* MAKECRCH */
#include "zutil.h" /* for STDC and FAR definitions */
#define local static

View File

@ -196,7 +196,7 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
# endif
# ifdef WIN32
/* In Win32, vsnprintf is available as the "non-ANSI" _vsnprintf. */
# if !defined(vsnprintf) && !defined(NO_vsnprintf)
# if !defined(vsnprintf) && !defined(NO_vsnprintf) && defined(_MSC_VER) && _MSC_VER > 1500
# define vsnprintf _vsnprintf
# endif
# endif

View File

@ -41,6 +41,7 @@
PreprocessorDefinitions="_LIB;__WXMSW__;WXBUILDING;wxUSE_GUI=0;wxUSE_BASE=1"
PrecompiledHeaderThrough="wx/wxprec.h"
DisableSpecificWarnings="4005"
UndefinePreprocessorDefinitions="WIN32_LEAN_AND_MEAN"
/>
<Tool
Name="VCManagedResourceCompilerTool"
@ -53,7 +54,7 @@
/>
<Tool
Name="VCLibrarianTool"
OutputFile="$(OutDir)\lib\wxbase29d.lib"
OutputFile="$(OutDir)\lib\wxbase28d.lib"
/>
<Tool
Name="VCALinkTool"
@ -134,10 +135,6 @@
<Filter
Name="Common Sources"
>
<File
RelativePath="src\common\any.cpp"
>
</File>
<File
RelativePath="src\common\appbase.cpp"
>
@ -154,14 +151,6 @@
RelativePath="src\common\archive.cpp"
>
</File>
<File
RelativePath="src\common\arrstr.cpp"
>
</File>
<File
RelativePath="src\common\base64.cpp"
>
</File>
<File
RelativePath="src\common\clntdata.cpp"
>
@ -179,11 +168,11 @@
>
</File>
<File
RelativePath="src\common\datetime.cpp"
RelativePath=".\src\common\datacmn.cpp"
>
</File>
<File
RelativePath="src\common\datetimefmt.cpp"
RelativePath="src\common\datetime.cpp"
>
</File>
<File
@ -234,10 +223,6 @@
RelativePath="src\common\event.cpp"
>
</File>
<File
RelativePath="src\common\evtloopcmn.cpp"
>
</File>
<File
RelativePath="src\common\extended.c"
>
@ -310,10 +295,6 @@
RelativePath="src\common\fs_mem.cpp"
>
</File>
<File
RelativePath="src\common\fswatchercmn.cpp"
>
</File>
<File
RelativePath="src\common\hash.cpp"
>
@ -334,10 +315,6 @@
RelativePath="src\common\ipcbase.cpp"
>
</File>
<File
RelativePath="src\common\languageinfo.cpp"
>
</File>
<File
RelativePath="src\common\list.cpp"
>
@ -370,10 +347,6 @@
RelativePath="src\common\mstream.cpp"
>
</File>
<File
RelativePath="src\common\numformatter.cpp"
>
</File>
<File
RelativePath="src\common\object.cpp"
>
@ -402,10 +375,6 @@
RelativePath="src\common\stdpbase.cpp"
>
</File>
<File
RelativePath="src\common\stdstream.cpp"
>
</File>
<File
RelativePath="src\common\stopwatch.cpp"
>
@ -422,18 +391,6 @@
RelativePath="src\common\string.cpp"
>
</File>
<File
RelativePath="src\common\stringimpl.cpp"
>
</File>
<File
RelativePath="src\common\stringops.cpp"
>
</File>
<File
RelativePath="src\common\strvararg.cpp"
>
</File>
<File
RelativePath="src\common\sysopt.cpp"
>
@ -450,42 +407,18 @@
RelativePath="src\common\textfile.cpp"
>
</File>
<File
RelativePath="src\common\time.cpp"
>
</File>
<File
RelativePath="src\common\timercmn.cpp"
>
</File>
<File
RelativePath="src\common\timerimpl.cpp"
>
</File>
<File
RelativePath="src\common\tokenzr.cpp"
>
</File>
<File
RelativePath="src\common\translation.cpp"
>
</File>
<File
RelativePath="src\common\txtstrm.cpp"
>
</File>
<File
RelativePath="src\common\unichar.cpp"
>
</File>
<File
RelativePath="src\common\uri.cpp"
>
</File>
<File
RelativePath="src\common\ustring.cpp"
>
</File>
<File
RelativePath="src\common\utilscmn.cpp"
>
@ -499,15 +432,7 @@
>
</File>
<File
RelativePath="src\common\wxcrt.cpp"
>
</File>
<File
RelativePath="src\common\wxprintf.cpp"
>
</File>
<File
RelativePath="src\common\xlocale.cpp"
RelativePath=".\src\common\wxchar.cpp"
>
</File>
<File
@ -554,14 +479,6 @@
RelativePath="src\msw\dlmsw.cpp"
>
</File>
<File
RelativePath="src\msw\evtloop.cpp"
>
</File>
<File
RelativePath="src\msw\fswatcher.cpp"
>
</File>
<File
RelativePath="src\msw\main.cpp"
>
@ -602,10 +519,6 @@
RelativePath="src\msw\thread.cpp"
>
</File>
<File
RelativePath="src\msw\timer.cpp"
>
</File>
<File
RelativePath="src\msw\utils.cpp"
>
@ -660,10 +573,6 @@
<Filter
Name="Generic Sources"
>
<File
RelativePath="src\generic\fswatcherg.cpp"
>
</File>
</Filter>
<Filter
Name="Setup Headers"

View File

@ -53,7 +53,8 @@
/>
<Tool
Name="VCLibrarianTool"
OutputFile="$(OutDir)\lib\wxmsw29d_core.lib"
AdditionalDependencies="Comctl32.lib"
OutputFile="$(OutDir)\lib\wxmsw28d_core.lib"
/>
<Tool
Name="VCALinkTool"
@ -930,6 +931,10 @@
RelativePath="src\msw\settings.cpp"
>
</File>
<File
RelativePath=".\src\msw\slider95.cpp"
>
</File>
<File
RelativePath="src\msw\spinbutt.cpp"
>
@ -1244,6 +1249,10 @@
RelativePath="src\generic\numdlgg.cpp"
>
</File>
<File
RelativePath=".\src\generic\panelg.cpp"
>
</File>
<File
RelativePath="src\generic\printps.cpp"
>
@ -3729,11 +3738,11 @@
>
</File>
<File
RelativePath="include\wx\splitter.h"
RelativePath="include\wx\persist\splitter.h"
>
</File>
<File
RelativePath="include\wx\persist\splitter.h"
RelativePath="include\wx\splitter.h"
>
</File>
<File
@ -3817,11 +3826,11 @@
>
</File>
<File
RelativePath="include\wx\toolbar.h"
RelativePath="include\wx\ribbon\toolbar.h"
>
</File>
<File
RelativePath="include\wx\ribbon\toolbar.h"
RelativePath="include\wx\toolbar.h"
>
</File>
<File
@ -3833,11 +3842,11 @@
>
</File>
<File
RelativePath="include\wx\toplevel.h"
RelativePath="include\wx\persist\toplevel.h"
>
</File>
<File
RelativePath="include\wx\persist\toplevel.h"
RelativePath="include\wx\toplevel.h"
>
</File>
<File
@ -3845,11 +3854,11 @@
>
</File>
<File
RelativePath="include\wx\treebook.h"
RelativePath="include\wx\persist\treebook.h"
>
</File>
<File
RelativePath="include\wx\persist\treebook.h"
RelativePath="include\wx\treebook.h"
>
</File>
<File

View File

@ -53,7 +53,7 @@
<Tool
Name="VCLinkerTool"
OutputFile="$(Root)Plugin/GFX/PJ64Glide64_d.dll"
AdditionalLibraryDirectories="&quot;$(Root)Source\3rd Party\wx\lib\vc_lib&quot;"
AdditionalLibraryDirectories=""
/>
<Tool
Name="VCALinkTool"

View File

@ -37,7 +37,7 @@
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;$(Root)Source/3rd Party/wx/include/msvc&quot;;&quot;$(Root)Source/3rd Party/wx/include&quot;;&quot;$(Root)Source/3rd Party/wx/src&quot;"
AdditionalIncludeDirectories="&quot;$(Root)Source/3rd Party/wx/include/msvc&quot;;&quot;$(Root)Source/3rd Party/wx/include&quot;;&quot;$(Root)Source/3rd Party/wx/src/zlib&quot;;&quot;$(Root)Source/3rd Party/wx/src&quot;"
UsePrecompiledHeader="0"
WarningLevel="3"
/>

View File

@ -133,7 +133,7 @@ TxImage::readPNG(FILE* fp, int* width, int* height, uint16* format)
/* expand 1,2,4 bit gray scale to 8 bit gray scale */
if (color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8)
png_set_expand_gray_1_2_4_to_8(png_ptr);
png_set_expand(png_ptr);
/* convert gray scale or gray scale + alpha to rgb color */
if (color_type == PNG_COLOR_TYPE_GRAY ||