Wxwidgets Serial Port Programming Pdf
This article provides a list of widget toolkits (also known as GUI frameworks), used to construct the graphical user interface (GUI) of programs, organized by their relationships with various operating systems.
PonyProg: a powerful but simple serial device programmer with a GUI framework for Linux and Windows. PonyProg is a serial device programmer software with a user friendly GUI framework available for Windows95/98/ME/NT/2000/XP and Intel Linux. Its purpose is. The best way to perform AVR ISP programming. Wxwidgets Serial Port Programming Pdf. Now that I've been learning in my class, Data Structures and Algorithms with C, I gained again the interest in programming. For the serial port. Qt does not offer anything out of the box, but you can use any library you choose. There seem to be few cross-platform (if you go that way), but I found those.
- 1Low-level widget toolkits
- 2High-level widget toolkits
- 2.1OS dependent
- 2.2Cross-platform
Low-level widget toolkits[edit]
Integrated in the operating system[edit]
- OS X uses Cocoa. Mac OS9 and OS X use Carbon for 32-bit applications.
- The Windows API used in Microsoft Windows. Microsoft had the graphics functions integrated in the kernel until 2006[1]
- The Haiku operating system uses an extended and modernised version of the Be API that was used by its spiritual predecessor BeOS. Haiku Inc. is expected to drop binary and source compatibility with the BeOS at some point in the future, which will result in its own Haiku API.
As a separate layer on top of the operating system[edit]
- The X Window System contains primitive building blocks, called Xt or 'Intrinsics', but they are mostly only used by older toolkits such as: OLIT, Motif and Xaw. Most contemporary toolkits, such as GTK+ or Qt, bypass them and use Xlib or XCB directly.
- The Amiga OSIntuition was formerly present in the Amiga Kickstart ROM and integrated itself with a medium-high level widget library which invoked the Workbench Amiga native GUI. Since Amiga OS 2.0, Intuition.library became disk based and object oriented. Also Workbench.library and Icon.library became disk based, and could be replaced with similar third-party solutions.
- Since 2005, Microsoft has taken the graphics system out of Windows' kernel.[2]
High-level widget toolkits[edit]
Toolkit name | Windows | OS X | Unix-like | Programming language | License |
---|---|---|---|---|---|
Qt | Yes | Yes | Yes | C++ | LGPL, commercial |
MFC | Yes | No | No | C++ | Proprietary |
OWL (superseded by VCL) | Yes | No | No | C++ (Borland C++) | Proprietary |
VCL (supersedes OWL) | Yes | No | No | Object Pascal (Delphi) | Proprietary |
WTL | Yes | No | No | C++ | Microsoft Public License |
LCL | Yes | Yes | Yes | Object Pascal (Free Pascal) | LGPL |
LessTif | No | No | Yes | C | LGPL |
GTK | Yes | Yes | Yes | C | LGPL |
FLTK | Yes | Yes | Yes | C++ | LGPL |
Fox toolkit | Yes | No | Yes | C++ | LGPL |
Nana C++ | Yes | No | Yes | C++ | Boost license |
wxWidgets | Yes | Yes | Yes | C++ | WxWindows license |
TnFOX | Yes | Yes | Yes | C++ | LGPL |
Ultimate++ | Yes | No | Yes | C++ | BSD |
Rogue Wave Views | Yes | No | Yes | C++ | proprietary |
CEGUI | Yes | Yes | Yes | C++ | MIT |
IUP | Yes | No | Yes | C | MIT |
Shoes (GUI toolkit) | cross-platform | Ruby | MIT | ||
AWT | cross-platform | Java | |||
Swing | cross-platform | Java | |||
Pivot (WTK) | cross-platform | Java | Apache License | ||
GNUstep | Yes | Yes | Yes | Objective-C | LGPL |
Juce | Yes | Yes | Yes | C++ | GPL, commercial |
Cocoa | No | Yes | No | Objective-C | Proprietary |
Elementary | Yes | Yes | Yes | C | LGPL, BSD |
Tk | Yes | Yes | Yes | C | BSD |
Kivy | cross-platform | Python | MIT |
OS dependent[edit]
On Amiga[edit]
- BOOPSI (Basic Object Oriented Programming System for Intuition) was introduced with OS 2.0 and enhanced Intuition with a system of classes in which every class represents a single widget or describes an interface event. This led to an evolution in which third-party developers each realised their own personal systems of classes.
- MUI: object-oriented GUI toolkit and the official toolkit for MorphOS.
- ReAction: object-oriented GUI toolkit and the official toolkit for AmigaOS.
- Zune (GUI toolkit) is an open source clone of MUI and the official toolkit for AROS.
On Macintosh[edit]
- Cocoa - used in OS X(see also Aqua).
- MacApp Macintosh framework.
- PowerPlant Macintosh framework.
On Microsoft Windows[edit]
- The Microsoft Foundation Classes (MFC), a C++ wrapper around the Windows API.
- The Windows Template Library (WTL), a template-based extension to ATL and a replacement of MFC
- The Object Windows Library, Borland's alternative to MFC.
- The Visual Component Library (VCL) is Borland's toolkit used in its C++ Builder and Delphi products.
- Windows Forms is .NET's set of classes that handle GUI controls. In the cross-platform Mono implementation, it is an independent toolkit, implemented entirely in managed code (not wrapping the Windows API, which doesn't exist on other platforms).[3]
- The Windows Presentation Foundation is the graphical subsystem of the .NET Framework 3.0. User interfaces can be created in WPF using any of the CLR languages (e.g. C#) or with the XML-based language XAML. Microsoft Expression Blend is a visual GUI builder for WPF.
On Unix, under the X Window System[edit]
Note that the X Window System was originally primarily for Unix-like operating systems, but it now runs on Microsoft Windows as well using, for example, Cygwin, so some or all of these toolkits can also be used under Windows.
- LessTif, an open source (LGPL) version of Motif.
- MoOLIT, a bridge between the look-and-feel of OPEN LOOK and Motif
- Motif used in the Common Desktop Environment.
- OLIT, an Xt-based OPEN LOOK intrinsics toolkit
- Xaw, the Project Athena widget set for the X Window System.
- XView, a SunView compatible OPEN LOOK toolkit
Cross-platform[edit]
Based on C (including bindings to other languages)[edit]
- Elementary, open source (LGPL), a part of the Enlightenment Foundation Libraries, a fast, stable, and scalable library that can be used to create both rich and fast applications that can be used on anything from every day desktop computers to small PDA's and set-top boxes.
- GTK+, open source (LGPL), primarily for the X Window System, ported to and emulated under other platforms; used in the GNOME, Rox, LXDE and Xfce desktop environments. The Windows port has support for native widgets.
- IUP, open source (MIT), a minimalist GUI toolkit in ANSI C for Windows, UNIX and Linux.
- Tk, open source (BSD-style), a widget set accessed from Tcl and other high-level script languages (interfaced in Python as Tkinter).
- XForms, the Forms Library for X
- XVT, Extensible Virtual Toolkit
Based on C++ (including bindings to other languages)[edit]
- CEGUI, open source (MIT License), cross-platform widget toolkit designed for gamedevelopment, but also usable for applications and tool development. Supports multiple renderers and optional libraries.
- FLTK, open source (LGPL), cross-platform toolkit designed to be small and fast.
- FOX toolkit, open source (LGPL), cross-platform toolkit.
- GLUI, a very small toolkit written with the GLUT library.
- gtkmm, C++ version of GTK+
- Juce provides GUI and widget set with the same look and feel in Microsoft Windows, X Window Systems, OS X and Android. Rendering can be based on OpenGL.
- Nana C++, open source (Boost license), a cross-platform toolkit designed to enable modern C++ GUI programming
- Qt, commercial and open source (GPL, LGPL) available under Unix and Linux (with X11 or Wayland), MS Windows (Desktop, CE and Phone 8), OS X, iOS, Android, BlackBerry 10 and embedded Linux; used in the KDE, Trinity, LXQt, and Lumina desktop environment, it's also used in Ubuntu's Unity shell.
- Rogue Wave Views (formerly ILOG Views) provides GUI and graphic library for Windows and the main X11 platforms.
- TnFOX, open source (LGPL), a portability toolkit.
- Ultimate++ is a free Win32/X11 application framework bundled with an IDE (BSD license)
- The Visual Component Framework (VCF) is an open source (BSD license) C++ framework project.
- wxWidgets (formerly wxWindows), open source (relaxed LGPL), abstracts toolkits across several platforms for C++, Python, Perl, Ruby and Haskell.
- Zinc Application Framework, cross-platform widget toolkit.
Based on OpenGL[edit]
- Clutter (LGPL) (in C) is an open source software library for creating fast, visually rich and animated graphical user interfaces.
Based on Flash[edit]
- Adobe Flash allows creating widgets running in most web browsers and in several mobile phones.
- Adobe Flex provides high-level widgets for building web user interfaces. Flash widgets can be used in Flex.
- Flash and Flex widgets will run without a web browser in the Adobe AIR runtime environment.
Based on XML[edit]
- GladeXML with GTK+
- XAML with Silverlight or Moonlight
Based on JavaScript[edit]
Wxwidgets Examples
General
- Qooxdoo Could be understood as Qt for the Web
- Sencha (formerly Ext JS)
- TIBCO General Interface, a rich set of GUI components that include vector charts and is now also available through an open source BSD license[4]
Full-stack framework
- Vaadin - Java
- ZK - A Java Web framework for building rich Ajax and mobile applications
Resource-based
- Google Web Toolkit (GWT)
- FBML Facebook Markup Language
No longer developed
- YUI (Yahoo! User Interface Library)
Based on SVG[edit]
- Raphaël is a JavaScript toolkit for SVG interfaces and animations
Based on .NET[edit]
- Gtk#, C# wrappers around the underlying GTK+ and GNOME libraries, written in C and available on Linux, MacOS and Windows.
- Windows Forms. There is an original Microsoft's implementation that is a wrapper around the Windows API and runs on windows, and Mono's alternative implementation that is cross platform.
Based on Java[edit]
- The Abstract Window Toolkit (AWT) is Sun Microsystems' original widget toolkit for Java applications. It typically uses another toolkit on each platform on which it runs.
- Swing is a richer widget toolkit supported since J2SE 1.2 as a replacement for AWT widgets. Swing is a lightweight toolkit, meaning it does not rely on native widgets.
- Apache Pivot is an open-source platform for building rich web applications in Java or any JVM-compatible language, and relies on the WTK widget toolkit.
- JavaFX and FXML.
- The Standard Widget Toolkit (SWT) is a native widget toolkit for Java that was developed as part of the Eclipse project. SWT uses a standard toolkit for the running platform (such as the Windows API, OS X Cocoa, or GTK+) underneath.
- Qt Jambi, the official Java binding to Qt from Trolltech. The commercial support and development has stopped[5]
Based on Object Pascal[edit]
- IP Pascal uses a graphics library built on top of standard language constructs. Also unusual for being a procedural toolkit that is cross-platform (no callbacks or other tricks), and is completely upward compatible with standard serial input and output paradigms. Completely standard programs with serial output can be run and extended with graphical constructs.
- LazarusLCL (for Pascal, Object Pascal and Delphi via Free Pascal compiler), a class library wrapping GTK+ 1.2, Gtk+ 2.x and the Windows API (Carbon, Windows CE and Qt4 support are all in development).
- fpGUI is created with the Free Pascal compiler. It doesn't rely on any large 3rdParty libraries and currently runs on Linux, Windows, Windows CE, and Mac (via X11). A Carbon (OS X) port is underway.
- CLX (Component Library for Cross-platform), used with Borland's Delphi, C++ Builder, and Kylix, for producing cross-platform applications. It is based on Qt, wrapped in such a way that its programming interface is similar to that of the VCL toolkit.
Based on Objective-C[edit]
Based on Ruby[edit]
- Shoes (GUI toolkit) is a cross platform framework for graphical user interface development.
Not yet categorised[edit]
Comparison of widget toolkits[edit]
Toolkit | Initial release | Latest release | Main language | Bindings | Tools | License | Pros | Cons | Back-end |
---|---|---|---|---|---|---|---|---|---|
Xaw, Athena | 1983 | C | |||||||
AWT | 1995 | Java | portable | ||||||
CEGUI | December 2004 | 0.8.7 (April 28, 2016; 3 years ago)[±][6] | C++ | Python,[7]Lua (using tolua++)[8] | CEED[9] | MIT License | Free license, fast, cross-platform, portable, free GUI editing tool | ||
Clutter | 2006 | C | Perl, Python, C#, C++, Vala, Ruby | LGPL | GTK+ and WebKit embedding | ||||
Elementary | 2007 (EFL: 2001) | 2016 | C | JavaScript, Python, Vala, C++ | editje, edje | LGPL | Portable, stable, fast, finger-friendly | ||
FLTK | 1998 | 2019 | C++ | Python (pyFLTK), Perl (FLTK.pm), Ruby (Ruby/FLTK), Tcl (Tcl Fltk), Guile (guile-fltk), Eiffel (IFLTK) | FLUID (Fast Light UI Designer) | LGPL (with an exception that allows static linking) | fast, small enough to static link | limited widget selection | |
FOX | 1997 | C++ | Ruby (FXRuby), Python (FXPy), Eiffel (EiffelFox) | consistent across platforms | non-native look and feel | ||||
GLUI | C++ | ||||||||
GNUstep | 1994 | 2017 | Objective-C | Java, Ruby, Scheme | Gorm (computing) | GPL for the apps, LGPL for the libs | Portable, free license | Native on macOS (with Cocoa) | X11, Win32, Wayland |
GTK+ | 1997 | 3.24.4[10](January 21, 2019; 6 months ago)[±] | C | C++ (gtkmm), Perl (Gtk2-perl), Ruby (ruby-gtk2), Python (PyGTK), Haskell (Gtk2Hs), Java (java-gnome) (not available for Microsoft Windows), C# (Gtk#), PHP (PHP-GTK), Ada (GTKAda), D (gtkD), FreeBasic (GladeToBac), Go (go-gtk), OCaml (lablgtk), JavaScript (Gjs, Seed), Fortran (gtk-fortran), Lua (lua-lgi), R (RGtk2) and others via GTK-server | Glade | LGPL | Portable, free license | Partly native only.[11][12] | |
IUP | 1992 | 2017[13] | C | Lua (IupLua)[14] | LEDC: a compiler for LED | MIT | Portable, lightweight, use the native API, native look&feel, free licence | Non‑Unicode (only plain ASCII) [15] | |
Motif, Lesstif | 1980s | C | BX Pro | ||||||
Nana C++ | 2007 | 1.2.2 (December 8, 2015; 3 years ago)[±][16] | C++ | VisualStudio, Dev-C++, Code::Blocks, GCC | portable, lightweight, modern C++ style | ||||
Qt | 1991 | 5.13[17](19 June 2019; 60 days ago)[±] | C++ | Ruby (QtRuby), Python (PyQt, PySide, PythonQt), Ada (QtAda), c# ( Qyoto), Java (Qt Jambi), Pascal ( FreePascal Qt4 ), Perl (Perl Qt4), PHP(PHP-Qt), Haskell (Qt Haskell), Lua (lqt, QtLua), Dao ( DaoQt), Tcl ( qtcl ), Common Lisp (CommonQt), D (QtD), Harbour (hbqt) | Qt Designer, Qt Creator | GPL, LGPL.[18] | Portable, rich widget set, GUI builder, free license, stable API | Partially native only.[19][20][21] | |
Shoes (GUI toolkit) | 2007 | 2010 | Ruby | MIT license/Open source | Simplicity, ease of use | ||||
SWT | Java | D (DWT) | Eclipse | portable | |||||
Swing | 1996 | Java | Eclipse, NetBeans | GPL for OpenJDK | Portable (Java), advanced widgets, GUI builders | ||||
Tk | 1991 | 2015 | C, Tcl | Ruby (RubyTk), Python (Tkinter), Perl (Perl/Tk), Ada (TASH), Common Lisp (LTk), Erlang (etk), .. | BSD | very portable, many language bindings | |||
Ultimate++ | 2004 | C++ | TheIDE | BSD | portable, NTL, free license | ||||
Rogue Wave Views | 1993 | 2014 (5.8) | C++ | ivfstudio | proprietary | portable (Windows, Unix-like), good support | commercial | ||
VCF | C++ | BSD | free license | ||||||
Windows Forms | CLI languages | CLI languages | Expression, Visual Studio | portability issues, no MVC | |||||
WPF, XAML, Silverlight | 2007 | CLI languages | CLI languages | Expression, Visual Studio | Portability issues | ||||
MFC, WinAPI | 1992 | C++ | Visual Studio | not portable (but Wine implements it for X Window) | |||||
ATL, WTL | 2004 | C++ | Visual Studio | not portable | |||||
wxWidgets | 1992 | 3.1.2 (10 December 2018; 8 months ago)[±][22] | C++ | C++ (native), Ruby (wxRuby), Python (wxPython), Perl (wxPerl), Java (wxJava, jwx!), Lua (wxLua), Tcl(wxTCL), JavaScript (GLUEscript), Smalltalk (wxSqueak), Erlang (wxErlang), Haskell (wxHaskell), C (wxC), D (wxD), .NET Framework (wxNet), Common Lisp (wxCL), Basic (wxBasic), BlitzMax (wxMax), Euphoria (wxEuphoria), Ada (wxAda), Pike (wxPike) | VisualWx, Boa Constructor, PythonCard, Spe, XRCed, wxGlade, wxFormBuilder, DialogBlocks ($), wxDesigner ($) | wxWindows License | Portable, rich widget set, free licence, semantic similarities to MFC make migration easy. | ||
XUL | XML, JavaScript | portable | |||||||
Juce | 2004 | C++ | Jucer | GPL, commercial | Cross-platform, with additional audio plug-in wrapping tools (VST, RTAS, AAX etc.) | ||||
XVT | 1989 | 2010 | C and C++ | Design for C and architect for C++ | Proprietary | Cross-platform, rich widget set, C and C++ GUI builders, very stable | |||
CLX | C++ | ||||||||
VCL | Delphi | ||||||||
Toolkit | Initial release | Latest release | Main language | Bindings | Tools | License | Pros | Cons | Back-end |
See also[edit]
References[edit]
Wxwidgets Tutorial Pdf
- ^Microsoft: MS Windows NT Kernel-mode User
- ^Techworld: Microsoft to move graphics outside OS kernel
- ^This version provides the core API of the .NET Framework2.0, but its implementation of this API is still incomplete.
- ^Web Development with TIBCO General Interface: Understanding General Interface Architecture Model View Controller Architecture InformIT
- ^Qt Software to discontinue Qt Jambi after 4.5 releaseArchived 26 July 2009 at the Wayback Machine
- ^http://cegui.org.uk/download/cegui-087
- ^http://cegui.org.uk/wiki/PyCEGUI
- ^http://cegui.org.uk/wiki/Extending_your_Lua_Interface
- ^http://cegui.org.uk/wiki/CEED
- ^https://github.com/GNOME/gtk/releases/tag/3.24.4
- ^Migrating to client-side windowsArchived 27 April 2011 at the Wayback Machine: 'GDK looks for the GDK_NATIVE_WINDOWS environment variable and makes all windows native if it is set. It also tries to be more compatible with the way prior versions worked in some other ways.'
- ^Coding Horror: Non-Native UI Sucks: '[…] has a cross-platform UI based on GTK, which produces predictably bland, least-common-denominator results:'
- ^http://sourceforge.net/projects/iup/files/3.21/
- ^http://www.tecgraf.puc-rio.br/iup/
- ^Comparing IUP with Other Interface Toolkits: '[…] it does not have support for Unicode characters.'
- ^http://www.nanapro.org/en-us/
- ^Knoll, Lars (19 June 2019). 'Qt 5.13 Released'. Qt Blog. The Qt Company. Retrieved 19 June 2019.
- ^Nyström, Sebastian (14 January 2009). 'Nokia to license Qt under LGPL'. Retrieved 5 December 2013.
- ^WxWidgets Compared To Other Toolkits: 'Qt doesn't have true native ports like wxWidgets does. Qt does not use system provided widgets, but emulates it with themes. What we mean by this is that even though Qt draws them quite realistically, Qt draws its own widgets on each platform.'
- ^'Qt Modular Class Library'. Digia. Archived from the original on 1 November 2013.
Qt uses the native graphics APIs of each platform it supports, taking full advantage of system resources and ensuring that applications have native look and feel.
- ^'The Qt 4 Style API'. The Qt Company.
Qt's built-in widgets use [QStyle] to perform nearly all of their drawing, ensuring that they look exactly like the equivalent native widgets.
- ^'wxWidgets: Cross-Platform GUI Library'. 10 December 2018. Retrieved 31 January 2019.
External links[edit]
- The GUI Toolkit, Framework Page, comparing some of the modern GUIs out there.
- Survey of Widget sets (for the X Window System) (Edward Falk)
- GUI Toolkits for The X Window System (Leslie Polzer, freshmeat.net, 27 July 2003)
In this [ http://wiki.wxwidgets.org/WxMenu#PopUp-menus ] example wxMenu
is a local variable.
It is then passed by pointer to PopupMenu
, now I always assume that when I give something a menu by pointer it'll delete it for me (much like panels and frames), there's no mention of a copy constructor in http://docs.wxwidgets.org/trunk/classwx_menu.html and even so what if it was subclassed? (so by deduction it does not copy)
Reading: http://docs.wxwidgets.org/trunk/classwx_window.html#a8f715d238cf74a845488b0e2645e98df also states that the PopupMenu
function doesn't return until the menu has been dismissed, it'd be silly if this blocked the entire GUI,
So my question is this:
Why doesn't PopupMenu
take a reference? wx is old, older than some of the things now standard in C++ (RTTI and some memory structures now provided by the STL for example) but references came to be because of operator overloading, inspired by Algol68 (source, 'The design and evolution of C++') which is older than the early 90s, which is when I believe wxWidgets came to be.
What constraints are there while the popup menu is open? I'd like to learn more about wx's internals, so if anyone can point me towards some resources that'd be superb! A lot of what I know about wx has been deduced from how it acts. I was happy initially with this magical black box that did GUIs for me, but I am so curious as to how it actually works _(I've read the books: 'Cross platform GUI programming in wxWidgets' and 'wxPython' - these don't cover it)
In the famous layers of wx diagrams there's the wxWidgets API
then below that the wxWidgets Port
then all the various platform specific stuff, I'd like to know more about how they work/interact.
[diagram: page 44 within this PDF, page 8 in the book: http://ptgmedia.pearsoncmg.com/images/0131473816/downloads/0131473816_book.pdf ]
Alec TealAlec Teal1 Answer
The different questions are rather unrelated. PopupMenu()
takes a pointer mostly for historical reasons (all wxWidgets functions typically take pointers to any window or menu objects). But the newer GetPopupMenuSelectionFromUser() takes a reference. Yet both of them are modal, in the sense that they don't return control until the menu is dismissed. Internally, popup menus run their own event loop which is, moreover, inside the native GUI toolkit (this is definitely the case under Windows) and not wx itself, but this shouldn't really matter.
In any case, PopupMenu()
does not take ownership of the passed in pointer. This allows you to use it like this:
But, again, for most of the cases you can just use GetPopupMenuSelectionFromUser()
which is even more convenient.