NS_METHOD nsFormControlFrame::HandleEvent(nsPresContext* aPresContext, nsGUIEvent* aEvent, nsEventStatus* aEventStatus) { // Check for user-input:none style const nsStyleUserInterface* uiStyle = GetStyleUserInterface(); if (uiStyle->mUserInput == NS_STYLE_USER_INPUT_NONE || uiStyle->mUserInput == NS_STYLE_USER_INPUT_DISABLED) return nsFrame::HandleEvent(aPresContext, aEvent, aEventStatus); return NS_OK; }
NS_IMETHODIMP nsImageControlFrame::GetCursor(const nsPoint& aPoint, nsIFrame::Cursor& aCursor) { // Use style defined cursor if one is provided, otherwise when // the cursor style is "auto" we use the pointer cursor. FillCursorInformationFromStyle(GetStyleUserInterface(), aCursor); if (NS_STYLE_CURSOR_AUTO == aCursor.mCursor) { aCursor.mCursor = NS_STYLE_CURSOR_POINTER; } return NS_OK; }
NS_IMETHODIMP nsGfxButtonControlFrame::HandleEvent(nsPresContext* aPresContext, nsGUIEvent* aEvent, nsEventStatus* aEventStatus) { // Override the HandleEvent to prevent the nsFrame::HandleEvent // from being called. The nsFrame::HandleEvent causes the button label // to be selected (Drawn with an XOR rectangle over the label) // do we have user-input style? const nsStyleUserInterface* uiStyle = GetStyleUserInterface(); if (uiStyle->mUserInput == NS_STYLE_USER_INPUT_NONE || uiStyle->mUserInput == NS_STYLE_USER_INPUT_DISABLED) return nsFrame::HandleEvent(aPresContext, aEvent, aEventStatus); return NS_OK; }
NS_METHOD nsImageControlFrame::HandleEvent(nsPresContext* aPresContext, nsGUIEvent* aEvent, nsEventStatus* aEventStatus) { NS_ENSURE_ARG_POINTER(aEventStatus); // Don't do anything if the event has already been handled by someone if (nsEventStatus_eConsumeNoDefault == *aEventStatus) { return NS_OK; } // do we have user-input style? const nsStyleUserInterface* uiStyle = GetStyleUserInterface(); if (uiStyle->mUserInput == NS_STYLE_USER_INPUT_NONE || uiStyle->mUserInput == NS_STYLE_USER_INPUT_DISABLED) return nsFrame::HandleEvent(aPresContext, aEvent, aEventStatus); if (mContent->HasAttr(kNameSpaceID_None, nsGkAtoms::disabled)) { // XXX cache disabled return NS_OK; } *aEventStatus = nsEventStatus_eIgnore; if (aEvent->eventStructType == NS_MOUSE_EVENT && aEvent->message == NS_MOUSE_BUTTON_UP && static_cast<nsMouseEvent*>(aEvent)->button == nsMouseEvent::eLeftButton) { // Store click point for nsHTMLInputElement::SubmitNamesValues // Do this on MouseUp because the specs don't say and that's what IE does nsIntPoint* lastClickPoint = static_cast<nsIntPoint*> (mContent->GetProperty(nsGkAtoms::imageClickedPoint)); if (lastClickPoint) { // normally lastClickedPoint is not null, as it's allocated in Init() nsPoint pt = nsLayoutUtils::GetEventCoordinatesRelativeTo(aEvent, this); TranslateEventCoords(pt, *lastClickPoint); } } return nsImageControlFrameSuper::HandleEvent(aPresContext, aEvent, aEventStatus); }
NS_IMETHODIMP nsComboboxControlFrame::HandleEvent(nsPresContext* aPresContext, nsGUIEvent* aEvent, nsEventStatus* aEventStatus) { NS_ENSURE_ARG_POINTER(aEventStatus); if (nsEventStatus_eConsumeNoDefault == *aEventStatus) { return NS_OK; } if (mContent->HasAttr(kNameSpaceID_None, nsGkAtoms::disabled)) { return NS_OK; } // If we have style that affects how we are selected, feed event down to // nsFrame::HandleEvent so that selection takes place when appropriate. const nsStyleUserInterface* uiStyle = GetStyleUserInterface(); if (uiStyle->mUserInput == NS_STYLE_USER_INPUT_NONE || uiStyle->mUserInput == NS_STYLE_USER_INPUT_DISABLED) return nsBlockFrame::HandleEvent(aPresContext, aEvent, aEventStatus); return NS_OK; }