本文整理汇总了C++中TForm::ShowModal方法的典型用法代码示例。如果您正苦于以下问题:C++ TForm::ShowModal方法的具体用法?C++ TForm::ShowModal怎么用?C++ TForm::ShowModal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TForm
的用法示例。
在下文中一共展示了TForm::ShowModal方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TFormS
void __fastcall TGLForm2D::ZoomOutClick(TObject *Sender)
{
int factor;
TForm* x = new TFormS(this,factor);
x->Caption = "Introduce Factor";
x->ShowModal();
int pasos;
TForm* y = new TFormS(this,pasos);
y->Caption = "Introduce nº de pasos";
y->ShowModal();
GLdouble fIncr= (factor-1)/(GLdouble)pasos;
GLdouble ancho = (xRight-xLeft); GLdouble alto =(yTop-yBot);
for(int i=0;i<=pasos;i++){
GLdouble fAux= 1 + fIncr*i;
GLdouble anchoNew= ancho*fAux; GLdouble altoNew= alto*fAux;
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluOrtho2D(centroX-anchoNew/2.0, centroX+anchoNew/2.0,
centroY-altoNew/2.0, centroY+altoNew/2.0);
GLScene();
Sleep(50);
}
nuevoAncho = (xRight-xLeft)*factor;
nuevoAlto = (yTop-yBot)*factor;
yBot = centroY-(nuevoAlto/2.0);
yTop = centroY+(nuevoAlto/2.0);
xRight = centroX+(nuevoAncho/2.0);
xLeft = centroX-(nuevoAncho/2.0);
GLScene();
sc->set(xLeft,xRight,yTop,yBot);
}
示例2: FullViewBClick
//---------------------------------------------------------------------------
void __fastcall TPictureViewer::FullViewBClick(TObject *Sender)
{
TForm* ImageFullView = new TForm(this);
ImageFullView->Color = FBackGroundColor;
TImage* FullImage = new TImage(ImageFullView);
FullImage->Transparent = Image->Transparent;
try {
ImageFullView->BorderStyle = bsToolWindow;
ImageFullView->FormStyle = fsStayOnTop;
ImageFullView->Position = poScreenCenter;
ImageFullView->Caption = GetString(sPicturePreview);
FullImage->Left = 0;
FullImage->Top = 0;
FullImage->AutoSize = true;
FullImage->Picture = Image->Picture;
ImageFullView->ClientWidth = FullImage->Width;
ImageFullView->ClientHeight = FullImage->Height;
FullImage->Parent = ImageFullView;
FullViewB->Enabled = false;
ImageFullView->ShowModal();
FullViewB->Enabled = true;
delete FullImage; FullImage = NULL;
delete ImageFullView; ImageFullView = NULL;
Image->Update();
} catch (Exception &e) {
if (FullImage) delete FullImage;
if (ImageFullView) delete ImageFullView;
FullViewB->Enabled = true;
}
}
示例3: AddButtonClick
//---------------------------------------------------------------------------
void __fastcall TRouteSheet::AddButtonClick(TObject *Sender) //Добавление контрагента
{
//CounterpartyRouteSheet->Show();
TForm *myCounterpartyRouteSheet = new TCounterpartyRouteSheet(this);
myCounterpartyRouteSheet->ShowModal();
delete myCounterpartyRouteSheet;
}
示例4: if
void __fastcall TGLForm2D::FormMouseDown(TObject *Sender,
TMouseButton Button, TShiftState Shift, int X, int Y)
{
GLdouble relacionAncho = (xRight-xLeft)/ClientWidth;
GLdouble relacionAlto = (yTop-yBot)/ClientHeight;
GLdouble cx = xLeft + (GLfloat)X*relacionAncho;
GLdouble cy = yTop - (GLfloat)Y*relacionAlto;
if(Button == mbLeft){
if(!seleccionar){
int tam;
if(sc->getArbol()->empty()){
TForm* x = new TFormS(this,tam);
x->Caption = "Introduce Tamaño";
x->ShowModal();
}
sc->getArbol()->anidar(cx,cy,aleatorio,tam);
}
else if(!sc->getArbol()->empty()){
PVD2* p = new PVD2(cx,cy);
if(sc->getArbol()->selCuadrado(p))
seleccionar = false;
delete p; p = NULL;
}else{
seleccionar = false;
ShowMessage("No hay nada que seleccionar!");
}
GLScene();
}
else{
sc->getArbol()->desanidar();
GLScene();
}
}
示例5: ButtonListadoPartidosClick
void __fastcall TFormClasificacion::ButtonListadoPartidosClick(
TObject *Sender)
{
TForm *x = new TFormListadoPartidos(this,t);
x->ShowModal();
delete x;
MostrarClasificacion();
}
示例6: ButtonBorrarEquipoClick
void __fastcall TFormClasificacion::ButtonBorrarEquipoClick(
TObject *Sender)
{
TForm *x = new TFormBorrarEquipo(this,t);
x->ShowModal();
delete x;
MostrarClasificacion();
}
示例7: ButtonAnyadirPartidoClick
void __fastcall TFormClasificacion::ButtonAnyadirPartidoClick(
TObject *Sender)
{
TForm *x = new TFormAnyadirPartido(this,t);
x->ShowModal();
delete x;
MostrarClasificacion();
}
示例8: TForm
//---------------------------------------------------------------------------
void __fastcall TFrm1010::ShowAppForms()
{
SfgForm *AppForm;
TForm *form = new TForm(Application);
TStringAlignGrid *grdAppForms = new TStringAlignGrid(form);
form->ClientHeight = 154;
form->ClientWidth = 402;
form->BorderStyle = bsDialog;
form->BorderIcons = TBorderIcons() << biSystemMenu;
form->Caption = "Escolher Programa";
form->Position = poDesktopCenter;
grdAppForms->Parent = form;
grdAppForms->ColCount = 4;
grdAppForms->DefaultRowHeight = 18;
grdAppForms->AlignCol[1] = alCenter;
grdAppForms->AlignCell[1][0] = alCenter;
grdAppForms->AlignCell[2][0] = alCenter;
grdAppForms->Cells[1][0] = "Programa";
grdAppForms->Cells[2][0] = "Título";
grdAppForms->Cells[3][0] = "Módulo";
grdAppForms->ColWidths[0] = 14;
grdAppForms->ColWidths[1] = 74;
grdAppForms->ColWidths[2] = 190;
grdAppForms->ColWidths[3] = 100;
grdAppForms->Align = alClient;
grdAppForms->OnDblClick = &grdAppFormsDblClick;
grdAppForms->Options = grdAppForms->Options << goColSizing << goRowSelect;
grdAppForms->RowCount = 2;
for (int i=0; i<AppForms->Count;i++) {
AppForm = (SfgForm*)AppForms->Items[i];
if (i > 0)
grdAppForms->RowCount++;
grdAppForms->Cells[1][i+1] = AppForm->FormClass;
grdAppForms->Cells[2][i+1] = AppForm->FormTitle;
switch(AppForm->FormModule) {
case APP_MODULO_ESTOQUE:
grdAppForms->Cells[3][i+1] = "Estoque";
break;
case APP_MODULO_COMPRAS:
grdAppForms->Cells[3][i+1] = "Compras";
break;
case APP_MODULO_VENDAS:
grdAppForms->Cells[3][i+1] = "Vendas";
break;
case APP_MODULO_FINANCAS:
grdAppForms->Cells[3][i+1] = "Finanças";
break;
default:
grdAppForms->Cells[3][i+1] = "Padrão";
}
}
grdAppForms->SortColumn(1,true);
grdAppForms->Row = 1;
form->ShowModal();
delete form;
}
示例9: CreateMessageDialog
//---------------------------------------------------------------------------
//上書き確認メッセージダイアログの表示(復号スレッドオブジェクトから呼ばれる)
//---------------------------------------------------------------------------
int __fastcall TForm1::ShowConfirmOverwriteMassageForm(String MsgText, String &Path)
{
//ボタンをカスタマイズするので上記関数と分けて作成
TButton *btn;
TMsgDlgButtons MsgButtons = (TMsgDlgButtons() << mbYesToAll << mbYes << mbNo << mbCancel);
TForm *dlg = CreateMessageDialog(MsgText, mtConfirmation, MsgButtons, mbCancel);
//ボタン名をそれぞれ書き換える
btn = (TButton *)dlg->FindComponent("YesToAll"); //'全て上書き(&W)'
btn->Caption = LoadResourceString(&Msgexeout::_DIALOG_BUTTON_NAME_OVERWITE_YES_TO_ALL);
btn = (TButton *)dlg->FindComponent("Yes"); //'上書き(&O)'
btn->Caption = LoadResourceString(&Msgexeout::_DIALOG_BUTTON_NAME_OVERWITE_YES);
btn = (TButton *)dlg->FindComponent("No"); //'別名保存(&A)'
btn->Caption = LoadResourceString(&Msgexeout::_DIALOG_BUTTON_NAME_OVERWITE_NO);
btn = (TButton *)dlg->FindComponent("Cancel"); //'キャンセル(&C)'
btn->Caption = LoadResourceString(&Msgexeout::_DIALOG_BUTTON_NAME_OVERWITE_CANCEL);
dlg->Caption = LoadResourceString(&Msgexeout::_MSG_CAPTION_CONFIRMATION);
dlg->ParentWindow = Form1->Handle;
//メッセージダイアログの表示
int ret = dlg->ShowModal();
if (ret == mrNo) { //別名で保存する(いいえ)
TSaveDialog *dlgsave = new TSaveDialog(dlg);
//'復号ファイルの保存'
dlgsave->Title = LoadResourceString(&Msgexeout::_DIALOG_SAVE_AS_FILE_CAPTION);
dlgsave->InitialDir = ExtractFileDir(ExcludeTrailingPathDelimiter(Path));
dlgsave->FileName = ExtractFileName(ExcludeTrailingPathDelimiter(Path));
//'ファイルフォルダー|*'
dlgsave->Filter = LoadResourceString(&Msgexeout::_DIALOG_SAVE_AS_FILTER);
//別名保存ダイアログ
if ( dlgsave->Execute() == true ){
Path = dlgsave->FileName;
}
else{
//キャンセル
ret = mrCancel;
}
delete dlgsave;
}
delete dlg;
return(ret);
}
示例10: ShowAbout
//.........这里部分代码省略.........
lblAppName2->Font->Name = "Courier New";
lblAppName2->Font->Style = TFontStyles() << fsBold << fsItalic;
lblAppName2->Font->Size = iFontSize;
lblAppName2->Transparent = true;
lblAppName2->Layout = tlCenter;
lblAppName2->WordWrap = true;
} // pPicture == NULL
else {
TImage *imgPicture = new TImage(Form);
imgPicture->Parent = pnlName;
imgPicture->Align = alClient;
imgPicture->Picture->Assign(pPicture);
}
TLabel *lblDate = new TLabel(Form); // Date
lblDate->Parent = pnlName;
lblDate->Caption = sDate;
lblDate->Font->Assign(Form->Font);
lblDate->Font->Style = TFontStyles() << fsBold;
lblDate->Font->Color = clWhite;
lblDate->Font->Size = 8;
lblDate->Alignment = taRightJustify;
switch (3) {
case 0:
lblDate->SetBounds(2, 2, lblDate->Width, lblDate->Height);
break;
case 1:
lblDate->SetBounds(2, pnlName->ClientHeight - lblDate->Height - 2,
lblDate->Width, lblDate->Height);
break;
case 2:
lblDate->SetBounds(pnlName->ClientWidth - lblDate->Width - 2, 2,
lblDate->Width, lblDate->Height);
break;
default:
lblDate->SetBounds(pnlName->ClientWidth - lblDate->Width - 2,
pnlName->ClientHeight - lblDate->Height - 2, lblDate->Width,
lblDate->Height);
}
lblDate->Transparent = true;
TLabel *lblVerion = new TLabel(Form); // Version
lblVerion->Parent = pnlName;
lblVerion->Caption = sVersion;
lblVerion->Font->Assign(Form->Font);
lblVerion->Font->Style = TFontStyles() << fsBold;
lblVerion->Font->Color = clWhite;
lblVerion->Font->Size = 8;
switch (2) {
case 0:
lblVerion->SetBounds(2, 2, lblVerion->Width, lblVerion->Height);
break;
case 1:
lblVerion->SetBounds(2, pnlName->ClientHeight - lblVerion->Height - 2,
lblVerion->Width, lblVerion->Height);
break;
case 2:
lblVerion->SetBounds(pnlName->ClientWidth - lblVerion->Width - 2, 2,
lblVerion->Width, lblVerion->Height);
break;
default:
lblVerion->SetBounds(pnlName->ClientWidth - lblVerion->Width - 2,
pnlName->ClientHeight - lblVerion->Height - 2, lblVerion->Width,
lblVerion->Height);
}
lblVerion->Transparent = true;
TButton *btnClose = new TButton(Form);
btnClose->Parent = Form;
btnClose->Caption = "OK";
btnClose->ModalResult = mrCancel;
btnClose->Cancel = true;
btnClose->SetBounds(Form->ClientWidth - 83, Form->ClientHeight - 34,
75, 26);
btnClose->TabOrder = 0;
TTimer *timer = new TTimer(Form);
timer->OnTimer = AboutObject->TimerTimer;
timer->Interval = 1;
timer->Enabled = true;
RestoreCursor();
Form->Left = (Screen->Width - Form->Width) / 2;
Form->Top = (Screen->Height - Form->Height) / 2;
SetCurPosToCenter(btnClose);
Form->ShowModal();
Form->Free();
AboutObject->Free();
lblMemory = NULL;
lblProc = NULL;
lblMemoryValue = NULL;
lblProcValue = NULL;
}
示例11: InputDialog
//.........这里部分代码省略.........
Prompt->Top = ScaleByTextHeightRunTime(Form, 13);
Prompt->Caption = APrompt;
TEdit * Edit;
THistoryComboBox * HistoryCombo;
if (History == NULL)
{
Edit = new TEdit(Form);
Edit->Parent = Form;
Edit->Text = Value;
Edit->SelectAll();
Edit->MaxLength = 255;
Token.Data.Edit = Edit;
Token.EditControl = Edit;
}
else
{
HistoryCombo = new THistoryComboBox(Form);
HistoryCombo->Parent = Form;
HistoryCombo->Text = Value;
HistoryCombo->SelectAll();
HistoryCombo->Items = History;
HistoryCombo->MaxLength = 255;
HistoryCombo->AutoComplete = false;
Token.EditControl = HistoryCombo;
}
Token.EditControl->Left = Prompt->Left;
Token.EditControl->Top = ScaleByTextHeightRunTime(Form, 30);
Token.EditControl->Width = ScaleByTextHeightRunTime(Form, 255);
Prompt->FocusControl = Token.EditControl;
int ButtonTop = ScaleByTextHeightRunTime(Form, 66);
int ButtonSpace = ScaleByTextHeightRunTime(Form, 6);
TButton * Button;
Button = new TButton(Form);
Button->Parent = Form;
Button->Caption = Vcl_Consts_SMsgDlgOK;
Button->ModalResult = mrOk;
Button->Default = True;
int ButtonHeight = ScaleByTextHeightRunTime(Button, Button->Height);
int ButtonWidth = ScaleByTextHeightRunTime(Button, Button->Width);
int ButtonsStart;
if (HelpKeyword.IsEmpty())
{
ButtonsStart = (Form->ClientWidth / 2) - ButtonWidth - (ButtonSpace / 2);
}
else
{
ButtonsStart = (Form->ClientWidth / 2) - (3 * ButtonWidth / 2) - ButtonSpace;
}
Button->SetBounds(ButtonsStart, ButtonTop, ButtonWidth, ButtonHeight);
Button = new TButton(Form);
Button->Parent = Form;
Button->Caption = Vcl_Consts_SMsgDlgCancel;
Button->ModalResult = mrCancel;
Button->Cancel = True;
Button->SetBounds(ButtonsStart + ButtonWidth + ButtonSpace, ButtonTop,
ButtonWidth, ButtonHeight);
if (!HelpKeyword.IsEmpty())
{
Button = new TButton(Form);
Button->Parent = Form;
Button->Caption = Vcl_Consts_SMsgDlgHelp;
Button->ModalResult = mrNone;
Button->SetBounds(ButtonsStart + 2 * (ButtonWidth + ButtonSpace), ButtonTop,
ButtonWidth, ButtonHeight);
TNotifyEvent OnClick;
((TMethod*)&OnClick)->Code = InputDialogHelp;
Button->OnClick = OnClick;
}
UseSystemSettingsPost(Form);
if (Form->ShowModal() == DefaultResult(Form))
{
if (History != NULL)
{
HistoryCombo->SaveToHistory();
History->Assign(HistoryCombo->Items);
Value = HistoryCombo->Text;
}
else
{
Value = Edit->Text;
}
Result = true;
}
}
__finally
{
delete Form;
}
return Result;
}
示例12: case
void __fastcall TGLForm2D::FormKeyDown(TObject *Sender, WORD &Key,
TShiftState Shift)
{
switch(Key){
case(TECLA_E):
cols = 0;
while(!embaldosa && cols <= 0){
TForm* x = new TFormS(this,cols);
x->Caption = "Introduce Columnas";
x->ShowModal();
}
embaldosa = !embaldosa;
if(!embaldosa)
glViewport(0,0,ClientWidth,ClientHeight);
break;
case(KEY_LEFT):
xLeft += 5;
xRight += 5;
centroX += 5;
sc->set(xLeft,xRight,yTop,yBot);
break;
case(KEY_RIGHT):
xLeft -= 5;
xRight -= 5;
centroX -= 5;
sc->set(xLeft,xRight,yTop,yBot);
break;
case(KEY_UP):
yTop -= 5;
yBot -= 5;
centroY -= 5;
sc->set(xLeft,xRight,yTop,yBot);
break;
case(KEY_DOWN):
yTop += 5;
yBot += 5;
centroY += 5;
sc->set(xLeft,xRight,yTop,yBot);
break;
case(ZOOM_IN):
nuevoAncho = (xRight-xLeft)/1.1;
nuevoAlto = (yTop-yBot)/1.1;
yBot = centroY-(nuevoAlto/2.0);
yTop = centroY+(nuevoAlto/2.0);
xRight = centroX+(nuevoAncho/2.0);
xLeft = centroX-(nuevoAncho/2.0);
sc->set(xLeft,xRight,yTop,yBot);
break;
case(ZOOM_OUT):
nuevoAncho = (xRight-xLeft)*1.1;
nuevoAlto = (yTop-yBot)*1.1;
yBot = centroY-(nuevoAlto/2.0);
yTop = centroY+(nuevoAlto/2.0);
xRight = centroX+(nuevoAncho/2.0);
xLeft = centroX-(nuevoAncho/2.0);
sc->set(xLeft,xRight,yTop,yBot);
break;
}
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluOrtho2D(xLeft,xRight, yBot,yTop);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
GLScene();
}
示例13: TForm
AboutBox&
AboutBox::Display() const
{
VersionInfo info = mVersionInfo;
string versionNumber = info[ "Version" ];
info.erase( "Version" );
string versionDetails;
for( VersionInfo::reverse_iterator i = info.rbegin(); i != info.rend(); ++i )
versionDetails += ", " + i->first + ": " + i->second;
versionDetails.erase( 0, 2 );
#ifdef __BORLANDC__
TForm* pForm = new TForm( static_cast<TComponent*>( NULL ) );
pForm->BorderStyle = bsDialog;
pForm->Position = poScreenCenter;
pForm->Caption = ( string( "About " ) + mApplicationName + "..." ).c_str();
TPanel* pPanel = new TPanel( pForm );
pPanel->Parent = pForm;
pPanel->BorderStyle = bsNone;
pPanel->BorderWidth = 0;
pPanel->BevelOuter = bvLowered;
pPanel->BevelInner = bvNone;
pPanel->Color = clWhite;
pPanel->Left = 10;
pPanel->Top = 10;
pPanel->Width = pForm->ClientWidth - 2 * pPanel->Left;
Graphics::TBitmap* pBitmap = new Graphics::TBitmap;
int logoWidth = GraphicResource::Width( Resources::BCI2000logo_mini ),
logoHeight = GraphicResource::Width( Resources::BCI2000logo_mini );
pBitmap->Width = logoWidth + 1;
pBitmap->Height = logoHeight + 1;
pBitmap->Canvas->Brush->Color = pPanel->Color;
pBitmap->Canvas->FillRect( TRect( 0, 0, pBitmap->Width, pBitmap->Height ) );
DrawContext dc = { pBitmap->Canvas->Handle, { 0, 0, logoWidth, logoHeight } };
GraphicResource::Render<RenderingMode::Transparent>( Resources::BCI2000logo_mini, dc );
TPicture* pPicture = new TPicture;
pPicture->Graphic = pBitmap;
TImage* pImage = new TImage( pForm );
pImage->Parent = pPanel;
pImage->Left = pPanel->Left;
pImage->Top = pPanel->Top;
pImage->Width = pBitmap->Width;
pImage->Height = pBitmap->Height;
pImage->Picture = pPicture;
TLabel* pNameLabel = new TLabel( pForm );
pNameLabel->Parent = pPanel;
pNameLabel->Top = pImage->Top;
pNameLabel->Left = 3 * pImage->Left + pImage->Width;
pNameLabel->Font->Size *= 2;
pNameLabel->Font->Style = pNameLabel->Font->Style << fsBold;
pNameLabel->Caption = mApplicationName.c_str();
TLabel* pCopyrightLabel = new TLabel( pForm );
pCopyrightLabel->Parent = pPanel;
pCopyrightLabel->Alignment = taLeftJustify;
pCopyrightLabel->Caption = ( versionNumber + "\n\n" + BCI2000_COPYRIGHT ).c_str();
pCopyrightLabel->Top = pNameLabel->Top + pNameLabel->Height;
pCopyrightLabel->Left = pNameLabel->Left;
int textWidth = max( pCopyrightLabel->Width, pNameLabel->Width );
pPanel->ClientWidth = 4 * pImage->Left + pImage->Width + textWidth;
pPanel->ClientHeight = pImage->Height + 2 * pImage->Top;
pForm->ClientWidth = 2 * pPanel->Left + pPanel->Width;
TLabel* pVersionLabel = new TLabel( pForm );
pVersionLabel->Parent = pForm;
pVersionLabel->Alignment = taCenter;
pVersionLabel->Top = 2 * pPanel->Top + pPanel->Height;
pVersionLabel->WordWrap = true;
pVersionLabel->Left = pPanel->Left;
pVersionLabel->Width = pPanel->Width;
pVersionLabel->Caption = versionDetails.c_str();
pVersionLabel->Left = ( pForm->ClientWidth - pVersionLabel->Width ) / 2;
TButton* pButton = new TButton( pForm );
pButton->Parent = pForm;
pButton->ModalResult = mrOk;
pButton->Caption = "Close";
pButton->Left = ( pForm->ClientWidth - pButton->Width ) / 2;
pButton->Top = pVersionLabel->Top + pVersionLabel->Height + pButton->Height / 2;
pForm->ClientHeight = pButton->Top + ( 3 * pButton->Height ) / 2;
pForm->ShowModal();
delete pForm;
#endif // __BORLANDC__
return *const_cast<AboutBox*>( this );
}