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