Exemplo n.º 1
0
static void make_command_widget(int height)
{
  if (!listener_text)
    {
      Arg args[32];
      Widget wv, wh;
      int n;

      if (!actions_loaded) {XtAppAddActions(MAIN_APP(ss), acts, NUM_ACTS); actions_loaded = true;}

      n = attach_all_sides(args, 0);
      XtSetArg(args[n], XmNheight, height); n++;
      if ((sound_style(ss) == SOUNDS_IN_NOTEBOOK) || (sound_style(ss) == SOUNDS_HORIZONTAL))
	listener_pane = XtCreateManagedWidget("frm", xmFormWidgetClass, SOUND_PANE_BOX(ss), args, n);
      else listener_pane = XtCreateManagedWidget("frm", xmFormWidgetClass, SOUND_PANE(ss), args, n);
      /* this widget is not redundant at least in Metroworks Motif */

      n = 0;
      XtSetArg(args[n], XmNbackground, ss->sgx->listener_color); n++;
      XtSetArg(args[n], XmNforeground, ss->sgx->listener_text_color); n++;
      if (ss->sgx->listener_fontlist) {XtSetArg(args[n], XM_FONT_RESOURCE, ss->sgx->listener_fontlist); n++;}
      n = attach_all_sides(args, n);
      XtSetArg(args[n], XmNeditMode, XmMULTI_LINE_EDIT); n++;
      XtSetArg(args[n], XmNskipAdjust, true); n++;
      XtSetArg(args[n], XmNvalue, listener_prompt(ss)); n++;
      XtSetArg(args[n], XmNpendingDelete, false); n++; /* don't cut selection upon paste */
      XtSetArg(args[n], XmNpositionIndex, XmLAST_POSITION); n++;
      XtSetArg(args[n], XmNhighlightThickness, 1); n++;
      listener_text = XmCreateScrolledText(listener_pane, "lisp-listener", args, n);
      ss->sgx->listener_pane = listener_text;

      XtVaSetValues(MAIN_SHELL(ss), XmNallowShellResize, false, NULL);

      XtManageChild(listener_text);
      XmTextSetCursorPosition(listener_text, 1);
      if (!transTable4) 
	transTable4 = XtParseTranslationTable(TextTrans4);
      XtOverrideTranslations(listener_text, transTable4);
      printout_end = 0;
      XtAddCallback(listener_text, XmNactivateCallback, command_return_callback, NULL);
      XtAddCallback(listener_text, XmNmodifyVerifyCallback, command_modify_callback, NULL);
      XtAddCallback(listener_text, XmNmotionVerifyCallback, command_motion_callback, NULL);

      lisp_window = XtParent(listener_text);
      XtAddEventHandler(lisp_window, EnterWindowMask, false, listener_focus_callback, NULL);
      XtAddEventHandler(lisp_window, LeaveWindowMask, false, listener_unfocus_callback, NULL);
      
      XmChangeColor(lisp_window, ss->sgx->basic_color);
      XtVaGetValues(lisp_window, XmNverticalScrollBar, &wv, XmNhorizontalScrollBar, &wh, NULL);
      XmChangeColor(wv, ss->sgx->basic_color);
      XmChangeColor(wh, ss->sgx->basic_color);
      map_over_children(SOUND_PANE(ss), color_sashes);

      if (auto_resize(ss))
	XtVaSetValues(MAIN_SHELL(ss), XmNallowShellResize, true, NULL);
    }
}
Exemplo n.º 2
0
void iupmotSetBgColor(Widget w, Pixel color)
{
  Pixel fgcolor;
  XtVaGetValues(w, XmNforeground, &fgcolor, NULL);
  XmChangeColor(w, color);
  /* XmChangeColor also sets the XmNforeground color, so we must reset to the previous one. */
  XtVaSetValues(w, XmNforeground, fgcolor, NULL);
  XtVaSetValues(w, XmNbackgroundPixmap, XmUNSPECIFIED_PIXMAP, NULL);
}
Exemplo n.º 3
0
void fb_set_button_bg_color (EIF_POINTER client, EIF_POINTER pix)
{
	font_box_data *fbd = (font_box_data *) client;
	/*  Need to only set the parent color since
		children are gadgets (i.e. gadgets automatically
		get the color of the parent) */

	if (fbd->number_family)
		XmChangeColor (XtParent((fbd->family_menu_buttons)[0]), (Pixel) pix);
	if (fbd->number_slant)
		XmChangeColor (XtParent((fbd->slant_menu_buttons)[0]), (Pixel) pix);
	if (fbd->number_width)
		XmChangeColor (XtParent((fbd->width_menu_buttons)[0]), (Pixel) pix);
	if (fbd->number_weight)
		XmChangeColor (XtParent((fbd->weight_menu_buttons)[0]), (Pixel) pix);
	if (fbd->number_point)
		XmChangeColor (XtParent((fbd->point_menu_buttons)[0]), (Pixel) pix);
	if (fbd->number_resolution)
		XmChangeColor (XtParent((fbd->resolution_menu_buttons)[0]), (Pixel) pix);
	XmChangeColor (XtParent(fbd->stand_fonts_button), (Pixel) pix);
}
Exemplo n.º 4
0
void color_listener(Pixel pix)
{
  ss->sgx->listener_color = pix;
  if (listener_text)
    XmChangeColor(listener_text, pix);
}