Rhino C++ API  8.14
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
CRhinoTextOut Class Referenceabstract

#include <RhinoSdkTextOut.h>

Inheritance diagram for CRhinoTextOut:
CRhinoTextDump

Public Types

enum  output_mode { text_dialog = 0, history_window, text_file, clipboard }
 

Public Member Functions

 CRhinoTextOut ()
 
virtual ~CRhinoTextOut ()
 
LPVOID Data () const
 
class CRhRichTextDialog * Dialog () const
 
virtual CRhinoCommand::result DisplayText (bool is_interactive, const wchar_t *lpsWindowTitle, LPVOID pData=nullptr, HWND hWndParent=nullptr)
 
virtual void PrintText (ON_TextLog &text_log, LPVOID pData)=0
 
bool ScrollTextDialogToBottom () const
 
void ScrollTextDialogToBottom (bool b)
 
void SetTextOutputMode (output_mode mode)
 
bool SetUseFileDialog (bool b)
 
output_mode TextOutputMode () const
 
bool UseFileDialog () const
 
const wchar_t * WindowTitle () const
 

Public Attributes

class CRhTextOutWStringTextLog * m_wbuffer
 

Protected Member Functions

bool PrintBuffer (CRhinoTextOutTextLog &text_log)
 
CRhinoCommand::result PrintToClipboard ()
 
CRhinoCommand::result PrintToDialog ()
 
CRhinoCommand::result PrintToFile ()
 
CRhinoCommand::result PrintToHistory ()
 

Protected Attributes

class CRhRichTextDialog * m_dialog
 
HWND m_hWnd
 
output_mode m_output_mode
 
LPVOID m_pData
 
bool m_scroll_dialog_to_bottom
 
bool m_use_file_dialog
 
ON_wString m_window_title
 

Member Enumeration Documentation

◆ output_mode

Enumerator
text_dialog 

Display text in dialog box.

history_window 

Display text in Rhino command history window.

text_file 

Write text to file.

clipboard 

Write text to Windows clipboard.

Constructor & Destructor Documentation

◆ CRhinoTextOut()

CRhinoTextOut::CRhinoTextOut ( )

◆ ~CRhinoTextOut()

virtual CRhinoTextOut::~CRhinoTextOut ( )
virtual

Member Function Documentation

◆ Data()

LPVOID CRhinoTextOut::Data ( ) const

Description: Data pointer passed to CRhinoTextOut::DisplayText(). Returns: Returns pointer passed to CRhinoTextOut::DisplayText() See also: CRhinoTextOut::DisplayText()

◆ Dialog()

class CRhRichTextDialog* CRhinoTextOut::Dialog ( ) const

Description: Dialog box used to display text. Returns: Returns pointer to dialog box used to display text.

◆ DisplayText()

virtual CRhinoCommand::result CRhinoTextOut::DisplayText ( bool  is_interactive,
const wchar_t *  lpsWindowTitle,
LPVOID  pData = nullptr,
HWND  hWndParent = nullptr 
)
virtual

Description: This will eventually call CRhinoTextOut::PrintText(). If is_interactive is true then the ON_TextLog passed to CRhinoTextOut::PrintText() will output text to a RichEditCtrl embedded in a text dialog otherwise the user will be prompted for a text file name to open and CRhinoTextOut::PrintText() will append the text file. Parameters: is_interactive [in] - If true then a text dialog is displayed otherwise text is output to a file. lpsWindowTitle [in] - Only valid if is_interactive == true, if so then the text dialog title is set to this string. pData [in] - Passed to CRhinoTextOut::PrintText as pData argument. hWndParent [in] - Optional argument which is only meaningful if is_interactive is true. If so then it is used as the parent window for the text dialog. Returns: CRhinoCommand::success = Text output successfully. CRhinoCommand::cancel = User pressed escape when promted for a file name to write to. CRhinoCommand::failure = Error opening text file.

◆ PrintBuffer()

bool CRhinoTextOut::PrintBuffer ( CRhinoTextOutTextLog text_log)
protected

◆ PrintText()

virtual void CRhinoTextOut::PrintText ( ON_TextLog text_log,
LPVOID  pData 
)
pure virtual

Description: You must override this function to actually display your text. Parameters: text_log [in] - Log attached to text file, history window or text dialog. pData [in] - Data passed to CRhinoTextOut::DisplayText method.

Implemented in CRhinoTextDump.

◆ PrintToClipboard()

CRhinoCommand::result CRhinoTextOut::PrintToClipboard ( )
protected

◆ PrintToDialog()

CRhinoCommand::result CRhinoTextOut::PrintToDialog ( )
protected

◆ PrintToFile()

CRhinoCommand::result CRhinoTextOut::PrintToFile ( )
protected

◆ PrintToHistory()

CRhinoCommand::result CRhinoTextOut::PrintToHistory ( )
protected

◆ ScrollTextDialogToBottom() [1/2]

bool CRhinoTextOut::ScrollTextDialogToBottom ( ) const

Description: If this is true and a text dialog is displayed then the edit control in the dialog will be scrolled to the bottom. Returns: Returns true if edit control should be scrolled to the bottom

◆ ScrollTextDialogToBottom() [2/2]

void CRhinoTextOut::ScrollTextDialogToBottom ( bool  b)

Description: If this is true and a text dialog is displayed then the edit control in the dialog will be scrolled to the bottom. Parameters: b [in] If true then edit control is scrolled to the bottom in the text dialog. Returns: Returns true if edit control should be scrolled to the bottom

◆ SetTextOutputMode()

void CRhinoTextOut::SetTextOutputMode ( output_mode  mode)

Description: Direct output to a specific context. Parameters: mode [in] - Place to direct output

◆ SetUseFileDialog()

bool CRhinoTextOut::SetUseFileDialog ( bool  b)

Description: Specify whether or not to use the file dialog when specifying a text file to write to. Parameters: b [in] If true then file dialog will be displayed when choosing the file option otherwise users will be prompted for a file name via the command line. Returns: Returns previous value

◆ TextOutputMode()

output_mode CRhinoTextOut::TextOutputMode ( ) const

Description: Place to direct output.

◆ UseFileDialog()

bool CRhinoTextOut::UseFileDialog ( ) const

Description: Specify whether or not to use the file dialog when specifying a text file to write to. Returns: Returns true if the file dialog when specifying a text file to write to.

◆ WindowTitle()

const wchar_t* CRhinoTextOut::WindowTitle ( ) const

For internal use

Description: String to use as dialog box title. Returns: Returns string to use as dialog box title.

Member Data Documentation

◆ m_dialog

class CRhRichTextDialog* CRhinoTextOut::m_dialog
protected

◆ m_hWnd

HWND CRhinoTextOut::m_hWnd
protected

◆ m_output_mode

output_mode CRhinoTextOut::m_output_mode
protected

◆ m_pData

LPVOID CRhinoTextOut::m_pData
protected

◆ m_scroll_dialog_to_bottom

bool CRhinoTextOut::m_scroll_dialog_to_bottom
protected

◆ m_use_file_dialog

bool CRhinoTextOut::m_use_file_dialog
protected

◆ m_wbuffer

class CRhTextOutWStringTextLog* CRhinoTextOut::m_wbuffer

◆ m_window_title

ON_wString CRhinoTextOut::m_window_title
protected