diff --git a/lib/mac/UserInterface/LCustomizeMenu.cp b/lib/mac/UserInterface/LCustomizeMenu.cp index b6bb5f545016..26072fe56bef 100644 --- a/lib/mac/UserInterface/LCustomizeMenu.cp +++ b/lib/mac/UserInterface/LCustomizeMenu.cp @@ -49,6 +49,17 @@ void LCustomizeMenu::Size(MenuHandle menu, MenuDefUPP* /* root */, Rect * /* rec (**menu).menuHeight = fItemHeight * fItemCount; (**menu).menuWidth = maxWidth; } +// +// PopUp +// +void LCustomizeMenu::PopUp(MenuHandle menu, MenuDefUPP* /* root */, Rect *rect , Point hitPt, short * item ) +{ + rect->left = hitPt.v; + rect->top = hitPt.h - fItemHeight * (*item - 1); + rect->right = rect->left + (**menu).menuWidth ; + rect->bottom = rect->top + (**menu).menuHeight ; + +} // // MeasureItem @@ -109,6 +120,7 @@ void LCustomizeMenu::Draw(MenuHandle menu, MenuDefUPP* /* root */, Rect *rect, P { Assert_(fItemCount != 0); Assert_(fItemHeight != 0); + for(int i = 1; i <= fItemCount; i++) { Rect itemrect; diff --git a/lib/mac/UserInterface/LCustomizeMenu.h b/lib/mac/UserInterface/LCustomizeMenu.h index 06c995ff81e6..1d654484fb1d 100644 --- a/lib/mac/UserInterface/LCustomizeMenu.h +++ b/lib/mac/UserInterface/LCustomizeMenu.h @@ -25,6 +25,7 @@ public: virtual void Draw (MenuHandle menu, MenuDefUPP* root, Rect *rect, Point hitPt, short *item); virtual void Size (MenuHandle menu, MenuDefUPP* root, Rect *rect, Point hitPt, short *item); virtual void Choose(MenuHandle menu, MenuDefUPP* root, Rect *rect, Point hitPt, short *item); + virtual void PopUp (MenuHandle menu, MenuDefUPP* root, Rect *rect, Point hitPt, short *item); protected: virtual void DrawItem (MenuHandle menu, int item, Rect& itemrect); virtual short MeasureItem (MenuHandle menu, int item); @@ -55,7 +56,7 @@ protected: // Basic Testing function virtual Boolean ItemEnable (MenuHandle menu, int item) - { return (((1L << (item )) & (**menu).enableFlags) != 0); }; + { return (item < 32 ) ? (((1L << (item )) & (**menu).enableFlags) != 0) : true; }; virtual Boolean HaveMark (short cmd, short mark) { return ((cmd != 0x1b) && (mark != 0)); }; virtual Boolean HaveIcon (short cmd, short iconindex) diff --git a/lib/mac/UserInterface/UCustomizePopUp.cp b/lib/mac/UserInterface/UCustomizePopUp.cp index 2d3208c191bf..e7b4d400fbc7 100644 --- a/lib/mac/UserInterface/UCustomizePopUp.cp +++ b/lib/mac/UserInterface/UCustomizePopUp.cp @@ -62,7 +62,11 @@ pascal void UCustomizePopUp::MDEF(short message, MenuHandle menu, Rect *rect, Po UCustomizePopUp::fCustomize->PopUp (menu, UCustomizePopUp::fOrigMenuDefUPP, rect, hitPt, item); break; default: - Assert_(FALSE); + // Assert_(FALSE); + // somehow we got message equal to 6 when we doing debug. So far I cannot find out any documentation + // describe what is message 6 mean. We just let the default routine handle it for now. + // We probably need to change it later- after we know what 6 mean... + CallMenuDefProc(*UCustomizePopUp::fOrigMenuDefUPP, message, menu, rect, hitPt, item); break; } ::SetA5 (savedA5) ;