mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-08-30 23:02:39 -06:00
CtrlCore: Cocoa Fixed menu hotkeys
git-svn-id: svn://ultimatepp.org/upp/trunk@12618 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
d5c61a393a
commit
866f4da2c7
3 changed files with 20 additions and 4 deletions
|
|
@ -12,8 +12,10 @@ protected:
|
|||
static void SyncMainMenu(bool force);
|
||||
|
||||
void *menubar = NULL;
|
||||
Event<Bar&> MainMenu;
|
||||
|
||||
public:
|
||||
void SetMainMenu(Event<Bar&> menu);
|
||||
virtual bool HotKey(dword key);
|
||||
|
||||
//$ };
|
||||
void SetMainMenu(Event<Bar&> menu);
|
||||
//$ };
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
namespace Upp {
|
||||
|
||||
#define LLOG(x) // DLOG(x)
|
||||
#define LLOG(x) // DLOG(x)
|
||||
|
||||
Ptr<Ctrl> Ctrl::focusCtrl;
|
||||
Ptr<Ctrl> Ctrl::focusCtrlWnd;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
#ifdef PLATFORM_COCOA
|
||||
|
||||
#define LLOG(x) DLOG(x)
|
||||
#define LLOG(x) // DLOG(x)
|
||||
|
||||
namespace Upp {
|
||||
|
||||
|
|
@ -195,6 +195,11 @@ bool CocoMenuBar::IsEmpty() const
|
|||
}
|
||||
}
|
||||
|
||||
- (void)menuDidClose:(NSMenu *)menu {
|
||||
CocoMenu *m = (CocoMenu *)menu;
|
||||
[m removeAllItems];
|
||||
}
|
||||
|
||||
-(void)submenuAction:(id)sender {
|
||||
if(ptr)
|
||||
proc(*ptr);
|
||||
|
|
@ -218,6 +223,15 @@ void TopWindow::SetMainMenu(Event<Bar&> menu)
|
|||
CocoMenuBar& bar = *(CocoMenuBar *)menubar;
|
||||
bar.Set(menu);
|
||||
SyncMainMenu(true);
|
||||
MainMenu = menu;
|
||||
}
|
||||
|
||||
bool TopWindow::HotKey(dword key)
|
||||
{
|
||||
LLOG("TopWindow::HotKey " << GetKeyDesc(key));
|
||||
if(Bar::Scan(MainMenu, key))
|
||||
return true;
|
||||
return Ctrl::HotKey(key);
|
||||
}
|
||||
|
||||
TopWindow *TopWindow::GetMenuTopWindow()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue