Thanks !
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts Menuvoid function(tgui::Gui& gui);
button->bindCallback(std::bind(function, std::ref(gui)), tgui::CheckBox::Checked | tgui::CheckBox::Unchecked);
p.button->bindCallback(std::bind(&AddObjectDialog::CloseAndSaveCallback, p.object), this, tgui::Button::LeftMouseClicked);
'tgui::CallbackManager::bindCallback' : no overloaded function takes 3 arguments
void NewObjectDialog::Display(sf::RenderWindow *w)
{
m_canvas->clear(sf::Color(80, 80, 80));
m_canvas->draw(*m_image);
}
tgui::Button::Ptr()
//Create the panel
m_panel = tgui::Panel::Ptr(*m_win);
m_panel->setPosition(0, 0);
m_panel->setSize(300, 400);
m_panel->setBackgroundColor(sf::Color(200, 200, 200));
//Add some widgets to it
m_b_ok = tgui::Button::Ptr(*m_panel);
m_b_ok->load(THEME_CONFIG_FILE);
m_b_ok->setSize(130, 30);
m_b_ok->setPosition(0, 0);
m_b_ok->setText("Ok");
//m_panel->add(m_b_ok);
m_b_cancel = tgui::Button::Ptr(*m_panel);
m_b_cancel->load(THEME_CONFIG_FILE);
m_b_cancel->setSize(130, 30);
m_b_cancel->setPosition(0, 40);
m_b_cancel->setText("Cancel");
//m_panel->add(m_b_cancel);
//Add the scrollbar
m_scrollbar = tgui::Scrollbar::Ptr(*m_win);
m_scrollbar->load(THEME_CONFIG_FILE);
m_scrollbar->setSize(20, 400);
m_scrollbar->setPosition(m_panel->getPosition() + sf::Vector2f(m_panel->getSize().x, 0));
m_scrollbar->setArrowScrollAmount(30);
m_scrollbar->setLowValue(360); // Viewable area (height of the panel)
m_scrollbar->setMaximum(400); // Total area (height of the 5 images)
// Call the scrollPanel function that we defined above when scrolling
m_scrollbar->bindCallback(&NewObjectDialog::ScrollPanel, this, tgui::Scrollbar::ValueChanged);
//Create the panel
m_panel->setPosition(0, 0);
m_panel->setSize(300, 400);
m_panel->setBackgroundColor(sf::Color(200, 200, 200));
//Add some widgets to it
//Button ok
m_b_ok->load(THEME_CONFIG_FILE);
m_b_ok->setSize(130, 30);
m_b_ok->setPosition(0, 0);
m_b_ok->setText("Ok");
m_panel->add(m_b_ok);
//Button cancel
m_b_cancel->load(THEME_CONFIG_FILE);
m_b_cancel->setSize(130, 30);
m_b_cancel->setPosition(0, 40);
m_b_cancel->setText("Cancel");
m_panel->add(m_b_cancel);
//Add the scrollbar
m_scrollbar->load(THEME_CONFIG_FILE);
m_scrollbar->setSize(20, 400);
m_scrollbar->setPosition(m_panel->getPosition() + sf::Vector2f(m_panel->getSize().x, 0));
m_scrollbar->setArrowScrollAmount(30);
m_scrollbar->setLowValue(360); // Viewable area (height of the panel)
m_scrollbar->setMaximum(5 * 180); // Total area (height of the 5 images)
// Call the scrollPanel function that we defined above when scrolling
m_scrollbar->bindCallback(&NewObjectDialog::ScrollPanel, this, tgui::Scrollbar::ValueChanged);
m_win->add(m_panel);
m_win->add(m_scrollbar);