From 6cedba093a6d87371ca67534b1b9165fe3d45fbc Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 18 Feb 2000 20:20:15 +0000 Subject: [PATCH] more long/double to int conversion warnings from HP-UX logs fixed git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6140 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/event.h | 4 ++-- src/generic/plot.cpp | 16 ++++++++-------- src/generic/treectrl.cpp | 9 +++++---- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/include/wx/event.h b/include/wx/event.h index 0b8f245e82..98cdf33d11 100644 --- a/include/wx/event.h +++ b/include/wx/event.h @@ -694,10 +694,10 @@ public: #endif // WXWIN_COMPATIBILITY // Get X position - long GetX() const { return m_x; } + wxCoord GetX() const { return m_x; } // Get Y position - long GetY() const { return m_y; } + wxCoord GetY() const { return m_y; } void CopyObject(wxObject& obj) const; diff --git a/src/generic/plot.cpp b/src/generic/plot.cpp index 825f5fbbb6..a600522441 100644 --- a/src/generic/plot.cpp +++ b/src/generic/plot.cpp @@ -126,8 +126,8 @@ void wxPlotArea::OnMouse( wxMouseEvent &event ) view_x *= wxPLOT_SCROLL_STEP; view_y *= wxPLOT_SCROLL_STEP; - int x = event.GetX(); - int y = event.GetY(); + wxCoord x = event.GetX(); + wxCoord y = event.GetY(); x += view_x; y += view_y; @@ -141,7 +141,7 @@ void wxPlotArea::OnMouse( wxMouseEvent &event ) double end = curve->GetEndY(); wxCoord offset_y = curve->GetOffsetY(); - double dy = (end - curve->GetY( x/m_owner->GetZoom() )) / range; + double dy = (end - curve->GetY( (wxInt32)(x/m_owner->GetZoom()) )) / range; wxCoord curve_y = (wxCoord)(dy * double_client_height) - offset_y - 1; if ((y-curve_y < 4) && (y-curve_y > -4)) @@ -214,7 +214,7 @@ void wxPlotArea::DrawCurve( wxDC *dc, wxPlotCurve *curve, int from, int to ) wxCoord y=0,last_y=0; for (int x = start_x; x < end_x; x++) { - double dy = (end - curve->GetY( x/zoom )) / range; + double dy = (end - curve->GetY( (wxInt32)(x/zoom) )) / range; y = (wxCoord)(dy * double_client_height) - offset_y - 1; if (x != start_x) @@ -310,8 +310,8 @@ void wxPlotXAxisArea::OnMouse( wxMouseEvent &event ) view_x *= wxPLOT_SCROLL_STEP; view_y *= wxPLOT_SCROLL_STEP; - int x = event.GetX(); - int y = event.GetY(); + wxCoord x = event.GetX(); + wxCoord y = event.GetY(); x += view_x; y += view_y; @@ -760,7 +760,7 @@ void wxPlotWindow::SetZoom( double zoom ) } SetScrollbars( wxPLOT_SCROLL_STEP, wxPLOT_SCROLL_STEP, (int)((max*m_xZoom)/wxPLOT_SCROLL_STEP)+1, 0, - (int)view_x*zoom/old_zoom, 0, + (int)(view_x*zoom/old_zoom), 0, TRUE ); RedrawXAxis(); @@ -780,7 +780,7 @@ void wxPlotWindow::ResetScrollbar() } SetScrollbars( wxPLOT_SCROLL_STEP, wxPLOT_SCROLL_STEP, - ((max*m_xZoom)/wxPLOT_SCROLL_STEP)+1, 0 ); + (int)(((max*m_xZoom)/wxPLOT_SCROLL_STEP)+1), 0 ); } void wxPlotWindow::RedrawXAxis() diff --git a/src/generic/treectrl.cpp b/src/generic/treectrl.cpp index 7bdbfe798d..a438ee6aaa 100644 --- a/src/generic/treectrl.cpp +++ b/src/generic/treectrl.cpp @@ -1556,7 +1556,7 @@ void wxTreeCtrl::PaintItem(wxGenericTreeItem *item, wxDC& dc) } dc.SetBackgroundMode(wxTRANSPARENT); - dc.DrawText( item->GetText(), image_w + item->GetX(), item->GetY() + dc.DrawText( item->GetText(), image_w + item->GetX(), (wxCoord)item->GetY() + ((total_h > text_h) ? (total_h - text_h)/2 : 0)); // restore normal font @@ -2116,8 +2116,8 @@ void wxTreeCtrl::OnIdle( wxIdleEvent &WXUNUSED(event) ) void wxTreeCtrl::CalculateSize( wxGenericTreeItem *item, wxDC &dc ) { - long text_w = 0; - long text_h = 0; + int text_w = 0; + int text_h = 0; if (item->IsBold()) dc.SetFont(m_boldFont); @@ -2145,7 +2145,8 @@ void wxTreeCtrl::CalculateSize( wxGenericTreeItem *item, wxDC &dc ) total_h += total_h/10; // otherwise 10% extra spacing item->SetHeight(total_h); - if (total_h>m_lineHeight) m_lineHeight=total_h; + if (total_h>m_lineHeight) + m_lineHeight=total_h; item->SetWidth(image_w+text_w+2); } -- 2.45.2