Sign in Join

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

Mailing lists / lazarus / 1999-07

LM_CLICK idea

5 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

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

Shane Miller

I was actually planning on setting LM_CLICK to an integer value and then in gtkint.pp it woulds say:

case MESSAGE of
LM_CLICK : Begin
...

                        end;

etc.

I didn't come up with generic names for LM_CLICK or anything. I used LM_CHECKRESIZE etc. even though it's a bit GTK specific. We can change them later if we wish.
By assigning them a nuber, we are forced in GTKINT.PP to assign signal a string value based on that number, BUT this allows us to do this

Procedure DoClick(var msg); message LM_CLICK;

and because that's an INTEGER value we can call Dispatch instead of DISPATCHSTR . At least I think we can. That will help us remain more multiplatform because dispatchstr is what SHOULD be called......

Shane

Earlier message 28 lines
-----Original Message----- From: Michael A. Hess To: Lazarus-List Date: Wednesday, July 07, 1999 2:35 PM Subject: [lazarus] LM_CLICK idea >That is another good idea for the multi-API thing. This way a different >file with the correct string for the API be it gtk or qt can be set for >LM_CLICK and then we don't need to do the switching thing you indicated >before. > >Where are you at with the code. I'd like to look at it and help some >more tonight but I don't want to play with code that you have already >done a alot of work on. Are you at a point where you can send me a cut >of the code? If so just send it to the ftp site and others can get it as >well. >-- >==== Programming my first best destiny! ==== > >Michael A. Hess Miracle Concepts, Inc. > http://www.miraclec.com > >_________________________________________________________________ > To unsubscribe: mail with > "unsubscribe" as the Subject > archives at http://www.miraclec.com/list_archives/lazarus >

Reply by email

Shane Miller
Show quoted text 5 lines
DISPATCHSTR . At least I think we can. That will help us remain more multiplatform because dispatchstr is what SHOULD be called...... Shane

What I meant was Dispatch is what should be called, not DispatchStr. Dispatch is used in the Window environment already so if we can use it, it seems reasonable.

Shane

Reply by email

Michael A. Hess
to Shane Miller
Shane Miller wrote
What I meant was Dispatch is what should be called, not DispatchStr.

I knew what you meant. :-)

Dispatch is used in the Window environment already so if we can use it, it seems reasonable.

As it does to me. I haven't tried using Dispatch but I will toss together a test program to see if it works just as well as DispatchStr.

==== Programming my first best destiny! ==== Michael A. Hess Miracle Concepts, Inc. http://www.miraclec.com

Reply by email

Michael A. Hess

That is another good idea for the multi-API thing. This way a different file with the correct string for the API be it gtk or qt can be set for LM_CLICK and then we don't need to do the switching thing you indicated before.

Where are you at with the code. I'd like to look at it and help some more tonight but I don't want to play with code that you have already done a alot of work on. Are you at a point where you can send me a cut of the code? If so just send it to the ftp site and others can get it as well.

==== Programming my first best destiny! ==== Michael A. Hess Miracle Concepts, Inc. http://www.miraclec.com

Reply by email

Peter Vreman
to Shane Miller: I was actually planning on setting LM_CLICK to an integer value and then in gtkint.pp it…
Show quoted text 21 lines
I was actually planning on setting LM_CLICK to an integer value and then in gtkint.pp it woulds say: case MESSAGE of LM_CLICK : Begin ... end; etc. I didn't come up with generic names for LM_CLICK or anything. I used LM_CHECKRESIZE etc. even though it's a bit GTK specific. We can change them later if we wish. By assigning them a nuber, we are forced in GTKINT.PP to assign signal a string value based on that number, BUT this allows us to do this Procedure DoClick(var msg); message LM_CLICK; and because that's an INTEGER value we can call Dispatch instead of DISPATCHSTR . At least I think we can. That will help us remain more multiplatform because dispatchstr is what SHOULD be called......

You can't use string constants becuase then you need recompiling of the whole application when you want an other toolkit. Using integers is a fast (a lot less string compares) alternative. You need to write for every toolkit a conversion routine:

function getmessageid(s:string):integer;
begin
  walk through a table and return the correspondenting id
end;

the table can then be sorted so a binary search maybe with some hashing can be used.

The compiler also uses such trick for all needed tokens which are futher handled like enumerated in the compiler.

Peter

Reply by email