/* flshow.cpp Файловая панель - вывод на экран */ /* Copyright (c) 1996 Eugene Roshal Copyright (c) 2000 Far Group All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. The name of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include #include "headers.hpp" #include "filelist.hpp" #include "colors.hpp" #include "lang.hpp" #include "filefilter.hpp" #include "cmdline.hpp" #include "filepanels.hpp" #include "ctrlobj.hpp" #include "syslog.hpp" #include "interf.hpp" #include "config.hpp" #include "datetime.hpp" #include "pathmix.hpp" #include "strmix.hpp" #include "panelmix.hpp" extern PanelViewSettings ViewSettingsArray[]; extern int ColumnTypeWidth[]; static wchar_t OutCharacter[8]={0,0,0,0,0,0,0,0}; static FarLangMsg __FormatEndSelectedPhrase(int Count) { if (Count == 1) return Msg::ListFileSize; char StrItems[32]; _itoa(Count, StrItems, 10); int LenItems = (int)strlen(StrItems); if (StrItems[LenItems-1] == '1' && Count != 11) return Msg::ListFilesSize1; return Msg::ListFilesSize2; } void FileList::DisplayObject() { Height=Y2-Y1-4+!Opt.ShowColumnTitles+(Opt.ShowPanelStatus ? 0:2); _OT(SysLog(L"[%p] FileList::DisplayObject()",this)); if (UpdateRequired) { UpdateRequired=FALSE; Update(UpdateRequiredMode); } ProcessPluginCommand(); ShowFileList(FALSE); } void FileList::ShowFileList(int Fast) { if (Locked()) { CorrectPosition(); return; } FARString strTitle; FARString strInfoCurDir; int Cells; OpenPluginInfo Info; if (PanelMode==PLUGIN_PANEL) { if (ProcessPluginEvent(FE_REDRAW,nullptr)) return; CtrlObject->Plugins.GetOpenPluginInfo(hPlugin,&Info); strInfoCurDir=Info.CurDir; } int CurFullScreen=IsFullScreen(); PrepareViewSettings(ViewMode,&Info); CorrectPosition(); if (CurFullScreen!=IsFullScreen()) { CtrlObject->Cp()->SetScreenPosition(); CtrlObject->Cp()->GetAnotherPanel(this)->Update(UPDATE_KEEP_SELECTION|UPDATE_SECONDARY); } SetScreen(X1+1,Y1+1,X2-1,Y2-1,L' ',COL_PANELTEXT); Box(X1,Y1,X2,Y2,COL_PANELBOX,DOUBLE_BOX); if (Opt.ShowColumnTitles) { // SetScreen(X1+1,Y1+1,X2-1,Y1+1,' ',COL_PANELTEXT); SetColor(COL_PANELTEXT); //??? //GotoXY(X1+1,Y1+1); //FS<=ViewSettings.ColumnCount-1) break; if (ViewSettings.ColumnWidth[I+1]<0) continue; SetColor(COL_PANELBOX); ColumnPos+=ViewSettings.ColumnWidth[I]; GotoXY(ColumnPos,Y1); BoxText(BoxSymbols[BS_T_H2V1]); if (Opt.ShowColumnTitles) { GotoXY(ColumnPos,Y1+1); BoxText(BoxSymbols[BS_V1]); } if (!Opt.ShowPanelStatus) { GotoXY(ColumnPos,Y2); BoxText(BoxSymbols[BS_B_H2V1]); } ColumnPos++; } int NextX1=X1+1; if (Opt.ShowSortMode) { static int SortModes[]={UNSORTED,BY_NAME,BY_EXT,BY_MTIME,BY_CTIME, BY_ATIME,BY_CHTIME,BY_SIZE,BY_DIZ,BY_OWNER, BY_PHYSICALSIZE,BY_NUMLINKS, BY_FULLNAME,BY_CUSTOMDATA }; static FarLangMsg SortStrings[]={Msg::MenuUnsorted,Msg::MenuSortByName, Msg::MenuSortByExt,Msg::MenuSortByWrite,Msg::MenuSortByCreation, Msg::MenuSortByAccess,Msg::MenuSortByChange,Msg::MenuSortBySize,Msg::MenuSortByDiz,Msg::MenuSortByOwner, Msg::MenuSortByPhysicalSize,Msg::MenuSortByNumLinks, Msg::MenuSortByFullName,Msg::MenuSortByCustomData }; for (size_t I=0; IIsEnabledOnPanel()) { OutCharacter[0]=L'*'; Text(OutCharacter); NextX1++; } } break; } } } if (!Opt.ShowHidden) { if (Opt.ShowColumnTitles) GotoXY(NextX1,Y1+1); else GotoXY(NextX1,Y1); SetColor(COL_PANELCOLUMNTITLE); OutCharacter[0]=L'h'; Text(OutCharacter); NextX1++; } /* <режимы сортировки> */ if (/*GetNumericSort() || GetCaseSensitiveSort() || GetSortGroups() || */GetSelectedFirstMode()) { if (Opt.ShowColumnTitles) GotoXY(NextX1,Y1+1); else GotoXY(NextX1,Y1); SetColor(COL_PANELCOLUMNTITLE); wchar_t *PtrOutCharacter=OutCharacter; *PtrOutCharacter=0; //if (GetSelectedFirstMode()) *PtrOutCharacter++=L'^'; /* if(GetNumericSort()) *PtrOutCharacter++=L'#'; if(GetSortGroups()) *PtrOutCharacter++=L'@'; */ /* if(GetCaseSensitiveSort()) { } */ *PtrOutCharacter=0; Text(OutCharacter); PtrOutCharacter[1]=0; } /* */ if (!Fast && GetFocus()) { if (PanelMode==PLUGIN_PANEL) CtrlObject->CmdLine->SetCurDir(Info.CurDir); else CtrlObject->CmdLine->SetCurDir(strCurDir); CtrlObject->CmdLine->Show(); } int TitleX2=Opt.Clock && !Opt.ShowMenuBar ? Min(ScrX-4,X2):X2; int TruncSize=TitleX2-X1-3; if (!Opt.ShowColumnTitles && Opt.ShowSortMode && Filter && Filter->IsEnabledOnPanel()) TruncSize-=2; GetTitle(strTitle,TruncSize,2);//,(PanelMode==PLUGIN_PANEL?0:2)); Cells=(int)strTitle.CellsCount(); int ClockCorrection=FALSE; if ((Opt.Clock && !Opt.ShowMenuBar) && TitleX2==ScrX-4) { ClockCorrection=TRUE; TitleX2+=4; } int TitleX=X1+(TitleX2-X1+1-Cells)/2; if (ClockCorrection) { int Overlap=TitleX+Cells-TitleX2+5; if (Overlap > 0) TitleX-=Overlap; } if (TitleX <= X1) TitleX = X1+1; SetColor(Focus ? COL_PANELSELECTEDTITLE:COL_PANELTITLE); GotoXY(TitleX,Y1); Text(strTitle); if (!FileCount) { SetScreen(X1+1,Y2-1,X2-1,Y2-1,L' ',COL_PANELTEXT); SetColor(COL_PANELTEXT); //??? //GotoXY(X1+1,Y2-1); //FS<0 && (Info.Flags & OPIF_REALNAMES)) { if (!strInfoCurDir.IsEmpty()) { strCurDir = strInfoCurDir; } else { if (!TestParentFolderName(ListData[CurFile]->strName)) { strCurDir=ListData[CurFile]->strName; size_t pos; if (FindLastSlash(pos,strCurDir)) { if (pos) { if (strCurDir.At(pos-1)!=L':') strCurDir.Truncate(pos); else strCurDir.Truncate(pos+1); } } } else { strCurDir = strOriginalCurDir; } } if (GetFocus()) { CtrlObject->CmdLine->SetCurDir(strCurDir); CtrlObject->CmdLine->Show(); } } if ((Opt.ShowPanelTotals || Opt.ShowPanelFree) && (Opt.ShowPanelStatus || !SelFileCount)) { ShowTotalSize(Info); } ShowList(FALSE,0); ShowSelectedSize(); if (Opt.ShowPanelScrollbar) { SetColor(COL_PANELSCROLLBAR); ScrollBarEx(X2,Y1+1+Opt.ShowColumnTitles,Height,Round(CurTopFile,Columns),Round(FileCount,Columns)); } ShowScreensCount(); if (!ProcessingPluginCommand && LastCurFile!=CurFile) { LastCurFile=CurFile; UpdateViewPanel(); } if (PanelMode==PLUGIN_PANEL) CtrlObject->Cp()->RedrawKeyBar(); } int FileList::GetShowColor(int Position, int ColorType) { DWORD ColorAttr=COL_PANELTEXT; const DWORD FarColor[] = {COL_PANELTEXT,COL_PANELSELECTEDTEXT,COL_PANELCURSOR,COL_PANELSELECTEDCURSOR}; if (ListData && Position < FileCount) { int Pos = HIGHLIGHTCOLOR_NORMAL; if (CurFile==Position && Focus && FileCount > 0) { Pos=ListData[Position]->Selected?HIGHLIGHTCOLOR_SELECTEDUNDERCURSOR:HIGHLIGHTCOLOR_UNDERCURSOR; } else if (ListData[Position]->Selected) Pos = HIGHLIGHTCOLOR_SELECTED; ColorAttr=ListData[Position]->Colors.Color[ColorType][Pos]; if (!ColorAttr || !Opt.Highlight) ColorAttr=FarColor[Pos]; } return ColorAttr; } void FileList::SetShowColor(int Position, int ColorType) { SetColor(GetShowColor(Position,ColorType)); } void FileList::ShowSelectedSize() { int Length; FARString strSelStr, strFormStr; if (Opt.ShowPanelStatus) { SetColor(COL_PANELBOX); DrawSeparator(Y2-2); for (int I=0,ColumnPos=X1+1; I X2-X1-1) { InsertCommas(FreeDiskSize>>20,strFreeSize); InsertCommas(TotalFileSize>>20,strFormSize); strTotalStr.Format(L" %ls %ls (%d) %ls %ls %ls ", strFormSize.CPtr(), Msg::ListMb.CPtr(), TotalFileCount, DHLine, strFreeSize.CPtr(), Msg::ListMb.CPtr()); } } } else strTotalStr.Format(Msg::ListFreeSize, !strFreeSize.IsEmpty() ? strFreeSize.CPtr():L"???"); SetColor(COL_PANELTOTALINFO); /* $ 01.08.2001 VVM + Обрезаем строчку справа, а не слева */ TruncStrFromEnd(strTotalStr, X2-X1-1); Length=(int)strTotalStr.GetLength(); GotoXY(X1+(X2-X1+1-Length)/2,Y2); const wchar_t *FirstBox=wcschr(strTotalStr,BoxSymbols[BS_H2]); int BoxPos=FirstBox ? (int)(FirstBox-strTotalStr.CPtr()):-1; int BoxLength=0; if (BoxPos!=-1) for (int I=0; strTotalStr.At(BoxPos+I)==BoxSymbols[BS_H2]; I++) BoxLength++; if (BoxPos==-1 || !BoxLength) Text(strTotalStr); else { FS << fmt::Cells() << fmt::Truncate(BoxPos) << strTotalStr; SetColor(COL_PANELBOX); FS << fmt::Cells() << fmt::Truncate(BoxLength) << strTotalStr.CPtr() + BoxPos; SetColor(COL_PANELTOTALINFO); Text(strTotalStr.CPtr()+BoxPos+BoxLength); } } int FileList::ConvertName(const wchar_t *SrcName,FARString &strDest,int MaxLength,int RightAlign,int ShowStatus,DWORD FileAttr) { if (ShowStatus && PanelMode==NORMAL_PANEL && (FileAttr&FILE_ATTRIBUTE_REPARSE_POINT) != 0 && !strCurDir.IsEmpty() && strCurDir[0] == GOOD_SLASH) { FARString strTemp; if (MixToFullPath(SrcName, strTemp, strCurDir) ) { char LinkDest[MAX_PATH + 1] = {0}; ssize_t r = sdc_readlink(strTemp.GetMB().c_str(), LinkDest, ARRAYSIZE(LinkDest) - 1); if (r > 0 && r < (ssize_t)ARRAYSIZE(LinkDest) ) { LinkDest[r] = 0; strTemp = SrcName; strTemp+= L" ->"; strTemp+= LinkDest; return ConvertName(strTemp, strDest, MaxLength, RightAlign, ShowStatus, FileAttr & (~(DWORD)FILE_ATTRIBUTE_REPARSE_POINT)); } else { fprintf(stderr, "sdc_readlink errno %u\n", errno); } } } int SrcLength = StrLength(SrcName); int SrcVisualLength = StrCellsCount(SrcName, SrcLength); if (RightAlign && SrcVisualLength > MaxLength) { size_t SkipCells = SrcVisualLength - MaxLength; size_t SkipOfs = StrSizeOfCells(SrcName, SrcLength, SkipCells, true); strDest.Copy(SrcName + SkipOfs, SrcLength - SkipOfs); return TRUE; } const wchar_t *DotPtr; if (!ShowStatus && ((!(FileAttr&FILE_ATTRIBUTE_DIRECTORY) && ViewSettings.AlignExtensions) || ((FileAttr&FILE_ATTRIBUTE_DIRECTORY) && ViewSettings.FolderAlignExtensions)) && SrcVisualLength<=MaxLength && (DotPtr=wcsrchr(SrcName,L'.')) && DotPtr!=SrcName && (SrcName[0]!=L'.' || SrcName[2]) && !wcschr(DotPtr+1,L' ')) { int DotLength=StrLength(DotPtr+1); int NameLength=DotLength?(int)(DotPtr-SrcName):SrcLength; int DotPos=MaxLength-Max(DotLength,3); if (DotPos<=NameLength) DotPos=NameLength+1; strDest.Copy(SrcName, NameLength); strDest.Append(L'.'); strDest.Append(DotPtr+1,DotLength); } else { size_t CellsCount = MaxLength; size_t CopyLen = StrSizeOfCells(SrcName, SrcLength, CellsCount, false); strDest.Copy(SrcName, CopyLen); } const size_t CopiedCellsCount = strDest.CellsCount(); if (CopiedCellsCount < size_t(MaxLength)) { strDest.Append(L' ', size_t(MaxLength - CopiedCellsCount)); } return (SrcVisualLength > MaxLength); } void FileList::PrepareViewSettings(int ViewMode,OpenPluginInfo *PlugInfo) { OpenPluginInfo Info={0}; if (PanelMode==PLUGIN_PANEL) { if (!PlugInfo) CtrlObject->Plugins.GetOpenPluginInfo(hPlugin,&Info); else Info=*PlugInfo; } ViewSettings=ViewSettingsArray[ViewMode]; if (PanelMode==PLUGIN_PANEL) { if (Info.PanelModesArray && ViewModeStatusColumnType,PanelView->StatusColumnWidth,PanelView->StatusColumnWidthType, PanelView->StatusColumnCount,PanelView->FullScreen); return(PrepareColumnWidths(PanelView->ColumnType,PanelView->ColumnWidth,PanelView->ColumnWidthType, PanelView->ColumnCount,PanelView->FullScreen)); } int FileList::PrepareColumnWidths(unsigned int *ColumnTypes,int *ColumnWidths, int *ColumnWidthsTypes,int &ColumnCount,int FullScreen) { int TotalWidth,TotalPercentWidth,TotalPercentCount,ZeroLengthCount,EmptyColumns,I; ZeroLengthCount=EmptyColumns=0; TotalWidth=ColumnCount-1; TotalPercentCount=TotalPercentWidth=0; for (I=0; I0) { int ExtraPercentWidth=(TotalPercentWidth>100 || !ZeroLengthCount)?ExtraWidth:ExtraWidth*TotalPercentWidth/100; int TempWidth=0; for (I=0; I0; I++) if (ColumnWidthsTypes[I]==PERCENT_WIDTH) { int PercentWidth = (TotalPercentCount>1)?(ExtraPercentWidth*ColumnWidths[I]/TotalPercentWidth):(ExtraPercentWidth-TempWidth); if (PercentWidth<1) PercentWidth=1; TempWidth+=PercentWidth; ColumnWidths[I]=PercentWidth; ColumnWidthsTypes[I] = COUNT_WIDTH; TotalPercentCount--; } ExtraWidth-=TempWidth; } for (I=0; I0; I++) if (!ColumnWidths[I]) { int AutoWidth=ExtraWidth/ZeroLengthCount; if (AutoWidth<1) AutoWidth=1; ColumnWidths[I]=AutoWidth; ExtraWidth-=AutoWidth; ZeroLengthCount--; } while (1) { int LastColumn=ColumnCount-1; TotalWidth=LastColumn-EmptyColumns; for (I=0; I0) TotalWidth+=ColumnWidths[I]; if (TotalWidth<=PanelTextWidth) break; if (ColumnCount<=1) { ColumnWidths[0]=PanelTextWidth; break; } else if (PanelTextWidth>=TotalWidth-ColumnWidths[LastColumn]) { ColumnWidths[LastColumn]=PanelTextWidth-(TotalWidth-ColumnWidths[LastColumn]); break; } else ColumnCount--; } ColumnsInGlobal = 1; int GlobalColumns=0; bool UnEqual; int Remainder; for (int i = 0; i < ViewSettings.ColumnCount; i++) { UnEqual = false; Remainder = ViewSettings.ColumnCount%ColumnsInGlobal; GlobalColumns = ViewSettings.ColumnCount/ColumnsInGlobal; if (!Remainder) { for (int k = 0; k < GlobalColumns-1; k++) { for (int j = 0; j < ColumnsInGlobal; j++) { if ((ViewSettings.ColumnType[k*ColumnsInGlobal+j] & 0xFF) != (ViewSettings.ColumnType[(k+1)*ColumnsInGlobal+j] & 0xFF)) UnEqual = true; } } if (!UnEqual) break; } ColumnsInGlobal++; } return(GlobalColumns); } extern void GetColor(int PaletteIndex); static int MakeCurLeftPos(int ColumnWidth, const wchar_t *Str, int LeftPos, int &MaxLeftPos) { int Cells = Str ? StrZCellsCount(Str) : 0; if (Cells < ColumnWidth || !Cells) return 0; if (LeftPos > Cells - ColumnWidth) LeftPos = Cells - ColumnWidth; size_t ng = LeftPos; int out = StrSizeOfCells(Str, wcslen(Str), ng, false); if (MaxLeftPos < (int)ng) MaxLeftPos = (int)ng; return out; } void FileList::ShowList(int ShowStatus,int StartColumn) { int StatusShown=FALSE; int MaxLeftPos=0,MinLeftPos=FALSE; int ColumnCount=ShowStatus ? ViewSettings.StatusColumnCount:ViewSettings.ColumnCount; for (int I=Y1+1+Opt.ShowColumnTitles,J=CurTopFile; I=CUSTOM_COLUMN0 && ColumnType<=CUSTOM_COLUMN_LAST) { int ColumnNumber=ColumnType-CUSTOM_COLUMN0; const wchar_t *ColumnData=nullptr; if (ColumnNumberCustomColumnNumber) ColumnData=ListData[ListPos]->CustomColumnData[ColumnNumber]; if (!ColumnData) ColumnData=ListData[ListPos]->strCustomData;//L""; int CurLeftPos=0; if (!ShowStatus && LeftPos>0) { CurLeftPos = MakeCurLeftPos(ColumnWidth, ColumnData, LeftPos, MaxLeftPos); } FS << fmt::Cells() << fmt::LeftAlign() << fmt::Size(ColumnWidth) << ColumnData + CurLeftPos; } else { switch (ColumnType) { case NAME_COLUMN: { int Width=ColumnWidth; int ViewFlags=ColumnTypes[K]; if ((ViewFlags & COLUMN_MARK) && Width>2) { Text(ListData[ListPos]->Selected?L"\x221A ":L" "); Width-=2; } if (ListData[ListPos]->Colors.MarkChar && Opt.Highlight && Width>1) { Width--; OutCharacter[0]=(wchar_t)(ListData[ListPos]->Colors.MarkChar & 0xffff); int OldColor=GetColor(); if (!ShowStatus) SetShowColor(ListPos,HIGHLIGHTCOLORTYPE_MARKCHAR); Text(OutCharacter); SetColor(OldColor); } const wchar_t *NamePtr = ListData[ListPos]->strName; const wchar_t *NameCopy = NamePtr; if (ViewFlags & COLUMN_NAMEONLY) { //BUGBUG!!! // !!! НЕ УВЕРЕН, но то, что отображается пустое // пространство вместо названия - бага NamePtr=PointToFolderNameIfFolder(NamePtr); } int CurLeftPos=0; int RightAlign=(ViewFlags & COLUMN_RIGHTALIGN); int LeftBracket=FALSE,RightBracket=FALSE; if (!ShowStatus && LeftPos) { if (LeftPos > 0 && !RightAlign) { CurLeftPos = MakeCurLeftPos(Width, NamePtr, LeftPos, MaxLeftPos); NamePtr += CurLeftPos; } else if (RightAlign) { int Cells = (int)StrZCellsCount(NamePtr); if (Cells > Width) { int CurRightPos = LeftPos; if (Cells + CurRightPos < Width) CurRightPos = Width - Cells; else RightBracket = TRUE; size_t ng = Cells + CurRightPos - Width; NamePtr += StrSizeOfCells(NamePtr, wcslen(NamePtr), ng, false); RightAlign = FALSE; if (MinLeftPos > CurRightPos) MinLeftPos = CurRightPos; } } } FARString strName; int TooLong=ConvertName(NamePtr, strName, Width, RightAlign,ShowStatus,ListData[ListPos]->FileAttr); if (CurLeftPos) LeftBracket=TRUE; if (TooLong) { if (RightAlign) LeftBracket=TRUE; if (!RightAlign && StrZCellsCount(NamePtr) > size_t(Width)) RightBracket=TRUE; } if (!ShowStatus) { if (ViewSettings.FileUpperToLowerCase) if (!(ListData[ListPos]->FileAttr & FILE_ATTRIBUTE_DIRECTORY) && !IsCaseMixed(NameCopy)) strName.Lower(); if ((ViewSettings.FolderUpperCase) && (ListData[ListPos]->FileAttr & FILE_ATTRIBUTE_DIRECTORY)) strName.Upper(); if ((ViewSettings.FileLowerCase) && !(ListData[ListPos]->FileAttr & FILE_ATTRIBUTE_DIRECTORY)) strName.Lower(); } Text(strName); int NameX=WhereX(); if (!ShowStatus) { if (LeftBracket) { GotoXY(CurX-1,CurY); if (Level == 1) SetColor(COL_PANELBOX); Text(openBracket); SetShowColor(J); } if (RightBracket) { if (Level == ColumnsInGlobal) SetColor(COL_PANELBOX); GotoXY(NameX,CurY); Text(closeBracket); ShowDivider=FALSE; if (Level == ColumnsInGlobal) SetColor(COL_PANELTEXT); else SetShowColor(J); } } } break; case SIZE_COLUMN: case PHYSICAL_COLUMN: { Text(FormatStr_Size( ListData[ListPos]->FileSize, ListData[ListPos]->PhysicalSize, ListData[ListPos]->strName, ListData[ListPos]->FileAttr, ListData[ListPos]->ShowFolderSize, ColumnType, ColumnTypes[K], ColumnWidth).CPtr()); break; } case DATE_COLUMN: case TIME_COLUMN: case WDATE_COLUMN: case CDATE_COLUMN: case ADATE_COLUMN: case CHDATE_COLUMN: { FILETIME *FileTime; switch (ColumnType) { case CDATE_COLUMN: FileTime=&ListData[ListPos]->CreationTime; break; case ADATE_COLUMN: FileTime=&ListData[ListPos]->AccessTime; break; case CHDATE_COLUMN: FileTime=&ListData[ListPos]->ChangeTime; break; case DATE_COLUMN: case TIME_COLUMN: case WDATE_COLUMN: default: FileTime=&ListData[ListPos]->WriteTime; break; } FS << FormatStr_DateTime(FileTime,ColumnType,ColumnTypes[K],ColumnWidth); break; } case ATTR_COLUMN: { FS << FormatStr_Attribute(ListData[ListPos]->FileAttr,ListData[ListPos]->FileMode,ColumnWidth); break; } case DIZ_COLUMN: { int CurLeftPos=0; if (!ShowStatus && LeftPos>0) { CurLeftPos = MakeCurLeftPos(ColumnWidth, ListData[ListPos]->DizText, LeftPos, MaxLeftPos); } FARString strDizText=ListData[ListPos]->DizText ? ListData[ListPos]->DizText+CurLeftPos:L""; size_t pos; if (strDizText.Pos(pos,L'\4')) strDizText.Truncate(pos); FS << fmt::Cells() << fmt::LeftAlign() << fmt::Size(ColumnWidth) << strDizText; break; } case OWNER_COLUMN: { const wchar_t* Owner=ListData[ListPos]->strOwner; if (Owner && !(ColumnTypes[K]&COLUMN_FULLOWNER) && PanelMode!=PLUGIN_PANEL) { const wchar_t* SlashPos=FirstSlash(Owner); if (SlashPos) Owner=SlashPos+1; } else if(Owner && IsSlash(*Owner)) { Owner++; } int CurLeftPos=0; if (!ShowStatus && LeftPos>0) { int Cells=StrZCellsCount(Owner); if (Cells>ColumnWidth) { CurLeftPos=LeftPos; if (CurLeftPos>Cells-ColumnWidth) CurLeftPos=Cells-ColumnWidth; if (CurLeftPos>MaxLeftPos) MaxLeftPos=CurLeftPos; } } FS << fmt::Cells() << fmt::LeftAlign() << fmt::Size(ColumnWidth) << Owner+CurLeftPos; break; } case GROUP_COLUMN: { const wchar_t* Group=ListData[ListPos]->strGroup; int CurLeftPos=0; if (!ShowStatus && LeftPos>0) { int Cells=StrZCellsCount(Group); if (Cells>ColumnWidth) { CurLeftPos=LeftPos; if (CurLeftPos>Cells-ColumnWidth) CurLeftPos=Cells-ColumnWidth; if (CurLeftPos>MaxLeftPos) MaxLeftPos=CurLeftPos; } } FS << fmt::Cells() << fmt::LeftAlign() << fmt::Size(ColumnWidth) << Group + CurLeftPos; break; } case NUMLINK_COLUMN: { FS << fmt::Cells() << fmt::Size(ColumnWidth) << ListData[ListPos]->NumberOfLinks; break; } } } } else { FS << fmt::Cells() << fmt::Expand(ColumnWidth) << L""; } if (ShowDivider==FALSE) GotoXY(CurX+ColumnWidth+1,CurY); else { if (!ShowStatus) { SetShowColor(ListPos); if (Level == ColumnsInGlobal) SetColor(COL_PANELBOX); } if (K == ColumnCount-1) SetColor(COL_PANELBOX); GotoXY(CurX+ColumnWidth,CurY); if (K==ColumnCount-1) BoxText(CurX+ColumnWidth==X2 ? BoxSymbols[BS_V2]:L' '); else BoxText(ShowStatus ? L' ':BoxSymbols[BS_V1]); if (!ShowStatus) SetColor(COL_PANELTEXT); } if (!ShowStatus) { if (Level == ColumnsInGlobal) { Level = 0; CurColumn++; } Level++; } } if ((!ShowStatus || StatusLine) && WhereX()0) LeftPos=MaxLeftPos; } } int FileList::IsFullScreen() { return this->ViewSettings.FullScreen; } int FileList::IsModeFullScreen(int Mode) { return(ViewSettingsArray[Mode].FullScreen); } int FileList::IsDizDisplayed() { return(IsColumnDisplayed(DIZ_COLUMN)); } int FileList::IsColumnDisplayed(int Type) { for (int i=0; i