Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

fpGUI

From Wikipedia, the free encyclopedia
Graphical user interface toolkit in Object Pascal
fpGUI
Stable release
v1.4.1 / September 2, 2015; 9 years ago (2015-09-02)
Preview release
- / -
Repository
Written inObject Pascal
Operating systemUnix/Linux/BSD (X11),Windows,OpenSolaris, ARM-Linux and WinCE devices.
TypeWidget toolkit
LicenseLGPL with static linking exception
Websitefpgui.sourceforge.net

fpGUI, the Free PascalGUI toolkit, is across-platform graphical user interface toolkit developed by Graeme Geldenhuys. fpGUI isopen source andfree software, licensed under a Modified LGPL license. The toolkit has been implemented using theFree Pascal compiler, meaning it is written in theObject Pascal language.

fpGUI consists only of graphicalwidgets 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 theFree Pascal Component Library (FCL) which comes standard with theFree Pascal compiler.

History

[edit]

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 open issues before the toolkit could be truly useful and used in real life applications by end-users. Most of these tools where migrated to the maturingLazarus 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 wasLinux andFreeBSD viaX11 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 areGTK,Xt andFLTK to name a few. GUI toolkits that follow the opposite design are toolkits like the latestQt[1] and MSEgui.

Example program

[edit]

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.

Licensing

[edit]

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

[edit]
  • Master Maths
    Used in a computer-based training system. As well as a basic accounting and administration package for franchisees.
  • A Visual Form Designer which is now included as part of fpGUI. It allows the developer to create user interfaces at a much faster pace.
  • Unimesur and various tools
    Written by Jean-Marc, the Unimesur program allows to convert measurements of flows of liquids and gases, between mass and volume units. All results were verified for the exactness of the conversion factors.
  • fpGUI DocView
    AnINF help file viewer that currently works on Windows,[2] Linux and FreeBSD. INF is the default help format of fpGUI, and is also the help format used inOS/2 (and alsoeComStation andArcaOS).
  • Free Pascal Testing Framework
    A cross-platform unit testing framework with a Console and GUI test runner.

See also

[edit]

References

[edit]
  1. ^"Trolltech Labs Blogs » Qt Invaded By Aliens — The End of All Flicker". Archived fromthe original on 2010-03-03. Retrieved2008-03-08.
  2. ^Unlike old 16-bitIPF.inf/.hlp viewers DocView can be used on 64-bit Windows

External links

[edit]
Low-level platform-specific
OnAmigaOS
OnClassic Mac OS,macOS
OnWindows
OnUnix,
underX11
OnBeOS,Haiku
OnAndroid
CLI
Low Level Cross-platform
CLI
C
Java
High-level, platform-specific
OnAmigaOS
OnClassic Mac OS,macOS
Object Pascal
Objective-C,Swift
C++
CLI
OnWindows
CLI
C++
Object Pascal
OnUnix,
underX11
OnAndroid
High-level, cross-platform
C
C++
Objective-C
CLI
Adobe Flash
Go
Haskell
Java
JavaScript
Common Lisp
Lua
Pascal
Object Pascal
Perl
PHP
Python
Ruby
Tcl
XML
shell
Dart
Retrieved from "https://en.wikipedia.org/w/index.php?title=FpGUI&oldid=1279885048"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp