void BitData::SelectAllFile(bool download) { DownloadFiles::iterator it = download_files_.begin(); DownloadFiles::iterator end = download_files_.end(); for (; it != end; ++it) DoSelectFile(it, download); }
void BitData::SelectFile(std::size_t file_index, bool download) { if (file_index < download_files_.size()) { DownloadFiles::iterator it = download_files_.begin(); std::advance(it, file_index); DoSelectFile(it, download); } }
static void TXT_FileSelectMousePress(TXT_UNCAST_ARG(fileselect), int x, int y, int b) { TXT_CAST_ARG(txt_fileselect_t, fileselect); if (!fileselect->inputbox->editing && !TXT_GetModifierState(TXT_MOD_ALT) && b == TXT_MOUSE_LEFT) { if (DoSelectFile(fileselect)) { return; } } return TXT_WidgetMousePress(fileselect->inputbox, x, y, b); }
static int TXT_FileSelectKeyPress(TXT_UNCAST_ARG(fileselect), int key) { TXT_CAST_ARG(txt_fileselect_t, fileselect); // When the enter key is pressed, pop up a file selection dialog, // if file selectors work. Allow holding down 'alt' to override // use of the native file selector, so the user can just type a path. if (!fileselect->inputbox->editing && !TXT_GetModifierState(TXT_MOD_ALT) && key == KEY_ENTER) { if (DoSelectFile(fileselect)) { return 1; } } return TXT_WidgetKeyPress(fileselect->inputbox, key); }