Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 2891 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Environment: MacOS 10.6.8, Filemaker Advanced v11.04, Troi File Plugin 6.0 (downloaded 212-06-15)

I have a severe problem with these functions. I need the values to establish drag and drop using the Troi File plugin, but the problem is with the basic FM functions. Note that all fields I need are only present once in the layout.

Here are the script steps I used to get the dropzone boundaries:

Go to Field [ BOOK::CoverImage_c ] // container field

Set Variable [ $field1; Value:Get ( ActiveFieldName ) ] // just for debug

Set Variable [ $dropzone1; Value:FieldBounds ( Get(FileName) ; Get (LayoutName) ; $field1 ) ]

Go to Field [ BOOK::Dragnote_gt ] // global text field // behaviour same if not global

Set Variable [ $field2; Value:Get ( ActiveFieldName ) ] // just for debug

Set Variable [ $dropzone2; Value:FieldBounds ( Get(FileName) ; Get (LayoutName) ; $field2 ) ]

GotoField[ ]

When I run this, the boundary values are different from the positions shown in layout mode.

As an alternative, I named the field objects in the layout (names: field1 = dragimage, field2 = dragnote) and tried to get their position with the following script steps:

Set Variable [ $notebound; Value:GetLayoutObjectAttribute ( "dragnote" ; "bounds" ) ]

Set Variable [ $imgbound; Value:GetLayoutObjectAttribute ( "dragimage" ; "bounds" ) ]

Again, the values are different from the positions shown in layout mode and also different from the results I got from FieldBounds.

Here are the complete results my script gave; all values without any correction for status bar etc, just as returned from the functions:

Actual layout position of field1 = CoverImage_c = 275 78 372 211

FieldBounds result for CoverImage_c = >138 114 391 239 0<

GetLayoutObjectAttribute result for object dragimage = CoverImage_c = >610 182 707 315 0<

Actual layout position of field2 = Dragnote_gt = 275 4 372 53

FieldBounds result for Dragnote_gt = >492 24 775 139 0<

GetLayoutObjectAttribute result for object dragnote = Dragnote_gt = >610 108 707 157 0<

This means that GetLayoutObjectAttribute delivers a constant offset of 335/104 pixels (right and down from the actual position) for both fields. FieldBounds results are outright bizarre. I get 4 different horizontal offsets (-137/217 for left, 19/403 for right) and also 4 different vertical offsets (36/20 for top, 28/86 for bottom), meaning that also field widths and heights are wrong. Window was set to Zoom 100%, re-sized to fit content, form view with just header and content parts (header height 54 px), status bar on.

For now I created my solution with hard-coded dropzone boundaries, but well... Anybody have any idea what could be wrong here? Anyone encountered something similar? After all these trials I feel that it could just be me going round the bend, but maybe it is not me, after all... hope dies last :-)

Best regards,

Lutz Pietschker

Database attached, relevant layout is "Book" (not BOOK). The test script is in script folder DragDrop, script "DragDropFieldBounds Test".

_Medienkatalog Copy.fp7.zip

  • 4 years later...
Posted (edited)

In case anyone comes here via Google as I did: FieldBounds coordinates are relative to the window. GetLayoutObjectAttribute(field,"bounds") coordinates are relative to the menubar, whether it's inside the window (as on Windows) or on top of the screen (as on Mac).

To get the coordinates relative to the window, using getLayoutObjectAttribute ( objectName ; ''left'' )-get(windowLeft)) for the left edge coordinate and getLayoutObjectAttribute ( objectName ; ''top'' )-get(windowTop)-(get(windowHeight)-get (windowContentHeight))+16 for the top edge coordinate will get you very close on Mac. 

Edited by Michael E. Kupietz

This topic is 2891 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.