• R/O
  • SSH
  • HTTPS

molby: Commit


Commit MetaInfo

Revision625 (tree)
Time2019-08-17 17:55:16
Authortoshinagata1964

Log Message

About dialog is improved.

Change Summary

Incremental Difference

--- trunk/Makefile (revision 624)
+++ trunk/Makefile (revision 625)
@@ -146,20 +146,7 @@
146146 $(CC) -c buildInfo.c -o $(DESTPREFIX)/buildInfo.o $(CFLAGS)
147147 $(CPP) -o $@ $(DESTOBJECTS) $(DESTPREFIX)/buildInfo.o $(CFLAGS) $(LDFLAGS)
148148
149-$(DESTPREFIX)/$(PRODUCT) : $(DESTPREFIX)/$(EXECUTABLE) ../Scripts/*.rb amber11 ortep3/ortep3$(EXE_SUFFIX)
150-ifeq ($(TARGET_PLATFORM),MAC)
151- rm -rf $(DESTPREFIX)/$(PRODUCT)
152- mkdir -p $(DESTPREFIX)/$(PRODUCT)/Contents/MacOS
153- mkdir -p $(DESTPREFIX)/$(PRODUCT)/Contents/Resources
154- cp -f Info.plist $(DESTPREFIX)/$(PRODUCT)/Contents
155- echo -n "APPL????" > $(DESTPREFIX)/$(PRODUCT)/Contents/PkgInfo
156- cp -r ../Scripts $(DESTPREFIX)/$(PRODUCT)/Contents/Resources
157- cp -r amber11 $(DESTPREFIX)/$(PRODUCT)/Contents/Resources
158- cp -r ortep3 $(DESTPREFIX)/$(PRODUCT)/Contents/Resources
159- mkdir -p $(DESTPREFIX)/$(PRODUCT)/Contents/Resources/Scripts/lib
160- for i in $(RUBY_EXTLIB); do cp $(RUBY_DIR)/lib/$$i $(DESTPREFIX)/$(PRODUCT)/Contents/Resources/Scripts/lib; done
161- cp $(DESTPREFIX)/$(EXECUTABLE) $(DESTPREFIX)/$(PRODUCT)/Contents/MacOS
162-endif
149+$(DESTPREFIX)/$(PRODUCT) : $(DESTPREFIX)/$(EXECUTABLE) ../Scripts/*.rb ../bitmaps/bitmaps amber11 ortep3/ortep3$(EXE_SUFFIX)
163150 ifeq ($(TARGET_PLATFORM),MSW)
164151 echo PWD = $(PWD)
165152 rm -rf $(DESTPREFIX)/$(PRODUCT_DIR)
@@ -167,6 +154,7 @@
167154 cp $(DESTPREFIX)/$(EXECUTABLE) $(DESTPREFIX)/$(PRODUCT_DIR)/$(FINAL_EXECUTABLE)
168155 # cp mingwm10.dll $(DESTPREFIX)/$(PRODUCT_DIR)
169156 cp -r ../Scripts $(DESTPREFIX)/$(PRODUCT_DIR)
157+ cp -r ../bitmaps/bitmaps $(DESTPREFIX)/$(PRODUCT_DIR)
170158 cp -r amber11 $(DESTPREFIX)/$(PRODUCT_DIR)
171159 cp -r ortep3 $(DESTPREFIX)/$(PRODUCT_DIR)
172160 mkdir -p $(DESTPREFIX)/$(PRODUCT_DIR)/Scripts/lib
--- trunk/MolLib/Molecule.c (revision 624)
+++ trunk/MolLib/Molecule.c (revision 625)
@@ -6203,7 +6203,7 @@
62036203 return sMoleculeSearchAcrossAtomGroup(mp->nimpropers, mp->impropers, 4, atomgroup, "impropers");
62046204 }
62056205
6206-/* Subroutine for MoleculeGuessBonds. It can be also used independently, but make sure that *outNbonds/*outBonds
6206+/* Subroutine for MoleculeGuessBonds. It can be also used independently, but make sure that *outNbonds / *outBonds
62076207 _correctly_ represents an array of two integers (as in mp->nbonds/mp->bonds). */
62086208 /* Find atoms within the given "distance" from the given position. */
62096209 /* If limit is negative, its absolute value denotes the threshold distance in angstrom; otherwise,
@@ -9433,7 +9433,7 @@
94339433 int
94349434 MoleculeChangeResidueNumber(Molecule *mp, IntGroup *group, int resSeq)
94359435 {
9436- return MoleculeChangeResidueNumberWithArray(mp, group, (Int *)(resSeq * 2 + 1));
9436+ return MoleculeChangeResidueNumberWithArray(mp, group, (Int *)(intptr_t)(resSeq * 2 + 1));
94379437 }
94389438
94399439 /* Offset the residue numbers by a certain amount. The argument nresidues, if non-negative,
--- trunk/MolLib/Ruby_bind/Molby_extern.h (revision 624)
+++ trunk/MolLib/Ruby_bind/Molby_extern.h (revision 625)
@@ -38,7 +38,7 @@
3838 extern int Ruby_UpdateUI(int index, Molecule *mol, int *outChecked, char **outTitle);
3939
4040 extern void Molby_startup(const char *script_path, const char *dir);
41-extern char *Molby_getDescription(void);
41+extern void Molby_getDescription(char **versionString, char **auxString);
4242 extern RubyValue Molby_evalRubyScriptOnMolecule(const char *script, Molecule *mol, const char *fname, int *status);
4343 /* extern RubyValue Molby_evalRubyScript(const char *script, int *status);
4444 extern RubyValue Molby_evalRubyScriptOnActiveMoleculeWithInterrupt(const char *script, int *status); */
--- trunk/MolLib/Ruby_bind/ruby_bind.c (revision 624)
+++ trunk/MolLib/Ruby_bind/ruby_bind.c (revision 625)
@@ -818,7 +818,7 @@
818818 int status;
819819 void *p[4];
820820 VALUE retval;
821- p[0] = (void *)index;
821+ p[0] = (void *)(intptr_t)index;
822822 p[1] = mol;
823823 p[2] = outChecked;
824824 p[3] = outTitle;
@@ -4787,7 +4787,7 @@
47874787
47884788 #pragma mark ------ Allocate/Release/Accessor ------
47894789
4790-/* An malloc'ed string buffer. Retains the error/warning message from the last ***load/***save method. */
4790+/* An malloc'ed string buffer. Retains the error/warning message from the last ***load / ***save method. */
47914791 /* Accessible from Ruby as Molecule#error_message and Molecule#error_message=. */
47924792 char *gLoadSaveErrorMessage = NULL;
47934793
@@ -12090,19 +12090,20 @@
1209012090 gMolbyRunLevel--;
1209112091 }
1209212092
12093-char *
12094-Molby_getDescription(void)
12093+void
12094+Molby_getDescription(char **versionString, char **auxString)
1209512095 {
1209612096 extern const char *gVersionString, *gCopyrightString;
1209712097 extern int gRevisionNumber;
1209812098 extern char *gLastBuildString;
12099- char *s;
12099+ char *s1, *s2;
1210012100 char *revisionString;
1210112101 if (gRevisionNumber > 0) {
1210212102 asprintf(&revisionString, ", revision %d", gRevisionNumber);
1210312103 } else revisionString = "";
12104- asprintf(&s,
12105- "Molby %s%s\n%s\nLast compile: %s\n"
12104+ asprintf(&s1, "Molby %s%s\n%s\nLast compile: %s\n",
12105+ gVersionString, revisionString, gCopyrightString, gLastBuildString);
12106+ asprintf(&s2,
1210612107 #if !defined(__CMDMAC__)
1210712108 "\nIncluding:\n"
1210812109 "%s"
@@ -12112,9 +12113,9 @@
1211212113 "ruby %s, http://www.ruby-lang.org/\n"
1211312114 "%s\n"
1211412115 "FFTW 3.3.2, http://www.fftw.org/\n"
12115- " Copyright (C) 2003, 2007-11 Matteo Frigo\n"
12116+ " Copyright (C) 2003, 2007-11 Matteo Frigo"
1211612117 " and Massachusetts Institute of Technology",
12117- gVersionString, revisionString, gCopyrightString, gLastBuildString,
12118+
1211812119 #if !defined(__CMDMAC__)
1211912120 MyAppCallback_getGUIDescriptionString(),
1212012121 #endif
@@ -12121,7 +12122,10 @@
1212112122 gRubyVersion, gRubyCopyright);
1212212123 if (revisionString[0] != 0)
1212312124 free(revisionString);
12124- return s;
12125+ if (versionString != NULL)
12126+ *versionString = s1;
12127+ if (auxString != NULL)
12128+ *auxString = s2;
1212512129 }
1212612130
1212712131 void
@@ -12174,9 +12178,13 @@
1217412178 } */
1217512179
1217612180 #if defined(__CMDMAC__)
12177- wbuf = Molby_getDescription();
12178- printf("%s\n", wbuf);
12179- free(wbuf);
12181+ {
12182+ char *wbuf2;
12183+ Molby_getDescription(&wbuf, &wbuf2);
12184+ printf("%s\n%s\n", wbuf, wbuf2);
12185+ free(wbuf);
12186+ free(wbuf2);
12187+ }
1218012188 #endif
1218112189
1218212190 /* Read atom display parameters */
--- trunk/MolLib/Ruby_bind/ruby_dialog.c (revision 624)
+++ trunk/MolLib/Ruby_bind/ruby_dialog.c (revision 625)
@@ -1767,7 +1767,7 @@
17671767
17681768 if (sym == sOnCountSymbol) {
17691769 retval = s_RubyDialog_CallActionProc(self, pval, 1, args);
1770- vp[3] = (void *)(NUM2INT(rb_Integer(retval)));
1770+ vp[3] = (void *)(intptr_t)(NUM2INT(rb_Integer(retval)));
17711771 return retval;
17721772 } else if (sym == sOnGetValueSymbol) {
17731773 args[1] = INT2NUM((int)vp[3]);
@@ -1781,7 +1781,7 @@
17811781 args[2] = INT2NUM((int)vp[4]);
17821782 args[3] = rb_str_new2((char *)vp[5]);
17831783 retval = s_RubyDialog_CallActionProc(self, pval, 4, args);
1784- vp[6] = (void *)(NUM2INT(rb_Integer(retval)));
1784+ vp[6] = (void *)(intptr_t)(NUM2INT(rb_Integer(retval)));
17851785 return retval;
17861786 } else if (sym == sOnDragSelectionToRowSymbol) {
17871787 args[1] = INT2NUM((int)vp[3]);
@@ -1791,15 +1791,15 @@
17911791 args[1] = INT2NUM((int)vp[3]);
17921792 args[2] = INT2NUM((int)vp[4]);
17931793 retval = s_RubyDialog_CallActionProc(self, pval, 3, args);
1794- vp[5] = (void *)(RTEST(retval) ? 1 : 0);
1794+ vp[5] = (void *)(intptr_t)(RTEST(retval) ? 1 : 0);
17951795 return retval;
17961796 } else if (sym == sIsDragAndDropEnabledSymbol) {
17971797 retval = s_RubyDialog_CallActionProc(self, pval, 1, args);
1798- vp[3] = (void *)(RTEST(retval) ? 1 : 0);
1798+ vp[3] = (void *)(intptr_t)(RTEST(retval) ? 1 : 0);
17991799 return retval;
18001800 } else if (sym == sOnSelectionChangedSymbol) {
18011801 retval = s_RubyDialog_CallActionProc(self, pval, 1, args);
1802- vp[3] = (void *)(RTEST(retval) ? 1 : 0);
1802+ vp[3] = (void *)(intptr_t)(RTEST(retval) ? 1 : 0);
18031803 return retval;
18041804 } else if (sym == sOnSetColorSymbol) {
18051805 float *fg = (float *)vp[5];
@@ -1828,7 +1828,7 @@
18281828 }
18291829 n |= 2;
18301830 }
1831- vp[7] = (void *)n;
1831+ vp[7] = (void *)(intptr_t)n;
18321832 return retval;
18331833 } else if (sym == sHasPopUpMenuSymbol) {
18341834 args[1] = INT2NUM((int)vp[3]);
@@ -1841,7 +1841,7 @@
18411841 char **titles;
18421842 retval = rb_ary_to_ary(retval);
18431843 n = RARRAY_LEN(retval);
1844- vp[6] = (void *)n;
1844+ vp[6] = (void *)(intptr_t)n;
18451845 titles = ALLOC_N(char *, n);
18461846 *((char ***)vp[5]) = titles;
18471847 for (i = 0; i < n; i++) {
@@ -1877,7 +1877,7 @@
18771877 RubyDialog_GetTableItemText(RubyValue self, RDItem *ip, int row, int column, char *buf, int buflen)
18781878 {
18791879 int status;
1880- void *vp[6] = { (void *)self, (void *)ip, (void *)sOnGetValueSymbol, (void *)row, (void *)column, NULL };
1880+ void *vp[6] = { (void *)(uintptr_t)self, (void *)ip, (void *)(uintptr_t)sOnGetValueSymbol, (void *)(intptr_t)row, (void *)(intptr_t)column, NULL };
18811881 VALUE val = rb_protect(s_RubyDialog_doTableAction, (VALUE)vp, &status);
18821882 if (status != 0 || val == Qnil) {
18831883 buf[0] = 0;
@@ -1891,7 +1891,7 @@
18911891 RubyDialog_SetTableItemText(RubyValue self, RDItem *ip, int row, int column, const char *str)
18921892 {
18931893 int status;
1894- void *vp[7] = { (void *)self, (void *)ip, (void *)sOnSetValueSymbol, (void *)row, (void *)column, (void *)str, NULL };
1894+ void *vp[7] = { (void *)(uintptr_t)self, (void *)ip, (void *)(uintptr_t)sOnSetValueSymbol, (void *)(intptr_t)row, (void *)(intptr_t)column, (void *)str, NULL };
18951895 VALUE val = rb_protect(s_RubyDialog_doTableAction, (VALUE)vp, &status);
18961896 if (status != 0 || val == Qnil) {
18971897 return -1;
@@ -1903,7 +1903,7 @@
19031903 RubyDialog_DragTableSelectionToRow(RubyValue self, RDItem *ip, int row)
19041904 {
19051905 int status;
1906- void *vp[5] = { (void *)self, (void *)ip, (void *)sOnDragSelectionToRowSymbol, (void *)row, NULL };
1906+ void *vp[5] = { (void *)(uintptr_t)self, (void *)ip, (void *)(uintptr_t)sOnDragSelectionToRowSymbol, (void *)(intptr_t)row, NULL };
19071907 rb_protect(s_RubyDialog_doTableAction, (VALUE)vp, &status);
19081908 if (status != 0)
19091909 Ruby_showError(status);
@@ -1913,7 +1913,7 @@
19131913 RubyDialog_IsTableItemEditable(RubyValue self, RDItem *ip, int row, int column)
19141914 {
19151915 int status;
1916- void *vp[6] = { (void *)self, (void *)ip, (void *)sIsItemEditableSymbol, (void *)row, (void *)column, NULL };
1916+ void *vp[6] = { (void *)(uintptr_t)self, (void *)ip, (void *)(uintptr_t)sIsItemEditableSymbol, (void *)(intptr_t)row, (void *)(intptr_t)column, NULL };
19171917 VALUE val = rb_protect(s_RubyDialog_doTableAction, (VALUE)vp, &status);
19181918 if (status != 0 || val == Qnil)
19191919 return 0;
@@ -1924,7 +1924,7 @@
19241924 RubyDialog_IsTableDragAndDropEnabled(RubyValue self, RDItem *ip)
19251925 {
19261926 int status;
1927- void *vp[4] = { (void *)self, (void *)ip, (void *)sIsDragAndDropEnabledSymbol, NULL };
1927+ void *vp[4] = { (void *)(uintptr_t)self, (void *)ip, (void *)(uintptr_t)sIsDragAndDropEnabledSymbol, NULL };
19281928 VALUE val = rb_protect(s_RubyDialog_doTableAction, (VALUE)vp, &status);
19291929 if (status != 0 || val == Qnil)
19301930 return 0;
@@ -1945,7 +1945,7 @@
19451945 RubyDialog_SetTableItemColor(RubyValue self, RDItem *ip, int row, int column, float *fg, float *bg)
19461946 {
19471947 int status;
1948- void *vp[8] = { (void *)self, (void *)ip, (void *)sOnSetColorSymbol, (void *)row, (void *)column, (void *)fg, (void *)bg, NULL };
1948+ void *vp[8] = { (void *)(uintptr_t)self, (void *)ip, (void *)(uintptr_t)sOnSetColorSymbol, (void *)(intptr_t)row, (void *)(intptr_t)column, (void *)fg, (void *)bg, NULL };
19491949 VALUE val = rb_protect(s_RubyDialog_doTableAction, (VALUE)vp, &status);
19501950 if (status != 0 || val == Qnil)
19511951 return 0;
@@ -1956,7 +1956,7 @@
19561956 RubyDialog_HasPopUpMenu(RubyValue self, RDItem *ip, int row, int column, char ***menu_titles)
19571957 {
19581958 int status;
1959- void *vp[7] = { (void *)self, (void *)ip, (void *)sHasPopUpMenuSymbol, (void *)row, (void *)column, (void *)menu_titles, NULL };
1959+ void *vp[7] = { (void *)(uintptr_t)self, (void *)ip, (void *)(uintptr_t)sHasPopUpMenuSymbol, (void *)(intptr_t)row, (void *)(intptr_t)column, (void *)menu_titles, NULL };
19601960 VALUE val = rb_protect(s_RubyDialog_doTableAction, (VALUE)vp, &status);
19611961 if (status != 0 || val == Qnil)
19621962 return 0;
@@ -1967,7 +1967,7 @@
19671967 RubyDialog_OnPopUpMenuSelected(RubyValue self, RDItem *ip, int row, int column, int selected_index)
19681968 {
19691969 int status;
1970- void *vp[7] = { (void *)self, (void *)ip, (void *)sOnPopUpMenuSelectedSymbol, (void *)row, (void *)column, (void *)selected_index, NULL };
1970+ void *vp[7] = { (void *)(uintptr_t)self, (void *)ip, (void *)(uintptr_t)sOnPopUpMenuSelectedSymbol, (void *)(intptr_t)row, (void *)(intptr_t)column, (void *)(intptr_t)selected_index, NULL };
19711971 rb_protect(s_RubyDialog_doTableAction, (VALUE)vp, &status);
19721972 if (status != 0)
19731973 Ruby_showError(status);
@@ -2130,9 +2130,9 @@
21302130 {
21312131 int status;
21322132 void *vp[3];
2133- vp[0] = (void *)self;
2133+ vp[0] = (void *)(uintptr_t)self;
21342134 vp[1] = ip;
2135- vp[2] = (void *)options;
2135+ vp[2] = (void *)(intptr_t)options;
21362136 rb_protect(s_RubyDialog_doItemAction, (VALUE)vp, &status);
21372137 if (status != 0)
21382138 Ruby_showError(status);
@@ -2224,7 +2224,7 @@
22242224 int status;
22252225 void *values[2];
22262226 values[0] = (void *)self;
2227- values[1] = (void *)keyCode;
2227+ values[1] = (void *)(intptr_t)keyCode;
22282228 rb_protect(s_RubyDialog_doKeyAction, (VALUE)values, &status);
22292229 if (status != 0) {
22302230 /* Stop timer before showing error dialog */
@@ -2249,7 +2249,7 @@
22492249 return Qnil; /* Not set */
22502250 else {
22512251 pval = rb_Integer(pval);
2252- ((void **)val)[2] = (void *)(NUM2INT(pval));
2252+ ((void **)val)[2] = (void *)(intptr_t)(NUM2INT(pval));
22532253 return pval;
22542254 }
22552255 }
@@ -2302,7 +2302,7 @@
23022302 {
23032303 int status;
23042304 VALUE rval;
2305- void *args[2] = { (void *)self, (void *)isModal };
2305+ void *args[2] = { (void *)(uintptr_t)self, (void *)(intptr_t)isModal };
23062306 rval = rb_protect(s_RubyDialog_doCloseWindow, (VALUE)args, &status);
23072307 if (status != 0) {
23082308 Ruby_showError(status);
@@ -2515,7 +2515,7 @@
25152515 j = 2;
25162516 else j = 0;
25172517 args[i * 2] = "style";
2518- args[i * 2 + 1] = (void *)j;
2518+ args[i * 2 + 1] = (void *)(intptr_t)j;
25192519 args[i * 2 + 2] = NULL;
25202520 } else if (kval == sWeightSymbol) {
25212521 if (aval == sMediumSymbol)
@@ -2526,7 +2526,7 @@
25262526 j = 2;
25272527 else j = 0;
25282528 args[i * 2] = "weight";
2529- args[i * 2 + 1] = (void *)j;
2529+ args[i * 2 + 1] = (void *)(intptr_t)j;
25302530 args[i * 2 + 2] = NULL;
25312531 } else if (kval == sFamilySymbol) {
25322532 if (aval == sDefaultSymbol)
@@ -2539,7 +2539,7 @@
25392539 j = 3;
25402540 else j = 0;
25412541 args[i * 2] = "family";
2542- args[i * 2 + 1] = (void *)j;
2542+ args[i * 2 + 1] = (void *)(intptr_t)j;
25432543 args[i * 2 + 2] = NULL;
25442544 }
25452545 }
@@ -2609,7 +2609,7 @@
26092609 j = 5;
26102610 else j = 0;
26112611 args[i * 2] = "style";
2612- args[i * 2 + 1] = (void *)j;
2612+ args[i * 2 + 1] = (void *)(intptr_t)j;
26132613 args[i * 2 + 2] = NULL;
26142614 }
26152615 }
--- trunk/wxSources/MoleculeView.cpp (revision 624)
+++ trunk/wxSources/MoleculeView.cpp (revision 625)
@@ -537,7 +537,6 @@
537537 wxBitmapType type = wxBITMAP_TYPE_PNG;
538538 if (ext.CmpNoCase(_T("tif")) == 0)
539539 type = wxBITMAP_TYPE_TIF;
540- MyAppCallback_initImageHandlers();
541540 img->SaveFile(fname, type);
542541 delete img;
543542 return 0;
--- trunk/wxSources/MyApp.cpp (revision 624)
+++ trunk/wxSources/MyApp.cpp (revision 625)
@@ -256,6 +256,9 @@
256256 new wxDocTemplate(m_docManager, _T("Z Matrix"), _T("*.zmat"), _T(""), _T("zmat"), _T("Molecule Doc"), _T("Molecule View"), CLASSINFO(MyDocument), CLASSINFO(MoleculeView));
257257 new wxDocTemplate(m_docManager, _T("Any Molecule"), _T("*.*"), _T(""), _T(""), _T("Molecule Doc"), _T("Molecule View"), CLASSINFO(MyDocument), CLASSINFO(MoleculeView));
258258
259+ // Init image handlers
260+ MyAppCallback_initImageHandlers();
261+
259262 // Create the main frame window
260263 frame = new MyFrame((wxDocManager *) m_docManager, (wxFrame *) NULL,
261264 _T("Molby"), wxPoint(0, 0), wxSize(800, 600),
@@ -1689,6 +1692,62 @@
16891692 this->AddPendingEvent(myEvent);
16901693 }
16911694
1695+#pragma mark ====== AboutBox ======
1696+
1697+IMPLEMENT_CLASS(AboutDialog, wxDialog)
1698+BEGIN_EVENT_TABLE(AboutDialog, wxDialog)
1699+END_EVENT_TABLE()
1700+
1701+AboutDialog::AboutDialog():
1702+ wxDialog(NULL, -1, wxT("About Molby"))
1703+{
1704+ // vsizer1 --> hsizer1 --> Molby icon
1705+ // | |-> vsizer2 --> "Molby"
1706+ // | |-> version strings
1707+ // |
1708+ // |-> copyright messages
1709+
1710+ char *s1, *s2;
1711+ Molby_getDescription(&s1, &s2);
1712+ wxString str1(s1, WX_DEFAULT_CONV);
1713+ wxString str2(s2, WX_DEFAULT_CONV);
1714+ free(s1);
1715+ free(s2);
1716+#if defined(__WXMSW__)
1717+ wxFont *textFont0 = new wxFont(12, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD);
1718+ wxFont *textFont1 = new wxFont(10, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL);
1719+ wxFont *textFont2 = new wxFont(9, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL);
1720+#else
1721+ wxFont *textFont0 = new wxFont(14, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD);
1722+ wxFont *textFont1 = new wxFont(12, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL);
1723+ wxFont *textFont2 = new wxFont(11, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL);
1724+#endif
1725+ wxBoxSizer *vsizer1 = new wxBoxSizer(wxVERTICAL);
1726+ wxBoxSizer *vsizer2 = new wxBoxSizer(wxVERTICAL);
1727+ wxBoxSizer *hsizer1 = new wxBoxSizer(wxHORIZONTAL);
1728+ wxString tifname = wxGetApp().FindResourcePath() + wxFILE_SEP_PATH + wxT("bitmaps/molby_icon64.png");
1729+ wxBitmap *molbyBitmap = new wxBitmap(tifname, wxBITMAP_TYPE_PNG);
1730+ wxStaticText *stext1 = new wxStaticText(this, -1, wxT("Molby"));
1731+ stext1->SetFont(*textFont0);
1732+ wxStaticText *stext2 = new wxStaticText(this, -1, str1);
1733+ stext2->SetFont(*textFont1);
1734+ wxStaticBitmap *staticBitmap = new wxStaticBitmap(this, -1, *molbyBitmap);
1735+ vsizer2->Add(stext1, 0, wxALL | wxEXPAND, 2);
1736+ vsizer2->Add(stext2, 0, wxALL | wxEXPAND, 2);
1737+ hsizer1->AddSpacer(20);
1738+ hsizer1->Add(staticBitmap, 0, 0, 10);
1739+ hsizer1->AddSpacer(20);
1740+ hsizer1->Add(vsizer2, 0, wxALL | wxEXPAND, 5);
1741+ wxStaticText *stext3 = new wxStaticText(this, -1, str2);
1742+ stext3->SetFont(*textFont2);
1743+ vsizer1->Add(hsizer1, 0, wxALL | wxEXPAND, 5);
1744+ vsizer1->Add(stext3, 0, wxALL | wxEXPAND, 5);
1745+ vsizer1->Add(this->CreateButtonSizer(wxOK), 0, wxALL | wxEXPAND, 10);
1746+ vsizer1->Layout();
1747+ this->SetSizerAndFit(vsizer1);
1748+ this->Centre();
1749+}
1750+
16921751 #pragma mark ====== MyFrame (top-level window) ======
16931752
16941753 /*
@@ -1717,11 +1776,9 @@
17171776
17181777 void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event) )
17191778 {
1720- char *s;
1721- s = Molby_getDescription();
1722- wxString str(s, WX_DEFAULT_CONV);
1723- (void)wxMessageBox(str, _T("Molby"));
1724- free(s);
1779+ AboutDialog *d = new AboutDialog();
1780+ if ( d->ShowModal() == wxID_OK )
1781+ d->Destroy();
17251782 }
17261783
17271784 MyFrame *GetMainFrame(void)
@@ -1738,18 +1795,18 @@
17381795 if (desc == NULL) {
17391796 asprintf(&desc,
17401797 "AmberTools 1.3, http://ambermd.org/\n"
1741- " Copyright (C) Junmei Wang, Ross C. Walker, \n"
1742- " Michael F. Crowley, Scott Brozell and David A. Case\n"
1798+ " Copyright (C) Junmei Wang, Ross C. Walker, "
1799+ "Michael F. Crowley, Scott Brozell and David A. Case\n"
17431800 "ORTEP-III, http://web.ornl.gov/sci/ortep/\n"
1744- " Michael N. Burnett and Carroll K. Johnson, \n"
1745- " Oak Ridge National Laboratory Report ORNL-6895,\n"
1746- " 1996.\n"
1801+ " Michael N. Burnett and Carroll K. Johnson, "
1802+ "Oak Ridge National Laboratory Report ORNL-6895, "
1803+ "1996.\n"
17471804 "wxWidgets %d.%d.%d, http://www.wxwidgets.org/\n"
1748- " Copyright (C) 1992-2013 Julian Smart, Vadim\n"
1749- " Zeitlin, Stefan Csomor, Robert Roebling,\n"
1750- " and other members of the wxWidgets team\n"
1751- " Portions (C) 1996 Artificial Intelligence \n"
1752- " Applications Institute\n",
1805+ " Copyright (C) 1992-2013 Julian Smart, Vadim "
1806+ "Zeitlin, Stefan Csomor, Robert Roebling,\n"
1807+ " and other members of the wxWidgets team\n"
1808+ " Portions (C) 1996 Artificial Intelligence "
1809+ "Applications Institute\n",
17531810 wxMAJOR_VERSION, wxMINOR_VERSION, wxRELEASE_NUMBER);
17541811 }
17551812 return desc;
--- trunk/wxSources/MyApp.h (revision 624)
+++ trunk/wxSources/MyApp.h (revision 625)
@@ -244,6 +244,17 @@
244244
245245 DECLARE_APP(MyApp)
246246
247+// About dialog
248+class AboutDialog: public wxDialog
249+{
250+ DECLARE_CLASS(AboutDialog)
251+public:
252+ AboutDialog();
253+ void OnOKPressed(wxCommandEvent &event);
254+private:
255+ DECLARE_EVENT_TABLE()
256+};
257+
247258 // Define a new frame
248259 class MyFrame: public wxDocParentFrame
249260 {
--- trunk/wxSources/MyDocument.cpp (revision 624)
+++ trunk/wxSources/MyDocument.cpp (revision 625)
@@ -338,8 +338,7 @@
338338 {
339339 wxString wildcard;
340340 wxFileName fname(GetFilename());
341- wxString fnstr;
342- GetPrintableName(fnstr);
341+ wxString fnstr = GetUserReadableName();
343342 {
344343 /* File filter is built from MyDocManager information */
345344 wxString desc, filter, ext;
@@ -394,7 +393,7 @@
394393 i = MyAppCallback_getGlobalSettingsWithType("global.export_background_color", 'i', &bg_color);
395394 if (i != 0)
396395 bg_color = 0;
397- GetPrintableName(fnstr);
396+ fnstr = GetUserReadableName();
398397 if ((i = fnstr.Find('.', true)) != wxNOT_FOUND) {
399398 fnstr = fnstr.Mid(0, i);
400399 }
@@ -1673,7 +1672,7 @@
16731672 MyDocument *doc = MyDocumentFromMolecule(mol);
16741673 if (doc != NULL) {
16751674 wxString fname;
1676- doc->GetPrintableName(fname);
1675+ fname = doc->GetUserReadableName();
16771676 strncpy(buf, (const char*)fname.mb_str(wxConvFile), bufsize - 1);
16781677 buf[bufsize - 1] = 0;
16791678 } else {
--- trunk/wxSources/MyThread.cpp (revision 624)
+++ trunk/wxSources/MyThread.cpp (revision 625)
@@ -36,7 +36,7 @@
3636 MyThread::ExitCode
3737 MyThread::Entry()
3838 {
39- ExitCode code = (ExitCode)((*m_entry_func)(m_argptr, m_argnum));
39+ ExitCode code = (ExitCode)(intptr_t)((*m_entry_func)(m_argptr, m_argnum));
4040 if (m_exit_func)
4141 (*m_exit_func)(m_argptr, m_argnum);
4242 // Exit(code);
--- trunk/wxSources/RubyDialogFrame.cpp (revision 624)
+++ trunk/wxSources/RubyDialogFrame.cpp (revision 625)
@@ -1875,7 +1875,6 @@
18751875 {
18761876 int len = strlen(fname);
18771877 wxBitmapType type = wxBITMAP_TYPE_PNG;
1878- MyAppCallback_initImageHandlers();
18791878 if (len >= 4) {
18801879 if (strcasecmp(fname + len - 4, ".png") == 0)
18811880 type = wxBITMAP_TYPE_PNG;
--- trunk/wxSources/RubyDialogFrame.h (revision 624)
+++ trunk/wxSources/RubyDialogFrame.h (revision 625)
@@ -23,7 +23,7 @@
2323 #include "wx/sizer.h"
2424 #include "wx/panel.h"
2525 #include "wx/timer.h"
26-#include "../Mollib/Ruby_bind/ruby_dialog.h"
26+#include "../MolLib/Ruby_bind/ruby_dialog.h"
2727 #include "MyListCtrl.h"
2828
2929 #include "modalwindow.h"
Show on old repository browser