Attached is a patch file for listbook.rb 1) Message box scrolls properly now 2) Blank lines are skipped when adding pizzas and ice cream _______________________________________________ wxruby-users mailing list wxruby-users@rubyforge.org http://rubyforge.org/mailman/listinfo/wxruby-users
Roy Sutton wrote:> Attached is a patch file for listbook.rb > > 1) Message box scrolls properly now > 2) Blank lines are skipped when adding pizzas and ice creamThis one didn''t apply cleanly. The lines appeared to be off by 3 or so, at least for the first change. Please re-diff against the head and resubmit. Thanks, Kevin
Odd. I diffed it against the head version... At least, I thought I did. I will retry it after researching the whole p0/p1 thing. OK, I''ve researched it. And the whole -p thing is kinda weird. Way too manual for me. I can see why you want it set correctly. I will, from now on, try to create a mirror structure so I can create proper patch files. Here''s the patch file, all cleaned up. I have finally decided to bag WinCVS since I never did figure out how to work it correctly and am just using the command line CVS tools. Now I can create diff files from the repository. Tell me if you like this better. Roy Kevin Smith wrote:> Roy Sutton wrote: > >> Attached is a patch file for listbook.rb >> >> 1) Message box scrolls properly now >> 2) Blank lines are skipped when adding pizzas and ice cream > > > This one didn''t apply cleanly. The lines appeared to be off by 3 or > so, at least for the first change. Please re-diff against the head and > resubmit. > > Thanks, > > Kevin > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > >-------------- next part -------------- Index: wxruby2/samples/listbook/listbook.rb ==================================================================RCS file: /var/cvs/wxruby/wxruby2/samples/listbook/listbook.rb,v retrieving revision 1.2 diff -b -u -r1.2 listbook.rb --- wxruby2/samples/listbook/listbook.rb 20 Aug 2005 00:35:00 -0000 1.2 +++ wxruby2/samples/listbook/listbook.rb 19 Aug 2005 23:56:25 -0000 @@ -64,15 +64,15 @@ evt_button(Wx::xrcid(''ID_PIZZA_BUTTON'')) do |event| #get selections and add to order order_string = @text_output.get_value- if order_string != "" then order_string << "\n" end+ if order_string != "" then order_string = "\n" end order_string << "One #{@pizza_size.get_string_selection} pizza with:\n" order_string << @pizza_crust.get_string_selection + " crust" + "\n" order_string << @pizza_sauce.get_string_selection + " sauce" +"\n" order_string << @pizza_cheese.get_string_selection + " and" + "\n"- @pizza_toppings.each { |obj| order_string << obj.get_string_selection + "\n" }+ @pizza_toppings.each { |obj| order_string << obj.get_string_selection + "\n" unless obj.get_string_selection == "" } - @text_output.set_value(order_string)+ @text_output.append_text(order_string) end @@ -84,11 +84,11 @@ evt_button(Wx::xrcid(''ID_DRINK_BUTTON'')) do |event| #get selections and add to order order_string = @text_output.get_value- if order_string != "" then order_string << "\n" end+ if order_string != "" then order_string = "\n" end order_string << "One #{@drink_size.get_string_selection} #{@drink_type.get_string_selection }.\n" - @text_output.set_value(order_string)+ @text_output.append_text(order_string) end # Variables for widgets in Ice Cream tab@@ -111,19 +111,18 @@ evt_button(Wx::xrcid(''ID_ICE_CREAM_BUTTON'')) do |event| #get selections and add to order order_string = @text_output.get_value- if order_string != "" then order_string << "\n" end+ if order_string != "" then order_string = "\n" end order_string << "One #{@ice_cream_size.get_string_selection} #{@ice_cream_type.get_string_selection} ice cream:\n" - @ice_cream_toppings.each { |obj| order_string << obj.get_string_selection + "\n" }+ @ice_cream_toppings.each { |obj| order_string << obj.get_string_selection + "\n" unless obj.get_string_selection == "" } - @text_output.set_value(order_string)+ @text_output.append_text(order_string) end evt_listbook_page_changed(Wx::xrcid(''ID_LISTBOOK'')) do |event| tab_number = event.get_selection- order_string = @text_output.get_value- order_string << "moved to tab = #{@listbook.get_page_text(tab_number)} \n"- @text_output.set_value(order_string)+ order_string = "moved to tab = #{@listbook.get_page_text(tab_number)} \n" + @text_output.append_text(order_string) end end
Roy Sutton wrote:> Here''s the patch file, all cleaned up.Hm.... kevins@aria:~/work/wxruby2$ patch -p1 </download/patches/listbook.rb.patch patching file samples/listbook/listbook.rb patch unexpectedly ends in middle of line patch: **** malformed patch at line 20: Glancing at the patch, it looks like all the newlines got stripped out somehow. Kevin
Try this one. I need to figure out how to get cvs to check out with DOS newlines. Kevin Smith wrote:> Roy Sutton wrote: > >> Here''s the patch file, all cleaned up. > > > Hm.... > > kevins@aria:~/work/wxruby2$ patch -p1 > </download/patches/listbook.rb.patch > patching file samples/listbook/listbook.rb > patch unexpectedly ends in middle of line > patch: **** malformed patch at line 20: > > > Glancing at the patch, it looks like all the newlines got stripped out > somehow. > > Kevin > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > >-------------- next part -------------- Index: wxruby2/samples/listbook/listbook.rb ==================================================================RCS file: /var/cvs/wxruby/wxruby2/samples/listbook/listbook.rb,v retrieving revision 1.2 diff -u -b -r1.2 listbook.rb --- wxruby2/samples/listbook/listbook.rb 20 Aug 2005 00:35:00 -0000 1.2 +++ wxruby2/samples/listbook/listbook.rb 21 Aug 2005 00:39:35 -0000 @@ -64,15 +64,15 @@ evt_button(Wx::xrcid(''ID_PIZZA_BUTTON'')) do |event| #get selections and add to order order_string = @text_output.get_value - if order_string != "" then order_string << "\n" end + if order_string != "" then order_string = "\n" end order_string << "One #{@pizza_size.get_string_selection} pizza with:\n" order_string << @pizza_crust.get_string_selection + " crust" + "\n" order_string << @pizza_sauce.get_string_selection + " sauce" +"\n" order_string << @pizza_cheese.get_string_selection + " and" + "\n" - @pizza_toppings.each { |obj| order_string << obj.get_string_selection + "\n" } + @pizza_toppings.each { |obj| order_string << obj.get_string_selection + "\n" unless obj.get_string_selection == "" } - @text_output.set_value(order_string) + @text_output.append_text(order_string) end @@ -84,11 +84,11 @@ evt_button(Wx::xrcid(''ID_DRINK_BUTTON'')) do |event| #get selections and add to order order_string = @text_output.get_value - if order_string != "" then order_string << "\n" end + if order_string != "" then order_string = "\n" end order_string << "One #{@drink_size.get_string_selection} #{@drink_type.get_string_selection }.\n" - @text_output.set_value(order_string) + @text_output.append_text(order_string) end # Variables for widgets in Ice Cream tab @@ -111,19 +111,18 @@ evt_button(Wx::xrcid(''ID_ICE_CREAM_BUTTON'')) do |event| #get selections and add to order order_string = @text_output.get_value - if order_string != "" then order_string << "\n" end + if order_string != "" then order_string = "\n" end order_string << "One #{@ice_cream_size.get_string_selection} #{@ice_cream_type.get_string_selection} ice cream:\n" - @ice_cream_toppings.each { |obj| order_string << obj.get_string_selection + "\n" } + @ice_cream_toppings.each { |obj| order_string << obj.get_string_selection + "\n" unless obj.get_string_selection == "" } - @text_output.set_value(order_string) + @text_output.append_text(order_string) end evt_listbook_page_changed(Wx::xrcid(''ID_LISTBOOK'')) do |event| tab_number = event.get_selection - order_string = @text_output.get_value - order_string << "moved to tab = #{@listbook.get_page_text(tab_number)} \n" - @text_output.set_value(order_string) + order_string = "moved to tab = #{@listbook.get_page_text(tab_number)} \n" + @text_output.append_text(order_string) end end
Roy Sutton wrote:> Try this one. I need to figure out how to get cvs to check out with DOS > newlines.Nope. kevins@aria:~/work/wxruby2$ patch -p1 </download/patches/listbook.rb.patch patching file samples/listbook/listbook.rb Hunk #1 FAILED at 64. 1 out of 1 hunk FAILED -- saving rejects to file samples/listbook/listbook.rb.rej missing header for unified diff at line 42 of patch can''t find file to patch at input line 42 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- | | order_string << @pizza_cheese.get_string_selection + " and" + "\n" | |- @pizza_toppings.each { |obj| order_string << obj.get_string_selection + "\n" } | |+ @pizza_toppings.each { |obj| order_string << obj.get_string_selection + "\n" unless obj.get_string_selection == "" } | | |- @text_output.set_value(order_string) | |+ @text_output.append_text(order_string) | end | | | | | -------------------------- File to patch: kevins@aria:~/work/wxruby2$ Kevin
How about this? Kevin Smith wrote:> Roy Sutton wrote: > >> Try this one. I need to figure out how to get cvs to check out with >> DOS newlines. > > > Nope. > > kevins@aria:~/work/wxruby2$ patch -p1 > </download/patches/listbook.rb.patch > patching file samples/listbook/listbook.rb > Hunk #1 FAILED at 64. > 1 out of 1 hunk FAILED -- saving rejects to file > samples/listbook/listbook.rb.rej > missing header for unified diff at line 42 of patch > can''t find file to patch at input line 42 > Perhaps you used the wrong -p or --strip option? > The text leading up to this was: > -------------------------- > | > | order_string << @pizza_cheese.get_string_selection + " and" + > "\n" > | > |- @pizza_toppings.each { |obj| order_string << > obj.get_string_selection + "\n" } > | > |+ @pizza_toppings.each { |obj| order_string << > obj.get_string_selection + "\n" unless obj.get_string_selection == "" } > | > | > |- @text_output.set_value(order_string) > | > |+ @text_output.append_text(order_string) > | end > | > | > | > | > | > -------------------------- > File to patch: > kevins@aria:~/work/wxruby2$ > > Kevin > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > >-------------- next part -------------- --- listbook.rb 2005-08-19 19:56:25.663070400 -0400 +++ wxruby2/samples/listbook/listbook.rb 2005-08-19 20:35:00.000000000 -0400 @@ -5,7 +5,7 @@ # class SimpleFrame < Wx::Frame - FILE_DIALOG, FILE_ABOUT, FILE_QUIT = [0,1,2] + FILE_DIALOG, FILE_ABOUT, FILE_QUIT = [0,Wx::ID_ABOUT,2] def initialize(parent) super(nil,-1,"Sample",Wx::Point.new(50,50),Wx::Size.new(300,300)) @@ -15,7 +15,7 @@ # Create a new menu bar = Wx::MenuBar.new menu = Wx::Menu.new - menu.append(FILE_ABOUT,"About") + menu.append(FILE_ABOUT,"About...") menu.append_separator menu.append(FILE_QUIT,"Quit") bar.append(menu,"File") @@ -64,15 +64,15 @@ evt_button(Wx::xrcid(''ID_PIZZA_BUTTON'')) do |event| #get selections and add to order order_string = @text_output.get_value - if order_string != "" then order_string = "\n" end + if order_string != "" then order_string << "\n" end order_string << "One #{@pizza_size.get_string_selection} pizza with:\n" order_string << @pizza_crust.get_string_selection + " crust" + "\n" order_string << @pizza_sauce.get_string_selection + " sauce" +"\n" order_string << @pizza_cheese.get_string_selection + " and" + "\n" - @pizza_toppings.each { |obj| order_string << obj.get_string_selection + "\n" unless obj.get_string_selection == "" } + @pizza_toppings.each { |obj| order_string << obj.get_string_selection + "\n" } - @text_output.append_text(order_string) + @text_output.set_value(order_string) end @@ -84,11 +84,11 @@ evt_button(Wx::xrcid(''ID_DRINK_BUTTON'')) do |event| #get selections and add to order order_string = @text_output.get_value - if order_string != "" then order_string = "\n" end + if order_string != "" then order_string << "\n" end order_string << "One #{@drink_size.get_string_selection} #{@drink_type.get_string_selection }.\n" - @text_output.append_text(order_string) + @text_output.set_value(order_string) end # Variables for widgets in Ice Cream tab @@ -111,18 +111,19 @@ evt_button(Wx::xrcid(''ID_ICE_CREAM_BUTTON'')) do |event| #get selections and add to order order_string = @text_output.get_value - if order_string != "" then order_string = "\n" end + if order_string != "" then order_string << "\n" end order_string << "One #{@ice_cream_size.get_string_selection} #{@ice_cream_type.get_string_selection} ice cream:\n" - @ice_cream_toppings.each { |obj| order_string << obj.get_string_selection + "\n" unless obj.get_string_selection == "" } + @ice_cream_toppings.each { |obj| order_string << obj.get_string_selection + "\n" } - @text_output.append_text(order_string) + @text_output.set_value(order_string) end evt_listbook_page_changed(Wx::xrcid(''ID_LISTBOOK'')) do |event| tab_number = event.get_selection - order_string = "moved to tab = #{@listbook.get_page_text(tab_number)} \n" - @text_output.append_text(order_string) + order_string = @text_output.get_value + order_string << "moved to tab = #{@listbook.get_page_text(tab_number)} \n" + @text_output.set_value(order_string) end end
Roy Sutton wrote:> How about this?Nope. kevins@aria:~/work/wxruby2$ patch -p1 </download/patches/listbook.rb2.patch missing header for unified diff at line 3 of patch patching file samples/listbook/listbook.rb Hunk #1 FAILED at 5. Hunk #2 FAILED at 15. patch: **** malformed patch at line 37: @@ -84,11 +84,11 @@ Are we having fun yet :-) The patch looks ok to me in a quick visual inspection. I wish I knew more about patch so I could know why it is complaining. Have you tried applying the patch on your own machine? Or do you even have patch available? Kevin
This one? Kevin Smith wrote:> Roy Sutton wrote: > >> How about this? > > > Nope. > > kevins@aria:~/work/wxruby2$ patch -p1 > </download/patches/listbook.rb2.patch > missing header for unified diff at line 3 of patch > patching file samples/listbook/listbook.rb > Hunk #1 FAILED at 5. > Hunk #2 FAILED at 15. > patch: **** malformed patch at line 37: @@ -84,11 +84,11 @@ > > > Are we having fun yet :-) > > The patch looks ok to me in a quick visual inspection. I wish I knew > more about patch so I could know why it is complaining. Have you tried > applying the patch on your own machine? Or do you even have patch > available? > > Kevin > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > >-------------- next part -------------- --- wxruby2\samples\listbook\listbook.rb 2005-08-19 20:35:00.000000000 -0400 +++ wxruby2_new\samples\listbook\listbook.rb 2005-08-21 12:29:40.518958400 -0400 @@ -64,15 +64,15 @@ evt_button(Wx::xrcid(''ID_PIZZA_BUTTON'')) do |event| #get selections and add to order order_string = @text_output.get_value - if order_string != "" then order_string << "\n" end + if order_string != "" then order_string = "\n" end order_string << "One #{@pizza_size.get_string_selection} pizza with:\n" order_string << @pizza_crust.get_string_selection + " crust" + "\n" order_string << @pizza_sauce.get_string_selection + " sauce" +"\n" order_string << @pizza_cheese.get_string_selection + " and" + "\n" - @pizza_toppings.each { |obj| order_string << obj.get_string_selection + "\n" } + @pizza_toppings.each { |obj| order_string << obj.get_string_selection + "\n" unless obj.get_string_selection == "" } - @text_output.set_value(order_string) + @text_output.append_text(order_string) end @@ -84,11 +84,11 @@ evt_button(Wx::xrcid(''ID_DRINK_BUTTON'')) do |event| #get selections and add to order order_string = @text_output.get_value - if order_string != "" then order_string << "\n" end + if order_string != "" then order_string = "\n" end order_string << "One #{@drink_size.get_string_selection} #{@drink_type.get_string_selection }.\n" - @text_output.set_value(order_string) + @text_output.append_text(order_string) end # Variables for widgets in Ice Cream tab @@ -111,19 +111,18 @@ evt_button(Wx::xrcid(''ID_ICE_CREAM_BUTTON'')) do |event| #get selections and add to order order_string = @text_output.get_value - if order_string != "" then order_string << "\n" end + if order_string != "" then order_string = "\n" end order_string << "One #{@ice_cream_size.get_string_selection} #{@ice_cream_type.get_string_selection} ice cream:\n" - @ice_cream_toppings.each { |obj| order_string << obj.get_string_selection + "\n" } + @ice_cream_toppings.each { |obj| order_string << obj.get_string_selection + "\n" unless obj.get_string_selection == "" } - @text_output.set_value(order_string) + @text_output.append_text(order_string) end evt_listbook_page_changed(Wx::xrcid(''ID_LISTBOOK'')) do |event| tab_number = event.get_selection - order_string = @text_output.get_value - order_string << "moved to tab = #{@listbook.get_page_text(tab_number)} \n" - @text_output.set_value(order_string) + order_string = "moved to tab = #{@listbook.get_page_text(tab_number)} \n" + @text_output.append_text(order_string) end end
Roy Sutton wrote:> This one?Still no joy. kevins@aria:~/work/wxruby2$ patch -p1 </download/patches/listbook.rb3.patch missing header for unified diff at line 3 of patch can''t find file to patch at input line 3 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |--- wxruby2\samples\listbook\listbook.rb 2005-08-19 20:35:00.000000000 -0400 |+++ wxruby2_new\samples\listbook\listbook.rb 2005-08-21 12:29:40.518958400 -0400 -------------------------- File to patch: samples/listbook/listbook.rb patching file samples/listbook/listbook.rb Hunk #1 FAILED at 64. Hunk #2 FAILED at 84. Hunk #3 FAILED at 111. 3 out of 3 hunks FAILED -- saving rejects to file samples/listbook/listbook.rb.rej Are you following the steps outlined by Sean? If so, and they''re not working, maybe you could go back to your original method but just issue the diff command from above the wxruby2 directory? Kevin