MBS FileMaker Plugin Example Databases

DragTest Popover

All examples are included with download of MBS FileMaker Plugin.

DragTest Popover.fmp12

Overview
Tables1
Relationships0
Layouts1
Scripts4
Value Lists0
Custom Functions0
Custom Menus33
File Options
Default custom menu set[Standard FileMaker Menus]
When opening file
Minimum allowed version12.0
Login usingAccount Name; Account= Admin
Allow user to save passwordOff
Require iOS passcodeOff
Switch to layoutOff
Hide all toolbarsOff
Script triggers
OnFirstWindowOpenOff
OnLastWindowCloseOff
OnWindowOpenOff
OnWindowCloseOff
OnFileAVPlayerChangeOff
Thumbnail Settings
Generate ThumbnailsOn; Temporary

 

Tables

Table Name
Statistics
Occurrences in Relationship Graph
DragTest
5 fields defined, 0 record
DragTest

Fields

Table Name: DragTest - 5 Fields
Field NameTypeOptionsCommentsOn LayoutsIn RelationshipsIn ScriptsIn Value Lists
testNormal, TextAuto-Enter:
  • Allow editing
Validation:
  • Only during data entry
Storage:
  • Repetitions: 1
  • Indexing: None
  • Automatically create indexes as needed
  • Index Language: German
          fieldNormal, BinaryAuto-Enter:
          • Allow editing
          Validation:
          • Only during data entry
          Storage:
          • Repetitions: 1
              DropLogoNormal, BinaryAuto-Enter:
              • Allow editing
              Validation:
              • Only during data entry
              Storage:
              • Global
              • Repetitions: 1
                    DescriptionNormal, TextAuto-Enter:
                    • Allow editing
                    Validation:
                    • Only during data entry
                    Storage:
                    • Repetitions: 1
                    • Indexing: None
                    • Automatically create indexes as needed
                    • Index Language: German
                        TextNormal, TextAuto-Enter:
                        • Allow editing
                        Validation:
                        • Only during data entry
                        Storage:
                        • Repetitions: 1
                        • Indexing: None
                        • Automatically create indexes as needed
                        • Index Language: German

                            Layout Objects: DragTest

                            Regular Fields

                            Field Name: DragTest::field
                            Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                            • Top: 130 pt
                            • Left: 6 pt
                            • Bottom: 267 pt
                            • Right: 232 pt
                            • Anchoring: Left, Top
                            Field Format:
                            • Edit Box
                            Field Behavior:
                            • Allow field to be entered: In Find mode, In Browse mode
                            • Touch keyboard type: System Default
                            • Go to next field using: Tab key
                            No

                            Field Name: DragTest::Description
                            Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                            • Top: 130 pt
                            • Left: 644 pt
                            • Bottom: 242 pt
                            • Right: 854 pt
                            • Anchoring: Left, Top
                            Field Format:
                            • Edit Box
                            Field Behavior:
                            • Allow field to be entered: In Find mode, In Browse mode
                            • Touch keyboard type: Default for Data Type
                            • Go to next field using: Tab key
                            Yes

                            Field Name: DragTest::Text
                            Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                            • Top: 130 pt
                            • Left: 242 pt
                            • Bottom: 267 pt
                            • Right: 495 pt
                            • Anchoring: Left, Top
                            Field Format:
                            • Edit Box
                            Field Behavior:
                            • Allow field to be entered: In Find mode, In Browse mode
                            • Touch keyboard type: Default for Data Type
                            • Go to next field using: Tab key
                            Yes

                            Popover Buttons

                            Popover Button PropertiesCoordinates
                              Type:
                            • Text: Open Drop Popover
                            • Top: 29 pt
                            • Left: 0 pt
                            • Bottom: 91 pt
                            • Right: 113 pt
                            • Anchoring: Left, Top
                            Popover PropertiesCoordinates
                              Object Name:
                            • DropPopover
                              Show Title Bar:
                            • Yes
                              Title:
                            • "Popover"
                              Position:
                            • Right
                              OnObjectEnter
                            • Script: SetupDrop
                            • Modes: Browse
                            • Top: 5 pt
                            • Left: 124 pt
                            • Bottom: 185 pt
                            • Right: 414 pt
                            • Anchoring: Left, Top
                            Popover Content
                            Tab ControlsSlide ControlsFieldsButtonsPortalsWeb Viewer ControlsCharts

                                Script Hierarchy

                                DragAction
                                SetupDrop
                                FreeDrop
                                FreeDropLater

                                Next Script: [SetupDrop]
                                Script NameDragAction
                                Run script with full access privilegesOff
                                Include In MenuYes
                                Layouts that use this script
                                  Scripts that use this script
                                    Script Definition
                                    Script Steps
                                    • Set Variable [ $dropview; Value:Get(ScriptParameter) ]
                                    • Set Variable [ $names; Value:¶ ]
                                    • #Check for paths in Drag & Drop
                                    • Set Variable [ $count; Value:MBS("DragDrop.GetPathCount"; $dropview) ]
                                    • If [ $count > 0 ]
                                    • Set Variable [ $index; Value:0 ]
                                    • Loop
                                    • Pause/Resume Script [ Duration (seconds): ,1 ]
                                    • Set Variable [ $path; Value:MBS("DragDrop.GetPath"; $dropview; $index) ]
                                    • If [ Length ( $path ) > 0 ]
                                    • If [ MBS("Files.FileExists"; $path) = 0 ]
                                    • #File not yet written? Wait a bit
                                    • Pause/Resume Script [ Duration (seconds): 1 ]
                                    • End If
                                    • Set Variable [ $name; Value:MBS( "Path.LastPathComponent"; $path) ]
                                    • Set Variable [ $names; Value:$names & $name & ¶ ]
                                    • New Record/Request
                                    • Set Field [ DragTest::field; MBS("Files.ReadFile"; $path; "auto") ]
                                    • Set Field [ DragTest::Text; $path ]
                                    • Set Field [ DragTest::Description; "Got via path list" ]
                                    • Commit Records/Requests [ No dialog ]
                                    • End If
                                    • #next
                                    • Set Variable [ $index; Value:$index+1 ]
                                    • Exit Loop If [ $index = $count ]
                                    • End Loop
                                    • End If
                                    • #Check for a file descriptor coming with Drag & Drop
                                    • Set Variable [ $count; Value:MBS("DragDrop.GetFileDescriptorCount"; $dropview; "") ]
                                    • If [ $count > 0 ]
                                    • Set Variable [ $index; Value:0 ]
                                    • Loop
                                    • Pause/Resume Script [ Duration (seconds): ,1 ]
                                    • Set Variable [ $name; Value:MBS("DragDrop.GetFileDescriptor"; $dropview; $index; "name") ]
                                    • Set Variable [ $data; Value:MBS("DragDrop.GetFileDescriptor"; $dropview; $index; "data") ]
                                    • Set Variable [ $size; Value:MBS("DragDrop.GetFileDescriptor"; $dropview; $index; "size") ]
                                    • Set Variable [ $path; Value:MBS("DragDrop.GetFileDescriptor"; $dropview; $index; "path") ]
                                    • Set Variable [ $pos; Value:Position ( $names; ¶ & $name & ¶; 1; 1) ]
                                    • If [ $pos = 0 ]
                                    • #not a duplicate
                                    • If [ Length ( $path ) > 0 ]
                                    • New Record/Request
                                    • Set Field [ DragTest::field; MBS("Files.ReadFile"; $path; "auto") ]
                                    • Set Field [ DragTest::Description; "Got via file descriptor with path" ]
                                    • Set Field [ DragTest::Text; $path ]
                                    • Commit Records/Requests [ No dialog ]
                                    • Else If [ $size > 0 ]
                                    • New Record/Request
                                    • Set Field [ DragTest::field; $data ]
                                    • Set Field [ DragTest::Text; $name ]
                                    • Set Field [ DragTest::Description; "Got via file descriptor with data" ]
                                    • Commit Records/Requests [ No dialog ]
                                    • End If
                                    • Set Variable [ $names; Value:$names & $name & ¶ ]
                                    • End If
                                    • #next
                                    • Set Variable [ $index; Value:$index+1 ]
                                    • Exit Loop If [ $index = $count ]
                                    • End Loop
                                    • End If
                                    • #Check for text coming with Drag & Drop
                                    • Set Variable [ $text; Value:MBS("DragDrop.GetText"; $dropview) ]
                                    • If [ Length($text) > 0 ]
                                    • New Record/Request
                                    • Set Field [ DragTest::Text; $text ]
                                    • Set Field [ DragTest::Description; "Got text" ]
                                    • Commit Records/Requests [ No dialog ]
                                    • End If
                                    Fields used in this script
                                    Scripts used in this script
                                      Layouts used in this script
                                        Tables used in this script
                                        Table occurrences used by this script
                                        Custom Functions used by this script
                                          Custom menu set used by this script

                                            Previous Script: [DragAction]Next Script: [FreeDrop]
                                            Script NameSetupDrop
                                            Run script with full access privilegesOff
                                            Include In MenuYes
                                            Layouts that use this script
                                              Scripts that use this script
                                                Script Definition
                                                Script Steps
                                                • #short pause for FileMaker to finish putting popover in place
                                                • Pause/Resume Script [ Duration (seconds): ,2 ]
                                                • Set Variable [ $$dropview; Value:MBS("DragDrop.CreateOnPopoverWithControl"; Get(WindowName); "DropPopover"; "drop"; 0; 0) ]
                                                • // Set Variable [ $$dropview; Value:MBS("DragDrop.CreateOnPopoverWithSize"; Get(WindowName); "DropPopover"; 20; 20; 200; 100) ]
                                                • If [ MBS("IsError") = 0 ]
                                                • Set Variable [ $result; Value:MBS( "DragDrop.RegisterDropTypes"; $$dropview; "file") ]
                                                • Set Variable [ $result; Value:MBS( "DragDrop.SetDragActionHandler"; $$dropview; Get ( FileName ); "DragAction") ]
                                                • Set Variable [ $result; Value:MBS( "DragDrop.SetCursor"; $$dropview; 1) ]
                                                • If [ MBS("Container.GetCount"; DragTest::DropLogo) = 0 ]
                                                • Show Custom Dialog [ Title: "Warning"; Message: "Logo for drop container is empty?"; Default Button: “OK”, Commit: “Yes”; Button 2: “Abbrechen”, Commit: “No” ]
                                                • Else
                                                • Set Variable [ $result; Value:MBS( "DragDrop.SetImage"; $$dropview; DragTest::DropLogo) ]
                                                • End If
                                                • End If
                                                Fields used in this script
                                                Scripts used in this script
                                                  Layouts used in this script
                                                    Tables used in this script
                                                    Table occurrences used by this script
                                                    Custom Functions used by this script
                                                      Custom menu set used by this script

                                                        Previous Script: [SetupDrop]Next Script: [FreeDropLater]
                                                        Script NameFreeDrop
                                                        Run script with full access privilegesOff
                                                        Include In MenuYes
                                                        Layouts that use this script
                                                          Scripts that use this script
                                                            Script Definition
                                                            Script Steps
                                                            • If [ Length($$dropView) > 0 ]
                                                            • Set Variable [ $result; Value:MBS( "DragDrop.Release"; $$dropview) ]
                                                            • Set Variable [ $$dropview; Value:"" ]
                                                            • End If
                                                            Fields used in this script
                                                              Scripts used in this script
                                                                Layouts used in this script
                                                                  Tables used in this script
                                                                    Table occurrences used by this script
                                                                      Custom Functions used by this script
                                                                        Custom menu set used by this script

                                                                          Previous Script: [FreeDrop]
                                                                          Script NameFreeDropLater
                                                                          Run script with full access privilegesOff
                                                                          Include In MenuNo
                                                                          Layouts that use this script
                                                                            Scripts that use this script
                                                                              Script Definition
                                                                              Script Steps
                                                                              Fields used in this script
                                                                                Scripts used in this script
                                                                                  Layouts used in this script
                                                                                    Tables used in this script
                                                                                      Table occurrences used by this script
                                                                                        Custom Functions used by this script
                                                                                          Custom menu set used by this script

                                                                                            Download example: DragTest Popover

                                                                                            Used functions:




                                                                                            Links
                                                                                            MBS FileMaker blog