VIZ++ Class: OpenGLFileSaveDialog

 VIZ++ Class Library  VIZ++ Samples  VIZ++ ClassTree 

Source code

/*
 * OpenGLFileSaveDialog.h 
 * Copyright (c) 2015 Antillia.com TOSHIYUKI ARAI. ALL RIGHTS RESERVED. 
 */


#pragma once

#include <viz++/opengl/OpenGLFileDialog.h>

namespace VIZ {

class OpenGLFileSaveDialog :public OpenGLFileDialog {

public:
  OpenGLFileSaveDialog(OpenGLMainView* view,           const char* initialDir = NULL, 
          const char* filter="All Files (*.*)\0*.*\0", const char* ext ="*")

  :OpenGLFileDialog(view, initialDir, filter, ext)
  {
    OPENFILENAME& ofn = getOpenFileName();
    ofn.Flags = OFN_EXPLORER | OFN_FILEMUSTEXIST | OFN_HIDEREADONLY |OFN_OVERWRITEPROMPT;
  }

  virtual bool popup()
  { 
    bool result = false;
    OPENFILENAME& ofn = getOpenFileName();
    int rc = GetSaveFileName(&ofn);
    if (rc == IDOK) {
      result = true;
    } 
    return result;
  }
};

}

Last modified: 10 Feb 2017

Copyright (c) 2009-2017 Antillia.com ALL RIGHTS RESERVED.