delphi-prism

What does Hasmorepages PrintPageEventArgs property do exactly?

此生再无相见时 提交于 2019-12-02 05:04:43
问题 I am trying to understand what Hasmorepages PrintPageEventArgs property is, why would you use it and how does it work. MSDN Library doesn't really have a good explanation. All they say is that if you set it to true, printpage event is called again. Is that mean the event loops on itself without leaving or leaves and calls itself again or relies on you to call the printpage event again? I am just trying to understand PrintPageEventArgs.hasmorepages property. Any hints or help will be greatly

How to enforce single instance of an application under mono?

狂风中的少年 提交于 2019-12-02 04:25:37
问题 So, I am able to enforce single instance of my application on Windows as follows. [STAThread] class method Program.Main(args: array of string); begin var mutex := new Mutex(true, "{8F6F0AC4-B9A1-45fd-A8CF-72F04E6BDE8F}"); if mutex.WaitOne(Timespan.Zero, true) then begin Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.ThreadException += OnThreadException; lMainForm := new MainForm; lMainForm.ShowInTaskbar := true; lMainForm.Visible := false;

How to prevent Closing and Disposing of a winform in the FormClosing event?

百般思念 提交于 2019-12-01 05:46:35
问题 This question may seem like a duplicate, but I just ran in to this issue while I was testing my program and I am kind of confused as to how you solve it. I have a winform and it has a form closing event. In the event, I pop open a messagebox asking the user, "Are you sure you want to close the window?." If they pushed yes button, the application closes window and prevents it from being disposed as expected. So, I can open it again. However, if they pushed no button, it still closes the window

Why is Self assignable in Delphi?

蓝咒 提交于 2019-11-30 17:17:52
This code in a GUI application compiles and runs: procedure TForm1.Button1Click(Sender: TObject); begin Self := TForm1.Create(Owner); end; (tested with Delphi 6 and 2009) why is Self writable and not read-only? in which situations could this be useful? Edit: is this also possible in Delphi Prism? (I think yes it is, see here ) Update: Delphi applications/libraries which make use of Self assignment: python4delphi That's not as bad as it could be. I just tested it in Delphi 2009, and it would seem that, while the Self parameter doesn't use const semantics, which you seem to be implying it should

Why is Self assignable in Delphi?

我只是一个虾纸丫 提交于 2019-11-30 00:54:46
问题 This code in a GUI application compiles and runs: procedure TForm1.Button1Click(Sender: TObject); begin Self := TForm1.Create(Owner); end; (tested with Delphi 6 and 2009) why is Self writable and not read-only? in which situations could this be useful? Edit: is this also possible in Delphi Prism? (I think yes it is, see here) Update: Delphi applications/libraries which make use of Self assignment: python4delphi 回答1: That's not as bad as it could be. I just tested it in Delphi 2009, and it

Why are there so many $IF DEFINED(CLR) in the VCL/RTL?

限于喜欢 提交于 2019-11-29 09:07:17
I've just compared the Delphi 2009 VCL/RTL code to the 2010 one. I noticed that there are many $IF DEFINED(CLR) conditional defines and they got more in the 2010 version. I thought that these conditional defines have fall into disuse, since Delphi .NET has been discontinued. The VCL/RTL aren't really used in Delphi Prism? Or are they? We're still using Delphi.NET internally for parts of the IDE and for some of the .NET versions of DBXpress delivered with Delphi Prism. Because of that, we're maintaining the CLR portions insofar as what is needed by those parts of the product. We're also

Why is MouseMove event firing when left mouse is clicked only for MouseDown event?

半腔热情 提交于 2019-11-28 10:40:04
问题 Either I am not totally understanding how events work or Delphi Prism has gone mad!!! I have a winform, mousedown event and mousemove event. Whenever I click the left mouse button only, MouseDown event fires as expected but ALSO MouseMove event fires right after when it is not suppose to. Here is the piece of code from my winform designer where the methods are assigned to events. self.ClientSize := new System.Drawing.Size(751, 502); self.KeyPreview := true; self.Name := 'Maker'; self.Text :=

Why are there so many $IF DEFINED(CLR) in the VCL/RTL?

六眼飞鱼酱① 提交于 2019-11-28 02:28:24
问题 I've just compared the Delphi 2009 VCL/RTL code to the 2010 one. I noticed that there are many $IF DEFINED(CLR) conditional defines and they got more in the 2010 version. I thought that these conditional defines have fall into disuse, since Delphi .NET has been discontinued. The VCL/RTL aren't really used in Delphi Prism? Or are they? 回答1: We're still using Delphi.NET internally for parts of the IDE and for some of the .NET versions of DBXpress delivered with Delphi Prism. Because of that, we

How can I pass a Delphi string to a Prism DLL?

ぃ、小莉子 提交于 2019-11-27 23:16:54
We try to pass a string from a native Delphi program to a Delphi Prism DLL. We have no problem passing integers, but strings are mismatched in the DLL. We saw Robert Love's code snippet in response to another question, but there is no code for the native Delphi program. How can we pass strings from Delphi to a Delphi Prism DLL? The best way would be to use WideString. For several reasons. It is Unicode and works before D2009 It's memory is managed in ole32.dll, so no dependency on either Delphi's memory manager or the CLR GC. You do not have to directly deal with pointers In Oxygene, you could