Correcting command handling for htmlarea form widgets. Now they no longer take over a host of browser commands like Print, Save, etc.
git-svn-id: svn://10.0.0.236/trunk@8091 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -758,6 +758,59 @@ void CFormHTMLArea::FinishCreateSelf()
|
||||
CHTMLView::FinishCreateSelf();
|
||||
}
|
||||
|
||||
void CFormHTMLArea::FindCommandStatus( CommandT inCommand, Boolean& outEnabled,
|
||||
Boolean& outUsesMark, Char16& outMark, Str255 outName )
|
||||
{
|
||||
outUsesMark = false;
|
||||
outEnabled = false;
|
||||
|
||||
// We don't want composer to control all the commands it would if it were
|
||||
// not inside a form, so short circuit these and hand them off to the
|
||||
// browser
|
||||
switch ( inCommand )
|
||||
{
|
||||
case cmd_AddToBookmarks:
|
||||
case cmd_Print:
|
||||
case cmd_ViewSource:
|
||||
case cmd_Publish:
|
||||
case cmd_Refresh:
|
||||
case cmd_Reload:
|
||||
case cmd_EditSource:
|
||||
case cmd_BrowseDocument:
|
||||
case cmd_Save:
|
||||
case cmd_SaveAs:
|
||||
case cmd_DocumentInfo:
|
||||
LCommander::FindCommandStatus(inCommand, outEnabled, outUsesMark, outMark, outName);
|
||||
break;
|
||||
default:
|
||||
CEditView::FindCommandStatus(inCommand, outEnabled, outUsesMark, outMark, outName);
|
||||
}
|
||||
}
|
||||
|
||||
Boolean CFormHTMLArea::ObeyCommand( CommandT inCommand, void *ioParam )
|
||||
{
|
||||
// We don't want composer to control all the commands it would if it were
|
||||
// not inside a form, so short circuit these and hand them off to the
|
||||
// browser
|
||||
switch ( inCommand )
|
||||
{
|
||||
case cmd_AddToBookmarks:
|
||||
case cmd_Print:
|
||||
case cmd_ViewSource:
|
||||
case cmd_Publish:
|
||||
case cmd_Refresh:
|
||||
case cmd_Reload:
|
||||
case cmd_EditSource:
|
||||
case cmd_BrowseDocument:
|
||||
case cmd_Save:
|
||||
case cmd_SaveAs:
|
||||
case cmd_DocumentInfo:
|
||||
return LCommander::ObeyCommand (inCommand, ioParam);
|
||||
break;
|
||||
default:
|
||||
return CEditView::ObeyCommand (inCommand, ioParam);
|
||||
}
|
||||
}
|
||||
|
||||
void CFormHTMLArea::BeTarget()
|
||||
{
|
||||
|
||||
@@ -331,8 +331,12 @@ public:
|
||||
void FinishCreateSelf();
|
||||
|
||||
// ¥¥ Misc
|
||||
virtual void BeTarget();
|
||||
virtual void DontBeTarget();
|
||||
virtual void FindCommandStatus( CommandT inCommand, Boolean& outEnabled,
|
||||
Boolean& outUsesMark, Char16& outMark, Str255 outName );
|
||||
|
||||
virtual Boolean ObeyCommand( CommandT inCommand, void *ioParam );
|
||||
virtual void BeTarget();
|
||||
virtual void DontBeTarget();
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user