[lazarus] Lazarus QT Engine snapshot

Shane Miller SMiller1 at stvgb.org
Thu Oct 21 09:16:27 EDT 1999


Looks good Cliff.  

Shane


>>> "Cliff Baeseman" <vbman at pcpros.net> 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', at CallMe);

{ pass control to engine main run loop }
 IntSendMessage(MSG_RUN_MAIN_LOOP,'',nil,0);
end.




cya back to the code...

Cliff






More information about the Lazarus mailing list