[fpc-pascal] Using the LCL without Lazarus

luciano de souza luchyanus at gmail.com
Thu Dec 1 17:57:42 CET 2016


I am also blind and this topic really interesses me.
In the given example, heith and width were specified in pixels.
Is there a way to write the same example using automatic adjustments,
in other words, setting to the layout incresing or decreasing in the
proporcion of the label writen?

2016-11-29 23:42 GMT-02:00, BobJ <rjustice004 at woh.rr.com>:
>
> Most of the viewers of this message are probably already aware that I am
> totally blind and must rely on screen-reading software to put to voice that
> which appears on the computer's video display.  Unfortunately, there is more
> than one technique for "painting" a video display, some of which are very
> "unfriendly" to screen-reading software.  Many web sites and
> application-software programs make use of some of those "unfriendly"
> techniques thereby rendering them unusable by blind users on a practical
> level.
>
> I have recently been very successful in completing a couple of console-based
> programs for my personal use by writing source code using Microsoft's
> NotePad and submitting that code to the FPC command-lie compiler.
>
> Now, I want to try my hand at developing software with a GUI but I have run
> into some obstacles as mentioned in my opening statements, above.
>
> My attempts to use the following software has proven to be unsuccessful
> because of the "unfriendly" nature of their video displays:
>
> Lazarus IDE,,
> IDEU IDE,
> FP IDE.
>
> So, while searching for some alternative methods that might be less
> "unfriendly," I discovered the following:
>
> My questions follow the excerpt)
>
> -------- Begin web-site excerpt --------
>
> Using the LCL without Lazarus
>
> 1How to use the LCL without the Lazarus IDE?
> 1.1Requirements
> 1.2Introduction
> 1.3The installation process
> 1.4The settings
> 1.5The code
> 1.6Lazarus 1.2.6
> 2Alternatives
> How to use the LCL without the Lazarus IDE?
>
> Requirements
> Things you'll need:
> .  Free Pascal 2.4.4
> .  Lazarus 0.9.30
> Tested on Microsoft Windows XP SP3.
>
> Introduction
>
> You are not forced to use the Lazarus IDE if you want to develop with the
> LCL. You can use it directly from the Free Pascal Compiler.
>
> The installation process
>
> First download Free Pascal 2.4.4 and the Lazarus 0.9.30 and install them.
> Our FPC install directory will be this
> C:\FPC\2.4.4\
> The Lazarus install directory will be this
> C:\Lazarus\
> Then copy the lcl folder.
> Copy this folder:
> C:\Lazarus\lcl
> Paste it to this location:
> C:\FPC\2.4.4\units\i386-win32\lcl
> Now you can remove Lazarus from your computer. In the next section we'll
> inform the FPC that the LCL has been installed.
>
> The settings
>
> Start the FP IDE (included with FPC).
> Click on the Options menu and then the Directories menu item.
>
> Select the Units tab (default).
> Add these directories:
> C:\FPC\2.4.4\units\i386-win32\lcl
> C:\FPC\2.4.4\units\i386-win32\lcl\units\i386-win32
> C:\FPC\2.4.4\units\i386-win32\lcl\widgetset
> C:\FPC\2.4.4\units\i386-win32\lcl\interfaces\win32
> Then click on the Include files tab.
> Add this directory:
> C:\FPC\2.4.4\units\i386-win32\lcl\include
> Now, you should be able to use the LCL. However, above should be done for
> all Modes in Options if you plan to switch the mode in the future. It is
> easier to edit fp.cfg directly. In the next section we'll try out creating a
> form with a button on it.
> The code
> This is the base code:
>
> program lcl_base;
> {$mode objfpc} {$H+}
>
> uses
>   Classes, Interfaces, Forms, StdCtrls;
>   //Interfaces is very important
>
> type
>   TForm1 = class(TForm)
>     Button1: TButton;
>   end;
>   //Our Form class
>
> var
>   Form1: TForm1;
>   //Declare the Form1
>
> begin
>   Application.Initialize;
>   Application.CreateForm(TForm1, Form1);
>   Form1.Button1 := TButton.Create(Form1);
>   With Form1.Button1 Do
>   begin
>     Parent := Form1;
>     Visible := TRUE;
>     Left := 10;
>     Top := 10;
>     Width := 100;
>     Height := 100;
>     Caption := 'PRESS ME';
>   end;
>   Application.Run;
>   //We do exactly the same as Lazarus does
> end.
>
> That's it. Now, you are able to use the LCL without the Lazarus IDE.
>
> Lazarus 1.2.6
> In order to compile the above example you will need access to units from
> folder C:\lazarus\components\lazutils. The FP compiler would build the
> application with c like operators on.
>
> Alternatives
> If your aim is to compile Lazarus projects without using the Lazarus IDE,
> you can install Lazarus and use the command line lazbuild tool to compile
> projects.
>
> -------- End web-site excerpt --------
>
> 1. I have FPC ver 3.0.0 and Lazarus ver 1.6
> Should the instructions given in the excerpt be applicable with these
> versions, as well?
>
> 2. Is it safe to assume that when they say
> "You are not forced to use the Lazarus IDE if you want to develop with the
> LCL. You can use it directly from the Free Pascal Compiler."
> that they mean that the source code can be submitted to FPC at the command
> line?
>
> 3. As I stated somewhere above, the FP IDE is not accessable at a practical
> level so, is there some other way that I can satisfy the requirements to do
> the following?
>
> Start the FP IDE (included with FPC).
> Click on the Options menu and then the Directories menu item.
> Select the Units tab (default).
> Add these directories:
> C:\FPC\2.4.4\units\i386-win32\lcl
> C:\FPC\2.4.4\units\i386-win32\lcl\units\i386-win32
> C:\FPC\2.4.4\units\i386-win32\lcl\widgetset
> C:\FPC\2.4.4\units\i386-win32\lcl\interfaces\win32
> Then click on the Include files tab.
> Add this directory:
> C:\FPC\2.4.4\units\i386-win32\lcl\include
> Now, you should be able to use the LCL.
>
>
> If the answers to my questions #1 & #2 are in the affirmative, and if the
> paths described in my question #3 can be added to the Windows search path or
> inserted into a *.ini file or somewhere else, perhaps I can give it a go.
>
> I apologize for such a lengthy message but, I didn't know how else to make
> clear my dilemma.
>
> Thanks,
>
> Bob
>
>


-- 
Luciano de Souza


More information about the fpc-pascal mailing list