//--------------------------------------------------------------------- __fastcall TCreateDirectoryDialog::TCreateDirectoryDialog(TComponent * AOwner): TForm(AOwner) { UseSystemSettings(this); RightsFrame->AllowAddXToDirectories = false; }
//--------------------------------------------------------------------------- __fastcall TEditorForm::TEditorForm(TComponent* Owner) : TForm(Owner) { EditorMemo = new TRichEdit20(this); EditorMemo->Parent = this; EditorMemo->Align = alClient; EditorMemo->HideSelection = false; EditorMemo->PlainText = true; EditorMemo->PopupMenu = EditorPopup; EditorMemo->ScrollBars = ssBoth; EditorMemo->WantTabs = true; EditorMemo->OnChange = EditorMemoChange; EditorMemo->OnKeyUp = EditorMemoKeyUp; EditorMemo->OnMouseUp = EditorMemoMouseUp; FParentForm = NULL; FCaretPos = TPoint(-1, -1); FLastFindDialog = NULL; FCloseAnnounced = false; FShowStatusBarHint = false; ApplyConfiguration(); FFindDialog = new TFindDialogEx(this); FFindDialog->OnFind = FindDialogFind; FReplaceDialog = new TReplaceDialogEx(this); FReplaceDialog->OnFind = FindDialogFind; FReplaceDialog->OnReplace = FindDialogFind; FEncoding = NULL; InitCodePage(); UseSystemSettings(this); UseDesktopFont(StatusBar); SetFormIcons(this, L"Z_ICON_EDITOR_BIG", L"Z_ICON_EDITOR_SMALL"); }
//--------------------------------------------------------------------------- __fastcall TEditMaskDialog::TEditMaskDialog(TComponent* Owner) : TForm(Owner) { UseSystemSettings(this); HintLabel(MaskHintText, FORMAT(L"%s\n \n%s\n \n%s\n \n%s", (LoadStr(MASK_HINT2), LoadStr(FILE_MASK_EX_HINT), LoadStr(PATH_MASK_HINT2), LoadStr(MASK_HELP)))); ReadOnlyControl(MaskMemo); }
//--------------------------------------------------------------------------- __fastcall TGenerateUrlDialog::TGenerateUrlDialog( TComponent * Owner, TSessionData * Data, TStrings * Paths) : TForm(Owner) { UseSystemSettings(this); FData = Data; FPaths = Paths; ReadOnlyControl(UrlMemo); }
//--------------------------------------------------------------------------- __fastcall TLogForm::TLogForm(TComponent* Owner) : TForm(Owner) { FLogMemo = NULL; FSessionLog = NULL; ShowWindow(Handle, SW_SHOWNA); UseSystemSettings(this); UseDesktopFont(StatusBar); SetFormIcons(this, L"Z_ICON_LOG_BIG", L"Z_ICON_LOG_SMALL"); }
//--------------------------------------------------------------------------- __fastcall TSelectMaskDialog::TSelectMaskDialog(TComponent* Owner) : TForm(Owner) { DefaultFileFilter(FFileFilter); SetFileFilter(FFileFilter); UseSystemSettings(this); HintLabel(HintText, FORMAT(L"%s\n \n%s\n \n%s\n \n%s", (LoadStr(MASK_HINT2), LoadStr(FILE_MASK_EX_HINT), LoadStr(COMBINING_MASKS_HINT), LoadStr(MASK_HELP)))); }
//--------------------------------------------------------------------------- __fastcall TFullSynchronizeDialog::TFullSynchronizeDialog(TComponent* Owner) : TForm(Owner) { UseSystemSettings(this); FParams = 0; FSaveMode = false; FOptions = 0; FPresetsMenu = new TPopupMenu(this); FSynchronizeBySizeCaption = SynchronizeBySizeCheck->Caption; HotTrackLabel(CopyParamLabel); CopyParamListButton(TransferSettingsButton); }
bool FocusBar::Ctrl::OnCreate (Win::CreateData const * create, bool & success) { UseSystemSettings (); Win::ButtonMaker buttonMaker (_h, CLOSE_BUTTON_ID); buttonMaker.Style () << Win::Button::Style::Flat << Win::Button::Style::VCenter << Win::Button::Style::HCenter; _closeButton = buttonMaker.Create (); // Revisit: poor man close button _closeButton.SetText ("X"); _closeButton.Show (); success = true; return true; }
//--------------------------------------------------------------------------- __fastcall TSynchronizeDialog::TSynchronizeDialog(TComponent * Owner) : TForm(Owner) { UseSystemSettings(this); FOptions = 0; FSynchronizing = false; FMinimizedByMe = false; FPresetsMenu = new TPopupMenu(this); FSynchronizeOptions = NULL; HotTrackLabel(CopyParamLabel); CopyParamListButton(TransferSettingsButton); SetGlobalMinimizeHandler(this, GlobalMinimize); }
//--------------------------------------------------------------------- __fastcall TFileSystemInfoDialog::TFileSystemInfoDialog(TComponent * AOwner, TGetSpaceAvailable OnGetSpaceAvailable) : TForm(AOwner) { UseSystemSettings(this); FOnGetSpaceAvailable = OnGetSpaceAvailable; FSpaceAvailableLoaded = false; FLastListItem = 0; CertificateGroup->Top = HostKeyGroup->Top; ReadOnlyControl(HostKeyFingerprintEdit); ReadOnlyControl(CertificateFingerprintEdit); ReadOnlyControl(InfoMemo); }
//--------------------------------------------------------------------- __fastcall TConsoleDialog::TConsoleDialog(TComponent* AOwner) : TForm(AOwner) { FTerminal = NULL; FClearExceptionOnFail = false; FOldChangeDirectory = NULL; FPrevTerminalClose = NULL;; FLastTerminal = NULL; FDirectoryChanged = false; OutputMemo->Color = clBlack; OutputMemo->Font->Color = (TColor)0x00BBBBBB; FixComboBoxResizeBug(CommandEdit); UseSystemSettings(this); OutputMemo->Font->Name = CustomWinConfiguration->DefaultFixedWidthFontName; OutputMemo->Font->Size = CustomWinConfiguration->DefaultFixedWidthFontSize; }
//--------------------------------------------------------------------- //--------------------------------------------------------------------- __fastcall TLocationProfilesDialog::TLocationProfilesDialog(TComponent * AOwner): TForm(AOwner) { FOperationSide = osLocal; FBookmarkDragSource = NULL; FTerminal = NULL; FSessionBookmarkList = new TBookmarkList(); FSharedBookmarkList = new TBookmarkList(); FChanging = false; FSessionFolders = CreateSortedStringList(); FSharedFolders = CreateSortedStringList(); FSessionScrollOnDragOver = new TTreeViewScrollOnDragOver(SessionProfilesView, true); FSharedScrollOnDragOver = new TTreeViewScrollOnDragOver(SharedProfilesView, true); UseSystemSettings(this); }
//--------------------------------------------------------------------------- __fastcall TLicenseDialog::TLicenseDialog(TComponent * Owner, TLicense License) : TForm(Owner) { UseSystemSettings(this); TStrings * LicenseList = new TStringList(); try { LicenseList->Text = ReadResource(LicenseStr[License]); assert(LicenseList->Count > 0); Caption = FMTLOAD(LICENSE_CAPTION, (LicenseList->Strings[0])); LicenseList->Delete(0); LicenseMemo->Lines->Text = LicenseList->Text; } __finally { delete LicenseList; } }
//--------------------------------------------------------------------------- __fastcall TSynchronizeDialog::TSynchronizeDialog(TComponent * Owner, TSynchronizeStartStopEvent OnStartStop, TGetSynchronizeOptionsEvent OnGetOptions, bool StartImmediatelly) : TForm(Owner) { UseSystemSettings(this); FOptions = 0; FSynchronizing = false; FMinimizedByMe = false; FPresetsMenu = new TPopupMenu(this); FOnStartStop = OnStartStop; FOnGetOptions = OnGetOptions; FSynchronizeOptions = NULL; FStartImmediatelly = StartImmediatelly; HotTrackLabel(CopyParamLabel); CopyParamListButton(TransferSettingsButton); SetGlobalMinimizeHandler(this, GlobalMinimize); }
//--------------------------------------------------------------------------- __fastcall TCopyDialog::TCopyDialog( TComponent* Owner, bool ToRemote, bool Move, TStrings * FileList, int Options, int CopyParamAttrs) : TForm(Owner) { FToRemote = ToRemote; FMove = Move; FOptions = Options; FCopyParamAttrs = CopyParamAttrs; FFileList = FileList; FOutputOptions = 0; AdjustControls(); FPresetsMenu = new TPopupMenu(this); HotTrackLabel(CopyParamLabel); CopyParamListButton(TransferSettingsButton); UseSystemSettings(this); }
//--------------------------------------------------------------------------- void __fastcall TAuthenticateForm::Init(TTerminal * Terminal) { FTerminal = Terminal; FSessionData = Terminal->SessionData; UseSystemSettings(this); FShowAsModalStorage = NULL; FFocusControl = NULL; UseDesktopFont(LogView); FPromptParent = InstructionsLabel->Parent; FPromptLeft = InstructionsLabel->Left; FPromptTop = InstructionsLabel->Top; FPromptRight = FPromptParent->ClientWidth - InstructionsLabel->Width - FPromptLeft; FPromptEditGap = PromptEdit1->Top - PromptLabel1->Top - PromptLabel1->Height; FPromptsGap = PromptLabel2->Top - PromptEdit1->Top - PromptEdit1->Height; ClientHeight = ScaleByTextHeight(this, 270); ClearLog(); }
//--------------------------------------------------------------------------- __fastcall TSynchronizeProgressForm::TSynchronizeProgressForm(TComponent * Owner, bool AllowMinimize, bool CompareOnly) : TForm(Owner) { FStarted = false; FCanceled = false; FElapsed = EncodeTimeVerbose(0, 0, 0, 0); FShowAsModalStorage = NULL; FMinimizedByMe = false; FCompareOnly = CompareOnly; UseSystemSettings(this); if (!AllowMinimize) { CancelButton->Left = CancelButton->Left + (MinimizeButton->Left - CancelButton->Left) / 2; MinimizeButton->Visible = false; } else { SetGlobalMinimizeHandler(this, GlobalMinimize); } }
//--------------------------------------------------------------------------- __fastcall TFileFindDialog::TFileFindDialog(TComponent * Owner, TFindEvent OnFind) : TForm(Owner) { UseSystemSettings(this); FOnFind = OnFind; FState = ffInit; FMinimizedByMe = false; FixComboBoxResizeBug(MaskEdit); FixComboBoxResizeBug(RemoteDirectoryEdit); HintLabel(MaskHintText, FORMAT(L"%s\n \n%s\n \n%s\n \n%s\n \n%s\n \n%s", (LoadStr(MASK_HINT2), LoadStr(FILE_MASK_EX_HINT), LoadStr(COMBINING_MASKS_HINT), LoadStr(PATH_MASK_HINT2), LoadStr(DIRECTORY_MASK_HINT), LoadStr(MASK_HELP)))); FSystemImageList = SharedSystemImageList(false); FileView->SmallImages = FSystemImageList; UseDesktopFont(FileView); UseDesktopFont(StatusBar); SetGlobalMinimizeHandler(this, GlobalMinimize); }
//--------------------------------------------------------------------------- __fastcall TAboutDialog::TAboutDialog(TComponent * AOwner, TConfiguration * Configuration, bool AllowLicense, TRegistration * Registration, bool ALoadThirdParty) : TForm(AOwner) { FConfiguration = Configuration; UseSystemSettings(this); LinkLabel(HomepageLabel, LoadStr(HOMEPAGE_URL)); LinkLabel(ForumUrlLabel, LoadStr(FORUM_URL)); ApplicationLabel->ParentFont = true; ApplicationLabel->Font->Style = ApplicationLabel->Font->Style << fsBold; ApplicationLabel->Caption = AppName; WinSCPCopyrightLabel->Caption = LoadStr(WINSCP_COPYRIGHT); UnicodeString Translator = LoadStr(TRANSLATOR_INFO); if (Registration == NULL) { RegistrationLabel->Visible = false; RegistrationBox->Visible = false; ClientHeight = ClientHeight - (ThirdPartyPanel->Top - RegistrationBox->Top); } else { RegistrationSubjectLabel->Caption = Registration->Subject; if (Registration->Registered) { UnicodeString Text; Text = FORMAT(LoadStrPart(ABOUT_REGISTRATION_LICENSES, 1), (Registration->Licenses >= 0 ? IntToStr(Registration->Licenses) : UnicodeString(LoadStrPart(ABOUT_REGISTRATION_LICENSES, 2)))); if (!Registration->NeverExpires) { Text = FMTLOAD(ABOUT_REGISTRATION_EXPIRES, (Text, FormatDateTime(L"ddddd", Registration->Expiration))); } RegistrationLicensesLabel->Caption = Text; Text = FMTLOAD(ABOUT_REGISTRATION_PRODUCTID, (Registration->ProductId)); if (Registration->EduLicense) { Text = FMTLOAD(ABOUT_REGISTRATION_EDULICENSE, (Text)); } RegistrationProductIdLabel->Caption = Text; RegistrationProductIdLabel->Font->Style = RegistrationProductIdLabel->Font->Style << fsBold; } else { RegistrationLicensesLabel->Visible = false; FOnRegistrationLink = Registration->OnRegistrationLink; RegistrationProductIdLabel->Caption = LoadStr(ABOUT_REGISTRATION_LINK); LinkLabel(RegistrationProductIdLabel, L""); } } if (Translator.IsEmpty()) { TranslatorLabel->Visible = false; TranslatorUrlLabel->Visible = false; ClientHeight = ClientHeight - (TranslatorLabel->Top - ProductSpecificMessageLabel->Top); } else { TranslatorLabel->Caption = LoadStr(TRANSLATOR_INFO); UnicodeString TranslatorUrl = LoadStr(TRANSLATOR_URL); if (!TranslatorUrl.IsEmpty()) { LinkLabel(TranslatorUrlLabel, TranslatorUrl); } else { TranslatorUrlLabel->Visible = false; // allow two lines of text, if there's no URL TranslatorLabel->AutoSize = false; TranslatorLabel->Width = ThirdPartyPanel->Width; TranslatorLabel->Height = TranslatorLabel->Height * 2; TranslatorLabel->WordWrap = true; } } LicenseButton->Visible = AllowLicense; LoadData(); if (ALoadThirdParty) { LoadThirdParty(); } else { CreateLabelPanel(ThirdPartyPanel, LoadStr(MESSAGE_DISPLAY_ERROR)); } }
//--------------------------------------------------------------------------- __fastcall TCustomCommandDialog::TCustomCommandDialog(TComponent* Owner, const TCustomCommandList * CustomCommandList, TCustomCommandsMode Mode, int Options, TCustomCommandValidate OnValidate, const TShortCuts * ShortCuts) : TForm(Owner) { SetCorrectFormParent(this); UseSystemSettings(this); FCustomCommandList = CustomCommandList; FMode = Mode; FOnValidate = OnValidate; HintLabel(HintText, LoadStr(CUSTOM_COMMAND_PATTERNS_HINT3)); int CaptionRes; switch (FMode) { case ccmAdd: CaptionRes = CUSTOM_COMMAND_ADD; break; case ccmEdit: CaptionRes = CUSTOM_COMMAND_EDIT; break; case ccmAdHoc: default: CaptionRes = CUSTOM_COMMAND_AD_HOC; break; } Caption = LoadStr(CaptionRes); if (FMode == ccmAdHoc) { int Shift = CommandEdit->Top - DescriptionEdit->Top; int Shift2 = Group->Height - ShortCutLabel->Top; DescriptionLabel->Visible = false; DescriptionEdit->Visible = false; for (int i = 0; i < Group->ControlCount; i++) { TControl * Control = Group->Controls[i]; if (Control->Visible) { if (Control->Top > DescriptionLabel->Top) { Control->Top = Control->Top - Shift; } } } ShortCutLabel->Visible = false; ShortCutCombo->Visible = false; ClientHeight = ClientHeight - Shift - Shift2; } else { assert(ShortCuts != NULL); InitializeShortCutCombo(ShortCutCombo, *ShortCuts); } EnableControl(RemoteCommandButton, FLAGCLEAR(Options, ccoDisableRemote)); UpdateControls(); }
//--------------------------------------------------------------------- __fastcall TCleanupDialog::TCleanupDialog(TComponent* AOwner) : TForm(AOwner) { UseSystemSettings(this); }
bool FocusBar::Ctrl::OnSettingChange (Win::SystemWideFlags flags, char const * sectionName) { if (flags.IsNonClientMetrics ()) UseSystemSettings (); return true; }