Simplicty and flexibility!


DataEase 8.2 - MoveObject() implemented including Resize (Ver. 8.2.0.1631)

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

DataEase 8.2 - MoveObject() implemented including Resize (Ver. 8.2.0.1631)

Download Sample

After some "lazy" summer months our release speed has again picked up and we are now 31 builds on from initial release of DE8.2.

The focus of DE8 is to allow the developer to develop a contemporary and advanced end user application. Where DFW before has been quite restrictive, DE8 is free.

The latest focus of our development team is positioning and size of on screen objects.

There has been a limited possibility to move objects on the form since OML was introduced, but we hazard to bet that it has never been used in any release application. It is hardly documented, and rather awkward to use (like most OML stuff).

The goal in DE8 is to make advanced functionality everyday funtionality so we have now implemented a function called MoveObject() that can move and resize any screen object.

It will move the object and all children, so if you move the Main Record object, a Subform or a Tab Control you will move everything that live on it too.

Function::Internal

MoveObject

MoveObject("ObjectName","Xpos","Ypos")
MoveObject("Record1","C","C")
MoveObject("MyBox","-10","+100")
MoveObject(*MyField","200","200")

Moving an object (and all its children) from its current position to any new position. The function contains functionality to allow the object to be moved to an absolute position, a relative position or to be centred within the current window.

You can use this function to move a single object to a wanted position, or you can use it to move an entire Record Object, Tab Control or Subform to a centred or relative position.

Parameters

ObjectName: String

Name of the object you want to move. Follow the normal guidelines for Object names in DFW i.e Case Sensitive. If you are unsure of the ObjectName, right click on the object in Question and choose either OML or Definition. Depending on what type of object it is it should come up either in Definitions, directly with Object Name etc.

Xpos: String

We use string so we can use codification.

Number: 0,100,200, etc. - This is absolute position within the current Window.
+ and - : This means relative to current position: MoveObject("MyObject","-10","-10") will move it 10 pixels to the left and up. To maintain position simply write +0 as 0 will move it all the way to top or left.
C : this means Centred in Current form. MoveObject("MyObject","C","C") will mean that the object will be centred within the current window.

Ypos: String

We use string so we can use codification.

Number: 0,100,200, etc. - This is absolute position within the current Window.
+ and - : This means relative to current position: MoveObject("MyObject","-10","-10") will move it 10 pixels to the left and up. To maintain position simply write +0 as 0 will move it all the way to top or left.
C : this means Centred in Current form. MoveObject("MyObject","C","C") will mean that the object will be centred within the current window.

Returns/Result


String:Nothing

Examples

Example 1:

Derivation in virtual field:
MoveObject("Record1","C","C")
Make sure that the record object for the current form has been resized to fit the objects on the form (Default size is same as form i.e .100x200cm) and change the background colour of the form object to the same as the record object if you want it to look like the record object is just centred in the window.

This is the original form. See how the record object has been resized and is placed in the upper left corner.


This is the result. The record object has been centred in the window. Definitely more "user friendly".

The field that do it is the little white field next to the DE8 Logo. We call the field (and object) Manip. It is a virtual field with the derivation:

SetState("Manip",0)+MoveObject("Record1","C","C")

The SetState is so the field itself is invisible in Runtime.

Example 2:

Here we will show how you can use the S option as well as the + option to both reposition and resize objects to fit the current window. To get the current windows height and width we use GetCurrent("Height") and GetCurrent("Width").

This is the form in Design Mode. You can see that it is a mess...

In Runtime it looks like this. You can see that it perfectly fits the current window.

Again we use a Manip field to execute the derivations.

MoveObject("Heading","50","+0")+MoveObject("Heading",concat("S",Width),"+0" )+MoveObject("Editor","50","150")+MoveObject("Editor",concat("S",Width),concat("S",Height) )+SetState("Width",0)+SetState("Height",0)+SetState("Manip",0)


Written by DataEase 08/09/14 at 23:02:01 Dataease [{8}]FIVE