<div class="centered" lang="en">
<h1>Molby</h1>
<h2>Interactive Molecular Modeling Software<br />with Integrated Ruby Interpreter</h2>
-<h3>Version 1.0.2</h3> <!-- version -->
+<h3>Version 1.1.0</h3> <!-- version -->
<h3>Toshi Nagata</h3>
<p><a href="http://molby.osdn.jp/index-en.html">http://molby.osdn.jp/index-en.html</a></p>
</div>
<div class="centered" lang="ja">
<h1>Molby</h1>
<h2>対話型分子モデリングソフトウェア<br />(Ruby インタプリタ内蔵)</h2>
-<h3>Version 1.0.2</h3> <!-- version -->
+<h3>Version 1.1.0</h3> <!-- version -->
<h3>永田 央</h3>
<p><a href="http://molby.osdn.jp/index.html">http://molby.osdn.jp/index.html</a></p>
</div>
Molby runs on the following platforms.
</p>
<ul>
-<li>Microsoft Windows (XP or later, 32 bit or 64 bit).</li>
-<li>Mac OS X (10.6 or later, 64 bit Intel).</li>
+<li>Microsoft Windows (7 or later, 32 bit or 64 bit).</li>
+<li>Mac OS X (10.12 or later, 64 bit Intel).</li>
</ul>
<p>
<h3>3-1. Microsoft Windows</h3>
<p>
-The Windows version is provided either as a zip archive (<code>MolbyWin.zip</code>) or a standard setup package (<code>SetupMolbyWin.exe</code>).
+The Windows version is provided either as a zip archive (<code>MolbyWin32.zip</code>, <code>MolbyWin64.zip</code>) or a standard setup package (<code>SetupMolbyWin32.exe</code>, <code>SetupMolbyWin.exe</code>).
</p>
<p>
To use the zip archive, expand all contents in your favorite place, and double-click the "Molby" icon.
<h3>3-2. Mac OS X</h3>
<p>
-The Mac version is provided as a zip archive (<code>MolbyMac.zip</code>). Double-click the archive, and you will get a folder including the Molby application. Drag it to the "Applications" folder in your hard drive.
-</p>
-<p>
-<span class="italic">Note:</span> The Mac version is provided as a universal binary, which runs natively on both PowerPC and Intel platforms.
+The Mac version is provided as a zip archive (<code>MolbyMac.zip</code>, <code>MolbyMacLegacy.zip</code> for MacOS 10.6 to 10.11). Double-click the archive, and you will get a folder including the Molby application. Drag it to the "Applications" folder in your hard drive.
</p>
<h2>4. Uninstallation</h2>
Molbyは以下のプラットフォームで動作します。
</p>
<ul>
-<li>Microsoft Windows (XPまたはそれ以降, 32ビットまたは64ビット).</li>
-<li>Mac OS X (10.6 またはそれ以降、64ビット).</li>
+<li>Microsoft Windows (7またはそれ以降, 32ビットまたは64ビット).</li>
+<li>Mac OS X (10.12 またはそれ以降、64ビット).</li>
</ul>
<p>
<h3>3-1. Microsoft Windows</h3>
<p>
-Windows版は、zip アーカイブ(<code>MolbyWin32.zip</code>:32 ビット版, <code>MolbyWin64.zip</code>: 64ビット版)、または標準のセットアップパッケージ (<code>SetupMolbyWin32.exe</code>: 32ビット版、<code>SetupMolbyWin64.exe</code>: 64ビット版) で配布されています。どちらも内容は同じです。
+Windows版は、zip アーカイブ(<code>MolbyWin32.zip</code>:32 ビット版, <code>MolbyWin64.zip</code>: 64ビット版)、または標準のセットアップパッケージ (<code>SetupMolbyWin32.exe</code>: 32ビット版、<code>SetupMolbyWin64.exe</code>: 64ビット版) で配布されています。
</p>
<p>
Zip アーカイブを使う時は、最初に内容をすべて展開してください。展開したフォルダの中に Molby アプリケーションがあるので、ダブルクリックして起動してください。
<h3>3-2. Mac OS X</h3>
<p>
-Mac版は、zip アーカイブ (<code>MolbyMac.zip</code>) で配布されています。アーカイブをダブルクリックすると、内容が展開されて新しいフォルダができます。Molby アプリケーションがその中にありますので、ハードディスクの「アプリケーション」フォルダにドラッグコピーしてください。
-</p>
-<p>
-<span class="italic">注:</span> Version 1.0 から、Mac 版は 64 bit のみになりました。
+Mac版は、zip アーカイブ (<code>MolbyMac.zip</code>, <code>MolbyMacLegacy.zip</code> [10.6〜10.11用]) で配布されています。アーカイブをダブルクリックすると、内容が展開されて新しいフォルダができます。Molby アプリケーションがその中にありますので、ハードディスクの「アプリケーション」フォルダにドラッグコピーしてください。
</p>
<h2>4. アンインストール</h2>
<p>
Toshi Nagata, "Molby - Graphical Molecular Modeling Software with Integrated Ruby Interpreter,"
<br />
-<i>Bull. Chem. Soc. Jpn.</i> <b>2014,</b> in press. DOI:<a href="http://dx.doi.org/10.1246/bcsj.20140093">10.1246/bcsj.20140093</a>
+<i>Bull. Chem. Soc. Jpn.</i> <b>2014,</b> <i>87,</i> 902-904. DOI:<a href="http://dx.doi.org/10.1246/bcsj.20140093">10.1246/bcsj.20140093</a>
</p>
</blockquote>
<p>
<a href="http://ambermd.org/">AmberTools 1.3</a>: Copyright (C) Junmei Wang, Ross C. Walker, Michael F. Crowley, Scott Brozell and David A. Case
</li>
<li>
-<a href="http://www.wxwidgets.org/">wxWidgets 3.0.0</a>: Copyright (C) 1992-2013 Julian Smart, Robert Roebling, Vadim Zeitlin and other members of the wxWidgets team. Portions (c) 1996 Artificial Intelligence Applications Institute
+<a href="http://www.wxwidgets.org/">wxWidgets 3.2.0</a>: Copyright (C) 1992-2022 Julian Smart, Robert Roebling, Vadim Zeitlin and other members of the wxWidgets team. Portions (c) 1996 Artificial Intelligence Applications Institute
</li>
<li>
<a href="http://www.ruby-lang.org/">Ruby 2.0.0</a>: Copyright (C) 1993-2013 Yukihiro Matsumoto
<h2>2. License</h2>
<p>
-Molby is distributed under the GNU General Public License (version 2).
+Molby is distributed under the GNU General Public License (version 3).
</p>
<blockquote>
<p>
<p>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
+the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
</p>
<p>
<blockquote>
<p>
Toshi Nagata, "Molby - Graphical Molecular Modeling Software with Integrated Ruby Interpreter," <br />
-<i>Bull. Chem. Soc. Jpn.</i> <b>2014,</b> in press. DOI:<a href="http://dx.doi.org/10.1246/bcsj.20140093">10.1246/bcsj.20140093</a>
+<i>Bull. Chem. Soc. Jpn.</i> <b>2014,</b> <i>87,</i> 902-904. DOI:<a href="http://dx.doi.org/10.1246/bcsj.20140093">10.1246/bcsj.20140093</a>
</p>
</blockquote>
<p>
<a href="http://ambermd.org/">AmberTools 1.3</a>: Copyright (C) Junmei Wang, Ross C. Walker, Michael F. Crowley, Scott Brozell and David A. Case
</li>
<li>
-<a href="http://www.wxwidgets.org/">wxWidgets 3.0.0</a>: Copyright (C) 1992-2013 Julian Smart, Robert Roebling, Vadim Zeitlin and other members of the wxWidgets team. Portions (c) 1996 Artificial Intelligence Applications Institute
+<a href="http://www.wxwidgets.org/">wxWidgets 3.2.0</a>: Copyright (C) 1992-2022 Julian Smart, Robert Roebling, Vadim Zeitlin and other members of the wxWidgets team. Portions (c) 1996 Artificial Intelligence Applications Institute
</li>
<li>
<a href="http://www.ruby-lang.org/">Ruby 2.0.0</a>: Copyright (C) 1993-2013 Yukihiro Matsumoto
<h2>2. ライセンス</h2>
<p>
-Molby は <a href="../etc/gpl.txt">GNU General Public License (GNU 一般公衆利用許諾契約書, version 2)</a> に従って配布します。
+Molby は <a href="../etc/gpl.txt">GNU General Public License (GNU 一般公衆利用許諾契約書, version 3)</a> に従って配布します。
</p>
<blockquote>
<p>
Copyright (C) 2008-2022 Toshi Nagata <!-- copyright -->
</p>
<p>
-このプログラムはフリーソフトウェアです。あなたはこれを、フリーソフトウェア財団によって発行された GNU 一般公衆利用許諾契約書(バージョン2か、希望によってはそれ以降のバージョンのうちどれか)の定める条件の下で再頒布または改変することができます。
+このプログラムはフリーソフトウェアです。あなたはこれを、フリーソフトウェア財団によって発行された GNU 一般公衆利用許諾契約書(バージョン3か、希望によってはそれ以降のバージョンのうちどれか)の定める条件の下で再頒布または改変することができます。
</p>
<p>
このプログラムは有用であることを願って頒布されますが、*全くの無保証* です。商業可能性の保証や特定の目的への適合性は、言外に示されたものも含め全く存在しません。詳しくはGNU 一般公衆利用許諾契約書をご覧ください。
#include <stdlib.h>
#include <string.h>
+#include "Missing.h"
+
extern int do_custom_bond_callback(MDArena *arena, Double r, void *procObj, Double *energy, Double *force);
static void
Transform tf;
Vector v;
Vector cello_new;
- Mat33 celltr_save;
+ Transform celltr_save;
Double w, w0;
int i;
int needs_cell_recalculate = 0;
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
+#include <math.h>
#define biso2radius(r) ((r) > 0.5 ? sqrt((r) / 78.9568352087147) : 0.08)
/* Invalid bond/angle/torsion value, used in internal cache */
const Double kInvalidValue = -10000000.0;
+#pragma mark ==== OpenGL utility functions ===
+
+static void __gluMultMatrixVecf(const GLdouble matrix[16], const GLdouble in[4], GLdouble out[4])
+{
+ int i;
+ for (i = 0; i < 4; i++) {
+ out[i] = in[0] * matrix[0*4+i] + in[1] * matrix[1*4+i] + in[2] * matrix[2*4+i] + in[3] * matrix[3*4+i];
+ }
+}
+
+static int __gluInvertMatrixf(const GLdouble m[16], GLdouble invOut[16])
+{
+ GLdouble inv[16], det;
+ int i;
+
+ inv[0] = m[5]*m[10]*m[15] - m[5]*m[11]*m[14] - m[9]*m[6]*m[15]
+ + m[9]*m[7]*m[14] + m[13]*m[6]*m[11] - m[13]*m[7]*m[10];
+ inv[4] = -m[4]*m[10]*m[15] + m[4]*m[11]*m[14] + m[8]*m[6]*m[15]
+ - m[8]*m[7]*m[14] - m[12]*m[6]*m[11] + m[12]*m[7]*m[10];
+ inv[8] = m[4]*m[9]*m[15] - m[4]*m[11]*m[13] - m[8]*m[5]*m[15]
+ + m[8]*m[7]*m[13] + m[12]*m[5]*m[11] - m[12]*m[7]*m[9];
+ inv[12] = -m[4]*m[9]*m[14] + m[4]*m[10]*m[13] + m[8]*m[5]*m[14]
+ - m[8]*m[6]*m[13] - m[12]*m[5]*m[10] + m[12]*m[6]*m[9];
+ inv[1] = -m[1]*m[10]*m[15] + m[1]*m[11]*m[14] + m[9]*m[2]*m[15]
+ - m[9]*m[3]*m[14] - m[13]*m[2]*m[11] + m[13]*m[3]*m[10];
+ inv[5] = m[0]*m[10]*m[15] - m[0]*m[11]*m[14] - m[8]*m[2]*m[15]
+ + m[8]*m[3]*m[14] + m[12]*m[2]*m[11] - m[12]*m[3]*m[10];
+ inv[9] = -m[0]*m[9]*m[15] + m[0]*m[11]*m[13] + m[8]*m[1]*m[15]
+ - m[8]*m[3]*m[13] - m[12]*m[1]*m[11] + m[12]*m[3]*m[9];
+ inv[13] = m[0]*m[9]*m[14] - m[0]*m[10]*m[13] - m[8]*m[1]*m[14]
+ + m[8]*m[2]*m[13] + m[12]*m[1]*m[10] - m[12]*m[2]*m[9];
+ inv[2] = m[1]*m[6]*m[15] - m[1]*m[7]*m[14] - m[5]*m[2]*m[15]
+ + m[5]*m[3]*m[14] + m[13]*m[2]*m[7] - m[13]*m[3]*m[6];
+ inv[6] = -m[0]*m[6]*m[15] + m[0]*m[7]*m[14] + m[4]*m[2]*m[15]
+ - m[4]*m[3]*m[14] - m[12]*m[2]*m[7] + m[12]*m[3]*m[6];
+ inv[10] = m[0]*m[5]*m[15] - m[0]*m[7]*m[13] - m[4]*m[1]*m[15]
+ + m[4]*m[3]*m[13] + m[12]*m[1]*m[7] - m[12]*m[3]*m[5];
+ inv[14] = -m[0]*m[5]*m[14] + m[0]*m[6]*m[13] + m[4]*m[1]*m[14]
+ - m[4]*m[2]*m[13] - m[12]*m[1]*m[6] + m[12]*m[2]*m[5];
+ inv[3] = -m[1]*m[6]*m[11] + m[1]*m[7]*m[10] + m[5]*m[2]*m[11]
+ - m[5]*m[3]*m[10] - m[9]*m[2]*m[7] + m[9]*m[3]*m[6];
+ inv[7] = m[0]*m[6]*m[11] - m[0]*m[7]*m[10] - m[4]*m[2]*m[11]
+ + m[4]*m[3]*m[10] + m[8]*m[2]*m[7] - m[8]*m[3]*m[6];
+ inv[11] = -m[0]*m[5]*m[11] + m[0]*m[7]*m[9] + m[4]*m[1]*m[11]
+ - m[4]*m[3]*m[9] - m[8]*m[1]*m[7] + m[8]*m[3]*m[5];
+ inv[15] = m[0]*m[5]*m[10] - m[0]*m[6]*m[9] - m[4]*m[1]*m[10]
+ + m[4]*m[2]*m[9] + m[8]*m[1]*m[6] - m[8]*m[2]*m[5];
+
+ det = m[0]*inv[0] + m[1]*inv[4] + m[2]*inv[8] + m[3]*inv[12];
+ if (det == 0)
+ return GL_FALSE;
+
+ det = 1.0 / det;
+
+ for (i = 0; i < 16; i++)
+ invOut[i] = inv[i] * det;
+
+ return GL_TRUE;
+}
+
+static void __gluMultMatricesf(const GLdouble a[16], const GLdouble b[16],
+ GLdouble r[16])
+{
+ int i, j;
+ for (i = 0; i < 4; i++) {
+ for (j = 0; j < 4; j++) {
+ r[i*4+j] = a[i*4+0]*b[0*4+j] + a[i*4+1]*b[1*4+j] + a[i*4+2]*b[2*4+j] + a[i*4+3]*b[3*4+j];
+ }
+ }
+}
+
+GLint
+myGluProject(GLdouble objx, GLdouble objy, GLdouble objz, const GLdouble modelMatrix[16], const GLdouble projMatrix[16], const GLint viewport[4], GLdouble *winx, GLdouble *winy, GLdouble *winz)
+{
+ GLdouble in[4];
+ GLdouble out[4];
+
+ in[0] = objx;
+ in[1] = objy;
+ in[2] = objz;
+ in[3] = 1.0;
+ __gluMultMatrixVecf(modelMatrix, in, out);
+ __gluMultMatrixVecf(projMatrix, out, in);
+ if (in[3] == 0.0)
+ return(GL_FALSE);
+ in[0] /= in[3];
+ in[1] /= in[3];
+ in[2] /= in[3];
+ /* Map x, y and z to range 0-1 */
+ in[0] = in[0] * 0.5 + 0.5;
+ in[1] = in[1] * 0.5 + 0.5;
+ in[2] = in[2] * 0.5 + 0.5;
+ /* Map x,y to viewport */
+ in[0] = in[0] * viewport[2] + viewport[0];
+ in[1] = in[1] * viewport[3] + viewport[1];
+ *winx = in[0];
+ *winy = in[1];
+ *winz = in[2];
+ return(GL_TRUE);
+}
+
+GLint
+myGluUnProject(GLdouble winx, GLdouble winy, GLdouble winz, const GLdouble modelMatrix[16], const GLdouble projMatrix[16], const GLint viewport[4], GLdouble *objx, GLdouble *objy, GLdouble *objz)
+{
+ GLdouble finalMatrix[16];
+ GLdouble in[4];
+ GLdouble out[4];
+
+ __gluMultMatricesf(modelMatrix, projMatrix, finalMatrix);
+ if (!__gluInvertMatrixf(finalMatrix, finalMatrix))
+ return(GL_FALSE);
+
+ in[0] = winx;
+ in[1] = winy;
+ in[2] = winz;
+ in[3] = 1.0;
+
+ /* Map x and y from window coordinates */
+ in[0] = (in[0] - viewport[0]) / viewport[2];
+ in[1] = (in[1] - viewport[1]) / viewport[3];
+
+ /* Map to range -1 to 1 */
+ in[0] = in[0] * 2 - 1;
+ in[1] = in[1] * 2 - 1;
+ in[2] = in[2] * 2 - 1;
+
+ __gluMultMatrixVecf(finalMatrix, in, out);
+ if (out[3] == 0.0) return(GL_FALSE);
+ out[0] /= out[3];
+ out[1] /= out[3];
+ out[2] /= out[3];
+ *objx = out[0];
+ *objy = out[1];
+ *objz = out[2];
+ return(GL_TRUE);
+}
+
+void
+myGluPerspective(GLdouble fovy_degree, GLdouble aspect, GLdouble zNear, GLdouble zFar) {
+ GLdouble m[16];
+ GLdouble fovy_rad = fovy_degree * (3.14159265358979 / 180.0);
+ GLdouble f = 1.0 / tan(fovy_rad / (GLdouble)2.0);
+ m[0] = f / aspect;
+ m[1] = 0.0;
+ m[2] = 0.0;
+ m[3] = 0.0;
+ m[4] = 0.0;
+ m[5] = f;
+ m[6] = 0.0;
+ m[7] = 0.0;
+ m[8] = 0.0;
+ m[9] = 0.0;
+ m[10] = (zFar + zNear) / (zNear - zFar);
+ m[11] = -1.0;
+ m[12] = 0.0;
+ m[13] = 0.0;
+ m[14] = (2 * zFar * zNear) / (zNear - zFar);
+ m[15] = 0.0;
+ glMatrixMode(GL_PROJECTION);
+ glLoadMatrixd(m);
+}
+
#pragma mark ==== MainView public methods ====
void
winZ = screenPos[2];
else
glReadPixels(screenPos[0] * scale, screenPos[1] * scale, 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, &winZ);
- gluUnProject(screenPos[0] * scale, screenPos[1] * scale, winZ, mview->modelview_matrix, mview->projection_matrix, viewport, &posX, &posY, &posZ);
+ myGluUnProject(screenPos[0] * scale, screenPos[1] * scale, winZ, mview->modelview_matrix, mview->projection_matrix, viewport, &posX, &posY, &posZ);
n = glGetError();
MainViewCallback_unlockFocus(mview);
objectPos[0] = posX;
viewport[0] = viewport[1] = 0;
viewport[2] = (GLint)(rect[2] - rect[0]) * scale;
viewport[3] = (GLint)(rect[3] - rect[1]) * scale;
- gluProject(objectPos[0], objectPos[1], objectPos[2], mview->modelview_matrix, mview->projection_matrix, viewport, &objX, &objY, &objZ);
+ myGluProject(objectPos[0], objectPos[1], objectPos[2], mview->modelview_matrix, mview->projection_matrix, viewport, &objX, &objY, &objZ);
if (glGetError() == GL_NO_ERROR) {
screenPos[0] = objX / scale;
screenPos[1] = objY / scale;
mview->perspective_vector[1] = width / height;
mview->perspective_vector[2] = dimension;
mview->perspective_vector[3] = distance + 200.0 * dimension;
- gluPerspective(mview->perspective_vector[0], mview->perspective_vector[1], mview->perspective_vector[2], mview->perspective_vector[3]);
+ myGluPerspective(mview->perspective_vector[0], mview->perspective_vector[1], mview->perspective_vector[2], mview->perspective_vector[3]);
/* Set up the model view */
glMatrixMode(GL_MODELVIEW);
MoleculeCallback_displayName(argp->u.mval, buf, sizeof buf);
if (buf[0] == 0) {
/* No associated document */
- snprintf(buf, sizeof buf, "#<Molecule:0x%lx>", (long unsigned)(void *)argp->u.mval);
+ snprintf(buf, sizeof buf, "#<Molecule:0x%lx>", (uintptr_t)(void *)argp->u.mval);
}
fprintf(fp, "%s", buf);
break;
Atom *ap;
/* If LSB of resSeqs is 1, then a constant value is used for all specified atoms */
- if (((int)resSeqs & 1) == 0) {
+ if (((uintptr_t)resSeqs & 1) == 0) {
withArray = 1;
resSeq = 0;
} else {
withArray = 0;
- resSeq = ((int)resSeqs - 1) / 2;
+ resSeq = ((uintptr_t)resSeqs - 1) / 2;
}
IntGroupIteratorInit(group, &iter);
#include <stdarg.h>
#include <math.h>
#include <float.h>
+#include "Missing.h"
/* Global parameter: it is initialized by the first call to ParameterReadFromFile() */
Parameter *gBuiltinParameters = NULL;
s_Ruby_UpdateUI_handler(VALUE data)
{
void **p = (void **)data;
- int index = (int)p[0];
+ int index = (intptr_t)p[0];
Molecule *mol = (Molecule *)p[1];
int *outChecked = (int *)p[2];
char **outTitle = (char **)p[3];
VALUE gval, rval, wval;
IntGroup *ig;
IntGroupIterator iter;
- int nn, errno, i, j, in, status;
+ int nn, errnum, i, j, in, status;
Vector *ref;
Double *weights, dval[3];
Transform tr;
if (rb_obj_is_kind_of(rval, rb_cNumeric)) {
int fn = NUM2INT(rb_Integer(rval));
if (fn < 0 || fn >= MoleculeGetNumberOfFrames(mol)) {
- errno = 1;
+ errnum = 1;
status = fn;
goto err;
}
} else if (rb_obj_is_kind_of(rval, rb_cLAMatrix)) {
LAMatrix *m = LAMatrixFromValue(rval, NULL, 0, 0);
if (m->row * m->column < nn * 3) {
- errno = 2;
+ errnum = 2;
goto err;
}
for (i = 0; i < nn; i++) {
VALUE aval;
rval = rb_protect(rb_ary_to_ary, rval, &status);
if (status != 0) {
- errno = 3;
+ errnum = 3;
goto err;
}
if (RARRAY_LEN(rval) < nn) {
- errno = 2;
+ errnum = 2;
goto err;
}
if (rb_obj_is_kind_of((RARRAY_PTR(rval))[0], rb_cNumeric)) {
/* Array of 3*nn numbers */
if (RARRAY_LEN(rval) < nn * 3) {
- errno = 2;
+ errnum = 2;
goto err;
}
for (i = 0; i < nn; i++) {
for (j = 0; j < 3; j++) {
aval = rb_protect(rb_Float, (RARRAY_PTR(rval))[i * 3 + j], &status);
if (status != 0) {
- errno = 3;
+ errnum = 3;
goto err;
}
dval[j] = NUM2DBL(aval);
} else {
aval = rb_protect(rb_ary_to_ary, aval, &status);
if (status != 0) {
- errno = 3;
+ errnum = 3;
goto err;
}
if (RARRAY_LEN(aval) < 3) {
- errno = 4;
+ errnum = 4;
status = i;
goto err;
}
for (j = 0; j < 3; j++) {
VALUE aaval = rb_protect(rb_Float, (RARRAY_PTR(aval))[j], &status);
if (status != 0) {
- errno = 3;
+ errnum = 3;
goto err;
}
dval[j] = NUM2DBL(aaval);
} else {
wval = rb_protect(rb_ary_to_ary, wval, &status);
if (status != 0) {
- errno = 3;
+ errnum = 3;
goto err;
}
if (RARRAY_LEN(wval) < nn) {
- errno = 5;
+ errnum = 5;
goto err;
}
for (i = 0; i < nn; i++) {
VALUE wwval = rb_protect(rb_Float, (RARRAY_PTR(wval))[i], &status);
if (status != 0) {
- errno = 3;
+ errnum = 3;
goto err;
}
weights[i] = NUM2DBL(wwval);
}
dval[0] = s_Molecule_FitCoordinates_Sub(mol, ig, ref, weights, tr);
if (dval[0] < 0) {
- errno = 6;
+ errnum = 6;
goto err;
}
- errno = 0;
+ errnum = 0;
err:
IntGroupIteratorRelease(&iter);
free(ref);
free(weights);
- if (errno == 0) {
+ if (errnum == 0) {
return rb_ary_new3(2, ValueFromTransform(&tr), rb_float_new(dval[0]));
- } else if (errno == 1) {
+ } else if (errnum == 1) {
rb_raise(rb_eMolbyError, "frame index (%d) is out of range", status);
- } else if (errno == 2) {
+ } else if (errnum == 2) {
rb_raise(rb_eMolbyError, "insufficient number of reference coordinates");
- } else if (errno == 3) {
+ } else if (errnum == 3) {
rb_jump_tag(status);
- } else if (errno == 4) {
+ } else if (errnum == 4) {
rb_raise(rb_eMolbyError, "less than 3 elements for index %d of reference coordinates", status);
- } else if (errno == 5) {
+ } else if (errnum == 5) {
rb_raise(rb_eMolbyError, "insufficient number of weight values");
- } else if (errno == 6) {
+ } else if (errnum == 6) {
rb_raise(rb_eMolbyError, "matrix calculation failed during coordinate fitting");
}
return Qnil; /* Not reached */
vp[3] = (void *)(intptr_t)(NUM2INT(rb_Integer(retval)));
return retval;
} else if (sym == sOnGetValueSymbol) {
- args[1] = INT2NUM((int)vp[3]);
- args[2] = INT2NUM((int)vp[4]);
+ args[1] = INT2NUM((intptr_t)vp[3]);
+ args[2] = INT2NUM((intptr_t)vp[4]);
retval = s_RubyDialog_CallActionProc(self, pval, 3, args);
retval = rb_str_to_str(retval);
vp[5] = strdup(EncodedStringValuePtr(retval));
return retval;
} else if (sym == sOnSetValueSymbol) {
- args[1] = INT2NUM((int)vp[3]);
- args[2] = INT2NUM((int)vp[4]);
+ args[1] = INT2NUM((intptr_t)vp[3]);
+ args[2] = INT2NUM((intptr_t)vp[4]);
args[3] = Ruby_NewEncodedStringValue2((char *)vp[5]);
retval = s_RubyDialog_CallActionProc(self, pval, 4, args);
vp[6] = (void *)(intptr_t)(NUM2INT(rb_Integer(retval)));
return retval;
} else if (sym == sOnDragSelectionToRowSymbol) {
- args[1] = INT2NUM((int)vp[3]);
+ args[1] = INT2NUM((intptr_t)vp[3]);
retval = s_RubyDialog_CallActionProc(self, pval, 2, args);
return retval;
} else if (sym == sIsItemEditableSymbol) {
- args[1] = INT2NUM((int)vp[3]);
- args[2] = INT2NUM((int)vp[4]);
+ args[1] = INT2NUM((intptr_t)vp[3]);
+ args[2] = INT2NUM((intptr_t)vp[4]);
retval = s_RubyDialog_CallActionProc(self, pval, 3, args);
vp[5] = (void *)(intptr_t)(RTEST(retval) ? 1 : 0);
return retval;
float *bg = (float *)vp[6];
int i, n = 0;
VALUE cval;
- args[1] = INT2NUM((int)vp[3]);
- args[2] = INT2NUM((int)vp[4]);
+ args[1] = INT2NUM((intptr_t)vp[3]);
+ args[2] = INT2NUM((intptr_t)vp[4]);
retval = s_RubyDialog_CallActionProc(self, pval, 3, args);
if (retval == Qnil)
return Qnil;
vp[7] = (void *)(intptr_t)n;
return retval;
} else if (sym == sHasPopUpMenuSymbol) {
- args[1] = INT2NUM((int)vp[3]);
- args[2] = INT2NUM((int)vp[4]);
+ args[1] = INT2NUM((intptr_t)vp[3]);
+ args[2] = INT2NUM((intptr_t)vp[4]);
retval = s_RubyDialog_CallActionProc(self, pval, 3, args);
if (retval == Qnil) {
vp[6] = (void *)0;
}
return retval;
} else if (sym == sOnPopUpMenuSelectedSymbol) {
- args[1] = INT2NUM((int)vp[3]);
- args[2] = INT2NUM((int)vp[4]);
- args[3] = INT2NUM((int)vp[5]);
+ args[1] = INT2NUM((intptr_t)vp[3]);
+ args[2] = INT2NUM((intptr_t)vp[4]);
+ args[3] = INT2NUM((intptr_t)vp[5]);
retval = s_RubyDialog_CallActionProc(self, pval, 4, args);
return retval;
} else return Qnil;
return 0;
} else if (val == Qnil)
return 0;
- else return (int)vp[3];
+ else return (intptr_t)vp[3];
}
void
if (status != 0 || val == Qnil) {
return -1;
} else
- return (int)vp[6];
+ return (intptr_t)vp[6];
}
void
VALUE val = rb_protect(s_RubyDialog_doTableAction, (VALUE)vp, &status);
if (status != 0 || val == Qnil)
return 0;
- else return (int)vp[5];
+ else return (intptr_t)vp[5];
}
int
VALUE val = rb_protect(s_RubyDialog_doTableAction, (VALUE)vp, &status);
if (status != 0 || val == Qnil)
return 0;
- else return (int)vp[3];
+ else return (intptr_t)vp[3];
}
void
VALUE val = rb_protect(s_RubyDialog_doTableAction, (VALUE)vp, &status);
if (status != 0 || val == Qnil)
return 0;
- else return (int)vp[7];
+ else return (intptr_t)vp[7];
}
int
VALUE val = rb_protect(s_RubyDialog_doTableAction, (VALUE)vp, &status);
if (status != 0 || val == Qnil)
return 0;
- else return (int)vp[6];
+ else return (intptr_t)vp[6];
}
void
VALUE flag;
RDItem *ip = (RDItem *)vp[1];
RDItem *ip2;
- int options = (int)vp[2];
+ int options = (intptr_t)vp[2];
VALUE ival, itval, actval, tval, aval;
RubyDialog *dref = s_RubyDialog_GetController(self);
VALUE items = rb_iv_get(self, "_items");
{
void **values = (void **)val;
VALUE self = (VALUE)values[0];
- int keyCode = (int)values[1];
+ int keyCode = (intptr_t)values[1];
VALUE actval = rb_iv_get(self, "_key_action");
if (actval != Qnil) {
if (TYPE(actval) == T_SYMBOL)
return -1;
else if (rval == Qnil)
return -1;
- else return (int)args[2];
+ else return (intptr_t)args[2];
}
static VALUE
{
void **values = (void **)val;
VALUE self = (VALUE)values[0];
- int isModal = (int)values[1];
+ int isModal = (intptr_t)values[1];
if (isModal) {
rb_funcall(self, rb_intern("end_modal"), 1, INT2NUM(1));
return Qnil;
An Interactive Molecular Modeling Software
with Integrated Ruby Interpreter
- Version 1.0.2
+ Version 1.1.0
Toshi Nagata
-version = "1.0.2"
+version = "1.1.0"
/* XPM */
-static char *jump_to_end_xpm[] = {
+static const char *jump_to_end_xpm[] = {
/* width height ncolors chars_per_pixel */
"9 9 7 1",
/* colors */
/* XPM */
-static char *jump_to_start_xpm[] = {
+static const char *jump_to_start_xpm[] = {
/* width height ncolors chars_per_pixel */
"9 9 8 1",
/* colors */
/* XPM */\r
-static char *pi00[] = {\r
+static const char *pi00[] = {\r
/* width height ncolors chars_per_pixel */\r
"12 12 20 1",\r
/* colors */\r
/* XPM */\r
-static char *pi01[] = {\r
+static const char *pi01[] = {\r
/* width height ncolors chars_per_pixel */\r
"12 12 23 1",\r
/* colors */\r
/* XPM */\r
-static char *pi02[] = {\r
+static const char *pi02[] = {\r
/* width height ncolors chars_per_pixel */\r
"12 12 19 1",\r
/* colors */\r
/* XPM */\r
-static char *pi03[] = {\r
+static const char *pi03[] = {\r
/* width height ncolors chars_per_pixel */\r
"12 12 20 1",\r
/* colors */\r
/* XPM */\r
-static char *pi04[] = {\r
+static const char *pi04[] = {\r
/* width height ncolors chars_per_pixel */\r
"12 12 24 1",\r
/* colors */\r
/* XPM */\r
-static char *pi05[] = {\r
+static const char *pi05[] = {\r
/* width height ncolors chars_per_pixel */\r
"12 12 19 1",\r
/* colors */\r
/* XPM */\r
-static char *pi06[] = {\r
+static const char *pi06[] = {\r
/* width height ncolors chars_per_pixel */\r
"12 12 19 1",\r
/* colors */\r
/* XPM */\r
-static char *pi07[] = {\r
+static const char *pi07[] = {\r
/* width height ncolors chars_per_pixel */\r
"12 12 24 1",\r
/* colors */\r
/* XPM */\r
-static char *pi08[] = {\r
+static const char *pi08[] = {\r
/* width height ncolors chars_per_pixel */\r
"12 12 20 1",\r
/* colors */\r
/* XPM */\r
-static char *pi09[] = {\r
+static const char *pi09[] = {\r
/* width height ncolors chars_per_pixel */\r
"12 12 20 1",\r
/* colors */\r
/* XPM */\r
-static char *pi10[] = {\r
+static const char *pi10[] = {\r
/* width height ncolors chars_per_pixel */\r
"12 12 23 1",\r
/* colors */\r
/* XPM */\r
-static char *pi11[] = {\r
+static const char *pi11[] = {\r
/* width height ncolors chars_per_pixel */\r
"12 12 19 1",\r
/* colors */\r
/* XPM */
-static char *play_backward_xpm[] = {
+static const char *play_backward_xpm[] = {
/* width height ncolors chars_per_pixel */
"9 9 12 1",
/* colors */
/* XPM */
-static char *play_forward_xpm[] = {
+static const char *play_forward_xpm[] = {
/* width height ncolors chars_per_pixel */
"9 9 12 1",
/* colors */
/* XPM */
-static char *rotate_bond_xpm[] = {
+static const char *rotate_bond_xpm[] = {
/* width height ncolors chars_per_pixel */
"18 18 30 2",
/* colors */
/* XPM */
-static char *rotate_x_xpm[] = {
+static const char *rotate_x_xpm[] = {
/* width height ncolors chars_per_pixel */
"18 18 29 2",
/* colors */
/* XPM */
-static char *rotate_y_xpm[] = {
+static const char *rotate_y_xpm[] = {
/* width height ncolors chars_per_pixel */
"18 18 26 1",
/* colors */
/* XPM */\r
-static char *stop_mini[] = {\r
+static const char *stop_mini[] = {\r
/* width height ncolors chars_per_pixel */\r
"12 12 34 2",\r
/* colors */\r
/* XPM */\r
-static char *stop_mini_dark[] = {\r
+static const char *stop_mini_dark[] = {\r
/* width height ncolors chars_per_pixel */\r
"12 12 42 2",\r
/* colors */\r
/* XPM */\r
-static char *stop_mini_grey[] = {\r
+static const char *stop_mini_grey[] = {\r
/* width height ncolors chars_per_pixel */\r
"12 12 71 2",\r
/* colors */\r
; Create an installer that can install both 32bit and 64bit versions
[Setup]
AppName = Molby
-AppVerName = Molby (v1.0.2)
+AppVerName = Molby (v1.1.0)
DefaultDirName = {pf}\Molby
DefaultGroupName = Molby
UninstallDisplayIcon = {app}\Molby.exe
[Setup]
AppName = Molby
-AppVerName = Molby (v1.0.2)
+AppVerName = Molby (v1.1.0)
DefaultDirName = {pf}\Molby (32bit)
DefaultGroupName = Molby (32bit)
UninstallDisplayIcon = {app}\Molby.exe
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
- <string>Version 1.0.2</string>
+ <string>Version 1.1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
- <string>v1.0.2</string>
+ <string>v1.1.0</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright 2008-2022 Toshi Nagata</string>
<key>NSPrincipalClass</key>
/* Begin PBXBuildFile section */
E403568428CF6A3D008E2C46 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E403568328CF6A3D008E2C46 /* QuartzCore.framework */; };
- E403568528D0AD7E008E2C46 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E4FC7845183E51180064FB2E /* Carbon.framework */; };
E403568628D0B7B0008E2C46 /* MyListCtrl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E41251B728CD92A100E12983 /* MyListCtrl.cpp */; };
E4059F9B28C46A6E0052B36B /* molby_icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = E4FC77D4183E4FF20064FB2E /* molby_icon.icns */; };
E4059F9C28C46A6E0052B36B /* Scripts in Resources */ = {isa = PBXBuildFile; fileRef = E4FC77D6183E4FFE0064FB2E /* Scripts */; };
E4589CEF28D5FD6400F55785 /* MyToggleButton.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4589CEE28D5FD6400F55785 /* MyToggleButton.cpp */; };
E4589CF028D5FD6400F55785 /* MyToggleButton.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4589CEE28D5FD6400F55785 /* MyToggleButton.cpp */; };
E4589CF228D6E89900F55785 /* docview.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E45B94611A170B9A008E95EB /* docview.cpp */; };
+ E4589CF528D82A5200F55785 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E4FC7845183E51180064FB2E /* Carbon.framework */; };
E4653CB118A0CC7D0022377B /* textctrl_addition.mm in Sources */ = {isa = PBXBuildFile; fileRef = E4653CB018A0CC7D0022377B /* textctrl_addition.mm */; };
E4ACACE718C6D32300F08B67 /* ortep3 in Resources */ = {isa = PBXBuildFile; fileRef = E4ACACE418C6D32300F08B67 /* ortep3 */; };
E4D379A219C87C2200636D28 /* modalwindow.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4D379A119C87C2200636D28 /* modalwindow.cpp */; };
E4FC784D183E51180064FB2E /* Cocoa.framework in Frameworks */,
E4FC784E183E51180064FB2E /* GLUT.framework in Frameworks */,
E4FC784F183E51180064FB2E /* IOKit.framework in Frameworks */,
- E403568528D0AD7E008E2C46 /* Carbon.framework in Frameworks */,
+ E4589CF528D82A5200F55785 /* Carbon.framework in Frameworks */,
E4FC7850183E51180064FB2E /* OpenGL.framework in Frameworks */,
E4FC7852183E51180064FB2E /* System.framework in Frameworks */,
E4FC7A17183E51570064FB2E /* AppKit.framework in Frameworks */,
void
ConsoleFrame::ShowHistory(bool up, bool option)
{
- char *p;
+ const char *p;
if (commandHistoryIndex == -1 && valueHistoryIndex == -1) {
if (!up)
return;
wxImage *img = CaptureGLCanvas(scale);
if (img != NULL) {
wxBitmap bitmap(*img);
- wxSize ppi = dc->GetPPI();
double sx, sy;
dc->GetUserScale(&sx, &sy);
dc->SetUserScale(sx / scale, sy / scale);
if (mview->tableIndex >= kMainViewBondTableIndex && mview->tableIndex <= kMainViewImproperTableIndex /* && mview->mol->par != NULL */ ) {
int row, col, i;
char indices[64], names[64], types[64], value[20], partypes[64], params[3][20];
- char *ptype, *parstr;
+ const char *ptype;
+ char *parstr;
wxPoint pos = event.GetPosition();
if (!listctrl->FindItemAtPosition(pos, &row, &col) || col < 4)
return;
}
asprintf(&parstr, "%s %s %s", params[0], params[1], params[2]);
MolActionCreateAndPerform(mview->mol, SCRIPT_ACTION("sssssss"), "cmd_edit_local_parameter_in_mainview", ptype, indices, names, types, value, partypes, parstr);
+ free(parstr);
}
}
return menu_bar;
}
-#if __WXMAC__
+#if defined(__WXMAC__) || defined(__WXOSX__)
/* When the application is launched without any documents, an empty document is opened.
This should be implemented by overriding this special method; parsing argc/argv does
not work, because the list of files is passed through an Apple Event. */
RequestOpenFilesByEvent(file);
}
-/* Open given files: instead of calling MacOpenFile() for each entry, build a file list
- and call MyApp::OnOpenFiles() */
-short
-MyApp::MacHandleAEODoc(const WXEVENTREF event, WXEVENTREF WXUNUSED(reply))
-{
- AEDescList docList;
- AEKeyword keywd;
- DescType returnedType;
- Size actualSize;
- long itemsInList;
- OSErr err;
- short i;
-
- return noErr; /* TODO: handle open Apple event */
-
- err = AEGetParamDesc((AppleEvent *)event, keyDirectObject, typeAEList, &docList);
- if (err != noErr)
- return err;
-
- err = AECountItems(&docList, &itemsInList);
- if (err != noErr)
- return err;
-
- ProcessSerialNumber PSN ;
- PSN.highLongOfPSN = 0 ;
- PSN.lowLongOfPSN = kCurrentProcess ;
- SetFrontProcess( &PSN ) ;
-
- wxString fName, fNameList;
- FSRef theRef ;
-
- for (i = 1; i <= itemsInList; i++)
- {
- AEGetNthPtr(
- &docList, i, typeFSRef, &keywd, &returnedType,
- (Ptr)&theRef, sizeof(theRef), &actualSize);
- // fName = wxMacFSRefToPath( &theRef ) ;
- fNameList.append(fName);
- fNameList.append(wxT("\n"));
+void
+MyApp::MacOpenFiles(const wxArrayString &fileNames)
+{
+ wxString fnames;
+ int i, n;
+ n = fileNames.GetCount();
+ for (i = 0; i < n; i++) {
+ fnames = fnames + fileNames[i];
+ if (i < n - 1)
+ fnames = fnames + wxT("\n");
}
-
- OnOpenFiles(fNameList);
-
- return noErr;
+ OnOpenFiles(fnames);
}
-#endif
+#endif // WXMAC
int
MyApp::OnExit(void)
{
int status = 0;
int callback_result = 0;
- int count = 0;
bool progress_panel = false;
char buf[256];
- size_t len, len_total;
wxString cmdstr(cmdline, WX_DEFAULT_CONV);
wxLongLong startTime;
// |
// |-> copyright messages
- char *s1, *s2, *s3;
+ const char *s1;
+ char *s2, *s3;
s1 = "Molby";
Molby_getDescription(&s2, &s3);
wxString str1(s1, WX_DEFAULT_CONV);
#if defined(__WXMAC__)
virtual void MacNewFile();
virtual void MacOpenFile(const wxString &fileName);
- virtual short MacHandleAEODoc(const WXEVENTREF event, WXEVENTREF WXUNUSED(reply));
+ virtual void MacOpenFiles(const wxArrayString &fileNames);
#endif
void EnableTimerForDocument(MyDocument *doc);
GNU General Public License for more details.
*/
-const char *gVersionString = "v1.0.2";
+const char *gVersionString = "v1.1.0";
const char *gCopyrightString = "Copyright (c) 2008-2022 Toshi Nagata";
/* The following are now defined in build/buildInfo.c, generated by record_build_date.sh */
/*int gRevisionNumber = 0;
{
int n = 0;
if (p_inited != 0)
- return;
+ return 0;
p_glIsRenderbufferEXT = (t_glIsRenderbufferEXT)wglGetProcAddress("glIsRenderbufferEXT");
if (p_glIsRenderbufferEXT == NULL)
n++;
int
ProgressFrame::CheckInterrupt()
{
- if (this != NULL && m_interruptValue) {
+ if (m_interruptValue) {
int save = m_interruptValue;
m_interruptValue = 0;
return save;
} else return;
if (size == 0)
size = font.GetPointSize();
+ wxFontFamily ffamily;
+ wxFontStyle fstyle;
+ wxFontWeight fweight;
if (family == 0)
- family = wxFONTFAMILY_DEFAULT;
+ ffamily = wxFONTFAMILY_DEFAULT;
else {
- family = (family == 2 ? wxFONTFAMILY_ROMAN :
+ ffamily = (family == 2 ? wxFONTFAMILY_ROMAN :
(family == 3 ? wxFONTFAMILY_SWISS :
(family == 4 ? wxFONTFAMILY_MODERN :
wxFONTFAMILY_DEFAULT)));
}
if (style == 0)
- style = wxFONTSTYLE_NORMAL;
+ fstyle = wxFONTSTYLE_NORMAL;
else {
- style = (style == 2 ? wxFONTSTYLE_SLANT :
+ fstyle = (style == 2 ? wxFONTSTYLE_SLANT :
(style == 3 ? wxFONTSTYLE_ITALIC :
wxFONTSTYLE_NORMAL));
}
if (weight == 0)
- weight = wxFONTWEIGHT_NORMAL;
+ fweight = wxFONTWEIGHT_NORMAL;
else {
- weight = (weight == 2 ? wxFONTWEIGHT_BOLD :
+ fweight = (weight == 2 ? wxFONTWEIGHT_BOLD :
(weight == 3 ? wxFONTWEIGHT_LIGHT :
wxFONTWEIGHT_NORMAL));
}
if (textctrl != NULL) {
wxTextAttr newAttr;
- wxFont newFont(size, family, style, weight);
+ wxFont newFont(size, ffamily, fstyle, fweight);
newAttr.SetFont(newFont);
textctrl->SetDefaultStyle(newAttr);
#if __WXMAC__
textctrl->SetFont(newFont);
#endif
} else {
- ctrl->SetFont(wxFont(size, family, style, weight));
+ ctrl->SetFont(wxFont(size, ffamily, fstyle, fweight));
wxString label = ctrl->GetLabel();
ctrl->SetLabel(_(""));
ctrl->SetLabel(label); /* Update the control size */
float size = FromDCDIP(dcp, *((float *)(args[i + 1])));
font.SetPointSize((int)size);
} else if (strcmp((const char *)args[i], "style") == 0) {
- long style = (intptr_t)(args[i + 1]);
+ int style = (intptr_t)(args[i + 1]);
+ wxFontStyle fstyle;
switch (style) {
- case 0: style = wxFONTSTYLE_NORMAL; break;
- case 1: style = wxFONTSTYLE_ITALIC; break;
- case 2: style = wxFONTSTYLE_SLANT; break;
- default: style = wxFONTSTYLE_NORMAL; break;
+ case 0: fstyle = wxFONTSTYLE_NORMAL; break;
+ case 1: fstyle = wxFONTSTYLE_ITALIC; break;
+ case 2: fstyle = wxFONTSTYLE_SLANT; break;
+ default: fstyle = wxFONTSTYLE_NORMAL; break;
}
- font.SetStyle(style);
+ font.SetStyle(fstyle);
} else if (strcmp((const char *)args[i], "family") == 0) {
wxFontFamily family;
j = (intptr_t)(args[i + 1]);
pen.SetWidth((int)width);
} else if (strcmp((const char *)args[i], "style") == 0) {
long style = (intptr_t)(args[i + 1]);
+ wxPenStyle pstyle;
switch (style) {
- case 0: style = wxSOLID; break;
- case 1: style = wxTRANSPARENT; break;
- case 2: style = wxDOT; break;
- case 3: style = wxLONG_DASH; break;
- case 4: style = wxSHORT_DASH; break;
- case 5: style = wxDOT_DASH; break;
- default: style = wxSOLID; break;
+ case 0: pstyle = wxPENSTYLE_SOLID; break;
+ case 1: pstyle = wxPENSTYLE_TRANSPARENT; break;
+ case 2: pstyle = wxPENSTYLE_DOT; break;
+ case 3: pstyle = wxPENSTYLE_LONG_DASH; break;
+ case 4: pstyle = wxPENSTYLE_SHORT_DASH; break;
+ case 5: pstyle = wxPENSTYLE_DOT_DASH; break;
+ default: pstyle = wxPENSTYLE_SOLID; break;
}
- pen.SetStyle(style);
+ pen.SetStyle(pstyle);
}
}
}