summaryrefslogtreecommitdiff
path: root/biblio/bibtex/utils/xbibfile/probes.c
blob: fb5babfa4ded157640f25c34addd03f50a99c4a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
/* This file is a part of XBibFile - a system for handling BibTeX references
 *
 * Author:   Ross Maloney
 * Date:     January 2002
 *
 */

#include  <gtk/gtk.h>


//extern  int format;


/* This procedure produces a window allowing selection of the
 * procedures for exploring the reference database */

void probe_menu(GtkWidget *widget)
{
  GtkTooltips *tooltips;
  GtkWidget   *window, *panel, *description, *selectionKeypad, *finish;
  GtkWidget   *separator, *keycentre;
  GtkWidget   *allkey, *allauthorkey, *allyearkey;
  GtkWidget   *wordkey, *authorkey, *yearkey, *refkey, *uplinkkey;
  GtkWidget   *journalkey, *typekey, *future3;
  GtkWidget   *spacer1key, *spacer2key;

  extern  void  close_window();   /* defined in file cleanup.c */
  extern  void  all();            /* defined in file listall.c */
  extern  void  word();           /* defined in file listword.c */
  extern  void  allyears();       /* defined in file listyears.c */
  extern  void  allauthors();     /* defined in file listauthors.c */
  extern  void  find_author();    /* defined in file listwriter.c */
  extern  void  find_year();      /* defined in file listpubyear.c */
  extern  void  viewref();        /* defined in file listref.c */
  extern  void  alluplinks();     /* defined in file listuplinks.c */


                    /* create the tooltip help feature */

  tooltips = gtk_tooltips_new();

                    /* form the outline of the window */

  window = gtk_window_new(GTK_WINDOW_TOPLEVEL); 
  gtk_window_set_title(GTK_WINDOW(window), "XBibFile select");
  gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_MOUSE);
  gtk_window_set_default_size(GTK_WINDOW(window), 420, 160);
  panel = gtk_vbox_new(FALSE, 10);
  gtk_container_add(GTK_CONTAINER(window), panel);
  gtk_container_set_border_width(GTK_CONTAINER(window), 10);
  description = gtk_label_new("Select a reference database probe");
  gtk_box_pack_start_defaults(GTK_BOX(panel), description);
  selectionKeypad = gtk_table_new(5, 4, TRUE);
  gtk_widget_set_usize(GTK_WIDGET(selectionKeypad), 390, 180);
  gtk_box_pack_start_defaults(GTK_BOX(panel), selectionKeypad);
  separator = gtk_hseparator_new();
  gtk_box_pack_start_defaults(GTK_BOX(panel), separator);
  keycentre = gtk_table_new(1, 3, TRUE);
  gtk_box_pack_start_defaults(GTK_BOX(panel), keycentre);
  finish = gtk_button_new_with_label("Cancel");
  gtk_widget_set_usize(GTK_WIDGET(keycentre), 390, 30);
  g_signal_connect(GTK_OBJECT(finish), "clicked",
                   G_CALLBACK(close_window), NULL);
  gtk_table_attach_defaults(GTK_TABLE(keycentre), finish, 1, 2, 0, 1);
  gtk_tooltips_set_tip(tooltips, finish,
                      "Finished inspecting that reference database", NULL);

                    /* connect the List all references present process */
  allkey = gtk_button_new_with_label("List all");
  gtk_table_attach_defaults(GTK_TABLE(selectionKeypad),
                            allkey, 0, 1, 0 ,1);
  g_signal_connect(GTK_OBJECT(allkey), "clicked",
                   G_CALLBACK(all), NULL);
  gtk_tooltips_set_tip(tooltips, allkey,
                       "Show all ref_type/tag/title fields", NULL);

                    /* List the authors of all references present */
  allauthorkey = gtk_button_new_with_label("List all authors");
  gtk_table_attach_defaults(GTK_TABLE(selectionKeypad),
                            allauthorkey, 0, 1, 1 ,2);
  g_signal_connect(GTK_OBJECT(allauthorkey), "clicked",
                   G_CALLBACK(allauthors), NULL);
  gtk_tooltips_set_tip(tooltips, allauthorkey,
                       "Show ref_type/tag/title tag fields for all author fields in database", NULL);

                    /* List the publication year of all references present */
  allyearkey = gtk_button_new_with_label("List all years");
  gtk_table_attach_defaults(GTK_TABLE(selectionKeypad),
                            allyearkey, 0, 1, 2 ,3);
  g_signal_connect(GTK_OBJECT(allyearkey), "clicked",
                   G_CALLBACK(allyears), NULL);
  gtk_tooltips_set_tip(tooltips, allyearkey,
                       "Show ref_type/tag/title fields for all publication fields in database", NULL);

                    /* connect the List references by word present */
  wordkey = gtk_button_new_with_label("List by word");
  gtk_table_attach_defaults(GTK_TABLE(selectionKeypad),
                            wordkey, 1, 2, 0 ,1);
  g_signal_connect(GTK_OBJECT(wordkey), "clicked",
                   G_CALLBACK(word), NULL);
  gtk_tooltips_set_tip(tooltips, wordkey,
                       "Show ref_type/tag/title fields corresponding to matches of specified word", NULL);

                    /* connect the List references by specified author */
  authorkey = gtk_button_new_with_label("List by author");
  gtk_table_attach_defaults(GTK_TABLE(selectionKeypad),
                            authorkey, 1, 2, 1 ,2);
  g_signal_connect(GTK_OBJECT(authorkey), "clicked",
                   G_CALLBACK(find_author), NULL);
  gtk_tooltips_set_tip(tooltips, authorkey,
                       "Show ref_type/tag/title fields corresponding to specified author", NULL);


                    /* connect the List references by year of publication */
  yearkey = gtk_button_new_with_label("List by year");
  gtk_table_attach_defaults(GTK_TABLE(selectionKeypad),
                            yearkey, 1, 2, 2 ,3);
  g_signal_connect(GTK_OBJECT(yearkey), "clicked",
                   G_CALLBACK(find_year), NULL);
  gtk_tooltips_set_tip(tooltips, yearkey,
                       "Show ref_type/tag/title fields for a specified year",
		       NULL);

                    /* connect the List references by publishing journal */
  journalkey = gtk_button_new_with_label("FUTURE 1");
  gtk_table_attach_defaults(GTK_TABLE(selectionKeypad),
                            journalkey, 1, 2, 3 ,4);
  gtk_tooltips_set_tip(tooltips, journalkey,
                       "Not currently used", NULL);

                    /* connect the List references by reference type */
  typekey = gtk_button_new_with_label("FUTURE 2");
  gtk_table_attach_defaults(GTK_TABLE(selectionKeypad),
                            typekey, 1, 2, 4 ,5);
  gtk_tooltips_set_tip(tooltips, typekey,
                       "Not currently used", NULL);
  future3 = gtk_button_new_with_label("FUTURE 3");
  gtk_table_attach_defaults(GTK_TABLE(selectionKeypad),
                            future3, 1, 2, 5 ,6);
  gtk_tooltips_set_tip(tooltips, future3,
                       "Not currently used", NULL);

                    /* connect the List references uplinks given */
  uplinkkey = gtk_button_new_with_label("List by uplink");
  gtk_table_attach_defaults(GTK_TABLE(selectionKeypad),
                            uplinkkey, 2, 3, 0 ,1);
  g_signal_connect(GTK_OBJECT(uplinkkey), "clicked",
                   G_CALLBACK(alluplinks), NULL);
  gtk_tooltips_set_tip(tooltips, uplinkkey,
                       "List reference citations via 'uplink' mechanism", NULL);

                    /* find the whole reference via its tag */
  refkey = gtk_button_new_with_label("View Reference");
  gtk_table_attach_defaults(GTK_TABLE(selectionKeypad),
                            refkey, 3, 4, 0 ,1);
  g_signal_connect(GTK_OBJECT(refkey), "clicked",
                   G_CALLBACK(viewref), NULL);
  gtk_tooltips_set_tip(tooltips, refkey,
                       "View whole reference accessed via its tag", NULL);

                    /* make the composite window visible on the screen */
  gtk_widget_show_all(window);
}