Simplicty and flexibility!


Function::Internal

MoveObject
MoveObject("ObjectName","Xpos","Ypos")
MoveObject("Record1","C","C")
MoveObject("MyBox","-10","+100")
MoveObject(*MyField","200","200")
MoveObject("MyField","S200","S50)
MoveObject("ServiceWindow1","L150","") -- Will move SYSTEM ServiceWindow1 to the left and width will be 150px.


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.
L: This means Left. MoveObject("MyObject","L","C") means that the object is "glued" to the left side and centred vertically.
R: This means Right. MoveObject("MyObject","R","C") means that the object is "glued" to the Right side and centred vertically.
S: this means size. You can resize the field by setting S in front of the number.

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.
T : this means TOP in Current form. MoveObject("MyObject","C","T") will mean that the object will be centred horizontally and "glued" to the top of the current window.
B : this means BOTTOM in Current form. MoveObject("MyObject","C","B") will mean that the object will be centred horizontally and "glued" to the Bottom of the current window.

S: this means size. You can resize the field by setting S in front of the number.

System Version:

We have implemented 4 service windows (borwser objects) that we will use as new menus in DE8.6 onwards. As part of the new policy they are not system owned but readily available for all developers. The names are ServiceWindow1 through to ServiceWindow4.

You can place them anywhere you like, but they will have priority 1 to 4 so if you place all 4 to the left the first one will be 1 then 2 etc.

Ex.
MoveObject("ServiceWindow1","L150","") 
MoveObejct("ServiceWindwo1","L0","") -- will allow you to have an active Service window that is hidden.

We also use SetState() to show ServiceWindows which is the new "toolbars" in DE8.6 onwards. These are 4 browser windows that can be utilised as part of your application as well.

SetState("ServiceWindow1","Show")
SetState("ServiceWindow4","Hide")

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)

Reference

See Also


SetState()
SetFocus()
OML
ExecDQL()
GetCurrent()

On the forum about MoveObject

Custome TableView/FormView Toggle, fun with LabelExecDQL, SetClass, Custom Menu, Custom Toolbar, MoveObject etc...

Since we made you cry over the weekend, and your "challenge" is an interesting one that give us plenty of opportunity to confuse you and everyone else even further we couldn't stop ourselves from putting aside some time and make a sample/solution/chal...

Product: Dataease [{8}]FIVE. Written by DataEase 13/07/15 at 19:09:21

Re:Custome TableView/FormView Toggle, fun with LabelExecDQL, SetClass, Custom Menu, Custom Toolbar, MoveObject etc...

Thank you firstly.  Having an example to work off helps masssively.I managed to get the saving corrrect record in table view sussed pretty quick, having a temporary variable with the exact same name as a field confused me as I didn't reali...

Product: Dataease [{8}]FIVE. Written by Simon B 15/07/15 at 10:55:41

Re:tree structure - MoveObject() will solve this.

Download Sample! We have been looking through our samples/tutorial database and found a Sample that might b...

Product: Dataease [{8}]FIVE. Written by DataEase Tech Sup 18/08/15 at 09:44:55

MoveObject("SomeData","L","200")+Keystrokes("_pgdn _pgup")

That was the short answer...But no such thing.DataEase create very advanced joins when it load a form/report etc. called internally a multiview.Contradictory to common belief, a form is not built on top of a table or a set o...

Product: Dataease [{8}]FIVE. Written by DataEase 29/09/15 at 09:58:46

MoveObject

Hi all,I've a field XSIZE with a derivation getcurrent ("width") and a YSIZE field with a derivation getcurrent ("height"), both defined as virtual fieldsIn a manip virtual field I've the instruction as follows :MoveObject ("bt_11...

Product: Dataease [{8}]FIVE. Written by afonso santos 10/03/18 at 18:45:13

Re:MoveObject

Hi Afonso.Nice to see that you play with these features.1. It looks like you want to move the button to the lower right corner and there is a easier and better way to do that....

Product: Dataease [{8}]FIVE. Written by DataEase 11/03/18 at 11:05:39

Enable/Disable based on Global variable using SetStyle(),SetState(),SetVar(),GetVar(),MoveObject()

If a customer doesn't have a support agreement with us there is no rule that we should supply the solution to a problem the said customer is encountering in using DataEase for Development.However we do answer questions that is of general inter...

Product: LegEasy 9 Developer. Written by DataEase 03/10/24 at 15:49:41

On the blog about MoveObject

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

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

DataEase 8.2 - New Sample showcasing Email (full) and PDF, MoveObject etc... (Ver. 8.2.0.1686)

Download Email and PDF sample This is not an article but a quick explanation of the sample application attached so you can "steal" the features we use. it is...

Product: Dataease [{8}]FIVE. Written by DataEase 14/11/14 at 18:16:20

New Sample 8.5 BETAII.2 - Showcase MoveObject, Label Alignment, Transparent Fields, SetStyle() (Ver. 8.5.0.1767)

We are sorry that the link was a "dud", this has now been fixed! Download Sample <img...

Product: Dataease [{8}]FIVE. Written by DataEase 10/04/15 at 16:27:00

Custome TableView/FormView Toggle, fun with LabelExecDQL, SetClass, Custom Menu, Custom Toolbar, MoveObject etc...

Downlaod Sample! We had a request the other day about manip...

Product: Dataease [{8}]FIVE. Written by DataEase 13/07/15 at 16:48:31

Enable/Disable based on Global variable using SetStyle(),SetState(),SetVar(),GetVar(),MoveObject()

Download Sample! We got a request from a user on how to control the users...

Product: . Written by DataEase 25/09/15 at 08:54:32

DataEase 8.5 - SetState(), SetStyle(), SetColor(), MoveObject() all now support wildcard (Ver. 8.5.0.2001)

New Features create New Demands....SetState(), SetStyle(), SetColor() and MoveObject() are between the most popular and besides ExecDQLClass the most used new features in DataEase 8.We very quickly realised that you needed to be able t...

Product: Dataease [{8}]FIVE. Written by DataEase 01/12/15 at 15:06:26

Re:Enable/Disable based on Global variable using SetStyle(),SetState(),SetVar(),GetVar(),MoveObject()

is it possible to download the sample still ?thank You...

Product: . Written by Ihor Zakharchenko 03/10/24 at 16:23:54

Re:Re:Enable/Disable based on Global variable using SetStyle(),SetState(),SetVar(),GetVar(),MoveObject()

got it! converted to LE9. testedthank You...

Product: LegEasy 9 Developer. Written by Ihor Zakharchenko 04/10/24 at 14:53:40


dg3_HelpView