]> git.saurik.com Git - wxWidgets.git/blob - include/wx/richtext/richtextimagedlg.h
12c2aa1045483fc3ce4b6bbad7ab11f5e328f962
[wxWidgets.git] / include / wx / richtext / richtextimagedlg.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/richtext/richtextimagedlg.h
3 // Purpose:
4 // Author: Mingquan Yang
5 // Modified by:
6 // Created: Wed 02 Jun 2010 11:27:23 CST
7 // RCS-ID:
8 // Copyright: (c) Mingquan Yang
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #include "wx/dialog.h"
13
14 #ifndef _RICHTEXTIMAGEDLG_H_
15 #define _RICHTEXTIMAGEDLG_H_
16
17 /*!
18 * Includes
19 */
20 #include "wx/richtext/richtextbuffer.h"
21
22 /*!
23 * Forward declarations
24 */
25
26 class WXDLLIMPEXP_FWD_CORE wxButton;
27 class WXDLLIMPEXP_FWD_CORE wxComboBox;
28 class WXDLLIMPEXP_FWD_CORE wxTextCtrl;
29
30 /*!
31 * Control identifiers
32 */
33
34 ////@begin control identifiers
35 #define SYMBOL_WXRICHTEXTIMAGEDIALOG_STYLE wxDEFAULT_DIALOG_STYLE|wxTAB_TRAVERSAL
36 #define SYMBOL_WXRICHTEXTIMAGEDIALOG_TITLE _("Image Properties")
37 #define SYMBOL_WXRICHTEXTIMAGEDIALOG_IDNAME ID_WXRICHTEXTIMAGEPAGE
38 #define SYMBOL_WXRICHTEXTIMAGEDIALOG_SIZE wxSize(400, 300)
39 #define SYMBOL_WXRICHTEXTIMAGEDIALOG_POSITION wxDefaultPosition
40 ////@end control identifiers
41
42
43 /*!
44 * wxRichTextImageDialog class declaration
45 */
46
47 class WXDLLIMPEXP_RICHTEXT wxRichTextImageDialog: public wxDialog
48 {
49 DECLARE_DYNAMIC_CLASS( wxRichTextImageDialog )
50 DECLARE_EVENT_TABLE()
51
52 public:
53 /// Constructors
54 wxRichTextImageDialog();
55 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 );
56
57 /// Creation
58 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 );
59
60 /// Destructor
61 ~wxRichTextImageDialog();
62
63 /// Initialises member variables
64 void Init();
65
66 /// Creates the controls and sizers
67 void CreateControls();
68
69 ////@begin wxRichTextImageDialog event handler declarations
70
71 /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXTIMAGEDIALOG_PARA_UP
72 void OnRichtextimagedialogParaUpClick( wxCommandEvent& event );
73
74 /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXTIMAGEDIALOG_DOWN
75 void OnRichtextimagedialogDownClick( wxCommandEvent& event );
76
77 ////@end wxRichTextImageDialog event handler declarations
78
79 ////@begin wxRichTextImageDialog member function declarations
80
81 /// Retrieves bitmap resources
82 wxBitmap GetBitmapResource( const wxString& name );
83
84 /// Retrieves icon resources
85 wxIcon GetIconResource( const wxString& name );
86 ////@end wxRichTextImageDialog member function declarations
87
88 /// Should we show tooltips?
89 static bool ShowToolTips();
90
91 /// Set the image attribute
92 void SetImageAttr(const wxRichTextAnchoredObjectAttr& attr);
93 wxRichTextImage* ApplyImageAttr();
94
95 /// Set the anchored object
96 void SetImageObject(wxRichTextImage *image, wxRichTextBuffer* buffer);
97
98 virtual bool TransferDataFromWindow();
99 virtual bool TransferDataToWindow();
100 private:
101 /// Convert CM to MM
102 bool ConvertFromString(const wxString& string, int& ret, int scale);
103 private:
104 wxRichTextAnchoredObjectAttr m_attr;
105 ////@begin wxRichTextImageDialog member variables
106 wxComboBox* m_alignment;
107 wxComboBox* m_float;
108 wxTextCtrl* m_width;
109 wxComboBox* m_unitsW;
110 wxTextCtrl* m_height;
111 wxComboBox* m_unitsH;
112 wxTextCtrl* m_offset;
113 wxComboBox* m_unitsOffset;
114 wxButton* m_saveButton;
115 wxButton* m_cancelButton;
116 /// Control identifiers
117 enum {
118 ID_WXRICHTEXTIMAGEPAGE = 10015,
119 ID_COMBOBOX_ALIGN = 10016,
120 ID_RICHTEXTIMAGEDIALOG_FLOATING_MODE = 10017,
121 ID_RICHTEXTIMAGEDIALOG_WIDTH = 10018,
122 ID_RICHTEXTIMAGEDIALOG_UNITS_W = 10019,
123 ID_RICHTEXTIMAGEDIALOG_HEIGHT = 10020,
124 ID_RICHTEXTIMAGEDIALOG_UNITS_H = 10021,
125 ID_RICHTEXTIMAGEDIALOG_OFFSET = 10022,
126 ID_RICHTEXTIMAGEDIALOG_OFFSET_UNITS = 10023,
127 ID_RICHTEXTIMAGEDIALOG_PARA_UP = 10024,
128 ID_RICHTEXTIMAGEDIALOG_DOWN = 10025
129 };
130 ////@end wxRichTextImageDialog member variables
131
132 wxRichTextBuffer* m_buffer;
133 wxRichTextObject* m_image;
134 wxRichTextObject* m_parent;
135 };
136
137 #endif
138 // _RICHTEXTIMAGEDLG_H_