Make your own free website on Tripod.com

 

 
Introduction Downloads Applications News FAQ
Forum Subscribe Articles Links Other

 

 Key Objects Library     

 Key Objects Library     

FAQ (Frequently Asked Questions)

 

Q: What is KOL ? What is MCK ?

A: KOL is a library of objects, which can be used with Delphi IDE and Delphi compiler to create small 32-bit GUI applications for Windows. Following Delphi versions are supported: Delphi5, Delphi4, Delphi3 and Delphi2. The smallest GUI program, which can be created using KOL, is about 13K.
    MCK is a kit of mirror components for Delphi, which are installed to Component Palette and allows visual programming of KOL-based application.

 

Q: Is a size of program made with KOL  (and MCK) depends on Delphi version?

A: Very little. Difference between Delphi3 and Delphi5 can be usually about 1Kbytes, and not always in favour of older version. But, system.dcu replacement is suggested (at least now) only for Delphi5, and with such replacement the executable can be 9-11K smaller. Choice is of yours.

 

Q: KOL library is developing fast, new properties, methods, events are adding constantly. Are your sure that your lirary will not grow enougth to become large as VCL? (And what the sense in that case to invent a wheel again...)

A: Yes, I am sure! Because of its well thought-out organization, KOL allows to Delphi compiler to use so called "smart-linking". For example, let us consider one of the recent addition: an event OnDropFiles (1-May-2001, v0.71). If this is not used and is not assigned, the size of the executable is not increased EVEN FOR A BYTE. And only in case when this event is used in the application, based on KOL, code of two procedures is added from the library: TControl.SetOnDropFiles and WndProcDropFiles. This is so because the procedure   WndProcDropTarget is referring only from the method SetDropTarget, which is referring only in case, when an event handler is assigned to the event OnDropTarget. And the entire library is built on this basic principal. (The VCL should be built so, but it is NOT build so, since this, the VCL can not economy size of the executable, when invoked).

 

Q: I am using your sys*.dcu replacement, but can not use Write and other functions for text files. What I should to do?

A: 1. Read readme.txt J.
     2. Call UseInputOutput procedure (once, e.g. in dpr-file).

 

Q: How to implement default (or cancel button), which responds to key Enter (or Escape)?

A: Use event Applet.OnMessage (see sample in TestKOL4).

 

Q: I have large fonts installed on my PC (125%). There is form property Scaled in VCL. It is sufficient to set it to False to provide correct showing of text labels on button, label and other controls independently on current screen settings. How to do the same in KOL?

A: It is sufficient to access property Font of form immediately after creating it. In result, object of type TGraphicTool is created, implementing font, which is assigned to device context of form window. Or, it is possible to access Font property of Applet (returned by NewApplet function), to change default font for all forms in application. For example:

        MyForm.Font;

Or, it is possible to change here any Font property of form/applet (style, color, height etc.). Note, that by default newly created font has size 20pixels (value of global variable DefFontHeight). Any child controls at the creation inherit font and brush of parent control (form).

 

Q: When Applet is used, minimizing animation is performing not from main form position, but from top left corner of screen. How to fix this?

A: Use event Applet.OnMessage:
function TSomeObject.KOLForm1Message(var Msg: tagMSG; var Rslt: Integer): Boolean;
begin
  if (Msg.message = WM_MOVE) or (Msg.message = WM_SIZE) then
    Applet.BoundsRect := Form.BoundsRect;
  Result := False;
end;

Or, assign True to MinimizeNormalAnimated property of the main form. (Not needed for applications, which contain a single form and do not create special Applet window).

 

Q: How to create a DLL containing KOL form and to call it from the application?

A: Create a form as usual and test it first in a standalone application (it is possible to create it visually using MCK). Then, prepare DLL project, containing exported function like follow:

   function ExecuteKOLform( < some parameters > ): Integer; stdcall;
   var MyKOLForm: PControl;
   begin
     Applet := NewApplet( '' );
     MyKOLForm := NewForm( Applet, 'DllKolForm' );
     ... { create form controls, do other things what You wish}
     MyKOLForm.ShowModal;
     ... { here You can read the state of controls and to do something }
     Applet.Free;
   end;

 

Q: Is it possible to create a DLL containing KOL forms visually, using MCK?
A: Yes, certainly. Create MCK project as usual, and then change word program in your dpr-file to library. Make also your forms not auto-creating, and add exported function(s) like it is shown in answer above.

+ Send a question

Copyright (C) by Vladimir Kladov, 2000-2001