зеркало из https://github.com/mozilla/pjs.git
adding methods to set and get the size mode (normal,minimized...). bug 30116 r=scc a=jevering
This commit is contained in:
Родитель
2fab5f234a
Коммит
d785b3735c
|
@ -348,15 +348,27 @@ class nsIWidget : public nsISupports {
|
|||
PRBool aRepaint) = 0;
|
||||
|
||||
/**
|
||||
* Set's the widget's z-index.
|
||||
* Sets the widget's z-index.
|
||||
*/
|
||||
NS_IMETHOD SetZIndex(PRInt32 aZIndex) = 0;
|
||||
|
||||
/**
|
||||
* Get's the widget's z-index.
|
||||
* Gets the widget's z-index.
|
||||
*/
|
||||
NS_IMETHOD GetZIndex(PRInt32* aZIndex) = 0;
|
||||
|
||||
/**
|
||||
* Minimize, maximize or normalize the window size.
|
||||
* Takes a value from nsSizeMode (see nsGUIEvent.h)
|
||||
*/
|
||||
NS_IMETHOD SetSizeMode(PRInt32 aMode) = 0;
|
||||
|
||||
/**
|
||||
* Return size mode (minimized, maximized, normalized).
|
||||
* Returns a value from nsSizeMode (see nsGUIEvent.h)
|
||||
*/
|
||||
NS_IMETHOD GetSizeMode(PRInt32* aMode) = 0;
|
||||
|
||||
/**
|
||||
* Enable or disable this Widget
|
||||
*
|
||||
|
|
|
@ -72,7 +72,8 @@ nsBaseWidget::nsBaseWidget()
|
|||
, mIsDestroying(PR_FALSE)
|
||||
, mOnDestroyCalled(PR_FALSE)
|
||||
, mBounds(0,0,0,0)
|
||||
, mZIndex(0)
|
||||
, mZIndex(0)
|
||||
, mSizeMode(nsSizeMode_Normal)
|
||||
{
|
||||
#ifdef NOISY_WIDGET_LEAKS
|
||||
gNumWidgets++;
|
||||
|
@ -335,6 +336,34 @@ NS_IMETHODIMP nsBaseWidget::GetZIndex(PRInt32* aZIndex)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
//
|
||||
// Maximize, minimize or restore the window. The BaseWidget implementation
|
||||
// merely stores the state.
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
NS_IMETHODIMP nsBaseWidget::SetSizeMode(PRInt32 aMode) {
|
||||
|
||||
if (aMode == nsSizeMode_Normal || aMode == nsSizeMode_Minimized ||
|
||||
aMode == nsSizeMode_Maximized) {
|
||||
|
||||
mSizeMode = (nsSizeMode) aMode;
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_ERROR_ILLEGAL_VALUE;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
//
|
||||
// Get the size mode (minimized, maximized, that sort of thing...)
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
NS_IMETHODIMP nsBaseWidget::GetSizeMode(PRInt32* aMode) {
|
||||
|
||||
*aMode = mSizeMode;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
//
|
||||
// Get the foreground color
|
||||
|
|
|
@ -69,6 +69,9 @@ public:
|
|||
NS_IMETHOD SetZIndex(PRInt32 aZIndex);
|
||||
NS_IMETHOD GetZIndex(PRInt32* aZIndex);
|
||||
|
||||
NS_IMETHOD SetSizeMode(PRInt32 aMode);
|
||||
NS_IMETHOD GetSizeMode(PRInt32* aMode);
|
||||
|
||||
virtual nscolor GetForegroundColor(void);
|
||||
NS_IMETHOD SetForegroundColor(const nscolor &aColor);
|
||||
virtual nscolor GetBackgroundColor(void);
|
||||
|
@ -140,6 +143,7 @@ protected:
|
|||
PRBool mOnDestroyCalled;
|
||||
nsRect mBounds;
|
||||
PRInt32 mZIndex;
|
||||
nsSizeMode mSizeMode;
|
||||
|
||||
// keep the list of children
|
||||
nsCOMPtr<nsISupportsArray> mChildren;
|
||||
|
|
Загрузка…
Ссылка в новой задаче