LoginSignup
1
0

More than 5 years have passed since last update.

C++ Builder XE4 > TOpenDialog (TSaveDialog) のOptions > ソースでの指定の仕方

Last updated at Posted at 2018-12-03
動作環境
C++ Builder XE4

関連

不明だった点

  • ofOverwritePromptをソースで指定する書き方

参考

SaveDialog1->Options << ofOverwritePrompt << ofCreatePrompt;

<<を使うようです。

実装

Unit1.cpp
//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
    : TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
    SaveDialog1->Options << ofOverwritePrompt;

    if (SaveDialog1->Execute() == false) {
        return;
    }

    // ここにファイル指定時の処理を書く
}
//---------------------------------------------------------------------------

不明点

<<の意味

A. 既存のものを消して設定
B. 既存のものに加えて設定

既存のもの
- ofHideReadOnly
- ofEnableSizing

動作結果からかんがみると、「B. 既存のものに加えて設定」である気はします。
(サイズ変更ができた、という理由から)

その他関連

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0