1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxWebView sample
4 // Author: Marianne Gagnon
6 // Copyright: (c) 2010 Marianne Gagnon, Steven Lamerton
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
10 // ----------------------------------------------------------------------------
12 // ----------------------------------------------------------------------------
14 // For compilers that support precompilation, includes "wx/wx.h".
15 #include "wx/wxprec.h"
25 #include <wx/artprov.h>
26 #include <wx/notifmsg.h>
27 #include <wx/settings.h>
28 #include <wx/webview.h>
29 #include <wx/infobar.h>
31 #if !defined(__WXMSW__) && !defined(__WXPM__)
32 #include "../sample.xpm"
36 #include <wx/stc/stc.h>
38 #error "wxStyledTextControl is needed by this sample"
42 #include "refresh.xpm"
45 class WebApp
: public wxApp
48 virtual bool OnInit();
51 class WebFrame
: public wxFrame
56 void OnAnimationTimer(wxTimerEvent
& evt
);
58 void OnUrl(wxCommandEvent
& evt
);
59 void OnBack(wxCommandEvent
& evt
);
60 void OnForward(wxCommandEvent
& evt
);
61 void OnStop(wxCommandEvent
& evt
);
62 void OnReload(wxCommandEvent
& evt
);
63 void OnClearHistory(wxCommandEvent
& evt
);
64 void OnEnableHistory(wxCommandEvent
& evt
);
65 void OnNavigationRequest(wxWebNavigationEvent
& evt
);
66 void OnNavigationComplete(wxWebNavigationEvent
& evt
);
67 void OnDocumentLoaded(wxWebNavigationEvent
& evt
);
68 void OnNewWindow(wxWebNavigationEvent
& evt
);
69 void OnViewSourceRequest(wxCommandEvent
& evt
);
70 void OnToolsClicked(wxCommandEvent
& evt
);
71 void OnSetZoom(wxCommandEvent
& evt
);
72 void OnError(wxWebNavigationEvent
& evt
);
73 void OnPrint(wxCommandEvent
& evt
);
74 void OnCut(wxCommandEvent
& evt
);
75 void OnCopy(wxCommandEvent
& evt
);
76 void OnPaste(wxCommandEvent
& evt
);
77 void OnUndo(wxCommandEvent
& evt
);
78 void OnRedo(wxCommandEvent
& evt
);
85 wxToolBarToolBase
* m_toolbar_back
;
86 wxToolBarToolBase
* m_toolbar_forward
;
87 wxToolBarToolBase
* m_toolbar_stop
;
88 wxToolBarToolBase
* m_toolbar_reload
;
89 wxToolBarToolBase
* m_toolbar_tools
;
92 wxMenuItem
* m_tools_tiny
;
93 wxMenuItem
* m_tools_small
;
94 wxMenuItem
* m_tools_medium
;
95 wxMenuItem
* m_tools_large
;
96 wxMenuItem
* m_tools_largest
;
97 wxMenuItem
* m_tools_handle_navigation
;
98 wxMenuItem
* m_tools_handle_new_window
;
99 wxMenuItem
* m_tools_enable_history
;
100 wxMenuItem
* m_edit_cut
;
101 wxMenuItem
* m_edit_copy
;
102 wxMenuItem
* m_edit_paste
;
103 wxMenuItem
* m_edit_undo
;
104 wxMenuItem
* m_edit_redo
;
107 int m_animation_angle
;
110 wxStaticText
* m_info_text
;
113 class SourceViewDialog
: public wxDialog
116 SourceViewDialog(wxWindow
* parent
, wxString source
);
119 IMPLEMENT_APP(WebApp
)
121 // ============================================================================
123 // ============================================================================
125 bool WebApp::OnInit()
127 if ( !wxApp::OnInit() )
130 WebFrame
*frame
= new WebFrame();
136 WebFrame::WebFrame() : wxFrame(NULL
, wxID_ANY
, "wxWebView Sample")
138 // set the frame icon
139 SetIcon(wxICON(sample
));
140 SetTitle("wxWebView Sample");
143 m_animation_angle
= 0;
146 wxBoxSizer
* topsizer
= new wxBoxSizer(wxVERTICAL
);
148 // Create the toolbar
149 m_toolbar
= CreateToolBar(wxTB_TEXT
);
150 m_toolbar
->SetToolBitmapSize(wxSize(32, 32));
152 wxBitmap back
= wxArtProvider::GetBitmap(wxART_GO_BACK
, wxART_TOOLBAR
);
153 wxBitmap forward
= wxArtProvider::GetBitmap(wxART_GO_FORWARD
, wxART_TOOLBAR
);
155 wxBitmap stop
= wxArtProvider::GetBitmap("gtk-stop", wxART_TOOLBAR
);
157 wxBitmap stop
= wxBitmap(stop_xpm
);
160 wxBitmap refresh
= wxArtProvider::GetBitmap("gtk-refresh", wxART_TOOLBAR
);
162 wxBitmap refresh
= wxBitmap(refresh_xpm
);
165 m_toolbar_back
= m_toolbar
->AddTool(wxID_ANY
, _("Back"), back
);
166 m_toolbar_forward
= m_toolbar
->AddTool(wxID_ANY
, _("Forward"), forward
);
167 m_toolbar_stop
= m_toolbar
->AddTool(wxID_ANY
, _("Stop"), stop
);
168 m_toolbar_reload
= m_toolbar
->AddTool(wxID_ANY
, _("Reload"), refresh
);
169 m_url
= new wxTextCtrl(m_toolbar
, wxID_ANY
, wxT(""), wxDefaultPosition
, wxSize(400, -1), wxTE_PROCESS_ENTER
);
170 m_toolbar
->AddControl(m_url
, _("URL"));
171 m_toolbar_tools
= m_toolbar
->AddTool(wxID_ANY
, _("Menu"), wxBitmap(wxlogo_xpm
));
173 m_toolbar
->Realize();
175 // Create the info panel
176 m_info
= new wxInfoBar(this);
177 topsizer
->Add(m_info
, wxSizerFlags().Expand());
179 // Create the webview
180 m_browser
= wxWebView::New(this, wxID_ANY
, "http://www.wxwidgets.org");
181 topsizer
->Add(m_browser
, wxSizerFlags().Expand().Proportion(1));
185 //Set a more sensible size for web browsing
186 SetSize(wxSize(800, 600));
188 // Create a log window
189 new wxLogWindow(this, _("Logging"));
191 // Create the Tools menu
192 m_tools_menu
= new wxMenu();
193 wxMenuItem
* print
= m_tools_menu
->Append(wxID_ANY
, _("Print"));
194 wxMenuItem
* viewSource
= m_tools_menu
->Append(wxID_ANY
, _("View Source"));
195 m_tools_menu
->AppendSeparator();
196 m_tools_tiny
= m_tools_menu
->AppendCheckItem(wxID_ANY
, _("Tiny"));
197 m_tools_small
= m_tools_menu
->AppendCheckItem(wxID_ANY
, _("Small"));
198 m_tools_medium
= m_tools_menu
->AppendCheckItem(wxID_ANY
, _("Medium"));
199 m_tools_large
= m_tools_menu
->AppendCheckItem(wxID_ANY
, _("Large"));
200 m_tools_largest
= m_tools_menu
->AppendCheckItem(wxID_ANY
, _("Largest"));
201 m_tools_menu
->AppendSeparator();
202 m_tools_handle_navigation
= m_tools_menu
->AppendCheckItem(wxID_ANY
, _("Handle Navigation"));
203 m_tools_handle_new_window
= m_tools_menu
->AppendCheckItem(wxID_ANY
, _("Handle New Windows"));
204 m_tools_menu
->AppendSeparator();
205 wxMenuItem
* clearhist
= m_tools_menu
->Append(wxID_ANY
, _("Clear History"));
206 m_tools_enable_history
= m_tools_menu
->AppendCheckItem(wxID_ANY
, _("Enable History"));
208 //Create an editing menu
209 wxMenu
* editmenu
= new wxMenu();
210 m_edit_cut
= editmenu
->Append(wxID_ANY
, _("Cut"));
211 m_edit_copy
= editmenu
->Append(wxID_ANY
, _("Copy"));
212 m_edit_paste
= editmenu
->Append(wxID_ANY
, _("Paste"));
213 editmenu
->AppendSeparator();
214 m_edit_undo
= editmenu
->Append(wxID_ANY
, _("Undo"));
215 m_edit_redo
= editmenu
->Append(wxID_ANY
, _("Redo"));
217 m_tools_menu
->AppendSeparator();
218 m_tools_menu
->AppendSubMenu(editmenu
, "Edit");
220 //By default we want to handle navigation and new windows
221 m_tools_handle_navigation
->Check();
222 m_tools_handle_new_window
->Check();
223 m_tools_enable_history
->Check();
226 // Connect the toolbar events
227 Connect(m_toolbar_back
->GetId(), wxEVT_COMMAND_TOOL_CLICKED
,
228 wxCommandEventHandler(WebFrame::OnBack
), NULL
, this );
229 Connect(m_toolbar_forward
->GetId(), wxEVT_COMMAND_TOOL_CLICKED
,
230 wxCommandEventHandler(WebFrame::OnForward
), NULL
, this );
231 Connect(m_toolbar_stop
->GetId(), wxEVT_COMMAND_TOOL_CLICKED
,
232 wxCommandEventHandler(WebFrame::OnStop
), NULL
, this );
233 Connect(m_toolbar_reload
->GetId(), wxEVT_COMMAND_TOOL_CLICKED
,
234 wxCommandEventHandler(WebFrame::OnReload
),NULL
, this );
235 Connect(m_toolbar_tools
->GetId(), wxEVT_COMMAND_TOOL_CLICKED
,
236 wxCommandEventHandler(WebFrame::OnToolsClicked
), NULL
, this );
238 Connect(m_url
->GetId(), wxEVT_COMMAND_TEXT_ENTER
,
239 wxCommandEventHandler(WebFrame::OnUrl
), NULL
, this );
241 // Connect the webview events
242 Connect(m_browser
->GetId(), wxEVT_COMMAND_WEB_VIEW_NAVIGATING
,
243 wxWebNavigationEventHandler(WebFrame::OnNavigationRequest
), NULL
, this);
244 Connect(m_browser
->GetId(), wxEVT_COMMAND_WEB_VIEW_NAVIGATED
,
245 wxWebNavigationEventHandler(WebFrame::OnNavigationComplete
), NULL
, this);
246 Connect(m_browser
->GetId(), wxEVT_COMMAND_WEB_VIEW_LOADED
,
247 wxWebNavigationEventHandler(WebFrame::OnDocumentLoaded
), NULL
, this);
248 Connect(m_browser
->GetId(), wxEVT_COMMAND_WEB_VIEW_ERROR
,
249 wxWebNavigationEventHandler(WebFrame::OnError
), NULL
, this);
250 Connect(m_browser
->GetId(), wxEVT_COMMAND_WEB_VIEW_NEWWINDOW
,
251 wxWebNavigationEventHandler(WebFrame::OnNewWindow
), NULL
, this);
253 // Connect the menu events
254 Connect(viewSource
->GetId(), wxEVT_COMMAND_MENU_SELECTED
,
255 wxCommandEventHandler(WebFrame::OnViewSourceRequest
), NULL
, this );
256 Connect(print
->GetId(), wxEVT_COMMAND_MENU_SELECTED
,
257 wxCommandEventHandler(WebFrame::OnPrint
), NULL
, this );
258 Connect(m_tools_tiny
->GetId(), wxEVT_COMMAND_MENU_SELECTED
,
259 wxCommandEventHandler(WebFrame::OnSetZoom
), NULL
, this );
260 Connect(m_tools_small
->GetId(), wxEVT_COMMAND_MENU_SELECTED
,
261 wxCommandEventHandler(WebFrame::OnSetZoom
), NULL
, this );
262 Connect(m_tools_medium
->GetId(), wxEVT_COMMAND_MENU_SELECTED
,
263 wxCommandEventHandler(WebFrame::OnSetZoom
), NULL
, this );
264 Connect(m_tools_large
->GetId(), wxEVT_COMMAND_MENU_SELECTED
,
265 wxCommandEventHandler(WebFrame::OnSetZoom
), NULL
, this );
266 Connect(m_tools_largest
->GetId(), wxEVT_COMMAND_MENU_SELECTED
,
267 wxCommandEventHandler(WebFrame::OnSetZoom
), NULL
, this );
268 Connect(clearhist
->GetId(), wxEVT_COMMAND_MENU_SELECTED
,
269 wxCommandEventHandler(WebFrame::OnClearHistory
), NULL
, this );
270 Connect(m_tools_enable_history
->GetId(), wxEVT_COMMAND_MENU_SELECTED
,
271 wxCommandEventHandler(WebFrame::OnEnableHistory
), NULL
, this );
272 Connect(m_edit_cut
->GetId(), wxEVT_COMMAND_MENU_SELECTED
,
273 wxCommandEventHandler(WebFrame::OnCut
), NULL
, this );
274 Connect(m_edit_copy
->GetId(), wxEVT_COMMAND_MENU_SELECTED
,
275 wxCommandEventHandler(WebFrame::OnCopy
), NULL
, this );
276 Connect(m_edit_paste
->GetId(), wxEVT_COMMAND_MENU_SELECTED
,
277 wxCommandEventHandler(WebFrame::OnPaste
), NULL
, this );
278 Connect(m_edit_undo
->GetId(), wxEVT_COMMAND_MENU_SELECTED
,
279 wxCommandEventHandler(WebFrame::OnUndo
), NULL
, this );
280 Connect(m_edit_redo
->GetId(), wxEVT_COMMAND_MENU_SELECTED
,
281 wxCommandEventHandler(WebFrame::OnRedo
), NULL
, this );
284 void WebFrame::OnAnimationTimer(wxTimerEvent
& evt
)
286 m_animation_angle
+= 15;
287 if (m_animation_angle
> 360) m_animation_angle
-= 360;
289 wxBitmap
image(24, 24);
292 dc
.SelectObject(image
);
293 dc
.SetBackground(wxBrush(wxColour(255,0,255)));
296 if (m_animation_angle
>= 0 && m_animation_angle
<= 180)
298 dc
.SetBrush(*wxYELLOW_BRUSH
);
299 dc
.SetPen(*wxYELLOW_PEN
);
300 dc
.DrawCircle(16 - int(sin(m_animation_angle
*0.01745f
/* convert to radians */)*14.0f
),
301 16 + int(cos(m_animation_angle
*0.01745f
/* convert to radians */)*14.0f
), 3 );
304 dc
.DrawBitmap(wxBitmap(wxlogo_xpm
), 0, 0, true);
306 if (m_animation_angle
> 180)
308 dc
.SetBrush(*wxYELLOW_BRUSH
);
309 dc
.SetPen(*wxYELLOW_PEN
);
310 dc
.DrawCircle(16 - int(sin(m_animation_angle
*0.01745f
/* convert to radians */)*14.0f
),
311 16 + int(cos(m_animation_angle
*0.01745f
/* convert to radians */)*14.0f
), 3 );
314 image
.SetMask(new wxMask(image
, wxColour(255,0,255)));
315 m_toolbar
->SetToolNormalBitmap(m_toolbar_tools
->GetId(), image
);
319 * Method that retrieves the current state from the web control and updates the GUI
320 * the reflect this current state.
322 void WebFrame::UpdateState()
324 m_toolbar
->EnableTool( m_toolbar_back
->GetId(), m_browser
->CanGoBack() );
325 m_toolbar
->EnableTool( m_toolbar_forward
->GetId(), m_browser
->CanGoForward() );
327 if (m_browser
->IsBusy())
331 m_timer
= new wxTimer(this);
332 this->Connect(wxEVT_TIMER
, wxTimerEventHandler(WebFrame::OnAnimationTimer
), NULL
, this);
334 m_timer
->Start(100); // start animation timer
336 m_toolbar
->EnableTool( m_toolbar_stop
->GetId(), true );
340 if (m_timer
!= NULL
) m_timer
->Stop(); // stop animation timer
341 m_toolbar
->SetToolNormalBitmap(m_toolbar_tools
->GetId(), wxBitmap(wxlogo_xpm
));
342 m_toolbar
->EnableTool( m_toolbar_stop
->GetId(), false );
345 SetTitle( m_browser
->GetCurrentTitle() );
346 m_url
->SetValue( m_browser
->GetCurrentURL() );
350 * Callback invoked when user entered an URL and pressed enter
352 void WebFrame::OnUrl(wxCommandEvent
& evt
)
354 m_browser
->LoadUrl( m_url
->GetValue() );
359 * Callback invoked when user pressed the "back" button
361 void WebFrame::OnBack(wxCommandEvent
& evt
)
368 * Callback invoked when user pressed the "forward" button
370 void WebFrame::OnForward(wxCommandEvent
& evt
)
372 m_browser
->GoForward();
377 * Callback invoked when user pressed the "stop" button
379 void WebFrame::OnStop(wxCommandEvent
& evt
)
386 * Callback invoked when user pressed the "reload" button
388 void WebFrame::OnReload(wxCommandEvent
& evt
)
394 void WebFrame::OnClearHistory(wxCommandEvent
& evt
)
396 m_browser
->ClearHistory();
400 void WebFrame::OnEnableHistory(wxCommandEvent
& evt
)
402 m_browser
->EnableHistory(m_tools_enable_history
->IsChecked());
406 void WebFrame::OnCut(wxCommandEvent
& evt
)
411 void WebFrame::OnCopy(wxCommandEvent
& evt
)
416 void WebFrame::OnPaste(wxCommandEvent
& evt
)
421 void WebFrame::OnUndo(wxCommandEvent
& evt
)
426 void WebFrame::OnRedo(wxCommandEvent
& evt
)
432 * Callback invoked when there is a request to load a new page (for instance
433 * when the user clicks a link)
435 void WebFrame::OnNavigationRequest(wxWebNavigationEvent
& evt
)
437 wxLogMessage("%s", "Navigation request to '" + evt
.GetHref() + "' (target='" +
438 evt
.GetTarget() + "')");
440 wxASSERT(m_browser
->IsBusy());
442 //If we don't want to handle navigation then veto the event and navigation
443 //will not take place
444 if(!m_tools_handle_navigation
->IsChecked())
451 * Callback invoked when a navigation request was accepted
453 void WebFrame::OnNavigationComplete(wxWebNavigationEvent
& evt
)
455 wxLogMessage("%s", "Navigation complete; url='" + evt
.GetHref() + "'");
460 * Callback invoked when a page is finished loading
462 void WebFrame::OnDocumentLoaded(wxWebNavigationEvent
& evt
)
464 wxLogMessage("%s", "Document loaded; url='" + evt
.GetHref() + "'");
469 * On new window, we veto to stop extra windows appearing
471 void WebFrame::OnNewWindow(wxWebNavigationEvent
& evt
)
473 wxLogMessage("%s", "New window; url='" + evt
.GetHref() + "'");
475 //If we handle new window events then just load them in this window as we
476 //are a single window browser
477 if(m_tools_handle_new_window
->IsChecked())
478 m_browser
->LoadUrl(evt
.GetHref());
480 //We always veto because we handle the event, otherwise under windows a new
481 //internet explorer windowis created
488 * Invoked when user selects the "View Source" menu item
490 void WebFrame::OnViewSourceRequest(wxCommandEvent
& evt
)
492 SourceViewDialog
dlg(this, m_browser
->GetPageSource());
497 * Invoked when user selects the "Menu" item
499 void WebFrame::OnToolsClicked(wxCommandEvent
& evt
)
501 if(m_browser
->GetCurrentURL() == "")
504 m_tools_tiny
->Check(false);
505 m_tools_small
->Check(false);
506 m_tools_medium
->Check(false);
507 m_tools_large
->Check(false);
508 m_tools_largest
->Check(false);
510 wxWebViewZoom zoom
= m_browser
->GetZoom();
513 case wxWEB_VIEW_ZOOM_TINY
:
514 m_tools_tiny
->Check();
516 case wxWEB_VIEW_ZOOM_SMALL
:
517 m_tools_small
->Check();
519 case wxWEB_VIEW_ZOOM_MEDIUM
:
520 m_tools_medium
->Check();
522 case wxWEB_VIEW_ZOOM_LARGE
:
523 m_tools_large
->Check();
525 case wxWEB_VIEW_ZOOM_LARGEST
:
526 m_tools_largest
->Check();
530 m_edit_cut
->Enable(m_browser
->CanCut());
531 m_edit_copy
->Enable(m_browser
->CanCopy());
532 m_edit_paste
->Enable(m_browser
->CanPaste());
534 m_edit_undo
->Enable(m_browser
->CanUndo());
535 m_edit_redo
->Enable(m_browser
->CanRedo());
537 wxPoint position
= ScreenToClient( wxGetMousePosition() );
538 PopupMenu(m_tools_menu
, position
.x
, position
.y
);
542 * Invoked when user selects the zoom size in the menu
544 void WebFrame::OnSetZoom(wxCommandEvent
& evt
)
546 if (evt
.GetId() == m_tools_tiny
->GetId())
548 m_browser
->SetZoom(wxWEB_VIEW_ZOOM_TINY
);
550 else if (evt
.GetId() == m_tools_small
->GetId())
552 m_browser
->SetZoom(wxWEB_VIEW_ZOOM_SMALL
);
554 else if (evt
.GetId() == m_tools_medium
->GetId())
556 m_browser
->SetZoom(wxWEB_VIEW_ZOOM_MEDIUM
);
558 else if (evt
.GetId() == m_tools_large
->GetId())
560 m_browser
->SetZoom(wxWEB_VIEW_ZOOM_LARGE
);
562 else if (evt
.GetId() == m_tools_largest
->GetId())
564 m_browser
->SetZoom(wxWEB_VIEW_ZOOM_LARGEST
);
573 * Callback invoked when a loading error occurs
575 void WebFrame::OnError(wxWebNavigationEvent
& evt
)
577 wxString errorCategory
;
578 switch (evt
.GetInt())
580 case wxWEB_NAV_ERR_CONNECTION
:
581 errorCategory
= "wxWEB_NAV_ERR_CONNECTION";
584 case wxWEB_NAV_ERR_CERTIFICATE
:
585 errorCategory
= "wxWEB_NAV_ERR_CERTIFICATE";
588 case wxWEB_NAV_ERR_AUTH
:
589 errorCategory
= "wxWEB_NAV_ERR_AUTH";
592 case wxWEB_NAV_ERR_SECURITY
:
593 errorCategory
= "wxWEB_NAV_ERR_SECURITY";
596 case wxWEB_NAV_ERR_NOT_FOUND
:
597 errorCategory
= "wxWEB_NAV_ERR_NOT_FOUND";
600 case wxWEB_NAV_ERR_REQUEST
:
601 errorCategory
= "wxWEB_NAV_ERR_REQUEST";
604 case wxWEB_NAV_ERR_USER_CANCELLED
:
605 errorCategory
= "wxWEB_NAV_ERR_USER_CANCELLED";
608 case wxWEB_NAV_ERR_OTHER
:
609 errorCategory
= "wxWEB_NAV_ERR_OTHER";
613 wxLogMessage("Error; url='" + evt
.GetHref() + "', error='" + errorCategory
+ "' (" + evt
.GetString() + ")");
615 //Show the info bar with an error
616 m_info
->ShowMessage(_("An error occurred loading ") + evt
.GetHref() + "\n" +
617 "'" + errorCategory
+ "' (" + evt
.GetString() + ")", wxICON_ERROR
);
623 * Invoked when user selects "Print" from the menu
625 void WebFrame::OnPrint(wxCommandEvent
& evt
)
630 SourceViewDialog::SourceViewDialog(wxWindow
* parent
, wxString source
) :
631 wxDialog(parent
, wxID_ANY
, "Source Code",
632 wxDefaultPosition
, wxSize(700,500),
633 wxDEFAULT_DIALOG_STYLE
| wxRESIZE_BORDER
)
635 wxStyledTextCtrl
* text
= new wxStyledTextCtrl(this, wxID_ANY
);
636 text
->SetMarginWidth(1, 30);
637 text
->SetMarginType(1, wxSTC_MARGIN_NUMBER
);
638 text
->SetText(source
);
640 text
->StyleClearAll();
641 text
->SetLexer(wxSTC_LEX_HTML
);
642 text
->StyleSetForeground(wxSTC_H_DOUBLESTRING
, wxColour(255,0,0));
643 text
->StyleSetForeground(wxSTC_H_SINGLESTRING
, wxColour(255,0,0));
644 text
->StyleSetForeground(wxSTC_H_ENTITY
, wxColour(255,0,0));
645 text
->StyleSetForeground(wxSTC_H_TAG
, wxColour(0,150,0));
646 text
->StyleSetForeground(wxSTC_H_TAGUNKNOWN
, wxColour(0,150,0));
647 text
->StyleSetForeground(wxSTC_H_ATTRIBUTE
, wxColour(0,0,150));
648 text
->StyleSetForeground(wxSTC_H_ATTRIBUTEUNKNOWN
, wxColour(0,0,150));
649 text
->StyleSetForeground(wxSTC_H_COMMENT
, wxColour(150,150,150));
651 wxBoxSizer
* sizer
= new wxBoxSizer(wxVERTICAL
);
652 sizer
->Add(text
, 1, wxEXPAND
);