6 Replies Latest reply on Nov 8, 2011 7:54 PM by DomMolloy_1

    Drawing on graphics

    DomMolloy_1

      Title

      Drawing on graphics

      Post

      I have an application that uses a diagram - let's say it's a map of a city. I'd like to allow someone to put an x on the map to show where the live. 

      Any ideas on how to do this?

        • 1. Re: Drawing on graphics
          philmodjunk

          Have you tried using Google Maps in a web viewer? That can be set up to mark a position on the map as specified by an address stored in Filemaker Fields.

          • 2. Re: Drawing on graphics
            DomMolloy_1

            Thanks Phil - sorry for misleading you a bit, it's not a map scenario. Actually trying to mark an injury or pain point on a body diagram. 

            • 3. Re: Drawing on graphics
              philmodjunk

              It's theoretically possible, but you'd need to decide if it's worth the trouble and if so, test to see if you get your layout to refresh with acceptable responsiveness.

              You could put your diagram in a container field.

              Put a transparent portal with transparent fields in front of it.

              Fill each portal row with a set of transparent, square fields so that the portal forms an invisible grid over the chart.

              Set up the fields as buttons that all perform the same script, but pass the name of the field as a script parameter using this expression:

              GetFieldName ( PortalTable::Field ) in the script parameter box.

              Then your script can be one line: SetFieldByName [get ( ScriptParameter ) ; "X"]

              and now you can click a portion of the chart to place an X there to mark the location clicked.

              • 4. Re: Drawing on graphics
                DomMolloy_1

                Everything worked well but I have a new complication. I need to be able to toggle the values (rotating through values X, O and space based on button clicks). I'm having a problem writing a single script here as the logic has to know what the prior value was to set the new value. Thoughts?

                 

                • 5. Re: Drawing on graphics
                  philmodjunk

                  You can use: GetField ( Get ( ScriptParameter ) ) to check the current value of your field in order to determine which value to next assign to that specified field.

                  • 6. Re: Drawing on graphics
                    DomMolloy_1

                    Got it to work -  it's a beautiful thing. Anyone wants to see the code let me know.  Thanks Phil!