fxruby 1.4.7 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/doc/apes02.html +6 -6
- data/doc/apes03.html +11 -11
- data/doc/book.html +1 -1
- data/doc/build.html +65 -67
- data/doc/ch03s02.html +7 -7
- data/doc/ch03s03.html +18 -18
- data/doc/ch03s04.html +11 -11
- data/doc/ch03s05.html +14 -14
- data/doc/ch04s02.html +14 -14
- data/doc/ch04s03.html +15 -15
- data/doc/ch04s04.html +28 -28
- data/doc/ch05s02.html +49 -49
- data/doc/ch05s03.html +8 -8
- data/doc/clipboardtut.html +45 -57
- data/doc/cvs.html +10 -10
- data/doc/differences.html +4 -4
- data/doc/dragdroptut.html +50 -50
- data/doc/events.html +11 -11
- data/doc/examples.html +48 -48
- data/doc/gems.html +38 -38
- data/doc/goals.html +4 -4
- data/doc/implementation.html +4 -4
- data/doc/infosources.html +9 -9
- data/doc/library.html +19 -19
- data/doc/opengl.html +31 -31
- data/doc/pt01.html +1 -1
- data/doc/pt02.html +1 -1
- data/doc/scintilla.html +15 -15
- data/doc/todo.html +6 -6
- data/doc/tutorial1.html +34 -34
- data/examples/babelfish.rb +1 -1
- data/examples/bounce.rb +1 -1
- data/examples/browser.rb +2 -2
- data/examples/button.rb +1 -1
- data/examples/datatarget.rb +2 -2
- data/examples/dctest.rb +12 -12
- data/examples/dialog.rb +1 -1
- data/examples/dilbert.rb +2 -2
- data/examples/dirlist.rb +1 -1
- data/examples/dragdrop.rb +1 -1
- data/examples/dragsource.rb +1 -1
- data/examples/dropsite.rb +1 -1
- data/examples/foursplit.rb +1 -1
- data/examples/gltest.rb +2 -2
- data/examples/glviewer.rb +4 -4
- data/examples/groupbox.rb +22 -22
- data/examples/header.rb +1 -1
- data/examples/hello.rb +1 -1
- data/examples/hello2.rb +1 -1
- data/examples/iconlist.rb +1 -1
- data/examples/image.rb +2 -2
- data/examples/imageviewer.rb +1 -1
- data/examples/inputs.rb +1 -1
- data/examples/mditest.rb +2 -2
- data/examples/pig.rb +1 -1
- data/examples/raabrowser.rb +2 -2
- data/examples/ratio.rb +2 -2
- data/examples/scintilla-test.rb +2 -2
- data/examples/scribble-orig.rb +3 -3
- data/examples/scribble.rb +1 -1
- data/examples/shutter.rb +1 -1
- data/examples/splitter.rb +36 -36
- data/examples/styledtext.rb +2 -2
- data/examples/tabbook.rb +1 -1
- data/examples/table.rb +1 -1
- data/examples/textedit/commands.rb +2 -2
- data/examples/textedit/helpwindow.rb +1 -1
- data/examples/textedit/prefdialog.rb +1 -1
- data/examples/textedit/textedit.rb +5 -3
- data/ext/{fox14 → fox16}/FXRbApp.cpp +1 -1
- data/ext/{fox14 → fox16}/FXRbDataTarget.cpp +1 -1
- data/ext/{fox14 → fox16}/FXRbGLViewer.cpp +1 -1
- data/ext/{fox14 → fox16}/FXRuby.cpp +137 -39
- data/ext/{fox14 → fox16}/MANIFEST +0 -0
- data/ext/{fox14 → fox16}/core_wrap.cpp +1177 -659
- data/ext/{fox14 → fox16}/dc_wrap.cpp +110 -3
- data/ext/{fox14 → fox16}/dialogs_wrap.cpp +381 -153
- data/ext/{fox14 → fox16}/extconf.rb +8 -8
- data/ext/{fox14 → fox16}/frames_wrap.cpp +1590 -1219
- data/ext/{fox14 → fox16}/fx3d_wrap.cpp +1060 -403
- data/ext/{fox14 → fox16}/iconlist_wrap.cpp +80 -25
- data/ext/{fox14 → fox16}/icons_wrap.cpp +296 -316
- data/ext/{fox14 → fox16}/image_wrap.cpp +267 -153
- data/ext/{fox14 → fox16}/impl.cpp +29 -0
- data/ext/{fox14 → fox16}/include/FXMemoryBuffer.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRb4Splitter.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRb7Segment.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbAccelTable.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbApp.h +3 -3
- data/ext/{fox14 → fox16}/include/FXRbAppVirtuals.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbArrowButton.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbBMPIcon.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbBMPImage.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbBitmap.h +23 -5
- data/ext/{fox14 → fox16}/include/FXRbBitmapFrame.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbBitmapView.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbBitmapVirtuals.h +12 -2
- data/ext/{fox14 → fox16}/include/FXRbButton.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbCURCursor.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbCanvas.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbCheckButton.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbChoiceBox.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbColorBar.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbColorDialog.h +1 -1
- data/ext/fox16/include/FXRbColorList.h +84 -0
- data/ext/fox16/include/FXRbColorRing.h +51 -0
- data/ext/{fox14 → fox16}/include/FXRbColorSelector.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbColorWell.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbColorWheel.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbComboBox.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbCommon.h +4 -1
- data/ext/{fox14 → fox16}/include/FXRbComposite.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbCursor.h +5 -5
- data/ext/{fox14 → fox16}/include/FXRbCursorVirtuals.h +2 -2
- data/ext/{fox14 → fox16}/include/FXRbDC.h +18 -0
- data/ext/{fox14 → fox16}/include/FXRbDCPrint.h +0 -0
- data/ext/{fox14 → fox16}/include/FXRbDCVirtuals.h +9 -0
- data/ext/{fox14 → fox16}/include/FXRbDCWindow.h +0 -0
- data/ext/{fox14 → fox16}/include/FXRbDataTarget.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbDebugTarget.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbDelegator.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbDial.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbDialogBox.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbDialogBoxVirtuals.h +0 -0
- data/ext/{fox14 → fox16}/include/FXRbDict.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbDirBox.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbDirDialog.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbDirList.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbDirSelector.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbDockBar.h +13 -13
- data/ext/{fox14 → fox16}/include/FXRbDockBarVirtuals.h +3 -3
- data/ext/{fox14 → fox16}/include/FXRbDockHandler.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbDockSite.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbDockSiteVirtuals.h +0 -0
- data/ext/{fox14 → fox16}/include/FXRbDockTitle.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbDocument.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbDragCorner.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbDrawable.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbDrawableVirtuals.h +0 -0
- data/ext/{fox14 → fox16}/include/FXRbDriveBox.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbFileDialog.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbFileDict.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbFileDictVirtuals.h +0 -0
- data/ext/{fox14 → fox16}/include/FXRbFileList.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbFileSelector.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbFoldingItemVirtuals.h +0 -0
- data/ext/{fox14 → fox16}/include/FXRbFoldingList.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbFoldingListVirtuals.h +0 -0
- data/ext/fox16/include/FXRbFont.h +183 -0
- data/ext/{fox14 → fox16}/include/FXRbFontDialog.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbFontSelector.h +1 -1
- data/ext/fox16/include/FXRbFontVirtuals.h +55 -0
- data/ext/{fox14 → fox16}/include/FXRbFrame.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbGIFCursor.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbGIFIcon.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbGIFImage.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbGLCanvas.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbGLCanvasVirtuals.h +0 -0
- data/ext/{fox14 → fox16}/include/FXRbGLContext.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbGLObject.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbGLObjectVirtuals.h +0 -0
- data/ext/{fox14 → fox16}/include/FXRbGLShape.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbGLShapeVirtuals.h +0 -0
- data/ext/{fox14 → fox16}/include/FXRbGLViewer.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbGLViewerVirtuals.h +0 -0
- data/ext/{fox14 → fox16}/include/FXRbGLVisual.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbGradientBar.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbGroupBox.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbHeader.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbHeaderItemVirtuals.h +0 -0
- data/ext/{fox14 → fox16}/include/FXRbHorizontalFrame.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbICOIcon.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbICOImage.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbIcon.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbIconItemVirtuals.h +0 -0
- data/ext/{fox14 → fox16}/include/FXRbIconList.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbIconListVirtuals.h +0 -0
- data/ext/fox16/include/FXRbIconSource.h +127 -0
- data/ext/fox16/include/FXRbIconSourceVirtuals.h +37 -0
- data/ext/{fox14 → fox16}/include/FXRbId.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbIdVirtuals.h +0 -0
- data/ext/{fox14 → fox16}/include/FXRbImage.h +7 -7
- data/ext/{fox14 → fox16}/include/FXRbImageFrame.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbImageView.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbImageVirtuals.h +3 -3
- data/ext/{fox14 → fox16}/include/FXRbInputDialog.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbJPGIcon.h +2 -2
- data/ext/{fox14 → fox16}/include/FXRbJPGImage.h +2 -2
- data/ext/fox16/include/FXRbKnob.h +51 -0
- data/ext/{fox14 → fox16}/include/FXRbLabel.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbList.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbListBox.h +5 -5
- data/ext/{fox14 → fox16}/include/FXRbListBoxVirtuals.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbListItemVirtuals.h +0 -0
- data/ext/{fox14 → fox16}/include/FXRbListVirtuals.h +0 -0
- data/ext/{fox14 → fox16}/include/FXRbMDIButton.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbMDIChild.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbMDIChildVirtuals.h +0 -0
- data/ext/{fox14 → fox16}/include/FXRbMDIClient.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbMDIClientVirtuals.h +0 -0
- data/ext/{fox14 → fox16}/include/FXRbMainWindow.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbMatrix.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbMenuBar.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbMenuButton.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbMenuCaption.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbMenuCascade.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbMenuCheck.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbMenuCommand.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbMenuPane.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbMenuRadio.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbMenuSeparator.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbMenuTitle.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbMessageBox.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbObject.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbObjectVirtuals.h +0 -0
- data/ext/{fox14 → fox16}/include/FXRbOptionMenu.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbPCXIcon.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbPCXImage.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbPNGIcon.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbPNGImage.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbPPMIcon.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbPPMImage.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbPacker.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbPicker.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbPopup.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbPopupVirtuals.h +0 -0
- data/ext/{fox14 → fox16}/include/FXRbPrintDialog.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbProgressBar.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbProgressDialog.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbRGBIcon.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbRGBImage.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbRadioButton.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbRealSlider.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbRealSpinner.h +5 -5
- data/ext/fox16/include/FXRbRealSpinnerVirtuals.h +3 -0
- data/ext/{fox14 → fox16}/include/FXRbRecentFiles.h +6 -3
- data/ext/{fox14 → fox16}/include/FXRbRegistry.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbReplaceDialog.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbRootWindow.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbRuler.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbScintilla.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbScrollArea.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbScrollAreaVirtuals.h +0 -0
- data/ext/{fox14 → fox16}/include/FXRbScrollBar.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbScrollPane.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbScrollWindow.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbSearchDialog.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbSeparator.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbSettings.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbShell.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbShutter.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbShutterVirtuals.h +0 -0
- data/ext/{fox14 → fox16}/include/FXRbSlider.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbSpinner.h +5 -5
- data/ext/{fox14 → fox16}/include/FXRbSpinnerVirtuals.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbSplashWindow.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbSplitter.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbSpring.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbStatusBar.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbStatusLine.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbStream.h +7 -7
- data/ext/{fox14 → fox16}/include/FXRbStreamVirtuals.h +3 -3
- data/ext/{fox14 → fox16}/include/FXRbStringDict.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbSwitcher.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbTGAIcon.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbTGAImage.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbTIFIcon.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbTIFImage.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbTabBar.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbTabBarVirtuals.h +0 -0
- data/ext/{fox14 → fox16}/include/FXRbTabBook.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbTabItem.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbTable.h +9 -3
- data/ext/{fox14 → fox16}/include/FXRbTableItemVirtuals.h +0 -0
- data/ext/{fox14 → fox16}/include/FXRbTableVirtuals.h +3 -0
- data/ext/fox16/include/FXRbText.h +187 -0
- data/ext/{fox14 → fox16}/include/FXRbTextField.h +1 -1
- data/ext/fox16/include/FXRbTextVirtuals.h +52 -0
- data/ext/{fox14 → fox16}/include/FXRbToggleButton.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbToolBar.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbToolBarGrip.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbToolBarShell.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbToolBarTab.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbToolTip.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbTopWindow.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbTopWindowVirtuals.h +0 -0
- data/ext/fox16/include/FXRbTranslator.h +61 -0
- data/ext/fox16/include/FXRbTranslatorVirtuals.h +4 -0
- data/ext/{fox14 → fox16}/include/FXRbTreeItemVirtuals.h +0 -0
- data/ext/{fox14 → fox16}/include/FXRbTreeList.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbTreeListBox.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbTreeListBoxVirtuals.h +0 -0
- data/ext/{fox14 → fox16}/include/FXRbTreeListVirtuals.h +0 -0
- data/ext/{fox14 → fox16}/include/FXRbTriStateButton.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbVerticalFrame.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbVisual.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbWindow.h +27 -9
- data/ext/{fox14 → fox16}/include/FXRbWindowVirtuals.h +13 -4
- data/ext/{fox14 → fox16}/include/FXRbWizard.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbXBMIcon.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbXBMImage.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbXPMIcon.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRbXPMImage.h +1 -1
- data/ext/{fox14 → fox16}/include/FXRuby.h +43 -18
- data/ext/{fox14 → fox16}/include/impl.h +5 -0
- data/ext/{fox14 → fox16}/include/inlinestubs.h +29 -0
- data/ext/{fox14 → fox16}/label_wrap.cpp +319 -122
- data/ext/{fox14 → fox16}/layout_wrap.cpp +443 -153
- data/ext/{fox14 → fox16}/librb.c +0 -0
- data/ext/{fox14 → fox16}/list_wrap.cpp +660 -44
- data/ext/{fox14 → fox16}/markfuncs.cpp +38 -8
- data/ext/{fox14 → fox16}/mdi_wrap.cpp +253 -109
- data/ext/{fox14 → fox16}/menu_wrap.cpp +342 -146
- data/ext/{fox14 → fox16}/scintilla_wrap.cpp +58 -39
- data/ext/{fox14 → fox16}/table_wrap.cpp +294 -82
- data/ext/{fox14 → fox16}/text_wrap.cpp +203 -193
- data/ext/{fox14 → fox16}/treelist_wrap.cpp +125 -60
- data/ext/{fox14 → fox16}/ui_wrap.cpp +993 -714
- data/ext/{fox14 → fox16}/unregisterOwnedObjects.cpp +6 -1
- data/lib/{fox14 → fox16}/aliases.rb +119 -46
- data/lib/{fox14 → fox16}/calendar.rb +2 -2
- data/lib/{fox14 → fox16}/chore.rb +6 -22
- data/lib/{fox14 → fox16}/colors.rb +1 -1
- data/lib/{fox14 → fox16}/core.rb +122 -4
- data/lib/{fox14 → fox16}/dict.rb +0 -0
- data/lib/{fox14 → fox16}/execute_nonmodal.rb +0 -0
- data/lib/{fox14 → fox16}/glgroup.rb +4 -2
- data/lib/{fox14 → fox16}/glshapes.rb +1 -1
- data/lib/{fox14 → fox16}/input.rb +1 -1
- data/lib/{fox14 → fox16}/irb.rb +1 -1
- data/lib/{fox14 → fox16}/iterators.rb +1 -1
- data/lib/{fox14 → fox16}/keys.rb +2 -2
- data/lib/{fox14 → fox16}/missingdep.rb +1 -1
- data/lib/{fox14 → fox16}/pseudokeyboard.rb +1 -1
- data/lib/{fox14 → fox16}/pseudomouse.rb +1 -1
- data/lib/{fox14 → fox16}/responder.rb +1 -1
- data/lib/{fox14 → fox16}/responder2.rb +5 -5
- data/lib/{fox14 → fox16}/scintilla.rb +249 -12
- data/lib/{fox14 → fox16}/settings.rb +0 -0
- data/lib/{fox14 → fox16}/signal.rb +1 -1
- data/lib/{fox14 → fox16}/splashscreen.rb +2 -2
- data/lib/{fox14 → fox16}/timeout.rb +10 -37
- data/lib/{fox14 → fox16}/undolist.rb +2 -2
- data/lib/{fox14 → fox16}/version.rb +2 -2
- data/rdoc-sources/FX4Splitter.rb +24 -6
- data/rdoc-sources/FX7Segment.rb +6 -0
- data/rdoc-sources/FXAccelTable.rb +35 -0
- data/rdoc-sources/FXApp.rb +113 -1
- data/rdoc-sources/FXBMPIcon.rb +5 -0
- data/rdoc-sources/FXBMPImage.rb +5 -0
- data/rdoc-sources/FXBitmap.rb +23 -1
- data/rdoc-sources/FXCheckButton.rb +7 -0
- data/rdoc-sources/FXColorList.rb +55 -0
- data/rdoc-sources/FXColorRing.rb +49 -0
- data/rdoc-sources/FXColorWheel.rb +22 -2
- data/rdoc-sources/FXComboBox.rb +10 -0
- data/rdoc-sources/FXDC.rb +18 -0
- data/rdoc-sources/FXDial.rb +34 -1
- data/rdoc-sources/FXDirList.rb +1 -0
- data/rdoc-sources/FXDockBar.rb +21 -6
- data/rdoc-sources/FXDockHandler.rb +7 -0
- data/rdoc-sources/FXDockSite.rb +18 -0
- data/rdoc-sources/FXExtentd.rb +85 -0
- data/rdoc-sources/FXExtentf.rb +85 -0
- data/rdoc-sources/FXFileDialog.rb +11 -0
- data/rdoc-sources/FXFileDict.rb +7 -7
- data/rdoc-sources/FXFileList.rb +22 -0
- data/rdoc-sources/FXFileSelector.rb +10 -0
- data/rdoc-sources/FXFoldingList.rb +13 -2
- data/rdoc-sources/FXFont.rb +68 -62
- data/rdoc-sources/FXGIFIcon.rb +5 -0
- data/rdoc-sources/FXGIFImage.rb +5 -0
- data/rdoc-sources/FXGLViewer.rb +23 -0
- data/rdoc-sources/FXGradientBar.rb +10 -0
- data/rdoc-sources/FXHeader.rb +11 -0
- data/rdoc-sources/FXICOIcon.rb +5 -0
- data/rdoc-sources/FXICOImage.rb +5 -0
- data/rdoc-sources/FXIconList.rb +8 -0
- data/rdoc-sources/FXIconSource.rb +12 -12
- data/rdoc-sources/FXImage.rb +0 -4
- data/rdoc-sources/FXInputDialog.rb +19 -6
- data/rdoc-sources/FXJPGIcon.rb +5 -0
- data/rdoc-sources/FXJPGImage.rb +5 -0
- data/rdoc-sources/FXKnob.rb +76 -0
- data/rdoc-sources/FXList.rb +8 -0
- data/rdoc-sources/FXListBox.rb +7 -1
- data/rdoc-sources/FXMenuCaption.rb +3 -0
- data/rdoc-sources/FXMenuCheck.rb +2 -2
- data/rdoc-sources/FXMenuCommand.rb +1 -2
- data/rdoc-sources/FXMenuRadio.rb +5 -2
- data/rdoc-sources/FXOptionMenu.rb +7 -0
- data/rdoc-sources/FXPCXIcon.rb +5 -0
- data/rdoc-sources/FXPCXImage.rb +5 -0
- data/rdoc-sources/FXPNGIcon.rb +5 -0
- data/rdoc-sources/FXPNGImage.rb +5 -0
- data/rdoc-sources/FXPPMIcon.rb +5 -0
- data/rdoc-sources/FXPPMImage.rb +5 -0
- data/rdoc-sources/FXQuatd.rb +5 -12
- data/rdoc-sources/FXQuatf.rb +5 -7
- data/rdoc-sources/FXRGBIcon.rb +5 -0
- data/rdoc-sources/FXRGBImage.rb +5 -0
- data/rdoc-sources/FXRadioButton.rb +6 -0
- data/rdoc-sources/FXRanged.rb +3 -0
- data/rdoc-sources/FXRangef.rb +3 -0
- data/rdoc-sources/FXRealSlider.rb +3 -1
- data/rdoc-sources/FXRealSpinner.rb +11 -4
- data/rdoc-sources/FXRecentFiles.rb +10 -6
- data/rdoc-sources/FXRectangle.rb +12 -0
- data/rdoc-sources/FXRuler.rb +28 -0
- data/rdoc-sources/FXScrollBar.rb +9 -3
- data/rdoc-sources/FXScrollPane.rb +3 -0
- data/rdoc-sources/FXSettings.rb +26 -0
- data/rdoc-sources/FXSize.rb +65 -0
- data/rdoc-sources/FXSlider.rb +2 -0
- data/rdoc-sources/FXSphered.rb +12 -0
- data/rdoc-sources/FXSpheref.rb +12 -0
- data/rdoc-sources/FXSpinner.rb +8 -4
- data/rdoc-sources/FXTGAIcon.rb +5 -0
- data/rdoc-sources/FXTGAImage.rb +5 -0
- data/rdoc-sources/FXTIFIcon.rb +5 -0
- data/rdoc-sources/FXTIFImage.rb +5 -0
- data/rdoc-sources/FXTabBar.rb +5 -1
- data/rdoc-sources/FXTabBook.rb +3 -0
- data/rdoc-sources/FXTabItem.rb +7 -0
- data/rdoc-sources/FXTable.rb +96 -18
- data/rdoc-sources/FXText.rb +47 -12
- data/rdoc-sources/FXTextField.rb +6 -0
- data/rdoc-sources/FXToggleButton.rb +0 -1
- data/rdoc-sources/FXTopWindow.rb +44 -2
- data/rdoc-sources/FXTranslator.rb +32 -0
- data/rdoc-sources/FXTreeList.rb +8 -0
- data/rdoc-sources/FXTreeListBox.rb +20 -0
- data/rdoc-sources/{FXVec.rb → FXVec2d.rb} +28 -29
- data/rdoc-sources/FXVec2f.rb +96 -0
- data/rdoc-sources/FXVec3d.rb +113 -0
- data/rdoc-sources/FXVec3f.rb +113 -0
- data/rdoc-sources/FXVec4d.rb +129 -0
- data/rdoc-sources/FXVec4f.rb +129 -0
- data/rdoc-sources/FXWindow.rb +89 -14
- data/rdoc-sources/FXXBMIcon.rb +5 -0
- data/rdoc-sources/FXXBMImage.rb +5 -0
- data/rdoc-sources/FXXPMIcon.rb +5 -0
- data/rdoc-sources/FXXPMImage.rb +5 -0
- data/rdoc-sources/README.rdoc +1 -1
- data/tests/TC_FXAccelTable.rb +1 -1
- data/tests/TC_FXApp.rb +1 -1
- data/tests/TC_FXArc.rb +1 -1
- data/tests/TC_FXBMPIcon.rb +1 -1
- data/tests/TC_FXBMPImage.rb +1 -1
- data/tests/TC_FXButton.rb +1 -1
- data/tests/TC_FXCheckButton.rb +1 -1
- data/tests/TC_FXComboBox.rb +2 -1
- data/tests/TC_FXDC.rb +1 -1
- data/tests/TC_FXDCPrint.rb +1 -1
- data/tests/TC_FXDCWindow.rb +1 -1
- data/tests/TC_FXDataTarget.rb +1 -1
- data/tests/TC_FXDirList.rb +2 -2
- data/tests/TC_FXFileAssoc.rb +1 -1
- data/tests/TC_FXFileStream.rb +1 -1
- data/tests/TC_FXFont.rb +2 -2
- data/tests/TC_FXFontDesc.rb +15 -19
- data/tests/TC_FXGLGroup.rb +1 -1
- data/tests/TC_FXGLShape.rb +1 -1
- data/tests/TC_FXGLViewer.rb +1 -3
- data/tests/TC_FXGradientBar.rb +1 -1
- data/tests/TC_FXHeader.rb +2 -2
- data/tests/TC_FXIconDict.rb +1 -1
- data/tests/TC_FXIconList.rb +2 -2
- data/tests/TC_FXId.rb +2 -2
- data/tests/TC_FXImage.rb +1 -1
- data/tests/TC_FXLight.rb +1 -1
- data/tests/TC_FXList.rb +2 -12
- data/tests/TC_FXListBox.rb +2 -2
- data/tests/TC_FXMat4f.rb +1 -1
- data/tests/TC_FXMaterial.rb +2 -2
- data/tests/TC_FXMemoryStream.rb +1 -1
- data/tests/TC_FXMenuCheck.rb +1 -1
- data/tests/TC_FXMenuCommand.rb +15 -1
- data/tests/TC_FXMenuRadio.rb +1 -1
- data/tests/TC_FXPoint.rb +1 -1
- data/tests/TC_FXQuatf.rb +1 -1
- data/tests/TC_FXRadioButton.rb +1 -1
- data/tests/TC_FXRangef.rb +1 -1
- data/tests/TC_FXRectangle.rb +1 -1
- data/tests/TC_FXRegion.rb +1 -1
- data/tests/TC_FXRegistry.rb +1 -1
- data/tests/TC_FXScrollArea.rb +1 -1
- data/tests/TC_FXScrollWindow.rb +1 -1
- data/tests/TC_FXSegment.rb +1 -1
- data/tests/TC_FXSettings.rb +1 -1
- data/tests/TC_FXShell.rb +1 -1
- data/tests/TC_FXSize.rb +1 -1
- data/tests/TC_FXStream.rb +1 -1
- data/tests/TC_FXTable.rb +33 -1
- data/tests/TC_FXTableItem.rb +2 -2
- data/tests/TC_FXText.rb +2 -2
- data/tests/TC_FXTopWindow.rb +1 -1
- data/tests/TC_FXTreeList.rb +2 -2
- data/tests/TC_FXTreeListBox.rb +2 -2
- data/tests/TC_FXUndoList.rb +2 -2
- data/tests/TC_FXVec2d.rb +6 -6
- data/tests/TC_FXVec2f.rb +5 -5
- data/tests/TC_FXVec3d.rb +5 -5
- data/tests/TC_FXVec3f.rb +5 -5
- data/tests/TC_FXVec4f.rb +3 -3
- data/tests/TC_FXViewport.rb +1 -1
- data/tests/TC_FXXBMIcon.rb +1 -1
- data/tests/TC_FXXBMImage.rb +1 -1
- data/tests/TC_FXXPMIcon.rb +1 -1
- data/tests/TC_FXXPMImage.rb +1 -1
- data/tests/TC_Misc.rb +1 -1
- data/tests/TC_downcast.rb +1 -1
- data/tests/TS_All.rb +1 -2
- data/tests/stress1.rb +5 -5
- data/tests/stress2.rb +1 -1
- data/tests/stress3.rb +1 -1
- data/tests/testcase.rb +1 -1
- metadata +294 -280
- data/doc/changes.html +0 -433
- data/ext/fox14/include/FXRbFont.h +0 -70
- data/ext/fox14/include/FXRbIconSource.h +0 -127
- data/ext/fox14/include/FXRbIconSourceVirtuals.h +0 -37
- data/ext/fox14/include/FXRbRealSpinnerVirtuals.h +0 -3
- data/ext/fox14/include/FXRbText.h +0 -94
- data/ext/fox14/include/FXRbTextVirtuals.h +0 -9
- data/rdoc-sources/FXMat4.rb +0 -171
- data/rdoc-sources/FXVec4.rb +0 -91
data/doc/ch04s02.html
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<html><head>
|
|
2
2
|
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
|
3
|
-
<title>Acquiring the Clipboard</title><
|
|
4
|
-
the bottom of the main window for copying and pasting:</p><pre class="programlisting">require 'rubygems'
|
|
3
|
+
<title>Acquiring 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="clipboardtut.html" title="Chapter 4. Working With the Clipboard"><link rel="previous" href="clipboardtut.html" title="Chapter 4. Working With the Clipboard"><link rel="next" href="ch04s03.html" title="Sending Data to 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">Acquiring the Clipboard</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="clipboardtut.html">Prev</a> </td><th width="60%" align="center">Chapter 4. Working With the Clipboard</th><td width="20%" align="right"> <a accesskey="n" href="ch04s03.html">Next</a></td></tr></table><hr></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1005"></a>Acquiring the Clipboard</h2></div></div><div></div></div><p>Let's begin by augmenting the GUI to include a row of buttons along
|
|
4
|
+
the bottom of the main window for copying and pasting:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">require 'rubygems'
|
|
5
5
|
require_gem 'fxruby'
|
|
6
6
|
require 'customer'
|
|
7
7
|
|
|
@@ -11,14 +11,14 @@ class ClipMainWindow < FXMainWindow
|
|
|
11
11
|
def initialize(anApp)
|
|
12
12
|
# Initialize base class first
|
|
13
13
|
super(anApp, "Clipboard Example", nil, nil, DECOR_ALL, 0, 0, 400, 300)
|
|
14
|
-
<span class="bold"><
|
|
14
|
+
<span class="bold"><b>
|
|
15
15
|
# Horizontal frame contains buttons
|
|
16
16
|
buttons = FXHorizontalFrame.new(self, LAYOUT_SIDE_BOTTOM|LAYOUT_FILL_X|PACK_UNIFORM_WIDTH)
|
|
17
|
-
</
|
|
17
|
+
</b></span><span class="bold"><b>
|
|
18
18
|
# Cut and paste buttons
|
|
19
19
|
copyButton = FXButton.new(buttons, "Copy")
|
|
20
20
|
pasteButton = FXButton.new(buttons, "Paste")
|
|
21
|
-
</
|
|
21
|
+
</b></span>
|
|
22
22
|
# Place the list in a sunken frame
|
|
23
23
|
sunkenFrame = FXVerticalFrame.new(self, LAYOUT_FILL_X|LAYOUT_FILL_Y|FRAME_SUNKEN|FRAME_THICK,
|
|
24
24
|
0, 0, 0, 0, 0, 0, 0, 0)
|
|
@@ -43,12 +43,12 @@ if __FILE__ == $0
|
|
|
43
43
|
theApp.run
|
|
44
44
|
end
|
|
45
45
|
end
|
|
46
|
-
</pre><p>Note that the lines which appear in bold face are those which have
|
|
46
|
+
</pre></td></tr></table><p>Note that the lines which appear in bold face are those which have
|
|
47
47
|
been added (or changed) since the previous source code listing.</p><p>The clipboard is a kind of shared resource in the operating system.
|
|
48
48
|
Copying (or cutting) data to the clipboard begins with some window in your
|
|
49
49
|
application requesting "ownership" of the clipboard by calling the
|
|
50
|
-
<
|
|
51
|
-
handler for the "Copy" button press which does just that:</p><pre class="programlisting"># User clicks Copy
|
|
50
|
+
<tt class="methodname">acquireClipboard()</tt> instance method. Let's add a
|
|
51
|
+
handler for the "Copy" button press which does just that:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"># User clicks Copy
|
|
52
52
|
copyButton.connect(SEL_COMMAND) do
|
|
53
53
|
customer = customerList.getItemData(customerList.currentItem)
|
|
54
54
|
types = [ FXWindow.stringType ]
|
|
@@ -56,17 +56,17 @@ copyButton.connect(SEL_COMMAND) do
|
|
|
56
56
|
@clippedCustomer = customer
|
|
57
57
|
end
|
|
58
58
|
end
|
|
59
|
-
</pre><p>The <
|
|
59
|
+
</pre></td></tr></table><p>The <tt class="methodname">acquireClipboard()</tt> method takes as its
|
|
60
60
|
input an array of drag types. A <span class="emphasis"><em>drag type</em></span> is just a
|
|
61
61
|
unique value, assigned by the window system, that identifies a particular
|
|
62
62
|
kind of data. In this case, we're using one of FOX's pre-registered drag
|
|
63
|
-
types (<
|
|
63
|
+
types (<tt class="constant">stringType</tt>) to indicate that we have some
|
|
64
64
|
string data to place on the clipboard. Later, we'll see how to register
|
|
65
|
-
customized, application-specific drag types as well.</p><p>The <
|
|
66
|
-
<
|
|
67
|
-
<
|
|
65
|
+
customized, application-specific drag types as well.</p><p>The <tt class="methodname">acquireClipboard()</tt> method returns
|
|
66
|
+
<tt class="constant">true</tt> on success; since we called
|
|
67
|
+
<tt class="methodname">acquireClipboard()</tt> on the main window, this means
|
|
68
68
|
that the main window is now the clipboard owner. At this time, we want to
|
|
69
69
|
save a reference to the currently selected customer in the
|
|
70
|
-
<
|
|
70
|
+
<tt class="varname">@clippedCustomer</tt> instance variable so that if its value
|
|
71
71
|
is requested later, we'll be able to return the
|
|
72
72
|
<span class="emphasis"><em>correct</em></span> customer's information.</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="clipboardtut.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="clipboardtut.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch04s03.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 4. Working With the Clipboard </td><td width="20%" align="center"><a accesskey="h" href="book.html">Home</a></td><td width="40%" align="right" valign="top"> Sending Data to the Clipboard</td></tr></table></div></body></html>
|
data/doc/ch04s03.html
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
<html><head>
|
|
2
2
|
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
|
3
|
-
<title>Sending Data to the Clipboard</title><
|
|
3
|
+
<title>Sending Data to 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="clipboardtut.html" title="Chapter 4. Working With the Clipboard"><link rel="previous" href="ch04s02.html" title="Acquiring the Clipboard"><link rel="next" href="ch04s04.html" title="Pasting Data from 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">Sending Data to the Clipboard</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch04s02.html">Prev</a> </td><th width="60%" align="center">Chapter 4. Working With the Clipboard</th><td width="20%" align="right"> <a accesskey="n" href="ch04s04.html">Next</a></td></tr></table><hr></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1054"></a>Sending Data to the Clipboard</h2></div></div><div></div></div><p>Whenever some other window requests the clipboard's contents (e.g.
|
|
4
4
|
as a result of a "paste" operation) FOX will send a
|
|
5
|
-
<
|
|
5
|
+
<tt class="constant">SEL_CLIPBOARD_REQUEST</tt> message to the current
|
|
6
6
|
clipboard owner. Remember, the clipboard owner is the window that called
|
|
7
|
-
<
|
|
7
|
+
<tt class="methodname">acquireClipboard()</tt>. For our example, the main
|
|
8
8
|
window is acting as the clipboard owner and so it needs to handle the
|
|
9
|
-
<
|
|
9
|
+
<tt class="constant">SEL_CLIPBOARD_REQUEST</tt> message:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"># Handle clipboard request
|
|
10
10
|
self.connect(SEL_CLIPBOARD_REQUEST) do
|
|
11
11
|
setDNDData(FROM_CLIPBOARD, FXWindow.stringType, Fox.fxencodeStringData(@clippedCustomer.to_s))
|
|
12
12
|
end
|
|
13
|
-
</pre><p>The <
|
|
13
|
+
</pre></td></tr></table><p>The <tt class="methodname">setDNDData()</tt> method takes three
|
|
14
14
|
arguments. The first argument tells FOX which kind of data transfer we're
|
|
15
15
|
trying to accomplish; as it turns out, this method can be used for
|
|
16
|
-
drag-and-drop (<
|
|
17
|
-
(<
|
|
18
|
-
argument to <
|
|
16
|
+
drag-and-drop (<tt class="constant">FROM_DRAGNDROP</tt>) and X11 selection
|
|
17
|
+
(<tt class="constant">FROM_SELECTION</tt>) data transfer as well. The second
|
|
18
|
+
argument to <tt class="methodname">setDNDData()</tt> is the drag type for the
|
|
19
19
|
data and the last argument is the data itself, a binary string.</p><p>If you're wondering why we need to call the
|
|
20
|
-
<
|
|
21
|
-
the string returned by the call to <
|
|
20
|
+
<tt class="methodname">fxencodeStringData()</tt> module method to preprocess
|
|
21
|
+
the string returned by the call to <tt class="methodname">Customer#to_s</tt>,
|
|
22
22
|
that's a reasonable thing to wonder about. In order for FOX to play nice
|
|
23
23
|
with other clipboard-aware applications, it must be able to store string
|
|
24
24
|
data on the clipboard in the format expected by those applications.
|
|
25
25
|
Unfortunately, that expected format is platform-dependent and does not
|
|
26
26
|
always correspond directly to the format that Ruby uses internally to
|
|
27
|
-
store its string data. The <
|
|
27
|
+
store its string data. The <tt class="methodname">fxencodeStringData()</tt>
|
|
28
28
|
method (and the corresponding
|
|
29
|
-
<
|
|
29
|
+
<tt class="methodname">fxdecodeStringData()</tt> method) provide you with a
|
|
30
30
|
platform-independent way of sending (or receiving) string data with the
|
|
31
|
-
<
|
|
31
|
+
<tt class="constant">stringType</tt> drag type.</p><p>If you run the program as it currently stands, you should now be
|
|
32
32
|
able to select a customer from the list, click the "Copy" button and then
|
|
33
33
|
paste the selected customer data (as a string) into some other
|
|
34
34
|
application. For example, if you're trying this tutorial on a Windows
|
|
35
35
|
machine, try pasting into a copy of Notepad or Microsoft Word. The pasted
|
|
36
|
-
text should look something like:</p><pre class="programlisting">#<struct Struct::Customer name="Joe Smith", address="123 Maple, Anytown, NC", zip=12345>
|
|
37
|
-
</pre></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch04s02.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="clipboardtut.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch04s04.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Acquiring the Clipboard </td><td width="20%" align="center"><a accesskey="h" href="book.html">Home</a></td><td width="40%" align="right" valign="top"> Pasting Data from the Clipboard</td></tr></table></div></body></html>
|
|
36
|
+
text should look something like:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">#<struct Struct::Customer name="Joe Smith", address="123 Maple, Anytown, NC", zip=12345>
|
|
37
|
+
</pre></td></tr></table></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch04s02.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="clipboardtut.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch04s04.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Acquiring the Clipboard </td><td width="20%" align="center"><a accesskey="h" href="book.html">Home</a></td><td width="40%" align="right" valign="top"> Pasting Data from the Clipboard</td></tr></table></div></body></html>
|
data/doc/ch04s04.html
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
1
|
<html><head>
|
|
2
2
|
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
|
3
|
-
<title>Pasting Data from the Clipboard</title><
|
|
3
|
+
<title>Pasting Data from 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="clipboardtut.html" title="Chapter 4. Working With the Clipboard"><link rel="previous" href="ch04s03.html" title="Sending Data to the Clipboard"><link rel="next" href="dragdroptut.html" title="Chapter 5. Drag and Drop"></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">Pasting Data from the Clipboard</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch04s03.html">Prev</a> </td><th width="60%" align="center">Chapter 4. Working With the Clipboard</th><td width="20%" align="right"> <a accesskey="n" href="dragdroptut.html">Next</a></td></tr></table><hr></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1105"></a>Pasting Data from the Clipboard</h2></div></div><div></div></div><p>We've seen one side of the equation, copying string data to the
|
|
4
4
|
clipboard. But before we can "round-trip" that customer data and paste it
|
|
5
5
|
back into another copy of our customer list application, we're clearly
|
|
6
6
|
going to need to transfer the data in some more useful format. That is to
|
|
7
7
|
say, if we were to receive the customer data in the format that it's
|
|
8
|
-
currently stored on the clipboard:</p><pre class="programlisting">#<struct Struct::Customer name="Joe Smith", address="123 Maple, Anytown, NC", zip=12345>
|
|
9
|
-
</pre><p>We'd have to parse that string and try to extract the relevant data
|
|
8
|
+
currently stored on the clipboard:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">#<struct Struct::Customer name="Joe Smith", address="123 Maple, Anytown, NC", zip=12345>
|
|
9
|
+
</pre></td></tr></table><p>We'd have to parse that string and try to extract the relevant data
|
|
10
10
|
from it. We can do better than that. The approach we'll use instead is to
|
|
11
11
|
serialize and deserialize the objects using YAML. First, make sure that
|
|
12
|
-
the YAML module is loaded by adding this line:</p><pre class="programlisting">require 'yaml'</pre><p>somewhere near the top of the program. Next, register a custom drag
|
|
13
|
-
type for <
|
|
14
|
-
one line to our main window's <
|
|
15
|
-
method:</p><pre class="programlisting">def create
|
|
12
|
+
the YAML module is loaded by adding this line:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">require 'yaml'</pre></td></tr></table><p>somewhere near the top of the program. Next, register a custom drag
|
|
13
|
+
type for <tt class="classname">Customer</tt> objects. We can do that by adding
|
|
14
|
+
one line to our main window's <tt class="methodname">create</tt> instance
|
|
15
|
+
method:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">def create
|
|
16
16
|
super
|
|
17
|
-
<span class="bold"><
|
|
18
|
-
</
|
|
17
|
+
<span class="bold"><b> @customerDragType = getApp().registerDragType("application/x-customer")
|
|
18
|
+
</b></span> show(PLACEMENT_SCREEN)
|
|
19
19
|
end
|
|
20
|
-
</pre><p>Note that by convention, the name of the drag type is the MIME type
|
|
20
|
+
</pre></td></tr></table><p>Note that by convention, the name of the drag type is the MIME type
|
|
21
21
|
for the data, but any unique string will do. In our case, we'll use the
|
|
22
22
|
string "application/x-customer" to identify the drag type for our
|
|
23
|
-
YAML-serialized <
|
|
23
|
+
YAML-serialized <tt class="classname">Customer</tt> objects.</p><p>With that in place, we can now go back and slightly change some of
|
|
24
24
|
our previous code. When we acquire the clipboard, we'd now like to be able
|
|
25
25
|
to offer the selected customer's information either as plain text (i.e.
|
|
26
26
|
the previous format) <span class="emphasis"><em>or</em></span> as a YAML document, so we'll
|
|
27
27
|
include <span class="emphasis"><em>both</em></span> of these types in the array of drag
|
|
28
|
-
types passed to <
|
|
28
|
+
types passed to <tt class="methodname">acquireClipboard()</tt>:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"># User clicks Copy
|
|
29
29
|
copyButton.connect(SEL_COMMAND) do
|
|
30
30
|
customer = customerList.getItemData(customerList.currentItem)
|
|
31
|
-
<span class="bold"><
|
|
32
|
-
</
|
|
31
|
+
<span class="bold"><b> types = [ FXWindow.stringType, @customerDragType ]
|
|
32
|
+
</b></span> if acquireClipboard(types)
|
|
33
33
|
@clippedCustomer = customer
|
|
34
34
|
end
|
|
35
35
|
end
|
|
36
|
-
</pre><p>Similarly, when we're handling the
|
|
37
|
-
<
|
|
36
|
+
</pre></td></tr></table><p>Similarly, when we're handling the
|
|
37
|
+
<tt class="constant">SEL_CLIPBOARD_REQUEST</tt> message, we now need to pay
|
|
38
38
|
attention to which drag type (i.e. which data format) the requestor
|
|
39
39
|
specified. We can do that by inspecting the
|
|
40
|
-
<
|
|
41
|
-
<
|
|
42
|
-
<
|
|
40
|
+
<tt class="methodname">target</tt> attribute of the
|
|
41
|
+
<tt class="classname">FXEvent</tt> instance passed along with the
|
|
42
|
+
<tt class="constant">SEL_CLIPBOARD_REQUEST</tt> message:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"># Handle clipboard request
|
|
43
43
|
self.connect(SEL_CLIPBOARD_REQUEST) do |sender, sel, event|
|
|
44
44
|
case event.target
|
|
45
45
|
when FXWindow.stringType
|
|
@@ -50,9 +50,9 @@ self.connect(SEL_CLIPBOARD_REQUEST) do |sender, sel, event|
|
|
|
50
50
|
# Ignore requests for unrecognized drag types
|
|
51
51
|
end
|
|
52
52
|
end
|
|
53
|
-
</pre><p>With these changes in place, we can now add a handler for the
|
|
53
|
+
</pre></td></tr></table><p>With these changes in place, we can now add a handler for the
|
|
54
54
|
"Paste" button which requests the clipboard data in YAML format,
|
|
55
|
-
deserializes it, and then adds an item to the customer list:</p><pre class="programlisting"># User clicks Paste
|
|
55
|
+
deserializes it, and then adds an item to the customer list:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"># User clicks Paste
|
|
56
56
|
pasteButton.connect(SEL_COMMAND) do
|
|
57
57
|
data = getDNDData(FROM_CLIPBOARD, @customerDragType)
|
|
58
58
|
if data
|
|
@@ -60,13 +60,13 @@ pasteButton.connect(SEL_COMMAND) do
|
|
|
60
60
|
customerList.appendItem(customer.name, nil, customer)
|
|
61
61
|
end
|
|
62
62
|
end
|
|
63
|
-
</pre><p>The <
|
|
64
|
-
inverse of the <
|
|
63
|
+
</pre></td></tr></table><p>The <tt class="methodname">getDNDData()</tt> method used here is the
|
|
64
|
+
inverse of the <tt class="methodname">setDNDData()</tt> method we used
|
|
65
65
|
earlier to push data to some other application requesting our clipboard
|
|
66
|
-
data. As with <
|
|
67
|
-
<
|
|
68
|
-
we're performing (e.g. <
|
|
66
|
+
data. As with <tt class="methodname">setDNDData()</tt>, the arguments to
|
|
67
|
+
<tt class="methodname">getDNDData()</tt> indicate the kind of data transfer
|
|
68
|
+
we're performing (e.g. <tt class="constant">FROM_CLIPBOARD</tt>) and the drag
|
|
69
69
|
type for the data we're requesting. If some failure occurs (usually,
|
|
70
70
|
because the clipboard owner can't provide its data in the requested
|
|
71
|
-
format) <
|
|
72
|
-
<
|
|
71
|
+
format) <tt class="methodname">getDNDData()</tt> will simply return
|
|
72
|
+
<tt class="constant">nil</tt>.</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch04s03.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="clipboardtut.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="dragdroptut.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Sending Data to the Clipboard </td><td width="20%" align="center"><a accesskey="h" href="book.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 5. Drag and Drop</td></tr></table></div></body></html>
|
data/doc/ch05s02.html
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<html><head>
|
|
2
2
|
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
|
3
|
-
<title>Drag Sources</title><
|
|
4
|
-
consisting of a main window widget (a <
|
|
5
|
-
instance) that parents an <
|
|
3
|
+
<title>Drag Sources</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="dragdroptut.html" title="Chapter 5. Drag and Drop"><link rel="previous" href="dragdroptut.html" title="Chapter 5. Drag and Drop"><link rel="next" href="ch05s03.html" title="Putting It All Together"></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">Drag Sources</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="dragdroptut.html">Prev</a> </td><th width="60%" align="center">Chapter 5. Drag and Drop</th><td width="20%" align="right"> <a accesskey="n" href="ch05s03.html">Next</a></td></tr></table><hr></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1353"></a>Drag Sources</h2></div></div><div></div></div><p>As before, we're going to start by presenting a skeleton application
|
|
4
|
+
consisting of a main window widget (a <tt class="classname">DragSource</tt>
|
|
5
|
+
instance) that parents an <tt class="classname">FXCanvas</tt> widget:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">require 'rubygems'
|
|
6
6
|
require_gem 'fxruby'
|
|
7
7
|
|
|
8
8
|
include Fox
|
|
@@ -45,22 +45,22 @@ if __FILE__ == $0
|
|
|
45
45
|
end
|
|
46
46
|
end
|
|
47
47
|
|
|
48
|
-
</pre><p>Since the main program (i.e. the part at the end) won't change for
|
|
48
|
+
</pre></td></tr></table><p>Since the main program (i.e. the part at the end) won't change for
|
|
49
49
|
the rest of the tutorial, I won't show that code anymore. Furthermore, the
|
|
50
|
-
<
|
|
51
|
-
the <
|
|
52
|
-
namely:</p><div class="itemizedlist"><ul type="disc"><li><p>We've defined a <
|
|
50
|
+
<tt class="classname">DragSource</tt> class has a few things in common with
|
|
51
|
+
the <tt class="classname">DropSite</tt> class from the previous example,
|
|
52
|
+
namely:</p><div class="itemizedlist"><ul type="disc"><li><p>We've defined a <tt class="constant">SEL_PAINT</tt> handler for the
|
|
53
53
|
canvas widget that just clears the canvas to its current background
|
|
54
54
|
color; and,</p></li><li><p>The drag type for colors
|
|
55
|
-
(<
|
|
56
|
-
<
|
|
55
|
+
(<tt class="constant">FXWindow.colorType</tt>) is registered in the
|
|
56
|
+
<tt class="classname">DragSource</tt>'s <tt class="methodname">create()</tt>
|
|
57
57
|
method.</p></li></ul></div><p>As before, you may want to run this basic version of the program to
|
|
58
58
|
be sure that it's working properly so far. You should simply see an empty
|
|
59
59
|
window with a red background.</p><p>Now for this application, we want a drag operation to begin when the
|
|
60
60
|
user presses the left mouse button inside the canvas and starts "dragging"
|
|
61
61
|
away from the canvas. So the first change we need to make is to add a
|
|
62
|
-
handler for the <
|
|
63
|
-
canvas:</p><pre class="programlisting">@canvas.connect(SEL_LEFTBUTTONPRESS) {
|
|
62
|
+
handler for the <tt class="constant">SEL_LEFTBUTTONPRESS</tt> message from the
|
|
63
|
+
canvas:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">@canvas.connect(SEL_LEFTBUTTONPRESS) {
|
|
64
64
|
#
|
|
65
65
|
# Capture (grab) the mouse when the button goes down, so that all future
|
|
66
66
|
# mouse events will be reported to this widget, even if those events occur
|
|
@@ -72,32 +72,32 @@ end
|
|
|
72
72
|
dragTypes = [FXWindow.colorType]
|
|
73
73
|
@canvas.beginDrag(dragTypes)
|
|
74
74
|
}
|
|
75
|
-
</pre><p>Note that there are usually two things you're going to want to do in
|
|
76
|
-
the <
|
|
77
|
-
The first is to call <
|
|
78
|
-
acts as the drag source. Calling <
|
|
75
|
+
</pre></td></tr></table><p>Note that there are usually two things you're going to want to do in
|
|
76
|
+
the <tt class="constant">SEL_LEFTBUTTONPRESS</tt> handler for a drag source.
|
|
77
|
+
The first is to call <tt class="methodname">grab()</tt> on the window that
|
|
78
|
+
acts as the drag source. Calling <tt class="methodname">grab()</tt>
|
|
79
79
|
"captures" the mouse in the sense that subsequent mouse motion events will
|
|
80
80
|
be reported as if they occurred inside the grab window. This is important,
|
|
81
81
|
since in our case we're going to be dragging from this window to some
|
|
82
82
|
other window, possibly a window in a different application
|
|
83
83
|
altogether.</p><p>The second thing you'll want to do in the
|
|
84
|
-
<
|
|
85
|
-
call <
|
|
84
|
+
<tt class="constant">SEL_LEFTBUTTONPRESS</tt> handler for a drag source is to
|
|
85
|
+
call <tt class="methodname">beginDrag()</tt>. This not only kicks the
|
|
86
86
|
application into drag-and-drop mode, but also provides a way for you to
|
|
87
87
|
inform the system about the formats of data (i.e. the drag types) that
|
|
88
88
|
this drag source is able to provide. For this example, the drag source is
|
|
89
89
|
just going to offer one drag type.</p><p>Since releasing the left mouse button should end the drag operation,
|
|
90
90
|
it's important to also add a handler for the
|
|
91
|
-
<
|
|
91
|
+
<tt class="constant">SEL_LEFTBUTTONRELEASE</tt> message:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">@canvas.connect(SEL_LEFTBUTTONRELEASE) {
|
|
92
92
|
@canvas.ungrab
|
|
93
93
|
@canvas.endDrag
|
|
94
94
|
}
|
|
95
|
-
</pre><p>This is pretty much the mirror image of our
|
|
96
|
-
<
|
|
97
|
-
<
|
|
98
|
-
<
|
|
99
|
-
state.</p><p>The next change is to add a <
|
|
100
|
-
to handle mouse motion events during the drag operation:</p><pre class="programlisting">@canvas.connect(SEL_MOTION) { |sender, sel, event|
|
|
95
|
+
</pre></td></tr></table><p>This is pretty much the mirror image of our
|
|
96
|
+
<tt class="constant">SEL_LEFTBUTTONPRESS</tt> handler. We call
|
|
97
|
+
<tt class="methodname">ungrab()</tt> to release the mouse capture, and
|
|
98
|
+
<tt class="methodname">endDrag()</tt> to clean up the drag-and-drop
|
|
99
|
+
state.</p><p>The next change is to add a <tt class="constant">SEL_MOTION</tt> handler,
|
|
100
|
+
to handle mouse motion events during the drag operation:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">@canvas.connect(SEL_MOTION) { |sender, sel, event|
|
|
101
101
|
if @canvas.dragging?
|
|
102
102
|
@canvas.handleDrag(event.root_x, event.root_y)
|
|
103
103
|
unless @canvas.didAccept == DRAG_REJECT
|
|
@@ -107,39 +107,39 @@ end
|
|
|
107
107
|
end
|
|
108
108
|
end
|
|
109
109
|
}
|
|
110
|
-
</pre><p>The <
|
|
110
|
+
</pre></td></tr></table><p>The <tt class="methodname">dragging?</tt> method returns true if we're
|
|
111
111
|
in the middle of a drag-and-drop operation for the drag source window,
|
|
112
|
-
i.e. after the call to <
|
|
113
|
-
call to <
|
|
112
|
+
i.e. after the call to <tt class="methodname">beginDrag()</tt> but before the
|
|
113
|
+
call to <tt class="methodname">endDrag()</tt>. If we're not currently
|
|
114
114
|
processing a drag operation, we're not really interested in mouse motion
|
|
115
115
|
events for the canvas.</p><p>If we <span class="emphasis"><em>are</em></span> processing a drag operation, however,
|
|
116
|
-
we need to call <
|
|
116
|
+
we need to call <tt class="methodname">handleDrag()</tt> on the drag source
|
|
117
117
|
window. FOX uses this information to send drag-and-drop messages (such as
|
|
118
|
-
<
|
|
119
|
-
and <
|
|
118
|
+
<tt class="constant">SEL_DND_ENTER</tt>, <tt class="constant">SEL_DND_MOTION</tt>
|
|
119
|
+
and <tt class="constant">SEL_DND_LEAVE</tt>) to the window that the mouse is
|
|
120
120
|
currently over. Note that the coordinates passed to
|
|
121
|
-
<
|
|
121
|
+
<tt class="methodname">handleDrag()</tt> are root window coordinates, and not
|
|
122
122
|
window-local coordinates.</p><p>Another good thing to consider doing here is to change the shape of
|
|
123
123
|
the cursor depending on the drop site's response to the drag-and-drop
|
|
124
124
|
messages from the drag source. For this example, we change the drag cursor
|
|
125
125
|
to one of FOX's built-in cursor shapes
|
|
126
|
-
(<
|
|
127
|
-
<
|
|
126
|
+
(<tt class="constant">DEF_SWATCH_CURSOR</tt>) if we get any response other than
|
|
127
|
+
<tt class="constant">DRAG_REJECT</tt> from the drop site. If the drop site
|
|
128
128
|
rejects this drag source's overtures, we instead change the drag cursor to
|
|
129
129
|
a cursor that resembles a stop sign
|
|
130
|
-
(<
|
|
130
|
+
(<tt class="constant">DEF_DNDSTOP_CURSOR</tt>).</p><p>I've purposely avoided suggesting that you run the program for the
|
|
131
131
|
last couple of changes, since until now there wasn't going to be any
|
|
132
132
|
visual indication that anything interesting was happening. But now you
|
|
133
133
|
should be able to run the application in its current state and see a few
|
|
134
134
|
things.</p><p>A first test is to confirm that the cursor shape changes to the
|
|
135
135
|
"stop" sign when you attempt to drag over some window that isn't willing
|
|
136
|
-
to accept a drop of the <
|
|
136
|
+
to accept a drop of the <tt class="constant">FXWindow.colorType</tt> drag type.
|
|
137
137
|
Start up one of the other FXRuby example programs (such as the
|
|
138
|
-
<
|
|
138
|
+
<tt class="filename">scribble.rb</tt> example) alongside your drag source
|
|
139
139
|
program, and then try "dragging" from the drag source's canvas onto the
|
|
140
140
|
Scribble program's canvas. During the drag attempt, the cursor should
|
|
141
141
|
maintain its shape as a "stop" sign since the canvas in the
|
|
142
|
-
<
|
|
142
|
+
<tt class="filename">scribble.rb</tt> example isn't drop-enabled.</p><p>Your next test can confirm that the cursor shape changes to the
|
|
143
143
|
"swatch" cursor (a small square) when you attempt to drag over a window
|
|
144
144
|
that is drop-enabled, and which is willing to accepts drops of this drag
|
|
145
145
|
type. The obvious choice is the example from the previous section (the
|
|
@@ -150,16 +150,16 @@ end
|
|
|
150
150
|
over a drop-enabled window, the cursor should change its shape.</p><p>The last (and most important) step is to actually complete the data
|
|
151
151
|
transfer. At any time during a drag-and-drop operation, a drop site may
|
|
152
152
|
request a copy of the drag-and-drop data by calling the
|
|
153
|
-
<
|
|
153
|
+
<tt class="methodname">getDNDData()</tt> method (as described in the previous
|
|
154
154
|
section). When this happens, FOX sends a
|
|
155
|
-
<
|
|
156
|
-
window, and so we now add a handler for that message:</p><pre class="programlisting">@canvas.connect(SEL_DND_REQUEST) { |sender, sel, event|
|
|
155
|
+
<tt class="constant">SEL_DND_REQUEST</tt> message to the current drag source
|
|
156
|
+
window, and so we now add a handler for that message:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">@canvas.connect(SEL_DND_REQUEST) { |sender, sel, event|
|
|
157
157
|
if event.target == FXWindow.colorType
|
|
158
158
|
@canvas.setDNDData(FROM_DRAGNDROP, FXWindow.colorType, Fox.fxencodeColorData(@canvas.backColor))
|
|
159
159
|
end
|
|
160
160
|
}
|
|
161
|
-
</pre><p>The first important thing to note here is that the
|
|
162
|
-
<
|
|
161
|
+
</pre></td></tr></table><p>The first important thing to note here is that the
|
|
162
|
+
<tt class="varname">target</tt> field of the <tt class="classname">FXEvent</tt>
|
|
163
163
|
instance will contain the drag type requested by the drop site. If your
|
|
164
164
|
drag source offers its data in multiple formats, you definitely need to
|
|
165
165
|
check this in order to know how to package-up the data for transfer.
|
|
@@ -167,17 +167,17 @@ end
|
|
|
167
167
|
this example) it's still a good idea to check the requested type, since a
|
|
168
168
|
rogue drop site could ask for the data in some unexpected format.</p><p>Assuming that the drag type is as expected, the last step is send
|
|
169
169
|
the data to the drop site by calling
|
|
170
|
-
<
|
|
171
|
-
<
|
|
170
|
+
<tt class="methodname">setDNDData()</tt>. As with the call to
|
|
171
|
+
<tt class="methodname">getDNDData()</tt> for our previous drop site program,
|
|
172
172
|
you want to be sure to specify the origin of the data
|
|
173
|
-
(<
|
|
174
|
-
(<
|
|
173
|
+
(<tt class="constant">FROM_DRAGNDROP</tt>), the drag type
|
|
174
|
+
(<tt class="constant">FXWindow.colorType</tt>) and the data itself as a binary
|
|
175
175
|
string.</p><p>As a final test of the completed program, try dragging from this
|
|
176
176
|
window to some drop-enabled window (as described earlier). Now, when you
|
|
177
177
|
release the left mouse button to complete the "drop", the drop site should
|
|
178
178
|
change its color to red.</p><p>The complete program is listed below, and is included in the
|
|
179
|
-
<
|
|
180
|
-
name <
|
|
179
|
+
<tt class="filename">examples</tt> directory under the file
|
|
180
|
+
name <tt class="filename">dragsource.rb</tt>.</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">require 'rubygems'
|
|
181
181
|
require_gem 'fxruby'
|
|
182
182
|
|
|
183
183
|
include Fox
|
|
@@ -259,4 +259,4 @@ if __FILE__ == $0
|
|
|
259
259
|
end
|
|
260
260
|
end
|
|
261
261
|
|
|
262
|
-
</pre></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="dragdroptut.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="dragdroptut.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch05s03.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 5. Drag and Drop </td><td width="20%" align="center"><a accesskey="h" href="book.html">Home</a></td><td width="40%" align="right" valign="top"> Putting It All Together</td></tr></table></div></body></html>
|
|
262
|
+
</pre></td></tr></table></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="dragdroptut.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="dragdroptut.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch05s03.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 5. Drag and Drop </td><td width="20%" align="center"><a accesskey="h" href="book.html">Home</a></td><td width="40%" align="right" valign="top"> Putting It All Together</td></tr></table></div></body></html>
|
data/doc/ch05s03.html
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<html><head>
|
|
2
2
|
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
|
3
|
-
<title>Putting It All Together</title><
|
|
3
|
+
<title>Putting It All Together</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="dragdroptut.html" title="Chapter 5. Drag and Drop"><link rel="previous" href="ch05s02.html" title="Drag Sources"><link rel="next" href="clipboardtut.html" title="Chapter 6. Unicode and FXRuby"></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">Putting It All Together</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch05s02.html">Prev</a> </td><th width="60%" align="center">Chapter 5. Drag and Drop</th><td width="20%" align="right"> <a accesskey="n" href="clipboardtut.html">Next</a></td></tr></table><hr></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1547"></a>Putting It All Together</h2></div></div><div></div></div><p>We've studied drag-and-drop enabled applications from two points of
|
|
4
4
|
view, that of a drag source and that of a drop site. But for most
|
|
5
5
|
applications, you'll want a window to act as both a drag source
|
|
6
6
|
<span class="emphasis"><em>and</em></span> a drop site. As it turns out, this is just a
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
sections.</p><p>If we use our completed drag source example program from the
|
|
9
9
|
previous section as a starting point, and then compare it to the drop site
|
|
10
10
|
example from the first section, it is apparent that the only "pieces"
|
|
11
|
-
missing are:</p><div class="itemizedlist"><ul type="disc"><li><p>A call to <
|
|
12
|
-
<
|
|
13
|
-
and,</p></li><li><p>A handler for the <
|
|
11
|
+
missing are:</p><div class="itemizedlist"><ul type="disc"><li><p>A call to <tt class="methodname">dropEnable()</tt>, to make
|
|
12
|
+
<tt class="classname">DragSource</tt>'s canvas drop-enabled;</p></li><li><p>A handler for the <tt class="constant">SEL_DND_MOTION</tt> message;
|
|
13
|
+
and,</p></li><li><p>A handler for the <tt class="constant">SEL_DND_DROP</tt>
|
|
14
14
|
message.</p></li></ul></div><p>If you merge those three short bits of code from
|
|
15
|
-
<
|
|
15
|
+
<tt class="filename">dropsite.rb</tt> into <tt class="filename">dragsource.rb</tt>,
|
|
16
16
|
you should end up with a program that can act as both a drag source and a
|
|
17
17
|
drop site. To test this program, you should be able to start up two
|
|
18
18
|
separate copies side-by-side and then drag from one to the other. Since,
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
FXRuby example that has displays a color dialog) and drag colors back and
|
|
23
23
|
forth between all three programs. You could spend days doing this and
|
|
24
24
|
never leave the house.</p><p>The complete program is listed below, and is included in the
|
|
25
|
-
<
|
|
26
|
-
name <
|
|
25
|
+
<tt class="filename">examples</tt> directory under the file
|
|
26
|
+
name <tt class="filename">dragdrop.rb</tt>.</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">require 'rubygems'
|
|
27
27
|
require_gem 'fxruby'
|
|
28
28
|
|
|
29
29
|
include Fox
|
|
@@ -125,4 +125,4 @@ if __FILE__ == $0
|
|
|
125
125
|
end
|
|
126
126
|
end
|
|
127
127
|
|
|
128
|
-
</pre></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch05s02.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="dragdroptut.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="
|
|
128
|
+
</pre></td></tr></table></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch05s02.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="dragdroptut.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="clipboardtut.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Drag Sources </td><td width="20%" align="center"><a accesskey="h" href="book.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 6. Unicode and FXRuby</td></tr></table></div></body></html>
|