Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Change color of button by calculation


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

Recommended Posts

Posted

I have a series of buttons that pull up different subsets of the same data. If a button would query a null set, I want its color to be gray-out. Is this possible?

Posted

Welcome to the forum,

Make the button a container field. Make global container fields to hold images of the buttons you want to use. Then make the container = to the global field of choice to get the desired color.

Posted

After so many years of writing SQL I'm struggling to convert my logic into FM.

In order to determine whether a button should be grayed-out, I want to determine if the value even exists in the table. A simple one line SQL would answer the question for every unique value, but in FM, do I need to do a find for each value and then interrogate those finds for my values?

Posted

Let me put the plan out here:

I have a matrix of buttons on a dashboard layout. Pushing any button will bring up the records belonging to that group. If no records exist, I want the button dimmed and inactive. In the field (button), I want to calculate the existance or nonexistance and then use that to populate the field with the correct color.

My question: What's a good calculation to do this?

Thanks

Posted

So it's the determination more than the actual visualization, that cuases the question?? There exist several ways to store a found set, but as I see a solution to your problem must it be something along the lines of this:

http://www.filemakermagazine.com/showmovie.php?ID=550&T=preview&N=PortalResults_full.mov

This principle gathers the ID's in a keyfield and in your case is a relation needed for each keyfield, the buttons appearance "in full bloom" or grayed out is determind on the counting of related records to each relation. But a better way exists ...a oneline portal around the button for each relation. This is the implementation of the visibility trick:

http://www.filemakerpros.com/MoreVis.zip

...but the grayed out buttons underneath needs to be sized larger than the portal, but even though centered and the button in itself shouldn't be larger. This is done by screencapture of grayed out button edged with enough with the background behind to make a size larger than the portal.

This makes the grayed out appeare when no records exists, and obviously isn't any script attached to other objects but the button in the portal that dissapeares.

Another issue is the tampering with the clipboard - measures must be instated to save whats in it at the start of the script as well as restoring the matters that where there initially.

Would you like me to make a template, or can you make it work on my dscription??

Then is the question, would I do it that way or are there provisions for doing it another way??? Yes ...with filemaker is there usually 2-3 other ways to accomplish the same task, it's only a matter how willing the developer is to drift away from his/her initial idea, and if I were to make the task you've at hand would I instead use this principle:

http://previews.filemakermagazine.com/videos/544/SavedSearches_full.mov

Because it makes it posible to find records matching a criteria, but originate from time after the saved search was made. But it defeats the original graphic issue to display an empty querry oops2.gif - so you have to deside which is most important to make saved searches clickable or loose records created after the found set is established.

--sd

Posted

After so many years of writing SQL I'm struggling to convert my logic into FM.

In order to determine whether a button should be grayed-out, I want to determine if the value even exists in the table. A simple one line SQL would answer the question for every unique value, but in FM, do I need to do a find for each value and then interrogate those finds for my values?

Very basic, stripped down example attached. I did not change the color of the button but rather changed the text that was displayed, and the color of that text. When a user presses the button and there are no sub-set of records (as in ID_Order # 3 of my example) the script is set to do nothing. Hopefully that gets you started in the right direction.

There are no attributes for Visible/Invisible, Enable/Disable or BackColor in FMP.

DisableButton.zip

Posted

There are no attributes for Visible/Invisible, Enable/Disable or BackColor in FMP.

Well my posts didn't make much sence apparently, checkout the changes I made to your file...

--sd

DisableButt.zip

Posted

Well my posts didn't make much sence apparently, checkout the changes I made to your file...

--sd

No, for once your post did make some sense to me and I have used the technique you describe in some of my solutions. Its a nice trick but is yet another not so intuitive workaround for such a simple problem. Even knowing beforehand what you had done it took more than a few minutes to reverse engineer it.

I stand by my statement that "there are no attributes for Visible/Invisible, Enable/Disable or BackColor in FMP". You can use work arounds to make an object be Invisible/Visible or Enabled/Disabled (using a portal & relationship), you can also use a second graphic to fake the appearence of changing the BackColor but you can not change the mentioned attributes of an object.

Posted

but you can not change the mentioned attributes of an object.

Yes it's bad that only a relation that can make it to work, which have severe syncronization issues with the found set at hand. But lets look isolated at buttons isntead, just as you made the text change attributs is it posible to build a button say an OS X aqua one with multiple slightly offset versions of the same merge field or set of mergefields, in a gradient change of colours. Some days ago did I make a template that took a point in this video ad notam.

http://previews.filemakermagazine.com/videos/579/BetterInterface.mov

...namely that jpg's pasted on the layout slows down a multiuser solution because it's much easier to send a command to the client that instructs draw a line from a to b than sending a detailed image when in demand.

Now aren't the icons to flip sortorder over a portal particular large, when it comes to it. But it might be just the detail needed that makes an otherwise slow rendering solution bearable. At least does it get rid of the repeating global field for the storage of the images.

Admitted it requires spit and polish to make it work if embossing and other 3D'ing are required ...but investigate/reverse engineer the template attached Dancing-Chilli.gif

--sd

AscDsc.zip

Posted

What I do notice is that Filemaker is slow in the rendering department. whether it be text, raster or vector graphics IMO it seems slow. Clicking a button is also slow to execute as are pop-up lists.

This topic is 7072 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.