• R/O
  • HTTP
  • SSH
  • HTTPS

Molby: コミット

Molecular Modeling Software


コミットメタ情報

リビジョン32d5eb386a0d850c359c9a8a56b536a94949e0fe (tree)
日時2014-10-06 22:44:07
作者toshinagata1964 <toshinagata1964@a2be...>
コミッターtoshinagata1964

ログメッセージ

Hitting Return in non-modal Ruby dialog now does not cause closing the window

git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/molby/trunk@578 a2be9bc6-48de-4e38-9406-05402d4bc13c

変更サマリ

差分

--- a/MolLib/Ruby_bind/ruby_dialog.c
+++ b/MolLib/Ruby_bind/ruby_dialog.c
@@ -2101,14 +2101,18 @@ s_RubyDialog_doItemAction(VALUE val)
21012101 rb_funcall(itval, SYM2ID(aval), 0);
21022102 } else if (aval == sReturnActionSym || aval == sEscapeActionSym) {
21032103 /* Enter or escape is pressed on text field */
2104- rb_ivar_set(itval, SYM2ID(sIsProcessingActionSymbol), Qfalse);
2105- itval = s_RubyDialog_ItemAtIndex(self, (aval == sReturnActionSym ? INT2FIX(0) : INT2FIX(1)));
2106- s_RubyDialog_EndModal(1, &itval, self);
2104+ if (RubyDialogCallback_isModal(dref)) {
2105+ rb_ivar_set(itval, SYM2ID(sIsProcessingActionSymbol), Qfalse);
2106+ itval = s_RubyDialog_ItemAtIndex(self, (aval == sReturnActionSym ? INT2FIX(0) : INT2FIX(1)));
2107+ s_RubyDialog_EndModal(1, &itval, self);
2108+ }
21072109 } else {
21082110 /* Default action (only for default buttons) */
2109- if (idx == 0 || idx == 1) {
2110- rb_ivar_set(itval, SYM2ID(sIsProcessingActionSymbol), Qfalse);
2111- s_RubyDialog_EndModal(1, &itval, self);
2111+ if (RubyDialogCallback_isModal(dref)) {
2112+ if (idx == 0 || idx == 1) {
2113+ rb_ivar_set(itval, SYM2ID(sIsProcessingActionSymbol), Qfalse);
2114+ s_RubyDialog_EndModal(1, &itval, self);
2115+ }
21122116 }
21132117 }
21142118
--- a/MolLib/Ruby_bind/ruby_dialog.h
+++ b/MolLib/Ruby_bind/ruby_dialog.h
@@ -99,6 +99,7 @@ STUB void RubyDialogCallback_release(RubyDialog *dref);
9999 STUB void RubyDialogCallback_setRubyObject(RubyDialog *dref, RubyValue val);
100100 STUB void RubyDialogCallback_setWindowTitle(RubyDialog *dref, const char *title);
101101 STUB int RubyDialogCallback_runModal(RubyDialog *dref);
102+STUB int RubyDialogCallback_isModal(RubyDialog *dref);
102103 STUB void RubyDialogCallback_endModal(RubyDialog *dref, int status);
103104 STUB void RubyDialogCallback_destroy(RubyDialog *dref);
104105 STUB void RubyDialogCallback_close(RubyDialog *dref);
--- a/wxSources/RubyDialogFrame.cpp
+++ b/wxSources/RubyDialogFrame.cpp
@@ -758,6 +758,12 @@ RubyDialogCallback_runModal(RubyDialog *dref)
758758 else return 1; /* Cancel */
759759 }
760760
761+int
762+RubyDialogCallback_isModal(RubyDialog *dref)
763+{
764+ return ((RubyDialogFrame *)dref)->IsModal();
765+}
766+
761767 void
762768 RubyDialogCallback_endModal(RubyDialog *dref, int status)
763769 {
旧リポジトリブラウザで表示