Fixed const problems in status bar code, changed panelg.cpp temporarily to

stop infinite loop, added notebook.cpp in wxMSW makefiles. Fixed #pragma
in utilscmn.cpp YET again.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@216 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart 1998-07-10 10:39:48 +00:00
parent 447daba1ce
commit 8b9518ee4a
14 changed files with 39 additions and 26 deletions

View File

@ -91,7 +91,7 @@ public:
virtual void SetStatusText(const wxString& text, int number = 0);
// Set status line widths
virtual void SetStatusWidths(int n, int *widths_field);
virtual void SetStatusWidths(int n, const int widths_field[]);
// Hint to tell framework which status bar to use
// TODO: should this go into a wxFrameworkSettings class perhaps?

View File

@ -31,14 +31,14 @@ public:
bool Create(wxWindow *parent, wxWindowID id = -1, long style = wxST_SIZEGRIP);
// a status line can have several (<256) fields numbered from 0
virtual void SetFieldsCount(int number = 1, int *widths = NULL);
virtual void SetFieldsCount(int number = 1, const int widths[] = NULL);
// each field of status line has it's own text
virtual void SetStatusText(const wxString& text, int number = 0);
virtual wxString GetStatusText(int number = 0) const;
// set status line fields' widths
virtual void SetStatusWidths(int n, int *widths_field);
virtual void SetStatusWidths(int n, const int widths_field[]);
// we're going to process WM_SIZE (of the parent window)
void OnSize(wxSizeEvent& event);
@ -46,7 +46,7 @@ public:
DECLARE_EVENT_TABLE()
protected:
void CopyFieldsWidth(int *widths);
void CopyFieldsWidth(const int widths[]);
void SetFieldsWidth();
};

View File

@ -215,7 +215,7 @@ void wxPrintData::ConvertToNative(void)
pd->Flags = PD_RETURNDC ;
// pd->lStructSize = sizeof( PRINTDLG );
pd->lStructSize = 66 ;
pd->hwndOwner=(HANDLE)NULL;
pd->hwndOwner=(HWND)NULL;
pd->hDevNames=(HANDLE)NULL;
pd->hInstance=(HINSTANCE)NULL;
pd->lCustData = (LPARAM) NULL;

View File

@ -10,7 +10,7 @@
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
#pragma implementation "utils.h"
#pragma implementation "utilscmn.h"
#endif
// For compilers that support precompilation, includes "wx.h".

View File

@ -112,6 +112,9 @@ void wxPanel::OnNavigationKey(wxNavigationKeyEvent& event)
// set focus to the next child which accepts it (or first/last if node == NULL)
bool wxPanel::SetFocusToNextChild(wxNode *node, bool bForward)
{
// Added by JACS since this seems to cause an infinite loop.
return FALSE;
// @@ using typed list would be better...
#define WIN(node) ((wxWindow *)(node->Data()))

View File

@ -94,7 +94,7 @@ bool wxStatusBar::Create(wxWindow *parent, wxWindowID id,
return success;
}
void wxStatusBar::SetFieldsCount(int number, const int *widths)
void wxStatusBar::SetFieldsCount(int number, const int widths[])
{
m_nFields = number;
@ -138,7 +138,7 @@ wxString wxStatusBar::GetStatusText(int n) const
return m_statusStrings[n];
}
void wxStatusBar::SetStatusWidths(int n, const int *widths_field)
void wxStatusBar::SetStatusWidths(int n, const int widths_field[])
{
// only set status widths, when n == number of statuswindows
if (n == m_nFields)

View File

@ -510,7 +510,7 @@ void wxDC::DrawRectangle(long x, long y, long width, long height)
HPEN orig_pen = NULL;
if (do_pen || !m_pen.Ok())
orig_pen = ::SelectObject((HDC) m_hDC, ::GetStockObject(NULL_PEN));
orig_pen = (HPEN) ::SelectObject((HDC) m_hDC, (HPEN) ::GetStockObject(NULL_PEN));
(void)Rectangle((HDC) m_hDC, XLOG2DEV(x), YLOG2DEV(y),
XLOG2DEV(x2) + 1, YLOG2DEV(y2) + 1);
@ -522,7 +522,7 @@ void wxDC::DrawRectangle(long x, long y, long width, long height)
HBRUSH orig_brush = NULL;
if (do_brush || !m_brush.Ok())
orig_brush = ::SelectObject((HDC) m_hDC, ::GetStockObject(NULL_BRUSH));
orig_brush = (HBRUSH) ::SelectObject((HDC) m_hDC, (HBRUSH) ::GetStockObject(NULL_BRUSH));
(void)Rectangle((HDC) m_hDC, XLOG2DEV(x), YLOG2DEV(y),
XLOG2DEV(x2), YLOG2DEV(y2));
@ -592,7 +592,7 @@ void wxDC::DrawEllipticArc(long x,long y,long w,long h,double sa,double ea)
// draw pie with NULL_PEN first and then outline otherwise a line is
// drawn from the start and end points to the centre
HPEN orig_pen = ::SelectObject((HDC) m_hDC, ::GetStockObject(NULL_PEN));
HPEN orig_pen = (HPEN) ::SelectObject((HDC) m_hDC, (HPEN) ::GetStockObject(NULL_PEN));
if (m_signY > 0)
{
(void)Pie((HDC) m_hDC, XLOG2DEV(x), YLOG2DEV(y), XLOG2DEV(x2)+1, YLOG2DEV(y2)+1,
@ -702,7 +702,7 @@ void wxDC::SetBrush(const wxBrush& brush)
if (m_brush.GetResourceHandle())
{
HBRUSH b = 0;
b = ::SelectObject((HDC) m_hDC, (HBRUSH)m_brush.GetResourceHandle()) ;
b = (HBRUSH) ::SelectObject((HDC) m_hDC, (HBRUSH)m_brush.GetResourceHandle()) ;
if (!m_oldBrush)
m_oldBrush = (WXHBRUSH) b;
}
@ -716,7 +716,7 @@ void wxDC::DrawText(const wxString& text, long x, long y, bool use16bit)
#if DEBUG > 1
wxDebugMsg("wxDC::DrawText: Selecting HFONT %X\n", m_font.GetResourceHandle());
#endif
HFONT f = ::SelectObject((HDC) m_hDC, (HFONT) m_font.GetResourceHandle());
HFONT f = (HFONT) ::SelectObject((HDC) m_hDC, (HFONT) m_font.GetResourceHandle());
if (!m_oldFont)
m_oldFont = (WXHFONT) f;
}
@ -914,8 +914,8 @@ void wxDC::GetTextExtent(const wxString& string, long *x, long *y,
GetTextExtentPoint((HDC) m_hDC, (char *)(const char *) string, strlen((char *)(const char *) string), &sizeRect);
GetTextMetrics((HDC) m_hDC, &tm);
if (x) *x = XDEV2LOGREL(sizeRect.cx);
if (y) *y = YDEV2LOGREL(sizeRect.cy);
*x = XDEV2LOGREL(sizeRect.cx);
*y = YDEV2LOGREL(sizeRect.cy);
if (descent) *descent = tm.tmDescent;
if (externalLeading) *externalLeading = tm.tmExternalLeading;
}
@ -1365,3 +1365,4 @@ void wxDC::GetTextExtent(const wxString& string, float *x, float *y,
*externalLeading = externalLeading1;
}
#endif

View File

@ -390,7 +390,7 @@ void wxFrame::SetStatusText(const wxString& text, int number)
m_frameStatusBar->SetStatusText(text, number);
}
void wxFrame::SetStatusWidths(int n, int *widths_field)
void wxFrame::SetStatusWidths(int n, const int widths_field[])
{
wxCHECK_RET( m_frameStatusBar != NULL, "no statusbar to set widths for" );

View File

@ -157,6 +157,7 @@ MSWOBJS = \
$(MSWDIR)\minifram.obj \
$(MSWDIR)\msgdlg.obj \
$(MSWDIR)\nativdlg.obj \
$(MSWDIR)\notebook.obj \
$(MSWDIR)\ownerdrw.obj \
$(MSWDIR)\palette.obj \
$(MSWDIR)\pen.obj \
@ -315,6 +316,8 @@ $(MSWDIR)\msgdlg.obj: $(MSWDIR)\msgdlg.$(SRCSUFF)
$(MSWDIR)\nativdlg.obj: $(MSWDIR)\nativdlg.$(SRCSUFF)
$(MSWDIR)\notebook.obj: $(MSWDIR)\notebook.$(SRCSUFF)
$(MSWDIR)\ownerdrw.obj: $(MSWDIR)\ownerdrw.$(SRCSUFF)
$(MSWDIR)\palette.obj: $(MSWDIR)\palette.$(SRCSUFF)

View File

@ -161,6 +161,7 @@ MSWOBJS = \
minifram.$(OBJSUFF) \
msgdlg.$(OBJSUFF) \
nativdlg.$(OBJSUFF) \
notebook.$(OBJSUFF) \
ownerdrw.$(OBJSUFF) \
palette.$(OBJSUFF) \
pen.$(OBJSUFF) \

View File

@ -163,6 +163,7 @@ MSWOBJS = \
$(MSWDIR)\minifram.obj \
$(MSWDIR)\msgdlg.obj \
$(MSWDIR)\nativdlg.obj \
$(MSWDIR)\notebook.obj \
$(MSWDIR)\ownerdrw.obj \
$(MSWDIR)\palette.obj \
$(MSWDIR)\pen.obj \

View File

@ -105,10 +105,10 @@ wxNotebook::wxNotebook()
// the same arguments as for wxControl
wxNotebook::wxNotebook(wxWindow *parent,
const wxWindowID id,
wxWindowID id,
const wxPoint& pos,
const wxSize& size,
const long style,
long style,
const wxString& name)
{
Init();
@ -118,10 +118,10 @@ wxNotebook::wxNotebook(wxWindow *parent,
// Create() function
bool wxNotebook::Create(wxWindow *parent,
const wxWindowID id,
wxWindowID id,
const wxPoint& pos,
const wxSize& size,
const long style,
long style,
const wxString& name)
{
// base init
@ -414,7 +414,7 @@ void wxNotebook::Command(wxCommandEvent& event)
wxFAIL_MSG("wxNotebook::Command not implemented");
}
bool wxNotebook::MSWNotify(const WXWPARAM wParam, const WXLPARAM lParam)
bool wxNotebook::MSWNotify(WXWPARAM wParam, WXLPARAM lParam)
{
wxNotebookEvent event(wxEVT_NULL, m_windowId,
TabCtrl_GetCurSel(m_hwnd), m_nSelection);

View File

@ -95,7 +95,10 @@ bool wxStatusBar95::Create(wxWindow *parent, wxWindowID id, long style)
{
SetParent(parent);
m_windowId = id == -1 ? NewControlId() : id;
if (id == -1)
m_windowId = NewControlId();
else
m_windowId = id;
DWORD wstyle = WS_CHILD | WS_VISIBLE;
if ( style & wxST_SIZEGRIP )
@ -116,7 +119,7 @@ bool wxStatusBar95::Create(wxWindow *parent, wxWindowID id, long style)
return TRUE;
}
void wxStatusBar95::CopyFieldsWidth(int *widths)
void wxStatusBar95::CopyFieldsWidth(const int widths[])
{
if (widths && !m_statusWidths)
m_statusWidths = new int[m_nFields];
@ -131,7 +134,7 @@ void wxStatusBar95::CopyFieldsWidth(int *widths)
}
}
void wxStatusBar95::SetFieldsCount(int nFields, int *widths)
void wxStatusBar95::SetFieldsCount(int nFields, const int widths[])
{
wxASSERT( (nFields > 0) && (nFields < 255) );
@ -141,7 +144,7 @@ void wxStatusBar95::SetFieldsCount(int nFields, int *widths)
SetFieldsWidth();
}
void wxStatusBar95::SetStatusWidths(int n, int *widths)
void wxStatusBar95::SetStatusWidths(int n, const int widths[])
{
// @@ I don't understand what this function is for...
wxASSERT( n == m_nFields );
@ -218,6 +221,7 @@ wxString wxStatusBar95::GetStatusText(int nField) const
if (len > 0)
{
StatusBar_GetText(hwnd, nField, str.GetWriteBuf(len));
str.UngetWriteBuf();
}
return str;
}

View File

@ -307,7 +307,7 @@ wxPropertyValue *wxPropertyValue::NewCopy(void)
case wxPropertyValueInteger:
return new wxPropertyValue(value.integer);
case wxPropertyValuebool:
return new wxPropertyValue((value.integer != 0));
return new wxPropertyValue((bool) (value.integer != 0));
case wxPropertyValueReal:
return new wxPropertyValue(value.real);
case wxPropertyValueString: