diff options
author | Igor Pavlov <ipavlov@users.sourceforge.net> | 2009-08-17 04:00:00 +0400 |
---|---|---|
committer | Kornel LesiĆski <kornel@geekhood.net> | 2016-05-28 02:16:00 +0300 |
commit | c99f3ebdd639c2adb03d8b44001b10af18516504 (patch) | |
tree | 92aaf34e5edbd7287c3f55037190da75ab0a8000 /CPP/7zip/UI/FileManager/App.h | |
parent | 829409452d85cd6dd9dfc9151f109d6e13a2bb1c (diff) |
9.06 beta
Diffstat (limited to 'CPP/7zip/UI/FileManager/App.h')
-rwxr-xr-x | CPP/7zip/UI/FileManager/App.h | 181 |
1 files changed, 74 insertions, 107 deletions
diff --git a/CPP/7zip/UI/FileManager/App.h b/CPP/7zip/UI/FileManager/App.h index 1fc77138..d2ced9ba 100755 --- a/CPP/7zip/UI/FileManager/App.h +++ b/CPP/7zip/UI/FileManager/App.h @@ -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 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 SetListViewMode(UINT32 index) - { GetFocusedPanel().SetListViewMode(index); } - UINT32 GetListViewMode() - { return GetFocusedPanel().GetListViewMode(); } - - void SortItemsWithPropID(PROPID propID) - { GetFocusedPanel().SortItemsWithPropID(propID); } - - void OpenRootFolder() - { GetFocusedPanel().OpenDrivesFolder(); } - void OpenParentFolder() - { GetFocusedPanel().OpenParentFolder(); } - void FoldersHistory() - { GetFocusedPanel().FoldersHistory(); } - void RefreshView() - { GetFocusedPanel().OnReload(); } + 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 RefreshStatusBar() { GetFocusedPanel().RefreshStatusBar(); } + + 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 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 |