Rhino C++ API  8.14
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
CRhinoGetFileDialog Class Reference

#include <rhinoSdkGetFileDialog.h>

Public Types

enum  bitmap_file_types {
  bmp = 1, jpg = 2, pcx = 4, png = 8,
  tif = 16, tga = 32
}
 
enum  file_dialog_type {
  open_dialog = 0, open_template_dialog, open_bitmap_dialog, open_rhino_3dm_file_dialog,
  open_toolbar_collection_dialog, open_text_file_dialog, open_worksession_dialog, import_dialog,
  attach_dialog, load_plug_in_dialog, save_dialog, save_small_dialog,
  save_template_dialog, save_bitmap_dialog, export_dialog, save_rhino_3dm_file_dialog,
  save_toolbar_collection_dialog, save_text_file_dialog, save_worksession_dialog, save_current_toolbar_collection_only_dialog,
  open_hatchpattern_dialog, open_linetype_dialog, save_pdf, save_xps,
  custom, save_rendering_dialog, save_csv_dialog, file_dialog_type_internal_numof,
  file_dialog_type_count = custom
}
 

Public Member Functions

 CRhinoGetFileDialog ()
 
virtual ~CRhinoGetFileDialog ()
 
BOOL32 AddPlugInFileTypes ()
 
bool AddTransparentBackgroundControl () const
 
int BitmapTypes () const
 
bool DisplayFileDialog (file_dialog_type fileType, const wchar_t *defaultName=nullptr, HWND parentWnd=nullptr)
 
void EnableUpdateEmbededInstanceDefinitions (bool b)
 
const wchar_t * FileName () const
 
CRhinoFileReadOptions FileReadOptions () const
 
bool FileTypeIsCurrentRhino3dmVersion () const
 
bool FileTypeIsEarlierRhino3dmVersion () const
 
unsigned int FileTypeRhino3dmVersion () const
 
CRhinoFileWriteOptions FileWriteOptions () const
 
const wchar_t * GetDefaultDirectory () const
 
unsigned int MinimumRhino3dmVersion () const
 
UUID PlugIn () const
 
int PlugInExtensionIndex () const
 
BOOL32 SetAddPlugInFileTypes (BOOL32 b)
 
bool SetAddTransparentBackgroundControl (bool value)
 
int SetBitmapTypes (int)
 
void SetDefaultDirectory (const wchar_t *lpsDir)
 
void SetDialogTitle (const wchar_t *lpTitle)
 
void SetFileWriteOptions (CRhinoFileWriteOptions &)
 
void SetMinimumRhino3dmVersion (unsigned int min_rhino_3dm_version)
 
void SetScriptMode (BOOL32 bInScriptMode)
 
BOOL32 SetShowPreview (BOOL32)
 
bool SetTransparentBitampBackgroundChecked (bool value)
 
void SetUseAsDefaultTemplate (BOOL32 b)
 
BOOL32 ShowPreview () const
 
bool TransparentBitampBackgroundChecked () const
 
bool UpdateEmbededInstanceDefinitions () const
 
BOOL32 UseAsDeafultTemplate () const
 

Static Public Member Functions

static void ClearFileTypeDefaultExtension (CRhinoGetFileDialog::file_dialog_type ft)
 
static const wchar_t * GetDefaultDirectory (file_dialog_type ft)
 
static BOOL32 SetDefaultDirectory (file_dialog_type ft, const wchar_t *lps)
 

Protected Member Functions

BOOL32 BuildExtensionList (file_dialog_type)
 
INT_PTR DoModal (CRhinoGetFileDialog::file_dialog_type ft, const wchar_t *lpsDefName, class CRhFileDialog &dlg)
 
const wchar_t * GetDefaultFileExtension (file_dialog_type) const
 
int GetDefaultFilterIndex (file_dialog_type) const
 
void GetPlugInExtensionIndex (class CRhFileDialog *)
 
bool ScriptMode () const
 
void SetDefaultFileExtensionFromFileName (file_dialog_type, const wchar_t *file_name)
 

Protected Attributes

BOOL32 m_bAddPlugInTypes
 Defaults to true. More...
 
BOOL32 m_bShowPreview
 Defaults to true. More...
 
bool m_bUpdateEmbededInstanceDefinitions
 
BOOL32 m_bUseAsDefault
 Use as default template. More...
 
BOOL32 m_bUseFileDialogs
 
ON_wString m_default_dir
 
ON_wString m_dialog_title
 
ON_ClassArray< CRhinoFileTypem_extensions
 
ON__UINT32 m_Flags
 
CRhinoFileReadOptions m_fro
 
CRhinoFileWriteOptions m_fwo
 
CRhinoFileWriteOptions m_fwo_in
 
unsigned int m_min_rhino_3dm_version
 default is 0 More...
 
int m_nExtensionIndex
 
UUID m_PlugIn
 
int m_types
 Defaults to all_types. More...
 
ON_wString m_wFileName
 

Static Protected Attributes

static ON_ClassArray< ON_wStringm_def_extensions
 

Member Enumeration Documentation

◆ bitmap_file_types

Enumerator
bmp 
jpg 
pcx 
png 
tif 
tga 

◆ file_dialog_type

Enumerator
open_dialog 
open_template_dialog 
open_bitmap_dialog 
open_rhino_3dm_file_dialog 

name of a rhino .3dm file

open_toolbar_collection_dialog 
open_text_file_dialog 
open_worksession_dialog 
import_dialog 
attach_dialog 
load_plug_in_dialog 
save_dialog 

Rhino model Save command.

save_small_dialog 
save_template_dialog 
save_bitmap_dialog 
export_dialog 
save_rhino_3dm_file_dialog 

name of a rhino .3dm file (current version)

save_toolbar_collection_dialog 
save_text_file_dialog 
save_worksession_dialog 
save_current_toolbar_collection_only_dialog 
open_hatchpattern_dialog 

RH-33812 - 28 Apr, 2016 - Lowell.

open_linetype_dialog 

RH - 33812 - 28 Apr, 2016 - Lowell.

save_pdf 
save_xps 
custom 

RH-50534 - 28 Jan 2019, John Croudy.

save_rendering_dialog 
save_csv_dialog 
file_dialog_type_internal_numof 

This value is for internal use only. It will change if more items are added. Never use this value in your plug-in.

file_dialog_type_count 

For backward compatibility only. DO NOT USE. Please change your code to use 'custom'.

Constructor & Destructor Documentation

◆ CRhinoGetFileDialog()

CRhinoGetFileDialog::CRhinoGetFileDialog ( )

◆ ~CRhinoGetFileDialog()

virtual CRhinoGetFileDialog::~CRhinoGetFileDialog ( )
virtual

Member Function Documentation

◆ AddPlugInFileTypes()

BOOL32 CRhinoGetFileDialog::AddPlugInFileTypes ( )

◆ AddTransparentBackgroundControl()

bool CRhinoGetFileDialog::AddTransparentBackgroundControl ( ) const

Description: The "Transparent background" check box will be added to the File dialog if this value is true. Returns: true if the "Transparent background" check box will appear in the file dialog. See Also: CRhFileDialog::SetAddTransparentBackgroundControl Remarks: Added 16 October 2012 by John Morse so we could add the option when saving a view to a file.

◆ BitmapTypes()

int CRhinoGetFileDialog::BitmapTypes ( ) const

◆ BuildExtensionList()

BOOL32 CRhinoGetFileDialog::BuildExtensionList ( file_dialog_type  )
protected

◆ ClearFileTypeDefaultExtension()

static void CRhinoGetFileDialog::ClearFileTypeDefaultExtension ( CRhinoGetFileDialog::file_dialog_type  ft)
static

◆ DisplayFileDialog()

bool CRhinoGetFileDialog::DisplayFileDialog ( file_dialog_type  fileType,
const wchar_t *  defaultName = nullptr,
HWND  parentWnd = nullptr 
)

Description: This function is will show just about any kind of Rhino related file dialog. It's a poor design because the context of the dialogs varies widely and different dialogs need different information to work well. Parameters: fileType - [in] defaultName - [in] pWndParent - [in]

◆ DoModal()

INT_PTR CRhinoGetFileDialog::DoModal ( CRhinoGetFileDialog::file_dialog_type  ft,
const wchar_t *  lpsDefName,
class CRhFileDialog &  dlg 
)
protected

◆ EnableUpdateEmbededInstanceDefinitions()

void CRhinoGetFileDialog::EnableUpdateEmbededInstanceDefinitions ( bool  b)

Description: This is only meaningful when scripting the file open command and the document setting in the file being read indicates a interactive "prompt" should be used to determine if a linked and embedded instance definition should be updated. Parameters: b - [in] true means a linked and embedded instance definitions will update when file open is done and the document settings indicate a "prompt" should be used to get the answer to the question. See Also: CRhFileDialog::UpdateEmbededInstanceDefinitions Remarks: Added 3 March 2006 by John Morse so we could add command line option that would open files and let the user specify what to do with embedded instance definitions.

◆ FileName()

const wchar_t* CRhinoGetFileDialog::FileName ( ) const

◆ FileReadOptions()

CRhinoFileReadOptions CRhinoGetFileDialog::FileReadOptions ( ) const

◆ FileTypeIsCurrentRhino3dmVersion()

bool CRhinoGetFileDialog::FileTypeIsCurrentRhino3dmVersion ( ) const

Returns: True if the file is a current Rhino version 3dm file.

◆ FileTypeIsEarlierRhino3dmVersion()

bool CRhinoGetFileDialog::FileTypeIsEarlierRhino3dmVersion ( ) const

Returns: True if the file is a previous Rhino version 3dm file.

◆ FileTypeRhino3dmVersion()

unsigned int CRhinoGetFileDialog::FileTypeRhino3dmVersion ( ) const

Returns: The version of the 3dm file or 0 if it's not a 3dm file 0: not a Rhino 3dm file 2 for Rhino V2 3dm file, 3 for Rhino V3 3dm file, 4 for Rhino V4 3dm file, 5 for Rhino V5 3dm file, 6 for Rhino V6 3dm file, ...

◆ FileWriteOptions()

CRhinoFileWriteOptions CRhinoGetFileDialog::FileWriteOptions ( ) const

◆ GetDefaultDirectory() [1/2]

const wchar_t* CRhinoGetFileDialog::GetDefaultDirectory ( ) const

◆ GetDefaultDirectory() [2/2]

static const wchar_t* CRhinoGetFileDialog::GetDefaultDirectory ( file_dialog_type  ft)
static

◆ GetDefaultFileExtension()

const wchar_t* CRhinoGetFileDialog::GetDefaultFileExtension ( file_dialog_type  ) const
protected

◆ GetDefaultFilterIndex()

int CRhinoGetFileDialog::GetDefaultFilterIndex ( file_dialog_type  ) const
protected

◆ GetPlugInExtensionIndex()

void CRhinoGetFileDialog::GetPlugInExtensionIndex ( class CRhFileDialog *  )
protected

◆ MinimumRhino3dmVersion()

unsigned int CRhinoGetFileDialog::MinimumRhino3dmVersion ( ) const

◆ PlugIn()

UUID CRhinoGetFileDialog::PlugIn ( ) const

Returns ON_max_uuid if unset. If it returns ON_nil_uuid, then the file type is a Rhino 3dm file.

◆ PlugInExtensionIndex()

int CRhinoGetFileDialog::PlugInExtensionIndex ( ) const

◆ ScriptMode()

bool CRhinoGetFileDialog::ScriptMode ( ) const
protected

◆ SetAddPlugInFileTypes()

BOOL32 CRhinoGetFileDialog::SetAddPlugInFileTypes ( BOOL32  b)

◆ SetAddTransparentBackgroundControl()

bool CRhinoGetFileDialog::SetAddTransparentBackgroundControl ( bool  value)

Description: The "Transparent background" check box will be added to the File dialog if this value is true. Returns: Returns previous value of this flag. See Also: CRhFileDialog::AddTransparentBackgroundControl Remarks: Added 16 October 2012 by John Morse so we could add the option when saving a view to a file.

◆ SetBitmapTypes()

int CRhinoGetFileDialog::SetBitmapTypes ( int  )

◆ SetDefaultDirectory() [1/2]

void CRhinoGetFileDialog::SetDefaultDirectory ( const wchar_t *  lpsDir)

◆ SetDefaultDirectory() [2/2]

static BOOL32 CRhinoGetFileDialog::SetDefaultDirectory ( file_dialog_type  ft,
const wchar_t *  lps 
)
static

◆ SetDefaultFileExtensionFromFileName()

void CRhinoGetFileDialog::SetDefaultFileExtensionFromFileName ( file_dialog_type  ,
const wchar_t *  file_name 
)
protected

◆ SetDialogTitle()

void CRhinoGetFileDialog::SetDialogTitle ( const wchar_t *  lpTitle)

◆ SetFileWriteOptions()

void CRhinoGetFileDialog::SetFileWriteOptions ( CRhinoFileWriteOptions )

◆ SetMinimumRhino3dmVersion()

void CRhinoGetFileDialog::SetMinimumRhino3dmVersion ( unsigned int  min_rhino_3dm_version)

◆ SetScriptMode()

void CRhinoGetFileDialog::SetScriptMode ( BOOL32  bInScriptMode)

◆ SetShowPreview()

BOOL32 CRhinoGetFileDialog::SetShowPreview ( BOOL32  )

◆ SetTransparentBitampBackgroundChecked()

bool CRhinoGetFileDialog::SetTransparentBitampBackgroundChecked ( bool  value)

Description: Sets the default value for the "Transparent background" check box if it is displayed. Returns: Returns previous value of this flag. See Also: CRhFileDialog::AddTransparentBackgroundControl CRhFileDialog::AddTransparentBackgroundControl Remarks: Added 16 October 2012 by John Morse so we could add the option when saving a view to a file.

◆ SetUseAsDefaultTemplate()

void CRhinoGetFileDialog::SetUseAsDefaultTemplate ( BOOL32  b)

◆ ShowPreview()

BOOL32 CRhinoGetFileDialog::ShowPreview ( ) const

◆ TransparentBitampBackgroundChecked()

bool CRhinoGetFileDialog::TransparentBitampBackgroundChecked ( ) const

Description: Check to see if the "Transparent background" check box was checked when the dialog closed. Returns: Returns true if the "Transparent background" check box was checked. See Also: CRhFileDialog::SetTransparentBitampBackgroundChecked CRhFileDialog::AddTransparentBackgroundControl Remarks: Added 16 October 2012 by John Morse so we could add the option when saving a view to a file.

◆ UpdateEmbededInstanceDefinitions()

bool CRhinoGetFileDialog::UpdateEmbededInstanceDefinitions ( ) const

Description: If the update linked and embedded instance definitions setting is set to "prompt" and a file is read in "script" mode with forbids asking questions, then the the value returned by this function is used to determine if a linked and embedded instance definition should be updated. Returns: true if definitions are to be updated in scripting mode. See Also: CRhFileDialog::EnableUpdateEmbededInstanceDefinitions Remarks: Added 3 March 2006 by John Morse so we could add command line option that would open files and let the user specify what to do with embedded instance definitions.

◆ UseAsDeafultTemplate()

BOOL32 CRhinoGetFileDialog::UseAsDeafultTemplate ( ) const

Member Data Documentation

◆ m_bAddPlugInTypes

BOOL32 CRhinoGetFileDialog::m_bAddPlugInTypes
protected

Defaults to true.

◆ m_bShowPreview

BOOL32 CRhinoGetFileDialog::m_bShowPreview
protected

Defaults to true.

◆ m_bUpdateEmbededInstanceDefinitions

bool CRhinoGetFileDialog::m_bUpdateEmbededInstanceDefinitions
protected

◆ m_bUseAsDefault

BOOL32 CRhinoGetFileDialog::m_bUseAsDefault
protected

Use as default template.

◆ m_bUseFileDialogs

BOOL32 CRhinoGetFileDialog::m_bUseFileDialogs
protected

◆ m_def_extensions

ON_ClassArray<ON_wString> CRhinoGetFileDialog::m_def_extensions
staticprotected

◆ m_default_dir

ON_wString CRhinoGetFileDialog::m_default_dir
protected

◆ m_dialog_title

ON_wString CRhinoGetFileDialog::m_dialog_title
protected

◆ m_extensions

ON_ClassArray<CRhinoFileType> CRhinoGetFileDialog::m_extensions
protected

◆ m_Flags

ON__UINT32 CRhinoGetFileDialog::m_Flags
protected

16 October 2012 by John Morse changed this from a BOOL32 to a ON__UINT32 and changed it to a flags field, this was done to add additional options without breaking the SDK. Call the ScriptMode() of function to get the determine if in scripting mode or call SetScriptMode() set set the value. BOOL32 m_bScriptMode;

◆ m_fro

CRhinoFileReadOptions CRhinoGetFileDialog::m_fro
protected

◆ m_fwo

CRhinoFileWriteOptions CRhinoGetFileDialog::m_fwo
protected

◆ m_fwo_in

CRhinoFileWriteOptions CRhinoGetFileDialog::m_fwo_in
protected

◆ m_min_rhino_3dm_version

unsigned int CRhinoGetFileDialog::m_min_rhino_3dm_version
protected

default is 0

If m_min_rhino_3dm_version > 0, then only a RHino 3dm file of that version or greater can be saved on plug-in formats are not supported.

◆ m_nExtensionIndex

int CRhinoGetFileDialog::m_nExtensionIndex
protected

◆ m_PlugIn

UUID CRhinoGetFileDialog::m_PlugIn
protected

If RhinoApp().IsRhinoUUID(m_PlugIn) is true, then (RHINO_CURRENT_FILE_VERSION_NUMBER-m_nExtensionIndex) identifies the version of the Rhino .3dm file. If RhinoApp().IsRhinoUUID(m_PlugIn) is false, then a plug-in is reading/writing the file type and m_nExtensionIndex is interpreted by the plug-in.

◆ m_types

int CRhinoGetFileDialog::m_types
protected

Defaults to all_types.

◆ m_wFileName

ON_wString CRhinoGetFileDialog::m_wFileName
protected