You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ovdCInputDialog.h 1.1KB

123456789101112131415161718192021222324252627282930313233343536
  1. #pragma once
  2. #include "ovd_base.h"
  3. namespace OpenViBE {
  4. namespace Designer {
  5. typedef void (*fpButtonCB)(GtkWidget* pWidget, gpointer data);
  6. class CInputDialog
  7. {
  8. public:
  9. CInputDialog(const char* gtkBuilder, fpButtonCB okButtonCB, void* data = nullptr, const char* title = nullptr, const char* label = nullptr,
  10. const char* entry = nullptr);
  11. ~CInputDialog();
  12. void run();
  13. void* getUserData() const { return m_userData; }
  14. const char* getEntry() const { return static_cast<const char*>(gtk_entry_get_text(m_dialogEntry)); }
  15. private:
  16. static gboolean keyPressEventCB(GtkWidget* widget, GdkEventKey* eventKey, gpointer data);
  17. static void buttonClickedCB(GtkButton* button, gpointer data);
  18. void buttonClicked(GtkButton* button) const;
  19. void* m_userData = nullptr;
  20. fpButtonCB m_okButtonCB;
  21. GtkDialog* m_dialog = nullptr;
  22. GtkLabel* m_dialogLabel = nullptr;
  23. GtkEntry* m_dialogEntry = nullptr;
  24. GtkButton* m_dialogOkButton = nullptr;
  25. GtkButton* m_dialogCancelButton = nullptr;
  26. };
  27. } // namespace Designer
  28. } // namespace OpenViBE