Sorry folks, a lot of changes to remedy GetFont, GetBrush etc.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1137 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -731,7 +731,7 @@ int wxIndividualLayoutConstraint::GetEdge(wxEdge which,
|
||||
// know the dimension is obtainable immediately.
|
||||
// E.g. a wxExpandSizer may contain a button (but the button's
|
||||
// true parent is a panel, not the sizer)
|
||||
if (other->GetChildren()->Member(thisWin))
|
||||
if (other->GetChildren().Member(thisWin))
|
||||
{
|
||||
switch (which)
|
||||
{
|
||||
@@ -1054,7 +1054,7 @@ bool wxOldDoLayout(wxWindow *win)
|
||||
|
||||
doneSoFar.Append(win);
|
||||
|
||||
wxNode *node = win->GetChildren()->First();
|
||||
wxNode *node = win->GetChildren().First();
|
||||
while (node)
|
||||
{
|
||||
wxWindow *child = (wxWindow *)node->Data();
|
||||
@@ -1079,7 +1079,7 @@ bool wxOldDoLayout(wxWindow *win)
|
||||
while ((noChanges > 0) && (noIterations < maxIterations))
|
||||
{
|
||||
noChanges = 0;
|
||||
wxNode *node = win->GetChildren()->First();
|
||||
wxNode *node = win->GetChildren().First();
|
||||
while (node)
|
||||
{
|
||||
wxWindow *child = (wxWindow *)node->Data();
|
||||
@@ -1104,7 +1104,7 @@ bool wxOldDoLayout(wxWindow *win)
|
||||
*/
|
||||
// Now set the sizes and positions of the children, and
|
||||
// recursively call Layout().
|
||||
node = win->GetChildren()->First();
|
||||
node = win->GetChildren().First();
|
||||
while (node)
|
||||
{
|
||||
wxWindow *child = (wxWindow *)node->Data();
|
||||
@@ -1203,7 +1203,7 @@ wxSizer::~wxSizer()
|
||||
{
|
||||
// Remove all children without deleting them,
|
||||
// or ~wxbWindow will delete proper windows _twice_
|
||||
wxNode *node = GetChildren()->First();
|
||||
wxNode *node = GetChildren().First();
|
||||
while (node)
|
||||
{
|
||||
wxNode *next = node->Next();
|
||||
@@ -1249,7 +1249,7 @@ void wxSizer::SetBorder(int x, int y)
|
||||
void wxSizer::AddSizerChild(wxWindow *child)
|
||||
{
|
||||
child->SetSizerParent(this);
|
||||
GetChildren()->Append(child);
|
||||
GetChildren().Append(child);
|
||||
|
||||
// Add some constraints for the purpose of storing
|
||||
// the relative position of the window/sizer
|
||||
@@ -1272,7 +1272,7 @@ void wxSizer::AddSizerChild(wxWindow *child)
|
||||
|
||||
void wxSizer::RemoveSizerChild(wxWindow *child)
|
||||
{
|
||||
GetChildren()->DeleteObject(child);
|
||||
GetChildren().DeleteObject(child);
|
||||
}
|
||||
|
||||
void wxSizer::SetSize(int x, int y, int w, int h, int WXUNUSED(flags))
|
||||
@@ -1382,7 +1382,7 @@ bool wxSizer::LayoutPhase1(int *noChanges)
|
||||
// Find the bounding box and set own size
|
||||
int maxX = 0;
|
||||
int maxY = 0;
|
||||
wxNode *node = GetChildren()->First();
|
||||
wxNode *node = GetChildren().First();
|
||||
while (node)
|
||||
{
|
||||
int x, y, width, height;
|
||||
@@ -1580,7 +1580,7 @@ bool wxRowColSizer::LayoutPhase1(int *noChanges)
|
||||
int maxX = currentX;
|
||||
int maxY = currentY;
|
||||
|
||||
wxNode *node = GetChildren()->First();
|
||||
wxNode *node = GetChildren().First();
|
||||
while (node)
|
||||
{
|
||||
wxWindow *win = (wxWindow *)node->Data();
|
||||
|
@@ -2301,7 +2301,7 @@ wxIcon wxResourceCreateIcon(const wxString& resource, wxResourceTable *table)
|
||||
else
|
||||
{
|
||||
wxLogWarning(_("Icon resource specification %s not found."), (const char*) resource);
|
||||
return (wxIcon *) NULL;
|
||||
return wxNullIcon;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2827,7 +2827,7 @@ bool wxWindow::LoadFromResource(wxWindow *parent, const wxString& resourceName,
|
||||
}
|
||||
|
||||
// Should have some kind of font at this point
|
||||
if (!GetFont()->Ok())
|
||||
if (!GetFont().Ok())
|
||||
SetFont(wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT));
|
||||
if (!GetBackgroundColour().Ok())
|
||||
SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE));
|
||||
|
@@ -224,7 +224,7 @@ void wxToolBarSimple::DrawTool(wxDC& dc, wxMemoryDC& memDC, wxToolBarTool *tool)
|
||||
{
|
||||
dc.SetClippingRegion(ax, ay, (bx-ax+1), (by-ay+1));
|
||||
dc.Blit((ax+1), (ay+1), (bx-ax-2), (by-ay-2), &memDC, 0, 0);
|
||||
wxPen * old_pen = dc.GetPen();
|
||||
wxPen * old_pen = & dc.GetPen();
|
||||
dc.SetPen( white_pen );
|
||||
dc.DrawLine(ax,(by-1),ax,ay);
|
||||
dc.DrawLine(ax,ay,(bx-1),ay);
|
||||
@@ -276,7 +276,7 @@ void wxToolBarSimple::DrawTool(wxDC& dc, wxMemoryDC& memDC, wxToolBarTool *tool)
|
||||
memDC.SelectObject(tool->m_bitmap1);
|
||||
dc.SetClippingRegion(ax, ay, (bx-ax+1), (by-ay+1));
|
||||
dc.Blit((ax+2), (ay+2), (bx-ax-2), (by-ay-2), &memDC, 0, 0);
|
||||
wxPen * old_pen = dc.GetPen();
|
||||
wxPen * old_pen = & dc.GetPen();
|
||||
dc.SetPen( black_pen );
|
||||
dc.DrawLine(ax,(by-1),ax,ay);
|
||||
dc.DrawLine(ax,ay,(bx-1),ay);
|
||||
|
@@ -445,7 +445,7 @@ wxFindWindowByLabel1 (const wxString& title, wxWindow * parent)
|
||||
|
||||
if (parent)
|
||||
{
|
||||
for (wxNode * node = parent->GetChildren()->First (); node; node = node->Next ())
|
||||
for (wxNode * node = parent->GetChildren().First (); node; node = node->Next ())
|
||||
{
|
||||
wxWindow *win = (wxWindow *) node->Data ();
|
||||
wxWindow *retwin = wxFindWindowByLabel1 (title, win);
|
||||
@@ -501,7 +501,7 @@ wxFindWindowByName1 (const wxString& title, wxWindow * parent)
|
||||
|
||||
if (parent)
|
||||
{
|
||||
for (wxNode * node = parent->GetChildren()->First (); node; node = node->Next ())
|
||||
for (wxNode * node = parent->GetChildren().First (); node; node = node->Next ())
|
||||
{
|
||||
wxWindow *win = (wxWindow *) node->Data ();
|
||||
wxWindow *retwin = wxFindWindowByName1 (title, win);
|
||||
|
@@ -80,9 +80,9 @@ wxGenericGrid::wxGenericGrid(void)
|
||||
m_labelTextColour = *wxBLACK;
|
||||
// m_labelBackgroundColour = *wxLIGHT_GREY;
|
||||
m_labelBackgroundColour = wxSystemSettings::GetSystemColour( wxSYS_COLOUR_BTNFACE );
|
||||
m_labelBackgroundBrush = (wxBrush *) NULL;
|
||||
m_labelTextFont = (wxFont *) NULL;
|
||||
m_cellTextFont = (wxFont *) NULL;
|
||||
m_labelBackgroundBrush = wxNullBrush;
|
||||
m_labelTextFont = wxNullFont;
|
||||
m_cellTextFont = wxNullFont;
|
||||
m_textItem = (wxTextCtrl *) NULL;
|
||||
m_currentRectVisible = FALSE;
|
||||
m_editable = TRUE;
|
||||
@@ -95,7 +95,7 @@ wxGenericGrid::wxGenericGrid(void)
|
||||
m_dragRowOrCol = 0;
|
||||
m_dragStartPosition = 0;
|
||||
m_dragLastPosition = 0;
|
||||
m_divisionPen = (wxPen *) NULL;
|
||||
m_divisionPen = wxNullPen;
|
||||
m_leftOfSheet = wxGRID_DEFAULT_SHEET_LEFT;
|
||||
m_topOfSheet = wxGRID_DEFAULT_SHEET_TOP;
|
||||
m_cellHeight = wxGRID_DEFAULT_CELL_HEIGHT;
|
||||
@@ -122,8 +122,6 @@ wxGenericGrid::wxGenericGrid(void)
|
||||
m_rowLabelCells = (wxGridCell **) NULL;
|
||||
m_colLabelCells = (wxGridCell **) NULL;
|
||||
m_textItem = (wxTextCtrl *) NULL;
|
||||
m_horizontalSashCursor = (wxCursor *) NULL;
|
||||
m_verticalSashCursor = (wxCursor *) NULL;
|
||||
}
|
||||
|
||||
bool wxGenericGrid::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size,
|
||||
@@ -133,16 +131,14 @@ bool wxGenericGrid::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos,
|
||||
m_editingPanel = (wxPanel *) NULL;
|
||||
m_hScrollBar = (wxScrollBar *) NULL;
|
||||
m_vScrollBar = (wxScrollBar *) NULL;
|
||||
m_horizontalSashCursor = (wxCursor *) NULL;
|
||||
m_verticalSashCursor = (wxCursor *) NULL;
|
||||
m_cellTextColour = *wxBLACK;
|
||||
m_cellBackgroundColour = *wxWHITE;
|
||||
m_labelTextColour = *wxBLACK;
|
||||
// m_labelBackgroundColour = *wxLIGHT_GREY;
|
||||
m_labelBackgroundColour = wxSystemSettings::GetSystemColour( wxSYS_COLOUR_BTNFACE );
|
||||
m_labelBackgroundBrush = (wxBrush *) NULL;
|
||||
m_labelTextFont = wxTheFontList->FindOrCreateFont(10, wxSWISS, wxNORMAL, wxBOLD);
|
||||
m_cellTextFont = wxTheFontList->FindOrCreateFont(10, wxSWISS, wxNORMAL, wxNORMAL);
|
||||
m_labelBackgroundBrush = wxNullBrush;
|
||||
m_labelTextFont = * wxTheFontList->FindOrCreateFont(10, wxSWISS, wxNORMAL, wxBOLD);
|
||||
m_cellTextFont = * wxTheFontList->FindOrCreateFont(10, wxSWISS, wxNORMAL, wxNORMAL);
|
||||
m_textItem = (wxTextCtrl *) NULL;
|
||||
m_currentRectVisible = FALSE;
|
||||
m_editable = TRUE;
|
||||
@@ -155,13 +151,13 @@ bool wxGenericGrid::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos,
|
||||
m_dragRowOrCol = 0;
|
||||
m_dragStartPosition = 0;
|
||||
m_dragLastPosition = 0;
|
||||
m_divisionPen = wxThePenList->FindOrCreatePen("LIGHT GREY", 1, wxSOLID);
|
||||
m_divisionPen = * wxThePenList->FindOrCreatePen("LIGHT GREY", 1, wxSOLID);
|
||||
m_doubleBufferingBitmap = (wxBitmap *) NULL;
|
||||
|
||||
if (!m_horizontalSashCursor)
|
||||
if (!m_horizontalSashCursor.Ok())
|
||||
{
|
||||
m_horizontalSashCursor = new wxCursor(wxCURSOR_SIZEWE);
|
||||
m_verticalSashCursor = new wxCursor(wxCURSOR_SIZENS);
|
||||
m_horizontalSashCursor = wxCursor(wxCURSOR_SIZEWE);
|
||||
m_verticalSashCursor = wxCursor(wxCURSOR_SIZENS);
|
||||
}
|
||||
|
||||
SetLabelBackgroundColour(m_labelBackgroundColour);
|
||||
@@ -402,7 +398,7 @@ void wxGenericGrid::UpdateDimensions(void)
|
||||
}
|
||||
}
|
||||
|
||||
wxGridCell *wxGenericGrid::GetCell(int row, int col)
|
||||
wxGridCell *wxGenericGrid::GetCell(int row, int col) const
|
||||
{
|
||||
if (!m_gridCells)
|
||||
return (wxGridCell *) NULL;
|
||||
@@ -414,7 +410,7 @@ wxGridCell *wxGenericGrid::GetCell(int row, int col)
|
||||
if (!cell)
|
||||
{
|
||||
// m_gridCells[row][col] = OnCreateCell();
|
||||
wxGridEvent g_evt(GetId(), wxEVT_GRID_CREATE_CELL, this, row, col);
|
||||
wxGridEvent g_evt(GetId(), wxEVT_GRID_CREATE_CELL, (wxGenericGrid*) this, row, col);
|
||||
GetEventHandler()->ProcessEvent(g_evt);
|
||||
m_gridCells[row][col] = g_evt.m_cell;
|
||||
return m_gridCells[row][col];
|
||||
@@ -556,7 +552,7 @@ void wxGenericGrid::DrawLabelAreas(wxDC *dc)
|
||||
// dc->DrawRectangle(m_rightOfSheet, m_topOfSheet, cw - m_rightOfSheet, ch - m_topOfSheet);
|
||||
|
||||
// Paint the label areas
|
||||
dc->SetBrush(*m_labelBackgroundBrush);
|
||||
dc->SetBrush(m_labelBackgroundBrush);
|
||||
// dc->DrawRectangle(m_leftOfSheet, m_topOfSheet, m_rightOfSheet - m_leftOfSheet + 1, m_horizontalLabelHeight + 1);
|
||||
dc->DrawRectangle(m_leftOfSheet, m_topOfSheet, cw-m_leftOfSheet, m_horizontalLabelHeight + 1);
|
||||
// dc->DrawRectangle(m_leftOfSheet, m_topOfSheet, m_verticalLabelWidth + 1, m_bottomOfSheet - m_topOfSheet + 1);
|
||||
@@ -583,9 +579,9 @@ void wxGenericGrid::DrawGridLines(wxDC *dc)
|
||||
|
||||
int i;
|
||||
|
||||
if (m_divisionPen)
|
||||
if (m_divisionPen.Ok())
|
||||
{
|
||||
dc->SetPen(*m_divisionPen);
|
||||
dc->SetPen(m_divisionPen);
|
||||
|
||||
int heightCount = m_topOfSheet + m_horizontalLabelHeight;
|
||||
|
||||
@@ -653,9 +649,9 @@ void wxGenericGrid::DrawGridLines(wxDC *dc)
|
||||
|
||||
}
|
||||
|
||||
if (m_divisionPen)
|
||||
if (m_divisionPen.Ok())
|
||||
{
|
||||
dc->SetPen(*m_divisionPen);
|
||||
dc->SetPen(m_divisionPen);
|
||||
|
||||
// Draw vertical grey lines for cells
|
||||
int widthCount = m_leftOfSheet + m_verticalLabelWidth;
|
||||
@@ -782,7 +778,7 @@ void wxGenericGrid::DrawColumnLabel(wxDC *dc, wxRect *rect, int col)
|
||||
rect2.width -= 5;
|
||||
rect2.height -= 4;
|
||||
dc->SetTextForeground(GetLabelTextColour());
|
||||
dc->SetFont(*GetLabelTextFont());
|
||||
dc->SetFont(GetLabelTextFont());
|
||||
if ( !cell->GetTextValue().IsNull() )
|
||||
DrawTextRect(dc, cell->GetTextValue(), &rect2, GetLabelAlignment(wxHORIZONTAL));
|
||||
}
|
||||
@@ -835,7 +831,7 @@ void wxGenericGrid::DrawRowLabel(wxDC *dc, wxRect *rect, int row)
|
||||
rect2.width -= 5;
|
||||
rect2.height -= 4;
|
||||
dc->SetTextForeground(GetLabelTextColour());
|
||||
dc->SetFont(*GetLabelTextFont());
|
||||
dc->SetFont(GetLabelTextFont());
|
||||
if ( !cell->GetTextValue().IsNull() )
|
||||
DrawTextRect(dc, cell->GetTextValue(), &rect2, GetLabelAlignment(wxVERTICAL));
|
||||
}
|
||||
@@ -874,7 +870,7 @@ void wxGenericGrid::DrawCellBackground(wxDC *dc, wxRect *rect, int row, int col)
|
||||
wxGridCell *cell = GetCell(row, col);
|
||||
if (cell)
|
||||
{
|
||||
dc->SetBrush(*cell->GetBackgroundBrush());
|
||||
dc->SetBrush(cell->GetBackgroundBrush());
|
||||
dc->SetPen(*wxTRANSPARENT_PEN);
|
||||
|
||||
#if 0 // In wxWin 2.0 the dc code is exact. RR.
|
||||
@@ -912,7 +908,7 @@ void wxGenericGrid::DrawCellValue(wxDC *dc, wxRect *rect, int row, int col)
|
||||
{
|
||||
dc->SetBackgroundMode(wxTRANSPARENT);
|
||||
dc->SetTextForeground(cell->GetTextColour());
|
||||
dc->SetFont(*cell->GetFont());
|
||||
dc->SetFont(cell->GetFont());
|
||||
|
||||
if ( !cell->GetTextValue().IsNull() )
|
||||
DrawTextRect(dc, cell->GetTextValue(), &rect2, cell->GetAlignment());
|
||||
@@ -1239,13 +1235,13 @@ void wxGenericGrid::OnMouseEvent(wxMouseEvent& ev)
|
||||
if (orientation == wxHORIZONTAL)
|
||||
{
|
||||
m_dragStatus = wxGRID_DRAG_LEFT_RIGHT;
|
||||
SetCursor(*m_horizontalSashCursor);
|
||||
SetCursor(m_horizontalSashCursor);
|
||||
m_dragLastPosition = (int)ev.GetX();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_dragStatus = wxGRID_DRAG_UP_DOWN;
|
||||
SetCursor(*m_verticalSashCursor);
|
||||
SetCursor(m_verticalSashCursor);
|
||||
m_dragLastPosition = (int)ev.GetY();
|
||||
}
|
||||
wxClientDC dc(this);
|
||||
@@ -1272,7 +1268,7 @@ void wxGenericGrid::OnMouseEvent(wxMouseEvent& ev)
|
||||
dc.EndDrawing();
|
||||
|
||||
m_dragLastPosition = (int)ev.GetX();
|
||||
SetCursor(*m_horizontalSashCursor);
|
||||
SetCursor(m_horizontalSashCursor);
|
||||
break;
|
||||
}
|
||||
case wxGRID_DRAG_UP_DOWN:
|
||||
@@ -1286,7 +1282,7 @@ void wxGenericGrid::OnMouseEvent(wxMouseEvent& ev)
|
||||
dc.EndDrawing();
|
||||
|
||||
m_dragLastPosition = (int)ev.GetY();
|
||||
SetCursor(*m_verticalSashCursor);
|
||||
SetCursor(m_verticalSashCursor);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1297,9 +1293,9 @@ void wxGenericGrid::OnMouseEvent(wxMouseEvent& ev)
|
||||
if (LabelSashHitTest((int)ev.GetX(), (int)ev.GetY(), &orientation, &rowOrCol, &startPos))
|
||||
{
|
||||
if (orientation == wxHORIZONTAL)
|
||||
SetCursor(*m_horizontalSashCursor);
|
||||
SetCursor(m_horizontalSashCursor);
|
||||
else
|
||||
SetCursor(*m_verticalSashCursor);
|
||||
SetCursor(m_verticalSashCursor);
|
||||
}
|
||||
else
|
||||
SetCursor(*wxSTANDARD_CURSOR);
|
||||
@@ -1511,7 +1507,7 @@ void wxGenericGrid::DrawCellText(void)
|
||||
SetGridClippingRegion(& dc);
|
||||
|
||||
dc.SetBackgroundMode(wxTRANSPARENT);
|
||||
dc.SetBrush(*cell->GetBackgroundBrush());
|
||||
dc.SetBrush(cell->GetBackgroundBrush());
|
||||
|
||||
strcpy(szEdit, m_textItem->GetValue());
|
||||
|
||||
@@ -1816,7 +1812,7 @@ void wxGenericGrid::RefreshCell(int row, int col, bool setText)
|
||||
}
|
||||
}
|
||||
|
||||
wxString& wxGenericGrid::GetCellValue(int row, int col)
|
||||
wxString& wxGenericGrid::GetCellValue(int row, int col) const
|
||||
{
|
||||
static wxString emptyString("");
|
||||
|
||||
@@ -1833,7 +1829,7 @@ void wxGenericGrid::SetColumnWidth(int col, int width)
|
||||
m_colWidths[col] = width;
|
||||
}
|
||||
|
||||
int wxGenericGrid::GetColumnWidth(int col)
|
||||
int wxGenericGrid::GetColumnWidth(int col) const
|
||||
{
|
||||
if (col <= m_totalCols)
|
||||
return m_colWidths[col];
|
||||
@@ -1847,7 +1843,7 @@ void wxGenericGrid::SetRowHeight(int row, int height)
|
||||
m_rowHeights[row] = height;
|
||||
}
|
||||
|
||||
int wxGenericGrid::GetRowHeight(int row)
|
||||
int wxGenericGrid::GetRowHeight(int row) const
|
||||
{
|
||||
if (row <= m_totalRows)
|
||||
return m_rowHeights[row];
|
||||
@@ -1865,7 +1861,7 @@ void wxGenericGrid::SetLabelSize(int orientation, int sz)
|
||||
SetCurrentRect(GetCursorRow(), GetCursorColumn());
|
||||
}
|
||||
|
||||
int wxGenericGrid::GetLabelSize(int orientation)
|
||||
int wxGenericGrid::GetLabelSize(int orientation) const
|
||||
{
|
||||
if (orientation == wxHORIZONTAL)
|
||||
return m_horizontalLabelHeight;
|
||||
@@ -1873,7 +1869,7 @@ int wxGenericGrid::GetLabelSize(int orientation)
|
||||
return m_verticalLabelWidth;
|
||||
}
|
||||
|
||||
wxGridCell *wxGenericGrid::GetLabelCell(int orientation, int pos)
|
||||
wxGridCell *wxGenericGrid::GetLabelCell(int orientation, int pos) const
|
||||
{
|
||||
if (orientation == wxHORIZONTAL)
|
||||
{
|
||||
@@ -1898,7 +1894,7 @@ void wxGenericGrid::SetLabelValue(int orientation, const wxString& val, int pos)
|
||||
cell->SetTextValue(val);
|
||||
}
|
||||
|
||||
wxString& wxGenericGrid::GetLabelValue(int orientation, int pos)
|
||||
wxString& wxGenericGrid::GetLabelValue(int orientation, int pos) const
|
||||
{
|
||||
static wxString emptyString = "";
|
||||
wxGridCell *cell = GetLabelCell(orientation, pos);
|
||||
@@ -1918,7 +1914,7 @@ void wxGenericGrid::SetLabelAlignment(int orientation, int align)
|
||||
SetCurrentRect(GetCursorRow(), GetCursorColumn());
|
||||
}
|
||||
|
||||
int wxGenericGrid::GetLabelAlignment(int orientation)
|
||||
int wxGenericGrid::GetLabelAlignment(int orientation) const
|
||||
{
|
||||
if (orientation == wxHORIZONTAL)
|
||||
return m_horizontalLabelAlignment;
|
||||
@@ -1935,7 +1931,7 @@ void wxGenericGrid::SetLabelTextColour(const wxColour& colour)
|
||||
void wxGenericGrid::SetLabelBackgroundColour(const wxColour& colour)
|
||||
{
|
||||
m_labelBackgroundColour = colour;
|
||||
m_labelBackgroundBrush = wxTheBrushList->FindOrCreateBrush(m_labelBackgroundColour, wxSOLID);
|
||||
m_labelBackgroundBrush = * wxTheBrushList->FindOrCreateBrush(m_labelBackgroundColour, wxSOLID);
|
||||
}
|
||||
|
||||
void wxGenericGrid::SetEditable(bool edit)
|
||||
@@ -1989,7 +1985,7 @@ void wxGenericGrid::SetCellAlignment(int flag, int row, int col)
|
||||
cell->SetAlignment(flag);
|
||||
}
|
||||
|
||||
int wxGenericGrid::GetCellAlignment(int row, int col)
|
||||
int wxGenericGrid::GetCellAlignment(int row, int col) const
|
||||
{
|
||||
wxGridCell *cell = GetCell(row, col);
|
||||
if (cell)
|
||||
@@ -2008,7 +2004,7 @@ void wxGenericGrid::SetCellAlignment(int flag)
|
||||
GetCell(i, j)->SetAlignment(flag);
|
||||
}
|
||||
|
||||
int wxGenericGrid::GetCellAlignment(void)
|
||||
int wxGenericGrid::GetCellAlignment(void) const
|
||||
{
|
||||
return m_cellAlignment;
|
||||
}
|
||||
@@ -2033,13 +2029,13 @@ void wxGenericGrid::SetCellBackgroundColour(const wxColour& val, int row, int co
|
||||
}
|
||||
}
|
||||
|
||||
wxColour& wxGenericGrid::GetCellBackgroundColour(int row, int col)
|
||||
wxColour& wxGenericGrid::GetCellBackgroundColour(int row, int col) const
|
||||
{
|
||||
wxGridCell *cell = GetCell(row, col);
|
||||
if (cell)
|
||||
return cell->GetBackgroundColour();
|
||||
else
|
||||
return m_cellBackgroundColour;
|
||||
return (wxColour&) m_cellBackgroundColour;
|
||||
}
|
||||
|
||||
void wxGenericGrid::SetCellTextColour(const wxColour& val, int row, int col)
|
||||
@@ -2052,7 +2048,7 @@ void wxGenericGrid::SetCellTextColour(const wxColour& val, int row, int col)
|
||||
}
|
||||
}
|
||||
|
||||
void wxGenericGrid::SetCellTextFont(wxFont *fnt, int row, int col)
|
||||
void wxGenericGrid::SetCellTextFont(const wxFont& fnt, int row, int col)
|
||||
{
|
||||
wxGridCell *cell = GetCell(row, col);
|
||||
if (cell)
|
||||
@@ -2062,22 +2058,22 @@ void wxGenericGrid::SetCellTextFont(wxFont *fnt, int row, int col)
|
||||
}
|
||||
}
|
||||
|
||||
wxFont *wxGenericGrid::GetCellTextFont(int row, int col)
|
||||
wxFont& wxGenericGrid::GetCellTextFont(int row, int col) const
|
||||
{
|
||||
wxGridCell *cell = GetCell(row, col);
|
||||
if (cell)
|
||||
return cell->GetFont();
|
||||
return (wxFont&) cell->GetFont();
|
||||
else
|
||||
return m_cellTextFont;
|
||||
return (wxFont&) m_cellTextFont;
|
||||
}
|
||||
|
||||
wxColour& wxGenericGrid::GetCellTextColour(int row, int col)
|
||||
wxColour& wxGenericGrid::GetCellTextColour(int row, int col) const
|
||||
{
|
||||
wxGridCell *cell = GetCell(row, col);
|
||||
if (cell)
|
||||
return cell->GetTextColour();
|
||||
return (wxColour&) cell->GetTextColour();
|
||||
else
|
||||
return m_cellTextColour;
|
||||
return (wxColour&) m_cellTextColour;
|
||||
}
|
||||
|
||||
void wxGenericGrid::SetCellTextColour(const wxColour& val)
|
||||
@@ -2090,7 +2086,7 @@ void wxGenericGrid::SetCellTextColour(const wxColour& val)
|
||||
GetCell(i, j)->SetTextColour(val);
|
||||
}
|
||||
|
||||
void wxGenericGrid::SetCellTextFont(wxFont *fnt)
|
||||
void wxGenericGrid::SetCellTextFont(const wxFont& fnt)
|
||||
{
|
||||
m_cellTextFont = fnt;
|
||||
int i,j;
|
||||
@@ -2110,7 +2106,7 @@ void wxGenericGrid::SetCellBitmap(wxBitmap *bitmap, int row, int col)
|
||||
}
|
||||
}
|
||||
|
||||
wxBitmap *wxGenericGrid::GetCellBitmap(int row, int col)
|
||||
wxBitmap *wxGenericGrid::GetCellBitmap(int row, int col) const
|
||||
{
|
||||
wxGridCell *cell = GetCell(row, col);
|
||||
if (cell)
|
||||
@@ -2407,8 +2403,8 @@ void wxGenericGrid::SetGridCursor(int row, int col)
|
||||
wxGridCell::wxGridCell(wxGenericGrid *window)
|
||||
{
|
||||
cellBitmap = (wxBitmap *) NULL;
|
||||
font = (wxFont *) NULL;
|
||||
backgroundBrush = (wxBrush *) NULL;
|
||||
font = wxNullFont;
|
||||
backgroundBrush = wxNullBrush;
|
||||
if (window)
|
||||
textColour = window->GetCellTextColour();
|
||||
else
|
||||
@@ -2421,7 +2417,7 @@ wxGridCell::wxGridCell(wxGenericGrid *window)
|
||||
if (window)
|
||||
font = window->GetCellTextFont();
|
||||
else
|
||||
font = wxTheFontList->FindOrCreateFont(12, wxSWISS, wxNORMAL, wxNORMAL);
|
||||
font = * wxTheFontList->FindOrCreateFont(12, wxSWISS, wxNORMAL, wxNORMAL);
|
||||
|
||||
SetBackgroundColour(backgroundColour);
|
||||
|
||||
@@ -2438,7 +2434,7 @@ wxGridCell::~wxGridCell(void)
|
||||
void wxGridCell::SetBackgroundColour(const wxColour& colour)
|
||||
{
|
||||
backgroundColour = colour;
|
||||
backgroundBrush = wxTheBrushList->FindOrCreateBrush(backgroundColour, wxSOLID);
|
||||
backgroundBrush = * wxTheBrushList->FindOrCreateBrush(backgroundColour, wxSOLID);
|
||||
}
|
||||
|
||||
void wxGenericGrid::OnText(wxCommandEvent& WXUNUSED(ev) )
|
||||
|
@@ -176,7 +176,7 @@ bool wxLayoutAlgorithm::LayoutMDIFrame(wxMDIParentFrame* frame, wxRect* r)
|
||||
wxCalculateLayoutEvent event;
|
||||
event.SetRect(rect);
|
||||
|
||||
wxNode* node = frame->GetChildren()->First();
|
||||
wxNode* node = frame->GetChildren().First();
|
||||
while (node)
|
||||
{
|
||||
wxWindow* win = (wxWindow*) node->Data();
|
||||
@@ -210,7 +210,7 @@ bool wxLayoutAlgorithm::LayoutFrame(wxFrame* frame, wxWindow* mainWindow)
|
||||
wxCalculateLayoutEvent event;
|
||||
event.SetRect(rect);
|
||||
|
||||
wxNode* node = frame->GetChildren()->First();
|
||||
wxNode* node = frame->GetChildren().First();
|
||||
while (node)
|
||||
{
|
||||
wxWindow* win = (wxWindow*) node->Data();
|
||||
|
@@ -528,13 +528,13 @@ void wxListLineData::DoDraw( wxPaintDC *dc, bool hilight, bool paintBG )
|
||||
{
|
||||
if (hilight)
|
||||
{
|
||||
dc->SetBrush( m_hilightBrush );
|
||||
dc->SetPen( wxTRANSPARENT_PEN );
|
||||
dc->SetBrush( * m_hilightBrush );
|
||||
dc->SetPen( * wxTRANSPARENT_PEN );
|
||||
}
|
||||
else
|
||||
{
|
||||
dc->SetBrush( wxWHITE_BRUSH );
|
||||
dc->SetPen( wxTRANSPARENT_PEN );
|
||||
dc->SetBrush( * wxWHITE_BRUSH );
|
||||
dc->SetPen( * wxTRANSPARENT_PEN );
|
||||
}
|
||||
dc->DrawRectangle( m_bound_hilight.x, m_bound_hilight.y,
|
||||
m_bound_hilight.width, m_bound_hilight.height );
|
||||
@@ -615,8 +615,8 @@ void wxListLineData::DrawRubberBand( wxPaintDC *dc, bool on )
|
||||
{
|
||||
if (on)
|
||||
{
|
||||
dc->SetPen( wxBLACK_PEN );
|
||||
dc->SetBrush( wxTRANSPARENT_BRUSH );
|
||||
dc->SetPen( * wxBLACK_PEN );
|
||||
dc->SetBrush( * wxTRANSPARENT_BRUSH );
|
||||
dc->DrawRectangle( m_bound_hilight.x, m_bound_hilight.y,
|
||||
m_bound_hilight.width, m_bound_hilight.height );
|
||||
}
|
||||
@@ -720,7 +720,7 @@ void wxListHeaderWindow::OnPaint( wxPaintEvent &WXUNUSED(event) )
|
||||
|
||||
dc.BeginDrawing();
|
||||
|
||||
dc.SetFont( *GetFont() );
|
||||
dc.SetFont( GetFont() );
|
||||
|
||||
int w = 0;
|
||||
int h = 0;
|
||||
@@ -832,12 +832,12 @@ void wxListHeaderWindow::OnMouse( wxMouseEvent &event )
|
||||
{
|
||||
if (hit_border)
|
||||
{
|
||||
if (m_currentCursor == wxSTANDARD_CURSOR) SetCursor( m_resizeCursor );
|
||||
if (m_currentCursor == wxSTANDARD_CURSOR) SetCursor( * m_resizeCursor );
|
||||
m_currentCursor = m_resizeCursor;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_currentCursor != wxSTANDARD_CURSOR) SetCursor( wxSTANDARD_CURSOR );
|
||||
if (m_currentCursor != wxSTANDARD_CURSOR) SetCursor( * wxSTANDARD_CURSOR );
|
||||
m_currentCursor = wxSTANDARD_CURSOR;
|
||||
}
|
||||
}
|
||||
@@ -1035,7 +1035,7 @@ void wxListMainWindow::OnPaint( wxPaintEvent &WXUNUSED(event) )
|
||||
|
||||
dc.BeginDrawing();
|
||||
|
||||
dc.SetFont( *GetFont() );
|
||||
dc.SetFont( GetFont() );
|
||||
|
||||
wxNode *node = m_lines.First();
|
||||
while (node)
|
||||
@@ -1863,7 +1863,7 @@ void wxListMainWindow::CalculatePositions( void )
|
||||
if (!m_lines.First()) return;
|
||||
|
||||
wxPaintDC dc( this );
|
||||
dc.SetFont( *GetFont() );
|
||||
dc.SetFont( GetFont() );
|
||||
|
||||
int iconSpacing = 0;
|
||||
if (m_mode & wxLC_ICON) iconSpacing = m_normal_spacing;
|
||||
|
@@ -89,7 +89,7 @@ void wxPanel::OnNavigationKey(wxNavigationKeyEvent& event)
|
||||
}
|
||||
|
||||
// first of all, find the window which currently has the focus
|
||||
wxNode *node = GetChildren()->First();
|
||||
wxNode *node = GetChildren().First();
|
||||
wxWindow *winFocus = event.GetCurrentFocus();
|
||||
|
||||
// @@@ no FindFocus() in wxGTK
|
||||
@@ -117,7 +117,7 @@ bool wxPanel::SetFocusToNextChild(wxNode *node, bool bForward)
|
||||
|
||||
bool bFound = FALSE; // have we found a window we will set focus to?
|
||||
|
||||
wxList *children = GetChildren();
|
||||
wxList *children = & GetChildren();
|
||||
if ( node == NULL ) {
|
||||
// we've never had focus before
|
||||
node = bForward ? children->First() : children->Last();
|
||||
|
@@ -527,9 +527,9 @@ void wxSashWindow::SizeWindows()
|
||||
int cw, ch;
|
||||
GetClientSize(&cw, &ch);
|
||||
|
||||
if (GetChildren()->Number() > 0)
|
||||
if (GetChildren().Number() > 0)
|
||||
{
|
||||
wxWindow* child = (wxWindow*) (GetChildren()->First()->Data());
|
||||
wxWindow* child = (wxWindow*) (GetChildren().First()->Data());
|
||||
|
||||
int x = 0;
|
||||
int y = 0;
|
||||
|
@@ -87,7 +87,7 @@ bool wxStatusBar::Create(wxWindow *parent, wxWindowID id,
|
||||
bool success = wxWindow::Create(parent, id, pos, size, style, name);
|
||||
|
||||
// Don't wish this to be found as a child
|
||||
parent->GetChildren()->DeleteObject(this);
|
||||
parent->GetChildren().DeleteObject(this);
|
||||
|
||||
InitColours();
|
||||
|
||||
@@ -172,8 +172,8 @@ void wxStatusBar::OnPaint(wxPaintEvent& WXUNUSED(event) )
|
||||
wxPaintDC dc(this);
|
||||
|
||||
int i;
|
||||
if ( GetFont() )
|
||||
dc.SetFont(*GetFont());
|
||||
if ( GetFont().Ok() )
|
||||
dc.SetFont(GetFont());
|
||||
dc.SetBackgroundMode(wxTRANSPARENT);
|
||||
|
||||
for ( i = 0; i < m_nFields; i ++ )
|
||||
|
@@ -825,7 +825,7 @@ void wxTabView::Draw(wxDC& dc)
|
||||
#ifndef wxUSE_NEW_METHOD
|
||||
if (GetTabStyle() & wxTAB_STYLE_DRAW_BOX)
|
||||
{
|
||||
dc.SetPen(GetShadowPen());
|
||||
dc.SetPen(* GetShadowPen());
|
||||
|
||||
// Draw bottom line
|
||||
dc.DrawLine(
|
||||
@@ -843,7 +843,7 @@ void wxTabView::Draw(wxDC& dc)
|
||||
(GetViewRect().y + GetViewRect().height)
|
||||
);
|
||||
|
||||
dc.SetPen(wxBLACK_PEN);
|
||||
dc.SetPen(* wxBLACK_PEN);
|
||||
|
||||
// Draw bottom line
|
||||
dc.DrawLine(
|
||||
|
@@ -438,7 +438,7 @@ bool wxApp::SendIdleEvents(wxWindow* win)
|
||||
if (event.MoreRequested())
|
||||
needMore = TRUE;
|
||||
|
||||
wxNode* node = win->GetChildren()->First();
|
||||
wxNode* node = win->GetChildren().First();
|
||||
while (node)
|
||||
{
|
||||
wxWindow* win = (wxWindow*) node->Data();
|
||||
|
@@ -98,7 +98,7 @@ void wxButton::SetDefault()
|
||||
// Because it's very hard to find wxButton in the same row,
|
||||
// correction is straighforward: we set resource for all wxButton
|
||||
// in this parent (but not sub panels)
|
||||
for (wxNode * node = parent->GetChildren ()->First (); node; node = node->Next ())
|
||||
for (wxNode * node = parent->GetChildren().First (); node; node = node->Next ())
|
||||
{
|
||||
wxButton *item = (wxButton *) node->Data ();
|
||||
if (item->IsKindOf(CLASSINFO(wxButton)))
|
||||
|
@@ -403,10 +403,10 @@ void wxDC::ComputeScaleAndOrigin(void)
|
||||
{
|
||||
// this is a bit artificial, but we need to force wxDC to think
|
||||
// the pen has changed
|
||||
wxPen* pen = GetPen();
|
||||
wxPen* pen = & GetPen();
|
||||
wxPen tempPen;
|
||||
m_pen = tempPen;
|
||||
SetPen(pen);
|
||||
SetPen(* pen);
|
||||
}
|
||||
};
|
||||
|
||||
|
@@ -1403,7 +1403,7 @@ void wxWindowDC::SetPen( const wxPen &pen )
|
||||
m_currentPenDash = m_pen.GetDash();
|
||||
|
||||
if (m_currentStyle == wxSTIPPLE)
|
||||
m_currentStipple = m_pen.GetStipple ();
|
||||
m_currentStipple = * m_pen.GetStipple ();
|
||||
|
||||
bool sameStyle = (oldStyle == m_currentStyle &&
|
||||
oldFill == m_currentFill &&
|
||||
@@ -1540,7 +1540,7 @@ void wxWindowDC::SetPen( const wxPen &pen )
|
||||
{
|
||||
Pixmap myStipple;
|
||||
|
||||
oldStipple = (wxBitmap*) NULL; // For later reset!!
|
||||
oldStipple = wxNullBitmap; // For later reset!!
|
||||
|
||||
switch (m_currentFill)
|
||||
{
|
||||
@@ -1691,7 +1691,7 @@ void wxWindowDC::SetBrush( const wxBrush &brush )
|
||||
|
||||
m_currentFill = m_brush.GetStyle ();
|
||||
if (m_currentFill == wxSTIPPLE)
|
||||
m_currentStipple = m_brush.GetStipple ();
|
||||
m_currentStipple = * m_brush.GetStipple ();
|
||||
|
||||
wxColour oldBrushColour(m_currentColour);
|
||||
m_currentColour = m_brush.GetColour ();
|
||||
|
@@ -48,8 +48,8 @@ wxMemoryDC::wxMemoryDC(void)
|
||||
XGCValues valReturn;
|
||||
XGetGCValues((Display*) m_display, (GC) m_gc, GCFont, &valReturn);
|
||||
m_oldFont = (WXFont) valReturn.font;
|
||||
SetBrush (wxWHITE_BRUSH);
|
||||
SetPen (wxBLACK_PEN);
|
||||
SetBrush (* wxWHITE_BRUSH);
|
||||
SetPen (* wxBLACK_PEN);
|
||||
};
|
||||
|
||||
wxMemoryDC::wxMemoryDC( wxDC* dc )
|
||||
@@ -77,8 +77,8 @@ wxMemoryDC::wxMemoryDC( wxDC* dc )
|
||||
XGCValues valReturn;
|
||||
XGetGCValues((Display*) m_display, (GC) m_gc, GCFont, &valReturn);
|
||||
m_oldFont = (WXFont) valReturn.font;
|
||||
SetBrush (wxWHITE_BRUSH);
|
||||
SetPen (wxBLACK_PEN);
|
||||
SetBrush (* wxWHITE_BRUSH);
|
||||
SetPen (* wxBLACK_PEN);
|
||||
};
|
||||
|
||||
wxMemoryDC::~wxMemoryDC(void)
|
||||
@@ -117,8 +117,8 @@ void wxMemoryDC::SelectObject( const wxBitmap& bitmap )
|
||||
bool oldOpt = GetOptimization();
|
||||
SetOptimization(FALSE);
|
||||
|
||||
SetBrush (wxWHITE_BRUSH);
|
||||
SetPen (wxBLACK_PEN);
|
||||
SetBrush (* wxWHITE_BRUSH);
|
||||
SetPen (* wxBLACK_PEN);
|
||||
|
||||
SetOptimization(oldOpt);
|
||||
|
||||
|
@@ -378,7 +378,7 @@ void wxFrame::GetClientSize(int *x, int *y) const
|
||||
// it seems that if a frame holds a panel, the menu bar size
|
||||
// gets automatically taken care of --- grano@cs.helsinki.fi 4.4.95
|
||||
bool hasSubPanel = FALSE;
|
||||
for(wxNode* node = GetChildren()->First(); node; node = node->Next())
|
||||
for(wxNode* node = GetChildren().First(); node; node = node->Next())
|
||||
{
|
||||
wxWindow *win = (wxWindow *)node->Data();
|
||||
hasSubPanel = (win->IsKindOf(CLASSINFO(wxPanel)) && !win->IsKindOf(CLASSINFO(wxDialog)));
|
||||
@@ -571,7 +571,7 @@ wxStatusBar *wxFrame::OnCreateStatusBar(int number, long style, wxWindowID id,
|
||||
|
||||
// Set the height according to the font and the border size
|
||||
wxClientDC dc(statusBar);
|
||||
dc.SetFont(* statusBar->GetFont());
|
||||
dc.SetFont(statusBar->GetFont());
|
||||
|
||||
long x, y;
|
||||
dc.GetTextExtent("X", &x, &y);
|
||||
@@ -664,7 +664,7 @@ void wxFrame::SetMenuBar(wxMenuBar *menuBar)
|
||||
void wxFrame::Fit()
|
||||
{
|
||||
// Work out max. size
|
||||
wxNode *node = GetChildren()->First();
|
||||
wxNode *node = GetChildren().First();
|
||||
int max_width = 0;
|
||||
int max_height = 0;
|
||||
while (node)
|
||||
@@ -721,7 +721,7 @@ void wxFrame::OnSize(wxSizeEvent& event)
|
||||
|
||||
// do we have _exactly_ one child?
|
||||
wxWindow *child = NULL;
|
||||
for ( wxNode *node = GetChildren()->First(); node; node = node->Next() )
|
||||
for ( wxNode *node = GetChildren().First(); node; node = node->Next() )
|
||||
{
|
||||
wxWindow *win = (wxWindow *)node->Data();
|
||||
if ( !win->IsKindOf(CLASSINFO(wxFrame)) &&
|
||||
@@ -751,7 +751,7 @@ void wxFrame::OnSize(wxSizeEvent& event)
|
||||
// subwindow found.
|
||||
void wxFrame::OnActivate(wxActivateEvent& event)
|
||||
{
|
||||
for(wxNode *node = GetChildren()->First(); node; node = node->Next())
|
||||
for(wxNode *node = GetChildren().First(); node; node = node->Next())
|
||||
{
|
||||
// Find a child that's a subwindow, but not a dialog box.
|
||||
wxWindow *child = (wxWindow *)node->Data();
|
||||
|
@@ -48,6 +48,7 @@ BEGIN_EVENT_TABLE(wxNotebook, wxControl)
|
||||
EVT_MOUSE_EVENTS(wxNotebook::OnMouseEvent)
|
||||
EVT_SET_FOCUS(wxNotebook::OnSetFocus)
|
||||
EVT_NAVIGATION_KEY(wxNotebook::OnNavigationKey)
|
||||
EVT_IDLE(wxNotebook::OnIdle)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxNotebook, wxControl)
|
||||
@@ -392,6 +393,23 @@ void wxNotebook::OnSize(wxSizeEvent& event)
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
// This was supposed to cure the non-display of the notebook
|
||||
// until the user resizes the window.
|
||||
// What's going on?
|
||||
void wxNotebook::OnIdle(wxIdleEvent& event)
|
||||
{
|
||||
static bool s_bFirstTime = TRUE;
|
||||
if ( s_bFirstTime ) {
|
||||
wxSize sz(GetSize());
|
||||
wxSizeEvent sizeEvent(sz, GetId());
|
||||
sizeEvent.SetEventObject(this);
|
||||
GetEventHandler()->ProcessEvent(sizeEvent);
|
||||
Refresh();
|
||||
s_bFirstTime = FALSE;
|
||||
}
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
// Implementation: calculate the layout of the view rect
|
||||
// and resize the children if required
|
||||
bool wxNotebook::RefreshLayout(bool force)
|
||||
|
@@ -148,7 +148,7 @@ void wxScrollBar::SetScrollbar(int position, int thumbSize, int range, int pageS
|
||||
|
||||
void wxScrollBar::Command(wxCommandEvent& event)
|
||||
{
|
||||
SetPosition(event.m_commandInt);
|
||||
SetThumbPosition(event.m_commandInt);
|
||||
ProcessCommand(event);
|
||||
}
|
||||
|
||||
|
@@ -590,7 +590,7 @@ void wxToolBar::DestroyPixmaps()
|
||||
wxToolBarTool *wxToolBar::AddTool(int index, const wxBitmap& bitmap, const wxBitmap& pushedBitmap,
|
||||
bool toggle, long xPos, long yPos, wxObject *clientData, const wxString& helpString1, const wxString& helpString2)
|
||||
{
|
||||
wxToolBarTool *tool = new wxToolBarTool(index, bitmap, (wxBitmap *)NULL, toggle, xPos, yPos, helpString1, helpString2);
|
||||
wxToolBarTool *tool = new wxToolBarTool(index, bitmap, wxNullBitmap, toggle, xPos, yPos, helpString1, helpString2);
|
||||
tool->m_clientData = clientData;
|
||||
|
||||
if (xPos > -1)
|
||||
|
@@ -571,7 +571,7 @@ wxXSetBusyCursor (wxWindow * win, wxCursor * cursor)
|
||||
|
||||
XFlush (display);
|
||||
|
||||
for(wxNode *node = win->GetChildren()->First (); node; node = node->Next())
|
||||
for(wxNode *node = win->GetChildren().First (); node; node = node->Next())
|
||||
{
|
||||
wxWindow *child = (wxWindow *) node->Data ();
|
||||
wxXSetBusyCursor (child, cursor);
|
||||
|
@@ -942,7 +942,7 @@ void wxWindow::Refresh(bool eraseBack, const wxRect *rect)
|
||||
// Responds to colour changes: passes event on to children.
|
||||
void wxWindow::OnSysColourChanged(wxSysColourChangedEvent& event)
|
||||
{
|
||||
wxNode *node = GetChildren()->First();
|
||||
wxNode *node = GetChildren().First();
|
||||
while ( node )
|
||||
{
|
||||
// Only propagate to non-top-level windows
|
||||
@@ -1371,7 +1371,7 @@ bool wxWindow::IsEnabled() const
|
||||
// it's an application error (pops up a dialog)
|
||||
bool wxWindow::TransferDataToWindow()
|
||||
{
|
||||
wxNode *node = GetChildren()->First();
|
||||
wxNode *node = GetChildren().First();
|
||||
while ( node )
|
||||
{
|
||||
wxWindow *child = (wxWindow *)node->Data();
|
||||
@@ -1391,7 +1391,7 @@ bool wxWindow::TransferDataToWindow()
|
||||
// validation failed: don't quit
|
||||
bool wxWindow::TransferDataFromWindow()
|
||||
{
|
||||
wxNode *node = GetChildren()->First();
|
||||
wxNode *node = GetChildren().First();
|
||||
while ( node )
|
||||
{
|
||||
wxWindow *child = (wxWindow *)node->Data();
|
||||
@@ -1407,7 +1407,7 @@ bool wxWindow::TransferDataFromWindow()
|
||||
|
||||
bool wxWindow::Validate()
|
||||
{
|
||||
wxNode *node = GetChildren()->First();
|
||||
wxNode *node = GetChildren().First();
|
||||
while ( node )
|
||||
{
|
||||
wxWindow *child = (wxWindow *)node->Data();
|
||||
@@ -1430,14 +1430,13 @@ wxWindow *wxWindow::FindFocus()
|
||||
|
||||
void wxWindow::AddChild(wxWindow *child)
|
||||
{
|
||||
GetChildren()->Append(child);
|
||||
GetChildren().Append(child);
|
||||
child->m_windowParent = this;
|
||||
}
|
||||
|
||||
void wxWindow::RemoveChild(wxWindow *child)
|
||||
{
|
||||
if (GetChildren())
|
||||
GetChildren()->DeleteObject(child);
|
||||
GetChildren().DeleteObject(child);
|
||||
child->m_windowParent = NULL;
|
||||
}
|
||||
|
||||
@@ -1450,9 +1449,7 @@ bool wxWindow::Reparent(wxWindow* WXUNUSED(parent))
|
||||
|
||||
void wxWindow::DestroyChildren()
|
||||
{
|
||||
if (GetChildren())
|
||||
{
|
||||
wxNode *node = GetChildren()->First();
|
||||
wxNode *node = GetChildren().First();
|
||||
while (node)
|
||||
{
|
||||
wxNode* next = node->Next();
|
||||
@@ -1460,19 +1457,18 @@ void wxWindow::DestroyChildren()
|
||||
delete child;
|
||||
node = next;
|
||||
}
|
||||
GetChildren()->Clear();
|
||||
GetChildren().Clear();
|
||||
#if 0
|
||||
wxNode *node;
|
||||
while ((node = GetChildren()->First()) != (wxNode *)NULL) {
|
||||
while ((node = GetChildren().First()) != (wxNode *)NULL) {
|
||||
wxWindow *child;
|
||||
if ((child = (wxWindow *)node->Data()) != (wxWindow *)NULL) {
|
||||
delete child;
|
||||
if ( GetChildren()->Member(child) )
|
||||
if ( GetChildren().Member(child) )
|
||||
delete node;
|
||||
}
|
||||
} /* while */
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
void wxWindow::MakeModal(bool modal)
|
||||
@@ -1687,7 +1683,7 @@ bool wxWindow::DoPhase(int phase)
|
||||
{
|
||||
noChanges = 0;
|
||||
noFailures = 0;
|
||||
wxNode *node = GetChildren()->First();
|
||||
wxNode *node = GetChildren().First();
|
||||
while (node)
|
||||
{
|
||||
wxWindow *child = (wxWindow *)node->Data();
|
||||
@@ -1732,7 +1728,7 @@ void wxWindow::ResetConstraints()
|
||||
constr->centreX.SetDone(FALSE);
|
||||
constr->centreY.SetDone(FALSE);
|
||||
}
|
||||
wxNode *node = GetChildren()->First();
|
||||
wxNode *node = GetChildren().First();
|
||||
while (node)
|
||||
{
|
||||
wxWindow *win = (wxWindow *)node->Data();
|
||||
@@ -1791,7 +1787,7 @@ void wxWindow::SetConstraintSizes(bool recurse)
|
||||
|
||||
if (recurse)
|
||||
{
|
||||
wxNode *node = GetChildren()->First();
|
||||
wxNode *node = GetChildren().First();
|
||||
while (node)
|
||||
{
|
||||
wxWindow *win = (wxWindow *)node->Data();
|
||||
@@ -1928,9 +1924,7 @@ bool wxWindow::Close(bool force)
|
||||
wxObject* wxWindow::GetChild(int number) const
|
||||
{
|
||||
// Return a pointer to the Nth object in the window
|
||||
if (!GetChildren())
|
||||
return(NULL) ;
|
||||
wxNode *node = GetChildren()->First();
|
||||
wxNode *node = GetChildren().First();
|
||||
int n = number;
|
||||
while (node && n--)
|
||||
node = node->Next() ;
|
||||
@@ -1961,7 +1955,7 @@ void wxWindow::Fit()
|
||||
{
|
||||
int maxX = 0;
|
||||
int maxY = 0;
|
||||
wxNode *node = GetChildren()->First();
|
||||
wxNode *node = GetChildren().First();
|
||||
while ( node )
|
||||
{
|
||||
wxWindow *win = (wxWindow *)node->Data();
|
||||
@@ -2015,7 +2009,7 @@ wxWindow *wxWindow::FindWindow(long id)
|
||||
if ( GetId() == id)
|
||||
return this;
|
||||
|
||||
wxNode *node = GetChildren()->First();
|
||||
wxNode *node = GetChildren().First();
|
||||
while ( node )
|
||||
{
|
||||
wxWindow *child = (wxWindow *)node->Data();
|
||||
@@ -2032,7 +2026,7 @@ wxWindow *wxWindow::FindWindow(const wxString& name)
|
||||
if ( GetName() == name)
|
||||
return this;
|
||||
|
||||
wxNode *node = GetChildren()->First();
|
||||
wxNode *node = GetChildren().First();
|
||||
while ( node )
|
||||
{
|
||||
wxWindow *child = (wxWindow *)node->Data();
|
||||
|
@@ -869,7 +869,7 @@ bool wxApp::SendIdleEvents(wxWindow* win)
|
||||
if (event.MoreRequested())
|
||||
needMore = TRUE;
|
||||
|
||||
wxNode* node = win->GetChildren()->First();
|
||||
wxNode* node = win->GetChildren().First();
|
||||
while (node)
|
||||
{
|
||||
wxWindow* win = (wxWindow*) node->Data();
|
||||
|
@@ -405,9 +405,9 @@ wxBitmap wxBitmap::GetBitmapForDC(wxDC& dc) const
|
||||
*/
|
||||
if( this->GetPalette() && this->GetPalette()->Ok() && (this->GetPalette()->GetHPALETTE() != 0) )
|
||||
{
|
||||
tmpBitmap.SetPalette(this->GetPalette());
|
||||
tmpBitmap.SetPalette(* this->GetPalette());
|
||||
memDC.SelectObject(tmpBitmap);
|
||||
memDC.SetPalette(this->GetPalette());
|
||||
memDC.SetPalette(* this->GetPalette());
|
||||
hPal = (HPALETTE) this->GetPalette()->GetHPALETTE();
|
||||
}
|
||||
else
|
||||
|
@@ -82,7 +82,7 @@ bool wxBitmapButton::Create(wxWindow *parent, wxWindowID id, const wxBitmap& bit
|
||||
// Subclass again for purposes of dialog editing mode
|
||||
SubclassWin((WXHWND)wx_button);
|
||||
|
||||
SetFont(* parent->GetFont()) ;
|
||||
SetFont(parent->GetFont()) ;
|
||||
|
||||
SetSize(x, y, width, height);
|
||||
ShowWindow(wx_button, SW_SHOW);
|
||||
|
@@ -87,7 +87,7 @@ bool wxButton::Create(wxWindow *parent, wxWindowID id, const wxString& label,
|
||||
// Subclass again for purposes of dialog editing mode
|
||||
SubclassWin((WXHWND)wx_button);
|
||||
|
||||
SetFont(* parent->GetFont());
|
||||
SetFont(parent->GetFont());
|
||||
|
||||
SetSize(x, y, width, height);
|
||||
ShowWindow(wx_button, SW_SHOW);
|
||||
@@ -117,7 +117,7 @@ void wxButton::SetSize(int x, int y, int width, int height, int sizeFlags)
|
||||
int cyf;
|
||||
char buf[300];
|
||||
GetWindowText((HWND) GetHWND(), buf, 300);
|
||||
GetTextExtent(buf, ¤t_width, &cyf,NULL,NULL,GetFont());
|
||||
GetTextExtent(buf, ¤t_width, &cyf,NULL,NULL,& GetFont());
|
||||
|
||||
// If we're prepared to use the existing width, then...
|
||||
if (width == -1 && ((sizeFlags & wxSIZE_AUTO_WIDTH) != wxSIZE_AUTO_WIDTH))
|
||||
@@ -126,7 +126,7 @@ void wxButton::SetSize(int x, int y, int width, int height, int sizeFlags)
|
||||
{
|
||||
int cx;
|
||||
int cy;
|
||||
wxGetCharSize(GetHWND(), &cx, &cy,GetFont());
|
||||
wxGetCharSize(GetHWND(), &cx, &cy,& GetFont());
|
||||
actualWidth = (int)(current_width + 3*cx) ;
|
||||
}
|
||||
|
||||
|
@@ -105,7 +105,7 @@ bool wxCheckBox::Create(wxWindow *parent, wxWindowID id, const wxString& label,
|
||||
// Subclass again for purposes of dialog editing mode
|
||||
SubclassWin(m_hWnd);
|
||||
|
||||
SetFont(*parent->GetFont());
|
||||
SetFont(parent->GetFont());
|
||||
|
||||
SetSize(x, y, width, height);
|
||||
|
||||
@@ -143,7 +143,7 @@ void wxCheckBox::SetSize(int x, int y, int width, int height, int sizeFlags)
|
||||
|
||||
if ( !str.IsEmpty() )
|
||||
{
|
||||
GetTextExtent(str, ¤t_width, &cyf, NULL, NULL, GetFont());
|
||||
GetTextExtent(str, ¤t_width, &cyf, NULL, NULL, & GetFont());
|
||||
if (w1 < 0)
|
||||
w1 = (int)(current_width + RADIO_SIZE);
|
||||
if (h1 < 0)
|
||||
|
@@ -105,7 +105,7 @@ bool wxChoice::Create(wxWindow *parent, wxWindowID id,
|
||||
// Subclass again for purposes of dialog editing mode
|
||||
SubclassWin(m_hWnd);
|
||||
|
||||
SetFont(* parent->GetFont());
|
||||
SetFont(parent->GetFont());
|
||||
|
||||
int i;
|
||||
for (i = 0; i < n; i++)
|
||||
@@ -204,7 +204,7 @@ void wxChoice::SetSize(int x, int y, int width, int height, int sizeFlags)
|
||||
|
||||
int cx; // button font dimensions
|
||||
int cy;
|
||||
wxGetCharSize(GetHWND(), &cx, &cy, GetFont());
|
||||
wxGetCharSize(GetHWND(), &cx, &cy, & GetFont());
|
||||
|
||||
int control_width, control_height;
|
||||
|
||||
@@ -232,7 +232,7 @@ void wxChoice::SetSize(int x, int y, int width, int height, int sizeFlags)
|
||||
for (i = 0; i < m_noStrings; i++)
|
||||
{
|
||||
wxString str(GetString(i));
|
||||
GetTextExtent(str, &len, &ht, NULL, NULL,GetFont());
|
||||
GetTextExtent(str, &len, &ht, NULL, NULL, & GetFont());
|
||||
if ( len > longest)
|
||||
longest = len;
|
||||
}
|
||||
|
@@ -127,7 +127,7 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id,
|
||||
// Subclass again for purposes of dialog editing mode
|
||||
SubclassWin(m_hWnd);
|
||||
|
||||
SetFont(* parent->GetFont());
|
||||
SetFont(parent->GetFont());
|
||||
int i;
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
|
@@ -370,7 +370,7 @@ wxStatusBar *wxFrame::OnCreateStatusBar(int number, long style, wxWindowID id,
|
||||
|
||||
// Set the height according to the font and the border size
|
||||
wxClientDC dc(statusBar);
|
||||
dc.SetFont(* statusBar->GetFont());
|
||||
dc.SetFont(statusBar->GetFont());
|
||||
|
||||
long x, y;
|
||||
dc.GetTextExtent("X", &x, &y);
|
||||
@@ -508,7 +508,7 @@ bool wxFrame::LoadAccelerators(const wxString& table)
|
||||
void wxFrame::Fit(void)
|
||||
{
|
||||
// Work out max. size
|
||||
wxNode *node = GetChildren()->First();
|
||||
wxNode *node = GetChildren().First();
|
||||
int max_width = 0;
|
||||
int max_height = 0;
|
||||
while (node)
|
||||
@@ -801,7 +801,7 @@ void wxFrame::OnSize(wxSizeEvent& event)
|
||||
|
||||
// do we have _exactly_ one child?
|
||||
wxWindow *child = NULL;
|
||||
for ( wxNode *node = GetChildren()->First(); node; node = node->Next() )
|
||||
for ( wxNode *node = GetChildren().First(); node; node = node->Next() )
|
||||
{
|
||||
wxWindow *win = (wxWindow *)node->Data();
|
||||
if ( !win->IsKindOf(CLASSINFO(wxFrame)) &&
|
||||
@@ -831,7 +831,7 @@ void wxFrame::OnSize(wxSizeEvent& event)
|
||||
// subwindow found.
|
||||
void wxFrame::OnActivate(wxActivateEvent& event)
|
||||
{
|
||||
for(wxNode *node = GetChildren()->First(); node; node = node->Next())
|
||||
for(wxNode *node = GetChildren().First(); node; node = node->Next())
|
||||
{
|
||||
// Find a child that's a subwindow, but not a dialog box.
|
||||
wxWindow *child = (wxWindow *)node->Data();
|
||||
@@ -1037,7 +1037,7 @@ void wxFrame::PositionToolBar(void)
|
||||
// propagate our state change to all child frames
|
||||
void wxFrame::IconizeChildFrames(bool bIconize)
|
||||
{
|
||||
for ( wxNode *node = GetChildren()->First(); node; node = node->Next() ) {
|
||||
for ( wxNode *node = GetChildren().First(); node; node = node->Next() ) {
|
||||
wxWindow *win = (wxWindow *)node->Data();
|
||||
if ( win->IsKindOf(CLASSINFO(wxFrame)) ) {
|
||||
((wxFrame *)win)->Iconize(bIconize);
|
||||
|
@@ -81,7 +81,7 @@ bool wxGauge95::Create(wxWindow *parent, wxWindowID id,
|
||||
|
||||
SendMessage((HWND) GetHWND(), PBM_SETRANGE, 0, MAKELPARAM(0, range));
|
||||
|
||||
SetFont(* parent->GetFont());
|
||||
SetFont(parent->GetFont());
|
||||
|
||||
if (width == -1)
|
||||
width = 50;
|
||||
|
@@ -128,7 +128,7 @@ bool wxGaugeMSW::Create(wxWindow *parent, wxWindowID id,
|
||||
SendMessage((HWND) GetHWND(), ZYZG_SETFGCOLOR, 0, RGB(GetForegroundColour().Red(), GetForegroundColour().Green(), GetForegroundColour().Blue()));
|
||||
SendMessage((HWND) GetHWND(), ZYZG_SETBKCOLOR, 0, RGB(GetBackgroundColour().Red(), GetBackgroundColour().Green(), GetBackgroundColour().Blue()));
|
||||
|
||||
SetFont(* parent->GetFont());
|
||||
SetFont(parent->GetFont());
|
||||
|
||||
if (width == -1)
|
||||
width = 50;
|
||||
|
@@ -167,7 +167,7 @@ bool wxImageList::Draw(int index, wxDC& dc, int x, int y,
|
||||
|
||||
if ( solidBackground )
|
||||
{
|
||||
wxBrush *brush = dc.GetBackground();
|
||||
wxBrush *brush = & dc.GetBackground();
|
||||
if ( brush && brush->Ok())
|
||||
{
|
||||
wxColour col(brush->GetColour());
|
||||
|
@@ -244,7 +244,7 @@ bool wxListBox::Create(wxWindow *parent, wxWindowID id,
|
||||
if ( (m_windowStyle & wxLB_MULTIPLE) == 0 )
|
||||
SendMessage(hwnd, LB_SETCURSEL, 0, 0);
|
||||
|
||||
SetFont(* parent->GetFont());
|
||||
SetFont(parent->GetFont());
|
||||
|
||||
SetSize(x, y, width, height);
|
||||
|
||||
@@ -495,7 +495,7 @@ void wxListBox::SetSize(int x, int y, int width, int height, int sizeFlags)
|
||||
int cx; // button font dimensions
|
||||
int cy;
|
||||
|
||||
wxGetCharSize(GetHWND(), &cx, &cy,GetFont());
|
||||
wxGetCharSize(GetHWND(), &cx, &cy, & GetFont());
|
||||
|
||||
float control_width, control_height, control_x, control_y;
|
||||
|
||||
@@ -540,8 +540,8 @@ void wxListBox::SetHorizontalExtent(const wxString& s)
|
||||
int existingExtent = (int)SendMessage(hwnd, LB_GETHORIZONTALEXTENT, 0, 0L);
|
||||
HDC dc = GetWindowDC(hwnd);
|
||||
HFONT oldFont = 0;
|
||||
if (GetFont() && GetFont()->GetResourceHandle())
|
||||
oldFont = (HFONT) ::SelectObject(dc, (HFONT) GetFont()->GetResourceHandle());
|
||||
if (GetFont().Ok() && GetFont().GetResourceHandle())
|
||||
oldFont = (HFONT) ::SelectObject(dc, (HFONT) GetFont().GetResourceHandle());
|
||||
|
||||
GetTextMetrics(dc, &lpTextMetric);
|
||||
SIZE extentXY;
|
||||
@@ -561,8 +561,8 @@ void wxListBox::SetHorizontalExtent(const wxString& s)
|
||||
int largestExtent = 0;
|
||||
HDC dc = GetWindowDC(hwnd);
|
||||
HFONT oldFont = 0;
|
||||
if (GetFont() && GetFont()->GetResourceHandle())
|
||||
oldFont = (HFONT) ::SelectObject(dc, (HFONT) GetFont()->GetResourceHandle());
|
||||
if (GetFont().Ok() && GetFont().GetResourceHandle())
|
||||
oldFont = (HFONT) ::SelectObject(dc, (HFONT) GetFont().GetResourceHandle());
|
||||
|
||||
GetTextMetrics(dc, &lpTextMetric);
|
||||
int i;
|
||||
|
@@ -527,7 +527,7 @@ bool wxMDIParentFrame::MSWOnCommand(WXWORD id, WXWORD cmd, WXHWND control)
|
||||
}
|
||||
if (id >= wxFIRST_MDI_CHILD && id <= wxLAST_MDI_CHILD)
|
||||
{
|
||||
wxNode* node = GetChildren()->First();
|
||||
wxNode* node = GetChildren().First();
|
||||
while (node)
|
||||
{
|
||||
wxWindow* child = (wxWindow*) node->Data();
|
||||
|
@@ -96,7 +96,7 @@ wxWindow* wxWindow::GetWindowChild1(wxWindowID& id)
|
||||
if ( m_windowId == id )
|
||||
return this;
|
||||
|
||||
wxNode *node = GetChildren()->First();
|
||||
wxNode *node = GetChildren().First();
|
||||
while ( node )
|
||||
{
|
||||
wxWindow* child = (wxWindow*) node->Data();
|
||||
|
@@ -154,7 +154,7 @@ bool wxRadioBox::Create(wxWindow *parent, wxWindowID id, const wxString& title,
|
||||
}
|
||||
#endif
|
||||
|
||||
SetFont(* parent->GetFont());
|
||||
SetFont(parent->GetFont());
|
||||
|
||||
SubclassWin((WXHWND)m_hWnd);
|
||||
|
||||
@@ -183,10 +183,10 @@ bool wxRadioBox::Create(wxWindow *parent, wxWindowID id, const wxString& title,
|
||||
m_useCtl3D = TRUE;
|
||||
}
|
||||
#endif
|
||||
if (GetFont())
|
||||
if (GetFont().Ok())
|
||||
{
|
||||
SendMessage((HWND)m_radioButtons[i],WM_SETFONT,
|
||||
(WPARAM)GetFont()->GetResourceHandle(),0L);
|
||||
(WPARAM)GetFont().GetResourceHandle(),0L);
|
||||
}
|
||||
m_subControls.Append((wxObject *)newId);
|
||||
}
|
||||
@@ -262,7 +262,7 @@ bool wxRadioBox::Create(wxWindow *parent, wxWindowID id, const wxString& title,
|
||||
}
|
||||
#endif
|
||||
|
||||
SetFont(* parent->GetFont());
|
||||
SetFont(parent->GetFont());
|
||||
|
||||
// Subclass again for purposes of dialog editing mode
|
||||
SubclassWin((WXHWND)m_hWnd);
|
||||
@@ -407,7 +407,7 @@ void wxRadioBox::SetSize(int x, int y, int width, int height, int sizeFlags)
|
||||
int current_width, cyf;
|
||||
|
||||
int cx1,cy1 ;
|
||||
wxGetCharSize(m_hWnd, &cx1, &cy1, GetFont());
|
||||
wxGetCharSize(m_hWnd, &cx1, &cy1, & GetFont());
|
||||
// Attempt to have a look coherent with other platforms:
|
||||
// We compute the biggest toggle dim, then we align all
|
||||
// items according this value.
|
||||
@@ -423,7 +423,7 @@ void wxRadioBox::SetSize(int x, int y, int width, int height, int sizeFlags)
|
||||
{
|
||||
// It's a labelled toggle
|
||||
GetWindowText((HWND) m_radioButtons[i], buf, 300);
|
||||
GetTextExtent(buf, ¤t_width, &cyf,NULL,NULL, GetFont());
|
||||
GetTextExtent(buf, ¤t_width, &cyf,NULL,NULL, & GetFont());
|
||||
eachWidth = (int)(current_width + RADIO_SIZE);
|
||||
eachHeight = (int)((3*cyf)/2);
|
||||
}
|
||||
@@ -503,7 +503,7 @@ void wxRadioBox::SetSize(int x, int y, int width, int height, int sizeFlags)
|
||||
{
|
||||
// It's a labeled item
|
||||
GetWindowText((HWND) m_radioButtons[i], buf, 300);
|
||||
GetTextExtent(buf, ¤t_width, &cyf,NULL,NULL,GetFont());
|
||||
GetTextExtent(buf, ¤t_width, &cyf,NULL,NULL, & GetFont());
|
||||
|
||||
// How do we find out radio button bitmap size!!
|
||||
// By adjusting them carefully, manually :-)
|
||||
|
@@ -103,7 +103,7 @@ bool wxRadioButton::Create(wxWindow *parent, wxWindowID id,
|
||||
}
|
||||
#endif
|
||||
|
||||
SetFont(* parent->GetFont());
|
||||
SetFont(parent->GetFont());
|
||||
|
||||
// Subclass again for purposes of dialog editing mode
|
||||
SubclassWin((WXHWND)m_hWnd);
|
||||
@@ -114,7 +114,7 @@ bool wxRadioButton::Create(wxWindow *parent, wxWindowID id,
|
||||
if (label != "")
|
||||
{
|
||||
int label_width, label_height;
|
||||
GetTextExtent(label, &label_width, &label_height, NULL, NULL, GetFont());
|
||||
GetTextExtent(label, &label_width, &label_height, NULL, NULL, & GetFont());
|
||||
if (width < 0)
|
||||
width = (int)(label_width + RADIO_SIZE);
|
||||
if (height<0)
|
||||
|
@@ -100,7 +100,7 @@ bool wxScrollBar::Create(wxWindow *parent, wxWindowID id,
|
||||
::SetScrollPos(scroll_bar, SB_CTL, 0, FALSE);
|
||||
ShowWindow(scroll_bar, SW_SHOW);
|
||||
|
||||
SetFont(* parent->GetFont());
|
||||
SetFont(parent->GetFont());
|
||||
|
||||
m_hWnd = (WXHWND)scroll_bar;
|
||||
|
||||
|
@@ -156,7 +156,7 @@ bool wxSlider95::Create(wxWindow *parent, wxWindowID id,
|
||||
|
||||
SetWindowText((HWND) m_hWnd, "");
|
||||
|
||||
SetFont(* parent->GetFont());
|
||||
SetFont(parent->GetFont());
|
||||
|
||||
if ( m_windowStyle & wxSL_LABELS )
|
||||
{
|
||||
@@ -168,20 +168,19 @@ bool wxSlider95::Create(wxWindow *parent, wxWindowID id,
|
||||
wxGetInstance(), NULL);
|
||||
|
||||
|
||||
if (GetFont())
|
||||
if (GetFont().Ok())
|
||||
{
|
||||
// GetFont()->RealizeResource();
|
||||
if (GetFont()->GetResourceHandle())
|
||||
if (GetFont().GetResourceHandle())
|
||||
{
|
||||
if ( m_staticMin )
|
||||
SendMessage((HWND)m_staticMin,WM_SETFONT,
|
||||
(WPARAM)GetFont()->GetResourceHandle(),0L);
|
||||
(WPARAM)GetFont().GetResourceHandle(),0L);
|
||||
if ( m_staticMax )
|
||||
SendMessage((HWND)m_staticMax,WM_SETFONT,
|
||||
(WPARAM)GetFont()->GetResourceHandle(),0L);
|
||||
(WPARAM)GetFont().GetResourceHandle(),0L);
|
||||
if (m_staticValue)
|
||||
SendMessage((HWND)m_staticValue,WM_SETFONT,
|
||||
(WPARAM)GetFont()->GetResourceHandle(),0L);
|
||||
(WPARAM)GetFont().GetResourceHandle(),0L);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -369,7 +368,7 @@ void wxSlider95::SetSize(int x, int y, int width, int height, int sizeFlags)
|
||||
int cy;
|
||||
int cyf;
|
||||
|
||||
wxGetCharSize(GetHWND(), &cx, &cy,GetFont());
|
||||
wxGetCharSize(GetHWND(), &cx, &cy, & GetFont());
|
||||
|
||||
if ((m_windowStyle & wxSL_VERTICAL) != wxSL_VERTICAL)
|
||||
{
|
||||
@@ -378,12 +377,12 @@ void wxSlider95::SetSize(int x, int y, int width, int height, int sizeFlags)
|
||||
int min_len = 0;
|
||||
|
||||
GetWindowText((HWND) m_staticMin, buf, 300);
|
||||
GetTextExtent(buf, &min_len, &cyf,NULL,NULL, GetFont());
|
||||
GetTextExtent(buf, &min_len, &cyf,NULL,NULL, & GetFont());
|
||||
|
||||
int max_len = 0;
|
||||
|
||||
GetWindowText((HWND) m_staticMax, buf, 300);
|
||||
GetTextExtent(buf, &max_len, &cyf,NULL,NULL, GetFont());
|
||||
GetTextExtent(buf, &max_len, &cyf,NULL,NULL, & GetFont());
|
||||
if (m_staticValue)
|
||||
{
|
||||
int new_width = (int)(wxMax(min_len, max_len));
|
||||
@@ -439,11 +438,11 @@ void wxSlider95::SetSize(int x, int y, int width, int height, int sizeFlags)
|
||||
{
|
||||
int min_len;
|
||||
GetWindowText((HWND) m_staticMin, buf, 300);
|
||||
GetTextExtent(buf, &min_len, &cyf,NULL,NULL,GetFont());
|
||||
GetTextExtent(buf, &min_len, &cyf,NULL,NULL, & GetFont());
|
||||
|
||||
int max_len;
|
||||
GetWindowText((HWND) m_staticMax, buf, 300);
|
||||
GetTextExtent(buf, &max_len, &cyf,NULL,NULL, GetFont());
|
||||
GetTextExtent(buf, &max_len, &cyf,NULL,NULL, & GetFont());
|
||||
|
||||
if (m_staticValue)
|
||||
{
|
||||
|
@@ -136,22 +136,22 @@ bool wxSliderMSW::Create(wxWindow *parent, wxWindowID id,
|
||||
0, 0, 0, 0, (HWND) parent->GetHWND(), (HMENU)NewControlId(),
|
||||
wxGetInstance(), NULL);
|
||||
|
||||
SetFont(* parent->GetFont());
|
||||
SetFont(parent->GetFont());
|
||||
|
||||
if (GetFont())
|
||||
if (GetFont().Ok())
|
||||
{
|
||||
// GetFont()->RealizeResource();
|
||||
if (GetFont()->GetResourceHandle())
|
||||
if (GetFont().GetResourceHandle())
|
||||
{
|
||||
if ( m_staticMin )
|
||||
SendMessage((HWND)m_staticMin,WM_SETFONT,
|
||||
(WPARAM)GetFont()->GetResourceHandle(),0L);
|
||||
(WPARAM)GetFont().GetResourceHandle(),0L);
|
||||
if ( m_staticMax )
|
||||
SendMessage((HWND)m_staticMax,WM_SETFONT,
|
||||
(WPARAM)GetFont()->GetResourceHandle(),0L);
|
||||
(WPARAM)GetFont().GetResourceHandle(),0L);
|
||||
if (m_staticValue)
|
||||
SendMessage((HWND)m_staticValue,WM_SETFONT,
|
||||
(WPARAM)GetFont()->GetResourceHandle(),0L);
|
||||
(WPARAM)GetFont().GetResourceHandle(),0L);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -340,7 +340,7 @@ void wxSliderMSW::SetSize(int x, int y, int width, int height, int sizeFlags)
|
||||
int cy;
|
||||
int cyf;
|
||||
|
||||
wxGetCharSize(GetHWND(), &cx, &cy,GetFont());
|
||||
wxGetCharSize(GetHWND(), &cx, &cy,& GetFont());
|
||||
|
||||
if ((m_windowStyle & wxSL_VERTICAL) != wxSL_VERTICAL)
|
||||
{
|
||||
@@ -349,12 +349,12 @@ void wxSliderMSW::SetSize(int x, int y, int width, int height, int sizeFlags)
|
||||
int min_len = 0;
|
||||
|
||||
GetWindowText((HWND) m_staticMin, buf, 300);
|
||||
GetTextExtent(buf, &min_len, &cyf,NULL,NULL, GetFont());
|
||||
GetTextExtent(buf, &min_len, &cyf,NULL,NULL, & GetFont());
|
||||
|
||||
int max_len = 0;
|
||||
|
||||
GetWindowText((HWND) m_staticMax, buf, 300);
|
||||
GetTextExtent(buf, &max_len, &cyf,NULL,NULL, GetFont());
|
||||
GetTextExtent(buf, &max_len, &cyf,NULL,NULL, & GetFont());
|
||||
if (m_staticValue)
|
||||
{
|
||||
int new_width = (int)(wxMax(min_len, max_len));
|
||||
@@ -400,11 +400,11 @@ void wxSliderMSW::SetSize(int x, int y, int width, int height, int sizeFlags)
|
||||
{
|
||||
int min_len;
|
||||
GetWindowText((HWND) m_staticMin, buf, 300);
|
||||
GetTextExtent(buf, &min_len, &cyf,NULL,NULL,GetFont());
|
||||
GetTextExtent(buf, &min_len, &cyf,NULL,NULL,& GetFont());
|
||||
|
||||
int max_len;
|
||||
GetWindowText((HWND) m_staticMax, buf, 300);
|
||||
GetTextExtent(buf, &max_len, &cyf,NULL,NULL, GetFont());
|
||||
GetTextExtent(buf, &max_len, &cyf,NULL,NULL, & GetFont());
|
||||
|
||||
if (m_staticValue)
|
||||
{
|
||||
|
@@ -84,7 +84,7 @@ bool wxStaticBitmap::Create(wxWindow *parent, wxWindowID id,
|
||||
// Subclass again for purposes of dialog editing mode
|
||||
SubclassWin(m_hWnd);
|
||||
|
||||
SetFont(* GetParent()->GetFont());
|
||||
SetFont(GetParent()->GetFont());
|
||||
|
||||
SetSize(x, y, width, height);
|
||||
return TRUE;
|
||||
|
@@ -89,7 +89,7 @@ bool wxStaticBox::Create(wxWindow *parent, wxWindowID id,
|
||||
// Subclass again for purposes of dialog editing mode
|
||||
SubclassWin(GetHWND());
|
||||
|
||||
SetFont(* parent->GetFont());
|
||||
SetFont(parent->GetFont());
|
||||
|
||||
SetSize(x, y, width, height);
|
||||
ShowWindow(wx_button, SW_SHOW);
|
||||
@@ -131,10 +131,10 @@ void wxStaticBox::SetSize(int x, int y, int width, int height, int sizeFlags)
|
||||
int cy;
|
||||
int cyf;
|
||||
|
||||
wxGetCharSize(GetHWND(), &cx, &cy,GetFont());
|
||||
wxGetCharSize(GetHWND(), &cx, &cy, & GetFont());
|
||||
|
||||
GetTextExtent(wxGetWindowText(m_hWnd), ¤t_width, &cyf,
|
||||
NULL,NULL,GetFont());
|
||||
NULL,NULL, & GetFont());
|
||||
if ( w1 < 0 )
|
||||
w1 = current_width + 3*cx;
|
||||
if ( h1 < 0 )
|
||||
|
@@ -86,7 +86,7 @@ bool wxStaticText::Create(wxWindow *parent, wxWindowID id,
|
||||
|
||||
SubclassWin(m_hWnd);
|
||||
|
||||
SetFont(* parent->GetFont());
|
||||
SetFont(parent->GetFont());
|
||||
SetSize(x, y, width, height);
|
||||
|
||||
return TRUE;
|
||||
@@ -114,7 +114,7 @@ void wxStaticText::SetSize(int x, int y, int width, int height, int sizeFlags)
|
||||
int cyf;
|
||||
|
||||
::GetWindowText((HWND) GetHWND(), buf, 300);
|
||||
GetTextExtent(buf, ¤t_width, &cyf, NULL, NULL,GetFont());
|
||||
GetTextExtent(buf, ¤t_width, &cyf, NULL, NULL, & GetFont());
|
||||
|
||||
int ww, hh;
|
||||
GetSize(&ww, &hh);
|
||||
@@ -126,7 +126,7 @@ void wxStaticText::SetSize(int x, int y, int width, int height, int sizeFlags)
|
||||
{
|
||||
int cx;
|
||||
int cy;
|
||||
wxGetCharSize(GetHWND(), &cx, &cy,GetFont());
|
||||
wxGetCharSize(GetHWND(), &cx, &cy, & GetFont());
|
||||
actualWidth = (int)(current_width + cx) ;
|
||||
}
|
||||
|
||||
@@ -159,7 +159,7 @@ void wxStaticText::SetLabel(const wxString& label)
|
||||
::ScreenToClient((HWND) parent->GetHWND(), &point);
|
||||
}
|
||||
|
||||
GetTextExtent(label, &w, &h, NULL, NULL, GetFont());
|
||||
GetTextExtent(label, &w, &h, NULL, NULL, & GetFont());
|
||||
MoveWindow((HWND) GetHWND(), point.x, point.y, (int)(w + 10), (int)h,
|
||||
TRUE);
|
||||
SetWindowText((HWND) GetHWND(), (const char *)label);
|
||||
|
@@ -348,7 +348,7 @@ wxToolBarTool *wxToolBarMSW::AddTool(int index, const wxBitmap& bitmap, const wx
|
||||
|
||||
wxToolBarTool *tool = new wxToolBarTool(index, bitmap, *bitmap2, toggle, xPos, yPos, helpString1, helpString2);
|
||||
#else
|
||||
wxToolBarTool *tool = new wxToolBarTool(index, bitmap, (wxBitmap *)NULL, toggle, xPos, yPos, helpString1, helpString2);
|
||||
wxToolBarTool *tool = new wxToolBarTool(index, bitmap, wxNullBitmap, toggle, xPos, yPos, helpString1, helpString2);
|
||||
#endif
|
||||
|
||||
tool->m_clientData = clientData;
|
||||
|
@@ -200,9 +200,9 @@ bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id,
|
||||
|
||||
SubclassWin(GetHWND());
|
||||
|
||||
if ( parent->GetFont() && parent->GetFont()->Ok() )
|
||||
if ( parent->GetFont().Ok() && parent->GetFont().Ok() )
|
||||
{
|
||||
SetFont(* parent->GetFont());
|
||||
SetFont(parent->GetFont());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -328,7 +328,7 @@ void wxTextCtrl::SetSize(int x, int y, int width, int height, int sizeFlags)
|
||||
int cx; // button font dimensions
|
||||
int cy;
|
||||
|
||||
wxGetCharSize(GetHWND(), &cx, &cy,GetFont());
|
||||
wxGetCharSize(GetHWND(), &cx, &cy, & GetFont());
|
||||
|
||||
int control_width, control_height, control_x, control_y;
|
||||
|
||||
|
@@ -108,9 +108,9 @@ END_EVENT_TABLE()
|
||||
// Find an item given the MS Windows id
|
||||
wxWindow *wxWindow::FindItem(int id) const
|
||||
{
|
||||
if (!GetChildren())
|
||||
return NULL;
|
||||
wxNode *current = GetChildren()->First();
|
||||
// if (!GetChildren())
|
||||
// return NULL;
|
||||
wxNode *current = GetChildren().First();
|
||||
while (current)
|
||||
{
|
||||
wxWindow *childWin = (wxWindow *)current->Data();
|
||||
@@ -139,9 +139,9 @@ wxWindow *wxWindow::FindItem(int id) const
|
||||
// Find an item given the MS Windows handle
|
||||
wxWindow *wxWindow::FindItemByHWND(WXHWND hWnd, bool controlOnly) const
|
||||
{
|
||||
if (!GetChildren())
|
||||
return NULL;
|
||||
wxNode *current = GetChildren()->First();
|
||||
// if (!GetChildren())
|
||||
// return NULL;
|
||||
wxNode *current = GetChildren().First();
|
||||
while (current)
|
||||
{
|
||||
wxObject *obj = (wxObject *)current->Data() ;
|
||||
@@ -1594,7 +1594,7 @@ long wxWindow::MSWOnNotify(WXWPARAM wParam, WXLPARAM lParam)
|
||||
{
|
||||
// Rely on MSWNotify to check whether the message
|
||||
// belongs to the window or not
|
||||
wxNode *node = GetChildren()->First();
|
||||
wxNode *node = GetChildren().First();
|
||||
while (node)
|
||||
{
|
||||
wxWindow *child = (wxWindow *)node->Data();
|
||||
@@ -1818,7 +1818,7 @@ long wxWindow::MSWOnQueryNewPalette()
|
||||
// Responds to colour changes: passes event on to children.
|
||||
void wxWindow::OnSysColourChanged(wxSysColourChangedEvent& event)
|
||||
{
|
||||
wxNode *node = GetChildren()->First();
|
||||
wxNode *node = GetChildren().First();
|
||||
while ( node )
|
||||
{
|
||||
// Only propagate to non-top-level windows
|
||||
@@ -3493,7 +3493,7 @@ bool wxWindow::IsEnabled(void) const
|
||||
// it's an application error (pops up a dialog)
|
||||
bool wxWindow::TransferDataToWindow()
|
||||
{
|
||||
wxNode *node = GetChildren()->First();
|
||||
wxNode *node = GetChildren().First();
|
||||
while ( node )
|
||||
{
|
||||
wxWindow *child = (wxWindow *)node->Data();
|
||||
@@ -3513,7 +3513,7 @@ bool wxWindow::TransferDataToWindow()
|
||||
// validation failed: don't quit
|
||||
bool wxWindow::TransferDataFromWindow()
|
||||
{
|
||||
wxNode *node = GetChildren()->First();
|
||||
wxNode *node = GetChildren().First();
|
||||
while ( node )
|
||||
{
|
||||
wxWindow *child = (wxWindow *)node->Data();
|
||||
@@ -3529,7 +3529,7 @@ bool wxWindow::TransferDataFromWindow()
|
||||
|
||||
bool wxWindow::Validate()
|
||||
{
|
||||
wxNode *node = GetChildren()->First();
|
||||
wxNode *node = GetChildren().First();
|
||||
while ( node )
|
||||
{
|
||||
wxWindow *child = (wxWindow *)node->Data();
|
||||
@@ -3556,30 +3556,28 @@ wxWindow *wxWindow::FindFocus()
|
||||
|
||||
void wxWindow::AddChild(wxWindow *child)
|
||||
{
|
||||
GetChildren()->Append(child);
|
||||
GetChildren().Append(child);
|
||||
child->m_windowParent = this;
|
||||
}
|
||||
|
||||
void wxWindow::RemoveChild(wxWindow *child)
|
||||
{
|
||||
if (GetChildren())
|
||||
GetChildren()->DeleteObject(child);
|
||||
// if (GetChildren())
|
||||
GetChildren().DeleteObject(child);
|
||||
child->m_windowParent = NULL;
|
||||
}
|
||||
|
||||
void wxWindow::DestroyChildren()
|
||||
{
|
||||
if (GetChildren()) {
|
||||
wxNode *node;
|
||||
while ((node = GetChildren()->First()) != (wxNode *)NULL) {
|
||||
while ((node = GetChildren().First()) != (wxNode *)NULL) {
|
||||
wxWindow *child;
|
||||
if ((child = (wxWindow *)node->Data()) != (wxWindow *)NULL) {
|
||||
delete child;
|
||||
if ( GetChildren()->Member(child) )
|
||||
if ( GetChildren().Member(child) )
|
||||
delete node;
|
||||
}
|
||||
} /* while */
|
||||
}
|
||||
}
|
||||
|
||||
void wxWindow::MakeModal(bool modal)
|
||||
@@ -3794,7 +3792,7 @@ bool wxWindow::DoPhase(int phase)
|
||||
{
|
||||
noChanges = 0;
|
||||
noFailures = 0;
|
||||
wxNode *node = GetChildren()->First();
|
||||
wxNode *node = GetChildren().First();
|
||||
while (node)
|
||||
{
|
||||
wxWindow *child = (wxWindow *)node->Data();
|
||||
@@ -3839,7 +3837,7 @@ void wxWindow::ResetConstraints()
|
||||
constr->centreX.SetDone(FALSE);
|
||||
constr->centreY.SetDone(FALSE);
|
||||
}
|
||||
wxNode *node = GetChildren()->First();
|
||||
wxNode *node = GetChildren().First();
|
||||
while (node)
|
||||
{
|
||||
wxWindow *win = (wxWindow *)node->Data();
|
||||
@@ -3898,7 +3896,7 @@ void wxWindow::SetConstraintSizes(bool recurse)
|
||||
|
||||
if (recurse)
|
||||
{
|
||||
wxNode *node = GetChildren()->First();
|
||||
wxNode *node = GetChildren().First();
|
||||
while (node)
|
||||
{
|
||||
wxWindow *win = (wxWindow *)node->Data();
|
||||
@@ -4036,9 +4034,9 @@ bool wxWindow::Close(bool force)
|
||||
wxObject* wxWindow::GetChild(int number) const
|
||||
{
|
||||
// Return a pointer to the Nth object in the Panel
|
||||
if (!GetChildren())
|
||||
return(NULL) ;
|
||||
wxNode *node = GetChildren()->First();
|
||||
// if (!GetChildren())
|
||||
// return(NULL) ;
|
||||
wxNode *node = GetChildren().First();
|
||||
int n = number;
|
||||
while (node && n--)
|
||||
node = node->Next() ;
|
||||
@@ -4100,7 +4098,7 @@ void wxWindow::Fit()
|
||||
{
|
||||
int maxX = 0;
|
||||
int maxY = 0;
|
||||
wxNode *node = GetChildren()->First();
|
||||
wxNode *node = GetChildren().First();
|
||||
while ( node )
|
||||
{
|
||||
wxWindow *win = (wxWindow *)node->Data();
|
||||
@@ -4133,7 +4131,7 @@ wxWindow *wxWindow::FindWindow(long id)
|
||||
if ( GetId() == id)
|
||||
return this;
|
||||
|
||||
wxNode *node = GetChildren()->First();
|
||||
wxNode *node = GetChildren().First();
|
||||
while ( node )
|
||||
{
|
||||
wxWindow *child = (wxWindow *)node->Data();
|
||||
@@ -4150,7 +4148,7 @@ wxWindow *wxWindow::FindWindow(const wxString& name)
|
||||
if ( GetName() == name)
|
||||
return this;
|
||||
|
||||
wxNode *node = GetChildren()->First();
|
||||
wxNode *node = GetChildren().First();
|
||||
while ( node )
|
||||
{
|
||||
wxWindow *child = (wxWindow *)node->Data();
|
||||
|
@@ -326,7 +326,7 @@ bool wxApp::SendIdleEvents(wxWindow* win)
|
||||
if (event.MoreRequested())
|
||||
needMore = TRUE;
|
||||
|
||||
wxNode* node = win->GetChildren()->First();
|
||||
wxNode* node = win->GetChildren().First();
|
||||
while (node)
|
||||
{
|
||||
wxWindow* win = (wxWindow*) node->Data();
|
||||
|
@@ -30,8 +30,8 @@ bool wxBitmapButton::Create(wxWindow *parent, wxWindowID id, const wxBitmap& bit
|
||||
SetValidator(validator);
|
||||
parent->AddChild(this);
|
||||
|
||||
m_backgroundColour = parent->GetDefaultBackgroundColour() ;
|
||||
m_foregroundColour = parent->GetDefaultForegroundColour() ;
|
||||
m_backgroundColour = parent->GetBackgroundColour() ;
|
||||
m_foregroundColour = parent->GetForegroundColour() ;
|
||||
m_windowStyle = style;
|
||||
m_marginX = 0;
|
||||
m_marginY = 0;
|
||||
|
@@ -15,6 +15,10 @@
|
||||
|
||||
#include "wx/wx.h"
|
||||
|
||||
#if wxUSE_POSTSCRIPT
|
||||
#include "wx/postscrp.h"
|
||||
#endif
|
||||
|
||||
#define _MAXPATHLEN 500
|
||||
|
||||
// Useful buffer, initialized in CommonInit
|
||||
|
@@ -376,10 +376,10 @@ void wxDC::ComputeScaleAndOrigin(void)
|
||||
{
|
||||
// this is a bit artificial, but we need to force wxDC to think
|
||||
// the pen has changed
|
||||
wxPen* pen = GetPen();
|
||||
wxPen* pen = & GetPen();
|
||||
wxPen tempPen;
|
||||
m_pen = tempPen;
|
||||
SetPen(pen);
|
||||
SetPen(* pen);
|
||||
}
|
||||
};
|
||||
|
||||
|
@@ -15,6 +15,7 @@
|
||||
|
||||
#include "wx/dcclient.h"
|
||||
#include "wx/dcmemory.h"
|
||||
#include "wx/region.h"
|
||||
#include <math.h>
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@@ -190,7 +190,7 @@ wxStatusBar *wxFrame::OnCreateStatusBar(int number, long style, wxWindowID id,
|
||||
|
||||
// Set the height according to the font and the border size
|
||||
wxClientDC dc(statusBar);
|
||||
dc.SetFont(* statusBar->GetFont());
|
||||
dc.SetFont(statusBar->GetFont());
|
||||
|
||||
long x, y;
|
||||
dc.GetTextExtent("X", &x, &y);
|
||||
@@ -264,7 +264,7 @@ void wxFrame::SetMenuBar(wxMenuBar *menuBar)
|
||||
void wxFrame::Fit()
|
||||
{
|
||||
// Work out max. size
|
||||
wxNode *node = GetChildren()->First();
|
||||
wxNode *node = GetChildren().First();
|
||||
int max_width = 0;
|
||||
int max_height = 0;
|
||||
while (node)
|
||||
@@ -321,7 +321,7 @@ void wxFrame::OnSize(wxSizeEvent& event)
|
||||
|
||||
// do we have _exactly_ one child?
|
||||
wxWindow *child = NULL;
|
||||
for ( wxNode *node = GetChildren()->First(); node; node = node->Next() )
|
||||
for ( wxNode *node = GetChildren().First(); node; node = node->Next() )
|
||||
{
|
||||
wxWindow *win = (wxWindow *)node->Data();
|
||||
if ( !win->IsKindOf(CLASSINFO(wxFrame)) &&
|
||||
@@ -351,7 +351,7 @@ void wxFrame::OnSize(wxSizeEvent& event)
|
||||
// subwindow found.
|
||||
void wxFrame::OnActivate(wxActivateEvent& event)
|
||||
{
|
||||
for(wxNode *node = GetChildren()->First(); node; node = node->Next())
|
||||
for(wxNode *node = GetChildren().First(); node; node = node->Next())
|
||||
{
|
||||
// Find a child that's a subwindow, but not a dialog box.
|
||||
wxWindow *child = (wxWindow *)node->Data();
|
||||
|
@@ -72,7 +72,7 @@ void wxScrollBar::SetScrollbar(int position, int thumbSize, int range, int pageS
|
||||
|
||||
void wxScrollBar::Command(wxCommandEvent& event)
|
||||
{
|
||||
SetPosition(event.m_commandInt);
|
||||
SetThumbPosition(event.m_commandInt);
|
||||
ProcessCommand(event);
|
||||
}
|
||||
|
||||
|
@@ -32,8 +32,8 @@ bool wxStaticText::Create(wxWindow *parent, wxWindowID id,
|
||||
SetName(name);
|
||||
if (parent) parent->AddChild(this);
|
||||
|
||||
SetBackgroundColour(parent->GetDefaultBackgroundColour()) ;
|
||||
SetForegroundColour(parent->GetDefaultForegroundColour()) ;
|
||||
SetBackgroundColour(parent->GetBackgroundColour()) ;
|
||||
SetForegroundColour(parent->GetForegroundColour()) ;
|
||||
|
||||
if ( id == -1 )
|
||||
m_windowId = (int)NewControlId();
|
||||
@@ -42,7 +42,7 @@ bool wxStaticText::Create(wxWindow *parent, wxWindowID id,
|
||||
|
||||
m_windowStyle = style;
|
||||
|
||||
SetFont(* parent->GetFont());
|
||||
SetFont(parent->GetFont());
|
||||
|
||||
// TODO
|
||||
return FALSE;
|
||||
|
@@ -378,7 +378,7 @@ void wxWindow::Refresh(bool eraseBack, const wxRect *rect)
|
||||
// Responds to colour changes: passes event on to children.
|
||||
void wxWindow::OnSysColourChanged(wxSysColourChangedEvent& event)
|
||||
{
|
||||
wxNode *node = GetChildren()->First();
|
||||
wxNode *node = GetChildren().First();
|
||||
while ( node )
|
||||
{
|
||||
// Only propagate to non-top-level windows
|
||||
@@ -583,7 +583,7 @@ bool wxWindow::IsEnabled() const
|
||||
// it's an application error (pops up a dialog)
|
||||
bool wxWindow::TransferDataToWindow()
|
||||
{
|
||||
wxNode *node = GetChildren()->First();
|
||||
wxNode *node = GetChildren().First();
|
||||
while ( node )
|
||||
{
|
||||
wxWindow *child = (wxWindow *)node->Data();
|
||||
@@ -603,7 +603,7 @@ bool wxWindow::TransferDataToWindow()
|
||||
// validation failed: don't quit
|
||||
bool wxWindow::TransferDataFromWindow()
|
||||
{
|
||||
wxNode *node = GetChildren()->First();
|
||||
wxNode *node = GetChildren().First();
|
||||
while ( node )
|
||||
{
|
||||
wxWindow *child = (wxWindow *)node->Data();
|
||||
@@ -619,7 +619,7 @@ bool wxWindow::TransferDataFromWindow()
|
||||
|
||||
bool wxWindow::Validate()
|
||||
{
|
||||
wxNode *node = GetChildren()->First();
|
||||
wxNode *node = GetChildren().First();
|
||||
while ( node )
|
||||
{
|
||||
wxWindow *child = (wxWindow *)node->Data();
|
||||
@@ -642,30 +642,27 @@ wxWindow *wxWindow::FindFocus()
|
||||
|
||||
void wxWindow::AddChild(wxWindow *child)
|
||||
{
|
||||
GetChildren()->Append(child);
|
||||
GetChildren().Append(child);
|
||||
child->m_windowParent = this;
|
||||
}
|
||||
|
||||
void wxWindow::RemoveChild(wxWindow *child)
|
||||
{
|
||||
if (GetChildren())
|
||||
GetChildren()->DeleteObject(child);
|
||||
GetChildren().DeleteObject(child);
|
||||
child->m_windowParent = NULL;
|
||||
}
|
||||
|
||||
void wxWindow::DestroyChildren()
|
||||
{
|
||||
if (GetChildren()) {
|
||||
wxNode *node;
|
||||
while ((node = GetChildren()->First()) != (wxNode *)NULL) {
|
||||
while ((node = GetChildren().First()) != (wxNode *)NULL) {
|
||||
wxWindow *child;
|
||||
if ((child = (wxWindow *)node->Data()) != (wxWindow *)NULL) {
|
||||
delete child;
|
||||
if ( GetChildren()->Member(child) )
|
||||
if ( GetChildren().Member(child) )
|
||||
delete node;
|
||||
}
|
||||
} /* while */
|
||||
}
|
||||
}
|
||||
|
||||
void wxWindow::MakeModal(bool modal)
|
||||
@@ -880,7 +877,7 @@ bool wxWindow::DoPhase(int phase)
|
||||
{
|
||||
noChanges = 0;
|
||||
noFailures = 0;
|
||||
wxNode *node = GetChildren()->First();
|
||||
wxNode *node = GetChildren().First();
|
||||
while (node)
|
||||
{
|
||||
wxWindow *child = (wxWindow *)node->Data();
|
||||
@@ -925,7 +922,7 @@ void wxWindow::ResetConstraints()
|
||||
constr->centreX.SetDone(FALSE);
|
||||
constr->centreY.SetDone(FALSE);
|
||||
}
|
||||
wxNode *node = GetChildren()->First();
|
||||
wxNode *node = GetChildren().First();
|
||||
while (node)
|
||||
{
|
||||
wxWindow *win = (wxWindow *)node->Data();
|
||||
@@ -984,7 +981,7 @@ void wxWindow::SetConstraintSizes(bool recurse)
|
||||
|
||||
if (recurse)
|
||||
{
|
||||
wxNode *node = GetChildren()->First();
|
||||
wxNode *node = GetChildren().First();
|
||||
while (node)
|
||||
{
|
||||
wxWindow *win = (wxWindow *)node->Data();
|
||||
@@ -1121,9 +1118,7 @@ bool wxWindow::Close(bool force)
|
||||
wxObject* wxWindow::GetChild(int number) const
|
||||
{
|
||||
// Return a pointer to the Nth object in the window
|
||||
if (!GetChildren())
|
||||
return(NULL) ;
|
||||
wxNode *node = GetChildren()->First();
|
||||
wxNode *node = GetChildren().First();
|
||||
int n = number;
|
||||
while (node && n--)
|
||||
node = node->Next() ;
|
||||
@@ -1154,7 +1149,7 @@ void wxWindow::Fit()
|
||||
{
|
||||
int maxX = 0;
|
||||
int maxY = 0;
|
||||
wxNode *node = GetChildren()->First();
|
||||
wxNode *node = GetChildren().First();
|
||||
while ( node )
|
||||
{
|
||||
wxWindow *win = (wxWindow *)node->Data();
|
||||
@@ -1192,7 +1187,7 @@ wxWindow *wxWindow::FindWindow(long id)
|
||||
if ( GetId() == id)
|
||||
return this;
|
||||
|
||||
wxNode *node = GetChildren()->First();
|
||||
wxNode *node = GetChildren().First();
|
||||
while ( node )
|
||||
{
|
||||
wxWindow *child = (wxWindow *)node->Data();
|
||||
@@ -1209,7 +1204,7 @@ wxWindow *wxWindow::FindWindow(const wxString& name)
|
||||
if ( GetName() == name)
|
||||
return this;
|
||||
|
||||
wxNode *node = GetChildren()->First();
|
||||
wxNode *node = GetChildren().First();
|
||||
while ( node )
|
||||
{
|
||||
wxWindow *child = (wxWindow *)node->Data();
|
||||
|
Reference in New Issue
Block a user