- ホーム
- > 洋書
- > 英文書
- > Computer / General
Full Description
"This book is the best way for beginning developers to learn wxWidgets programming in C++. It is a must-have for programmers thinking of using wxWidgets and those already using it."-Mitch Kapor, founder of Lotus Software and the Open Source Applications FoundationBuild advanced cross-platform applications that support native look-and-feel on Windows, Linux, Unix, Mac OS X, and even Pocket PC Master wxWidgets from start to finish-even if you've never built GUI applications beforeLeverage advanced wxWidgets capabilities: networking, multithreading, streaming, and moreCD-ROM: library of development tools, source code, and sample applicationsForeword by Mitch Kapor, founder, Lotus Development and Open Source Application FoundationwxWidgets is an easy-to-use, open source C++ API for writing GUI applications that run on Windows, Linux, Unix, Mac OS X, and even Pocket PC-supporting each platform's native look and feel with virtually no additional coding. Now, its creator and two leading developers teach you all you need to know to write robust cross-platform software with wxWidgets. This book covers everything from dialog boxes to drag-and-drop, from networking to multithreading. It includes all the tools and code you need to get great results, fast. From AMD to AOL, Lockheed Martin to Xerox, world-class developers are using wxWidgets to save money, increase efficiency, and reach new markets. With this book, you can, too.wxWidgets quickstart: event/input handling, window layouts, drawing, printing, dialogs, and moreWorking with window classes, from simple to advanced Memory management, debugging, error checking, internationalization, and other advanced topicsIncludes extensive code samples for Windows, Linux (GTK+), and Mac OS XAbout the CD-ROM The CD-ROM contains all of the source code from the book; wxWidgets distributions for Windows, Linux, Unix, Mac OS X, and other platforms; the wxWidgets reference guide; and development tools including the OpenWatcom C++ compiler, the poEdit translation helper, and the DialogBlocks user interface builder.(c) Copyright Pearson Education. All rights reserved.
Contents
Foreword by Mitch Kapor.Preface.Acknowledgments.About the Authors.1. Introduction.What Is wxWidgets?Why Use wxWidgets?A Brief History of wxWidgetsThe wxWidgets CommunitywxWidgets and Object-Oriented ProgrammingLicense ConsiderationsThe wxWidgets ArchitecturewxMSW wxGTKwxX11wxMotifwxMacwxCocoawxWinCEwxPalmOSwxOS2wxMGLInternal OrganizationSummary 2. Getting Started.A Small wxWidgets SampleThe Application ClassThe Frame ClassThe Event HandlersThe Frame ConstructorThe Whole ProgramCompiling and Running the ProgramProgram FlowSummary3. Event Handling.Event-Driven ProgrammingEvent Tables and HandlersSkipping EventsPluggable Event HandlersDynamic Event HandlersWindow IdentifiersDefining Custom EventsSummary4. Window Basics.Anatomy of a WindowThe Concept of a WindowClient and Non-Client AreasScrollbarsCaret and CursorTop-Level WindowsCoordinate SystemPaintingColor and FontWindow VariantSizingInput Idle Time Processing and UI UpdatesWindow Creation and DeletionWindow StylesA Quick Guide to the Window ClassesBase Window ClassesTop-Level WindowsContainer WindowsNon-Static ControlsStatic ControlsMenus Control BarsBase Window ClasseswxWindowwxControlTop-Level WindowswxFrame wxMDIParentFramewxMDIChildFramewxDialog wxPopupWindow Container WindowswxPanel wxNotebook wxScrolledWindowwxSplitterWindowNon-Static ControlswxButtonwxButton LabelswxBitmapButtonwxChoicewxComboBoxwxCheckBox wxListBox and wxCheckListBoxwxRadioBoxwxRadioButtonwxScrollBarwxSpinButtonwxSpinCtrlwxSliderwxTextCtrlwxToggleButtonStatic ControlswxGaugewxStaticTextwxStaticBitmapwxStaticLinewxStaticBox MenuswxMenuControl BarswxMenuBarwxToolBarwxStatusBarSummary 5. Drawing and Printing.Understanding Device ContextsAvailable Device ContextsDrawing on Windows with wxClientDCErasing Window BackgroundsDrawing on Windows with wxPaintDCDrawing on Bitmaps with wxMemoryDCCreating Metafiles with wxMetafileDCAccessing the Screen with wxScreenDCPrinting with wxPrinterDC and wxPostScriptDCDrawing ToolswxColour wxPenwxBrush wxFont wxPalette Device Context Drawing FunctionsDrawing TextDrawing Lines and ShapesDrawing SplinesDrawing BitmapsFilling Arbitrary AreasLogical FunctionsUsing the Printing FrameworkMore on wxPrintoutScaling for Printing and PreviewingPrinting under Unix with GTK+3D Graphics with wxGLCanvasSummary6. Handling Input.Mouse InputHandling Button and Motion EventsHandling Mouse Wheel EventsHandling Keyboard EventsAn Example Character Event HandlerKey Code TranslationModifier Key VariationsAccelerators Handling Joystick EventswxJoystick EventswxJoystickEvent Member FunctionswxJoystick Member FunctionsSummary7. Window Layout Using Sizers.Layout BasicsSizersCommon Features of SizersProgramming with SizersProgramming with wxBoxSizerProgramming with wxStaticBoxSizerProgramming with wxGridSizerProgramming with wxFlexGridSizerProgramming with wxGridBagSizerFurther Layout IssuesDialog UnitsPlatform-Adaptive LayoutsDynamic LayoutsSummary8. Using Standard Dialogs.Informative DialogswxMessageDialogwxProgressDialog wxProgressDialog ExamplewxBusyInfowxShowTipFile and Directory DialogswxFileDialogwxDirDialog Choice and Selection DialogswxColourDialogwxFontDialogwxSingleChoiceDialogwxMultiChoiceDialogEntry DialogswxNumberEntryDialogwxTextEntryDialog and wxPasswordEntryDialogwxFindReplaceDialogPrinting DialogswxPageSetupDialogwxPrintDialogSummary9. Writing Custom Dialogs.Steps in Creating a Custom DialogAn Example: PersonalRecordDialogDeriving a New ClassDesigning Data StorageCoding the Controls and LayoutData Transfer and ValidationHandling EventsHandling UI UpdatesAdding HelpThe Complete ClassInvoking the DialogAdapting Dialogs for Small DevicesFurther Considerations in Dialog DesignKeyboard NavigationData and UI SeparationLayoutAesthetics Alternatives to DialogsUsing wxWidgets Resource FilesLoading ResourcesUsing Binary and Embedded Resource FilesTranslating ResourcesThe XRC FormatWriting Resource HandlersForeign ControlsSummary10. Programming with Images.Image Classes in wxWidgetsProgramming with wxBitmapCreating a wxBitmapSetting a wxMaskThe XPM FormatDrawing with BitmapsPackaging Bitmap ResourcesProgramming with wxIconCreating a wxIconUsing wxIconAssociating an Icon with an ApplicationProgramming with wxCursorCreating a wxCursorUsing wxCursorUsing wxSetCursorEventProgramming with wxImageLoading and Saving ImagesTransparency Transformations Color ReductionManipulating wxImage Data DirectlyImage Lists and Icon BundlesCustomizing Art in wxWidgets Summary11. Clipboard and Drag and Drop.Data ObjectsData Source DutiesData Target DutiesUsing the ClipboardImplementing Drag and DropImplementing a Drag SourceImplementing a Drop TargetUsing Standard Drop TargetsCreating a Custom Drop TargetMore on wxDataObjectDrag and Drop Helpers in wxWidgetsSummary12. Advanced Window Classes.wxTreeCtrlwxTreeCtrl StyleswxTreeCtrl EventswxTreeCtrl Member FunctionswxListCtrl wxListCtrl StyleswxListCtrl EventswxListItem wxListCtrl Member FunctionsUsing wxListCtrlVirtual List ControlswxWizard wxWizard EventswxWizard Member FunctionswxWizard ExamplewxHtmlWindowwxHtmlWindow StyleswxHtmlWindow Member FunctionsEmbedding Windows in HTML PagesHTML PrintingwxGridThe wxGrid System of ClasseswxGrid EventswxGrid Member FunctionswxTaskBarIconwxTaskBarIcon EventswxTaskBarIcon Member FunctionsWriting Your Own ControlsThe Custom Control DeclarationAdding DoGetBestSizeDefining a New Event ClassDisplaying Information on the ControlHandling InputDefining Default Event HandlersImplementing ValidatorsImplementing Resource HandlersDetermining Control AppearanceA More Complex Example: wxThumbnailCtrlSummary13. Data Structure Classes.Why Not STL?StringsUsing wxStringwxString, Characters, and String LiteralsBasic wxString to C Pointer ConversionsStandard C String FunctionsConverting to and from NumberswxStringTokenizerwxRegEx wxArrayArray TypeswxArrayStringArray Construction, Destruction, and Memory ManagementArray Sample CodewxList and wxNodewxHashMapStoring and Processing Dates and TimeswxDateTimewxDateTime Constructors and ModifierswxDateTime AccessorsGetting the Current TimeParsing and Formatting DatesDate ComparisonsDate ArithmeticHelper Data StructureswxObject wxLongLong wxPoint and wxRealPointwxRect wxRegion wxSize wxVariant Summary14. Files and Streams.File Classes and FunctionswxFile and wxFFilewxTextFile wxTempFile wxDir wxFileName File FunctionsStream ClassesFile StreamsMemory and String StreamsReading and Writing Data TypesSocket StreamsFilter StreamsZip StreamsVirtual File SystemsSummary15. Memory Management, Debugging, and Error Checking.Memory Management BasicsCreating and Deleting Window ObjectsCreating and Copying Drawing ObjectsInitializing Your Application ObjectCleaning Up Your ApplicationDetecting Memory Leaks and Other ErrorsFacilities for Defensive ProgrammingError ReportingwxMessageOutput Versus wxLogProviding Run-Time Type InformationUsing wxModuleLoading Dynamic LibrariesException HandlingDebugging TipsDebugging X11 ErrorsSimplify the ProblemDebugging a Release BuildSummary 16. Writing International Applications.Introduction to InternationalizationProviding TranslationspoEdit Step-by-Step Guide to Using Message CatalogsUsing wxLocaleCharacter Encodings and UnicodeConverting DatawxEncodingConverterwxCSConv (wxMBConv)Converting Outside of a Temporary BufferHelp FilesNumbers and DatesOther MediaA Simple SampleSummary17. Writing Multithreaded Applications.When to Use Threads, and When Not ToUsing wxThreadCreation Specifying Stack SizeSpecifying PriorityStarting the ThreadHow to Pause a Thread or Wait for an External ConditionTermination Synchronization ObjectswxMutex DeadlockswxCriticalSection wxCondition wxSemaphoreThe wxWidgets Thread SampleAlternatives to MultithreadingUsing wxTimerIdle Time ProcessingYielding Summary18. Programming with wxSocket.Socket Classes and Functionality OverviewIntroduction to Sockets and Basic Socket ProcessingThe ClientThe ServerConnecting to a ServerSocket EventsSocket Status and Error NotificationsSending and Receiving Socket DataCreating a ServerSocket Event RecapSocket FlagsBlocking and Non-Blocking Sockets in wxWidgetsHow Flags Affect Socket BehaviorUsing wxSocket as a Standard SocketUsing Socket StreamsFile Sending ThreadFile Receiving ThreadAlternatives to wxSocketSummary19. Working with Documents and Views.Document/View BasicsStep 1: Choose an Interface StyleStep 2: Create and Use Frame ClassesStep 3: Define Your Document and View ClassesStep 4: Define Your Window ClassesStep 5: Use wxDocManager and wxDocTemplateOther Document/View CapabilitiesStandard IdentifiersPrinting and PreviewingFile HistoryExplicit Document CreationStrategies for Implementing Undo/RedoSummary20. Perfecting Your Application.Single Instance or Multiple Instances?Modifying Event HandlingReducing FlickerImplementing Online HelpUsing a Help ControllerExtended wxWidgets HTML HelpAuthoring HelpOther Ways to Provide HelpContext-Sensitive Help and TooltipsMenu HelpParsing the Command LineStoring Application ResourcesReducing the Number of Data FilesFinding the Application PathInvoking Other ApplicationsRunning an ApplicationLaunching DocumentsRedirecting Process Input and OutputManaging Application SettingsStoring SettingsEditing SettingsApplication InstallationInstallation on WindowsInstallation on LinuxInstallation on Mac OS XFollowing UI Design GuidelinesStandard ButtonsMenus Icons Fonts and ColorsApplication Termination BehaviorFurther ReadingSummaryAppendix A. Installing wxWidgets.Appendix B. Building Your Own wxWidgets Applications.Appendix C. Creating Applications with DialogBlocks.Appendix D. Other Features in wxWidgets.Appendix E. Third-Party Tools for wxWidgets.Appendix F. wxWidgets Application Showcase.Appendix G. Using the CD-ROM.Appendix H. How wxWidgets Processes Events.Appendix I. Event Classes and Macros.Appendix J. Code Listings.Appendix K. Porting from MFC.Glossary.Index.