2001-09-29 00:14:13 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
|
|
|
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
1999-01-18 18:14:00 +03:00
|
|
|
*
|
2001-09-29 00:14:13 +04: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
|
|
|
*
|
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.
|
1999-01-18 18:14:00 +03:00
|
|
|
*
|
1999-11-06 06:40:37 +03:00
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
2001-09-29 00:14:13 +04:00
|
|
|
* The Initial Developer of the Original Code is
|
|
|
|
* 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):
|
2001-12-11 09:16:07 +03:00
|
|
|
* Dean Tessman <dean_tessman@hotmail.com>
|
2001-09-29 00:14:13 +04:00
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
|
|
|
* either 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"),
|
|
|
|
* 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
|
|
|
|
* use your version of this file under the terms of the NPL, indicate your
|
|
|
|
* 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
|
|
|
|
* the terms of any one of the NPL, the GPL or the LGPL.
|
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
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
|
|
|
|
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-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"
|
2001-11-02 10:40:01 +03:00
|
|
|
#include "nsIStatefulFrame.h"
|
2004-01-10 01:18:26 +03:00
|
|
|
#include "nsIDOMMouseListener.h"
|
1999-01-18 18:14:00 +03:00
|
|
|
|
|
|
|
class nsIView;
|
|
|
|
class nsStyleContext;
|
|
|
|
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,
|
2000-12-09 10:28:19 +03:00
|
|
|
public nsIRollupListener,
|
2001-11-02 10:40:01 +03:00
|
|
|
public nsIScrollableViewProvider,
|
|
|
|
public nsIStatefulFrame
|
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-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
|
|
|
|
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,
|
2003-02-22 03:32:13 +03:00
|
|
|
nsStyleContext* aContext,
|
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* 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
|
|
|
|
2001-09-19 16:35:19 +04:00
|
|
|
NS_IMETHOD Paint(nsIPresContext* aPresContext,
|
2000-03-07 18:54:31 +03:00
|
|
|
nsIRenderingContext& aRenderingContext,
|
2001-09-19 16:35:19 +04:00
|
|
|
const nsRect& aDirtyRect,
|
|
|
|
nsFramePaintLayer aWhichLayer,
|
|
|
|
PRUint32 aFlags = 0);
|
1999-11-02 01:12:45 +03:00
|
|
|
#ifdef NS_DEBUG
|
2001-11-14 04:33:42 +03:00
|
|
|
NS_IMETHOD GetFrameName(nsAString& aResult) const;
|
1999-11-02 01:12:45 +03:00
|
|
|
#endif
|
1999-11-24 09:03:41 +03:00
|
|
|
NS_IMETHOD Destroy(nsIPresContext* aPresContext);
|
2004-01-09 17:20:53 +03:00
|
|
|
virtual nsIFrame* GetFirstChild(nsIAtom* aListName) 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);
|
2004-01-09 17:20:53 +03:00
|
|
|
virtual nsIAtom* GetAdditionalChildListName(PRInt32 aIndex) 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
|
|
|
|
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);
|
2001-11-02 10:40:01 +03:00
|
|
|
NS_IMETHOD GetName(nsAString* aName);
|
2003-10-31 23:19:18 +03:00
|
|
|
NS_IMETHOD_(PRInt32) GetFormControlType() const;
|
2002-03-24 01:26:36 +03:00
|
|
|
NS_IMETHOD SetProperty(nsIPresContext* aPresContext, nsIAtom* aName, const nsAString& aValue);
|
|
|
|
NS_IMETHOD GetProperty(nsIAtom* aName, nsAString& 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);
|
2001-11-02 10:40:01 +03:00
|
|
|
NS_IMETHOD OnContentReset();
|
|
|
|
|
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
|
|
|
|
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);
|
2002-01-26 02:35:44 +03:00
|
|
|
NS_IMETHOD RollupFromList(nsIPresContext* aPresContext);
|
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);
|
2002-01-26 02:35:44 +03:00
|
|
|
NS_IMETHOD RedisplaySelectedText();
|
2002-02-08 21:35:48 +03:00
|
|
|
NS_IMETHOD SetNeedToFireOnChange(PRBool aNeedToFireOnChange);
|
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-09-15 09:31:31 +04:00
|
|
|
NS_IMETHOD GetOptionSelected(PRInt32 aIndex, PRBool* aValue);
|
2002-03-31 14:14:01 +04:00
|
|
|
NS_IMETHOD DoneAddingChildren(PRBool aIsDone);
|
2001-11-02 10:40:01 +03:00
|
|
|
NS_IMETHOD OnOptionSelected(nsIPresContext* aPresContext,
|
|
|
|
PRInt32 aIndex,
|
|
|
|
PRBool aSelected);
|
2002-01-26 02:35:44 +03:00
|
|
|
NS_IMETHOD OnOptionTextChanged(nsIDOMHTMLOptionElement* option);
|
2001-11-02 10:40:01 +03:00
|
|
|
NS_IMETHOD GetDummyFrame(nsIFrame** aFrame);
|
|
|
|
NS_IMETHOD SetDummyFrame(nsIFrame* aFrame);
|
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
|
|
|
|
2001-12-11 09:16:07 +03:00
|
|
|
// a combobox should not roll up if activated by a mouse activate message (eg. X-mouse)
|
|
|
|
NS_IMETHOD ShouldRollupOnMouseActivate(PRBool *aShouldRollup)
|
|
|
|
{ *aShouldRollup = PR_FALSE; return NS_OK;}
|
|
|
|
|
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
|
2003-04-09 00:50:57 +04:00
|
|
|
NS_IMETHOD GetScrollableView(nsIPresContext* aPresContext, nsIScrollableView** aView);
|
2000-12-09 10:28:19 +03:00
|
|
|
|
2001-11-02 10:40:01 +03:00
|
|
|
//nsIStatefulFrame
|
|
|
|
NS_IMETHOD SaveState(nsIPresContext* aPresContext, nsIPresState** aState);
|
|
|
|
NS_IMETHOD RestoreState(nsIPresContext* aPresContext, nsIPresState* aState);
|
|
|
|
|
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:
|
2002-01-26 02:35:44 +03:00
|
|
|
|
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);
|
2001-11-02 10:40:01 +03:00
|
|
|
void InitTextStr();
|
2002-06-14 10:50:22 +04:00
|
|
|
void CheckFireOnChange();
|
2002-01-26 02:35:44 +03:00
|
|
|
nsresult RedisplayText(PRInt32 aIndex);
|
|
|
|
nsresult ActuallyDisplayText(nsAString& aText, PRBool aNotify);
|
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.
|
|
|
|
nsCOMPtr<nsITextContent> mDisplayContent; // Anonymous content used to display the current selection
|
|
|
|
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-01-09 04:52:17 +03:00
|
|
|
// Resize Reflow Optimization
|
1999-12-22 22:46:28 +03:00
|
|
|
nsSize mCacheSize;
|
2000-03-07 18:54:31 +03:00
|
|
|
nsSize mCachedAvailableSize;
|
2003-01-09 17:26:32 +03:00
|
|
|
nscoord mCachedMaxElementWidth;
|
2002-11-12 22:17:51 +03:00
|
|
|
nscoord mCachedAscent;
|
2000-03-07 18:54:31 +03:00
|
|
|
|
|
|
|
nsSize mCachedUncDropdownSize;
|
|
|
|
nsSize mCachedUncComboSize;
|
|
|
|
|
|
|
|
nscoord mItemDisplayWidth;
|
|
|
|
//nscoord mItemDisplayHeight;
|
|
|
|
nsCSSFrameConstructor* mFrameConstructor;
|
|
|
|
|
2002-02-08 21:35:48 +03:00
|
|
|
PRPackedBool mDroppedDown; // Current state of the dropdown list, PR_TRUE is dropped down
|
2000-09-10 02:15:57 +04:00
|
|
|
PRPackedBool mGoodToGo;
|
2002-02-08 21:35:48 +03:00
|
|
|
PRPackedBool mNeedToFireOnChange;
|
2000-05-09 00:32:11 +04:00
|
|
|
|
2002-02-08 21:35:48 +03:00
|
|
|
PRInt32 mRecentSelectedIndex;
|
2002-01-26 02:35:44 +03:00
|
|
|
PRInt32 mDisplayedIndex;
|
|
|
|
|
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;
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|