Added fix in nsCheckButton for IRIX build. Made OnPaint and OnResize virtual

in nsWindow.h, this fixes a bug when bringing up Sample5.
This commit is contained in:
kmcclusk%netscape.com 1998-09-17 15:31:18 +00:00
parent 52eb548808
commit 28b895b957
4 changed files with 15 additions and 4 deletions

View File

@ -38,6 +38,7 @@ NS_IMPL_RELEASE(nsButton)
//-------------------------------------------------------------------------
nsButton::nsButton() : nsWindow() , nsIButton()
{
printf("BUTTON CONSTRUCTED\n");
NS_INIT_REFCNT();
}
@ -50,6 +51,7 @@ void nsButton::Create(nsIWidget *aParent,
nsIToolkit *aToolkit,
nsWidgetInitData *aInitData)
{
printf("BUTTON CREATED\n");
aParent->AddChild(this);
Widget parentWidget = nsnull;
@ -88,6 +90,8 @@ void nsButton::Create(nsNativeWidget aParent,
nsIToolkit *aToolkit,
nsWidgetInitData *aInitData)
{
printf("BAD BUTTON CREATE\n");
}
//-------------------------------------------------------------------------

View File

@ -229,6 +229,7 @@ NS_METHOD nsCheckButton::SetLabel(const nsString& aText)
XtVaSetValues(mWidget, XmNlabelString, str, nsnull);
NS_FREE_STR_BUF(label);
XmStringFree(str);
return NS_OK;
}

View File

@ -324,6 +324,7 @@ void nsWindow::CreateChildWindow(nsNativeWidget aNativeParent,
nsIToolkit *aToolkit,
nsWidgetInitData *aInitData)
{
printf("ENTER Create a child window\n");
mBounds = aRect;
mAppShell = aAppShell;
@ -352,6 +353,7 @@ void nsWindow::CreateChildWindow(nsNativeWidget aNativeParent,
XmNuserData, this,
nsnull);
printf("Created a child window %d %d\n", aRect.width, aRect.height);
if (aWidgetParent) {
aWidgetParent->AddChild(this);
}
@ -362,6 +364,7 @@ void nsWindow::CreateChildWindow(nsNativeWidget aNativeParent,
InitCallbacks();
CreateGC();
printf("EXIT Creating a child window\n");
}
//-------------------------------------------------------------------------
@ -972,10 +975,13 @@ void* nsWindow::GetNativeData(PRUint32 aDataType)
// We Cache a Read-Only Shared GC in the Toolkit. If we don't
// have one ourselves (because it needs to be writeable) grab the
// the shared GC
if (nsnull == mGC)
if (nsnull == mGC) {
NS_ASSERTION(mToolkit, "Unable to return GC, toolkit is null");
res = (void *)((nsToolkit *)mToolkit)->GetSharedGC();
else
}
else {
res = (void *)mGC;
}
NS_ASSERTION(res, "Unable to return GC");
return res;
}

View File

@ -130,7 +130,7 @@ public:
void SetBounds(const nsRect &aRect);
PRBool ConvertStatus(nsEventStatus aStatus);
PRBool DispatchEvent(nsGUIEvent* event);
PRBool OnPaint(nsPaintEvent &event);
virtual PRBool OnPaint(nsPaintEvent &event);
void OnDestroy();
PRBool OnKey(PRUint32 aEventType, PRUint32 aKeyCode, nsKeyEvent* aEvent);
PRBool DispatchFocus(nsGUIEvent &aEvent);
@ -139,7 +139,7 @@ public:
PRBool IgnoreResize();
PRUint32 GetYCoord(PRUint32 aNewY);
PRBool DispatchMouseEvent(nsMouseEvent& aEvent);
PRBool OnResize(nsSizeEvent &aEvent);
virtual PRBool OnResize(nsSizeEvent &aEvent);
// Resize event management