Пример #1
0
void on_save_object_activate(GtkMenuItem *m, gpointer data) {
	if(curr_obj < 0) {
		quick_message("No object selected.");
		return;
	}
	create_file_selection(save_file, "");
}
Пример #2
0
void
create_windows(const char *host_tag, int instance_count)
{
    char tag[64];

    /* build a nice identifier string for the window titles */
    if (strlen(host_tag) == 0) {
        strcpy(tag, host_name_default);
    } else if (strstr(host_tag, host_name_default)) {
        if (strlen(host_tag) > 63) {
            snprintf(tag, 64, "...%s", host_tag + strlen(host_tag) - 60); /* hope the unique info is at the end */
        } else {
            strcpy(tag, host_tag);
        }
    } else {
        if (strlen(host_name_default) + strlen(host_tag) > 62) {
            snprintf(tag, 64, "%s ...%s", host_name_default, host_tag + strlen(host_tag) + strlen(host_name_default) - 59);
        } else {
            snprintf(tag, 64, "%s %s", host_name_default, host_tag);
        }
    }

    create_main_window(tag, instance_count);
    create_ui_context_menu(main_window);
    create_file_selection(tag);
    create_about_window(tag);
    create_notice_window(tag);
}
Пример #3
0
void create_main ( Widget parent )
/************************************************************************
 *	create_main()							*
 *									*
 *	This module creates the main window area.			*
 *									*
 *	Input parameters:						*
 *	parent	Wiget		parent widget id			*
 *									*
 * S. Wang/GSC	  01/97 extract from old ntrans.c			*
 * S. Wang/GSC	  03/97 change help file table name			*
 * G. Krueger/EAI 11/97 Renamed NxmHelp functions			*
 * E. Safford/SAIC	10/01	make help window 80 columns wide	*
 * T. Piper/SAIC	02/04	Changed name and location of help index	*
 ***********************************************************************/
{

/*---------------------------------------------------------------------*/

	toplevel_form = XtCreateManagedWidget("toplevel_form",
			xmFormWidgetClass, parent,
			NULL,		   0);
	create_top_menubar(toplevel_form);

	create_legend(toplevel_form);
	colrbar_frame = XtVaCreateManagedWidget("colrbar",
				xmFrameWidgetClass, toplevel_form,
				XmNbottomAttachment,XmATTACH_FORM,
				XmNleftAttachment,  XmATTACH_FORM,
				XmNrightAttachment, XmATTACH_FORM,
				NULL);

	NuiColorBarCreate(colrbar_frame,True);
	NuiColorEditPopup(toplevel_form);

	create_drawingW(toplevel_form);
	create_file_selection(toplevel_form);
	create_local_products(toplevel_form);

	NxmPrt_create("ntrans", toplevel_form, ntrans_print);
	create_models(toplevel_form);

	create_selectgroup(toplevel_form);

	NxmHelp_create( toplevel_form, "HelpDialog", "HelpText",
			"$GEMHLP/hlp/ntransIndex.hlp", 20, 80);
}
Пример #4
0
void selection_cb(GtkWidget *ob, long data)
{
   char str[256];

   switch(data)
   {
      case 1:
         selection_start = cur_pos;
         calc_timecode(cur_pos,1);
         gtk_label_set_text(GTK_LABEL(gtk_xlav->FSelStart),timecode);
         break;
      case 2:
         selection_end   = cur_pos;
         calc_timecode(cur_pos,1);
         gtk_label_set_text(GTK_LABEL(gtk_xlav->FSelEnd),timecode);
         break;
      case 3: /* Clear */
         selection_start = -1;
         selection_end   = -1;
         gtk_label_set_text(GTK_LABEL(gtk_xlav->FSelStart),"-:--:--:--");
         gtk_label_set_text(GTK_LABEL(gtk_xlav->FSelEnd),"-:--:--:--");
         break;
      case 4: /* Cut */
      case 5: /* Copy */
         if(check_selection()) return;
         sprintf(str,"e%c %d %d\n",(data==4)?'u':'o',selection_start,selection_end);
         write(out_pipe,str,strlen(str));
         if(data==4)
         {
            selection_start = -1;
            selection_end   = -1;
            gtk_label_set_text(GTK_LABEL(gtk_xlav->FSelStart),"-:--:--:--");
            gtk_label_set_text(GTK_LABEL(gtk_xlav->FSelEnd),"-:--:--:--");
         }
         break;
      case 6: /* Paste */
         if(check_selection()) return;
         selection_start = -1;
         selection_end   = -1;
         gtk_label_set_text(GTK_LABEL(gtk_xlav->FSelStart),"-:--:--:--");
         gtk_label_set_text(GTK_LABEL(gtk_xlav->FSelEnd),"-:--:--:--");
         write(out_pipe,"ep\n",3);
         break;
      case 7: /* Save All */
         savetype=SAVE_ALL;
         create_file_selection();
         break;
      case 8: /* Save  */
         if(check_selection()) return;
         savetype=SAVE_SEL;
         create_file_selection();
         break;
      case 11:
         if(selection_start >= 0)
         {
            sprintf(str,"s%d\n",selection_start);
            write(out_pipe,str,strlen(str));
         }
         else
            printf("Selection Start is not set!\n");
         break;
      case 12:
         if(selection_end >= 0)
         {
            sprintf(str,"s%d\n",selection_end);
            write(out_pipe,str,strlen(str));
         }
         else
            printf("Selection End is not set!\n");
         break;
      default:
         printf("selection %ld\n",data);
   }
}