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.
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")
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)
SetState()
SetFocus()
OML
ExecDQL()
GetCurrent()
Product: Dataease [{8}]FIVE. Written by DataEase 13/07/15 at 19:09:21
Product: Dataease [{8}]FIVE. Written by Simon B 15/07/15 at 10:55:41
Product: Dataease [{8}]FIVE. Written by DataEase Tech Sup 18/08/15 at 09:44:55
Product: Dataease [{8}]FIVE. Written by DataEase 29/09/15 at 09:58:46
Product: Dataease [{8}]FIVE. Written by afonso santos 10/03/18 at 18:45:13
Product: Dataease [{8}]FIVE. Written by DataEase 11/03/18 at 11:05:39
Product: LegEasy 9 Developer. Written by DataEase 03/10/24 at 15:49:41
Product: Dataease [{8}]FIVE. Written by DataEase 08/09/14 at 23:02:01
Product: Dataease [{8}]FIVE. Written by DataEase 14/11/14 at 18:16:20
Product: Dataease [{8}]FIVE. Written by DataEase 10/04/15 at 16:27:00
Product: Dataease [{8}]FIVE. Written by DataEase 13/07/15 at 16:48:31
Product: . Written by DataEase 25/09/15 at 08:54:32
Product: Dataease [{8}]FIVE. Written by DataEase 01/12/15 at 15:06:26
Product: . Written by Ihor Zakharchenko 03/10/24 at 16:23:54