//--------------------------------------------------------------------------- // ファイルのロードメニュー void __fastcall TResCmpDlg::LoadBtnClick(TObject *Sender) { if( Cnt >= RESMAX ) return; OpenDialog->Title = "計算結果を選択"; OpenDialog->Filter = "MMANA 計算結果(*.mab)|*.mab|"; OpenDialog->FileName = ""; OpenDialog->DefaultExt = "mab"; OpenDialog->InitialDir = ResDir; if( OpenDialog->Execute() == TRUE ){ for( int i = 0; i < Cnt; i++ ){ if( !strcmp(Fname[i].c_str(), AnsiString(OpenDialog->FileName).c_str()) ){ return; } } Fname[Cnt] = OpenDialog->FileName; if( LoadResFile(AnsiString(OpenDialog->FileName).c_str()) == TRUE ){ CalcMaxDB(); Grid->RowCount = Cnt + 1; UpdateUIAll(); SetDirName(ResDir, AnsiString(OpenDialog->FileName).c_str()); Grid->Invalidate(); PBox->Invalidate(); } } }
//--------------------------------------------------------------------------- int __fastcall TFileViewDlg::NewFolder(void) { int r = FALSE; TOpenDialog *pDialog = Mmsstv->OpenDialog; pDialog->Options >> ofCreatePrompt; pDialog->Options >> ofFileMustExist; if( MsgEng ){ pDialog->Title = "Set folder"; } else { pDialog->Title = "フォルダの選択"; } char bf[512]; sprintf(bf, "%s|%s|%s|%s", GetPicFilter(), GetTempFilter(), GetLibFilter(), "OLE objects(*.*)|*.*"); pDialog->Filter = bf; pDialog->FileName = "Dummy"; pDialog->DefaultExt = "jpg"; pDialog->InitialDir = pCurPage->m_Folder.c_str(); pDialog->FilterIndex = pCurPage->m_Type + 1; SetDisPaint(); NormalWindow(Mmsstv); if( Mmsstv->OpenDialogExecute(TRUE) == TRUE ){ SetDirName(bf, AnsiString(pDialog->FileName).c_str()); //ja7ude 0428 pCurPage->m_Folder = bf; char drive[_MAX_DRIVE]; char dir[_MAX_DIR]; char name[_MAX_FNAME]; char ext[_MAX_EXT]; AnsiString Name; ::_splitpath( AnsiString(pDialog->FileName).c_str(), drive, dir, name, ext ); m_Name = name; m_Name += ext; #if 1 pCurPage->m_Type = pDialog->FilterIndex - 1; #else LPCSTR pExt = GetEXT(m_Name.c_str()); if( !strcmpi(pExt, "MTI") ){ pCurPage->m_Type = 2; } else if( !strcmpi(pExt, "MTM") ){ pCurPage->m_Type = 1; } else if( !strcmpi(pExt, "DLL") ){ pCurPage->m_Type = 3; } else if( IsPic(pExt) ){ pCurPage->m_Type = 0; } else { pCurPage->m_Type = 4; } #endif r = TRUE; } ResDisPaint(); TopWindow(Mmsstv); return r; }
//--------------------------------------------------------------------------- void __fastcall TColorBarDlg::BitBtnClick(TObject *Sender) { TOpenDialog *pDialog = Mmsstv->OpenDialog; pDialog->Options >> ofCreatePrompt; pDialog->Options << ofFileMustExist; if( MsgEng ){ pDialog->Title = "Load picture from file"; } else { pDialog->Title = "画像のロード"; } pDialog->Filter = GetPicFilter(); pDialog->FileName = ""; pDialog->DefaultExt = "jpg"; pDialog->InitialDir = BitmapDir; SetDisPaint(); NormalWindow(this); if( Mmsstv->OpenDialogExecute(TRUE) == TRUE ){ SetDirName(BitmapDir, AnsiString(pDialog->FileName).c_str()); //ja7ude 0428 TPicRectDlg *pBox = new TPicRectDlg(this); if( ::LoadImage(pBox->pBitmap, AnsiString(pDialog->FileName).c_str()) == TRUE ){ //ja7ude 0428 Graphics::TBitmap *pBmp = new Graphics::TBitmap(); AdjustBitmapFormat(pBmp); pBmp->Width = pBox->pBitmap->Width < 320 ? pBox->pBitmap->Width : 320; int H = 16; int d; if( sscanf(AnsiString(LineCnt->Text).c_str(), "%u", &d) == 1 ){ //ja7ude 0428 if( (d >= 1) && (d <= 256) ){ H = d; } } pBmp->Height = pBox->pBitmap->Height < H ? pBox->pBitmap->Height : H; if( pBox->Execute(pBmp) == TRUE ){ if( pBitmap == NULL ){ pBitmap = new Graphics::TBitmap(); } AdjustBitmapFormat(pBitmap); pBitmap->Width = 320; pBitmap->Height = H; int x, y; for( y = 0; y < pBitmap->Height; y += pBmp->Height){ for( x = 0; x < pBitmap->Width; x += pBmp->Width){ pBitmap->Canvas->Draw(x, y, pBmp); } } } delete pBmp; } delete pBox; } ResDisPaint(); TopWindow(this); }
NS_IMETHODIMP nsAbDirProperty::CopyMailList(nsIAbDirectory* srcList) { SetIsMailList(true); nsString str; srcList->GetDirName(str); SetDirName(str); srcList->GetListNickName(str); SetListNickName(str); srcList->GetDescription(str); SetDescription(str); nsCOMPtr<nsIMutableArray> pAddressLists; srcList->GetAddressLists(getter_AddRefs(pAddressLists)); SetAddressLists(pAddressLists); return NS_OK; }
//--------------------------------------------------------------------------- void __fastcall TRADIOSetDlg::RefBtnClick(TObject *Sender) { TOpenDialog *pBox = new TOpenDialog(this); pBox->Options >> ofCreatePrompt; pBox->Options << ofFileMustExist; if( sys.m_MsgEng ){ pBox->Title = "Program file"; pBox->Filter = "Program files(*.exe;*.lnk)|*.exe;*.lnk|"; } else { pBox->Title = "プログラムファイル"; pBox->Filter = "プログラムファイル(*.exe;*.lnk)|*.exe;*.lnk|"; } pBox->FileName = CmdGNR->Text.c_str(); pBox->DefaultExt = "exe"; char bf[256]; SetDirName(bf, AnsiString(CmdGNR->Text).c_str()); //JA7UDE 0428 pBox->InitialDir = bf; if( pBox->Execute() == TRUE ){ CmdGNR->Text = AnsiString(pBox->FileName).c_str(); //JA7UDE 0428 } delete pBox; }
//--------------------------------------------------------------------------- void __fastcall TRADIOSetDlg::RefBtnClick(TObject *Sender) { TOpenDialog *pBox = Mmsstv->OpenDialog; pBox->Options >> ofCreatePrompt; pBox->Options << ofFileMustExist; if( MsgEng ){ pBox->Title = "Program file"; pBox->Filter = "Program files(*.exe;*.lnk)|*.exe;*.lnk|"; } else { pBox->Title = "プログラムファイル"; pBox->Filter = "プログラムファイル(*.exe;*.lnk)|*.exe;*.lnk|"; } pBox->FileName = CmdGNR->Text.c_str(); pBox->DefaultExt = "exe"; char bf[256]; SetDirName(bf, AnsiString(CmdGNR->Text).c_str()); //ja7ude 0428 pBox->InitialDir = bf; NormalWindow(this); if( pBox->Execute() == TRUE ){ CmdGNR->Text = pBox->FileName.c_str(); } TopWindow(this); }