1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
|
/*
Copyright (C) 2006-2009 Fons Adriaensen <fons@kokkinizita.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __FILEWIN_H
#define __FILEWIN_H
#include <clxclient.h>
#include "global.h"
class Filewin : public X_window , public X_callback
{
public:
Filewin (X_window *parw, X_callback *callb, X_resman *resman);
~Filewin (void);
void save_dialog (const char *path, const char *fext, const char *file = 0);
void load_dialog (const char *path, const char *fext, const char *file = 0);
const char *file (void) const { return _tfname->text (); }
const char *wdir (void) const { return _wdir; }
private:
enum { LOAD, SAVE };
enum { B_CANCEL, B_ACTION, B_NEWDIR, B_DELETE, B_PARENT, B_GOHOME, B_PRESET };
enum
{
XMIN = 450, YMIN = 300,
XMAX = 900, YMAX = 600,
XPOS = 150, YPOS = 150,
LM = 4, RM = 4
};
virtual void handle_event (XEvent *xe);
virtual void handle_callb (int, X_window*, _XEvent*);
void expose (XExposeEvent *E);
void resize (XConfigureEvent *E);
void xcmesg (XClientMessageEvent *E);
void redraw (void);
void scandir (const char *path, const char *fext);
void newdir (void);
void remove (void);
void select (XButtonEvent *E);
void action (void);
void show (const char *path, const char *fext);
void hide (int cbarg);
Atom _xatom;
X_callback *_xcbh;
int _xs;
int _ys;
int _cbarg;
char _fext [64];
char _cdir [1024];
char _wdir [1024];
const char *_home;
const char *_pres;
X_mclist *_mclist;
X_window *_wbottom;
X_scroll *_scroll;
X_textip *_tfpath;
X_textip *_tfname;
X_tbutton *_bcancel;
X_tbutton *_baction;
X_tbutton *_bnewdir;
X_tbutton *_bdelete;
X_tbutton *_bparent;
X_tbutton *_bgohome;
X_tbutton *_bpreset;
};
#endif
|