- 微博 QQ QQ空间 贴吧
1 .CMPE 135: Object-Oriented Analysis and Design October 4 Class Meeting Department of Computer Engineering San Jose State University Fall 2018 Instructor: Ron Mak www.cs.sjsu.edu/~mak 1
2 .2 Software Frameworks A software framework consists of a set of cooperating classes . These classes implement the essential mechanisms for a particular problem domain . Example: wxWidgets is a C++ software framework for multi-platform GUI programming. A framework imposes a structure on the design and development of applications. It has classes and API that implement the structure. It is more than simply a library.
3 .3 Software Frameworks , cont’d An programmer builds an application by: Subclassing framework classes. Adding new classes that provide custom functionality. Inversion of control The framework controls the execution flow. The programmer registers callback functions , mostly as event handlers , with the framework. The framework invokes the callback functions at the appropriate times, such as in response to events.
4 .Building and Installing wxWidgets Go to https://www.wxwidgets.org to download for your platform. It’s a bit tricky to build and install. Mac: Fairly straightforward. I use Eclipse. Linux: I failed to build the dynamic libraries, so I built the static libraries instead. Windows: I successfully built for Microsoft Visual C++. 4
5 .wxWidgets Samples and Demos The download includes the source code for many sample programs and several demos. The build scripts also build all these programs. Each has a makefile to build individually. Use the sample programs to learn how to code and use each widget. 5 Demo
6 .wxWidgets Documentation Online tutorials: https://www.wxwidgets.org/docs/tutorials/ Online reference: https://docs.wxwidgets.org/3.0/ 6
7 .wx -RPS: Mac OS X 7
8 .wx -RPS: Debian 9.1 (Linux) 8
9 .wx -RPS: Windows 10 9 Why does the app look so ugly on Windows?