Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2000-01

Lazarus help html document

14 messages · 9 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Andrew Bednarz
you wrote
Can I get comments on this file please. I spent a lot of time typing but

not much editing it so it's rough.

Please let me know if you guys think it'll be helpful to new developers

out there, plus let me know sections that could >be added.

this is good - this kind of stuff makes me more willing to jump in when I get time..

AMC Enterprises P/L - Andrew Bednarz
First Floor - Senior Programmer
3 Chesterville Rd -
Cheltenham Vic 3192 - Ph: (03) 9584-2700
http://www.amc.com.au/ - Fax: (03) 9584-2755

Reply by email

Michael A. Hess
to Shane Miller: Can I get comments on this file please. I spent a lot of time typing but not much…
Shane Miller wrote
Can I get comments on this file please. I spent a lot of time typing but not much editing it so it's rough.

There are alot of typos but I won't worry about those right now. Here are some of my comments.

A few examples of widget sets would be the default Win32 widgets (controls) that are used within the Windows environment. Also, within linux you can use GTK widgets or QT widgets. This allows Lazarus to be run under Windows and Linux and have total code compatability.

This would lead people to believe that you can only use Win32 in Windows. Both GTK and Qt are available under windows and they can also be used with Lazarus and the LCL.

The rest of the explaination seems correct. However in reading how the interfaces.pp works this does indicate that we need to clean this up somewhat. It does work but it isn't very clean. I know part of this is my fault since I had planned on moving things to separate directories and I just haven't gotten to it yet. I will make a big effort to get to this in the next few days.

==== Programming my first best destiny! ==== Michael A. Hess Miracle Concepts, Inc. http://www.miraclec.com

Reply by email

Vincent Snijders
to Shane Miller: Can I get comments on this file please. I spent a lot of time typing but not much…

It may be a bit of topic, but what I really feel missing in the how-to-pages, is how to set up a compiler-debugger team or an IDE such as TP.

I have heard rumours that there is an IDE for go32v2 and RHIDE which is suposed to run on linux as well. I think Shane and some others use DDD. So there really must be something more then notepad (editpad) en plain ppc386. What I need to really understand code and to be able to debug it (one of the most important part of code writing) is a way of stepping through the code (with F8).

Could someone write a how-to (or rather two, one for linux and one for win32) on (how to) install one of the above mentioned debugging tools so that one can step through the code? For me that would be a big step overcoming the hurdles of becoming a contributor.

Thanks for your attention,

Vincent Snijders

Earlier message 15 lines
----- Original Message ----- From: Shane Miller To: Sent: Monday, January 10, 2000 10:02 PM Subject: [lazarus] Lazarus help html document Can I get comments on this file please. I spent a lot of time typing but not much editing it so it's rough. Please let me know if you guys think it'll be helpful to new developers out there, plus let me know sections that could be added. Thanks Shane

Reply by email

Kevin Berry

here here!

As soon as I'm able to compile and start playing
around with it, I'm going to want to step through the code...

Cheers,
Kevin.

--- Vincent Snijders wrote 6 lines
It may be a bit of topic, but what I really feel missing in the how-to-pages, is how to set up a compiler-debugger team or an IDE such as TP.

[...snip...]
__________________________________________________ Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger. http://im.yahoo.com

Reply by email

Peter Vreman
to Michael A. Hess: There are alot of typos but I won't worry about those right now. Here are some of my…
Show quoted text 14 lines
> Can I get comments on this file please. I spent a lot of time typing > but not much editing it so it's rough. There are alot of typos but I won't worry about those right now. Here are some of my comments. > A few examples of widget sets would be the default Win32 widgets > (controls) that are used within the Windows environment. Also, within > linux you can use GTK widgets or QT widgets. This allows Lazarus to be > run under Windows and Linux and have total code compatability. This would lead people to believe that you can only use Win32 in Windows. Both GTK and Qt are available under windows and they can also be used with Lazarus and the LCL.

Maybe you should provide the GTK DLL's on the website

Btw. there are new gtk dll's available.

Peter

Reply by email

Marc Weustink
to Shane Miller: Can I get comments on this file please. I spent a lot of time typing but not much…
you wrote 5 lines
Can I get comments on this file please. I spent a lot of time typing but not much editing it so it's rough. Please let me know if you guys think it'll be helpful to new developers out there, plus let me know sections that could be added.

First reaction, I'll print it out tomorrow and might have more comments.

It roughly says how it works, however in the TButton example the LM_PRESSED and LM_RELEASED messages aren't sent anymore. They have been replaced by the mouse LM_[L|M|R]BUTTON[DOWN|UP] and key messages LM_KEY[DOWN|UP]

For a better readability I would choose a left alignment.

Marc

Reply by email

Shane Miller

Can I get comments on this file please. I spent a lot of time typing but not much editing it so it's rough.

Please let me know if you guys think it'll be helpful to new developers out there, plus let me know sections that could be added.

Thanks
Shane

Title: Welcome to the Lazarus Project Information Page

<IMG SRC="SMLogo/lazarus_sm.jpg"
WIDTH="250" HEIGHT="188">
The Official Source of Lazarus Project Information

<IMG SRC="SMDecors/baroque2J.gif" ALT="Welcome"
WIDTH="480" HEIGHT="52">

<IMG SRC="SMDecors/baroque10.gif"
WIDTH="120" HEIGHT="36">

Welcome to the Lazarus Project
Information Page
Welcome to the Lazarus Project Information page.
This document is designed for the "new" developer to Lazaurs. From this document you will learn how to add code to lazarus and how we have setup the components, controls, events, etc inside the Lazarus code. This page will be updated as changes are made to the componets and the underlying structure of the LCL (Lazarus Component Library).
A
brief explaination:Lazarus is built to allow it the be run using many differnet types of "widget" sets. A few examples of widget sets would be the default Win32 widgets (controls) that are used within the Windows environment. Also, within linux you can use GTK widgets or QT widgets. This allows Lazarus to be run under Windows and Linux and have total code compatability.
All the code that determines which widget set to use is found within a file called Interfaces.pp or one of the files it uses. Within this file are the "{$Define}"'s that specify which widget set the controls should be built off of.
"{$define GTK}" causes the InterfaceObject class to become a class of "TGtkObject" and therefore inherit all the gtk specific commands/methods/properties. This is a quick and easy method of controlling the widget set without making the developer control which files or directories should be in the search path. This way it's all controlled by one "Define". Later, this will be a setting within the IDE itself and will allow the developer to simply choose which widget set to use by selecting them from a list..
Currently, the GTK widget set is the most complete within Lazarus and therefore I will start by explaining the files associated with that widget set.
Interfaces.pp defines a class TInterfaceObject that inherits from TGTKObject which is found in GTKInt.pp
GTKInt.PP:Contains the class definition for TGTKObject The most important method in this class definition is IntSendMessage3That function is called by the TControl class and is used to send the widget set messages such as LM_CREATE to create a widget, LM_SETLABEL to change a widget's caption, LM_SHOWHIDE to set a widget's visible property to true/false, etc. Each widget set (QT, WIN32, GTK) will have it's own IntSendMessage3 function inside their specific class definition (like TWIN32Object or TQTObject). All code associated with the GTKInt.pp class definition can be found in GTKObject.inc.
EVENTS: Events are currently assigned by calling a procedure within TControl called "SetCallback" which then calls each widget interface object (in GTK's case, it calls TGTKObject") and assigns a event/signal for that control. For example, in TWinControl.AttachSignals, a event is assigned for LM_DETROY. That signal/event is then assigned to that twincontrol. The SetCallback function in gtkobject tells the GTK widget to call a proceure in gtkcallback when it being destroyed and pass it the SENDER from the initial SetCallBack call. When the control is being destroyed, gtk fires a "destroy" signal. When that signal occurs, a procedure in gtkcallback.inc gets called and uses the SENDER property that we told it to send along when we connected the signal, and we call TControl(SENDER).WindowProc(Message). Message is a TLMessage (compatable with TMessage) that we fill with the appropriate information for each event. As an example of a component, I will explain TButton.

TButton:TButton inherits from TButtonControl. All
TButton does is declare a few "message" procedures. These procedures are called automatically when the associated message is dispatched. LM_PRESSED is dispatched when the button is pressed, LM_RELEASED is dispatched when the button is released, etc. All these procedure's do is check to see if the developer assigned the OnPressed or OnReleased events to a procedure. If so, it then calls that procedure.
TButton.Create's only job is to call the inherited create, then set the fCompStyle property. Every control has a fCompStyle property. This allows the widget set to know what type o control it is and therefore create/destroy/click/show/hide/... the correct type of widget. In TButton, fCompStyle is set to csButton.
TButtonControl does nothing but call the inherited Create. TButtoncontrol inherits from TWinControl.
TWinControl is in charge of doing most of the work. It set's all the call backs for "windowed" controls, creates a list of controls and their children, and inherits from TControl. TControl sends messages back and forth to the interface object for each widget type. For example, when "caption" is set to some value, a procedure called SetCaption is called. This procedure calls Sendmessage(LM_SETLABEL,Self,nil). SendMessage (defined in controls.pp) calls the InterfaceObject.IntSendMessage3 and passes it the message (LM_SETLABEL) and self.
In the case that GTk is defined and we are using GTK widgets, IntSendMessage3 in gtkObject is called. It determines that a LM_SETLABEL message was sent and it calls TgtkObject.SetLabel(Sender) where Sender equals the "Self" that we sent it. In gtk's SetLabel we call a procedure gtk_label_set_text after determining that SENDER is a TBUTTON. We pass it the label of the button (which is actually a child widget of the button widget) and we also pass it the value of TButton(Sender).Caption. If we were using WIN32 our IntSendMessage3 in win32interface would call a SetLabel function that would call a Windows API function to set the label. In QT widgets we call a QT specific function call. All other properties/settings for the controls are set the same way. Each type of property has it's own message and this implementation is hidden within TControl so most developers will never need to understand this.

How can I participate?: Let's say you are looking
through the code and notice that we don't have a TCalendar component but GTK does and you would like to implement it. If Delphi doesn't have this control already, you will need to create a new unit and include file. The skeleton files for this can be found in lazarus/lcl/templates. make sure you load these and save tham as Calendar.pp and Calendar.inc in lazarus/lcl. Create the classes called TCalendar and add a fCompStyle constant for a calendar into vclglobals.pp. Call it csCalendar and assign it to the last cs???? +1. In TCalendar call the inherited method, then set fCompStyle to csCalendar.
In gtkobject.inc, go to IntSendMessage3. If you follow the message LM_CREATE through this procedure, you will see that it calls CreateComponent. In the procedure CreateComponent the property fCompStyle is looked at (the local variable CompStyle is assigned fCompStyle's value) and this is used to determine how to create the widget. To create a gtk Calendar widget, the call is gtk_calendar_new() so you create a entry into the CASE statement
csCalendar : begin
p := gtk_calendar_new();
gtk_widget_show(p);
end;Now in your form's code (where you want the Calendar) all you need to do is add the code
Calendar1 : TCalendar;
Calendar1 := TCalendar.create;
Calendar1.Parent := Form1; //Form1 should be the form name Calendar1.Show;It's basically that simple! Now gtk offers a few other procedures that you can take advantage of for this control. gtk_calendar_select_day, gtk_calendar_select_month, etc. These can be used when you add a Day and Month property to TCalendar. In the SetDay and SetMonth, you simply call SendMessage(LM_SETDAY,Self,nil) or
SendMessage(LM_SETMONTH,Self,Nil). You will need to add LM_SETDAY and LM_SETMONTH into the LMessage.pp file under the section for messages sent to the interface. Once you have this, you need to go into gtkobject and add to the case statement in IntSendMessage3 for those two messages. For each message, call the appropriate gtk call using either TCalendar's day property or TCalendar's Month property (which should be set in SetDay and SetMonth in TCalendar).
How Can I Help : Chapter 2: Of course there are many things that can be done without modifying any widget specific code. For example, we are currently trying to create an IDE based on our code. We are close to getting the editor portion working but we have many TODO's left. If you are interested in getting involved, this is a great spot to jump in. If you are familiar with the tool "grep" you can search for the words "TODO" in the source. Each one marks a spot that needs to be finished. Simply find one you are interested in, let the mailing list know you will be working on it and go to it.
A brief map of files:

Interfaces.pp - Declares a class called InterfaceObject that (depending on the "define" inherits from GTKInt.pp. InterfaceObject is created within the Initialization portion of this file.

GTKINT.pp declares a class called gtkobject. Code is found in gtkobject.inc
GTKObject (class) inherits from InterfaceBase which defines functions that are either specific to the widget set, or other functions that simply don't belong in any other class.
Interfacebase uses the file winapih.inc to define calls that are compatable with the windows API calls that are required for compatability. If they are widget set dependent (for example gtk) then the calls in winapih.inc are overridded in a widget dependent file. In GTK's case it's called gtkwinapih.inc and the actual code for those procedures are found in gtkwinapi.inc. This allows us to create different definitions for windows API calls based on the interface.

TControl send all messages to InterfaceBase.IntSendmessage3 which is overrided by the widget specific files. Therefore if GTK is defined in Interfaces.pp then the IntSendMessage3 is called in gtkobject.inc.This may seem confusing but once you look into it you will get the hang of it. Feel free to email the mailing list with questions. Any idea's on how to improve this BRIEF explanation please email the mailing list.

This
document maintained by <A
HREF="">
Material Copyright � 2000 Lazarus Project

Reply by email

Michael A. Hess
to Peter Vreman: Maybe you should provide the GTK DLL's on the website Btw. there are new gtk dll's…
Peter Vreman wrote
I mean in a separate zip with only the 6 needed dll's. Becuase we don't need all those .a files and .h files.

Done. I have made a zip of just the GTK Dlls required for Win32. They can be found at

ftp://lazarus.freepascal.org/lazarus/gtk-dlls.zip

I will add this option to the HowTo page as well.

==== Programming my first best destiny! ==== Michael A. Hess Miracle Concepts, Inc. http://www.miraclec.com

Reply by email

Peter Vreman
to Peter Vreman: Maybe you should provide the GTK DLL's on the website Btw. there are new gtk dll's…
you wrote 5 lines
Peter Vreman wrote: > > Maybe you should provide the GTK DLL's on the website We do. The links are provided in the Win32 HowTo document.

I mean in a separate zip with only the 6 needed dll's. Becuase we don't need all those .a files and .h files.

Packing only the dll's is 855k instead of 1,7mb for the three -dev zips. And then you need to find the .dll's in the subdirs.

Show quoted text 7 lines

No, gtk is dated in 2000 already.

Peter

Reply by email

Intranet User 5622
to Shane Miller: Can I get comments on this file please. I spent a lot of time typing but not much…

I would like to get out of Lazurus group, but i
can't.
�
I try 5 times to send messages with ' unsubscrible'� as the subject without sucess, can someone please help-me, to stop. �
Regards
�
�
<BLOCKQUOTE
style="BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px">

Earlier message 16 lines
----- Original Message ----- <DIV style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black">From: Shane Miller To: <A href="" > Sent: Monday, January 10, 2000 7:02 PM Subject: [lazarus] Lazarus help html document Can I get comments on this file please.� I spent a lot of time typing but not much editing it so it's rough.Please let me know if you guys think it'll be helpful to new developers out there, plus let me know sections that could be added.ThanksShane

Reply by email

Michael A. Hess
to Peter Vreman: Maybe you should provide the GTK DLL's on the website Btw. there are new gtk dll's…
Peter Vreman wrote
Maybe you should provide the GTK DLL's on the website

We do. The links are provided in the Win32 HowTo document.

Btw. there are new gtk dll's available.

These are the ones we current link to. Are they the latest?

http://user.sgic.fi/~tml/gimp/win32/gtk+-dev-19991218.zip http://user.sgic.fi/~tml/gimp/win32/glib-dev-19991218.zip http://user.sgic.fi/~tml/gimp/win32/extralibs-dev-19991218.zip

==== Programming my first best destiny! ==== Michael A. Hess Miracle Concepts, Inc. http://www.miraclec.com

Reply by email

Michael A. Hess
to Shane Miller: Can I get comments on this file please. I spent a lot of time typing but not much…
Vincent Snijders wrote 9 lines
It may be a bit of topic, but what I really feel missing in the how-to-pages, is how to set up a compiler-debugger team or an IDE such as TP. I have heard rumours that there is an IDE for go32v2 and RHIDE which is suposed to run on linux as well. I think Shane and some others use DDD. So there really must be something more then notepad (editpad) en plain ppc386.

Well you can get the version of FPC that contains an IDE. You just need to download a snapshot. The only problem is that it uses a clone of Turbo Vision which has some problems so the source can't be distributed. This means you can't build the IDE yourself. (If I understand it correctly).

As mentioned you can also try using RHIDE. If you are working on a Win32 machine you can use the fpide to work with Free Pascal. It doesn't currently integrate a debugger but that isn't that big a deal. You can still run the debugger separately.

http://cc5336-a.ensch1.ov.nl.home.com/fpide/

As you mentioned you can use DDD for debugging. It does all the step through stuff you are looking for. You can get Linux and I believe Windows version of DDD.

http://www.cs.tu-bs.de/softech/ddd

As to using notepad as an editor. Well I use the editor found in MC (not GMC). It has all of the syntax highlighting I need. I then compile from the command line and when I need to trace code I use the debugger. Granted it will be nice when we can have it all in one package but that is what we are working towards. :-)

==== Programming my first best destiny! ==== Michael A. Hess Miracle Concepts, Inc. http://www.miraclec.com

Reply by email

Michael A. Hess
to Shane Miller: Can I get comments on this file please. I spent a lot of time typing but not much…
I would like to get out of Lazurus group, but i can't. I try 5 times to send messages with ' unsubscrible' as the subject without sucess, can someone please help-me, to stop.

I checked the list and the reason you can't be removed is because you are not listed under the above address. The only address for your domain is

I will assume that that is you and manually remove it from the list.

==== Programming my first best destiny! ==== Michael A. Hess Miracle Concepts, Inc. http://www.miraclec.com

Reply by email