backing out Akanna's changes that broke Irix

This commit is contained in:
sar%netscape.com 1998-07-28 08:33:24 +00:00
Родитель cdedb8da6c
Коммит 4295429c61
2 изменённых файлов: 106 добавлений и 111 удалений

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

@ -1029,114 +1029,3 @@ D( printf ("Creating pulldown menu\n");)
}
#endif
//
// "C" routines moved from SearchRuleView.cpp because they're needed
// by more than just MOZ_MAIL_NEWS
//
extern "C" Widget
fe_make_option_menu(Widget toplevel, Widget parent, char* widgetName, Widget *popup)
{
Cardinal ac;
Arg av[10];
Widget option_menu;
Visual* v = 0;
Colormap cmap = 0;
Cardinal depth = 0;
XtVaGetValues(toplevel, XtNvisual, &v, XtNcolormap, &cmap,
XtNdepth, &depth, 0);
ac = 0;
XtSetArg(av[ac], XmNvisual, v); ac++;
XtSetArg(av[ac], XmNdepth, depth); ac++;
XtSetArg(av[ac], XmNcolormap, cmap); ac++;
*popup= XmCreatePulldownMenu(parent, widgetName, av, ac);
ac = 0;
XtSetArg(av[ac], XmNsubMenuId, *popup); ac++;
XtSetArg(av[ac], XmNmarginWidth, 0); ac++;
option_menu = XmCreateOptionMenu(parent, widgetName, av, ac);
XtUnmanageChild(XmOptionLabelGadget(option_menu));
return option_menu;
}
extern "C" void
fe_get_option_size ( Widget optionMenu,
Dimension *retWidth, Dimension *retHeight )
{
Dimension width = 0, height = 0;
Dimension mh=0, mw=0, ml=0, mr=0, mt=0, mb=0 ; /*margin*/
Dimension st=0, bw=0, ht=0;
Dimension space=0;
WidgetList children;
Cardinal numChildren;
Widget popupW;
Widget btn;
*retWidth = 0;
*retHeight = 0;
XtVaGetValues(optionMenu,
XmNsubMenuId, &popupW, 0);
XtVaGetValues(popupW,
XmNchildren, &children,
XmNnumChildren, &numChildren, 0);
if ( numChildren > 0 )
{
btn = children[0];
XtVaGetValues(btn, XmNwidth, &width,
XmNheight, &height,
XmNmarginHeight, &mh,
XmNmarginWidth, &mw,
XmNmarginLeft, &ml,
XmNmarginRight, &mr,
XmNmarginBottom, &mb,
XmNmarginTop, &mt,
XmNhighlightThickness, &ht,
XmNshadowThickness, &st,
XmNborderWidth, &bw,
0);
XtVaGetValues(optionMenu, XmNspacing, &space, 0);
*retHeight = height + (mh+mt+mb+bw+st+ht + space ) * 2;
*retWidth= width + (mw+ml+mr+bw+st+ht + space) * 2;
}
}
extern "C" Boolean
fe_set_current_attribute_option(Widget parent, int btnPos )
{
unsigned char type;
WidgetList children;
Cardinal numChildren;
Widget pulldownW;
if ( XmIsRowColumn(parent) )
{
XtVaGetValues(parent, XmNrowColumnType, &type,
XmNsubMenuId, &pulldownW,
0);
if ( type == XmMENU_OPTION && pulldownW)
{
XtVaGetValues(pulldownW,
XmNchildren, &children,
XmNnumChildren, &numChildren,0 );
if ( (int)numChildren > btnPos && btnPos >= 0)
{
XtVaSetValues(parent, XmNmenuHistory,
children[btnPos], 0);
return True;
}
}
}
return False;
}

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

@ -54,6 +54,112 @@ extern int XFE_SEARCH_INVALID_YEAR;
const char *XFE_SearchRuleView::activateSearch = "XFE_SearchRuleView::activateSearch";
//--- C utilities function ---
extern "C" Widget
fe_make_option_menu(Widget toplevel, Widget parent, char* widgetName, Widget *popup)
{
Cardinal ac;
Arg av[10];
Widget option_menu;
Visual* v = 0;
Colormap cmap = 0;
Cardinal depth = 0;
XtVaGetValues(toplevel, XtNvisual, &v, XtNcolormap, &cmap,
XtNdepth, &depth, 0);
ac = 0;
XtSetArg(av[ac], XmNvisual, v); ac++;
XtSetArg(av[ac], XmNdepth, depth); ac++;
XtSetArg(av[ac], XmNcolormap, cmap); ac++;
*popup= XmCreatePulldownMenu(parent, widgetName, av, ac);
ac = 0;
XtSetArg(av[ac], XmNsubMenuId, *popup); ac++;
XtSetArg(av[ac], XmNmarginWidth, 0); ac++;
option_menu = XmCreateOptionMenu(parent, widgetName, av, ac);
XtUnmanageChild(XmOptionLabelGadget(option_menu));
return option_menu;
}
extern "C" void
fe_get_option_size ( Widget optionMenu,
Dimension *retWidth, Dimension *retHeight )
{
Dimension width = 0, height = 0;
Dimension mh=0, mw=0, ml=0, mr=0, mt=0, mb=0 ; /*margin*/
Dimension st=0, bw=0, ht=0;
Dimension space=0;
WidgetList children;
Cardinal numChildren;
Widget popupW;
Widget btn;
*retWidth = 0;
*retHeight = 0;
XtVaGetValues(optionMenu,
XmNsubMenuId, &popupW, 0);
XtVaGetValues(popupW,
XmNchildren, &children,
XmNnumChildren, &numChildren, 0);
if ( numChildren > 0 )
{
btn = children[0];
XtVaGetValues(btn, XmNwidth, &width,
XmNheight, &height,
XmNmarginHeight, &mh,
XmNmarginWidth, &mw,
XmNmarginLeft, &ml,
XmNmarginRight, &mr,
XmNmarginBottom, &mb,
XmNmarginTop, &mt,
XmNhighlightThickness, &ht,
XmNshadowThickness, &st,
XmNborderWidth, &bw,
0);
XtVaGetValues(optionMenu, XmNspacing, &space, 0);
*retHeight = height + (mh+mt+mb+bw+st+ht + space ) * 2;
*retWidth= width + (mw+ml+mr+bw+st+ht + space) * 2;
}
}
extern "C" Boolean
fe_set_current_attribute_option(Widget parent, int btnPos )
{
unsigned char type;
WidgetList children;
Cardinal numChildren;
Widget pulldownW;
if ( XmIsRowColumn(parent) )
{
XtVaGetValues(parent, XmNrowColumnType, &type,
XmNsubMenuId, &pulldownW,
0);
if ( type == XmMENU_OPTION && pulldownW)
{
XtVaGetValues(pulldownW,
XmNchildren, &children,
XmNnumChildren, &numChildren,0 );
if ( (int)numChildren > btnPos && btnPos >= 0)
{
XtVaSetValues(parent, XmNmenuHistory,
children[btnPos], 0);
return True;
}
}
}
return False;
}
/*---------------------------------------------------------------
This part should be belonging to libmsg. This part is
copied from winfe