From 44a2bd07587f3a2f1f58fcd5556563150e4920f3 Mon Sep 17 00:00:00 2001 From: "kmcclusk%netscape.com" Date: Thu, 17 Sep 1998 15:31:18 +0000 Subject: [PATCH] Added fix in nsCheckButton for IRIX build. Made OnPaint and OnResize virtual in nsWindow.h, this fixes a bug when bringing up Sample5. git-svn-id: svn://10.0.0.236/trunk@10270 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/widget/src/motif/nsButton.cpp | 4 ++++ mozilla/widget/src/motif/nsCheckButton.cpp | 1 + mozilla/widget/src/motif/nsWindow.cpp | 10 ++++++++-- mozilla/widget/src/motif/nsWindow.h | 4 ++-- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/mozilla/widget/src/motif/nsButton.cpp b/mozilla/widget/src/motif/nsButton.cpp index e85fae4f972..e9fcff2b0de 100644 --- a/mozilla/widget/src/motif/nsButton.cpp +++ b/mozilla/widget/src/motif/nsButton.cpp @@ -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"); + } //------------------------------------------------------------------------- diff --git a/mozilla/widget/src/motif/nsCheckButton.cpp b/mozilla/widget/src/motif/nsCheckButton.cpp index 18bf06c47bd..1fe82023f63 100644 --- a/mozilla/widget/src/motif/nsCheckButton.cpp +++ b/mozilla/widget/src/motif/nsCheckButton.cpp @@ -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; } diff --git a/mozilla/widget/src/motif/nsWindow.cpp b/mozilla/widget/src/motif/nsWindow.cpp index a764ecb548b..0149a9be197 100644 --- a/mozilla/widget/src/motif/nsWindow.cpp +++ b/mozilla/widget/src/motif/nsWindow.cpp @@ -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; } diff --git a/mozilla/widget/src/motif/nsWindow.h b/mozilla/widget/src/motif/nsWindow.h index f3701319bab..705cc0cd8e8 100644 --- a/mozilla/widget/src/motif/nsWindow.h +++ b/mozilla/widget/src/motif/nsWindow.h @@ -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