Imported Upstream version 2.9.0
[debian/cc1111] / sim / ucsim / gui.src / obsolete / portmon.src / pmapp.cc
1 /*
2  * Simulator of microcontrollers (pmapp.cc)
3  *
4  * Copyright (C) 1999,99 Drotos Daniel, Talker Bt.
5  * 
6  * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu
7  *
8  */
9
10 /* This file is part of microcontroller simulator: ucsim.
11
12 UCSIM is free software; you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation; either version 2 of the License, or
15 (at your option) any later version.
16
17 UCSIM is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20 GNU General Public License for more details.
21
22 You should have received a copy of the GNU General Public License
23 along with UCSIM; see the file COPYING.  If not, write to the Free
24 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
25 02111-1307, USA. */
26 /*@1@*/
27
28 #include "wincl.h"
29 #include "labelcl.h"
30
31 #include "pmappcl.h"
32 #include "portcl.h"
33
34
35 int
36 cl_pmapp::mk_views(class cl_group *ins_to)
37 {
38   class cl_view *v;
39   //class cl_win *w;
40   class cl_box *b;
41   
42   b= new cl_box(0,0,0,0);
43
44   if (!ins_to)
45     return(0);
46   
47   b->set(43,2,14,13);
48   v= new cl_portw(b, 3, "Port #3", this);
49   v->init();
50   ins_to->insert(v);
51     
52   b->set(29,2,14,13);
53   v= new cl_portw(b, 2, "Port #2", this);
54   v->init();
55   ins_to->insert(v);
56   /*
57   b->set(15,2,14,13);
58   ins_to->insert(v= new cl_portw(b, 1, "Port #1", this));
59   v->init();
60
61   b->set(1,2,14,13);
62   ins_to->insert(v= new cl_portw(b, 0, "Port #0", this));
63   v->init();
64
65   b->set(59,3,19,11);
66   v= new cl_label(b, this,
67 "Next win: n,TAB\nPrev win: p\nCursor  : u,d,l,r,\n          arrows\nToggle  : space,CR\nQuit    : q");
68   v->init();
69   b->move_rel(-1,-1);
70   b->grow(2,2);
71   
72   b->set(58,2,21,13);
73   w= new cl_win(b, "Help", this);
74   w->options&= ~OF_SELECTABLE;
75   w->init();
76   w->insert(v);
77   ins_to->insert(w);
78   w->draw();
79   */
80   delete b;
81
82   return(0);
83 }
84
85 int *
86 cl_pmapp::mk_palette(void)
87 {
88   return(cl_app::mk_palette());
89 }
90
91 int
92 cl_pmapp::handle_event(struct t_event *event)
93 {
94   if (event->what == EV_KEY)
95     switch (event->event.key)
96       {
97       case 'q':
98         event->what= EV_COMMAND;
99         event->event.msg.cmd= CMD_QUIT;
100         return(0);
101       case 'p':
102         desk->select_prev();
103         return(1);
104       case 'n': case '\t':
105         desk->select_next();
106         return(1);
107         
108       }
109   return(cl_app::handle_event(event));
110 }
111
112
113 /* End of gui.src/portmon.src/pmapp.cc */