include/ax/ax_textinputdialog.h

Go to the documentation of this file.
00001 
00002 // Name:        ax_textinputdialog.h
00003 // Purpose:     
00004 // Author:      Julian Smart
00005 // Modified by: 
00006 // Created:     01/04/2009 14:48:08
00007 // RCS-ID:      
00008 // Copyright:   
00009 // Licence:     New BSD License
00011 
00012 #ifndef _AX_TEXTINPUTDIALOG_H_
00013 #define _AX_TEXTINPUTDIALOG_H_
00014 
00015 class AxSpeech;
00016 
00017 /*
00018  * Includes
00019  */
00020 
00022 #include "wx/valgen.h"
00024 
00025 /*
00026  * Forward declarations
00027  */
00028 
00030 class AxTextCtrl;
00032 
00033 class wxShortcutManager;
00034 
00035 // Pass to give it a multiline text control
00036 #define axTEXTDIALOG_MULTILINE 0x02
00037 
00038 /*
00039  * Control identifiers
00040  */
00041 
00043 #define SYMBOL_AXTEXTINPUTDIALOG_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL
00044 #define SYMBOL_AXTEXTINPUTDIALOG_TITLE _("Text Input")
00045 #define SYMBOL_AXTEXTINPUTDIALOG_IDNAME wxID_ANY
00046 #define SYMBOL_AXTEXTINPUTDIALOG_SIZE wxSize(400, 300)
00047 #define SYMBOL_AXTEXTINPUTDIALOG_POSITION wxDefaultPosition
00049 
00050 
00058 class AxTextInputDialog: public wxDialog
00059 {    
00060     DECLARE_DYNAMIC_CLASS( AxTextInputDialog )
00061     DECLARE_EVENT_TABLE()
00062 
00063 public:
00065     AxTextInputDialog();
00066     AxTextInputDialog( wxWindow* parent,
00067         const wxString& message, const wxString& caption, const wxString& defaultValue,
00068         const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = SYMBOL_AXTEXTINPUTDIALOG_STYLE );
00069 
00071     bool Create( wxWindow* parent,
00072         const wxString& message, const wxString& caption, const wxString& defaultValue,
00073         const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = SYMBOL_AXTEXTINPUTDIALOG_STYLE );
00074 
00076     ~AxTextInputDialog();
00077 
00079     void Init();
00080 
00082     void CreateControls(const wxString& defaultValue, const wxString& message);
00083     
00084     wxString GetValue() const { return m_value; }
00085     void SetValue(const wxString& value) { m_value = value; }
00086     
00087     wxString GetDescription() const { return m_description; }
00088     void SetDescription(const wxString& descr) { m_description = descr; }
00089 
00090     void SetSpeech(AxSpeech* speech);
00091     AxSpeech* GetSpeech() const { return m_speech; }
00092 
00093     void SetShortcutManager(wxShortcutManager* shortcuts);
00094 
00095     void SpeakCurrentText(bool initialView = false);
00096 
00098 
00100     void OnInitDialog( wxInitDialogEvent& event );
00101 
00103     void OnAnyTextUpdated( wxCommandEvent& event );
00104 
00106     void OnChar( wxKeyEvent& event );
00107 
00109 
00111 
00113     wxBitmap GetBitmapResource( const wxString& name );
00114 
00116     wxIcon GetIconResource( const wxString& name );
00118 
00120     static bool ShowToolTips();
00121 
00123     wxStaticText* m_descriptionCtrl;
00124     AxTextCtrl* m_valueCtrl;
00126 
00127     wxString    m_value;
00128     wxString    m_description;
00129 
00130     AxSpeech*   m_speech;
00131     bool        m_disableEvents;
00132 };
00133 
00134 #endif
00135     // _AX_TEXTINPUTDIALOG_H_

Generated on Wed May 6 19:20:18 2009 for AxTk by  doxygen 1.5.1