fxruby 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/ANNOUNCE +25 -0
- data/ChangeLog +10606 -0
- data/INSTALL +50 -0
- data/LICENSE +456 -0
- data/README +39 -0
- data/doc/apes02.html +21 -0
- data/doc/apes03.html +39 -0
- data/doc/book.html +3 -0
- data/doc/build.html +144 -0
- data/doc/ch03s02.html +24 -0
- data/doc/ch03s03.html +53 -0
- data/doc/ch03s04.html +37 -0
- data/doc/ch03s05.html +61 -0
- data/doc/ch04s02.html +72 -0
- data/doc/ch04s03.html +37 -0
- data/doc/ch04s04.html +72 -0
- data/doc/ch05s02.html +262 -0
- data/doc/ch05s03.html +128 -0
- data/doc/changes.html +75 -0
- data/doc/clipboardtut.html +68 -0
- data/doc/cvs.html +35 -0
- data/doc/differences.html +11 -0
- data/doc/dragdroptut.html +266 -0
- data/doc/events.html +36 -0
- data/doc/examples.html +104 -0
- data/doc/gems.html +73 -0
- data/doc/goals.html +39 -0
- 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 +16 -0
- data/doc/infosources.html +33 -0
- data/doc/library.html +30 -0
- data/doc/opengl.html +73 -0
- data/doc/pt01.html +3 -0
- data/doc/pt02.html +3 -0
- data/doc/scintilla.html +36 -0
- data/doc/todo.html +40 -0
- data/doc/tutorial1.html +97 -0
- data/examples/RAA.rb +25 -0
- data/examples/README +53 -0
- data/examples/babelfish.rb +107 -0
- data/examples/bounce.rb +159 -0
- data/examples/browser.rb +191 -0
- data/examples/button.rb +160 -0
- data/examples/datatarget.rb +223 -0
- data/examples/dctest.rb +702 -0
- data/examples/dialog.rb +148 -0
- data/examples/dilbert.rb +105 -0
- data/examples/dirlist.rb +63 -0
- data/examples/dragdrop.rb +101 -0
- data/examples/dragsource.rb +81 -0
- data/examples/dropsite.rb +61 -0
- data/examples/foursplit.rb +103 -0
- data/examples/gltest.rb +342 -0
- data/examples/glviewer.rb +579 -0
- data/examples/groupbox.rb +422 -0
- data/examples/header.rb +150 -0
- data/examples/hello.rb +12 -0
- data/examples/hello2.rb +51 -0
- data/examples/iRAA.rb +153 -0
- data/examples/iconlist.rb +104 -0
- data/examples/icons/AngryGuyInBunnySuit.ico +0 -0
- data/examples/icons/FatBot.ico +0 -0
- data/examples/icons/FlippedySwitch.ico +0 -0
- data/examples/icons/LeGoon.ico +0 -0
- data/examples/icons/Net.ico +0 -0
- data/examples/icons/RedMacOS.ico +0 -0
- data/examples/icons/SawBlade.ico +0 -0
- data/examples/icons/backview.png +0 -0
- data/examples/icons/big.png +0 -0
- data/examples/icons/bigfolder.png +0 -0
- data/examples/icons/bigpenguin.png +0 -0
- data/examples/icons/bottomview.png +0 -0
- data/examples/icons/camera.png +0 -0
- data/examples/icons/capbutt.png +0 -0
- data/examples/icons/capnotlast.png +0 -0
- data/examples/icons/capproj.png +0 -0
- data/examples/icons/capround.png +0 -0
- data/examples/icons/colorpal.png +0 -0
- data/examples/icons/copy.png +0 -0
- data/examples/icons/cut.png +0 -0
- data/examples/icons/delimit.png +0 -0
- data/examples/icons/dippy.png +0 -0
- data/examples/icons/double_dash.png +0 -0
- data/examples/icons/filenew.png +0 -0
- data/examples/icons/fileopen.png +0 -0
- data/examples/icons/filesave.png +0 -0
- data/examples/icons/filesaveas.png +0 -0
- data/examples/icons/fonts.png +0 -0
- data/examples/icons/fox.png +0 -0
- data/examples/icons/foxicon.png +0 -0
- data/examples/icons/frontview.png +0 -0
- data/examples/icons/gem_big.png +0 -0
- data/examples/icons/gem_small.png +0 -0
- data/examples/icons/hello2.png +0 -0
- data/examples/icons/help.png +0 -0
- data/examples/icons/indent.png +0 -0
- data/examples/icons/jbevel.png +0 -0
- data/examples/icons/jmiter.png +0 -0
- data/examples/icons/jround.png +0 -0
- data/examples/icons/kill.png +0 -0
- data/examples/icons/leftview.png +0 -0
- data/examples/icons/light.png +0 -0
- data/examples/icons/minidoc.png +0 -0
- data/examples/icons/minifolder.png +0 -0
- data/examples/icons/minifolderopen.png +0 -0
- data/examples/icons/newfolder.png +0 -0
- data/examples/icons/nolight.png +0 -0
- data/examples/icons/onoff_dash.png +0 -0
- data/examples/icons/palette.png +0 -0
- data/examples/icons/parallel.png +0 -0
- data/examples/icons/paste.png +0 -0
- data/examples/icons/pattern.png +0 -0
- data/examples/icons/penguin.png +0 -0
- data/examples/icons/perspective.png +0 -0
- data/examples/icons/printicon.png +0 -0
- data/examples/icons/prop.png +0 -0
- data/examples/icons/redo.png +0 -0
- data/examples/icons/rightview.png +0 -0
- data/examples/icons/saveas.png +0 -0
- data/examples/icons/shutter1.png +0 -0
- data/examples/icons/shutter2.png +0 -0
- data/examples/icons/small.png +0 -0
- data/examples/icons/smoothlight.png +0 -0
- data/examples/icons/solid_line.png +0 -0
- data/examples/icons/tbuplevel.png +0 -0
- data/examples/icons/topview.png +0 -0
- data/examples/icons/undo.png +0 -0
- data/examples/icons/winapp.png +0 -0
- data/examples/icons/zoom.png +0 -0
- data/examples/image.rb +281 -0
- data/examples/imageviewer.rb +513 -0
- data/examples/inputs.rb +84 -0
- data/examples/mditest.rb +180 -0
- data/examples/pig.rb +77 -0
- data/examples/raabrowser.rb +132 -0
- data/examples/scintilla-test.rb +81 -0
- data/examples/scribble-orig.rb +186 -0
- data/examples/scribble.rb +166 -0
- data/examples/shutter.rb +158 -0
- data/examples/splitter.rb +211 -0
- data/examples/styledtext.rb +92 -0
- data/examples/tabbook.rb +124 -0
- data/examples/table.rb +187 -0
- data/examples/textedit/commands.rb +117 -0
- data/examples/textedit/helpwindow.rb +295 -0
- data/examples/textedit/prefdialog.rb +235 -0
- data/examples/textedit/textedit.rb +1767 -0
- data/ext/fox12/FXRbApp.cpp +127 -0
- data/ext/fox12/FXRbDataTarget.cpp +106 -0
- data/ext/fox12/FXRbGLViewer.cpp +89 -0
- data/ext/fox12/FXRuby.cpp +1818 -0
- data/ext/fox12/MANIFEST +189 -0
- data/ext/fox12/core_wrap.cpp +10119 -0
- data/ext/fox12/dc_wrap.cpp +2638 -0
- data/ext/fox12/dialogs_wrap.cpp +6244 -0
- data/ext/fox12/extconf.rb +176 -0
- data/ext/fox12/frames_wrap.cpp +8274 -0
- data/ext/fox12/fx3d_wrap.cpp +9315 -0
- data/ext/fox12/iconlist_wrap.cpp +3742 -0
- data/ext/fox12/icons_wrap.cpp +4040 -0
- data/ext/fox12/image_wrap.cpp +4026 -0
- data/ext/fox12/impl.cpp +1064 -0
- data/ext/fox12/include/FXMemoryBuffer.h +52 -0
- data/ext/fox12/include/FXRb4Splitter.h +54 -0
- data/ext/fox12/include/FXRbAccelTable.h +46 -0
- data/ext/fox12/include/FXRbApp.h +137 -0
- data/ext/fox12/include/FXRbAppVirtuals.h +15 -0
- data/ext/fox12/include/FXRbArrowButton.h +51 -0
- data/ext/fox12/include/FXRbBMPIcon.h +54 -0
- data/ext/fox12/include/FXRbBMPImage.h +54 -0
- data/ext/fox12/include/FXRbBitmap.h +115 -0
- data/ext/fox12/include/FXRbBitmapFrame.h +56 -0
- data/ext/fox12/include/FXRbBitmapView.h +52 -0
- data/ext/fox12/include/FXRbBitmapVirtuals.h +27 -0
- data/ext/fox12/include/FXRbButton.h +51 -0
- data/ext/fox12/include/FXRbCURCursor.h +60 -0
- data/ext/fox12/include/FXRbCanvas.h +51 -0
- data/ext/fox12/include/FXRbCheckButton.h +51 -0
- data/ext/fox12/include/FXRbColorBar.h +51 -0
- data/ext/fox12/include/FXRbColorDialog.h +53 -0
- data/ext/fox12/include/FXRbColorSelector.h +51 -0
- data/ext/fox12/include/FXRbColorWell.h +51 -0
- data/ext/fox12/include/FXRbColorWheel.h +51 -0
- data/ext/fox12/include/FXRbComboBox.h +56 -0
- data/ext/fox12/include/FXRbCommon.h +86 -0
- data/ext/fox12/include/FXRbComposite.h +51 -0
- data/ext/fox12/include/FXRbCursor.h +87 -0
- data/ext/fox12/include/FXRbCursorVirtuals.h +6 -0
- data/ext/fox12/include/FXRbDC.h +385 -0
- data/ext/fox12/include/FXRbDCPrint.h +49 -0
- data/ext/fox12/include/FXRbDCVirtuals.h +166 -0
- data/ext/fox12/include/FXRbDCWindow.h +64 -0
- data/ext/fox12/include/FXRbDataTarget.h +65 -0
- data/ext/fox12/include/FXRbDebugTarget.h +46 -0
- data/ext/fox12/include/FXRbDelegator.h +46 -0
- data/ext/fox12/include/FXRbDial.h +51 -0
- data/ext/fox12/include/FXRbDialogBox.h +68 -0
- data/ext/fox12/include/FXRbDialogBoxVirtuals.h +3 -0
- data/ext/fox12/include/FXRbDict.h +46 -0
- data/ext/fox12/include/FXRbDirBox.h +51 -0
- data/ext/fox12/include/FXRbDirDialog.h +53 -0
- data/ext/fox12/include/FXRbDirList.h +79 -0
- data/ext/fox12/include/FXRbDirSelector.h +51 -0
- data/ext/fox12/include/FXRbDocument.h +46 -0
- data/ext/fox12/include/FXRbDragCorner.h +51 -0
- data/ext/fox12/include/FXRbDrawable.h +64 -0
- data/ext/fox12/include/FXRbDrawableVirtuals.h +3 -0
- data/ext/fox12/include/FXRbDriveBox.h +51 -0
- data/ext/fox12/include/FXRbFileDialog.h +56 -0
- data/ext/fox12/include/FXRbFileDict.h +104 -0
- data/ext/fox12/include/FXRbFileDictVirtuals.h +9 -0
- data/ext/fox12/include/FXRbFileList.h +81 -0
- data/ext/fox12/include/FXRbFileSelector.h +51 -0
- data/ext/fox12/include/FXRbFoldingItemVirtuals.h +45 -0
- data/ext/fox12/include/FXRbFoldingList.h +183 -0
- data/ext/fox12/include/FXRbFont.h +70 -0
- data/ext/fox12/include/FXRbFontDialog.h +53 -0
- data/ext/fox12/include/FXRbFontSelector.h +51 -0
- data/ext/fox12/include/FXRbFrame.h +51 -0
- data/ext/fox12/include/FXRbGIFCursor.h +60 -0
- data/ext/fox12/include/FXRbGIFIcon.h +54 -0
- data/ext/fox12/include/FXRbGIFImage.h +54 -0
- data/ext/fox12/include/FXRbGLCanvas.h +92 -0
- data/ext/fox12/include/FXRbGLCanvasVirtuals.h +13 -0
- data/ext/fox12/include/FXRbGLContext.h +58 -0
- data/ext/fox12/include/FXRbGLObject.h +103 -0
- data/ext/fox12/include/FXRbGLObjectVirtuals.h +22 -0
- data/ext/fox12/include/FXRbGLShape.h +81 -0
- data/ext/fox12/include/FXRbGLShapeVirtuals.h +8 -0
- data/ext/fox12/include/FXRbGLViewer.h +83 -0
- data/ext/fox12/include/FXRbGLViewerVirtuals.h +6 -0
- data/ext/fox12/include/FXRbGLVisual.h +56 -0
- data/ext/fox12/include/FXRbGradientBar.h +55 -0
- data/ext/fox12/include/FXRbGroupBox.h +51 -0
- data/ext/fox12/include/FXRbHeader.h +125 -0
- data/ext/fox12/include/FXRbHeaderItemVirtuals.h +22 -0
- data/ext/fox12/include/FXRbHorizontalFrame.h +51 -0
- data/ext/fox12/include/FXRbICOIcon.h +54 -0
- data/ext/fox12/include/FXRbICOImage.h +54 -0
- data/ext/fox12/include/FXRbIcon.h +57 -0
- data/ext/fox12/include/FXRbIconItemVirtuals.h +71 -0
- data/ext/fox12/include/FXRbIconList.h +266 -0
- data/ext/fox12/include/FXRbIconListVirtuals.h +21 -0
- data/ext/fox12/include/FXRbId.h +74 -0
- data/ext/fox12/include/FXRbIdVirtuals.h +9 -0
- data/ext/fox12/include/FXRbImage.h +162 -0
- data/ext/fox12/include/FXRbImageFrame.h +56 -0
- data/ext/fox12/include/FXRbImageView.h +52 -0
- data/ext/fox12/include/FXRbImageVirtuals.h +51 -0
- data/ext/fox12/include/FXRbInputDialog.h +53 -0
- data/ext/fox12/include/FXRbJPGIcon.h +54 -0
- data/ext/fox12/include/FXRbJPGImage.h +54 -0
- data/ext/fox12/include/FXRbLabel.h +51 -0
- data/ext/fox12/include/FXRbList.h +204 -0
- data/ext/fox12/include/FXRbListBox.h +56 -0
- data/ext/fox12/include/FXRbListItemVirtuals.h +36 -0
- data/ext/fox12/include/FXRbListVirtuals.h +18 -0
- data/ext/fox12/include/FXRbMDIButton.h +162 -0
- data/ext/fox12/include/FXRbMDIChild.h +82 -0
- data/ext/fox12/include/FXRbMDIChildVirtuals.h +12 -0
- data/ext/fox12/include/FXRbMDIClient.h +80 -0
- data/ext/fox12/include/FXRbMDIClientVirtuals.h +12 -0
- data/ext/fox12/include/FXRbMainWindow.h +54 -0
- data/ext/fox12/include/FXRbMatrix.h +51 -0
- data/ext/fox12/include/FXRbMenuBar.h +63 -0
- data/ext/fox12/include/FXRbMenuButton.h +51 -0
- data/ext/fox12/include/FXRbMenuCaption.h +51 -0
- data/ext/fox12/include/FXRbMenuCascade.h +51 -0
- data/ext/fox12/include/FXRbMenuCheck.h +49 -0
- data/ext/fox12/include/FXRbMenuCommand.h +49 -0
- data/ext/fox12/include/FXRbMenuPane.h +52 -0
- data/ext/fox12/include/FXRbMenuRadio.h +49 -0
- data/ext/fox12/include/FXRbMenuSeparator.h +51 -0
- data/ext/fox12/include/FXRbMenuTitle.h +51 -0
- data/ext/fox12/include/FXRbMessageBox.h +56 -0
- data/ext/fox12/include/FXRbObject.h +67 -0
- data/ext/fox12/include/FXRbObjectVirtuals.h +9 -0
- data/ext/fox12/include/FXRbOptionMenu.h +73 -0
- data/ext/fox12/include/FXRbPCXIcon.h +54 -0
- data/ext/fox12/include/FXRbPCXImage.h +54 -0
- data/ext/fox12/include/FXRbPNGIcon.h +54 -0
- data/ext/fox12/include/FXRbPNGImage.h +54 -0
- data/ext/fox12/include/FXRbPPMIcon.h +54 -0
- data/ext/fox12/include/FXRbPPMImage.h +54 -0
- data/ext/fox12/include/FXRbPacker.h +51 -0
- data/ext/fox12/include/FXRbPicker.h +51 -0
- data/ext/fox12/include/FXRbPopup.h +70 -0
- data/ext/fox12/include/FXRbPopupVirtuals.h +6 -0
- data/ext/fox12/include/FXRbPrintDialog.h +53 -0
- data/ext/fox12/include/FXRbProgressBar.h +51 -0
- data/ext/fox12/include/FXRbProgressDialog.h +53 -0
- data/ext/fox12/include/FXRbRGBIcon.h +54 -0
- data/ext/fox12/include/FXRbRGBImage.h +54 -0
- data/ext/fox12/include/FXRbRadioButton.h +51 -0
- data/ext/fox12/include/FXRbRealSlider.h +51 -0
- data/ext/fox12/include/FXRbRealSpinner.h +64 -0
- data/ext/fox12/include/FXRbRealSpinnerVirtuals.h +3 -0
- data/ext/fox12/include/FXRbRecentFiles.h +49 -0
- data/ext/fox12/include/FXRbRegistry.h +46 -0
- data/ext/fox12/include/FXRbReplaceDialog.h +53 -0
- data/ext/fox12/include/FXRbRootWindow.h +51 -0
- data/ext/fox12/include/FXRbRuler.h +56 -0
- data/ext/fox12/include/FXRbScintilla.h +52 -0
- data/ext/fox12/include/FXRbScrollArea.h +82 -0
- data/ext/fox12/include/FXRbScrollAreaVirtuals.h +13 -0
- data/ext/fox12/include/FXRbScrollBar.h +73 -0
- data/ext/fox12/include/FXRbScrollPane.h +52 -0
- data/ext/fox12/include/FXRbScrollWindow.h +52 -0
- data/ext/fox12/include/FXRbSearchDialog.h +53 -0
- data/ext/fox12/include/FXRbSeparator.h +95 -0
- data/ext/fox12/include/FXRbSettings.h +46 -0
- data/ext/fox12/include/FXRbShell.h +56 -0
- data/ext/fox12/include/FXRbShutter.h +86 -0
- data/ext/fox12/include/FXRbShutterVirtuals.h +3 -0
- data/ext/fox12/include/FXRbSlider.h +51 -0
- data/ext/fox12/include/FXRbSpinner.h +64 -0
- data/ext/fox12/include/FXRbSpinnerVirtuals.h +3 -0
- data/ext/fox12/include/FXRbSplitter.h +54 -0
- data/ext/fox12/include/FXRbSpring.h +51 -0
- data/ext/fox12/include/FXRbStatusBar.h +51 -0
- data/ext/fox12/include/FXRbStatusLine.h +51 -0
- data/ext/fox12/include/FXRbStream.h +101 -0
- data/ext/fox12/include/FXRbStreamVirtuals.h +9 -0
- data/ext/fox12/include/FXRbStringDict.h +46 -0
- data/ext/fox12/include/FXRbSwitcher.h +51 -0
- data/ext/fox12/include/FXRbTGAIcon.h +54 -0
- data/ext/fox12/include/FXRbTGAImage.h +54 -0
- data/ext/fox12/include/FXRbTIFIcon.h +54 -0
- data/ext/fox12/include/FXRbTIFImage.h +54 -0
- data/ext/fox12/include/FXRbTabBar.h +64 -0
- data/ext/fox12/include/FXRbTabBarVirtuals.h +3 -0
- data/ext/fox12/include/FXRbTabBook.h +52 -0
- data/ext/fox12/include/FXRbTabItem.h +51 -0
- data/ext/fox12/include/FXRbTable.h +416 -0
- data/ext/fox12/include/FXRbTableItemVirtuals.h +68 -0
- data/ext/fox12/include/FXRbTableVirtuals.h +73 -0
- data/ext/fox12/include/FXRbText.h +89 -0
- data/ext/fox12/include/FXRbTextField.h +51 -0
- data/ext/fox12/include/FXRbTextVirtuals.h +9 -0
- data/ext/fox12/include/FXRbToggleButton.h +51 -0
- data/ext/fox12/include/FXRbToolBar.h +80 -0
- data/ext/fox12/include/FXRbToolBarGrip.h +51 -0
- data/ext/fox12/include/FXRbToolBarShell.h +52 -0
- data/ext/fox12/include/FXRbToolBarTab.h +51 -0
- data/ext/fox12/include/FXRbToolBarVirtuals.h +6 -0
- data/ext/fox12/include/FXRbToolTip.h +51 -0
- data/ext/fox12/include/FXRbTopWindow.h +91 -0
- data/ext/fox12/include/FXRbTopWindowVirtuals.h +15 -0
- data/ext/fox12/include/FXRbTreeItemVirtuals.h +42 -0
- data/ext/fox12/include/FXRbTreeList.h +249 -0
- data/ext/fox12/include/FXRbTreeListBox.h +53 -0
- data/ext/fox12/include/FXRbTreeListVirtuals.h +30 -0
- data/ext/fox12/include/FXRbTriStateButton.h +51 -0
- data/ext/fox12/include/FXRbVerticalFrame.h +51 -0
- data/ext/fox12/include/FXRbVisual.h +56 -0
- data/ext/fox12/include/FXRbWindow.h +200 -0
- data/ext/fox12/include/FXRbWindowVirtuals.h +69 -0
- data/ext/fox12/include/FXRbWizard.h +60 -0
- data/ext/fox12/include/FXRbXBMIcon.h +54 -0
- data/ext/fox12/include/FXRbXBMImage.h +54 -0
- data/ext/fox12/include/FXRbXPMIcon.h +54 -0
- data/ext/fox12/include/FXRbXPMImage.h +54 -0
- data/ext/fox12/include/FXRuby.h +728 -0
- data/ext/fox12/include/impl.h +201 -0
- data/ext/fox12/include/inlinestubs.h +1063 -0
- data/ext/fox12/label_wrap.cpp +4945 -0
- data/ext/fox12/layout_wrap.cpp +5061 -0
- data/ext/fox12/librb.c +636 -0
- data/ext/fox12/list_wrap.cpp +2212 -0
- data/ext/fox12/markfuncs.cpp +1568 -0
- data/ext/fox12/mdi_wrap.cpp +4521 -0
- data/ext/fox12/menu_wrap.cpp +4673 -0
- data/ext/fox12/scintilla_wrap.cpp +2245 -0
- data/ext/fox12/table_wrap.cpp +3581 -0
- data/ext/fox12/text_wrap.cpp +3539 -0
- data/ext/fox12/treelist_wrap.cpp +5609 -0
- data/ext/fox12/ui_wrap.cpp +10017 -0
- data/index.html +14 -0
- data/lib/fox12/aliases.rb +5211 -0
- data/lib/fox12/calendar.rb +218 -0
- data/lib/fox12/chore.rb +51 -0
- data/lib/fox12/colors.rb +282 -0
- data/lib/fox12/core.rb +249 -0
- data/lib/fox12/dict.rb +35 -0
- data/lib/fox12/glgroup.rb +165 -0
- data/lib/fox12/glshapes.rb +457 -0
- data/lib/fox12/input.rb +56 -0
- data/lib/fox12/irb.rb +179 -0
- data/lib/fox12/iterators.rb +331 -0
- data/lib/fox12/keys.rb +1376 -0
- data/lib/fox12/missingdep.rb +16 -0
- data/lib/fox12/pseudokeyboard.rb +36 -0
- data/lib/fox12/pseudomouse.rb +84 -0
- data/lib/fox12/responder.rb +72 -0
- data/lib/fox12/responder2.rb +122 -0
- data/lib/fox12/scintilla.rb +2629 -0
- data/lib/fox12/settings.rb +18 -0
- data/lib/fox12/signal.rb +68 -0
- data/lib/fox12/timeout.rb +58 -0
- data/lib/fox12/undolist.rb +456 -0
- data/lib/fox12/version.rb +11 -0
- data/rdoc-sources/FX4Splitter.rb +138 -0
- data/rdoc-sources/FXAccelTable.rb +67 -0
- data/rdoc-sources/FXApp.rb +557 -0
- data/rdoc-sources/FXArrowButton.rb +69 -0
- data/rdoc-sources/FXBMPIcon.rb +45 -0
- data/rdoc-sources/FXBMPImage.rb +20 -0
- data/rdoc-sources/FXBitmap.rb +78 -0
- data/rdoc-sources/FXBitmapFrame.rb +29 -0
- data/rdoc-sources/FXBitmapView.rb +41 -0
- data/rdoc-sources/FXButton.rb +43 -0
- data/rdoc-sources/FXCURCursor.rb +13 -0
- data/rdoc-sources/FXCanvas.rb +18 -0
- data/rdoc-sources/FXCheckButton.rb +57 -0
- data/rdoc-sources/FXColorBar.rb +43 -0
- data/rdoc-sources/FXColorDialog.rb +36 -0
- data/rdoc-sources/FXColorSelector.rb +65 -0
- data/rdoc-sources/FXColorWell.rb +57 -0
- data/rdoc-sources/FXColorWheel.rb +35 -0
- data/rdoc-sources/FXComboBox.rb +153 -0
- data/rdoc-sources/FXComposite.rb +34 -0
- data/rdoc-sources/FXCursor.rb +67 -0
- data/rdoc-sources/FXDC.rb +667 -0
- data/rdoc-sources/FXDCPrint.rb +127 -0
- data/rdoc-sources/FXDCWindow.rb +37 -0
- data/rdoc-sources/FXDataTarget.rb +41 -0
- data/rdoc-sources/FXDebugTarget.rb +25 -0
- data/rdoc-sources/FXDelegator.rb +23 -0
- data/rdoc-sources/FXDial.rb +68 -0
- data/rdoc-sources/FXDialogBox.rb +36 -0
- data/rdoc-sources/FXDict.rb +79 -0
- data/rdoc-sources/FXDirBox.rb +49 -0
- data/rdoc-sources/FXDirDialog.rb +18 -0
- data/rdoc-sources/FXDirList.rb +143 -0
- data/rdoc-sources/FXDirSelector.rb +30 -0
- data/rdoc-sources/FXDocument.rb +29 -0
- data/rdoc-sources/FXDragCorner.rb +19 -0
- data/rdoc-sources/FXDrawable.rb +27 -0
- data/rdoc-sources/FXDriveBox.rb +46 -0
- data/rdoc-sources/FXFileDialog.rb +132 -0
- data/rdoc-sources/FXFileDict.rb +168 -0
- data/rdoc-sources/FXFileList.rb +163 -0
- data/rdoc-sources/FXFileSelector.rb +148 -0
- data/rdoc-sources/FXFileStream.rb +24 -0
- data/rdoc-sources/FXFoldingList.rb +453 -0
- data/rdoc-sources/FXFont.rb +345 -0
- data/rdoc-sources/FXFontDialog.rb +14 -0
- data/rdoc-sources/FXFontSelector.rb +37 -0
- data/rdoc-sources/FXFrame.rb +47 -0
- data/rdoc-sources/FXGIFCursor.rb +38 -0
- data/rdoc-sources/FXGIFIcon.rb +21 -0
- data/rdoc-sources/FXGIFImage.rb +19 -0
- data/rdoc-sources/FXGLCanvas.rb +45 -0
- data/rdoc-sources/FXGLContext.rb +41 -0
- data/rdoc-sources/FXGLObject.rb +75 -0
- data/rdoc-sources/FXGLShape.rb +75 -0
- data/rdoc-sources/FXGLViewer.rb +309 -0
- data/rdoc-sources/FXGLVisual.rb +94 -0
- data/rdoc-sources/FXGradientBar.rb +291 -0
- data/rdoc-sources/FXGroupBox.rb +33 -0
- data/rdoc-sources/FXHeader.rb +377 -0
- data/rdoc-sources/FXHorizontalFrame.rb +29 -0
- data/rdoc-sources/FXICOIcon.rb +50 -0
- data/rdoc-sources/FXICOImage.rb +21 -0
- data/rdoc-sources/FXIcon.rb +38 -0
- data/rdoc-sources/FXIconList.rb +418 -0
- data/rdoc-sources/FXId.rb +34 -0
- data/rdoc-sources/FXImage.rb +198 -0
- data/rdoc-sources/FXImageFrame.rb +22 -0
- data/rdoc-sources/FXImageView.rb +35 -0
- data/rdoc-sources/FXInputDialog.rb +62 -0
- data/rdoc-sources/FXJPGIcon.rb +52 -0
- data/rdoc-sources/FXJPGImage.rb +25 -0
- data/rdoc-sources/FXLabel.rb +66 -0
- data/rdoc-sources/FXList.rb +412 -0
- data/rdoc-sources/FXListBox.rb +158 -0
- data/rdoc-sources/FXMDIButton.rb +67 -0
- data/rdoc-sources/FXMDIChild.rb +145 -0
- data/rdoc-sources/FXMDIClient.rb +67 -0
- data/rdoc-sources/FXMainWindow.rb +20 -0
- data/rdoc-sources/FXMat4.rb +171 -0
- data/rdoc-sources/FXMatrix.rb +57 -0
- data/rdoc-sources/FXMemoryBuffer.rb +19 -0
- data/rdoc-sources/FXMemoryStream.rb +45 -0
- data/rdoc-sources/FXMenuBar.rb +23 -0
- data/rdoc-sources/FXMenuButton.rb +84 -0
- data/rdoc-sources/FXMenuCaption.rb +47 -0
- data/rdoc-sources/FXMenuCascade.rb +18 -0
- data/rdoc-sources/FXMenuCheck.rb +30 -0
- data/rdoc-sources/FXMenuCommand.rb +27 -0
- data/rdoc-sources/FXMenuPane.rb +13 -0
- data/rdoc-sources/FXMenuRadio.rb +30 -0
- data/rdoc-sources/FXMenuSeparator.rb +21 -0
- data/rdoc-sources/FXMenuTitle.rb +27 -0
- data/rdoc-sources/FXMessageBox.rb +77 -0
- data/rdoc-sources/FXObject.rb +22 -0
- data/rdoc-sources/FXOptionMenu.rb +76 -0
- data/rdoc-sources/FXPCXIcon.rb +48 -0
- data/rdoc-sources/FXPCXImage.rb +21 -0
- data/rdoc-sources/FXPNGIcon.rb +48 -0
- data/rdoc-sources/FXPNGImage.rb +21 -0
- data/rdoc-sources/FXPPMIcon.rb +21 -0
- data/rdoc-sources/FXPPMImage.rb +21 -0
- data/rdoc-sources/FXPacker.rb +62 -0
- data/rdoc-sources/FXPicker.rb +27 -0
- data/rdoc-sources/FXPopup.rb +53 -0
- data/rdoc-sources/FXPrintDialog.rb +36 -0
- data/rdoc-sources/FXProgressBar.rb +57 -0
- data/rdoc-sources/FXProgressDialog.rb +36 -0
- data/rdoc-sources/FXQuatd.rb +1 -0
- data/rdoc-sources/FXQuatf.rb +1 -0
- data/rdoc-sources/FXRGBIcon.rb +49 -0
- data/rdoc-sources/FXRGBImage.rb +21 -0
- data/rdoc-sources/FXRadioButton.rb +64 -0
- data/rdoc-sources/FXRanged.rb +97 -0
- data/rdoc-sources/FXRangef.rb +97 -0
- data/rdoc-sources/FXRealSlider.rb +99 -0
- data/rdoc-sources/FXRealSpinner.rb +133 -0
- data/rdoc-sources/FXRecentFiles.rb +73 -0
- data/rdoc-sources/FXRectangle.rb +137 -0
- data/rdoc-sources/FXRegion.rb +64 -0
- data/rdoc-sources/FXRegistry.rb +39 -0
- data/rdoc-sources/FXReplaceDialog.rb +56 -0
- data/rdoc-sources/FXRootWindow.rb +17 -0
- data/rdoc-sources/FXRuler.rb +60 -0
- data/rdoc-sources/FXScintilla.rb +121 -0
- data/rdoc-sources/FXScrollArea.rb +86 -0
- data/rdoc-sources/FXScrollBar.rb +101 -0
- data/rdoc-sources/FXScrollPane.rb +23 -0
- data/rdoc-sources/FXScrollWindow.rb +38 -0
- data/rdoc-sources/FXSearchDialog.rb +24 -0
- data/rdoc-sources/FXSeparator.rb +64 -0
- data/rdoc-sources/FXSettings.rb +222 -0
- data/rdoc-sources/FXShell.rb +7 -0
- data/rdoc-sources/FXShutter.rb +97 -0
- data/rdoc-sources/FXSize.rb +30 -0
- data/rdoc-sources/FXSlider.rb +96 -0
- data/rdoc-sources/FXSphered.rb +65 -0
- data/rdoc-sources/FXSpheref.rb +65 -0
- data/rdoc-sources/FXSpinner.rb +132 -0
- data/rdoc-sources/FXSplitter.rb +88 -0
- data/rdoc-sources/FXSpring.rb +61 -0
- data/rdoc-sources/FXStatusBar.rb +42 -0
- data/rdoc-sources/FXStatusLine.rb +60 -0
- data/rdoc-sources/FXStream.rb +115 -0
- data/rdoc-sources/FXStringDict.rb +38 -0
- data/rdoc-sources/FXSwitcher.rb +78 -0
- data/rdoc-sources/FXTGAIcon.rb +48 -0
- data/rdoc-sources/FXTGAImage.rb +21 -0
- data/rdoc-sources/FXTIFIcon.rb +52 -0
- data/rdoc-sources/FXTIFImage.rb +24 -0
- data/rdoc-sources/FXTabBar.rb +76 -0
- data/rdoc-sources/FXTabBook.rb +38 -0
- data/rdoc-sources/FXTabItem.rb +51 -0
- data/rdoc-sources/FXTable.rb +654 -0
- data/rdoc-sources/FXText.rb +533 -0
- data/rdoc-sources/FXTextField.rb +141 -0
- data/rdoc-sources/FXToggleButton.rb +69 -0
- data/rdoc-sources/FXToolBar.rb +121 -0
- data/rdoc-sources/FXToolBarGrip.rb +55 -0
- data/rdoc-sources/FXToolBarShell.rb +44 -0
- data/rdoc-sources/FXToolTip.rb +36 -0
- data/rdoc-sources/FXTopWindow.rb +92 -0
- data/rdoc-sources/FXTreeList.rb +503 -0
- data/rdoc-sources/FXTreeListBox.rb +182 -0
- data/rdoc-sources/FXTriStateButton.rb +49 -0
- data/rdoc-sources/FXVec.rb +97 -0
- data/rdoc-sources/FXVec4.rb +91 -0
- data/rdoc-sources/FXVerticalFrame.rb +29 -0
- data/rdoc-sources/FXVisual.rb +79 -0
- data/rdoc-sources/FXWindow.rb +633 -0
- data/rdoc-sources/FXWizard.rb +63 -0
- data/rdoc-sources/FXXBMIcon.rb +22 -0
- data/rdoc-sources/FXXBMImage.rb +22 -0
- data/rdoc-sources/FXXPMIcon.rb +50 -0
- data/rdoc-sources/FXXPMImage.rb +21 -0
- data/rdoc-sources/README.rdoc +53 -0
- data/rdoc-sources/fxdefs.rb +90 -0
- data/tests/README +19 -0
- data/tests/TC_FXAccelTable.rb +43 -0
- data/tests/TC_FXApp.rb +15 -0
- data/tests/TC_FXArc.rb +26 -0
- data/tests/TC_FXButton.rb +72 -0
- data/tests/TC_FXCheckButton.rb +57 -0
- data/tests/TC_FXComboBox.rb +36 -0
- data/tests/TC_FXDC.rb +372 -0
- data/tests/TC_FXDCPrint.rb +102 -0
- data/tests/TC_FXDCWindow.rb +23 -0
- data/tests/TC_FXDataTarget.rb +24 -0
- data/tests/TC_FXDirList.rb +30 -0
- data/tests/TC_FXFileAssoc.rb +62 -0
- data/tests/TC_FXFileStream.rb +90 -0
- data/tests/TC_FXFont.rb +59 -0
- data/tests/TC_FXFontDesc.rb +62 -0
- data/tests/TC_FXGLGroup.rb +32 -0
- data/tests/TC_FXGLShape.rb +28 -0
- data/tests/TC_FXGLViewer.rb +18 -0
- data/tests/TC_FXGradientBar.rb +89 -0
- data/tests/TC_FXHeader.rb +82 -0
- data/tests/TC_FXIconDict.rb +52 -0
- data/tests/TC_FXIconList.rb +192 -0
- data/tests/TC_FXId.rb +19 -0
- data/tests/TC_FXImage.rb +144 -0
- data/tests/TC_FXLight.rb +33 -0
- data/tests/TC_FXList.rb +116 -0
- data/tests/TC_FXListBox.rb +49 -0
- data/tests/TC_FXMat4f.rb +228 -0
- data/tests/TC_FXMaterial.rb +75 -0
- data/tests/TC_FXMemoryStream.rb +87 -0
- data/tests/TC_FXMenuCommand.rb +26 -0
- data/tests/TC_FXPoint.rb +57 -0
- data/tests/TC_FXQuatf.rb +77 -0
- data/tests/TC_FXRadioButton.rb +57 -0
- data/tests/TC_FXRangef.rb +48 -0
- data/tests/TC_FXRectangle.rb +88 -0
- data/tests/TC_FXRegion.rb +54 -0
- data/tests/TC_FXRegistry.rb +27 -0
- data/tests/TC_FXScrollArea.rb +28 -0
- data/tests/TC_FXScrollWindow.rb +28 -0
- data/tests/TC_FXSegment.rb +22 -0
- data/tests/TC_FXShell.rb +26 -0
- data/tests/TC_FXSize.rb +54 -0
- data/tests/TC_FXStream.rb +11 -0
- data/tests/TC_FXTable.rb +468 -0
- data/tests/TC_FXTableItem.rb +48 -0
- data/tests/TC_FXText.rb +81 -0
- data/tests/TC_FXTopWindow.rb +32 -0
- data/tests/TC_FXTreeList.rb +83 -0
- data/tests/TC_FXTreeListBox.rb +23 -0
- data/tests/TC_FXUndoList.rb +43 -0
- data/tests/TC_FXVec2d.rb +142 -0
- data/tests/TC_FXVec2f.rb +137 -0
- data/tests/TC_FXVec3d.rb +150 -0
- data/tests/TC_FXVec3f.rb +150 -0
- data/tests/TC_FXVec4f.rb +158 -0
- data/tests/TC_FXViewport.rb +30 -0
- data/tests/TC_Misc.rb +157 -0
- data/tests/TC_downcast.rb +15 -0
- data/tests/TS_All.rb +25 -0
- data/tests/blankpage.ps +166 -0
- data/tests/doit.rb +5 -0
- data/tests/howdypage.ps +181 -0
- data/tests/stress1.rb +94 -0
- data/tests/stress2.rb +51 -0
- data/tests/stress3.rb +117 -0
- data/tests/testcase.rb +38 -0
- data/web/art/fxrubylogo.png +0 -0
- data/web/art/fxrubylogo_small.png +0 -0
- data/web/art/line.gif +0 -0
- data/web/art/oul_grey.gif +0 -0
- data/web/art/our.gif +0 -0
- data/web/downloads.html +91 -0
- data/web/home.html +109 -0
- data/web/menu.html +50 -0
- data/web/styles.css +167 -0
- data/web/top.html +15 -0
- metadata +737 -0
data/doc/changes.html
ADDED
@@ -0,0 +1,75 @@
|
|
1
|
+
<html><head>
|
2
|
+
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
3
|
+
<title>Chapter 10. Change History</title><meta name="generator" content="DocBook XSL Stylesheets V1.61.2"><link rel="home" href="book.html" title="Developing Graphical User Interfaces with FXRuby"><link rel="up" href="pt01.html" title="Part I. The Basics"><link rel="previous" href="infosources.html" title="Chapter 9. Other Sources of Information"><link rel="next" href="pt02.html" title="Part II. Appendices"></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 10. Change History</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="infosources.html">Prev</a> </td><th width="60%" align="center">Part I. The Basics</th><td width="20%" align="right"> <a accesskey="n" href="pt02.html">Next</a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="changes"></a>Chapter 10. Change History</h2></div></div><div></div></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e2403"></a>Changes For Version 1.2.2 (October 1, 2004)</h2></div></div><div></div></div><div class="itemizedlist"><ul type="bullet"><li style="list-style-type: disc"><p>In order to avoid versioning problems when dealing with a mix of
|
4
|
+
applications based on either FXRuby 1.0 or 1.2, the feature name for
|
5
|
+
FXRuby has been changed from "fox" to "fox12". For most application
|
6
|
+
developers, this means that you will need to modify the source code
|
7
|
+
for applications targeted at FXRuby 1.2 to begin with the line</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">require 'fox12'</pre></td></tr></table><p>Note that no
|
8
|
+
changes should be required for legacy applications targeted at FXRuby
|
9
|
+
1.0.</p></li><li style="list-style-type: disc"><p>Made a number of updates to the documentation, to reflect API
|
10
|
+
changes for FXRuby 1.2.</p></li><li style="list-style-type: disc"><p>The binary gem for Windows was built with FOX version 1.2.9 and
|
11
|
+
FXScintilla version 1.61.</p></li></ul></div></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e2420"></a>Changes For Version 1.2a2 (July 10, 2004)</h2></div></div><div></div></div><div class="itemizedlist"><ul type="bullet"><li style="list-style-type: disc"><p>This is the second "alpha" release of FXRuby 1.2. This release
|
12
|
+
should be compatible with any FOX library version 1.2; it is not
|
13
|
+
compatible with any previous FOX library versions. As this is an alpha
|
14
|
+
release, users should expect a certain amount of instability, bugs,
|
15
|
+
etc.</p></li><li style="list-style-type: disc"><p>For this release, all of the FOX 1.2 classes are available with
|
16
|
+
the exception of the <tt class="classname">FXBitmapView</tt> class. There
|
17
|
+
is a small problem with how the <tt class="classname">FXBitmapView</tt>
|
18
|
+
class is declared in the FOX 1.2 header files, and I'm trying to
|
19
|
+
decide how best to resolve that problem. The goal is to have this
|
20
|
+
problem resolved by the next alpha release of FXRuby.</p></li><li style="list-style-type: disc"><p>For this release, all of the RDoc-based online documentation has
|
21
|
+
been brought up to date with the new APIs.</p></li><li style="list-style-type: disc"><p>Portions of the FXRuby User's Guide were still out of date with
|
22
|
+
respect to the new APIs (see <a href="http://sourceforge.net/tracker/index.php?func=detail&aid=988623&group_id=20243&atid=120243" target="_top">SourceForge
|
23
|
+
Bug #988623</a>). This has been fixed.</p></li><li style="list-style-type: disc"><p>The <tt class="filename">mditest.rb</tt> example program was not up
|
24
|
+
to date with the new APIs. This has been fixed.</p></li><li style="list-style-type: disc"><p>The <tt class="filename">glviewer.rb</tt> example program was not up
|
25
|
+
to date with the new APIs (see <a href="http://sourceforge.net/tracker/index.php?func=detail&aid=986479&group_id=20243&atid=120243" target="_top">SourceForge
|
26
|
+
Bug #986479</a>). This has been fixed. Thanks to Remy Drouilhet
|
27
|
+
for reporting this problem and suggesting the fixes.</p></li><li style="list-style-type: disc"><p>The <tt class="methodname">FXGLGroup#bounds</tt> method was defined
|
28
|
+
incorrectly (see <a href="http://sourceforge.net/tracker/index.php?func=detail&aid=986476&group_id=20243&atid=120243" target="_top">SourceForge
|
29
|
+
Bug #986476</a>). This has been fixed. Thanks to Remy Drouilhet
|
30
|
+
for reporting this problem and suggesting the fix.</p></li><li style="list-style-type: disc"><p>The <tt class="filename">scintilla-test.rb</tt> example program was
|
31
|
+
not up to date with the new APIs (see <a href="http://sourceforge.net/tracker/index.php?func=detail&aid=986172&group_id=20243&atid=120243" target="_top">SourceForge
|
32
|
+
Bug #986172</a>). This has been fixed. Thanks to Peter Watkins for
|
33
|
+
reporting this problem and submitting a corrected version of the
|
34
|
+
program.</p></li><li style="list-style-type: disc"><p>There was a small typo in the table.rb example program (see
|
35
|
+
<a href="http://sourceforge.net/tracker/index.php?func=detail&aid=988152&group_id=20243&atid=120243" target="_top">SourceForge
|
36
|
+
Bug #988152</a>). This has been fixed. Thanks to Jamey Cribbs for
|
37
|
+
reporting this problem and suggesting the fix.</p></li><li style="list-style-type: disc"><p>Due to an oversight on my part, one of the overloaded
|
38
|
+
constructors for the <tt class="classname">FXRegion</tt> class wasn't
|
39
|
+
wrapped properly (see <a href="http://sourceforge.net/tracker/index.php?func=detail&aid=986181&group_id=20243&atid=120243" target="_top">SourceForge
|
40
|
+
Bug #986181</a>). This has been fixed. Thanks to Bil Bas for
|
41
|
+
reporting this problem.</p></li><li style="list-style-type: disc"><p>Removed some obsolete aliases for the old leading and trailing
|
42
|
+
rows and columns for the <tt class="classname">FXTable</tt> class (see
|
43
|
+
<a href="http://sourceforge.net/tracker/index.php?func=detail&aid=986181&group_id=20243&atid=120243" target="_top">SourceForge
|
44
|
+
Bug #988038</a>). Thanks to Yuri Leikind for reporting this
|
45
|
+
problem.</p></li><li style="list-style-type: disc"><p>Added <tt class="classname">FXTable</tt> instance methods
|
46
|
+
<tt class="methodname">horizontalGridShown=()</tt> and
|
47
|
+
<tt class="methodname">verticalGridShown=()</tt> to complement the
|
48
|
+
already available <tt class="methodname">horizontalGridShown?</tt> and
|
49
|
+
<tt class="methodname">verticalGridShown?</tt> methods.</p></li><li style="list-style-type: disc"><p>The binary gem for the 1.2a1 release on Windows didn't have PNG
|
50
|
+
or JPEG image support built-in (see <a href="http://sourceforge.net/tracker/index.php?func=detail&aid=986180&group_id=20243&atid=120243" target="_top">SourceForge
|
51
|
+
Bug #986180</a>). This has been fixed. Thanks to Bil Bas for
|
52
|
+
reporting this problem.</p></li><li style="list-style-type: disc"><p>The binary gem for Windows was built with FOX version 1.2.7 and
|
53
|
+
FXScintilla version 1.61.</p></li></ul></div></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e2529"></a>Changes For Version 1.2a1 (June 28, 2004)</h2></div></div><div></div></div><div class="itemizedlist"><ul type="bullet"><li style="list-style-type: disc"><p>This is the first "alpha" release of FXRuby 1.2. This release
|
54
|
+
should be compatible with any FOX library version 1.2; it is not
|
55
|
+
compatible with any previous FOX library versions. As this is an alpha
|
56
|
+
release, users should expect a certain amount of instability, bugs,
|
57
|
+
etc.</p><p>The intent of this first alpha release is twofold. The primary
|
58
|
+
intent is allow application developers who have current projects based
|
59
|
+
on FXRuby 1.0 to begin the process of updating their applications for
|
60
|
+
compatibility with FXRuby 1.2. For this release, all of the classes
|
61
|
+
that existed in FXRuby 1.0 have been updated for compatibility with
|
62
|
+
FOX 1.2, and so developers should at least be able to begin to "port"
|
63
|
+
their applications forward now. Note that there have been a number of
|
64
|
+
changes for FOX 1.2 and FXRuby 1.2, both in terms of API changes and
|
65
|
+
less obvious "behavioral" changes. For a detailed summary of these
|
66
|
+
changes, please see <a href="http://www.knology.net/~lyle/fox/1.2/WhatsNew.html" target="_top">"What's New
|
67
|
+
in FOX 1.2"</a> (also available as a <a href="http://www.knology.net/~lyle/fox/1.2/WhatsNew.pdf" target="_top">PDF</a>).
|
68
|
+
Note that few, if any, of the new classes introduced in FOX 1.2 are
|
69
|
+
available in this first alpha release of FXRuby 1.2. Support for those
|
70
|
+
new classes should come along quickly in subsequent alpha releases of
|
71
|
+
FXRuby 1.2.</p><p>The secondary intent of this first alpha release is to introduce
|
72
|
+
the new <a href="http://rubygems.rubyforge.org" target="_top">RubyGems</a>-based packaging
|
73
|
+
of FXRuby and to begin to work out the inevitable kinks in that
|
74
|
+
system.</p></li><li style="list-style-type: disc"><p>The binary gem for Windows was built with FOX version 1.2.4 and
|
75
|
+
FXScintilla version 1.57.</p></li></ul></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="infosources.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="pt02.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 9. Other Sources of Information </td><td width="20%" align="center"><a accesskey="h" href="book.html">Home</a></td><td width="40%" align="right" valign="top"> Part II. Appendices</td></tr></table></div></body></html>
|
@@ -0,0 +1,68 @@
|
|
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><meta name="generator" content="DocBook XSL Stylesheets V1.61.2"><link rel="home" href="book.html" title="Developing Graphical User Interfaces with FXRuby"><link rel="up" href="pt01.html" title="Part I. The Basics"><link rel="previous" 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></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="clipboardtut.html#d0e1008">Basic Application</a></dt><dt><a href="ch04s02.html">Acquiring the Clipboard</a></dt><dt><a href="ch04s03.html">Sending Data to the Clipboard</a></dt><dt><a href="ch04s04.html">Pasting Data from the Clipboard</a></dt></dl></div><p>Two of the standard FOX widgets, <tt class="classname">FXText</tt> and
|
4
|
+
<tt class="classname">FXTextField</tt>, provide clipboard support out of the
|
5
|
+
box. For example, you can select some text in an
|
6
|
+
<tt class="classname">FXTextField</tt> 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
|
+
<tt class="classname">FXText</tt> or <tt class="classname">FXTextField</tt> 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="d0e1008"></a>Basic Application</h2></div></div><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><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">require 'rubygems'
|
16
|
+
require_gem 'fxruby'
|
17
|
+
require 'customer'
|
18
|
+
|
19
|
+
include Fox
|
20
|
+
|
21
|
+
class ClipMainWindow < FXMainWindow
|
22
|
+
def initialize(anApp)
|
23
|
+
# Initialize base class first
|
24
|
+
super(anApp, "Clipboard Example", nil, nil, DECOR_ALL, 0, 0, 400, 300)
|
25
|
+
|
26
|
+
# Place the list in a sunken frame
|
27
|
+
sunkenFrame = FXVerticalFrame.new(self, LAYOUT_FILL_X|LAYOUT_FILL_Y|FRAME_SUNKEN|FRAME_THICK,
|
28
|
+
0, 0, 0, 0, 0, 0, 0, 0)
|
29
|
+
|
30
|
+
# Customer list
|
31
|
+
customerList = FXList.new(sunkenFrame, nil, 0, LIST_BROWSESELECT|LAYOUT_FILL_X|LAYOUT_FILL_Y)
|
32
|
+
$customers.each do |customer|
|
33
|
+
customerList.appendItem(customer.name, nil, customer)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
def create
|
38
|
+
super
|
39
|
+
show(PLACEMENT_SCREEN)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
if __FILE__ == $0
|
44
|
+
FXApp.new("ClipboardExample", "FXRuby") do |theApp|
|
45
|
+
ClipMainWindow.new(theApp)
|
46
|
+
theApp.create
|
47
|
+
theApp.run
|
48
|
+
end
|
49
|
+
end
|
50
|
+
</pre></td></tr></table><p>We're assuming that the "customer" module defines a
|
51
|
+
<tt class="classname">Customer</tt> class and a global array
|
52
|
+
<tt class="varname">$customers</tt> that contains the list of customers. For a
|
53
|
+
real world application, you might access this information from a database
|
54
|
+
or some other source, but for this example we'll just use a hard-coded
|
55
|
+
array:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"># customer.rb
|
56
|
+
|
57
|
+
Customer = Struct.new("Customer", :name, :address, :zip)
|
58
|
+
|
59
|
+
$customers = []
|
60
|
+
$customers << Customer.new("Reed Richards", "123 Maple, Central City, NY", 010111)
|
61
|
+
$customers << Customer.new("Sue Storm", "123 Maple, Anytown, NC", 12345)
|
62
|
+
$customers << Customer.new("Benjamin J. Grimm", "123 Maple, Anytown, NC", 12345)
|
63
|
+
$customers << Customer.new("Johnny Storm", "123 Maple, Anytown, NC", 12345)
|
64
|
+
</pre></td></tr></table><p>The goals for the next few sections are to extend this application
|
65
|
+
so that users can select a customer from the list and copy that customer's
|
66
|
+
information to the clipboard, and subsequently paste that information into
|
67
|
+
another copy of the program (or some other clipboard-aware
|
68
|
+
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/cvs.html
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
<html><head>
|
2
|
+
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
3
|
+
<title>Appendix F. Getting the Sources from CVS</title><meta name="generator" content="DocBook XSL Stylesheets V1.61.2"><link rel="home" href="book.html" title="Developing Graphical User Interfaces with FXRuby"><link rel="up" href="pt02.html" title="Part II. Appendices"><link rel="previous" href="apes03.html" title="Virtual Functions"></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 F. Getting the Sources from CVS</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="apes03.html">Prev</a> </td><th width="60%" align="center">Part II. Appendices</th><td width="20%" align="right"> </td></tr></table><hr></div><div class="appendix" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="cvs"></a>Appendix F. Getting the Sources from CVS</h2></div></div><div></div></div><p>All of the source code for FXRuby is available for anonymous,
|
4
|
+
read-only CVS access. This chapter describes how to check out the sources
|
5
|
+
for either the stable or development release of FXRuby and then build FXRuby
|
6
|
+
from those sources. The information in this chapter builds on the basic CVS
|
7
|
+
instructions provided for any RubyForge hosted project, and specifically
|
8
|
+
those <a href="http://rubyforge.org/scm/?group_id=300" target="_top">instructions</a> for the
|
9
|
+
FXRuby project hosted at RubyForge.</p><p>There are some prerequisites. Obviously, you're going to need to have
|
10
|
+
some kind of CVS client installed on your system and have a clue about how
|
11
|
+
to use it to check out code from a remote repository. Please do not send me
|
12
|
+
questions about how to install or use CVS. The best source of information in
|
13
|
+
this case is the <a href="http://cvshome.org" target="_top">CVS home page</a> and,
|
14
|
+
in particular, <a href="http://www.cvshome.org/docs/manual/cvs.html" target="_top">Per
|
15
|
+
Cederqvist's CVS manual</a>. Next, if you intend to make changes to the
|
16
|
+
SWIG interface files (e.g. to change the behavior of some of the wrapped
|
17
|
+
functions, or to add new ones), you'll need to have a working SWIG
|
18
|
+
installation so that you can regenerate the C++ source files from the
|
19
|
+
modified SWIG interface files. I always use the latest development version
|
20
|
+
of <a href="http://www.swig.org" target="_top">SWIG</a>, but any release after,
|
21
|
+
say, SWIG 1.3.15 should work fine. The older SWIG 1.1 releases will
|
22
|
+
definitely <span class="emphasis"><em>not</em></span> work.</p><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e3743"></a>Checking out the stable version</h2></div></div><div></div></div><p>The stable version of FXRuby is the 1.0.x branch and is compatible
|
23
|
+
with any of the FOX 1.0.x releases. It is <span class="emphasis"><em>not</em></span>
|
24
|
+
compatible with any other release branches of FOX (e.g. the FOX 1.2.x or
|
25
|
+
1.3.x series of releases).</p><p>To check out the stable version of FXRuby, do the following:</p><div class="orderedlist"><ol type="1"><li><p>Log in to the CVS server by typing:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="screen">cvs -d:pserver:anonymous@rubyforge.org:/var/cvs/fxruby login</pre></td></tr></table><p>When prompted for a password for <span class="emphasis"><em>anonymous</em></span>,
|
26
|
+
simply press the <b class="keycap">Enter</b> key.</p></li><li><p>Check out the stable branch of FXRuby by typing:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="screen">cvs -z3 -d:pserver:anonymous@rubyforge.org:/var/cvs/fxruby co -rrelease10 FXRuby</pre></td></tr></table></li></ol></div><p>At this point, you should be ready to change to the top-level
|
27
|
+
directory and go through the normal build and installation process, as
|
28
|
+
described in an earlier chapter.</p></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e3776"></a>Regenerating wrapper code with SWIG</h2></div></div><div></div></div><p>If you make changes to any of the SWIG interface files (the files
|
29
|
+
ending with a <tt class="filename">.i</tt> extension, in the <tt class="filename">swig-interfaces</tt> subdirectory) you will need
|
30
|
+
to re-run SWIG to regenerate parts of the FXRuby source code:</p><div class="orderedlist"><ol type="1"><li><p>Change directories to the <tt class="filename">swig-interfaces</tt> subdirectory of the
|
31
|
+
FXRuby source tree.</p></li><li><p>Type the following command to create a "bootstrap"
|
32
|
+
<tt class="filename">dependencies</tt> file:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="screen">touch dependencies</pre></td></tr></table><p>You should only need to do this for the initial checkout of the
|
33
|
+
sources; after that, the <tt class="filename">dependencies</tt> file will
|
34
|
+
be updated as described in the next step.</p></li><li><p>Build the "depend" target to generate the real
|
35
|
+
<tt class="filename">dependencies</tt> file by typing:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="screen">make depend</pre></td></tr></table></li><li><p>Finally, regenerate the sources by typing:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="screen">make</pre></td></tr></table></li></ol></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="apes03.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="pt02.html">Up</a></td><td width="40%" align="right"> </td></tr><tr><td width="40%" align="left" valign="top">Virtual Functions </td><td width="20%" align="center"><a accesskey="h" href="book.html">Home</a></td><td width="40%" align="right" valign="top"> </td></tr></table></div></body></html>
|
@@ -0,0 +1,11 @@
|
|
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><meta name="generator" content="DocBook XSL Stylesheets V1.61.2"><link rel="home" href="book.html" title="Developing Graphical User Interfaces with FXRuby"><link rel="up" href="pt02.html" title="Part II. Appendices"><link rel="previous" 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></div></div><p>The FXRuby API follows the FOX API very closely and for the most part, you should be able to use the standard FOX class documentation as a reference. In some cases, however, fundamental differences between Ruby and C++ necessitated slight changes in the API. For some other cases, FOX classes were enhanced to take advantage of Ruby language features (such as iterators). The purpose of this chapter is to identify some of the differences between the C++ and Ruby interfaces to FOX.</p><p>One difference that should be easy to cope with is the substitution of Ruby Strings for FXStrings. Any function that would normally expect an <span class="type">FXString</span> input argument insteads takes a Ruby String. Similarly, functions that would return an <span class="type">FXString</span> will instead return a Ruby string. For functions that would normally accept a <tt class="constant">NULL</tt> or empty string argument, just pass <tt class="constant">nil</tt> or an empty string ("").</p><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e2824"></a>Functions that expect arrays of objects</h2></div></div><div></div></div><p>One common pattern in FOX member function argument lists is to expect a pointer to an array of values, followed by an integer indicating the number of values in the array. This of course isn't necessary in Ruby, where <tt class="classname">Array</tt> objects "know" their lengths. As a result, functions such as <tt class="methodname">FXWindow::acquireClipboard()</tt>, whose C++ declaration looks like this:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">FXbool acquireClipboard(const FXDragType *types, FXuint numTypes);</pre></td></tr></table><p>are called from Ruby code by passing in a single <tt class="classname">Array</tt> argument, e.g.</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">myWindow.acquireClipboard(typesArray)</pre></td></tr></table></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e2844"></a>Functions that return values by reference</h2></div></div><div></div></div><p>Many FOX methods take advantage of the C++ language feature of returning values by reference. For example, the <tt class="methodname">getCursorPos()</tt> member function for class <tt class="classname">FXWindow</tt> has the declaration:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">FXint getCursorPos(FXint& x, FXint& y, FXint& buttons) const;</pre></td></tr></table><p>which indicates that the function takes references to three integers (x, y and buttons). To call this function from a C++ program, you'd write code like this:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">FXint x, y;
|
4
|
+
FXuint buttons;
|
5
|
+
|
6
|
+
if (window->getCursorPosition(x, y, buttons))
|
7
|
+
fprintf(stderr, "Current position is (%d, %d)\n", x, y);</pre></td></tr></table><p>Since this idiom doesn't translate well to Ruby, some functions' interfaces have been slightly modified. For example, the FXRuby implementation of <tt class="methodname">getCursorPos()</tt> returns the three values as an <tt class="classname">Array</tt>, e.g.:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">x, y, buttons = aWindow.getCursorPos()</pre></td></tr></table><p>The following table shows how these kinds of functions are 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><tt class="methodname">FXDial#range</tt></td><td>Returns a <tt class="classname">Range</tt> instance.</td></tr><tr><td><tt class="methodname">FXDial#range=(aRange)</tt></td><td>Accepts a <tt class="classname">Range</tt> instance as its input.</td></tr><tr><td><tt class="methodname">FXFontDialog#fontSelection</tt></td><td>Returns the <tt class="classname">FXFontDesc</tt> instance</td></tr><tr><td><tt class="methodname">FXFontSelector#fontSelection</tt></td><td>Returns the <tt class="classname">FXFontDesc</tt> instance</td></tr><tr><td><tt class="methodname">FXGLObject#bounds(range)</tt></td><td>Takes an <tt class="classname">FXRange</tt> instance as its input and returns a (possibly modified) <tt class="classname">FXRange</tt> instance.</td></tr><tr><td><tt class="methodname">FXGLViewer#eyeToScreen(eye)</tt></td><td>Takes an array of eye coordinates (floats) as its input and returns the screen point coordinate as an array of integers [sx, sy]</td></tr><tr><td><tt class="methodname">FXGLViewer#getBoreVector(sx, sy)</tt></td><td>Returns the endpoint and direction vector as an array of arrays [point, dir]</td></tr><tr><td><tt class="methodname">FXGLViewer#light</tt></td><td>Returns a <tt class="classname">FXLight</tt> instance</td></tr><tr><td><tt class="methodname">FXGLViewer#viewport</tt></td><td>Returns an <tt class="classname">FXViewport</tt> instance.</td></tr><tr><td><tt class="methodname">FXPrinterDialog#printer</tt></td><td>Returns the <tt class="classname">FXPrinter</tt> instance</td></tr><tr><td><tt class="methodname">FXScrollArea#position</tt></td><td>Returns the position as an array of integers [x, y]</td></tr><tr><td><tt class="methodname">FXSlider#range</tt></td><td>Returns a <tt class="classname">Range</tt> instance.</td></tr><tr><td><tt class="methodname">FXSlider#range=(aRange)</tt></td><td>Accepts a <tt class="classname">Range</tt> instance as its input.</td></tr><tr><td><tt class="methodname">FXSpinner#range</tt></td><td>Returns a <tt class="classname">Range</tt> instance.</td></tr><tr><td><tt class="methodname">FXSpinner#range=(aRange)</tt></td><td>Accepts a <tt class="classname">Range</tt> instance as its input.</td></tr><tr><td><tt class="methodname">FXText#appendText(text, notify=false)</tt></td><td>Append text to the end of the buffer.</td></tr><tr><td><tt class="methodname">FXText#appendStyledText(text, style=0, notify=false)</tt></td><td>Append styled text to the end of the buffer.</td></tr><tr><td><tt class="methodname">FXText#extractText(pos, n)</tt></td><td>Extracts <span class="emphasis"><em>n</em></span> characters from the buffer beginning at position <span class="emphasis"><em>pos</em></span> and returns the result as a String.</td></tr><tr><td><tt class="methodname">FXText#extractStyle(pos, n)</tt></td><td>Extracts <span class="emphasis"><em>n</em></span> style characters from the buffer beginning at position <span class="emphasis"><em>pos</em></span> and returns the result as a String.</td></tr><tr><td><tt class="methodname">FXText#insertText(pos, text, notify=false)</tt></td><td>Insert <span class="emphasis"><em>text</em></span> at position <span class="emphasis"><em>pos</em></span> in the buffer.</td></tr><tr><td><tt class="methodname">FXText#insertStyledText(pos, text, style=0, notify=false)</tt></td><td>Insert <span class="emphasis"><em>text</em></span> at position <span class="emphasis"><em>pos</em></span> in the buffer.</td></tr><tr><td><tt class="methodname">FXText#replaceText(pos, m, text, notify=false)</tt></td><td>Replace <span class="emphasis"><em>m</em></span> characters at <span class="emphasis"><em>pos</em></span> by <span class="emphasis"><em>text</em></span>.</td></tr><tr><td><tt class="methodname">FXText#replaceStyledText(pos, m, text, style=0, notify=false)</tt></td><td>Replace <span class="emphasis"><em>m</em></span> characters at <span class="emphasis"><em>pos</em></span> by <span class="emphasis"><em>text</em></span>.</td></tr><tr><td><tt class="methodname">FXText#setDelimiters(delimiters)</tt></td><td>Change delimiters of words (<span class="emphasis"><em>delimiters</em></span> is a string).</td></tr><tr><td><tt class="methodname">FXText#getDelimiters()</tt></td><td>Return word delimiters as a string.</td></tr><tr><td><tt class="methodname">FXWindow#cursorPosition</tt></td><td>Returns an array of integers [x, y, buttons]</td></tr><tr><td><tt class="methodname">FXWindow#translateCoordinatesFrom(window, x, y)</tt></td><td>Returns the translated coordinates as an array [x, y]</td></tr><tr><td><tt class="methodname">FXWindow#translateCoordinatesTo(window, x, y)</tt></td><td>Returns the translated coordinates as an array [x, 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="d0e3134"></a>Iterators</h2></div></div><div></div></div><p>Several classes have been extended with an <tt class="methodname">each</tt> method to provide Ruby-style iterators. These classes include <tt class="classname">FXComboBox</tt>, <tt class="classname">FXGLGroup</tt>, <tt class="classname">FXHeader</tt>, <tt class="classname">FXIconList</tt>, <tt class="classname">FXList</tt>, <tt class="classname">FXListBox</tt>, <tt class="classname">FXTreeItem</tt>, <tt class="classname">FXTreeList</tt> and <tt class="classname">FXTreeListBox</tt>. These classes also mix-in Ruby's <tt class="classname">Enumerable</tt> module so that you can take full advantage of the iterators.</p><p>The block parameters passed to your code block vary depending on the class. For example, iterating over an <tt class="classname">FXList</tt> instance yields <tt class="classname">FXListItem</tt> parameters:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">aList.each { |aListItem|
|
8
|
+
puts "text for this item = #{aListItem.getText()}"
|
9
|
+
}</pre></td></tr></table><p>whereas iterating over an <tt class="classname">FXComboBox</tt> instance yields two parameters, the item text (a string) and the item data:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">aComboBox.each { |itemText, itemData|
|
10
|
+
puts "text for this item = #{itemText}"
|
11
|
+
}</pre></td></tr></table><p>The following table shows the block parameters for each of these 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><tt class="classname">FXComboBox</tt></td><td>the item text (a string) and user data</td></tr><tr><td><tt class="classname">FXGLGroup</tt></td><td>an <tt class="classname">FXGLObject</tt> instance</td></tr><tr><td><tt class="classname">FXHeader</tt></td><td>an <tt class="classname">FXHeaderItem</tt> instance</td></tr><tr><td><tt class="classname">FXIconList</tt></td><td>an <tt class="classname">FXIconItem</tt> instance</td></tr><tr><td><tt class="classname">FXList</tt></td><td>an <tt class="classname">FXListItem</tt> instance</td></tr><tr><td><tt class="classname">FXListBox</tt></td><td>the item text (a string), icon (an <tt class="classname">FXIcon</tt> instance) and user data</td></tr><tr><td><tt class="classname">FXTreeItem</tt></td><td>an <tt class="classname">FXTreeItem</tt> instance</td></tr><tr><td><tt class="classname">FXTreeList</tt></td><td>an <tt class="classname">FXTreeItem</tt> instance</td></tr><tr><td><tt class="classname">FXTreeListBox</tt></td><td>an <tt class="classname">FXTreeItem</tt> 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="d0e3278"></a>Attribute Accessors</h2></div></div><div></div></div><p>FOX strictly handles access to all object attributes through member functions, e.g. <tt class="methodname">setBackgroundColor</tt> and <tt class="methodname">getBackgroundColor</tt> or <tt class="methodname">setText</tt> and <tt class="methodname">getText</tt>. FXRuby exposes all of these functions but also provides aliases that look more like regular Ruby attribute accessors. The names for these accessors are based on the FOX method names; for example, <tt class="methodname">setBackgroundColor</tt> and <tt class="methodname">getBackgroundColor</tt> are aliased to <tt class="methodname">backgroundColor=</tt> and <tt class="methodname">backgroundColor</tt>, respectively.</p><p>In many cases these aliases allow you to write more compact and legible code. For example, consider this code snippet:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">aLabel.setText(aLabel.getText() + " (modified)")</pre></td></tr></table><p>Now consider a different code snippet, using the aliased accessor method names:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">aLabel.text += " (modified)"</pre></td></tr></table><p>While these two are functionally equivalent, the latter is a bit 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="d0e3317"></a>Message Passing</h2></div></div><div></div></div><p>FOX message maps are implemented as static C++ class members. With FXRuby, you just associate messages with message handlers in the class <tt class="methodname">initialize</tt> method using the <tt class="methodname">FXMAPFUNC()</tt>, <tt class="methodname">FXMAPTYPE()</tt>, <tt class="methodname">FXMAPTYPES()</tt> or <tt class="methodname">FXMAPFUNCS()</tt> methods. See almost any of the example programs for examples of how this is done.</p><p>As in C++ FOX, the last argument passed to your message handler functions contains message-specific data. For instance, all <tt class="constant">SEL_PAINT</tt> messages pass an <tt class="classname">FXEvent</tt> object through this argument to give you some information about the size of the exposed rectangle. On the other hand, a <tt class="constant">SEL_COMMAND</tt> message from an <tt class="classname">FXHeader</tt> object passes the index of the selected header item through this argument. Instead of guessing what's in this last argument, your best bet is to instead invoke a member function on the sending object to find out what you need, instead of relying on the data passed through this pointer. For example, if you get a <tt class="constant">SEL_COMMAND</tt> message from an <tt class="classname">FXColorWell</tt> object, the data passed through that last argument is supposed to be the new RGB color value. Instead of trying to interpret the argument's contents, just turn around and call the color well's <tt class="methodname">getRGBA()</tt> member function to retrieve its color. Similarly, if you get a <tt class="constant">SEL_COMMAND</tt> message from a tree list, call its <tt class="methodname">getCurrentItem()</tt> 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="d0e3366"></a>Catching Operating System Signals</h2></div></div><div></div></div><p>The <tt class="methodname">FXApp#addSignal</tt> and <tt class="methodname">FXApp#removeSignal</tt> methods have been enhanced to accept either a string or integer as their first argument. If it's a string (e.g. "SIGINT" or just "INT") the code will determine the corresponding signal number for you (similar to the standard Ruby library's <tt class="methodname">Process.kill</tt> module method). For examples of how to use this, see the <tt class="filename">datatarget.rb</tt> or <tt class="filename">imageviewer.rb</tt> example programs.</p></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e3386"></a>Support for Multithreaded Applications</h2></div></div><div></div></div><p>There is some support for multithreaded FXRuby applications, but it's not wonderful. The current implementation does what is also done in Ruby/GTK; it turns over some idle processing time to the Ruby thread scheduler to let other threads do their thing. As I learn more about Ruby's threading implementation I may try something different, but this seems to work OK for now. For a simple example, see the <tt class="filename">groupbox.rb</tt> example program, in which the clock label that appears in the lower right-hand corner is continuously updated (by a separate thread).</p><p>If you suspect that FXRuby's threads support is interfering with your application's performance, you may want to try tweaking the amount of time that the main application thread "sleeps" during idle processing; do this by setting the <tt class="classname">FXApp</tt> object's <i class="structfield"><tt>sleepTime</tt></i> attribute. The default value for <i class="structfield"><tt>FXApp#sleepTime</tt></i> is 100 milliseconds. You can also disable the threads support completely by calling <tt class="methodname">FXApp#threadsEnabled=false</tt> (and subsequently re-enable it with <tt class="methodname">FXApp#threadsEnabled=true</tt>).</p></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e3411"></a>Debugging Tricks</h2></div></div><div></div></div><p>As a debugging tool, you can optionally catch exceptions raised in message handlers. To turn on this feature, call the <tt class="methodname">setIgnoreExceptions(true)</tt> module method. When this is enabled, any exceptions raised in message handler functions will cause a standard stack trace to be dumped to the standard output, but then your application will, for better or worse, proceed normally. Thanks to 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>
|
@@ -0,0 +1,266 @@
|
|
1
|
+
<html><head>
|
2
|
+
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
3
|
+
<title>Chapter 5. Drag and Drop</title><meta name="generator" content="DocBook XSL Stylesheets V1.61.2"><link rel="home" href="book.html" title="Developing Graphical User Interfaces with FXRuby"><link rel="up" href="pt01.html" title="Part I. The Basics"><link rel="previous" 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></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="dragdroptut.html#d0e1223">Drop Sites</a></dt><dt><a href="ch05s02.html">Drag Sources</a></dt><dt><a href="ch05s03.html">Putting It All Together</a></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 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="d0e1223"></a>Drop Sites</h2></div></div><div></div></div><p>We're going to start by presenting a skeleton application consisting
|
7
|
+
of a main window widget (a <tt class="classname">DropSite</tt> instance) that
|
8
|
+
parents an <tt class="classname">FXCanvas</tt> widget:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">require 'rubygems'
|
9
|
+
require_gem 'fxruby'
|
10
|
+
|
11
|
+
include Fox
|
12
|
+
|
13
|
+
class DropSite < FXMainWindow
|
14
|
+
def initialize(anApp)
|
15
|
+
# Initialize base class
|
16
|
+
super(anApp, "Drop Site", nil, nil, DECOR_ALL, 0, 0, 400, 300)
|
17
|
+
|
18
|
+
# Fill main window with canvas
|
19
|
+
@canvas = FXCanvas.new(self, nil, 0, LAYOUT_FILL_X|LAYOUT_FILL_Y)
|
20
|
+
end
|
21
|
+
|
22
|
+
def create
|
23
|
+
# Create the main window and canvas
|
24
|
+
super
|
25
|
+
|
26
|
+
# Show the main window
|
27
|
+
show(PLACEMENT_SCREEN)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
if __FILE__ == $0
|
32
|
+
FXApp.new("DropSite", "FXRuby") do |theApp|
|
33
|
+
DropSite.new(theApp)
|
34
|
+
theApp.create
|
35
|
+
theApp.run
|
36
|
+
end
|
37
|
+
end
|
38
|
+
</pre></td></tr></table><p>Since the main program (i.e. the part at the end) won't change for
|
39
|
+
the rest of the tutorial, I won't show that code anymore. Since an
|
40
|
+
<tt class="classname">FXCanvas</tt> widget relies on some other object (its
|
41
|
+
message target) to draw its contents, we need to handle
|
42
|
+
<tt class="constant">SEL_PAINT</tt> messages generated by the canvas. We'll do
|
43
|
+
that by adding a handler that clears the canvas to its current background
|
44
|
+
color:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">require 'rubygems'
|
45
|
+
require_gem 'fxruby'
|
46
|
+
|
47
|
+
include Fox
|
48
|
+
|
49
|
+
class DropSite < FXMainWindow
|
50
|
+
def initialize(anApp)
|
51
|
+
# Initialize base class
|
52
|
+
super(anApp, "Drop Site", nil, nil, DECOR_ALL, 0, 0, 400, 300)
|
53
|
+
|
54
|
+
# Fill main window with canvas
|
55
|
+
@canvas = FXCanvas.new(self, nil, 0, LAYOUT_FILL_X|LAYOUT_FILL_Y)
|
56
|
+
|
57
|
+
<span class="bold"><b> # Handle expose events on the canvas
|
58
|
+
@canvas.connect(SEL_PAINT) { |sender, sel, event|
|
59
|
+
FXDCWindow.new(@canvas, event) { |dc|
|
60
|
+
dc.foreground = @canvas.backColor
|
61
|
+
dc.fillRectangle(event.rect.x, event.rect.y, event.rect.w, event.rect.h)
|
62
|
+
}
|
63
|
+
}</b></span>
|
64
|
+
end
|
65
|
+
|
66
|
+
def create
|
67
|
+
# Create the main window and canvas
|
68
|
+
super
|
69
|
+
|
70
|
+
# Show the main window
|
71
|
+
show(PLACEMENT_SCREEN)
|
72
|
+
end
|
73
|
+
end
|
74
|
+
</pre></td></tr></table><p>Run this basic version of the program to be sure that it's working
|
75
|
+
properly so far. You should simply see an empty window with a white
|
76
|
+
background.</p><p>Now, on to the fun stuff. Our goal is to be able to drag color data
|
77
|
+
from some other window, such as an <tt class="classname">FXColorWell</tt>
|
78
|
+
widget, and drop it onto the canvas in order to change the canvas'
|
79
|
+
background color. In order for a FOX widget to be able to accept drops at
|
80
|
+
all, we need to first call its <tt class="methodname">dropEnable()</tt>
|
81
|
+
method:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">def initialize(anApp)
|
82
|
+
# Initialize base class
|
83
|
+
super(anApp, "Drop Site", nil, nil, DECOR_ALL, 0, 0, 400, 300)
|
84
|
+
|
85
|
+
# Fill main window with canvas
|
86
|
+
@canvas = FXCanvas.new(self, nil, 0, LAYOUT_FILL_X|LAYOUT_FILL_Y)
|
87
|
+
|
88
|
+
# Handle expose events on the canvas
|
89
|
+
@canvas.connect(SEL_PAINT) { |sender, sel, event|
|
90
|
+
FXDCWindow.new(@canvas, event) { |dc|
|
91
|
+
dc.foreground = @canvas.backColor
|
92
|
+
dc.fillRectangle(event.rect.x, event.rect.y, event.rect.w, event.rect.h)
|
93
|
+
}
|
94
|
+
}
|
95
|
+
|
96
|
+
<span class="bold"><b> # Enable canvas for drag-and-drop messages
|
97
|
+
@canvas.dropEnable
|
98
|
+
</b></span>end
|
99
|
+
</pre></td></tr></table><p>At this point, let's try a little test to see if the program does
|
100
|
+
anything interesting yet. Start by running some other FOX or FXRuby
|
101
|
+
program to use as a drag source for the color data. You should be able to
|
102
|
+
use any program that displays an FXColorWell widget, and this includes the
|
103
|
+
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
|
104
|
+
box are color wells, and the large box on the left-hand side of the color
|
105
|
+
dialog box is also a color well. Now start your drag-and-drop test program
|
106
|
+
and try to drag a color from one of these color wells onto this window. At
|
107
|
+
this point, the mouse pointer should turn into a stop sign, indicating
|
108
|
+
that the canvas isn't accepting drops of color data yet.</p><p>To correct this problem, we need to use the canvas'
|
109
|
+
<tt class="methodname">acceptDrop()</tt> method to indicate whether or not
|
110
|
+
we'll accept certain kinds of drops. You can call
|
111
|
+
<tt class="methodname">acceptDrop()</tt> any time after receiving the initial
|
112
|
+
<tt class="constant">SEL_DND_ENTER</tt> message, but it's usually done in
|
113
|
+
response to a <tt class="constant">SEL_DND_MOTION</tt> message. Let's add a
|
114
|
+
handler for <tt class="constant">SEL_DND_MOTION</tt> messages from the canvas
|
115
|
+
in DropSite's initialize() method. For now, we'll unconditionally accept
|
116
|
+
drops from any drag source, regardless of what kind of data they're
|
117
|
+
offering:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">def initialize(anApp)
|
118
|
+
# Initialize base class
|
119
|
+
super(anApp, "Drop Site", nil, nil, DECOR_ALL, 0, 0, 400, 300)
|
120
|
+
|
121
|
+
# Fill main window with canvas
|
122
|
+
@canvas = FXCanvas.new(self, nil, 0, LAYOUT_FILL_X|LAYOUT_FILL_Y)
|
123
|
+
|
124
|
+
# Handle expose events on the canvas
|
125
|
+
@canvas.connect(SEL_PAINT) { |sender, sel, event|
|
126
|
+
FXDCWindow.new(@canvas, event) { |dc|
|
127
|
+
dc.foreground = @canvas.backColor
|
128
|
+
dc.fillRectangle(event.rect.x, event.rect.y, event.rect.w, event.rect.h)
|
129
|
+
}
|
130
|
+
}
|
131
|
+
|
132
|
+
# Enable canvas for drag-and-drop messages
|
133
|
+
@canvas.dropEnable
|
134
|
+
|
135
|
+
<span class="bold"><b> # Handle SEL_DND_MOTION messages from the canvas
|
136
|
+
@canvas.connect(SEL_DND_MOTION) {
|
137
|
+
# Accept drops unconditionally (for now)
|
138
|
+
@canvas.acceptDrop
|
139
|
+
}
|
140
|
+
</b></span>end
|
141
|
+
</pre></td></tr></table><p>Now try the previous test again. This time, when you try to drag
|
142
|
+
from a color well to the drop-enabled canvas, you should see the mouse
|
143
|
+
pointer turn into a small filled square. This is a visual cue to the user
|
144
|
+
indicating that the canvas will accept a drop of the drag-and-drop
|
145
|
+
data.</p><p>Now it's time to get more specific about what kind of data is being
|
146
|
+
dragged between these applications, and how to process that data. So far,
|
147
|
+
our drop-enabled canvas merely knows that you're dragging some kind of
|
148
|
+
data from a drag source, but it doesn't know what kind of data it is. We
|
149
|
+
really need to be more exclusive about what kinds of data are acceptable.
|
150
|
+
FOX uses unique drag types to distinguish between different kinds of
|
151
|
+
"draggable" data. As you'll see later, you have the freedom to define drag
|
152
|
+
types for any kind of application-specific data that you need; but for
|
153
|
+
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
|
154
|
+
can be used, and so we'll start by adding a few lines to
|
155
|
+
<tt class="classname">DropSite</tt>'s <tt class="methodname">create()</tt> method
|
156
|
+
to register the drag type for color data:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">def create
|
157
|
+
# Create the main window and canvas
|
158
|
+
super
|
159
|
+
|
160
|
+
<span class="bold"><b> # Register the drag type for colors
|
161
|
+
FXWindow.colorType = getApp().registerDragType(FXWindow.colorTypeName)
|
162
|
+
|
163
|
+
</b></span> # Show the main window
|
164
|
+
show(PLACEMENT_SCREEN)
|
165
|
+
end
|
166
|
+
</pre></td></tr></table><p>Note that the first time that
|
167
|
+
<tt class="methodname">registerDragType()</tt> is called for a particular
|
168
|
+
drag type name (such as <tt class="methodname">FXWindow.colorTypeName</tt>)
|
169
|
+
it will generate a unique identifier for that drag type. Subsequent calls
|
170
|
+
to <tt class="methodname">registerDragType()</tt> for the same drag type name
|
171
|
+
will just return the previously-generated drag type. Now, we want to
|
172
|
+
modify our <tt class="constant">SEL_DND_MOTION</tt> handler so that it's a
|
173
|
+
little more picky about which kinds of drops it will accept:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"># Handle SEL_DND_MOTION messages from the canvas
|
174
|
+
@canvas.connect(SEL_DND_MOTION) {
|
175
|
+
<span class="bold"><b> if @canvas.offeredDNDType?(FROM_DRAGNDROP, FXWindow.colorType)
|
176
|
+
@canvas.acceptDrop
|
177
|
+
end
|
178
|
+
</b></span>}
|
179
|
+
</pre></td></tr></table><p>Here, we call the canvas' <tt class="methodname">offeredDNDType?</tt>
|
180
|
+
method to ask if the drag source can provide its data in the requested
|
181
|
+
format. Only if <tt class="methodname">offeredDNDType?</tt> returns true will
|
182
|
+
we call <tt class="methodname">acceptDrop()</tt> as before.</p><p>The last step is to actually handle the drop, and for that we add a
|
183
|
+
handler for the <tt class="constant">SEL_DND_DROP</tt> message:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><span class="bold"><b># Handle SEL_DND_DROP message from the canvas
|
184
|
+
@canvas.connect(SEL_DND_DROP) {
|
185
|
+
# Try to obtain the data as color values first
|
186
|
+
data = @canvas.getDNDData(FROM_DRAGNDROP, FXWindow.colorType)
|
187
|
+
unless data.nil?
|
188
|
+
# Update canvas background color
|
189
|
+
@canvas.backColor = Fox.fxdecodeColorData(data)
|
190
|
+
end
|
191
|
+
}</b></span></pre></td></tr></table><p>Assuming that the drag source is able to provide its data in the
|
192
|
+
requested format, the <tt class="methodname">getDNDData()</tt> method will
|
193
|
+
return a String (which for our purposes is just a byte buffer). If you've
|
194
|
+
defined your own application-specific drag types, this data can of course
|
195
|
+
be anything, and we'll see examples of this in a later tutorial. But the
|
196
|
+
data for standard drag types like
|
197
|
+
<tt class="methodname">FXWindow.colorType</tt> can be decoded using the
|
198
|
+
appropriate built-in library functions. In this case, we use the
|
199
|
+
<tt class="methodname">fxdecodeColorData()</tt> method to convert the bytes
|
200
|
+
into a color value that we can use.</p><p>Now comes the moment of truth. Try running your test program again
|
201
|
+
(one that displays a color well). Now, when you drag a color from a color
|
202
|
+
well and drop it onto the <tt class="classname">DropSite</tt> window, the
|
203
|
+
canvas should change its background color accordingly.</p><p>The complete program is listed below, and is included in the
|
204
|
+
<tt class="filename">examples</tt> directory under the file
|
205
|
+
name <tt class="filename">dropsite.rb</tt>.</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">require 'rubygems'
|
206
|
+
require_gem 'fxruby'
|
207
|
+
|
208
|
+
include Fox
|
209
|
+
|
210
|
+
class DropSite < FXMainWindow
|
211
|
+
def initialize(anApp)
|
212
|
+
# Initialize base class
|
213
|
+
super(anApp, "Drop Site", nil, nil, DECOR_ALL, 0, 0, 400, 300)
|
214
|
+
|
215
|
+
# Fill main window with canvas
|
216
|
+
@canvas = FXCanvas.new(self, nil, 0, LAYOUT_FILL_X|LAYOUT_FILL_Y)
|
217
|
+
|
218
|
+
# Handle expose events on the canvas
|
219
|
+
@canvas.connect(SEL_PAINT) { |sender, sel, event|
|
220
|
+
FXDCWindow.new(@canvas, event) { |dc|
|
221
|
+
dc.foreground = @canvas.backColor
|
222
|
+
dc.fillRectangle(event.rect.x, event.rect.y, event.rect.w, event.rect.h)
|
223
|
+
}
|
224
|
+
}
|
225
|
+
|
226
|
+
# Enable canvas for drag-and-drop messages
|
227
|
+
@canvas.dropEnable
|
228
|
+
|
229
|
+
# Handle SEL_DND_MOTION messages from the canvas
|
230
|
+
@canvas.connect(SEL_DND_MOTION) {
|
231
|
+
if @canvas.offeredDNDType?(FROM_DRAGNDROP, FXWindow.colorType)
|
232
|
+
@canvas.acceptDrop
|
233
|
+
end
|
234
|
+
}
|
235
|
+
|
236
|
+
# Handle SEL_DND_DROP message from the canvas
|
237
|
+
@canvas.connect(SEL_DND_DROP) {
|
238
|
+
# Try to obtain the data as color values first
|
239
|
+
data = @canvas.getDNDData(FROM_DRAGNDROP, FXWindow.colorType)
|
240
|
+
unless data.nil?
|
241
|
+
# Update canvas background color
|
242
|
+
@canvas.backColor = Fox.fxdecodeColorData(data)
|
243
|
+
end
|
244
|
+
}
|
245
|
+
end
|
246
|
+
|
247
|
+
def create
|
248
|
+
# Create the main window and canvas
|
249
|
+
super
|
250
|
+
|
251
|
+
# Register the drag type for colors
|
252
|
+
FXWindow.colorType = getApp().registerDragType(FXWindow.colorTypeName)
|
253
|
+
|
254
|
+
# Show the main window
|
255
|
+
show(PLACEMENT_SCREEN)
|
256
|
+
end
|
257
|
+
end
|
258
|
+
|
259
|
+
if __FILE__ == $0
|
260
|
+
FXApp.new("DropSite", "FXRuby") do |theApp|
|
261
|
+
DropSite.new(theApp)
|
262
|
+
theApp.create
|
263
|
+
theApp.run
|
264
|
+
end
|
265
|
+
end
|
266
|
+
</pre></td></tr></table></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>
|