1387
1419
PopupItem (canned, "RNA editing");
1388
1420
PopupItem (canned, "reasons given in citation");
1389
1421
PopupItem (canned, "ribosomal slippage");
1390
PopupItem (canned, "trans splicing");
1422
PopupItem (canned, "trans-splicing");
1391
1423
PopupItem (canned, "artificial frameshift");
1424
PopupItem (canned, "nonconsensus splice site");
1425
PopupItem (canned, "rearrangement required");
1426
PopupItem (canned, "alternative start codon");
1392
1427
if (sfp != NULL && sfp->excpt) {
1393
1428
if (StringICmp (sfp->except_text, "RNA editing") == 0) {
1394
1429
SetValue (canned, 2);
1395
1430
} else if (StringICmp (sfp->except_text, "reasons given in citation") == 0 ||
1396
1431
StringICmp (sfp->except_text, "reasons cited in publication") == 0) {
1397
1432
SetValue (canned, 3);
1398
} else if (StringICmp (sfp->except_text, "ribosomal slippage") == 0) {
1399
SetValue (canned, 4);
1400
} else if (StringICmp (sfp->except_text, "ribosome slippage") == 0) {
1401
SetValue (canned, 4);
1402
} else if (StringICmp (sfp->except_text, "trans splicing") == 0) {
1403
SetValue (canned, 5);
1404
} else if (StringICmp (sfp->except_text, "trans-splicing") == 0) {
1433
} else if (StringICmp (sfp->except_text, "ribosomal slippage") == 0 ||
1434
StringICmp (sfp->except_text, "ribosome slippage") == 0) {
1435
SetValue (canned, 4);
1436
} else if (StringICmp (sfp->except_text, "trans-splicing") == 0 ||
1437
StringICmp (sfp->except_text, "trans splicing") == 0) {
1405
1438
SetValue (canned, 5);
1406
1439
} else if (StringICmp (sfp->except_text, "artificial frameshift") == 0) {
1407
1440
SetValue (canned, 6);
1441
} else if (StringICmp (sfp->except_text, "non-consensus splice site") == 0 ||
1442
StringICmp (sfp->except_text, "nonconsensus splice site") == 0) {
1443
SetValue (canned, 7);
1444
} else if (StringICmp (sfp->except_text, "rearrangement required for product") == 0) {
1445
SetValue (canned, 8);
1446
} else if (StringICmp (sfp->except_text, "alternative start codon") == 0) {
1447
SetValue (canned, 9);
1410
1450
SetValue (canned, 1);
1460
1502
ffp->newGeneGrp = HiddenGroup (y, 2, 0, NULL);
1461
1503
StaticPrompt (ffp->newGeneGrp, "Gene Symbol", 0, dialogTextHeight, programFont, 'l');
1462
1504
ffp->geneSymbol = DialogText (ffp->newGeneGrp, "", 20, NULL);
1505
StaticPrompt (ffp->newGeneGrp, "Allele", 0, dialogTextHeight, programFont, 'l');
1506
ffp->geneAllele = DialogText (ffp->newGeneGrp, "", 20, NULL);
1463
1507
StaticPrompt (ffp->newGeneGrp, "Description", 0, dialogTextHeight, programFont, 'l');
1464
1508
ffp->geneDesc = DialogText (ffp->newGeneGrp, "", 20, NULL);
1509
StaticPrompt (ffp->newGeneGrp, "Locus Tag", 0, dialogTextHeight, programFont, 'l');
1510
ffp->locusTag = DialogText (ffp->newGeneGrp, "", 20, NULL);
1465
1511
Hide (ffp->newGeneGrp);
1466
1512
ffp->editGeneBtn = PushButton (y, "Edit Gene Feature", Nlm_LaunchGeneFeatEd);
1467
1513
SetObjectExtra (ffp->editGeneBtn, ffp, NULL);
1927
extern void LaunchGeneralTextViewer (CharPtr path, CharPtr title)
1979
static void FindInGeneralText (ButtoN b)
1994
Char path [PATH_MAX];
1999
TextViewFormPtr tfp;
2002
tfp = (TextViewFormPtr) GetObjectExtra (b);
2003
if (tfp == NULL) return;
2004
if (tfp->doc != NULL) {
2005
GetOffset (tfp->doc, NULL, &offset);
2006
} else if (tfp->text != NULL) {
2007
GetOffset (tfp->text, NULL, &offset);
2013
str = SaveStringFromText (tfp->find);
2015
if (StringDoesHaveText) {
2017
if (ExportForm (tfp->form, path)) {
2018
tbl = TextFsaNew ();
2020
TextFsaAdd (tbl, str);
2021
fp = FileOpen (path, "r");
2025
cntr = FileLength (path);
2026
cnt = (Int2) MIN (cntr, 1024L);
2028
while (cnt > 0 && cntr > 0 && line <= max &&
2029
((next == -1 && offset > first) || first == -1)) {
2030
actual = (Int2) FileRead (buf, 1, cnt, fp);
2036
while (ch != '\0') {
2037
if (ch == '\n' || ch == '\r') {
2038
if (ch == '\n' && lastch == '\r') {
2039
/* do not increment line */
2040
} else if (ch == '\r' && lastch == '\n') {
2041
/* do not increment line */
2046
state = TextFsaNext (tbl, state, ch, &matches);
2047
if (matches != NULL) {
2051
if (next == -1 && line > offset) {
2060
cnt = (Int2) MIN (cntr, 1024L);
2075
Message (MSG_ERROR, "Too many lines for search");
2080
} else if (first >= 0) {
2083
if (tfp->doc != NULL) {
2084
SetOffset (tfp->doc, 0, offset);
2086
} else if (tfp->text != NULL) {
2087
SetOffset (tfp->text, 0, offset);
2092
static void LaunchGeneralTextViewerEx (CharPtr path, CharPtr title, Boolean useScrollText)
1931
2098
Int2 pixheight;
1933
2100
StdEditorProcsPtr sepp;
1941
2108
tfp = (TextViewFormPtr) MemNew (sizeof (TextViewForm));
1943
w = DocumentWindow (-50, -33, -10, -10, title, StdCloseWindowProc, ResizeTextViewer);
1944
SetObjectExtra (w, tfp, StdCleanupFormProc);
1945
tfp->form = (ForM) w;
1946
tfp->exportform = ExportTextViewForm;
1947
tfp->formmessage = TextViewFormMessage;
1949
sepp = (StdEditorProcsPtr) GetAppProperty ("StdEditorForm");
1951
SetActivate (w, sepp->activateForm);
1952
tfp->appmessage = sepp->handleMessages;
1956
pixwidth = 35 * stdCharWidth + 17;
1957
pixheight = 20 * stdLineHeight;
1959
tvpp = (TextViewProcsPtr) GetAppProperty ("TextDisplayForm");
1961
pixwidth = MAX (pixwidth, tvpp->minPixelWidth);
1962
pixheight = MAX (pixheight, tvpp->minPixelHeight);
1963
if (tvpp->displayFont != NULL) {
1964
fnt = tvpp->displayFont;
1966
if (tvpp->activateForm != NULL) {
1967
SetActivate (w, tvpp->activateForm);
2109
if (tfp == NULL) return;
2111
w = DocumentWindow (-50, -33, -10, -10, title, StdCloseWindowProc, ResizeTextViewer);
2112
SetObjectExtra (w, tfp, StdCleanupFormProc);
2113
tfp->form = (ForM) w;
2114
tfp->exportform = ExportTextViewForm;
2115
tfp->formmessage = TextViewFormMessage;
2117
sepp = (StdEditorProcsPtr) GetAppProperty ("StdEditorForm");
2119
SetActivate (w, sepp->activateForm);
2120
tfp->appmessage = sepp->handleMessages;
2124
pixwidth = 35 * stdCharWidth + 17;
2125
pixheight = 20 * stdLineHeight;
2127
tvpp = (TextViewProcsPtr) GetAppProperty ("TextDisplayForm");
2129
pixwidth = MAX (pixwidth, tvpp->minPixelWidth);
2130
pixheight = MAX (pixheight, tvpp->minPixelHeight);
2131
if (tvpp->displayFont != NULL) {
2132
fnt = tvpp->displayFont;
2134
if (tvpp->activateForm != NULL) {
2135
SetActivate (w, tvpp->activateForm);
1971
2139
#ifndef WIN_MAC
1972
m = PulldownMenu (w, "File");
1973
FormCommandItem (m, "Export...", (BaseFormPtr) tfp, VIB_MSG_EXPORT);
1975
FormCommandItem (m, "Close", (BaseFormPtr) tfp, VIB_MSG_CLOSE);
1976
if (tvpp != NULL && tvpp->useScrollText) {
1977
m = PulldownMenu (w, "Edit");
1978
FormCommandItem (m, CUT_MENU_ITEM, (BaseFormPtr) tfp, VIB_MSG_CUT);
1979
FormCommandItem (m, COPY_MENU_ITEM, (BaseFormPtr) tfp, VIB_MSG_COPY);
1980
FormCommandItem (m, PASTE_MENU_ITEM, (BaseFormPtr) tfp, VIB_MSG_PASTE);
1981
FormCommandItem (m, CLEAR_MENU_ITEM, (BaseFormPtr) tfp, VIB_MSG_DELETE);
2140
m = PulldownMenu (w, "File");
2141
FormCommandItem (m, "Export...", (BaseFormPtr) tfp, VIB_MSG_EXPORT);
2143
FormCommandItem (m, "Close", (BaseFormPtr) tfp, VIB_MSG_CLOSE);
2144
if (tvpp != NULL && tvpp->useScrollText) {
2145
m = PulldownMenu (w, "Edit");
2146
FormCommandItem (m, CUT_MENU_ITEM, (BaseFormPtr) tfp, VIB_MSG_CUT);
2147
FormCommandItem (m, COPY_MENU_ITEM, (BaseFormPtr) tfp, VIB_MSG_COPY);
2148
FormCommandItem (m, PASTE_MENU_ITEM, (BaseFormPtr) tfp, VIB_MSG_PASTE);
2149
FormCommandItem (m, CLEAR_MENU_ITEM, (BaseFormPtr) tfp, VIB_MSG_DELETE);
1985
if (tvpp != NULL && tvpp->useScrollText) {
1986
tfp->text = ScrollText (w, (pixwidth + stdCharWidth - 1) / stdCharWidth,
1987
(pixheight + stdLineHeight - 1) / stdLineHeight,
1989
SetObjectExtra (tfp->text, tfp, NULL);
1991
if (! FileToScrollText (tfp->text, path)) {
1992
SetTitle (tfp->text, "(Text is too large to be displayed in this control.)");
1995
tfp->doc = DocumentPanel (w, pixwidth, pixheight);
1996
SetObjectExtra (tfp->doc, tfp, NULL);
1998
txtColFmt.pixWidth = screenRect.right - screenRect.left;
1999
txtColFmt.pixInset = 8;
2000
DisplayFancy (tfp->doc, path, &txtParFmt, &txtColFmt, fnt, 0);
2001
/* document.c: SaveTableItem does not strip preceeding tabs if tabCount is 0 */
2153
/* right now Find button is only in indexer Sequin */
2154
if (useScrollText) {
2155
g = HiddenGroup (w, 5, 0, NULL);
2156
b = PushButton (g, "Find", FindInGeneralText);
2157
SetObjectExtra (b, tfp, NULL);
2158
tfp->find = DialogText (g, "", 10, NULL);
2161
if (useScrollText) {
2162
tfp->text = ScrollText (w, (pixwidth + stdCharWidth - 1) / stdCharWidth,
2163
(pixheight + stdLineHeight - 1) / stdLineHeight,
2165
SetObjectExtra (tfp->text, tfp, NULL);
2167
if (! FileToScrollText (tfp->text, path)) {
2168
/* SetTitle (tfp->text, "(Text is too large to be displayed in this control.)"); */
2170
LaunchGeneralTextViewerEx (path, title, FALSE);
2174
tfp->doc = DocumentPanel (w, pixwidth, pixheight);
2175
SetObjectExtra (tfp->doc, tfp, NULL);
2177
txtColFmt.pixWidth = screenRect.right - screenRect.left;
2178
txtColFmt.pixInset = 8;
2179
DisplayFancy (tfp->doc, path, &txtParFmt, &txtColFmt, fnt, 0);
2180
/* document.c: SaveTableItem does not strip preceeding tabs if tabCount is 0 */
2187
extern void LaunchGeneralTextViewer (CharPtr path, CharPtr title)
2190
TextViewProcsPtr tvpp;
2192
tvpp = (TextViewProcsPtr) GetAppProperty ("TextDisplayForm");
2193
if (tvpp != NULL && tvpp->useScrollText) {
2194
LaunchGeneralTextViewerEx (path, title, TRUE);
2196
LaunchGeneralTextViewerEx (path, title, FALSE);
2009
2200
#ifndef WIN_MAC