Further Window Classes

team bbl


wxGenericDirCtrl shows a hierarchy of directories, and optionally files; it can be used to build browsers.

wxCalendarCtrl (see Figure D-1) is an attractive way for the user to enter date information. This control can be customized in various ways, including highlighting special dates and starting the week with either Monday or Sunday. wxCalendarCtrl is in the core wxWidgets library, and the sample is in samples/calendar.

Figure D-1. wxCalendarCtrl


wxDatePickerCtrl is a more compact control than wxCalendarCtrl that allows the user to select a date. On Windows, it uses a native Win32 control, and on other platforms, a generic wxWidgets version is used.

wxTipWindow is a kind of wxPopupWindow that can be used for showing tooltips, and it is used by wxSimpleHelpProvider to show popup help. The tooltip text is provided in the constructor itself.

wxStyledTextCtrl is a wrapper around Scintilla, a highly capable code editor with highlighting, wrapping, and many other features. With minimal code, your application can support editing text files for a large number of different file formats and programming languages. The Scintilla project can be found at www.scintilla.org, and wxStyledTextCtrl can be found in the contrib hierarchy of your wxWidgets distribution. Check out the demo in contrib/samples/stc (see Figure D-2); documentation is available at http://www.yellowbrain.com/stc.

Figure D-2. wxStyledTextCtrl example


wxStaticPicture shows an arbitrary, possibly scaled image, working around a restriction in wxStaticBitmap image size on Windows. See contrib/src/gizmos.

wxLEDNumberCtrl (see Figure D-3) is a simulation of an LED display for showing a numeric string. See contrib/src/gizmos.

Figure D-3. LED control


wxEditableListBox shows a list of strings with controls to add, delete, and move items.

wxFoldPanelBar (see Figure D-4) is an alternative to tabs as a way of showing multiple panels of controls economically. The titles of "folded" panels stack up along the bottom when not in use, and unlike with a tabbed interface, you can choose any combination of panels to be shown simultaneously. See contrib/src/foldbar.

Figure D-4. Folding panel


wxGIFAnimationCtrl can be used for simple, small animations (see Figure D-5). It uses a generic set of classes for flipbook-style animation, and these classes can be extended to use sources of animation data other than GIF. Note that wxHtmlWindow can also display animated GIFs, using its own method. See contrib/src/animate.

Figure D-5. GIF animation control


wxSplashScreen shows a window with a thin border, displaying a bitmap describing your application. Show it in application initialization and then either explicitly destroy it or let it time-out.

OGL (Object Graphics Library) provides a way to display diagrams consisting of shapes connected by lines, with optional arrows and labels. Figure D-6 shows the wxPython OGL demo displaying a variety of shape types. See contrib/src/ogl.

Figure D-6. wxPython running the OGL demo


FL (Frame Layout) manages the layout for windows that can be moved around a frame and "undocked." This will soon be superceded by an improved solution. See contrib/src/fl.

    team bbl



    Cross-Platform GUI Programming with wxWidgets
    Cross-Platform GUI Programming with wxWidgets
    ISBN: 0131473816
    EAN: 2147483647
    Year: 2005
    Pages: 262

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net