Difference between revisions of "fpGUI Interface"
Jwdietrich (talk | contribs) (Categories cleaned up) |
Ggeldenhuys (talk | contribs) (→Creating your first LCL application with fpGUI: Added additional instructions for Lazarus (trunk) and Lazarus v1.0.8 and earlier.) |
||
(8 intermediate revisions by 3 users not shown) | |||
Line 6: | Line 6: | ||
[[fpGUI]] is a widgetset completely written in Object Pascal. It links directly with the underlying windowing system, and thus avoids the need for many external libraries. More information on its website: http://fpgui.sourceforge.net | [[fpGUI]] is a widgetset completely written in Object Pascal. It links directly with the underlying windowing system, and thus avoids the need for many external libraries. More information on its website: http://fpgui.sourceforge.net | ||
+ | |||
+ | This page covers the fpGUI widgetset - a Lazarus LCL widget wrapping the fpGUI code. It is different from [[fpGUI|pure fpGUI]] code. | ||
{{Other Interfaces}} | {{Other Interfaces}} | ||
Line 13: | Line 15: | ||
This is a step-by-step guide to build your first application with the fpGUI widgetset | This is a step-by-step guide to build your first application with the fpGUI widgetset | ||
− | + | # Download the latest Lazarus from subversion and build it (not necessary if you downloaded a pre-compiled snapshot) | |
− | + | # Download fpGUI source code from the SourceForge.net Git repository as follows: | |
− | + | #:<pre>git clone git://git.code.sf.net/p/fpgui/code</pre> | |
− | + | # Make sure you switch the the '''maint''' branch of fpGUI. | |
− | + | #:<pre>git checkout maint</pre> | |
− | + | # Now we need to make the Lazarus LCL find the fpGUI code. | |
− | + | ##'''Using Lazarus (trunk)''' | |
− | + | ##*Option 1) | |
− | + | ##*:Copy the 'src' directory from the fpGUI sources into your Lazarus directory as follows:<br/><br/> | |
− | Option 1) | + | ##*:<fpgui>/src/ ⇒ <lazarus>/lcl/interfaces/fpgui/src/ |
− | Copy the 'src' directory from the fpGUI sources into your Lazarus directory as follows: | + | ##*:<br/> |
− | + | ##*Option 2) | |
− | + | ##*:Use your file system's symbolic linking function to create a link the fpGUI '''src''' directory, to the correct location in Lazarus. | |
− | + | ##*:For example:<br/><br/> | |
− | Option 2) | + | ##*:cd /opt/lazarus/lcl/interfaces/fpgui |
− | Use your file | + | ##*:ln -s /path/to/fpgui/src src |
− | + | ##*:<br/> | |
− | For example: | + | ##'''Using Lazarus 1.0.8 and earlier''' |
− | + | ##*Option 1) | |
− | + | ##:Supported on all platforms. Copy two directories and one file from the downloaded '''fpgui''' to '''lazarus'''<br/><br/> | |
− | + | ##:<fpGUI dir>/src/gui ⇒ lazarus/lcl/interfaces/fpgui/gui | |
− | + | ##:<fpGUI dir>/src/corelib ⇒ lazarus/lcl/interfaces/fpgui/corelib | |
− | Option 1) | + | ##:<fpGUI dir>/src/VERSION_FILE.inc ⇒ lazarus/lcl/interfaces/fpgui/VERSION_FILE.inc |
− | Supported on all platforms. Copy two directories and one file from the downloaded '''fpgui''' to '''lazarus''' | + | ##:<br/> |
− | + | ##*Option 2) | |
− | + | ##:Linux or any other Unix type platforms. Create symbolic links from the fpGUI's '''corelib''', '''gui''' directories and VERSION_FILE.inc to the Lazarus LCL directory as follows:<br/><br/> | |
− | + | ##:ln -s <fpGUI dir>/src/gui lazarus/lcl/interfaces/fpgui/gui | |
− | + | ##:ln -s <fpGUI dir>/src/corelib lazarus/lcl/interfaces/fpgui/corelib | |
− | + | ##:ln -s <fpGUI dir>/src/VERSION_FILE.inc lazarus/lcl/interfaces/fpgui/VERSION_FILE.inc | |
− | Option 2) | + | ##:<br/> |
− | Linux or any other Unix type platforms. Create symbolic links from the fpGUI's '''corelib''', '''gui''' directories and VERSION_FILE.inc to the Lazarus LCL directory as follows: | + | #Now you need to recompile LCL for the LCL-fpGUI widgetset |
− | + | ##'''Using Lazarus (trunk)''' | |
− | + | ###Start a new LCL application | |
− | + | ###Tell it to use the LCL-fpGUI widgeset by using the '''Additions and Overrides''' dialog. This can be found by selecting "Project Options -> Compiler Options -> Additions and Overrides". You can use the drop-down button menus in that dialog to define the following IDE Macros, or type them in by hand. For the '''fpGUIPlatform''' macro, only define one, dependent on the platform you are compiling for. | |
− | + | ###*define IDE Macro: '''LCLWidgetType := fpgui''' | |
− | + | ###*define IDE Macro: '''fpGUIPlatform := gdi'''<span style="margin-left: 100px;">(for Windows)</span> | |
− | + | ###*define IDE Macro: '''fpGUIPlatform := x11'''<span style="margin-left: 100px;">(for Linux/FreeBSD)</span> | |
− | + | ###Compile your project! | |
+ | ##'''Using Lazarus 1.0.8 and earlier''' | ||
+ | ###Start a new LCL application | ||
+ | ###Open Lazarus, open the menu "Tools -> Configure Build Lazarus", select all options to None and LCL to Build+Clean, select fpGUI widgetset and rebuild it. | ||
+ | ###Go to the menu Compiler Options, select '''fpGUI''' as the widgetset | ||
+ | ###Compile your project! | ||
==Implementation details== | ==Implementation details== | ||
Line 76: | Line 83: | ||
Here: [[Roadmap#Widgetset dependent components]] | Here: [[Roadmap#Widgetset dependent components]] | ||
+ | |||
+ | == See also == | ||
+ | * [[fpGUI]] Toolkit | ||
+ | * [http://www.turbocontrol.com/easyfpgui.htm '''Easy fpGUI'''] The easy way to try fpGUI and Free Pascal! Simply unpack the archive and you have a fully working FPC and fpGUI environment. | ||
+ | |||
[[Category:fpGUI]] | [[Category:fpGUI]] | ||
+ | [[Category:Lazarus]] | ||
+ | [[Category:LCL]] |
Latest revision as of 00:51, 29 October 2016
│
Deutsch (de) │
English (en) │
español (es) │
français (fr) │
Introduction
fpGUI is a widgetset completely written in Object Pascal. It links directly with the underlying windowing system, and thus avoids the need for many external libraries. More information on its website: http://fpgui.sourceforge.net
This page covers the fpGUI widgetset - a Lazarus LCL widget wrapping the fpGUI code. It is different from pure fpGUI code.
Other Interfaces
- Lazarus known issues (things that will never be fixed) - A list of interface compatibility issues
- Win32/64 Interface - The Windows API (formerly Win32 API) interface for Windows 95/98/Me/2000/XP/Vista/10, but not CE
- Windows CE Interface - For Pocket PC and Smartphones
- Carbon Interface - The Carbon 32 bit interface for macOS (deprecated; removed from macOS 10.15)
- Cocoa Interface - The Cocoa 64 bit interface for macOS
- Qt Interface - The Qt4 interface for Unixes, macOS, Windows, and Linux-based PDAs
- Qt5 Interface - The Qt5 interface for Unixes, macOS, Windows, and Linux-based PDAs
- GTK1 Interface - The gtk1 interface for Unixes, macOS (X11), Windows
- GTK2 Interface - The gtk2 interface for Unixes, macOS (X11), Windows
- GTK3 Interface - The gtk3 interface for Unixes, macOS (X11), Windows
- fpGUI Interface - Based on the fpGUI library, which is a cross-platform toolkit completely written in Object Pascal
- Custom Drawn Interface - A cross-platform LCL backend written completely in Object Pascal inside Lazarus. The Lazarus interface to Android.
Platform specific Tips
- Android Programming - For Android smartphones and tablets
- iPhone/iPod development - About using Objective Pascal to develop iOS applications
- FreeBSD Programming Tips - FreeBSD programming tips
- Linux Programming Tips - How to execute particular programming tasks in Linux
- macOS Programming Tips - Lazarus tips, useful tools, Unix commands, and more...
- WinCE Programming Tips - Using the telephone API, sending SMSes, and more...
- Windows Programming Tips - Desktop Windows programming tips
Interface Development Articles
- Carbon interface internals - If you want to help improving the Carbon interface
- Windows CE Development Notes - For Pocket PC and Smartphones
- Adding a new interface - How to add a new widget set interface
- LCL Defines - Choosing the right options to recompile LCL
- LCL Internals - Some info about the inner workings of the LCL
- Cocoa Internals - Some info about the inner workings of the Cocoa widgetset
Creating your first LCL application with fpGUI
This is a step-by-step guide to build your first application with the fpGUI widgetset
- Download the latest Lazarus from subversion and build it (not necessary if you downloaded a pre-compiled snapshot)
- Download fpGUI source code from the SourceForge.net Git repository as follows:
git clone git://git.code.sf.net/p/fpgui/code
- Make sure you switch the the maint branch of fpGUI.
git checkout maint
- Now we need to make the Lazarus LCL find the fpGUI code.
- Using Lazarus (trunk)
- Option 1)
- Copy the 'src' directory from the fpGUI sources into your Lazarus directory as follows:
- <fpgui>/src/ ⇒ <lazarus>/lcl/interfaces/fpgui/src/
- Copy the 'src' directory from the fpGUI sources into your Lazarus directory as follows:
- Option 2)
- Use your file system's symbolic linking function to create a link the fpGUI src directory, to the correct location in Lazarus.
- For example:
- cd /opt/lazarus/lcl/interfaces/fpgui
- ln -s /path/to/fpgui/src src
- Option 1)
- Using Lazarus 1.0.8 and earlier
- Option 1)
- Supported on all platforms. Copy two directories and one file from the downloaded fpgui to lazarus
- <fpGUI dir>/src/gui ⇒ lazarus/lcl/interfaces/fpgui/gui
- <fpGUI dir>/src/corelib ⇒ lazarus/lcl/interfaces/fpgui/corelib
- <fpGUI dir>/src/VERSION_FILE.inc ⇒ lazarus/lcl/interfaces/fpgui/VERSION_FILE.inc
- Option 2)
- Linux or any other Unix type platforms. Create symbolic links from the fpGUI's corelib, gui directories and VERSION_FILE.inc to the Lazarus LCL directory as follows:
- ln -s <fpGUI dir>/src/gui lazarus/lcl/interfaces/fpgui/gui
- ln -s <fpGUI dir>/src/corelib lazarus/lcl/interfaces/fpgui/corelib
- ln -s <fpGUI dir>/src/VERSION_FILE.inc lazarus/lcl/interfaces/fpgui/VERSION_FILE.inc
- Using Lazarus (trunk)
- Now you need to recompile LCL for the LCL-fpGUI widgetset
- Using Lazarus (trunk)
- Start a new LCL application
- Tell it to use the LCL-fpGUI widgeset by using the Additions and Overrides dialog. This can be found by selecting "Project Options -> Compiler Options -> Additions and Overrides". You can use the drop-down button menus in that dialog to define the following IDE Macros, or type them in by hand. For the fpGUIPlatform macro, only define one, dependent on the platform you are compiling for.
- define IDE Macro: LCLWidgetType := fpgui
- define IDE Macro: fpGUIPlatform := gdi(for Windows)
- define IDE Macro: fpGUIPlatform := x11(for Linux/FreeBSD)
- Compile your project!
- Using Lazarus 1.0.8 and earlier
- Start a new LCL application
- Open Lazarus, open the menu "Tools -> Configure Build Lazarus", select all options to None and LCL to Build+Clean, select fpGUI widgetset and rebuild it.
- Go to the menu Compiler Options, select fpGUI as the widgetset
- Compile your project!
- Using Lazarus (trunk)
Implementation details
Component mapping
This is a table indication which FPGUI controls are used to build each LCL control.
NOTE: This table is incomplete and out of date. Many other controls have already been implemented in LCL-fpGUI, but not listed in this table.
LCL Control | FPGUI Control | Comments |
---|---|---|
TPageControl | TfpgPageControl | - |
TButton | TfpgButton | - |
TBitBtn | TfpgButton | fpGUI's standard button class supports images. |
TSpeedButton | TfpgButton | fpGUI's standard button class supports images and flat look etc. |
Road map for the fpGUI interface
Here: Roadmap#Widgetset dependent components
See also
- fpGUI Toolkit
- Easy fpGUI The easy way to try fpGUI and Free Pascal! Simply unpack the archive and you have a fully working FPC and fpGUI environment.