fxruby 1.4.7 → 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- 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/clipboardtut.html
CHANGED
@@ -1,68 +1,56 @@
|
|
1
1
|
<html><head>
|
2
2
|
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
3
|
-
<title>Chapter
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
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="d0e986"></a>Basic Application</h2></div></div></div><p>In order to illustrate how to integrate cut and paste operations
|
13
|
-
into your application, we'll start from a simple FXRuby application that
|
14
|
-
doesn't yet provide any clipboard support. This application simply
|
15
|
-
presents a list of customers (from some external source).</p><pre class="programlisting">require 'rubygems'
|
16
|
-
require_gem 'fxruby'
|
17
|
-
require 'customer'
|
3
|
+
<title>Chapter 6. Unicode 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="pt01.html" title="Part I. The Basics"><link rel="previous" href="ch05s03.html" title="Putting It All Together"><link rel="next" href="examples.html" title="Chapter 7. Examples"></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 6. Unicode and FXRuby</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch05s03.html">Prev</a> </td><th width="60%" align="center">Part I. The Basics</th><td width="20%" align="right"> <a accesskey="n" href="examples.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 6. Unicode and FXRuby</h2></div></div><div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="clipboardtut.html#d0e1608">Basic Application</a></dt></dl></div><p>Beginning with version 1.6, FOX and FXRuby provide support for the
|
4
|
+
display of Unicode strings in FOX widgets. For some excellent discussion
|
5
|
+
about how to use Unicode in Ruby, I recommend Patrick Hall's article, <a href="http://ruphus.com/blog/2005/06/11/ruby-and-unicode/" target="_top">"Ruby and
|
6
|
+
Unicode"</a> and why the lucky stiff's follow-up article, <a href="http://redhanded.hobix.com/inspect/closingInOnUnicodeWithJcode.html" target="_top">"Closing
|
7
|
+
in on Unicode with Jcode"</a>. Here, we're going to make use of the
|
8
|
+
ideas in those articles to give a quick demonstration of how to use FXRuby's
|
9
|
+
support for Unicode.</p><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1608"></a>Basic Application</h2></div></div><div></div></div><p>Here's the original version of our "Hello, World!" program:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">require 'fox16'
|
18
10
|
|
19
11
|
include Fox
|
20
12
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
13
|
+
application = FXApp.new("Hello", "FoxTest")
|
14
|
+
main = FXMainWindow.new(application, "Hello", nil, nil, DECOR_ALL)
|
15
|
+
FXButton.new(main, "&Hello, World!", nil, application, FXApp::ID_QUIT)
|
16
|
+
application.create()
|
17
|
+
main.show(PLACEMENT_SCREEN)
|
18
|
+
application.run()
|
19
|
+
</pre></td></tr></table><p>and here's the modified version:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">require 'fox16'
|
20
|
+
<span class="bold"><b>require 'jcode'</b></span>
|
25
21
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
def create
|
38
|
-
super
|
39
|
-
show(PLACEMENT_SCREEN)
|
40
|
-
end
|
22
|
+
<span class="bold"><b>$KCODE = 'u'</b></span>
|
23
|
+
|
24
|
+
<span class="bold"><b>class UString < String
|
25
|
+
# Show u-prefix as in Python
|
26
|
+
def inspect; "u#{ super }" end
|
27
|
+
|
28
|
+
# Count multibyte characters
|
29
|
+
def length; self.scan(/./).length end
|
30
|
+
|
31
|
+
# Reverse the string
|
32
|
+
def reverse; self.scan(/./).reverse.join end
|
41
33
|
end
|
42
34
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
theApp.create
|
47
|
-
theApp.run
|
35
|
+
module Kernel
|
36
|
+
def u( str )
|
37
|
+
UString.new str.gsub(/U\+([0-9a-fA-F]{4,4})/u){["#$1".hex ].pack('U*')}
|
48
38
|
end
|
49
|
-
end
|
50
|
-
|
51
|
-
|
52
|
-
<code class="varname">$customers</code> 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><pre class="programlisting"># customer.rb
|
39
|
+
end</b></span>
|
40
|
+
|
41
|
+
include Fox
|
56
42
|
|
57
|
-
|
43
|
+
<span class="bold"><b>question = u'U+00bfHabla espaU+00f1ol?'</b></span>
|
58
44
|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
45
|
+
application = FXApp.new("Hello", "FoxTest")
|
46
|
+
main = FXMainWindow.new(application, "Hello", nil, nil, DECOR_ALL)
|
47
|
+
FXButton.new(main, <span class="bold"><b>question</b></span>, nil, application, FXApp::ID_QUIT)
|
48
|
+
application.create()
|
49
|
+
main.show(PLACEMENT_SCREEN)
|
50
|
+
application.run()
|
51
|
+
</pre></td></tr></table><p>The <span class="bold"><b>jcode</b></span> library (part of the
|
52
|
+
standard Ruby library) provides a number of extensions to Ruby's
|
53
|
+
<tt class="classname">String</tt> class, to ensure that its methods work
|
54
|
+
properly for non-ASCII character encodings. By setting the
|
55
|
+
<tt class="varname">$KCODE</tt> global variable to "u", we're telling Ruby which
|
56
|
+
character encoding it is that we're using (UTF-8).</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch05s03.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="examples.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Putting It All Together </td><td width="20%" align="center"><a accesskey="h" href="book.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 7. Examples</td></tr></table></div></body></html>
|
data/doc/cvs.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>Appendix F. Getting the Sources from CVS</title><
|
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
4
|
read-only CVS access. This chapter describes how to check out the sources
|
5
5
|
for either the stable or development release of FXRuby and then build FXRuby
|
6
6
|
from those sources. The information in this chapter builds on the basic CVS
|
@@ -19,17 +19,17 @@
|
|
19
19
|
modified SWIG interface files. I always use the latest development version
|
20
20
|
of <a href="http://www.swig.org" target="_top">SWIG</a>, but any release after,
|
21
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="
|
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="d0e3617"></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
23
|
with any of the FOX 1.0.x releases. It is <span class="emphasis"><em>not</em></span>
|
24
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><pre class="screen">cvs -d:pserver:anonymous@rubyforge.org:/var/cvs/fxruby login</pre><p>When prompted for a password for <span class="emphasis"><em>anonymous</em></span>,
|
26
|
-
simply press the <
|
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
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="
|
29
|
-
ending with a <
|
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 <
|
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="d0e3650"></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
31
|
FXRuby source tree.</p></li><li><p>Type the following command to create a "bootstrap"
|
32
|
-
<
|
33
|
-
sources; after that, the <
|
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
34
|
be updated as described in the next step.</p></li><li><p>Build the "depend" target to generate the real
|
35
|
-
<
|
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>
|
data/doc/differences.html
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
<html><head>
|
2
2
|
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
3
|
-
<title>Appendix C. Differences between FOX and FXRuby</title><
|
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="d0e2698"></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="d0e2718"></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
4
|
FXuint buttons;
|
5
5
|
|
6
6
|
if (window->getCursorPosition(x, y, buttons))
|
7
|
-
fprintf(stderr, "Current position is (%d, %d)\n", x, y);</pre><p>Since this idiom doesn't translate well to Ruby, some functions' interfaces have been slightly modified. For example, the FXRuby implementation of <
|
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="d0e3008"></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
8
|
puts "text for this item = #{aListItem.getText()}"
|
9
|
-
}</pre><p>whereas iterating over an <
|
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
10
|
puts "text for this item = #{itemText}"
|
11
|
-
}</pre><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><
|
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="d0e3152"></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="d0e3191"></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="d0e3240"></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="d0e3260"></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="d0e3285"></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>
|
data/doc/dragdroptut.html
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
<html><head>
|
2
2
|
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
3
|
-
<title>Chapter 5. Drag and Drop</title><
|
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#d0e1201">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
4
|
drag-and-drop. It's also one of the more complicated to understand. For more
|
5
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="d0e1201"></a>Drop Sites</h2></div></div></div><p>We're going to start by presenting a skeleton application consisting
|
7
|
-
of a main window widget (a <
|
8
|
-
parents an <
|
6
|
+
Drop</a>.</p><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1201"></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
9
|
require_gem 'fxruby'
|
10
10
|
|
11
11
|
include Fox
|
@@ -35,13 +35,13 @@ if __FILE__ == $0
|
|
35
35
|
theApp.run
|
36
36
|
end
|
37
37
|
end
|
38
|
-
</pre><p>Since the main program (i.e. the part at the end) won't change for
|
38
|
+
</pre></td></tr></table><p>Since the main program (i.e. the part at the end) won't change for
|
39
39
|
the rest of the tutorial, I won't show that code anymore. Since an
|
40
|
-
<
|
40
|
+
<tt class="classname">FXCanvas</tt> widget relies on some other object (its
|
41
41
|
message target) to draw its contents, we need to handle
|
42
|
-
<
|
42
|
+
<tt class="constant">SEL_PAINT</tt> messages generated by the canvas. We'll do
|
43
43
|
that by adding a handler that clears the canvas to its current background
|
44
|
-
color:</p><pre class="programlisting">require 'rubygems'
|
44
|
+
color:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">require 'rubygems'
|
45
45
|
require_gem 'fxruby'
|
46
46
|
|
47
47
|
include Fox
|
@@ -54,13 +54,13 @@ class DropSite < FXMainWindow
|
|
54
54
|
# Fill main window with canvas
|
55
55
|
@canvas = FXCanvas.new(self, nil, 0, LAYOUT_FILL_X|LAYOUT_FILL_Y)
|
56
56
|
|
57
|
-
<span class="bold"><
|
57
|
+
<span class="bold"><b> # Handle expose events on the canvas
|
58
58
|
@canvas.connect(SEL_PAINT) { |sender, sel, event|
|
59
59
|
FXDCWindow.new(@canvas, event) { |dc|
|
60
60
|
dc.foreground = @canvas.backColor
|
61
61
|
dc.fillRectangle(event.rect.x, event.rect.y, event.rect.w, event.rect.h)
|
62
62
|
}
|
63
|
-
}</
|
63
|
+
}</b></span>
|
64
64
|
end
|
65
65
|
|
66
66
|
def create
|
@@ -71,14 +71,14 @@ class DropSite < FXMainWindow
|
|
71
71
|
show(PLACEMENT_SCREEN)
|
72
72
|
end
|
73
73
|
end
|
74
|
-
</pre><p>Run this basic version of the program to be sure that it's working
|
74
|
+
</pre></td></tr></table><p>Run this basic version of the program to be sure that it's working
|
75
75
|
properly so far. You should simply see an empty window with a white
|
76
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 <
|
77
|
+
from some other window, such as an <tt class="classname">FXColorWell</tt>
|
78
78
|
widget, and drop it onto the canvas in order to change the canvas'
|
79
79
|
background color. In order for a FOX widget to be able to accept drops at
|
80
|
-
all, we need to first call its <
|
81
|
-
method:</p><pre class="programlisting">def initialize(anApp)
|
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
82
|
# Initialize base class
|
83
83
|
super(anApp, "Drop Site", nil, nil, DECOR_ALL, 0, 0, 400, 300)
|
84
84
|
|
@@ -93,10 +93,10 @@ end
|
|
93
93
|
}
|
94
94
|
}
|
95
95
|
|
96
|
-
<span class="bold"><
|
96
|
+
<span class="bold"><b> # Enable canvas for drag-and-drop messages
|
97
97
|
@canvas.dropEnable
|
98
|
-
</
|
99
|
-
</pre><p>At this point, let's try a little test to see if the program does
|
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
100
|
anything interesting yet. Start by running some other FOX or FXRuby
|
101
101
|
program to use as a drag source for the color data. You should be able to
|
102
102
|
use any program that displays an FXColorWell widget, and this includes the
|
@@ -106,15 +106,15 @@ end
|
|
106
106
|
and try to drag a color from one of these color wells onto this window. At
|
107
107
|
this point, the mouse pointer should turn into a stop sign, indicating
|
108
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
|
-
<
|
109
|
+
<tt class="methodname">acceptDrop()</tt> method to indicate whether or not
|
110
110
|
we'll accept certain kinds of drops. You can call
|
111
|
-
<
|
112
|
-
<
|
113
|
-
response to a <
|
114
|
-
handler for <
|
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
115
|
in DropSite's initialize() method. For now, we'll unconditionally accept
|
116
116
|
drops from any drag source, regardless of what kind of data they're
|
117
|
-
offering:</p><pre class="programlisting">def initialize(anApp)
|
117
|
+
offering:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">def initialize(anApp)
|
118
118
|
# Initialize base class
|
119
119
|
super(anApp, "Drop Site", nil, nil, DECOR_ALL, 0, 0, 400, 300)
|
120
120
|
|
@@ -132,13 +132,13 @@ end
|
|
132
132
|
# Enable canvas for drag-and-drop messages
|
133
133
|
@canvas.dropEnable
|
134
134
|
|
135
|
-
<span class="bold"><
|
135
|
+
<span class="bold"><b> # Handle SEL_DND_MOTION messages from the canvas
|
136
136
|
@canvas.connect(SEL_DND_MOTION) {
|
137
137
|
# Accept drops unconditionally (for now)
|
138
138
|
@canvas.acceptDrop
|
139
139
|
}
|
140
|
-
</
|
141
|
-
</pre><p>Now try the previous test again. This time, when you try to drag
|
140
|
+
</b></span>end
|
141
|
+
</pre></td></tr></table><p>Now try the previous test again. This time, when you try to drag
|
142
142
|
from a color well to the drop-enabled canvas, you should see the mouse
|
143
143
|
pointer turn into a small filled square. This is a visual cue to the user
|
144
144
|
indicating that the canvas will accept a drop of the drag-and-drop
|
@@ -152,35 +152,35 @@ end
|
|
152
152
|
types for any kind of application-specific data that you need; but for
|
153
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
154
|
can be used, and so we'll start by adding a few lines to
|
155
|
-
<
|
156
|
-
to register the drag type for color data:</p><pre class="programlisting">def create
|
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
157
|
# Create the main window and canvas
|
158
158
|
super
|
159
159
|
|
160
|
-
<span class="bold"><
|
160
|
+
<span class="bold"><b> # Register the drag type for colors
|
161
161
|
FXWindow.colorType = getApp().registerDragType(FXWindow.colorTypeName)
|
162
162
|
|
163
|
-
</
|
163
|
+
</b></span> # Show the main window
|
164
164
|
show(PLACEMENT_SCREEN)
|
165
165
|
end
|
166
|
-
</pre><p>Note that the first time that
|
167
|
-
<
|
168
|
-
drag type name (such as <
|
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
169
|
it will generate a unique identifier for that drag type. Subsequent calls
|
170
|
-
to <
|
170
|
+
to <tt class="methodname">registerDragType()</tt> for the same drag type name
|
171
171
|
will just return the previously-generated drag type. Now, we want to
|
172
|
-
modify our <
|
173
|
-
little more picky about which kinds of drops it will accept:</p><pre class="programlisting"># Handle SEL_DND_MOTION messages from the canvas
|
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
174
|
@canvas.connect(SEL_DND_MOTION) {
|
175
|
-
<span class="bold"><
|
175
|
+
<span class="bold"><b> if @canvas.offeredDNDType?(FROM_DRAGNDROP, FXWindow.colorType)
|
176
176
|
@canvas.acceptDrop
|
177
177
|
end
|
178
|
-
</
|
179
|
-
</pre><p>Here, we call the canvas' <
|
178
|
+
</b></span>}
|
179
|
+
</pre></td></tr></table><p>Here, we call the canvas' <tt class="methodname">offeredDNDType?</tt>
|
180
180
|
method to ask if the drag source can provide its data in the requested
|
181
|
-
format. Only if <
|
182
|
-
we call <
|
183
|
-
handler for the <
|
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
184
|
@canvas.connect(SEL_DND_DROP) {
|
185
185
|
# Try to obtain the data as color values first
|
186
186
|
data = @canvas.getDNDData(FROM_DRAGNDROP, FXWindow.colorType)
|
@@ -188,21 +188,21 @@ end
|
|
188
188
|
# Update canvas background color
|
189
189
|
@canvas.backColor = Fox.fxdecodeColorData(data)
|
190
190
|
end
|
191
|
-
}</
|
192
|
-
requested format, the <
|
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
193
|
return a String (which for our purposes is just a byte buffer). If you've
|
194
194
|
defined your own application-specific drag types, this data can of course
|
195
195
|
be anything, and we'll see examples of this in a later tutorial. But the
|
196
196
|
data for standard drag types like
|
197
|
-
<
|
197
|
+
<tt class="methodname">FXWindow.colorType</tt> can be decoded using the
|
198
198
|
appropriate built-in library functions. In this case, we use the
|
199
|
-
<
|
199
|
+
<tt class="methodname">fxdecodeColorData()</tt> method to convert the bytes
|
200
200
|
into a color value that we can use.</p><p>Now comes the moment of truth. Try running your test program again
|
201
201
|
(one that displays a color well). Now, when you drag a color from a color
|
202
|
-
well and drop it onto the <
|
202
|
+
well and drop it onto the <tt class="classname">DropSite</tt> window, the
|
203
203
|
canvas should change its background color accordingly.</p><p>The complete program is listed below, and is included in the
|
204
|
-
<
|
205
|
-
name <
|
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
206
|
require_gem 'fxruby'
|
207
207
|
|
208
208
|
include Fox
|
@@ -263,4 +263,4 @@ if __FILE__ == $0
|
|
263
263
|
theApp.run
|
264
264
|
end
|
265
265
|
end
|
266
|
-
</pre></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch04s04.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="pt01.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch05s02.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Pasting Data from the Clipboard </td><td width="20%" align="center"><a accesskey="h" href="book.html">Home</a></td><td width="40%" align="right" valign="top"> Drag Sources</td></tr></table></div></body></html>
|
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>
|
data/doc/events.html
CHANGED
@@ -1,36 +1,36 @@
|
|
1
1
|
<html><head>
|
2
2
|
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
3
|
-
<title>Chapter
|
3
|
+
<title>Chapter 8. FXRuby's Message-Target System</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="examples.html" title="Chapter 7. Examples"><link rel="next" href="todo.html" title="Chapter 9. To-do list"></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 8. FXRuby's Message-Target System</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="examples.html">Prev</a> </td><th width="60%" align="center">Part I. The Basics</th><td width="20%" align="right"> <a accesskey="n" href="todo.html">Next</a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="events"></a>Chapter 8. FXRuby's Message-Target System</h2></div></div><div></div></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e2075"></a>Background</h2></div></div><div></div></div><p>One of the biggest flaws with earlier releases of FXRuby was its strict reproduction of FOX's process for mapping GUI events (messages) to instance methods (handlers). That process involved four distinct steps:</p><div class="orderedlist"><ol type="1" compact><li><p>Initializing a <span class="emphasis"><em>message identifier</em></span>, an integer that helps to disambiguate the sender of the message and/or its purpose.</p></li><li><p>Mapping a specific message type and identifier to an instance method for the message target object.</p></li><li><p>Implementing the actual handler method in the message target.</p></li><li><p>Registering the message target and message identifier with the widget that's going to send the messages.</p></li></ol></div><p>So, for example, let's say you wanted to create a button widget that, when pressed, prints the string "Ouch!" to the terminal. In the old scheme of things, you'd need to identify some object to act as the target for any messages generated by this button. To keep things simple, let's say that the application's main window (<span class="emphasis"><em>mainWindow</em></span>) is designated as the target for the button. We'll need to generate a unique identifier associated with the button:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">class MyMainWindow < FXMainWindow
|
4
4
|
|
5
5
|
include Responder
|
6
6
|
|
7
7
|
ID_BUTTON = FXMainWindow::ID_LAST
|
8
8
|
|
9
9
|
... other stuff ...
|
10
|
-
end</pre><p>Next, you'd want to specify the mapping for a specific message type to the target's instance method that handles that message:</p><pre class="programlisting">FXMAPFUNC(SEL_COMMAND, MyMainWindow::ID_BUTTON, 'onCmdButton')</pre><p>Finally, you'd need to implement the instance method (<
|
10
|
+
end</pre></td></tr></table><p>Next, you'd want to specify the mapping for a specific message type to the target's instance method that handles that message:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">FXMAPFUNC(SEL_COMMAND, MyMainWindow::ID_BUTTON, 'onCmdButton')</pre></td></tr></table><p>Finally, you'd need to implement the instance method (<tt class="methodname">onCmdButton</tt>) named in the call to <tt class="methodname">FXMAPFUNC</tt>:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">def onCmdButton(sender, sel, ptr)
|
11
11
|
puts "Ouch!"
|
12
|
-
end</pre><p>The last step is to tell the button who it's message target is, and which message identifier to use when sending messages to that target:</p><pre class="programlisting">aButton = FXButton.new(parent, "Push Me", nil, mainWindow, ID_BUTTON)</pre><p>This was an extremely tedious process, especially for programmers who are used to Ruby/Tk's or Ruby/GTK's approach for connecting signals (events) to blocks that handle the signal. After some discussions at RubyConf 2001 and subsequent discussions on the Ruby newsgroup, a new model was proposed and hashed out on the RubyGarden Wiki. This new model was introduced with the FXRuby-0.99.179 release.</p></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="
|
12
|
+
end</pre></td></tr></table><p>The last step is to tell the button who it's message target is, and which message identifier to use when sending messages to that target:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">aButton = FXButton.new(parent, "Push Me", nil, mainWindow, ID_BUTTON)</pre></td></tr></table><p>This was an extremely tedious process, especially for programmers who are used to Ruby/Tk's or Ruby/GTK's approach for connecting signals (events) to blocks that handle the signal. After some discussions at RubyConf 2001 and subsequent discussions on the Ruby newsgroup, a new model was proposed and hashed out on the RubyGarden Wiki. This new model was introduced with the FXRuby-0.99.179 release.</p></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e2123"></a>Event Model</h2></div></div><div></div></div><p>FXRuby implements a new, simplified approach to this built on top of the old model. It more or less mimics the syntax used in Ruby/GTK; you can attach a message handler block to a widget using a new <tt class="methodname">connect</tt> instance method, e.g.</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">aButton = FXButton.new(parent, "Push Me")
|
13
13
|
aButton.connect(SEL_COMMAND) { |sender, sel, ptr|
|
14
14
|
puts "Ouch!"
|
15
|
-
}</pre><p>Alternate forms of the <
|
15
|
+
}</pre></td></tr></table><p>Alternate forms of the <tt class="methodname">FXObject#connect</tt> method can take either a <tt class="classname">Method</tt> or <tt class="classname">Proc</tt> instance as a second argument (i.e. instead of attaching a block), e.g.</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">def push(sender, sel, ptr)
|
16
16
|
puts "Ouch!"
|
17
17
|
end
|
18
18
|
|
19
19
|
aButton = FXButton.new(parent, "Push Me")
|
20
|
-
aButton.connect(SEL_COMMAND, method(:push))</pre><p>It works by creating a special target object (behind the scenes) that stands-in as the message target for your widget and passes off incoming messages to the appropriate block. The single argument to <
|
21
|
-
aButton.connect(SEL_COMMAND) { puts "Ouch!" }</pre></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="
|
20
|
+
aButton.connect(SEL_COMMAND, method(:push))</pre></td></tr></table><p>It works by creating a special target object (behind the scenes) that stands-in as the message target for your widget and passes off incoming messages to the appropriate block. The single argument to <tt class="methodname">connect</tt> is the FOX message type you're handling (e.g. <tt class="constant">SEL_COMMAND</tt>, <tt class="constant">SEL_CHANGED</tt>, etc.) The three arguments to the block are the same as those for regular FOX message handler methods, namely, the sender object, the message type and identifier and the message data. And of course, for simple handlers like this one, you can just leave the arguments off altogether:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">aButton = FXButton.new(parent, "Push Me")
|
21
|
+
aButton.connect(SEL_COMMAND) { puts "Ouch!" }</pre></td></tr></table></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e2159"></a>Timers</h2></div></div><div></div></div><p>Timers are scheduled by calling <tt class="methodname">FXApp#addTimeout</tt>. There are three different forms of <tt class="methodname">addTimeout</tt>, but the first argument to each is the timeout interval in milliseconds. The most primitive version of this method takes two additional arguments to specify the target object and message identifier for the object that will handle the timeout event:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">aTimer = getApp().addTimeout(1000, timeoutHandlerObj, ID_TIMER)</pre></td></tr></table><p>The second form takes either a <tt class="classname">Method</tt> or <tt class="classname">Proc</tt> instance as its second argument, e.g.</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">aTimer = getApp().addTimeout(1000, method(:timeoutHandlerMethod))</pre></td></tr></table><p>The last form uses a code block as the handler for the timeout event:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">aTimer = getApp().addTimeout(1000) { |sender, sel, ptr|
|
22
22
|
# handle this timeout event
|
23
|
-
}</pre></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="
|
23
|
+
}</pre></td></tr></table></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e2186"></a>Chores</h2></div></div><div></div></div><p>Chores are scheduled by calling <tt class="methodname">FXApp#addChore</tt>. There are three different forms of <tt class="methodname">addChore</tt>; the most primitive version requires two arguments to specify the target object and message identifier for the object that will handle the chore event:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">aChore = getApp().addChore(choreHandlerObj, ID_CHORE)</pre></td></tr></table><p>The second form takes either a <tt class="classname">Method</tt> or <tt class="classname">Proc</tt> instance as its single argument, e.g.</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">aChore = getApp().addChore(method(:choreHandlerMethod))</pre></td></tr></table><p>The last form uses a code block as the handler for the chore:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">aChore = getApp().addChore { |sender, sel, ptr|
|
24
24
|
# handle this chore
|
25
|
-
}</pre></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="
|
25
|
+
}</pre></td></tr></table></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e2213"></a>Signals</h2></div></div><div></div></div><p>Operating system signal handlers are designated by calling <tt class="methodname">FXApp#addSignal</tt>. There are three different forms of <tt class="methodname">addSignal</tt>, but the first argument to each is the signal name (e.g. "SIGINT") or number. Each version also has two optional arguments (which should come at the end of the list) to specify <i class="parameter"><tt>immediate</tt></i> and <i class="parameter"><tt>flags</tt></i>. The most primitive version of this method takes two additional arguments to specify the target object and message identifier for the object that will handle this operating system signal:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">aSignal = getApp().addSignal("SIGINT", signalHandlerObj, ID_SIGINT)</pre></td></tr></table><p>The second form takes either a <tt class="classname">Method</tt> or <tt class="classname">Proc</tt> instance as its second argument, e.g.</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">aSignal = getApp().addSignal("SIGINT", method(:signalHandlerMethod))</pre></td></tr></table><p>The last form uses a code block as the handler for the signal:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">aSignal = getApp().addSignal("SIGINT") { |sender, sel, ptr|
|
26
26
|
# handle this signal
|
27
|
-
}</pre></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="
|
27
|
+
}</pre></td></tr></table></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e2246"></a>Input Events</h2></div></div><div></div></div><p>Input event handlers are designated by calling <tt class="methodname">FXApp#addInput</tt>. There are three different forms of <tt class="methodname">addInput</tt>, but the first two arguments to each are the file object (including sockets) and the mode flag (some combination of <tt class="constant">INPUT_READ</tt>, <tt class="constant">INPUT_WRITE</tt> and <tt class="constant">INPUT_EXCEPT</tt>). The most primitive version of this method takes two additional arguments to specify the target object and message identifier for the object that will handle this input event:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">getApp().addInput(aFile, INPUT_READ, inputHandlerObj, ID_INPUT)</pre></td></tr></table><p>The second form takes either a <tt class="classname">Method</tt> or <tt class="classname">Proc</tt> instance as its third argument, e.g.</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">getApp().addInput(aSocket, INPUT_READ|INPUT_EXCEPT, method(:inputHandlerMethod))</pre></td></tr></table><p>The last form uses a code block as the handler for the input event:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">getApp().addInput(aFile, INPUT_WRITE|INPUT_EXCEPT) { |sender, sel, ptr|
|
28
28
|
# handle this input
|
29
|
-
}</pre><p>This API is a little different from the other cases. For example, timeout events always send the same message type (<
|
29
|
+
}</pre></td></tr></table><p>This API is a little different from the other cases. For example, timeout events always send the same message type (<tt class="constant">SEL_TIMEOUT</tt>) to their message target, so you just have a single handler method (or block) to handle the timeout. In contrast, input sources (e.g. pipes or sockets) can generate three different FOX messages, <tt class="constant">SEL_IO_READ</tt>, <tt class="constant">SEL_IO_WRITE</tt> and <tt class="constant">SEL_IO_EXCEPTION</tt>, depending on what happens, so your handler method (block) needs to check the message type, e.g.</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">getApp().addInput(socket, INPUT_READ|INPUT_WRITE) { |sender, sel, ptr|
|
30
30
|
case SELTYPE(sel)
|
31
31
|
when SEL_IO_READ
|
32
32
|
# handle read event
|
33
33
|
when SEL_IO_WRITE
|
34
34
|
# handle write event
|
35
35
|
end
|
36
|
-
}</pre></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="examples.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="todo.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter
|
36
|
+
}</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="examples.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="todo.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 7. Examples </td><td width="20%" align="center"><a accesskey="h" href="book.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 9. To-do list</td></tr></table></div></body></html>
|
data/doc/examples.html
CHANGED
@@ -1,24 +1,24 @@
|
|
1
1
|
<html><head>
|
2
2
|
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
3
|
-
<title>Chapter
|
3
|
+
<title>Chapter 7. Examples</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="clipboardtut.html" title="Chapter 6. Unicode and FXRuby"><link rel="next" href="events.html" title="Chapter 8. FXRuby's Message-Target System"></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 7. Examples</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="clipboardtut.html">Prev</a> </td><th width="60%" align="center">Part I. The Basics</th><td width="20%" align="right"> <a accesskey="n" href="events.html">Next</a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="examples"></a>Chapter 7. Examples</h2></div></div><div></div></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1648"></a>hello</h2></div></div><div></div></div><p>The <a href="../examples/hello.rb" target="_top"><tt class="filename">hello.rb</tt></a>
|
4
4
|
example program is about as short as it gets for a working FXRuby program.
|
5
5
|
Use this as a starting point for understanding the basic elements of an
|
6
6
|
FXRuby program, especially if you're new to GUI programming in
|
7
|
-
general.</p><div class="screenshot"><div class="mediaobject" align="center"><img src="images/hello.png" align="middle"></div></div></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="
|
7
|
+
general.</p><div class="screenshot"><div class="mediaobject" align="center"><img src="images/hello.png" align="middle"></div></div></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1661"></a>hello2</h2></div></div><div></div></div><p>The <a href="../examples/hello2.rb" target="_top"><tt class="filename">hello2.rb</tt></a>
|
8
8
|
example kicks it up a notch by adding an icon and tooltip to the button
|
9
|
-
from the <
|
9
|
+
from the <tt class="filename">hello.rb</tt> example.</p><div class="screenshot"><div class="mediaobject" align="center"><img src="images/hello2.png" align="middle"></div></div></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1677"></a>scribble</h2></div></div><div></div></div><p>The <a href="../examples/scribble.rb" target="_top"><tt class="filename">scribble.rb</tt></a>
|
10
10
|
example is a good demonstration of how to obtain a device context for a
|
11
|
-
window (in this case, an <
|
11
|
+
window (in this case, an <tt class="classname">FXCanvas</tt>) and draw into
|
12
12
|
that window. It also provides a basic demonstration of how FOX's GUI
|
13
13
|
updating mechanism can be used to automatically update the state of
|
14
14
|
widgets based on the application's state. Observe the "Clear"
|
15
15
|
button becoming enabled and disabled (greyed-out) depending on whether the
|
16
16
|
canvas is currently "dirty" or "clean", and then see how
|
17
|
-
this updating is actually handled in the code.</p><div class="screenshot"><div class="mediaobject" align="center"><img src="images/scribble.png" align="middle"></div></div></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="
|
17
|
+
this updating is actually handled in the code.</p><div class="screenshot"><div class="mediaobject" align="center"><img src="images/scribble.png" align="middle"></div></div></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1693"></a>button</h2></div></div><div></div></div><p>The <a href="../examples/button.rb" target="_top"><tt class="filename">button.rb</tt></a>
|
18
18
|
example program shows off the various options (or button styles) for
|
19
|
-
<
|
19
|
+
<tt class="classname">FXButton</tt> widgets.</p><div class="screenshot"><div class="mediaobject" align="center"><img src="images/button.png" align="middle"></div></div></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1709"></a>datatarget</h2></div></div><div></div></div><p>The <a href="../examples/datatarget.rb" target="_top"><tt class="filename">datatarget.rb</tt></a>
|
20
20
|
example program demonstrates most or all of the widgets that can work with
|
21
|
-
FOX data targets (that is, instances of class <
|
21
|
+
FOX data targets (that is, instances of class <tt class="classname">FXDataTarget</tt>).
|
22
22
|
Data targets are special objects that have a a string, float or integer
|
23
23
|
value associated with them, and can interact with widgets to keep the data
|
24
24
|
target's value in sync with the widget's setting. For example, you
|
@@ -28,77 +28,77 @@
|
|
28
28
|
target's value is changed, the text field will update its setting.
|
29
29
|
Since a single data targets can be attached to multiple widgets, this can
|
30
30
|
be a useful way to keep multiple controls for the same logical value in
|
31
|
-
sync with each other.</p><div class="screenshot"><div class="mediaobject" align="center"><img src="images/datatarget.png" align="middle"></div></div></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="
|
31
|
+
sync with each other.</p><div class="screenshot"><div class="mediaobject" align="center"><img src="images/datatarget.png" align="middle"></div></div></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1725"></a>dialog</h2></div></div><div></div></div><p>The <a href="../examples/dialog.rb" target="_top"><tt class="filename">dialog.rb</tt></a>
|
32
32
|
example is a simple program demonstrating how to construct and display
|
33
|
-
modal and non-modal dialog boxes.</p><div class="screenshot"><div class="mediaobject" align="center"><img src="images/dialog.png" align="middle"></div></div></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="
|
34
|
-
example program demonstrates the <
|
33
|
+
modal and non-modal dialog boxes.</p><div class="screenshot"><div class="mediaobject" align="center"><img src="images/dialog.png" align="middle"></div></div></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1738"></a>dirlist</h2></div></div><div></div></div><p>The <a href="../examples/dirlist.rb" target="_top"><tt class="filename">dirlist.rb</tt></a>
|
34
|
+
example program demonstrates the <tt class="classname">FXDirList</tt> widget.
|
35
35
|
The directory list is a special kind of tree list, where each tree item
|
36
|
-
represents a directory (or folder) in the file system.</p><div class="screenshot"><div class="mediaobject" align="center"><img src="images/dirlist.png" align="middle"></div></div></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="
|
37
|
-
example program demonstrates the <
|
36
|
+
represents a directory (or folder) in the file system.</p><div class="screenshot"><div class="mediaobject" align="center"><img src="images/dirlist.png" align="middle"></div></div></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1754"></a>iconlist</h2></div></div><div></div></div><p>The <a href="../examples/iconlist.rb" target="_top"><tt class="filename">iconlist.rb</tt></a>
|
37
|
+
example program demonstrates the <tt class="classname">FXIconList</tt> widget.
|
38
38
|
An icon list is a special kind of list widget that can display its
|
39
39
|
contents in one of three basic modes (details mode, small icons mode or
|
40
40
|
large icons mode). The first screenshot below shows an icon list in
|
41
41
|
details mode, while the second shows the same icon list in "big
|
42
|
-
icons" mode.</p><div class="screenshot"><div class="mediaobject" align="center"><img src="images/iconlist-details.png" align="middle"></div></div><div class="screenshot"><div class="mediaobject" align="center"><img src="images/iconlist-bigicons.png" align="middle"></div></div></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="
|
42
|
+
icons" mode.</p><div class="screenshot"><div class="mediaobject" align="center"><img src="images/iconlist-details.png" align="middle"></div></div><div class="screenshot"><div class="mediaobject" align="center"><img src="images/iconlist-bigicons.png" align="middle"></div></div></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1774"></a>mditest</h2></div></div><div></div></div><p>The <a href="../examples/mditest.rb" target="_top"><tt class="filename">mditest.rb</tt></a>
|
43
43
|
example program demonstrates FOX's Multiple Document Interface (MDI)
|
44
|
-
capabilities, specifically the <
|
45
|
-
<
|
44
|
+
capabilities, specifically the <tt class="classname">FXMDIClient</tt> and
|
45
|
+
<tt class="classname">FXMDIChild</tt> classes.</p><div class="screenshot"><div class="mediaobject" align="center"><img src="images/mditest.png" align="middle"></div></div></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1793"></a>groupbox</h2></div></div><div></div></div><p>The <a href="../examples/groupbox.rb" target="_top"><tt class="filename">groupbox.rb</tt></a>
|
46
46
|
example program is a kind of "periodic table of widgets"
|
47
47
|
demonstration, FOX-style. It shows off a lot of the FOX widgets as well as
|
48
|
-
providing a good exercise of FOX's layout managers.</p><div class="screenshot"><div class="mediaobject" align="center"><img src="images/groupbox.png" align="middle"></div></div></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="
|
49
|
-
example program mainly demonstrates the <
|
50
|
-
widget and the <
|
51
|
-
example demonstrates how to draw directly into an <
|
52
|
-
object and then "draw" that image into a canvas.</p><div class="screenshot"><div class="mediaobject" align="center"><img src="images/image.png" align="middle"></div></div></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="
|
53
|
-
example demonstrates the <
|
54
|
-
It also provides an example of the <
|
55
|
-
widget (on the left side of the split) and the <
|
56
|
-
layout manager (in the middle pane).</p><div class="screenshot"><div class="mediaobject" align="center"><img src="images/splitter.png" align="middle"></div></div></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="
|
57
|
-
example program demonstrates the <
|
48
|
+
providing a good exercise of FOX's layout managers.</p><div class="screenshot"><div class="mediaobject" align="center"><img src="images/groupbox.png" align="middle"></div></div></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1806"></a>header</h2></div></div><div></div></div><p>The <a href="../examples/header.rb" target="_top"><tt class="filename">header.rb</tt></a>
|
49
|
+
example program mainly demonstrates the <tt class="classname">FXHeader</tt>
|
50
|
+
widget and the <tt class="classname">FXSplitter</tt> layout manager.</p><div class="screenshot"><div class="mediaobject" align="center"><img src="images/header.png" align="middle"></div></div></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1825"></a>image</h2></div></div><div></div></div><p>The <a href="../examples/image.rb" target="_top"><tt class="filename">image.rb</tt></a>
|
51
|
+
example demonstrates how to draw directly into an <tt class="classname">FXImage</tt>
|
52
|
+
object and then "draw" that image into a canvas.</p><div class="screenshot"><div class="mediaobject" align="center"><img src="images/image.png" align="middle"></div></div></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1841"></a>splitter</h2></div></div><div></div></div><p>The <a href="../examples/splitter.rb" target="_top"><tt class="filename">splitter.rb</tt></a>
|
53
|
+
example demonstrates the <tt class="classname">FXSplitter</tt> layout manager.
|
54
|
+
It also provides an example of the <tt class="classname">FXTreeList</tt>
|
55
|
+
widget (on the left side of the split) and the <tt class="classname">FXMatrix</tt>
|
56
|
+
layout manager (in the middle pane).</p><div class="screenshot"><div class="mediaobject" align="center"><img src="images/splitter.png" align="middle"></div></div></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1863"></a>foursplit</h2></div></div><div></div></div><p>The <a href="../examples/foursplit.rb" target="_top"><tt class="filename">foursplit.rb</tt></a>
|
57
|
+
example program demonstrates the <tt class="classname">FX4Splitter</tt> layout
|
58
58
|
manager. This four-way split is especially useful for CAD-type programs
|
59
59
|
where it's necessary to show multiple views of the model
|
60
|
-
simultaneously.</p><div class="screenshot"><div class="mediaobject" align="center"><img src="images/foursplit.png" align="middle"></div></div></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="
|
61
|
-
example provides a simple demonstration of the <
|
60
|
+
simultaneously.</p><div class="screenshot"><div class="mediaobject" align="center"><img src="images/foursplit.png" align="middle"></div></div></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1879"></a>shutter</h2></div></div><div></div></div><p>The <a href="../examples/shutter.rb" target="_top"><tt class="filename">shutter.rb</tt></a>
|
61
|
+
example provides a simple demonstration of the <tt class="classname">FXShutter</tt>
|
62
62
|
widget, with the skeleton of a PIM-type application. The very nice icons
|
63
|
-
used for this program are courtesy of <a href="http://www.forrestwalter.com/icons" target="_top">Gort's Icons</a>.</p><div class="screenshot"><div class="mediaobject" align="center"><img src="images/shutter.png" align="middle"></div></div></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="
|
64
|
-
example exists mainly to demonstrate the <
|
65
|
-
widget, but shows off a few other features in the process.</p><div class="screenshot"><div class="mediaobject" align="center"><img src="images/tabbook.png" align="middle"></div></div></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="
|
66
|
-
example features the <
|
63
|
+
used for this program are courtesy of <a href="http://www.forrestwalter.com/icons" target="_top">Gort's Icons</a>.</p><div class="screenshot"><div class="mediaobject" align="center"><img src="images/shutter.png" align="middle"></div></div></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1898"></a>tabbook</h2></div></div><div></div></div><p>The <a href="../examples/tabbook.rb" target="_top"><tt class="filename">tabbook.rb</tt></a>
|
64
|
+
example exists mainly to demonstrate the <tt class="classname">FXTabBook</tt>
|
65
|
+
widget, but shows off a few other features in the process.</p><div class="screenshot"><div class="mediaobject" align="center"><img src="images/tabbook.png" align="middle"></div></div></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1914"></a>table</h2></div></div><div></div></div><p>The <a href="../examples/table.rb" target="_top"><tt class="filename">table.rb</tt></a>
|
66
|
+
example features the <tt class="classname">FXTable</tt> widget, sometimes
|
67
67
|
known as a "grid" or "spreadsheet" widget in other
|
68
|
-
toolkits.</p><div class="screenshot"><div class="mediaobject" align="center"><img src="images/table.png" align="middle"></div></div></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="
|
68
|
+
toolkits.</p><div class="screenshot"><div class="mediaobject" align="center"><img src="images/table.png" align="middle"></div></div></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1930"></a>gltest</h2></div></div><div></div></div><p>The <a href="../examples/gltest.rb" target="_top"><tt class="filename">gltest.rb</tt></a>
|
69
69
|
example program demonstrates how to create a basic OpenGL canvas (i.e. an
|
70
|
-
instance of the <
|
70
|
+
instance of the <tt class="classname">FXGLCanvas</tt> widget) and draw into
|
71
71
|
it. It also demonstrates how to use timers and chores. This example
|
72
72
|
requires the Ruby/OpenGL extension, available from the Ruby Application
|
73
|
-
Archive.</p><div class="screenshot"><div class="mediaobject" align="center"><img src="images/gltest.png" align="middle"></div></div></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="
|
74
|
-
example program demonstrates how to use the <
|
73
|
+
Archive.</p><div class="screenshot"><div class="mediaobject" align="center"><img src="images/gltest.png" align="middle"></div></div></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1946"></a>glviewer</h2></div></div><div></div></div><p>The <a href="../examples/glviewer.rb" target="_top"><tt class="filename">glviewer.rb</tt></a>
|
74
|
+
example program demonstrates how to use the <tt class="classname">FXGLViewer</tt>
|
75
75
|
widget and draw various kinds of GL objects into it. It can also be used
|
76
76
|
as model for a fairly complicated FXRuby application, since it includes a
|
77
|
-
lot of typical features (like a menu bar, toolbar, status line, etc.).</p><div class="screenshot"><div class="mediaobject" align="center"><img src="images/glviewer.png" align="middle"></div></div></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="
|
78
|
-
example, the <a href="../examples/imageviewer.rb" target="_top"><
|
77
|
+
lot of typical features (like a menu bar, toolbar, status line, etc.).</p><div class="screenshot"><div class="mediaobject" align="center"><img src="images/glviewer.png" align="middle"></div></div></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1962"></a>imageviewer</h2></div></div><div></div></div><p>Like the <a href="../examples/glviewer.rb" target="_top"><tt class="filename">glviewer.rb</tt></a>
|
78
|
+
example, the <a href="../examples/imageviewer.rb" target="_top"><tt class="filename">imageviewer.rb</tt></a>
|
79
79
|
can be used as a model for a typical full-featured GUI application, with a
|
80
80
|
menu bar, toolbar, and so forth. It also features the
|
81
|
-
<
|
81
|
+
<tt class="classname">FXImageView</tt> widget.</p><div class="screenshot"><div class="mediaobject" align="center"><img src="images/imageviewer.png" align="middle"></div></div></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1982"></a>dilbert</h2></div></div><div></div></div><p>The <a href="../examples/dilbert.rb" target="_top"><tt class="filename">dilbert.rb</tt></a>
|
82
82
|
example fetches the "Daily Dilbert" cartoon and displays it in a
|
83
83
|
window. This was just a fun little exercise for me, but it does provide a
|
84
|
-
more bare-bones example of the <
|
85
|
-
than that provided by the (more complicated) <
|
84
|
+
more bare-bones example of the <tt class="classname">FXImageView</tt> widget
|
85
|
+
than that provided by the (more complicated) <tt class="filename">imageviewer.rb</tt>
|
86
86
|
example.</p><p>This example program requires the html-parser extension, available
|
87
|
-
from the Ruby Application Archive.</p><div class="screenshot"><div class="mediaobject" align="center"><img src="images/dilbert.png" align="middle"></div></div></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="
|
87
|
+
from the Ruby Application Archive.</p><div class="screenshot"><div class="mediaobject" align="center"><img src="images/dilbert.png" align="middle"></div></div></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e2003"></a>raabrowser</h2></div></div><div></div></div><p>The <a href="../examples/raabrowser.rb" target="_top"><tt class="filename">raabrowser.rb</tt></a>
|
88
88
|
example program shows a treelist view of the current Ruby Application
|
89
89
|
Archive (RAA) contents, and product-specific information for the currently
|
90
90
|
selected product in the panel on the right. This is a good demonstration
|
91
|
-
of the following features:</p><div class="itemizedlist"><ul type="bullet"><li style="list-style-type: disc"><p>the <
|
91
|
+
of the following features:</p><div class="itemizedlist"><ul type="bullet"><li style="list-style-type: disc"><p>the <tt class="classname">FXSplitter</tt> layout manager, used to
|
92
92
|
split the left side (containing the tree list) from the right side
|
93
93
|
(containing the information panel). If the panel on the left is too
|
94
94
|
narrow to see all of its contents (especially when you've expanded
|
95
|
-
the tree) try resizing the split.</p></li><li style="list-style-type: disc"><p>the <
|
96
|
-
the RAA contents.</p></li><li style="list-style-type: disc"><p>data targets (i.e. instances of class <
|
95
|
+
the tree) try resizing the split.</p></li><li style="list-style-type: disc"><p>the <tt class="classname">FXTreeList</tt> widget, used to display
|
96
|
+
the RAA contents.</p></li><li style="list-style-type: disc"><p>data targets (i.e. instances of class <tt class="classname">FXDataTarget</tt>),
|
97
97
|
which are used for the contents of the fields in the information
|
98
|
-
panel.</p></li></ul></div><p>This example program requires the <a href="http://www.jin.gr.jp/~nahi/Ruby/SOAP4R" target="_top">SOAP4R</a> extension.</p><div class="screenshot"><div class="mediaobject" align="center"><img src="images/raabrowser.png" align="middle"></div></div></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="
|
99
|
-
example program, like the <
|
98
|
+
panel.</p></li></ul></div><p>This example program requires the <a href="http://www.jin.gr.jp/~nahi/Ruby/SOAP4R" target="_top">SOAP4R</a> extension.</p><div class="screenshot"><div class="mediaobject" align="center"><img src="images/raabrowser.png" align="middle"></div></div></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e2040"></a>babelfish</h2></div></div><div></div></div><p>The <a href="../examples/babelfish.rb" target="_top"><tt class="filename">babelfish.rb</tt></a>
|
99
|
+
example program, like the <tt class="filename">raabrowser.rb</tt> example,
|
100
100
|
depends on the <a href="http://www.jin.gr.jp/~nahi/Ruby/SOAP4R" target="_top">SOAP4R</a>
|
101
|
-
extension. Other than that it doesn't bring anything new to the table.</p><div class="screenshot"><div class="mediaobject" align="center"><img src="images/babelfish.png" align="middle"></div></div></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="
|
101
|
+
extension. Other than that it doesn't bring anything new to the table.</p><div class="screenshot"><div class="mediaobject" align="center"><img src="images/babelfish.png" align="middle"></div></div></div><div class="simplesect" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e2059"></a>browser</h2></div></div><div></div></div><p>The <a href="../examples/browser.rb" target="_top"><tt class="filename">browser.rb</tt></a>
|
102
102
|
example program is mainly a "me too" for the class browser
|
103
103
|
distributed with Ruby/GTK. It's hard for me to get excited about it,
|
104
|
-
but here it is.</p><div class="screenshot"><div class="mediaobject" align="center"><img src="images/browser.png" align="middle"></div></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="
|
104
|
+
but here it is.</p><div class="screenshot"><div class="mediaobject" align="center"><img src="images/browser.png" align="middle"></div></div></div></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="pt01.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="events.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 6. Unicode and FXRuby </td><td width="20%" align="center"><a accesskey="h" href="book.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 8. FXRuby's Message-Target System</td></tr></table></div></body></html>
|