mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-16 10:11:49 -06:00
4.20
This commit is contained in:
committed by
Kornel Lesiński
parent
8c1b5c7b7e
commit
3c510ba80b
@@ -1,6 +1,6 @@
|
||||
// FAM.cpp
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "StdAfx.h"
|
||||
|
||||
#include "resource.h"
|
||||
#include "Panel.h"
|
||||
@@ -30,8 +30,6 @@ using namespace NWindows;
|
||||
|
||||
HINSTANCE g_hInstance;
|
||||
HWND g_HWND;
|
||||
|
||||
|
||||
static UString g_MainPath;
|
||||
|
||||
const int kNumDefaultPanels = 1;
|
||||
@@ -56,7 +54,6 @@ CSysString GetProgramFolderPrefix()
|
||||
}
|
||||
|
||||
|
||||
|
||||
class CSplitterPos
|
||||
{
|
||||
int _ratio; // 10000 is max
|
||||
@@ -106,8 +103,9 @@ public:
|
||||
};
|
||||
|
||||
bool g_CanChangeSplitter = false;
|
||||
int g_SplitterPos = 0;
|
||||
UINT32 g_SplitterPos = 0;
|
||||
CSplitterPos g_Splitter;
|
||||
bool g_PanelsInfoDefined = false;
|
||||
|
||||
int g_StartCaptureMousePos;
|
||||
int g_StartCaptureSplitterPos;
|
||||
@@ -126,7 +124,9 @@ BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
|
||||
TCHAR windowClass[MAX_LOADSTRING]; // The window class name
|
||||
lstrcpy(windowClass, TEXT("FM"));
|
||||
|
||||
g_hInstance = hInstance; // Store instance handle in our global variable
|
||||
g_hInstance = hInstance;
|
||||
|
||||
ReloadLang();
|
||||
|
||||
// LoadString(hInstance, IDS_CLASS, windowClass, MAX_LOADSTRING);
|
||||
|
||||
@@ -184,9 +184,8 @@ BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
|
||||
}
|
||||
|
||||
UINT32 numPanels, currentPanel;
|
||||
UINT32 splitterPos;
|
||||
bool panelsInfoDefined = ReadPanelsInfo(numPanels, currentPanel, splitterPos);
|
||||
if (panelsInfoDefined)
|
||||
g_PanelsInfoDefined = ReadPanelsInfo(numPanels, currentPanel, g_SplitterPos);
|
||||
if (g_PanelsInfoDefined)
|
||||
{
|
||||
if (numPanels < 1 || numPanels > 2)
|
||||
numPanels = kNumDefaultPanels;
|
||||
@@ -207,17 +206,6 @@ BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
|
||||
return FALSE;
|
||||
g_HWND = hWnd;
|
||||
|
||||
if (panelsInfoDefined)
|
||||
{
|
||||
g_SplitterPos = splitterPos;
|
||||
g_Splitter.SetPos(hWnd, splitterPos);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_Splitter.SetRatio(hWnd, kSplitterRateMax / 2);
|
||||
g_SplitterPos = g_Splitter.GetPos();
|
||||
}
|
||||
|
||||
CWindow window(hWnd);
|
||||
|
||||
WINDOWPLACEMENT placement;
|
||||
@@ -383,10 +371,10 @@ void ExecuteCommand(UINT commandID)
|
||||
g_App.AddToArchive();
|
||||
break;
|
||||
case kExtractCommand:
|
||||
g_App.ExtractArchive();
|
||||
g_App.ExtractArchives();
|
||||
break;
|
||||
case kTestCommand:
|
||||
g_App.TestArchive();
|
||||
g_App.TestArchives();
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -455,7 +443,23 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
// HCURSOR cursor = ::LoadCursor(0, IDC_SIZEWE);
|
||||
// ::SetCursor(cursor);
|
||||
|
||||
g_App.Create(hWnd, g_MainPath);
|
||||
if (g_PanelsInfoDefined)
|
||||
g_Splitter.SetPos(hWnd, g_SplitterPos);
|
||||
else
|
||||
{
|
||||
g_Splitter.SetRatio(hWnd, kSplitterRateMax / 2);
|
||||
g_SplitterPos = g_Splitter.GetPos();
|
||||
}
|
||||
|
||||
RECT rect;
|
||||
::GetClientRect(hWnd, &rect);
|
||||
int xSize = rect.right;
|
||||
int xSizes[2];
|
||||
xSizes[0] = g_Splitter.GetPos();
|
||||
xSizes[1] = xSize - kSplitterWidth - xSizes[0];
|
||||
if (xSizes[1] < 0)
|
||||
xSizes[1] = 0;
|
||||
g_App.Create(hWnd, g_MainPath, xSizes);
|
||||
// g_SplitterPos = 0;
|
||||
|
||||
DragAcceptFiles(hWnd, TRUE);
|
||||
|
||||
Reference in New Issue
Block a user