Compress-Deflate7
view release on metacpan or search on metacpan
7zip/CPP/7zip/UI/FileManager/BrowseDialog.cpp view on Meta::CPAN
SetItemText(IDC_BROWSE_PATH, Path);
_list.SetRedraw(false);
_list.DeleteAllItems();
if (!Path.IsEmpty() && Path.Back() != WCHAR_PATH_SEPARATOR)
Path += WCHAR_PATH_SEPARATOR;
LVITEMW item;
int index = 0;
int cursorIndex = -1;
#ifndef _SFX
if (_showDots)
{
UString itemName = L"..";
item.iItem = index;
if (selectedName.IsEmpty())
cursorIndex = item.iItem;
item.mask = LVIF_TEXT | LVIF_PARAM | LVIF_IMAGE;
int subItem = 0;
item.iSubItem = subItem++;
item.lParam = kParentIndex;
item.pszText = (wchar_t *)(const wchar_t *)itemName;
item.iImage = _extToIconMap.GetIconIndex(FILE_ATTRIBUTE_DIRECTORY, Path);
if (item.iImage < 0)
item.iImage = 0;
_list.InsertItem(&item);
_list.SetSubItem(index, subItem++, L"");
_list.SetSubItem(index, subItem++, L"");
index++;
}
#endif
for (int i = 0; i < _files.Size(); i++)
{
const CFileInfoW &fi = _files[i];
item.iItem = index;
if (fi.Name.CompareNoCase(selectedName) == 0)
cursorIndex = item.iItem;
item.mask = LVIF_TEXT | LVIF_PARAM | LVIF_IMAGE;
int subItem = 0;
item.iSubItem = subItem++;
item.lParam = i;
item.pszText = (wchar_t *)(const wchar_t *)fi.Name;
item.iImage = _extToIconMap.GetIconIndex(fi.Attrib, Path + fi.Name);
if (item.iImage < 0)
item.iImage = 0;
_list.InsertItem(&item);
{
7zip/CPP/7zip/UI/FileManager/BrowseDialog.cpp view on Meta::CPAN
}
{
UString s;
if (!fi.IsDir())
s = ConvertSizeToStringShort(fi.Size);
_list.SetSubItem(index, subItem++, s);
}
index++;
}
if (_list.GetItemCount() > 0 && cursorIndex >= 0)
_list.SetItemState_FocusedSelected(cursorIndex);
_list.SortItems(CompareItems2, (LPARAM)this);
if (_list.GetItemCount() > 0 && cursorIndex < 0)
_list.SetItemState(0, LVIS_FOCUSED, LVIS_FOCUSED);
_list.EnsureVisible(_list.GetFocusedItem(), false);
_list.SetRedraw(true);
return S_OK;
}
HRESULT CBrowseDialog::Reload()
{
UString selectedCur;
int index = _list.GetNextSelectedItem(-1);
7zip/CPP/7zip/UI/FileManager/FM.cpp view on Meta::CPAN
int baseID = 100;
NWindows::NControl::CToolBar aToolBar;
aToolBar.Attach(::CreateToolbarEx (hWnd,
WS_CHILD | WS_BORDER | WS_VISIBLE | TBSTYLE_TOOLTIPS, // | TBSTYLE_FLAT
baseID + 2, 11,
(HINSTANCE)HINST_COMMCTRL, IDB_VIEW_SMALL_COLOR,
(LPCTBBUTTON)&tbb, sizeof(tbb) / sizeof(tbb[0]),
0, 0, 100, 30, sizeof (TBBUTTON)));
*/
// HCURSOR cursor = ::LoadCursor(0, IDC_SIZEWE);
// ::SetCursor(cursor);
if (g_PanelsInfoDefined)
g_Splitter.SetPos(hWnd, g_SplitterPos);
else
{
g_Splitter.SetRatio(hWnd, kSplitterRateMax / 2);
g_SplitterPos = g_Splitter.GetPos();
}
RECT rect;
7zip/CPP/7zip/UI/FileManager/PanelItems.cpp view on Meta::CPAN
// OutputDebugString(TEXT("Start Dir\n"));
UInt32 numItems;
_folder->GetNumberOfItems(&numItems);
bool showDots = _showDots && !IsRootFolder();
_listView.SetItemCount(numItems + (showDots ? 1 : 0));
_selectedStatusVector.Reserve(numItems);
int cursorIndex = -1;
CMyComPtr<IFolderGetSystemIconIndex> folderGetSystemIconIndex;
if (!IsFSFolder() || _showRealFileIcons)
_folder.QueryInterface(IID_IFolderGetSystemIconIndex, &folderGetSystemIconIndex);
if (showDots)
{
UString itemName = L"..";
item.iItem = _listView.GetItemCount();
if (itemName.CompareNoCase(focusedName) == 0)
cursorIndex = item.iItem;
item.mask = LVIF_TEXT | LVIF_PARAM | LVIF_IMAGE;
int subItem = 0;
item.iSubItem = subItem++;
item.lParam = kParentIndex;
item.pszText = const_cast<wchar_t *>((const wchar_t *)itemName);
UInt32 attrib = FILE_ATTRIBUTE_DIRECTORY;
item.iImage = _extToIconMap.GetIconIndex(attrib, itemName);
if (item.iImage < 0)
item.iImage = 0;
if (_listView.InsertItem(&item) == -1)
return E_FAIL;
}
// OutputDebugStringA("S1\n");
for (UInt32 i = 0; i < numItems; i++)
{
UString itemName = GetItemName(i);
const UString relPath = GetItemRelPath(i);
if (relPath.CompareNoCase(focusedName) == 0)
cursorIndex = _listView.GetItemCount();
bool selected = false;
if (selectedNames.FindInSorted(relPath) >= 0)
selected = true;
_selectedStatusVector.Add(selected);
item.mask = LVIF_TEXT | LVIF_PARAM | LVIF_IMAGE;
if (!_mySelectMode)
if (selected)
{
7zip/CPP/7zip/UI/FileManager/PanelItems.cpp view on Meta::CPAN
}
}
if (item.iImage < 0)
item.iImage = 0;
if (_listView.InsertItem(&item) == -1)
return E_FAIL; // error
}
// OutputDebugStringA("End2\n");
if (_listView.GetItemCount() > 0 && cursorIndex >= 0)
SetFocusedSelectedItem(cursorIndex, selectFocused);
_listView.SortItems(CompareItems, (LPARAM)this);
if (cursorIndex < 0 && _listView.GetItemCount() > 0)
{
if (focusedPos >= _listView.GetItemCount())
focusedPos = _listView.GetItemCount() - 1;
// we select item only in showDots mode.
SetFocusedSelectedItem(focusedPos, showDots);
}
// m_RedrawEnabled = true;
_listView.EnsureVisible(_listView.GetFocusedItem(), false);
_listView.SetRedraw(true);
_listView.InvalidateRect(NULL, true);
( run in 0.247 second using v1.01-cache-2.11-cpan-4d50c553e7e )