1999-01-18 18:14:00 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
*
|
1999-11-06 06:40:37 +03:00
|
|
|
* The contents of this file are subject to the Netscape 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/NPL/
|
1999-01-18 18:14:00 +03:00
|
|
|
*
|
1999-11-06 06:40:37 +03: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.
|
1999-01-18 18:14:00 +03:00
|
|
|
*
|
1999-11-06 06:40:37 +03:00
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is Netscape
|
1999-01-18 18:14:00 +03:00
|
|
|
* Communications Corporation. Portions created by Netscape are
|
1999-11-06 06:40:37 +03:00
|
|
|
* Copyright (C) 1998 Netscape Communications Corporation. All
|
|
|
|
* Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
1999-01-18 18:14:00 +03:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef nsComboboxControlFrame_h___
|
|
|
|
#define nsComboboxControlFrame_h___
|
|
|
|
|
2000-03-07 18:54:31 +03:00
|
|
|
#ifdef DEBUG_evaughan
|
|
|
|
//#define DEBUG_rods
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef DEBUG_rods
|
2000-10-04 17:39:07 +04:00
|
|
|
//#define DO_REFLOW_DEBUG
|
|
|
|
//#define DO_REFLOW_COUNTER
|
2000-03-15 18:47:11 +03:00
|
|
|
//#define DO_UNCONSTRAINED_CHECK
|
2000-03-07 18:54:31 +03:00
|
|
|
//#define DO_PIXELS
|
|
|
|
//#define DO_NEW_REFLOW
|
|
|
|
#endif
|
2000-01-05 19:42:47 +03:00
|
|
|
|
2001-06-30 04:25:09 +04:00
|
|
|
#include "nsIDOMMouseListener.h"
|
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
|
|
|
#include "nsAreaFrame.h"
|
1999-01-18 18:14:00 +03:00
|
|
|
#include "nsIFormControlFrame.h"
|
|
|
|
#include "nsIComboboxControlFrame.h"
|
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
|
|
|
#include "nsVoidArray.h"
|
|
|
|
#include "nsIAnonymousContentCreator.h"
|
1999-08-26 18:54:07 +04:00
|
|
|
#include "nsISelectControlFrame.h"
|
1999-09-15 09:31:31 +04:00
|
|
|
#include "nsIStatefulFrame.h"
|
1999-09-22 01:20:50 +04:00
|
|
|
#include "nsIRollupListener.h"
|
2000-02-01 02:59:55 +03:00
|
|
|
#include "nsIPresState.h"
|
2000-03-07 18:54:31 +03:00
|
|
|
#include "nsCSSFrameConstructor.h"
|
2000-03-07 19:45:21 +03:00
|
|
|
#include "nsITextContent.h"
|
2000-12-09 10:28:19 +03:00
|
|
|
#include "nsIScrollableViewProvider.h"
|
1999-01-18 18:14:00 +03:00
|
|
|
|
|
|
|
class nsFormFrame;
|
|
|
|
class nsIView;
|
|
|
|
class nsStyleContext;
|
|
|
|
class nsIHTMLContent;
|
|
|
|
class nsIListControlFrame;
|
2000-12-09 10:28:19 +03:00
|
|
|
class nsIScrollableView;
|
1999-01-18 18:14:00 +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
|
|
|
/**
|
|
|
|
* Child list name indices
|
|
|
|
* @see #GetAdditionalChildListName()
|
|
|
|
*/
|
2000-05-09 09:11:12 +04:00
|
|
|
#define NS_COMBO_FRAME_POPUP_LIST_INDEX (NS_BLOCK_FRAME_ABSOLUTE_LIST_INDEX + 1)
|
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
|
|
|
|
|
|
|
class nsComboboxControlFrame : public nsAreaFrame,
|
1999-01-18 18:14:00 +03:00
|
|
|
public nsIFormControlFrame,
|
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
|
|
|
public nsIComboboxControlFrame,
|
1999-08-26 18:54:07 +04:00
|
|
|
public nsIAnonymousContentCreator,
|
1999-09-15 09:31:31 +04:00
|
|
|
public nsISelectControlFrame,
|
2001-05-30 15:26:21 +04:00
|
|
|
public nsIStatefulFrame,
|
2000-12-09 10:28:19 +03:00
|
|
|
public nsIRollupListener,
|
|
|
|
public nsIScrollableViewProvider
|
1999-01-18 18:14:00 +03:00
|
|
|
{
|
|
|
|
public:
|
1999-12-05 23:43:18 +03:00
|
|
|
friend nsresult NS_NewComboboxControlFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame, PRUint32 aFlags);
|
|
|
|
|
1999-01-18 18:14:00 +03:00
|
|
|
nsComboboxControlFrame();
|
|
|
|
~nsComboboxControlFrame();
|
|
|
|
|
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
|
|
|
// nsISupports
|
1999-01-18 18:14:00 +03:00
|
|
|
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
|
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
|
|
|
|
|
|
|
// nsIAnonymousContentCreator
|
2000-01-22 04:16:50 +03:00
|
|
|
NS_IMETHOD CreateAnonymousContent(nsIPresContext* aPresContext,
|
|
|
|
nsISupportsArray& aChildList);
|
2000-04-19 17:55:17 +04:00
|
|
|
NS_IMETHOD CreateFrameFor(nsIPresContext* aPresContext,
|
|
|
|
nsIContent * aContent,
|
|
|
|
nsIFrame** aFrame);
|
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
|
|
|
|
2001-05-18 03:52:32 +04:00
|
|
|
NS_IMETHOD GetAccessible(nsIAccessible** aAccessible);
|
|
|
|
|
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
|
|
|
// nsIFrame
|
1999-11-24 09:03:41 +03:00
|
|
|
NS_IMETHOD Init(nsIPresContext* aPresContext,
|
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
|
|
|
nsIContent* aContent,
|
|
|
|
nsIFrame* aParent,
|
|
|
|
nsIStyleContext* aContext,
|
|
|
|
nsIFrame* aPrevInFlow);
|
1999-01-18 18:14:00 +03:00
|
|
|
|
1999-11-24 09:03:41 +03:00
|
|
|
NS_IMETHOD Reflow(nsIPresContext* aCX,
|
1999-01-18 18:14:00 +03:00
|
|
|
nsHTMLReflowMetrics& aDesiredSize,
|
|
|
|
const nsHTMLReflowState& aReflowState,
|
|
|
|
nsReflowStatus& aStatus);
|
|
|
|
|
1999-11-24 09:03:41 +03:00
|
|
|
NS_IMETHOD HandleEvent(nsIPresContext* aPresContext,
|
1999-07-29 01:38:08 +04:00
|
|
|
nsGUIEvent* aEvent,
|
1999-11-24 09:03:41 +03:00
|
|
|
nsEventStatus* aEventStatus);
|
1999-07-29 01:38:08 +04:00
|
|
|
|
2000-03-07 18:54:31 +03:00
|
|
|
NS_IMETHOD Paint(nsIPresContext* aPresContext,
|
|
|
|
nsIRenderingContext& aRenderingContext,
|
|
|
|
const nsRect& aDirtyRect,
|
|
|
|
nsFramePaintLayer aWhichLayer);
|
1999-11-02 01:12:45 +03:00
|
|
|
#ifdef NS_DEBUG
|
1999-01-18 18:14:00 +03:00
|
|
|
NS_IMETHOD GetFrameName(nsString& aResult) const;
|
1999-11-02 01:12:45 +03:00
|
|
|
#endif
|
1999-11-24 09:03:41 +03:00
|
|
|
NS_IMETHOD Destroy(nsIPresContext* aPresContext);
|
2000-01-22 04:16:50 +03:00
|
|
|
NS_IMETHOD FirstChild(nsIPresContext* aPresContext,
|
|
|
|
nsIAtom* aListName,
|
|
|
|
nsIFrame** aFirstChild) const;
|
1999-11-24 09:03:41 +03:00
|
|
|
NS_IMETHOD SetInitialChildList(nsIPresContext* aPresContext,
|
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
|
|
|
nsIAtom* aListName,
|
|
|
|
nsIFrame* aChildList);
|
|
|
|
NS_IMETHOD GetAdditionalChildListName(PRInt32 aIndex,
|
|
|
|
nsIAtom** aListName) const;
|
|
|
|
|
2000-03-22 05:43:08 +03:00
|
|
|
NS_IMETHOD GetFrameForPoint(nsIPresContext* aPresContext, const nsPoint& aPoint, nsFramePaintLayer aWhichLayer, nsIFrame** aFrame);
|
1999-08-10 23:25:22 +04: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
|
|
|
// nsIFormControlFrame
|
|
|
|
NS_IMETHOD SetSuggestedSize(nscoord aWidth, nscoord aHeight);
|
|
|
|
NS_IMETHOD GetName(nsString* aName);
|
|
|
|
NS_IMETHOD GetType(PRInt32* aType) const;
|
2000-08-23 21:27:06 +04:00
|
|
|
NS_IMETHOD SetProperty(nsIPresContext* aPresContext, nsIAtom* aName, const nsAReadableString& aValue);
|
|
|
|
NS_IMETHOD GetProperty(nsIAtom* aName, nsAWritableString& aValue);
|
1999-05-14 03:45:40 +04:00
|
|
|
void SetFocus(PRBool aOn, PRBool aRepaint);
|
1999-08-21 04:09:24 +04:00
|
|
|
void ScrollIntoView(nsIPresContext* aPresContext);
|
2000-02-09 22:34:39 +03:00
|
|
|
virtual void InitializeControl(nsIPresContext* aPresContext);
|
1999-01-18 18:14:00 +03:00
|
|
|
virtual PRBool IsSuccessful(nsIFormControlFrame* aSubmitter);
|
|
|
|
virtual void SetFormFrame(nsFormFrame* aFormFrame) { mFormFrame = aFormFrame; }
|
1999-10-26 08:44:41 +04:00
|
|
|
virtual void Reset(nsIPresContext* aPresContext);
|
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
|
|
|
virtual PRInt32 GetMaxNumValues();
|
|
|
|
virtual PRBool GetNamesValues(PRInt32 aMaxNumValues, PRInt32& aNumValues,
|
|
|
|
nsString* aValues, nsString* aNames);
|
1999-01-18 18:14:00 +03:00
|
|
|
NS_IMETHOD GetFont(nsIPresContext* aPresContext,
|
2000-01-25 18:25:46 +03:00
|
|
|
const nsFont*& aFont);
|
1999-01-18 18:14:00 +03:00
|
|
|
NS_IMETHOD GetFormContent(nsIContent*& aContent) const;
|
|
|
|
virtual nscoord GetVerticalBorderWidth(float aPixToTwip) const;
|
|
|
|
virtual nscoord GetHorizontalBorderWidth(float aPixToTwip) const;
|
1999-11-24 09:03:41 +03:00
|
|
|
virtual nscoord GetVerticalInsidePadding(nsIPresContext* aPresContext,
|
1999-09-30 15:36:32 +04:00
|
|
|
float aPixToTwip,
|
1999-01-18 18:14:00 +03:00
|
|
|
nscoord aInnerHeight) const;
|
1999-11-24 09:03:41 +03:00
|
|
|
virtual nscoord GetHorizontalInsidePadding(nsIPresContext* aPresContext,
|
1999-01-18 18:14:00 +03:00
|
|
|
float aPixToTwip,
|
|
|
|
nscoord aInnerWidth,
|
|
|
|
nscoord aCharWidth) const;
|
1999-03-06 22:43:13 +03:00
|
|
|
virtual nsresult RequiresWidget(PRBool &aRequiresWidget);
|
|
|
|
|
1999-10-06 03:43:06 +04:00
|
|
|
NS_IMETHOD SelectionChanged();// Called when the selection has changed.
|
1999-08-26 18:54:07 +04:00
|
|
|
// If the the same item in the list is selected
|
|
|
|
// it is NOT called.
|
|
|
|
|
1999-01-18 18:14:00 +03:00
|
|
|
// nsIFormMouseListener
|
|
|
|
virtual void MouseClicked(nsIPresContext* aPresContext);
|
|
|
|
|
|
|
|
//nsIComboboxControlFrame
|
1999-08-26 18:54:07 +04:00
|
|
|
NS_IMETHOD IsDroppedDown(PRBool * aDoDropDown) { *aDoDropDown = mDroppedDown; return NS_OK; }
|
|
|
|
NS_IMETHOD ShowDropDown(PRBool aDoDropDown);
|
1999-08-23 18:05:37 +04:00
|
|
|
NS_IMETHOD GetDropDown(nsIFrame** aDropDownFrame);
|
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 SetDropDown(nsIFrame* aDropDownFrame);
|
2001-04-09 16:08:40 +04:00
|
|
|
NS_IMETHOD ListWasSelected(nsIPresContext* aPresContext, PRBool aForceUpdate, PRBool aSendEvent);
|
1999-08-26 18:54:07 +04:00
|
|
|
NS_IMETHOD UpdateSelection(PRBool aDoDispatchEvent, PRBool aForceUpdate, PRInt32 aNewIndex);
|
1999-08-31 17:22:40 +04:00
|
|
|
NS_IMETHOD AbsolutelyPositionDropDown();
|
1999-09-14 03:20:50 +04:00
|
|
|
NS_IMETHOD GetAbsoluteRect(nsRect* aRect);
|
2000-12-21 02:25:40 +03:00
|
|
|
NS_IMETHOD GetIndexOfDisplayArea(PRInt32* aSelectedIndex);
|
1999-08-26 18:54:07 +04:00
|
|
|
|
|
|
|
// nsISelectControlFrame
|
1999-10-26 08:44:41 +04:00
|
|
|
NS_IMETHOD AddOption(nsIPresContext* aPresContext, PRInt32 index);
|
|
|
|
NS_IMETHOD RemoveOption(nsIPresContext* aPresContext, PRInt32 index);
|
1999-08-27 07:58:13 +04:00
|
|
|
NS_IMETHOD SetOptionSelected(PRInt32 aIndex, PRBool aValue);
|
1999-09-15 09:31:31 +04:00
|
|
|
NS_IMETHOD GetOptionSelected(PRInt32 aIndex, PRBool* aValue);
|
1999-11-19 18:46:20 +03:00
|
|
|
NS_IMETHOD DoneAddingContent(PRBool aIsDone);
|
2000-04-29 03:24:59 +04:00
|
|
|
NS_IMETHOD OptionDisabled(nsIContent * aContent);
|
2001-06-08 06:34:09 +04:00
|
|
|
NS_IMETHOD MakeSureSomethingIsSelected(nsIPresContext* aPresContext); // Default to option 0
|
1999-01-18 18:14:00 +03:00
|
|
|
|
1999-09-15 09:31:31 +04:00
|
|
|
//nsIStatefulFrame
|
2000-01-14 12:28:54 +03:00
|
|
|
NS_IMETHOD SaveState(nsIPresContext* aPresContext, nsIPresState** aState);
|
|
|
|
NS_IMETHOD RestoreState(nsIPresContext* aPresContext, nsIPresState* aState);
|
1999-09-15 09:31:31 +04:00
|
|
|
|
1999-09-22 01:20:50 +04:00
|
|
|
//nsIRollupListener
|
2000-04-19 17:55:17 +04:00
|
|
|
// NS_DECL_NSIROLLUPLISTENER
|
1999-09-22 01:20:50 +04:00
|
|
|
NS_IMETHOD Rollup();
|
2000-12-09 10:28:19 +03:00
|
|
|
// a combobox should roll up if a mousewheel event happens outside of
|
|
|
|
// the popup area
|
|
|
|
NS_IMETHOD ShouldRollupOnMouseWheelEvent(PRBool *aShouldRollup)
|
|
|
|
{ *aShouldRollup = PR_TRUE; return NS_OK;}
|
2000-05-13 00:23:04 +04:00
|
|
|
|
|
|
|
//NS_IMETHOD ShouldRollupOnMouseWheelEvent(nsIWidget *aWidget, PRBool *aShouldRollup)
|
|
|
|
//{ *aShouldRollup = PR_FALSE; return NS_OK;}
|
1999-09-22 01:20:50 +04:00
|
|
|
|
2000-03-07 18:54:31 +03:00
|
|
|
NS_IMETHOD SetFrameConstructor(nsCSSFrameConstructor *aConstructor)
|
|
|
|
{ mFrameConstructor = aConstructor; return NS_OK;} // not owner - do not addref!
|
1999-09-22 01:20:50 +04:00
|
|
|
|
2000-12-09 10:28:19 +03:00
|
|
|
// nsIScrollableViewProvider
|
|
|
|
NS_IMETHOD GetScrollableView(nsIScrollableView** aView);
|
|
|
|
|
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
|
|
|
protected:
|
2000-03-07 18:54:31 +03:00
|
|
|
NS_IMETHOD CreateDisplayFrame(nsIPresContext* aPresContext);
|
|
|
|
|
|
|
|
#ifdef DO_NEW_REFLOW
|
|
|
|
NS_IMETHOD ReflowItems(nsIPresContext* aPresContext,
|
|
|
|
const nsHTMLReflowState& aReflowState,
|
|
|
|
nsHTMLReflowMetrics& aDesiredSize);
|
|
|
|
#endif
|
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
|
|
|
|
|
|
|
// nsHTMLContainerFrame
|
1999-01-18 18:14:00 +03:00
|
|
|
virtual PRIntn GetSkipSides() const;
|
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
|
|
|
|
|
|
|
// Utilities
|
|
|
|
nsresult ReflowComboChildFrame(nsIFrame* aFrame,
|
1999-11-24 09:03:41 +03:00
|
|
|
nsIPresContext* aPresContext,
|
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
|
|
|
nsHTMLReflowMetrics& aDesiredSize,
|
|
|
|
const nsHTMLReflowState& aReflowState,
|
|
|
|
nsReflowStatus& aStatus,
|
|
|
|
nscoord aAvailableWidth,
|
|
|
|
nscoord aAvailableHeight);
|
|
|
|
|
1999-08-31 17:22:40 +04:00
|
|
|
public:
|
1999-11-24 09:03:41 +03:00
|
|
|
nsresult PositionDropdown(nsIPresContext* aPresContext,
|
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
|
|
|
nscoord aHeight,
|
|
|
|
nsRect aAbsoluteTwipsRect,
|
|
|
|
nsRect aAbsolutePixelRect);
|
1999-08-31 17:22:40 +04:00
|
|
|
protected:
|
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
|
|
|
void ShowPopup(PRBool aShowPopup);
|
|
|
|
void ShowList(nsIPresContext* aPresContext, PRBool aShowList);
|
|
|
|
void SetChildFrameSize(nsIFrame* aFrame, nscoord aWidth, nscoord aHeight);
|
1999-10-26 08:44:41 +04:00
|
|
|
void InitTextStr(nsIPresContext* aPresContext, PRBool aUpdate);
|
1999-11-24 09:03:41 +03:00
|
|
|
nsresult GetPrimaryComboFrame(nsIPresContext* aPresContext, nsIContent* aContent, nsIFrame** aFrame);
|
1999-08-26 18:54:07 +04:00
|
|
|
NS_IMETHOD ToggleList(nsIPresContext* aPresContext);
|
1999-01-18 18:14:00 +03:00
|
|
|
|
2000-03-07 18:54:31 +03:00
|
|
|
void ReflowCombobox(nsIPresContext * aPresContext,
|
|
|
|
const nsHTMLReflowState& aReflowState,
|
|
|
|
nsHTMLReflowMetrics& aDesiredSize,
|
|
|
|
nsReflowStatus& aStatus,
|
|
|
|
nsIFrame * aDisplayFrame,
|
|
|
|
nsIFrame * aDropDownBtn,
|
|
|
|
nscoord& aDisplayWidth,
|
|
|
|
nscoord aBtnWidth,
|
|
|
|
const nsMargin& aBorderPadding,
|
|
|
|
nscoord aFallBackHgt = -1,
|
|
|
|
PRBool aCheckHeight = PR_FALSE);
|
|
|
|
|
|
|
|
nsFrameList mPopupFrames; // additional named child list
|
|
|
|
nsIPresContext* mPresContext; // XXX: Remove the need to cache the pres context.
|
|
|
|
nsFormFrame* mFormFrame; // Parent Form Frame
|
|
|
|
nsString mTextStr; // Current Combo box selection
|
|
|
|
PRInt32 mSelectedIndex; // current selected index
|
|
|
|
nsCOMPtr<nsITextContent> mDisplayContent; // Anonymous content used to display the current selection
|
2000-09-10 02:15:57 +04:00
|
|
|
PRPackedBool mDroppedDown; // Current state of the dropdown list, PR_TRUE is dropped down
|
2000-03-07 18:54:31 +03:00
|
|
|
nsIFrame* mDisplayFrame; // frame to display selection
|
|
|
|
nsIFrame* mButtonFrame; // button frame
|
|
|
|
nsIFrame* mDropdownFrame; // dropdown list frame
|
|
|
|
nsIFrame* mTextFrame; // display area frame
|
|
|
|
nsIListControlFrame * mListControlFrame; // ListControl Interface for the dropdown frame
|
1999-01-18 18:14:00 +03:00
|
|
|
|
2000-02-01 02:59:55 +03:00
|
|
|
|
|
|
|
nsCOMPtr<nsIPresState> mPresState; // Need cache state when list is null
|
|
|
|
|
2000-01-09 04:52:17 +03:00
|
|
|
// Resize Reflow Optimization
|
1999-12-22 22:46:28 +03:00
|
|
|
nsSize mCacheSize;
|
|
|
|
nsSize mCachedMaxElementSize;
|
2000-03-07 18:54:31 +03:00
|
|
|
nsSize mCachedAvailableSize;
|
|
|
|
|
|
|
|
nsSize mCachedUncDropdownSize;
|
|
|
|
nsSize mCachedUncComboSize;
|
|
|
|
|
|
|
|
nscoord mItemDisplayWidth;
|
|
|
|
//nscoord mItemDisplayHeight;
|
|
|
|
nsCSSFrameConstructor* mFrameConstructor;
|
|
|
|
|
2000-09-10 02:15:57 +04:00
|
|
|
PRPackedBool mGoodToGo;
|
2000-05-09 00:32:11 +04:00
|
|
|
|
2001-06-30 04:25:09 +04:00
|
|
|
// make someone to listen to the button. If its programmatically pressed by someone like Accessibility
|
|
|
|
// then open or close the combo box.
|
|
|
|
nsCOMPtr<nsIDOMMouseListener> mButtonListener;
|
|
|
|
|
2000-10-04 17:39:07 +04:00
|
|
|
// static class data member for Bug 32920
|
|
|
|
// only one control can be focused at a time
|
|
|
|
static nsComboboxControlFrame * mFocused;
|
2001-02-23 04:45:45 +03:00
|
|
|
static nscoord mCachedScrollbarWidth;
|
2000-10-04 17:39:07 +04:00
|
|
|
|
2000-03-07 18:54:31 +03:00
|
|
|
#ifdef DO_REFLOW_COUNTER
|
|
|
|
PRInt32 mReflowId;
|
|
|
|
#endif
|
1999-12-22 22:46:28 +03:00
|
|
|
|
1999-01-18 18:14:00 +03:00
|
|
|
private:
|
|
|
|
NS_IMETHOD_(nsrefcnt) AddRef() { return NS_OK; }
|
|
|
|
NS_IMETHOD_(nsrefcnt) Release() { return NS_OK; }
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|