コード例 #1
0
//---------------------------------------------------------------------------
void __fastcall TSynchronizeDialog::FormShow(TObject * /*Sender*/)
{
  InstallPathWordBreakProc(LocalDirectoryEdit);
  InstallPathWordBreakProc(RemoteDirectoryEdit);

  // OnShow gets called more than once sometimes
  if (!FSynchronizing)
  {
    ClearLog();
    UpdateControls();
    if (FStartImmediatelly)
    {
      // if starting get cancelled (from SYNCHRONISE_BEFORE_KEEPUPTODATE2 prompt),
      // and OnShow gets called again (FSynchronizing is false),
      // we do not want to try to start again
      FStartImmediatelly = false;
      StartButtonClick(NULL);
    }
  }
}
コード例 #2
0
//---------------------------------------------------------------------------
void __fastcall TWebServForm::FormShow(TObject *Sender)
{
    TIniFile    *IniFile;
    WSAData     wsi;

    if (!FInitialized) {
        FInitialized     = TRUE;
        IniFile          = new TIniFile(FIniFileName);
        Top              = IniFile->ReadInteger(SectionWindow, KeyTop,    Top);
        Left             = IniFile->ReadInteger(SectionWindow, KeyLeft,   Left);
        Width            = IniFile->ReadInteger(SectionWindow, KeyWidth,  Width);
        Height           = IniFile->ReadInteger(SectionWindow, KeyHeight, Height);
        DocDirEdit->Text     = IniFile->ReadString(SectionData, KeyDocDir,
                                                  "c:\WwwRoot");
        DefaultDocEdit->Text = IniFile->ReadString(SectionData, KeyDefaultDoc,
                                                  "index.html");
        PortEdit->Text       = IniFile->ReadString(SectionData, KeyPort,
                                                  "80");
        DisplayHeaderCheckBox->Checked =
                IniFile->ReadInteger(SectionData, KeyDisplayHeader, 0);
        delete IniFile;
        DisplayMemo->Clear();
        // Initialize client count caption
        ClientCountLabel->Caption = "0";
        // Display version info for program and use components
        wsi = WinsockInfo();
        Display(CopyRight);
        Display("Using:");
        Display("    Winsock:");
        Display(Format("        Version %d.%d",
                       ARRAYOFCONST((wsi.wHighVersion >> 8,
                                     wsi.wHighVersion & 15))));
        Display(Format("        %s", ARRAYOFCONST((&wsi.szDescription[0]))));
        Display(Format("        %s", ARRAYOFCONST((&wsi.szSystemStatus[0]))));
        if (wsi.lpVendorInfo != NULL)
            Display(Format("        %s", ARRAYOFCONST((wsi.lpVendorInfo))));
        // Automatically start server
        StartButtonClick(this);
    }