Make one button enable a different button - cocoa

I have 4 custom radio buttons that change a message when clicked. The message deals with search terms. I have one search button. Does anyone know of a way to make the search button activate a different action to take you to a different page depending on which of the radio buttons is clicked?
Kind of like having one search button hooked up to 4 different actions and enable/disable the actions from the radio buttons.
If any on knows how to do this with just 2 buttons, then I can figure out the logic for 4 buttons.

Here is my new working code:
//Search Button
-(IBAction)showWineriesButton
{
btnSearchWineries.hidden=FALSE;
btnSearchGrapes.hidden=TRUE;
btnSearchWines.hidden=TRUE;
btnSearchReviews.hidden=TRUE;
}
-(IBAction)showGrapesButton
{
btnSearchWineries.hidden=TRUE;
btnSearchGrapes.hidden=FALSE;
btnSearchWines.hidden=TRUE;
btnSearchReviews.hidden=TRUE;
}
-(IBAction)showWinesButton
{
btnSearchWineries.hidden=TRUE;
btnSearchGrapes.hidden=TRUE;
btnSearchWines.hidden=FALSE;
btnSearchReviews.hidden=TRUE;
}
-(IBAction)showReviewsButton
{
btnSearchWineries.hidden=TRUE;
btnSearchGrapes.hidden=TRUE;
btnSearchWines.hidden=TRUE;
btnSearchReviews.hidden=FALSE;
}˚

Related

jqGrid show hide button navGrid inlineNav

I'm using jqGrid jqGrid 4.14.2-pre
How to hide or show buttons depending on the condition
Not using css
loadComplete:function(data)
{
if(data.records > 100)
{
$('#grid').jqGrid('navGrid','#pager');
// hide $('#grid').jqGrid('inlineNav','#pager'); ?
}
else
{
$('#grid').jqGrid('inlineNav','#pager');
// hide $('#grid').jqGrid('navGrid','#pager'); ?
}
}
I'd recommend you to call both navGrid and inlineNav, but to hide unneeded buttons identifying there by id. You should just know simple rule how the ids will be build. jqGrid uses prefix build on the navigator button ("add_", "edit_", "refresh_", ...) and the grid id ("grid" in your case). See the old answer for more details. The method inlineNav do the same, but the ids of buttons will be build base on another rule: the grid id and the suffix "_iladd" (for Add button), "_iledit" (for Edit button), "_ilsave" (for Save button) and "_ilcancel" (for Cancel button).
Let us you have grid with id="grid". To hide Add button added by navGrid you can use $("#add_grid").hide();. To hide inlineNav Add button you can use $("#grid_iladd").hide();.

Multiselect option with remove item

I'm looking for a Qt/QML multiselect control that have a remove button.
I want to add a filter builder and I didn't find a good example or control for this purpose.
I can design token by myself. I'm just curious if someone already did that and can share it.
Multi filter selector
Thanks
A simple radio button for each option can do the job. If you do not include all these radio buttons under an exclusive group, a second click on these buttons deselects the option.
A click on the radio button includes selected option in the search results and second selection removes the option from the results.
An extra button which deselects all the radio buttons can also be added.
I don't intend to insult or disrespect you, but i think with radio buttons the task takes less time than posting this question.

How to hide/show JQGrid inline navigation button from javascript

Hide and show Add and Cancel button programmatically in JQGrid
You can make Add and Cancel button hidden of visible in the same way like any other elements on the HTML page. You can use jQuery.show, jQuery.hide or jQuery.css with "display", "none" or "display", "" parameters. Thus the only thing which you need is to get DOM elements which represent the buttons. You can get the elements by id for example.
jqGrid assigns ids to all standard buttons. The ids of buttons added by inlineNav will be build from grid id as prefix and strings "_iladd" (for Add button), "_iledit" (for Edit button), "_ilsave" (for Save button) and "_ilcancel" (for Cancel button). So if you have the grid with id="mygrid" then $("#mygrid_iladd").hide() can be used to hide the Add button and $("#mygrid_ilcancel").hide() to hide the Cancel button. To hide both buttons you can use $("#mygrid_iladd,#mygrid_ilcancel").hide().

Uncheck radio button custom control in ASP MVC

I want to create a radio button custom control in my ASP MVC application. I am using HTML Helpers for this (I hope it is the right way). I want to know if there is a way to make the radio button unchecked when clicked.
Any ideas ?
Thanks
I want to know if there is a way to make the radio button unchecked when clicked.
That's a very weird requirement and you probably should be using checkboxes instead of radio buttons, but anyway, it is possible with javascript. If we suppose that the radio button is checked initially and you want to uncheck it when clicked:
$(function() {
$('#id_of_radio_button').click(function() {
$(this).removeAttr('checked');
});
});
But really, that's very weird. Radio buttons normally work by having them in groups: you have a couple of radio buttons and you can check only one in the group. So by selecting a different radio button in the group you are unchecking the current one.
Checkboxes on the other hand are not grouped. You can check/uncheck their values by clicking on them.

GUI: radio button group without selection?

Image a couple of objects for which one property can have 3 possible values. To edit them I want to use a radio button group with 3 buttons. If you have one object selected, it's obvious which radio button to select. But which what to select if multiple objects with different values of this property are selected? A radio button group without a selected radio button looks somewhat "naked".
One possible solution would be to add a 4th button to the group that indicates that the property is not set. You could have that one be the default when you need an 'indeterminate' default setting. This would allow the radio button group to start out with a selected radio button.
That being said, I'm having a hard time visualizing your situation. Do you think you could add some more detail to your question? I think you are talking about the default state of the radio buttons, but I'm not totally sure.
Hope this helps.

Resources