remove unused tab widget and tooltip widget as they have never been used

This commit is contained in:
pavlov%netscape.com 1999-08-21 08:41:46 +00:00
parent 0c77f9a8c8
commit ebd04ecb57
32 changed files with 374 additions and 1409 deletions

View File

@ -29,8 +29,6 @@ nsIFileWidget.h
nsIMenuListener.h
nsIToolkit.h
nsWidgetsCID.h
nsITabWidget.h
nsITooltipWidget.h
nsIAppShell.h
nsILabel.h
nsILookAndFeel.h

View File

@ -36,7 +36,6 @@ EXPORTS = \
nsIFileWidget.h \
nsStringUtil.h \
nsui.h \
nsITabWidget.h \
nsIWidget.h \
nsIButton.h \
nsICheckButton.h\
@ -54,7 +53,6 @@ EXPORTS = \
nsIMenuListener.h \
nsIToolkit.h \
nsWidgetsCID.h \
nsITooltipWidget.h \
nsIAppShell.h \
nsILookAndFeel.h \
nsILabel.h \

View File

@ -56,8 +56,6 @@ EXPORTS=nsui.h \
nsIMenuListener.h \
nsIToolkit.h \
nsWidgetsCID.h \
nsITabWidget.h \
nsITooltipWidget.h \
nsIAppShell.h \
nsStringUtil.h \
nsILookAndFeel.h \

View File

@ -212,7 +212,7 @@ enum nsDragDropEventStatus {
#define NS_INPUT_EVENT 6
#define NS_KEY_EVENT 7
#define NS_MOUSE_EVENT 8
#define NS_TOOLTIP_EVENT 9
#define NS_MENU_EVENT 10
#define NS_DRAGDROP_EVENT 11
#define NS_TEXT_EVENT 12
@ -251,10 +251,8 @@ enum nsDragDropEventStatus {
// Tab control's selected tab has changed
#define NS_TABCHANGE (NS_WINDOW_START + 35)
// Tooltip should be shown
#define NS_SHOW_TOOLTIP (NS_WINDOW_START + 36)
// Tooltip should be hidden
#define NS_HIDE_TOOLTIP (NS_WINDOW_START + 37)
// Menu item selected
#define NS_MENU_SELECTED (NS_WINDOW_START + 38)

View File

@ -1,58 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef nsITabWidget_h__
#define nsITabWidget_h__
#include "nsIWidget.h"
#include "nsString.h"
#define NS_ITABWIDGET_IID \
{ 0xf05ba6e0, 0xd4a7, 0x11d1, { 0x9e, 0xc0, 0x0, 0xaa, 0x0, 0x2f, 0xb8, 0x21 } };
/**
* Tab widget.
* Presents a lists of tabs to be clicked on.
*/
class nsITabWidget : public nsISupports {
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_ITABWIDGET_IID)
/**
* Setup the tabs
*
* @param aNumberOfTabs The number of tabs in aTabLabels and aTabID
* @param aTabLabels title displayed in the tab
* @result NS_Ok if no errors
*/
NS_IMETHOD SetTabs(PRUint32 aNumberOfTabs, const nsString aTabLabels[]) = 0;
/**
* Get selected tab
*
* @return the index of the selected tab. Index ranges between 0 and (NumberOfTabs - 1)
* @result NS_Ok if no errors
*/
NS_IMETHOD GetSelectedTab(PRUint32& aTab) = 0;
};
#endif

View File

@ -1,40 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef nsITooltipWidget_h__
#define nsITooltipWidget_h__
#include "nsIWidget.h"
#include "nsString.h"
#define NS_ITOOLTIPWIDGET_IID \
{ 0x2910c191, 0xe38a, 0x11d1, { 0x9e, 0xc1, 0x0, 0xaa, 0x0, 0x2f, 0xb8, 0x21 } };
/**
*
* Tool tip display widget
*
*/
class nsITooltipWidget : public nsISupports
{
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_ITOOLTIPWIDGET_IID)
};
#endif // nsITooltipWidget_h__

View File

@ -578,37 +578,6 @@ class nsIWidget : public nsISupports {
NS_IMETHOD ShowMenuBar(PRBool aShow) = 0;
/**
* Set the collection of tooltip rectangles.
* A NS_SHOW_TOOLTIP event is generated when the mouse hovers over one
* of the rectangles. a NS_HIDE_TOOLTIP event is generated when the mouse
* is moved or a new tooltip is displayed.
*
* @param aNumberOfTips number of tooltip areas.
* @param aTooltipArea array of x,y,width,height rectangles specifying hot areas
*
*/
NS_IMETHOD SetTooltips(PRUint32 aNumberOfTips,nsRect* aTooltipAreas[]) = 0;
/**
* Update the collection of tooltip rectangles. The number of tooltips must
* match the original number of tooltips specified in SetTooltips. Must be called
* after calling SetTooltips.
*
* @param aNewTips array of x,y,width,height rectangles specifying the new hot areas
*
*/
NS_IMETHOD UpdateTooltips(nsRect* aNewTips[]) = 0;
/**
* Remove the collection of tooltip rectangles.
*/
NS_IMETHOD RemoveTooltips() = 0;
/**
* Convert from this widget coordinates to screen coordinates.
*

View File

@ -36,13 +36,11 @@ class nsIListBox;
class nsIListWidget;
class nsILookAndFeel;
class nsIMouseListener;
class nsITabWidget;
class nsIToolkit;
class nsIWidget;
class nsICheckButton;
class nsIScrollbar;
class nsIRadioButton;
class nsITooltipWidget;
class nsITextWidget;
class nsIBrowserWindow;
@ -93,13 +91,6 @@ NS_CreateTextAreaWidget(nsISupports* aParent,
EVENT_CALLBACK aHandleEventFunction,
const nsFont* aFont = nsnull);
extern NS_WIDGET nsresult
NS_CreateTooltipWidget(nsISupports* aParent,
nsITooltipWidget* aWidget,
const nsRect& aRect,
EVENT_CALLBACK aHandleEventFunction,
const nsFont* aFont = nsnull);
extern NS_WIDGET nsresult
NS_CreateListBox(nsISupports* aParent,
@ -116,13 +107,6 @@ NS_CreateComboBox(nsISupports* aParent,
EVENT_CALLBACK aHandleEventFunction,
const nsFont* aFont = nsnull);
extern NS_WIDGET nsresult
NS_CreateTabWidget(nsISupports* aParent,
nsITabWidget* aWidget,
const nsRect& aRect,
EVENT_CALLBACK aHandleEventFunction,
const nsFont* aFont = nsnull);
extern NS_WIDGET nsresult
NS_CreateScrollBar(nsISupports* aParent,

View File

@ -76,16 +76,6 @@
{ 0x2d96b3dc, 0xc051, 0x11d1, \
{0xa8, 0x27, 0x00, 0x40, 0x95, 0x9a, 0x28, 0xc9} }
/* 2d96b3dd-c051-11d1-a827-0040959a28c9 */
#define NS_TABWIDGET_CID \
{ 0x2d96b3dd, 0xc051, 0x11d1, \
{0xa8, 0x27, 0x00, 0x40, 0x95, 0x9a, 0x28, 0xc9} }
/* 2d96b3de-c051-11d1-a827-0040959a28c9 */
#define NS_TOOLTIPWIDGET_CID \
{ 0x2d96b3de, 0xc051, 0x11d1, \
{0xa8, 0x27, 0x00, 0x40, 0x95, 0x9a, 0x28, 0xc9} }
/* 2d96b3df-c051-11d1-a827-0040959a28c9 */
#define NS_APPSHELL_CID \
{ 0x2d96b3df, 0xc051, 0x11d1, \

View File

@ -30,13 +30,11 @@
#include "nsIListWidget.h"
#include "nsILookAndFeel.h"
#include "nsIMouseListener.h"
#include "nsITabWidget.h"
#include "nsIToolkit.h"
#include "nsIWidget.h"
#include "nsICheckButton.h"
#include "nsIScrollbar.h"
#include "nsIRadioButton.h"
#include "nsITooltipWidget.h"
#include "nsITextWidget.h"
@ -304,72 +302,6 @@ NS_CreateComboBox(nsISupports* aParent,
return NS_OK;
}
NS_WIDGET nsresult
NS_CreateTabWidget(nsISupports* aParent,
nsITabWidget* aWidget,
const nsRect& aRect,
EVENT_CALLBACK aHandleEventFunction,
const nsFont* aFont)
{
nsIWidget* parent = nsnull;
if (aParent != nsnull)
aParent->QueryInterface(kIWidgetIID,(void**)&parent);
nsIWidget* widget = nsnull;
if (NS_OK == aWidget->QueryInterface(kIWidgetIID,(void**)&widget)) {
widget->Create(parent, aRect, aHandleEventFunction, NULL);
widget->Show(PR_TRUE);
if (aFont != nsnull)
widget->SetFont(*aFont);
NS_IF_RELEASE(widget);
}
else
{
NS_ERROR("Called QueryInterface on a non kIWidgetIID supported object");
}
if (aParent)
NS_IF_RELEASE(parent);
return NS_OK;
}
extern NS_WIDGET nsresult
NS_CreateTooltipWidget(nsISupports* aParent,
nsITooltipWidget* aWidget,
const nsRect& aRect,
EVENT_CALLBACK aHandleEventFunction,
const nsFont* aFont)
{
nsIWidget* parent = nsnull;
if (aParent != nsnull)
aParent->QueryInterface(kIWidgetIID,(void**)&parent);
nsIWidget* widget = nsnull;
if (NS_OK == aWidget->QueryInterface(kIWidgetIID,(void**)&widget)) {
widget->Create(parent, aRect, aHandleEventFunction, NULL);
widget->Show(PR_TRUE);
if (aFont != nsnull)
widget->SetFont(*aFont);
NS_IF_RELEASE(widget);
}
else
{
NS_ERROR("Call QueryInterface on a non kIWidgetIID supported object");
}
if (aParent)
NS_IF_RELEASE(parent);
return NS_OK;
}
extern NS_WIDGET nsresult
NS_ShowWidget(nsISupports* aWidget, PRBool aShow)
{

View File

@ -34,8 +34,6 @@
#include "nsTextHelper.h"
#include "nsTextWidget.h"
#include "nsToolkit.h"
#include "nsTabWidget.h"
#include "nsTooltipWidget.h"
#include "nsWindow.h"
#include "nsLabel.h"
#include "nsMenuBar.h"
@ -67,8 +65,6 @@ static NS_DEFINE_IID(kCHorzScrollbar, NS_HORZSCROLLBAR_CID);
static NS_DEFINE_IID(kCVertScrollbar, NS_VERTSCROLLBAR_CID);
static NS_DEFINE_IID(kCTextArea, NS_TEXTAREA_CID);
static NS_DEFINE_IID(kCTextField, NS_TEXTFIELD_CID);
static NS_DEFINE_IID(kCTabWidget, NS_TABWIDGET_CID);
static NS_DEFINE_IID(kCTooltipWidget, NS_TOOLTIPWIDGET_CID);
static NS_DEFINE_IID(kCAppShell, NS_APPSHELL_CID);
static NS_DEFINE_IID(kCToolkit, NS_TOOLKIT_CID);
static NS_DEFINE_IID(kCLookAndFeel, NS_LOOKANDFEEL_CID);
@ -204,12 +200,6 @@ nsresult nsWidgetFactory::CreateInstance( nsISupports* aOuter,
else if (mClassID.Equals(kCTextField)) {
inst = (nsISupports*)(nsWindow*)new nsTextWidget();
}
else if (mClassID.Equals(kCTabWidget)) {
inst = (nsISupports*)(nsWindow*)new nsTabWidget();
}
else if (mClassID.Equals(kCTooltipWidget)) {
inst = (nsISupports*)(nsWindow*)new nsTooltipWidget();
}
else if (mClassID.Equals(kCAppShell)) {
inst = (nsISupports*)new nsAppShell();
}

View File

@ -48,7 +48,6 @@ CPPSRCS = \
nsRadioButton.cpp \
nsScrollbar.cpp \
nsSound.cpp \
nsTabWidget.cpp \
nsTextAreaWidget.cpp \
nsTextHelper.cpp \
nsTextWidget.cpp \

View File

@ -1,106 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "nsTabWidget.h"
#include "nsString.h"
NS_IMPL_ADDREF_INHERITED(nsTabWidget, nsWidget)
NS_IMPL_RELEASE_INHERITED(nsTabWidget, nsWidget)
//-------------------------------------------------------------------------
//
// nsTabWidget constructor
//
//-------------------------------------------------------------------------
nsTabWidget::nsTabWidget() : nsWidget()
{
NS_INIT_REFCNT();
}
//-------------------------------------------------------------------------
//
// nsTabWidget destructor
//
//-------------------------------------------------------------------------
nsTabWidget::~nsTabWidget()
{
}
//-------------------------------------------------------------------------
//
// Query interface implementation
//
//-------------------------------------------------------------------------
nsresult nsTabWidget::QueryInterface(const nsIID& aIID, void** aInstancePtr)
{
nsresult result = nsWidget::QueryInterface(aIID, aInstancePtr);
if (result == NS_NOINTERFACE && aIID.Equals(nsITabWidget::GetIID())) {
*aInstancePtr = (void*) ((nsITabWidget*)this);
NS_ADDREF_THIS();
result = NS_OK;
}
return result;
}
//-------------------------------------------------------------------------
//
// Set the tab labels
//
//-------------------------------------------------------------------------
NS_METHOD nsTabWidget::SetTabs(PRUint32 aNumberOfTabs, const nsString aTabLabels[])
{
/*
TC_ITEM tie;
char labelTemp[256];
for (PRUint32 i = 0; i < aNumberOfTabs; i++) {
tie.mask = TCIF_TEXT;
aTabLabels[i].ToCString(labelTemp, 256);
tie.pszText = labelTemp;
TabCtrl_InsertItem(mWnd, i, &tie);
}
*/
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Get the currently selected tab
//
//-------------------------------------------------------------------------
PRUint32 nsTabWidget::GetSelectedTab(PRUint32& aTabNumber)
{
/*
aTabNumber = TabCtrl_GetCurSel(mWnd);
*/
return NS_OK;
}
//-------------------------------------------------------------------------
//
//-------------------------------------------------------------------------
NS_METHOD nsTabWidget::GetBounds(nsRect &aRect)
{
return nsWidget::GetBounds(aRect);
}

View File

@ -1,54 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef nsTabWidget_h__
#define nsTabWidget_h__
#include "nsWidget.h"
#include "nsITabWidget.h"
/**
* Native Win32 tab control wrapper
*/
class nsTabWidget : public nsWidget,
public nsITabWidget
{
public:
nsTabWidget();
virtual ~nsTabWidget();
// nsISupports
NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr);
NS_IMETHOD_(nsrefcnt) AddRef(void);
NS_IMETHOD_(nsrefcnt) Release(void);
// nsITabWidget part
NS_IMETHOD SetTabs(PRUint32 aNumberOfTabs, const nsString aTabLabels[]);
NS_IMETHOD GetSelectedTab(PRUint32& aTabNumber);
// nsIWidget overrides
virtual PRBool OnMove(PRInt32 aX, PRInt32 aY) { return PR_FALSE; }
virtual PRBool OnPaint(nsPaintEvent & aEvent) { return PR_FALSE; }
virtual PRBool OnResize(nsRect &aRect) { return PR_FALSE; }
NS_IMETHOD GetBounds(nsRect &aRect);
};
#endif // nsTabWidget_h__

View File

@ -42,7 +42,6 @@
#include "nsMenuItem.h"
#include "nsPopUpMenu.h"
#include "nsContextMenu.h"
#include "nsTabWidget.h"
#include "nsFontRetrieverService.h"
// Drag & Drop, Clipboard
@ -65,8 +64,6 @@ static NS_DEFINE_IID(kCHorzScrollbar, NS_HORZSCROLLBAR_CID);
static NS_DEFINE_IID(kCVertScrollbar, NS_VERTSCROLLBAR_CID);
static NS_DEFINE_IID(kCTextArea, NS_TEXTAREA_CID);
static NS_DEFINE_IID(kCTextField, NS_TEXTFIELD_CID);
static NS_DEFINE_IID(kCTabWidget, NS_TABWIDGET_CID);
static NS_DEFINE_IID(kCTooltipWidget, NS_TOOLTIPWIDGET_CID);
static NS_DEFINE_IID(kCAppShell, NS_APPSHELL_CID);
static NS_DEFINE_IID(kCToolkit, NS_TOOLKIT_CID);
static NS_DEFINE_IID(kCLookAndFeel, NS_LOOKANDFEEL_CID);
@ -203,13 +200,6 @@ nsresult nsWidgetFactory::CreateInstance(nsISupports *aOuter,
else if (mClassID.Equals(kCTextField)) {
inst = (nsISupports*)(nsWidget *)new nsTextWidget();
}
else if (mClassID.Equals(kCTabWidget)) {
inst = (nsISupports*)(nsWidget *)new nsTabWidget();
}
else if (mClassID.Equals(kCTooltipWidget)) {
// no tooltips??
// inst = (nsISupports*)(nsWidget *)new nsTooltipWidget();
}
else if (mClassID.Equals(kCAppShell)) {
inst = (nsISupports*)new nsAppShell();
}

View File

@ -0,0 +1,369 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "nsWidgetSupport.h"
#include "nsRect.h"
#include "nsITextAreaWidget.h"
#include "nsIFileWidget.h"
#include "nsIAppShell.h"
#include "nsIButton.h"
#include "nsIComboBox.h"
#include "nsIEventListener.h"
#include "nsILabel.h"
#include "nsIListBox.h"
#include "nsIListWidget.h"
#include "nsILookAndFeel.h"
#include "nsIMouseListener.h"
#include "nsIToolkit.h"
#include "nsIWidget.h"
#include "nsICheckButton.h"
#include "nsIScrollbar.h"
#include "nsIRadioButton.h"
#include "nsITextWidget.h"
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
static NS_DEFINE_IID(kIWidgetIID, NS_IWIDGET_IID);
static NS_DEFINE_IID(kILookAndFeelIID, NS_ILOOKANDFEEL_IID);
static NS_DEFINE_IID(kIButtonIID, NS_IBUTTON_IID);
static NS_DEFINE_IID(kIFileWidgetIID, NS_IFILEWIDGET_IID);
static NS_DEFINE_IID(kITextWidgetIID, NS_ITEXTWIDGET_IID);
static NS_DEFINE_IID(kICheckButtonIID, NS_ICHECKBUTTON_IID);
static NS_DEFINE_IID(kIRadioButtonIID, NS_IRADIOBUTTON_IID);
static NS_DEFINE_IID(kILabelIID, NS_ILABEL_IID);
static NS_DEFINE_IID(kIScrollBarIID, NS_ISCROLLBAR_IID);
NS_WIDGET nsresult
NS_CreateButton(nsISupports* aParent,
nsIButton* aButton,
const nsRect& aRect,
EVENT_CALLBACK aHandleEventFunction,
const nsFont* aFont)
{
nsIWidget* parent = nsnull;
if (aParent != nsnull)
aParent->QueryInterface(kIWidgetIID,(void**)&parent);
nsIWidget* widget;
if (NS_OK == aButton->QueryInterface(kIWidgetIID,(void**)&widget)) {
widget->Create(parent, aRect, aHandleEventFunction, NULL);
widget->Show(PR_TRUE);
if (aFont != nsnull)
widget->SetFont(*aFont);
NS_IF_RELEASE(widget);
}
if (aParent != nsnull)
NS_IF_RELEASE(parent);
return NS_OK;
}
NS_WIDGET nsresult
NS_CreateCheckButton(nsISupports* aParent,
nsICheckButton* aCheckButton,
const nsRect& aRect,
EVENT_CALLBACK aHandleEventFunction,
const nsFont* aFont)
{
nsIWidget* parent = nsnull;
if (aParent != nsnull)
aParent->QueryInterface(kIWidgetIID,(void**)&parent);
nsIWidget* widget;
if (NS_OK == aCheckButton->QueryInterface(kIWidgetIID,(void**)&widget)) {
widget->Create(parent, aRect, aHandleEventFunction, NULL);
widget->Show(PR_TRUE);
if (aFont != nsnull)
widget->SetFont(*aFont);
NS_IF_RELEASE(widget);
}
if (aParent != nsnull)
NS_IF_RELEASE(parent);
return NS_OK;
}
NS_WIDGET nsresult
NS_CreateRadioButton( nsISupports* aParent,
nsIRadioButton* aRadioButton,
const nsRect& aRect,
EVENT_CALLBACK aHandleEventFunction,
const nsFont* aFont)
{
nsIWidget* parent = nsnull;
if (aParent != nsnull)
aParent->QueryInterface(kIWidgetIID,(void**)&parent);
nsIWidget* widget;
if (NS_OK == aRadioButton->QueryInterface(kIWidgetIID,(void**)&widget)) {
widget->Create(parent, aRect, aHandleEventFunction, NULL);
widget->Show(PR_TRUE);
if (aFont != nsnull)
widget->SetFont(*aFont);
NS_IF_RELEASE(widget);
}
if (aParent != nsnull)
NS_IF_RELEASE(parent);
return NS_OK;
}
NS_WIDGET nsresult
NS_CreateLabel( nsISupports* aParent,
nsILabel* aLabel,
const nsRect& aRect,
EVENT_CALLBACK aHandleEventFunction,
const nsFont* aFont)
{
nsIWidget* parent = nsnull;
if (NS_OK == aParent->QueryInterface(kIWidgetIID,(void**)&parent))
{
nsIWidget* widget;
if (NS_OK == aLabel->QueryInterface(kIWidgetIID,(void**)&widget)) {
widget->Create(parent, aRect, aHandleEventFunction, NULL);
widget->Show(PR_TRUE);
if (aFont != nsnull)
widget->SetFont(*aFont);
NS_IF_RELEASE(widget);
}
NS_IF_RELEASE(parent);
}
return NS_OK;
}
NS_WIDGET nsresult
NS_CreateTextAreaWidget(nsISupports* aParent,
nsITextAreaWidget* aWidget,
const nsRect& aRect,
EVENT_CALLBACK aHandleEventFunction,
const nsFont* aFont)
{
nsIWidget* parent = nsnull;
if (aParent != nsnull)
aParent->QueryInterface(kIWidgetIID,(void**)&parent);
nsIWidget* widget = nsnull;
if (NS_OK == aWidget->QueryInterface(kIWidgetIID,(void**)&widget)) {
widget->Create(parent, aRect, aHandleEventFunction, NULL);
widget->Show(PR_TRUE);
if (aFont != nsnull)
widget->SetFont(*aFont);
NS_IF_RELEASE(widget);
}
else
{
NS_ERROR("Called QueryInterface on a non kIWidgetIID supported object");
}
if (aParent)
NS_IF_RELEASE(parent);
return NS_OK;
}
NS_WIDGET nsresult
NS_CreateTextWidget(nsISupports* aParent,
nsITextWidget* aWidget,
const nsRect& aRect,
EVENT_CALLBACK aHandleEventFunction,
const nsFont* aFont)
{
nsIWidget* parent = nsnull;
if (aParent != nsnull)
aParent->QueryInterface(kIWidgetIID,(void**)&parent);
nsIWidget* widget = nsnull;
if (NS_OK == aWidget->QueryInterface(kIWidgetIID,(void**)&widget)) {
widget->Create(parent, aRect, aHandleEventFunction, NULL);
widget->Show(PR_TRUE);
if (aFont != nsnull)
widget->SetFont(*aFont);
NS_IF_RELEASE(widget);
}
else
{
NS_ERROR("Called QueryInterface on a non kIWidgetIID supported object");
}
if (aParent)
NS_IF_RELEASE(parent);
return NS_OK;
}
NS_WIDGET nsresult
NS_CreateScrollBar(nsISupports* aParent,
nsIScrollbar* aWidget,
const nsRect& aRect,
EVENT_CALLBACK aHandleEventFunction)
{
nsIWidget* parent = nsnull;
if (aParent != nsnull)
aParent->QueryInterface(kIWidgetIID,(void**)&parent);
nsIWidget* widget = nsnull;
if (NS_OK == aWidget->QueryInterface(kIWidgetIID,(void**)&widget)) {
widget->Create(parent, aRect, aHandleEventFunction, NULL);
widget->Show(PR_TRUE);
NS_IF_RELEASE(widget);
}
else
{
NS_ERROR("Called QueryInterface on a non kIWidgetIID supported object");
}
if (aParent)
NS_IF_RELEASE(parent);
return NS_OK;
}
NS_WIDGET nsresult
NS_CreateListBox(nsISupports* aParent,
nsIListBox* aWidget,
const nsRect& aRect,
EVENT_CALLBACK aHandleEventFunction,
const nsFont* aFont)
{
nsIWidget* parent = nsnull;
if (aParent != nsnull)
aParent->QueryInterface(kIWidgetIID,(void**)&parent);
nsIWidget* widget = nsnull;
if (NS_OK == aWidget->QueryInterface(kIWidgetIID,(void**)&widget)) {
widget->Create(parent, aRect, aHandleEventFunction, NULL);
widget->Show(PR_TRUE);
if (aFont != nsnull)
widget->SetFont(*aFont);
NS_IF_RELEASE(widget);
}
else
{
NS_ERROR("Called QueryInterface on a non kIWidgetIID supported object");
}
if (aParent)
NS_IF_RELEASE(parent);
return NS_OK;
}
NS_WIDGET nsresult
NS_CreateComboBox(nsISupports* aParent,
nsIComboBox* aWidget,
const nsRect& aRect,
EVENT_CALLBACK aHandleEventFunction,
const nsFont* aFont)
{
nsIWidget* parent = nsnull;
if (aParent != nsnull)
aParent->QueryInterface(kIWidgetIID,(void**)&parent);
nsIWidget* widget = nsnull;
if (NS_OK == aWidget->QueryInterface(kIWidgetIID,(void**)&widget)) {
widget->Create(parent, aRect, aHandleEventFunction, NULL);
widget->Show(PR_TRUE);
if (aFont != nsnull)
widget->SetFont(*aFont);
NS_IF_RELEASE(widget);
}
else
{
NS_ERROR("Called QueryInterface on a non kIWidgetIID supported object");
}
if (aParent)
NS_IF_RELEASE(parent);
return NS_OK;
}
extern NS_WIDGET nsresult
NS_ShowWidget(nsISupports* aWidget, PRBool aShow)
{
nsIWidget* widget = nsnull;
if (NS_OK == aWidget->QueryInterface(kIWidgetIID,(void**)&widget)) {
widget->Show(aShow);
NS_IF_RELEASE(widget);
}
return NS_OK;
}
extern NS_WIDGET nsresult
NS_MoveWidget(nsISupports* aWidget, PRUint32 aX, PRUint32 aY)
{
nsIWidget* widget = nsnull;
if (NS_OK == aWidget->QueryInterface(kIWidgetIID,(void**)&widget)) {
widget->Move(aX,aY);
NS_IF_RELEASE(widget);
}
return NS_OK;
}
extern NS_WIDGET nsresult
NS_EnableWidget(nsISupports* aWidget, PRBool aEnable)
{
nsIWidget* widget;
if (NS_OK == aWidget->QueryInterface(kIWidgetIID,(void**)&widget))
{
widget->Enable(aEnable);
NS_RELEASE(widget);
}
return NS_OK;
}
extern NS_WIDGET nsresult
NS_SetFocusToWidget(nsISupports* aWidget)
{
nsIWidget* widget = nsnull;
if (NS_OK == aWidget->QueryInterface(kIWidgetIID,(void**)&widget)) {
widget->SetFocus();
NS_IF_RELEASE(widget);
}
return NS_OK;
}
extern NS_WIDGET nsresult
NS_GetWidgetNativeData(nsISupports* aWidget, void** aNativeData)
{
void* result = nsnull;
nsIWidget* widget;
if (NS_OK == aWidget->QueryInterface(kIWidgetIID,(void**)&widget))
{
result = widget->GetNativeData(NS_NATIVE_WIDGET);
NS_RELEASE(widget);
}
*aNativeData = result;
return NS_OK;
}

View File

@ -138,38 +138,6 @@ void nsWindow::ConvertToDeviceCoordinates(nscoord &aX, nscoord &aY)
}
//-------------------------------------------------------------------------
//
// Setup initial tooltip rectangles
//
//-------------------------------------------------------------------------
NS_METHOD nsWindow::SetTooltips(PRUint32 aNumberOfTips,nsRect* aTooltipAreas[])
{
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Update all tooltip rectangles
//
//-------------------------------------------------------------------------
NS_METHOD nsWindow::UpdateTooltips(nsRect* aNewTips[])
{
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Remove all tooltip rectangles
//
//-------------------------------------------------------------------------
NS_METHOD nsWindow::RemoveTooltips()
{
return NS_OK;
}
NS_METHOD nsWindow::Destroy()
{
#ifdef NOISY_DESTROY

View File

@ -73,10 +73,6 @@ public:
NS_IMETHOD Invalidate(PRBool aIsSynchronous);
NS_IMETHOD Invalidate(const nsRect &aRect, PRBool aIsSynchronous);
NS_IMETHOD SetTooltips(PRUint32 aNumberOfTips,nsRect* aTooltipAreas[]);
NS_IMETHOD UpdateTooltips(nsRect* aNewTips[]);
NS_IMETHOD RemoveTooltips();
NS_IMETHOD BeginResizingChildren(void);
NS_IMETHOD EndResizingChildren(void);
NS_IMETHOD Destroy(void);

View File

@ -68,8 +68,6 @@ static NS_DEFINE_IID(kCHorzScrollbar, NS_HORZSCROLLBAR_CID);
static NS_DEFINE_IID(kCVertScrollbar, NS_VERTSCROLLBAR_CID);
static NS_DEFINE_IID(kCTextArea, NS_TEXTAREA_CID);
static NS_DEFINE_IID(kCTextField, NS_TEXTFIELD_CID);
static NS_DEFINE_IID(kCTabWidget, NS_TABWIDGET_CID);
static NS_DEFINE_IID(kCTooltipWidget, NS_TOOLTIPWIDGET_CID);
static NS_DEFINE_IID(kCAppShell, NS_APPSHELL_CID);
static NS_DEFINE_IID(kCToolkit, NS_TOOLKIT_CID);
static NS_DEFINE_IID(kCLookAndFeel, NS_LOOKANDFEEL_CID);
@ -219,14 +217,6 @@ nsresult nsWidgetFactory::CreateInstance(nsISupports *aOuter,
else if (mClassID.Equals(kCTextField)) {
inst = (nsISupports*)(nsWindow*)new nsTextWidget();
}
else if (mClassID.Equals(kCTabWidget)) {
// inst = (nsISupports*)(nsWindow*)new nsTabWidget();
NS_NOTYETIMPLEMENTED("nsTabWidget");
}
else if (mClassID.Equals(kCTooltipWidget)) {
// inst = (nsISupports*)(nsWindow*)new nsTooltipWidget();
NS_NOTYETIMPLEMENTED("nsTooltipWidget");
}
else if (mClassID.Equals(kCAppShell)) {
inst = (nsISupports*)new nsAppShell();
}

View File

@ -30,13 +30,11 @@
#include "nsIListWidget.h"
#include "nsILookAndFeel.h"
#include "nsIMouseListener.h"
#include "nsITabWidget.h"
#include "nsIToolkit.h"
#include "nsIWidget.h"
#include "nsICheckButton.h"
#include "nsIScrollbar.h"
#include "nsIRadioButton.h"
#include "nsITooltipWidget.h"
#include "nsITextWidget.h"
@ -306,72 +304,6 @@ NS_CreateComboBox(nsISupports* aParent,
return NS_OK;
}
NS_WIDGET nsresult
NS_CreateTabWidget(nsISupports* aParent,
nsITabWidget* aWidget,
const nsRect& aRect,
EVENT_CALLBACK aHandleEventFunction,
const nsFont* aFont)
{
nsIWidget* parent = nsnull;
if (aParent != nsnull)
aParent->QueryInterface(kIWidgetIID,(void**)&parent);
nsIWidget* widget = nsnull;
if (NS_OK == aWidget->QueryInterface(kIWidgetIID,(void**)&widget)) {
widget->Create(parent, aRect, aHandleEventFunction, NULL);
widget->Show(PR_TRUE);
if (aFont != nsnull)
widget->SetFont(*aFont);
NS_IF_RELEASE(widget);
}
else
{
NS_ERROR("Called QueryInterface on a non kIWidgetIID supported object");
}
if (aParent)
NS_IF_RELEASE(parent);
return NS_OK;
}
extern NS_WIDGET nsresult
NS_CreateTooltipWidget(nsISupports* aParent,
nsITooltipWidget* aWidget,
const nsRect& aRect,
EVENT_CALLBACK aHandleEventFunction,
const nsFont* aFont)
{
nsIWidget* parent = nsnull;
if (aParent != nsnull)
aParent->QueryInterface(kIWidgetIID,(void**)&parent);
nsIWidget* widget = nsnull;
if (NS_OK == aWidget->QueryInterface(kIWidgetIID,(void**)&widget)) {
widget->Create(parent, aRect, aHandleEventFunction, NULL);
widget->Show(PR_TRUE);
if (aFont != nsnull)
widget->SetFont(*aFont);
NS_IF_RELEASE(widget);
}
else
{
NS_ERROR("Call QueryInterface on a non kIWidgetIID supported object");
}
if (aParent)
NS_IF_RELEASE(parent);
return NS_OK;
}
extern NS_WIDGET nsresult
NS_ShowWidget(nsISupports* aWidget, PRBool aShow)
{

View File

@ -30,13 +30,11 @@
#include "nsIListWidget.h"
#include "nsILookAndFeel.h"
#include "nsIMouseListener.h"
#include "nsITabWidget.h"
#include "nsIToolkit.h"
#include "nsIWidget.h"
#include "nsICheckButton.h"
#include "nsIScrollbar.h"
#include "nsIRadioButton.h"
#include "nsITooltipWidget.h"
#include "nsITextWidget.h"
@ -310,70 +308,6 @@ NS_CreateComboBox(nsISupports* aParent,
}
WIDGET_SUPPORT_EXPORT(nsresult)
NS_CreateTabWidget(nsISupports* aParent,
nsITabWidget* aWidget,
const nsRect& aRect,
EVENT_CALLBACK aHandleEventFunction,
const nsFont* aFont)
{
nsIWidget* parent = nsnull;
if (aParent != nsnull)
aParent->QueryInterface(kIWidgetIID,(void**)&parent);
nsIWidget* widget = nsnull;
if (NS_OK == aWidget->QueryInterface(kIWidgetIID,(void**)&widget)) {
widget->Create(parent, aRect, aHandleEventFunction, NULL);
widget->Show(PR_TRUE);
if (aFont != nsnull)
widget->SetFont(*aFont);
NS_IF_RELEASE(widget);
}
else
{
NS_ERROR("Called QueryInterface on a non kIWidgetIID supported object");
}
if (aParent)
NS_IF_RELEASE(parent);
return NS_OK;
}
WIDGET_SUPPORT_EXPORT(nsresult)
NS_CreateTooltipWidget(nsISupports* aParent,
nsITooltipWidget* aWidget,
const nsRect& aRect,
EVENT_CALLBACK aHandleEventFunction,
const nsFont* aFont)
{
nsIWidget* parent = nsnull;
if (aParent != nsnull)
aParent->QueryInterface(kIWidgetIID,(void**)&parent);
nsIWidget* widget = nsnull;
if (NS_OK == aWidget->QueryInterface(kIWidgetIID,(void**)&widget)) {
widget->Create(parent, aRect, aHandleEventFunction, NULL);
widget->Show(PR_TRUE);
if (aFont != nsnull)
widget->SetFont(*aFont);
NS_IF_RELEASE(widget);
}
else
{
NS_ERROR("Call QueryInterface on a non kIWidgetIID supported object");
}
if (aParent)
NS_IF_RELEASE(parent);
return NS_OK;
}
WIDGET_SUPPORT_EXPORT(nsresult)
NS_ShowWidget(nsISupports* aWidget, PRBool aShow)

View File

@ -48,8 +48,6 @@ CPPSRCS = \
nsTextAreaWidget.cpp \
nsFileWidget.cpp \
nsScrollbar.cpp \
nsTabWidget.cpp \
nsTooltipWidget.cpp \
nsAppShell.cpp \
nsLookAndFeel.cpp \
nsLabel.cpp \
@ -85,8 +83,6 @@ OBJS = \
.\$(OBJDIR)\nsTextAreaWidget.obj \
.\$(OBJDIR)\nsFileWidget.obj \
.\$(OBJDIR)\nsScrollbar.obj \
.\$(OBJDIR)\nsTabWidget.obj \
.\$(OBJDIR)\nsTooltipWidget.obj \
.\$(OBJDIR)\nsAppShell.obj \
.\$(OBJDIR)\nsLookAndFeel.obj \
.\$(OBJDIR)\nsLabel.obj \

View File

@ -1,161 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "nsTabWidget.h"
#include "nsToolkit.h"
#include "nsColor.h"
#include "nsGUIEvent.h"
#include "nsString.h"
#include "nsStringUtil.h"
#include <commctrl.h>
#include <windows.h>
NS_IMPL_ADDREF(nsTabWidget)
NS_IMPL_RELEASE(nsTabWidget)
//-------------------------------------------------------------------------
//
// nsTabWidget constructor
//
//-------------------------------------------------------------------------
nsTabWidget::nsTabWidget() : nsWindow()
{
NS_INIT_REFCNT();
// Ensure that common controls dll is loaded
InitCommonControls();
}
//-------------------------------------------------------------------------
//
// nsTabWidget destructor
//
//-------------------------------------------------------------------------
nsTabWidget::~nsTabWidget()
{
}
//-------------------------------------------------------------------------
//
// Query interface implementation
//
//-------------------------------------------------------------------------
nsresult nsTabWidget::QueryInterface(const nsIID& aIID, void** aInstancePtr)
{
nsresult result = nsWindow::QueryInterface(aIID, aInstancePtr);
if (result == NS_NOINTERFACE && aIID.Equals(nsCOMTypeInfo<nsITabWidget>::GetIID())) {
*aInstancePtr = (void*) ((nsITabWidget*)this);
NS_ADDREF_THIS();
result = NS_OK;
}
return result;
}
//-------------------------------------------------------------------------
//
// Set the tab labels
//
//-------------------------------------------------------------------------
NS_METHOD nsTabWidget::SetTabs(PRUint32 aNumberOfTabs, const nsString aTabLabels[])
{
TC_ITEM tie;
char labelTemp[256];
for (PRUint32 i = 0; i < aNumberOfTabs; i++) {
tie.mask = TCIF_TEXT;
aTabLabels[i].ToCString(labelTemp, 256);
tie.pszText = labelTemp;
TabCtrl_InsertItem(mWnd, i, &tie);
}
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Get the currently selected tab
//
//-------------------------------------------------------------------------
PRUint32 nsTabWidget::GetSelectedTab(PRUint32& aTabNumber)
{
aTabNumber = TabCtrl_GetCurSel(mWnd);
return NS_OK;
}
//-------------------------------------------------------------------------
//
// paint message. Don't send the paint out
//
//-------------------------------------------------------------------------
PRBool nsTabWidget::OnPaint()
{
return PR_FALSE;
}
PRBool nsTabWidget::OnResize(nsRect &aWindowRect)
{
return PR_FALSE;
}
//-------------------------------------------------------------------------
//
// return the window class name and initialize the class if needed
//
//-------------------------------------------------------------------------
LPCTSTR nsTabWidget::WindowClass()
{
return WC_TABCONTROL;
}
//-------------------------------------------------------------------------
//
// return window styles
//
//-------------------------------------------------------------------------
DWORD nsTabWidget::WindowStyle()
{
return WS_CHILD | WS_CLIPSIBLINGS;
}
//-------------------------------------------------------------------------
//
// return window extended styles
//
//-------------------------------------------------------------------------
DWORD nsTabWidget::WindowExStyle()
{
return 0;
}
//-------------------------------------------------------------------------
//
// get position/dimensions
//
//-------------------------------------------------------------------------
NS_METHOD nsTabWidget::GetBounds(nsRect &aRect)
{
return nsWindow::GetBounds(aRect);
}

View File

@ -1,61 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef nsTabWidget_h__
#define nsTabWidget_h__
#include "nsdefs.h"
#include "nsWindow.h"
#include "nsSwitchToUIThread.h"
#include "nsITabWidget.h"
/**
* Native Win32 tab control wrapper
*/
class nsTabWidget : public nsWindow,
public nsITabWidget
{
public:
nsTabWidget();
virtual ~nsTabWidget();
// nsISupports
NS_IMETHOD_(nsrefcnt) Release(void);
NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr);
NS_IMETHOD_(nsrefcnt) AddRef(void);
// nsITabWidget part
NS_IMETHOD SetTabs(PRUint32 aNumberOfTabs, const nsString aTabLabels[]);
NS_IMETHOD GetSelectedTab(PRUint32& aTabNumber);
// nsIWidget overrides
virtual PRBool OnPaint();
virtual PRBool OnResize(nsRect &aWindowRect);
NS_IMETHOD GetBounds(nsRect &aRect);
protected:
virtual LPCTSTR WindowClass();
virtual DWORD WindowStyle();
virtual DWORD WindowExStyle();
};
#endif // nsTabWidget_h__

View File

@ -1,160 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "nsTooltipWidget.h"
#include "nsToolkit.h"
#include "nsColor.h"
#include "nsGUIEvent.h"
#include "nsString.h"
#include "nsStringUtil.h"
#include <commctrl.h>
#include <windows.h>
BOOL nsTooltipWidget::sTooltipWidgetIsRegistered = FALSE;
NS_IMPL_ADDREF(nsTooltipWidget)
NS_IMPL_RELEASE(nsTooltipWidget)
//-------------------------------------------------------------------------
//
// nsTooltipWidget constructor
//
//-------------------------------------------------------------------------
nsTooltipWidget::nsTooltipWidget()
{
NS_INIT_REFCNT();
}
//-------------------------------------------------------------------------
//
// nsTooltipWidget destructor
//
//-------------------------------------------------------------------------
nsTooltipWidget::~nsTooltipWidget()
{
}
//-------------------------------------------------------------------------
//
// Query interface implementation
//
//-------------------------------------------------------------------------
nsresult nsTooltipWidget::QueryInterface(const nsIID& aIID, void** aInstancePtr)
{
nsresult result = nsWindow::QueryInterface(aIID, aInstancePtr);
if (result == NS_NOINTERFACE && aIID.Equals(nsCOMTypeInfo<nsITooltipWidget>::GetIID())) {
*aInstancePtr = (void*) ((nsITooltipWidget*)this);
NS_ADDREF_THIS();
result = NS_OK;
}
return result;
}
//-------------------------------------------------------------------------
//
// paint message. Don't send the paint out
//
//-------------------------------------------------------------------------
PRBool nsTooltipWidget::OnPaint()
{
return PR_FALSE;
}
PRBool nsTooltipWidget::OnResize(nsRect &aWindowRect)
{
return PR_FALSE;
}
//-------------------------------------------------------------------------
//
// return the window class name and initialize the class if needed
//
//-------------------------------------------------------------------------
LPCTSTR nsTooltipWidget::WindowClass()
{
const LPCTSTR className = "NetscapeTooltipWidgetClass";
if (!nsTooltipWidget::sTooltipWidgetIsRegistered) {
WNDCLASS wc;
wc.style = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS;
wc.lpfnWndProc = ::DefWindowProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = nsToolkit::mDllInstance;
wc.hIcon = 0;
wc.hCursor = NULL;
wc.hbrBackground = ::CreateSolidBrush(NSRGB_2_COLOREF(NS_RGB(255,255,225)));
wc.lpszMenuName = NULL;
wc.lpszClassName = className;
nsTooltipWidget::sTooltipWidgetIsRegistered = ::RegisterClass(&wc);
}
return className;
}
//-------------------------------------------------------------------------
//
// return window styles
//
//-------------------------------------------------------------------------
DWORD nsTooltipWidget::WindowStyle()
{
return WS_POPUP;
}
//-------------------------------------------------------------------------
//
// return window extended styles
//
//-------------------------------------------------------------------------
DWORD nsTooltipWidget::WindowExStyle()
{
return 0; //WS_EX_TOPMOST;
}
//-------------------------------------------------------------------------
//
// Clear window before paint
//
//-------------------------------------------------------------------------
PRBool nsTooltipWidget::AutoErase()
{
return(PR_TRUE);
}
//-------------------------------------------------------------------------
//
// get position/dimensions
//
//-------------------------------------------------------------------------
NS_METHOD nsTooltipWidget::GetBounds(nsRect &aRect)
{
return nsWindow::GetBounds(aRect);
}

View File

@ -1,60 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef nsTooltipWidget_h__
#define nsTooltipWidget_h__
#include "nsdefs.h"
#include "nsWindow.h"
#include "nsSwitchToUIThread.h"
#include "nsITooltipWidget.h"
/**
* Native Win32 tooltip window wrapper
*/
class nsTooltipWidget : public nsWindow,
public nsITooltipWidget
{
public:
nsTooltipWidget();
virtual ~nsTooltipWidget();
// nsISupports
NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr);
NS_IMETHOD_(nsrefcnt) AddRef(void);
NS_IMETHOD_(nsrefcnt) Release(void);
virtual PRBool OnPaint();
virtual PRBool OnResize(nsRect &aWindowRect);
virtual PRBool AutoErase();
NS_IMETHOD GetBounds(nsRect &aRect);
protected:
virtual LPCTSTR WindowClass();
virtual DWORD WindowStyle();
virtual DWORD WindowExStyle();
private:
static BOOL sTooltipWidgetIsRegistered;
};
#endif // nsTooltipWidget_h__

View File

@ -92,7 +92,6 @@ nsWindow::nsWindow() : nsBaseWidget()
mIsAltDown = PR_FALSE;
mIsDestroying = PR_FALSE;
mOnDestroyCalled = PR_FALSE;
mTooltip = NULL;
mDeferredPositioner = NULL;
mLastPoint.x = 0;
mLastPoint.y = 0;
@ -219,50 +218,6 @@ NS_METHOD nsWindow::EndResizingChildren(void)
return NS_OK;
}
// DoCreateTooltip - creates a tooltip control and adds some tools
// to it.
// Returns the handle of the tooltip control if successful or NULL
// otherwise.
// hwndOwner - handle of the owner window
//
void nsWindow::AddTooltip(HWND hwndOwner,nsRect* aRect, int aId)
{
TOOLINFO ti; // tool information
memset(&ti, 0, sizeof(TOOLINFO));
// Make sure the common control DLL is loaded
InitCommonControls();
// Create a tooltip control for the window if needed
if (mTooltip == (HWND) NULL) {
mTooltip = CreateWindow(TOOLTIPS_CLASS, (LPSTR) NULL, TTS_ALWAYSTIP,
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
NULL, (HMENU) NULL,
nsToolkit::mDllInstance,
NULL);
}
if (mTooltip == (HWND) NULL)
return;
ti.cbSize = sizeof(TOOLINFO);
ti.uFlags = TTF_SUBCLASS;
ti.hwnd = hwndOwner;
ti.hinst = nsToolkit::mDllInstance;
ti.uId = aId;
ti.lpszText = (LPSTR)" "; // must set text to
// something for tooltip to give events;
ti.rect.left = aRect->x;
ti.rect.top = aRect->y;
ti.rect.right = aRect->x + aRect->width;
ti.rect.bottom = aRect->y + aRect->height;
if (!SendMessage(mTooltip, TTM_ADDTOOL, 0,
(LPARAM) (LPTOOLINFO) &ti))
return;
}
NS_METHOD nsWindow::WidgetToScreen(const nsRect& aOldRect, nsRect& aNewRect)
{
POINT point;
@ -289,79 +244,6 @@ NS_METHOD nsWindow::ScreenToWidget(const nsRect& aOldRect, nsRect& aNewRect)
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Setup initial tooltip rectangles
//
//-------------------------------------------------------------------------
NS_METHOD nsWindow::SetTooltips(PRUint32 aNumberOfTips,nsRect* aTooltipAreas[])
{
RemoveTooltips();
for (int i = 0; i < (int)aNumberOfTips; i++) {
AddTooltip(mWnd, aTooltipAreas[i], i);
}
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Update all tooltip rectangles
//
//-------------------------------------------------------------------------
NS_METHOD nsWindow::UpdateTooltips(nsRect* aNewTips[])
{
TOOLINFO ti;
memset(&ti, 0, sizeof(TOOLINFO));
ti.cbSize = sizeof(TOOLINFO);
ti.hwnd = mWnd;
// Get the number of tooltips
UINT count = ::SendMessage(mTooltip, TTM_GETTOOLCOUNT, 0, 0);
NS_ASSERTION(count > 0, "Called UpdateTooltips before calling SetTooltips");
for (UINT i = 0; i < count; i++) {
ti.uId = i;
int result =::SendMessage(mTooltip, TTM_ENUMTOOLS, i, (LPARAM) (LPTOOLINFO)&ti);
nsRect* newTip = aNewTips[i];
ti.rect.left = newTip->x;
ti.rect.top = newTip->y;
ti.rect.right = newTip->x + newTip->width;
ti.rect.bottom = newTip->y + newTip->height;
::SendMessage(mTooltip, TTM_NEWTOOLRECT, 0, (LPARAM) (LPTOOLINFO)&ti);
}
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Remove all tooltip rectangles
//
//-------------------------------------------------------------------------
NS_METHOD nsWindow::RemoveTooltips()
{
TOOLINFO ti;
memset(&ti, 0, sizeof(TOOLINFO));
ti.cbSize = sizeof(TOOLINFO);
long val;
if (mTooltip == NULL)
return NS_ERROR_FAILURE;
// Get the number of tooltips
UINT count = ::SendMessage(mTooltip, TTM_GETTOOLCOUNT, 0, (LPARAM)&val);
for (UINT i = 0; i < count; i++) {
ti.uId = i;
ti.hwnd = mWnd;
::SendMessage(mTooltip, TTM_DELTOOL, 0, (LPARAM) (LPTOOLINFO)&ti);
}
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Convert nsEventStatus value to a windows boolean
@ -2364,19 +2246,6 @@ PRBool nsWindow::ProcessMessage(UINT msg, WPARAM wParam, LPARAM lParam, LRESULT
}
break;
case TTN_SHOW: {
nsTooltipEvent event;
InitEvent(event, NS_SHOW_TOOLTIP);
event.tipIndex = (PRUint32)wParam;
event.eventStructType = NS_TOOLTIP_EVENT;
result = DispatchWindowEvent(&event);
NS_RELEASE(event.widget);
}
break;
case TTN_POP:
result = DispatchStandardEvent(NS_HIDE_TOOLTIP);
break;
}
}
break;
@ -3038,12 +2907,6 @@ void nsWindow::OnDestroy()
mPalette = NULL;
}
// free tooltip window
if (mTooltip) {
VERIFY(::DestroyWindow(mTooltip));
mTooltip = NULL;
}
// if we were in the middle of deferred window positioning then
// free the memory for the multiple-window position structure
if (mDeferredPositioner) {

View File

@ -114,9 +114,6 @@ public:
NS_IMETHOD SetTitle(const nsString& aTitle);
NS_IMETHOD SetMenuBar(nsIMenuBar * aMenuBar);
NS_IMETHOD ShowMenuBar(PRBool aShow);
NS_IMETHOD SetTooltips(PRUint32 aNumberOfTips,nsRect* aTooltipAreas[]);
NS_IMETHOD RemoveTooltips();
NS_IMETHOD UpdateTooltips(nsRect* aNewTips[]);
NS_IMETHOD WidgetToScreen(const nsRect& aOldRect, nsRect& aNewRect);
NS_IMETHOD ScreenToWidget(const nsRect& aOldRect, nsRect& aNewRect);
NS_IMETHOD BeginResizingChildren(void);
@ -192,7 +189,6 @@ protected:
DWORD GetBorderStyle(nsBorderStyle aBorderStyle);
PRBool DispatchStandardEvent(PRUint32 aMsg);
void AddTooltip(HWND hwndOwner, nsRect* aRect, int aId);
void RelayMouseEvent(UINT aMsg, WPARAM wParam, LPARAM lParam);
void GetNonClientBounds(nsRect &aRect);
@ -212,7 +208,6 @@ protected:
static nsWindow* gCurrentWindow;
nsPoint mLastPoint;
HWND mWnd;
HWND mTooltip;
HPALETTE mPalette;
WNDPROC mPrevWndProc;

View File

@ -73,40 +73,6 @@ nsBaseWidget::Enumerator::QueryInterface(REFNSIID aIID, void** aInstancePtr)
return NS_NOINTERFACE;
}
//-------------------------------------------------------------------------
//
// Setup initial tooltip rectangles
//
//-------------------------------------------------------------------------
NS_METHOD nsBaseWidget::SetTooltips(PRUint32 aNumberOfTips,nsRect* aTooltipAreas[])
{
return NS_ERROR_NOT_IMPLEMENTED;
}
//-------------------------------------------------------------------------
//
// Update all tooltip rectangles
//
//-------------------------------------------------------------------------
NS_METHOD nsBaseWidget::UpdateTooltips(nsRect* aNewTips[])
{
return NS_ERROR_NOT_IMPLEMENTED;
}
//-------------------------------------------------------------------------
//
// Remove all tooltip rectangles
//
//-------------------------------------------------------------------------
NS_METHOD nsBaseWidget::RemoveTooltips()
{
return NS_ERROR_NOT_IMPLEMENTED;
}
//-------------------------------------------------------------------------
//
// nsBaseWidget constructor
@ -835,7 +801,6 @@ case _value: eventName = _name ; break
_ASSIGN_eventName(NS_FORM_RESET,"NS_FORM_RESET");
_ASSIGN_eventName(NS_FORM_SUBMIT,"NS_FORM_SUBMIT");
_ASSIGN_eventName(NS_GOTFOCUS,"NS_GOTFOCUS");
_ASSIGN_eventName(NS_HIDE_TOOLTIP,"NS_HIDE_TOOLTIP");
_ASSIGN_eventName(NS_IMAGE_ABORT,"NS_IMAGE_ABORT");
_ASSIGN_eventName(NS_IMAGE_ERROR,"NS_IMAGE_ERROR");
_ASSIGN_eventName(NS_IMAGE_LOAD,"NS_IMAGE_LOAD");
@ -871,9 +836,7 @@ case _value: eventName = _name ; break
_ASSIGN_eventName(NS_SCROLLBAR_PAGE_NEXT,"NS_SCROLLBAR_PAGE_NEXT");
_ASSIGN_eventName(NS_SCROLLBAR_PAGE_PREV,"NS_SCROLLBAR_PAGE_PREV");
_ASSIGN_eventName(NS_SCROLLBAR_POS,"NS_SCROLLBAR_POS");
_ASSIGN_eventName(NS_SHOW_TOOLTIP,"NS_SHOW_TOOLTIP");
_ASSIGN_eventName(NS_SIZE,"NS_SIZE");
_ASSIGN_eventName(NS_TABCHANGE,"NS_TABCHANGE");
#undef _ASSIGN_eventName

View File

@ -79,9 +79,6 @@ public:
NS_IMETHOD SetWindowType(nsWindowType aWindowType);
NS_IMETHOD SetBorderStyle(nsBorderStyle aBorderStyle);
NS_IMETHOD SetTitle(const nsString& aTitle);
NS_IMETHOD SetTooltips(PRUint32 aNumberOfTips,nsRect* aTooltipAreas[]);
NS_IMETHOD RemoveTooltips();
NS_IMETHOD UpdateTooltips(nsRect* aNewTips[]);
NS_IMETHOD AddMouseListener(nsIMouseListener * aListener);
NS_IMETHOD AddEventListener(nsIEventListener * aListener);
NS_IMETHOD AddMenuListener(nsIMenuListener * aListener);

View File

@ -35,8 +35,8 @@ NS_IMPL_ADDREF(nsTransferable)
NS_IMPL_RELEASE(nsTransferable)
// million bytes
#define LARGE_DATASET_SIZE 1000000
//#define LARGE_DATASET_SIZE 10
//#define LARGE_DATASET_SIZE 1000000
#define LARGE_DATASET_SIZE 10
struct DataStruct {
DataStruct (const nsString & aString)

View File

@ -49,8 +49,6 @@
#include "nsFont.h"
#include "nsIComponentManager.h"
#include "nsWidgetsCID.h"
#include "nsITabWidget.h"
#include "nsITooltipWidget.h"
#include "nsIAppShell.h"
#include "nsWidgetSupport.h"
@ -80,12 +78,9 @@ nsIListBox *gMultiListBox = NULL;
nsIWidget *movingWidget = NULL;
nsIScrollbar *scrollbar = NULL;
nsITabWidget *tabWidget = NULL;
nsIButton *toolTipButton1 = NULL;
nsIButton *toolTipButton2 = NULL;
nsITooltipWidget *tooltipWindow = NULL;
nsIRadioButton * gRadioBtns[16];
int gNumRadioBtns = 0;
@ -133,16 +128,6 @@ char * gFailedMsg = NULL;
#define kBrowseBtn "Browse..."
#define kSetSelectedIndices "Set 0,2,4"
#define kTooltip1_x 400
#define kTooltip1_y 100
#define kTooltip1_width 100
#define kTooltip1_height 100
#define kTooltip2_x 200
#define kTooltip2_y 300
#define kTooltip2_width 100
#define kTooltip2_height 100
// class ids
static NS_DEFINE_IID(kCWindowCID, NS_WINDOW_CID);
static NS_DEFINE_IID(kCChildCID, NS_CHILD_CID);
@ -158,8 +143,6 @@ static NS_DEFINE_IID(kCTextAreaCID, NS_TEXTAREA_CID);
static NS_DEFINE_IID(kCTextFieldCID, NS_TEXTFIELD_CID);
static NS_DEFINE_IID(kLookAndFeelCID, NS_LOOKANDFEEL_CID);
static NS_DEFINE_IID(kCTabWidgetCID, NS_TABWIDGET_CID);
static NS_DEFINE_IID(kCTooltipWidgetCID, NS_TOOLTIPWIDGET_CID);
static NS_DEFINE_IID(kEventQueueServiceCID, NS_EVENTQUEUESERVICE_CID);
static NS_DEFINE_IID(kEventQueueCID, NS_EVENTQUEUE_CID);
static NS_DEFINE_IID(kCAppShellCID, NS_APPSHELL_CID);
@ -181,8 +164,6 @@ static NS_DEFINE_IID(kIListBoxIID, NS_ILISTBOX_IID);
static NS_DEFINE_IID(kIListWidgetIID, NS_ILISTWIDGET_IID);
static NS_DEFINE_IID(kIComboBoxIID, NS_ICOMBOBOX_IID);
static NS_DEFINE_IID(kIFileWidgetIID, NS_IFILEWIDGET_IID);
static NS_DEFINE_IID(kITabWidgetIID, NS_ITABWIDGET_IID);
static NS_DEFINE_IID(kITooltipWidgetIID, NS_ITOOLTIPWIDGET_IID);
static NS_DEFINE_IID(kIEventQueueServiceIID, NS_IEVENTQUEUESERVICE_IID);
static NS_DEFINE_IID(kIAppShellIID, NS_IAPPSHELL_IID);
@ -454,31 +435,6 @@ nsIButton* createSimpleButton(nsIWidget * aWin,
}
/**--------------------------------------------------------------------------------
*
*/
nsITooltipWidget* createTooltipWindow(nsIWidget * aWin,
char * aTitle,
int aX,
int aY,
int aWidth,
EVENT_CALLBACK aHandleEventFunction) {
nsITooltipWidget *tooltip;
nsRect rect(aX, aY, aWidth, 40);
nsComponentManager::CreateInstance(kCTooltipWidgetCID, nsnull, kITooltipWidgetIID, (void**)&tooltip);
NS_CreateTooltipWidget((nsISupports*)nsnull,tooltip,rect,aHandleEventFunction);
nsIWidget* toolTipWidget;
if (NS_OK == tooltip->QueryInterface(kIWidgetIID,(void**)&toolTipWidget))
{
/*nsIButton *toolTipButton =*/ createSimpleButton(toolTipWidget, "tooltip",5, 5, 80, 0);
NS_RELEASE(toolTipWidget);
}
return tooltip;
}
/**--------------------------------------------------------------------------------
* List Test Handler
*--------------------------------------------------------------------------------
@ -881,27 +837,6 @@ nsEventStatus PR_CALLBACK HandleEvent(nsGUIEvent *aEvent)
PRUint32 actualSize;
switch(aEvent->message) {
case NS_SHOW_TOOLTIP:
{
char buf[256];
nsTooltipEvent* tEvent = (nsTooltipEvent*)aEvent;
sprintf(buf,"Show tooltip %d", tEvent->tipIndex);
statusText->SetText(buf,actualSize);
nsRect oldPos;
oldPos.x = aEvent->point.x;
oldPos.y = aEvent->point.y;
nsRect newPos;
window->WidgetToScreen(oldPos, newPos);
NS_MoveWidget(tooltipWindow,newPos.x + 5, newPos.y + 5);
NS_ShowWidget(tooltipWindow,PR_TRUE);
}
break;
case NS_HIDE_TOOLTIP:
statusText->SetText("Hide tooltip",actualSize);
NS_ShowWidget(tooltipWindow,PR_FALSE);
break;
case NS_MOVE: {
char str[256];
sprintf(str, "Moved window to %d,%d", aEvent->point.x, aEvent->point.y);
@ -1060,101 +995,6 @@ nsEventStatus PR_CALLBACK HandleFileButtonEvent(nsGUIEvent *aEvent)
return(nsEventStatus_eConsumeDoDefault);
}
/*--------------------------------------------------------------------------------
* Tab change handler
*--------------------------------------------------------------------------------
*/
nsEventStatus PR_CALLBACK HandleTabEvent(nsGUIEvent *aEvent)
{
PRUint32 actualSize;
switch(aEvent->message) {
case NS_TABCHANGE:
PRUint32 tab = 0;
tabWidget->GetSelectedTab(tab);
char buf[256];
sprintf(buf, "Selected tab %d", tab);
statusText->SetText(buf,actualSize);
break;
}
return(nsEventStatus_eConsumeDoDefault);
}
void SetTooltipPos(int pos, nsIWidget *aWidget, nsIButton *aButton1, nsIButton *aButton2)
{
switch(pos) {
case 1: {
nsRect* tips1[2];
tips1[0] = new nsRect(
kTooltip1_x,
kTooltip1_y,
kTooltip1_width / 2,
kTooltip1_height);
tips1[1] = new nsRect(
kTooltip1_x + (kTooltip1_width / 2),
kTooltip1_y,
kTooltip1_width / 2,
kTooltip1_height);
aWidget->SetTooltips(2, tips1);
NS_MoveWidget(aButton1,kTooltip1_x, kTooltip1_y);
NS_MoveWidget(aButton2,kTooltip1_x + kTooltip1_width, kTooltip1_y + kTooltip1_height);
delete tips1[0];
delete tips1[1];
}
break;
case 2: {
nsRect* tipsDummy[1];
// Test updating the tooltips by initialy giving a tooltip
// location that is 100 pixels to the left, then changing
// it to the correct position.
tipsDummy[0] = new nsRect(kTooltip2_x - 100,kTooltip2_y,
kTooltip2_width,kTooltip2_height);
aWidget->SetTooltips(1, tipsDummy);
nsRect* tips2[1];
tips2[0] = new nsRect(kTooltip2_x,kTooltip2_y,
kTooltip2_width,kTooltip2_height);
aWidget->UpdateTooltips(tips2); // Put it in the correct position
NS_MoveWidget(aButton1,kTooltip2_x, kTooltip2_y);
NS_MoveWidget(aButton2,kTooltip2_x + kTooltip2_width, kTooltip2_y + kTooltip2_height);
delete tips2[0];
delete tipsDummy[0];
}
break;
}
}
nsEventStatus MoveTooltip(int aPos, nsGUIEvent *aEvent)
{
switch(aEvent->message) {
case NS_MOUSE_LEFT_BUTTON_DOWN:
SetTooltipPos(aPos, window, toolTipButton1, toolTipButton2);
break;
}
return(nsEventStatus_eConsumeDoDefault);
}
nsEventStatus PR_CALLBACK TooltipPos1(nsGUIEvent *aEvent)
{
return(MoveTooltip(1, aEvent));
}
nsEventStatus PR_CALLBACK TooltipPos2(nsGUIEvent *aEvent)
{
return(MoveTooltip(2, aEvent));
}
/*----------------------------------------------------------------------------
* DoSelfTests
*---------------------------------------------------------------------------*/
@ -1228,8 +1068,6 @@ nsresult WidgetTest(int *argc, char **argv)
nsComponentManager::RegisterComponentLib(kCVertScrollbarCID, NULL, NULL, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsComponentManager::RegisterComponentLib(kCTextAreaCID, NULL, NULL, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsComponentManager::RegisterComponentLib(kCTextFieldCID, NULL, NULL, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsComponentManager::RegisterComponentLib(kCTabWidgetCID, NULL, NULL, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsComponentManager::RegisterComponentLib(kCTooltipWidgetCID, NULL, NULL, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsComponentManager::RegisterComponentLib(kCAppShellCID, NULL, NULL, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsComponentManager::RegisterComponentLib(kCToolkitCID, NULL, NULL, WIDGET_DLL, PR_FALSE, PR_FALSE);
nsComponentManager::RegisterComponentLib(kClipboardCID, NULL, NULL, WIDGET_DLL, PR_FALSE, PR_FALSE);
@ -1303,16 +1141,6 @@ nsresult WidgetTest(int *argc, char **argv)
NS_ADDREF(deviceContext);
}
#ifdef XP_PC
tooltipWindow = createTooltipWindow(window, "INSERT <tooltip> here", 0, 0, 150, 0);
NS_ShowWidget(tooltipWindow,PR_FALSE);
toolTipButton1 = createSimpleButton(window, "Tooltip \\/\\/",400, 100, 100, 0);
toolTipButton2 = createSimpleButton(window, "Tooltip /\\/\\",500, 200, 100, 0);
createTestButton(window, "Move Tooltip pos 1", 450, 150, 130, TooltipPos1);
createTestButton(window, "Move Tooltip pos 2", 450, 175, 130, TooltipPos2);
SetTooltipPos(1, window, toolTipButton1, toolTipButton2);
#endif
//
// create a child
//
@ -1571,18 +1399,6 @@ nsresult WidgetTest(int *argc, char **argv)
y += rect.height + 5;
x = 5;
//
// create a tab widget
//
rect.SetRect(300, 500, 200, 50);
nsComponentManager::CreateInstance(kCTabWidgetCID, nsnull, kITabWidgetIID, (void**)&tabWidget);
if (tabWidget)
{
NS_CreateTabWidget(window,tabWidget,rect,HandleTabEvent);
nsString tabs[] = {"low", "medium", "high" };
tabWidget->SetTabs(3, tabs);
}
//
// create a Radio button
//