[lazarus] Lazarus QT implementation
Shane Miller
SMiller1 at stvgb.org
Mon Oct 18 13:42:39 EDT 1999
2 things. First, I am fine with you doing this (and it wouldn't matter if I wasn't :-) ) but try to make it plug in to our code that we have now by using the sendmessage3 calls that already exist, along with a qtinterface object.
Second, I would really like to see some work done getting an editor working like Kassandra or MWEDit. I say we get Kassandra implemented then either work on MWEDIT or continue finishing out IDE.
Shane
>>> "Baeseman, Cliff" <Cliff.Baeseman at greenheck.com> 10/18/99 09:58AM >>>
I have been sitting quietly at home for about 4-5 days now working on a QT
Engine for lazarus. Now before everyone has a fit let me explain a few
things here. First of all the GTK library has way to many limitations and is
in no way polymorphic like the QT implementation is. I have learned in the
last few days just how flexible, stable, fast the QT library is. The QT
library has every thing we need to get a successful class library up and
running very quickly.
The bad thing or good thing depending on how you look at it is that QT is
C++ which means not touchable by FPC. I have a very extendable interface
engine that I built especially for use with FPC or any other language for
that matter.
Here is a little about how it works....
"Messaging calls to the library"
fpc-message -calls-> C Interface -calls-> LazarusQT Engine -> Perform
Message Action on widget in widget list
The C interface to the library is simple
void * IntSendMessage(int Message, char WidgetID,void * Data, int
DataType, int DataSize)
so a call to the library to create a button looks like this
IntSendMessage(MSG_CREATE_BUTTON_WITH_LABEL,'label1','Hello
Button',0,0)
"event hooks calling from the library"
QWidget --> LCL Component WinProc(integer)
The event hook interface which I am completing now looks like this..
ProcEventHook(void * FAddress, char WidgetID)
The event will call a single procedure (per widget) passing a integer as the
event that occured.
So in free pascal you can hook a event something like this.
'first hook the event'
ProcEventHook(@WinProc,'label1')
when the label fires a event it will call WinProc and pass the event id.
procedure WinProc(Message: Integer);
begin
case Message of
MSG_CLICK: <--then dispatch the call
end;
This does of course mean that winprock can be overridden and extended as
necessary at a component level.
The drawback but not much of one is that widgets have to be defined in the
library before use. This is very simple to do only 4 lines of code for most
implementations. I was able to add 4 widgets to the engine yesterday in 25
minutes. I have also implemented control reparenting and x, y, height, width
layout. In QT everything is a polymorphic decendant of QObject and all
layout stuff is at that level. This means that X and Y positioning is gravy.
Just wanting to let everyone know what I am up to. I may be able to realese
the base engine to everyone about friday if my wife quits b---ching at me.
Cliff
_________________________________________________________________
To unsubscribe: mail lazarus-request at miraclec.com with
"unsubscribe" as the Subject
archives at http://www.miraclec.com/list_archives/lazarus
More information about the Lazarus
mailing list