Sign in Join

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

Mailing lists / lazarus / 1999-10

Lazarus QT Engine snapshot

3 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

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

Cliff Baeseman

Hi everyone here is a snapshot of a form and button generated by FPC code and the Lazarus QT Engine...

I finalized the engine design and am now going after adding all widgets. Events are now working just fine. Here is the test app code... This should plug right into the LCL stuff without changing much of anyting except the QTObject will just pass the messages straight to the LCL QT Engine

program Test;
{$ objfpc}
uses
 testlib, sysutils;
{ button callback event handler  }
procedure CallMe(myint: integer);cdecl;
begin
  if EVENT_CLICK then
     writeln('Click Event Sent By the button');
end;
var
 WindowTitle : pchar;
 ButtonLabel : pchar;
 WindowName : pchar;
begin
 ButtonLabel := 'Lazarus QT Engine';
 WindowName := 'window1';
 WindowTitle := 'Lazarus QT Application Engine';
 { initialize engine }
 IntSendMessage(MSG_CREATE_APPLICATION,'',nil,0);
 { create window and button }
 IntSendMessage(MSG_CREATE_WINDOW,'window1',nil,0);
 IntSendMessage(MSG_CREATE_BUTTON_WITH_LABEL,'button1',ButtonLabel,0);
 { reparent the button to the window }
 IntSendMessage(MSG_WIDGET_SET_PARENT,'button1',WindowName,0);
 { set window height and width }
 IntSendMessage(MSG_WIDGET_SET_HEIGHT,'window1',pinteger(400),0);
 IntSendMessage(MSG_WIDGET_SET_WIDTH,'window1',pinteger(400),0);
{ set the button height and width }
 IntSendMessage(MSG_WIDGET_SET_HEIGHT,'button1',pinteger(200),0);
 IntSendMessage(MSG_WIDGET_SET_WIDTH,'button1',pinteger(200),0);
{ set window caption }
 IntSendMessage(MSG_SET_WIDGET_CAPTION,'window1',WindowTitle,0);
{ show button and window }
 IntSendMessage(MSG_WIDGET_SHOW,'window1',nil,0);
 IntSendMessage(MSG_WIDGET_SHOW,'button1',nil,0);
{ set the main window to be the main widget controls destruction }
 IntSendMessage(MSG_APPLICATION_SET_MAIN_WIDGET,'window1',nil,0);
{ attach a event callback procedure to the button }
 AttachEventHandler('button1',@CallMe);
{ pass control to engine main run loop }
 IntSendMessage(MSG_RUN_MAIN_LOOP,'',nil,0);
end.

cya back to the code...

Cliff

-------------- next part --------------
A non-text attachment was scrubbed...
Name: jpg00000.jpg
Type: application/octet-stream
Size: 7349 bytes
Desc: "Qtengine.jpg"
Url : http://localhost/pipermail/lazarus/attachments/19991021/dbf0f5f0/jpg00000.obj

Shane Miller

Looks good Cliff.

Shane

>> "Cliff Baeseman" 10/20/99 11:23PM >>>

Hi everyone here is a snapshot of a form and button generated by FPC code and the Lazarus QT Engine...

I finalized the engine design and am now going after adding all widgets. Events are now working just fine. Here is the test app code... This should plug right into the LCL stuff without changing much of anyting except the QTObject will just pass the messages straight to the LCL QT Engine

program Test;
{$ objfpc}
uses
 testlib, sysutils;
{ button callback event handler  }
procedure CallMe(myint: integer);cdecl;
begin
  if EVENT_CLICK then
     writeln('Click Event Sent By the button');
end;
var
 WindowTitle : pchar;
 ButtonLabel : pchar;
 WindowName : pchar;
begin
 ButtonLabel := 'Lazarus QT Engine';
 WindowName := 'window1';
 WindowTitle := 'Lazarus QT Application Engine';
 { initialize engine }
 IntSendMessage(MSG_CREATE_APPLICATION,'',nil,0);
 { create window and button }
 IntSendMessage(MSG_CREATE_WINDOW,'window1',nil,0);
 IntSendMessage(MSG_CREATE_BUTTON_WITH_LABEL,'button1',ButtonLabel,0);
 { reparent the button to the window }
 IntSendMessage(MSG_WIDGET_SET_PARENT,'button1',WindowName,0);
 { set window height and width }
 IntSendMessage(MSG_WIDGET_SET_HEIGHT,'window1',pinteger(400),0);
 IntSendMessage(MSG_WIDGET_SET_WIDTH,'window1',pinteger(400),0);
{ set the button height and width }
 IntSendMessage(MSG_WIDGET_SET_HEIGHT,'button1',pinteger(200),0);
 IntSendMessage(MSG_WIDGET_SET_WIDTH,'button1',pinteger(200),0);
{ set window caption }
 IntSendMessage(MSG_SET_WIDGET_CAPTION,'window1',WindowTitle,0);
{ show button and window }
 IntSendMessage(MSG_WIDGET_SHOW,'window1',nil,0);
 IntSendMessage(MSG_WIDGET_SHOW,'button1',nil,0);
{ set the main window to be the main widget controls destruction }
 IntSendMessage(MSG_APPLICATION_SET_MAIN_WIDGET,'window1',nil,0);
{ attach a event callback procedure to the button }
 AttachEventHandler('button1',@CallMe);
{ pass control to engine main run loop }
 IntSendMessage(MSG_RUN_MAIN_LOOP,'',nil,0);
end.

cya back to the code...

Cliff

Baeseman, Cliff

I added scroll bars and edit box last night. I am just going to add a few more things and port the pascal code to a new qtobject.pp. I will then have to build compile and install script for the liblazqt.01.so shared lib. I also have to go in and document the messaging system. I also started documenting the engine internals and the messaging methods.ie.what should be passed and what is returned since it runs totally on pointers.

Cliff

Earlier message 93 lines
-----Original Message----- From: Shane Miller Sent: Thursday, October 21, 1999 8:23 AM To: Subject: Re: [lazarus] Lazarus QT Engine snapshot Looks good Cliff. Shane >>> "Cliff Baeseman" 10/20/99 11:23PM >>> Hi everyone here is a snapshot of a form and button generated by FPC code and the Lazarus QT Engine... I finalized the engine design and am now going after adding all widgets. Events are now working just fine. Here is the test app code... This should plug right into the LCL stuff without changing much of anyting except the QTObject will just pass the messages straight to the LCL QT Engine program Test; {$ objfpc} uses testlib, sysutils; { button callback event handler } procedure CallMe(myint: integer);cdecl; begin if EVENT_CLICK then writeln('Click Event Sent By the button'); end; var WindowTitle : pchar; ButtonLabel : pchar; WindowName : pchar; begin ButtonLabel := 'Lazarus QT Engine'; WindowName := 'window1'; WindowTitle := 'Lazarus QT Application Engine'; { initialize engine } IntSendMessage(MSG_CREATE_APPLICATION,'',nil,0); { create window and button } IntSendMessage(MSG_CREATE_WINDOW,'window1',nil,0); IntSendMessage(MSG_CREATE_BUTTON_WITH_LABEL,'button1',ButtonLabel,0); { reparent the button to the window } IntSendMessage(MSG_WIDGET_SET_PARENT,'button1',WindowName,0); { set window height and width } IntSendMessage(MSG_WIDGET_SET_HEIGHT,'window1',pinteger(400),0); IntSendMessage(MSG_WIDGET_SET_WIDTH,'window1',pinteger(400),0); { set the button height and width } IntSendMessage(MSG_WIDGET_SET_HEIGHT,'button1',pinteger(200),0); IntSendMessage(MSG_WIDGET_SET_WIDTH,'button1',pinteger(200),0); { set window caption } IntSendMessage(MSG_SET_WIDGET_CAPTION,'window1',WindowTitle,0); { show button and window } IntSendMessage(MSG_WIDGET_SHOW,'window1',nil,0); IntSendMessage(MSG_WIDGET_SHOW,'button1',nil,0); { set the main window to be the main widget controls destruction } IntSendMessage(MSG_APPLICATION_SET_MAIN_WIDGET,'window1',nil,0); { attach a event callback procedure to the button } AttachEventHandler('button1',@CallMe); { pass control to engine main run loop } IntSendMessage(MSG_RUN_MAIN_LOOP,'',nil,0); end. cya back to the code... Cliff _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus