Vida Marcell Posted February 27, 2022 Share Posted February 27, 2022 Link to comment Share on other sites More sharing options...
Josh Posted February 27, 2022 Share Posted February 27, 2022 This actually is fine. You want to create a panel inside the tabber client area, and it will cover up the mess. I think in the development build I have added an extra rectangle block to cover that up. My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Vida Marcell Posted February 27, 2022 Author Share Posted February 27, 2022 I know that Josh, here is what i mean Link to comment Share on other sites More sharing options...
Vida Marcell Posted February 27, 2022 Author Share Posted February 27, 2022 The Ambient occlusion is covered by height, as i noticed there couldnt be more that 4 tabs Link to comment Share on other sites More sharing options...
Josh Posted February 27, 2022 Share Posted February 27, 2022 What the hell? Can you please post a small demo I can run? My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Vida Marcell Posted February 27, 2022 Author Share Posted February 27, 2022 32 minutes ago, Josh said: What the hell? Can you please post a small demo I can run? sure Link to comment Share on other sites More sharing options...
Vida Marcell Posted February 27, 2022 Author Share Posted February 27, 2022 #include "UltraEngine.h" using namespace UltraEngine; int sidepanelwidth = 380; int main(int argc, const char* argv[]) { //Get the displays auto displays = GetDisplays(); //Create a window auto window = CreateWindow("Ultra Engine", 0, 0, 1200, 800, displays[0], WINDOW_TITLEBAR | WINDOW_RESIZABLE | WINDOW_CENTER); window->SetMinSize(800, 600); //Create User Interface auto ui = CreateInterface(window); double bgcolor = 0.187; ui->root->SetColor(bgcolor, bgcolor, bgcolor); //Create Menu auto menu = CreateMenu("", ui->root); menu->SetColor(bgcolor, bgcolor, bgcolor); auto menu_file = CreateMenu("File", menu); auto menu_edit = CreateMenu("Edit", menu); auto menu_view = CreateMenu("View", menu); auto menu_window = CreateMenu("Window", menu); auto menu_help = CreateMenu("Help", menu); //Create viewport int gap = 6; int y_size = 30; auto sz = ui->root->GetSize(); auto viewport = CreateTabber(gap, y_size, sz.x - sidepanelwidth - gap, sz.y - gap - y_size, ui->root); viewport->AddItem("Albedo", true); viewport->AddItem("Normal"); viewport->AddItem("Roughness"); viewport->AddItem("AmbientOcclusion"); viewport->SetLayout(1, 1, 1, 1); auto albedo_p = CreatePanel(0, 0, sz.x, sz.y, viewport); albedo_p->SetLayout(1, 1, 1, 1); viewport->items[0].extra = albedo_p; auto normal_p = CreatePanel(0, 0, sz.x, sz.y, viewport); normal_p->SetLayout(1, 1, 1, 1); viewport->items[1].extra = normal_p; auto rough_p = CreatePanel(0, 0, sz.x, sz.y, viewport); rough_p->SetLayout(1, 1, 1, 1); viewport->items[2].extra = rough_p; auto ao_p = CreatePanel(0, 0, sz.x, sz.y, viewport); ao_p->SetLayout(1, 1, 1, 1); viewport->items[3].extra = ao_p; auto sidepanel = CreateTabber(viewport->GetSize().x + gap + gap, y_size, sidepanelwidth - gap - gap, sz.y - gap - y_size, ui->root); sidepanel->SetLayout(0, 1, 1, 1); sidepanel->AddItem("Setup", true); sidepanel->AddItem("De-Lit"); auto setup_p = CreatePanel(0, 0, sz.x, sz.y, sidepanel); setup_p->SetLayout(1, 1, 1, 1); sidepanel->items[0].extra = setup_p; auto delit_p = CreatePanel(0, 0, sz.x, sz.y, sidepanel); delit_p->SetLayout(1, 1, 1, 1); sidepanel->items[0].extra = delit_p; while (true) { const Event ev = WaitEvent(); switch (ev.id) { case EVENT_WIDGETACTION: Print("Item " + String(ev.data) + " action"); break; case EVENT_WIDGETSELECT: if (ev.source == viewport) { for (int n = 0; n < viewport->items.size(); ++n) { if (viewport->items[n].extra) { auto panel = viewport->items[n].extra->As<Widget>(); if (n == ev.data) { panel->Show(); } else { panel->Hide(); } } } } else if (ev.source == sidepanel) { for (int n = 0; n < sidepanel->items.size(); ++n) { if (sidepanel->items[n].extra) { auto panel = sidepanel->items[n].extra->As<Widget>(); if (n == ev.data) { panel->Show(); } else { panel->Hide(); } } } } break; case EVENT_QUIT: case EVENT_WINDOWCLOSE: return 0; break; default: break; } } return 0; } for example add this to "viewport": viewport->AddItem("Metalness"); or viewport->AddItem("Height"); 1 Link to comment Share on other sites More sharing options...
Vida Marcell Posted February 27, 2022 Author Share Posted February 27, 2022 So now you see the problem? im trying to make something similar to "knald" a material software. Link to comment Share on other sites More sharing options...
Josh Posted March 1, 2022 Share Posted March 1, 2022 The code you posted does not match your screenshots. It creates four tabs on the left panel, and I see four tabs when I run the code. What is the problem with this code? My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Vida Marcell Posted March 1, 2022 Author Share Posted March 1, 2022 Allright sorry Josh, #include "UltraEngine.h" using namespace UltraEngine; int sidepanelwidth = 380; int main(int argc, const char* argv[]) { //Get the displays auto displays = GetDisplays(); //Create a window auto window = CreateWindow("Ultra Engine", 0, 0, 1200, 800, displays[0], WINDOW_TITLEBAR | WINDOW_RESIZABLE | WINDOW_CENTER); window->SetMinSize(800, 600); //Create User Interface auto ui = CreateInterface(window); double bgcolor = 0.187; ui->root->SetColor(bgcolor, bgcolor, bgcolor); //Create Menu auto menu = CreateMenu("", ui->root); menu->SetColor(bgcolor, bgcolor, bgcolor); auto menu_file = CreateMenu("File", menu); auto menu_edit = CreateMenu("Edit", menu); auto menu_view = CreateMenu("View", menu); auto menu_window = CreateMenu("Window", menu); auto menu_help = CreateMenu("Help", menu); //Create viewport int gap = 6; int y_size = 30; auto sz = ui->root->GetSize(); auto viewport = CreateTabber(gap, y_size, sz.x - sidepanelwidth - gap, sz.y - gap - y_size, ui->root); viewport->AddItem("Albedo", true); viewport->AddItem("Normal"); viewport->AddItem("Roughness"); viewport->AddItem("AmbientOcclusion"); viewport->AddItem("Metalness"); viewport->AddItem("Height"); viewport->SetLayout(1, 1, 1, 1); while (true) { const Event ev = WaitEvent(); switch (ev.id) { case EVENT_WIDGETACTION: Print("Item " + String(ev.data) + " action"); break; case EVENT_WIDGETSELECT: break; case EVENT_QUIT: case EVENT_WINDOWCLOSE: return 0; break; default: break; } } return 0; } now this should be allright, as you can see i added 2 more tabs, but a taked out the functioning of the tabber, but that doesnt change anything, as you can see, i'm running this code now: the AO has the same position as the Metalness Link to comment Share on other sites More sharing options...
Solution Josh Posted March 1, 2022 Solution Share Posted March 1, 2022 Here it is with my current build: But with the build on Steam I can indeed produce the error. So I guess it was fixed and I need to put an update out soon. 1 My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Recommended Posts