2001-09-29 00:14:13 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
2004-04-18 18:30:37 +04:00
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
1998-11-10 02:30:16 +03:00
|
|
|
*
|
2004-04-18 18:30:37 +04:00
|
|
|
* The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
* the License. You may obtain a copy of the License at
|
|
|
|
* http://www.mozilla.org/MPL/
|
1998-11-10 02:30:16 +03:00
|
|
|
*
|
2001-09-29 00:14:13 +04:00
|
|
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* License.
|
1998-11-10 02:30:16 +03:00
|
|
|
*
|
1999-11-06 06:40:37 +03:00
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
2004-04-18 18:30:37 +04:00
|
|
|
* The Initial Developer of the Original Code is
|
2001-09-29 00:14:13 +04:00
|
|
|
* Netscape Communications Corporation.
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 1998
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
1999-11-06 06:40:37 +03:00
|
|
|
*
|
2001-09-29 00:14:13 +04:00
|
|
|
* Contributor(s):
|
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
2004-04-18 18:30:37 +04:00
|
|
|
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
|
|
|
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
2001-09-29 00:14:13 +04:00
|
|
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
* of those above. If you wish to allow use of your version of this file only
|
|
|
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
2004-04-18 18:30:37 +04:00
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
2001-09-29 00:14:13 +04:00
|
|
|
* decision by deleting the provisions above and replace them with the notice
|
|
|
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
* the provisions above, a recipient may use your version of this file under
|
2004-04-18 18:30:37 +04:00
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
2001-09-29 00:14:13 +04:00
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
1999-02-12 20:45:58 +03:00
|
|
|
#include "nsCOMPtr.h"
|
2001-11-02 10:40:01 +03:00
|
|
|
#include "nsIImageControlFrame.h"
|
1999-04-14 01:51:43 +04:00
|
|
|
#include "nsImageFrame.h"
|
1999-01-22 18:32:57 +03:00
|
|
|
#include "nsFormControlHelper.h"
|
1998-11-10 02:30:16 +03:00
|
|
|
#include "nsIFormControlFrame.h"
|
|
|
|
#include "nsIFormControl.h"
|
|
|
|
#include "nsHTMLParts.h"
|
|
|
|
#include "nsIRenderingContext.h"
|
2004-08-01 03:15:21 +04:00
|
|
|
#include "nsPresContext.h"
|
1998-11-10 02:30:16 +03:00
|
|
|
#include "nsIPresShell.h"
|
2003-02-22 03:32:13 +03:00
|
|
|
#include "nsStyleContext.h"
|
1998-11-10 02:30:16 +03:00
|
|
|
#include "nsLeafFrame.h"
|
|
|
|
#include "nsCSSRendering.h"
|
|
|
|
#include "nsISupports.h"
|
|
|
|
#include "nsHTMLAtoms.h"
|
|
|
|
#include "nsIDeviceContext.h"
|
|
|
|
#include "nsIFontMetrics.h"
|
|
|
|
#include "nsIImage.h"
|
|
|
|
#include "nsStyleConsts.h"
|
2000-02-09 22:34:39 +03:00
|
|
|
#include "nsFormControlFrame.h"
|
2001-07-16 06:40:48 +04:00
|
|
|
#include "nsGUIEvent.h"
|
2001-11-01 18:31:13 +03:00
|
|
|
#include "nsLayoutAtoms.h"
|
2002-06-04 04:44:04 +04:00
|
|
|
#include "nsIServiceManager.h"
|
2002-09-30 15:56:37 +04:00
|
|
|
#include "nsContainerFrame.h"
|
2005-08-23 07:57:07 +04:00
|
|
|
#include "nsLayoutUtils.h"
|
2001-08-17 07:13:07 +04:00
|
|
|
#ifdef ACCESSIBILITY
|
2001-05-12 01:11:38 +04:00
|
|
|
#include "nsIAccessibilityService.h"
|
2001-08-17 07:13:07 +04:00
|
|
|
#endif
|
1998-11-10 02:30:16 +03:00
|
|
|
|
1998-11-20 20:22:08 +03:00
|
|
|
#define nsImageControlFrameSuper nsImageFrame
|
|
|
|
class nsImageControlFrame : public nsImageControlFrameSuper,
|
2001-11-02 10:40:01 +03:00
|
|
|
public nsIFormControlFrame,
|
|
|
|
public nsIImageControlFrame
|
1998-11-10 02:30:16 +03:00
|
|
|
{
|
|
|
|
public:
|
1998-12-03 09:31:43 +03:00
|
|
|
nsImageControlFrame();
|
1999-11-05 02:16:47 +03:00
|
|
|
~nsImageControlFrame();
|
1998-11-10 02:30:16 +03:00
|
|
|
|
2004-08-01 03:15:21 +04:00
|
|
|
NS_IMETHOD Destroy(nsPresContext *aPresContext);
|
2000-05-16 16:44:32 +04:00
|
|
|
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
|
1998-11-10 02:30:16 +03:00
|
|
|
|
2004-08-01 03:15:21 +04:00
|
|
|
NS_IMETHOD Reflow(nsPresContext* aPresContext,
|
1999-04-27 04:06:03 +04:00
|
|
|
nsHTMLReflowMetrics& aDesiredSize,
|
|
|
|
const nsHTMLReflowState& aReflowState,
|
|
|
|
nsReflowStatus& aStatus);
|
|
|
|
|
2004-08-01 03:15:21 +04:00
|
|
|
NS_IMETHOD HandleEvent(nsPresContext* aPresContext,
|
1998-11-10 02:30:16 +03:00
|
|
|
nsGUIEvent* aEvent,
|
1999-11-24 09:03:41 +03:00
|
|
|
nsEventStatus* aEventStatus);
|
1998-11-10 02:30:16 +03:00
|
|
|
|
2003-10-31 23:19:18 +03:00
|
|
|
virtual nsIAtom* GetType() const;
|
2001-11-01 18:31:13 +03:00
|
|
|
|
2001-08-17 07:13:07 +04:00
|
|
|
#ifdef ACCESSIBILITY
|
2001-05-18 03:52:32 +04:00
|
|
|
NS_IMETHOD GetAccessible(nsIAccessible** aAccessible);
|
2001-08-17 07:13:07 +04:00
|
|
|
#endif
|
2001-05-18 03:52:32 +04:00
|
|
|
|
1999-11-02 01:12:45 +03:00
|
|
|
#ifdef DEBUG
|
2001-11-14 04:33:42 +03:00
|
|
|
NS_IMETHOD GetFrameName(nsAString& aResult) const {
|
|
|
|
return MakeFrameName(NS_LITERAL_STRING("ImageControl"), aResult);
|
1998-11-19 20:22:29 +03:00
|
|
|
}
|
1999-11-02 01:12:45 +03:00
|
|
|
#endif
|
1998-11-19 20:22:29 +03:00
|
|
|
|
2004-12-31 00:56:11 +03:00
|
|
|
NS_IMETHOD GetCursor(const nsPoint& aPoint,
|
|
|
|
nsIFrame::Cursor& aCursor);
|
1999-04-28 02:54:15 +04:00
|
|
|
|
2003-10-31 23:19:18 +03:00
|
|
|
NS_IMETHOD_(PRInt32) GetFormControlType() const;
|
1998-11-10 02:30:16 +03:00
|
|
|
|
2001-11-02 10:40:01 +03:00
|
|
|
NS_IMETHOD GetName(nsAString* aName);
|
1998-11-10 02:30:16 +03:00
|
|
|
|
|
|
|
void SetFocus(PRBool aOn, PRBool aRepaint);
|
2004-08-01 03:15:21 +04:00
|
|
|
void ScrollIntoView(nsPresContext* aPresContext);
|
1999-01-22 18:32:57 +03:00
|
|
|
|
|
|
|
NS_IMETHOD GetFormContent(nsIContent*& aContent) const;
|
2004-08-01 03:15:21 +04:00
|
|
|
virtual nscoord GetVerticalInsidePadding(nsPresContext* aPresContext,
|
1999-09-30 15:30:04 +04:00
|
|
|
float aPixToTwip,
|
1999-01-22 18:32:57 +03:00
|
|
|
nscoord aInnerHeight) const;
|
2004-08-01 03:15:21 +04:00
|
|
|
virtual nscoord GetHorizontalInsidePadding(nsPresContext* aPresContext,
|
1999-01-22 18:32:57 +03:00
|
|
|
float aPixToTwip,
|
|
|
|
nscoord aInnerWidth,
|
|
|
|
nscoord aCharWidth) const;
|
1999-03-06 22:43:13 +03:00
|
|
|
|
|
|
|
|
1999-01-26 01:16:27 +03:00
|
|
|
// nsIFormControlFrame
|
2004-08-01 03:15:21 +04:00
|
|
|
NS_IMETHOD SetProperty(nsPresContext* aPresContext, nsIAtom* aName, const nsAString& aValue);
|
2002-03-24 01:26:36 +03:00
|
|
|
NS_IMETHOD GetProperty(nsIAtom* aName, nsAString& aValue);
|
fixed bugs #6303, #6753, #6756, #6759
Re-wrote nsComboboxFrame.
removed the obsolete nsHTMLAtoms: comboText,comoTextSelected,comTextSelectedFocus,dropDownVisible,
dropdownHidden, dropDownBtnOut, dropDownBtnPressed,
Added nsHTMLAtoms::combobox, nsLayoutAtoms::popupList
Renamed dropDownList to dropDownListPseudo
Added "arrow.gif" as to be used the background-image for the combobox button
ua.css - added rules for select to differentiate between comboboxes and listboxes.
Added style rules to more closely match the XPTOOLKIT XPWidgets look.
removed the following :-moz-combobox-text, -moz-combobox-textselected
nsIFormControlFrame.h - Added SetSuggestedSize method.
nsButtonControlFrame - Implemented SetSuggestedSize.
nsCSSFrameConstructor.cpp - Rewrote ConstructSelectFrame.
nsIWidget.h -Added GetAbsoluteBounds method.
nsWindow.cpp - Implemented GetAbsoluteBounds.
1999-07-15 02:00:24 +04:00
|
|
|
NS_IMETHOD SetSuggestedSize(nscoord aWidth, nscoord aHeight);
|
2001-11-02 10:40:01 +03:00
|
|
|
NS_IMETHOD OnContentReset();
|
|
|
|
|
|
|
|
// nsIImageControlFrame
|
|
|
|
NS_IMETHOD GetClickedX(PRInt32* aX);
|
|
|
|
NS_IMETHOD GetClickedY(PRInt32* aY);
|
1999-01-22 18:32:57 +03:00
|
|
|
|
1998-11-10 02:30:16 +03:00
|
|
|
protected:
|
|
|
|
NS_IMETHOD_(nsrefcnt) AddRef(void);
|
|
|
|
NS_IMETHOD_(nsrefcnt) Release(void);
|
|
|
|
|
|
|
|
nsPoint mLastClickPoint;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
1998-12-03 09:31:43 +03:00
|
|
|
nsImageControlFrame::nsImageControlFrame()
|
1998-11-10 02:30:16 +03:00
|
|
|
{
|
|
|
|
mLastClickPoint = nsPoint(0,0);
|
|
|
|
}
|
|
|
|
|
1999-11-05 02:16:47 +03:00
|
|
|
nsImageControlFrame::~nsImageControlFrame()
|
|
|
|
{
|
2000-05-16 16:44:32 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2004-08-01 03:15:21 +04:00
|
|
|
nsImageControlFrame::Destroy(nsPresContext *aPresContext)
|
2000-05-16 16:44:32 +04:00
|
|
|
{
|
|
|
|
nsFormControlFrame::RegUnRegAccessKey(aPresContext, NS_STATIC_CAST(nsIFrame*, this), PR_FALSE);
|
2000-02-09 22:34:39 +03:00
|
|
|
|
2000-05-16 16:44:32 +04:00
|
|
|
return nsImageControlFrameSuper::Destroy(aPresContext);
|
1999-11-05 02:16:47 +03:00
|
|
|
}
|
|
|
|
|
1998-11-10 02:30:16 +03:00
|
|
|
nsresult
|
1999-12-05 02:49:50 +03:00
|
|
|
NS_NewImageControlFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
|
1998-11-10 02:30:16 +03:00
|
|
|
{
|
1999-05-12 02:03:29 +04:00
|
|
|
NS_PRECONDITION(aNewFrame, "null OUT ptr");
|
|
|
|
if (nsnull == aNewFrame) {
|
|
|
|
return NS_ERROR_NULL_POINTER;
|
|
|
|
}
|
1999-12-05 02:49:50 +03:00
|
|
|
nsImageControlFrame* it = new (aPresShell) nsImageControlFrame;
|
1999-05-12 02:03:29 +04:00
|
|
|
if (!it) {
|
1998-11-10 02:30:16 +03:00
|
|
|
return NS_ERROR_OUT_OF_MEMORY;
|
|
|
|
}
|
1999-05-12 02:03:29 +04:00
|
|
|
*aNewFrame = it;
|
1998-11-10 02:30:16 +03:00
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
1999-11-02 04:50:15 +03:00
|
|
|
// Frames are not refcounted, no need to AddRef
|
|
|
|
NS_IMETHODIMP
|
1998-11-10 02:30:16 +03:00
|
|
|
nsImageControlFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
|
|
|
|
{
|
|
|
|
NS_PRECONDITION(0 != aInstancePtr, "null ptr");
|
|
|
|
if (NULL == aInstancePtr) {
|
|
|
|
return NS_ERROR_NULL_POINTER;
|
|
|
|
}
|
2001-01-04 23:44:42 +03:00
|
|
|
if (aIID.Equals(NS_GET_IID(nsIFormControlFrame))) {
|
1998-11-10 02:30:16 +03:00
|
|
|
*aInstancePtr = (void*) ((nsIFormControlFrame*) this);
|
|
|
|
return NS_OK;
|
2001-05-12 01:11:38 +04:00
|
|
|
}
|
2001-11-02 10:40:01 +03:00
|
|
|
if (aIID.Equals(NS_GET_IID(nsIImageControlFrame))) {
|
|
|
|
*aInstancePtr = (void*) ((nsIImageControlFrame*) this);
|
|
|
|
return NS_OK;
|
|
|
|
}
|
2001-05-12 01:11:38 +04:00
|
|
|
|
1998-11-20 20:22:08 +03:00
|
|
|
return nsImageControlFrameSuper::QueryInterface(aIID, aInstancePtr);
|
1998-11-10 02:30:16 +03:00
|
|
|
}
|
|
|
|
|
2001-08-17 07:13:07 +04:00
|
|
|
#ifdef ACCESSIBILITY
|
2001-05-18 03:52:32 +04:00
|
|
|
NS_IMETHODIMP nsImageControlFrame::GetAccessible(nsIAccessible** aAccessible)
|
|
|
|
{
|
|
|
|
nsCOMPtr<nsIAccessibilityService> accService = do_GetService("@mozilla.org/accessibilityService;1");
|
|
|
|
|
|
|
|
if (accService) {
|
2005-03-27 07:03:11 +04:00
|
|
|
if (mContent->Tag() == nsHTMLAtoms::button) {
|
|
|
|
return accService->CreateHTML4ButtonAccessible(NS_STATIC_CAST(nsIFrame*, this), aAccessible);
|
|
|
|
}
|
|
|
|
else if (mContent->Tag() == nsHTMLAtoms::input) {
|
|
|
|
return accService->CreateHTMLButtonAccessible(NS_STATIC_CAST(nsIFrame*, this), aAccessible);
|
|
|
|
}
|
2001-05-18 03:52:32 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
return NS_ERROR_FAILURE;
|
|
|
|
}
|
2001-08-17 07:13:07 +04:00
|
|
|
#endif
|
2001-05-18 03:52:32 +04:00
|
|
|
|
1998-11-10 02:30:16 +03:00
|
|
|
nsrefcnt nsImageControlFrame::AddRef(void)
|
|
|
|
{
|
|
|
|
NS_WARNING("not supported");
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsrefcnt nsImageControlFrame::Release(void)
|
|
|
|
{
|
|
|
|
NS_WARNING("not supported");
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2003-10-31 23:19:18 +03:00
|
|
|
nsIAtom*
|
|
|
|
nsImageControlFrame::GetType() const
|
2001-11-01 18:31:13 +03:00
|
|
|
{
|
2003-10-31 23:19:18 +03:00
|
|
|
return nsLayoutAtoms::imageControlFrame;
|
2001-11-01 18:31:13 +03:00
|
|
|
}
|
|
|
|
|
1999-04-27 04:06:03 +04:00
|
|
|
NS_METHOD
|
2004-08-01 03:15:21 +04:00
|
|
|
nsImageControlFrame::Reflow(nsPresContext* aPresContext,
|
1999-04-27 04:06:03 +04:00
|
|
|
nsHTMLReflowMetrics& aDesiredSize,
|
|
|
|
const nsHTMLReflowState& aReflowState,
|
|
|
|
nsReflowStatus& aStatus)
|
|
|
|
{
|
2000-04-22 01:51:35 +04:00
|
|
|
DO_GLOBAL_REFLOW_COUNT("nsImageControlFrame", aReflowState.reason);
|
2001-11-14 16:40:03 +03:00
|
|
|
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
|
2002-06-04 04:44:04 +04:00
|
|
|
if (aReflowState.reason == eReflowReason_Initial) {
|
2000-02-09 22:34:39 +03:00
|
|
|
nsFormControlFrame::RegUnRegAccessKey(aPresContext, NS_STATIC_CAST(nsIFrame*, this), PR_TRUE);
|
1998-11-10 02:30:16 +03:00
|
|
|
}
|
1999-04-27 04:06:03 +04:00
|
|
|
return nsImageControlFrameSuper::Reflow(aPresContext, aDesiredSize, aReflowState, aStatus);
|
1998-11-10 02:30:16 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
NS_METHOD
|
2004-08-01 03:15:21 +04:00
|
|
|
nsImageControlFrame::HandleEvent(nsPresContext* aPresContext,
|
1999-01-27 03:25:40 +03:00
|
|
|
nsGUIEvent* aEvent,
|
1999-11-24 09:03:41 +03:00
|
|
|
nsEventStatus* aEventStatus)
|
1998-11-10 02:30:16 +03:00
|
|
|
{
|
1999-11-24 09:03:41 +03:00
|
|
|
NS_ENSURE_ARG_POINTER(aEventStatus);
|
2000-08-09 03:38:00 +04:00
|
|
|
|
2002-05-02 00:15:44 +04:00
|
|
|
// Don't do anything if the event has already been handled by someone
|
|
|
|
if (nsEventStatus_eConsumeNoDefault == *aEventStatus) {
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2000-08-09 03:38:00 +04:00
|
|
|
// do we have user-input style?
|
2003-05-15 07:42:21 +04:00
|
|
|
const nsStyleUserInterface* uiStyle = GetStyleUserInterface();
|
2000-08-09 03:38:00 +04:00
|
|
|
if (uiStyle->mUserInput == NS_STYLE_USER_INPUT_NONE || uiStyle->mUserInput == NS_STYLE_USER_INPUT_DISABLED)
|
|
|
|
return nsFrame::HandleEvent(aPresContext, aEvent, aEventStatus);
|
|
|
|
|
2002-06-04 04:44:04 +04:00
|
|
|
if (nsFormControlHelper::GetDisabled(mContent)) { // XXX cache disabled
|
1998-11-10 02:30:16 +03:00
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
1999-11-24 09:03:41 +03:00
|
|
|
*aEventStatus = nsEventStatus_eIgnore;
|
1998-11-10 02:30:16 +03:00
|
|
|
|
1998-11-18 08:25:26 +03:00
|
|
|
switch (aEvent->message) {
|
2000-08-04 02:17:14 +04:00
|
|
|
case NS_MOUSE_LEFT_BUTTON_UP:
|
1999-01-27 03:25:40 +03:00
|
|
|
{
|
|
|
|
// Store click point for GetNamesValues
|
2004-03-06 07:48:15 +03:00
|
|
|
// Do this on MouseUp because the specs don't say and that's what IE does
|
2005-08-23 07:57:07 +04:00
|
|
|
nsPoint pt = nsLayoutUtils::GetEventCoordinatesRelativeTo(aEvent, this);
|
|
|
|
TranslateEventCoords(pt, mLastClickPoint);
|
1999-01-27 03:25:40 +03:00
|
|
|
break;
|
1998-11-10 02:30:16 +03:00
|
|
|
}
|
|
|
|
}
|
1998-11-20 20:22:08 +03:00
|
|
|
return nsImageControlFrameSuper::HandleEvent(aPresContext, aEvent,
|
|
|
|
aEventStatus);
|
1998-11-10 02:30:16 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsImageControlFrame::SetFocus(PRBool aOn, PRBool aRepaint)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
1999-08-21 04:09:24 +04:00
|
|
|
void
|
2004-08-01 03:15:21 +04:00
|
|
|
nsImageControlFrame::ScrollIntoView(nsPresContext* aPresContext)
|
1999-08-21 04:09:24 +04:00
|
|
|
{
|
|
|
|
if (aPresContext) {
|
2003-12-21 08:36:36 +03:00
|
|
|
nsIPresShell *presShell = aPresContext->GetPresShell();
|
2000-09-08 09:53:28 +04:00
|
|
|
if (presShell) {
|
|
|
|
presShell->ScrollFrameIntoView(this,
|
2000-01-26 01:19:39 +03:00
|
|
|
NS_PRESSHELL_SCROLL_IF_NOT_VISIBLE,NS_PRESSHELL_SCROLL_IF_NOT_VISIBLE);
|
2000-09-08 09:53:28 +04:00
|
|
|
}
|
1999-08-21 04:09:24 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-12-19 02:38:09 +03:00
|
|
|
NS_IMETHODIMP_(PRInt32)
|
2003-10-31 23:19:18 +03:00
|
|
|
nsImageControlFrame::GetFormControlType() const
|
1998-11-10 02:30:16 +03:00
|
|
|
{
|
2002-12-19 02:38:09 +03:00
|
|
|
return NS_FORM_INPUT_IMAGE;
|
1998-11-10 02:30:16 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2001-11-02 10:40:01 +03:00
|
|
|
nsImageControlFrame::GetName(nsAString* aResult)
|
1998-11-10 02:30:16 +03:00
|
|
|
{
|
2002-08-07 03:50:08 +04:00
|
|
|
return nsFormControlHelper::GetName(mContent, aResult);
|
1998-11-10 02:30:16 +03:00
|
|
|
}
|
|
|
|
|
1999-04-28 02:54:15 +04:00
|
|
|
NS_IMETHODIMP
|
2004-12-31 00:56:11 +03:00
|
|
|
nsImageControlFrame::GetCursor(const nsPoint& aPoint,
|
|
|
|
nsIFrame::Cursor& aCursor)
|
1999-04-28 02:54:15 +04:00
|
|
|
{
|
1999-06-25 04:19:44 +04:00
|
|
|
// Use style defined cursor if one is provided, otherwise when
|
|
|
|
// the cursor style is "auto" we use the pointer cursor.
|
2004-12-31 00:56:11 +03:00
|
|
|
FillCursorInformationFromStyle(GetStyleUserInterface(), aCursor);
|
|
|
|
|
|
|
|
if (NS_STYLE_CURSOR_AUTO == aCursor.mCursor) {
|
|
|
|
aCursor.mCursor = NS_STYLE_CURSOR_POINTER;
|
1999-06-25 04:19:44 +04:00
|
|
|
}
|
2004-12-31 00:56:11 +03:00
|
|
|
|
1999-04-28 02:54:15 +04:00
|
|
|
return NS_OK;
|
|
|
|
}
|
1998-11-10 02:30:16 +03:00
|
|
|
|
1999-01-22 18:32:57 +03:00
|
|
|
NS_IMETHODIMP
|
|
|
|
nsImageControlFrame::GetFormContent(nsIContent*& aContent) const
|
|
|
|
{
|
2003-07-04 16:50:32 +04:00
|
|
|
aContent = GetContent();
|
|
|
|
NS_IF_ADDREF(aContent);
|
|
|
|
return NS_OK;
|
1999-01-22 18:32:57 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
nscoord
|
2004-08-01 03:15:21 +04:00
|
|
|
nsImageControlFrame::GetVerticalInsidePadding(nsPresContext* aPresContext,
|
1999-09-30 15:30:04 +04:00
|
|
|
float aPixToTwip,
|
|
|
|
nscoord aInnerHeight) const
|
1999-01-22 18:32:57 +03:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
nscoord
|
2004-08-01 03:15:21 +04:00
|
|
|
nsImageControlFrame::GetHorizontalInsidePadding(nsPresContext* aPresContext,
|
1999-01-22 18:32:57 +03:00
|
|
|
float aPixToTwip,
|
|
|
|
nscoord aInnerWidth,
|
|
|
|
nscoord aCharWidth) const
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
1999-01-26 01:16:27 +03:00
|
|
|
|
2004-08-01 03:15:21 +04:00
|
|
|
NS_IMETHODIMP nsImageControlFrame::SetProperty(nsPresContext* aPresContext,
|
2000-08-23 21:27:06 +04:00
|
|
|
nsIAtom* aName,
|
2002-03-24 01:26:36 +03:00
|
|
|
const nsAString& aValue)
|
1999-01-26 01:16:27 +03:00
|
|
|
{
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2000-08-23 21:27:06 +04:00
|
|
|
NS_IMETHODIMP nsImageControlFrame::GetProperty(nsIAtom* aName,
|
2002-03-24 01:26:36 +03:00
|
|
|
nsAString& aValue)
|
1999-01-26 01:16:27 +03:00
|
|
|
{
|
2000-08-23 21:27:06 +04:00
|
|
|
aValue.Truncate();
|
1999-01-26 01:16:27 +03:00
|
|
|
return NS_OK;
|
1999-01-27 03:25:40 +03:00
|
|
|
}
|
fixed bugs #6303, #6753, #6756, #6759
Re-wrote nsComboboxFrame.
removed the obsolete nsHTMLAtoms: comboText,comoTextSelected,comTextSelectedFocus,dropDownVisible,
dropdownHidden, dropDownBtnOut, dropDownBtnPressed,
Added nsHTMLAtoms::combobox, nsLayoutAtoms::popupList
Renamed dropDownList to dropDownListPseudo
Added "arrow.gif" as to be used the background-image for the combobox button
ua.css - added rules for select to differentiate between comboboxes and listboxes.
Added style rules to more closely match the XPTOOLKIT XPWidgets look.
removed the following :-moz-combobox-text, -moz-combobox-textselected
nsIFormControlFrame.h - Added SetSuggestedSize method.
nsButtonControlFrame - Implemented SetSuggestedSize.
nsCSSFrameConstructor.cpp - Rewrote ConstructSelectFrame.
nsIWidget.h -Added GetAbsoluteBounds method.
nsWindow.cpp - Implemented GetAbsoluteBounds.
1999-07-15 02:00:24 +04:00
|
|
|
|
|
|
|
NS_IMETHODIMP nsImageControlFrame::SetSuggestedSize(nscoord aWidth, nscoord aHeight)
|
|
|
|
{
|
|
|
|
// mSuggestedWidth = aWidth;
|
|
|
|
// mSuggestedHeight = aHeight;
|
|
|
|
return NS_OK;
|
1999-07-16 04:26:47 +04:00
|
|
|
}
|
|
|
|
|
2001-11-02 10:40:01 +03:00
|
|
|
NS_IMETHODIMP
|
|
|
|
nsImageControlFrame::OnContentReset()
|
|
|
|
{
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsImageControlFrame::GetClickedX(PRInt32* aX)
|
|
|
|
{
|
|
|
|
*aX = mLastClickPoint.x;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsImageControlFrame::GetClickedY(PRInt32* aY)
|
|
|
|
{
|
|
|
|
*aY = mLastClickPoint.y;
|
|
|
|
return NS_OK;
|
|
|
|
}
|