Lines 84-102
Link Here
|
84 |
// IDs for the controls and the menu commands |
84 |
// IDs for the controls and the menu commands |
85 |
enum |
85 |
enum |
86 |
{ |
86 |
{ |
87 |
// menu items |
87 |
// menu items |
88 |
FILE_QUIT = 1, |
88 |
ID_FILE_QUIT = 1, |
89 |
FILE_OPEN, |
89 |
ID_FILE_OPEN, |
90 |
FILE_BROWSE, |
90 |
ID_FILE_BROWSE, |
91 |
FILE_HTML_EDITMODE, |
91 |
ID_FILE_HTML_EDITMODE, |
92 |
FILE_TEST_HTML, |
92 |
ID_FILE_TEST_HTML, |
93 |
FILE_TEST_SELECT, |
93 |
ID_FILE_TEST_SELECT, |
94 |
FILE_TEST_HTMLSELECT, |
94 |
ID_FILE_TEST_HTMLSELECT, |
95 |
FILE_TEST_GETTEXT, |
95 |
ID_FILE_TEST_GETTEXT, |
96 |
FILE_TEST_HTMLGETTEXT, |
96 |
ID_FILE_TEST_HTMLGETTEXT, |
97 |
FILE_TEST_HOME, |
97 |
ID_FILE_TEST_HOME, |
98 |
FILE_TEST_ACTIVEX, |
98 |
ID_FILE_TEST_ACTIVEX, |
99 |
FILE_ABOUT, |
99 |
ID_FILE_ABOUT, |
100 |
|
100 |
|
101 |
// controls |
101 |
// controls |
102 |
ID_MSHTML = 501, |
102 |
ID_MSHTML = 501, |
Lines 111-137
Link Here
|
111 |
// handlers) which process them. It can be also done at run-time, but for the |
111 |
// handlers) which process them. It can be also done at run-time, but for the |
112 |
// simple menu events like this the static method is much simpler. |
112 |
// simple menu events like this the static method is much simpler. |
113 |
BEGIN_EVENT_TABLE(wxIEFrame, wxFrame) |
113 |
BEGIN_EVENT_TABLE(wxIEFrame, wxFrame) |
114 |
EVT_SIZE(wxIEFrame::OnSize) |
114 |
EVT_SIZE(wxIEFrame::OnSize) |
115 |
EVT_MENU(FILE_QUIT, wxIEFrame::OnQuit) |
115 |
EVT_MENU(ID_FILE_QUIT, wxIEFrame::OnQuit) |
116 |
EVT_MENU(FILE_BROWSE, wxIEFrame::OnBrowse) |
116 |
EVT_MENU(ID_FILE_BROWSE, wxIEFrame::OnBrowse) |
117 |
EVT_MENU(FILE_OPEN, wxIEFrame::OnOpen) |
117 |
EVT_MENU(ID_FILE_OPEN, wxIEFrame::OnOpen) |
118 |
EVT_MENU(FILE_HTML_EDITMODE, wxIEFrame::OnEditMode) |
118 |
EVT_MENU(ID_FILE_HTML_EDITMODE, wxIEFrame::OnEditMode) |
119 |
EVT_UPDATE_UI(FILE_HTML_EDITMODE, wxIEFrame::OnEditModeUI) |
119 |
EVT_UPDATE_UI(ID_FILE_HTML_EDITMODE, wxIEFrame::OnEditModeUI) |
120 |
EVT_MENU(FILE_TEST_HTML, wxIEFrame::OnTestHTML) |
120 |
EVT_MENU(ID_FILE_TEST_HTML, wxIEFrame::OnTestHTML) |
121 |
EVT_MENU(FILE_TEST_SELECT, wxIEFrame::OnTestSelect) |
121 |
EVT_MENU(ID_FILE_TEST_SELECT, wxIEFrame::OnTestSelect) |
122 |
EVT_MENU(FILE_TEST_HTMLSELECT, wxIEFrame::OnTestHTMLSelect) |
122 |
EVT_MENU(ID_FILE_TEST_HTMLSELECT, wxIEFrame::OnTestHTMLSelect) |
123 |
EVT_MENU(FILE_TEST_GETTEXT, wxIEFrame::OnTestGetText) |
123 |
EVT_MENU(ID_FILE_TEST_GETTEXT, wxIEFrame::OnTestGetText) |
124 |
EVT_MENU(FILE_TEST_HTMLGETTEXT, wxIEFrame::OnTestHTMLGetText) |
124 |
EVT_MENU(ID_FILE_TEST_HTMLGETTEXT, wxIEFrame::OnTestHTMLGetText) |
125 |
EVT_MENU(FILE_TEST_HOME, wxIEFrame::OnTestHome) |
125 |
EVT_MENU(ID_FILE_TEST_HOME, wxIEFrame::OnTestHome) |
126 |
EVT_MENU(FILE_TEST_ACTIVEX, wxIEFrame::OnTestActiveX) |
126 |
EVT_MENU(ID_FILE_TEST_ACTIVEX, wxIEFrame::OnTestActiveX) |
127 |
EVT_MENU(FILE_ABOUT, wxIEFrame::OnAbout) |
127 |
EVT_MENU(ID_FILE_ABOUT, wxIEFrame::OnAbout) |
128 |
|
128 |
|
129 |
// ActiveX Events |
129 |
// ActiveX Events |
130 |
EVT_ACTIVEX_DISPID(ID_MSHTML, DISPID_STATUSTEXTCHANGE, OnMSHTMLStatusTextChangeX) |
130 |
EVT_ACTIVEX_DISPID(ID_MSHTML, DISPID_STATUSTEXTCHANGE, wxIEFrame::OnMSHTMLStatusTextChangeX) |
131 |
EVT_ACTIVEX(ID_MSHTML, "BeforeNavigate2", OnMSHTMLBeforeNavigate2X) |
131 |
EVT_ACTIVEX(ID_MSHTML, "BeforeNavigate2", wxIEFrame::OnMSHTMLBeforeNavigate2X) |
132 |
EVT_ACTIVEX(ID_MSHTML, "TitleChange", OnMSHTMLTitleChangeX) |
132 |
EVT_ACTIVEX(ID_MSHTML, "TitleChange", wxIEFrame::OnMSHTMLTitleChangeX) |
133 |
EVT_ACTIVEX(ID_MSHTML, "NewWindow2", OnMSHTMLNewWindow2X) |
133 |
EVT_ACTIVEX(ID_MSHTML, "NewWindow2", wxIEFrame::OnMSHTMLNewWindow2X) |
134 |
EVT_ACTIVEX(ID_MSHTML, "ProgressChange", OnMSHTMLProgressChangeX) |
134 |
EVT_ACTIVEX(ID_MSHTML, "ProgressChange", wxIEFrame::OnMSHTMLProgressChangeX) |
135 |
END_EVENT_TABLE() |
135 |
END_EVENT_TABLE() |
136 |
|
136 |
|
137 |
// ---------------------------------------------------------------------------- |
137 |
// ---------------------------------------------------------------------------- |
Lines 143-172
Link Here
|
143 |
: wxFrame((wxFrame *)NULL, -1, title, pos, size) |
143 |
: wxFrame((wxFrame *)NULL, -1, title, pos, size) |
144 |
{ |
144 |
{ |
145 |
// set the frame icon |
145 |
// set the frame icon |
146 |
SetIcon(wxICON(wxIE)); |
146 |
// problems with resources, commenting by now |
|
|
147 |
// SetIcon(wxICON(wxIE)); |
147 |
|
148 |
|
148 |
// create a menu bar |
149 |
// create a menu bar |
149 |
wxMenu *menuFile = new wxMenu("", wxMENU_TEAROFF); |
150 |
wxMenu *menuFile = new wxMenu("", wxMENU_TEAROFF); |
150 |
|
151 |
|
151 |
// the "About" item should be in the help menu |
152 |
// the "About" item should be in the help menu |
152 |
wxMenu *helpMenu = new wxMenu; |
153 |
wxMenu *helpMenu = new wxMenu; |
153 |
helpMenu->Append(FILE_ABOUT, "&About...\tCtrl-A", "Show about dialog"); |
154 |
helpMenu->Append(ID_FILE_ABOUT, "&About...\tCtrl-A", "Show about dialog"); |
154 |
|
155 |
|
155 |
menuFile->Append(FILE_TEST_HTML, "Test HTML", "Demonstrates LoadString()"); |
156 |
menuFile->Append(ID_FILE_TEST_HTML, "Test HTML", "Demonstrates LoadString()"); |
156 |
menuFile->Append(FILE_OPEN, "Open HTML File", "Demonstrates LoadStream(istream *)"); |
157 |
menuFile->Append(ID_FILE_OPEN, "Open HTML File", "Demonstrates LoadStream(istream *)"); |
157 |
menuFile->Append(FILE_BROWSE, "Browse Web Page", "Demonstrates LoadUrl(url)"); |
158 |
menuFile->Append(ID_FILE_BROWSE, "Browse Web Page", "Demonstrates LoadUrl(url)"); |
158 |
menuFile->Append(FILE_HTML_EDITMODE, "Edit Mode", "Demonstrates editing html", true); |
159 |
menuFile->Append(ID_FILE_HTML_EDITMODE, "Edit Mode", "Demonstrates editing html", true); |
159 |
menuFile->AppendSeparator(); |
160 |
menuFile->AppendSeparator(); |
160 |
menuFile->Append(FILE_TEST_SELECT, "Get Selected Text", "Demonstrates GetStringSelection(false)"); |
161 |
menuFile->Append(ID_FILE_TEST_SELECT, "Get Selected Text", "Demonstrates GetStringSelection(false)"); |
161 |
menuFile->Append(FILE_TEST_HTMLSELECT, "Get HTML Selected Text", "Demonstrates GetStringSelection(true)"); |
162 |
menuFile->Append(ID_FILE_TEST_HTMLSELECT, "Get HTML Selected Text", "Demonstrates GetStringSelection(true)"); |
162 |
menuFile->AppendSeparator(); |
163 |
menuFile->AppendSeparator(); |
163 |
menuFile->Append(FILE_TEST_GETTEXT, "Get Text", "Demonstrates GetText(false)"); |
164 |
menuFile->Append(ID_FILE_TEST_GETTEXT, "Get Text", "Demonstrates GetText(false)"); |
164 |
menuFile->Append(FILE_TEST_HTMLGETTEXT, "Get HTML Text", "Demonstrates GetText(true)"); |
165 |
menuFile->Append(ID_FILE_TEST_HTMLGETTEXT, "Get HTML Text", "Demonstrates GetText(true)"); |
165 |
menuFile->Append(FILE_TEST_HOME, "Open Home Page", "Demonstrates GoHome()"); |
166 |
menuFile->Append(ID_FILE_TEST_HOME, "Open Home Page", "Demonstrates GoHome()"); |
166 |
menuFile->AppendSeparator(); |
167 |
menuFile->AppendSeparator(); |
167 |
menuFile->Append(FILE_TEST_ACTIVEX, "Display a ActiveX control", "Demonstrates the Generic ActiveX Container"); |
168 |
menuFile->Append(ID_FILE_TEST_ACTIVEX, "Display a ActiveX control", "Demonstrates the Generic ActiveX Container"); |
168 |
menuFile->AppendSeparator(); |
169 |
menuFile->AppendSeparator(); |
169 |
menuFile->Append(FILE_QUIT, "E&xit\tAlt-X", "Quit this program"); |
170 |
menuFile->Append(ID_FILE_QUIT, "E&xit\tAlt-X", "Quit this program"); |
170 |
|
171 |
|
171 |
// now append the freshly created menu to the menu bar... |
172 |
// now append the freshly created menu to the menu bar... |
172 |
wxMenuBar *menuBar = new wxMenuBar(); |
173 |
wxMenuBar *menuBar = new wxMenuBar(); |