Skip to content
Commits on Source (2)
......@@ -139,9 +139,15 @@ Public Sub WatchTimer_Timer()
Dim X As Integer
Dim Y As Integer
If Not $hCurrentMenu Or If $hCurrentMenu.Closed Then
Last.Stop
Return
Endif
X = Mouse.ScreenX - Me.Parent.ScreenX
Y = Mouse.ScreenY - Me.Parent.ScreenY
'Debug X;; Y
If X < 0 Or If Y < 0 Or If X >= Me.Parent.W Or If Y >= Me.Parent.H Then Return
......
......@@ -520,6 +520,14 @@ BEGIN_PROPERTY(Menu_Proxy)
END_PROPERTY
BEGIN_PROPERTY(Menu_Closed)
GB.ReturnBoolean(MENU->isClosed());
END_PROPERTY
//---------------------------------------------------------------------------
GB_DESC CMenuChildrenDesc[] =
......@@ -573,6 +581,8 @@ GB_DESC CMenuDesc[] =
GB_METHOD("Show", 0, Menu_Show, 0),
GB_METHOD("Hide", 0, Menu_Hide, 0),
GB_PROPERTY_READ("Closed", "b", Menu_Closed),
GB_EVENT("Click", 0, 0, &EVENT_Click),
GB_EVENT("Show", 0, 0, &EVENT_Show),
GB_EVENT("Hide", 0, 0, &EVENT_Hide),
......
......@@ -60,6 +60,7 @@ public:
bool topLevel() const { return top_level; }
bool isSeparator() const { return _style == SEPARATOR; }
void *parent() const { return pr; }
bool isClosed() const { return !_opened; }
void setChecked(bool vl);
void setToggle(bool vl);
......
......@@ -893,6 +893,13 @@ BEGIN_PROPERTY(Menu_Tag)
END_METHOD
BEGIN_PROPERTY(Menu_Closed)
GB.ReturnBoolean(!THIS->opened);
END_PROPERTY
//---------------------------------------------------------------------------
GB_DESC CMenuChildrenDesc[] =
......@@ -943,6 +950,8 @@ GB_DESC CMenuDesc[] =
GB_METHOD("Show", NULL, Menu_Show, NULL),
GB_METHOD("Hide", NULL, Menu_Hide, NULL),
GB_PROPERTY_READ("Closed", "b", Menu_Closed),
//GB_EVENT("Delete", NULL, NULL, &EVENT_Destroy), // Must be first
GB_EVENT("Click", NULL, NULL, &EVENT_Click),
GB_EVENT("Show", NULL, NULL, &EVENT_Show),
......@@ -1022,6 +1031,8 @@ void CMenu::slotShown(void)
HANDLE_PROXY(menu);
GB.Ref(menu);
menu->opened = TRUE;
GB.Raise(menu, EVENT_Show, 0);
......@@ -1043,6 +1054,8 @@ void CMenu::slotHidden(void)
GET_MENU_SENDER(menu);
HANDLE_PROXY(menu);
menu->opened = FALSE;
if (GB.CanRaise(menu, EVENT_Hide))
{
GB.Ref(menu);
......
......@@ -80,6 +80,7 @@ typedef
unsigned disabled : 1;
unsigned visible : 1;
unsigned init_shortcut : 1;
unsigned opened : 1;
}
CMENU;
......