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

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:

Related

Change ToolBar Title dynamically on click events in Fragment on Xamarin android?

First let me explain something, so you guys can understand better my problem:
I'm using Toolbar and i have a Fragment called Location Fragment where i have 6 floationg action button vertically .
When you click on one of the floating action button some action like geofence,live tracking,current location etc are performed on the same map fragment.
So my problem is that when i click any of the floation action button ,like when i click geo-fencing floation action button the title on the tool bar should change with the geofence title..In this way for all the Floating action button the title of toolbar should change. in my case the title of the tool bar is not changing .
I have tried to use setTitle or this.Activity.Title="Geo-fence" on the click method of Floating action button,but still it remains same title .
Change ToolBar Title dynamically on click events in Fragment
In your Fragment, add the following code in your click events :
((AppCompatActivity)Activity).SupportActionBar.SetTitle(Resource.String.YourTitle);
this.SupportActionBar.Title = "Your Title";

How to set focus from one UIButton to Another UIButton in UIToolbar Done Button

I am working with iPhone Application with creating single object multiple dynamic button in UITableView. And when user will press button every time UIDatePicker will open to select date. So Is is possible to move focus from one UIButton to another UIButton after date selection. I am explaining you in detail as follows:
I have create UITableView with single object Multiple Custom UIButtons. When user will click on all this button the UIDatePicker will show with Next and Cancel UIToolBar. When user select date from datePicker and press Next button i want focus or select for the next UIButton to give facility to select date from datePicker for another button. Like flow without removing view for transaction.
So is it possible to Focus on another button after pressing Next button to another button.I googled around but could not find any solution for this.
Please help me for this.
Yes You can.. Perform following steps:
Set Different style for your buttons for Highlighted state.
Give a unique tag for each Button.
Lets say you have 5 buttons with tags 0 to 4. In your TouchUpInsideEvent write this,
(IBAction)onButtonClick:(UIButton *)sender
{
for(UIButton * btn in myButtons)//Mybuttons is outletCollection of buttons
{
if (btn.tag == sender.tag + 1)
{
[btn setHighlighted:YES];
break;
}
}
}
If it does not work with Highlighted state, you can try with Selected state. (I think it will work with selected state only .. :))

Can I exchange the position of the cancel/set buttons on Mobiscroll?

I'm using Mobiscroll 2.0.3. The datepicker view gives ok button on the left and cancel button on the right. Can I exchange the position, like the cancel button on the left and set button on the right? Because I have ok/cancel buttons placed in the opposite way to Moviscroll on the site. Users would get confused if the button positions are different at each.
You should be able to do that just using CSS and overriding the styles. I did it for the scroll-wheel view but the idea is the same (also note that that this was for mobiscroll 1.5.3 so the the markup and classes may have changed)
/* overide stlyes for mobi date/time picker */
.dwb-c
{
float:left;
margin-bottom:12px;
}
.dwb-s
{
float:right;
margin-bottom:12px;
}
I know it's late but if someone try to google it, just try this https://docs.mobiscroll.com/jquery/datetime#opt-buttons
You can set an array of buttons to display and you can use string names if you wanna show default buttons. So if you wanna change direction just set buttons like this:
buttons: ["cancel", "set"]

How to implement radio button in iPhone?

I want to add buttons like radio button. i have created round rect button but no idea about radio button.
How can I do it? This how I implement checkbox button feature.
any help please ?
The best way of achieving this is setting a normal and a selected image for each button. You can then easily switch each button on or off using the selected property:
myButton.selected = YES;
There is no direct UI for radio button you have to use images on UIbutton so that you can replace the checked images when a user press on the button just like tableview check/ uncehck functionality .It is just a trick by which you can make feel of a radio button.
I've written a controller for handling the logic behind an array of radio buttons. It's open source and on GitHub, check it out!
https://github.com/goosoftware/GSRadioButtonSetController
Check out DLRadioButton! It supports not only radio buttons but also checkboxes. If you have any questions, please feel free to leave a comment.

Animate only a part of an element

how can I animate only a part of an element?
I show/hide a div using jquery-ui's show method but I'd like to start/end the animation from/to a given height of the element.
My dev website can be seen here (link removed). When clicking on the 'Contact' button the contact page shows up or hides if it's already open. Since I couldn't find how to starts my animation from a given height I added a fixed button when it's closed, but when the contact button of the contact page overlaps the fixed button when it's closing...
Any help welcome!
looking for something like this??
http://jsfiddle.net/rlemon/F6Efp/8/
You can also add any fade or whatever effects. This is using a single button to animate both open and close. You could also attach a attribute to the button tag to define it's current state.

Resources