This source file includes following definitions.
- wrapper_
- GetNativeMenu
- RunMenuAt
- RunContextMenuAt
- CancelMenu
- Rebuild
- UpdateStates
- GetMenuAction
- AddMenuListener
- RemoveMenuListener
- SetMinimumWidth
#include "ui/views/controls/menu/menu_2.h"
#include "ui/base/models/menu_model.h"
#include "ui/views/controls/menu/menu_listener.h"
namespace views {
Menu2::Menu2(ui::MenuModel* model)
: model_(model),
wrapper_(MenuWrapper::CreateWrapper(model)) {
Rebuild();
}
Menu2::~Menu2() {}
HMENU Menu2::GetNativeMenu() const {
return wrapper_->GetNativeMenu();
}
void Menu2::RunMenuAt(const gfx::Point& point, Alignment alignment) {
wrapper_->RunMenuAt(point, alignment);
}
void Menu2::RunContextMenuAt(const gfx::Point& point) {
RunMenuAt(point, ALIGN_TOPLEFT);
}
void Menu2::CancelMenu() {
wrapper_->CancelMenu();
}
void Menu2::Rebuild() {
wrapper_->Rebuild(NULL);
}
void Menu2::UpdateStates() {
wrapper_->UpdateStates();
}
MenuWrapper::MenuAction Menu2::GetMenuAction() const {
return wrapper_->GetMenuAction();
}
void Menu2::AddMenuListener(MenuListener* listener) {
wrapper_->AddMenuListener(listener);
}
void Menu2::RemoveMenuListener(MenuListener* listener) {
wrapper_->RemoveMenuListener(listener);
}
void Menu2::SetMinimumWidth(int width) {
wrapper_->SetMinimumWidth(width);
}
}