× General Purpose Components and Libraries, discussions, problems and suggestions

Question [LAB] Cindy components

  • Sternas Stefanos
  • Sternas Stefanos's Avatar Topic Author
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
More
8 years 1 month ago - 8 years 1 month ago #2121 by Sternas Stefanos
Replied by Sternas Stefanos on topic Re: [LAB] Cindy components
We waiting your release Sir

Is a good idea to make pl_Cindy sub-forum?

PilotLogic Architect and Core Programmer
Last edit: 8 years 1 month ago by Sternas Stefanos.

Please Log in or Create an account to join the conversation.

More
8 years 1 month ago #2122 by Mauricio
Replied by Mauricio on topic Re: [LAB] Cindy components
What is pl_Cindy sub-forum ?

Mauricio

Please Log in or Create an account to join the conversation.

  • Sternas Stefanos
  • Sternas Stefanos's Avatar Topic Author
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
More
8 years 1 month ago #2123 by Sternas Stefanos
Replied by Sternas Stefanos on topic Re: [LAB] Cindy components
General Purpose/pl_Cindy category
at this forum

PilotLogic Architect and Core Programmer

Please Log in or Create an account to join the conversation.

More
8 years 1 month ago #2124 by Mauricio
Replied by Mauricio on topic Re: [LAB] Cindy components
Single forum is good for me: more simple to monitor.

Mauricio

Please Log in or Create an account to join the conversation.

More
8 years 1 month ago #2127 by mtbf40
Replied by mtbf40 on topic Re: [LAB] Cindy components
Thx for your answers :)

Please Log in or Create an account to join the conversation.

More
8 years 1 month ago #2183 by Mauricio
Replied by Mauricio on topic [LAB] Cindy components
Cindy v5.0 released (for Delphi) !

Cindy website

Added DBExpress components and the major news is ... TcyDocER (may be easy to port ;) )

TcyDocER extract document information (mail, phone, amounts etc ...) using OCR results from any source like Tesseract (open source) or Transym (comercial but cheap, fast, easy and powerful). There' s no demo of TcyDocER for now but i will working on it!

Regards,
Mauricio

Please Log in or Create an account to join the conversation.

  • Sternas Stefanos
  • Sternas Stefanos's Avatar Topic Author
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
More
8 years 1 month ago #2184 by Sternas Stefanos
Replied by Sternas Stefanos on topic [LAB] Cindy components
Thanks Sir
we will work on this version

PilotLogic Architect and Core Programmer

Please Log in or Create an account to join the conversation.

  • RockyLuck
  • Visitor
  • Visitor
8 years 1 month ago - 8 years 1 month ago #2185 by RockyLuck
Replied by RockyLuck on topic [LAB] Cindy components
@mauriciopt:
I enjoy the enthusiasm you exhibit in releasing new Cindy features.

However, the CodeTyphon port does not work very well.

I would very much appreciate it if you could have a look at the pervasive problem of glyphs on buttons.
Will you have a look at this topic: Topic 1796
The problem, ie why it does not work, is explained there.

Thanks!



Last edit: 8 years 1 month ago by RockyLuck. Reason: Wrong topic number

Please Log in or Create an account to join the conversation.

  • Sternas Stefanos
  • Sternas Stefanos's Avatar Topic Author
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
More
8 years 1 month ago - 8 years 1 month ago #2186 by Sternas Stefanos
Replied by Sternas Stefanos on topic [LAB] Cindy components
Sir
always you can help us and
with your Cindy source modifications...

PilotLogic Architect and Core Programmer
Last edit: 8 years 1 month ago by Sternas Stefanos.

Please Log in or Create an account to join the conversation.

  • RockyLuck
  • Visitor
  • Visitor
8 years 1 month ago #2187 by RockyLuck
Replied by RockyLuck on topic [LAB] Cindy components

sternas wrote: Sir
always you can help us and
with your Cindy source modifications...

The problem is not with the Cindy components. The problem is with the inadequate port of Lazarus of the Windows message structure. In this case, the CN_DRAWITEM message is not sent (needed by TcyBaseButton to draw the glyph), because the WM_DRAWITEM Windows message is not handled by Lazarus. :angry:

This may be cured, but only if one has intimate knowledge of the Cindy software. Someone (and I presumed mauriciopt is the right person for that) has to look into this and come up with an alternative for the dead CN_DRAWITEM handler.

Please Log in or Create an account to join the conversation.

More
8 years 1 month ago #2188 by Mauricio
Replied by Mauricio on topic [LAB] Cindy components
@RockyLuck: i anderstand what' s the problem but:
- i don' t have any experience with Lazarus.
- I' don' t participate on "Cindy for Lazarus"
Maybe, this will change one day ...

I' m pretty sure that the persons who are porting Cindy will find a solution.

Mauricio

PS: TcyDocER (very great component, no demo for now) have been developped with in mind its port for Lazarus.
I think that its port will be very easy.

Please Log in or Create an account to join the conversation.

  • RockyLuck
  • Visitor
  • Visitor
8 years 1 month ago #2189 by RockyLuck
Replied by RockyLuck on topic [LAB] Cindy components

mauriciopt wrote: @RockyLuck: i understand what' s the problem but:
- i don' t have any experience with Lazarus.
- I' don' t participate on "Cindy for Lazarus"

If you cannot solve this, at least can you give us some pointers in which direction to look when the WM_DRAWITEM message is not present.

Which alternative method would you pursue?

Thanks a million.

Please Log in or Create an account to join the conversation.

More
8 years 1 month ago #2191 by Chris
Replied by Chris on topic [LAB] Cindy components
there's mention of the LM_DRAWITEM (Lazarus equivalent of WM_DRAWITEM) here;

www.lazarus.freepascal.org/index.php/top...g24167.html#msg24167

LuizAmerico mentioned;

2) Under LCL/win32 the draw of button is done in response to a LM_DRAWITEM message. The other widget sets can do this? Or should the win32 response be moved to a LM_PAINT message?

does it just need some conditional defines and some Lazarus equivalence around the relevant code?

TheBlackSheep

Please Log in or Create an account to join the conversation.

  • RockyLuck
  • Visitor
  • Visitor
8 years 1 month ago #2195 by RockyLuck
Replied by RockyLuck on topic [LAB] Cindy components

TheBlackSheep wrote: there's mention of the LM_DRAWITEM (Lazarus equivalent of WM_DRAWITEM) here;

www.lazarus.freepascal.org/index.php/top...g24167.html#msg24167

LuizAmerico mentioned;

2) Under LCL/win32 the draw of button is done in response to a LM_DRAWITEM message. The other widget sets can do this? Or should the win32 response be moved to a LM_PAINT message?

does it just need some conditional defines and some Lazarus equivalence around the relevant code?

TheBlackSheep


I know that. The message processor in TcyBaseButton (unit cyBaseButton) does say (note the 9999 comment of the conversion by CodeTyphon):

Line 70:  procedure CNDrawItem(var Message: TLMDrawItems); message LM_DRAWITEM;  // 9999 TWMDrawItem = TLMDrawItems

but that procedure is never called, because LM_DRAWITEM never comes.

The reason for that is, that the LM_DRAWITEM message is only sent for owner drawn items (like the status panels in a TStatusBar). But it is not sent for drawing basic buttons. In Delphi, part of the logic in changing the visibility of a basic button is to generate the CN_DRAWITEM message.

Please Log in or Create an account to join the conversation.

  • Sternas Stefanos
  • Sternas Stefanos's Avatar Topic Author
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
More
8 years 1 month ago - 8 years 1 month ago #2196 by Sternas Stefanos
Replied by Sternas Stefanos on topic [LAB] Cindy components
Guys
I think it's LCL error, not trigger LM_DRAWITEM

and the Experimental Lab pl_Cindy version for test...

PilotLogic Architect and Core Programmer
Attachments:
Last edit: 8 years 1 month ago by Sternas Stefanos.

Please Log in or Create an account to join the conversation.

  • RockyLuck
  • Visitor
  • Visitor
8 years 4 weeks ago #2198 by RockyLuck
Replied by RockyLuck on topic [LAB] Cindy components

sternas wrote: Guys
I think it's LCL error, not trigger LM_DRAWITEM

and the Experimental Lab pl_Cindy version for test...


I already showed that it's an LCL error. The experimental lab version did not change a thing :S

Please Log in or Create an account to join the conversation.

More
8 years 4 weeks ago #2199 by Aleksandar
Replied by Aleksandar on topic [LAB] Cindy components
Let's clear something once for all:

LM_DRAWITEM is replacement for WM_DRAWITEM, not for CN_DRAWITEM!

In Delphi CN_DRAWITEM is defined like:

CN_DRAWITEM = CN_BASE + WM_DRAWITEM;

In Lazarus CN_DRAWITEM is defined like:

CN_DRAWITEM = CN_BASE + LM_DRAWITEM;

Original procedure in cyBaseButton looks like this:

procedure CNDrawItem(var Message: TWMDrawItem); message CN_DRAWITEM;

so it should be like

procedure CNDrawItem(var Message: TLMDrawItems); message CN_DRAWITEM;

in Lazarus.

Hope this will help. I do not have time to test, and do not have Windows machine with installed CT.

Please Log in or Create an account to join the conversation.

  • RockyLuck
  • Visitor
  • Visitor
8 years 4 weeks ago #2200 by RockyLuck
Replied by RockyLuck on topic [LAB] Cindy components
@Viking: probably a very good point. :cheer: But it did not help unfortunately :S The message LM_DRAWITEM is simply not generated.

Please Log in or Create an account to join the conversation.

More
8 years 4 weeks ago #2202 by Aleksandar
Replied by Aleksandar on topic [LAB] Cindy components

RockyLuck wrote: @Viking: probably a very good point. :cheer: But it did not help unfortunately :S The message LM_DRAWITEM is simply not generated.


Would you please make simple steps to reproduce and if possible images with result as it should be (from Delphi) as what you actually get (in Lazarus). That would probably help us all to understand what we get and what we trying to accomplish.

I will try to install CT in some Windows machine when I find some time and to see can I somehow help with this.

Please Log in or Create an account to join the conversation.

  • RockyLuck
  • Visitor
  • Visitor
8 years 4 weeks ago #2203 by RockyLuck
Replied by RockyLuck on topic [LAB] Cindy components
@Viking: your assumption that the message to catch was CN_DRAWITEM was understandable, probably this should have happened, but it was not correct. This is the code for handling the WM_DRAWITEM in function WIndowProc (file Win32callback.inc):

WM_DRAWITEM:
    begin
    .
    .
        end else
        begin
          with TLMDrawItems(LMessage) do
          begin
            Msg := LM_DRAWITEM;
            Ctl := 0;
            DrawItemStruct := PDrawItemStruct(LParam);
          end;

So, no translation to CN_DRAWITEM there.

Windows is responsible for generating the WM_DRAWITEM message. It does that if the control is "OwnerDrawn". That's what basically is wrong with the LCL implementation: the control is not set to owner drawn (Delphi does this correctly).

I inserted an override for CreateParams in cyBaseButton:

procedure CreateParams(var Params: TCreateParams); override;
    .
    .
procedure TcyBaseButton.CreateParams(var Params: TCreateParams);
begin
   inherited CreateParams(Params);
   with Params do Style := Style or BS_OWNERDRAW;
end;

That did something! Some buttons started to look more or less OK. Some would only show if clicked. I recompiled Lazarus with this change in the pl_Cindy package and strangely enough at design time the buttons now showed only their caption :S

What it does show is that Cindy will only run in a Windows environment with some of its controls. That is not what I'm looking for. :angry:

Please Log in or Create an account to join the conversation.