コード例 #1
0
static void pglpfw_unmanagePanes ( void )
/************************************************************************
 * pglpfw_unmanagePanes							*
 *									*
 * This function unmanages all the children of the main pane widget.	*
 *									*
 * void pglpfw_unmanagePanes ()						*
 *									*
 * Input parameters:							*
 * Output parameters:							*
 *			NONE						*
 *									*
 **									*
 * Log:									*
 * T. Lee/SAIC		04/02						*
 ***********************************************************************/
{
    if (XtIsManaged (_sortPaneW)) {
	XtUnmanageChild (_sortPaneW);
    }

    if (XtIsManaged (_selectPaneW)) {
	XtUnmanageChild (_selectPaneW);
    }


    if (XtIsManaged (_browseBtnPane)) {
	XtUnmanageChild (_browseBtnPane);
    }

    if (XtIsManaged (_openPaneW)) {
	XtUnmanageChild (_openPaneW);
    }

} 
コード例 #2
0
ファイル: nonlwin.c プロジェクト: TehTreag/xmgr-resurrection
void update_nonl_frame(void)
{
    int i;
    
    if (nonl_frame) {
        XmString str = XmStringCreateSimple(nonl_opts.title);
        XtVaSetValues(nonl_title_item, XmNlabelString, str, NULL);
/* 
 * If I define only XmALIGNMENT_CENTER (default!) then it's ignored - bug in Motif???
 */
    	XtVaSetValues(nonl_title_item, XmNalignment, XmALIGNMENT_BEGINNING, NULL);
        XtVaSetValues(nonl_title_item, XmNalignment, XmALIGNMENT_CENTER, NULL);
        XmStringFree(str);
        
        xv_setstr(nonl_formula_item, nonl_opts.formula);
        sprintf(buf, "%g", nonl_opts.tolerance);
        xv_setstr(nonl_tol_item, buf);
        SetChoice(nonl_nparm_item, nonl_opts.parnum);
        for (i = 0; i < MAXPARM; i++) {
            sprintf(buf, "%g", nonl_parms[i].value);
            xv_setstr(nonl_value_item[i], buf);
            XmToggleButtonSetState(nonl_constr_item[i], nonl_parms[i].constr, False);
            sprintf(buf, "%g", nonl_parms[i].min);
            xv_setstr(nonl_lowb_item[i], buf);
            XtSetSensitive(nonl_lowb_item[i], nonl_parms[i].constr);
            sprintf(buf, "%g", nonl_parms[i].max);
            xv_setstr(nonl_uppb_item[i], buf);
            XtSetSensitive(nonl_uppb_item[i], nonl_parms[i].constr);
            if (i < nonl_opts.parnum) {
                if (!XtIsManaged (nonl_parm_item[i])) {
                    XtManageChild(nonl_parm_item[i]);
                }
            } else {
                if (XtIsManaged (nonl_parm_item[i])) {
                    XtUnmanageChild(nonl_parm_item[i]);
                }
            }
        }
        
        XmToggleButtonSetState(nonl_autol_item, nonl_prefs.autoload, False);
        for (i = 0; i < 3; i++) {
	    XmToggleButtonSetState(nonl_load_item[i], False, False);
        }
        XmToggleButtonSetState(nonl_load_item[nonl_prefs.load], True, False);
        
        if (nonl_prefs.load == LOAD_FUNCTION) {
            XtSetSensitive(nonl_fload_rc, True);
        } else {
            XtSetSensitive(nonl_fload_rc, False);
        }
        
        sprintf(buf, "%g", nonl_prefs.start);
        xv_setstr(nonl_start_item, buf);
        sprintf(buf, "%g", nonl_prefs.stop);
        xv_setstr(nonl_stop_item, buf);
        sprintf(buf, "%d", nonl_prefs.npoints);
        xv_setstr(nonl_npts_item, buf);
    }

}
コード例 #3
0
ファイル: alAudio.c プロジェクト: epics-extensions/alh
/******************************************************
  alhAudioSetupCallback
******************************************************/
void alhAudioSetupCallback( Widget menuButton, XtPointer clientdata,
XtPointer cbs)
{
    /* dismiss the dialog */
    if (audioSetup.audioSetupDialog &&
        XtIsManaged(audioSetup.audioSetupDialog)) {
        audioSetupDismissCallback(audioSetup.audioSetupDialog,
            (XtPointer)menuButton, NULL);
        if (menuButton) XtVaSetValues(menuButton, XmNset, FALSE, NULL);
        return;
    }

    /* create audioSetupWindow and Dialog Widgets if necessary */
    if (!audioSetup.audioSetupDialog)  audioSetupCreateDialog(menuButton);

    /* show Dialog */
    if (!audioSetup.audioSetupDialog) return;
    if (!XtIsManaged(audioSetup.audioSetupDialog)){
        XtManageChild(audioSetup.audioSetupDialog);
    }

    XMapWindow(XtDisplay(audioSetup.audioSetupDialog),
        XtWindow(XtParent(audioSetup.audioSetupDialog)));

    if (menuButton) XtVaSetValues(menuButton, XmNset, TRUE, NULL);
}
コード例 #4
0
ファイル: mask.c プロジェクト: epicsdeb/alh
/******************************************************
  maskShowDialog
******************************************************/
void maskShowDialog(ALINK *area,Widget menuButton)
{
	struct maskWindow *maskWindow;

	maskWindow = (struct maskWindow *)area->maskWindow;

	/* dismiss Dialog */
	if (maskWindow && maskWindow->maskDialog && 
	    XtIsManaged(maskWindow->maskDialog)) {
		maskDismissCallback(NULL, (XtPointer)maskWindow, NULL);
		return;
	}

	/* create maskWindow and Dialog Widgets if necessary */
	if (!maskWindow)  maskCreateDialog(area);

	/* update maskWindow */
	maskWindow = (struct maskWindow *)area->maskWindow;
	maskWindow->menuButton = menuButton;

	/* update Dialog Widgets */
	maskUpdateDialogWidgets(maskWindow);

	/* show Dialog */
	if (!maskWindow->maskDialog) return;
	if (!XtIsManaged(maskWindow->maskDialog)) {
		XtManageChild(maskWindow->maskDialog);
	}
	XMapWindow(XtDisplay(maskWindow->maskDialog),
	    XtWindow(XtParent(maskWindow->maskDialog)));
	if (menuButton) XtVaSetValues(menuButton, XmNset, TRUE, NULL);
}
コード例 #5
0
void pglpfw_popdown ( void )
/************************************************************************
 * pglpfw_popdown							*
 *									*
 * This function puts the file window down. 				*
 *									*
 * void pglpfw_popdown ( )						*
 *									*
 * Input parameters:                                                    *
 * Output parameters:                                                   *
 * Return parameters:                                                   *
 *			NONE						*
 *									*
 **									*
 * Log:									*
 * T. Lee/SAIC		04/02	Created					*
 ***********************************************************************/
{
    if (XtIsManaged (_fileSelW)) {
    	XtUnmanageChild (_fileSelW);
    }

    if (XtIsManaged (_browsePopup)) {
    	XtUnmanageChild (_browsePopup);
    }
}
コード例 #6
0
ファイル: lwlib.c プロジェクト: cpitclaudel/emacs
Widget
lw_raise_all_pop_up_widgets (void)
{
  widget_info* info;
  widget_instance* instance;
  Widget result = NULL;

  for (info = all_widget_info; info; info = info->next)
    for (instance = info->instances; instance; instance = instance->next)
      if (instance->pop_up_p)
	{
	  Widget widget = instance->widget;
	  if (widget)
	    {
	      if (XtIsManaged (widget)
#ifdef USE_MOTIF
		  /* What a complete load of crap!!!!
		     When a dialogShell is on the screen, it is not managed!
		   */
		  || (lw_motif_widget_p (instance->widget) &&
		      XtIsManaged (first_child (widget)))
#endif
		  )
		{
		  if (!result)
		    result = widget;
		  XMapRaised (XtDisplay (widget), XtWindow (widget));
		}
	    }
	}
  return result;
}
コード例 #7
0
ファイル: close_window.c プロジェクト: huilang22/Projects
int shutdown_cmf_external_id()
{

  if (ci_idterminate_dialog && XtIsManaged(ci_idterminate_dialog))
  {
    XMapRaised(XtDisplay(ci_idterminate_shell),
               XtWindow(ci_idterminate_shell));
    post_dialog(ci_idterminate_shell, XmDIALOG_ERROR, 
                 "Unsaved Provisioning Information");
    return(FAILURE);
  }
  
  if (ci_iddetail_form && XtIsManaged(ci_iddetail_form))
  {
    XMapRaised(XtDisplay(ci_iddetail_shell),
               XtWindow(ci_iddetail_shell));
    post_dialog(ci_iddetail_shell, XmDIALOG_ERROR, 
                 "Unsaved Provisioning Information");
    return(FAILURE);
  }
  
  close_cmf_external_id_windows();
  return(SUCCESS);

} /* end shutdown_cmf_external_id */
コード例 #8
0
ファイル: XsMDICanvas.C プロジェクト: 3v1n0/wxWidgets
void XsMDICanvas::_resize (XtPointer)
{
   Dimension   clipHeight;
   Dimension   clipWidth;
   Dimension   canvasHeight;
   Dimension   canvasWidth;
	    
// Check if clip window and canvas are managed

   if (!XtIsManaged (_clipWin) || !XtIsManaged (_drawArea))
      return;
   
// Get the clip window size

   XtVaGetValues (_clipWin, XmNwidth, &clipWidth, XmNheight, &clipHeight, NULL);
   
// Get the canvas size

   XtVaGetValues (_drawArea, XmNwidth, &canvasWidth, XmNheight, &canvasHeight, NULL);

// Force the canvas to be at least as big as the clip window

   if (canvasWidth < clipWidth)
      canvasWidth = clipWidth;
   if (canvasHeight < clipHeight)
      canvasHeight = clipHeight;
			   
   XtVaSetValues (_drawArea, XmNwidth, canvasWidth, XmNheight, canvasHeight, NULL);
}
コード例 #9
0
void mapset_popup ( int func )
/************************************************************************
 * mapset_popup								*
 *                                                                      *
 * This function popups the Apply Map Settings window			*
 *                                                                      *
 * void mapset_popup(func)                                          	*
 *                                                                      *
 * Input parameters:                                                    *
 *	func		int	get or apply map settings		*
 * Output parameters:                                                   *
 * Return parameters:                                                   *
 *                      NONE                                            *
 *                                                                      *
 ** Log:                                                                *
 * M. Li/SAIC           12/01                                           *
 * M. Li/SAIC		01/02	Added function id and _fromWid window	*
 ***********************************************************************/
{
XmString  title_string;
/*---------------------------------------------------------------------*/

    mapset_update();

    switch (func) {
	case MAPSET_APPLY:		/* Apply Map settings 	*/	
	    title_string = XmStringCreateLocalized ("Apply Map Settings");
    	    XtVaSetValues(_mapsetW,
                  XmNdialogTitle,       title_string,
                  NULL);
	    XmStringFree (title_string);

	    if (!XtIsManaged(_toWid)) {
		XtManageChild(_toWid);
	    }
	    if (XtIsManaged(_fromWid)) {
		XtUnmanageChild(_fromWid);
	    }
	    break;

	case MAPSET_GET:		/* Get Map settings	*/ 
	    title_string = XmStringCreateLocalized ("Get Map Settings");
            XtVaSetValues(_mapsetW,
                  XmNdialogTitle,       title_string,
                  NULL);
	    XmStringFree (title_string);

            if (!XtIsManaged(_fromWid)) {
                XtManageChild(_fromWid);
            }
            if (XtIsManaged(_toWid)) {
                XtUnmanageChild(_toWid);
            }
            break;
    }

    XtManageChild(_mapsetW);
}
コード例 #10
0
static void motCanvasSetSize(Ihandle *ih, Widget sb_win, int setsize)
{
  Widget sb_horiz = (Widget)iupAttribGet(ih, "_IUPMOT_SBHORIZ");
  Widget sb_vert = (Widget)iupAttribGet(ih, "_IUPMOT_SBVERT");
  int sb_vert_width=0, sb_horiz_height=0;
  int width, height;
  Dimension border;

  /* IMPORTANT:
   The border, added by the Core, is NOT included in the Motif size.
   So when setting the size, we must compensate the border, 
   so the actual size will be the size we expect. */
  XtVaGetValues(sb_win, XmNborderWidth, &border, NULL);
  width = ih->currentwidth - 2*border;
  height = ih->currentheight - 2*border;

  /* avoid abort in X */
  if (width <= 0) width = 1;
  if (height <= 0) height = 1;

  if (setsize)
  {
    XtVaSetValues(sb_win,
      XmNwidth, (XtArgVal)width,
      XmNheight, (XtArgVal)height,
      NULL);
  }

  if (sb_vert && XtIsManaged(sb_vert))
    sb_vert_width = iupdrvGetScrollbarSize();
  if (sb_horiz && XtIsManaged(sb_horiz))
    sb_horiz_height = iupdrvGetScrollbarSize();

  if (sb_vert_width)
  {
    XtVaSetValues(sb_vert,
      XmNwidth, (XtArgVal)sb_vert_width,
      XmNheight, (XtArgVal)height-sb_horiz_height,
      NULL);
    iupmotSetPosition(sb_vert, width-sb_vert_width, 0);
  }
  if (sb_horiz_height)
  {
    XtVaSetValues(sb_horiz,
      XmNwidth, (XtArgVal)width-sb_vert_width,
      XmNheight, (XtArgVal)sb_horiz_height,
      NULL);
    iupmotSetPosition(sb_horiz, 0, height-sb_horiz_height);
  }

  XtVaSetValues(ih->handle,
    XmNwidth, (XtArgVal)width-sb_vert_width,
    XmNheight, (XtArgVal)height-sb_horiz_height,
    NULL);
}
コード例 #11
0
ファイル: Frame.c プロジェクト: CPFDSoftware-Tony/gmv
/************************************************************************
 *
 *  ChangeManaged
 *	Process a changed in managed state of the child.  If its
 *	size is out of sync with the frame, make a resize request
 *	to change the size of the frame.
 *	Note: called before ConstraintDestroy.
 *
 ************************************************************************/
static void 
ChangeManaged(
        Widget wid )
{
   XmFrameWidget fw = (XmFrameWidget) wid ;

   Widget title_area = (fw->frame.title_area &&
			XtIsManaged(fw->frame.title_area)) ?
			fw->frame.title_area : (Widget) NULL;
   Dimension t_w = 0;
   Dimension t_h = 0;
   Dimension t_bw = (title_area) ? title_area->core.border_width : 0;

   Widget work_area = (fw->frame.work_area &&
			XtIsManaged(fw->frame.work_area)) ?
			fw->frame.work_area : (Widget) NULL;

   Dimension w_w = (work_area) ? work_area->core.width : 0;
   Dimension w_h = (work_area) ? work_area->core.height : 0;
   Dimension w_bw = (work_area) ? work_area->core.border_width : 0;
   Dimension fwWidth, fwHeight;

   if (title_area) 
   {                                          
	/* We don't want the current size of the title object -- width/height
	** may have been set on it. Because we'll be forcing it to the size we
	** want (see ConfigureChildren), we must use the "natural" size here,
	** so query its value now. (Use current border_width.)
        */
	XtWidgetGeometry title_reply;                           
	XtQueryGeometry (title_area, NULL, &title_reply);      
	t_w = (title_reply.request_mode & CWWidth) ?          
		title_reply.width : title_area->core.width;   
	t_h = (title_reply.request_mode & CWHeight) ?       
		title_reply.height : title_area->core.height;
   }                             

   /* need to  check on initial sizing (not null) */
   if (XtIsRealized((Widget)fw) || (XtWidth(fw) == 0) || (XtHeight(fw) == 0)) {
       CalcFrameSize (fw, t_w, t_h, t_bw, w_w, w_h, w_bw,
		      &fwWidth, &fwHeight);

       while (XtMakeResizeRequest ((Widget) fw, 
				   fwWidth, fwHeight,
				   &fwWidth, &fwHeight) == XtGeometryAlmost) 
	 /*EMPTY*/;
       ClearShadow(fw);
   }
 
   ConfigureChildren(fw, NULL, NULL);

   DrawShadow(fw);

   XmeNavigChangeManaged((Widget) fw);
}
コード例 #12
0
ファイル: Frame.c プロジェクト: CPFDSoftware-Tony/gmv
/*ARGSUSED*/
static Boolean 
SetValues(
        Widget cw,
        Widget rw,		/* unused */
        Widget nw,
        ArgList args,		/* unused */
        Cardinal *num_args )	/* unused */
{
   XmFrameWidget current = (XmFrameWidget) cw ;
   XmFrameWidget new_w = (XmFrameWidget) nw ;
   Boolean redisplay = False;
   Widget title_area = (new_w->frame.title_area &&
			XtIsManaged(new_w->frame.title_area)) ?
			new_w->frame.title_area : NULL;
   Dimension t_w = (title_area) ? title_area->core.width : 0;
   Dimension t_h = (title_area) ? title_area->core.height : 0;
   Dimension t_bw = (title_area) ? title_area->core.border_width : 0;

   Widget work_area = (new_w->frame.work_area &&
			XtIsManaged(new_w->frame.work_area)) ?
			new_w->frame.work_area : (Widget) NULL;
   Dimension w_w = (work_area) ? work_area->core.width : 0;
   Dimension w_h = (work_area) ? work_area->core.height : 0;
   Dimension w_bw = (work_area) ? work_area->core.border_width : 0;


   if (!XmRepTypeValidValue( XmRID_SHADOW_TYPE, new_w->frame.shadow_type,
			(Widget) new_w))
   {
      new_w->frame.shadow_type = current->frame.shadow_type;
   }

    if (!XtIsRealized((Widget)new_w)) return False ;

   if (new_w->frame.margin_width != current->frame.margin_width ||
       new_w->frame.margin_height != current->frame.margin_height ||
       new_w->manager.shadow_thickness != current->manager.shadow_thickness)
   {
      CalcFrameSize (new_w, t_w, t_h, t_bw, w_w, w_h, w_bw,
			&new_w->core.width, &new_w->core.height);
   }

   if (new_w -> frame.shadow_type != current -> frame.shadow_type ||
       new_w->frame.margin_width != current->frame.margin_width ||
       new_w->frame.margin_height != current->frame.margin_height ||
       new_w->manager.shadow_thickness != current->manager.shadow_thickness)
   {
     redisplay = True;
   }

   return (redisplay);
}
コード例 #13
0
void
ui_set_visible(
    Widget	widget,
    BOOL	viz
)
{
    if (viz == TRUE && !XtIsManaged(widget))
	XtManageChild(widget);

    else if (viz == FALSE && XtIsManaged(widget))
	XtUnmanageChild(widget);

}
コード例 #14
0
ファイル: close_window.c プロジェクト: huilang22/Projects
int shutdown_corridors()
{
  if (coradd_form && XtIsManaged(coradd_form))
  {
    XMapRaised(XtDisplay(coradd_shell),
               XtWindow(coradd_shell));
    post_dialog(coradd_shell, XmDIALOG_ERROR, 
                 "Unsaved Provisioning Information");
    return(FAILURE);
  }
  
  if (coricb_form && XtIsManaged(coricb_form))
  {
    XMapRaised(XtDisplay(coricb_shell),
               XtWindow(coricb_shell));
    post_dialog(coricb_shell, XmDIALOG_ERROR, 
                 "Unsaved Provisioning Information");
    return(FAILURE);
  }
  
  if (corrate_form && XtIsManaged(corrate_form))
  {
    XMapRaised(XtDisplay(corrate_shell),
               XtWindow(corrate_shell));
    post_dialog(corrate_shell, XmDIALOG_ERROR, 
                 "Unsaved Provisioning Information");
    return(FAILURE);
  }
  
  if (corter_bb && XtIsManaged(corter_bb))
  {
    XMapRaised(XtDisplay(corter_shell),
               XtWindow(corter_shell));
    post_dialog(corter_shell, XmDIALOG_ERROR, 
                 "Unsaved Provisioning Information");
    return(FAILURE);
  }
  
  if (corsel_form && XtIsManaged(corsel_form))
  {
    XMapRaised(XtDisplay(corselect_shell),
               XtWindow(corselect_shell));
    post_dialog(corselect_shell, XmDIALOG_ERROR, 
                 "Unsaved Provisioning Information");
    return(FAILURE);
  }
  
  close_corridors_windows();
  return(SUCCESS);

} /* end shutdown_corridors */
コード例 #15
0
ファイル: PropertiesTab.c プロジェクト: brettatoms/xqs
void PutPropInfo( Window window ) 
{
  Bool show_type, ignore_frames;

  if( ! XtIsManaged(prop_frame) )   return;  

  SetWidgetCursor( tab_form, XC_watch );
  XmTextClear( prop_out );  

  SetStatus( "Retrieving window properties..." );

  show_type = pref_db.propPrefs[0].value;
  ignore_frames = pref_db.propPrefs[1].value;

  xprop( window, show_type, ignore_frames );

  if( XmTextGetLastPosition(prop_out) == 0 )
       XmTextPrintf( prop_out, "No properties defined for window ( 0x%x )",
		     (unsigned int)window );
       /* SetStatus( "No properties defined for window" ); */
  else XtVaSetValues( prop_out, XmNcursorPosition, 0,  NULL );

  ClearStatus();	 
  UnsetWidgetCursor( tab_form );

}
コード例 #16
0
ファイル: XsMDICanvas.C プロジェクト: 3v1n0/wxWidgets
void XsMDICanvas::add (XsMDIWindow *win)
{
   assert (win != 0);

   const int increment = 10;

// Check if we need to allocate more space

   if (_num >= _max)
   {
      XsMDIWindow **newList = new XsMDIWindow*[_max + increment];

      for (int loop = 0; loop < _num; loop++)
         newList[loop] = _list[loop];
      _max += increment;

      delete [] _list;
      _list = newList;
   }

// Add the new window

   _list[_num++] = win;

// Install the parent canvas 

   win->_setWindowParent (_drawArea);

// If the canvas is shown, place the window

   if (XtIsManaged (_base))
      _placeWindow (win);
}
コード例 #17
0
ファイル: Intrinsic.c プロジェクト: sheldonrobinson/VcXsrv
static void CallChangeManaged(
    register Widget		widget)
{
    register Cardinal		i;
    XtWidgetProc		change_managed;
    register WidgetList		children;
    int    			managed_children = 0;

    register CompositePtr cpPtr;
    register CompositePartPtr clPtr;

    if (XtIsComposite (widget)) {
        cpPtr = (CompositePtr)&((CompositeWidget) widget)->composite;
        clPtr = (CompositePartPtr)&((CompositeWidgetClass)
                                    widget->core.widget_class)->composite_class;
    } else return;

    children = cpPtr->children;
    LOCK_PROCESS;
    change_managed = clPtr->change_managed;
    UNLOCK_PROCESS;

    /* CallChangeManaged for all children */
    for (i = cpPtr->num_children; i != 0; --i) {
        CallChangeManaged (children[i-1]);
        if (XtIsManaged(children[i-1])) managed_children++;
    }

    if (change_managed != NULL && managed_children != 0) {
        CALLGEOTAT(_XtGeoTrace(widget,"Call \"%s\"[%d,%d]'s changemanaged\n",
                               XtName(widget),
                               widget->core.width, widget->core.height));
        (*change_managed) (widget);
    }
} /* CallChangeManaged */
コード例 #18
0
static void 
_XmFastExpose(Widget widg)
{
  register int i;
  register Widget child;
  XmGrabShellWidget gs = (XmGrabShellWidget)widg;

  _XmProcessLock();
  (*(XtClass(widg)->core_class.expose)) (widg, NULL, NULL);
  _XmProcessUnlock();
  
  /* Process each windowed child */
  for (i = 0; i < gs->composite.num_children; i++)
    {
      child = gs->composite.children[i];
      
      if (XtIsWidget(child) && XtIsManaged(child)) {
        _XmProcessLock();
	(*(XtClass(child)->core_class.expose)) (child, NULL, NULL);
	_XmProcessUnlock();
      }
    }
  
  XFlush(XtDisplay(widg));
  DrawBorder(widg);
}
コード例 #19
0
ファイル: button.cpp プロジェクト: hgwells/tive
void wxButton::SetDefaultShadowThicknessAndResize()
{
    Widget buttonWidget = (Widget)GetMainWidget();
    bool managed = XtIsManaged( buttonWidget );
    if( managed )
        XtUnmanageChild( buttonWidget );

    XtVaSetValues( buttonWidget,
                   XmNdefaultButtonShadowThickness, 1,
                   NULL );

    if( managed )
        XtManageChild( buttonWidget );

    // this can't currently be done, because user code that calls SetDefault
    // will break otherwise
#if 0
    wxSize best = GetBestSize(), actual = GetSize();
    if( best.x < actual.x ) best.x = actual.x;
    if( best.y < actual.y ) best.y = actual.y;

    if( best != actual )
        SetSize( best );
#endif
    InvalidateBestSize();
}
コード例 #20
0
ファイル: GMUtils.c プロジェクト: unix-junkie/motif
/*******************************************************************
 * Figure out how much size we need. Shrink wrap around the children.
 ****************/
void 
_XmGMCalcSize(XmManagerWidget manager,
#if NeedWidePrototypes
            int margin_width,
            int margin_height,        
#else
            Dimension margin_width,
            Dimension margin_height,        
#endif /* NeedWidePrototypes */
            Dimension *replyWidth,
            Dimension *replyHeight )
{
    register int i ;
    register Widget child ;   
    int right, bottom ;

    *replyWidth = *replyHeight = 0 ;

    for (i = 0; i < manager->composite.num_children; i++) {
        child = manager->composite.children[i];
        if (XtIsManaged (child)) {
          right = XtX(child) + 2*XtBorderWidth(child) + XtWidth(child) ;
            bottom = XtY(child) + 2*XtBorderWidth(child) + XtHeight(child) ;

          if (right > (int) *replyWidth) *replyWidth = right ;
          if (bottom > (int) *replyHeight) *replyHeight = bottom ;
      }
    }

    *replyWidth += margin_width + MGR_ShadowThickness(manager);
    *replyHeight += margin_height + MGR_ShadowThickness(manager);

    if (!(*replyWidth)) *replyWidth = 10;
    if (!(*replyHeight)) *replyHeight = 10;
}
コード例 #21
0
void pgfilterw_popdown ( void )
/************************************************************************
 * pgfilterw_popdown							*
 *									*
 * This function unmanages the display filter window.			*
 *									*
 * void pgfilterw_popdown ( void )					*
 *									*
 * Input parameters:							*
 * Output parameters:							*
 *			NONE						*
 *									*
 **									*
 * Log:									*
 * J. Wu/SAIC		07/04	initial coding				*
 ***********************************************************************/
{
    int		ii;
    /*---------------------------------------------------------------------*/

    if ( XtIsManaged ( _filterForm ) ) {
        XtUnmanageChild ( _filterForm );
    }

    /*
     *  Deactivate filter, so all elements could be displayed.
     */
    _allOn = False;
    for ( ii = 0; ii < _nFilTime[TIME_FILTER]; ii++ ) {
        _filterStatus[ii] = False;
        XmToggleButtonSetState ( _filterChkBtn[ii], False, False );
    }
    pgfilterw_updateFilter ();
}
コード例 #22
0
void g_retrievecursor(int store_id)
{
    Widget wid;
    Window w;
    int x,y;

    if (store_id < 0 || store_id > G_MAX_STORE_CURSOR || SC[store_id].w == 0)
        return;

    wid = XtWindowToWidget(INTERNAL_display,SC[store_id].w);
    if (wid && XtIsManaged(wid) &&
        XmGetVisibility(wid) != XmVISIBILITY_FULLY_OBSCURED) {
        w = SC[store_id].w;
        x = SC[store_id].x;
        y = SC[store_id].y;
    }
    else {
        w = INTERNAL_rootwin;
        x = SC[store_id].rootx;
        y = SC[store_id].rooty;
    }
    XWarpPointer(INTERNAL_display,
                 None,
                 w,
                 0, 0,
                 0, 0,
                 x, y);
    XFlush(INTERNAL_display);
}
コード例 #23
0
int INTERNAL_cursorpos(float *x, float *y)
{
    int    rootx, rooty, wx, wy, ret;
    Window root, child;
    unsigned int mask;
    Widget wid;
    
    *x = *y = 0.0;
    if ((wid=XtWindowToWidget(INTERNAL_display,xwini[GD.win_id].xwin))==NULL)
        return FALSE;
    if (XtIsManaged(wid)==FALSE)
        return FALSE;
    if (XmGetVisibility(wid) == XmVISIBILITY_FULLY_OBSCURED)
        return FALSE;
    ret = (int) XQueryPointer(INTERNAL_display,
                              xwini[GD.win_id].xwin,
                              &root,
                              &child,
                              &rootx, &rooty,
                              &wx, &wy,
                              &mask);
    *x = usercoorx((float) wx);
    *y = usercoory((float) wy);
    return ret;
}
コード例 #24
0
void pggrpch_popdown ( void ) 
/************************************************************************
 * pggrpch_popdown						        *
 *									*
 * This function pops down VG Group Change window.		        *
 *									*
 * void pggrpch_popdown ()					        *
 *									*
 * Input parameters:							*
 * Output parameters:							*
 * Return parameters:							*
 *			NONE						*
 *									*
 **									*
 * Log:									*
 * H. Zeng/EAI		05/01	initial coding				*
 * H. Zeng/EAI          03/02   renamed for new nmap_pggrpch file       *
 ***********************************************************************/
{
/*---------------------------------------------------------------------*/

    if (XtIsManaged (_grpChngWin)) {
	XtUnmanageChild (_grpChngWin);

    }
    
}
コード例 #25
0
ファイル: test15.c プロジェクト: melanj/lesstif
static void
PrintWidgetDetails(Widget W, int index)
{
    Position x,y;
    Dimension h,w;
    Boolean Result;
    XtGeometryMask mode;

    if (!XtIsManaged(W)) return;
    mode = ExpectedResults[index].request_mode;
    w = h = x = y = 0;
    XtVaGetValues(W,
                  XmNwidth, &w,
                  XmNheight, &h,
                  XmNx, &x,
                  XmNy, &y,
                  NULL);
    Result = (mode & CWX ? ExpectedResults[index].x == x : True) &&
             (mode & CWY ? ExpectedResults[index].y == y : True) &&
             (mode & CWWidth ? ExpectedResults[index].width == w : True) &&
             (mode & CWHeight ? ExpectedResults[index].height == h : True);

    GlobalResult1 = GlobalResult1 && Result;

    printf("%14s x %-4i(%4i) y %-4i(%4i) w %-4i(%4i) h %-4i(%4i) %s\n",XtName(W),
           x, (ExpectedResults[index].request_mode & CWX ? ExpectedResults[index].x : x),
           y, (ExpectedResults[index].request_mode & CWY ? ExpectedResults[index].y : y),
           w, (ExpectedResults[index].request_mode & CWWidth ? ExpectedResults[index].width : w),
           h, (ExpectedResults[index].request_mode & CWHeight ? ExpectedResults[index].height : h),
           Result ? "Good" : "Bad");
}
コード例 #26
0
ファイル: Dialog.c プロジェクト: aosm/X11
/*ARGSUSED*/
static void
XawDialogConstraintInitialize(Widget request, Widget cnew,
			      ArgList args, Cardinal *num_args)
{
    DialogWidget dw = (DialogWidget)cnew->core.parent;
    DialogConstraints constraint = (DialogConstraints)cnew->core.constraints;

    if (!XtIsSubclass(cnew, commandWidgetClass)) /* if not a button */
	return;					 /* then just use defaults */

    constraint->form.left = constraint->form.right = XtChainLeft;
    if (dw->dialog.valueW == NULL) 
	constraint->form.vert_base = dw->dialog.labelW;
    else
	constraint->form.vert_base = dw->dialog.valueW;

    if (dw->composite.num_children > 1) {
	WidgetList children = dw->composite.children;
	Widget *childP;

        for (childP = children + dw->composite.num_children - 1;
	   childP >= children; childP-- ) {
	    if (*childP == dw->dialog.labelW || *childP == dw->dialog.valueW)
		break;
	    if (XtIsManaged(*childP) &&
	        XtIsSubclass(*childP, commandWidgetClass)) {
		constraint->form.horiz_base = *childP;
		break;
	    }
	}
    }
}
コード例 #27
0
void MotifUI::DumpWidget(Widget w, boolean verbose, int level)
{
   int i;

   for (i = 0; i < level; i++)
      printf("   ");
   printf("%s : %s", XrmQuarkToString(w->core.xrm_name),
	  w->core.widget_class->core_class.class_name);
   if (verbose)
    {
      int n = (level * 3) + strlen(XrmQuarkToString(w->core.xrm_name)) +
	      strlen(w->core.widget_class->core_class.class_name) + 3;
      for ( ; n < G_width; n++)
         printf(" ");
      if (XtIsManaged(w))
	 printf(" Managed  ");
      else
	 printf(" Unmanaged");
      if (XtIsSensitive(w))
	 printf(" Sensitive  ");
      else
	 printf(" Insensitive");
      if (XtIsRealized(w))
	 printf(" Realized  ");
      else
	 printf(" Unrealized");
      if (w->core.visible)
	 printf("  Visible\n");
      else
	 printf("  Invisible\n");
    }
   else
      printf("\n");
}
コード例 #28
0
ファイル: Form.c プロジェクト: dimkr/tinyxlib
static void
XawFormChangeManaged(Widget w)
{
    FormWidget fw = (FormWidget)w;
    FormConstraints form;
    WidgetList children, childP;
    int num_children = fw->composite.num_children;
    Widget child;

    (*((FormWidgetClass)w->core.widget_class)->form_class.layout)
	(fw, XtWidth(w), XtHeight(w), True);

    fw->form.old_width = XtWidth(w);
    fw->form.old_height = XtHeight(w);
    for (children = childP = fw->composite.children;
	 childP - children < num_children;
	 childP++) {
	child = *childP;
	if (!XtIsManaged(child))
	    continue;
	form = (FormConstraints)child->core.constraints;
#ifndef OLDXAW
	form->form.virtual_x = XtX(child);
	form->form.virtual_y = XtY(child);
#endif
	form->form.virtual_width = XtWidth(child);
	form->form.virtual_height = XtHeight(child);
    }
}
コード例 #29
0
void XmdsManageWindow(Widget w)
{
  if (!XtIsManaged(w))
    XtManageChild(w);
  else
    XmdsRaiseWindow(w);
}
コード例 #30
0
ファイル: DialogShell.C プロジェクト: juddy/edcde
void
DialogShell::manage()
{
    if (NULL == _workArea) return;
    if (!XtIsManaged(_workArea )) XtManageChild(_workArea);
    UIComponent::manage();
}