Madwolfie Posted July 9, 2010 Posted July 9, 2010 (edited) Hi All I have a layout with many check boxes on it - but I like nice graphics, so I have implemented a script to show these when each tick box is clicked. The trouble is I now have 15 scripts activated for each individual field - is there anyway to get just one script to act on many different fields, so that each tick box would display the graphics that I chose. It is important that an associated field, ****:Data contains a value (0 or 1) so that it can be used elsewhere ?? The script is basically, If "Tick"=1 Set Field[Tick;0] Else SetField[Tick;1] end if Edited July 9, 2010 by Guest Forgot to include script
bcooney Posted July 9, 2010 Posted July 9, 2010 (edited) So, you have two fields, Tick (number) and dspTick_c (calc, result container). The calc for dspTick is, if Tick=1; g_checkbox graphic, g_uncheckedgraphic), correct? You set these two global containers in an Open script to their corresponding container fields, right? Now to answer your question, you can use one script and send the script a scriptparameter. Set $param, Get(scriptparameter) if $param = "Field1" Set Field [Field1, abs(field1-1)] elseif $param = "Field2" Set Field [Field2, abs (field2 -1 )] elseif more sets endif As you can see, having pretty checkboxes is a lot of dev effort. Otherwise, all you need is field Tick, formatted as a checkbox with the value list of 1. You will have a 1980's [x] Edited July 9, 2010 by Guest
Madwolfie Posted July 9, 2010 Author Posted July 9, 2010 Thanks for that. Each time I get a reply to a post I have to devalue my experience rating from good to poor! I need to understand what Field 1 relates to in your script. I have 15 checkboxes each with a script and each with two fields (number and calc container as you said). How do I get your script to display the correct tick (or not) depending on which filed it relates to. In other words how do I make field 1 in your script apply to each of my check fields?
Madwolfie Posted July 9, 2010 Author Posted July 9, 2010 Sorry but a lot of this is not available in the script menu of 8.5 - I assume I am writing this in the Scriptmaker ?
efen Posted July 9, 2010 Posted July 9, 2010 All of this is available in version 8.5 See attachment for how your script can look as advised by bcooney Assign each of your tickboxes a different script parameter so that the script chooses which tickbox to change
bcooney Posted July 10, 2010 Posted July 10, 2010 Thanks, efen, that's exactly the structure I was suggesting.
Madwolfie Posted July 10, 2010 Author Posted July 10, 2010 (edited) Magic ! Thanks - amazing what difference just a couple of bits of code make ! Just one quick question, should the Else If[$param=*] be 1 more than the parameter for the actual tick step ?? As mine is ? And why do you not need to use the If $param statement more than once ?? I luv the power of Filemaker and just wish I had the time to do more and learn more Thanks again guys Edited July 10, 2010 by Guest
Søren Dyhr Posted July 10, 2010 Posted July 10, 2010 But isn't something wrong here? The behaviour is not the one you expect from checkboxes but instead radio buttons? Hopefully aren't you to torment any mac users with this, windows users have had it comming as long as they have opened a computer for some duties. The "Human User Interface Guideline" dictates this: A checkbox describes a state, action, or value that can be either on or off. In a group of checkboxes, each checkbox should be independent of all the others, unless interdependency is clearly indicated (for example, by displaying a subordinate checkbox indented below a superior checkbox). A checkbox can also enable or disable another control, such as a text field or pop-up menu. While the mimic'ed behavior you have asked for is this: Use a group of radio buttons when you need to display a set of choices from which the user can choose only one. If you need to display a set of choices from which the user can choose more than one at the same time, use checkboxes instead. Also, if you need to display a single setting, state, or choice the user can either accept or reject, don’t use a single radio button; instead you can use a checkbox. ...so read on McDuff: http://preview.tinyurl.com/2a6k8jr The "radio button" description is just to scroll to the above! --sd
Madwolfie Posted July 10, 2010 Author Posted July 10, 2010 Hmmm, as I understand it my layout requires the user to tick a checkbox if a certain contact has a facility - there are 15 to tick for yes OR untick for no. Either way I am still not impressed with the standard check box graphic or radio button that Filemaker supplies - even more so when Filemaker is a subsidiary of APPLE and should thus have superb graphic abilities :-) So my goal is to present a nice looking interface in every solution - if that means a custom script to display the graphic then it will have to be like that.
bcooney Posted July 10, 2010 Posted July 10, 2010 (edited) I visualized a set of checkboxes that weren't mutually exclusive (as Soren says, that would be the job of radio buttons). So, I think that you're on the right track. I refer to checkboxes as flag fields, and name them as such. For example, flag_IsActive (number field), is a very common flag field in systems. Flag fields are either 1 or empty (or zero). I'm not sure I understand your questions from above, and perhaps they were posted before efen's example script. The actual scriptparameter that you attach to the checkbox button doesn't matter and does not need to be the field name. As you see in efen's example, all you need is a unique value per checkbox button. The IF, ELSEIF structure then will know by the scriptparameter which field to set. Abs (field-1) is a shortcut method to toggle from 1 to zero. My style is also to set a $var to the incoming scriptparameter because I feel it's more apparent script documentation and Get (ScriptParameter) is too much typing. hth, Barbara PS: The lack of current interface tools in FM are a very common complaint. We don't think Steve Jobs knows about the Filemaker subsidiary. Edited July 10, 2010 by Guest
Madwolfie Posted July 10, 2010 Author Posted July 10, 2010 :-) Thanks - I have two threads that seem to have merged into the same discussion, on the other thread it has been suggested that I do not need all the unstored calculations and that they slow down the solution. I cannot see how to reference the graphics (same for each checkbox) but to keep each choice unique, without that calculation ? see http://fmforums.com/forum/showtopic.php?fid/31/tid/215578/pid/360162/post/360162/#360162
Søren Dyhr Posted July 10, 2010 Posted July 10, 2010 Perhaps you then should consider jquery integration with the webviewer instead ... or boolean formatting of number fields having something from webdings font or something similar. I have here a small template with a relational structure made to ensure minimal scripting requirements ... utilizing the wingding font where provisions of a snazzy checkmark are! But the template will only work with fm10 and upwards! --sd box.zip
Madwolfie Posted July 10, 2010 Author Posted July 10, 2010 Hmmmm, thanks, but I will have to wait until I get paid for this solution before I can afford to upgrade :-)
Søren Dyhr Posted July 10, 2010 Posted July 10, 2010 But give it a whirl with a download of the newest trial version of Filemaker, the issue is that the current record's ID needs to be transfered to the other side of the cartesian relation when ever the user flips to a new record. But the basic idea could be done with a single buttom script line sans the scriptmaker - within the very record ... it only requires to format each of your boolean fields to show only one of it's states. Here is one supposingly workable under fm8.5 ....and if you investigate it will you learn that no scripting is required exept for the one-liners attached to each object! --sd box2.zip
Madwolfie Posted July 10, 2010 Author Posted July 10, 2010 Hi That is VERY minimalist - BUT how do I get my nice graphic for the tick AND the one for the cross into the box - I cannot see from your example where the graphic is stored ??
comment Posted July 10, 2010 Posted July 10, 2010 You should also take a look at: http://fmforums.com/forum/showtopic.php?tid/215221/post/358474/#358474 http://fmforums.com/forum/showpost.php?post/340683/
Søren Dyhr Posted July 10, 2010 Posted July 10, 2010 If you tear apart the last template of Comments will you see he uses the Lucinda Grande font in a boolean styled numberfield, with the value "a" ... I'm using the same by pulling the type table down from the OS and pick something suiting my purpose - but what is done is shown in the above image! So the image is actually stored in your OS's fonts, and not a container field! --sd
comment Posted July 10, 2010 Posted July 10, 2010 he uses the Lucinda Grande font Webdings, actually.
Madwolfie Posted July 10, 2010 Author Posted July 10, 2010 Got it - thanks But this is what mine looks like now - and at least this way it gives me the option of being able to change the graphics to other styles easily to suit different applications and clients - there was a mistake in my addition to the script in the image I posted, but it all works now :-)))
Madwolfie Posted July 10, 2010 Author Posted July 10, 2010 Arrrgh ! Now I have a blank layout - with the previous calculations there was always an image in the fields - now I have to click 3 times to get a tick and there is no null image - temporarily solution is to add a graphic behind the boxes - but I still have 3 clicks to get a tick
Søren Dyhr Posted July 10, 2010 Posted July 10, 2010 Right I would, somewhat continue along the trail which Comment and I tries to get you doing. The next issue is the glasy boxes underneath ... here would I see if I with some spit and polish could remake them fully blown up in 400% or more via a series of 1 pix lines of varying lenght from the native tool, since pasting up something made in say Photoshop is likely to be very straining on a networked solution... But you should also know that a lot of these "gestures" have been made prefab, by Matt Petrowski in his: http://www.scriptology.com/theme-library --sd
Recommended Posts
This topic is 5250 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 accountSign in
Already have an account? Sign in here.
Sign In Now