// ------------------------------------------------------------------------
// return the timespan for the given number of seconds
- static wxTimeSpan Seconds(int sec) { return wxTimeSpan(0, 0, sec); }
+ static wxTimeSpan Seconds(long sec) { return wxTimeSpan(0, 0, sec); }
static wxTimeSpan Second() { return Seconds(1); }
// return the timespan for the given number of minutes
- static wxTimeSpan Minutes(int min) { return wxTimeSpan(0, min, 0 ); }
+ static wxTimeSpan Minutes(long min) { return wxTimeSpan(0, min, 0 ); }
static wxTimeSpan Minute() { return Minutes(1); }
// return the timespan for the given number of hours
- static wxTimeSpan Hours(int hours) { return wxTimeSpan(hours, 0, 0); }
+ static wxTimeSpan Hours(long hours) { return wxTimeSpan(hours, 0, 0); }
static wxTimeSpan Hour() { return Hours(1); }
// return the timespan for the given number of days
- static wxTimeSpan Days(int days) { return Hours(24 * days); }
+ static wxTimeSpan Days(long days) { return Hours(24 * days); }
static wxTimeSpan Day() { return Days(1); }
// return the timespan for the given number of weeks
- static wxTimeSpan Weeks(int days) { return Days(7 * days); }
+ static wxTimeSpan Weeks(long days) { return Days(7 * days); }
static wxTimeSpan Week() { return Weeks(1); }
// default ctor constructs the 0 time span
// from separate values for each component, date set to 0 (hours are
// not restricted to 0..24 range, neither are minutes, seconds or
// milliseconds)
- inline wxTimeSpan(int hours,
- int minutes = 0,
- int seconds = 0,
- int milliseconds = 0);
+ inline wxTimeSpan(long hours,
+ long minutes = 0,
+ long seconds = 0,
+ long milliseconds = 0);
// default copy ctor is ok
// wxTimeSpan construction
// ----------------------------------------------------------------------------
-wxTimeSpan::wxTimeSpan(int hours, int minutes, int seconds, int milliseconds)
+wxTimeSpan::wxTimeSpan(long hours, long minutes, long seconds, long milliseconds)
{
// assign first to avoid precision loss
- m_diff = (long)hours;
+ m_diff = hours;
m_diff *= 60l;
m_diff += minutes;
m_diff *= 60l;
#define WXUNUSED(identifier) identifier
#endif
+// some arguments are only used in debug mode, but unused in release one
+#ifdef __WXDEBUG__
+ #define WXUNUSED_UNLESS_DEBUG(param) param
+#else
+ #define WXUNUSED_UNLESS_DEBUG(param) WXUNUSED(param)
+#endif
+
// ----------------------------------------------------------------------------
// portable calling conventions macros
// ----------------------------------------------------------------------------
wxRegionIterator();
wxRegionIterator(const wxRegion& region);
- void Reset() { m_current = 0; }
+ void Reset() { m_current = 0u; }
void Reset(const wxRegion& region);
operator bool () const;
wxRect GetRect() const { return wxRect(GetX(), GetY(), GetWidth(), GetHeight()); }
private:
- long m_current;
- wxRegion m_region;
+ size_t m_current;
+ wxRegion m_region;
private:
DECLARE_DYNAMIC_CLASS(wxRegionIterator);
wxRegionIterator();
wxRegionIterator(const wxRegion& region);
- void Reset() { m_current = 0; }
+ void Reset() { m_current = 0u; }
void Reset(const wxRegion& region);
operator bool () const;
wxRect GetRect() const { return wxRect(GetX(), GetY(), GetWidth(), GetHeight()); }
private:
- long m_current;
- wxRegion m_region;
+ size_t m_current;
+ wxRegion m_region;
private:
DECLARE_DYNAMIC_CLASS(wxRegionIterator);
// types increases, so always use the accessor functions and don't access
// the fields directly!)
- void Check(wxCmdLineParamType typ) const
+ void Check(wxCmdLineParamType WXUNUSED_UNLESS_DEBUG(typ)) const
{
wxASSERT_MSG( type == typ, _T("type mismatch in wxCmdLineOption") );
}
}
}
-void wxCmdLineParserData::SetArguments(const wxString& cmdline)
+void wxCmdLineParserData::SetArguments(const wxString& WXUNUSED(cmdline))
{
// either use wxMSW wxApp::ConvertToStandardCommandArgs() or move its logic
// here and use this method from it - but don't duplicate the code
if ( m_validatorWindow )
{
- long keyCode = event.KeyCode();
+ int keyCode = (int)event.KeyCode();
// we don't filter special keys and Delete
if (
void wxListLineData::SetColumnPosition( int index, int x )
{
- int i = index;
- wxNode *node = m_items.Nth( i );
+ wxNode *node = m_items.Nth( (size_t)index );
if (node)
{
wxListItemData *item = (wxListItemData*)node->Data();
void wxListLineData::DoDraw( wxDC *dc, bool hilight, bool paintBG )
{
- long dev_x = dc->LogicalToDeviceX( m_bound_all.x-2 );
- long dev_y = dc->LogicalToDeviceY( m_bound_all.y-2 );
- long dev_w = dc->LogicalToDeviceXRel( m_bound_all.width+4 );
- long dev_h = dc->LogicalToDeviceYRel( m_bound_all.height+4 );
+ wxCoord dev_x = dc->LogicalToDeviceX( m_bound_all.x-2 );
+ wxCoord dev_y = dc->LogicalToDeviceY( m_bound_all.y-2 );
+ wxCoord dev_w = dc->LogicalToDeviceXRel( m_bound_all.width+4 );
+ wxCoord dev_h = dc->LogicalToDeviceYRel( m_bound_all.height+4 );
if (!m_owner->IsExposed( dev_x, dev_y, dev_w, dev_h ))
{
void wxListHeaderWindow::OnMouse( wxMouseEvent &event )
{
- int x = event.GetX();
- int y = event.GetY();
+ wxCoord x = (wxCoord)event.GetX();
+ wxCoord y = (wxCoord)event.GetY();
if (m_isDragging)
{
DrawCurrent();
void wxListMainWindow::EditLabel( long item )
{
- wxNode *node = m_lines.Nth( item );
+ wxNode *node = m_lines.Nth( (size_t)item );
wxCHECK_RET( node, wxT("wrong index in wxListCtrl::Edit()") );
m_currentEdit = (wxListLineData*) node->Data();
wxClientDC dc(this);
PrepareDC(dc);
- long x = dc.DeviceToLogicalX( (long)event.GetX() );
- long y = dc.DeviceToLogicalY( (long)event.GetY() );
+ wxCoord x = dc.DeviceToLogicalX( (wxCoord)event.GetX() );
+ wxCoord y = dc.DeviceToLogicalY( (wxCoord)event.GetY() );
/* Did we actually hit an item ? */
long hitResult = 0;
/* we send a list_key event up */
wxListEvent le( wxEVT_COMMAND_LIST_KEY_DOWN, GetParent()->GetId() );
- le.m_code = event.KeyCode();
+ le.m_code = (int)event.KeyCode();
le.SetEventObject( parent );
parent->GetEventHandler()->ProcessEvent( le );
void wxListMainWindow::SetItem( wxListItem &item )
{
m_dirty = TRUE;
- wxNode *node = m_lines.Nth( item.m_itemId );
+ wxNode *node = m_lines.Nth( (size_t)item.m_itemId );
if (node)
{
wxListLineData *line = (wxListLineData*)node->Data();
if (stateMask & wxLIST_STATE_FOCUSED)
{
- wxNode *node = m_lines.Nth( item );
+ wxNode *node = m_lines.Nth( (size_t)item );
if (node)
{
wxListLineData *line = (wxListLineData*)node->Data();
if (stateMask & wxLIST_STATE_SELECTED)
{
- bool on = state & wxLIST_STATE_SELECTED;
+ bool on = (state & wxLIST_STATE_SELECTED) != 0;
if (!on && (m_mode & wxLC_SINGLE_SEL)) return;
- wxNode *node = m_lines.Nth( item );
+ wxNode *node = m_lines.Nth( (size_t)item );
if (node)
{
wxListLineData *line = (wxListLineData*)node->Data();
RefreshLine( m_current );
if (oldCurrent) RefreshLine( oldCurrent );
}
- bool on = state & wxLIST_STATE_SELECTED;
+ bool on = (state & wxLIST_STATE_SELECTED) != 0;
if (on != line->IsHilighted())
{
line->Hilight( on );
int ret = wxLIST_STATE_DONTCARE;
if (stateMask & wxLIST_STATE_FOCUSED)
{
- wxNode *node = m_lines.Nth( item );
+ wxNode *node = m_lines.Nth( (size_t)item );
if (node)
{
wxListLineData *line = (wxListLineData*)node->Data();
}
if (stateMask & wxLIST_STATE_SELECTED)
{
- wxNode *node = m_lines.Nth( item );
+ wxNode *node = m_lines.Nth( (size_t)item );
if (node)
{
wxListLineData *line = (wxListLineData*)node->Data();
void wxListMainWindow::GetItem( wxListItem &item )
{
- wxNode *node = m_lines.Nth( item.m_itemId );
+ wxNode *node = m_lines.Nth( (size_t)item.m_itemId );
if (node)
{
wxListLineData *line = (wxListLineData*)node->Data();
void wxListMainWindow::GetItemRect( long index, wxRect &rect )
{
- wxNode *node = m_lines.Nth( index );
+ wxNode *node = m_lines.Nth( (size_t)index );
if (node)
{
wxListLineData *line = (wxListLineData*)node->Data();
bool wxListMainWindow::GetItemPosition(long item, wxPoint& pos)
{
- wxNode *node = m_lines.Nth( item );
+ wxNode *node = m_lines.Nth( (size_t)item );
if (node)
{
wxRect rect;
long ret = 0;
if (item > 0) ret = item;
if(ret >= GetItemCount()) return -1;
- wxNode *node = m_lines.Nth( ret );
+ wxNode *node = m_lines.Nth( (size_t)ret );
while (node)
{
wxListLineData *line = (wxListLineData*)node->Data();
void wxListMainWindow::DeleteItem( long index )
{
m_dirty = TRUE;
- wxNode *node = m_lines.Nth( index );
+ wxNode *node = m_lines.Nth( (size_t)index );
if (node)
{
wxListLineData *line = (wxListLineData*)node->Data();
wxListLineData *oldCurrent = m_current;
m_current = (wxListLineData *) NULL;
- int i = index;
- wxNode *node = m_lines.Nth( i );
+ wxNode *node = m_lines.Nth( (size_t)index );
if (node) m_current = (wxListLineData*)node->Data();
if (m_current) MoveToFocus();
m_current = oldCurrent;
long pos = start;
wxString tmp = str;
if (pos < 0) pos = 0;
- wxNode *node = m_lines.Nth( pos );
+ wxNode *node = m_lines.Nth( (size_t)pos );
while (node)
{
wxListLineData *line = (wxListLineData*)node->Data();
{
long pos = start;
if (pos < 0) pos = 0;
- wxNode *node = m_lines.Nth( pos );
+ wxNode *node = m_lines.Nth( (size_t)pos );
while (node)
{
wxListLineData *line = (wxListLineData*)node->Data();
long ret = line->IsHit( x, y );
if (ret & flags)
{
- flags = ret;
+ flags = (int)ret;
return count;
}
node = node->Next();
line->SetItem( 0, item );
if ((item.m_itemId >= 0) && (item.m_itemId < (int)m_lines.GetCount()))
{
- wxNode *node = m_lines.Nth( item.m_itemId );
+ wxNode *node = m_lines.Nth( (size_t)item.m_itemId );
if (node) m_lines.Insert( node, line );
}
else
wxListHeaderData *column = new wxListHeaderData( item );
if ((col >= 0) && (col < (int)m_columns.GetCount()))
{
- wxNode *node = m_columns.Nth( col );
+ wxNode *node = m_columns.Nth( (size_t)col );
if (node)
m_columns.Insert( node, column );
}
if (style & wxICON_MASK)
{
wxStaticBitmap *icon = new wxStaticBitmap(
- this, -1, wxTheApp->GetStdIcon(style & wxICON_MASK));
+ this, -1, wxTheApp->GetStdIcon((int)(style & wxICON_MASK)));
icon_text->Add( icon, 0, wxCENTER );
}
void wxSplitterWindow::OnMouseEvent(wxMouseEvent& event)
{
- wxCoord x = event.GetX(),
- y = event.GetY();
+ wxCoord x = (wxCoord)event.GetX(),
+ y = (wxCoord)event.GetY();
// reset the cursor
#ifdef __WXMOTIF__
m_height = size.y;
}
- long GetWidth() const { return m_width; }
- long GetHeight() const { return m_height; }
+ wxCoord GetWidth() const { return m_width; }
+ wxCoord GetHeight() const { return m_height; }
wxCoord m_x;
wxCoord m_y;
m_lastX = m_xMargin;
m_lastY += maxToolHeight + m_toolPacking;
}
- tool->m_x = (long) (m_lastX + (maxToolWidth - tool->GetWidth())/2.0);
- tool->m_y = (long) (m_lastY + (maxToolHeight - tool->GetHeight())/2.0);
+ tool->m_x = (m_lastX + (maxToolWidth - tool->GetWidth())/2.0);
+ tool->m_y = (m_lastY + (maxToolHeight - tool->GetHeight())/2.0);
m_lastX += maxToolWidth + m_toolPacking;
}
m_lastX += (maxToolWidth + m_toolPacking);
m_lastY = m_yMargin;
}
- tool->m_x = (long) (m_lastX + (maxToolWidth - tool->GetWidth())/2.0);
- tool->m_y = (long) (m_lastY + (maxToolHeight - tool->GetHeight())/2.0);
+ tool->m_x = (m_lastX + (maxToolWidth - tool->GetWidth())/2.0);
+ tool->m_y = (m_lastY + (maxToolHeight - tool->GetHeight())/2.0);
m_lastY += maxToolHeight + m_toolPacking;
}
}
else
{
- long x = tool->m_x;
- long y = tool->m_y;
- long w = bitmap.GetWidth();
- long h = bitmap.GetHeight();
+ wxCoord x = tool->m_x;
+ wxCoord y = tool->m_y;
+ wxCoord w = bitmap.GetWidth();
+ wxCoord h = bitmap.GetHeight();
wxPen thick_black_pen("BLACK", 3, wxSOLID);
memDC.SelectObject(bitmap);
// children but has a [+] button
int m_isBold :1; // render the label in bold font
- int m_x, m_y;
- long m_height, m_width;
+ wxCoord m_x, m_y;
+ wxCoord m_height, m_width;
int m_xCross, m_yCross;
int m_level;
wxRegionIterator::wxRegionIterator()
{
- m_current = 0;
+ Reset();
}
wxRegionIterator::wxRegionIterator( const wxRegion& region )
{
- m_region = region;
- m_current = 0;
+ Reset(region);
}
void wxRegionIterator::Reset( const wxRegion& region )
{
m_region = region;
- m_current = 0;
+ Reset();
}
wxRegionIterator::operator bool () const
wxRegionIterator::wxRegionIterator()
{
- m_current = 0;
+ Reset();
}
wxRegionIterator::wxRegionIterator( const wxRegion& region )
{
- m_region = region;
- m_current = 0;
+ Reset(region);
}
void wxRegionIterator::Reset( const wxRegion& region )
{
m_region = region;
- m_current = 0;
+ Reset();
}
wxRegionIterator::operator bool () const