OSDN Git Service

RubyDialogCallback_drawEllipse is modified so as to avoid use of 'rad1' and 'rad2...
authortoshinagata1964 <toshinagata1964@a2be9bc6-48de-4e38-9406-05402d4bc13c>
Mon, 21 Oct 2013 07:47:43 +0000 (07:47 +0000)
committertoshinagata1964 <toshinagata1964@a2be9bc6-48de-4e38-9406-05402d4bc13c>
Mon, 21 Oct 2013 07:47:43 +0000 (07:47 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/molby/trunk@408 a2be9bc6-48de-4e38-9406-05402d4bc13c

MolLib/Ruby_bind/ruby_dialog.h
wxSources/MyListCtrl.cpp
wxSources/RubyDialogFrame.cpp

index b5c17b9..556fc2f 100644 (file)
@@ -94,7 +94,7 @@ STUB void RubyDialogCallback_setAutoResizeEnabled(RubyDialog *dref, int flag);
 STUB int RubyDialogCallback_isAutoResizeEnabled(RubyDialog *dref);
 STUB int RubyDialogCallback_Listen(RubyDialog *dref, void *obj, const char *objtype, const char *msg, RubyValue oval, RubyValue pval);
 STUB void RubyDialogCallback_clear(RubyDialog *dref);
-STUB void RubyDialogCallback_drawEllipse(RubyDialog *dref, float x, float y, float rad1, float rad2);
+STUB void RubyDialogCallback_drawEllipse(RubyDialog *dref, float x, float y, float r1, float r2);
 STUB void RubyDialogCallback_drawLine(RubyDialog *dref, int ncoords, float *coords);
 STUB void RubyDialogCallback_drawRectangle(RubyDialog *dref, float x, float y, float width, float height, float round);
 STUB void RubyDialogCallback_drawText(RubyDialog *dref, const char *s, float x, float y);
index 1c8103a..baa1d84 100644 (file)
@@ -142,11 +142,11 @@ MyListCtrl::OnGetItemAttr(long item) const
        if (ret == 0)
                return NULL;
        if (ret & 1) {
-               wxColour fgcol(fg[0] * 255, fg[1] * 255, fg[2] * 255);
+               wxColour fgcol((int)(fg[0] * 255), (int)(fg[1] * 255), (int)(fg[2] * 255));
                subTitleRowAttr->SetTextColour(fgcol);
        } else subTitleRowAttr->SetTextColour(*wxBLACK);
        if (ret & 2) {
-               wxColour bgcol(bg[0] * 255, bg[1] * 255, bg[2] * 255);
+               wxColour bgcol((int)(bg[0] * 255), (int)(bg[1] * 255), (int)(bg[2] * 255));
                subTitleRowAttr->SetBackgroundColour(bgcol);
        } else subTitleRowAttr->SetBackgroundColour(*wxWHITE);
        return subTitleRowAttr;
index 9d192a5..e38a521 100644 (file)
@@ -627,7 +627,7 @@ RDRectFromwxRect(const wxRect &frame)
 static inline wxRect
 wxRectFromRDRect(RDRect rframe)
 {
-       wxRect frame(rframe.origin.x, rframe.origin.y, rframe.size.width, rframe.size.height);
+       wxRect frame((int)rframe.origin.x, (int)rframe.origin.y, (int)rframe.size.width, (int)rframe.size.height);
        return frame;
 }
 
@@ -645,8 +645,8 @@ void
 RubyDialogCallback_setWindowMinSize(RubyDialog *dref, RDSize size)
 {
        wxSize minSize;
-       minSize.x = size.width;
-       minSize.y = size.height;
+       minSize.x = (int)size.width;
+       minSize.y = (int)size.height;
        ((RubyDialogFrame *)dref)->SetMinSize(minSize);
 }
 
@@ -662,7 +662,7 @@ RubyDialogCallback_windowSize(RubyDialog *dref)
 void
 RubyDialogCallback_setWindowSize(RubyDialog *dref, RDSize size)
 {
-       wxSize wsize(size.width, size.height);
+       wxSize wsize((int)size.width, (int)size.height);
        ((RubyDialogFrame *)dref)->SetSize(wsize);
        ((RubyDialogFrame *)dref)->CentreOnScreen();
 }
@@ -695,12 +695,12 @@ RubyDialogCallback_clear(RubyDialog *dref)
 }
 
 void
-RubyDialogCallback_drawEllipse(RubyDialog *dref, float x, float y, float rad1, float rad2)
+RubyDialogCallback_drawEllipse(RubyDialog *dref, float x, float y, float r1, float r2)
 {
        wxDC *dcp = ((RubyDialogFrame *)dref)->currentContext;
        if (dcp == NULL)
                return;
-       dcp->DrawEllipse(x - rad1, y - rad2, rad1 * 2, rad2 * 2);
+       dcp->DrawEllipse(x - r1, y - r2, r1 * 2, r2 * 2);
 }
 
 void
@@ -726,9 +726,9 @@ RubyDialogCallback_drawRectangle(RubyDialog *dref, float x, float y, float width
        if (dcp == NULL)
                return;
        if (round > 0.0)
-               dcp->DrawRoundedRectangle(x, y, width, height, round);
+               dcp->DrawRoundedRectangle((int)x, (int)y, (int)width, (int)height, (int)round);
        else
-               dcp->DrawRectangle(x, y, width, height);
+               dcp->DrawRectangle((int)x, (int)y, (int)width, (int)height);
 }
 
 void
@@ -1260,14 +1260,14 @@ RubyDialogCallback_getFontForItem(RDItem *item, int *size, int *family, int *sty
 void
 RubyDialogCallback_setForegroundColorForItem(RDItem *item, const double *col)
 {
-       wxColour wcol(col[0] * 255, col[1] * 255, col[2] * 255, col[3] * 255);
+       wxColour wcol((int)(col[0] * 255), (int)(col[1] * 255), (int)(col[2] * 255), (int)(col[3] * 255));
        ((wxWindow *)item)->SetForegroundColour(wcol);
 }
 
 void
 RubyDialogCallback_setBackgroundColorForItem(RDItem *item, const double *col)
 {
-       wxColour wcol(col[0] * 255, col[1] * 255, col[2] * 255, col[3] * 255);
+       wxColour wcol((int)(col[0] * 255), (int)(col[1] * 255), (int)(col[2] * 255), (int)(col[3] * 255));
        ((wxWindow *)item)->SetBackgroundColour(wcol);
 }