2005-03-25 18:20:26 +03:00
|
|
|
//
|
|
|
|
// "$Id$"
|
|
|
|
//
|
|
|
|
// Fl_File_Chooser dialog for the Fast Light Tool Kit (FLTK).
|
|
|
|
//
|
2011-06-07 15:41:36 +04:00
|
|
|
// Copyright 1998-2011 by Bill Spitzak and others.
|
2005-03-25 18:20:26 +03:00
|
|
|
//
|
2011-07-19 08:49:30 +04:00
|
|
|
// This library is free software. Distribution and use rights are outlined in
|
|
|
|
// the file "COPYING" which should have been included with this file. If this
|
|
|
|
// file is missing or damaged, see the license at:
|
|
|
|
//
|
|
|
|
// http://www.fltk.org/COPYING.php
|
2005-03-25 18:20:26 +03:00
|
|
|
//
|
|
|
|
// Please report all bugs and problems on the following page:
|
|
|
|
//
|
|
|
|
// http://www.fltk.org/str.php
|
|
|
|
//
|
|
|
|
|
2008-05-01 22:03:45 +04:00
|
|
|
// generated by Fast Light User Interface Designer (fluid) version 1.0300
|
2001-08-02 01:24:49 +04:00
|
|
|
|
2001-09-29 18:38:59 +04:00
|
|
|
#include "../FL/Fl_File_Chooser.H"
|
2005-07-25 23:20:06 +04:00
|
|
|
#include <FL/fl_draw.H>
|
2001-08-02 01:24:49 +04:00
|
|
|
|
2005-04-15 22:00:33 +04:00
|
|
|
void Fl_File_Chooser::cb_window_i(Fl_Double_Window*, void*) {
|
2002-11-20 18:49:24 +03:00
|
|
|
fileName->value("");
|
2002-05-24 18:02:56 +04:00
|
|
|
fileList->deselect();
|
2002-06-07 19:06:32 +04:00
|
|
|
Fl::remove_timeout((Fl_Timeout_Handler)previewCB, this);
|
2001-08-02 20:17:04 +04:00
|
|
|
window->hide();
|
2001-08-02 01:24:49 +04:00
|
|
|
}
|
2003-09-08 21:11:45 +04:00
|
|
|
void Fl_File_Chooser::cb_window(Fl_Double_Window* o, void* v) {
|
2001-09-29 18:38:59 +04:00
|
|
|
((Fl_File_Chooser*)(o->user_data()))->cb_window_i(o,v);
|
2001-08-02 01:24:49 +04:00
|
|
|
}
|
|
|
|
|
2005-04-15 22:00:33 +04:00
|
|
|
void Fl_File_Chooser::cb_showChoice_i(Fl_Choice*, void*) {
|
2002-06-07 19:06:32 +04:00
|
|
|
showChoiceCB();
|
2001-08-02 20:17:04 +04:00
|
|
|
}
|
2002-06-07 19:06:32 +04:00
|
|
|
void Fl_File_Chooser::cb_showChoice(Fl_Choice* o, void* v) {
|
|
|
|
((Fl_File_Chooser*)(o->parent()->parent()->user_data()))->cb_showChoice_i(o,v);
|
2001-08-02 01:24:49 +04:00
|
|
|
}
|
|
|
|
|
2005-04-15 22:00:33 +04:00
|
|
|
void Fl_File_Chooser::cb_favoritesButton_i(Fl_Menu_Button*, void*) {
|
2002-06-07 19:06:32 +04:00
|
|
|
favoritesButtonCB();
|
2001-08-02 01:24:49 +04:00
|
|
|
}
|
2002-06-07 19:06:32 +04:00
|
|
|
void Fl_File_Chooser::cb_favoritesButton(Fl_Menu_Button* o, void* v) {
|
|
|
|
((Fl_File_Chooser*)(o->parent()->parent()->user_data()))->cb_favoritesButton_i(o,v);
|
2001-08-02 01:24:49 +04:00
|
|
|
}
|
|
|
|
|
2005-04-15 22:00:33 +04:00
|
|
|
void Fl_File_Chooser::cb_newButton_i(Fl_Button*, void*) {
|
2001-08-02 01:24:49 +04:00
|
|
|
newdir();
|
|
|
|
}
|
2001-09-29 18:38:59 +04:00
|
|
|
void Fl_File_Chooser::cb_newButton(Fl_Button* o, void* v) {
|
2002-06-07 19:06:32 +04:00
|
|
|
((Fl_File_Chooser*)(o->parent()->parent()->user_data()))->cb_newButton_i(o,v);
|
2001-08-02 01:24:49 +04:00
|
|
|
}
|
|
|
|
|
2002-06-07 19:06:32 +04:00
|
|
|
#include <FL/Fl_Bitmap.H>
|
2001-12-11 19:03:13 +03:00
|
|
|
static unsigned char idata_new[] =
|
2005-11-01 19:32:21 +03:00
|
|
|
{0,0,120,0,132,0,2,1,1,254,1,128,49,128,49,128,253,128,253,128,49,128,49,
|
|
|
|
128,1,128,1,128,255,255,0,0};
|
2001-12-11 19:03:13 +03:00
|
|
|
static Fl_Bitmap image_new(idata_new, 16, 16);
|
2001-08-02 01:24:49 +04:00
|
|
|
|
2005-04-15 22:00:33 +04:00
|
|
|
void Fl_File_Chooser::cb__i(Fl_Tile*, void*) {
|
2002-06-07 19:06:32 +04:00
|
|
|
update_preview();
|
2001-08-02 01:24:49 +04:00
|
|
|
}
|
2002-06-07 19:06:32 +04:00
|
|
|
void Fl_File_Chooser::cb_(Fl_Tile* o, void* v) {
|
2001-09-29 18:38:59 +04:00
|
|
|
((Fl_File_Chooser*)(o->parent()->user_data()))->cb__i(o,v);
|
2001-08-02 01:24:49 +04:00
|
|
|
}
|
|
|
|
|
2005-04-15 22:00:33 +04:00
|
|
|
void Fl_File_Chooser::cb_fileList_i(Fl_File_Browser*, void*) {
|
2002-04-19 00:37:29 +04:00
|
|
|
fileListCB();
|
|
|
|
}
|
|
|
|
void Fl_File_Chooser::cb_fileList(Fl_File_Browser* o, void* v) {
|
2002-06-07 19:06:32 +04:00
|
|
|
((Fl_File_Chooser*)(o->parent()->parent()->user_data()))->cb_fileList_i(o,v);
|
|
|
|
}
|
|
|
|
|
2005-04-15 22:00:33 +04:00
|
|
|
void Fl_File_Chooser::cb_previewButton_i(Fl_Check_Button*, void*) {
|
2002-06-07 19:06:32 +04:00
|
|
|
preview(previewButton->value());
|
|
|
|
}
|
|
|
|
void Fl_File_Chooser::cb_previewButton(Fl_Check_Button* o, void* v) {
|
|
|
|
((Fl_File_Chooser*)(o->parent()->parent()->parent()->user_data()))->cb_previewButton_i(o,v);
|
2002-04-19 00:37:29 +04:00
|
|
|
}
|
2011-06-06 20:11:22 +04:00
|
|
|
|
|
|
|
void Fl_File_Chooser::cb_showHiddenButton_i(Fl_Check_Button*, void*) {
|
|
|
|
showHidden(showHiddenButton->value());
|
|
|
|
}
|
|
|
|
void Fl_File_Chooser::cb_showHiddenButton(Fl_Check_Button* o, void* v) {
|
|
|
|
((Fl_File_Chooser*)(o->parent()->parent()->parent()->user_data()))->cb_showHiddenButton_i(o,v);
|
|
|
|
}
|
|
|
|
|
2005-04-15 22:00:33 +04:00
|
|
|
void Fl_File_Chooser::cb_fileName_i(Fl_File_Input*, void*) {
|
2002-04-19 00:37:29 +04:00
|
|
|
fileNameCB();
|
|
|
|
}
|
2002-05-01 01:50:16 +04:00
|
|
|
void Fl_File_Chooser::cb_fileName(Fl_File_Input* o, void* v) {
|
2002-06-07 19:06:32 +04:00
|
|
|
((Fl_File_Chooser*)(o->parent()->parent()->user_data()))->cb_fileName_i(o,v);
|
2002-04-19 00:37:29 +04:00
|
|
|
}
|
|
|
|
|
2005-04-15 22:00:33 +04:00
|
|
|
void Fl_File_Chooser::cb_okButton_i(Fl_Return_Button*, void*) {
|
2007-01-28 22:41:56 +03:00
|
|
|
window->hide();
|
|
|
|
|
|
|
|
// Do any callback that is registered...
|
2002-04-19 00:37:29 +04:00
|
|
|
if (callback_)
|
|
|
|
(*callback_)(this, data_);
|
|
|
|
}
|
|
|
|
void Fl_File_Chooser::cb_okButton(Fl_Return_Button* o, void* v) {
|
2002-06-07 19:06:32 +04:00
|
|
|
((Fl_File_Chooser*)(o->parent()->parent()->parent()->user_data()))->cb_okButton_i(o,v);
|
2002-04-19 00:37:29 +04:00
|
|
|
}
|
|
|
|
|
2005-04-15 22:00:33 +04:00
|
|
|
void Fl_File_Chooser::cb_cancelButton_i(Fl_Button*, void*) {
|
2002-11-19 20:26:10 +03:00
|
|
|
fileName->value("");
|
2002-05-24 18:02:56 +04:00
|
|
|
fileList->deselect();
|
2002-06-07 19:06:32 +04:00
|
|
|
Fl::remove_timeout((Fl_Timeout_Handler)previewCB, this);
|
2002-04-19 00:37:29 +04:00
|
|
|
window->hide();
|
|
|
|
}
|
2005-03-25 18:20:26 +03:00
|
|
|
void Fl_File_Chooser::cb_cancelButton(Fl_Button* o, void* v) {
|
|
|
|
((Fl_File_Chooser*)(o->parent()->parent()->parent()->user_data()))->cb_cancelButton_i(o,v);
|
2002-06-07 19:06:32 +04:00
|
|
|
}
|
|
|
|
|
2005-04-15 22:00:33 +04:00
|
|
|
void Fl_File_Chooser::cb_favList_i(Fl_File_Browser*, void*) {
|
2002-06-07 19:06:32 +04:00
|
|
|
favoritesCB(favList);
|
|
|
|
}
|
|
|
|
void Fl_File_Chooser::cb_favList(Fl_File_Browser* o, void* v) {
|
|
|
|
((Fl_File_Chooser*)(o->parent()->user_data()))->cb_favList_i(o,v);
|
|
|
|
}
|
|
|
|
|
2005-04-15 22:00:33 +04:00
|
|
|
void Fl_File_Chooser::cb_favUpButton_i(Fl_Button*, void*) {
|
2002-06-07 19:06:32 +04:00
|
|
|
favoritesCB(favUpButton);
|
|
|
|
}
|
|
|
|
void Fl_File_Chooser::cb_favUpButton(Fl_Button* o, void* v) {
|
2005-03-25 18:20:26 +03:00
|
|
|
((Fl_File_Chooser*)(o->parent()->parent()->user_data()))->cb_favUpButton_i(o,v);
|
2002-06-07 19:06:32 +04:00
|
|
|
}
|
|
|
|
|
2005-04-15 22:00:33 +04:00
|
|
|
void Fl_File_Chooser::cb_favDeleteButton_i(Fl_Button*, void*) {
|
2002-06-07 19:06:32 +04:00
|
|
|
favoritesCB(favDeleteButton);
|
|
|
|
}
|
|
|
|
void Fl_File_Chooser::cb_favDeleteButton(Fl_Button* o, void* v) {
|
2005-03-25 18:20:26 +03:00
|
|
|
((Fl_File_Chooser*)(o->parent()->parent()->user_data()))->cb_favDeleteButton_i(o,v);
|
2002-06-07 19:06:32 +04:00
|
|
|
}
|
|
|
|
|
2005-04-15 22:00:33 +04:00
|
|
|
void Fl_File_Chooser::cb_favDownButton_i(Fl_Button*, void*) {
|
2002-06-07 19:06:32 +04:00
|
|
|
favoritesCB(favDownButton);
|
|
|
|
}
|
|
|
|
void Fl_File_Chooser::cb_favDownButton(Fl_Button* o, void* v) {
|
2005-03-25 18:20:26 +03:00
|
|
|
((Fl_File_Chooser*)(o->parent()->parent()->user_data()))->cb_favDownButton_i(o,v);
|
2002-06-07 19:06:32 +04:00
|
|
|
}
|
|
|
|
|
2005-04-15 22:00:33 +04:00
|
|
|
void Fl_File_Chooser::cb_favCancelButton_i(Fl_Button*, void*) {
|
2002-06-07 19:06:32 +04:00
|
|
|
favWindow->hide();
|
|
|
|
}
|
|
|
|
void Fl_File_Chooser::cb_favCancelButton(Fl_Button* o, void* v) {
|
2005-03-25 18:20:26 +03:00
|
|
|
((Fl_File_Chooser*)(o->parent()->parent()->user_data()))->cb_favCancelButton_i(o,v);
|
2002-06-07 19:06:32 +04:00
|
|
|
}
|
|
|
|
|
2005-04-15 22:00:33 +04:00
|
|
|
void Fl_File_Chooser::cb_favOkButton_i(Fl_Return_Button*, void*) {
|
2002-06-07 19:06:32 +04:00
|
|
|
favoritesCB(favOkButton);
|
|
|
|
}
|
|
|
|
void Fl_File_Chooser::cb_favOkButton(Fl_Return_Button* o, void* v) {
|
2005-03-25 18:20:26 +03:00
|
|
|
((Fl_File_Chooser*)(o->parent()->parent()->user_data()))->cb_favOkButton_i(o,v);
|
2002-04-19 00:37:29 +04:00
|
|
|
}
|
|
|
|
|
2001-09-29 18:38:59 +04:00
|
|
|
Fl_File_Chooser::Fl_File_Chooser(const char *d, const char *p, int t, const char *title) {
|
2007-02-21 23:23:03 +03:00
|
|
|
Fl_Group *prev_current = Fl_Group::current();
|
2007-01-28 22:41:56 +03:00
|
|
|
{ window = new Fl_Double_Window(490, 380, "Choose File");
|
|
|
|
window->callback((Fl_Callback*)cb_window, (void*)(this));
|
2005-03-25 18:20:26 +03:00
|
|
|
{ Fl_Group* o = new Fl_Group(10, 10, 470, 25);
|
2007-01-28 22:41:56 +03:00
|
|
|
{ showChoice = new Fl_Choice(65, 10, 215, 25, "Show:");
|
|
|
|
showChoice->down_box(FL_BORDER_BOX);
|
|
|
|
showChoice->labelfont(1);
|
|
|
|
showChoice->callback((Fl_Callback*)cb_showChoice);
|
|
|
|
Fl_Group::current()->resizable(showChoice);
|
2002-06-07 19:06:32 +04:00
|
|
|
showChoice->label(show_label);
|
2007-01-28 22:41:56 +03:00
|
|
|
} // Fl_Choice* showChoice
|
|
|
|
{ favoritesButton = new Fl_Menu_Button(290, 10, 155, 25, "Favorites");
|
|
|
|
favoritesButton->down_box(FL_BORDER_BOX);
|
|
|
|
favoritesButton->callback((Fl_Callback*)cb_favoritesButton);
|
2008-10-01 02:22:49 +04:00
|
|
|
favoritesButton->align(Fl_Align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE));
|
2002-06-07 19:06:32 +04:00
|
|
|
favoritesButton->label(favorites_label);
|
2007-01-28 22:41:56 +03:00
|
|
|
} // Fl_Menu_Button* favoritesButton
|
2002-06-07 19:06:32 +04:00
|
|
|
{ Fl_Button* o = newButton = new Fl_Button(455, 10, 25, 25);
|
2007-01-28 22:41:56 +03:00
|
|
|
newButton->image(image_new);
|
|
|
|
newButton->labelsize(8);
|
|
|
|
newButton->callback((Fl_Callback*)cb_newButton);
|
2004-04-06 23:33:11 +04:00
|
|
|
o->tooltip(new_directory_tooltip);
|
2007-01-28 22:41:56 +03:00
|
|
|
} // Fl_Button* newButton
|
2002-06-07 19:06:32 +04:00
|
|
|
o->end();
|
2007-01-28 22:41:56 +03:00
|
|
|
} // Fl_Group* o
|
2005-11-01 19:32:21 +03:00
|
|
|
{ Fl_Tile* o = new Fl_Tile(10, 45, 470, 225);
|
2001-09-29 10:40:06 +04:00
|
|
|
o->callback((Fl_Callback*)cb_);
|
2007-01-28 22:41:56 +03:00
|
|
|
{ fileList = new Fl_File_Browser(10, 45, 295, 225);
|
|
|
|
fileList->type(2);
|
|
|
|
fileList->callback((Fl_Callback*)cb_fileList);
|
|
|
|
fileList->window()->hotspot(fileList);
|
|
|
|
} // Fl_File_Browser* fileList
|
|
|
|
{ previewBox = new Fl_Box(305, 45, 175, 225, "?");
|
|
|
|
previewBox->box(FL_DOWN_BOX);
|
|
|
|
previewBox->labelsize(100);
|
2008-10-01 02:22:49 +04:00
|
|
|
previewBox->align(Fl_Align(FL_ALIGN_CLIP|FL_ALIGN_INSIDE));
|
2007-01-28 22:41:56 +03:00
|
|
|
} // Fl_Box* previewBox
|
2002-06-07 19:06:32 +04:00
|
|
|
o->end();
|
|
|
|
Fl_Group::current()->resizable(o);
|
2007-01-28 22:41:56 +03:00
|
|
|
} // Fl_Tile* o
|
2005-11-01 19:32:21 +03:00
|
|
|
{ Fl_Group* o = new Fl_Group(10, 275, 470, 95);
|
2002-06-07 19:06:32 +04:00
|
|
|
{ Fl_Group* o = new Fl_Group(10, 275, 470, 20);
|
2007-01-28 22:41:56 +03:00
|
|
|
{ previewButton = new Fl_Check_Button(10, 275, 73, 20, "Preview");
|
2008-05-01 22:03:45 +04:00
|
|
|
previewButton->shortcut(0x80070);
|
2007-01-28 22:41:56 +03:00
|
|
|
previewButton->down_box(FL_DOWN_BOX);
|
|
|
|
previewButton->value(1);
|
|
|
|
previewButton->callback((Fl_Callback*)cb_previewButton);
|
2002-06-07 19:06:32 +04:00
|
|
|
previewButton->label(preview_label);
|
2007-01-28 22:41:56 +03:00
|
|
|
} // Fl_Check_Button* previewButton
|
2011-06-06 20:11:22 +04:00
|
|
|
{ showHiddenButton = new Fl_Check_Button(115, 275, 165, 20, "Show hidden files");
|
|
|
|
showHiddenButton->down_box(FL_DOWN_BOX);
|
|
|
|
showHiddenButton->callback((Fl_Callback*)cb_showHiddenButton);
|
|
|
|
showHiddenButton->label(hidden_label);
|
|
|
|
} // Fl_Check_Button* showHiddenButton
|
2005-11-07 11:39:23 +03:00
|
|
|
{ Fl_Box* o = new Fl_Box(115, 275, 365, 20);
|
2002-06-07 19:06:32 +04:00
|
|
|
Fl_Group::current()->resizable(o);
|
2007-01-28 22:41:56 +03:00
|
|
|
} // Fl_Box* o
|
2002-06-07 19:06:32 +04:00
|
|
|
o->end();
|
2007-01-28 22:41:56 +03:00
|
|
|
} // Fl_Group* o
|
|
|
|
{ fileName = new Fl_File_Input(115, 300, 365, 35);
|
|
|
|
fileName->labelfont(1);
|
|
|
|
fileName->callback((Fl_Callback*)cb_fileName);
|
|
|
|
fileName->when(FL_WHEN_ENTER_KEY);
|
|
|
|
Fl_Group::current()->resizable(fileName);
|
2008-04-12 23:16:19 +04:00
|
|
|
fileName->when(FL_WHEN_CHANGED | FL_WHEN_ENTER_KEY);
|
2007-01-28 22:41:56 +03:00
|
|
|
} // Fl_File_Input* fileName
|
2003-09-08 21:11:45 +04:00
|
|
|
{ Fl_Box* o = new Fl_Box(10, 310, 105, 25, "Filename:");
|
2005-03-25 18:20:26 +03:00
|
|
|
o->labelfont(1);
|
2008-10-01 02:22:49 +04:00
|
|
|
o->align(Fl_Align(FL_ALIGN_RIGHT|FL_ALIGN_INSIDE));
|
2002-06-07 19:06:32 +04:00
|
|
|
o->label(filename_label);
|
2007-01-28 22:41:56 +03:00
|
|
|
} // Fl_Box* o
|
2002-06-07 19:06:32 +04:00
|
|
|
{ Fl_Group* o = new Fl_Group(10, 345, 470, 25);
|
2007-01-28 22:41:56 +03:00
|
|
|
{ okButton = new Fl_Return_Button(313, 345, 85, 25, "OK");
|
|
|
|
okButton->callback((Fl_Callback*)cb_okButton);
|
2002-06-07 19:06:32 +04:00
|
|
|
okButton->label(fl_ok);
|
2007-01-28 22:41:56 +03:00
|
|
|
} // Fl_Return_Button* okButton
|
2005-03-25 18:20:26 +03:00
|
|
|
{ Fl_Button* o = cancelButton = new Fl_Button(408, 345, 72, 25, "Cancel");
|
2007-01-28 22:41:56 +03:00
|
|
|
cancelButton->callback((Fl_Callback*)cb_cancelButton);
|
2002-06-07 19:06:32 +04:00
|
|
|
o->label(fl_cancel);
|
2007-01-28 22:41:56 +03:00
|
|
|
} // Fl_Button* cancelButton
|
2005-03-25 18:20:26 +03:00
|
|
|
{ Fl_Box* o = new Fl_Box(10, 345, 30, 25);
|
2002-06-07 19:06:32 +04:00
|
|
|
Fl_Group::current()->resizable(o);
|
2007-01-28 22:41:56 +03:00
|
|
|
} // Fl_Box* o
|
2002-06-07 19:06:32 +04:00
|
|
|
o->end();
|
2007-01-28 22:41:56 +03:00
|
|
|
} // Fl_Group* o
|
2002-06-07 19:06:32 +04:00
|
|
|
o->end();
|
2007-01-28 22:41:56 +03:00
|
|
|
} // Fl_Group* o
|
2002-06-07 19:06:32 +04:00
|
|
|
if (title) window->label(title);
|
2007-01-28 22:41:56 +03:00
|
|
|
window->set_modal();
|
|
|
|
window->end();
|
|
|
|
} // Fl_Double_Window* window
|
|
|
|
{ favWindow = new Fl_Double_Window(355, 150, "Manage Favorites");
|
|
|
|
favWindow->user_data((void*)(this));
|
|
|
|
{ favList = new Fl_File_Browser(10, 10, 300, 95);
|
|
|
|
favList->type(2);
|
|
|
|
favList->callback((Fl_Callback*)cb_favList);
|
|
|
|
Fl_Group::current()->resizable(favList);
|
|
|
|
} // Fl_File_Browser* favList
|
2005-03-25 18:20:26 +03:00
|
|
|
{ Fl_Group* o = new Fl_Group(320, 10, 25, 95);
|
2007-01-28 22:41:56 +03:00
|
|
|
{ favUpButton = new Fl_Button(320, 10, 25, 25, "@8>");
|
|
|
|
favUpButton->callback((Fl_Callback*)cb_favUpButton);
|
|
|
|
} // Fl_Button* favUpButton
|
|
|
|
{ favDeleteButton = new Fl_Button(320, 45, 25, 25, "X");
|
|
|
|
favDeleteButton->labelfont(1);
|
|
|
|
favDeleteButton->callback((Fl_Callback*)cb_favDeleteButton);
|
|
|
|
Fl_Group::current()->resizable(favDeleteButton);
|
|
|
|
} // Fl_Button* favDeleteButton
|
|
|
|
{ favDownButton = new Fl_Button(320, 80, 25, 25, "@2>");
|
|
|
|
favDownButton->callback((Fl_Callback*)cb_favDownButton);
|
|
|
|
} // Fl_Button* favDownButton
|
2005-03-25 18:20:26 +03:00
|
|
|
o->end();
|
2007-01-28 22:41:56 +03:00
|
|
|
} // Fl_Group* o
|
2005-03-25 18:20:26 +03:00
|
|
|
{ Fl_Group* o = new Fl_Group(10, 113, 335, 29);
|
2007-01-28 22:41:56 +03:00
|
|
|
{ favCancelButton = new Fl_Button(273, 115, 72, 25, "Cancel");
|
|
|
|
favCancelButton->callback((Fl_Callback*)cb_favCancelButton);
|
2005-03-25 18:20:26 +03:00
|
|
|
favCancelButton->label(fl_cancel);
|
2007-01-28 22:41:56 +03:00
|
|
|
} // Fl_Button* favCancelButton
|
|
|
|
{ favOkButton = new Fl_Return_Button(181, 115, 79, 25, "Save");
|
|
|
|
favOkButton->callback((Fl_Callback*)cb_favOkButton);
|
2005-03-25 18:20:26 +03:00
|
|
|
favOkButton->label(save_label);
|
2007-01-28 22:41:56 +03:00
|
|
|
} // Fl_Return_Button* favOkButton
|
2005-03-25 18:20:26 +03:00
|
|
|
{ Fl_Box* o = new Fl_Box(10, 115, 161, 25);
|
|
|
|
Fl_Group::current()->resizable(o);
|
2007-01-28 22:41:56 +03:00
|
|
|
} // Fl_Box* o
|
2005-03-25 18:20:26 +03:00
|
|
|
o->end();
|
2007-01-28 22:41:56 +03:00
|
|
|
} // Fl_Group* o
|
2002-06-07 19:06:32 +04:00
|
|
|
favWindow->label(manage_favorites_label);
|
2007-01-28 22:41:56 +03:00
|
|
|
favWindow->set_modal();
|
|
|
|
favWindow->size_range(181, 150);
|
|
|
|
favWindow->end();
|
|
|
|
} // Fl_Double_Window* favWindow
|
2002-06-07 19:06:32 +04:00
|
|
|
callback_ = 0;
|
2011-06-06 20:11:22 +04:00
|
|
|
data_ = 0;
|
|
|
|
directory_[0] = 0;
|
|
|
|
window->size_range(window->w(), window->h(), Fl::w(), Fl::h());
|
|
|
|
type(t);
|
|
|
|
filter(p);
|
|
|
|
update_favorites();
|
|
|
|
value(d);
|
|
|
|
type(t);
|
|
|
|
int e;
|
|
|
|
prefs_.get("preview", e, 1);
|
|
|
|
preview(e);
|
|
|
|
Fl_Group::current(prev_current);
|
2008-05-01 22:03:45 +04:00
|
|
|
ext_group=(Fl_Widget*)0;
|
2002-06-07 19:06:32 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
Fl_File_Chooser::~Fl_File_Chooser() {
|
|
|
|
Fl::remove_timeout((Fl_Timeout_Handler)previewCB, this);
|
2011-06-06 20:11:22 +04:00
|
|
|
if(ext_group)window->remove(ext_group);
|
|
|
|
delete window;
|
|
|
|
delete favWindow;
|
2001-08-04 16:21:34 +04:00
|
|
|
}
|
|
|
|
|
2002-06-07 19:06:32 +04:00
|
|
|
void Fl_File_Chooser::callback(void (*cb)(Fl_File_Chooser *, void *), void *d ) {
|
2001-08-04 16:21:34 +04:00
|
|
|
callback_ = cb;
|
2011-06-06 20:11:22 +04:00
|
|
|
data_ = d;
|
2001-08-02 01:24:49 +04:00
|
|
|
}
|
|
|
|
|
2001-09-29 18:38:59 +04:00
|
|
|
void Fl_File_Chooser::color(Fl_Color c) {
|
2001-08-02 01:24:49 +04:00
|
|
|
fileList->color(c);
|
|
|
|
}
|
|
|
|
|
2001-09-29 18:38:59 +04:00
|
|
|
Fl_Color Fl_File_Chooser::color() {
|
2001-08-02 01:24:49 +04:00
|
|
|
return (fileList->color());
|
|
|
|
}
|
|
|
|
|
2001-09-29 18:38:59 +04:00
|
|
|
char * Fl_File_Chooser::directory() {
|
2001-08-02 01:24:49 +04:00
|
|
|
return directory_;
|
|
|
|
}
|
|
|
|
|
2001-09-29 18:38:59 +04:00
|
|
|
const char * Fl_File_Chooser::filter() {
|
2001-08-02 01:24:49 +04:00
|
|
|
return (fileList->filter());
|
|
|
|
}
|
|
|
|
|
2002-07-02 01:14:20 +04:00
|
|
|
int Fl_File_Chooser::filter_value() {
|
|
|
|
return showChoice->value();
|
|
|
|
}
|
|
|
|
|
|
|
|
void Fl_File_Chooser::filter_value(int f) {
|
|
|
|
showChoice->value(f);
|
2011-06-06 20:11:22 +04:00
|
|
|
showChoiceCB();
|
2002-07-02 01:14:20 +04:00
|
|
|
}
|
|
|
|
|
2001-09-29 18:38:59 +04:00
|
|
|
void Fl_File_Chooser::hide() {
|
2001-08-02 01:24:49 +04:00
|
|
|
window->hide();
|
|
|
|
}
|
|
|
|
|
2001-09-29 18:38:59 +04:00
|
|
|
void Fl_File_Chooser::iconsize(uchar s) {
|
2001-08-02 01:24:49 +04:00
|
|
|
fileList->iconsize(s);
|
|
|
|
}
|
|
|
|
|
2001-09-29 18:38:59 +04:00
|
|
|
uchar Fl_File_Chooser::iconsize() {
|
2001-08-02 01:24:49 +04:00
|
|
|
return (fileList->iconsize());
|
|
|
|
}
|
|
|
|
|
2001-09-29 18:38:59 +04:00
|
|
|
void Fl_File_Chooser::label(const char *l) {
|
2001-08-02 01:24:49 +04:00
|
|
|
window->label(l);
|
|
|
|
}
|
|
|
|
|
2001-09-29 18:38:59 +04:00
|
|
|
const char * Fl_File_Chooser::label() {
|
2001-08-02 01:24:49 +04:00
|
|
|
return (window->label());
|
|
|
|
}
|
|
|
|
|
2005-03-25 18:20:26 +03:00
|
|
|
void Fl_File_Chooser::ok_label(const char *l) {
|
|
|
|
okButton->label(l);
|
2011-06-06 20:11:22 +04:00
|
|
|
int w=0, h=0;
|
|
|
|
okButton->measure_label(w, h);
|
|
|
|
okButton->resize(cancelButton->x() - 50 - w, cancelButton->y(),
|
|
|
|
w + 40, 25);
|
|
|
|
okButton->parent()->init_sizes();
|
2005-03-25 18:20:26 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
const char * Fl_File_Chooser::ok_label() {
|
|
|
|
return (okButton->label());
|
|
|
|
}
|
|
|
|
|
2001-12-15 18:20:54 +03:00
|
|
|
int Fl_File_Chooser::shown() {
|
|
|
|
return window->shown();
|
|
|
|
}
|
|
|
|
|
2001-09-29 18:38:59 +04:00
|
|
|
void Fl_File_Chooser::textcolor(Fl_Color c) {
|
2001-08-02 01:24:49 +04:00
|
|
|
fileList->textcolor(c);
|
|
|
|
}
|
|
|
|
|
2001-09-29 18:38:59 +04:00
|
|
|
Fl_Color Fl_File_Chooser::textcolor() {
|
2001-08-02 01:24:49 +04:00
|
|
|
return (fileList->textcolor());
|
|
|
|
}
|
|
|
|
|
2008-05-01 22:56:12 +04:00
|
|
|
void Fl_File_Chooser::textfont(Fl_Font f) {
|
2001-08-02 20:17:04 +04:00
|
|
|
fileList->textfont(f);
|
2001-08-02 01:24:49 +04:00
|
|
|
}
|
|
|
|
|
2008-05-01 22:56:12 +04:00
|
|
|
Fl_Font Fl_File_Chooser::textfont() {
|
2001-08-02 20:17:04 +04:00
|
|
|
return (fileList->textfont());
|
2001-08-02 01:24:49 +04:00
|
|
|
}
|
|
|
|
|
2008-08-16 01:11:21 +04:00
|
|
|
void Fl_File_Chooser::textsize(Fl_Fontsize s) {
|
2001-08-02 20:17:04 +04:00
|
|
|
fileList->textsize(s);
|
2001-08-02 01:24:49 +04:00
|
|
|
}
|
|
|
|
|
2008-08-16 01:11:21 +04:00
|
|
|
Fl_Fontsize Fl_File_Chooser::textsize() {
|
2001-08-02 01:24:49 +04:00
|
|
|
return (fileList->textsize());
|
|
|
|
}
|
|
|
|
|
2001-09-29 18:38:59 +04:00
|
|
|
void Fl_File_Chooser::type(int t) {
|
2001-08-02 01:24:49 +04:00
|
|
|
type_ = t;
|
2011-06-06 20:11:22 +04:00
|
|
|
if (t & MULTI)
|
|
|
|
fileList->type(FL_MULTI_BROWSER);
|
|
|
|
else
|
|
|
|
fileList->type(FL_HOLD_BROWSER);
|
|
|
|
if (t & CREATE)
|
|
|
|
newButton->activate();
|
|
|
|
else
|
|
|
|
newButton->deactivate();
|
|
|
|
if (t & DIRECTORY)
|
|
|
|
fileList->filetype(Fl_File_Browser::DIRECTORIES);
|
|
|
|
else
|
|
|
|
fileList->filetype(Fl_File_Browser::FILES);
|
2001-08-02 01:24:49 +04:00
|
|
|
}
|
|
|
|
|
2001-09-29 18:38:59 +04:00
|
|
|
int Fl_File_Chooser::type() {
|
2001-08-02 01:24:49 +04:00
|
|
|
return (type_);
|
|
|
|
}
|
|
|
|
|
2005-08-08 04:50:02 +04:00
|
|
|
void * Fl_File_Chooser::user_data() const {
|
|
|
|
return (data_);
|
|
|
|
}
|
|
|
|
|
|
|
|
void Fl_File_Chooser::user_data(void *d) {
|
|
|
|
data_ = d;
|
|
|
|
}
|
|
|
|
|
2001-09-29 18:38:59 +04:00
|
|
|
int Fl_File_Chooser::visible() {
|
2001-08-02 01:24:49 +04:00
|
|
|
return window->visible();
|
|
|
|
}
|
2005-03-25 18:20:26 +03:00
|
|
|
|
2008-05-01 22:03:45 +04:00
|
|
|
Fl_Widget* Fl_File_Chooser::add_extra(Fl_Widget* gr) {
|
|
|
|
Fl_Widget* ret=ext_group;
|
|
|
|
if (gr==ext_group) {
|
|
|
|
return ret;
|
2011-06-07 15:41:36 +04:00
|
|
|
}
|
|
|
|
if (ext_group) {
|
|
|
|
int sh=ext_group->h()+4;
|
|
|
|
Fl_Widget* svres=window->resizable();
|
|
|
|
window->resizable(NULL);
|
|
|
|
window->size(window->w(),window->h()-sh);
|
|
|
|
window->remove(ext_group);
|
|
|
|
ext_group=NULL;
|
|
|
|
window->resizable(svres);
|
|
|
|
}
|
|
|
|
if (gr) {
|
|
|
|
int nh=window->h()+gr->h()+4;
|
|
|
|
Fl_Widget* svres=window->resizable();
|
|
|
|
window->resizable(NULL);
|
|
|
|
window->size(window->w(),nh);
|
|
|
|
gr->position(2,okButton->y()+okButton->h()+2);
|
|
|
|
window->add(gr);
|
|
|
|
ext_group=gr;
|
|
|
|
window->resizable(svres);
|
|
|
|
}
|
|
|
|
return ret;
|
2008-05-01 22:03:45 +04:00
|
|
|
}
|
|
|
|
|
2005-03-25 18:20:26 +03:00
|
|
|
//
|
|
|
|
// End of "$Id$".
|
|
|
|
//
|