mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-07 13:15:04 -06:00
9.06 beta
This commit is contained in:
committed by
Kornel Lesiński
parent
829409452d
commit
c99f3ebdd6
@@ -3,10 +3,12 @@
|
||||
#ifndef __APP_H
|
||||
#define __APP_H
|
||||
|
||||
#include "Panel.h"
|
||||
#include "AppState.h"
|
||||
#include "Windows/Control/CommandBar.h"
|
||||
#include "Windows/Control/ImageList.h"
|
||||
|
||||
#include "AppState.h"
|
||||
#include "Panel.h"
|
||||
|
||||
class CApp;
|
||||
|
||||
extern CApp g_App;
|
||||
@@ -14,8 +16,6 @@ extern HWND g_HWND;
|
||||
|
||||
const int kNumPanelsMax = 2;
|
||||
|
||||
extern void MoveSubWindows(HWND hWnd);
|
||||
|
||||
enum
|
||||
{
|
||||
kAddCommand = kToolbarStartID,
|
||||
@@ -77,12 +77,10 @@ class CDropTarget:
|
||||
|
||||
public:
|
||||
MY_UNKNOWN_IMP1_MT(IDropTarget)
|
||||
STDMETHOD(DragEnter)(IDataObject * dataObject, DWORD keyState,
|
||||
POINTL pt, DWORD *effect);
|
||||
STDMETHOD(DragEnter)(IDataObject * dataObject, DWORD keyState, POINTL pt, DWORD *effect);
|
||||
STDMETHOD(DragOver)(DWORD keyState, POINTL pt, DWORD * effect);
|
||||
STDMETHOD(DragLeave)();
|
||||
STDMETHOD(Drop)(IDataObject * dataObject, DWORD keyState,
|
||||
POINTL pt, DWORD *effect);
|
||||
STDMETHOD(Drop)(IDataObject * dataObject, DWORD keyState, POINTL pt, DWORD *effect);
|
||||
|
||||
CDropTarget():
|
||||
TargetPanelIndex(-1),
|
||||
@@ -119,16 +117,18 @@ public:
|
||||
CPanel Panels[kNumPanelsMax];
|
||||
bool PanelsCreated[kNumPanelsMax];
|
||||
|
||||
NWindows::NControl::CImageList _archiveButtonsImageList;
|
||||
NWindows::NControl::CImageList _standardButtonsImageList;
|
||||
NWindows::NControl::CImageList _buttonsImageList;
|
||||
|
||||
NWindows::NControl::CReBar _rebar;
|
||||
NWindows::NControl::CToolBar _archiveToolBar;
|
||||
NWindows::NControl::CToolBar _standardToolBar;
|
||||
#ifdef UNDER_CE
|
||||
NWindows::NControl::CCommandBar _commandBar;
|
||||
#endif
|
||||
NWindows::NControl::CToolBar _toolBar;
|
||||
|
||||
CDropTarget *_dropTargetSpec;
|
||||
CMyComPtr<IDropTarget> _dropTarget;
|
||||
|
||||
CApp(): _window(0), NumPanels(2), LastFocusedPanel(0) {}
|
||||
|
||||
void CreateDragTarget()
|
||||
{
|
||||
_dropTargetSpec = new CDropTarget();
|
||||
@@ -165,94 +165,53 @@ public:
|
||||
void Save();
|
||||
void Release();
|
||||
|
||||
|
||||
/*
|
||||
void SetFocus(int panelIndex)
|
||||
{ Panels[panelIndex].SetFocusToList(); }
|
||||
*/
|
||||
void SetFocusToLastItem()
|
||||
{ Panels[LastFocusedPanel].SetFocusToLastRememberedItem(); }
|
||||
|
||||
// void SetFocus(int panelIndex) { Panels[panelIndex].SetFocusToList(); }
|
||||
void SetFocusToLastItem() { Panels[LastFocusedPanel].SetFocusToLastRememberedItem(); }
|
||||
int GetFocusedPanelIndex() const { return LastFocusedPanel; }
|
||||
|
||||
bool IsPanelVisible(int index) const { return (NumPanels > 1 || index == LastFocusedPanel); }
|
||||
|
||||
/*
|
||||
void SetCurrentIndex()
|
||||
{ CurrentPanel = GetFocusedPanelIndex(); }
|
||||
*/
|
||||
|
||||
CApp(): NumPanels(2), LastFocusedPanel(0) {}
|
||||
CPanel &GetFocusedPanel()
|
||||
{ return Panels[GetFocusedPanelIndex()]; }
|
||||
CPanel &GetFocusedPanel() { return Panels[GetFocusedPanelIndex()]; }
|
||||
|
||||
// File Menu
|
||||
void OpenItem()
|
||||
{ GetFocusedPanel().OpenSelectedItems(true); }
|
||||
void OpenItemInside()
|
||||
{ GetFocusedPanel().OpenFocusedItemAsInternal(); }
|
||||
void OpenItemOutside()
|
||||
{ GetFocusedPanel().OpenSelectedItems(false); }
|
||||
void EditItem()
|
||||
{ GetFocusedPanel().EditItem(); }
|
||||
void Rename()
|
||||
{ GetFocusedPanel().RenameFile(); }
|
||||
void CopyTo()
|
||||
{ OnCopy(false, false, GetFocusedPanelIndex()); }
|
||||
void MoveTo()
|
||||
{ OnCopy(true, false, GetFocusedPanelIndex()); }
|
||||
void Delete(bool toRecycleBin)
|
||||
{ GetFocusedPanel().DeleteItems(toRecycleBin); }
|
||||
void OpenItem() { GetFocusedPanel().OpenSelectedItems(true); }
|
||||
void OpenItemInside() { GetFocusedPanel().OpenFocusedItemAsInternal(); }
|
||||
void OpenItemOutside() { GetFocusedPanel().OpenSelectedItems(false); }
|
||||
void EditItem() { GetFocusedPanel().EditItem(); }
|
||||
void Rename() { GetFocusedPanel().RenameFile(); }
|
||||
void CopyTo() { OnCopy(false, false, GetFocusedPanelIndex()); }
|
||||
void MoveTo() { OnCopy(true, false, GetFocusedPanelIndex()); }
|
||||
void Delete(bool toRecycleBin) { GetFocusedPanel().DeleteItems(toRecycleBin); }
|
||||
void CalculateCrc();
|
||||
void DiffFiles();
|
||||
void Split();
|
||||
void Combine();
|
||||
void Properties()
|
||||
{ GetFocusedPanel().Properties(); }
|
||||
void Comment()
|
||||
{ GetFocusedPanel().ChangeComment(); }
|
||||
void Properties() { GetFocusedPanel().Properties(); }
|
||||
void Comment() { GetFocusedPanel().ChangeComment(); }
|
||||
|
||||
void CreateFolder()
|
||||
{ GetFocusedPanel().CreateFolder(); }
|
||||
void CreateFile()
|
||||
{ GetFocusedPanel().CreateFile(); }
|
||||
void CreateFolder() { GetFocusedPanel().CreateFolder(); }
|
||||
void CreateFile() { GetFocusedPanel().CreateFile(); }
|
||||
|
||||
// Edit
|
||||
void EditCut()
|
||||
{ GetFocusedPanel().EditCut(); }
|
||||
void EditCopy()
|
||||
{ GetFocusedPanel().EditCopy(); }
|
||||
void EditPaste()
|
||||
{ GetFocusedPanel().EditPaste(); }
|
||||
void EditCut() { GetFocusedPanel().EditCut(); }
|
||||
void EditCopy() { GetFocusedPanel().EditCopy(); }
|
||||
void EditPaste() { GetFocusedPanel().EditPaste(); }
|
||||
|
||||
void SelectAll(bool selectMode)
|
||||
{ GetFocusedPanel().SelectAll(selectMode); }
|
||||
void InvertSelection()
|
||||
{ GetFocusedPanel().InvertSelection(); }
|
||||
void SelectSpec(bool selectMode)
|
||||
{ GetFocusedPanel().SelectSpec(selectMode); }
|
||||
void SelectByType(bool selectMode)
|
||||
{ GetFocusedPanel().SelectByType(selectMode); }
|
||||
void SelectAll(bool selectMode) { GetFocusedPanel().SelectAll(selectMode); }
|
||||
void InvertSelection() { GetFocusedPanel().InvertSelection(); }
|
||||
void SelectSpec(bool selectMode) { GetFocusedPanel().SelectSpec(selectMode); }
|
||||
void SelectByType(bool selectMode) { GetFocusedPanel().SelectByType(selectMode); }
|
||||
|
||||
void RefreshStatusBar()
|
||||
{ GetFocusedPanel().RefreshStatusBar(); }
|
||||
void RefreshStatusBar() { GetFocusedPanel().RefreshStatusBar(); }
|
||||
|
||||
void SetListViewMode(UINT32 index)
|
||||
{ GetFocusedPanel().SetListViewMode(index); }
|
||||
UINT32 GetListViewMode()
|
||||
{ return GetFocusedPanel().GetListViewMode(); }
|
||||
void SetListViewMode(UINT32 index) { GetFocusedPanel().SetListViewMode(index); }
|
||||
UINT32 GetListViewMode() { return GetFocusedPanel().GetListViewMode(); }
|
||||
PROPID GetSortID() { return GetFocusedPanel().GetSortID(); }
|
||||
|
||||
void SortItemsWithPropID(PROPID propID)
|
||||
{ GetFocusedPanel().SortItemsWithPropID(propID); }
|
||||
void SortItemsWithPropID(PROPID propID) { GetFocusedPanel().SortItemsWithPropID(propID); }
|
||||
|
||||
void OpenRootFolder()
|
||||
{ GetFocusedPanel().OpenDrivesFolder(); }
|
||||
void OpenParentFolder()
|
||||
{ GetFocusedPanel().OpenParentFolder(); }
|
||||
void FoldersHistory()
|
||||
{ GetFocusedPanel().FoldersHistory(); }
|
||||
void RefreshView()
|
||||
{ GetFocusedPanel().OnReload(); }
|
||||
void OpenRootFolder() { GetFocusedPanel().OpenDrivesFolder(); }
|
||||
void OpenParentFolder() { GetFocusedPanel().OpenParentFolder(); }
|
||||
void FoldersHistory() { GetFocusedPanel().FoldersHistory(); }
|
||||
void RefreshView() { GetFocusedPanel().OnReload(); }
|
||||
void RefreshAllPanels()
|
||||
{
|
||||
for (int i = 0; i < NumPanels; i++)
|
||||
@@ -263,18 +222,29 @@ public:
|
||||
Panels[index].OnReload();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
void SysIconsWereChanged()
|
||||
{
|
||||
for (int i = 0; i < NumPanels; i++)
|
||||
{
|
||||
int index = i;
|
||||
if (NumPanels == 1)
|
||||
index = LastFocusedPanel;
|
||||
Panels[index].SysIconsWereChanged();
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
void SetListSettings();
|
||||
void SetShowSystemMenu();
|
||||
HRESULT SwitchOnOffOnePanel();
|
||||
bool GetFlatMode() { return Panels[LastFocusedPanel].GetFlatMode(); }
|
||||
void ChangeFlatMode() { Panels[LastFocusedPanel].ChangeFlatMode(); }
|
||||
|
||||
void OpenBookmark(int index)
|
||||
{ GetFocusedPanel().OpenBookmark(index); }
|
||||
void SetBookmark(int index)
|
||||
{ GetFocusedPanel().SetBookmark(index); }
|
||||
void OpenBookmark(int index) { GetFocusedPanel().OpenBookmark(index); }
|
||||
void SetBookmark(int index) { GetFocusedPanel().SetBookmark(index); }
|
||||
|
||||
void ReloadRebar(HWND hwnd);
|
||||
void ReloadToolbars();
|
||||
void ReadToolbar()
|
||||
{
|
||||
@@ -293,33 +263,28 @@ public:
|
||||
if (ShowArchiveToolbar) mask |= 8;
|
||||
SaveToolbarsMask(mask);
|
||||
}
|
||||
|
||||
void SaveToolbarChanges();
|
||||
|
||||
void SwitchStandardToolbar()
|
||||
{
|
||||
ShowStandardToolbar = !ShowStandardToolbar;
|
||||
SaveToolbar();
|
||||
ReloadRebar(g_HWND);
|
||||
MoveSubWindows(_window);
|
||||
SaveToolbarChanges();
|
||||
}
|
||||
void SwitchArchiveToolbar()
|
||||
{
|
||||
ShowArchiveToolbar = !ShowArchiveToolbar;
|
||||
SaveToolbar();
|
||||
ReloadRebar(g_HWND);
|
||||
MoveSubWindows(_window);
|
||||
SaveToolbarChanges();
|
||||
}
|
||||
void SwitchButtonsLables()
|
||||
{
|
||||
ShowButtonsLables = !ShowButtonsLables;
|
||||
SaveToolbar();
|
||||
ReloadRebar(g_HWND);
|
||||
MoveSubWindows(_window);
|
||||
SaveToolbarChanges();
|
||||
}
|
||||
void SwitchLargeButtons()
|
||||
{
|
||||
LargeButtons = !LargeButtons;
|
||||
SaveToolbar();
|
||||
ReloadRebar(g_HWND);
|
||||
MoveSubWindows(_window);
|
||||
SaveToolbarChanges();
|
||||
}
|
||||
|
||||
void AddToArchive() { GetFocusedPanel().AddToArchive(); }
|
||||
@@ -332,6 +297,8 @@ public:
|
||||
void RefreshTitle(bool always = false);
|
||||
void RefreshTitleAlways() { RefreshTitle(true); }
|
||||
void RefreshTitle(int panelIndex, bool always = false);
|
||||
|
||||
void MoveSubWindows();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user