[Lazarus] Expanding EditBox

Paul Ishenin ip at kmiac.ru
Wed Feb 3 02:20:32 CET 2010


03.02.2010 7:23, JoshyFun wrote:

> I had a little extend feature for EditBox but it needs a message in
> Windows (only to get a bit better look) and in other platforms it
> could be solved using plain LCL. So the question is how to integrate
> that message for Win32/64 without the usual #ifdef. Should a new
> function be added to intfbasewinapi ? or is there a better way to do
> it ? The message is an EM_ message for TextBox.

You can add TWSCustomEdit.SetSomething() and override it on win32 
widgetset only:

class procedure TWin32WSCustomEdit.SetSomething(Edit: TCustomEdit; 
State: Boolean);
begin
   // this protects from ocasional call of SetSomething while handle is 
not yet allocated
   if not CheckWSHandleAllocated(...) then
     Exit;

   // this performs your call
   SendMessage(TWin32WSCustomEdit.Handle, EM_..., WParam, LParam);
end;

In the LCL code you write where you need this:

   TWSCustomEditClass(WidgetSetClass).SetSomething(Self, ...);

Best regards,
Paul Ishenin.





More information about the Lazarus mailing list