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
|
|
|
*
|
|
|
|
* The Original Code is Mozilla Communicator client code.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is Netscape Communications
|
1999-11-06 06:40:37 +03:00
|
|
|
* Corporation. Portions created by Netscape are
|
|
|
|
* Copyright (C) 1998 Netscape Communications Corporation. All
|
|
|
|
* Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
1999-01-18 18:14:00 +03:00
|
|
|
*/
|
|
|
|
#ifndef nsListControlFrame_h___
|
|
|
|
#define nsListControlFrame_h___
|
|
|
|
|
2000-03-03 07:28:59 +03:00
|
|
|
#ifdef DEBUG_evaughan
|
|
|
|
//#define DEBUG_rods
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef DEBUG_rods
|
2000-03-18 17:17:34 +03:00
|
|
|
#define DO_REFLOW_DEBUG
|
|
|
|
#define DO_REFLOW_COUNTER
|
2000-03-03 07:28:59 +03:00
|
|
|
//#define DO_UNCONSTRAINED_CHECK
|
|
|
|
//#define DO_PIXELS
|
|
|
|
#endif
|
|
|
|
|
1999-01-18 18:14:00 +03:00
|
|
|
#include "nsScrollFrame.h"
|
|
|
|
#include "nsIFormControlFrame.h"
|
|
|
|
#include "nsIListControlFrame.h"
|
1999-08-26 18:54:07 +04:00
|
|
|
#include "nsISelectControlFrame.h"
|
|
|
|
#include "nsIDOMMouseListener.h"
|
|
|
|
#include "nsIDOMMouseMotionListener.h"
|
1999-08-27 18:42:27 +04:00
|
|
|
#include "nsIDOMKeyListener.h"
|
1999-09-15 09:31:31 +04:00
|
|
|
#include "nsIStatefulFrame.h"
|
2000-01-14 12:28:54 +03:00
|
|
|
#include "nsIPresState.h"
|
1999-01-18 18:14:00 +03:00
|
|
|
|
|
|
|
class nsIDOMHTMLSelectElement;
|
|
|
|
class nsIDOMHTMLCollection;
|
|
|
|
class nsIDOMHTMLOptionElement;
|
|
|
|
class nsIComboboxControlFrame;
|
1999-06-22 00:41:56 +04:00
|
|
|
class nsIViewManager;
|
1999-08-26 18:54:07 +04:00
|
|
|
class nsIPresContext;
|
2000-02-15 18:04:38 +03:00
|
|
|
class nsVoidArray;
|
2000-03-15 18:55:30 +03:00
|
|
|
class nsIScrollableView;
|
1999-01-18 18:14:00 +03:00
|
|
|
|
|
|
|
/**
|
1999-05-28 01:17:10 +04:00
|
|
|
* Frame-based listbox.
|
1999-01-18 18:14:00 +03:00
|
|
|
*/
|
1999-05-28 01:17:10 +04:00
|
|
|
|
1999-01-18 18:14:00 +03:00
|
|
|
class nsListControlFrame : public nsScrollFrame,
|
1999-03-23 00:32:12 +03:00
|
|
|
public nsIFormControlFrame,
|
1999-08-26 18:54:07 +04:00
|
|
|
public nsIListControlFrame,
|
|
|
|
public nsIDOMMouseListener,
|
|
|
|
public nsIDOMMouseMotionListener,
|
1999-08-27 18:42:27 +04:00
|
|
|
public nsIDOMKeyListener,
|
1999-11-16 04:20:04 +03:00
|
|
|
public nsISelectControlFrame,
|
|
|
|
public nsIStatefulFrame
|
1999-01-18 18:14:00 +03:00
|
|
|
{
|
|
|
|
public:
|
1999-12-05 02:49:50 +03:00
|
|
|
friend nsresult NS_NewListControlFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
|
1999-01-18 18:14:00 +03:00
|
|
|
|
|
|
|
// nsISupports
|
1999-08-31 17:22:50 +04:00
|
|
|
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
|
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
|
|
|
// nsIFrame
|
1999-11-24 09:03:41 +03:00
|
|
|
NS_IMETHOD HandleEvent(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
|
|
|
nsGUIEvent* aEvent,
|
1999-11-24 09:03:41 +03:00
|
|
|
nsEventStatus* aEventStatus);
|
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
|
|
|
|
1999-11-24 09:03:41 +03:00
|
|
|
NS_IMETHOD SetInitialChildList(nsIPresContext* aPresContext,
|
1999-01-18 18:14:00 +03:00
|
|
|
nsIAtom* aListName,
|
|
|
|
nsIFrame* aChildList);
|
1999-04-13 02:14:31 +04: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 Init(nsIPresContext* aPresContext,
|
1999-01-18 18:14:00 +03:00
|
|
|
nsIContent* aContent,
|
1999-01-22 18:32:57 +03:00
|
|
|
nsIFrame* aParent,
|
1999-02-25 06:27:57 +03:00
|
|
|
nsIStyleContext* aContext,
|
|
|
|
nsIFrame* aPrevInFlow);
|
1999-01-18 18:14:00 +03:00
|
|
|
|
1999-11-24 09:03:41 +03:00
|
|
|
NS_IMETHOD DidReflow(nsIPresContext* aPresContext, nsDidReflowStatus aStatus);
|
1999-10-26 08:44:41 +04:00
|
|
|
NS_IMETHOD MoveTo(nsIPresContext* aPresContext, nscoord aX, nscoord aY);
|
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
|
|
|
// nsIFormControlFrame
|
|
|
|
NS_IMETHOD GetType(PRInt32* aType) const;
|
|
|
|
NS_IMETHOD GetName(nsString* aName);
|
1999-10-26 08:44:41 +04:00
|
|
|
NS_IMETHOD SetProperty(nsIPresContext* aPresContext, nsIAtom* aName, const nsString& aValue);
|
1999-01-26 01:16:27 +03:00
|
|
|
NS_IMETHOD GetProperty(nsIAtom* aName, nsString& aValue);
|
fixed bugs #6303, #6753, #6756, #6759
Re-wrote nsComboboxFrame.
removed the obsolete nsHTMLAtoms: comboText,comoTextSelected,comTextSelectedFocus,dropDownVisible,
dropdownHidden, dropDownBtnOut, dropDownBtnPressed,
Added nsHTMLAtoms::combobox, nsLayoutAtoms::popupList
Renamed dropDownList to dropDownListPseudo
Added "arrow.gif" as to be used the background-image for the combobox button
ua.css - added rules for select to differentiate between comboboxes and listboxes.
Added style rules to more closely match the XPTOOLKIT XPWidgets look.
removed the following :-moz-combobox-text, -moz-combobox-textselected
nsIFormControlFrame.h - Added SetSuggestedSize method.
nsButtonControlFrame - Implemented SetSuggestedSize.
nsCSSFrameConstructor.cpp - Rewrote ConstructSelectFrame.
nsIWidget.h -Added GetAbsoluteBounds method.
nsWindow.cpp - Implemented GetAbsoluteBounds.
1999-07-15 02:00:24 +04:00
|
|
|
NS_IMETHOD GetMultiple(PRBool* aResult, nsIDOMHTMLSelectElement* aSelect = nsnull);
|
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 void SetFocus(PRBool aOn = PR_TRUE, PRBool aRepaint = PR_FALSE);
|
1999-08-21 04:09:24 +04:00
|
|
|
virtual void ScrollIntoView(nsIPresContext* aPresContext);
|
1999-01-18 18:14:00 +03:00
|
|
|
virtual void MouseClicked(nsIPresContext* aPresContext);
|
1999-10-26 08:44:41 +04:00
|
|
|
virtual void Reset(nsIPresContext* aPresContext);
|
1999-01-18 18:14:00 +03:00
|
|
|
virtual PRBool IsSuccessful(nsIFormControlFrame* aSubmitter);
|
|
|
|
virtual PRInt32 GetMaxNumValues();
|
|
|
|
virtual PRBool GetNamesValues(PRInt32 aMaxNumValues, PRInt32& aNumValues,
|
|
|
|
nsString* aValues, nsString* aNames);
|
|
|
|
virtual void SetFormFrame(nsFormFrame* aFrame);
|
1999-11-24 09:03:41 +03:00
|
|
|
virtual nscoord GetVerticalInsidePadding(nsIPresContext* aPresContext,
|
1999-09-30 15:36:44 +04:00
|
|
|
float aPixToTwip,
|
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 aInnerHeight) const;
|
1999-11-24 09:03:41 +03:00
|
|
|
virtual nscoord GetHorizontalInsidePadding(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
|
|
|
float aPixToTwip,
|
|
|
|
nscoord aInnerWidth,
|
|
|
|
nscoord aCharWidth) const;
|
|
|
|
virtual nsresult RequiresWidget(PRBool &aRequiresWidget);
|
|
|
|
|
|
|
|
// nsHTMLContainerFrame
|
|
|
|
virtual PRIntn GetSkipSides() const;
|
|
|
|
|
|
|
|
// nsIListControlFrame
|
1999-01-18 18:14:00 +03:00
|
|
|
NS_IMETHOD SetComboboxFrame(nsIFrame* aComboboxFrame);
|
1999-08-26 18:54:07 +04:00
|
|
|
NS_IMETHOD GetSelectedIndex(PRInt32* aIndex);
|
1999-01-18 18:14:00 +03:00
|
|
|
NS_IMETHOD GetSelectedItem(nsString & aStr);
|
1999-10-26 08:44:41 +04:00
|
|
|
NS_IMETHOD CaptureMouseEvents(nsIPresContext* aPresContext, PRBool aGrabMouseEvents);
|
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 GetMaximumSize(nsSize &aSize);
|
|
|
|
NS_IMETHOD SetSuggestedSize(nscoord aWidth, nscoord aHeight);
|
1999-07-21 02:32:41 +04:00
|
|
|
NS_IMETHOD GetNumberOfOptions(PRInt32* aNumOptions);
|
1999-10-26 08:44:41 +04:00
|
|
|
NS_IMETHOD SyncViewWithFrame(nsIPresContext* aPresContext);
|
1999-09-08 18:27:38 +04:00
|
|
|
NS_IMETHOD AboutToDropDown();
|
1999-10-01 18:30:33 +04:00
|
|
|
NS_IMETHOD AboutToRollup();
|
1999-10-12 12:47:29 +04:00
|
|
|
NS_IMETHOD UpdateSelection(PRBool aDoDispatchEvent, PRBool aForceUpdate, nsIContent* aContent);
|
2000-02-12 19:21:37 +03:00
|
|
|
NS_IMETHOD SetPresState(nsIPresState * aState) { mPresState = aState; return NS_OK;}
|
2000-03-03 07:28:59 +03:00
|
|
|
NS_IMETHOD SetOverrideReflowOptimization(PRBool aValue) { mOverrideReflowOpt = aValue; return NS_OK; }
|
2000-03-18 17:17:34 +03:00
|
|
|
NS_IMETHOD GetOptionsContainer(nsIPresContext* aPresContext, nsIFrame** aFrame);
|
2000-03-03 07:28:59 +03:00
|
|
|
|
|
|
|
NS_IMETHOD SaveStateInternal(nsIPresContext* aPresContext, nsIPresState** aState);
|
|
|
|
NS_IMETHOD RestoreStateInternal(nsIPresContext* aPresContext, nsIPresState* aState);
|
1999-01-18 18:14:00 +03:00
|
|
|
|
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);
|
1999-09-15 09:31:31 +04:00
|
|
|
|
|
|
|
//nsIStatefulFrame
|
1999-11-02 04:50:15 +03:00
|
|
|
NS_IMETHOD GetStateType(nsIPresContext* aPresContext, nsIStatefulFrame::StateType* aStateType);
|
2000-01-14 12:28:54 +03:00
|
|
|
NS_IMETHOD SaveState(nsIPresContext* aPresContext, nsIPresState** aState);
|
|
|
|
NS_IMETHOD RestoreState(nsIPresContext* aPresContext, nsIPresState* aState);
|
1999-08-26 18:54:07 +04:00
|
|
|
|
|
|
|
//nsIDOMEventListener
|
1999-08-27 18:42:27 +04:00
|
|
|
virtual nsresult MouseDown(nsIDOMEvent* aMouseEvent);
|
|
|
|
virtual nsresult MouseUp(nsIDOMEvent* aMouseEvent);
|
1999-08-26 18:54:07 +04:00
|
|
|
virtual nsresult MouseClick(nsIDOMEvent* aMouseEvent) { return NS_OK; }
|
|
|
|
virtual nsresult MouseDblClick(nsIDOMEvent* aMouseEvent) { return NS_OK; }
|
|
|
|
virtual nsresult MouseOver(nsIDOMEvent* aMouseEvent) { return NS_OK; }
|
|
|
|
virtual nsresult MouseOut(nsIDOMEvent* aMouseEvent) { return NS_OK; }
|
|
|
|
virtual nsresult HandleEvent(nsIDOMEvent* aEvent) { return NS_OK; }
|
|
|
|
|
|
|
|
//nsIDOMEventMotionListener
|
|
|
|
virtual nsresult MouseMove(nsIDOMEvent* aMouseEvent);
|
2000-03-15 18:55:30 +03:00
|
|
|
virtual nsresult DragMove(nsIDOMEvent* aMouseEvent);
|
1999-08-26 18:54:07 +04:00
|
|
|
|
1999-08-27 18:42:27 +04:00
|
|
|
//nsIDOMKeyListener
|
|
|
|
virtual nsresult KeyDown(nsIDOMEvent* aKeyEvent);
|
|
|
|
virtual nsresult KeyUp(nsIDOMEvent* aKeyEvent) { return NS_OK; }
|
1999-09-30 15:36:44 +04:00
|
|
|
virtual nsresult KeyPress(nsIDOMEvent* aKeyEvent);
|
1999-08-26 18:54:07 +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
|
|
|
// Static Methods
|
1999-01-18 18:14:00 +03:00
|
|
|
static nsIDOMHTMLSelectElement* GetSelect(nsIContent * aContent);
|
|
|
|
static nsIDOMHTMLCollection* GetOptions(nsIContent * aContent, nsIDOMHTMLSelectElement* aSelect = nsnull);
|
1999-08-27 18:42:27 +04:00
|
|
|
static nsIDOMHTMLOptionElement* GetOption(nsIDOMHTMLCollection& aOptions, PRInt32 aIndex);
|
|
|
|
static nsIContent* GetOptionAsContent(nsIDOMHTMLCollection* aCollection,PRInt32 aIndex);
|
|
|
|
static PRBool GetOptionValue(nsIDOMHTMLCollection& aCollecton, PRInt32 aIndex, nsString& aValue);
|
1999-01-18 18:14:00 +03:00
|
|
|
|
1999-06-22 00:41:56 +04:00
|
|
|
protected:
|
1999-11-12 01:13:33 +03:00
|
|
|
|
1999-08-26 18:54:07 +04:00
|
|
|
NS_IMETHOD GetSelectedIndexFromDOM(PRInt32* aIndex); // from DOM
|
1999-09-08 18:27:38 +04:00
|
|
|
NS_IMETHOD IsTargetOptionDisabled(PRBool &aIsDisabled);
|
1999-11-12 01:13:33 +03:00
|
|
|
nsresult ScrollToFrame(nsIContent * aOptElement);
|
2000-01-11 23:36:37 +03:00
|
|
|
PRBool IsClickingInCombobox(nsIDOMEvent* aMouseEvent);
|
1999-09-08 18:27:38 +04:00
|
|
|
|
1999-01-18 18:14:00 +03:00
|
|
|
nsListControlFrame();
|
|
|
|
virtual ~nsListControlFrame();
|
|
|
|
|
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
|
|
|
// nsScrollFrame overrides
|
1999-06-22 00:41:56 +04:00
|
|
|
// Override the widget created for the list box so a Borderless top level widget is created
|
|
|
|
// for drop-down lists.
|
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 nsresult CreateScrollingViewWidget(nsIView* aView,const nsStylePosition* aPosition);
|
1999-10-26 08:44:41 +04:00
|
|
|
virtual nsresult GetScrollingParentView(nsIPresContext* aPresContext,
|
|
|
|
nsIFrame* aParent,
|
|
|
|
nsIView** aParentView);
|
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
|
|
|
PRInt32 GetNumberOfOptions();
|
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
|
|
|
// Utility methods
|
1999-07-21 02:32:41 +04:00
|
|
|
nsresult GetSizeAttribute(PRInt32 *aSize);
|
|
|
|
PRInt32 GetNumberOfSelections();
|
1999-08-26 18:54:07 +04:00
|
|
|
nsIContent* GetOptionFromContent(nsIContent *aContent);
|
1999-08-27 18:42:27 +04:00
|
|
|
nsresult GetIndexFromDOMEvent(nsIDOMEvent* aMouseEvent, PRInt32& aOldIndex, PRInt32& aCurIndex);
|
1999-08-26 18:54:07 +04:00
|
|
|
PRInt32 GetSelectedIndexFromContent(nsIContent *aContent);
|
1999-08-27 18:42:27 +04:00
|
|
|
nsIContent* GetOptionContent(PRInt32 aIndex);
|
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
|
|
|
PRBool IsContentSelected(nsIContent* aContent);
|
1999-08-27 18:42:27 +04:00
|
|
|
PRBool IsContentSelectedByIndex(PRInt32 aIndex);
|
1999-08-27 07:58:13 +04:00
|
|
|
void SetContentSelected(PRInt32 aIndex, PRBool aSelected);
|
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 GetViewOffset(nsIViewManager* aManager, nsIView* aView, nsPoint& aPoint);
|
|
|
|
nsresult Deselect();
|
|
|
|
nsIFrame *GetOptionFromChild(nsIFrame* aParentFrame);
|
|
|
|
PRBool IsAncestor(nsIView* aAncestor, nsIView* aChild);
|
1999-06-22 00:41:56 +04:00
|
|
|
nsIView* GetViewFor(nsIWidget* aWidget);
|
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
|
|
|
PRBool IsInDropDownMode();
|
|
|
|
PRBool IsOptionElement(nsIContent* aContent);
|
|
|
|
PRBool IsOptionElementFrame(nsIFrame *aFrame);
|
1999-05-14 03:45:40 +04:00
|
|
|
nsIFrame *GetSelectableFrame(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
|
|
|
void DisplaySelected(nsIContent* aContent);
|
|
|
|
void DisplayDeselected(nsIContent* aContent);
|
1999-10-26 08:44:41 +04:00
|
|
|
void ForceRedraw(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
|
|
|
PRBool IsOptionGroup(nsIFrame* aFrame);
|
|
|
|
void SingleSelection();
|
|
|
|
void MultipleSelection(PRBool aIsShift, PRBool aIsControl);
|
|
|
|
void SelectIndex(PRInt32 aIndex);
|
|
|
|
void ToggleSelected(PRInt32 aIndex);
|
|
|
|
void ClearSelection();
|
|
|
|
void ExtendedSelection(PRInt32 aStartIndex, PRInt32 aEndIndex, PRBool aDoInvert, PRBool aSetValue);
|
1999-10-01 18:30:33 +04:00
|
|
|
void ResetSelectedItem();
|
1999-11-12 01:13:33 +03:00
|
|
|
PRBool CheckIfAllFramesHere();
|
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
|
|
|
|
|
|
|
PRBool HasSameContent(nsIFrame* aFrame1, nsIFrame* aFrame2);
|
1999-08-26 18:54:07 +04:00
|
|
|
void HandleListSelection(nsIDOMEvent * aDOMEvent);
|
1999-08-19 18:11:28 +04:00
|
|
|
PRInt32 GetSelectedIndexFromFrame(nsIFrame *aHitFrame);
|
2000-02-09 22:34:39 +03:00
|
|
|
PRBool IsLeftButton(nsIDOMEvent* aMouseEvent);
|
1999-10-06 03:43:06 +04:00
|
|
|
|
2000-03-15 18:55:30 +03:00
|
|
|
void GetScrollableView(nsIScrollableView*& aScrollableView);
|
|
|
|
|
1999-10-06 03:43:06 +04:00
|
|
|
// onChange detection
|
|
|
|
nsresult SelectionChanged(nsIContent* aContent);
|
|
|
|
|
1999-01-18 18:14:00 +03:00
|
|
|
// Data Members
|
|
|
|
nsFormFrame* mFormFrame;
|
|
|
|
PRInt32 mSelectedIndex;
|
1999-08-26 18:54:07 +04:00
|
|
|
PRInt32 mOldSelectedIndex;
|
1999-09-08 18:27:38 +04:00
|
|
|
PRInt32 mSelectedIndexWhenPoppedDown;
|
1999-01-18 18:14:00 +03:00
|
|
|
PRInt32 mStartExtendedIndex;
|
|
|
|
PRInt32 mEndExtendedIndex;
|
|
|
|
PRBool mIsInitializedFromContent;
|
1999-05-28 01:17:10 +04:00
|
|
|
nsIComboboxControlFrame *mComboboxFrame;
|
1999-05-29 01:12:09 +04:00
|
|
|
PRBool mButtonDown;
|
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 mMaxWidth;
|
|
|
|
nscoord mMaxHeight;
|
|
|
|
PRBool mIsCapturingMouseEvents;
|
2000-02-15 18:04:38 +03:00
|
|
|
|
|
|
|
nsVoidArray * mSelectionCache;
|
|
|
|
PRInt32 mSelectionCacheLength;
|
1999-08-26 18:54:07 +04:00
|
|
|
|
1999-11-12 01:13:33 +03:00
|
|
|
PRBool mIsAllContentHere;
|
|
|
|
PRBool mIsAllFramesHere;
|
|
|
|
PRBool mHasBeenInitialized;
|
2000-03-03 07:28:59 +03:00
|
|
|
|
|
|
|
PRBool mOverrideReflowOpt;
|
1999-11-12 01:13:33 +03:00
|
|
|
|
2000-04-19 17:55:17 +04:00
|
|
|
PRInt32 mDelayedIndexSetting;
|
|
|
|
PRBool mDelayedValueSetting;
|
|
|
|
|
1999-08-26 18:54:07 +04:00
|
|
|
nsIPresContext* mPresContext; // XXX: Remove the need to cache the pres context.
|
1999-07-29 01:38:08 +04:00
|
|
|
|
2000-02-12 19:21:37 +03:00
|
|
|
nsCOMPtr<nsIPresState> mPresState; // Need cache state when list is null
|
|
|
|
|
1999-07-29 01:38:08 +04:00
|
|
|
// XXX temprary only until full system mouse capture works
|
|
|
|
PRBool mIsScrollbarVisible;
|
1999-08-31 17:22:50 +04:00
|
|
|
|
2000-01-09 04:41:11 +03:00
|
|
|
//Resize Reflow OpitmizationSize;
|
|
|
|
nsSize mCacheSize;
|
|
|
|
nsSize mCachedMaxElementSize;
|
2000-03-03 07:28:59 +03:00
|
|
|
nsSize mCachedUnconstrainedSize;
|
|
|
|
nsSize mCachedAvailableSize;
|
|
|
|
|
|
|
|
#ifdef DO_REFLOW_COUNTER
|
|
|
|
PRInt32 mReflowId;
|
|
|
|
#endif
|
2000-01-09 04:41:11 +03:00
|
|
|
|
1999-08-31 17:22:50 +04:00
|
|
|
private:
|
|
|
|
NS_IMETHOD_(nsrefcnt) AddRef() { return NS_OK; }
|
|
|
|
NS_IMETHOD_(nsrefcnt) Release() { return NS_OK; }
|
1999-01-18 18:14:00 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* nsListControlFrame_h___ */
|
|
|
|
|