Kaynağa Gözat

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

master
kevin 11 yıl önce
ebeveyn
işleme
13b910ac6f
2 değiştirilmiş dosya ile 12 ekleme ve 15 silme
  1. 12
    14
      src/kc/kcApp.cpp
  2. 0
    1
      src/kc/kcApp.h

+ 12
- 14
src/kc/kcApp.cpp Dosyayı Görüntüle

@@ -64,7 +64,7 @@
64 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 65
   : Fl_Double_Window(w, h,title),
66 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 68
     _as_btn(NULL),_ai_btn(NULL),_ao_btn(NULL),_pgm_btn(NULL),
69 69
     _ss_btn(NULL),_sr_btn(NULL),_ena_chk(NULL),
70 70
     _pageList(NULL),_ctlList(NULL),
@@ -82,22 +82,16 @@ kcApp::kcApp(cmCtx_t* ctx, cmPrH_t prH, cmTsMp1cH_t printqH, int w, int h, const
82 82
   // and a horizontal splitter on the bottom
83 83
   begin();
84 84
   _createMenu(w,kMenuH);
85
-  _splt = new Fl_HSplitter(0, kMenuH, w, h-kStatusH-kMenuH, h-kStatusH-kMenuH-100);
86 85
   end();
87 86
 
88 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 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 91
   _tabs->callback(_s_tab_cb,this);
97 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 95
   _tabs->client_area(tx,ty,tw,th);
102 96
 
103 97
   // Create the 'Setup' tab group
@@ -105,23 +99,28 @@ kcApp::kcApp(cmCtx_t* ctx, cmPrH_t prH, cmTsMp1cH_t printqH, int w, int h, const
105 99
   _tabs->add(setup_grp);
106 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 110
   // Create the master group
109 111
   _tabs->add(_mstr_grp  = new Fl_Group(tx,ty,tw,th,"Master"));
110 112
 
111
-
112 113
   // Create an empty tab group and make it resizable 
113 114
   // to prevent the other tab groups from being resizable.
114 115
   Fl_Group* wdgt = new Fl_Group(tx,ty+30,1,1);
115 116
   _tabs->add(wdgt);
116 117
   _tabs->resizable(wdgt);  // make other tabs non-resizable
117 118
 
118
-
119 119
   // make the splitter the resizable group element (thereby making the menu non-resizable).
120 120
   // see:http://fltk.org/articles.php?L415+I0+T+M1000+P1
121
-  resizable(_splt); 
121
+  resizable(_tabs); 
122 122
   show(argc, argv);
123 123
 
124
-
125 124
   // direct all output to the console window
126 125
   cmRptSetup(&_ctx->rpt,_s_print,_s_print, this);
127 126
   cmTsMp1cSetCbFunc(_printqH, _s_print_queue_cb, this );
@@ -141,7 +140,6 @@ kcApp::~kcApp()
141 140
 void kcApp::resize(int x, int y, int w, int h)
142 141
 {
143 142
   Fl_Double_Window::resize(x, y, w, h);
144
-  _splt->resize(0, kMenuH, w, h-kStatusH);
145 143
   cmPrefsPathSetInt(_prH,"appWndW",w);
146 144
   cmPrefsPathSetInt(_prH,"appWndH",h);
147 145
 }

+ 0
- 1
src/kc/kcApp.h Dosyayı Görüntüle

@@ -290,7 +290,6 @@ private:
290 290
   cmAiH_t          _aiH;
291 291
 
292 292
   Fl_Menu_Bar*     _menu;
293
-  Fl_HSplitter*    _splt;
294 293
   Fl_Text_Display* _con;
295 294
   Fl_Tabs*         _tabs;
296 295
   Fl_Group*        _mstr_grp;

Loading…
İptal
Kaydet