menuitem

How do get menu to open to the left in WPF?

与世无争的帅哥 提交于 2019-11-28 05:02:05
问题 I have a menu (with menuitems) in WPF. Unfortunately when I click on the menu heading it opens the menu to the right. The problem is that there is stuff on the right that I don't want it to overlap. How do I tell WPF to open the menu to the left? Do I need to do a control template? (control templates seem so heavy handed for such basic style changes). Thanks! KSG 回答1: While you can create a ControlTemplate to do this like they do here, I agree that it is a cumbersome method just to modify one

How can I alter a MenuItem on the Options Menu on Android?

安稳与你 提交于 2019-11-28 04:51:50
I have an Options Menu on my Activity with an MenuItem "Start". When this MenuItem is selected I would like to alter the Menu so it contains a MenuItem "Stop". And finally when "Stop" is selected, I would like to alter back to "Start". Here is parts of my code that isn't working. I have both "Start" and "Stop" listed in mymenu.xml I should probably remove "stop" when the menu is created: public class MyActivity extends Activity { private boolean isStarted = false; @Override public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getMenuInflater(); menu.removeItem(R.id.stop);

Animated menu item “jumps” when animation starts

大城市里の小女人 提交于 2019-11-28 04:24:09
问题 I am using the code from this question: Animated Icon for ActionItem to animate my refresh ActionBarButton . It works fine, except that the style doesn't seem to be right. When I click the item, it starts rotating, but only after it "jumps" a few pixels. It seems like the style of the ImageView is different from the style of the menu item. The item is defined like this: <item android:id="@+id/action_refresh" android:orderInCategory="100" android:icon="@drawable/ic_menu_refresh" android

WPF Sub-MenuItem Opening on the Left Instead of the Right

白昼怎懂夜的黑 提交于 2019-11-28 04:23:02
问题 I have set up a simple sample menu. <Menu> <MenuItem Header="Top Menu"> <MenuItem Header="Item 1"> <MenuItem Header="Sub Menu 2" /> </MenuItem> </MenuItem> </Menu> Sub Menu 2 is opening on the left instead of the expected right side of the menu. I would expect this behaviour if the menu was near the edge of the screen, but window is centered on the screen and not near any edge. Is there a property that controls where a MenuItem opens on the screen? 回答1: Does this happen on other applications

Change selected dot color of JRadioButtonMenuItem

南笙酒味 提交于 2019-11-28 04:12:48
问题 I'm working on my personal Java chat client whose one feature is setting user's status (Available, Invisible, Busy). To make it user-friendly, I put those statuses into a JMenu with JRadioButtonMenuItem . The problem is I want each status RadioButton to have its own radio-dot color (or dot-icon). For example: [Green-Dot] Available [Red-Dot] Busy [Gray-Dot] Invisible. I thought of extending the JRadioButtonMenuItem with three different custom RadioButtonMenuItem , but couldn't understand how

Why is this WPF RoutedCommand bound Context MenuItem disabled?

霸气de小男生 提交于 2019-11-28 04:06:33
问题 I'm still fumbling my way around WPF at the moment, and can not figure out why this context menu item is disabled: <Window x:Class="DisabledMenuItemProblem.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:DisabledMenuItemProblem" Title="Window1" Height="300" Width="300"> <TextBlock Text="fooooobaaaaaar"> <TextBlock.ContextMenu> <ContextMenu> <MenuItem Header="Foo" Command="{x:Static

How to add “active” class to wp_nav_menu() current menu item (simple way)

懵懂的女人 提交于 2019-11-28 03:49:56
I am creating custom Wordpress theme using a starter theme _Underscores. I am also using Bootstrap as a front-end framework. I would like to modify wp_nav_menu so that it assigns current menu item class="active" instead of class="current-menu-item" (which is default). Or maybe at least assigns both of these classes. I need this in order to use .active class from bootstrap.css. Here is the example of what I have (all these classes are wp generated, please scroll to see what I mean): <ul id="menu-main-menu" class="nav navbar-nav"> <li id="menu-item-14" class="menu-item menu-item-type-post_type

Inflate Bottom Navigation View menu programmatically

南笙酒味 提交于 2019-11-28 03:12:21
问题 Bottom Navigation View has been added to version 25 of the Design Support Library. Tried and it's much easier to use now. But I am facing problem implementing it as per my app requirements. I want to inflate menu resource dynamically and change menu items/titles of the Bottom Navigation view programmatically. inflateMenu(int menuResource) — Inflate a menu for the bottom navigation view using a menu resource identifier. According to docs: inflateMenu: void inflateMenu (int resId) Inflate a

BottomNavigationView - How to uncheck all MenuItems and keep Titles being displayed?

你离开我真会死。 提交于 2019-11-28 02:53:54
问题 As I liked the design from BottomNavigationView I decided to implement a new Menu for my App with it, instead of just using simple buttons. I took this post as a guideline. According to BottomNavigationView 's documentation, its purpose is to provide quick navigation between top-level views of an app. It is primarily designed for use on mobile. In my case, I just want each MenuItem to launch an activity, but by default there is always one MenuItem selected: I tried to set the color to white

asp.net adding class to current menuItem

a 夏天 提交于 2019-11-28 01:57:54
问题 I am new the asp.net so i will appreciate a full code answer. I have a web site in asp.net and c# i added a menu to the site.master page it looks like this: <asp:Menu ID="mainMenu" runat="server" autopostback="true"> <Items> <asp:MenuItem Text="Home" Value="Home" ></asp:MenuItem> <asp:MenuItem Text="Pipes" Value="Pipes"></asp:MenuItem> <asp:MenuItem Text="View & Query" Value="View & Query"></asp:MenuItem> <asp:MenuItem Text="API" Value="API"></asp:MenuItem> </Items> </asp:Menu> I now need to