Changeset 4083 in orxonox.OLD for orxonox/trunk/src/lib/gui/gui/gui_gtk.cc
- Timestamp:
- May 6, 2005, 2:53:28 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/gui/gui/gui_gtk.cc
r4081 r4083 1748 1748 this->changeOption = NULL; 1749 1749 this->openUpButton = NULL; 1750 this->okObject = NULL; 1751 this->okFunc = NULL; 1750 1752 1751 1753 #ifdef HAVE_GTK2 1752 1754 this->widget = gtk_file_selection_new(fileDialogName); 1755 1756 gtk_file_selection_set_select_multiple(GTK_FILE_SELECTION (this->widget), FALSE); 1757 1753 1758 g_signal_connect(GTK_FILE_SELECTION (this->widget)->cancel_button, 1754 1759 "button_release_event", … … 1781 1786 } 1782 1787 1788 void FileDialog::setOKFunc(void* okObject, bool(*function)(const char* , void*)) 1789 { 1790 this->okObject = okObject; 1791 this->okFunc = function; 1792 } 1793 1794 1783 1795 void FileDialog::setOpenUpButton(Button* openUpButton) 1784 1796 { … … 1803 1815 } 1804 1816 1817 /** 1818 \brief disables the File Operator Buttons 1819 */ 1820 void 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 */ 1805 1830 void FileDialog::okEvent(void) 1806 1831 { 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 */ 1814 1853 void FileDialog::open(void) 1815 1854 { … … 1821 1860 } 1822 1861 1862 /** 1863 \closes the FileDialog-Window 1864 */ 1823 1865 void FileDialog::close(void) 1824 1866 {
Note: See TracChangeset
for help on using the changeset viewer.