Browse Source

kcApp.cpp: Changed console from splitter window to tab window.

master
kevin 11 years ago
parent
commit
13b910ac6f
2 changed files with 12 additions and 15 deletions
  1. 12
    14
      src/kc/kcApp.cpp
  2. 0
    1
      src/kc/kcApp.h

+ 12
- 14
src/kc/kcApp.cpp View File

64
 kcApp::kcApp(cmCtx_t* ctx, cmPrH_t prH, cmTsMp1cH_t printqH, int w, int h, const cmChar_t* title, cmAiH_t aiH, int argc, char* argv[] )
64
 kcApp::kcApp(cmCtx_t* ctx, cmPrH_t prH, cmTsMp1cH_t printqH, int w, int h, const cmChar_t* title, cmAiH_t aiH, int argc, char* argv[] )
65
   : Fl_Double_Window(w, h,title),
65
   : Fl_Double_Window(w, h,title),
66
     _ctx(ctx),_prH(prH),_aiH(aiH),
66
     _ctx(ctx),_prH(prH),_aiH(aiH),
67
-    _menu(NULL),_splt(NULL),_con(NULL),_tabs(NULL),_mstr_grp(NULL),
67
+    _menu(NULL),_con(NULL),_tabs(NULL),_mstr_grp(NULL),
68
     _as_btn(NULL),_ai_btn(NULL),_ao_btn(NULL),_pgm_btn(NULL),
68
     _as_btn(NULL),_ai_btn(NULL),_ao_btn(NULL),_pgm_btn(NULL),
69
     _ss_btn(NULL),_sr_btn(NULL),_ena_chk(NULL),
69
     _ss_btn(NULL),_sr_btn(NULL),_ena_chk(NULL),
70
     _pageList(NULL),_ctlList(NULL),
70
     _pageList(NULL),_ctlList(NULL),
82
   // and a horizontal splitter on the bottom
82
   // and a horizontal splitter on the bottom
83
   begin();
83
   begin();
84
   _createMenu(w,kMenuH);
84
   _createMenu(w,kMenuH);
85
-  _splt = new Fl_HSplitter(0, kMenuH, w, h-kStatusH-kMenuH, h-kStatusH-kMenuH-100);
86
   end();
85
   end();
87
 
86
 
88
   // Create a text display object for console output andvadd it to the lower splitter area
87
   // Create a text display object for console output andvadd it to the lower splitter area
89
-  Fl_Text_Buffer* buf = new Fl_Text_Buffer();
90
-  _con = new Fl_Text_Display(_splt->container2->x(),_splt->container2->y(),_splt->container2->w(),_splt->container2->h());
91
-  _con->buffer(buf);
92
-  _splt->container2->add(_con);
93
 
88
 
94
   // Create a tab view and added it to the upper splitter area
89
   // Create a tab view and added it to the upper splitter area
95
-  _tabs = new Fl_Tabs(_splt->container1->x(),_splt->container1->y(),_splt->container1->w(),_splt->container1->h());
90
+  add(_tabs = new Fl_Tabs(this->x(),this->y()+kMenuH,this->w(),this->h()-kMenuH));
96
   _tabs->callback(_s_tab_cb,this);
91
   _tabs->callback(_s_tab_cb,this);
97
   _tabs->end();
92
   _tabs->end();
98
-  _splt->container1->add(_tabs);
99
 
93
 
100
-  int tx,ty,th,tw;
94
+  int tx=x(),ty=y(),th=this->w(),tw=this->h();
101
   _tabs->client_area(tx,ty,tw,th);
95
   _tabs->client_area(tx,ty,tw,th);
102
 
96
 
103
   // Create the 'Setup' tab group
97
   // Create the 'Setup' tab group
105
   _tabs->add(setup_grp);
99
   _tabs->add(setup_grp);
106
   _createSetupDlg(setup_grp);
100
   _createSetupDlg(setup_grp);
107
 
101
 
102
+  // Create the console window
103
+  Fl_Group* con_grp = new Fl_Group(tx,ty,tw,th,"Console");
104
+  _tabs->add(con_grp);
105
+  Fl_Text_Buffer* buf = new Fl_Text_Buffer();
106
+  _con = new Fl_Text_Display(tx,ty,tw,th);
107
+  _con->buffer(buf);
108
+  con_grp->add(_con);
109
+
108
   // Create the master group
110
   // Create the master group
109
   _tabs->add(_mstr_grp  = new Fl_Group(tx,ty,tw,th,"Master"));
111
   _tabs->add(_mstr_grp  = new Fl_Group(tx,ty,tw,th,"Master"));
110
 
112
 
111
-
112
   // Create an empty tab group and make it resizable 
113
   // Create an empty tab group and make it resizable 
113
   // to prevent the other tab groups from being resizable.
114
   // to prevent the other tab groups from being resizable.
114
   Fl_Group* wdgt = new Fl_Group(tx,ty+30,1,1);
115
   Fl_Group* wdgt = new Fl_Group(tx,ty+30,1,1);
115
   _tabs->add(wdgt);
116
   _tabs->add(wdgt);
116
   _tabs->resizable(wdgt);  // make other tabs non-resizable
117
   _tabs->resizable(wdgt);  // make other tabs non-resizable
117
 
118
 
118
-
119
   // make the splitter the resizable group element (thereby making the menu non-resizable).
119
   // make the splitter the resizable group element (thereby making the menu non-resizable).
120
   // see:http://fltk.org/articles.php?L415+I0+T+M1000+P1
120
   // see:http://fltk.org/articles.php?L415+I0+T+M1000+P1
121
-  resizable(_splt); 
121
+  resizable(_tabs); 
122
   show(argc, argv);
122
   show(argc, argv);
123
 
123
 
124
-
125
   // direct all output to the console window
124
   // direct all output to the console window
126
   cmRptSetup(&_ctx->rpt,_s_print,_s_print, this);
125
   cmRptSetup(&_ctx->rpt,_s_print,_s_print, this);
127
   cmTsMp1cSetCbFunc(_printqH, _s_print_queue_cb, this );
126
   cmTsMp1cSetCbFunc(_printqH, _s_print_queue_cb, this );
141
 void kcApp::resize(int x, int y, int w, int h)
140
 void kcApp::resize(int x, int y, int w, int h)
142
 {
141
 {
143
   Fl_Double_Window::resize(x, y, w, h);
142
   Fl_Double_Window::resize(x, y, w, h);
144
-  _splt->resize(0, kMenuH, w, h-kStatusH);
145
   cmPrefsPathSetInt(_prH,"appWndW",w);
143
   cmPrefsPathSetInt(_prH,"appWndW",w);
146
   cmPrefsPathSetInt(_prH,"appWndH",h);
144
   cmPrefsPathSetInt(_prH,"appWndH",h);
147
 }
145
 }

+ 0
- 1
src/kc/kcApp.h View File

290
   cmAiH_t          _aiH;
290
   cmAiH_t          _aiH;
291
 
291
 
292
   Fl_Menu_Bar*     _menu;
292
   Fl_Menu_Bar*     _menu;
293
-  Fl_HSplitter*    _splt;
294
   Fl_Text_Display* _con;
293
   Fl_Text_Display* _con;
295
   Fl_Tabs*         _tabs;
294
   Fl_Tabs*         _tabs;
296
   Fl_Group*        _mstr_grp;
295
   Fl_Group*        _mstr_grp;

Loading…
Cancel
Save