nsText* removed unused class variables.

nsWidget use the nsLookAndFeel values instead of defining the colors again.
This commit is contained in:
pavlov%pavlov.net 1998-12-06 04:31:13 +00:00
parent 98d8b3260b
commit 120268aa09
5 changed files with 13 additions and 50 deletions

View File

@ -44,10 +44,6 @@ public:
protected:
NS_METHOD CreateNative(GtkWidget *parentWindow);
private:
PRBool mMakeReadOnly;
};
#endif // nsTextAreaWidget_h__

View File

@ -37,10 +37,7 @@ NS_IMPL_RELEASE(nsTextWidget)
// nsTextWidget constructor
//
//-------------------------------------------------------------------------
nsTextWidget::nsTextWidget() : nsTextHelper(),
mIsPasswordCallBacksInstalled(PR_FALSE),
mMakeReadOnly(PR_FALSE),
mMakePassword(PR_FALSE)
nsTextWidget::nsTextWidget() : nsTextHelper()
{
}
@ -62,7 +59,6 @@ NS_METHOD nsTextWidget::CreateNative(GtkWidget *parentWindow)
{
mWidget = gtk_entry_new();
gtk_widget_set_name(mWidget, "nsTextWidget");
gtk_editable_set_editable(GTK_EDITABLE(mWidget), mMakeReadOnly?PR_FALSE:PR_TRUE);
gtk_signal_connect(GTK_OBJECT(mWidget),
"key_release_event",
GTK_SIGNAL_FUNC(nsGtkWidget_Text_Callback),
@ -106,30 +102,3 @@ PRBool nsTextWidget::OnResize(nsSizeEvent &aEvent)
{
return PR_FALSE;
}
//--------------------------------------------------------------
NS_METHOD nsTextWidget::SetPassword(PRBool aIsPassword)
{
if (mWidget == nsnull && aIsPassword) {
mMakePassword = PR_TRUE;
return NS_OK;
}
gtk_entry_set_visibility(GTK_ENTRY(mWidget), aIsPassword);
#if 0
if (aIsPassword) {
if (!mIsPasswordCallBacksInstalled) {
XtAddCallback(mWidget, XmNmodifyVerifyCallback, nsXtWidget_Text_Callback, NULL);
XtAddCallback(mWidget, XmNactivateCallback, nsXtWidget_Text_Callback, NULL);
mIsPasswordCallBacksInstalled = PR_TRUE;
}
} else {
if (mIsPasswordCallBacksInstalled) {
XtRemoveCallback(mWidget, XmNmodifyVerifyCallback, nsXtWidget_Text_Callback, NULL);
XtRemoveCallback(mWidget, XmNactivateCallback, nsXtWidget_Text_Callback, NULL);
mIsPasswordCallBacksInstalled = PR_FALSE;
}
}
#endif
nsTextHelper::SetPassword(aIsPassword);
return NS_OK;
}

View File

@ -24,11 +24,6 @@
#include "nsITextWidget.h"
typedef struct _PasswordData {
nsString mPassword;
PRBool mIgnore;
} PasswordData;
/**
* Native Motif single line edit control wrapper.
*/
@ -45,17 +40,9 @@ public:
virtual PRBool OnPaint(nsPaintEvent & aEvent);
virtual PRBool OnResize(nsSizeEvent &aEvent);
NS_IMETHOD SetPassword(PRBool aIsPassword);
protected:
NS_IMETHOD CreateNative(GtkWidget *parentWindow);
PRBool mIsPasswordCallBacksInstalled;
private:
PRBool mMakeReadOnly;
PRBool mMakePassword;
};
#endif // nsTextWidget_h__

View File

@ -29,13 +29,21 @@
g.green=NS_GET_G(n); \
g.blue=NS_GET_R(n);
static NS_DEFINE_IID(kILookAndFeelIID, NS_ILOOKANDFEEL_IID);
static NS_DEFINE_IID(kLookAndFeelCID, NS_LOOKANDFEEL_CID);
//#define DBG 1
nsWidget::nsWidget()
{
// XXX Shouldn't this be done in nsBaseWidget?
NS_INIT_REFCNT();
mBackground = NS_RGB(214,214,214);
// get the proper color from the look and feel code
nsILookAndFeel * lookAndFeel;
if (NS_OK == nsRepository::CreateInstance(kLookAndFeelCID, nsnull, kILookAndFeelIID, (void**)&lookAndFeel)) {
lookAndFeel->GetColor(nsILookAndFeel::eColor_WindowBackground, mBackground);
}
mGC = nsnull;
mWidget = nsnull;
mParent = nsnull;

View File

@ -22,10 +22,13 @@
#include "nsBaseWidget.h"
#include "nsToolkit.h"
#include "nsIAppShell.h"
#include "nsWidgetsCID.h"
#include "nsIMouseListener.h"
#include "nsIEventListener.h"
#include "nsLookAndFeel.h"
#include <gtk/gtk.h>
#ifndef GTK_HAVE_FEATURES_1_1_6
#include "gtklayout.h"