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
|
//
// "$Id: DiffChooser.h 388 2006-06-07 16:09:03Z fabien $"
//
// DiffChooser widget definitions.
//
// Copyright 2005 by Michael Sweet.
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License v2 as published
// by the Free Software Foundation.
//
// 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.
//
#ifndef _DiffChooser_h_
# define _DiffChooser_h_
# include <FL/Fl.H>
# include <FL/Fl_Group.H>
# include <FL/Fl_File_Browser.H>
# include <FL/Fl_File_Input.H>
# include "FavoritesMenu.h"
#if defined(WIN32)
#include <io.h>
#define snprintf _snprintf
#define access _access
#else
#include <unistd.h>
#endif
class DiffChooser : public Fl_Group
{
Fl_File_Input input_; // Input field
FavoritesMenu menu_; // Favorites button
Fl_File_Browser browser_; // File browser
char directory_[1024];// Directory name
char filename_[1024];// Cached filename
static void browser_cb(Fl_File_Browser *fb, DiffChooser *dc);
static void input_cb(Fl_File_Input *fi, DiffChooser *dc);
static void menu_cb(FavoritesMenu *fm, DiffChooser *dc);
public:
DiffChooser(int X, int Y, int W, int H, const char *L = (const char *)0);
int count();
void deselect() { browser_.deselect(); }
const char *directory() { return (directory_); }
int selected(int i) { return (browser_.selected(i)); }
int size() { return (browser_.size()); }
void value(const char *f);
const char *value() { return (input_.value()); }
const char *value(int i);
};
#endif // !_DiffChooser_h_
//
// End of "$Id: DiffChooser.h 388 2006-06-07 16:09:03Z fabien $".
//
|