FpGUI

Last updated
fpGUI
Fpgui.png
Stable release
v1.4.1 / September 2, 2015;6 years ago (2015-09-02)
Preview release
- / -
Repository
Written in Object Pascal
Operating system Unix/Linux/BSD (X11), Windows, OpenSolaris, ARM-Linux and WinCE devices.
Type Widget toolkit
License LGPL with static linking exception
Website fpgui.sourceforge.net

fpGUI, the Free Pascal GUI toolkit, is a cross-platform graphical user interface toolkit developed by Graeme Geldenhuys. fpGUI is open source and free software, licensed under a Modified LGPL license. The toolkit has been implemented using the Free Pascal compiler, meaning it is written in the Object Pascal language.

Contents

fpGUI consists only of graphical widgets or components, and a cross-platform 2D drawing library. It doesn't implement database layers, 3D graphics, XML parsers etc. It also doesn't rely on any huge third party libraries like GTK or Qt. All the extras come straight from what is available with the Free Pascal Component Library (FCL) which comes standard with the Free Pascal compiler.

History

The first version of fpGUI was written by Sebastian Günther back in 2000. The project was then abandoned in 2002. fpGUI was a successor to an earlier OO GTK wrapper, fpGTK, and was pretty much a fresh start to allow multiple (backend) widgetsets, most notably win32. The toolkit was used for some internal FPC tooling (e.g. the fpdoc editor), but there were still a lot of things outstanding before the toolkit could be truly useful and used in real life applications by end-users. Most of these tools where migrated to the maturing Lazarus in the 2004-2006 timeframe.

Graeme Geldenhuys revived the toolkit in mid-2006 where Sebastian left off. He continued developing the toolkit for the next year. Merging three sub-projects (fpGFX, fpIMG and fpGUI) into a single project fpGUI. Graeme extended the number of components and amount of backend graphics layer, and improved the overall toolkit. The supported platforms at that stage was Linux and FreeBSD via X11 and Microsoft Windows via GDI. After a few months Felipe Monteiro de Carvalho joined the development team adding support for Windows Mobile devices and extending the graphics support and design. Felipe also started working on Mac OS X support via Carbon.

At the beginning of June 2007 Graeme found some major design issues in the source base. This prevented fpGUI from being truly useful in real applications. After numerous prototypes the fpGUI project was completely rewritten. Past experience helped a lot and new design ideas were implemented. The code base ended up being much simpler with a cleaner design. One of the major changes was that all widgets were now based on a multi-handle (windowed) design. Each widget now has a window handle. Other GUI toolkits that follow a similar design are GTK, Xt and FLTK to name a few. GUI toolkits that follow the opposite design are toolkits like the latest Qt [1] and MSEgui.

Example program

The following program shows a single window with a "Quit" button in the bottom right. On the canvas (background) of the window it paints all the standard built-in images used with fpGUI.

programstdimglist;{$mode objfpc}{$H+}usesClasses,SysUtils,fpg_base,fpg_main,fpg_form,fpg_imgfmt_bmp,fpg_button;typeTMainForm=class(TfpgForm)privatebtnClose:TfpgButton;procedurebtnCloseClick(Sender:TObject);protectedprocedureHandlePaint;override;publicconstructorCreate(aowner:TComponent);override;procedureAfterCreate;override;end;{ TMainForm }procedureTMainForm.AfterCreate;beginSetPosition(100,100,700,500);WindowTitle:='fpGUI Standard Image Listing';// Place button in bottom right corner.btnClose:=CreateButton(self,Width-90,Height-35,75,'Quit',@btnCloseClick);btnClose.ImageName:='stdimg.quit';btnClose.Anchors:=[anRight,anBottom];end;procedureTMainForm.btnCloseClick(Sender:TObject);beginClose;end;procedureTMainForm.HandlePaint;varn:integer;x:TfpgCoord;y:TfpgCoord;sl:TStringList;img:TfpgImage;beginCanvas.BeginDraw;// begin double bufferinginheritedHandlePaint;sl:=TStringList.Create;x:=8;y:=8;fpgImages.ListImages(sl);forn:=0tosl.Count-1dobeginCanvas.DrawString(x,y,sl[n]+':');img:=TfpgImage(sl.Objects[n]);ifimg<>nilthenCanvas.DrawImage(x+130,y,img);inc(y,img.Height+8);ify>Height-32then// largest images are 32 in heightbegininc(x,200);y:=8;end;end;Canvas.EndDraw;sl.Free;end;constructorTMainForm.Create(aowner:TComponent);begininheritedCreate(aowner);(* PRIOR TO v1.4:  // Place button in bottom right corner.  btnClose := CreateButton(self, Width-90, Height-35, 75, 'Quit', @btnCloseClick);  btnClose.ImageName := 'stdimg.quit';  btnClose.Anchors := [anRight, anBottom];*)end;procedureMainProc;varfrm:TMainForm;beginfpgApplication.Initialize;frm:=TMainForm.Create(nil);tryfrm.Show;fpgApplication.Run;finallyfrm.Free;end;end;beginMainProc;end.

Here is a screenshot of the above program when run under Linux.
Fpgui stdimglist.png

Licensing

fpGUI is statically linked into programs and is licensed using a modified version of LGPL specially designed to allow static linking to proprietary programs. The only code you need to make available are any changes you made to the fpGUI toolkit - nothing more.

Software written with fpGUI

See also

Related Research Articles

A widget toolkit, widget library, GUI toolkit, or UX library is a library or a collection of libraries containing a set of graphical control elements used to construct the graphical user interface (GUI) of programs.

wxWidgets

wxWidgets is a widget toolkit and tools library for creating graphical user interfaces (GUIs) for cross-platform applications. wxWidgets enables a program's GUI code to compile and run on several computer platforms with minimal or no code changes. A wide choice of compilers and other tools to use with wxWidgets facilitates development of sophisticated applications. wxWidgets supports a comprehensive range of popular operating systems and graphical libraries, both proprietary and free, and is widely deployed in prominent organizations.

FLTK

Fast Light Toolkit is a cross-platform widget library for graphical user interfaces (GUIs), developed by Bill Spitzak and others. Made to accommodate 3D graphics programming, it has an interface to OpenGL, but it is also suitable for general GUI programming.

Graphical widget Element of interaction in a graphical user interface

A graphical widget in a graphical user interface is an element of interaction, such as a button or a scroll bar. Controls are software components that a computer user interacts with through direct manipulation to read or edit information about an application. User interface libraries such as Windows Presentation Foundation, GTK, and Cocoa, contain a collection of controls and the logic to render these.

PyQt

PyQt is a Python binding of the cross-platform GUI toolkit Qt, implemented as a Python plug-in. PyQt is free software developed by the British firm Riverbank Computing. It is available under similar terms to Qt versions older than 4.5; this means a variety of licenses including GNU General Public License (GPL) and commercial license, but not the GNU Lesser General Public License (LGPL). PyQt supports Microsoft Windows as well as various flavours of UNIX, including Linux and MacOS.

Fox toolkit

The FOX toolkit is an open-source, cross-platform widget toolkit, i.e. a library of basic elements for building a graphical user interface (GUI). FOX stands for Free Objects for X.

PHP-GTK PHP library for GTK+ GUI applications

PHP-GTK is a set of language bindings for PHP which allow GTK GUI applications to be written in PHP. PHP-GTK provides an object-oriented interface to GTK classes and functions. While PHP-GTK partially supports GTK2, GTK3 is not supported at all.

Graphical user interface builder

A graphical user interface builder, also known as GUI designer, is a software development tool that simplifies the creation of GUIs by allowing the designer to arrange graphical control elements using a drag-and-drop WYSIWYG editor. Without a GUI builder, a GUI must be built by manually specifying each widget's parameters in source-code, with no visual feedback until the program is run.

X Toolkit Intrinsics

X Toolkit Intrinsics is a library that implements an API to facilitate the development of programs with a graphical user interface (GUI) for the X Window System. It can be used in the C or C++ languages.

gtkmm is the official C++ interface for the popular GUI library GTK. gtkmm is free software distributed under the GNU Lesser General Public License (LGPL).

Tkinter is a Python binding to the Tk GUI toolkit. It is the standard Python interface to the Tk GUI toolkit, and is Python's de facto standard GUI. Tkinter is included with standard GNU/Linux, Microsoft Windows and macOS installs of Python.

ReAction GUI is the widget toolkit engine that is used in AmigaOS 3.2-4.1.

Enthought, Inc. is a software company based in Austin, Texas, United States that develops scientific and analytic computing solutions using primarily the Python programming language. It is best known for the early development and maintenance of the SciPy library of mathematics, science, and engineering algorithms and for its Python for scientific computing distribution Enthought Canopy.

GTK-server is an open-source project released under the GNU General Public License. The GTK-server project aims to bring Graphical User Interface programming to any interpreted language using the GIMP Tool Kit (GTK) or XForms.

Ultimate++

Ultimate++, also known as U++ or Upp - is a C++ rapid application development framework which aims to reduce the code complexity of typical desktop applications by extensively exploiting C++ features. Programs created with it can work on multiple operating systems and hardware architectures without the need to write platform specific code.

GTK Free and open-source cross-platform widget toolkit for creating graphical user interfaces

GTK is a free and open-source cross-platform widget toolkit for creating graphical user interfaces (GUIs). It is licensed under the terms of the GNU Lesser General Public License, allowing both free and proprietary software to use it. It is one of the most popular toolkits for the Wayland and X11 windowing systems.

wxPHP stands for "wxWidgets for PHP" and is a PHP extension that wraps the wxWidgets library, which allows writing multi-platform desktop applications that make use of the native graphical components available to the different platforms. It supports the three major operating systems: Windows, Linux and Mac OS X by using the PHP language. Applications are written in PHP language, and since it is an interpreted language, it does not require an intermediate compilation step in order to run the application, provided the PHP interpreter has the extension available.

Nana is a cross-platform C++ library for creating graphical user interfaces. It uses a platform-independent API and currently supports Windows, Linux and FreeBSD.

References

  1. "Trolltech Labs Blogs » Qt Invaded By Aliens — The End of All Flicker". Archived from the original on 2010-03-03. Retrieved 2008-03-08.
  2. Unlike old 16-bit IPF .inf/.hlp viewers DocView can be used on 64-bit Windows