Difference between revisions of "fpGUI Interface"

From Free Pascal wiki
m (Creating your first LCL application with fpGUI)
(Creating your first LCL application with fpGUI: reformatted the bulk of the wiki text in a wiki mark-up.)
Line 15: 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
  
1. Download the latest Lazarus from subversion and build it (not necessary if you downloaded a pre-compiled snapshot)
+
# 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:
2. 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.
git clone git://git.code.sf.net/p/fpgui/code
+
#:<pre>git checkout maint</pre>
 
+
# Now we need to make the Lazarus LCL find the fpGUI code.
3. Make sure you switch the the '''maint''' branch of fpGUI.
+
##'''Using Lazarus (trunk)'''
 
+
##*Option 1)
git checkout maint
+
##*:Copy the 'src' directory from the fpGUI sources into your Lazarus directory as follows:<br/><br/>
 
+
##*:<fpgui>/src/ ⇒ <lazarus>/lcl/interfaces/fpgui/src/
4. Now we need to make the Lazarus LCL find the fpGUI code.
+
##*:<br/>
 
+
##*Option 2)
===Using Lazarus (trunk)===
+
##*:Use your file system's symbolic linking function to create a link the fpGUI '''src''' directory, to the correct location in Lazarus.
Option 1)<br/>
+
##*:For example:<br/><br/>
Copy the 'src' directory from the fpGUI sources into your Lazarus directory as follows:
+
##*:cd /opt/lazarus/lcl/interfaces/fpgui
 
+
##*:ln -s /path/to/fpgui/src src
  <fpgui>/src/ ⇒ <lazarus>/lcl/interfaces/fpgui/src/
+
##*:<br/>
 
+
##'''Using Lazarus 1.0.8 and earlier'''
Option 2)<br/>
+
##*Option 1)
Use your file system's symbolic linking function to create a link the fpGUI '''src''' directory, to the correct location in Lazarus.
+
##:Supported on all platforms. Copy two directories and one file from the downloaded '''fpgui''' to '''lazarus'''<br/><br/>
 
+
##:<fpGUI dir>/src/gui &rArr; lazarus/lcl/interfaces/fpgui/gui
For example:
+
##:<fpGUI dir>/src/corelib &rArr; lazarus/lcl/interfaces/fpgui/corelib
    cd /opt/lazarus/lcl/interfaces/fpgui
+
##:<fpGUI dir>/src/VERSION_FILE.inc &rArr; lazarus/lcl/interfaces/fpgui/VERSION_FILE.inc
    ln -s /path/to/fpgui/src src
+
##:<br/>
 
+
##*Option 2)
===Using Lazarus 1.0.8 and earlier===
+
##: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/>
Option 1)<br/>
+
##:ln -s <fpGUI dir>/src/gui lazarus/lcl/interfaces/fpgui/gui
Supported on all platforms. Copy two directories and one file from the downloaded '''fpgui''' to '''lazarus'''
+
##: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
<fpGUI dir>/src/gui &rArr; lazarus/lcl/interfaces/fpgui/gui
+
##:<br/>
<fpGUI dir>/src/corelib &rArr; lazarus/lcl/interfaces/fpgui/corelib
+
#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.
<fpGUI dir>/src/VERSION_FILE.inc &rArr; lazarus/lcl/interfaces/fpgui/VERSION_FILE.inc
+
#Go to the menu Compiler Options, select '''fpGUI''' as the widgetset and you can recompile your project to fpGUI.
 
 
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:
 
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
 
 
 
5. 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.
 
 
 
6. Go to the menu Compiler Options, select '''fpGUI''' as the widgetset and you can recompile your project to fpGUI.
 
  
 
==Implementation details==
 
==Implementation details==

Revision as of 00:35, 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

Platform specific Tips

Interface Development Articles

Creating your first LCL application with fpGUI

This is a step-by-step guide to build your first application with the fpGUI widgetset

  1. Download the latest Lazarus from subversion and build it (not necessary if you downloaded a pre-compiled snapshot)
  2. Download fpGUI source code from the SourceForge.net Git repository as follows:
    git clone git://git.code.sf.net/p/fpgui/code
  3. Make sure you switch the the maint branch of fpGUI.
    git checkout maint
  4. Now we need to make the Lazarus LCL find the fpGUI code.
    1. 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/

      • 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

    2. 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

  5. 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.
  6. Go to the menu Compiler Options, select fpGUI as the widgetset and you can recompile your project to fpGUI.

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.