//===================================================// // // // SELECTION // // // //===================================================// void unselectAll() { selected_count[active_panel] = 0; if (active_panel) { selected0.drop(); } else { selected1.drop(); } } dword getSelectedCount() { return selected_count[active_panel]; } void setElementSelectedFlag(dword n, int state) { if (n==0) && (strncmp(items.get(n)*304+buf+72,"..",2)==0) return; if (active_panel) { selected0.set(n, state); } else { selected1.set(n, state); } if (state==true) selected_count[active_panel]++; if (state==false) && (selected_count[active_panel]>0) selected_count[active_panel]--; } int getElementSelectedFlag(dword n) { if (active_panel) { return selected0.get(n); } else { return selected1.get(n); } } dword GetFilesCount(dword _in_path) { BDVK file_info_count; DIR_SIZE paste_dir_size; GetFileInfo(_in_path, #file_info_count); if ( file_info_count.isfolder ) { return paste_dir_size.get(_in_path); } else { return 1; } } //===================================================// // // // COPY AND PASTE // // // //===================================================// byte copy_to[4096]; byte copy_from[4096]; bool cut_active = false; enum {COPY, CUT, DELETE}; void CopyFilesListToClipboard(bool _cut_active) { byte copy_t[4096]; dword buff_data; dword path_len = 0; dword size_buf = 0; dword copy_buf_offset = 0; dword i; if (files.count<=0) return; //no files if (_cut_active!=DELETE) cut_active = _cut_active; //if no element selected by "Insert" key, then we copy current element if (!getSelectedCount()) { setElementSelectedFlag(files.cur_y, true); } if (!getSelectedCount()) return; size_buf = 10; for (i=0; i=files.first) && (i