diff --git a/dependencies/testproject_featuredemo.cpp b/dependencies/testproject_featuredemo.cpp index 079eeda18b1ae5419c90d733daed774a2c915640..2983c2289538c0c205f88ce6ea9f2fe28ccc3777 100644 --- a/dependencies/testproject_featuredemo.cpp +++ b/dependencies/testproject_featuredemo.cpp @@ -11,7 +11,7 @@ #include "widgets/Button.h" #include "widgets/TextInput.h" #include "widgets/RadioButton.h" -#include "widgets/CheckBox.h" +#include "widgets/TextBox.h" #include "widgets/RadioButton.h" #include "widgets/CheckBox.h" @@ -67,6 +67,8 @@ int main(int argc, char* argv[]) { TDT4102::TextBox b{{300, 200}, 108, 35, "TEXTBOX!"}; window.add(b); + b.setBoxColor(TDT4102::Color::dark_orange); + b.setTextColor(TDT4102::Color::green); input.setCallback(&textChanged); window.add(input); @@ -87,24 +89,6 @@ int main(int argc, char* argv[]) { // cb.setCheckBoxColorActive(TDT4102::Color::green); cb.setLabel("This is a"); - - TDT4102::RadioButton rb{{200, 200}, 100, 30, "Easy"}; - window.add(rb); - - rb.setLabelColor(TDT4102::Color::salmon); - - rb.setRadioColor(TDT4102::Color::gold); - rb.setRadioColorHover(TDT4102::Color::lime_green); - rb.setRadioColorActive(TDT4102::Color::aquamarine); - - TDT4102::CheckBox cb{{200, 300}, 120, 50, "Check"}; - window.add(cb); - // cb.setLabelColor(TDT4102::Color::blue); - cb.setCheckBoxColorHover(TDT4102::Color::red); - // cb.setCheckBoxColorActive(TDT4102::Color::green); - cb.setLabel("This is a"); - - int x = 10; int y = 10; @@ -120,8 +104,8 @@ int main(int argc, char* argv[]) { std::vector<Ball> circles; circles.resize(5000); for (unsigned int i = 0; i < circles.size(); i++) { - circles.at(i).x = randint(0, window.get_width()); - circles.at(i).y = randint(0, window.get_height()); + circles.at(i).x = randint(0, window.width()); + circles.at(i).y = randint(0, window.height()); circles.at(i).radius = randint(5, 10); circles.at(i).xSpeed = float(randint(-400, 400)) / 100.0f; circles.at(i).ySpeed = float(randint(-400, 400)) / 100.0f; @@ -166,8 +150,8 @@ int main(int argc, char* argv[]) { bool allAtCenter = true; for (Ball& ball : circles) { - float gravityX = (float(window.get_width()) / 2.0f) - ball.x; - float gravityY = (float(window.get_height()) / 2.0f) - ball.y; + float gravityX = (float(window.width()) / 2.0f) - ball.x; + float gravityY = (float(window.height()) / 2.0f) - ball.y; float absoluteSpeed = std::max(std::sqrt(gravityX * gravityX + gravityY * gravityY), 3.0f); const float gravity = 0.07f; ball.xSpeed += (gravityX / absoluteSpeed) * gravity; @@ -186,7 +170,7 @@ int main(int argc, char* argv[]) { } else if(ball.y + ball.radius < 0) { ball.y = window.h() + ball.radius; }*/ - if ((std::abs(ball.x - float(window.get_width()) / 2.0f) > 1.0f) && (std::abs(ball.y - float(window.get_height()) / 2.0f) > 1.0f)) { + if ((std::abs(ball.x - float(window.width()) / 2.0f) > 1.0f) && (std::abs(ball.y - float(window.height()) / 2.0f) > 1.0f)) { allAtCenter = false; } // window.draw_circle({int(ball.x), int(ball.y)}, ball.radius, ball.colour, TDT4102::Color::black);