Merge the fix 311741 from 4.5 tree.
This commit is contained in:
Родитель
2fef67b510
Коммит
fe39d1964f
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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) ;
|
||||
|
|
Загрузка…
Ссылка в новой задаче