Obtaining navigation button controls in calabash-ios v0.9.169 - calabash

Prior to calabash-ios v0.9.169 I used to be able to obtain certain navigation button controls using the following query:
query("view:'_UIToolbarUINavigationButton'")
Since v0.9.169 I can no longer obtain this control- the query returns an empty array. I can do a more general query for UIButton and it is returned in the result:
[2] "<_UIToolbarNavigationButton: 0xd9ab880; frame = (-11 7; 41 30); opaque = NO; layer = <CALayer: 0xd9aba50>>",
What is the recommended way to obtain this button?
System info:
xcode-select --print-path -> /Applications/Xcode.app/Contents/Developer
xcodebuild -version -> Xcode 5.1.1 Build version 5B1008
calabash-ios version -> 0.9.169
calabash.framework version -> 0.9.169
server_version['version'] -> "0.9.169"

query("view:'_UIToolbarUINavigationButton'")
There is a typo in your query.
_UIToolbarNavigationButton'
not
_UIToolbarUINavigationButton
I will take this opportunity to point you to some alternative and more stable ways of interacting with Toolbar Buttons:
wait_tap
briar gem's navbar.rb

Related

How to hide the cfgrid default bottom toolbar?

As coldfusion is upgraded for my current application. The earlier code for extjs isn't working anymore
Could you suggest the latest version for the below implementations?
var grid = ColdFusion.Grid.getGridObject('mainGrid');
grid.getBottomToolbar().hide();
this doesnt hide the default toolbar that appears with cfgrid. Tried adding a xtype: 'pagingtoolbar', to the grid and renderTo :grid.bbar , where grid.bbar is null in the newest version.
Also
e.grid.colModel.config[e.column].editor.selectOnFocus = true;
while adding a listener function the above code isn't working
Also
grid.syncSize();//Sync to size up everything properly again
what shall be used instead here?

Disable native Next button in Qt installer framework

I have to disable standard next button, on my custom page via installscript.qs file.
I can disable my own button (that I created in .ui file) via .qs script like this: widget.myButton.setEnabled(false);
This man shows that native buttons represented as enumeration and I cannot disable them same way.
Controller Scripting manual page shows some interactions with native buttons. Like gui.clickButton(buttons.NextButton). I go through whole gui object man and don't found anything useful.
Qt installer framework has a native license check page with Next button logic that I need, but I have not found any samples that do it manually. (license page work because its default license page and it's logic inside framework as I understand).
Finally I found isComplete() method that can be useful for me, but it is for C++ API not for qs.
So how to disable native button via installscript.qs file?
In case someone else end ups here, I finally found a cleaner solution: a dynamic widget has a property complete that can be changed to enable and disable the "Next" button. Set it to false to disable the button.
Controller.prototype.DynamicMyWidgetCallback = function()
{
var currentWidget = gui.currentPageWidget();
if (currentWidget != null)
{
currentWidget.complete = false
}
}
The only solution i had found is call installer.setValue("canContinue" "false");
Then connect page entered event using gui.pageById(QInstaller.TargetDirectory).entered.
connect(Component.prototype.targetPageEntered);
In targetPageEntered check our value:
Component.prototype.targetPageEntered = function () {
if (installer.value("canContinue") != "true") {
gui.clickButton(buttons.BackButton);
QMessageBox.information("someid", "Installer",
"You must do smth to continue", QMessageBox.Ok);
}
}
Of course you need to change the installer.value when user complete required actions.

Rotate Apple Map as per user movement

Apple Map
Core Location
I implemented Apple Map with Core Location and its delegate to add pin and its working perfectly but now i am stuck with the issue to :
Rotate Map as per user movement ( as user travelling with car moves the different direction , the apple map should move )
I found Apple Map native does same work . Here is gif :
I did find solution yet . Kindly suggest me how to do it ?
Note ->
Don't want to use Google Map
Don't want to move Pin (annotation view)
If you want me to update my existing code , i can update again .
Simply add the MKUserTrackingBarButtonItem to your toolbar, it behaves exactly as the button in Maps app and handles all of the magic.
let trackingButton = MKUserTrackingBarButtonItem(mapView: mapView)
toolbarItems = [trackingButton]
Alternatively you could set the MKUserTrackingMode but then you're going to run into some handling issues, and a few caveats of doing it this way. Such as resetting the view after user scrolls the map, and not being able to control the zoom level among other things.
mapView.setUserTrackingMode(MKUserTrackingMode.followWithHeading, animated: true)

Since what version of IE does it begin supporting "Find on page" command?

I'm using web browser control in my dialog-based MFC project. I also like using the built-in IE's "find on page" functionality that brings up this window:
I can invoke it as such:
//pWebBrowser = pointer to IWebBrowser2
HRESULT hr;
CComVariant var1, var2;
if(SUCCEEDED(hr = pWebBrowser->ExecWB(OLECMDID_FIND, OLECMDEXECOPT_PROMPTUSER, &var1, &var2)))
{
//Done
}
This works great on my Windows 8.1 machine, but when I tried this code on an old Windows XP installation, I got this ... "thing" that totally breaks the flow in my app:
Does anyone know since what version of IE did they start supporting that "find on page" window?
The 'find on page' functionality was introduced in IE8, which highlights all instances of found words while allowing the user to continue the navigation normally.
Source: New features -> Inline search within pages

Touch Up Inside event not working after rotation of tab bar

I have a button in one of view controller of tab bar controller. All set up in storyboard. I registered action method like this
- (IBAction)buttonPressed:(id)sender {
NSLog(#"Button pressed");
}
The thing is that once I make left and top constraints (to force it stay in the right upper corner) touch up inside event stops working after I change rotation. So just open app in portrait mode - method is working. Change to landscape and I cannot tap button suddenly.
I've recreated problem in this easy example project.
Many thanks.
Just put the following code in you TabBarViewController class.
- (void)viewDidLayoutSubviews
{
// fix for iOS7 bug in UITabBarController
self.selectedViewController.view.superview.frame = self.view.bounds;
}
Recently I noticed same bug in my application. First I tried Slavco Petkovski method. But this caused me another bug with rotating and getting right bounds and frame, so I kept searching.
I found another solution for this problem, mainly setting autoresizing mask of view controller's view in xib. But since arrows in inspector in my Xcode (version 5.0.1) are inactive and you can't set them, you have to open xib file in text editor find autoresizingMask property for main view and change it like this:
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
EDIT:
Alternatively you can do this in your view controller's code - same result as in changes in xcode:
self.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;