ProPaint v.001 released :)

Posted by jmls on 05-Oct-2008 10:19

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.

All Replies

Posted by jmls on 05-Oct-2008 10:20

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]

Posted by Admin on 05-Oct-2008 10:27

Too cool. I'll check it out just tomorrow. Enjoy the PUG meeting tomorrow!

Posted by Admin on 05-Oct-2008 10:51

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.

Posted by jmls on 05-Oct-2008 10:55

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.

Posted by Admin on 05-Oct-2008 11:02

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.

Posted by jmls on 05-Oct-2008 11:35

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.

Posted by Admin on 05-Oct-2008 11:40

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.

Posted by jmls on 05-Oct-2008 13:08

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 ?

Posted by Admin on 05-Oct-2008 13:38

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.

Posted by jmls on 05-Oct-2008 14:04

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.

Posted by jmls on 05-Oct-2008 14:24

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

Posted by Admin on 05-Oct-2008 14:27

ToString is a method and requires parenthesis. Did you try ToString().

Message was edited by:

Mike Fechner

Posted by jmls on 05-Oct-2008 14:27

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 ..

Posted by jmls on 05-Oct-2008 14:28

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.

Posted by Admin on 05-Oct-2008 14:31

I'm on your side!

This thread is closed