mirror of
https://github.com/winscp/winscp.git
synced 2026-10-24 02:28:55 +03:00
Reverts e55f27da
Fixing some anchors and tab order on the way
Dialogs (and controls with specific width or height) are now about 10% wider
Note that main form already used the Segoe UI:9 by explicitly using UseDesktopFont for most/all of its controls
Layout rules
- follow IDE design guidelines in general
- controls start at 8x8, but at 9x9 in group boxes and 22v if group has title
- right and bottom padding in groupbox is the same as left padding
-for checkboxes the bottom padding of the checkmark is the same as left padding = 10
- buttons are 80x25 by default, with +14v with dropdown
- checkboxes/radiobuttons are +2h
- labels are 15 high, textboxes/comboxes 23
- indentation is controls under checkboxes is +16h
Source commit: 09a558e92af838e142d3624cb433cc052782881c
108 lines
3.5 KiB
C++
108 lines
3.5 KiB
C++
//---------------------------------------------------------------------------
|
|
#include <vcl.h>
|
|
#pragma hdrstop
|
|
|
|
USEFORM("forms\CustomScpExplorer.cpp", CustomScpExplorerForm);
|
|
USEFORM("forms\NonVisual.cpp", NonVisualDataModule); /* TDataModule: File Type */
|
|
USEFORM("forms\ScpCommander.cpp", ScpCommanderForm);
|
|
USEFORM("forms\ScpExplorer.cpp", ScpExplorerForm);
|
|
//---------------------------------------------------------------------------
|
|
#include <CoreMain.h>
|
|
#include <WinInterface.h>
|
|
#include <ProgParams.h>
|
|
#include <VCLCommon.h>
|
|
#include <Setup.h>
|
|
#include <PuttyTools.h>
|
|
#include <GUITools.h>
|
|
#include <Tools.h>
|
|
//---------------------------------------------------------------------------
|
|
void __fastcall AppLogImpl(UnicodeString S)
|
|
{
|
|
AppLog(S);
|
|
}
|
|
//---------------------------------------------------------------------------
|
|
WINAPI wWinMain(HINSTANCE, HINSTANCE, LPWSTR, int)
|
|
{
|
|
int Result = 0;
|
|
try
|
|
{
|
|
TProgramParams * Params = TProgramParams::Instance();
|
|
ApplicationLog = new TApplicationLog();
|
|
UnicodeString AppLogPath;
|
|
if (Params->FindSwitch(L"applog", AppLogPath))
|
|
{
|
|
ApplicationLog->Enable(AppLogPath);
|
|
OnAppLog = AppLogImpl;
|
|
}
|
|
AppLog(L"Starting...");
|
|
if (Params->FindSwitch(L"IsUWP"))
|
|
{
|
|
EnableUWPTestMode();
|
|
}
|
|
|
|
AddStartupSequence(L"M");
|
|
AppLogFmt(L"Process: %d", (GetCurrentProcessId()));
|
|
AppLogFmt(L"Mouse: %s", (BooleanToEngStr(Mouse->MousePresent)));
|
|
AppLogFmt(L"Mouse wheel: %s, msg: %d, scroll lines: %d", (BooleanToEngStr(Mouse->WheelPresent), int(Mouse->RegWheelMessage), Mouse->WheelScrollLines));
|
|
AppLogFmt(L"ACP: %d", (static_cast<int>(GetACP())));
|
|
AppLogFmt(L"Win32 platform: %d", (Win32Platform()));
|
|
AppLogFmt(L"Windows product type: %x", (static_cast<int>(GetWindowsProductType())));
|
|
AppLogFmt(L"Win64: %s", (BooleanToEngStr(IsWin64())));
|
|
AddStartupSequence(L"T");
|
|
|
|
WinInitialize();
|
|
Application->Initialize();
|
|
Application->MainFormOnTaskBar = true;
|
|
Application->ModalPopupMode = pmAuto;
|
|
DebugAssert(SameFont(Application->DefaultFont, std::unique_ptr<TFont>(new TFont()).get()));
|
|
SetEnvironmentVariable(L"WINSCP_PATH",
|
|
ExcludeTrailingBackslash(ExtractFilePath(Application->ExeName)).c_str());
|
|
CoreInitialize();
|
|
ApplicationLog->AddStartupInfo(); // Needs Configuration
|
|
InitializeWinHelp();
|
|
InitializeSystemSettings();
|
|
AddStartupSequence(L"S");
|
|
|
|
try
|
|
{
|
|
try
|
|
{
|
|
ConfigureInterface();
|
|
SetupInitialize();
|
|
|
|
Application->Title = AppName;
|
|
AppLog(L"Executing...");
|
|
Result = Execute();
|
|
AppLog(L"Execution done");
|
|
}
|
|
catch (Exception & E)
|
|
{
|
|
// Capture most errors before Usage class is released,
|
|
// so that we can count them
|
|
Configuration->Usage->Inc(L"GlobalFailures");
|
|
// After we get WM_QUIT (posted by Application->Terminate()), i.e once Application->Run() exits,
|
|
// the message just blinks
|
|
ShowExtendedException(&E);
|
|
}
|
|
}
|
|
__finally
|
|
{
|
|
AppLog(L"Finalizing");
|
|
GUIFinalize();
|
|
FinalizeSystemSettings();
|
|
FinalizeWinHelp();
|
|
CoreFinalize();
|
|
WinFinalize();
|
|
AppLog(L"Finalizing done");
|
|
OnAppLog = NULL;
|
|
SAFE_DESTROY_EX(TApplicationLog, ApplicationLog);
|
|
}
|
|
}
|
|
catch (Exception &E)
|
|
{
|
|
ShowExtendedException(&E);
|
|
}
|
|
return Result;
|
|
}
|
|
//---------------------------------------------------------------------------
|