[Fxruby-commits] CVS: FXRuby/examples gdchart.rb,1.1.2.1,1.1.2.2 scintilla_wrapper.rb,1.1,1.1.2.1
Status: Inactive
Brought to you by:
lyle
From: Lyle J. <ly...@us...> - 2002-05-15 21:15:07
|
Update of /cvsroot/fxruby/FXRuby/examples In directory usw-pr-cvs1:/tmp/cvs-serv17031 Modified Files: Tag: release10 gdchart.rb scintilla_wrapper.rb Log Message: Index: gdchart.rb =================================================================== RCS file: /cvsroot/fxruby/FXRuby/examples/Attic/gdchart.rb,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** gdchart.rb 4 Apr 2002 16:44:24 -0000 1.1.2.1 --- gdchart.rb 15 May 2002 21:15:03 -0000 1.1.2.2 *************** *** 1,70 **** ! require 'fox' ! require 'GDChart' ! require 'tempfile' ! ! include Fox ! ! class GDChartViewer < FXMainWindow ! def initialize(app) ! # Invoke base class initialize first ! super(app, "GDChart Viewer", nil, nil, DECOR_ALL, ! 0, 0, 850, 600, 0, 0) ! ! # Sunken border for image widget ! imagebox = FXHorizontalFrame.new(self, ! FRAME_SUNKEN|FRAME_THICK|LAYOUT_FILL_X|LAYOUT_FILL_Y) ! ! # Make image widget ! @imageview = FXImageView.new(imagebox, nil, nil, 0, ! LAYOUT_FILL_X|LAYOUT_FILL_Y|HSCROLLER_NEVER|VSCROLLER_NEVER) ! ! # Construct a PNG image and store it in the image viewer ! @imageview.image = createChart ! ! # Resize main window client area to fit image size ! resize(@imageview.contentWidth, @imageview.contentHeight) ! end ! ! def createChart ! # Create a simple chart ! GDChart.title = "A Chart" ! GDChart.xtitle = "X-axis" ! GDChart.ytitle = "Y-axis" ! data = [1, 2, 3, 4, 5, 6] ! labels = ["label 1", "label 2", "label 3", "label 4", "label 5", "label 6"] ! ! # Write chart data out as GIF to a temporary file ! File.open('gdchart.gif', 'w') do |f| ! GDChart.out_graph(200, 200, f, GDChart::LINE, labels.length, labels, 1, data) ! end ! ! # Reopen it and construct image ! img = nil ! File.open('gdchart.gif', 'rb') do |f| ! img = FXGIFIcon.new(getApp(), f.read) ! end ! img ! end ! ! def create ! super ! show(PLACEMENT_SCREEN) ! end ! end ! ! if __FILE__ == $0 ! # Make application ! application = FXApp.new("GDChart Viewer", "FoxTest") ! ! # Open display ! application.init(ARGV) ! ! # Make window ! window = GDChartViewer.new(application) ! ! # Create it ! application.create ! ! # Run ! application.run ! end --- 1,70 ---- ! require 'fox' ! require 'GDChart' ! require 'tempfile' ! ! include Fox ! ! class GDChartViewer < FXMainWindow ! def initialize(app) ! # Invoke base class initialize first ! super(app, "GDChart Viewer", nil, nil, DECOR_ALL, ! 0, 0, 850, 600, 0, 0) ! ! # Sunken border for image widget ! imagebox = FXHorizontalFrame.new(self, ! FRAME_SUNKEN|FRAME_THICK|LAYOUT_FILL_X|LAYOUT_FILL_Y) ! ! # Make image widget ! @imageview = FXImageView.new(imagebox, nil, nil, 0, ! LAYOUT_FILL_X|LAYOUT_FILL_Y|HSCROLLER_NEVER|VSCROLLER_NEVER) ! ! # Construct a PNG image and store it in the image viewer ! @imageview.image = createChart ! ! # Resize main window client area to fit image size ! resize(@imageview.contentWidth, @imageview.contentHeight) ! end ! ! def createChart ! # Create a simple chart ! GDChart.title = "A Chart" ! GDChart.xtitle = "X-axis" ! GDChart.ytitle = "Y-axis" ! data = [1, 2, 3, 4, 5, 6] ! labels = ["label 1", "label 2", "label 3", "label 4", "label 5", "label 6"] ! ! # Write chart data out as GIF to a temporary file ! File.open('gdchart.gif', 'w') do |f| ! GDChart.out_graph(200, 200, f, GDChart::LINE, labels.length, labels, 1, data) ! end ! ! # Reopen it and construct image ! img = nil ! File.open('gdchart.gif', 'rb') do |f| ! img = FXGIFIcon.new(getApp(), f.read) ! end ! img ! end ! ! def create ! super ! show(PLACEMENT_SCREEN) ! end ! end ! ! if __FILE__ == $0 ! # Make application ! application = FXApp.new("GDChart Viewer", "FoxTest") ! ! # Open display ! application.init(ARGV) ! ! # Make window ! window = GDChartViewer.new(application) ! ! # Create it ! application.create ! ! # Run ! application.run ! end Index: scintilla_wrapper.rb =================================================================== RCS file: /cvsroot/fxruby/FXRuby/examples/scintilla_wrapper.rb,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** scintilla_wrapper.rb 21 Mar 2002 23:04:10 -0000 1.1 --- scintilla_wrapper.rb 15 May 2002 21:15:04 -0000 1.1.2.1 *************** *** 1,2276 **** ! ## ***** WARNING...THIS FILE IS GENERATED BY FROM SCINTILLA.IFACE ! ## ***** DO NOT MODIFY...MODIFY SCINTILLA.RB INSTEAD ! ! module Scintilla ! ## First line may be used for shbang ! ! ## This file defines the interface to Scintilla ! ! ## A line starting with ## is a pure comment and should be stripped by readers. ! ## A line starting with #! is for future shbang use [...4523 lines suppressed...] ! SCE_NNCRONTAB_DEFAULT = 0 ! SCE_NNCRONTAB_COMMENT = 1 ! SCE_NNCRONTAB_TASK = 2 ! SCE_NNCRONTAB_SECTION = 3 ! SCE_NNCRONTAB_KEYWORD = 4 ! SCE_NNCRONTAB_MODIFIER = 5 ! SCE_NNCRONTAB_ASTERISK = 6 ! SCE_NNCRONTAB_NUMBER = 7 ! SCE_NNCRONTAB_STRING = 8 ! SCE_NNCRONTAB_ENVIRONMENT = 9 ! SCE_NNCRONTAB_IDENTIFIER = 10 ! ! # Events ! ! # GTK+ Specific to work around focus and accelerator problems: ! ! ! # The old name for SCN_UPDATEUI ! SCN_CHECKBRACE = 2007 ! end |