Sign in Join

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

Mailing lists / lazarus / 2010-02

Expanding EditBox

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

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

JoshyFun

Hello Lazarus-List,

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.

Thank you.

Best regards, JoshyFun

Reply by email

Paul Ishenin
to JoshyFun
JoshyFun wrote 6 lines
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.

Reply by email

JoshyFun
to Paul Ishenin

Hello Lazarus-List,

you wrote
> function be added to intfbasewinapi ? or is there a better way to do > it ? The message is an EM_ message for TextBox.

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

Ok, I'll implement a quite empty default using LCL and override it for Win32 (because it is a Get operation, not a Set one).

Thank you.

Best regards, JoshyFun

Reply by email