mirror of
https://github.com/fltk/fltk.git
synced 2026-05-28 11:25:22 +08:00
Fl_File_Chooser: removed the "Show hidden files" button for WIN32 where it's not relevant.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8286 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
@@ -123,9 +123,11 @@ private:
|
|||||||
Fl_Return_Button *favOkButton;
|
Fl_Return_Button *favOkButton;
|
||||||
void cb_favOkButton_i(Fl_Return_Button*, void*);
|
void cb_favOkButton_i(Fl_Return_Button*, void*);
|
||||||
static void cb_favOkButton(Fl_Return_Button*, void*);
|
static void cb_favOkButton(Fl_Return_Button*, void*);
|
||||||
|
#ifndef WIN32
|
||||||
Fl_Check_Button *show_hidden;
|
Fl_Check_Button *show_hidden;
|
||||||
static void show_hidden_cb(Fl_Check_Button*, void*);
|
static void show_hidden_cb(Fl_Check_Button*, void*);
|
||||||
void remove_hidden_files();
|
void remove_hidden_files();
|
||||||
|
#endif
|
||||||
public:
|
public:
|
||||||
~Fl_File_Chooser();
|
~Fl_File_Chooser();
|
||||||
void callback(void (*cb)(Fl_File_Chooser *, void *), void *d = 0);
|
void callback(void (*cb)(Fl_File_Chooser *, void *), void *d = 0);
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ void Fl_File_Chooser::cb_previewButton_i(Fl_Check_Button*, void*) {
|
|||||||
void Fl_File_Chooser::cb_previewButton(Fl_Check_Button* o, void* v) {
|
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);
|
((Fl_File_Chooser*)(o->parent()->parent()->parent()->user_data()))->cb_previewButton_i(o,v);
|
||||||
}
|
}
|
||||||
|
#ifndef WIN32
|
||||||
void Fl_File_Chooser::remove_hidden_files()
|
void Fl_File_Chooser::remove_hidden_files()
|
||||||
{
|
{
|
||||||
int count = fileList->size();
|
int count = fileList->size();
|
||||||
@@ -107,7 +107,7 @@ void Fl_File_Chooser::show_hidden_cb(Fl_Check_Button* o, void* data) {
|
|||||||
mychooser->browser()->redraw();
|
mychooser->browser()->redraw();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
void Fl_File_Chooser::cb_fileName_i(Fl_File_Input*, void*) {
|
void Fl_File_Chooser::cb_fileName_i(Fl_File_Input*, void*) {
|
||||||
fileNameCB();
|
fileNameCB();
|
||||||
}
|
}
|
||||||
@@ -228,7 +228,7 @@ Fl_File_Chooser::Fl_File_Chooser(const char *d, const char *p, int t, const char
|
|||||||
previewButton->callback((Fl_Callback*)cb_previewButton);
|
previewButton->callback((Fl_Callback*)cb_previewButton);
|
||||||
previewButton->label(preview_label);
|
previewButton->label(preview_label);
|
||||||
} // Fl_Check_Button* previewButton
|
} // Fl_Check_Button* previewButton
|
||||||
|
#ifndef WIN32
|
||||||
{ show_hidden = new Fl_Check_Button(
|
{ show_hidden = new Fl_Check_Button(
|
||||||
previewButton->x() + previewButton->w() + 30, 275, 140, 20, "Show hidden files");
|
previewButton->x() + previewButton->w() + 30, 275, 140, 20, "Show hidden files");
|
||||||
show_hidden->down_box(FL_DOWN_BOX);
|
show_hidden->down_box(FL_DOWN_BOX);
|
||||||
@@ -236,7 +236,7 @@ Fl_File_Chooser::Fl_File_Chooser(const char *d, const char *p, int t, const char
|
|||||||
show_hidden->callback((Fl_Callback*)show_hidden_cb, this);
|
show_hidden->callback((Fl_Callback*)show_hidden_cb, this);
|
||||||
show_hidden->label(hidden_label);
|
show_hidden->label(hidden_label);
|
||||||
} // Fl_Check_Button* show_hidden
|
} // Fl_Check_Button* show_hidden
|
||||||
|
#endif
|
||||||
{ Fl_Box* o = new Fl_Box(115, 275, 365, 20);
|
{ Fl_Box* o = new Fl_Box(115, 275, 365, 20);
|
||||||
Fl_Group::current()->resizable(o);
|
Fl_Group::current()->resizable(o);
|
||||||
} // Fl_Box* o
|
} // Fl_Box* o
|
||||||
|
|||||||
@@ -1150,8 +1150,9 @@ Fl_File_Chooser::rescan()
|
|||||||
|
|
||||||
// Build the file list...
|
// Build the file list...
|
||||||
fileList->load(directory_, sort);
|
fileList->load(directory_, sort);
|
||||||
|
#ifndef WIN32
|
||||||
if (!show_hidden->value()) remove_hidden_files();
|
if (!show_hidden->value()) remove_hidden_files();
|
||||||
|
#endif
|
||||||
// Update the preview box...
|
// Update the preview box...
|
||||||
update_preview();
|
update_preview();
|
||||||
}
|
}
|
||||||
@@ -1176,8 +1177,9 @@ void Fl_File_Chooser::rescan_keep_filename()
|
|||||||
|
|
||||||
// Build the file list...
|
// Build the file list...
|
||||||
fileList->load(directory_, sort);
|
fileList->load(directory_, sort);
|
||||||
|
#ifndef WIN32
|
||||||
if (!show_hidden->value()) remove_hidden_files();
|
if (!show_hidden->value()) remove_hidden_files();
|
||||||
|
#endif
|
||||||
// Update the preview box...
|
// Update the preview box...
|
||||||
update_preview();
|
update_preview();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user