This commit is contained in:
Alex Moening 2026-10-11 18:08:14 -04:00
parent 6463d11913
commit 55d7c91e5e
2 changed files with 19 additions and 5 deletions

View file

@ -4,6 +4,7 @@
#include <FL/Fl.H> #include <FL/Fl.H>
#include <FL/Fl_Button.H> #include <FL/Fl_Button.H>
#include <FL/Fl_Group.H> #include <FL/Fl_Group.H>
#include <FL/Fl_Multi_Browser.H>
#include <FL/Fl_Tabs.H> #include <FL/Fl_Tabs.H>
#include <FL/Fl_Text_Buffer.H> #include <FL/Fl_Text_Buffer.H>
#include <FL/Fl_Text_Display.H> #include <FL/Fl_Text_Display.H>
@ -42,21 +43,24 @@ void SummaryCallback(Fl_Widget * w, void * data) {
tabs->redraw(); tabs->redraw();
} }
} }
SummaryManager::SummaryManager(int x, int y, int w, int h) SummaryManager::SummaryManager(int x, int y, int w, int h)
: Fl_Group(x, y, w, h), tabs(x, y, w, h) { : Fl_Group(x, y, w, h), tabs(x, y, w, h) {
Fl_Group *grp1 = new Fl_Group(x, y + 30, w, h - 30, "Tab1"); Fl_Group *grp1 = new Fl_Group(x, y + 30, w, h - 30, "Current Project");
grp1->when(FL_WHEN_CLOSED); grp1->when(FL_WHEN_CLOSED);
{ {
Fl_Window *win1 = new Fl_Window(x, y + 30, w, h - 30, "Tab1W"); Fl_Window *win1 = new Fl_Window(x, y + 30, w, h - 30, "Tab1W");
std::cout << "here" << std::endl; std::cout << "here" << std::endl;
{ {
auto butt = new Fl_Button(0, 0, 100, 200, "test"); project_items = new Fl_Multi_Browser(0,0,100,h-30);
auto butt = new Fl_Button(100, 0, 100, 200, "test");
} }
win1->end(); win1->end();
auto butt = new Fl_Button(0, 30, 100, 200, "nyaaa"); //auto butt = new Fl_Button(0, 30, 100, 200, "nyaaa");
} }
grp1->end(); grp1->end();
// Fl_Group *grp2 = new Fl_Group(20, 30, 280, 170, "Tab2"); // Fl_Group *grp2 = new Fl_Group(20, 30, 280, 170, "Tab2");
@ -178,7 +182,7 @@ void LoadReport(std::string s, Fl_Text_Buffer * text, Fl_Text_Buffer * style) {
Summary::Summary(ComplexEntry c, int x, int y, int w, int h) : Fl_Group(x, y, w, h, "Loading...") { Summary::Summary(ComplexEntry c, int x, int y, int w, int h) : Fl_Group(x, y, w, h, "Loading..."), entry(c) {
title = c.basic.A.name + "+" + c.basic.B.name + "(" + std::to_string(c.basic.Apercent) + "%," + std::to_string(c.basic.Bpercent) + "%)"; title = c.basic.A.name + "+" + c.basic.B.name + "(" + std::to_string(c.basic.Apercent) + "%," + std::to_string(c.basic.Bpercent) + "%)";
this->label(title.c_str()); this->label(title.c_str());
this->when(FL_WHEN_CLOSED); this->when(FL_WHEN_CLOSED);
@ -202,6 +206,7 @@ Summary::Summary(ComplexEntry c, int x, int y, int w, int h) : Fl_Group(x, y, w,
s2->buffer(s2buff); s2->buffer(s2buff);
// s1style_buff->insert(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"); // s1style_buff->insert(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA");
// std::cout << c.A_buf.c_str() << std::endl; // std::cout << c.A_buf.c_str() << std::endl;
@ -221,6 +226,7 @@ Summary::Summary(ComplexEntry c, int x, int y, int w, int h) : Fl_Group(x, y, w,
win->resizable(text_boxes); win->resizable(text_boxes);
this->callback(SummaryCallback); this->callback(SummaryCallback);
} }
Summary::~Summary() { Summary::~Summary() {

View file

@ -10,6 +10,7 @@
#include <FL/Fl_Text_Buffer.H> #include <FL/Fl_Text_Buffer.H>
#include <FL/Fl_Window.H> #include <FL/Fl_Window.H>
#include <FL/Fl_Text_Display.H> #include <FL/Fl_Text_Display.H>
#include <FL/Fl_Multi_Browser.H>
#include <memory> #include <memory>
#include <vector> #include <vector>
@ -22,6 +23,8 @@ struct Summary : Fl_Group {
Fl_Text_Buffer * s1style_buff; Fl_Text_Buffer * s1style_buff;
Fl_Text_Buffer * s2buff; Fl_Text_Buffer * s2buff;
Fl_Text_Buffer * s2style_buff; Fl_Text_Buffer * s2style_buff;
ComplexEntry entry;
Summary(ComplexEntry c, int x, int y, int w, int h); Summary(ComplexEntry c, int x, int y, int w, int h);
~Summary(); ~Summary();
@ -31,10 +34,15 @@ struct Summary : Fl_Group {
struct SummaryManager : Fl_Group { struct SummaryManager : Fl_Group {
SummaryManager(int x, int y, int w, int h); SummaryManager(int x, int y, int w, int h);
Fl_Tabs tabs; Fl_Tabs tabs;
Fl_Multi_Browser * project_items;
std::vector<Summary*> items; std::vector<Summary*> items;
void addComplex(ComplexEntry& c); void addComplex(ComplexEntry& c);
void addCurrentTabToComplex();
}; };
#endif #endif