fxruby 1.6.19 → 1.6.20
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +10 -0
- data/Manifest.txt +922 -0
- data/{LICENSE → README.txt} +27 -1
- data/Rakefile +191 -0
- data/TODO +47 -0
- data/doap.rdf +87 -0
- data/examples/icons/bluebullet14x14.gif +0 -0
- data/examples/icons/transpbullet14x14.gif +0 -0
- data/ext/fox16/FXRbApp.cpp +2 -2
- data/ext/fox16/FXRbDataTarget.cpp +2 -2
- data/ext/fox16/FXRbGLViewer.cpp +2 -2
- data/ext/fox16/FXRuby.cpp +7 -3
- data/ext/fox16/extconf.rb +18 -85
- data/ext/fox16/impl.cpp +0 -0
- data/ext/fox16/include/FXMemoryBuffer.h +2 -2
- data/ext/fox16/include/FXRb4Splitter.h +2 -2
- data/ext/fox16/include/FXRb7Segment.h +2 -2
- data/ext/fox16/include/FXRbAccelTable.h +2 -2
- data/ext/fox16/include/FXRbApp.h +2 -2
- data/ext/fox16/include/FXRbAppVirtuals.h +0 -0
- data/ext/fox16/include/FXRbArrowButton.h +2 -2
- data/ext/fox16/include/FXRbBMPIcon.h +2 -2
- data/ext/fox16/include/FXRbBMPImage.h +2 -2
- data/ext/fox16/include/FXRbBitmap.h +2 -2
- data/ext/fox16/include/FXRbBitmapFrame.h +1 -1
- data/ext/fox16/include/FXRbBitmapView.h +2 -2
- data/ext/fox16/include/FXRbBitmapVirtuals.h +0 -0
- data/ext/fox16/include/FXRbButton.h +2 -2
- data/ext/fox16/include/FXRbCURCursor.h +2 -2
- data/ext/fox16/include/FXRbCanvas.h +2 -2
- data/ext/fox16/include/FXRbCheckButton.h +2 -2
- data/ext/fox16/include/FXRbChoiceBox.h +1 -1
- data/ext/fox16/include/FXRbColorBar.h +2 -2
- data/ext/fox16/include/FXRbColorDialog.h +2 -2
- data/ext/fox16/include/FXRbColorList.h +2 -2
- data/ext/fox16/include/FXRbColorRing.h +2 -2
- data/ext/fox16/include/FXRbColorSelector.h +2 -2
- data/ext/fox16/include/FXRbColorWell.h +2 -2
- data/ext/fox16/include/FXRbColorWheel.h +2 -2
- data/ext/fox16/include/FXRbComboBox.h +2 -2
- data/ext/fox16/include/FXRbCommon.h +2 -2
- data/ext/fox16/include/FXRbComposite.h +2 -2
- data/ext/fox16/include/FXRbCursor.h +2 -2
- data/ext/fox16/include/FXRbCursorVirtuals.h +0 -0
- data/ext/fox16/include/FXRbDC.h +2 -2
- data/ext/fox16/include/FXRbDCPrint.h +2 -2
- data/ext/fox16/include/FXRbDCVirtuals.h +0 -0
- data/ext/fox16/include/FXRbDCWindow.h +2 -2
- data/ext/fox16/include/FXRbDataTarget.h +2 -2
- data/ext/fox16/include/FXRbDebugTarget.h +2 -2
- data/ext/fox16/include/FXRbDelegator.h +2 -2
- data/ext/fox16/include/FXRbDial.h +2 -2
- data/ext/fox16/include/FXRbDialogBox.h +2 -2
- data/ext/fox16/include/FXRbDialogBoxVirtuals.h +0 -0
- data/ext/fox16/include/FXRbDict.h +2 -2
- data/ext/fox16/include/FXRbDirBox.h +2 -2
- data/ext/fox16/include/FXRbDirDialog.h +2 -2
- data/ext/fox16/include/FXRbDirList.h +2 -2
- data/ext/fox16/include/FXRbDirSelector.h +2 -2
- data/ext/fox16/include/FXRbDockBar.h +1 -1
- data/ext/fox16/include/FXRbDockBarVirtuals.h +0 -0
- data/ext/fox16/include/FXRbDockHandler.h +2 -2
- data/ext/fox16/include/FXRbDockSite.h +0 -0
- data/ext/fox16/include/FXRbDockSiteVirtuals.h +0 -0
- data/ext/fox16/include/FXRbDockTitle.h +2 -2
- data/ext/fox16/include/FXRbDocument.h +2 -2
- data/ext/fox16/include/FXRbDragCorner.h +2 -2
- data/ext/fox16/include/FXRbDrawable.h +2 -2
- data/ext/fox16/include/FXRbDrawableVirtuals.h +0 -0
- data/ext/fox16/include/FXRbDriveBox.h +2 -2
- data/ext/fox16/include/FXRbFileDialog.h +2 -2
- data/ext/fox16/include/FXRbFileDict.h +2 -2
- data/ext/fox16/include/FXRbFileDictVirtuals.h +0 -0
- data/ext/fox16/include/FXRbFileList.h +2 -2
- data/ext/fox16/include/FXRbFileSelector.h +2 -2
- data/ext/fox16/include/FXRbFoldingItemVirtuals.h +0 -0
- data/ext/fox16/include/FXRbFoldingList.h +2 -2
- data/ext/fox16/include/FXRbFoldingListVirtuals.h +0 -0
- data/ext/fox16/include/FXRbFont.h +2 -2
- data/ext/fox16/include/FXRbFontDialog.h +2 -2
- data/ext/fox16/include/FXRbFontSelector.h +2 -2
- data/ext/fox16/include/FXRbFontVirtuals.h +0 -0
- data/ext/fox16/include/FXRbFrame.h +2 -2
- data/ext/fox16/include/FXRbGIFCursor.h +2 -2
- data/ext/fox16/include/FXRbGIFIcon.h +2 -2
- data/ext/fox16/include/FXRbGIFImage.h +2 -2
- data/ext/fox16/include/FXRbGLCanvas.h +2 -2
- data/ext/fox16/include/FXRbGLCanvasVirtuals.h +0 -0
- data/ext/fox16/include/FXRbGLContext.h +2 -2
- data/ext/fox16/include/FXRbGLObject.h +2 -2
- data/ext/fox16/include/FXRbGLObjectVirtuals.h +0 -0
- data/ext/fox16/include/FXRbGLShape.h +2 -2
- data/ext/fox16/include/FXRbGLShapeVirtuals.h +0 -0
- data/ext/fox16/include/FXRbGLViewer.h +2 -2
- data/ext/fox16/include/FXRbGLViewerVirtuals.h +0 -0
- data/ext/fox16/include/FXRbGLVisual.h +2 -2
- data/ext/fox16/include/FXRbGradientBar.h +1 -1
- data/ext/fox16/include/FXRbGroupBox.h +2 -2
- data/ext/fox16/include/FXRbHeader.h +2 -2
- data/ext/fox16/include/FXRbHeaderItemVirtuals.h +0 -0
- data/ext/fox16/include/FXRbHorizontalFrame.h +2 -2
- data/ext/fox16/include/FXRbICOIcon.h +2 -2
- data/ext/fox16/include/FXRbICOImage.h +2 -2
- data/ext/fox16/include/FXRbIcon.h +2 -2
- data/ext/fox16/include/FXRbIconItemVirtuals.h +0 -0
- data/ext/fox16/include/FXRbIconList.h +2 -2
- data/ext/fox16/include/FXRbIconListVirtuals.h +0 -0
- data/ext/fox16/include/FXRbIconSource.h +2 -2
- data/ext/fox16/include/FXRbIconSourceVirtuals.h +0 -0
- data/ext/fox16/include/FXRbId.h +2 -2
- data/ext/fox16/include/FXRbIdVirtuals.h +0 -0
- data/ext/fox16/include/FXRbImage.h +2 -2
- data/ext/fox16/include/FXRbImageFrame.h +1 -1
- data/ext/fox16/include/FXRbImageView.h +2 -2
- data/ext/fox16/include/FXRbImageVirtuals.h +0 -0
- data/ext/fox16/include/FXRbInputDialog.h +2 -2
- data/ext/fox16/include/FXRbJPGIcon.h +2 -2
- data/ext/fox16/include/FXRbJPGImage.h +2 -2
- data/ext/fox16/include/FXRbKnob.h +2 -2
- data/ext/fox16/include/FXRbLabel.h +2 -2
- data/ext/fox16/include/FXRbList.h +2 -2
- data/ext/fox16/include/FXRbListBox.h +2 -2
- data/ext/fox16/include/FXRbListBoxVirtuals.h +0 -0
- data/ext/fox16/include/FXRbListItemVirtuals.h +0 -0
- data/ext/fox16/include/FXRbListVirtuals.h +0 -0
- data/ext/fox16/include/FXRbMDIButton.h +2 -2
- data/ext/fox16/include/FXRbMDIChild.h +2 -2
- data/ext/fox16/include/FXRbMDIChildVirtuals.h +0 -0
- data/ext/fox16/include/FXRbMDIClient.h +2 -2
- data/ext/fox16/include/FXRbMDIClientVirtuals.h +0 -0
- data/ext/fox16/include/FXRbMainWindow.h +2 -2
- data/ext/fox16/include/FXRbMatrix.h +2 -2
- data/ext/fox16/include/FXRbMenuBar.h +1 -1
- data/ext/fox16/include/FXRbMenuButton.h +2 -2
- data/ext/fox16/include/FXRbMenuCaption.h +2 -2
- data/ext/fox16/include/FXRbMenuCascade.h +2 -2
- data/ext/fox16/include/FXRbMenuCheck.h +1 -1
- data/ext/fox16/include/FXRbMenuCommand.h +2 -2
- data/ext/fox16/include/FXRbMenuPane.h +2 -2
- data/ext/fox16/include/FXRbMenuRadio.h +1 -1
- data/ext/fox16/include/FXRbMenuSeparator.h +2 -2
- data/ext/fox16/include/FXRbMenuTitle.h +2 -2
- data/ext/fox16/include/FXRbMessageBox.h +2 -2
- data/ext/fox16/include/FXRbObject.h +2 -2
- data/ext/fox16/include/FXRbObjectVirtuals.h +0 -0
- data/ext/fox16/include/FXRbOptionMenu.h +2 -2
- data/ext/fox16/include/FXRbPCXIcon.h +2 -2
- data/ext/fox16/include/FXRbPCXImage.h +2 -2
- data/ext/fox16/include/FXRbPNGIcon.h +2 -2
- data/ext/fox16/include/FXRbPNGImage.h +2 -2
- data/ext/fox16/include/FXRbPPMIcon.h +2 -2
- data/ext/fox16/include/FXRbPPMImage.h +2 -2
- data/ext/fox16/include/FXRbPacker.h +2 -2
- data/ext/fox16/include/FXRbPicker.h +2 -2
- data/ext/fox16/include/FXRbPopup.h +2 -2
- data/ext/fox16/include/FXRbPopupVirtuals.h +0 -0
- data/ext/fox16/include/FXRbPrintDialog.h +2 -2
- data/ext/fox16/include/FXRbProgressBar.h +2 -2
- data/ext/fox16/include/FXRbProgressDialog.h +2 -2
- data/ext/fox16/include/FXRbRGBIcon.h +2 -2
- data/ext/fox16/include/FXRbRGBImage.h +2 -2
- data/ext/fox16/include/FXRbRadioButton.h +2 -2
- data/ext/fox16/include/FXRbRealSlider.h +2 -2
- data/ext/fox16/include/FXRbRealSpinner.h +2 -2
- data/ext/fox16/include/FXRbRealSpinnerVirtuals.h +0 -0
- data/ext/fox16/include/FXRbRecentFiles.h +2 -2
- data/ext/fox16/include/FXRbRegistry.h +2 -2
- data/ext/fox16/include/FXRbReplaceDialog.h +2 -2
- data/ext/fox16/include/FXRbRootWindow.h +2 -2
- data/ext/fox16/include/FXRbRuler.h +1 -1
- data/ext/fox16/include/FXRbRulerView.h +1 -1
- data/ext/fox16/include/FXRbScintilla.h +2 -2
- data/ext/fox16/include/FXRbScrollArea.h +2 -2
- data/ext/fox16/include/FXRbScrollAreaVirtuals.h +0 -0
- data/ext/fox16/include/FXRbScrollBar.h +1 -1
- data/ext/fox16/include/FXRbScrollPane.h +2 -2
- data/ext/fox16/include/FXRbScrollWindow.h +2 -2
- data/ext/fox16/include/FXRbSearchDialog.h +2 -2
- data/ext/fox16/include/FXRbSeparator.h +2 -2
- data/ext/fox16/include/FXRbSettings.h +2 -2
- data/ext/fox16/include/FXRbShell.h +2 -2
- data/ext/fox16/include/FXRbShutter.h +2 -2
- data/ext/fox16/include/FXRbShutterVirtuals.h +0 -0
- data/ext/fox16/include/FXRbSlider.h +2 -2
- data/ext/fox16/include/FXRbSpinner.h +2 -2
- data/ext/fox16/include/FXRbSpinnerVirtuals.h +0 -0
- data/ext/fox16/include/FXRbSplashWindow.h +2 -2
- data/ext/fox16/include/FXRbSplitter.h +2 -2
- data/ext/fox16/include/FXRbSpring.h +2 -2
- data/ext/fox16/include/FXRbStatusBar.h +1 -1
- data/ext/fox16/include/FXRbStatusLine.h +1 -1
- data/ext/fox16/include/FXRbStream.h +2 -2
- data/ext/fox16/include/FXRbStreamVirtuals.h +0 -0
- data/ext/fox16/include/FXRbStringDict.h +2 -2
- data/ext/fox16/include/FXRbSwitcher.h +2 -2
- data/ext/fox16/include/FXRbTGAIcon.h +2 -2
- data/ext/fox16/include/FXRbTGAImage.h +2 -2
- data/ext/fox16/include/FXRbTIFIcon.h +2 -2
- data/ext/fox16/include/FXRbTIFImage.h +2 -2
- data/ext/fox16/include/FXRbTabBar.h +2 -2
- data/ext/fox16/include/FXRbTabBarVirtuals.h +0 -0
- data/ext/fox16/include/FXRbTabBook.h +2 -2
- data/ext/fox16/include/FXRbTabItem.h +2 -2
- data/ext/fox16/include/FXRbTable.h +2 -2
- data/ext/fox16/include/FXRbTableItemVirtuals.h +0 -0
- data/ext/fox16/include/FXRbTableVirtuals.h +0 -0
- data/ext/fox16/include/FXRbText.h +2 -2
- data/ext/fox16/include/FXRbTextField.h +2 -2
- data/ext/fox16/include/FXRbTextVirtuals.h +0 -0
- data/ext/fox16/include/FXRbToggleButton.h +2 -2
- data/ext/fox16/include/FXRbToolBar.h +1 -1
- data/ext/fox16/include/FXRbToolBarGrip.h +1 -1
- data/ext/fox16/include/FXRbToolBarShell.h +1 -1
- data/ext/fox16/include/FXRbToolBarTab.h +1 -1
- data/ext/fox16/include/FXRbToolTip.h +1 -1
- data/ext/fox16/include/FXRbTopWindow.h +2 -2
- data/ext/fox16/include/FXRbTopWindowVirtuals.h +0 -0
- data/ext/fox16/include/FXRbTranslator.h +2 -2
- data/ext/fox16/include/FXRbTranslatorVirtuals.h +0 -0
- data/ext/fox16/include/FXRbTreeItemVirtuals.h +0 -0
- data/ext/fox16/include/FXRbTreeList.h +2 -2
- data/ext/fox16/include/FXRbTreeListBox.h +2 -2
- data/ext/fox16/include/FXRbTreeListBoxVirtuals.h +0 -0
- data/ext/fox16/include/FXRbTreeListVirtuals.h +0 -0
- data/ext/fox16/include/FXRbTriStateButton.h +2 -2
- data/ext/fox16/include/FXRbVerticalFrame.h +2 -2
- data/ext/fox16/include/FXRbVisual.h +2 -2
- data/ext/fox16/include/FXRbWindow.h +2 -2
- data/ext/fox16/include/FXRbWindowVirtuals.h +0 -0
- data/ext/fox16/include/FXRbWizard.h +1 -1
- data/ext/fox16/include/FXRbXBMIcon.h +2 -2
- data/ext/fox16/include/FXRbXBMImage.h +2 -2
- data/ext/fox16/include/FXRbXPMIcon.h +2 -2
- data/ext/fox16/include/FXRbXPMImage.h +2 -2
- data/ext/fox16/include/FXRuby.h +2 -2
- data/ext/fox16/include/impl.h +2 -2
- data/ext/fox16/make_impl.rb +121 -0
- data/ext/fox16/markfuncs.cpp +0 -0
- data/lib/fox16.rb +8 -0
- data/lib/fox16/bitmapview.rb +223 -0
- data/lib/fox16/scintilla.rb +103 -3
- data/lib/fox16/version.rb +1 -5
- data/rdoc-sources/Makefile +23 -0
- data/scripts/build-fox.rb +31 -0
- data/scripts/generate_kwargs_lib.rb +414 -0
- data/scripts/iface.rb +391 -0
- data/swig-interfaces/FX4Splitter.i +149 -0
- data/swig-interfaces/FX7Segment.i +141 -0
- data/swig-interfaces/FXAccelTable.i +100 -0
- data/swig-interfaces/FXApp.i +735 -0
- data/swig-interfaces/FXArrowButton.i +136 -0
- data/swig-interfaces/FXBMPIcon.i +88 -0
- data/swig-interfaces/FXBMPImage.i +54 -0
- data/swig-interfaces/FXBitmap.i +90 -0
- data/swig-interfaces/FXBitmapFrame.i +72 -0
- data/swig-interfaces/FXBitmapView.i +94 -0
- data/swig-interfaces/FXButton.i +130 -0
- data/swig-interfaces/FXCURCursor.i +49 -0
- data/swig-interfaces/FXCanvas.i +61 -0
- data/swig-interfaces/FXCheckButton.i +108 -0
- data/swig-interfaces/FXChoiceBox.i +91 -0
- data/swig-interfaces/FXColorBar.i +110 -0
- data/swig-interfaces/FXColorDialog.i +79 -0
- data/swig-interfaces/FXColorList.i +99 -0
- data/swig-interfaces/FXColorRing.i +148 -0
- data/swig-interfaces/FXColorSelector.i +157 -0
- data/swig-interfaces/FXColorWell.i +133 -0
- data/swig-interfaces/FXColorWheel.i +108 -0
- data/swig-interfaces/FXComboBox.i +280 -0
- data/swig-interfaces/FXComposeContext.i +66 -0
- data/swig-interfaces/FXComposite.i +103 -0
- data/swig-interfaces/FXCursor.i +120 -0
- data/swig-interfaces/FXDC.i +280 -0
- data/swig-interfaces/FXDCPrint.i +141 -0
- data/swig-interfaces/FXDCWindow.i +75 -0
- data/swig-interfaces/FXDataTarget.i +115 -0
- data/swig-interfaces/FXDebugTarget.i +60 -0
- data/swig-interfaces/FXDelegator.i +56 -0
- data/swig-interfaces/FXDial.i +168 -0
- data/swig-interfaces/FXDialogBox.i +131 -0
- data/swig-interfaces/FXDict.i +200 -0
- data/swig-interfaces/FXDirBox.i +68 -0
- data/swig-interfaces/FXDirDialog.i +97 -0
- data/swig-interfaces/FXDirList.i +274 -0
- data/swig-interfaces/FXDirSelector.i +142 -0
- data/swig-interfaces/FXDockBar.i +180 -0
- data/swig-interfaces/FXDockHandler.i +94 -0
- data/swig-interfaces/FXDockSite.i +91 -0
- data/swig-interfaces/FXDockTitle.i +91 -0
- data/swig-interfaces/FXDocument.i +70 -0
- data/swig-interfaces/FXDragCorner.i +72 -0
- data/swig-interfaces/FXDrawable.i +90 -0
- data/swig-interfaces/FXDriveBox.i +63 -0
- data/swig-interfaces/FXExtentd.i +131 -0
- data/swig-interfaces/FXExtentf.i +131 -0
- data/swig-interfaces/FXFileDialog.i +268 -0
- data/swig-interfaces/FXFileDict.i +121 -0
- data/swig-interfaces/FXFileList.i +345 -0
- data/swig-interfaces/FXFileSelector.i +347 -0
- data/swig-interfaces/FXFileStream.i +49 -0
- data/swig-interfaces/FXFoldingList.i +556 -0
- data/swig-interfaces/FXFont.i +333 -0
- data/swig-interfaces/FXFontDialog.i +63 -0
- data/swig-interfaces/FXFontSelector.i +127 -0
- data/swig-interfaces/FXFrame.i +245 -0
- data/swig-interfaces/FXGIFCursor.i +86 -0
- data/swig-interfaces/FXGIFIcon.i +54 -0
- data/swig-interfaces/FXGIFImage.i +54 -0
- data/swig-interfaces/FXGLCanvas.i +90 -0
- data/swig-interfaces/FXGLContext.i +85 -0
- data/swig-interfaces/FXGLObject.i +70 -0
- data/swig-interfaces/FXGLShape.i +152 -0
- data/swig-interfaces/FXGLViewer.i +691 -0
- data/swig-interfaces/FXGLVisual.i +136 -0
- data/swig-interfaces/FXGradientBar.i +310 -0
- data/swig-interfaces/FXGroupBox.i +94 -0
- data/swig-interfaces/FXHeader.i +432 -0
- data/swig-interfaces/FXHorizontalFrame.i +60 -0
- data/swig-interfaces/FXICOIcon.i +92 -0
- data/swig-interfaces/FXICOImage.i +54 -0
- data/swig-interfaces/FXIcon.i +128 -0
- data/swig-interfaces/FXIconDict.i +90 -0
- data/swig-interfaces/FXIconList.i +596 -0
- data/swig-interfaces/FXIconSource.i +55 -0
- data/swig-interfaces/FXId.i +103 -0
- data/swig-interfaces/FXImage.i +197 -0
- data/swig-interfaces/FXImageFrame.i +66 -0
- data/swig-interfaces/FXImageView.i +88 -0
- data/swig-interfaces/FXInputDialog.i +180 -0
- data/swig-interfaces/FXJPGIcon.i +101 -0
- data/swig-interfaces/FXJPGImage.i +67 -0
- data/swig-interfaces/FXKnob.i +182 -0
- data/swig-interfaces/FXLabel.i +199 -0
- data/swig-interfaces/FXList.i +476 -0
- data/swig-interfaces/FXListBox.i +234 -0
- data/swig-interfaces/FXMDIButton.i +173 -0
- data/swig-interfaces/FXMDIChild.i +242 -0
- data/swig-interfaces/FXMDIClient.i +149 -0
- data/swig-interfaces/FXMainWindow.i +53 -0
- data/swig-interfaces/FXMat3d.i +102 -0
- data/swig-interfaces/FXMat3f.i +102 -0
- data/swig-interfaces/FXMat4d.i +122 -0
- data/swig-interfaces/FXMat4f.i +138 -0
- data/swig-interfaces/FXMatrix.i +101 -0
- data/swig-interfaces/FXMemoryBuffer.i +64 -0
- data/swig-interfaces/FXMemoryStream.i +73 -0
- data/swig-interfaces/FXMenuBar.i +67 -0
- data/swig-interfaces/FXMenuButton.i +152 -0
- data/swig-interfaces/FXMenuCaption.i +176 -0
- data/swig-interfaces/FXMenuCascade.i +76 -0
- data/swig-interfaces/FXMenuCheck.i +90 -0
- data/swig-interfaces/FXMenuCommand.i +69 -0
- data/swig-interfaces/FXMenuPane.i +60 -0
- data/swig-interfaces/FXMenuRadio.i +93 -0
- data/swig-interfaces/FXMenuSeparator.i +65 -0
- data/swig-interfaces/FXMenuTitle.i +74 -0
- data/swig-interfaces/FXMessageBox.i +128 -0
- data/swig-interfaces/FXObject.i +169 -0
- data/swig-interfaces/FXOptionMenu.i +140 -0
- data/swig-interfaces/FXPCXIcon.i +91 -0
- data/swig-interfaces/FXPCXImage.i +55 -0
- data/swig-interfaces/FXPNGIcon.i +95 -0
- data/swig-interfaces/FXPNGImage.i +59 -0
- data/swig-interfaces/FXPPMIcon.i +91 -0
- data/swig-interfaces/FXPPMImage.i +55 -0
- data/swig-interfaces/FXPacker.i +255 -0
- data/swig-interfaces/FXPicker.i +54 -0
- data/swig-interfaces/FXPoint.i +52 -0
- data/swig-interfaces/FXPopup.i +162 -0
- data/swig-interfaces/FXPrintDialog.i +154 -0
- data/swig-interfaces/FXProgressBar.i +133 -0
- data/swig-interfaces/FXProgressDialog.i +105 -0
- data/swig-interfaces/FXQuatd.i +128 -0
- data/swig-interfaces/FXQuatf.i +122 -0
- data/swig-interfaces/FXRGBIcon.i +90 -0
- data/swig-interfaces/FXRGBImage.i +56 -0
- data/swig-interfaces/FXRadioButton.i +117 -0
- data/swig-interfaces/FXRanged.i +163 -0
- data/swig-interfaces/FXRangef.i +172 -0
- data/swig-interfaces/FXRealSlider.i +166 -0
- data/swig-interfaces/FXRealSpinner.i +215 -0
- data/swig-interfaces/FXRecentFiles.i +119 -0
- data/swig-interfaces/FXRectangle.i +104 -0
- data/swig-interfaces/FXRegion.i +88 -0
- data/swig-interfaces/FXRegistry.i +96 -0
- data/swig-interfaces/FXReplaceDialog.i +131 -0
- data/swig-interfaces/FXRootWindow.i +50 -0
- data/swig-interfaces/FXRuler.i +245 -0
- data/swig-interfaces/FXRulerView.i +233 -0
- data/swig-interfaces/FXScintilla.i +192 -0
- data/swig-interfaces/FXScrollArea.i +211 -0
- data/swig-interfaces/FXScrollBar.i +178 -0
- data/swig-interfaces/FXScrollPane.i +83 -0
- data/swig-interfaces/FXScrollWindow.i +67 -0
- data/swig-interfaces/FXSearchDialog.i +48 -0
- data/swig-interfaces/FXSeparator.i +138 -0
- data/swig-interfaces/FXSettings.i +160 -0
- data/swig-interfaces/FXShell.i +91 -0
- data/swig-interfaces/FXShutter.i +140 -0
- data/swig-interfaces/FXSize.i +71 -0
- data/swig-interfaces/FXSlider.i +181 -0
- data/swig-interfaces/FXSphered.i +126 -0
- data/swig-interfaces/FXSpheref.i +126 -0
- data/swig-interfaces/FXSpinner.i +212 -0
- data/swig-interfaces/FXSplashWindow.i +82 -0
- data/swig-interfaces/FXSplitter.i +123 -0
- data/swig-interfaces/FXSpring.i +79 -0
- data/swig-interfaces/FXStatusBar.i +68 -0
- data/swig-interfaces/FXStatusLine.i +100 -0
- data/swig-interfaces/FXStream.i +150 -0
- data/swig-interfaces/FXStringDict.i +61 -0
- data/swig-interfaces/FXSwitcher.i +110 -0
- data/swig-interfaces/FXTGAIcon.i +85 -0
- data/swig-interfaces/FXTGAImage.i +56 -0
- data/swig-interfaces/FXTIFIcon.i +73 -0
- data/swig-interfaces/FXTIFImage.i +93 -0
- data/swig-interfaces/FXTabBar.i +121 -0
- data/swig-interfaces/FXTabBook.i +70 -0
- data/swig-interfaces/FXTabItem.i +82 -0
- data/swig-interfaces/FXTable.i +861 -0
- data/swig-interfaces/FXText.i +763 -0
- data/swig-interfaces/FXTextField.i +290 -0
- data/swig-interfaces/FXToggleButton.i +136 -0
- data/swig-interfaces/FXToolBar.i +75 -0
- data/swig-interfaces/FXToolBarGrip.i +82 -0
- data/swig-interfaces/FXToolBarShell.i +98 -0
- data/swig-interfaces/FXToolBarTab.i +114 -0
- data/swig-interfaces/FXToolTip.i +93 -0
- data/swig-interfaces/FXTopWindow.i +263 -0
- data/swig-interfaces/FXTranslator.i +55 -0
- data/swig-interfaces/FXTreeList.i +549 -0
- data/swig-interfaces/FXTreeListBox.i +317 -0
- data/swig-interfaces/FXTriStateButton.i +77 -0
- data/swig-interfaces/FXURL.i +35 -0
- data/swig-interfaces/FXVec2d.i +87 -0
- data/swig-interfaces/FXVec2f.i +87 -0
- data/swig-interfaces/FXVec3d.i +111 -0
- data/swig-interfaces/FXVec3f.i +109 -0
- data/swig-interfaces/FXVec4d.i +115 -0
- data/swig-interfaces/FXVec4f.i +115 -0
- data/swig-interfaces/FXVerticalFrame.i +69 -0
- data/swig-interfaces/FXVisual.i +162 -0
- data/swig-interfaces/FXWindow.i +851 -0
- data/swig-interfaces/FXWizard.i +125 -0
- data/swig-interfaces/FXXBMIcon.i +56 -0
- data/swig-interfaces/FXXBMImage.i +118 -0
- data/swig-interfaces/FXXPMIcon.i +122 -0
- data/swig-interfaces/FXXPMImage.i +56 -0
- data/swig-interfaces/README +17 -0
- data/swig-interfaces/common.i +48 -0
- data/swig-interfaces/core.i +85 -0
- data/swig-interfaces/dcmodule.i +36 -0
- data/swig-interfaces/dialogs.i +49 -0
- data/swig-interfaces/exceptions.i +249 -0
- data/swig-interfaces/framesmodule.i +54 -0
- data/swig-interfaces/freefuncs.i +93 -0
- data/swig-interfaces/fx3d.i +60 -0
- data/swig-interfaces/fxdefs.i +419 -0
- data/swig-interfaces/handlers.i +615 -0
- data/swig-interfaces/iconlistmodule.i +37 -0
- data/swig-interfaces/icons.i +48 -0
- data/swig-interfaces/ignore-message-handlers.rb +16 -0
- data/swig-interfaces/image.i +49 -0
- data/swig-interfaces/labelmodule.i +47 -0
- data/swig-interfaces/layout.i +47 -0
- data/swig-interfaces/listmodule.i +37 -0
- data/swig-interfaces/macros.i +1326 -0
- data/swig-interfaces/markfuncs.i +210 -0
- data/swig-interfaces/mdi.i +38 -0
- data/swig-interfaces/menumodule.i +44 -0
- data/swig-interfaces/ruby-typemaps.i +772 -0
- data/swig-interfaces/scintilla.i +57 -0
- data/swig-interfaces/table-module.i +36 -0
- data/swig-interfaces/text-module.i +36 -0
- data/swig-interfaces/treelist-module.i +37 -0
- data/swig-interfaces/ui.i +63 -0
- data/{tests → test}/README +0 -0
- data/{tests → test}/TC_FXAccelTable.rb +0 -0
- data/{tests → test}/TC_FXApp.rb +0 -0
- data/{tests → test}/TC_FXArc.rb +0 -0
- data/{tests → test}/TC_FXBMPIcon.rb +0 -0
- data/{tests → test}/TC_FXBMPImage.rb +0 -0
- data/{tests → test}/TC_FXButton.rb +0 -0
- data/{tests → test}/TC_FXCheckButton.rb +0 -0
- data/{tests → test}/TC_FXComboBox.rb +0 -0
- data/{tests → test}/TC_FXDC.rb +0 -0
- data/{tests → test}/TC_FXDCPrint.rb +0 -0
- data/{tests → test}/TC_FXDCWindow.rb +0 -0
- data/{tests → test}/TC_FXDataTarget.rb +0 -0
- data/{tests → test}/TC_FXDialogBox.rb +0 -0
- data/{tests → test}/TC_FXDirList.rb +0 -0
- data/{tests → test}/TC_FXExtentd.rb +0 -0
- data/{tests → test}/TC_FXExtentf.rb +0 -0
- data/{tests → test}/TC_FXFileAssoc.rb +0 -0
- data/{tests → test}/TC_FXFileStream.rb +0 -0
- data/{tests → test}/TC_FXFoldingList.rb +0 -0
- data/{tests → test}/TC_FXFont.rb +0 -0
- data/{tests → test}/TC_FXFontDesc.rb +0 -0
- data/{tests → test}/TC_FXGLGroup.rb +0 -0
- data/{tests → test}/TC_FXGLShape.rb +0 -0
- data/{tests → test}/TC_FXGLViewer.rb +0 -0
- data/{tests → test}/TC_FXGradientBar.rb +0 -0
- data/{tests → test}/TC_FXHeader.rb +0 -0
- data/{tests → test}/TC_FXHiliteStyle.rb +0 -0
- data/{tests → test}/TC_FXIconDict.rb +0 -0
- data/{tests → test}/TC_FXIconList.rb +0 -0
- data/{tests → test}/TC_FXId.rb +0 -0
- data/{tests → test}/TC_FXImage.rb +0 -0
- data/{tests → test}/TC_FXLight.rb +0 -0
- data/{tests → test}/TC_FXList.rb +0 -0
- data/{tests → test}/TC_FXListBox.rb +0 -0
- data/{tests → test}/TC_FXMainWindow.rb +0 -0
- data/{tests → test}/TC_FXMat4f.rb +0 -0
- data/{tests → test}/TC_FXMaterial.rb +0 -0
- data/{tests → test}/TC_FXMemoryStream.rb +0 -0
- data/{tests → test}/TC_FXMenuCheck.rb +0 -0
- data/{tests → test}/TC_FXMenuCommand.rb +0 -0
- data/{tests → test}/TC_FXMenuRadio.rb +0 -0
- data/{tests → test}/TC_FXMessageBox.rb +0 -0
- data/{tests → test}/TC_FXPoint.rb +0 -0
- data/{tests → test}/TC_FXQuatf.rb +0 -0
- data/{tests → test}/TC_FXRadioButton.rb +0 -0
- data/{tests → test}/TC_FXRanged.rb +0 -0
- data/{tests → test}/TC_FXRangef.rb +0 -0
- data/{tests → test}/TC_FXRectangle.rb +0 -0
- data/{tests → test}/TC_FXRegion.rb +0 -0
- data/{tests → test}/TC_FXRegistry.rb +0 -0
- data/{tests → test}/TC_FXScrollArea.rb +0 -0
- data/{tests → test}/TC_FXScrollWindow.rb +0 -0
- data/{tests → test}/TC_FXSegment.rb +0 -0
- data/{tests → test}/TC_FXSettings.rb +0 -0
- data/{tests → test}/TC_FXShell.rb +0 -0
- data/{tests → test}/TC_FXSize.rb +0 -0
- data/{tests → test}/TC_FXStream.rb +0 -0
- data/{tests → test}/TC_FXTable.rb +0 -0
- data/{tests → test}/TC_FXTableItem.rb +0 -0
- data/{tests → test}/TC_FXText.rb +0 -0
- data/{tests → test}/TC_FXTopWindow.rb +0 -0
- data/{tests → test}/TC_FXTreeList.rb +0 -0
- data/{tests → test}/TC_FXTreeListBox.rb +0 -0
- data/{tests → test}/TC_FXUndoList.rb +0 -0
- data/{tests → test}/TC_FXVec2d.rb +0 -0
- data/{tests → test}/TC_FXVec2f.rb +0 -0
- data/{tests → test}/TC_FXVec3d.rb +0 -0
- data/{tests → test}/TC_FXVec3f.rb +0 -0
- data/{tests → test}/TC_FXVec4f.rb +0 -0
- data/{tests → test}/TC_FXViewport.rb +0 -0
- data/{tests → test}/TC_FXXBMIcon.rb +0 -0
- data/{tests → test}/TC_FXXBMImage.rb +0 -0
- data/{tests → test}/TC_FXXPMIcon.rb +0 -0
- data/{tests → test}/TC_FXXPMImage.rb +0 -0
- data/{tests → test}/TC_Misc.rb +0 -0
- data/{tests → test}/TC_downcast.rb +0 -0
- data/{tests → test}/TS_All.rb +0 -0
- data/{tests → test}/blankpage.ps +0 -0
- data/{tests → test}/howdypage.ps +0 -0
- data/{tests → test}/stress1.rb +0 -0
- data/{tests → test}/stress2.rb +0 -0
- data/{tests → test}/stress3.rb +0 -0
- data/{tests → test}/testcase.rb +0 -0
- metadata +718 -458
- data/doc/apes02.html +0 -21
- data/doc/apes03.html +0 -39
- data/doc/book.html +0 -3
- data/doc/build.html +0 -132
- data/doc/ch03s02.html +0 -23
- data/doc/ch03s03.html +0 -52
- data/doc/ch03s04.html +0 -36
- data/doc/ch03s05.html +0 -60
- data/doc/ch04s02.html +0 -71
- data/doc/ch04s03.html +0 -37
- data/doc/ch04s04.html +0 -72
- data/doc/ch05s02.html +0 -260
- data/doc/ch05s03.html +0 -127
- data/doc/changes.html +0 -777
- data/doc/clipboardtut.html +0 -67
- data/doc/differences.html +0 -190
- data/doc/dragdroptut.html +0 -263
- data/doc/events.html +0 -36
- data/doc/examples.html +0 -104
- data/doc/gems.html +0 -73
- data/doc/goals.html +0 -41
- data/doc/images/babelfish.png +0 -0
- data/doc/images/browser.png +0 -0
- data/doc/images/button.png +0 -0
- data/doc/images/call-chain-example.png +0 -0
- data/doc/images/colordialog.png +0 -0
- data/doc/images/datatarget.png +0 -0
- data/doc/images/dialog.png +0 -0
- data/doc/images/dilbert.png +0 -0
- data/doc/images/dirlist.png +0 -0
- data/doc/images/dropsite-droprejected.png +0 -0
- data/doc/images/foursplit.png +0 -0
- data/doc/images/gltest.png +0 -0
- data/doc/images/glviewer.png +0 -0
- data/doc/images/groupbox.png +0 -0
- data/doc/images/header.png +0 -0
- data/doc/images/hello-with-button.png +0 -0
- data/doc/images/hello-with-icon-1.png +0 -0
- data/doc/images/hello-with-icon-2.png +0 -0
- data/doc/images/hello-with-icon-3.png +0 -0
- data/doc/images/hello-with-tooltip.png +0 -0
- data/doc/images/hello-without-button.png +0 -0
- data/doc/images/hello.png +0 -0
- data/doc/images/hello2.png +0 -0
- data/doc/images/iconlist-bigicons.png +0 -0
- data/doc/images/iconlist-details.png +0 -0
- data/doc/images/image.png +0 -0
- data/doc/images/imageviewer.png +0 -0
- data/doc/images/inheritance.png +0 -0
- data/doc/images/mditest.png +0 -0
- data/doc/images/raabrowser.png +0 -0
- data/doc/images/scribble.png +0 -0
- data/doc/images/shutter.png +0 -0
- data/doc/images/splitter.png +0 -0
- data/doc/images/tabbook.png +0 -0
- data/doc/images/table.png +0 -0
- data/doc/images/tutorial1.png +0 -0
- data/doc/implementation.html +0 -16
- data/doc/infosources.html +0 -33
- data/doc/library.html +0 -30
- data/doc/opengl.html +0 -73
- data/doc/pt01.html +0 -3
- data/doc/pt02.html +0 -3
- data/doc/scintilla.html +0 -36
- data/doc/style.css +0 -247
- data/doc/subversion.html +0 -21
- data/doc/tutorial1.html +0 -90
- data/doc/unicode.html +0 -56
- data/web/community.html +0 -81
- data/web/documentation.html +0 -83
- data/web/downloads.html +0 -85
- data/web/index.html +0 -88
data/doc/clipboardtut.html
DELETED
@@ -1,67 +0,0 @@
|
|
1
|
-
<html><head>
|
2
|
-
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
3
|
-
<title>Chapter 4. Working With the Clipboard</title><link rel="stylesheet" href="style.css" type="text/css"><meta name="generator" content="DocBook v5 XSL Stylesheets V1.72.0"><link rel="start" href="book.html" title="Developing Graphical User Interfaces with FXRuby"><link rel="up" href="pt01.html" title="Part I. The Basics"><link rel="prev" href="ch03s05.html" title="Adding an icon"><link rel="next" href="ch04s02.html" title="Acquiring the Clipboard"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 4. Working With the Clipboard</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch03s05.html">Prev</a> </td><th width="60%" align="center">Part I. The Basics</th><td width="20%" align="right"> <a accesskey="n" href="ch04s02.html">Next</a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="clipboardtut"></a>Chapter 4. Working With the Clipboard</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="clipboardtut.html#d0e1003">Basic Application</a></span></dt><dt><span class="section"><a href="ch04s02.html">Acquiring the Clipboard</a></span></dt><dt><span class="section"><a href="ch04s03.html">Sending Data to the Clipboard</a></span></dt><dt><span class="section"><a href="ch04s04.html">Pasting Data from the Clipboard</a></span></dt></dl></div><p>Two of the standard FOX widgets, <code class="classname">FXText</code> and
|
4
|
-
<code class="classname">FXTextField</code>, provide clipboard support out of the
|
5
|
-
box. For example, you can select some text in an
|
6
|
-
<code class="classname">FXTextField</code> and then press Ctrl+C to copy that text
|
7
|
-
to the system clipboard. You can also press Ctrl+X to "cut" the selected
|
8
|
-
text to the clipboard, or Ctrl+V to paste text from the clipboard into an
|
9
|
-
<code class="classname">FXText</code> or <code class="classname">FXTextField</code> widget.
|
10
|
-
The purpose of this tutorial is to demonstrate how to interact with the
|
11
|
-
clipboard programmatically, so that you can integrate additional clipboard
|
12
|
-
support into your FXRuby applications.</p><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1003"></a>Basic Application</h2></div></div></div><p>In order to illustrate how to integrate cut and paste operations
|
13
|
-
into your application, we'll start from a simple FXRuby application that
|
14
|
-
doesn't yet provide any clipboard support. This application simply
|
15
|
-
presents a list of customers (from some external source).</p><pre class="programlisting">require 'fox16'
|
16
|
-
require 'customer'
|
17
|
-
|
18
|
-
include Fox
|
19
|
-
|
20
|
-
class ClipMainWindow < FXMainWindow
|
21
|
-
def initialize(anApp)
|
22
|
-
# Initialize base class first
|
23
|
-
super(anApp, "Clipboard Example", :opts => DECOR_ALL, :width => 400, :height => 300)
|
24
|
-
|
25
|
-
# Place the list in a sunken frame
|
26
|
-
sunkenFrame = FXVerticalFrame.new(self,
|
27
|
-
LAYOUT_FILL_X|LAYOUT_FILL_Y|FRAME_SUNKEN|FRAME_THICK, :padding => 0)
|
28
|
-
|
29
|
-
# Customer list
|
30
|
-
customerList = FXList.new(sunkenFrame, :opts => LIST_BROWSESELECT|LAYOUT_FILL_X|LAYOUT_FILL_Y)
|
31
|
-
$customers.each do |customer|
|
32
|
-
customerList.appendItem(customer.name, nil, customer)
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
def create
|
37
|
-
super
|
38
|
-
show(PLACEMENT_SCREEN)
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
if __FILE__ == $0
|
43
|
-
FXApp.new("ClipboardExample", "FXRuby") do |theApp|
|
44
|
-
ClipMainWindow.new(theApp)
|
45
|
-
theApp.create
|
46
|
-
theApp.run
|
47
|
-
end
|
48
|
-
end
|
49
|
-
</pre><p>We're assuming that the "customer" module defines a
|
50
|
-
<code class="classname">Customer</code> class and a global array
|
51
|
-
<code class="varname">$customers</code> that contains the list of customers. For a
|
52
|
-
real world application, you might access this information from a database
|
53
|
-
or some other source, but for this example we'll just use a hard-coded
|
54
|
-
array:</p><pre class="programlisting"># customer.rb
|
55
|
-
|
56
|
-
Customer = Struct.new("Customer", :name, :address, :zip)
|
57
|
-
|
58
|
-
$customers = []
|
59
|
-
$customers << Customer.new("Reed Richards", "123 Maple, Central City, NY", 010111)
|
60
|
-
$customers << Customer.new("Sue Storm", "123 Maple, Anytown, NC", 12345)
|
61
|
-
$customers << Customer.new("Benjamin J. Grimm", "123 Maple, Anytown, NC", 12345)
|
62
|
-
$customers << Customer.new("Johnny Storm", "123 Maple, Anytown, NC", 12345)
|
63
|
-
</pre><p>The goals for the next few sections are to extend this application
|
64
|
-
so that users can select a customer from the list and copy that customer's
|
65
|
-
information to the clipboard, and subsequently paste that information into
|
66
|
-
another copy of the program (or some other clipboard-aware
|
67
|
-
application).</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch03s05.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="pt01.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch04s02.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Adding an icon </td><td width="20%" align="center"><a accesskey="h" href="book.html">Home</a></td><td width="40%" align="right" valign="top"> Acquiring the Clipboard</td></tr></table></div></body></html>
|
data/doc/differences.html
DELETED
@@ -1,190 +0,0 @@
|
|
1
|
-
<html><head>
|
2
|
-
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
3
|
-
<title>Appendix C. Differences between FOX and FXRuby</title><link rel="stylesheet" href="style.css" type="text/css"><meta name="generator" content="DocBook v5 XSL Stylesheets V1.72.0"><link rel="start" href="book.html" title="Developing Graphical User Interfaces with FXRuby"><link rel="up" href="pt02.html" title="Part II. Appendices"><link rel="prev" href="scintilla.html" title="Appendix B. Using Scintilla with FXRuby"><link rel="next" href="library.html" title="Appendix D. The FXRuby Standard Library"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Appendix C. Differences between FOX and FXRuby</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="scintilla.html">Prev</a> </td><th width="60%" align="center">Part II. Appendices</th><td width="20%" align="right"> <a accesskey="n" href="library.html">Next</a></td></tr></table><hr></div><div class="appendix" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="differences"></a>Appendix C. Differences between FOX and FXRuby</h2></div></div></div><p>The FXRuby API follows the FOX API very closely and for the most part,
|
4
|
-
you should be able to use the standard FOX class documentation as a
|
5
|
-
reference. In some cases, however, fundamental differences between Ruby and
|
6
|
-
C++ necessitated slight changes in the API. For some other cases, FOX
|
7
|
-
classes were enhanced to take advantage of Ruby language features (such as
|
8
|
-
iterators). The purpose of this chapter is to identify some of the
|
9
|
-
differences between the C++ and Ruby interfaces to FOX.</p><p>One difference that should be easy to cope with is the substitution of
|
10
|
-
Ruby Strings for FXStrings. Any function that would normally expect an
|
11
|
-
<span class="type">FXString</span> input argument insteads takes a Ruby String.
|
12
|
-
Similarly, functions that would return an <span class="type">FXString</span> will instead
|
13
|
-
return a Ruby string. For functions that would normally accept a
|
14
|
-
<code class="constant">NULL</code> or empty string argument, just pass
|
15
|
-
<code class="constant">nil</code> or an empty string ("").</p><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e5018"></a>Functions that expect arrays of objects</h2></div></div></div><p>One common pattern in FOX member function argument lists is to
|
16
|
-
expect a pointer to an array of values, followed by an integer indicating
|
17
|
-
the number of values in the array. This of course isn't necessary in Ruby,
|
18
|
-
where <code class="classname">Array</code> objects "know" their lengths. As a
|
19
|
-
result, functions such as
|
20
|
-
<code class="methodname">FXWindow::acquireClipboard()</code>, whose C++
|
21
|
-
declaration looks like this:</p><pre class="programlisting">FXbool acquireClipboard(const FXDragType *types, FXuint numTypes);</pre><p>are called from Ruby code by passing in a single
|
22
|
-
<code class="classname">Array</code> argument, e.g.</p><pre class="programlisting">myWindow.acquireClipboard(typesArray)</pre></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e5038"></a>Functions that return values by reference</h2></div></div></div><p>Many FOX methods take advantage of the C++ language feature of
|
23
|
-
returning values by reference. For example, the
|
24
|
-
<code class="methodname">getCursorPos()</code> member function for class
|
25
|
-
<code class="classname">FXWindow</code> has the declaration:</p><pre class="programlisting">FXint getCursorPos(FXint& x, FXint& y, FXint& buttons) const;</pre><p>which indicates that the function takes references to three integers
|
26
|
-
(x, y and buttons). To call this function from a C++ program, you'd write
|
27
|
-
code like this:</p><pre class="programlisting">FXint x, y;
|
28
|
-
FXuint buttons;
|
29
|
-
|
30
|
-
if (window->getCursorPosition(x, y, buttons))
|
31
|
-
fprintf(stderr, "Current position is (%d, %d)\n", x, y);</pre><p>Since this idiom doesn't translate well to Ruby, some functions'
|
32
|
-
interfaces have been slightly modified. For example, the FXRuby
|
33
|
-
implementation of <code class="methodname">getCursorPos()</code> returns the
|
34
|
-
three values as an <code class="classname">Array</code>, e.g.:</p><pre class="programlisting">x, y, buttons = aWindow.getCursorPos()</pre><p>The following table shows how these kinds of functions are
|
35
|
-
implemented in FXRuby:</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><thead><tr><th align="center">Instance Method</th><th align="center">Return Value</th></tr></thead><tbody><tr><td><code class="methodname">FXDial#range</code></td><td>Returns a <code class="classname">Range</code> instance.</td></tr><tr><td><code class="methodname">FXDial#range=(aRange)</code></td><td>Accepts a <code class="classname">Range</code> instance as its
|
36
|
-
input.</td></tr><tr><td><code class="methodname">FXFontDialog#fontSelection</code></td><td>Returns the <code class="classname">FXFontDesc</code>
|
37
|
-
instance</td></tr><tr><td><code class="methodname">FXFontSelector#fontSelection</code></td><td>Returns the <code class="classname">FXFontDesc</code>
|
38
|
-
instance</td></tr><tr><td><code class="methodname">FXGLObject#bounds(range)</code></td><td>Takes an <code class="classname">FXRange</code> instance as its
|
39
|
-
input and returns a (possibly modified)
|
40
|
-
<code class="classname">FXRange</code> instance.</td></tr><tr><td><code class="methodname">FXGLViewer#eyeToScreen(eye)</code></td><td>Takes an array of eye coordinates (floats) as its input and
|
41
|
-
returns the screen point coordinate as an array of integers [sx,
|
42
|
-
sy]</td></tr><tr><td><code class="methodname">FXGLViewer#getBoreVector(sx,
|
43
|
-
sy)</code></td><td>Returns the endpoint and direction vector as an array of
|
44
|
-
arrays [point, dir]</td></tr><tr><td><code class="methodname">FXGLViewer#light</code></td><td>Returns a <code class="classname">FXLight</code> instance</td></tr><tr><td><code class="methodname">FXGLViewer#viewport</code></td><td>Returns an <code class="classname">FXViewport</code>
|
45
|
-
instance.</td></tr><tr><td><code class="methodname">FXPrinterDialog#printer</code></td><td>Returns the <code class="classname">FXPrinter</code>
|
46
|
-
instance</td></tr><tr><td><code class="methodname">FXScrollArea#position</code></td><td>Returns the position as an array of integers [x, y]</td></tr><tr><td><code class="methodname">FXSlider#range</code></td><td>Returns a <code class="classname">Range</code> instance.</td></tr><tr><td><code class="methodname">FXSlider#range=(aRange)</code></td><td>Accepts a <code class="classname">Range</code> instance as its
|
47
|
-
input.</td></tr><tr><td><code class="methodname">FXSpinner#range</code></td><td>Returns a <code class="classname">Range</code> instance.</td></tr><tr><td><code class="methodname">FXSpinner#range=(aRange)</code></td><td>Accepts a <code class="classname">Range</code> instance as its
|
48
|
-
input.</td></tr><tr><td><code class="methodname">FXText#appendText(text,
|
49
|
-
notify=false)</code></td><td>Append text to the end of the buffer.</td></tr><tr><td><code class="methodname">FXText#appendStyledText(text, style=0,
|
50
|
-
notify=false)</code></td><td>Append styled text to the end of the buffer.</td></tr><tr><td><code class="methodname">FXText#extractText(pos, n)</code></td><td>Extracts <span class="emphasis"><em>n</em></span> characters from the buffer
|
51
|
-
beginning at position <span class="emphasis"><em>pos</em></span> and returns the
|
52
|
-
result as a String.</td></tr><tr><td><code class="methodname">FXText#extractStyle(pos,
|
53
|
-
n)</code></td><td>Extracts <span class="emphasis"><em>n</em></span> style characters from the
|
54
|
-
buffer beginning at position <span class="emphasis"><em>pos</em></span> and returns
|
55
|
-
the result as a String.</td></tr><tr><td><code class="methodname">FXText#insertText(pos, text,
|
56
|
-
notify=false)</code></td><td>Insert <span class="emphasis"><em>text</em></span> at position
|
57
|
-
<span class="emphasis"><em>pos</em></span> in the buffer.</td></tr><tr><td><code class="methodname">FXText#insertStyledText(pos, text, style=0,
|
58
|
-
notify=false)</code></td><td>Insert <span class="emphasis"><em>text</em></span> at position
|
59
|
-
<span class="emphasis"><em>pos</em></span> in the buffer.</td></tr><tr><td><code class="methodname">FXText#replaceText(pos, m, text,
|
60
|
-
notify=false)</code></td><td>Replace <span class="emphasis"><em>m</em></span> characters at
|
61
|
-
<span class="emphasis"><em>pos</em></span> by <span class="emphasis"><em>text</em></span>.</td></tr><tr><td><code class="methodname">FXText#replaceStyledText(pos, m, text, style=0,
|
62
|
-
notify=false)</code></td><td>Replace <span class="emphasis"><em>m</em></span> characters at
|
63
|
-
<span class="emphasis"><em>pos</em></span> by <span class="emphasis"><em>text</em></span>.</td></tr><tr><td><code class="methodname">FXText#setDelimiters(delimiters)</code></td><td>Change delimiters of words (<span class="emphasis"><em>delimiters</em></span>
|
64
|
-
is a string).</td></tr><tr><td><code class="methodname">FXText#getDelimiters()</code></td><td>Return word delimiters as a string.</td></tr><tr><td><code class="methodname">FXWindow#cursorPosition</code></td><td>Returns an array of integers [x, y, buttons]</td></tr><tr><td><code class="methodname">FXWindow#translateCoordinatesFrom(window, x,
|
65
|
-
y)</code></td><td>Returns the translated coordinates as an array [x,
|
66
|
-
y]</td></tr><tr><td><code class="methodname">FXWindow#translateCoordinatesTo(window, x,
|
67
|
-
y)</code></td><td>Returns the translated coordinates as an array [x,
|
68
|
-
y]</td></tr></tbody></table></div></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e5328"></a>Iterators</h2></div></div></div><p>Several classes have been extended with an
|
69
|
-
<code class="methodname">each</code> method to provide Ruby-style iterators.
|
70
|
-
These classes include <code class="classname">FXComboBox</code>,
|
71
|
-
<code class="classname">FXGLGroup</code>, <code class="classname">FXHeader</code>,
|
72
|
-
<code class="classname">FXIconList</code>, <code class="classname">FXList</code>,
|
73
|
-
<code class="classname">FXListBox</code>, <code class="classname">FXTreeItem</code>,
|
74
|
-
<code class="classname">FXTreeList</code> and
|
75
|
-
<code class="classname">FXTreeListBox</code>. These classes also mix-in Ruby's
|
76
|
-
<code class="classname">Enumerable</code> module so that you can take full
|
77
|
-
advantage of the iterators.</p><p>The block parameters passed to your code block vary depending on the
|
78
|
-
class. For example, iterating over an <code class="classname">FXList</code>
|
79
|
-
instance yields <code class="classname">FXListItem</code> parameters:</p><pre class="programlisting">aList.each { |aListItem|
|
80
|
-
puts "text for this item = #{aListItem.getText()}"
|
81
|
-
}</pre><p>whereas iterating over an <code class="classname">FXComboBox</code> instance
|
82
|
-
yields two parameters, the item text (a string) and the item data:</p><pre class="programlisting">aComboBox.each { |itemText, itemData|
|
83
|
-
puts "text for this item = #{itemText}"
|
84
|
-
}</pre><p>The following table shows the block parameters for each of these
|
85
|
-
classes' iterators:</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><thead><tr><th align="center">Class</th><th align="center">Block Parameters</th></tr></thead><tbody><tr><td><code class="classname">FXComboBox</code></td><td>the item text (a string) and user data</td></tr><tr><td><code class="classname">FXGLGroup</code></td><td>an <code class="classname">FXGLObject</code> instance</td></tr><tr><td><code class="classname">FXHeader</code></td><td>an <code class="classname">FXHeaderItem</code> instance</td></tr><tr><td><code class="classname">FXIconList</code></td><td>an <code class="classname">FXIconItem</code> instance</td></tr><tr><td><code class="classname">FXList</code></td><td>an <code class="classname">FXListItem</code> instance</td></tr><tr><td><code class="classname">FXListBox</code></td><td>the item text (a string), icon (an
|
86
|
-
<code class="classname">FXIcon</code> instance) and user data</td></tr><tr><td><code class="classname">FXTreeItem</code></td><td>an <code class="classname">FXTreeItem</code> instance</td></tr><tr><td><code class="classname">FXTreeList</code></td><td>an <code class="classname">FXTreeItem</code> instance</td></tr><tr><td><code class="classname">FXTreeListBox</code></td><td>an <code class="classname">FXTreeItem</code> instance</td></tr></tbody></table></div></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e5472"></a>Attribute Accessors</h2></div></div></div><p>FOX strictly handles access to all object attributes through member
|
87
|
-
functions, e.g. <code class="methodname">setBackgroundColor</code> and
|
88
|
-
<code class="methodname">getBackgroundColor</code> or
|
89
|
-
<code class="methodname">setText</code> and <code class="methodname">getText</code>.
|
90
|
-
FXRuby exposes all of these functions but also provides aliases that look
|
91
|
-
more like regular Ruby attribute accessors. The names for these accessors
|
92
|
-
are based on the FOX method names; for example,
|
93
|
-
<code class="methodname">setBackgroundColor</code> and
|
94
|
-
<code class="methodname">getBackgroundColor</code> are aliased to
|
95
|
-
<code class="methodname">backgroundColor=</code> and
|
96
|
-
<code class="methodname">backgroundColor</code>, respectively.</p><p>In many cases these aliases allow you to write more compact and
|
97
|
-
legible code. For example, consider this code snippet:</p><pre class="programlisting">aLabel.setText(aLabel.getText() + " (modified)")</pre><p>Now consider a different code snippet, using the aliased accessor
|
98
|
-
method names:</p><pre class="programlisting">aLabel.text += " (modified)"</pre><p>While these two are functionally equivalent, the latter is a bit
|
99
|
-
easier to read and understand at first glance.</p></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e5511"></a>Message Passing</h2></div></div></div><p>FOX message maps are implemented as static C++ class members. With
|
100
|
-
FXRuby, you just associate messages with message handlers in the class
|
101
|
-
<code class="methodname">initialize</code> method using the
|
102
|
-
<code class="methodname">FXMAPFUNC()</code>,
|
103
|
-
<code class="methodname">FXMAPTYPE()</code>,
|
104
|
-
<code class="methodname">FXMAPTYPES()</code> or
|
105
|
-
<code class="methodname">FXMAPFUNCS()</code> methods. See almost any of the
|
106
|
-
example programs for examples of how this is done.</p><p>As in C++ FOX, the last argument passed to your message handler
|
107
|
-
functions contains message-specific data. For instance, all
|
108
|
-
<code class="constant">SEL_PAINT</code> messages pass an
|
109
|
-
<code class="classname">FXEvent</code> object through this argument to give you
|
110
|
-
some information about the size of the exposed rectangle. On the other
|
111
|
-
hand, a <code class="constant">SEL_COMMAND</code> message from an
|
112
|
-
<code class="classname">FXHeader</code> object passes the index of the selected
|
113
|
-
header item through this argument. Instead of guessing what's in this last
|
114
|
-
argument, your best bet is to instead invoke a member function on the
|
115
|
-
sending object to find out what you need, instead of relying on the data
|
116
|
-
passed through this pointer. For example, if you get a
|
117
|
-
<code class="constant">SEL_COMMAND</code> message from an
|
118
|
-
<code class="classname">FXColorWell</code> object, the data passed through that
|
119
|
-
last argument is supposed to be the new RGB color value. Instead of trying
|
120
|
-
to interpret the argument's contents, just turn around and call the color
|
121
|
-
well's <code class="methodname">getRGBA()</code> member function to retrieve its
|
122
|
-
color. Similarly, if you get a <code class="constant">SEL_COMMAND</code> message
|
123
|
-
from a tree list, call its <code class="methodname">getCurrentItem()</code>
|
124
|
-
method to find out which item was selected.</p></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e5560"></a>Catching Operating System Signals</h2></div></div></div><p>The <code class="methodname">FXApp#addSignal</code> and
|
125
|
-
<code class="methodname">FXApp#removeSignal</code> methods have been enhanced to
|
126
|
-
accept either a string or integer as their first argument. If it's a
|
127
|
-
string (e.g. "SIGINT" or just "INT") the code will determine the
|
128
|
-
corresponding signal number for you (similar to the standard Ruby
|
129
|
-
library's <code class="methodname">Process.kill</code> module method). For
|
130
|
-
examples of how to use this, see the <code class="filename">datatarget.rb</code> or
|
131
|
-
<code class="filename">imageviewer.rb</code> example programs.</p></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e5580"></a>Support for Multithreaded Applications</h2></div></div></div><p>There is some support for multithreaded FXRuby applications, but
|
132
|
-
it's not wonderful. The current implementation does what is also done in
|
133
|
-
Ruby/GTK; it turns over some idle processing time to the Ruby thread
|
134
|
-
scheduler to let other threads do their thing. As I learn more about
|
135
|
-
Ruby's threading implementation I may try something different, but this
|
136
|
-
seems to work OK for now. For a simple example, see the
|
137
|
-
<code class="filename">groupbox.rb</code> example program, in which the clock label
|
138
|
-
that appears in the lower right-hand corner is continuously updated (by a
|
139
|
-
separate thread).</p><p>If you suspect that FXRuby's threads support is interfering with
|
140
|
-
your application's performance, you may want to try tweaking the amount of
|
141
|
-
time that the main application thread "sleeps" during idle processing; do
|
142
|
-
this by setting the <code class="classname">FXApp</code> object's
|
143
|
-
<em class="structfield"><code>sleepTime</code></em> attribute. The default value for
|
144
|
-
<em class="structfield"><code>FXApp#sleepTime</code></em> is 100 milliseconds. You can
|
145
|
-
also disable the threads support completely by calling
|
146
|
-
<code class="methodname">FXApp#threadsEnabled=false</code> (and subsequently
|
147
|
-
re-enable it with
|
148
|
-
<code class="methodname">FXApp#threadsEnabled=true</code>).</p></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e5605"></a>Keyword-Style Arguments</h2></div></div></div><p>FXRuby 1.6.5 introduced preliminary, experimental support for using
|
149
|
-
keyword-style arguments in FXRuby method calls. The current implementation
|
150
|
-
of this feature only works for class constructors (i.e. the "new" class
|
151
|
-
methods), but the intent is to gradually extend this feature so that it
|
152
|
-
covers all FXRuby methods.</p><p>What this means in practice is that for calls to methods that have
|
153
|
-
one or more optional arguments, you can replace all of the optional
|
154
|
-
arguments with a hash that sets only the values for which the default
|
155
|
-
isn't appropriate. So, for example, consider a typical call to
|
156
|
-
<code class="methodname">FXMainWindow.new</code>:</p><pre class="programlisting">main = FXMainWindow.new(app, "Title Goes Here", nil, nil, DECOR_ALL, 0, 0, 800, 600)</pre><p>In this case, the programmer wants to set the initial window width
|
157
|
-
and height to 800 and 600. In order to do that (with the current release
|
158
|
-
of FXRuby), however, she's required to fill in all of the optional
|
159
|
-
arguments in between the window title string and the width and height
|
160
|
-
values. As anyone who's worked with FXRuby for any amount of time will
|
161
|
-
tell you, it's easy to accidentally leave out one of those intermediate
|
162
|
-
arguments and it can be difficult to figure out what's wrong
|
163
|
-
afterwards.</p><p>Now consider how this method call could be written using the new
|
164
|
-
keyword arguments support. First, the programmer would need to require the
|
165
|
-
keyword arguments library:</p><pre class="programlisting">require 'fox16/kwargs'</pre><p>Then she would look up the API documentation for the
|
166
|
-
<code class="methodname">FXMainWindow#initialize</code> method (e.g. <a xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.fxruby.org/doc/api/classes/Fox/FXMainWindow.html" target="_top">here</a>)
|
167
|
-
and see that the names of the width and height arguments are, in fact,
|
168
|
-
"width" and "height". Armed with that information, she would be able to
|
169
|
-
rewrite the previous code as:</p><pre class="programlisting">main = FXMainWindow.new(app, "Title Goes Here", :width => 800, :height => 600)</pre><p>Here, the programmer has omitted the intermediate optional arguments
|
170
|
-
(thus accepting their default values) and specified only the width and
|
171
|
-
height values. This code is obviously a lot more readable and
|
172
|
-
maintainable.</p><p>It is important to observe the difference between required and
|
173
|
-
optional arguments when using this feature. If the API documentation for a
|
174
|
-
particular method doesn't indicate that an argument has a default value,
|
175
|
-
then it is by definition not an optional argument. So one could
|
176
|
-
<span class="emphasis"><em>not</em></span> write the example as, e.g.</p><pre class="programlisting">main = FXMainWindow.new(app, :width => 800, :title => "Title Goes Here", :height => 600)</pre><p>This example is incorrect because the title argument is required,
|
177
|
-
and it must be the second argument in the call. Obviously, this means that
|
178
|
-
the optional arguments in a method call (if they're specified) will always
|
179
|
-
follow all of the required arguments.</p><p>Finally, note that the keyword arguments feature has been
|
180
|
-
implemented so that it's backwards-compatible with the original positional
|
181
|
-
arguments scheme (or it's intended to be, at any rate). What that means is
|
182
|
-
that you can immediately start making use of this feature in your existing
|
183
|
-
code, even if you don't have time to update all of the method calls to use
|
184
|
-
keyword arguments.</p></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e5646"></a>Debugging Tricks</h2></div></div></div><p>As a debugging tool, you can optionally catch exceptions raised in
|
185
|
-
message handlers. To turn on this feature, call the
|
186
|
-
<code class="methodname">setIgnoreExceptions(true)</code> module method. When
|
187
|
-
this is enabled, any exceptions raised in message handler functions will
|
188
|
-
cause a standard stack trace to be dumped to the standard output, but then
|
189
|
-
your application will, for better or worse, proceed normally. Thanks to
|
190
|
-
Ted Meng for this suggestion.</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="scintilla.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="pt02.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="library.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Appendix B. Using Scintilla with FXRuby </td><td width="20%" align="center"><a accesskey="h" href="book.html">Home</a></td><td width="40%" align="right" valign="top"> Appendix D. The FXRuby Standard Library</td></tr></table></div></body></html>
|
data/doc/dragdroptut.html
DELETED
@@ -1,263 +0,0 @@
|
|
1
|
-
<html><head>
|
2
|
-
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
3
|
-
<title>Chapter 5. Drag and Drop</title><link rel="stylesheet" href="style.css" type="text/css"><meta name="generator" content="DocBook v5 XSL Stylesheets V1.72.0"><link rel="start" href="book.html" title="Developing Graphical User Interfaces with FXRuby"><link rel="up" href="pt01.html" title="Part I. The Basics"><link rel="prev" href="ch04s04.html" title="Pasting Data from the Clipboard"><link rel="next" href="ch05s02.html" title="Drag Sources"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 5. Drag and Drop</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch04s04.html">Prev</a> </td><th width="60%" align="center">Part I. The Basics</th><td width="20%" align="right"> <a accesskey="n" href="ch05s02.html">Next</a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="dragdroptut"></a>Chapter 5. Drag and Drop</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="dragdroptut.html#d0e1218">Drop Sites</a></span></dt><dt><span class="section"><a href="ch05s02.html">Drag Sources</a></span></dt><dt><span class="section"><a href="ch05s03.html">Putting It All Together</a></span></dt></dl></div><p>One of the more powerful features available to FOX applications is
|
4
|
-
drag-and-drop. It's also one of the more complicated to understand. For more
|
5
|
-
background, see the standard FOX documentation on <a xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.fox-toolkit.com/draganddrop.html" target="_top">Drag and
|
6
|
-
Drop</a>.</p><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1218"></a>Drop Sites</h2></div></div></div><p>We're going to start by presenting a skeleton application consisting
|
7
|
-
of a main window widget (a <code class="classname">DropSite</code> instance) that
|
8
|
-
parents an <code class="classname">FXCanvas</code> widget:</p><pre class="programlisting">require 'fox16'
|
9
|
-
|
10
|
-
include Fox
|
11
|
-
|
12
|
-
class DropSite < FXMainWindow
|
13
|
-
def initialize(anApp)
|
14
|
-
# Initialize base class
|
15
|
-
super(anApp, "Drop Site", :opts => DECOR_ALL, :width => 400, :height => 300)
|
16
|
-
|
17
|
-
# Fill main window with canvas
|
18
|
-
@canvas = FXCanvas.new(self, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y)
|
19
|
-
end
|
20
|
-
|
21
|
-
def create
|
22
|
-
# Create the main window and canvas
|
23
|
-
super
|
24
|
-
|
25
|
-
# Show the main window
|
26
|
-
show(PLACEMENT_SCREEN)
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
if __FILE__ == $0
|
31
|
-
FXApp.new("DropSite", "FXRuby") do |theApp|
|
32
|
-
DropSite.new(theApp)
|
33
|
-
theApp.create
|
34
|
-
theApp.run
|
35
|
-
end
|
36
|
-
end
|
37
|
-
</pre><p>Since the main program (i.e. the part at the end) won't change for
|
38
|
-
the rest of the tutorial, I won't show that code anymore. Since an
|
39
|
-
<code class="classname">FXCanvas</code> widget relies on some other object (its
|
40
|
-
message target) to draw its contents, we need to handle
|
41
|
-
<code class="constant">SEL_PAINT</code> messages generated by the canvas. We'll do
|
42
|
-
that by adding a handler that clears the canvas to its current background
|
43
|
-
color:</p><pre class="programlisting">require 'fox16'
|
44
|
-
|
45
|
-
include Fox
|
46
|
-
|
47
|
-
class DropSite < FXMainWindow
|
48
|
-
def initialize(anApp)
|
49
|
-
# Initialize base class
|
50
|
-
super(anApp, "Drop Site", :opts => DECOR_ALL, :width => 400, :height => 300)
|
51
|
-
|
52
|
-
# Fill main window with canvas
|
53
|
-
@canvas = FXCanvas.new(self, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y)
|
54
|
-
|
55
|
-
<span class="bold"><strong> # Handle expose events on the canvas
|
56
|
-
@canvas.connect(SEL_PAINT) do |sender, sel, event|
|
57
|
-
FXDCWindow.new(@canvas, event) do |dc|
|
58
|
-
dc.foreground = @canvas.backColor
|
59
|
-
dc.fillRectangle(event.rect.x, event.rect.y, event.rect.w, event.rect.h)
|
60
|
-
end
|
61
|
-
end</strong></span>
|
62
|
-
end
|
63
|
-
|
64
|
-
def create
|
65
|
-
# Create the main window and canvas
|
66
|
-
super
|
67
|
-
|
68
|
-
# Show the main window
|
69
|
-
show(PLACEMENT_SCREEN)
|
70
|
-
end
|
71
|
-
end
|
72
|
-
</pre><p>Run this basic version of the program to be sure that it's working
|
73
|
-
properly so far. You should simply see an empty window with a white
|
74
|
-
background.</p><p>Now, on to the fun stuff. Our goal is to be able to drag color data
|
75
|
-
from some other window, such as an <code class="classname">FXColorWell</code>
|
76
|
-
widget, and drop it onto the canvas in order to change the canvas'
|
77
|
-
background color. In order for a FOX widget to be able to accept drops at
|
78
|
-
all, we need to first call its <code class="methodname">dropEnable</code>
|
79
|
-
method:</p><pre class="programlisting">def initialize(anApp)
|
80
|
-
# Initialize base class
|
81
|
-
super(anApp, "Drop Site", :opts => DECOR_ALL, :width => 400, :height => 300)
|
82
|
-
|
83
|
-
# Fill main window with canvas
|
84
|
-
@canvas = FXCanvas.new(self, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y)
|
85
|
-
|
86
|
-
# Handle expose events on the canvas
|
87
|
-
@canvas.connect(SEL_PAINT) do |sender, sel, event|
|
88
|
-
FXDCWindow.new(@canvas, event) do |dc|
|
89
|
-
dc.foreground = @canvas.backColor
|
90
|
-
dc.fillRectangle(event.rect.x, event.rect.y, event.rect.w, event.rect.h)
|
91
|
-
end
|
92
|
-
end
|
93
|
-
|
94
|
-
<span class="bold"><strong> # Enable canvas for drag-and-drop messages
|
95
|
-
@canvas.dropEnable
|
96
|
-
</strong></span>end
|
97
|
-
</pre><p>At this point, let's try a little test to see if the program does
|
98
|
-
anything interesting yet. Start by running some other FOX or FXRuby
|
99
|
-
program to use as a drag source for the color data. You should be able to
|
100
|
-
use any program that displays an FXColorWell widget, and this includes the
|
101
|
-
standard color dialog box shown here:</p><div class="screenshot"><div class="mediaobject" align="center"><img src="images/colordialog.png" align="middle"></div></div><p>Each of the small colored boxes near the bottom of the color dialog
|
102
|
-
box are color wells, and the large box on the left-hand side of the color
|
103
|
-
dialog box is also a color well. Now start your drag-and-drop test program
|
104
|
-
and try to drag a color from one of these color wells onto this window. At
|
105
|
-
this point, the mouse pointer should turn into a stop sign, indicating
|
106
|
-
that the canvas isn't accepting drops of color data yet.</p><p>To correct this problem, we need to use the canvas'
|
107
|
-
<code class="methodname">acceptDrop</code> method to indicate whether or not
|
108
|
-
we'll accept certain kinds of drops. You can call
|
109
|
-
<code class="methodname">acceptDrop</code> any time after receiving the initial
|
110
|
-
<code class="constant">SEL_DND_ENTER</code> message, but it's usually done in
|
111
|
-
response to a <code class="constant">SEL_DND_MOTION</code> message. Let's add a
|
112
|
-
handler for <code class="constant">SEL_DND_MOTION</code> messages from the canvas
|
113
|
-
in DropSite's <code class="methodname">initialize</code> method. For now, we'll unconditionally accept
|
114
|
-
drops from any drag source, regardless of what kind of data they're
|
115
|
-
offering:</p><pre class="programlisting">def initialize(anApp)
|
116
|
-
# Initialize base class
|
117
|
-
super(anApp, "Drop Site", :opts => DECOR_ALL, :width => 400, :height => 300)
|
118
|
-
|
119
|
-
# Fill main window with canvas
|
120
|
-
@canvas = FXCanvas.new(self, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y)
|
121
|
-
|
122
|
-
# Handle expose events on the canvas
|
123
|
-
@canvas.connect(SEL_PAINT) do |sender, sel, event|
|
124
|
-
FXDCWindow.new(@canvas, event) do |dc|
|
125
|
-
dc.foreground = @canvas.backColor
|
126
|
-
dc.fillRectangle(event.rect.x, event.rect.y, event.rect.w, event.rect.h)
|
127
|
-
end
|
128
|
-
end
|
129
|
-
|
130
|
-
# Enable canvas for drag-and-drop messages
|
131
|
-
@canvas.dropEnable
|
132
|
-
|
133
|
-
<span class="bold"><strong> # Handle SEL_DND_MOTION messages from the canvas
|
134
|
-
@canvas.connect(SEL_DND_MOTION) do
|
135
|
-
# Accept drops unconditionally (for now)
|
136
|
-
@canvas.acceptDrop
|
137
|
-
end
|
138
|
-
</strong></span>end
|
139
|
-
</pre><p>Now try the previous test again. This time, when you try to drag
|
140
|
-
from a color well to the drop-enabled canvas, you should see the mouse
|
141
|
-
pointer turn into a small filled square. This is a visual cue to the user
|
142
|
-
indicating that the canvas will accept a drop of the drag-and-drop
|
143
|
-
data.</p><p>Now it's time to get more specific about what kind of data is being
|
144
|
-
dragged between these applications, and how to process that data. So far,
|
145
|
-
our drop-enabled canvas merely knows that you're dragging some kind of
|
146
|
-
data from a drag source, but it doesn't know what kind of data it is. We
|
147
|
-
really need to be more exclusive about what kinds of data are acceptable.
|
148
|
-
FOX uses unique drag types to distinguish between different kinds of
|
149
|
-
"draggable" data. As you'll see later, you have the freedom to define drag
|
150
|
-
types for any kind of application-specific data that you need; but for
|
151
|
-
now, we're going to use FOX's built-in drag type for color data.</p><p>Drag types (even the standard ones) must be registered before they
|
152
|
-
can be used, and so we'll start by adding a few lines to
|
153
|
-
<code class="classname">DropSite</code>'s <code class="methodname">create</code> method
|
154
|
-
to register the drag type for color data:</p><pre class="programlisting">def create
|
155
|
-
# Create the main window and canvas
|
156
|
-
super
|
157
|
-
|
158
|
-
<span class="bold"><strong> # Register the drag type for colors
|
159
|
-
FXWindow.colorType = getApp().registerDragType(FXWindow.colorTypeName)
|
160
|
-
|
161
|
-
</strong></span> # Show the main window
|
162
|
-
show(PLACEMENT_SCREEN)
|
163
|
-
end
|
164
|
-
</pre><p>Note that the first time that
|
165
|
-
<code class="methodname">registerDragType</code> is called for a particular
|
166
|
-
drag type name (such as <code class="methodname">FXWindow.colorTypeName</code>)
|
167
|
-
it will generate a unique identifier for that drag type. Subsequent calls
|
168
|
-
to <code class="methodname">registerDragType</code> for the same drag type name
|
169
|
-
will just return the previously-generated drag type. Now, we want to
|
170
|
-
modify our <code class="constant">SEL_DND_MOTION</code> handler so that it's a
|
171
|
-
little more picky about which kinds of drops it will accept:</p><pre class="programlisting"># Handle SEL_DND_MOTION messages from the canvas
|
172
|
-
@canvas.connect(SEL_DND_MOTION) do
|
173
|
-
<span class="bold"><strong> if @canvas.offeredDNDType?(FROM_DRAGNDROP, FXWindow.colorType)
|
174
|
-
@canvas.acceptDrop
|
175
|
-
end
|
176
|
-
</strong></span>end
|
177
|
-
</pre><p>Here, we call the canvas' <code class="methodname">offeredDNDType?</code>
|
178
|
-
method to ask if the drag source can provide its data in the requested
|
179
|
-
format. Only if <code class="methodname">offeredDNDType?</code> returns true will
|
180
|
-
we call <code class="methodname">acceptDrop</code> as before.</p><p>The last step is to actually handle the drop, and for that we add a
|
181
|
-
handler for the <code class="constant">SEL_DND_DROP</code> message:</p><pre class="programlisting"><span class="bold"><strong># Handle SEL_DND_DROP message from the canvas
|
182
|
-
@canvas.connect(SEL_DND_DROP) do
|
183
|
-
# Try to obtain the data as color values first
|
184
|
-
data = @canvas.getDNDData(FROM_DRAGNDROP, FXWindow.colorType)
|
185
|
-
unless data.nil?
|
186
|
-
# Update canvas background color
|
187
|
-
@canvas.backColor = Fox.fxdecodeColorData(data)
|
188
|
-
end
|
189
|
-
end</strong></span></pre><p>Assuming that the drag source is able to provide its data in the
|
190
|
-
requested format, the <code class="methodname">getDNDData</code> method will
|
191
|
-
return a string (which for our purposes is just a byte buffer). If you've
|
192
|
-
defined your own application-specific drag types, this data can of course
|
193
|
-
be anything, and we'll see examples of this in a later tutorial. But the
|
194
|
-
data for standard drag types like
|
195
|
-
<code class="methodname">FXWindow.colorType</code> can be decoded using the
|
196
|
-
appropriate built-in library functions. In this case, we use the
|
197
|
-
<code class="methodname">fxdecodeColorData</code> method to convert the bytes
|
198
|
-
into a color value that we can use.</p><p>Now comes the moment of truth. Try running your test program again
|
199
|
-
(one that displays a color well). Now, when you drag a color from a color
|
200
|
-
well and drop it onto the <code class="classname">DropSite</code> window, the
|
201
|
-
canvas should change its background color accordingly.</p><p>The complete program is listed below, and is included in the
|
202
|
-
<code class="filename">examples</code> directory under the file
|
203
|
-
name <code class="filename">dropsite.rb</code>.</p><pre class="programlisting">require 'fox16'
|
204
|
-
|
205
|
-
include Fox
|
206
|
-
|
207
|
-
class DropSite < FXMainWindow
|
208
|
-
def initialize(anApp)
|
209
|
-
# Initialize base class
|
210
|
-
super(anApp, "Drop Site", :opts => DECOR_ALL, :width => 400, :height => 300)
|
211
|
-
|
212
|
-
# Fill main window with canvas
|
213
|
-
@canvas = FXCanvas.new(self, :opts => LAYOUT_FILL_X|LAYOUT_FILL_Y)
|
214
|
-
|
215
|
-
# Handle expose events on the canvas
|
216
|
-
@canvas.connect(SEL_PAINT) do |sender, sel, event|
|
217
|
-
FXDCWindow.new(@canvas, event) do |dc|
|
218
|
-
dc.foreground = @canvas.backColor
|
219
|
-
dc.fillRectangle(event.rect.x, event.rect.y, event.rect.w, event.rect.h)
|
220
|
-
end
|
221
|
-
end
|
222
|
-
|
223
|
-
# Enable canvas for drag-and-drop messages
|
224
|
-
@canvas.dropEnable
|
225
|
-
|
226
|
-
# Handle SEL_DND_MOTION messages from the canvas
|
227
|
-
@canvas.connect(SEL_DND_MOTION) do
|
228
|
-
if @canvas.offeredDNDType?(FROM_DRAGNDROP, FXWindow.colorType)
|
229
|
-
@canvas.acceptDrop
|
230
|
-
end
|
231
|
-
end
|
232
|
-
|
233
|
-
# Handle SEL_DND_DROP message from the canvas
|
234
|
-
@canvas.connect(SEL_DND_DROP) do
|
235
|
-
# Try to obtain the data as color values first
|
236
|
-
data = @canvas.getDNDData(FROM_DRAGNDROP, FXWindow.colorType)
|
237
|
-
unless data.nil?
|
238
|
-
# Update canvas background color
|
239
|
-
@canvas.backColor = Fox.fxdecodeColorData(data)
|
240
|
-
end
|
241
|
-
end
|
242
|
-
end
|
243
|
-
|
244
|
-
def create
|
245
|
-
# Create the main window and canvas
|
246
|
-
super
|
247
|
-
|
248
|
-
# Register the drag type for colors
|
249
|
-
FXWindow.colorType = getApp().registerDragType(FXWindow.colorTypeName)
|
250
|
-
|
251
|
-
# Show the main window
|
252
|
-
show(PLACEMENT_SCREEN)
|
253
|
-
end
|
254
|
-
end
|
255
|
-
|
256
|
-
if __FILE__ == $0
|
257
|
-
FXApp.new("DropSite", "FXRuby") do |theApp|
|
258
|
-
DropSite.new(theApp)
|
259
|
-
theApp.create
|
260
|
-
theApp.run
|
261
|
-
end
|
262
|
-
end
|
263
|
-
</pre></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch04s04.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="pt01.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch05s02.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Pasting Data from the Clipboard </td><td width="20%" align="center"><a accesskey="h" href="book.html">Home</a></td><td width="40%" align="right" valign="top"> Drag Sources</td></tr></table></div></body></html>
|