Mercurial > ~dholland > hg > ag > index.cgi
comparison anagram/guisupport/wm1.cpp @ 0:13d2b8934445
Import AnaGram (near-)release tree into Mercurial.
author | David A. Holland |
---|---|
date | Sat, 22 Dec 2007 17:52:45 -0500 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:13d2b8934445 |
---|---|
1 /* | |
2 * AnaGram, A System for Syntax Directed Programming | |
3 * Copyright 1993-1999 Parsifal Software. All Rights Reserved. | |
4 * See the file COPYING for license and usage terms. | |
5 * | |
6 * wm1.cpp - Window Management Module | |
7 */ | |
8 | |
9 #include "ctrlpanel.hpp" | |
10 #include "dpanel.hpp" | |
11 #include "dspar.hpp" | |
12 #include "dvplug.hpp" | |
13 #include "fileview.hpp" | |
14 #include "gtview.hpp" | |
15 #include "rule.h" | |
16 #include "wm1.h" | |
17 | |
18 //#define INCLUDE_LOGGING | |
19 #include "log.h" //LOG | |
20 | |
21 | |
22 void set_text_line(int line, int col , int right) { | |
23 LOGSECTION("set_text_line"); | |
24 LOGV(syntaxFileId); | |
25 if (syntaxFileId == 0) return; | |
26 | |
27 FileWindow *syntaxWindow = | |
28 (FileWindow *) AgFrame::windowRegistry.find(syntaxFileId); | |
29 LOGV((int) syntaxWindow); | |
30 if (syntaxWindow == 0) return; | |
31 LOGV(line); | |
32 LOGV(col); | |
33 line--; | |
34 col--; | |
35 cint whereNow = syntaxWindow->getCursorLocation(); | |
36 LOGV(whereNow); | |
37 if (whereNow.y < line) { | |
38 syntaxWindow->setCursorLocation(cint(col, line+4)); | |
39 } | |
40 if (whereNow.y > line) { | |
41 syntaxWindow->setCursorLocation(cint(col, line-4)); | |
42 } | |
43 syntaxWindow->setCursorLocation(cint(col,line)); | |
44 LOGS("setCursorLocation returned"); | |
45 } | |
46 | |
47 void set_rule_line(unsigned fn) { | |
48 LOGSECTION("set_rule_line"); | |
49 LOGV(fn); | |
50 if (fn == 0 || fn > nforms_base) { | |
51 return; | |
52 } | |
53 Rule rule(fn); | |
54 | |
55 set_text_line(rule->line, rule->col, 0); | |
56 LOGS("set_text_line returned"); | |
57 } | |
58 | |
59 | |
60 void pop_up_window(dc_ref window) { | |
61 LOGSECTION("pop_up_window(dc_ref)"); | |
62 if (!window.exists()) { | |
63 return; | |
64 } | |
65 LOGV(window->head_title) LCV(window->foot_title); | |
66 | |
67 AgFrame *newPanel; | |
68 if (window->head_title == "Auxiliary Trace" | |
69 || window->head_title == "Conflict Trace" | |
70 || window->head_title == "Error Trace" | |
71 || window->head_title == "Keyword Anomaly Trace" | |
72 || window->head_title == "Reduction Trace") { | |
73 newPanel = new GTWindow((trace_window_dc *) (dc *) window); | |
74 } | |
75 else { | |
76 LOGS("ready to construct data panel"); | |
77 AgDataViewPlug *connector = new AgDataViewPlug(window); | |
78 LOGS("connector built"); | |
79 window->windowConnector = connector; | |
80 newPanel = new AgDataPanel(connector); | |
81 LOGS("newPanel built"); | |
82 newPanel->syntaxDependent = connector->syntaxDependent(); | |
83 newPanel->show(); | |
84 LOGS("window showing"); | |
85 } | |
86 newPanel->setAutoDeleteObject(); | |
87 LOGS("set autodelete"); | |
88 newPanel->setFocus(); | |
89 LOGS("succeeded in setting focus"); | |
90 } | |
91 | |
92 /* End WM1.C */ |