Example #1
0
//---------------------------------------------------------------------------
int __fastcall TFileLoadSave::ShowModal(FileNum path,AnsiString& currname,AnsiString& currtitle,FileModes mode)
{
	int i=0;
	while(dirnums[i] && dirnums[i]!=FileNum(int(path)&0xff00))
    	i++;
    if (dirnums[i]==0)
    {
    	if (path)
        {
	    	CurrDirNum=FileNum(int(path)&0xff00);
		    dirnums[1+1]=CurrDirNum;
            char pathbuff[80];
            char* n=FILEMAN.namenumberedfilelessfail(CurrDirNum);
            char* c;
            for (c=n+strlen(n);*c!='\\';--c)
	            *c=0;
            strcpy(pathbuff,n);
			return ShowModal(pathbuff,currname,currtitle,mode);
        }
        else
        {
    	    i=0;
	        CurrDirNum=dirnums[i];
        }
    }
	PathList->ItemIndex=i;
	return ShowModal(PathList->Items->Strings[i],currname,currtitle,mode);
}
Example #2
0
//---------------------------------------------------------------------
int __fastcall TACalResDlg::Execute(CACal *p)
{
	pACal = p;
	mmax = pACal->GetMV();
	int i;
	MVAL *mp = mval;
	for( i = 0; i < mmax; i++, mp++ ){
		pACal->ReadMV(mp, i);
	}
	Grid->RowCount = mmax + 1;
	char bf[256];
	pACal->SetTradeStr(bf);
	CalCond->Caption = bf;
	if( !pACal->atrg.TF ){
		if( pACal->amax >= 2 ){
			Grid->ColCount = Grid->ColCount + pACal->amax - 1;
		}
	}
	Sort(0);
	ScrollIndex(GetCurIndex());
	SetupPtn(Grid->Row);

	// ダイアログボックスを開く
	if( ShowModal() == IDOK ){
		if( Grid->Row ){
			int Row = Grid->Row - 1;
			for( i = 0; i < pACal->amax; i++ ){
				pACal->SetPara(i, mval[Row].AD[i]);
			}
			pACal->WList.Update();
			return TRUE;
		}
	}
	return FALSE;
}
Example #3
0
DWORD CAbout::DoModal()
{
	if(! this->m_hWnd)
		return -1;
	m_bModal = true;
	return ShowModal();
}
Example #4
0
//---------------------------------------------------------------------------
bool __fastcall TLocationProfilesDialog::Execute()
{
  bool Result;
  PageControl->ActivePage = GetProfilesSheet();
  FBookmarkSelected = false;
  Result = (ShowModal() == DefaultResult(this));
  if (Terminal)
  {
    WinConfiguration->Bookmarks[FSessionKey] = FSessionBookmarkList;
    WinConfiguration->SharedBookmarks = FSharedBookmarkList;
    WinConfiguration->UseSharedBookmarks = (PageControl->ActivePage == SharedProfilesSheet);
  }
  if (Result)
  {
    if (FBookmarkSelected)
    {
      Configuration->Usage->Inc(L"OpenedBookmark");
    }
    else
    {
      Configuration->Usage->Inc(L"OpenedPath");
    }
  }
  return Result;
}
Example #5
0
// ---------------------------------------------------------------------------
Ibcustomdataset::TIBUpdateAction __fastcall TUpdateErrorForm::HandleError
	(Data::Db::TDataSet* DataSet, Data::Db::EDatabaseError* E,
	Data::Db::TUpdateKind UpdateKind) {
	const System::UnicodeString UpdateKindStr[3] = {
		"Modified", "Inserted", "Deleted"};
	// Put the error context information into the labels on the form
	UpdateType->Caption = UpdateKindStr[UpdateKind];
	ErrorText->Caption = E->Message;
	// Fill the string grid with the update field values
	GetFieldValues(DataSet);
	ShowModal();
	switch (ModalResult) {
	case mrRetry:
		// If user wants to retry, then put any changed values from the
		// string grid back into the associated field's NewValue property }
		SetFieldValues(DataSet);
		return Ibcustomdataset::uaRetry;
		break;
	case mrIgnore:
		return Ibcustomdataset::uaSkip;
		break;
	default:
		return Ibcustomdataset::uaAbort;
	}
}
Example #6
0
void TEditDataForm::Go(int BlockNo, int Mx, int My)
{
        AnsiString text;

        if (CharSet->ItemIndex == -1) CharSet->ItemIndex=1;

        Top = My - Height/2;
        Left = Mx - Width/2;
        if (Top<0) Top=0;
        if (Left<0) Left=0;
        if (Left+Width > Screen->Width) Left = Screen->Width - Width;
        if (Top+Height > Screen->Height) Top = Screen->Height - Height;

        Block=BlockNo;
        DecodeData(Block);
        ActiveControl= OK;
        ShowModal();

        /*
        TZXFile.Tape[BlockNo].Pause = Pause->Text.ToInt();
        TZXFile.Tape[BlockNo].Head.General.FinalBits = UsedBits->Text.ToInt();

        TZXFile.Tape[BlockNo].Head.General.Flags = LevelHigh->Checked;

        TZXFile.Tape[BlockNo].Head.General.PilotLen = PPL->Text.ToInt();
        TZXFile.Tape[BlockNo].Head.General.PilotPulses = NoPP->Text.ToInt();
        */
}
Example #7
0
	bool Run(wxWindow* parent, const wxString& m_local_dir, int count_files, int count_dirs)
	{
		if (!Load(parent, _T("ID_SEARCH_DOWNLOAD")))
			return false;

		wxString desc;
		if (!count_dirs)
			desc.Printf(wxPLURAL("Selected %d file for transfer.", "Selected %d files for transfer.", count_files), count_files);
		else if (!count_files)
			desc.Printf(wxPLURAL("Selected %d directory with its contents for transfer.", "Selected %d directories with their contents for transfer.", count_dirs), count_dirs);
		else
		{
			wxString files = wxString::Format(wxPLURAL("%d file", "%d files", count_files), count_files);
			wxString dirs = wxString::Format(wxPLURAL("%d directory with its contents", "%d directories with their contents", count_dirs), count_dirs);
			desc.Printf(_("Selected %s and %s for transfer."), files.c_str(), dirs.c_str());
		}
		XRCCTRL(*this, "ID_DESC", wxStaticText)->SetLabel(desc);

		XRCCTRL(*this, "ID_LOCALPATH", wxTextCtrl)->ChangeValue(m_local_dir);

		if (ShowModal() != wxID_OK)
			return false;

		return true;
	}
Example #8
0
  void __fastcall TSuperGroups::OpenForm()
{
	UWord i;
	for (i = 0; i < MAXLOADEDSUPERGROUPS;i++)
		MissionEditor->tmploadedsupergroup[i] = MissionEditor->loadedsupergroup[i];

	SuperGroupGrid->Rows[0]->SetText("Name\nCurrent\nViewable\nMovable\nDeletable\nNew\nChanged");

	Refresh();

	int result = ShowModal();
	switch (result)
	{
		case	mrOk:
		  {

				break;
		  }
		case	mrCancel:
		  {
				for (i = 0; i < MAXLOADEDSUPERGROUPS;i++)
					MissionEditor->loadedsupergroup[i] = MissionEditor->tmploadedsupergroup[i];
				 break;
		  }
	  }

}
Example #9
0
//---------------------------------------------------------------------
// 検索と置き換えの実行
int __fastcall TValRepDlg::Execute(double &nd, double &od)
{
	double od1, od2;
	double nd1, nd2;

	int f = FALSE;
	RepSel->Enabled = FALSE;
	InvSel->Enabled = FALSE;
	EditOld->Text = StrDbl(od);
	EditNew->Text = StrDbl(od);
	Calc(od1, AnsiString(EditOld->Text).c_str());
	Calc(nd1, AnsiString(EditNew->Text).c_str());
	if( ShowModal() == IDOK ){
		Calc(od2, AnsiString(EditOld->Text).c_str());
		Calc(nd2, AnsiString(EditNew->Text).c_str());
		if( od1 != od2 ){
			od = od2;
		}
		if( nd1 != nd2 ){
			nd = nd2;
		}
		if( od != nd ) f = TRUE;
	}
	return f;
}
Example #10
0
job_log_dialog::job_log_dialog(wxWindow *parent,
                               wxString &log)
  : wxDialog(parent, -1, Z("Job output"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
  , text(log)
  , m_geometry_saver{this, "job_log_dialog"}
{
  wxBoxSizer *siz_all = new wxBoxSizer(wxVERTICAL);
  siz_all->Add(new wxStaticText(this, -1, Z("Output of the selected jobs:")), 0, wxALIGN_LEFT | wxLEFT | wxTOP, 10);
  siz_all->AddSpacer(5);
  siz_all->Add(new wxTextCtrl(this, -1, log, wxDefaultPosition, wxSize(550, 150), wxTE_MULTILINE | wxTE_READONLY), 1, wxGROW | wxLEFT | wxRIGHT, 10);

  wxBoxSizer *siz_buttons = new wxBoxSizer(wxHORIZONTAL);
  wxButton *b_ok          = new wxButton(this, wxID_OK, Z("&Ok"));
  b_ok->SetDefault();
  siz_buttons->Add(1,    0, 1, wxGROW, 0);
  siz_buttons->Add(b_ok, 0, 0, 0);
  siz_buttons->Add(1,    0, 1, wxGROW, 0);
  siz_buttons->Add(new wxButton(this, ID_JOBS_B_SAVE_LOG, Z("&Save")), 0, 0, 0);
  siz_buttons->Add(1, 0, 1, wxGROW, 0);
  siz_all->Add(siz_buttons, 0, wxGROW | wxTOP | wxBOTTOM, 10);
  siz_all->SetSizeHints(this);
  SetSizerAndFit(siz_all);

  m_geometry_saver.set_default_size(900, 500, true).restore();

  ShowModal();
}
Example #11
0
//---------------------------------------------------------------------------
void __fastcall TMissionTextDlg::OpenForm()
{
	MissionDescriptionText->Lines->SetText("disabled feature");
//		MissionEditor->ActiveCampaign.mission[MissionEditor->currmission].missiontext);
//	MissionNewsText->Lines->SetText("disabled this feature too");
//		MissionEditor->ActiveCampaign.mission[MissionEditor->currmission].newstext);

//camp	if (MissionEditor->MissionMode)
		NewsTextSheet->Enabled = false;
//	else
//		NewsTextSheet->Enabled = true;

	int result = ShowModal();
	switch (result)
	{
		case	mrOk:
		  {
			MissionEditor->loadedbfs[MissionEditor->bfieldbeingfilled].changed=true;
//			MissionEditor->MissionEdited=true;
//			strcpy(MissionEditor->ActiveCampaign.mission[MissionEditor->currmission].missiontext,
  //					MissionTextDlg->MissionDescriptionText->Lines->GetText());
//			strcpy(MissionEditor->ActiveCampaign.mission[MissionEditor->currmission].newstext,
  //					MissionTextDlg->MissionNewsText->Lines->GetText());
			if (MissionEditor->currmission == 0)
//			strcpy(MissionEditor->ActiveCampaign.firstmission,
  //					MissionTextDlg->MissionDescriptionText->Lines->GetText());

				break;
		  }
		case	mrCancel:
		  {
				 break;
		  }
	  }
}
Example #12
0
//---------------------------------------------------------------------------
bool __fastcall TRemoteTransferDialog::Execute(void *& Session, UnicodeString & Target,
  UnicodeString & FileMask, bool & DirectCopy)
{
  FCurrentSession = -1;
  for (int Index = 0; Index < SessionCombo->Items->Count; Index++)
  {
    if (SessionCombo->Items->Objects[Index] == Session)
    {
      FCurrentSession = Index;
      SessionCombo->ItemIndex = Index;
      break;
    }
  }
  assert(FCurrentSession >= 0);
  DirectoryEdit->Items = CustomWinConfiguration->History[L"RemoteTarget"];
  DirectoryEdit->Text = UnixIncludeTrailingBackslash(Target) + FileMask;
  FDirectCopy = DirectCopy;
  NotDirectCopyCheck->Checked = !DirectCopy;
  bool Result = (ShowModal() == DefaultResult(this));
  if (Result)
  {
    Session = SessionCombo->Items->Objects[SessionCombo->ItemIndex];
    CustomWinConfiguration->History[L"RemoteTarget"] = DirectoryEdit->Items;
    Target = UnixExtractFilePath(DirectoryEdit->Text);
    FileMask = UnixExtractFileName(DirectoryEdit->Text);
    DirectCopy = !NotDirectCopyCheck->Checked;
  }
  return Result;
}
Example #13
0
//---------------------------------------------------------------------------
bool __fastcall TCustomCommandDialog::Execute(TCustomCommandType & Command)
{
  CommandEdit->Items = CustomWinConfiguration->History[L"CustomCommand"];
  if (CommandEdit->Items->Count == 0)
  {
    for (int i = 0; i < FCustomCommandList->Count; i++)
    {
      CommandEdit->Items->Add(FCustomCommandList->Commands[i]->Name);
    }
  }

  DescriptionEdit->Text = Command.Name;
  FOrigDescription = Command.Name;
  CommandEdit->Text = Command.Command;
  SetParams(Command.Params);
  if (FMode != ccmAdHoc)
  {
    SetShortCutCombo(ShortCutCombo, Command.ShortCut);
  }

  bool Result = (ShowModal() == DefaultResult(this));
  if (Result)
  {
    GetCommand(Command);

    CommandEdit->SaveToHistory();
    CustomWinConfiguration->History[L"CustomCommand"] = CommandEdit->Items;
  }
  return Result;
}
Example #14
0
void mxLongTextEditor::CreateCommonStuff(wxString value) {
	
	last_dir=config->Files.last_dir;
	
	wxBoxSizer *mid_sizer = new wxBoxSizer(wxVERTICAL);
	wxBoxSizer *bottom_sizer = new wxBoxSizer(wxHORIZONTAL);
	
	my_text = new wxTextCtrl(this,wxID_ANY,value,wxDefaultPosition,wxDefaultSize,wxTE_MULTILINE);
	mid_sizer->Add(my_text,sizers->BA5_Exp1);
	wxButton *button_ok = new mxBitmapButton(this,wxID_OK,bitmaps->buttons.ok,LANG(GENERAL_OK_BUTTON,"&Aceptar"));
	wxButton *button_cancel = new mxBitmapButton(this,wxID_CANCEL,bitmaps->buttons.cancel,LANG(GENERAL_CANCEL_BUTTON,"&Cancelar"));
	wxButton *button_more = new wxButton(this,mxID_ARGS_BUTTON,LANG(LONGTEXT_MORE_OPTIONS,"Mas opciones..."));
	wxBitmapButton *button_help = new wxBitmapButton (this,mxID_HELP_BUTTON,*bitmaps->buttons.help);
	bottom_sizer->Add(button_help,sizers->BA5_Exp0);
	bottom_sizer->AddStretchSpacer();
	bottom_sizer->Add(button_more,sizers->BA5);
	bottom_sizer->AddStretchSpacer();
	bottom_sizer->Add(button_cancel,sizers->BA5);
	bottom_sizer->Add(button_ok,sizers->BA5);
	mid_sizer->Add(bottom_sizer,sizers->Exp0);
	
	button_ok->SetDefault(); 
	my_text->SetSelection(0,my_text->GetLastPosition());
	my_text->SetFocus();
	
	SetSizer(mid_sizer);
	ShowModal();
	
}
Example #15
0
//---------------------------------------------------------------------
int __fastcall TColorSetDlg::Execute(TColor *pcol)
{
	int i, x, f;
	int n = 0;
	int pos = -1;
	for( i = 0; i < 8; i++ ){
		f = 0;
		for( x = 0; x < 4; x++, n++ ){
			GetItem(i, x)->Color = sys.m_ColorSet[n];
			if( pcol[x] != sys.m_ColorSet[n] ) f++;
		}
		if( !f ){
			pos = i;
		}
	}
	RGSet->ItemIndex = pos;
	if( ShowModal() == IDOK ){
		n = 0;
		for( i = 0; i < 8; i++ ){
			for( x = 0; x < 4; x++, n++ ){
				sys.m_ColorSet[n] = GetItem(i, x)->Color;
			}
		}
		if( RGSet->ItemIndex >= 0 ){
			for( x = 0; x < 4; x++ ){
				pcol[x] = GetItem(RGSet->ItemIndex, x)->Color;
			}
			return TRUE;
		}
	}
	return FALSE;
}
Example #16
0
//---------------------------------------------------------------------------
bool __fastcall TCopyDialog::Execute()
{
  // at start assume that copy param is current preset
  FPreset = GUIConfiguration->CopyParamCurrent;
  DirectoryEdit->Items = CustomWinConfiguration->History[
    FToRemote ? L"RemoteTarget" : L"LocalTarget"];
  bool Result = (ShowModal() == DefaultResult(this));
  if (Result)
  {
    Configuration->BeginUpdate();
    try
    {
      if (FLAGSET(OutputOptions, cooSaveSettings) &&
          FLAGCLEAR(FOptions, coDisableSaveSettings))
      {
        GUIConfiguration->DefaultCopyParam = Params;
      }
      DirectoryEdit->SaveToHistory();
      CustomWinConfiguration->History[FToRemote ?
        L"RemoteTarget" : L"LocalTarget"] = DirectoryEdit->Items;
    }
    __finally
    {
      Configuration->EndUpdate();
    }
  }
  return Result;
}
Example #17
0
int __fastcall TQSODlgBox::ShowFind(CLogFind *fp)
{
	m_fp = fp;
	if( fp->GetCount() ){
		Log.GetData(&m_sd, fp->pFindTbl[0]);
		m_CurNo = fp->pFindTbl[0];
	}
	else {
		memset(&m_sd, 0, sizeof(SDMMLOG));
		OKBtn->Enabled = FALSE;
	}
	SetCountry();
	char bf[512];
	UpdateTextData(&m_sd, fp->pFindTbl[0]);
	Grid->RowCount = fp->GetCount() ? fp->GetCount() + 1 : 2;
	Grid->TopRow = 1;
	Grid->Row = 1;
	sprintf(bf, "[%s]", fp->GetText());
	strcat(bf, m_Country.c_str());
	Caption = bf;
	UpdateStat();
	m_EditFlag = 0;
	UpdateBtn();
	if( ShowModal() == IDOK ){
		if( m_EditFlag ){
			UpdateCurData(&m_sd);
			Log.PutData(&m_sd, m_CurNo);
		}
		return TRUE;
	}
	else {
		return FALSE;
	}
}
Example #18
0
bool UIStartupDialog::Show()
{
	if (!ShowModal("Umodel Startup Options", 360, 200))
		return false;

	// process some options

	// GameOverride
	Opt.GameOverride = GAME_UNKNOWN;
	if (OverrideGameGroup->IsChecked() && (OverrideGameCombo->GetSelectionIndex() >= 0))
	{
		const char* gameName = OverrideGameCombo->GetSelectionText();
		for (int i = 0; /* empty */; i++)
		{
			const GameInfo &info = GListOfGames[i];
			if (!info.Name) break;
			if (!strcmp(info.Name, gameName))
			{
				Opt.GameOverride = info.Enum;
				break;
			}
		}
	}

	return true;
}
Example #19
0
void CSearchDialog::Run()
{
	m_original_dir = m_pState->GetRemotePath();
	m_local_target = m_pState->GetLocalDir();

	m_pState->BlockHandlers(STATECHANGE_REMOTE_DIR);
	m_pState->BlockHandlers(STATECHANGE_REMOTE_DIR_MODIFIED);
	m_pState->RegisterHandler(this, STATECHANGE_REMOTE_DIR, false);
	m_pState->RegisterHandler(this, STATECHANGE_REMOTE_IDLE, false);

	ShowModal();

	SaveConditions();

	m_pState->UnregisterHandler(this, STATECHANGE_REMOTE_IDLE);
	m_pState->UnregisterHandler(this, STATECHANGE_REMOTE_DIR);
	m_pState->UnblockHandlers(STATECHANGE_REMOTE_DIR);
	m_pState->UnblockHandlers(STATECHANGE_REMOTE_DIR_MODIFIED);

	if (m_searching)
	{
		if (!m_pState->IsRemoteIdle())
		{
			m_pState->m_pCommandQueue->Cancel();
			m_pState->GetRecursiveOperationHandler()->StopRecursiveOperation();
		}
		if (!m_original_dir.IsEmpty())
			m_pState->ChangeRemoteDir(m_original_dir);
	}
	else
	{
		if (m_pState->IsRemoteIdle() && !m_original_dir.IsEmpty())
			m_pState->ChangeRemoteDir(m_original_dir);
	}
}
//---------------------------------------------------------
bool CVariogram_Dialog::Execute(CSG_Shapes *pPoints, int Attribute, bool bLog, CSG_Table *pVariogram, CSG_Trend *pModel)
{
	if( m_pPoints != pPoints || m_nPoints != pPoints->Get_Count() || !m_Extent.is_Equal(pPoints->Get_Extent()) )
	{
		m_pPoints	= pPoints;
		m_nPoints	= pPoints->Get_Count();
		m_Extent	= pPoints->Get_Extent();
		m_Distance	= -1;

		int	nSkip	= 1 + m_pPoints->Get_Count() / 10000;

		m_Settings("SKIP"   )->Set_Value(nSkip);
		m_Settings("LAGDIST")->Set_Value(CSG_Variogram::Get_Lag_Distance(m_pPoints, 0, nSkip));
		m_Settings("MAXDIST")->Set_Value(0.5 * sqrt(SG_Get_Square(m_pPoints->Get_Extent().Get_XRange()) + SG_Get_Square(m_pPoints->Get_Extent().Get_YRange())));
	}

	m_Attribute		= Attribute;
	m_bLog			= bLog;
	m_pVariogram	= pVariogram;
	m_pModel		= pModel;

	m_pDiagram->Initialize(m_pModel, m_pVariogram);

	//-----------------------------------------------------
	Set_Variogram();

	return( ShowModal() == wxID_OK && m_pModel && m_pModel->is_Okay() );
}
Example #21
0
//---------------------------------------------------------------------------
//Вставляем репортаж
int TfrmSubjectIns::Insert(int BranchID, AnsiString BranchName)
{
	tblSubject->Open();
	tblSubject->Insert();
//	tblSubjectType->Open();
//	tblSubject->FieldByName("ID")->Value = frmDataModule->LastID("Subjectes")+1;
	tblSubject->FieldByName("Name")->Value = "Новый сюжет";
	tblSubject->FieldByName("Branche_ID")->Value = BranchID;
	tblSubject->FieldByName("SubjectType_ID")->Value = 10;
//		=	tblSubjectType->FieldByName("ID")->AsInteger;
	tblSubject->FieldByName("DateSubject")->Value
		=	TDateTime::CurrentDate();
	tblSubject->Post();
	SubjectID = tblSubject->FieldByName("ID")->Value;

	this->BranchID = BranchID;
	this->BranchName = BranchName;
	lblBranchName->Caption = BranchName;

	if(ShowModal() == mrOk)
		return SubjectID;
	else {
		return -1;
	}
};
Example #22
0
bool __fastcall TfrmSignsReports::Execute(TRoadFrm *frm)
{
FRoadFrm=frm;
ExistSourceList->Items->Clear();
DesignSourceList->Items->Clear();
for (int i=0;i<MainForm->ResManager->DataCount;i++)
    {
    TDtaSource *Dta=MainForm->ResManager->Data[i];
    if (Dta)
        if (Dta->Id==FRoadFrm->RoadId)
            {
            ExistSourceList->Items->AddObject(Dta->SourceName,Dta);
            DesignSourceList->Items->AddObject(Dta->SourceName,Dta);
            txtRoadDistr->Text=DBDataModule->GetDistrName(FRoadFrm->RoadId);
            String S=DBDataModule->GetInspectName(FRoadFrm->RoadId).Trim();
            int n=S.Pos(" ");
            if (n)
                txtDepDistr->Text=S.SubString(1,n-1);
            else
                txtDepDistr->Text=S;       
            txtDepCheef->Text=MainForm->CheefList->Values[txtDepDistr->Text];
            }
    }
SetComboListItem(ExistSourceList,FRoadFrm->MetricData);
SetComboListItem(DesignSourceList,FRoadFrm->EditedData);
TestEnabled();
return ShowModal()==mrOk;
}
Example #23
0
//---------------------------------------------------------------------
bool __fastcall TPropertiesDialog::Execute(TRemoteProperties & Properties)
{
  SetFileProperties(Properties);

  PageControl->ActivePage = CommonSheet;
  if (FAllowedChanges & cpGroup) ActiveControl = GroupComboBox;
    else
  if (FAllowedChanges & cpOwner) ActiveControl = OwnerComboBox;
    else
  if (FAllowedChanges & cpMode) ActiveControl = RightsFrame;
    else ActiveControl = CancelButton;

  ChecksumAlgEdit->Text = GUIConfiguration->ChecksumAlg;
  ResetChecksum();

  UpdateControls();

  bool Result = (ShowModal() == DefaultResult(this));

  if (Result)
  {
    Properties = GetFileProperties();
  }

  GUIConfiguration->ChecksumAlg = ChecksumAlgEdit->Text;

  return Result;
}
Example #24
0
//---------------------------------------------------------------------------
void	__fastcall TPaintScheme::OpenForm(MEPilotType&	pilot)
{

    OverallSpinEdit->Text =IntToStr(pilot.imagemaps.topwing);
    TopWingSpinEdit->Text = IntToStr(pilot.imagemaps.topwing);
    TailSpinEdit->Text = IntToStr(pilot.imagemaps.tail);
    BottomWingSpinEdit->Text = IntToStr(pilot.imagemaps.btmwing);
    FuselageSpinEdit->Text = IntToStr(pilot.imagemaps.fuselage);
    DetailSpinEdit->Text = IntToStr(pilot.imagemaps.other);
    EmblemSpinEdit->Text = IntToStr(pilot.imagemaps.emblem);

    int result = ShowModal();
    switch (result)
    {
    case	mrOk:
    {
        pilot.imagemaps.topwing = TopWingSpinEdit->Value;
        pilot.imagemaps.tail 	= TailSpinEdit->Value;
        pilot.imagemaps.btmwing = BottomWingSpinEdit->Value;
        pilot.imagemaps.fuselage= FuselageSpinEdit->Value;
        pilot.imagemaps.other  	= DetailSpinEdit->Value;
        pilot.imagemaps.emblem 	= EmblemSpinEdit->Value;

    }
    }
}
bool CConditionalDialog::Run()
{
	wxString dialogs = COptions::Get()->GetOption(OPTION_ONETIME_DIALOGS);
	if (dialogs.Len() > (unsigned int)m_type && dialogs[m_type] == '1')
		return true;

	Fit();
	wxGetApp().GetWrapEngine()->WrapRecursive(this, 3);

	CenterOnParent();

	int id = ShowModal();

	auto cb = dynamic_cast<wxCheckBox*>(FindWindow(wxID_HIGHEST + 1));
	if (cb && cb->GetValue()) {
		while (dialogs.Len() <= (unsigned int)m_type)
			dialogs += _T("0");
		dialogs[m_type] = '1';
		COptions::Get()->SetOption(OPTION_ONETIME_DIALOGS, dialogs.ToStdWstring());
	}

	if (id == wxID_OK || id == wxID_YES)
		return true;

	return false;
}
void mxEnumerationEditor::CreateCommonStuff(const wxArrayString &array) {
	
	wxBoxSizer *mid_sizer = new wxBoxSizer(wxHORIZONTAL);
	wxBoxSizer *bottom_sizer = new wxBoxSizer(wxHORIZONTAL);
	wxBoxSizer *right_sizer = new wxBoxSizer(wxVERTICAL);
	wxBoxSizer *main_sizer = new wxBoxSizer(wxVERTICAL);
	
	m_list = new wxListBox(this,wxID_ANY);
	mid_sizer->Add(m_list,sizers->BA5_Exp1);
	wxButton *button_up = new wxButton(this,mxID_ENUMED_UP,LANG(ENUMEDITOR_MOVE_UP,"Mover Arriba"));
	wxButton *button_down = new wxButton(this,mxID_ENUMED_DOWN,LANG(ENUMEDITOR_MOVE_DOWN,"Mover Abajo"));
	wxButton *button_edit = new wxButton(this,mxID_ENUMED_EDIT,LANG(ENUMEDITOR_EDIT,"Editar..."));
	wxButton *button_add = new wxButton(this,mxID_ENUMED_ADD,LANG(ENUMEDITOR_ADD,"Agregar..."));
	wxButton *button_delete = new wxButton(this,mxID_ENUMED_DELETE,LANG(ENUMEDITOR_REMOVE,"Quitar"));
	
	wxButton *button_ok = new mxBitmapButton(this,wxID_OK,bitmaps->buttons.ok,LANG(GENERAL_OK_BUTTON,"&Aceptar"));
	wxButton *button_cancel = new mxBitmapButton(this,wxID_CANCEL,bitmaps->buttons.cancel,LANG(GENERAL_CANCEL_BUTTON,"&Cancelar"));
	right_sizer->Add(button_up,sizers->BA5_Exp0);
	right_sizer->Add(button_down,sizers->BA5_Exp0);
	right_sizer->Add(button_edit,sizers->BA5_Exp0);
	right_sizer->Add(button_add,sizers->BA5_Exp0);
	right_sizer->Add(button_delete,sizers->BA5_Exp0);
	mid_sizer->Add(right_sizer,sizers->Exp0_Right);
	bottom_sizer->Add(button_cancel,sizers->BA5_Exp0);
	bottom_sizer->Add(button_ok,sizers->BA5_Exp0);
	main_sizer->Add(mid_sizer,sizers->Exp1);
	main_sizer->Add(bottom_sizer,sizers->Center);
	
	m_list->InsertItems(array,0);
	m_list->SetFocus();
	SetSizer(main_sizer);
	ShowModal();
}
Example #27
0
ChooseSemaphore::ChooseSemaphore(wxWindow *parent, JMLib *j, PatternLoader *s)
	: wxDialog(parent, -1, _T("Show Semaphore"),
			wxDefaultPosition, wxDefaultSize,
			wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER) {

  jmlib = j;
  semaphores = s;

  newsemaphore = new wxTextCtrl(this,-1,wxString(jmlib->getStyle(),wxConvUTF8),wxDefaultPosition,wxDefaultSize);

  wxButton *ok = new wxButton(this, wxID_OK, _T("OK"));
  wxButton *apply = new wxButton(this, wxID_APPLY,_T("Apply"));
  wxButton *cancel = new wxButton(this, wxID_CANCEL, _T("Cancel"));
  wxBoxSizer *buttonsizer = new wxBoxSizer(wxHORIZONTAL);
  buttonsizer->Add(ok, 1, wxALIGN_CENTRE|wxALL, 5);
  buttonsizer->Add(apply, 1, wxALIGN_CENTRE|wxALL, 5);
  buttonsizer->Add(cancel, 1, wxALIGN_CENTRE|wxALL, 5);

  wxBoxSizer *toplevel = new wxBoxSizer(wxVERTICAL);
  toplevel->Add(newsemaphore,0,wxALIGN_CENTER|wxEXPAND|wxALL,5);
  toplevel->Add(buttonsizer,0,wxALIGN_CENTER|wxEXPAND|wxALL,5);

  toplevel->Fit( this );
  toplevel->SetSizeHints( this );

  SetSizer(toplevel);
  SetAutoLayout(TRUE);
  // SetSize(-1,parent->GetSize().y - 30);
  Layout();
  CentreOnParent();
  ShowModal();
}
Example #28
0
//---------------------------------------------------------------------------
void __fastcall TGenerateUrlDialog::Execute()
{
  int Components = WinConfiguration->GenerateUrlComponents;
  if (Components < 0)
  {
    Components = UserNameCheck->Tag | RemoteDirectoryCheck->Tag;
  }

  for (int Index = 0; Index < OptionsGroup->ControlCount; Index++)
  {
    TCheckBox * CheckBox = dynamic_cast<TCheckBox *>(OptionsGroup->Controls[Index]);

    if (ALWAYS_TRUE((CheckBox != NULL) && (CheckBox->Tag != 0)))
    {
      CheckBox->Checked = FLAGSET(Components, CheckBox->Tag);
    }
  }

  UpdateControls();

  ShowModal();

  Components = 0;
  for (int Index = 0; Index < OptionsGroup->ControlCount; Index++)
  {
    TCheckBox * CheckBox = dynamic_cast<TCheckBox *>(OptionsGroup->Controls[Index]);

    if (ALWAYS_TRUE((CheckBox != NULL) && (CheckBox->Tag != 0)) &&
        CheckBox->Checked)
    {
      Components |= CheckBox->Tag;
    }
  }
  WinConfiguration->GenerateUrlComponents = Components;
}
Example #29
0
mxListSharedWindow::mxListSharedWindow(wxWindow* parent, wxWindowID id, const wxPoint& pos , const wxSize& size , long style) : wxDialog(parent, id, LANG(LISTSHARED_CAPTION,"Lista de Archivos Compartidos"), pos, size, style) {
	
	wxBoxSizer *mySizer = new wxBoxSizer(wxVERTICAL);
	wxBoxSizer *bottomSizer= new wxBoxSizer(wxHORIZONTAL);
	
	mySizer->Add(new wxStaticText(this, wxID_ANY, LANG(LISTSHARED_LIST_LABEL,"Lista de fuentes compartidos: "), wxDefaultPosition, wxDefaultSize, 0), sizers->BLRT5);
	
	wxArrayString array;
	if (!share) share = new ShareManager();
	share->GetSharedList(array);
	list = new wxListBox(this,wxID_ANY,wxDefaultPosition, wxSize(150,150),array);
	
	mySizer->Add(list,sizers->BA5_Exp1);
	
	wxBitmapButton *help_button = new wxBitmapButton (this,mxID_HELP_BUTTON,*bitmaps->buttons.help);
	wxButton *unshare_button = new mxBitmapButton (this, wxID_CANCEL, bitmaps->buttons.cancel, LANG(LISTSHARED_REMOVE,"&Quitar de la lista")); 
	wxButton *close_button = new mxBitmapButton (this, wxID_OK, bitmaps->buttons.ok, LANG(GENERAL_CLOSE_BUTTON,"&Cerrar"));
	
	bottomSizer->Add(help_button,sizers->BA5_Exp0);
	bottomSizer->AddStretchSpacer();
	bottomSizer->Add(unshare_button,sizers->BA5);
	bottomSizer->Add(close_button,sizers->BA5);
	
	mySizer->Add(bottomSizer,sizers->BA5_Exp0);
	SetSizerAndFit(mySizer);
	
	ShowModal();
	list->SetFocus();
	
}
Example #30
0
//---------------------------------------------------------------------------
bool __fastcall TCreateDirectoryDialog::Execute(UnicodeString & Directory,
  TRemoteProperties * Properties, bool & SaveSettings)
{
  DirectoryEdit->Text = Directory;
  SaveSettingsCheck->Checked = SaveSettings;
  if (Properties != NULL)
  {
    bool SetRights = Properties->Valid.Contains(vpRights);
    SetRightsCheck->Checked = SetRights;
    // expect sensible value even if rights are not set valid
    RightsFrame->Rights = Properties->Rights;
  }

  bool Result = (ShowModal() == DefaultResult(this));
  if (Result)
  {
    Directory = DirectoryEdit->Text;
    SaveSettings = SaveSettingsCheck->Checked;
    if (Properties != NULL)
    {
      if (SetRightsCheck->Checked)
      {
        Properties->Valid = Properties->Valid << vpRights;
        Properties->Rights = RightsFrame->Rights;
      }
      else
      {
        Properties->Valid = Properties->Valid >> vpRights;
      }
    }
  }
  return Result;
}