How go from one UI to another UI on Image button click event in juce introjucer? - juce

can you please tell me How go from one UI to another UI on Image button click event in juce introjucer?

Basically you have to:
1.- Parent component must inherit from ButtonListener, and you must implement the buttonclicked method
void WindowComponent::buttonClicked (Button* activeButton)
{
if (activeButton == &someButton)
{
gotoOtherPage();
}
}
2.- Your "UIs" i must suppose are components, if so just do something like:
component.setVisible(false),
otherComponent.setVisible(true),
Or perhaps stash them in a TabbedComponent, hide the tabs or overlap some buttons and then just do:
tabbedComponent.setCurrentTabIndex(someIndex);
That should get you going, in case you need help to draw a button just do something like:
addAndMakeVisible (&someButton);
someButton.setBounds(...);
someButton.addListener(this);
Check out the doxygen docs, they are quite helpful.

Related

Issues trying to use/apply event handler on specific html element

I would like some advice on how to specify the element for certain event handler. I'm trying to change the color on a paragraph when I click on it but it change the color regardless of where I click on the browser.
function onmouseA(){
document.getElementById("test").style.color = "#C5D9FF";
}
document.onmousedown = onmouseA;
I actually did specify the with the id="test", but it doesn't work properly, need some advice, thanks.

How to implement direct transitions between sibling pages in Xamarin.Forms with ReactiveUI?

I need to implement the routing functionality in Xamarin.Forms application using the ReactiveUI framework.
The following transitions map needs to be implemented:

Above the black arrows show forward transitions (e.g. I go from the Menu to the Order page by clicking on the menu item button), while the red arrows are for Go Back functionality. Please note that Go back should work for both: (a) the "Go back" link in the top navigation bar (b) the hardware «Back» button on the Android devices.
How do I implement the transitions between sibling pages like these:
Menu - Order - Map - Back to the Menu
Menu - Order - Order details - Pin details page - Back to the Map - Back to the Menu
?
P.S. Here is the guide https://www.reactiveui.net/docs/handbook/routing/ I followed recently, so I used GoNext/GoBack commands to implement more simple transitions like Menu - Order - Order details - Back to the Order - Back to the Menu. It does not work well for the described case, as the Back buttons make transitions back to the previous page instead of their parent page in the navigation map.
The NavigateBack command implementation is quite simple in ReactiveUI's RoutingState, it just removes the last element from the RoutingState.NavigationStack, RoutingState.NavigationStack is an instance of ObservableCollection<IRoutableViewModel>.
So in your particular case, you could write your own NavigateBack command implementation that mutates the navigation stack as required by your application domain. You could use a switch block to figure out what page is currently shown in the screen, and then map that page into another page, either newly created or stored in a field or in a Locator.Current. Probably your command will require a more complex canExecute implementation as well.
ReactiveCommand<Unit, IRoutableViewModel> navigateBackDomainAware =
ReactiveCommand.CreateFromObservable(() => {
var currentViewModel = NavigationStack[NavigationStack.Count - 1];
if (currentViewModel is PinDetailsViewModel) {
var mapViewModel = GetMapViewModel();
NavigationStack.Add(mapViewModel); // The navigation.
return Observable.Return(mapViewModel);
} else {
// Handle other pages. You can also put some domain-specific code
// describing the navigation mappings in your application here.
}
});

How to click on something else than an achor or button in codeCeption

I am trying to build a test scenario for acceptance testing. In my scenario, I want to click on an non-editable input field to trigger a JqueryUI calendar, and then click a date from the calendar.
The problem is that I can't seem to find any actions in CodeCeption that allows you to click on something else than a an anchor or a button.
The doc clearly states : Perform a click on a link or a button, given by a locator.
public function click($link, $context = null)
There are also similar functions that do something similar, but not with the left mouse button
public function clickWithRightButton($cssOrXPath)
public function doubleClick($cssOrXPath)
This seems so trivial that I can't find anything about it. Why isn't there a clickWithLeftButton? Am I missing something here? I'm just starting with acceptance tests with CodeCeption.
I may not fully understand the question, but have you tried
$I->waitForText('Text User would click on Here', 30);
$I->click('Text User would click on Here');

MvvmCross : databinding programmatically

I think I need to bind data programmatically to solve my problem.
I use a TabHost which hosts 2 Tabs.
I need to load the MvxBindableListView in the second tab when TabHost appears and keep the first tab as default tab.
What I'm doing is starting the second tab activity without problem because I check the process using this code:
protected override void OnViewModelSet()
{
SetContentView(Resource.Layout.Page_ActivityView);
System.Diagnostics.Debug.WriteLine("activityView started");
MvxBindableListView mvxBindableListView = FindViewById<MvxBindableListView>(Resource.Id.mvxBindableListView);
mvxBindableListView.ChildViewAdded += new System.EventHandler<Android.Views.ViewGroup.ChildViewAddedEventArgs>(mvxBindableListView_ChildViewAdded);
}
"activityView started" is displayed in output debugger, but MvxBindableListView.ChildViewAdded event isn't raised, only when I click the second tab.
So I suppose that MvxBindableListView is not databound.
Thanks in advance to help me loading my second tab programmatically.
I think ChildViewAdded is an event that occurs when the ListView is rendered - at that time when it needs to 'draw list items', then it will ask its adapter for child Views for the screen. As you scroll down the list, it will then ask for more child views - but it will also reuse views - so for a simple list you should only ever (hopefully) get N+1 calls on ChildViewAdded for a list which shows N items at one time.
So it's perfectly possible for a list to be databound but never to call ChildViewAdded - that won't get called until the list is 'drawn'
Sadly the Xamarin docs aren't helpful here - http://docs.mono-android.net/monodoc.ashx?link=E%3AAndroid.Views.ViewGroup.ChildViewAdded
Note: if you do actually want to bind programatically, then you can do this to - using Bind() methods and extension methods. However, I haven't expanded on that here - as it doesn't sound like that's actually what you need!

How to call the same function that the ToolBar editbutton does

So I have created a context box upon right click that has Add/Edit/Delete Rows. I also have a bunch of code launched before the Dialog is shown. My problem is that when I use the context menu it doesn't go through some of the code. I have tried to call on the functions directly but it doesn't format correctly.
I am mainly concerned with the edit button, here is the code I am using to bring up the edit Dialog
function editRow() {
var grid = jQuery("#<%= Jqgrid1.ClientID %>");
var rowKey = grid.getGridParam("selrow");
if (rowKey) {
// I have tried calling functions here and it still doesn't work
grid.editGridRow(rowKey, grid.editDialogOptions);
}
else {
alert("No rows are selected");
}
}
So if I use this to display the editform it isn't formatted correctly nor does it go through the functions all correctly.
I am using the ASP Webforms version of Jqgrid so I call the function by doing this
<cc1:JQGrid1 ID="Jqgrid1
//other attributes
ClientSideEvents-BeforeEditDialogShown="ChangeMonitor"
//Rest of code />
So this works just fine, and I'm trying to get the Edit button on the context menu to display correctly.
My thought was to use Jquery to trigger a click on the actual Edit button once someone used the context menu. I couldn't find an ID that would work however.
Is there an easy way to connect my context menu Edit button, with the actual Edit button in the toolbar?
Well I found a solution to my problem.
The id field of the button was edit_ct100_cpMainContent_Jqgrid1_top so I just triggered a click with this code.
$("td[id^=edit][id$=top]").trigger("click")
For some reason when I used the _ct100_cpMainContent_Jqgrid1 it wasn't working, but now it does. Hope this helps someone.

Resources