logo资料库

wxPython 2.8 Application Development Cookbook.pdf

第1页 / 共312页
第2页 / 共312页
第3页 / 共312页
第4页 / 共312页
第5页 / 共312页
第6页 / 共312页
第7页 / 共312页
第8页 / 共312页
资料共312页,剩余部分请下载后查看
Cover
Copyright
Credits
About the Author
About the Reviewers
Table of Contents
Preface
Chapter 1: Getting Started with wxPython
Introduction
The application object
The main frame
Understanding the window hierarchy
Referencing controls
Using Bitmaps
Adding icons to Windows
Utilizing Stock IDs
Accessing the clipboard
Supporting drag and drop
Two-stage widget creation
Understanding inheritance limitations
Chapter 2: Responding to Events
Introduction
Handling events
Understanding event propagation
Handling Key events
Using UpdateUI events
Playing with the mouse
Creating custom event classes
Managing event handlers with EventStack
Validating input with validators
Handling Apple events
Chapter 3: Basic Building Blocks of a User Interface
Introduction
Creating Stock Buttons
Buttons, buttons, and more buttons
Offering options with CheckBoxes
Using the TextCtrl
Providing choices with the Choice control
Adding Menus and MenuBars
Working with ToolBars
How to use PopupMenus
Grouping controls with a StaticBox
Chapter 4: Advanced Building Blocks of a User Interface
Introduction
Listing data with a ListCtrl
Browsing files with the CustomTreeCtrl
Creating a VListBox
StyledTextCtrl using lexers
Working with tray icons
Adding tabs to a Notebook
Using the FlatNotebook
Scrolling with a ScrolledPanel
Simplifying the FoldPanelBar
Chapter 5: Providing Information and Alerting Users
Introduction
Showing a MessageBox
Providing help with ToolTips
Using SuperToolTips
Displaying a BalloonTip
Creating a custom SplashScreen
Showing task progress with the Progress dialog
Creating an AboutBox
Chapter 6: Retrieving Information from Users
Introduction
Selecting files with a FileDialog
Searching text with a FindReplaceDialog
Getting images with ImageDialog
Using the Print dialogs
Chapter 7: Window Layout and Design
Introduction
Using a BoxSizer
Understanding proportions, flags, and borders
Laying out controls with the GridBagSizer
Standard dialog button layout
Using XML resources
Making a custom resource handler
Using the AuiFrameManager
Chapter 8: Drawing to the Screen
Introduction
Screen drawing
Drawing shapes
Utilizing SystemSettings
Using a GraphicsContext
Drawing with RendererNative
Reducing flicker in drawing routines
Chapter 9: Design Approaches and Techniques
Introduction
Creating Singletons
Implementing an observer pattern
Strategy pattern
Model View Controller
Using mixin classes
Using decorators
Chapter 10: Creating Components and Extending Functionality
Introduction
Customizing the ArtProvider
Adding controls to a StatusBar
Making a tool window
Creating a SearchBar
Working with ListCtrl mixins
StyledTextCtrl custom highlighting
Creating a custom control
Chapter 11: Using Threads and Timers to Create Responsive Interfaces
Introduction
Non-Blocking GUI
Understanding thread safety
Threading tools
Using Timers
Capturing output
Chapter 12: Building and Managing Applications for Distribution
Introduction
Working with StandardPaths
Persisting the state of the UI
Using the SingleInstanceChecker
Exception handling
Optimizing for OS X
Supporting internationalization
Distributing an application
Index
wxPython 2.8 Application Development Cookbook Quickly create robust, reliable, and reusable wxPython applications Cody Precord BIRMINGHAM - MUMBAI
wxPython 2.8 Application Development Cookbook Copyright © 2010 Packt Publishing All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews. Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book. Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information. First published: December 2010 Production Reference: 1031210 Published by Packt Publishing Ltd. 32 Lincoln Road Olton Birmingham, B27 6PA, UK. ISBN 978-1-849511-78-0 www.packtpub.com Cover Image by Vinayak Chittar (vinayak.chittar@gmail.com)
Credits Author Cody Precord Reviewers Maurice HT Ling Steve McMahon Jeff McNeil Chukwudi Nwachukwu Acquisition Editor Steven Wilding Development Editor Maitreya Bhakal Technical Editor Conrad Sardinha Indexers Tejal Daruwale Rekha Nair Editorial Team Leader Akshara Aware Project Team Leader Lata Basantani Project Coordinator Vincila Colaco Proofreader Dirk Manuel Graphics Nilesh Mohite Production Coordinator Aparna Bhagat Cover Work Aparna Bhagat
About the Author Cody Precord is a Software Engineer based in Minneapolis, MN, USA. He has been designing and writing systems and application software for AIX, Linux, Windows, and Macintosh OS X for the last ten years using primarily C, C++, Perl, Bash, Korn Shell, and Python. The constant need of working on multiple platforms naturally led Cody to the wxPython toolkit, which he has been using intensely for that last five years. Cody has been primarily using wxPython for his open source project, Editra, which is a cross-platform development tool. He is interested in promoting cross-platform development practices and improving usability in software.
wxPython 2.8 Application Development Cookbook Quickly create robust, reliable, and reusable wxPython applications Cody Precord BIRMINGHAM - MUMBAI
wxPython 2.8 Application Development Cookbook Copyright © 2010 Packt Publishing All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews. Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book. Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information. First published: December 2010 Production Reference: 1031210 Published by Packt Publishing Ltd. 32 Lincoln Road Olton Birmingham, B27 6PA, UK. ISBN 978-1-849511-78-0 www.packtpub.com Cover Image by Vinayak Chittar (vinayak.chittar@gmail.com)
Credits Author Cody Precord Reviewers Maurice HT Ling Steve McMahon Jeff McNeil Chukwudi Nwachukwu Acquisition Editor Steven Wilding Development Editor Maitreya Bhakal Technical Editor Conrad Sardinha Indexers Tejal Daruwale Rekha Nair Editorial Team Leader Akshara Aware Project Team Leader Lata Basantani Project Coordinator Vincila Colaco Proofreader Dirk Manuel Graphics Nilesh Mohite Production Coordinator Aparna Bhagat Cover Work Aparna Bhagat
分享到:
收藏