[Fxruby-commits] CVS: FXRuby/examples RAA.rb,1.1,1.2 canvasdemo.rb,1.1,1.2 dctest.rb,1.1,1.2 gdchart
Status: Inactive
Brought to you by:
lyle
|
From: Lyle J. <ly...@us...> - 2002-07-11 13:33:30
|
Update of /cvsroot/fxruby/FXRuby/examples
In directory usw-pr-cvs1:/tmp/cvs-serv26972/examples
Modified Files:
datatarget.rb glviewer.rb groupbox.rb iRAA.rb image.rb
inputs.rb raabrowser.rb scintilla-test.rb table.rb
Added Files:
RAA.rb canvasdemo.rb dctest.rb gdchart.rb
Removed Files:
scintilla_wrapper.rb
Log Message:
Merged changes from the release10 branch back onto the main trunk.
Index: datatarget.rb
===================================================================
RCS file: /cvsroot/fxruby/FXRuby/examples/datatarget.rb,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** datatarget.rb 14 Nov 2001 22:45:23 -0000 1.10
--- datatarget.rb 11 Jul 2002 13:32:56 -0000 1.11
***************
*** 83,87 ****
0, 0, 20, 0)
! # Arange nicely
matrix = FXMatrix.new(self, 7,
MATRIX_BY_COLUMNS|LAYOUT_SIDE_TOP|LAYOUT_FILL_X|LAYOUT_FILL_Y)
--- 83,87 ----
0, 0, 20, 0)
! # Arrange nicely
matrix = FXMatrix.new(self, 7,
MATRIX_BY_COLUMNS|LAYOUT_SIDE_TOP|LAYOUT_FILL_X|LAYOUT_FILL_Y)
***************
*** 204,208 ****
# Current threads implementation causes problems for this example, so disable
! application.disableThreads
# Open display
--- 204,208 ----
# Current threads implementation causes problems for this example, so disable
! application.threadsEnabled = false
# Open display
Index: glviewer.rb
===================================================================
RCS file: /cvsroot/fxruby/FXRuby/examples/glviewer.rb,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** glviewer.rb 2 Apr 2002 22:27:54 -0000 1.10
--- glviewer.rb 11 Jul 2002 13:32:56 -0000 1.11
***************
*** 558,562 ****
# Make application
application = FXApp.new("GLViewer", "FoxTest")
! application.disableThreads
# Open the display
--- 558,562 ----
# Make application
application = FXApp.new("GLViewer", "FoxTest")
! application.threadsEnabled = false
# Open the display
Index: groupbox.rb
===================================================================
RCS file: /cvsroot/fxruby/FXRuby/examples/groupbox.rb,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** groupbox.rb 2 Apr 2002 22:27:54 -0000 1.12
--- groupbox.rb 11 Jul 2002 13:32:56 -0000 1.13
***************
*** 220,224 ****
slider = FXSlider.new(group2, nil, 0, (LAYOUT_TOP|LAYOUT_FILL_X|
LAYOUT_FIX_HEIGHT|SLIDER_HORIZONTAL|SLIDER_INSIDE_BAR), 0, 0, 200, 20)
! slider.setRange(0, 3)
frame = FXHorizontalFrame.new(group2, LAYOUT_FILL_X|LAYOUT_FILL_Y)
--- 220,224 ----
slider = FXSlider.new(group2, nil, 0, (LAYOUT_TOP|LAYOUT_FILL_X|
LAYOUT_FIX_HEIGHT|SLIDER_HORIZONTAL|SLIDER_INSIDE_BAR), 0, 0, 200, 20)
! slider.range = 0..3
frame = FXHorizontalFrame.new(group2, LAYOUT_FILL_X|LAYOUT_FILL_Y)
***************
*** 279,283 ****
spinner = FXSpinner.new(group3, 20, nil, 0,
SPIN_NORMAL|FRAME_SUNKEN|FRAME_THICK|LAYOUT_SIDE_TOP)
! spinner.setRange(1, 20)
combobox = FXComboBox.new(group3, 5, 5, nil, 0,
--- 279,283 ----
spinner = FXSpinner.new(group3, 20, nil, 0,
SPIN_NORMAL|FRAME_SUNKEN|FRAME_THICK|LAYOUT_SIDE_TOP)
! spinner.range = 1..20
combobox = FXComboBox.new(group3, 5, 5, nil, 0,
Index: iRAA.rb
===================================================================
RCS file: /cvsroot/fxruby/FXRuby/examples/iRAA.rb,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** iRAA.rb 21 Mar 2002 23:02:38 -0000 1.1
--- iRAA.rb 11 Jul 2002 13:32:56 -0000 1.2
***************
*** 1,84 ****
! module RAA
- InterfaceNS = "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.1"
! class Category
! include SOAP::Marshallable
! @@typeNamespace = InterfaceNS
- attr_reader :major, :minor
! def initialize( major, minor = nil )
! @major = major
! @minor = minor
! end
! def to_s
! "#{ @major }/#{ @minor }"
! end
! def ==( rhs )
! if @major != rhs.major
! false
! elsif !@minor or !rhs.minor
! true
! else
! @minor == rhs.minor
! end
end
end
! class Product
! include SOAP::Marshallable
! @@typeNamespace = InterfaceNS
! attr_reader :name
! attr_accessor :version, :status, :homepage, :download, :license, :description
! def initialize( name, version = nil, status = nil, homepage = nil, download = nil, license = nil, description = nil )
! @name = name
! @version = version
! @status = status
! @homepage = homepage
! @download = download
! @license = license
! @description = description
! end
end
! class Owner
! include SOAP::Marshallable
! @@typeNamespace = InterfaceNS
! attr_reader :id
! attr_accessor :email, :name
! def initialize( email, name )
! @email = email
! @name = name
! @id = "#{ @email }-#{ @name }"
! end
end
! class Info
! include SOAP::Marshallable
! @@typeNamespace = InterfaceNS
! attr_accessor :category, :product, :owner, :update
! def initialize( category = nil, product = nil, owner = nil, update = nil )
! @category = category
! @product = product
! @owner = owner
! @update = update
! end
end
! Methods = {
! 'getAllListings' => [ 'Array' ],
! 'getProductTree' => [ 'Hash' ],
! 'getInfoFromCategory' => [ 'Array', 'category' ],
! 'getModifiedInfoSince' => [ 'Array', 'time' ],
! 'getInfoFromName' => [ 'Info', 'name' ],
! }
end
--- 1,139 ----
! require 'soap/rpcUtils'
! module RAA; extend SOAP
! InterfaceNS = "http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.1"
! MappingRegistry = SOAP::RPCUtils::MappingRegistry.new
! Methods = [
! [ 'getAllListings', [ 'retval', 'return' ]],
! [ 'getProductTree', [ 'retval', 'return' ]],
! [ 'getInfoFromCategory', [ 'in', 'category' ], [ 'retval', 'return' ]],
! [ 'getModifiedInfoSince', [ 'in', 'time' ], [ 'retval', 'return' ]],
! [ 'getInfoFromName', [ 'in', 'name' ], [ 'retval', 'return' ]],
! ]
! class Category
! include SOAP::Marshallable
!
! attr_reader :major, :minor
!
! def initialize( major, minor = nil )
! @major = major
! @minor = minor
! end
!
! def to_s
! "#{ @major }/#{ @minor }"
! end
!
! def ==( rhs )
! if @major != rhs.major
! false
! elsif !@minor or !rhs.minor
! true
! else
! @minor == rhs.minor
end
end
+ end
! MappingRegistry.set(
! ::RAA::Category,
! ::SOAP::SOAPStruct,
! ::SOAP::RPCUtils::MappingRegistry::TypedStructFactory,
! [ InterfaceNS, "Category" ]
! )
! class Product
! include SOAP::Marshallable
! attr_reader :name
! attr_accessor :version, :status, :homepage, :download, :license, :description
!
! def initialize( name, version = nil, status = nil, homepage = nil, download = nil, license = nil, description = nil )
! @name = name
! @version = version
! @status = status
! @homepage = homepage
! @download = download
! @license = license
! @description = description
end
+ end
! MappingRegistry.set(
! ::RAA::Product,
! ::SOAP::SOAPStruct,
! ::SOAP::RPCUtils::MappingRegistry::TypedStructFactory,
! [ InterfaceNS, "Product" ]
! )
! class Owner
! include SOAP::Marshallable
! attr_reader :id
! attr_accessor :email, :name
!
! def initialize( email, name )
! @email = email
! @name = name
! @id = "#{ @email }-#{ @name }"
end
+ end
! MappingRegistry.set(
! ::RAA::Owner,
! ::SOAP::SOAPStruct,
! ::SOAP::RPCUtils::MappingRegistry::TypedStructFactory,
! [ InterfaceNS, "Owner" ]
! )
! class Info
! include SOAP::Marshallable
! attr_accessor :category, :product, :owner, :update
!
! def initialize( category = nil, product = nil, owner = nil, update = nil )
! @category = category
! @product = product
! @owner = owner
! @update = update
end
! def <=>( rhs )
! @update <=> rhs.update
! end
!
! def eql?( rhs )
! @product.name == rhs.product.name
! end
! end
!
! MappingRegistry.set(
! ::RAA::Info,
! ::SOAP::SOAPStruct,
! ::SOAP::RPCUtils::MappingRegistry::TypedStructFactory,
! [ InterfaceNS, "Info" ]
! )
!
! class StringArray < Array; end
! MappingRegistry.set(
! ::RAA::StringArray,
! ::SOAP::SOAPArray,
! ::SOAP::RPCUtils::MappingRegistry::TypedArrayFactory,
! [ XSD::Namespace, XSD::StringLiteral ]
! )
!
! class InfoArray < Array; end
! MappingRegistry.set(
! ::RAA::InfoArray,
! ::SOAP::SOAPArray,
! ::SOAP::RPCUtils::MappingRegistry::TypedArrayFactory,
! [ InterfaceNS, 'Info' ]
! )
!
!
end
Index: image.rb
===================================================================
RCS file: /cvsroot/fxruby/FXRuby/examples/image.rb,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** image.rb 5 Nov 2001 23:12:22 -0000 1.11
--- image.rb 11 Jul 2002 13:32:56 -0000 1.12
***************
*** 117,138 ****
(0...512).each { |x|
(0...50).each { |y|
! @grey_ramp[3*(y*512+x) ] = (x/2)
! @grey_ramp[3*(y*512+x)+1] = (x/2)
! @grey_ramp[3*(y*512+x)+2] = (x/2)
}
(0...50).each { |y|
! @red_ramp[3*(y*512+x) ] = (x/2)
! @red_ramp[3*(y*512+x)+1] = 0
! @red_ramp[3*(y*512+x)+2] = 0
}
(0...50).each { |y|
! @green_ramp[3*(y*512+x) ] = 0
! @green_ramp[3*(y*512+x)+1] = (x/2)
! @green_ramp[3*(y*512+x)+2] = 0
}
(0...50).each { |y|
! @blue_ramp[3*(y*512+x) ] = 0
! @blue_ramp[3*(y*512+x)+1] = 0
! @blue_ramp[3*(y*512+x)+2] = (x/2)
}
}
--- 117,138 ----
(0...512).each { |x|
(0...50).each { |y|
! @grey.data[3*(y*512+x) ] = (x/2)
! @grey.data[3*(y*512+x)+1] = (x/2)
! @grey.data[3*(y*512+x)+2] = (x/2)
}
(0...50).each { |y|
! @red.data[3*(y*512+x) ] = (x/2)
! @red.data[3*(y*512+x)+1] = 0
! @red.data[3*(y*512+x)+2] = 0
}
(0...50).each { |y|
! @green.data[3*(y*512+x) ] = 0
! @green.data[3*(y*512+x)+1] = (x/2)
! @green.data[3*(y*512+x)+2] = 0
}
(0...50).each { |y|
! @blue.data[3*(y*512+x) ] = 0
! @blue.data[3*(y*512+x)+1] = 0
! @blue.data[3*(y*512+x)+2] = (x/2)
}
}
***************
*** 176,182 ****
# Erase the canvas, color comes from well
! dc.setForeground(@backwell.getRGBA())
! dc.fillRectangle(0, 0, @picture.getWidth(), @picture.getHeight())
# Draw images
--- 176,182 ----
# Erase the canvas, color comes from well
! dc.foreground = @backwell.rgba
! dc.fillRectangle(0, 0, @picture.width, @picture.height)
# Draw images
***************
*** 191,205 ****
# Draw patterns
! dc.setFillStyle(FILL_OPAQUESTIPPLED)
! dc.setForeground(FXColor::Black)
! dc.setBackground(FXColor::White)
(STIPPLE_0..STIPPLE_16).each { |pat|
! dc.setStipple(pat)
dc.fillRectangle(10 + (512*pat)/17, 490, 31, 50)
}
! dc.setFillStyle(FILL_SOLID)
# Draw borders
! dc.setForeground(@borderwell.getRGBA())
dc.drawRectangle(10, 10, 512, 50)
dc.drawRectangle(10, 60, 512, 50)
--- 191,205 ----
# Draw patterns
! dc.fillStyle = FILL_OPAQUESTIPPLED
! dc.foreground = FXColor::Black
! dc.background = FXColor::White
(STIPPLE_0..STIPPLE_16).each { |pat|
! dc.stipple = pat
dc.fillRectangle(10 + (512*pat)/17, 490, 31, 50)
}
! dc.fillStyle = FILL_SOLID
# Draw borders
! dc.foreground = @borderwell.rgba
dc.drawRectangle(10, 10, 512, 50)
dc.drawRectangle(10, 60, 512, 50)
***************
*** 217,227 ****
# Draw text
! dc.setTextFont(@font)
! dc.setForeground(@textwell.getRGBA())
! dc.drawText(540, 60, "Grey", 4)
! dc.drawText(540, 180, "Red", 3)
! dc.drawText(540, 300, "Green", 5)
! dc.drawText(540, 420, "Blue", 4)
! dc.drawText(540, 540, "Patterns", 8)
# Don't wait for the GC to catch up, do it now!
--- 217,227 ----
# Draw text
! dc.textFont = @font
! dc.foreground = @textwell.rgba
! dc.drawText(540, 60, "Grey")
! dc.drawText(540, 180, "Red")
! dc.drawText(540, 300, "Green")
! dc.drawText(540, 420, "Blue")
! dc.drawText(540, 540, "Patterns")
# Don't wait for the GC to catch up, do it now!
***************
*** 234,239 ****
# Clear whole thing
! sdc.setForeground(@backwell.getRGBA())
! sdc.fillRectangle(0, 0, @canvas.getWidth(), @canvas.getHeight())
# Paint image
--- 234,239 ----
# Clear whole thing
! sdc.foreground = @backwell.rgba
! sdc.fillRectangle(0, 0, @canvas.width, @canvas.height)
# Paint image
***************
*** 254,261 ****
saveDialog = FXFileDialog.new(self, "Save as BMP")
if saveDialog.execute != 0
! FXFileStream.open(saveDialog.filename, FXStreamSave) { |outfile|
@picture.restore
@picture.savePixels(outfile)
! }
end
return 1
--- 254,261 ----
saveDialog = FXFileDialog.new(self, "Save as BMP")
if saveDialog.execute != 0
! FXFileStream.open(saveDialog.filename, FXStreamSave) do |outfile|
@picture.restore
@picture.savePixels(outfile)
! end
end
return 1
Index: inputs.rb
===================================================================
RCS file: /cvsroot/fxruby/FXRuby/examples/inputs.rb,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** inputs.rb 27 Nov 2001 15:46:10 -0000 1.4
--- inputs.rb 11 Jul 2002 13:32:56 -0000 1.5
***************
*** 34,40 ****
end
def onCmdText(sender, sel, ptr)
! # Remove previous input (if any)
! getApp().removeInput(@pipe, INPUT_READ|INPUT_EXCEPT) if @pipe
# Clean up the output window
--- 34,48 ----
end
+ # Remove previous input (if any)
+ def closePipe
+ if @pipe
+ getApp().removeInput(@pipe, INPUT_READ|INPUT_EXCEPT)
+ @pipe = nil
+ end
+ end
+
def onCmdText(sender, sel, ptr)
! # Stop previous command
! closePipe
# Clean up the output window
***************
*** 48,52 ****
case SELTYPE(sel)
when SEL_IO_READ
! @cmdOutput.appendText(@pipe.read)
when SEL_IO_EXCEPT
puts 'onPipeExcept'
--- 56,65 ----
case SELTYPE(sel)
when SEL_IO_READ
! text = @pipe.read
! if text
! @cmdOutput.appendText(text)
! else
! closePipe
! end
when SEL_IO_EXCEPT
puts 'onPipeExcept'
Index: raabrowser.rb
===================================================================
RCS file: /cvsroot/fxruby/FXRuby/examples/raabrowser.rb,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** raabrowser.rb 1 Mar 2002 20:15:41 -0000 1.2
--- raabrowser.rb 11 Jul 2002 13:32:56 -0000 1.3
***************
*** 1,129 ****
! require 'fox'
! require 'soap/driver'
! require 'iRAA'
!
! include Fox
!
! URL = 'http://www.ruby-lang.org/~nahi/soap/raa/'
!
! class RAABrowserWindow < FXMainWindow
! def initialize(app)
! # Initialize base class
! super(app, "Ruby Application Archive", nil, nil, DECOR_ALL, 0, 0, 600, 600)
!
! # Contents
! contents = FXHorizontalFrame.new(self, LAYOUT_FILL_X|LAYOUT_FILL_Y)
!
! # Horizontal splitter
! splitter = FXSplitter.new(contents, (LAYOUT_SIDE_TOP|LAYOUT_FILL_X|
! LAYOUT_FILL_Y|SPLITTER_TRACKING|SPLITTER_HORIZONTAL))
!
! # Create a sunken frame to hold the tree list
! groupbox = FXGroupBox.new(splitter, "Contents",
! LAYOUT_FILL_X|LAYOUT_FILL_Y|FRAME_GROOVE)
! frame = FXHorizontalFrame.new(groupbox,
! LAYOUT_FILL_X|LAYOUT_FILL_Y|FRAME_SUNKEN|FRAME_THICK)
!
! # Create the empty tree list
! @treeList = FXTreeList.new(frame, 0, nil, 0,
! (TREELIST_BROWSESELECT|TREELIST_SHOWS_LINES|TREELIST_SHOWS_BOXES|
! TREELIST_ROOT_BOXES|LAYOUT_FILL_X|LAYOUT_FILL_Y))
! @treeList.connect(SEL_COMMAND) do |sender, sel, item|
! if @treeList.isItemLeaf(item)
! getApp().beginWaitCursor
! begin
! info = @raa.getInfoFromName(item.text)
! @category.value = info.category.major + "/" + info.category.minor
! @projectName.value = info.product.name
! @version.value = info.product.version
! @status.value = info.product.status
! @lastUpdate.value = info.update.to_s
! @owner.value = "#{info.owner.name} (#{info.owner.email})"
! @homepage.value = info.product.homepage
! @download.value = info.product.download
! @license.value = info.product.license
! @description.value = info.product.description
! rescue SOAP::PostUnavailableError => ex
! getApp().endWaitCursor
! FXMessageBox.error(self, MBOX_OK, "SOAP Error", ex.message)
! ensure
! getApp().endWaitCursor
! end
! end
! end
!
! # Set up data targets for the product-specific information
! @category = FXDataTarget.new("")
! @projectName = FXDataTarget.new("")
! @version = FXDataTarget.new("")
! @status = FXDataTarget.new("")
! @lastUpdate = FXDataTarget.new("")
! @owner = FXDataTarget.new("")
! @homepage = FXDataTarget.new("")
! @download = FXDataTarget.new("")
! @license = FXDataTarget.new("")
! @description = FXDataTarget.new("")
!
! # Information appears on the right-hand side
! infoFrame = FXVerticalFrame.new(splitter, LAYOUT_FILL_X|LAYOUT_FILL_Y|LAYOUT_RIGHT|FRAME_SUNKEN|FRAME_THICK)
!
! infoBox = FXGroupBox.new(infoFrame, "Info", GROUPBOX_NORMAL|LAYOUT_FILL_X|FRAME_GROOVE)
! infoMatrix = FXMatrix.new(infoBox, 2, MATRIX_BY_COLUMNS|LAYOUT_FILL_X|LAYOUT_FILL_Y)
! FXLabel.new(infoMatrix, "Category:")
! FXTextField.new(infoMatrix, 20, @category, FXDataTarget::ID_VALUE, TEXTFIELD_NORMAL|LAYOUT_FILL_X|LAYOUT_FILL_COLUMN)
! FXLabel.new(infoMatrix, "Project name:")
! FXTextField.new(infoMatrix, 20, @projectName, FXDataTarget::ID_VALUE, TEXTFIELD_NORMAL|LAYOUT_FILL_X|LAYOUT_FILL_COLUMN)
! FXLabel.new(infoMatrix, "Version:")
! FXTextField.new(infoMatrix, 20, @version, FXDataTarget::ID_VALUE, TEXTFIELD_NORMAL|LAYOUT_FILL_X|LAYOUT_FILL_COLUMN)
! FXLabel.new(infoMatrix, "Status:")
! FXTextField.new(infoMatrix, 20, @status, FXDataTarget::ID_VALUE, TEXTFIELD_NORMAL|LAYOUT_FILL_X|LAYOUT_FILL_COLUMN)
! FXLabel.new(infoMatrix, "Last update:")
! FXTextField.new(infoMatrix, 20, @lastUpdate, FXDataTarget::ID_VALUE, TEXTFIELD_NORMAL|LAYOUT_FILL_X|LAYOUT_FILL_COLUMN)
! FXLabel.new(infoMatrix, "Owner:")
! FXTextField.new(infoMatrix, 20, @owner, FXDataTarget::ID_VALUE, TEXTFIELD_NORMAL|LAYOUT_FILL_X|LAYOUT_FILL_COLUMN)
! FXLabel.new(infoMatrix, "Homepage:")
! FXTextField.new(infoMatrix, 20, @homepage, FXDataTarget::ID_VALUE, TEXTFIELD_NORMAL|LAYOUT_FILL_X|LAYOUT_FILL_COLUMN)
! FXLabel.new(infoMatrix, "Download:")
! FXTextField.new(infoMatrix, 20, @download, FXDataTarget::ID_VALUE, TEXTFIELD_NORMAL|LAYOUT_FILL_X|LAYOUT_FILL_COLUMN)
! FXLabel.new(infoMatrix, "License:")
! FXTextField.new(infoMatrix, 20, @license, FXDataTarget::ID_VALUE, TEXTFIELD_NORMAL|LAYOUT_FILL_X|LAYOUT_FILL_COLUMN)
!
! descriptionBox = FXGroupBox.new(infoFrame, "Description", GROUPBOX_NORMAL|LAYOUT_FILL_X|LAYOUT_FILL_Y|FRAME_GROOVE)
! descriptionFrame = FXHorizontalFrame.new(descriptionBox, FRAME_SUNKEN|FRAME_THICK|LAYOUT_FILL_X|LAYOUT_FILL_Y)
! FXText.new(descriptionFrame, @description, FXDataTarget::ID_VALUE, TEXT_READONLY|TEXT_WORDWRAP|LAYOUT_FILL_X|LAYOUT_FILL_Y)
!
! # Initialize the service
! @raa = SOAP::Driver.new(nil, nil, RAA::InterfaceNS, URL)
! RAA::Methods.each do |m, p|
! @raa.addMethod(m, *(p[1..-1]))
! end
!
! # Set up the product tree list
! @productTree = @raa.getProductTree
! @productTree.keys.sort.each do |sectionName|
! sectionHash = @productTree[sectionName]
! sectionItem = @treeList.addItemLast(nil, sectionName)
! sectionHash.keys.sort.each do |categoryName|
! categoryArray = sectionHash[categoryName]
! categoryItem = @treeList.addItemLast(sectionItem, categoryName)
! categoryArray.each do |productName|
! productItem = @treeList.addItemLast(categoryItem, productName)
! end
! end
! end
! end
!
! def create
! super
! @treeList.parent.parent.setWidth(@treeList.font.getTextWidth('M'*24))
! show(PLACEMENT_SCREEN)
! end
! end
!
! if __FILE__ == $0
! app = FXApp.new("RAABrowser", "FoxTest")
! app.init(ARGV)
! RAABrowserWindow.new(app)
! app.create
! app.run
! end
--- 1,128 ----
! require 'cgi'
! require 'fox'
! require 'RAA'
!
! include Fox
!
! class RAABrowserWindow < FXMainWindow
! def initialize(app)
! # Initialize base class
! super(app, "Ruby Application Archive", nil, nil, DECOR_ALL, 0, 0, 600, 600)
!
! # Contents
! contents = FXHorizontalFrame.new(self, LAYOUT_FILL_X|LAYOUT_FILL_Y)
!
! # Horizontal splitter
! splitter = FXSplitter.new(contents, (LAYOUT_SIDE_TOP|LAYOUT_FILL_X|
! LAYOUT_FILL_Y|SPLITTER_TRACKING|SPLITTER_HORIZONTAL))
!
! # Create a sunken frame to hold the tree list
! groupbox = FXGroupBox.new(splitter, "Contents",
! LAYOUT_FILL_X|LAYOUT_FILL_Y|FRAME_GROOVE)
! frame = FXHorizontalFrame.new(groupbox,
! LAYOUT_FILL_X|LAYOUT_FILL_Y|FRAME_SUNKEN|FRAME_THICK)
!
! # Create the empty tree list
! @treeList = FXTreeList.new(frame, 0, nil, 0,
! (TREELIST_BROWSESELECT|TREELIST_SHOWS_LINES|TREELIST_SHOWS_BOXES|
! TREELIST_ROOT_BOXES|LAYOUT_FILL_X|LAYOUT_FILL_Y))
! @treeList.connect(SEL_COMMAND) do |sender, sel, item|
! if @treeList.isItemLeaf(item)
! getApp().beginWaitCursor
! begin
! info = @raa.getInfoFromName(item.text)
! @category.value = info.category.major + "/" + info.category.minor
! @projectName.value = info.product.name
! @version.value = info.product.version
! @status.value = info.product.status
! @lastUpdate.value = info.update.strftime("%F %T GMT")
! @owner.value = "#{info.owner.name} (#{info.owner.email})"
! @homepage.value = info.product.homepage
! @download.value = info.product.download
! @license.value = info.product.license
! @description.value =
! CGI::unescapeHTML(info.product.description).gsub(/\r\n/, "\n")
! rescue SOAP::PostUnavailableError => ex
! getApp().endWaitCursor
! FXMessageBox.error(self, MBOX_OK, "SOAP Error", ex.message)
! ensure
! getApp().endWaitCursor
! end
! end
! end
!
! # Set up data targets for the product-specific information
! @category = FXDataTarget.new("")
! @projectName = FXDataTarget.new("")
! @version = FXDataTarget.new("")
! @status = FXDataTarget.new("")
! @lastUpdate = FXDataTarget.new("")
! @owner = FXDataTarget.new("")
! @homepage = FXDataTarget.new("")
! @download = FXDataTarget.new("")
! @license = FXDataTarget.new("")
! @description = FXDataTarget.new("")
!
! # Information appears on the right-hand side
! infoFrame = FXVerticalFrame.new(splitter, LAYOUT_FILL_X|LAYOUT_FILL_Y|LAYOUT_RIGHT|FRAME_SUNKEN|FRAME_THICK)
!
! infoBox = FXGroupBox.new(infoFrame, "Info", GROUPBOX_NORMAL|LAYOUT_FILL_X|FRAME_GROOVE)
! infoMatrix = FXMatrix.new(infoBox, 2, MATRIX_BY_COLUMNS|LAYOUT_FILL_X|LAYOUT_FILL_Y)
! FXLabel.new(infoMatrix, "Category:")
! FXTextField.new(infoMatrix, 20, @category, FXDataTarget::ID_VALUE, TEXTFIELD_NORMAL|LAYOUT_FILL_X|LAYOUT_FILL_COLUMN)
! FXLabel.new(infoMatrix, "Project name:")
! FXTextField.new(infoMatrix, 20, @projectName, FXDataTarget::ID_VALUE, TEXTFIELD_NORMAL|LAYOUT_FILL_X|LAYOUT_FILL_COLUMN)
! FXLabel.new(infoMatrix, "Version:")
! FXTextField.new(infoMatrix, 20, @version, FXDataTarget::ID_VALUE, TEXTFIELD_NORMAL|LAYOUT_FILL_X|LAYOUT_FILL_COLUMN)
! FXLabel.new(infoMatrix, "Status:")
! FXTextField.new(infoMatrix, 20, @status, FXDataTarget::ID_VALUE, TEXTFIELD_NORMAL|LAYOUT_FILL_X|LAYOUT_FILL_COLUMN)
! FXLabel.new(infoMatrix, "Last update:")
! FXTextField.new(infoMatrix, 20, @lastUpdate, FXDataTarget::ID_VALUE, TEXTFIELD_NORMAL|LAYOUT_FILL_X|LAYOUT_FILL_COLUMN)
! FXLabel.new(infoMatrix, "Owner:")
! FXTextField.new(infoMatrix, 20, @owner, FXDataTarget::ID_VALUE, TEXTFIELD_NORMAL|LAYOUT_FILL_X|LAYOUT_FILL_COLUMN)
! FXLabel.new(infoMatrix, "Homepage:")
! FXTextField.new(infoMatrix, 20, @homepage, FXDataTarget::ID_VALUE, TEXTFIELD_NORMAL|LAYOUT_FILL_X|LAYOUT_FILL_COLUMN)
! FXLabel.new(infoMatrix, "Download:")
! FXTextField.new(infoMatrix, 20, @download, FXDataTarget::ID_VALUE, TEXTFIELD_NORMAL|LAYOUT_FILL_X|LAYOUT_FILL_COLUMN)
! FXLabel.new(infoMatrix, "License:")
! FXTextField.new(infoMatrix, 20, @license, FXDataTarget::ID_VALUE, TEXTFIELD_NORMAL|LAYOUT_FILL_X|LAYOUT_FILL_COLUMN)
!
! descriptionBox = FXGroupBox.new(infoFrame, "Description", GROUPBOX_NORMAL|LAYOUT_FILL_X|LAYOUT_FILL_Y|FRAME_GROOVE)
! descriptionFrame = FXHorizontalFrame.new(descriptionBox, FRAME_SUNKEN|FRAME_THICK|LAYOUT_FILL_X|LAYOUT_FILL_Y)
! FXText.new(descriptionFrame, @description, FXDataTarget::ID_VALUE, TEXT_READONLY|TEXT_WORDWRAP|LAYOUT_FILL_X|LAYOUT_FILL_Y)
!
! # Initialize the service
! server = 'http://www.ruby-lang.org/~nahi/soap/raa/'
! proxy = ENV['HTTP_PROXY'] || ENV['http_proxy']
! @raa = RAA::Driver.new(server, proxy)
! @raa.setLogDev(nil) # be quiet!
!
! # Set up the product tree list
! @productTree = @raa.getProductTree
! @productTree.keys.sort.each do |sectionName|
! sectionHash = @productTree[sectionName]
! sectionItem = @treeList.addItemLast(nil, sectionName)
! sectionHash.keys.sort.each do |categoryName|
! categoryArray = sectionHash[categoryName]
! categoryItem = @treeList.addItemLast(sectionItem, categoryName)
! categoryArray.each do |productName|
! productItem = @treeList.addItemLast(categoryItem, productName)
! end
! end
! end
! end
!
! def create
! super
! @treeList.parent.parent.setWidth(@treeList.font.getTextWidth('M'*24))
! show(PLACEMENT_SCREEN)
! end
! end
!
! if __FILE__ == $0
! app = FXApp.new("RAABrowser", "FoxTest")
! app.init(ARGV)
! RAABrowserWindow.new(app)
! app.create
! app.run
! end
Index: scintilla-test.rb
===================================================================
RCS file: /cvsroot/fxruby/FXRuby/examples/scintilla-test.rb,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** scintilla-test.rb 19 Feb 2002 00:11:21 -0000 1.4
--- scintilla-test.rb 11 Jul 2002 13:32:56 -0000 1.5
***************
*** 2,6 ****
require 'fox'
! require 'scintilla_wrapper'
include Fox
--- 2,6 ----
require 'fox'
! require 'fox/scintilla'
include Fox
***************
*** 12,19 ****
and FXRuby is developed by Lyle Johnson.
EOM
-
- class FXScintilla
- include Scintilla
- end
class ScintillaTest < FXMainWindow
--- 12,15 ----
Index: table.rb
===================================================================
RCS file: /cvsroot/fxruby/FXRuby/examples/table.rb,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** table.rb 2 Apr 2002 22:27:54 -0000 1.9
--- table.rb 11 Jul 2002 13:32:57 -0000 1.10
***************
*** 108,116 ****
puts "SEL_CHANGED row=#{tablePos.row}, col=#{tablePos.col}"
}
! @table.connect(SEL_COMMAND) { |sender, sel, ptr|
! puts "SEL_COMMAND ptr=#{ptr}"
}
! @table.connect(SEL_CLICKED) { |sender, sel, ptr|
! puts "SEL_CLICKED ptr=#{ptr}"
}
--- 108,116 ----
puts "SEL_CHANGED row=#{tablePos.row}, col=#{tablePos.col}"
}
! @table.connect(SEL_COMMAND) { |sender, sel, tablePos|
! puts "SEL_COMMAND row=#{tablePos.row}, col=#{tablePos.col}"
}
! @table.connect(SEL_CLICKED) { |sender, sel, tablePos|
! puts "SEL_CLICKED row=#{tablePos.row}, col=#{tablePos.col}"
}
--- scintilla_wrapper.rb DELETED ---
|