Chauk-Mean Proum
2009-Feb-16 20:40 UTC
[wxruby-development] Some issues raised by the improved version of the RichTextCtrl sample
Hi all, I''ve just committed a much more improved version of the RichTextCtrl sample. It now features load/save, undo/redo, copy/paste ... This works rather well except : 1/ On Linux, adding RichTextHTMLHandler to the buffer causes a crash (just uncomment line #41 to see it happening). Note that the HTML save from the C++ sample works fine so I''m pretty sure that my wxWidgets build is OK. On MinGW, there is no such problem and the HTML output works. 2/ Copy/paste does not always keep the text formatting Under some circumstances, the formatting of the pasted text is mixed with the formatting of the destination location. To reproduce : - run the sample - click on the Italic and Underline buttons to change the current formatting - type "hello" - select from "RichTextCtrl sample" to "Use the formatting buttons". The selection contains text with different formatting. - click on Copy or CTRL+C - click after the "hello" text, and click on Paste or CTRL+V - the RichTextCtrl sample" text is underlined and italics !! The C++ sample works as expected. Am I missing something ? Cheers. Chauk-Mean.
Alex Fenton
2009-Feb-17 21:31 UTC
[wxruby-development] Some issues raised by the improved version of the RichTextCtrl sample
Chauk-Mean Proum wrote:> I''ve just committed a much more improved version of the RichTextCtrl sample. > It now features load/save, undo/redo, copy/paste ... >Thanks for this, I tried it and it looks impressive.> 1/ On Linux, adding RichTextHTMLHandler to the buffer causes a crash >Should be fixed by SVN:2017 (you may need to rake clean) http://rubyforge.org/pipermail/wxruby-svn-commit/2009-February/000873.html> 2/ Copy/paste does not always keep the text formatting > Under some circumstances, the formatting of the pasted text is mixed > with the formatting of the destination location. > To reproduce : > - run the sample > - click on the Italic and Underline buttons to change the current formatting > - type "hello" > - select from "RichTextCtrl sample" to "Use the formatting buttons". > The selection contains text with different formatting. > - click on Copy or CTRL+C > - click after the "hello" text, and click on Paste or CTRL+V > - the RichTextCtrl sample" text is underlined and italics !! > The C++ sample works as expected. > Am I missing something ?Hmm, I see what you mean. My hunch would be that it''s down to wxWidgets because we don''t add much on top of that. Ultimately we''d need an identical test case to be sure, but since they''re not "virtual" (director) methods wxRuby is not intervening much. alex
Chauk-Mean Proum
2009-Feb-18 12:40 UTC
[wxruby-development] Some issues raised by the improved version of the RichTextCtrl sample
Hi Alex, 2009/2/17 Alex Fenton <alex at pressure.to>:>> >> I''ve just committed a much more improved version of the RichTextCtrl >> sample. >> It now features load/save, undo/redo, copy/paste ... >> > > Thanks for this, I tried it and it looks impressive.I''m glad that you like it. I''ve seen that you have fixed a ruby-1.8 compatibility issue. Although I''ve updated the doc on AcceleratorTable with ruby 1.8 / 1.9 compatibility aspect, I''ve forgotten to test this improved version on ruby-1.8 ...>> 1/ On Linux, adding RichTextHTMLHandler to the buffer causes a crash > > Should be fixed by SVN:2017 (you may need to rake clean) > http://rubyforge.org/pipermail/wxruby-svn-commit/2009-February/000873.html >Thanks. This works fine now.>> 2/ Copy/paste does not always keep the text formatting >> Under some circumstances, the formatting of the pasted text is mixed >> with the formatting of the destination location. >> To reproduce : >> - run the sample >> - click on the Italic and Underline buttons to change the current >> formatting >> - type "hello" >> - select from "RichTextCtrl sample" to "Use the formatting buttons". >> The selection contains text with different formatting. >> - click on Copy or CTRL+C >> - click after the "hello" text, and click on Paste or CTRL+V >> - the RichTextCtrl sample" text is underlined and italics !! >> The C++ sample works as expected. >> Am I missing something ? > > Hmm, I see what you mean. My hunch would be that it''s down to wxWidgets > because we don''t add much on top of that. Ultimately we''d need an identical > test case to be sure, but since they''re not "virtual" (director) methods > wxRuby is not intervening much. >You''re right. I''ve been able to reproduce the problem with the C++ sample. I will investigate a bit more before creating a bug report for wxWidgets. Chauk-Mean.
Alex Fenton
2009-Feb-18 15:29 UTC
[wxruby-development] Some issues raised by the improved version of the RichTextCtrl sample
Chauk-Mean Proum wrote:> I''ve seen that you have fixed a ruby-1.8 compatibility issue. > Although I''ve updated the doc on AcceleratorTable with ruby 1.8 / 1.9 > compatibility aspect, I''ve forgotten to test this improved version on > ruby-1.8 ...On reflection, would it make more sense to permit a single-character string as an alternative argument for Integer keycode in AccelTable? Having the user deal with string->int conversion seems unnecessary? alex
Chauk-Mean Proum
2009-Feb-18 15:40 UTC
[wxruby-development] Some issues raised by the improved version of the RichTextCtrl sample
2009/2/18 Alex Fenton <alex at pressure.to>:> Chauk-Mean Proum wrote: >> >> I''ve seen that you have fixed a ruby-1.8 compatibility issue. >> Although I''ve updated the doc on AcceleratorTable with ruby 1.8 / 1.9 >> compatibility aspect, I''ve forgotten to test this improved version on >> ruby-1.8 ... > > On reflection, would it make more sense to permit a single-character string > as an alternative argument for Integer keycode in AccelTable? Having the > user deal with string->int conversion seems unnecessary?Yes. That''s a very good idea. That will ease writing code for both ruby 1.8 and 1.9. Chauk-Mean.