How do I remove the Office-like button, but keep the ribbon? - visual-studio-2010

How do I remove the Office-like button, but keep the ribbon?

In your CMainFrame class declare the ribbon button:
private:
CMFCRibbonApplicationButton m_wndRibbonButton;
Then in the OnCreate method, set the button visibility and assign it to the ribbon bar:
m_wndRibbonButton.SetVisible(FALSE);
m_wndRibbonBar.SetApplicationButton(&m_wndRibbonButton, CSize());
This is what you'll get:

Related

How to programatically scroll CollectionView after its rendering

I want to programatically scroll CollectionView after its rendering however, I can't seem to find the lifecycle hook to call the scroll function in.
Calling the scroll function in OnAppearing hook is out of the question because that hook exists only in ContentPage and my CollectionView exists in a LazyView that gets initialized after clicking a button on a page.
private void ScrollToItemAtPosition(int idx) {
PhotoCollection.ScrollTo(idx, position: ScrollToPosition.Center);
}
Any ideas? Thanks!

iOS custom button has lost click functionality

I have made an iOS customrenderer for a Button in my PCL.
The button is a custom button, Hence why my PCL Handle_clicked event doesn't fire.
I suppose i need to add something in:
btn.TouchUpInside += (object sender, EventArgs c) =>
{
};
in order to make some sort of callback, so that my Handle_clicked event knows when the user has clicked the button. I just don't know how, as customrenderers are fairly new to me.
I have tried adding the following to my custom button:
UIButton btn = new UIButton(UIButtonType.Custom);
btn = Control as UIButton; //I have added this
Unfortunately by doing so, it recognize the click event, but doesn't add my custom styling.

Select Item in NSCollectionView on mouseDown, not mouseUp?

I'd like to make it so my NSCollectionView's selection behavior matches the icon-view in Finder. Finder will select and highlight elements when the mouse button is clicked down, but NSCollectionView's built in behavior appears to use mouse up to trigger a selection.
Is there a way to make NSCollectionView act like Finder in this regard?
Per pfandtrade's comment above, it looks like the highlight state of an NSCollectionViewItem will be changed before that item is selected.
mouseDown = NSCollectionViewItem's highlightState is set to forSelection
mouseUp = NSCOllectionViewItem's highlightState is set to none, but isSelected property is then set to true.
I added the following to my NSCollectionViewItem subclass:
override var highlightState: NSCollectionViewItemHighlightState{
didSet{
if self.highlightState == .forSelection{
self.showSelectedHighlight() //my stylization function
}
}
}

Can we override NAVIGATION BACK BUTTON press in Xamarin.forms?

Can we override navigation back button pressed in Xamarin.forms?
I have one navigation back button and the one save button in navigation bar.Save button hits the web service and saves in asynchronous way. While saving although i used progressing bar, navigation back button can be pressed and hence the app crashes due to index out of range exception on navigation stack.I tried using OnDisappearing() , did not work. I wanna cancel the PopUpAsync(),if the save is not done completely, but failed to achieve that. Is there any solution for this scenario? Can we override the navigation back button press event using any custom renderer ?
For controlling the back button to do what I want, I used this method in Xamarin:
public override bool OnKeyDown(Keycode HWkeyCode, KeyEvent e)
{
if (HWkeyCode == Keycode.Back)
{
StartActivity(typeof(FrontPageActivity));
return true;
}
return false;
}

How do I show a Next button on Sencha NavigationView?

Sencha adds a nice Back button to the navigation bar. As shown below.
So my questions are:-
How can I dynamically add the Next button to the navigation bar?
How do I style the Next button to have a triangular edge, similar to what the Back button has?
You can change appearance of button to look alike forward button by setting ui : "forward" config for button.
You can add buttons to navigation bar with following way -
navigationBar : {
items:[
{
xtype:'button',
text:'Forward',
ui:'forward'
}
]
},
You can also add buttons dynamically to navigation bar from controller. First get instance of navigation view and then navigation bar. Create some buttons and add them to it.
var navBar = this.getMyNavView().getNavigationBar();
var button = Ext.create('Ext.Button', {
text: 'Button'
});
navBar.add(button);
update
Found this issue for ui : 'forward' on sencha forum. Have a look at it.
http://www.sencha.com/forum/showthread.php?253899-When-using-ui-forward-and-back-the-buttons-are-not-being-rendered-properly

Resources