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:
@@ -91,7 +91,7 @@ public:
|
|||||||
virtual void SetStatusText(const wxString& text, int number = 0);
|
virtual void SetStatusText(const wxString& text, int number = 0);
|
||||||
|
|
||||||
// Set status line widths
|
// 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
|
// Hint to tell framework which status bar to use
|
||||||
// TODO: should this go into a wxFrameworkSettings class perhaps?
|
// TODO: should this go into a wxFrameworkSettings class perhaps?
|
||||||
|
@@ -31,14 +31,14 @@ public:
|
|||||||
bool Create(wxWindow *parent, wxWindowID id = -1, long style = wxST_SIZEGRIP);
|
bool Create(wxWindow *parent, wxWindowID id = -1, long style = wxST_SIZEGRIP);
|
||||||
|
|
||||||
// a status line can have several (<256) fields numbered from 0
|
// 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
|
// each field of status line has it's own text
|
||||||
virtual void SetStatusText(const wxString& text, int number = 0);
|
virtual void SetStatusText(const wxString& text, int number = 0);
|
||||||
virtual wxString GetStatusText(int number = 0) const;
|
virtual wxString GetStatusText(int number = 0) const;
|
||||||
|
|
||||||
// set status line fields' widths
|
// 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)
|
// we're going to process WM_SIZE (of the parent window)
|
||||||
void OnSize(wxSizeEvent& event);
|
void OnSize(wxSizeEvent& event);
|
||||||
@@ -46,7 +46,7 @@ public:
|
|||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void CopyFieldsWidth(int *widths);
|
void CopyFieldsWidth(const int widths[]);
|
||||||
void SetFieldsWidth();
|
void SetFieldsWidth();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -215,7 +215,7 @@ void wxPrintData::ConvertToNative(void)
|
|||||||
pd->Flags = PD_RETURNDC ;
|
pd->Flags = PD_RETURNDC ;
|
||||||
// pd->lStructSize = sizeof( PRINTDLG );
|
// pd->lStructSize = sizeof( PRINTDLG );
|
||||||
pd->lStructSize = 66 ;
|
pd->lStructSize = 66 ;
|
||||||
pd->hwndOwner=(HANDLE)NULL;
|
pd->hwndOwner=(HWND)NULL;
|
||||||
pd->hDevNames=(HANDLE)NULL;
|
pd->hDevNames=(HANDLE)NULL;
|
||||||
pd->hInstance=(HINSTANCE)NULL;
|
pd->hInstance=(HINSTANCE)NULL;
|
||||||
pd->lCustData = (LPARAM) NULL;
|
pd->lCustData = (LPARAM) NULL;
|
||||||
|
@@ -10,7 +10,7 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma implementation "utils.h"
|
#pragma implementation "utilscmn.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// For compilers that support precompilation, includes "wx.h".
|
// For compilers that support precompilation, includes "wx.h".
|
||||||
|
@@ -112,6 +112,9 @@ void wxPanel::OnNavigationKey(wxNavigationKeyEvent& event)
|
|||||||
// set focus to the next child which accepts it (or first/last if node == NULL)
|
// set focus to the next child which accepts it (or first/last if node == NULL)
|
||||||
bool wxPanel::SetFocusToNextChild(wxNode *node, bool bForward)
|
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...
|
// @@ using typed list would be better...
|
||||||
#define WIN(node) ((wxWindow *)(node->Data()))
|
#define WIN(node) ((wxWindow *)(node->Data()))
|
||||||
|
|
||||||
|
@@ -94,7 +94,7 @@ bool wxStatusBar::Create(wxWindow *parent, wxWindowID id,
|
|||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxStatusBar::SetFieldsCount(int number, const int *widths)
|
void wxStatusBar::SetFieldsCount(int number, const int widths[])
|
||||||
{
|
{
|
||||||
m_nFields = number;
|
m_nFields = number;
|
||||||
|
|
||||||
@@ -138,7 +138,7 @@ wxString wxStatusBar::GetStatusText(int n) const
|
|||||||
return m_statusStrings[n];
|
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
|
// only set status widths, when n == number of statuswindows
|
||||||
if (n == m_nFields)
|
if (n == m_nFields)
|
||||||
|
@@ -510,7 +510,7 @@ void wxDC::DrawRectangle(long x, long y, long width, long height)
|
|||||||
HPEN orig_pen = NULL;
|
HPEN orig_pen = NULL;
|
||||||
|
|
||||||
if (do_pen || !m_pen.Ok())
|
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),
|
(void)Rectangle((HDC) m_hDC, XLOG2DEV(x), YLOG2DEV(y),
|
||||||
XLOG2DEV(x2) + 1, YLOG2DEV(y2) + 1);
|
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;
|
HBRUSH orig_brush = NULL;
|
||||||
|
|
||||||
if (do_brush || !m_brush.Ok())
|
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),
|
(void)Rectangle((HDC) m_hDC, XLOG2DEV(x), YLOG2DEV(y),
|
||||||
XLOG2DEV(x2), YLOG2DEV(y2));
|
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
|
// draw pie with NULL_PEN first and then outline otherwise a line is
|
||||||
// drawn from the start and end points to the centre
|
// 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)
|
if (m_signY > 0)
|
||||||
{
|
{
|
||||||
(void)Pie((HDC) m_hDC, XLOG2DEV(x), YLOG2DEV(y), XLOG2DEV(x2)+1, YLOG2DEV(y2)+1,
|
(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())
|
if (m_brush.GetResourceHandle())
|
||||||
{
|
{
|
||||||
HBRUSH b = 0;
|
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)
|
if (!m_oldBrush)
|
||||||
m_oldBrush = (WXHBRUSH) b;
|
m_oldBrush = (WXHBRUSH) b;
|
||||||
}
|
}
|
||||||
@@ -716,7 +716,7 @@ void wxDC::DrawText(const wxString& text, long x, long y, bool use16bit)
|
|||||||
#if DEBUG > 1
|
#if DEBUG > 1
|
||||||
wxDebugMsg("wxDC::DrawText: Selecting HFONT %X\n", m_font.GetResourceHandle());
|
wxDebugMsg("wxDC::DrawText: Selecting HFONT %X\n", m_font.GetResourceHandle());
|
||||||
#endif
|
#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)
|
if (!m_oldFont)
|
||||||
m_oldFont = (WXHFONT) f;
|
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);
|
GetTextExtentPoint((HDC) m_hDC, (char *)(const char *) string, strlen((char *)(const char *) string), &sizeRect);
|
||||||
GetTextMetrics((HDC) m_hDC, &tm);
|
GetTextMetrics((HDC) m_hDC, &tm);
|
||||||
|
|
||||||
if (x) *x = XDEV2LOGREL(sizeRect.cx);
|
*x = XDEV2LOGREL(sizeRect.cx);
|
||||||
if (y) *y = YDEV2LOGREL(sizeRect.cy);
|
*y = YDEV2LOGREL(sizeRect.cy);
|
||||||
if (descent) *descent = tm.tmDescent;
|
if (descent) *descent = tm.tmDescent;
|
||||||
if (externalLeading) *externalLeading = tm.tmExternalLeading;
|
if (externalLeading) *externalLeading = tm.tmExternalLeading;
|
||||||
}
|
}
|
||||||
@@ -1365,3 +1365,4 @@ void wxDC::GetTextExtent(const wxString& string, float *x, float *y,
|
|||||||
*externalLeading = externalLeading1;
|
*externalLeading = externalLeading1;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -390,7 +390,7 @@ void wxFrame::SetStatusText(const wxString& text, int number)
|
|||||||
m_frameStatusBar->SetStatusText(text, 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" );
|
wxCHECK_RET( m_frameStatusBar != NULL, "no statusbar to set widths for" );
|
||||||
|
|
||||||
|
@@ -157,6 +157,7 @@ MSWOBJS = \
|
|||||||
$(MSWDIR)\minifram.obj \
|
$(MSWDIR)\minifram.obj \
|
||||||
$(MSWDIR)\msgdlg.obj \
|
$(MSWDIR)\msgdlg.obj \
|
||||||
$(MSWDIR)\nativdlg.obj \
|
$(MSWDIR)\nativdlg.obj \
|
||||||
|
$(MSWDIR)\notebook.obj \
|
||||||
$(MSWDIR)\ownerdrw.obj \
|
$(MSWDIR)\ownerdrw.obj \
|
||||||
$(MSWDIR)\palette.obj \
|
$(MSWDIR)\palette.obj \
|
||||||
$(MSWDIR)\pen.obj \
|
$(MSWDIR)\pen.obj \
|
||||||
@@ -315,6 +316,8 @@ $(MSWDIR)\msgdlg.obj: $(MSWDIR)\msgdlg.$(SRCSUFF)
|
|||||||
|
|
||||||
$(MSWDIR)\nativdlg.obj: $(MSWDIR)\nativdlg.$(SRCSUFF)
|
$(MSWDIR)\nativdlg.obj: $(MSWDIR)\nativdlg.$(SRCSUFF)
|
||||||
|
|
||||||
|
$(MSWDIR)\notebook.obj: $(MSWDIR)\notebook.$(SRCSUFF)
|
||||||
|
|
||||||
$(MSWDIR)\ownerdrw.obj: $(MSWDIR)\ownerdrw.$(SRCSUFF)
|
$(MSWDIR)\ownerdrw.obj: $(MSWDIR)\ownerdrw.$(SRCSUFF)
|
||||||
|
|
||||||
$(MSWDIR)\palette.obj: $(MSWDIR)\palette.$(SRCSUFF)
|
$(MSWDIR)\palette.obj: $(MSWDIR)\palette.$(SRCSUFF)
|
||||||
|
@@ -161,6 +161,7 @@ MSWOBJS = \
|
|||||||
minifram.$(OBJSUFF) \
|
minifram.$(OBJSUFF) \
|
||||||
msgdlg.$(OBJSUFF) \
|
msgdlg.$(OBJSUFF) \
|
||||||
nativdlg.$(OBJSUFF) \
|
nativdlg.$(OBJSUFF) \
|
||||||
|
notebook.$(OBJSUFF) \
|
||||||
ownerdrw.$(OBJSUFF) \
|
ownerdrw.$(OBJSUFF) \
|
||||||
palette.$(OBJSUFF) \
|
palette.$(OBJSUFF) \
|
||||||
pen.$(OBJSUFF) \
|
pen.$(OBJSUFF) \
|
||||||
|
@@ -163,6 +163,7 @@ MSWOBJS = \
|
|||||||
$(MSWDIR)\minifram.obj \
|
$(MSWDIR)\minifram.obj \
|
||||||
$(MSWDIR)\msgdlg.obj \
|
$(MSWDIR)\msgdlg.obj \
|
||||||
$(MSWDIR)\nativdlg.obj \
|
$(MSWDIR)\nativdlg.obj \
|
||||||
|
$(MSWDIR)\notebook.obj \
|
||||||
$(MSWDIR)\ownerdrw.obj \
|
$(MSWDIR)\ownerdrw.obj \
|
||||||
$(MSWDIR)\palette.obj \
|
$(MSWDIR)\palette.obj \
|
||||||
$(MSWDIR)\pen.obj \
|
$(MSWDIR)\pen.obj \
|
||||||
|
@@ -105,10 +105,10 @@ wxNotebook::wxNotebook()
|
|||||||
|
|
||||||
// the same arguments as for wxControl
|
// the same arguments as for wxControl
|
||||||
wxNotebook::wxNotebook(wxWindow *parent,
|
wxNotebook::wxNotebook(wxWindow *parent,
|
||||||
const wxWindowID id,
|
wxWindowID id,
|
||||||
const wxPoint& pos,
|
const wxPoint& pos,
|
||||||
const wxSize& size,
|
const wxSize& size,
|
||||||
const long style,
|
long style,
|
||||||
const wxString& name)
|
const wxString& name)
|
||||||
{
|
{
|
||||||
Init();
|
Init();
|
||||||
@@ -118,10 +118,10 @@ wxNotebook::wxNotebook(wxWindow *parent,
|
|||||||
|
|
||||||
// Create() function
|
// Create() function
|
||||||
bool wxNotebook::Create(wxWindow *parent,
|
bool wxNotebook::Create(wxWindow *parent,
|
||||||
const wxWindowID id,
|
wxWindowID id,
|
||||||
const wxPoint& pos,
|
const wxPoint& pos,
|
||||||
const wxSize& size,
|
const wxSize& size,
|
||||||
const long style,
|
long style,
|
||||||
const wxString& name)
|
const wxString& name)
|
||||||
{
|
{
|
||||||
// base init
|
// base init
|
||||||
@@ -414,7 +414,7 @@ void wxNotebook::Command(wxCommandEvent& event)
|
|||||||
wxFAIL_MSG("wxNotebook::Command not implemented");
|
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,
|
wxNotebookEvent event(wxEVT_NULL, m_windowId,
|
||||||
TabCtrl_GetCurSel(m_hwnd), m_nSelection);
|
TabCtrl_GetCurSel(m_hwnd), m_nSelection);
|
||||||
|
@@ -95,7 +95,10 @@ bool wxStatusBar95::Create(wxWindow *parent, wxWindowID id, long style)
|
|||||||
{
|
{
|
||||||
SetParent(parent);
|
SetParent(parent);
|
||||||
|
|
||||||
m_windowId = id == -1 ? NewControlId() : id;
|
if (id == -1)
|
||||||
|
m_windowId = NewControlId();
|
||||||
|
else
|
||||||
|
m_windowId = id;
|
||||||
|
|
||||||
DWORD wstyle = WS_CHILD | WS_VISIBLE;
|
DWORD wstyle = WS_CHILD | WS_VISIBLE;
|
||||||
if ( style & wxST_SIZEGRIP )
|
if ( style & wxST_SIZEGRIP )
|
||||||
@@ -116,7 +119,7 @@ bool wxStatusBar95::Create(wxWindow *parent, wxWindowID id, long style)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxStatusBar95::CopyFieldsWidth(int *widths)
|
void wxStatusBar95::CopyFieldsWidth(const int widths[])
|
||||||
{
|
{
|
||||||
if (widths && !m_statusWidths)
|
if (widths && !m_statusWidths)
|
||||||
m_statusWidths = new int[m_nFields];
|
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) );
|
wxASSERT( (nFields > 0) && (nFields < 255) );
|
||||||
|
|
||||||
@@ -141,7 +144,7 @@ void wxStatusBar95::SetFieldsCount(int nFields, int *widths)
|
|||||||
SetFieldsWidth();
|
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...
|
// @@ I don't understand what this function is for...
|
||||||
wxASSERT( n == m_nFields );
|
wxASSERT( n == m_nFields );
|
||||||
@@ -218,6 +221,7 @@ wxString wxStatusBar95::GetStatusText(int nField) const
|
|||||||
if (len > 0)
|
if (len > 0)
|
||||||
{
|
{
|
||||||
StatusBar_GetText(hwnd, nField, str.GetWriteBuf(len));
|
StatusBar_GetText(hwnd, nField, str.GetWriteBuf(len));
|
||||||
|
str.UngetWriteBuf();
|
||||||
}
|
}
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
@@ -307,7 +307,7 @@ wxPropertyValue *wxPropertyValue::NewCopy(void)
|
|||||||
case wxPropertyValueInteger:
|
case wxPropertyValueInteger:
|
||||||
return new wxPropertyValue(value.integer);
|
return new wxPropertyValue(value.integer);
|
||||||
case wxPropertyValuebool:
|
case wxPropertyValuebool:
|
||||||
return new wxPropertyValue((value.integer != 0));
|
return new wxPropertyValue((bool) (value.integer != 0));
|
||||||
case wxPropertyValueReal:
|
case wxPropertyValueReal:
|
||||||
return new wxPropertyValue(value.real);
|
return new wxPropertyValue(value.real);
|
||||||
case wxPropertyValueString:
|
case wxPropertyValueString:
|
||||||
|
Reference in New Issue
Block a user