Blackberry invoke button Click Programmatically - blackberry

I want to invoke a button click event programmatically in blackberry. How should I do this?

You can use EventInjector.NavigationEvent
EventInjector.invokeEvent(new EventInjector.NavigationEvent(EventInjector.Navig ationEvent.NAVIGATION_CLICK, 0, 0, 0));

Related

Changing the IDCANCEL button to a IDCLOSE button on a propertysheet, taking localization into account

This might sound like a dumb question. I know that CMFCPropertyPage has a CancelToClose method but I can't find similar for the sheet object.
I basically want the Cancel button to be "Close" at all times and was hoping to do it in the sheet object.
Is the only way to do this by calling CancelToClose in each of the pages?
I read this and now realise it is not want I want anyway.
This is what I want on my sheet:
A custom Preview button.
A Close button.
The preview button will be to the left side of the close button. I have found a tutorial about adding a custom button.
For the Close button I am not sure what to do.
Update
So, at the moment I have:
So it has the custom button (where the existing hidden IDOK button is located). And it has the IDCANCEL button. But I want the button to be "Close".
I know I can use SetWindowText but I am thinking about localization so I wondered what the best way is.
This is how I ended up resolving this issue. I now call this code from CMFCPropertySheet::OnInitDialog():
void CVisitsRotaPropertySheet::SetupButtons()
{
CRect rctOK, rctCancel;
CString strButtonText;
// Get the position if the IDOK button
GetDlgItem(IDOK)->GetWindowRect(rctOK);
ScreenToClient(rctOK);
// Get the position of the IDCANCEL button
GetDlgItem(IDCANCEL)->GetWindowRect(rctCancel);
ScreenToClient(rctCancel);
// Hide the IDCANCEL button
GetDlgItem(IDCANCEL)->ShowWindow(SW_HIDE);
// Move the IDOK button to be in the same place as the IDCANCEL button
GetDlgItem(IDOK)->MoveWindow(rctCancel);
// Create the PREVIEW button in the original location of the IDOK button
ENSURE(strButtonText.LoadString(IDS_STR_PREVIEW));
m_btnPreview.Create(strButtonText,
BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, rctOK, this, IDC_BUTTON_PREVIEW);
m_btnPreview.SetFont(GetFont());
}
The above code adjusts the buttons as I desire. Then, in my CMFCPropertyPage::OnInitDialog() handlers I call CancelToClose().
The result:

How to perform click after tap with x y co-ordinator in appium1.7.1 for ios

In my application having x,y co-ordinators I am able to perform tap but I am not able to perform click on x,y co-ordinators. Please help me to click on below x y co-ordinators after tap
TouchAction touch1 = new TouchAction(driver);
touch1.tap (80, 300).perform();
You can try press action to click by coordinates:
new TouchAction(driver)
.press(x, y)
.waitAction(500)
.release()
.perform();
To Tap on particular element in appium is working for me no need to click again
Below given code is working fine for me to tap and click,
We have to provide x,y possition
TouchAction touch3 = new TouchAction(driver);
touch3.tap (102,147).perform();
why do you want to perform click after you are tapping the element which will not work as once you tap on the element it will redirect you to another screen and there will be no element to click again

How i can translate/Flip View/manager in Blackberry?

i want to translate/Flip view/ manager in BlackBerry when i press Next Button or Previous Button which available in status Bar, i m attaching my screen. Does any body have idea please send me
Thanx in advance..
When u click on your Next Prev Button you have to change your Bitmapfield image using bitmapfield.setBitmap("your new image");
You can use net.rim.device.api.ui.extension.component.PictureScrollField to achieve the desired effect

how to set image background of button in Blackberry [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Image Button in BlackBerry
i want set images as background of button. but i am not get any idea how it possible so can any one help me for my problem..
Thank you in advance..
You'll need to use a BitmapField, set it FOCUSABLE, and then override navigationClick() to execute the FieldChangeListener
Here's the link to official doc
http://docs.blackberry.com/en/developers/deliverables/29251/Creating_a_custom_button_1676236_11.jsp
I think it has everything you need plus it will let you know about creating custom objects
You have to make a custom field that will contain a bitmap and that will handle the click event or use the BitmapField and set the FOCUSABLE style to it. If you need help in how to create custom fields let me know..
It is possible.
image=Bitmap.getBitmapResource("abc.png");
one=new ButtonField("One")
{
protected void paint(Graphics g)
{
g.drawBitmap(0, 0, image.getWidth(), image.getHeight(), image, 0, 0);
super.paint(g);
}
};
one.setChangeListener(this);
hor.add(one);

How to create a Sidebar form in delphi

How can I create a Sidebar form in delphi.
I try the ScreenSnap and Align properties but I need that the form stay visible even if the user maximize other forms, without been on top. Just like the windows sidebar do.
Update: From the comments: if a window is maximized, it maximizes next to the window, not in front of or behind.
What you're looking for is called an AppBar. Begin your research with the ShAppBarMessage API function.
You can call a Windows API function to force your application to stay on top:
SetWindowPos(Handle, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);

Resources