Recent

Recent Posts

Pages: [1] 2 3 ... 10
1
Third party / Re: mrMath matrix library
« Last post by VTwin on Today at 04:18:36 am »
This sounds great, thanks. Would appreciate confirmation that it is cross platform.
2
General / Re: How does SimpleIPC works?
« Last post by lucamar on Today at 04:17:58 am »
Start the server application. Then start the client application. Then start the client application again, so you have two clients. Then test, sending messages to the server from one client or the other.
3
General / Re: How does SimpleIPC works?
« Last post by rdny on Today at 03:50:37 am »
Yes, it should be possible but you can make sure very easily: open more than one instance of the client and try it :)
[/quote]

Hi Lucamar! Can you explain in much detailed? Sorry can't get it %)
4
General / Re: Casting Variables and pointers
« Last post by HeavyUser on Today at 03:45:58 am »
Is there a way to cast variables with AS or hard cast to a another variable.
ie..

type
TClassOne = class(TComponent);

TClassTwo = class(TClassOne);

TClassThree = Class(TClassTwo);

TMyClassClass = Class of TClassOne;

var
  aObject: TObject;
  aClass: TClass;
  aClassThree: TClassThree;
begin
  aClass := TClassThree;
  aObject := aClass.NewInstance;

// None of the below work or similiar
  aClassThree := aObject as aClass;
  aClassThree := aObject as aClass.ClassType;
end;
What are you trying to accomplish? The code is all over the place and I can't figure out your goal. here are a few hints.
1) Tclass is defined as Class of Tobject. This types of variables only save the class reference for dynamic object creation, it is not to be used to save or access objects.
2) To create an object you call its contractor usually named create eg.
Code: Pascal  [Select]
  1. var
  2.   vClass: TClassone;
  3. begin
  4.   vClass := TClassThree.Create;
  5.   showmessage(vClass.ClassName);
  6.   vClass.free;
  7. end;
  8.  

5
Mac OS X / Re: What's new?
« Last post by VTwin on Today at 03:33:51 am »
Somehow standard controls are not working at all for me. But as an interim solution I have set a flag in plist file, so I keep Aqua look even if dark theme is selected in Mojave. Better than having everything look all wrong.

I did try to experiment with a few properties like ParentXXX but changing those runtime did not make any difference concerning my problem at least.

I'm concerned about this. For reference, what is the flag you set?
6
General / Re: Casting Variables and pointers
« Last post by lucamar on Today at 03:31:03 am »
Quite logically, you can only cast a descendant to an ancestor type not viceversa.

The ancestor object hasn't got the space needed to "emulate" a decendant's fields, neither the pointers in the VMT for its (new) methods, etc.

ETA

Also, note that as must be resolvable in compile time; it's used in constructions such as:
Code: Pascal  [Select]
  1. aClassThree := aObject as TClassThree;
  2. { Or using the alternate sintax: }
  3. aClassThree := TClassThree(aObject);

Hint: What's the error you're receiving?
7
General / Re: How does SimpleIPC works?
« Last post by lucamar on Today at 03:22:11 am »
One more question, is it possible to send messages in different clients? Like Private messages?

Yes, it should be possible but you can make sure very easily: open more than one instance of the client and try it :)
8
LCL / Re: How to capture horizontal mouse scroll event?
« Last post by VTwin on Today at 03:02:40 am »
I guess one could keep track of either one, and wait for the other before acting. I wonder though if a scroll of 0 is sent as an event.
9
LCL / Re: How to capture horizontal mouse scroll event?
« Last post by VTwin on Today at 02:53:14 am »
Many thanks jamie. I had given this some thought, but did not figure out a solution. That could work. I wonder which is fired first, if it is predictable then perhaps one could just wait for the second event.
10
LCL / Re: How to capture horizontal mouse scroll event?
« Last post by jamie on Today at 02:38:26 am »
Assuming the messages received should be back to back

Try this..

When you enter the OnMouseVertical scroll for example, you test for a global flag to see if the OnMouseHorizontalscroll
is already in play, if not then set this variable to the Vertical Mode with its details and then the next line use the
Applciation.ProcessMessages.

  Doing this will look at the message que and thus then fire the other event, now you have both directions before you
even draw the image.

 So basically this is a synchronizing way of capturing both events before drawing..

 and if the other message isn't in the que in that order, then you can simply reset those settings to see if they
got changed from the second event, if not then you do the single event drawing..

 I have done this in windows because I've found in most cases the messags are back to bacl..

I can't say how that works in other targets
Pages: [1] 2 3 ... 10