2
This file is part of Advanced Strategic Command; http://www.asc-hq.de
3
Copyright (C) 1994-1999 Martin Bickel and Marc Schellenberger
5
This program is free software; you can redistribute it and/or modify
6
it under the terms of the GNU General Public License as published by
7
the Free Software Foundation; either version 2 of the License, or
8
(at your option) any later version.
10
This program is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
GNU General Public License for more details.
15
You should have received a copy of the GNU General Public License
16
along with this program; see the file COPYING. If not, write to the
17
Free Software Foundation, Inc., 59 Temple Place, Suite 330,
18
Boston, MA 02111-1307 USA
21
#ifndef FILESELECTOR_H
22
#define FILESELECTOR_H
24
#include "selectionwindow.h"
25
#include "../paradialog.h"
28
class FileSelectionItemFactory;
30
class FileSelectionWindow : public ASC_PG_Dialog {
34
FileSelectionItemFactory* factory;
37
void fileNameSelected( const ASCString& filename );
38
void fileNameEntered( ASCString filename );
40
FileSelectionWindow( PG_Widget *parent, const PG_Rect &r, const ASCString& fileWildcard, bool save );
41
ASCString getFilename() { return filename; };
45
class FileSelectionItemFactory: public SelectionItemFactory {
47
typedef deallocating_vector<FileInfo*> Items;
54
FileSelectionItemFactory( const ASCString& wildcard );
56
static bool comp ( const FileInfo* i1, const FileInfo* i2 );
60
int getLevel( const ASCString& name );
62
SelectionWidget* spawnNextItem( PG_Widget* parent, const PG_Point& pos );
64
SigC::Signal1<void,const ASCString& > filenameSelectedMouse;
65
SigC::Signal1<void,const ASCString& > filenameSelectedKeyb;
66
SigC::Signal1<void,const ASCString& > filenameMarked;
68
void itemMarked( const SelectionWidget* widget );
70
void itemSelected( const SelectionWidget* widget, bool mouse );
73
extern ASCString selectFile( const ASCString& ext, bool load );