Example #1
0
static void 
UpdateImList(
    I18nEnv *env,
    char *hostname)
{
    Cardinal i;
    XtArgVal n;
    Widget *im_tog = NULL;
    int ret = NoError;

    /* Clean first the existing list */
    
    /* destroy toggle in radio box is any */
    XtVaGetValues(i18n.inputMethodRC, XmNchildren, &im_tog,
		  XmNnumChildren, &n, NULL);
    if (n) {
	XtUnmanageChildren(im_tog, n);
	for (i=0; i<n; i++) XtDestroyWidget(im_tog[i]);
	im_tog = NULL;
    }    

    /* Empty what we used to have here */
    if (env->ims_sel->ims_list_size) {
	XtFree((char *) env->ims_sel->ims_list);
	env->ims_sel->ims_list = NULL;
	env->ims_sel->ims_list_size = 0 ;
    }

    /* then update the env struct with new ims name and status */
    ret = _DtI18nGetImList(env, hostname);
    if (ret != NoError) {
	_DtTurnOffHourGlass(i18n.inputMethodTB);
	_DtI18nErrorDialog(ret);
    }
}
Example #2
0
/*+++++++++++++++++++++++++++++++++++++++*/
void 
popup_startupBB(
        Widget shell )
{

    if (style.startupDialog == NULL) 
    {
      if (smWindow != NULL)
      {
          if (style.smState.smCompatMode) 
          {
               InfoDialog(((char *)GETMESSAGE(7, 13, 
               "This session was started from an X Window System\n\
startup script.  Startup settings are not valid,\n\
since the session cannot be restored.")), 
                style.startupDialog ? style.startupDialog : style.shell, False);

               return;
          }

          _DtTurnOnHourGlass(shell);  
          GetStartupValues();
          BuildStartup(shell);
          XtManageChild(style.startupDialog);
          _DtTurnOffHourGlass(shell);  
      }

      else /* SM not running - post error dialog */
      {
Example #3
0
static void 
SetImsToggleList(I18nEnv *env)
{
    Cardinal n,i;
    XmString string;
    Widget *im_tog = NULL;
    Arg args[5];
    Boolean found = FALSE;
    Cardinal default_index = 0;

    /* create new toggles */

    if (env->ims_sel->ims_list_size > 0)
	im_tog = (Widget*)XtMalloc(sizeof(Widget) 
				   * env->ims_sel->ims_list_size);


    for (i=0; i< env->ims_sel->ims_list_size; i++) {
	string = XmStringCreateLocalized(env->ims_sel->ims_list[i].im_label);
	n = 0;
	XtSetArg(args[n], XmNlabelString, string); n++;
	XtSetArg(args[n], XmNsensitive, 
		 !(env->ims_sel->ims_list[i].inactive)); n++;
	XtSetArg(args[n], XmNuserData, 
		 env->ims_sel->ims_list[i].im_name); n++;

	/* Need to default to the file_sel->im_name, if in the list */
	if (strcmp(env->file_sel->im_name, 
		   env->ims_sel->ims_list[i].im_name) == 0) {
	    found = TRUE;
	    XtSetArg(args[n], XmNset, True); n++;
	}

	if (env->ims_sel->ims_list[i].im_default) {
	    default_index = i;
	}

	im_tog[i] = XmCreateToggleButtonGadget(i18n.inputMethodRC, 
					       "IM", args, n);
	XmStringFree(string);
    }

    if (env->ims_sel->ims_list_size > 0)
	XtManageChildren(im_tog, env->ims_sel->ims_list_size);

    /* If we provided toggle buttons, but the file_sel->im_name was not 
       found, default it to the default from the locale file. */

    if (im_tog && !found) {
	n = 0;
	XtSetArg(args[n], XmNset, True); n++;
	XtSetValues(im_tog[default_index], args, n);
    }

    if (im_tog)
	XtFree((char *) im_tog);

    _DtTurnOffHourGlass(i18n.inputMethodTB);
}
Example #4
0
void
DialogShell::normalCursor()
{
    // Do nothing if the widget has not been realized

    if (XtIsRealized ( _w ))
    {
        _DtTurnOffHourGlass(_w);
    }
}
Example #5
0
/*+++++++++++++++++++++++++++++++++++++++*/
void 
popup_keyboardBB(
        Widget shell )
{
    if (style.kbdDialog == NULL) 
    {
      _DtTurnOnHourGlass(shell);  
      build_keyboardDlg(shell);
      XtManageChild(style.kbdDialog);
      _DtTurnOffHourGlass(shell);  
    }
    else 
    {
      XtManageChild(style.kbdDialog);
      raiseWindow(XtWindow(XtParent(style.kbdDialog)));
    }
}
Example #6
0
void 
popup_dtwmBB(
        Widget shell )
{
    if (style.dtwmDialog == NULL) {
      _DtTurnOnHourGlass(shell);  
      build_dtwmDlg(shell);
      getDtwmValues();
      XtManageChild(style.dtwmDialog);
      _DtTurnOffHourGlass(shell);  
    }
    else 
    {
        XtManageChild(style.dtwmDialog);
        raiseWindow(XtWindow(XtParent(style.dtwmDialog)));
    }
    dtwm.systemDefaultFlag = False;
}
Example #7
0
void 
popup_i18nBB(
        Widget shell )
{
    int ret = NoError;

    if (style.i18nDialog == NULL) {
      _DtTurnOnHourGlass(shell);  
      BuildI18nDlg(shell);
      ret = InitI18nValues(shell);
      XtManageChild(style.i18nDialog);
      if (ret != NoError)
	  _DtI18nErrorDialog(ret) ;
      _DtTurnOffHourGlass(shell);  
    }
    else 
    {
        XtManageChild(style.i18nDialog);
        raiseWindow(XtWindow(XtParent(style.i18nDialog)));
    }
}
Example #8
0
extern void
day_event(XEvent *event)
{
        static int lastcol, lastrow;
        static XEvent lastevent;
        pr_pos xy;
        int x, y, i, j;
        int boxw, boxh, margin, id;
        Calendar *c = calendar;
        Tick date = c->view->date;
        Boolean in_mbox = False; /* in month boxes ? */
        Editor *e = (Editor*)c->editor;
        ToDo *t = (ToDo*)c->todo;
        GEditor *ge = (GEditor*)c->geditor;
        Day *day_info = (Day *)c->view->day_info;
 
        boxw    = c->view->boxw;
        boxh    = c->view->boxh;
        margin  = c->view->outside_margin;
        x       = event->xbutton.x;
        y       = event->xbutton.y;
 
        /* boundary conditions */
        if ((!(in_mbox = in_moboxes(c, x, y)) && x < MOBOX_AREA_WIDTH+2)
||
                (x > MOBOX_AREA_WIDTH+2 && y < c->view->topoffset)) {
                lastcol=0; lastrow=0;
                return;
        }
        if (in_mbox) {
                xy.x = (x - margin)/ day_info->col_w;
                xy.y = (x - c->view->topoffset)/ day_info->row_h;
        }
        else {
                xy.x    = boxw;
                xy.y    = (y - c->view->topoffset)/boxh;
        }
        switch(event->type) {
        case MotionNotify:
                if (!in_mbox) {
                        if (xy.x !=lastcol || xy.y !=lastrow) {
                                calendar_deselect(c);
                                j = day_xytoclock(c, xy.x, xy.y, date);
                                if (j >= 0) {
                                        c->view->olddate = c->view->date;                                        c->view->date = j;
                                        calendar_select(c, hourSelect, (caddr_t)&xy);
                                }
                                lastcol=xy.x;
                                lastrow=xy.y;
                        }
                }
                break;
        case ButtonPress:
		if (ds_is_double_click(&lastevent, event)) {
			_DtTurnOnHourGlass(c->frame);
			j = day_xytoclock(c, xy.x, xy.y, date);
			if (lastcol == xy.x && lastrow == xy.y)
				show_editor(c, j, next_nhours(j, 1), xy.y == 0 ? True : False);
			if (in_mbox) {
				monthbox_deselect(c);
				monthbox_xytodate(c, x, y);
				monthbox_select(c);
			} else
				show_editor(c, j, next_nhours(j, 1), xy.y == 0 ? True : False);
			_DtTurnOffHourGlass(c->frame);
		} else {
			if (in_mbox) {
				monthbox_deselect(c);
				monthbox_xytodate(c, x, y);
				paint_dayview(c, False, NULL, True);
				calendar_select(c, hourSelect, (caddr_t)NULL);
				monthbox_select(c);
				j = day_xytoclock(c, xy.x, xy.y, date);
				if (editor_showing(e)) {
					set_editor_defaults(e, j,
							    next_nhours(j, 1), False);
					add_all_appt(e);
				}
				if (todo_showing(t)) {
					set_todo_defaults(t);
					add_all_todo(t);
				}
				if (geditor_showing(ge)) {
					set_geditor_defaults(ge, j,
							     next_nhours(j, 1));
					add_all_gappt(ge);
				}
			} else {
				calendar_deselect(c);
				j = day_xytoclock(c, xy.x, xy.y, date);
				if (j >= 0) {
					c->view->olddate = c->view->date;
					c->view->date = j;
					calendar_select(c, hourSelect,
							(caddr_t)&xy);
					if (editor_showing(e)) {
						set_editor_defaults(e, j,
							next_nhours(j, 1), xy.y == 0 ? True : False);
						add_all_appt(e);
					}
					if (todo_showing(t)) {
						set_todo_defaults(t);
						add_all_todo(t);
					}
					if (geditor_showing(ge)) {
						set_geditor_defaults(ge, j,
							next_nhours(j, 1));
						add_all_gappt(ge);
					}
				}
			}
		}
		lastcol=xy.x;
		lastrow=xy.y;
                break;
        default:
        	break;
        };            /* switch */
        lastevent = *event;
}
Example #9
0
extern void
week_event(XEvent *event)
{
    Calendar *c = calendar;
    Props *p = (Props*)c->properties;
    static int lastdate;
    static XEvent lastevent;
    int x, y, i, j, hr, id;
    Week    *w = (Week *)c->view->week_info;
    Selection *wsel;
    Editor *e = (Editor *)c->editor;
    ToDo *t = (ToDo*)c->todo;
    GEditor *ge = (GEditor*)c->geditor;
    static int lastrow, lastcol;
    int row, col;

    x 	= event->xbutton.x;
    y 	= event->xbutton.y;
    wsel    = (Selection *)w->current_selection;

    switch(event->type) {
    case MotionNotify:
        j = week_xytoclock(w, x, y);
        (col = dow(j)) == 0 ? col = 6 : col--;
        if (inchart(w, x, y))
            row = (double)(y - w->chart_y) /
                  (double)(w->chart_hour_height+ w->add_pixels);
        else
            row = wsel->row;
        if (j != lastdate || lastcol != col || lastrow != row) {
            calendar_deselect(c);
            wsel->row = row;
            wsel->col = col;
            if (j > 0) {
                c->view->olddate = c->view->date;
                c->view->date = j;
                calendar_select(c, weekdaySelect, NULL);
            }
        }
        lastcol = wsel->col;
        lastrow = wsel->row;
        lastdate = c->view->date;
        break;
    case ButtonPress:
        j = week_xytoclock(w, x, y);
        if (j == -1)
            return;
        hr = (inchart(w, x, y)) ? week_xytohour(w, x, y) : (wsel->row + w->begin_hour);

        if (ds_is_double_click(&lastevent, event)) {
            _DtTurnOnHourGlass(c->frame);
            if (j == lastdate) {
                show_editor(c, next_nhours(j, hr), next_nhours(j, hr + 1), False);
            }
            else if (editor_showing(e)) {
                set_editor_defaults(e, next_nhours(j, hr), next_nhours(j, hr + 1), False);
                add_all_appt(e);
            }
            _DtTurnOffHourGlass(c->frame);
        }
        else {
            calendar_deselect(c);
            (wsel->col = dow(j)) == 0 ?
            wsel->col = 6 : wsel->col--;
            if (inchart(w, x, y))
                wsel->row = (double)(y - w->chart_y) /
                            (double)(w->chart_hour_height + w->add_pixels);
            if (j > 0) {
                c->view->olddate = c->view->date;
                c->view->date = j;
                calendar_select(c, weekdaySelect, NULL);
            }
            if (editor_showing(e)) {
                set_editor_defaults(e, next_nhours(j, hr), next_nhours(j, hr + 1), False);
                add_all_appt(e);
            }
            if (todo_showing(t)) {
                set_todo_defaults(t);
                add_all_todo(t);
            }
            if (geditor_showing(ge)) {
                set_geditor_defaults(ge, 0, 0);
                add_all_gappt(ge);
            }
        }
        lastdate = c->view->date;
        lastcol = wsel->col;
        lastrow = wsel->row;
        break;
    default:
        break;
    };             /* switch */
    lastevent = *event;
}