Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4083 in orxonox.OLD for orxonox/trunk/src/lib/gui/gui/gui_gtk.cc


Ignore:
Timestamp:
May 6, 2005, 2:53:28 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk/gui: now one can only select the data-repos

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/gui/gui/gui_gtk.cc

    r4081 r4083  
    17481748  this->changeOption = NULL;
    17491749  this->openUpButton = NULL;
     1750  this->okObject = NULL;
     1751  this->okFunc = NULL;
    17501752
    17511753#ifdef HAVE_GTK2
    17521754  this->widget = gtk_file_selection_new(fileDialogName);
     1755
     1756  gtk_file_selection_set_select_multiple(GTK_FILE_SELECTION (this->widget), FALSE);
     1757
    17531758  g_signal_connect(GTK_FILE_SELECTION (this->widget)->cancel_button,
    17541759                     "button_release_event",
     
    17811786}
    17821787
     1788void FileDialog::setOKFunc(void* okObject, bool(*function)(const char* , void*))
     1789{
     1790  this->okObject = okObject;
     1791  this->okFunc = function;
     1792}
     1793
     1794
    17831795void FileDialog::setOpenUpButton(Button* openUpButton)
    17841796{
     
    18031815}
    18041816
     1817/**
     1818   \brief disables the File Operator Buttons
     1819*/
     1820void FileDialog::disableFileOpts(void)
     1821{
     1822#ifdef HAVE_GTK2
     1823  gtk_file_selection_hide_fileop_buttons(GTK_FILE_SELECTION(this->widget));
     1824#endif /* HAVE_GTK2 */
     1825}
     1826
     1827/**
     1828   \brief The ok-button has been pressed
     1829*/
    18051830void FileDialog::okEvent(void)
    18061831{
    1807   if (this->changeOption)
    1808 #ifdef HAVE_GTK2
    1809     changeOption->setValue(gtk_file_selection_get_filename(GTK_FILE_SELECTION(this->widget)));
    1810 #endif /* HAVE_GTK2 */
    1811   this->close();
    1812 }
    1813 
     1832  if (this->okFunc)
     1833    {
     1834#ifdef HAVE_GTK2
     1835      if(this->okFunc((const char*)gtk_file_selection_get_filename(GTK_FILE_SELECTION(this->widget)), this->okObject))
     1836         this->close();
     1837#endif /* HAVE_GTK2 */
     1838    }
     1839  else if (this->changeOption)
     1840    {
     1841#ifdef HAVE_GTK2
     1842      changeOption->setValue(gtk_file_selection_get_filename(GTK_FILE_SELECTION(this->widget)));
     1843#endif /* HAVE_GTK2 */
     1844      this->close();
     1845    }
     1846  else
     1847    this->close();
     1848}
     1849
     1850/**
     1851   \biref opens up the FileDialog-Window
     1852*/
    18141853void FileDialog::open(void)
    18151854{
     
    18211860}
    18221861
     1862/**
     1863   \closes the FileDialog-Window
     1864*/
    18231865void FileDialog::close(void)
    18241866{
Note: See TracChangeset for help on using the changeset viewer.