1999-01-18 15:14:00 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
*
|
1999-11-06 03:40:37 +00: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 15:14:00 +00:00
|
|
|
*
|
1999-11-06 03:40:37 +00: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 15:14:00 +00:00
|
|
|
*
|
1999-11-06 03:40:37 +00:00
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is Netscape
|
1999-01-18 15:14:00 +00:00
|
|
|
* Communications Corporation. Portions created by Netscape are
|
1999-11-06 03:40:37 +00:00
|
|
|
* Copyright (C) 1998 Netscape Communications Corporation. All
|
|
|
|
* Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
1999-01-18 15:14:00 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef nsComboboxControlFrame_h___
|
|
|
|
#define nsComboboxControlFrame_h___
|
|
|
|
|
2000-03-07 15:54:31 +00:00
|
|
|
#ifdef DEBUG_evaughan
|
|
|
|
//#define DEBUG_rods
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef DEBUG_rods
|
2000-04-28 23:24:59 +00:00
|
|
|
#define DO_REFLOW_DEBUG
|
|
|
|
#define DO_REFLOW_COUNTER
|
2000-03-15 15:47:11 +00:00
|
|
|
//#define DO_UNCONSTRAINED_CHECK
|
2000-03-07 15:54:31 +00:00
|
|
|
//#define DO_PIXELS
|
|
|
|
//#define DO_NEW_REFLOW
|
|
|
|
#endif
|
2000-01-05 16:42:47 +00: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-14 22:00:24 +00:00
|
|
|
#include "nsAreaFrame.h"
|
1999-01-18 15:14:00 +00: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-14 22:00:24 +00:00
|
|
|
#include "nsVoidArray.h"
|
|
|
|
#include "nsIAnonymousContentCreator.h"
|
1999-08-26 14:54:07 +00:00
|
|
|
#include "nsISelectControlFrame.h"
|
1999-09-15 05:31:31 +00:00
|
|
|
#include "nsIStatefulFrame.h"
|
1999-09-21 21:20:50 +00:00
|
|
|
#include "nsIRollupListener.h"
|
2000-01-31 23:59:55 +00:00
|
|
|
#include "nsIPresState.h"
|
2000-03-07 15:54:31 +00:00
|
|
|
#include "nsCSSFrameConstructor.h"
|
2000-03-07 16:45:21 +00:00
|
|
|
#include "nsITextContent.h"
|
1999-01-18 15:14:00 +00:00
|
|
|
|
|
|
|
class nsFormFrame;
|
|
|
|
class nsIView;
|
|
|
|
class nsStyleContext;
|
|
|
|
class nsIHTMLContent;
|
|
|
|
class nsIListControlFrame;
|
|
|
|
|
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-14 22:00:24 +00:00
|
|
|
/**
|
|
|
|
* Child list name indices
|
|
|
|
* @see #GetAdditionalChildListName()
|
|
|
|
*/
|
|
|
|
#define NS_COMBO_FRAME_POPUP_LIST_INDEX (NS_AREA_FRAME_ABSOLUTE_LIST_INDEX + 1)
|
|
|
|
|
|
|
|
class nsComboboxControlFrame : public nsAreaFrame,
|
1999-01-18 15:14:00 +00: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-14 22:00:24 +00:00
|
|
|
public nsIComboboxControlFrame,
|
1999-08-26 14:54:07 +00:00
|
|
|
public nsIAnonymousContentCreator,
|
1999-09-15 05:31:31 +00:00
|
|
|
public nsISelectControlFrame,
|
1999-09-21 21:20:50 +00:00
|
|
|
public nsIStatefulFrame,
|
|
|
|
public nsIRollupListener
|
1999-01-18 15:14:00 +00:00
|
|
|
{
|
|
|
|
public:
|
1999-12-05 20:43:18 +00:00
|
|
|
friend nsresult NS_NewComboboxControlFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame, PRUint32 aFlags);
|
|
|
|
|
1999-01-18 15:14:00 +00: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-14 22:00:24 +00:00
|
|
|
// nsISupports
|
1999-01-18 15:14:00 +00: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-14 22:00:24 +00:00
|
|
|
|
|
|
|
// nsIAnonymousContentCreator
|
2000-01-22 01:16:50 +00:00
|
|
|
NS_IMETHOD CreateAnonymousContent(nsIPresContext* aPresContext,
|
|
|
|
nsISupportsArray& aChildList);
|
2000-04-19 13:55:17 +00: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-14 22:00:24 +00:00
|
|
|
|
|
|
|
// nsIFrame
|
1999-11-24 06:03:41 +00: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-14 22:00:24 +00:00
|
|
|
nsIContent* aContent,
|
|
|
|
nsIFrame* aParent,
|
|
|
|
nsIStyleContext* aContext,
|
|
|
|
nsIFrame* aPrevInFlow);
|
1999-01-18 15:14:00 +00:00
|
|
|
|
1999-11-24 06:03:41 +00:00
|
|
|
NS_IMETHOD Reflow(nsIPresContext* aCX,
|
1999-01-18 15:14:00 +00:00
|
|
|
nsHTMLReflowMetrics& aDesiredSize,
|
|
|
|
const nsHTMLReflowState& aReflowState,
|
|
|
|
nsReflowStatus& aStatus);
|
|
|
|
|
1999-11-24 06:03:41 +00:00
|
|
|
NS_IMETHOD HandleEvent(nsIPresContext* aPresContext,
|
1999-07-28 21:38:08 +00:00
|
|
|
nsGUIEvent* aEvent,
|
1999-11-24 06:03:41 +00:00
|
|
|
nsEventStatus* aEventStatus);
|
1999-07-28 21:38:08 +00:00
|
|
|
|
2000-03-07 15:54:31 +00:00
|
|
|
NS_IMETHOD Paint(nsIPresContext* aPresContext,
|
|
|
|
nsIRenderingContext& aRenderingContext,
|
|
|
|
const nsRect& aDirtyRect,
|
|
|
|
nsFramePaintLayer aWhichLayer);
|
1999-11-01 22:12:45 +00:00
|
|
|
#ifdef NS_DEBUG
|
1999-01-18 15:14:00 +00:00
|
|
|
NS_IMETHOD GetFrameName(nsString& aResult) const;
|
1999-11-01 22:12:45 +00:00
|
|
|
#endif
|
1999-11-24 06:03:41 +00:00
|
|
|
NS_IMETHOD Destroy(nsIPresContext* aPresContext);
|
2000-01-22 01:16:50 +00:00
|
|
|
NS_IMETHOD FirstChild(nsIPresContext* aPresContext,
|
|
|
|
nsIAtom* aListName,
|
|
|
|
nsIFrame** aFirstChild) const;
|
1999-11-24 06:03:41 +00: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-14 22:00:24 +00:00
|
|
|
nsIAtom* aListName,
|
|
|
|
nsIFrame* aChildList);
|
|
|
|
NS_IMETHOD GetAdditionalChildListName(PRInt32 aIndex,
|
|
|
|
nsIAtom** aListName) const;
|
|
|
|
|
2000-03-22 02:43:08 +00:00
|
|
|
NS_IMETHOD GetFrameForPoint(nsIPresContext* aPresContext, const nsPoint& aPoint, nsFramePaintLayer aWhichLayer, nsIFrame** aFrame);
|
1999-08-10 19:25:22 +00: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-14 22:00:24 +00:00
|
|
|
// nsIFormControlFrame
|
|
|
|
NS_IMETHOD SetSuggestedSize(nscoord aWidth, nscoord aHeight);
|
|
|
|
NS_IMETHOD GetName(nsString* aName);
|
|
|
|
NS_IMETHOD GetType(PRInt32* aType) const;
|
1999-10-26 04:44:41 +00:00
|
|
|
NS_IMETHOD SetProperty(nsIPresContext* aPresContext, nsIAtom* aName, const nsString& aValue);
|
1999-01-25 22:16:27 +00:00
|
|
|
NS_IMETHOD GetProperty(nsIAtom* aName, nsString& aValue);
|
1999-05-13 23:45:40 +00:00
|
|
|
void SetFocus(PRBool aOn, PRBool aRepaint);
|
1999-08-21 00:09:24 +00:00
|
|
|
void ScrollIntoView(nsIPresContext* aPresContext);
|
2000-02-09 19:34:39 +00:00
|
|
|
virtual void InitializeControl(nsIPresContext* aPresContext);
|
1999-01-18 15:14:00 +00:00
|
|
|
virtual PRBool IsSuccessful(nsIFormControlFrame* aSubmitter);
|
|
|
|
virtual void SetFormFrame(nsFormFrame* aFormFrame) { mFormFrame = aFormFrame; }
|
1999-10-26 04:44:41 +00: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-14 22:00:24 +00:00
|
|
|
virtual PRInt32 GetMaxNumValues();
|
|
|
|
virtual PRBool GetNamesValues(PRInt32 aMaxNumValues, PRInt32& aNumValues,
|
|
|
|
nsString* aValues, nsString* aNames);
|
1999-01-18 15:14:00 +00:00
|
|
|
NS_IMETHOD GetFont(nsIPresContext* aPresContext,
|
2000-01-25 15:25:46 +00:00
|
|
|
const nsFont*& aFont);
|
1999-01-18 15:14:00 +00:00
|
|
|
NS_IMETHOD GetFormContent(nsIContent*& aContent) const;
|
|
|
|
virtual nscoord GetVerticalBorderWidth(float aPixToTwip) const;
|
|
|
|
virtual nscoord GetHorizontalBorderWidth(float aPixToTwip) const;
|
1999-11-24 06:03:41 +00:00
|
|
|
virtual nscoord GetVerticalInsidePadding(nsIPresContext* aPresContext,
|
1999-09-30 11:36:32 +00:00
|
|
|
float aPixToTwip,
|
1999-01-18 15:14:00 +00:00
|
|
|
nscoord aInnerHeight) const;
|
1999-11-24 06:03:41 +00:00
|
|
|
virtual nscoord GetHorizontalInsidePadding(nsIPresContext* aPresContext,
|
1999-01-18 15:14:00 +00:00
|
|
|
float aPixToTwip,
|
|
|
|
nscoord aInnerWidth,
|
|
|
|
nscoord aCharWidth) const;
|
1999-03-06 19:43:13 +00:00
|
|
|
virtual nsresult RequiresWidget(PRBool &aRequiresWidget);
|
|
|
|
|
1999-10-05 23:43:06 +00:00
|
|
|
NS_IMETHOD SelectionChanged();// Called when the selection has changed.
|
1999-08-26 14:54:07 +00:00
|
|
|
// If the the same item in the list is selected
|
|
|
|
// it is NOT called.
|
|
|
|
|
1999-01-18 15:14:00 +00:00
|
|
|
// nsIFormMouseListener
|
|
|
|
virtual void MouseClicked(nsIPresContext* aPresContext);
|
|
|
|
|
|
|
|
//nsIComboboxControlFrame
|
1999-08-26 14:54:07 +00:00
|
|
|
NS_IMETHOD IsDroppedDown(PRBool * aDoDropDown) { *aDoDropDown = mDroppedDown; return NS_OK; }
|
|
|
|
NS_IMETHOD ShowDropDown(PRBool aDoDropDown);
|
1999-08-23 14:05:37 +00: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-14 22:00:24 +00:00
|
|
|
NS_IMETHOD SetDropDown(nsIFrame* aDropDownFrame);
|
1999-01-18 15:14:00 +00:00
|
|
|
NS_IMETHOD ListWasSelected(nsIPresContext* aPresContext);
|
1999-08-26 14:54:07 +00:00
|
|
|
NS_IMETHOD UpdateSelection(PRBool aDoDispatchEvent, PRBool aForceUpdate, PRInt32 aNewIndex);
|
1999-08-31 13:22:40 +00:00
|
|
|
NS_IMETHOD AbsolutelyPositionDropDown();
|
1999-09-13 23:20:50 +00:00
|
|
|
NS_IMETHOD GetAbsoluteRect(nsRect* aRect);
|
1999-08-26 14:54:07 +00:00
|
|
|
|
|
|
|
// nsISelectControlFrame
|
1999-10-26 04:44:41 +00:00
|
|
|
NS_IMETHOD AddOption(nsIPresContext* aPresContext, PRInt32 index);
|
|
|
|
NS_IMETHOD RemoveOption(nsIPresContext* aPresContext, PRInt32 index);
|
1999-08-27 03:58:13 +00:00
|
|
|
NS_IMETHOD SetOptionSelected(PRInt32 aIndex, PRBool aValue);
|
1999-09-15 05:31:31 +00:00
|
|
|
NS_IMETHOD GetOptionSelected(PRInt32 aIndex, PRBool* aValue);
|
1999-11-19 15:46:20 +00:00
|
|
|
NS_IMETHOD DoneAddingContent(PRBool aIsDone);
|
2000-04-28 23:24:59 +00:00
|
|
|
NS_IMETHOD OptionDisabled(nsIContent * aContent);
|
1999-01-18 15:14:00 +00:00
|
|
|
|
1999-09-15 05:31:31 +00:00
|
|
|
//nsIStatefulFrame
|
1999-11-02 01:50:15 +00:00
|
|
|
NS_IMETHOD GetStateType(nsIPresContext* aPresContext, nsIStatefulFrame::StateType* aStateType);
|
2000-01-14 09:28:54 +00:00
|
|
|
NS_IMETHOD SaveState(nsIPresContext* aPresContext, nsIPresState** aState);
|
|
|
|
NS_IMETHOD RestoreState(nsIPresContext* aPresContext, nsIPresState* aState);
|
1999-09-15 05:31:31 +00:00
|
|
|
|
1999-09-21 21:20:50 +00:00
|
|
|
//nsIRollupListener
|
2000-04-19 13:55:17 +00:00
|
|
|
// NS_DECL_NSIROLLUPLISTENER
|
1999-09-21 21:20:50 +00:00
|
|
|
NS_IMETHOD Rollup();
|
2000-04-19 13:55:17 +00:00
|
|
|
NS_IMETHOD ShouldRollupOnMouseWheelEvent(nsIWidget *aWidget, PRBool *aShouldRollup)
|
|
|
|
{ *aShouldRollup = PR_FALSE; return NS_OK;}
|
1999-09-21 21:20:50 +00:00
|
|
|
|
2000-03-07 15:54:31 +00:00
|
|
|
NS_IMETHOD SetFrameConstructor(nsCSSFrameConstructor *aConstructor)
|
|
|
|
{ mFrameConstructor = aConstructor; return NS_OK;} // not owner - do not addref!
|
1999-09-21 21:20:50 +00: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-14 22:00:24 +00:00
|
|
|
protected:
|
2000-03-07 15:54:31 +00: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-14 22:00:24 +00:00
|
|
|
|
|
|
|
// nsHTMLContainerFrame
|
1999-01-18 15:14:00 +00: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-14 22:00:24 +00:00
|
|
|
|
|
|
|
// Utilities
|
|
|
|
nsresult ReflowComboChildFrame(nsIFrame* aFrame,
|
1999-11-24 06:03:41 +00: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-14 22:00:24 +00:00
|
|
|
nsHTMLReflowMetrics& aDesiredSize,
|
|
|
|
const nsHTMLReflowState& aReflowState,
|
|
|
|
nsReflowStatus& aStatus,
|
|
|
|
nscoord aAvailableWidth,
|
|
|
|
nscoord aAvailableHeight);
|
|
|
|
|
1999-08-31 13:22:40 +00:00
|
|
|
public:
|
1999-11-24 06:03:41 +00: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-14 22:00:24 +00:00
|
|
|
nscoord aHeight,
|
|
|
|
nsRect aAbsoluteTwipsRect,
|
|
|
|
nsRect aAbsolutePixelRect);
|
1999-08-31 13:22:40 +00: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-14 22:00:24 +00:00
|
|
|
void ShowPopup(PRBool aShowPopup);
|
|
|
|
void ShowList(nsIPresContext* aPresContext, PRBool aShowList);
|
|
|
|
void SetChildFrameSize(nsIFrame* aFrame, nscoord aWidth, nscoord aHeight);
|
1999-10-26 04:44:41 +00:00
|
|
|
void InitTextStr(nsIPresContext* aPresContext, PRBool aUpdate);
|
1999-11-24 06:03:41 +00:00
|
|
|
nsresult GetPrimaryComboFrame(nsIPresContext* aPresContext, nsIContent* aContent, nsIFrame** aFrame);
|
|
|
|
nsIFrame* GetButtonFrame(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-14 22:00:24 +00:00
|
|
|
nsIFrame* GetDropdownFrame();
|
1999-08-26 14:54:07 +00:00
|
|
|
NS_IMETHOD ToggleList(nsIPresContext* aPresContext);
|
1999-11-16 22:47:23 +00:00
|
|
|
NS_IMETHOD MakeSureSomethingIsSelected(nsIPresContext* aPresContext); // Default to option 0
|
1999-01-18 15:14:00 +00:00
|
|
|
|
2000-03-07 15:54:31 +00: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
|
|
|
|
nsIHTMLContent* mButtonContent; // Anonymous content used to popup the dropdown list
|
|
|
|
PRBool mDroppedDown; // Current state of the dropdown list, PR_TRUE is dropped down
|
|
|
|
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
|
|
|
|
PRBool mIgnoreFocus; // Tells the combo to ignore all focus notifications
|
1999-01-18 15:14:00 +00:00
|
|
|
|
2000-01-31 23:59:55 +00:00
|
|
|
|
|
|
|
nsCOMPtr<nsIPresState> mPresState; // Need cache state when list is null
|
|
|
|
|
2000-01-09 01:52:17 +00:00
|
|
|
// Resize Reflow Optimization
|
1999-12-22 19:46:28 +00:00
|
|
|
nsSize mCacheSize;
|
|
|
|
nsSize mCachedMaxElementSize;
|
2000-03-07 15:54:31 +00:00
|
|
|
nsSize mCachedAvailableSize;
|
|
|
|
|
|
|
|
nsSize mCachedUncDropdownSize;
|
|
|
|
nsSize mCachedUncComboSize;
|
|
|
|
|
|
|
|
nscoord mItemDisplayWidth;
|
|
|
|
//nscoord mItemDisplayHeight;
|
|
|
|
nsCSSFrameConstructor* mFrameConstructor;
|
|
|
|
|
|
|
|
#ifdef DO_REFLOW_COUNTER
|
|
|
|
PRInt32 mReflowId;
|
|
|
|
#endif
|
1999-12-22 19:46:28 +00:00
|
|
|
|
1999-01-18 15:14:00 +00:00
|
|
|
private:
|
|
|
|
NS_IMETHOD_(nsrefcnt) AddRef() { return NS_OK; }
|
|
|
|
NS_IMETHOD_(nsrefcnt) Release() { return NS_OK; }
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|