Пример #1
0
/*----------------------------------------------------------------------*/
/* extern */ void
XfeShellSetIconicState(Widget shell,Boolean state)
{
  /*
	Because of weirdness in Xt/Shell.c, one can't change the "iconic"
	flag of a shell after it has been created but before it has been realized.
	That resource is only checked when the shell is Initialized (ie, when
	XtCreatePopupShell is called) instead of the more obvious times like:
	when it is Realized (before the window is created) or when it is Managed
	(before window is mapped).
	
	The Shell class's SetValues method does not modify wm_hints.initial_state
	if the widget has not yet been realized - it ignores the request until
	afterward, when it's too late.
   */

    assert( XtIsWMShell(shell) );

	if (_XfeIsAlive(shell))
	{
		WMShellWidget wms = (WMShellWidget) shell;
		
		XtVaSetValues(shell,XtNiconic,state,NULL);
		
		wms->wm.wm_hints.flags |= StateHint;
		wms->wm.wm_hints.initial_state = (state ? IconicState : NormalState);
	}
}
Пример #2
0
static void
mark_shell_size_user_specified (Widget wmshell)
{
  if (! XtIsWMShell (wmshell)) emacs_abort ();
  /* This is kind of sleazy, but I can't see how else to tell it to make it
     mark the WM_SIZE_HINTS size as user specified when appropriate. */
  ((WMShellWidget) wmshell)->wm.size_hints.flags |= USSize;
}
Пример #3
0
static Widget
get_wm_shell (Widget w)
{
  Widget wmshell;

  for (wmshell = XtParent (w);
       wmshell && !XtIsWMShell (wmshell);
       wmshell = XtParent (wmshell));

  return wmshell;
}
Пример #4
0
/*----------------------------------------------------------------------*/
/* extern */ Boolean
XfeShellGetIconicState(Widget shell)
{
	Boolean state = False;

    assert( XtIsWMShell(shell) );

	if (_XfeIsAlive(shell))
	{
		XtVaGetValues(shell,XtNiconic,&state,NULL);
	}

	return state;
}
Пример #5
0
void wm_set_icon(Widget shell, Pixmap icon, Pixmap mask)
{
    if (XtIsWMShell(shell))
    {
	XtVaSetValues(shell,
		      XmNiconPixmap, icon,
		      XmNiconMask, mask,
		      XtPointer(0));
    }

#if 0				// This should be done by the shell.
    wm_set_icon(XtDisplay(shell), XtWindow(shell), icon, mask);
#endif
}
Пример #6
0
void PostMacroEditDialog(Widget wid, char *cmd, XtPointer cd)
{
    int n;
    Arg wargs[10];
    Widget w = wid;
    Widget fr, rc, rc1, rc2, list, text;
    Widget clear;
    StdForm *sf;
    
    while (!XtIsWMShell(w))
        w = XtParent(w);
    
    sf = PostStdFormDialog(w, "Macro Editor",
             BUTT_APPLY, (XtCallbackProc)RunMacro, NULL,
             BUTT_CANCEL, NULL, NULL,
             NULL, NULL, NULL, 0, NULL);

    fr = XtVaCreateWidget("frame", xmFrameWidgetClass,
				          sf->form, XmNshadowType, XmSHADOW_OUT, NULL);
    rc = XtVaCreateWidget("rowcol", xmRowColumnWidgetClass, fr,
                          XmNorientation, XmHORIZONTAL,
                          NULL);
    rc1 = XtVaCreateWidget("rowcol", xmRowColumnWidgetClass, rc,
                          XmNorientation, XmVERTICAL,
                          NULL);
    rc2 = XtVaCreateWidget("rowcol", xmRowColumnWidgetClass, rc,
                          XmNorientation, XmVERTICAL,
                          NULL);
    XtCreateManagedWidget("Available macro commands:", xmLabelWidgetClass,
                          rc1, NULL, 0);
    XtCreateManagedWidget("Macro:", xmLabelWidgetClass,
                          rc2, NULL, 0);
    n = 0;
    XtSetArg(wargs[n], XmNitemCount, nMacroCmds); n++;
    XtSetArg(wargs[n], XmNitems, xMacroCmdStrs); n++;
    XtSetArg(wargs[n], XmNvisibleItemCount, 15); n++;
    XtSetArg(wargs[n], XmNfontList, gp->flist12); n++;
    XtSetArg(wargs[n], XmNselectionPolicy, XmSINGLE_SELECT); n++;
    list = XmCreateScrolledList(rc1, "list", wargs, n);
    
    text = XtVaCreateManagedWidget("text", xmTextWidgetClass, rc2,
                                   XmNeditMode, XmMULTI_LINE_EDIT,
                                   XmNcolumns, 25,
                                   XmNrows, 15,
                                   XmNfontList, gp->flist12,
                                   NULL);
    clear = XtCreateManagedWidget("Clear", xmPushButtonWidgetClass,
                                  rc2, NULL, 0);

    XtAddCallback(list, XmNsingleSelectionCallback,
                  (XtCallbackProc)SelectMacroCmdCallback, text);
    XtAddCallback(clear, XmNactivateCallback,
                  (XtCallbackProc)ClearMacro, text);
    
    ArrangeStdFormDialog(sf, rc);

    XtManageChild(list);
    XtManageChild(rc1);                
    XtManageChild(rc2);                
    XtManageChild(rc);                
    XtManageChild(fr);
    
    UpdateMacroWindow(text);     
    
    ManageDialogCenteredOnPointer(sf->form);
}