Simplicty and flexibility!


DataEase 8.5 and programming vs. DataEasy... (How to use programming to bend the imagefield to your bidding!)

Started by DataEase
You will need to Sign In to be able to comment on the Blog!

DataEase 8.5 and programming vs. DataEasy... (How to use programming to bend the imagefield to your bidding!)

Download Sample!

PS! THIS SAMPLE WILL ONLY RUN IN DATAEASE 8.5

Hmmm.... Some times we get request that our gut and inside knowledge of DataEase for Windows (its strengths and limitations) and hence what we call "instinct" immediately will tell us that it is impossible...

However! 

We have been criticized for making DataEase for WIndows more "Advanced" (read difficult) in DataEase 8 and yes, we have moved it much more towards "programming" rather than keeping it in the doldrums of this undefined definition of "DataEasy".

Our approach to DataEase is:

1) DataEase need to solve all the needs of a proper application.
2) It should be as easy and fast as possible to accomplish this.

The future team was stuck in this "mis-interpretation" that freedom was freedom to do mistakes, so they did everything to stop the users from doing thing that they hadn't "intended" and overdevelop functionality to do everything for you which would have been good if they knew what that was.

We are still working on what "DataEasy" really means, so in the mean time we expand the product so the app you developed "DataEasy" can be taken all the way to a proper sellable application with the help of "programming".

A lot of our users are afraid of programming, but in truth DataEase has always been a programming tool. Yes, you started of with inserting some fields in a form and  could input data directly, but the moment you wanted to do something more you had to program. 

A lot of users say that DFD was "soo much better", but they keep forgetting that for derivations etc, there was absolutely NO help (interactive or otherwise) on the syntax. You simply needed to try and fail (and you had to go all out and in again through another menu to test). So derivation is definitely better in DFW ;-)

DQL is what they talk about of course, and the DQL editor was interactive in DFD when it never has been in DFW, however it was very limited in interactive mode so if you wanted to do anything "hard core" you still needed to Program...

So what is programming? 

"Is is simply to combine functions/commands to achieve something more than each function can do on its own!"

And this is what we have concentrated on in DE8, to make a lot of basic functions that in combination can achieve ANYTHING!

And this is how we in the attached sample has solved something that our INSTINCTS told us IS IMPOSSIBLE in DataEase!

And (again) it was much simpler and much less programming than one would think...


The Solution.


1. We used an Image field. 


Problem:
The limitation with the image field (standard) is that it of fixed size and can only do two things. Stretch the image to fit the Field or leave it the size it is. So either the image is contorted, don't fill the allocated space or are bigger than the allocated space.

Neither is very useful to be honest, so what people tend to do is to make a big image field, keep the background the same as the form and no border so the image will look OK within reason. 

Solution:
We use the new function MoveObject with the "S" option (size) to resize the ImageField to the given size of the image.

MoveObject("Image",concat("S",X-Size+2 ),concat("S",Y-Size+2 ))

We add +2 simply because DataEase has a tendency to forget about border...

Now we have a image field that is the correct size for any image, try Next Image etc.



2. Next Problem is the zoom on mouseover.

Here we cheat a little. We use the only feature of the image field i.e. Stretch to fit. Since we under 1 size the object correctly there is nothing to do but now we use the Imagefields "weakness" against it.

On MouseEnter we simply use the derivation above but instead of adding 2 we multiply with 2 (you can of course multiply with anything you like.

define "retval" text .

retval := MoveObject("Image",concat("S",X-Size * 2 ),concat("S",Y-Size*2 )) .

and on MouseExit we simply set it back to the original size.

So this is how simple and how powerful PROGRAMMING is if you are not afraid of it ;-)


Written by DataEase 22/06/15 at 11:24:29 Dataease [{8}]FIVE
DG3_BlogList