I've managed to convert most of the functionality of the infragistics paint demo from c# to ABL. I've attached the first version. The workshop directory should be placed in your project.
Things that don't work:
1) any of the file open/save/saveas
2) about
3) there seems to be some issue where the paint keeps getting reset to white.
I really would appreciate comments and bug fixes.
Thanks.
heh. Would help if I attached the code
New version uploaded: Now you can load and save images from disk.
Message was edited by:
Julian Lyndon-Smith
Added new version of propaint.cls
[View:~/cfs-file.ashx/__key/communityserver-discussions-components-files/19/propaint.cls:550:0]
[View:~/cfs-file.ashx/__key/communityserver-discussions-components-files/19/workshop.zip:550:0]
Too cool. I'll check it out just tomorrow. Enjoy the PUG meeting tomorrow!
A short comment (before running the files at all):
Could you please explain when you are using lowercase class names and when CamelCased class names? You sample uses a mix and I'm pretty sure there is a rule behind it.
My personal rule is always to use CamelCase. It matches the most with .NET class names.
most of it was copied from the c# code. Sometimes the IDE "enhances" the code and upper-cases it, other times not.
I am still to go through the code and comment it - I was also going to fix it to my standards and CamelCase it
So, in summary, there are no explanations apart from lazy coding.
most of it was copied from the c# code. Sometimes the
IDE "enhances" the code and upper-cases it, other
times not.
This should have improved in beta 2.
nope - if you have auto-case on, it will CAPS the abl keywords, even if they are part of a .net class.
color is an example of that.
Improved was my term. Looks like still not perfect. Works much better when prefixed with the namespace (System.Drawing.Color). But it should work as well without. Especially when the context (like the NEW call for a previous defined variable of the type) is clear.
But this should be moved to a separate thread.
Ok, I'm a little stuimped here. I'm trying to use the forms.OpenFileDialog in here, but the c# code
if ( this.openFileDlg.ShowDialog(this) == DialogResult.OK )
converted to ABL
if THIS-OBJECT:openFiledlg:ShowDialog(this-object) EQ DialogResult:OK THEN
gives the error
"System.ArgumentException: You can only call ShowDialog as part of a WAIT-FOR statement"
A) what does this mean ? ?
B) Doesn't it violate the one-world one-waitfor ?
Ran into an issue with the SystemDialogs a while ago (http://www.psdn.com/library/thread.jspa?threadID=11685&tstart=50)
This lead to an enhancement, documented in the "beta2 changes.doc" in section "SET Added to WAIT-FOR".
So you need to define a variable of type System.Windows.Forms.DialogResult first.
B) Doesn't it violate the one-world one-waitfor ?
No - modal dialog do always require a WAIT-FOR. That has been the case with the old UI and is the case with the new UI.
thanks for the advice Mike.
I've now got a problem with an exception in the ABL runtime .. I'm trying to track it down and will let you know.
right. I can reproduce this.
if you uncomment line 22 (/IF dlgResult:ToString EQ "OK" THEN/) and attempt a syntax check, then the ABL crashes. Reported as W810050012
ToString is a method and requires parenthesis. Did you try ToString().
Message was edited by:
Mike Fechner
right. I can reproduce this.
if you uncomment line 22 (/*IF dlgResult:ToString EQ
"OK" THEN*/) and attempt a syntax check, then the ABL
crashes. Reported as W810050012
Heh. found the problem.
IF dlgResult:ToString EQ "OK" THEN
should be
IF dlgResult:ToString() EQ "OK" THEN
added the (), and it all syntax checks ok ..
ToString is a method and requires parenthesis. Did
you try ToString().
we found the problem at the same time. However, the ABL should not crash.
I'm on your side!