Logo Search packages:      
Sourcecode: inkscape version File versions

Inkscape::UI::Dialogs::FileOpenDialogImpl::FileOpenDialogImpl ( char const *  dir,
FileDialogType  fileTypes,
char const *  title 
)

Constructor. Not called directly. Use the factory.

Definition at line 813 of file filedialog.cpp.

References createFilterMenu(), extension, fileNameEntry, fileNameEntryChangedCallback(), fileSelectedCallback(), myFilename, svgPreview, and updatePreviewCallback().

                                                          :
                 Gtk::FileChooserDialog(Glib::ustring(title))
{


    /* One file at a time */
    set_select_multiple(false);

    /* Initalize to Autodetect */
    extension = NULL;
    /* No filename to start out with */
    myFilename = "";

    /* Set our dialog type (open, import, etc...)*/
    dialogType = fileTypes;


    /* Set the pwd and/or the filename */
    if (dir != NULL)
        set_current_folder(dir);

    //###### Add the file types menu
    createFilterMenu();

    //###### Add a preview widget
    set_preview_widget(svgPreview);
    set_preview_widget_active(true);
    set_use_preview_label (false);

    //Catch selection-changed events, so we can adjust the text widget
    signal_update_preview().connect(
         sigc::mem_fun(*this, &FileOpenDialogImpl::updatePreviewCallback) );


    //###### Add a text entry bar, and tie it to file chooser events
    fileNameEntry.set_text(get_current_folder());
    set_extra_widget(fileNameEntry);
    fileNameEntry.grab_focus();

    //Catch when user hits [return] on the text field
    fileNameEntry.signal_activate().connect(
         sigc::mem_fun(*this, &FileOpenDialogImpl::fileNameEntryChangedCallback) );

    //Catch selection-changed events, so we can adjust the text widget
    signal_selection_changed().connect(
         sigc::mem_fun(*this, &FileOpenDialogImpl::fileSelectedCallback) );

    add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
    add_button(Gtk::Stock::OPEN,   Gtk::RESPONSE_OK);

}


Generated by  Doxygen 1.6.0   Back to index