-/////////////////////////////////////////////////////////////////////////////\r
-// Name: wx/richtext/richtextimagedlg.h\r
-// Purpose: \r
-// Author: Mingquan Yang\r
-// Modified by: \r
-// Created: Wed 02 Jun 2010 11:27:23 CST\r
-// RCS-ID: \r
-// Copyright: (c) Mingquan Yang\r
-// Licence: wxWindows licence\r
-/////////////////////////////////////////////////////////////////////////////\r
-\r
-#include "wx/dialog.h"\r
-\r
-#ifndef _RICHTEXTIMAGEDLG_H_\r
-#define _RICHTEXTIMAGEDLG_H_\r
-\r
-/*!\r
- * Includes\r
- */\r
-#include "wx/richtext/richtextbuffer.h"\r
-\r
-/*!\r
- * Forward declarations\r
- */\r
-\r
-class WXDLLIMPEXP_FWD_CORE wxButton;\r
-class WXDLLIMPEXP_FWD_CORE wxComboBox;\r
-class WXDLLIMPEXP_FWD_CORE wxTextCtrl;\r
-\r
-/*!\r
- * Control identifiers\r
- */\r
-\r
-////@begin control identifiers\r
-#define SYMBOL_WXRICHTEXTIMAGEDIALOG_STYLE wxDEFAULT_DIALOG_STYLE|wxTAB_TRAVERSAL\r
-#define SYMBOL_WXRICHTEXTIMAGEDIALOG_TITLE _("Image Properties")\r
-#define SYMBOL_WXRICHTEXTIMAGEDIALOG_IDNAME ID_WXRICHTEXTIMAGEPAGE\r
-#define SYMBOL_WXRICHTEXTIMAGEDIALOG_SIZE wxSize(400, 300)\r
-#define SYMBOL_WXRICHTEXTIMAGEDIALOG_POSITION wxDefaultPosition\r
-////@end control identifiers\r
-\r
-\r
-/*!\r
- * wxRichTextImageDialog class declaration\r
- */\r
-\r
-class WXDLLIMPEXP_RICHTEXT wxRichTextImageDialog: public wxDialog\r
-{ \r
- DECLARE_DYNAMIC_CLASS( wxRichTextImageDialog )\r
- DECLARE_EVENT_TABLE()\r
-\r
-public:\r
- /// Constructors\r
- wxRichTextImageDialog();\r
- wxRichTextImageDialog( wxWindow* parent, wxWindowID id = SYMBOL_WXRICHTEXTIMAGEDIALOG_IDNAME, const wxString& caption = SYMBOL_WXRICHTEXTIMAGEDIALOG_TITLE, const wxPoint& pos = SYMBOL_WXRICHTEXTIMAGEDIALOG_POSITION, const wxSize& size = SYMBOL_WXRICHTEXTIMAGEDIALOG_SIZE, long style = SYMBOL_WXRICHTEXTIMAGEDIALOG_STYLE );\r
-\r
- /// Creation\r
- bool Create( wxWindow* parent, wxWindowID id = SYMBOL_WXRICHTEXTIMAGEDIALOG_IDNAME, const wxString& caption = SYMBOL_WXRICHTEXTIMAGEDIALOG_TITLE, const wxPoint& pos = SYMBOL_WXRICHTEXTIMAGEDIALOG_POSITION, const wxSize& size = SYMBOL_WXRICHTEXTIMAGEDIALOG_SIZE, long style = SYMBOL_WXRICHTEXTIMAGEDIALOG_STYLE );\r
-\r
- /// Destructor\r
- ~wxRichTextImageDialog();\r
-\r
- /// Initialises member variables\r
- void Init();\r
-\r
- /// Creates the controls and sizers\r
- void CreateControls();\r
-\r
-////@begin wxRichTextImageDialog event handler declarations\r
-\r
- /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXTIMAGEDIALOG_PARA_UP\r
- void OnRichtextimagedialogParaUpClick( wxCommandEvent& event );\r
-\r
- /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXTIMAGEDIALOG_DOWN\r
- void OnRichtextimagedialogDownClick( wxCommandEvent& event );\r
-\r
-////@end wxRichTextImageDialog event handler declarations\r
-\r
-////@begin wxRichTextImageDialog member function declarations\r
-\r
- /// Retrieves bitmap resources\r
- wxBitmap GetBitmapResource( const wxString& name );\r
-\r
- /// Retrieves icon resources\r
- wxIcon GetIconResource( const wxString& name );\r
-////@end wxRichTextImageDialog member function declarations\r
-\r
- /// Should we show tooltips?\r
- static bool ShowToolTips();\r
-\r
- /// Set the image attribute\r
- void SetImageAttr(const wxRichTextAnchoredObjectAttr& attr);\r
- wxRichTextImage* ApplyImageAttr();\r
-\r
- /// Set the anchored object\r
- void SetImageObject(wxRichTextImage *image, wxRichTextBuffer* buffer);\r
-\r
- virtual bool TransferDataFromWindow();\r
- virtual bool TransferDataToWindow();\r
-private:\r
- /// Convert CM to MM\r
- bool ConvertFromString(const wxString& string, int& ret, int scale);\r
-private:\r
- wxRichTextAnchoredObjectAttr m_attr;\r
-////@begin wxRichTextImageDialog member variables\r
- wxComboBox* m_alignment;\r
- wxComboBox* m_float;\r
- wxTextCtrl* m_width;\r
- wxComboBox* m_unitsW;\r
- wxTextCtrl* m_height;\r
- wxComboBox* m_unitsH;\r
- wxTextCtrl* m_offset;\r
- wxComboBox* m_unitsOffset;\r
- wxButton* m_saveButton;\r
- wxButton* m_cancelButton;\r
- /// Control identifiers\r
- enum {\r
- ID_WXRICHTEXTIMAGEPAGE = 10015,\r
- ID_COMBOBOX_ALIGN = 10016,\r
- ID_RICHTEXTIMAGEDIALOG_FLOATING_MODE = 10017,\r
- ID_RICHTEXTIMAGEDIALOG_WIDTH = 10018,\r
- ID_RICHTEXTIMAGEDIALOG_UNITS_W = 10019,\r
- ID_RICHTEXTIMAGEDIALOG_HEIGHT = 10020,\r
- ID_RICHTEXTIMAGEDIALOG_UNITS_H = 10021,\r
- ID_RICHTEXTIMAGEDIALOG_OFFSET = 10022,\r
- ID_RICHTEXTIMAGEDIALOG_OFFSET_UNITS = 10023,\r
- ID_RICHTEXTIMAGEDIALOG_PARA_UP = 10024,\r
- ID_RICHTEXTIMAGEDIALOG_DOWN = 10025\r
- };\r
-////@end wxRichTextImageDialog member variables\r
-\r
- wxRichTextBuffer* m_buffer;\r
- wxRichTextObject* m_image;\r
- wxRichTextObject* m_parent;\r
-};\r
-\r
-#endif\r
- // _RICHTEXTIMAGEDLG_H_\r
+/////////////////////////////////////////////////////////////////////////////
+// Name: wx/richtext/richtextimagedlg.h
+// Purpose:
+// Author: Mingquan Yang
+// Modified by:
+// Created: Wed 02 Jun 2010 11:27:23 CST
+// RCS-ID:
+// Copyright: (c) Mingquan Yang
+// Licence: wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+#include "wx/dialog.h"
+
+#ifndef _RICHTEXTIMAGEDLG_H_
+#define _RICHTEXTIMAGEDLG_H_
+
+/*!
+ * Includes
+ */
+#include "wx/richtext/richtextbuffer.h"
+
+/*!
+ * Forward declarations
+ */
+
+class WXDLLIMPEXP_FWD_CORE wxButton;
+class WXDLLIMPEXP_FWD_CORE wxComboBox;
+class WXDLLIMPEXP_FWD_CORE wxTextCtrl;
+
+/*!
+ * Control identifiers
+ */
+
+////@begin control identifiers
+#define SYMBOL_WXRICHTEXTIMAGEDIALOG_STYLE wxDEFAULT_DIALOG_STYLE|wxTAB_TRAVERSAL
+#define SYMBOL_WXRICHTEXTIMAGEDIALOG_TITLE _("Image Properties")
+#define SYMBOL_WXRICHTEXTIMAGEDIALOG_IDNAME ID_WXRICHTEXTIMAGEPAGE
+#define SYMBOL_WXRICHTEXTIMAGEDIALOG_SIZE wxSize(400, 300)
+#define SYMBOL_WXRICHTEXTIMAGEDIALOG_POSITION wxDefaultPosition
+////@end control identifiers
+
+
+/*!
+ * wxRichTextImageDialog class declaration
+ */
+
+class WXDLLIMPEXP_RICHTEXT wxRichTextImageDialog: public wxDialog
+{
+ DECLARE_DYNAMIC_CLASS( wxRichTextImageDialog )
+ DECLARE_EVENT_TABLE()
+
+public:
+ /// Constructors
+ wxRichTextImageDialog();
+ wxRichTextImageDialog( wxWindow* parent, wxWindowID id = SYMBOL_WXRICHTEXTIMAGEDIALOG_IDNAME, const wxString& caption = SYMBOL_WXRICHTEXTIMAGEDIALOG_TITLE, const wxPoint& pos = SYMBOL_WXRICHTEXTIMAGEDIALOG_POSITION, const wxSize& size = SYMBOL_WXRICHTEXTIMAGEDIALOG_SIZE, long style = SYMBOL_WXRICHTEXTIMAGEDIALOG_STYLE );
+
+ /// Creation
+ bool Create( wxWindow* parent, wxWindowID id = SYMBOL_WXRICHTEXTIMAGEDIALOG_IDNAME, const wxString& caption = SYMBOL_WXRICHTEXTIMAGEDIALOG_TITLE, const wxPoint& pos = SYMBOL_WXRICHTEXTIMAGEDIALOG_POSITION, const wxSize& size = SYMBOL_WXRICHTEXTIMAGEDIALOG_SIZE, long style = SYMBOL_WXRICHTEXTIMAGEDIALOG_STYLE );
+
+ /// Destructor
+ ~wxRichTextImageDialog();
+
+ /// Initialises member variables
+ void Init();
+
+ /// Creates the controls and sizers
+ void CreateControls();
+
+ /// Set the dimension into the value and units controls
+ void SetDimensionValue(wxTextAttrDimension& dim, wxTextCtrl* valueCtrl, wxComboBox* unitsCtrl);
+
+ /// Get the dimension from the value and units controls
+ void GetDimensionValue(wxTextAttrDimension& dim, wxTextCtrl* valueCtrl, wxComboBox* unitsCtrl);
+
+////@begin wxRichTextImageDialog event handler declarations
+
+ /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXTIMAGEDIALOG_PARA_UP
+ void OnRichtextimagedialogParaUpClick( wxCommandEvent& event );
+
+ /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXTIMAGEDIALOG_DOWN
+ void OnRichtextimagedialogDownClick( wxCommandEvent& event );
+
+////@end wxRichTextImageDialog event handler declarations
+
+////@begin wxRichTextImageDialog member function declarations
+
+ /// Retrieves bitmap resources
+ wxBitmap GetBitmapResource( const wxString& name );
+
+ /// Retrieves icon resources
+ wxIcon GetIconResource( const wxString& name );
+////@end wxRichTextImageDialog member function declarations
+
+ /// Should we show tooltips?
+ static bool ShowToolTips();
+
+ /// Set the image attribute
+ void SetImageAttr(const wxRichTextAttr& textAttr);
+ wxRichTextImage* ApplyImageAttr();
+
+ /// Set the anchored object
+ void SetImageObject(wxRichTextImage *image, wxRichTextBuffer* buffer);
+
+ virtual bool TransferDataFromWindow();
+ virtual bool TransferDataToWindow();
+private:
+ /// Convert CM to MM
+ bool ConvertFromString(const wxString& string, int& ret, int scale);
+private:
+ wxRichTextAttr m_textAttr;
+
+////@begin wxRichTextImageDialog member variables
+ wxComboBox* m_float;
+ wxTextCtrl* m_width;
+ wxComboBox* m_unitsW;
+ wxTextCtrl* m_height;
+ wxComboBox* m_unitsH;
+ wxTextCtrl* m_offset;
+ wxComboBox* m_unitsOffset;
+ wxButton* m_saveButton;
+ wxButton* m_cancelButton;
+ /// Control identifiers
+ enum {
+ ID_WXRICHTEXTIMAGEPAGE = 10015,
+ ID_RICHTEXTIMAGEDIALOG_FLOATING_MODE = 10017,
+ ID_RICHTEXTIMAGEDIALOG_WIDTH = 10018,
+ ID_RICHTEXTIMAGEDIALOG_UNITS_W = 10019,
+ ID_RICHTEXTIMAGEDIALOG_HEIGHT = 10020,
+ ID_RICHTEXTIMAGEDIALOG_UNITS_H = 10021,
+ ID_RICHTEXTIMAGEDIALOG_OFFSET = 10022,
+ ID_RICHTEXTIMAGEDIALOG_OFFSET_UNITS = 10023,
+ ID_RICHTEXTIMAGEDIALOG_PARA_UP = 10024,
+ ID_RICHTEXTIMAGEDIALOG_DOWN = 10025
+ };
+////@end wxRichTextImageDialog member variables
+
+ wxRichTextBuffer* m_buffer;
+ wxRichTextObject* m_image;
+ wxRichTextObject* m_parent;
+};
+
+#endif
+ // _RICHTEXTIMAGEDLG_H_