summaryrefslogtreecommitdiff
path: root/src/Fl_File_Chooser2.cxx
diff options
context:
space:
mode:
authorFabien Costantini <fabien@onepost.net>2012-04-05 05:12:30 +0000
committerFabien Costantini <fabien@onepost.net>2012-04-05 05:12:30 +0000
commit8809c5d65dd20895dcae90e9d2af05fd271f2e9e (patch)
treed53cbf6d921ae68bda31b6c5d522dc8c87ee9bd1 /src/Fl_File_Chooser2.cxx
parent37ea8ba9e635e9655417714bd49ab7bb2b36beb5 (diff)
Fixed build error in msvs because Fl ref to FULLSCREEN enum was not accessible in Fl_Widget. new inline is_fullscreen() getter has been implemented to avoid a build error with (at least) msvc compilers. Fixed a ton of warnings / problems when bilding on windows 64 bits target with ms toolchain. cleaned up about 200 warnings raised when building win74 targets.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9325 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_File_Chooser2.cxx')
-rw-r--r--src/Fl_File_Chooser2.cxx23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/Fl_File_Chooser2.cxx b/src/Fl_File_Chooser2.cxx
index 60ea840f6..7abc48bc0 100644
--- a/src/Fl_File_Chooser2.cxx
+++ b/src/Fl_File_Chooser2.cxx
@@ -896,7 +896,7 @@ Fl_File_Chooser::fileNameCB()
// Other key pressed - do filename completion as possible...
num_files = fileList->size();
- min_match = strlen(filename);
+ min_match = (int) strlen(filename);
max_match = min_match + 1;
first_line = 0;
@@ -912,7 +912,7 @@ Fl_File_Chooser::fileNameCB()
if (!first_line) {
// First match; copy stuff over...
strlcpy(matchname, file, sizeof(matchname));
- max_match = strlen(matchname);
+ max_match = (int) strlen(matchname);
// Strip trailing /, if any...
if (matchname[max_match - 1] == '/') {
@@ -950,14 +950,17 @@ Fl_File_Chooser::fileNameCB()
fileList->redraw();
} else if (max_match > min_match && first_line) {
// Add the matching portion...
- fileName->replace(filename - pathname, filename - pathname + min_match,
- matchname);
+ fileName->replace(
+ (int) (filename - pathname),
+ (int) (filename - pathname + min_match),
+ matchname);
// Highlight it with the cursor at the end of the selection so
// s/he can press the right arrow to accept the selection
// (Tab and End also do this for both cases.)
- fileName->position(filename - pathname + max_match,
- filename - pathname + min_match);
+ fileName->position(
+ (int) (filename - pathname + max_match),
+ (int) (filename - pathname + min_match));
} else if (max_match == 0) {
fileList->deselect(0);
fileList->redraw();
@@ -1346,7 +1349,7 @@ Fl_File_Chooser::update_preview()
if (fp != NULL) {
// Try reading the first 1k of data for a label...
- bytes = fread(preview_text_, 1, sizeof(preview_text_) - 1, fp);
+ bytes = (int) fread(preview_text_, 1, sizeof(preview_text_) - 1, fp);
preview_text_[bytes] = '\0';
fclose(fp);
} else {
@@ -1544,7 +1547,7 @@ Fl_File_Chooser::value(const char *filename)
if (slash > pathname) slash[-1] = '/';
fileName->value(pathname);
- fileName->position(0, strlen(pathname));
+ fileName->position(0, (int) strlen(pathname));
okButton->activate();
// Then find the file in the file list and select it...
@@ -1610,8 +1613,8 @@ compare_dirnames(const char *a, const char *b) {
int alen, blen;
// Get length of each string...
- alen = strlen(a) - 1;
- blen = strlen(b) - 1;
+ alen = (int) (strlen(a) - 1);
+ blen = (int) (strlen(b) - 1);
if (alen < 0 || blen < 0) return alen - blen;