fpGUI Interface: what changed
Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.
Title: fpGUI Interface
| Old | New | Line | |
|---|---|---|---|
| 1 | + | ## Contents | |
| 2 | + | ||
| 3 | + | * 1 Introduction | |
| 4 | + | * 2 Other Interfaces | |
| 5 | + | * 2.1 Platform specific Tips | |
| 6 | + | * 2.2 Interface Development Articles | |
| 7 | + | * 3 Creating your first LCL application with fpGUI | |
| 8 | + | * 4 Implementation details | |
| 9 | + | * 4.1 Component mapping | |
| 10 | + | * 5 Road map for the fpGUI interface | |
| 11 | + | * 6 See also | |
| 12 | + | ||
| 13 | + | ## Introduction | |
| 14 | + | ||
| 15 | + | [[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> | |
| 16 | + | ||
| 17 | + | This page covers the fpGUI widgetset - a Lazarus LCL widget wrapping the fpGUI code. It is different from [[fpGUI|pure fpGUI]] code. | |
| 18 | + | ||
| 19 | + | ## Other Interfaces | |
| 20 | + | ||
| 21 | + | * [[Lazarus known issues \(things that will never be fixed\|Lazarus known issues (things that will never be fixed)]]> "Lazarus known issues \(things that will never be fixed\)") \- A list of interface compatibility issues | |
| 22 | + | * [[Win32/64 Interface]] \- The Windows API (formerly Win32 API) interface for Windows 95/98/Me/2000/XP/Vista/10, but not CE | |
| 23 | + | * [[Windows CE Interface]] \- For Pocket PC and Smartphones | |
| 24 | + | * [[Carbon Interface]] \- The Carbon 32 bit interface for macOS (deprecated; removed from macOS 10.15) | |
| 25 | + | * [[Cocoa Interface]] \- The Cocoa 64 bit interface for macOS | |
| 26 | + | * [[Qt Interface]] \- The Qt4 interface for Unixes, macOS, Windows, and Linux-based PDAs | |
| 27 | + | * [[Qt5 Interface]] \- The Qt5 interface for Unixes, macOS, Windows, and Linux-based PDAs | |
| 28 | + | * [[GTK1 Interface]] \- The gtk1 interface for Unixes, macOS (X11), Windows | |
| 29 | + | * [[GTK2 Interface]] \- The gtk2 interface for Unixes, macOS (X11), Windows | |
| 30 | + | * [[GTK3 Interface]] \- The gtk3 interface for Unixes, macOS (X11), Windows | |
| 31 | + | * fpGUI Interface \- Based on the fpGUI library, which is a cross-platform toolkit completely written in Object Pascal | |
| 32 | + | * [[Custom Drawn Interface]] \- A cross-platform LCL backend written completely in Object Pascal inside Lazarus. The Lazarus interface to Android. | |
| 33 | + | ||
| 34 | + | ### Platform specific Tips | |
| 35 | + | ||
| 36 | + | * [[Android Programming]] \- For Android smartphones and tablets | |
| 37 | + | * [[iPhone/iPod development]] \- About using Objective Pascal to develop iOS applications | |
| 38 | + | * [[FreeBSD Programming Tips]] \- FreeBSD programming tips | |
| 39 | + | * [[Linux Programming Tips]] \- How to execute particular programming tasks in Linux | |
| 40 | + | * [[macOS Programming Tips]] \- Lazarus tips, useful tools, Unix commands, and more... | |
| 41 | + | * [[WinCE Programming Tips]] \- Using the telephone API, sending SMSes, and more... | |
| 42 | + | * [[Windows Programming Tips]] \- Desktop Windows programming tips | |
| 43 | + | ||
| 44 | + | ### Interface Development Articles | |
| 45 | + | ||
| 46 | + | * [[Carbon interface internals]] \- If you want to help improving the Carbon interface | |
| 47 | + | * [[Windows CE Development Notes]] \- For Pocket PC and Smartphones | |
| 48 | + | * [[Adding a new interface]] \- How to add a new widget set interface | |
| 49 | + | * [[LCL Defines]] \- Choosing the right options to recompile LCL | |
| 50 | + | * [[LCL Internals]] \- Some info about the inner workings of the LCL | |
| 51 | + | * [[Cocoa Internals]] \- Some info about the inner workings of the Cocoa widgetset | |
| 52 | + | ||
| 53 | + | ## Creating your first LCL application with fpGUI | |
| 54 | + | ||
| 55 | + | This is a step-by-step guide to build your first application with the fpGUI widgetset | |
| 56 | + | ||
| 57 | + | 1. Download the latest Lazarus from subversion and build it (not necessary if you downloaded a pre-compiled snapshot) | |
| 58 | + | 2. Download fpGUI source code from the SourceForge.net Git repository as follows: | |
| 59 | + | ||
| 60 | + | ||
| 61 | + | ``` | |
| 62 | + | git clone git://git.code.sf.net/p/fpgui/code | |
| 63 | + | ``` | |
| 64 | + | ||
| 65 | + | 3. Make sure you switch the the **maint** branch of fpGUI. | |
| 66 | + | ||
| 67 | + | ||
| 68 | + | ``` | |
| 69 | + | git checkout maint | |
| 70 | + | ``` | |
| 71 | + | ||
| 72 | + | 4. Now we need to make the Lazarus LCL find the fpGUI code. | |
| 73 | + | 1. **Using Lazarus (trunk)** | |
| 74 | + | * Option 1) | |
| 75 | + | ||
| 76 | + | Copy the 'src' directory from the fpGUI sources into your Lazarus directory as follows: | |
| 77 | + | ||
| 78 | + | ||
| 79 | + | <fpgui>/src/ ⇒ <lazarus>/lcl/interfaces/fpgui/src/ | |
| 80 | + | ||
| 81 | + | ||
| 82 | + | * Option 2) | |
| 83 | + | ||
| 84 | + | Use your file system's symbolic linking function to create a link the fpGUI **src** directory, to the correct location in Lazarus. | |
| 85 | + | For example: | |
| 86 | + | ||
| 87 | + | ||
| 88 | + | cd /opt/lazarus/lcl/interfaces/fpgui | |
| 89 | + | ln -s /path/to/fpgui/src src | |
| 90 | + | ||
| 91 | + | ||
| 92 | + | 2. **Using Lazarus 1.0.8 and earlier** | |
| 93 | + | * Option 1) | |
| 94 | + | ||
| 95 | + | Supported on all platforms. Copy two directories and one file from the downloaded **fpgui** to **lazarus** | |
| 96 | + | ||
| 97 | + | ||
| 98 | + | <fpGUI dir>/src/gui ⇒ lazarus/lcl/interfaces/fpgui/gui | |
| 99 | + | <fpGUI dir>/src/corelib ⇒ lazarus/lcl/interfaces/fpgui/corelib | |
| 100 | + | <fpGUI dir>/src/VERSION_FILE.inc ⇒ lazarus/lcl/interfaces/fpgui/VERSION_FILE.inc | |
| 101 | + | ||
| 102 | + | ||
| 103 | + | * Option 2) | |
| 104 | + | ||
| 105 | + | 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: | |
| 106 | + | ||
| 107 | + | ||
| 108 | + | ln -s <fpGUI dir>/src/gui lazarus/lcl/interfaces/fpgui/gui | |
| 109 | + | ln -s <fpGUI dir>/src/corelib lazarus/lcl/interfaces/fpgui/corelib | |
| 110 | + | ln -s <fpGUI dir>/src/VERSION_FILE.inc lazarus/lcl/interfaces/fpgui/VERSION_FILE.inc | |
| 111 | + | ||
| 112 | + | ||
| 113 | + | 5. Now you need to recompile LCL for the LCL-fpGUI widgetset | |
| 114 | + | 1. **Using Lazarus (trunk)** | |
| 115 | + | 1. Start a new LCL application | |
| 116 | + | 2. 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. | |
| 117 | + | * define IDE Macro: **LCLWidgetType := fpgui** | |
| 118 | + | * define IDE Macro: **fpGUIPlatform := gdi**(for Windows) | |
| 119 | + | * define IDE Macro: **fpGUIPlatform := x11**(for Linux/FreeBSD) | |
| 120 | + | 3. Compile your project! | |
| 121 | + | 2. **Using Lazarus 1.0.8 and earlier** | |
| 122 | + | 1. Start a new LCL application | |
| 123 | + | 2. 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. | |
| 124 | + | 3. Go to the menu Compiler Options, select **fpGUI** as the widgetset | |
| 125 | + | 4. Compile your project! | |
| 126 | + | ||
| 127 | + | ## Implementation details | |
| 128 | + | ||
| 129 | + | ### Component mapping | |
| 130 | + | ||
| 131 | + | This is a table indication which FPGUI controls are used to build each LCL control. | |
| 132 | + | ||
| 133 | + | **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. | |
| 134 | + | ||
| 135 | + | ||
| 136 | + | ||
| 137 | + | LCL Control | FPGUI Control | Comments | |
| 138 | + | ---|---|--- | |
| 139 | + | TPageControl | TfpgPageControl | \- | |
| 140 | + | TButton | TfpgButton | \- | |
| 141 | + | TBitBtn | TfpgButton | fpGUI's standard button class supports images. | |
| 142 | + | TSpeedButton | TfpgButton | fpGUI's standard button class supports images and flat look etc. | |
| 143 | + | ||
| 144 | + | ## Road map for the fpGUI interface | |
| 145 | + | ||
| 146 | + | Here: [[Roadmap|Roadmap#Widgetset dependent components]] | |
| 147 | + | ||
| 148 | + | ## See also | |
| 149 | + | ||
| 150 | + | * [[fpGUI]] Toolkit | |
| 151 | + | * [**Easy fpGUI**](<http://www.turbocontrol.com/easyfpgui.htm>) The easy way to try fpGUI and Free Pascal! Simply unpack the archive and you have a fully working FPC and fpGUI environment. | |
| 152 | + | ||
| 153 | + | --- | |
| 154 | + | *From the Free Pascal wiki, page "fpGUI Interface", as the Internet Archive kept it on 2023-06-07. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).* |
