VDKFileChooser Class Reference

Provides a wrap for GtkFileChooser widget. More...

#include <vdkfilechooser.h>

Inheritance diagram for VDKFileChooser:

VDKForm VDKObject VDKNotCopyAble List of all members.

Public Member Functions

Public Attributes

Private Member Functions


Detailed Description

Provides a wrap for GtkFileChooser widget.

Usage
  #include <vdk/vdkfilechooser.h>
  FileStringArray selections;
  VDKFileChooser* fc = new VDKFileChooser(this, &selections,"File chooser");
  // fc->MultiSelection = true; // comment out for multi selection mode
  fc->AddFilterPattern("All files","*");
  fc->AddFilterPattern("C sources","*.c");
  fc->AddFilterPattern("CC sources","*.cc");
  fc->AddFilterPattern("C/CC headers","*.h");
  fc->SetDefaultFilter("All files");
  fc->ShowModal();
  // returns selections array filled with 1 or more filenames pending
  // on selection mode (set with MultiSelection property)
  if(selections.size() == 1)
    {
    printf("\nSelected:%s",(char*) selections[0]);
    fflush(stdout);
    }
  else if(selections.size() > 1)
    {
      for(int t = 0; t < selections.size(); t++)
            printf("\nSelected:%s",(char*) selections[t]);
      fflush(stdout);
    }
On return selections will be an empty array if user presses "cancel" button.


Constructor & Destructor Documentation

END_SIGNAL_MAP VDKFileChooser::VDKFileChooser ( VDKForm owner,
FileStringArray selections,
char *  title 
)

Constructor

Parameters:
owner 
selections a FileStringArray pointer
title window title


Member Function Documentation

void VDKFileChooser::Setup ( void   )  [private, virtual]

Must be overridden by subclasses, in this method user fills form with useful widgets

Implements VDKForm.

void VDKFileChooser::AddFilterPattern ( char *  name,
char *  pattern 
)

Add a filter based on a pattern

Parameters:
name a human readable name
pattern a filter pattern (ie: *.cc")

void VDKFileChooser::SetDefaultFilter ( char *  name  ) 

set <name> filter as default

Parameters:
name a human readable name

void VDKFileChooser::RemoveFilter ( char *  name  ) 

remove <name> filter from filter's list

Parameters:
name a human readable name


Member Data Documentation

VDKReadWriteValueProp<VDKFileChooser,bool> VDKFileChooser::MultiSelection

setting this property to true allow selecting more than one file (false by default)

VDKReadWriteValueProp<VDKFileChooser,GtkFileChooserAction> VDKFileChooser::Action

sets file chooser mode, can be one of following:


The documentation for this class was generated from the following files:
Generated on Fri Nov 10 15:11:26 2006 for vdk 2.4.0 by  doxygen 1.5.1