First step in moving the tooltip insanity out of the xfe and onto its own

library.
This commit is contained in:
ramiro%netscape.com 1998-08-26 05:59:32 +00:00
Родитель f76be88c23
Коммит eab953e848
19 изменённых файлов: 2662 добавлений и 52 удалений

Просмотреть файл

@ -37,6 +37,7 @@ ifdef XFE_WIDGETS_BUILD_UNUSED
UNUSED_DIRS = \
XfeCaption \
XfeComboBox \
XfeToolTip \
$(NULL)
endif

Просмотреть файл

@ -44,6 +44,7 @@ ifdef XFE_WIDGETS_BUILD_UNUSED
UNUSED_DIRS = \
XfeCaption \
XfeComboBox \
XfeToolTip \
$(NULL)
endif

Просмотреть файл

@ -170,7 +170,7 @@ static XtResource resources[] =
sizeof(Dimension),
XtOffsetOf(XfeBypassShellRec , xfe_bypass_shell . shadow_thickness),
XmRImmediate,
(XtPointer) XfeDEFAULT_SHADOW_THICKNESS
(XtPointer) XfeDEFAULT_SHADOW_THICKNESS
},
{
XmNshadowType,
@ -201,7 +201,7 @@ static XtResource resources[] =
sizeof(Boolean),
XtOffsetOf(XfeBypassShellRec , xfe_bypass_shell . ignore_exposures),
XmRImmediate,
(XtPointer) True
(XtPointer) False
},
/* Override Shell resources */
@ -314,7 +314,7 @@ _XFE_WIDGET_CLASS_RECORD(bypassshell,BypassShell) =
/* Composite Part */
{
XtInheritGeometryManager, /* geometry_manager */
_XfeLiberalGeometryManager, /* geometry_manager */
ChangeManaged, /* change_managed */
XtInheritInsertChild, /* insert_child */
XtInheritDeleteChild, /* delete_child */
@ -503,7 +503,7 @@ ChangeManaged(Widget w)
Widget new_managed_child = NULL;
Widget old_managed_child = bp->managed_child;
for(i = 0; i < _XfemNumChildren(w); i++)
for (i = 0; i < _XfemNumChildren(w); i++)
{
Widget child = _XfeChildrenIndex(w,i);
@ -523,18 +523,27 @@ ChangeManaged(Widget w)
{
/* Assign the new managed child */
bp->managed_child = new_managed_child;
/*
* Request that we be resized to the new geometry.
*
*/
_XfeMakeGeometryRequest(w,
_XfeWidth(bp->managed_child) + 2 * bp->shadow_thickness,
_XfeHeight(bp->managed_child) + 2 * bp->shadow_thickness);
/* Invoke before change managed Callbacks */
_XfeInvokeCallbacks(w,bp->change_managed_callback,
XmCR_CHANGE_MANAGED,NULL,False);
_XfeConfigureWidget(bp->managed_child,
bp->shadow_thickness,
bp->shadow_thickness,
_XfeWidth(w) - 2 * bp->shadow_thickness,
_XfeHeight(w) - 2 * bp->shadow_thickness);
if (_XfeIsRealized(bp->managed_child))
/* Place the managed child in the center of the shell */
_XfeMoveWidget(bp->managed_child,
bp->shadow_thickness,
bp->shadow_thickness);
/* Raise the managed child's window to the top if needed */
if (XtIsWidget(w) && _XfeIsRealized(bp->managed_child))
{
XRaiseWindow(XtDisplay(w),_XfeWindow(bp->managed_child));
}
@ -544,9 +553,45 @@ ChangeManaged(Widget w)
static XtGeometryResult
GeometryManager(Widget child,XtWidgetGeometry *request,XtWidgetGeometry *reply)
{
XtGeometryResult result;
Widget w = XtParent(child);
XfeBypassShellPart * bp = _XfeBypassShellPart(w);
return result;
printf("GeometryManager(w = %s,child = %s)\n",XtName(w),XtName(child));
if (request->request_mode & XtCWQueryOnly)
{
return XtGeometryYes;
}
if (request->request_mode & CWX)
{
_XfeX(child) = request->x;
}
if (request->request_mode & CWY)
{
_XfeY(child) = request->y;
}
if (request->request_mode & CWWidth)
{
_XfeWidth(child) = request->width;
}
if (request->request_mode & CWHeight)
{
_XfeHeight(child) = request->height;
}
if (request->request_mode & CWBorderWidth)
{
_XfeBorderWidth(child) = request->border_width;
}
_XfeMakeGeometryRequest(w,
_XfeWidth(bp->managed_child) + 2 * bp->shadow_thickness,
_XfeHeight(bp->managed_child) + 2 * bp->shadow_thickness);
XfeResize(w);
return XtGeometryYes;
}
/*----------------------------------------------------------------------*/
@ -682,3 +727,22 @@ XfeCreateBypassShell(Widget pw,char * name,Arg * av,Cardinal ac)
return XtCreatePopupShell(name,xfeBypassShellWidgetClass,pw,av,ac);
}
/*----------------------------------------------------------------------*/
/* extern */ void
XfeBypassShellUpdateSize(Widget w)
{
XfeBypassShellPart * bp = _XfeBypassShellPart(w);
assert( XfeIsBypassShell(w) );
printf("XfeBypassShellUpdateSize(%s)\n",XtName(w));
if (_XfeIsAlive(bp->managed_child))
{
_XfeMakeGeometryRequest(w,
_XfeWidth(bp->managed_child) + 2 * bp->shadow_thickness,
_XfeHeight(bp->managed_child) + 2 * bp->shadow_thickness);
}
XfeResize(w);
}
/*----------------------------------------------------------------------*/

Просмотреть файл

@ -60,6 +60,9 @@ XfeCreateBypassShell (Widget pw,
Arg * av,
Cardinal ac);
/*----------------------------------------------------------------------*/
extern void
XfeBypassShellUpdateSize (Widget w);
/*----------------------------------------------------------------------*/
XFE_END_CPLUSPLUS_PROTECTION

Просмотреть файл

@ -639,7 +639,7 @@ _XfeLiberalGeometryManager(Widget child,
{
Widget w = XtParent(child);
assert( XfeIsManager(w) );
/* assert( XfeIsManager(w) ); */
if (request->request_mode & XtCWQueryOnly)
{
@ -673,11 +673,18 @@ _XfeLiberalGeometryManager(Widget child,
* a lot more efficient. -re
*/
/* Layout the components */
_XfeManagerLayoutComponents(w);
/* Layout the children */
_XfeManagerLayoutChildren(w);
if (XfeIsManager(w))
{
/* Layout the components */
_XfeManagerLayoutComponents(w);
/* Layout the children */
_XfeManagerLayoutChildren(w);
}
else
{
XfeResize(w);
}
return XtGeometryYes;
}

Просмотреть файл

@ -458,8 +458,8 @@ XfeLinkedFind(XfeLinked list,
}
/*----------------------------------------------------------------------*/
/* extern */ XfeLinkNode
XfeLinkedFindItem(XfeLinked list,
XtPointer item)
XfeLinkedFindNodeByItem(XfeLinked list,
XtPointer item)
{
XfeLinkNode node;

Просмотреть файл

@ -66,105 +66,105 @@ typedef struct _XfeLinkNodeRec * XfeLinkNode;
/* */
/*----------------------------------------------------------------------*/
extern Cardinal
XfeLinkedCount (XfeLinked list);
XfeLinkedCount (XfeLinked list);
/*----------------------------------------------------------------------*/
extern XfeLinkNode
XfeLinkedHead (XfeLinked list);
XfeLinkedHead (XfeLinked list);
/*----------------------------------------------------------------------*/
extern XfeLinkNode
XfeLinkedTail (XfeLinked list);
XfeLinkedTail (XfeLinked list);
/*----------------------------------------------------------------------*/
extern XfeLinked
XfeLinkedConstruct (void);
/*----------------------------------------------------------------------*/
extern void
XfeLinkedDestroy (XfeLinked list,
XfeLinkedApplyProc proc,
XfeLinkedDestroy (XfeLinked list,
XfeLinkedApplyProc proc,
XtPointer data);
/*----------------------------------------------------------------------*/
extern void
XfeLinkedApply (XfeLinked list,
XfeLinkedApplyProc proc,
XfeLinkedApply (XfeLinked list,
XfeLinkedApplyProc proc,
XtPointer data);
/*----------------------------------------------------------------------*/
extern XfeLinkNode
XfeLinkedInsertAfter (XfeLinked list,
XfeLinkedInsertAfter (XfeLinked list,
XfeLinkNode node,
XtPointer item);
/*----------------------------------------------------------------------*/
extern XfeLinkNode
XfeLinkedInsertBefore (XfeLinked list,
XfeLinkedInsertBefore (XfeLinked list,
XfeLinkNode node,
XtPointer item);
/*----------------------------------------------------------------------*/
extern XfeLinkNode
XfeLinkedInsertAtTail (XfeLinked list,
XfeLinkedInsertAtTail (XfeLinked list,
XtPointer item);
/*----------------------------------------------------------------------*/
extern XfeLinkNode
XfeLinkedInsertAtHead (XfeLinked list,
XfeLinkedInsertAtHead (XfeLinked list,
XtPointer item);
/*----------------------------------------------------------------------*/
extern XfeLinkNode
XfeLinkedInsertOrdered (XfeLinked list,
XfeLinkedCompareFunc func,
XfeLinkedInsertOrdered (XfeLinked list,
XfeLinkedCompareFunc func,
XtPointer item,
XtPointer data);
/*----------------------------------------------------------------------*/
extern XtPointer
XfeLinkedRemoveNode (XfeLinked list,
XfeLinkedRemoveNode (XfeLinked list,
XfeLinkNode node);
/*----------------------------------------------------------------------*/
extern void
XfeLinkedClear (XfeLinked list,
XfeLinkedApplyProc proc,
XfeLinkedClear (XfeLinked list,
XfeLinkedApplyProc proc,
XtPointer data);
/*----------------------------------------------------------------------*/
extern XfeLinkNode
XfeLinkedFindLT (XfeLinked list,
XfeLinkedCompareFunc func,
XfeLinkedFindLT (XfeLinked list,
XfeLinkedCompareFunc func,
XtPointer item,
XtPointer data);
/*----------------------------------------------------------------------*/
extern XfeLinkNode
XfeLinkedFindGT (XfeLinked list,
XfeLinkedCompareFunc func,
XfeLinkedFindGT (XfeLinked list,
XfeLinkedCompareFunc func,
XtPointer item,
XtPointer data);
/*----------------------------------------------------------------------*/
extern XfeLinkNode
XfeLinkedFindLE (XfeLinked list,
XfeLinkedCompareFunc func,
XfeLinkedFindLE (XfeLinked list,
XfeLinkedCompareFunc func,
XtPointer item,
XtPointer data);
/*----------------------------------------------------------------------*/
extern XfeLinkNode
XfeLinkedFindGE (XfeLinked list,
XfeLinkedCompareFunc func,
XfeLinkedFindGE (XfeLinked list,
XfeLinkedCompareFunc func,
XtPointer item,
XtPointer data);
/*----------------------------------------------------------------------*/
extern XfeLinkNode
XfeLinkedFindEQ (XfeLinked list,
XfeLinkedCompareFunc func,
XfeLinkedFindEQ (XfeLinked list,
XfeLinkedCompareFunc func,
XtPointer item,
XtPointer data);
/*----------------------------------------------------------------------*/
extern XfeLinkNode
XfeLinkedFind (XfeLinked list,
XfeLinkedTestFunc func,
XfeLinkedFind (XfeLinked list,
XfeLinkedTestFunc func,
XtPointer data);
/*----------------------------------------------------------------------*/
extern XfeLinkNode
XfeLinkedFindItem (XfeLinked list,
XfeLinkedFindNodeByItem (XfeLinked list,
XtPointer item);
/*----------------------------------------------------------------------*/
extern XfeLinkNode
XfeLinkedIndex (XfeLinked list,
XfeLinkedIndex (XfeLinked list,
Cardinal i);
/*----------------------------------------------------------------------*/
extern Boolean
XfeLinkedPosition (XfeLinked list,
XfeLinkedPosition (XfeLinked list,
XtPointer item,
Cardinal * pos);
/*----------------------------------------------------------------------*/

Просмотреть файл

@ -0,0 +1,56 @@
#!gmake
#
# 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.
##########################################################################
#
# Name: Makefile
# Description: Makefile for XfeToolTip library
# Author: Ramiro Estrugo <ramiro@netscape.com>
#
##########################################################################
DEPTH = ../../../..
# XfeWidgets headers are exported to dist/public/XfeToolTip/Xfe. We use
# the 'Xfe' directory to avoid the hasstle of having to remember yet another
# include prefix.
MODULE = XfeToolTip/Xfe
LIBRARY_NAME = XfeToolTip
CSRCS = \
ToolTip.c \
ToolTipShell.c \
$(NULL)
REQUIRES = \
XfeToolTip \
XfeWidgets
EXPORTS = \
ToolTip.h \
ToolTipP.h \
ToolTipShell.h \
ToolTipShellP.h \
ToolTipStringDefs.h \
$(NULL)
include $(DEPTH)/config/rules.mk

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -0,0 +1,98 @@
/* -*- Mode: C; tab-width: 4; 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.
*/
/*----------------------------------------------------------------------*/
/* */
/* Name: <Xfe/ToolTip.h> */
/* Description: XfeToolTip - Tool tip and doc string support. */
/* Author: Ramiro Estrugo <ramiro@netscape.com> */
/* */
/*----------------------------------------------------------------------*/
#ifndef _XfeToolTip_h_ /* start ToolTip.h */
#define _XfeToolTip_h_
#include <Xfe/ToolTipShell.h>
XFE_BEGIN_CPLUSPLUS_PROTECTION
/*----------------------------------------------------------------------*/
/* */
/* XfeToolTip string collection callback */
/* */
/*----------------------------------------------------------------------*/
typedef void (*XfeToolTipLabelCallback) (Widget w,
XtPointer client_data,
XmString * string);
/*----------------------------------------------------------------------*/
/* */
/* XfeToolTip public methods */
/* */
/*----------------------------------------------------------------------*/
extern void
XfeToolTipAdd (Widget w);
/*----------------------------------------------------------------------*/
extern void
XfeToolTipRemove (Widget w);
/*----------------------------------------------------------------------*/
extern void
XfeToolTipSetEnabledState (Widget w,
Boolean state);
/*----------------------------------------------------------------------*/
extern Boolean
XfeToolTipGetEnabledState (Widget w);
/*----------------------------------------------------------------------*/
/*----------------------------------------------------------------------*/
/* */
/* Callback functions */
/* */
/*----------------------------------------------------------------------*/
extern void
XfeToolTipSetStringCallback (Widget w,
XfeToolTipLabelCallback callback,
XtPointer client_data);
/*----------------------------------------------------------------------*/
extern void
XfeToolTipClearStringCallback (Widget w);
/*----------------------------------------------------------------------*/
/*----------------------------------------------------------------------*/
/* */
/* XfeToolTipIsShowing() - Check whether the global tooltip is showing */
/* */
/*----------------------------------------------------------------------*/
extern Boolean
XfeToolTipIsShowing (void);
/*----------------------------------------------------------------------*/
/*----------------------------------------------------------------------*/
/* */
/* Enable / Disable functions */
/* */
/*----------------------------------------------------------------------*/
extern void XfeToolTipGlobalSetEnabledState (Boolean state);
extern Boolean XfeToolTipGlobalGetEnabledState (void);
/*----------------------------------------------------------------------*/
XFE_END_CPLUSPLUS_PROTECTION
#endif /* end ToolTip.h */

Просмотреть файл

@ -0,0 +1,59 @@
/* -*- Mode: C; tab-width: 4; 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.
*/
/*----------------------------------------------------------------------*/
/* */
/* Name: <Xfe/ToolTipP.h> */
/* Description: XfeToolTip - Tool tip and doc string support. */
/* Author: Ramiro Estrugo <ramiro@netscape.com> */
/* */
/*----------------------------------------------------------------------*/
#ifndef _XfeToolTipP_h_ /* start ToolTipP.h */
#define _XfeToolTipP_h_
#include <Xfe/ToolTip.h>
#include <Xfe/XfeP.h>
XFE_BEGIN_CPLUSPLUS_PROTECTION
/*----------------------------------------------------------------------*/
/* */
/* XfeToolTip Private Methods */
/* */
/*----------------------------------------------------------------------*/
extern Widget
_XfeToolTipGetShell (Widget w);
/*----------------------------------------------------------------------*/
extern Widget
_XfeToolTipGetLabel (Widget w);
/*----------------------------------------------------------------------*/
extern void
_XfeToolTipLock (void);
/*----------------------------------------------------------------------*/
extern void
_XfeToolTipUnlock (void);
/*----------------------------------------------------------------------*/
extern Boolean
_XfeToolTipIsLocked (void);
/*----------------------------------------------------------------------*/
XFE_END_CPLUSPLUS_PROTECTION
#endif /* end ToolTipP.h */

Просмотреть файл

@ -0,0 +1,481 @@
/* -*- Mode: C; tab-width: 4; 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.
*/
/*----------------------------------------------------------------------*/
/* */
/* Name: <Xfe/ToolTipShell.c> */
/* Description: XfeToolTipShell widget source. */
/* Author: Ramiro Estrugo <ramiro@netscape.com> */
/* */
/*----------------------------------------------------------------------*/
#include <Xfe/ToolTipShellP.h>
#include <Xm/RepType.h>
#define MESSAGE1 "Widget is not an XfeToolTipShell."
#define MESSAGE2 "XmNtoolTupWidget is a read-only resource."
#define TOOL_TIP_LABEL_NAME "ToolTipLabel"
/*----------------------------------------------------------------------*/
/* */
/* Core class methods */
/* */
/*----------------------------------------------------------------------*/
static void ClassInitialize (void);
static void Initialize (Widget,Widget,ArgList,Cardinal *);
static void Destroy (Widget);
static Boolean SetValues (Widget,Widget,Widget,ArgList,Cardinal *);
static void GetValuesHook (Widget,ArgList,Cardinal *);
/*----------------------------------------------------------------------*/
/* */
/* ToolTipShell widget functions */
/* */
/*----------------------------------------------------------------------*/
static Widget LabelCreate (Widget);
/*----------------------------------------------------------------------*/
/* */
/* Rep type registration functions */
/* */
/*----------------------------------------------------------------------*/
static void RegisterToolTipPlacement (void);
static void RegisterToolTipType (void);
/*----------------------------------------------------------------------*/
/* */
/* Screen functions functions */
/* */
/*----------------------------------------------------------------------*/
static int ScreenGetSpaceBelow (Widget);
static int ScreenGetSpaceAbove (Widget);
/*----------------------------------------------------------------------*/
/* */
/* XfeToolTipShell resources */
/* */
/*----------------------------------------------------------------------*/
static XtResource resources[] =
{
/* Tool tip resources */
{
XmNtoolTipLabel,
XmCReadOnly,
XmRWidget,
sizeof(Widget),
XtOffsetOf(XfeToolTipShellRec , xfe_tool_tip_shell . tool_tip_label),
XmRImmediate,
(XtPointer) NULL
},
{
XmNfontList,
XmCFontList,
XmRFontList,
sizeof(XmFontList),
XtOffsetOf(XfeToolTipShellRec , xfe_tool_tip_shell . font_list),
XmRImmediate,
(XtPointer) NULL
},
{
XmNtoolTipTimeout,
XmCToolTipTimeout,
XmRInt,
sizeof(int),
XtOffsetOf(XfeToolTipShellRec , xfe_tool_tip_shell . tool_tip_timeout),
XmRImmediate,
(XtPointer) XfeDEFAULT_TOOL_TIP_TIMEOUT
},
/* Enumeration resources */
{
XmNtoolTipType,
XmCToolTipType,
XmRToolTipType,
sizeof(unsigned char),
XtOffsetOf(XfeToolTipShellRec , xfe_tool_tip_shell . tool_tip_type),
XmRImmediate,
(XtPointer) 0
},
{
XmNtoolTipPlacement,
XmCToolTipPlacement,
XmRToolTipPlacement,
sizeof(unsigned char),
XtOffsetOf(XfeToolTipShellRec , xfe_tool_tip_shell . tool_tip_placement),
XmRImmediate,
(XtPointer) 0
},
/* Offset resources */
{
XmNbottomOffset,
XmCOffset,
XmRInt,
sizeof(int),
XtOffsetOf(XfeToolTipShellRec , xfe_tool_tip_shell . bottom_offset),
XmRImmediate,
(XtPointer) 0
},
{
XmNleftOffset,
XmCOffset,
XmRInt,
sizeof(int),
XtOffsetOf(XfeToolTipShellRec , xfe_tool_tip_shell . left_offset),
XmRImmediate,
(XtPointer) 0
},
{
XmNrightOffset,
XmCOffset,
XmRInt,
sizeof(int),
XtOffsetOf(XfeToolTipShellRec , xfe_tool_tip_shell . right_offset),
XmRImmediate,
(XtPointer) 0
},
{
XmNtopOffset,
XmCOffset,
XmRInt,
sizeof(int),
XtOffsetOf(XfeToolTipShellRec , xfe_tool_tip_shell . top_offset),
XmRImmediate,
(XtPointer) 0
},
};
/*----------------------------------------------------------------------*/
/* */
/* XfeToolTipShell widget class record initialization */
/* */
/*----------------------------------------------------------------------*/
_XFE_WIDGET_CLASS_RECORD(tooltipshell,ToolTipShell) =
{
{
(WidgetClass) &xfeBypassShellClassRec, /* superclass */
"XfeToolTipShell", /* class_name */
sizeof(XfeToolTipShellRec), /* widget_size */
ClassInitialize, /* class_initialize */
NULL, /* class_part_initialize*/
False, /* class_inited */
Initialize, /* initialize */
NULL, /* initialize_hook */
XtInheritRealize, /* realize */
NULL, /* actions */
0, /* num_actions */
resources, /* resources */
XtNumber(resources), /* num_resources */
NULLQUARK, /* xrm_class */
True, /* compress_motion */
XtExposeCompressMaximal, /* compress_exposure */
True, /* compress_enterleave */
False, /* visible_interest */
Destroy, /* destroy */
XtInheritResize, /* resize */
XtInheritExpose, /* expose */
SetValues, /* set_values */
NULL, /* set_values_hook */
NULL, /* set_values_almost */
NULL, /* get_values_hook */
NULL, /* access_focus */
XtVersion, /* version */
NULL, /* callback_private */
XtInheritTranslations, /* tm_table */
NULL, /* query_geometry */
NULL, /* display accelerator */
NULL, /* extension */
},
/* Composite Part */
{
XtInheritGeometryManager, /* geometry_manager */
XtInheritChangeManaged, /* change_managed */
XtInheritInsertChild, /* insert_child */
XtInheritDeleteChild, /* delete_child */
NULL /* extension */
},
/* Shell */
{
NULL, /* extension */
},
/* WMShell */
{
NULL, /* extension */
},
/* VendorShell */
{
NULL, /* extension */
},
/* XfeBypassShell Part */
{
NULL, /* extension */
},
/* XfeToolShell Part */
{
NULL, /* extension */
},
};
/*----------------------------------------------------------------------*/
/* */
/* xfeToolTipShellWidgetClass declaration. */
/* */
/*----------------------------------------------------------------------*/
_XFE_WIDGET_CLASS(tooltipshell,ToolTipShell);
/*----------------------------------------------------------------------*/
/* */
/* Core Class methods */
/* */
/*----------------------------------------------------------------------*/
static void
ClassInitialize()
{
/* Register XfeToolTip Representation Types */
RegisterToolTipPlacement();
RegisterToolTipType();
}
/*----------------------------------------------------------------------*/
static void
Initialize(Widget rw,Widget nw,ArgList args,Cardinal *nargs)
{
XfeToolTipShellPart * tp = _XfeToolTipShellPart(nw);
/* Make sure rep types are ok */
XfeRepTypeCheck(nw,XmRToolTipType,&tp->tool_tip_type,
0);
XfeRepTypeCheck(nw,XmRToolTipPlacement,&tp->tool_tip_type,
0);
/* Make sure read-only resources aren't set */
if (tp->tool_tip_label)
{
_XmWarning(nw,MESSAGE2);
tp->tool_tip_label = NULL;
}
/* Create components */
tp->tool_tip_label = LabelCreate(nw);
/* Initialize private members */
tp->tool_tip_timer_id = 0;
/* Manage the children */
XtManageChild(tp->tool_tip_label);
/* XfeOverrideTranslations(nw,_XfeToolTipShellExtraTranslations); */
}
/*----------------------------------------------------------------------*/
static void
Destroy(Widget w)
{
/* XfeToolTipShellPart * tp = _XfeToolTipShellPart(w); */
}
/*----------------------------------------------------------------------*/
static Boolean
SetValues(Widget ow,Widget rw,Widget nw,ArgList args,Cardinal *nargs)
{
XfeToolTipShellPart * np = _XfeToolTipShellPart(nw);
XfeToolTipShellPart * op = _XfeToolTipShellPart(ow);
/* XmNtoolTipWidget */
if (np->tool_tip_label != op->tool_tip_label)
{
_XmWarning(nw,MESSAGE2);
np->tool_tip_label = op->tool_tip_label;
}
/* XmNtoolTipType */
if (np->tool_tip_type != op->tool_tip_type)
{
}
/* XmNtoolTipPlacement */
if (np->tool_tip_placement != op->tool_tip_placement)
{
}
/* XmNfontList */
if (np->font_list != op->font_list)
{
}
return False;
}
/*----------------------------------------------------------------------*/
static void
GetValuesHook(Widget w,ArgList args,Cardinal* nargs)
{
/* XfeToolTipShellPart * tp = _XfeToolTipShellPart(w); */
Cardinal i;
for (i = 0; i < *nargs; i++)
{
#if 0
/* label_string */
if (strcmp(args[i].name,XmNlabelString) == 0)
{
*((XtArgVal *) args[i].value) =
(XtArgVal) XmStringCopy(lp->label_string);
}
/* font_list */
else if (strcmp(args[i].name,XmNfontList) == 0)
{
*((XtArgVal *) args[i].value) =
(XtArgVal) XmFontListCopy(lp->font_list);
}
#endif
}
}
/*----------------------------------------------------------------------*/
/*----------------------------------------------------------------------*/
/* */
/* Rep type registration functions */
/* */
/*----------------------------------------------------------------------*/
static void
RegisterToolTipPlacement(void)
{
static String names[] =
{
"tool_tip_editable",
"tool_tip_read_only"
};
XmRepTypeRegister(XmRToolTipPlacement,names,NULL,XtNumber(names));
}
/*----------------------------------------------------------------------*/
static void
RegisterToolTipType(void)
{
static String names[] =
{
"tool_tip_editable",
"tool_tip_read_only"
};
XmRepTypeRegister(XmRToolTipType,names,NULL,XtNumber(names));
}
/*----------------------------------------------------------------------*/
/*----------------------------------------------------------------------*/
/* */
/* XfeToolTipShell action procedures */
/* */
/*----------------------------------------------------------------------*/
static void
ActionPopup(Widget item,XEvent * event,char ** params,Cardinal * nparams)
{
Widget w = XfeIsToolTipShell(item) ? item : _XfeParent(item);
XfeToolTipShellPart * tp = _XfeToolTipShellPart(w);
}
/*----------------------------------------------------------------------*/
static void
ActionPopdown(Widget item,XEvent * event,char ** params,Cardinal * nparams)
{
Widget w = XfeIsToolTipShell(item) ? item : _XfeParent(item);
XfeToolTipShellPart * tp = _XfeToolTipShellPart(w);
}
/*----------------------------------------------------------------------*/
static void
ActionHighlight(Widget item,XEvent * event,char ** params,Cardinal * nparams)
{
Widget w = XfeIsToolTipShell(item) ? item : _XfeParent(item);
}
/*----------------------------------------------------------------------*/
/*----------------------------------------------------------------------*/
/* */
/* ToolTipShell widget functions */
/* */
/*----------------------------------------------------------------------*/
static Widget
LabelCreate(Widget w)
{
XfeToolTipShellPart * tp = _XfeToolTipShellPart(w);
Widget widget = NULL;
Arg av[20];
Cardinal ac = 0;
XtSetArg(av[ac],XmNbackground, _XfeBackgroundPixel(w)); ac++;
/* XtSetArg(av[ac],XmNforeground, tp->title_foreground); ac++; */
/* XtSetArg(av[ac],XmNalignment, tp->title_alignment); ac++; */
XtSetArg(av[ac],XmNshadowThickness, 0); ac++;
/* XtSetArg(av[ac],XmNstringDirection, tp->title_direction); ac++; */
XtSetArg(av[ac],XmNraiseBorderThickness, 0); ac++;
XtSetArg(av[ac],XmNraiseOnEnter, False); ac++;
XtSetArg(av[ac],XmNfillOnArm, False); ac++;
XtSetArg(av[ac],XmNarmOffset, 0); ac++;
if (tp->font_list != NULL)
{
XtSetArg(av[ac],XmNfontList, tp->font_list); ac++;
}
widget = XtCreateManagedWidget(TOOL_TIP_LABEL_NAME,
xfeButtonWidgetClass,
w,
av,
ac);
/* XtAddCallback(widget,XmNactivateCallback,TitleActivateCB,w); */
return widget;
}
/*----------------------------------------------------------------------*/
/*----------------------------------------------------------------------*/
/* */
/* XfeToolTipShell Public Methods */
/* */
/*----------------------------------------------------------------------*/
/* extern */ Widget
XfeCreateToolTipShell(Widget pw,char * name,Arg * av,Cardinal ac)
{
return XtCreatePopupShell(name,xfeToolTipShellWidgetClass,pw,av,ac);
}
/*----------------------------------------------------------------------*/
/* extern */ Widget
XfeToolTipShellGetLabel(Widget w)
{
XfeToolTipShellPart * tp = _XfeToolTipShellPart(w);
assert( XfeIsToolTipShell(w) );
assert( _XfeIsAlive(tp->tool_tip_label) );
return tp->tool_tip_label;
}
/*----------------------------------------------------------------------*/

Просмотреть файл

@ -0,0 +1,112 @@
/* -*- Mode: C; tab-width: 4; 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.
*/
/*----------------------------------------------------------------------*/
/* */
/* Name: <Xfe/ToolTipShell.h> */
/* Description: XfeToolTipShell widget public header file. */
/* Author: Ramiro Estrugo <ramiro@netscape.com> */
/* */
/*----------------------------------------------------------------------*/
#ifndef _XfeToolTipShell_h_ /* start ToolTipShell.h */
#define _XfeToolTipShell_h_
#include <Xfe/BypassShell.h>
#include <Xfe/ToolTipStringDefs.h>
#include <Xfe/Button.h>
XFE_BEGIN_CPLUSPLUS_PROTECTION
/*----------------------------------------------------------------------*/
/* */
/* XfeToolTip reasonable defaults for some resources */
/* */
/*----------------------------------------------------------------------*/
#define XfeDEFAULT_TOOL_TIP_BOTTOM_OFFSET 10
#define XfeDEFAULT_TOOL_TIP_LEFT_OFFSET 10
#define XfeDEFAULT_TOOL_TIP_RIGHT_OFFSET 10
#define XfeDEFAULT_TOOL_TIP_TOP_OFFSET 10
#define XfeDEFAULT_TOOL_TIP_TIMEOUT 200
/*----------------------------------------------------------------------*/
/* */
/* XmRToolTipType */
/* */
/*----------------------------------------------------------------------*/
enum
{
XmTOOL_TIP_EDITABLE, /* */
XmTOOL_TIP_READ_ONLY /* */
};
/*----------------------------------------------------------------------*/
/*----------------------------------------------------------------------*/
/* */
/* XfeTip class names */
/* */
/*----------------------------------------------------------------------*/
externalref WidgetClass xfeToolTipShellWidgetClass;
typedef struct _XfeToolTipShellClassRec * XfeToolTipShellWidgetClass;
typedef struct _XfeToolTipShellRec * XfeToolTipShellWidget;
/*----------------------------------------------------------------------*/
/* */
/* XfeTip subclass test macro */
/* */
/*----------------------------------------------------------------------*/
#define XfeIsToolTipShell(w) XtIsSubclass(w,xfeToolTipShellWidgetClass)
/*----------------------------------------------------------------------*/
/* */
/* XfeToolTipShell public methods */
/* */
/*----------------------------------------------------------------------*/
extern Widget
XfeCreateToolTipShell (Widget pw,
String name,
Arg * av,
Cardinal ac);
/*----------------------------------------------------------------------*/
extern Widget
XfeToolTipShellGetLabel (Widget w);
/*----------------------------------------------------------------------*/
extern void
XfeToolTipShellAdd (Widget w);
/*----------------------------------------------------------------------*/
extern void
XfeToolTipShellRemove (Widget w);
/*----------------------------------------------------------------------*/
extern void
XfeToolTipShellAddCallback (Widget w);
/*----------------------------------------------------------------------*/
/*----------------------------------------------------------------------*/
/* */
/* XfeToolTipShellIsShowing() - Check whether the global tooltip is showing */
/* */
/*----------------------------------------------------------------------*/
extern Boolean
XfeToolTipShellIsShowing (void);
/*----------------------------------------------------------------------*/
XFE_END_CPLUSPLUS_PROTECTION
#endif /* end ToolTipShell.h */

Просмотреть файл

@ -0,0 +1,150 @@
/* -*- Mode: C; tab-width: 4; 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.
*/
/*----------------------------------------------------------------------*/
/* */
/* Name: <Xfe/ToolTipShellP.h> */
/* Description: XfeToolTipShell widget private header file. */
/* Author: Ramiro Estrugo <ramiro@netscape.com> */
/* */
/*----------------------------------------------------------------------*/
#ifndef _XfeToolTipShellP_h_ /* start ToolTipShellP.h*/
#define _XfeToolTipShellP_h_
#include <Xfe/ToolTipShell.h>
#include <Xfe/BypassShellP.h>
XFE_BEGIN_CPLUSPLUS_PROTECTION
/*----------------------------------------------------------------------*/
/* */
/* XfeToolTipShellClassPart */
/* */
/*----------------------------------------------------------------------*/
typedef struct
{
XtPointer extension; /* extension */
} XfeToolTipShellClassPart;
/*----------------------------------------------------------------------*/
/* */
/* XfeToolTipShellClassRec */
/* */
/*----------------------------------------------------------------------*/
typedef struct _XfeToolTipShellClassRec
{
CoreClassPart core_class;
CompositeClassPart composite_class;
ShellClassPart shell_class;
WMShellClassPart wm_shell_class;
VendorShellClassPart vendor_shell_class;
XfeBypassShellClassPart xfe_bypass_shell_class;
XfeToolTipShellClassPart xfe_tool_tip_shell_class;
} XfeToolTipShellClassRec;
externalref XfeToolTipShellClassRec xfeToolTipShellClassRec;
/*----------------------------------------------------------------------*/
/* */
/* XfeToolTipShellPart */
/* */
/*----------------------------------------------------------------------*/
typedef struct _XfeToolTipShellPart
{
/* Tool tip resources */
XmFontList font_list; /* Title font list */
Widget tool_tip_label; /* Tool tip label */
int tool_tip_timeout; /* Tool tip timeout */
/* Enumeration resources */
unsigned char tool_tip_type; /* Tool tip type */
unsigned char tool_tip_placement; /* Tool tip placement */
/* Offset resources */
int bottom_offset; /* bottom_offset */
int left_offset; /* left_offset */
int right_offset; /* right_offset */
int top_offset; /* top_offset */
/* Private data -- Dont even look past this comment -- */
XtIntervalId tool_tip_timer_id; /* Tool tip timer id */
} XfeToolTipShellPart;
/*----------------------------------------------------------------------*/
/* */
/* XfeToolTipShellRec */
/* */
/*----------------------------------------------------------------------*/
typedef struct _XfeToolTipShellRec
{
CorePart core;
CompositePart composite;
ShellPart shell;
WMShellPart wm;
VendorShellPart vendor;
XfeBypassShellPart xfe_bypass_shell;
XfeToolTipShellPart xfe_tool_tip_shell;
} XfeToolTipShellRec;
/*----------------------------------------------------------------------*/
/* */
/* XfeToolTipShellPart access macro */
/* */
/*----------------------------------------------------------------------*/
#define _XfeToolTipShellPart(w) \
&(((XfeToolTipShellWidget) w) -> xfe_tool_tip_shell)
/*----------------------------------------------------------------------*/
/* */
/* XfeToolTipShell method invocation functions */
/* */
/*----------------------------------------------------------------------*/
extern void
_XfeToolTipShellLayoutTitle (Widget w);
/*----------------------------------------------------------------------*/
extern void
_XfeToolTipShellLayoutArrow (Widget w);
/*----------------------------------------------------------------------*/
extern void
_XfeToolTipShellDrawHighlight (Widget w,
XEvent * event,
Region region,
XRectangle * clip_rect);
/*----------------------------------------------------------------------*/
extern void
_XfeToolTipShellDrawTitleShadow (Widget w,
XEvent * event,
Region region,
XRectangle * clip_rect);
/*----------------------------------------------------------------------*/
/*----------------------------------------------------------------------*/
/* */
/* XfeToolTipShell - superclass = XfeManager */
/* */
/* Component preparation macros. */
/* */
/*----------------------------------------------------------------------*/
#define _XFE_PREPARE_ARROW XfePrepare1
XFE_END_CPLUSPLUS_PROTECTION
#endif /* end ToolTipShellP.h */

Просмотреть файл

@ -0,0 +1,68 @@
/* -*- Mode: C; tab-width: 4; 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.
*/
/*----------------------------------------------------------------------*/
/* */
/* Name: <Xfe/ToolTipStringDefs.h> */
/* Description: XfeToolTip string definitions. */
/* Author: Ramiro Estrugo <ramiro@netscape.com> */
/* */
/*----------------------------------------------------------------------*/
#ifndef _XfeToolTipStringDefs_h_ /* start ToolTipStringDefs.h*/
#define _XfeToolTipStringDefs_h_
/*----------------------------------------------------------------------*/
/* */
/* Callback Names */
/* */
/*----------------------------------------------------------------------*/
#define XmNtoolTipCallback "toolTipCallback"
/*----------------------------------------------------------------------*/
/* */
/* Resource Names */
/* */
/*----------------------------------------------------------------------*/
#define XmNdocumentationString "documentationString"
#define XmNtipString "tipString"
#define XmNtoolTipPlacement "toolTipPlacement"
#define XmNtoolTipTimeout "toolTipTimeout"
#define XmNtoolTipType "toolTipType"
#define XmNtoolTipLabel "toolTipLabel"
/*----------------------------------------------------------------------*/
/* */
/* Class Names */
/* */
/*----------------------------------------------------------------------*/
#define XmCDocumentationString "DocumentationString"
#define XmCTipString "TipString"
#define XmCToolTipPlacement "ToolTipPlacement"
#define XmCToolTipTimeout "ToolTipTimeout"
#define XmCToolTipType "ToolTipType"
/*----------------------------------------------------------------------*/
/* */
/* Representation Types */
/* */
/*----------------------------------------------------------------------*/
#define XmRToolTipPlacement "ToolTipPlacement"
#define XmRToolTipType "ToolTipType"
#endif /* end ToolTipStringDefs.h */

Просмотреть файл

@ -0,0 +1,43 @@
#! gmake
#
# 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.
#
DEPTH = ../../../../..
CSRCS = \
ToolTipTest.c \
$(NULL)
REQUIRES = \
XfeTest \
XfeToolTip \
XfeBm \
XfeWidgets
STATIC_PROGS = $(addprefix $(OBJDIR)/, $(CSRCS:.c=.static))
SHARED_PROGS = $(addprefix $(OBJDIR)/, $(CSRCS:.c=.shared))
include $(DEPTH)/config/rules.mk
include $(DEPTH)/cmd/xfe/XfeWidgets/XfeWidgets.mk
all:: $(STATIC_PROGS) $(SHARED_PROGS)
install:: $(STATIC_PROGS) $(SHARED_PROGS)
shared: $(SHARED_PROGS)
static: $(STATIC_PROGS)

Просмотреть файл

@ -0,0 +1,113 @@
! -*- Mode: Fundamental; tab-width: 4; indent-tabs-mode: nil -*-
!
! 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.
ToolTipTest*MainForm.width: 800
ToolTipTest*MainForm.height: 400
ToolTipTest*MainForm.background: Gray60
ToolTipTest*MainForm.shadowThickness: 0
ToolTipTest*MainForm.shadowType: shadow_in
!ToolTipTest*fontList: -*-helvetica-medium-r-*-*-*-120-*-*-*-*-iso8859-*
!ToolTipTest*labelFontList: -*-helvetica-medium-r-*-*-*-120-*-*-*-*-iso8859-*
ToolTipTest*foreground: Black
ToolTipTest*titleFontList: -*-helvetica-medium-r-*-*-*-120-*-*-*-*-iso8859-*
ToolTipTest*textFontList: -*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-*
ToolTipTest*XfeToolTip*background: CadetBlue
ToolTipTest*ToolTipShell.background: #FFFFCC
ToolTipTest*ToolTipShell.borderColor: Black
ToolTipTest*ToolTipShell.borderWidth: 1
ToolTipTest*ToolTipLabel.fontList: -*-helvetica-medium-r-*-*-*-120-*-*-*-*-iso8859-*
ToolTipTest*ToolTiplabel.background: #FFFFCC
ToolTipTest*ToolTipLabel.foreground: black
ToolTipTest*XmPushButton.bottomAttachment: attach_none
ToolTipTest*XmPushButton.leftAttachment: attach_form
ToolTipTest*XmPushButton.rightAttachment: attach_none
ToolTipTest*XmPushButton.topOffset: 10
ToolTipTest*XmPushButton.leftOffset: 10
ToolTipTest*XmLabel.bottomAttachment: attach_none
ToolTipTest*XmLabel.leftAttachment: attach_form
ToolTipTest*XmLabel.rightAttachment: attach_none
ToolTipTest*XmLabel.topOffset: 10
ToolTipTest*XmLabel.leftOffset: 10
ToolTipTest*XmPushButtonGadget.bottomAttachment: attach_none
ToolTipTest*XmPushButtonGadget.leftAttachment: attach_form
ToolTipTest*XmPushButtonGadget.rightAttachment: attach_none
ToolTipTest*XmPushButtonGadget.topOffset: 10
ToolTipTest*XmPushButtonGadget.leftOffset: 10
ToolTipTest*XmPushButtonGadget.topAttachment: attach_widget
ToolTipTest*XmLabelGadget.bottomAttachment: attach_none
ToolTipTest*XmLabelGadget.leftAttachment: attach_form
ToolTipTest*XmLabelGadget.rightAttachment: attach_none
ToolTipTest*XmLabelGadget.topOffset: 10
ToolTipTest*XmLabelGadget.leftOffset: 10
ToolTipTest*XmLabelGadget.topAttachment: attach_widget
ToolTipTest*ButtonWidget1.topAttachment: attach_form
ToolTipTest*ButtonWidget2.topAttachment: attach_widget
ToolTipTest*ButtonWidget2.topWidget: ButtonWidget1
ToolTipTest*ButtonWidget3.topAttachment: attach_widget
ToolTipTest*ButtonWidget3.topWidget: ButtonWidget2
ToolTipTest*LabelWidget1.topAttachment: attach_widget
ToolTipTest*LabelWidget1.topWidget: ButtonWidget3
ToolTipTest*LabelWidget2.topAttachment: attach_widget
ToolTipTest*LabelWidget2.topWidget: LabelWidget1
ToolTipTest*LabelWidget3.topAttachment: attach_widget
ToolTipTest*LabelWidget3.topWidget: LabelWidget2
ToolTipTest*XmPushButtonGadget.topAttachment: attach_widget
ToolTipTest*XmPushButtonGadget.bottomAttachment: attach_none
ToolTipTest*XmPushButtonGadget.leftAttachment: attach_form
ToolTipTest*XmPushButtonGadget.rightAttachment: attach_none
ToolTipTest*XmPushButtonGadget.bottomOffset: 10
ToolTipTest*XmPushButtonGadget.leftOffset: 10
ToolTipTest*XmPushButtonGadget.rightOffset: 10
ToolTipTest*XmPushButtonGadget.topOffset: 10
ToolTipTest*XmLabelGadget.topAttachment: attach_widget
ToolTipTest*XmLabelGadget.bottomAttachment: attach_none
ToolTipTest*XmLabelGadget.leftAttachment: attach_form
ToolTipTest*XmLabelGadget.rightAttachment: attach_none
ToolTipTest*XmLabelGadget.bottomOffset: 10
ToolTipTest*XmLabelGadget.leftOffset: 10
ToolTipTest*XmLabelGadget.rightOffset: 10
ToolTipTest*XmLabelGadget.topOffset: 10

Просмотреть файл

@ -0,0 +1,113 @@
/* -*- Mode: C; tab-width: 4; 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.
*/
/*----------------------------------------------------------------------*/
/* */
/* Name: ToolTipTest.c */
/* Description: Test for XfeToolTip widget. */
/* Author: Ramiro Estrugo <ramiro@netscape.com> */
/* */
/*----------------------------------------------------------------------*/
#include <Xfe/XfeTest.h>
#include <Xfe/ToolTip.h>
#include <Xfe/TextCaption.h>
static Widget _button_gadgets[3];
static Widget _label_gadgets[3];
static Widget _button_widgets[3];
static Widget _label_widgets[3];
/*----------------------------------------------------------------------*/
int
main(int argc,char *argv[])
{
Widget form;
Widget frame;
XfeAppCreateSimple("ToolTipTest",&argc,argv,"MainFrame",&frame,&form);
_button_widgets[0] = XmCreatePushButton(form,"ButtonWidget1",NULL,0);
_button_widgets[1] = XmCreatePushButton(form,"ButtonWidget2",NULL,0);
_button_widgets[2] = XmCreatePushButton(form,"ButtonWidget3",NULL,0);
_label_widgets[0] = XmCreateLabel(form,"LabelWidget1",NULL,0);
_label_widgets[1] = XmCreateLabel(form,"LabelWidget2",NULL,0);
_label_widgets[2] = XmCreateLabel(form,"LabelWidget3",NULL,0);
_button_gadgets[0] = XmCreatePushButtonGadget(form,"ButtonGadget1",NULL,0);
_button_gadgets[1] = XmCreatePushButtonGadget(form,"ButtonGadget2",NULL,0);
_button_gadgets[2] = XmCreatePushButtonGadget(form,"ButtonGadget3",NULL,0);
_label_gadgets[0] = XmCreateLabelGadget(form,"LabelGadget1",NULL,0);
_label_gadgets[1] = XmCreateLabelGadget(form,"LabelGadget2",NULL,0);
_label_gadgets[2] = XmCreateLabelGadget(form,"LabelGadget3",NULL,0);
XtVaSetValues(_button_gadgets[0],XmNtopWidget,_label_widgets[2],NULL);
XtVaSetValues(_button_gadgets[1],XmNtopWidget,_button_gadgets[0],NULL);
XtVaSetValues(_button_gadgets[2],XmNtopWidget,_button_gadgets[1],NULL);
XtVaSetValues(_label_gadgets[0],XmNtopWidget,_button_gadgets[2],NULL);
XtVaSetValues(_label_gadgets[1],XmNtopWidget,_label_gadgets[0],NULL);
XtVaSetValues(_label_gadgets[2],XmNtopWidget,_label_gadgets[1],NULL);
/* XtRealizeWidget(form); */
XtManageChild(_button_widgets[0]);
XtManageChild(_button_widgets[1]);
XtManageChild(_button_widgets[2]);
XtManageChild(_label_widgets[0]);
XtManageChild(_label_widgets[1]);
XtManageChild(_label_widgets[2]);
XtManageChild(_button_gadgets[0]);
XtManageChild(_button_gadgets[1]);
XtManageChild(_button_gadgets[2]);
XtManageChild(_label_gadgets[0]);
XtManageChild(_label_gadgets[1]);
XtManageChild(_label_gadgets[2]);
XtPopup(frame,XtGrabNone);
XfeToolTipAdd(_button_widgets[0]);
XfeToolTipAdd(_button_widgets[1]);
/* XfeToolTipAdd(_button_widgets[2]); */
XfeToolTipAdd(_label_widgets[0]);
XfeToolTipAdd(_label_widgets[1]);
/* XfeToolTipAdd(_label_widgets[2]); */
XfeToolTipAdd(_button_gadgets[0]);
XfeToolTipAdd(_button_gadgets[1]);
/* XfeToolTipAdd(_button_gadgets[2]); */
XfeToolTipAdd(_label_gadgets[0]);
XfeToolTipAdd(_label_gadgets[1]);
/* XfeToolTipAdd(_label_gadgets[2]); */
XfeToolTipGlobalSetEnabledState(True);
XfeAppMainLoop();
return 0;
}
/*----------------------------------------------------------------------*/

Просмотреть файл

@ -540,12 +540,14 @@ cmd/xfe/XfeWidgets/Xfe/Makefile
cmd/xfe/XfeWidgets/XfeBm/Makefile
cmd/xfe/XfeWidgets/XfeCaption/Makefile
cmd/xfe/XfeWidgets/XfeComboBox/Makefile
cmd/xfe/XfeWidgets/XfeToolTip/Makefile
cmd/xfe/XfeWidgets/XfeTest/Makefile
cmd/xfe/XfeWidgets/tests/Makefile
cmd/xfe/XfeWidgets/tests/Xfe/Makefile
cmd/xfe/XfeWidgets/tests/XfeBm/Makefile
cmd/xfe/XfeWidgets/tests/XfeCaption/Makefile
cmd/xfe/XfeWidgets/tests/XfeComboBox/Makefile
cmd/xfe/XfeWidgets/tests/XfeToolTip/Makefile
cmd/xfe/XfeWidgets/tests/XmL/Makefile
cmd/xfe/icons/Makefile
cmd/xfe/plugins/Makefile