some more SetIcon() calls added; cleanup indentation of some samples
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58745 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1,6 +1,12 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: test.cpp
|
// Name: about.cpp
|
||||||
// Purpose: wxHtml testing example
|
// Purpose: wxHtml sample: about dialog test
|
||||||
|
// Author: ?
|
||||||
|
// Modified by:
|
||||||
|
// Created: ?
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) wxWidgets team
|
||||||
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
// For compilers that support precompilation, includes "wx/wx.h".
|
// For compilers that support precompilation, includes "wx/wx.h".
|
||||||
@@ -21,6 +27,11 @@
|
|||||||
#include "wx/wxhtml.h"
|
#include "wx/wxhtml.h"
|
||||||
#include "wx/statline.h"
|
#include "wx/statline.h"
|
||||||
|
|
||||||
|
#ifndef __WXMSW__
|
||||||
|
#include "../../sample.xpm"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// private classes
|
// private classes
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -109,6 +120,8 @@ bool MyApp::OnInit()
|
|||||||
MyFrame::MyFrame(const wxString& title)
|
MyFrame::MyFrame(const wxString& title)
|
||||||
: wxFrame((wxFrame *)NULL, wxID_ANY, title)
|
: wxFrame((wxFrame *)NULL, wxID_ANY, title)
|
||||||
{
|
{
|
||||||
|
SetIcon(wxICON(sample));
|
||||||
|
|
||||||
// create a menu bar
|
// create a menu bar
|
||||||
wxMenu *menuFile = new wxMenu;
|
wxMenu *menuFile = new wxMenu;
|
||||||
|
|
||||||
|
@@ -1,6 +1,12 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: test.cpp
|
// Name: help.cpp
|
||||||
// Purpose: wxHtml testing example
|
// Purpose: wxHtml sample: help test
|
||||||
|
// Author: ?
|
||||||
|
// Modified by:
|
||||||
|
// Created: ?
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) wxWidgets team
|
||||||
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
// For compilers that support precompilation, includes "wx/wx.h".
|
// For compilers that support precompilation, includes "wx/wx.h".
|
||||||
@@ -22,6 +28,11 @@
|
|||||||
#include "wx/filesys.h"
|
#include "wx/filesys.h"
|
||||||
#include "wx/fs_zip.h"
|
#include "wx/fs_zip.h"
|
||||||
|
|
||||||
|
#ifndef __WXMSW__
|
||||||
|
#include "../../sample.xpm"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// private classes
|
// private classes
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -138,6 +149,8 @@
|
|||||||
: wxFrame((wxFrame *)NULL, wxID_ANY, title, pos, size),
|
: wxFrame((wxFrame *)NULL, wxID_ANY, title, pos, size),
|
||||||
help(wxHF_DEFAULT_STYLE | wxHF_OPEN_FILES)
|
help(wxHF_DEFAULT_STYLE | wxHF_OPEN_FILES)
|
||||||
{
|
{
|
||||||
|
SetIcon(wxICON(sample));
|
||||||
|
|
||||||
// create a menu bar
|
// create a menu bar
|
||||||
wxMenu *menuFile = new wxMenu;
|
wxMenu *menuFile = new wxMenu;
|
||||||
|
|
||||||
@@ -189,7 +202,3 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1,9 +1,16 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: helpview.cpp
|
// Name: printing.cpp
|
||||||
// Purpose: wxHtml help browser
|
// Purpose: wxHtml sample: help browser
|
||||||
|
// Author: ?
|
||||||
|
// Modified by:
|
||||||
|
// Created: ?
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) wxWidgets team
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
// Please note: see utils/helpview for a more fully-featured
|
// Please note: see utils/helpview for a more fully-featured
|
||||||
// standalone help browser.
|
// standalone help browser.
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
// For compilers that support precompilation, includes "wx/wx.h".
|
// For compilers that support precompilation, includes "wx/wx.h".
|
||||||
#include "wx/wxprec.h"
|
#include "wx/wxprec.h"
|
||||||
@@ -24,11 +31,11 @@
|
|||||||
#include "wx/log.h"
|
#include "wx/log.h"
|
||||||
#include "wx/filedlg.h"
|
#include "wx/filedlg.h"
|
||||||
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// private classes
|
// private classes
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
// Define a new application type, each program should derive a class from wxApp
|
// Define a new application type, each program should derive a class from wxApp
|
||||||
class MyApp : public wxApp
|
class MyApp : public wxApp
|
||||||
{
|
{
|
||||||
@@ -84,7 +91,6 @@ bool MyApp::OnInit()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int MyApp::OnExit()
|
int MyApp::OnExit()
|
||||||
{
|
{
|
||||||
delete help;
|
delete help;
|
||||||
|
@@ -32,6 +32,10 @@
|
|||||||
|
|
||||||
#include "wx/html/webkit.h"
|
#include "wx/html/webkit.h"
|
||||||
|
|
||||||
|
#ifndef __WXMSW__
|
||||||
|
#include "../../sample.xpm"
|
||||||
|
#endif
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// resources
|
// resources
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -149,6 +153,8 @@ bool MyApp::OnInit()
|
|||||||
MyFrame::MyFrame(const wxString& title)
|
MyFrame::MyFrame(const wxString& title)
|
||||||
: wxFrame(NULL, wxID_ANY, title, wxDefaultPosition, wxSize(500,500))
|
: wxFrame(NULL, wxID_ANY, title, wxDefaultPosition, wxSize(500,500))
|
||||||
{
|
{
|
||||||
|
SetIcon(wxICON(sample));
|
||||||
|
|
||||||
wxMenuBar* myBar = new wxMenuBar();
|
wxMenuBar* myBar = new wxMenuBar();
|
||||||
wxMenu* fileMenu = new wxMenu;
|
wxMenu* fileMenu = new wxMenu;
|
||||||
fileMenu->Append(ID_OPEN, _("&Open"));
|
fileMenu->Append(ID_OPEN, _("&Open"));
|
||||||
|
@@ -1,7 +1,12 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: printimg.cpp
|
// Name: printing.cpp
|
||||||
// Purpose: wxHtmlEasyPrinting testing example
|
// Purpose: wxHtml sample: wxHtmlEasyPrinting test
|
||||||
// Licence: wxWindows Licence
|
// Author: ?
|
||||||
|
// Modified by:
|
||||||
|
// Created: ?
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) wxWidgets team
|
||||||
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
@@ -22,6 +27,10 @@
|
|||||||
#include "wx/html/htmlwin.h"
|
#include "wx/html/htmlwin.h"
|
||||||
#include "wx/html/htmprint.h"
|
#include "wx/html/htmprint.h"
|
||||||
|
|
||||||
|
#ifndef __WXMSW__
|
||||||
|
#include "../../sample.xpm"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// private classes
|
// private classes
|
||||||
@@ -68,6 +77,7 @@ class MyFrame : public wxFrame
|
|||||||
wxHtmlWindow *m_Html;
|
wxHtmlWindow *m_Html;
|
||||||
wxHtmlEasyPrinting *m_Prn;
|
wxHtmlEasyPrinting *m_Prn;
|
||||||
wxString m_Name;
|
wxString m_Name;
|
||||||
|
|
||||||
// any class wishing to process wxWidgets events must use this macro
|
// any class wishing to process wxWidgets events must use this macro
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
};
|
};
|
||||||
@@ -165,6 +175,8 @@ bool MyApp::OnInit()
|
|||||||
MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
|
MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
|
||||||
: wxFrame((wxFrame *)NULL, wxID_ANY, title, pos, size)
|
: wxFrame((wxFrame *)NULL, wxID_ANY, title, pos, size)
|
||||||
{
|
{
|
||||||
|
SetIcon(wxICON(sample));
|
||||||
|
|
||||||
// create a menu bar
|
// create a menu bar
|
||||||
wxMenu *menuFile = new wxMenu;
|
wxMenu *menuFile = new wxMenu;
|
||||||
menuFile->Append(Minimal_Open, _("Open...\tCtrl-O"));
|
menuFile->Append(Minimal_Open, _("Open...\tCtrl-O"));
|
||||||
|
@@ -1,7 +1,12 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: virtua;.cpp
|
// Name: virtual.cpp
|
||||||
// Purpose: wxHtml testing example
|
// Purpose: wxHtml sample: demonstrates virtual file systems feature
|
||||||
// demonstrates virtual file systems feature
|
// Author: ?
|
||||||
|
// Modified by:
|
||||||
|
// Created: ?
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) wxWidgets team
|
||||||
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
// For compilers that support precompilation, includes "wx/wx.h".
|
// For compilers that support precompilation, includes "wx/wx.h".
|
||||||
@@ -17,9 +22,11 @@
|
|||||||
#include "wx/wx.h"
|
#include "wx/wx.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#include "wx/html/htmlwin.h"
|
#include "wx/html/htmlwin.h"
|
||||||
|
|
||||||
|
#ifndef __WXMSW__
|
||||||
|
#include "../../sample.xpm"
|
||||||
|
#endif
|
||||||
|
|
||||||
// new handler class:
|
// new handler class:
|
||||||
|
|
||||||
@@ -27,6 +34,9 @@
|
|||||||
#include "wx/mstream.h"
|
#include "wx/mstream.h"
|
||||||
|
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// MyVFS
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
class MyVFS : public wxFileSystemHandler
|
class MyVFS : public wxFileSystemHandler
|
||||||
{
|
{
|
||||||
@@ -37,14 +47,11 @@ public:
|
|||||||
bool CanOpen(const wxString& location);
|
bool CanOpen(const wxString& location);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
bool MyVFS::CanOpen(const wxString& location)
|
bool MyVFS::CanOpen(const wxString& location)
|
||||||
{
|
{
|
||||||
return (GetProtocol(location) == wxT("myVFS"));
|
return (GetProtocol(location) == wxT("myVFS"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
wxFSFile* MyVFS::OpenFile(wxFileSystem& WXUNUSED(fs), const wxString& location)
|
wxFSFile* MyVFS::OpenFile(wxFileSystem& WXUNUSED(fs), const wxString& location)
|
||||||
{
|
{
|
||||||
wxFSFile *f;
|
wxFSFile *f;
|
||||||
@@ -184,6 +191,8 @@ wxHtmlWindow *html;
|
|||||||
MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
|
MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
|
||||||
: wxFrame((wxFrame *)NULL, wxID_ANY, title, pos, size)
|
: wxFrame((wxFrame *)NULL, wxID_ANY, title, pos, size)
|
||||||
{
|
{
|
||||||
|
SetIcon(wxICON(sample));
|
||||||
|
|
||||||
// create a menu bar
|
// create a menu bar
|
||||||
wxMenu *menuFile = new wxMenu;
|
wxMenu *menuFile = new wxMenu;
|
||||||
wxMenu *menuNav = new wxMenu;
|
wxMenu *menuNav = new wxMenu;
|
||||||
@@ -226,7 +235,6 @@ wxHtmlWindow *html;
|
|||||||
if (!html -> HistoryBack()) wxMessageBox(_("You reached prehistory era!"));
|
if (!html -> HistoryBack()) wxMessageBox(_("You reached prehistory era!"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void MyFrame::OnForward(wxCommandEvent& WXUNUSED(event))
|
void MyFrame::OnForward(wxCommandEvent& WXUNUSED(event))
|
||||||
{
|
{
|
||||||
if (!html -> HistoryForward()) wxMessageBox(_("No more items in history!"));
|
if (!html -> HistoryForward()) wxMessageBox(_("No more items in history!"));
|
||||||
|
@@ -1,7 +1,12 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: widget.cpp
|
// Name: zip.cpp
|
||||||
// Purpose: wxHtml testing example
|
// Purpose: wxHtml sample: Demonstrates embedded controls
|
||||||
// Demonstrates embedded controls
|
// Author: ?
|
||||||
|
// Modified by:
|
||||||
|
// Created: ?
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) wxWidgets team
|
||||||
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
// For compilers that support precompilation, includes "wx/wx.h".
|
// For compilers that support precompilation, includes "wx/wx.h".
|
||||||
@@ -17,23 +22,17 @@
|
|||||||
#include "wx/wx.h"
|
#include "wx/wx.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#include "wx/html/htmlwin.h"
|
#include "wx/html/htmlwin.h"
|
||||||
|
|
||||||
#include "../../sample.xpm"
|
#include "../../sample.xpm"
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
TAG HANDER FOR 'MYBIND' TAG
|
// TAG HANDER FOR 'MYBIND' TAG
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "wx/html/m_templ.h"
|
#include "wx/html/m_templ.h"
|
||||||
|
|
||||||
|
|
||||||
TAG_HANDLER_BEGIN(MYBIND, "MYBIND")
|
TAG_HANDLER_BEGIN(MYBIND, "MYBIND")
|
||||||
|
|
||||||
TAG_HANDLER_PROC(tag)
|
TAG_HANDLER_PROC(tag)
|
||||||
@@ -184,6 +183,8 @@ wxHtmlWindow *html;
|
|||||||
MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
|
MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
|
||||||
: wxFrame((wxFrame *)NULL, wxID_ANY, title, pos, size)
|
: wxFrame((wxFrame *)NULL, wxID_ANY, title, pos, size)
|
||||||
{
|
{
|
||||||
|
SetIcon(wxICON(sample));
|
||||||
|
|
||||||
// create a menu bar
|
// create a menu bar
|
||||||
wxMenu *menuFile = new wxMenu;
|
wxMenu *menuFile = new wxMenu;
|
||||||
wxMenu *menuNav = new wxMenu;
|
wxMenu *menuNav = new wxMenu;
|
||||||
|
@@ -1,6 +1,12 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: test.cpp
|
// Name: zip.cpp
|
||||||
// Purpose: wxHtml testing example
|
// Purpose: wxHtml sample
|
||||||
|
// Author: ?
|
||||||
|
// Modified by:
|
||||||
|
// Created: ?
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) wxWidgets team
|
||||||
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
// For compilers that support precompilation, includes "wx/wx.h".
|
// For compilers that support precompilation, includes "wx/wx.h".
|
||||||
@@ -20,6 +26,10 @@
|
|||||||
#include "wx/html/htmlwin.h"
|
#include "wx/html/htmlwin.h"
|
||||||
#include "wx/fs_zip.h"
|
#include "wx/fs_zip.h"
|
||||||
|
|
||||||
|
#ifndef __WXMSW__
|
||||||
|
#include "../../sample.xpm"
|
||||||
|
#endif
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// private classes
|
// private classes
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -135,6 +145,8 @@ wxHtmlWindow *html;
|
|||||||
MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
|
MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
|
||||||
: wxFrame((wxFrame *)NULL, wxID_ANY, title, pos, size)
|
: wxFrame((wxFrame *)NULL, wxID_ANY, title, pos, size)
|
||||||
{
|
{
|
||||||
|
SetIcon(wxICON(sample));
|
||||||
|
|
||||||
// create a menu bar
|
// create a menu bar
|
||||||
wxMenu *menuFile = new wxMenu;
|
wxMenu *menuFile = new wxMenu;
|
||||||
wxMenu *menuNav = new wxMenu;
|
wxMenu *menuNav = new wxMenu;
|
||||||
|
@@ -17,6 +17,10 @@
|
|||||||
// Include private headers
|
// Include private headers
|
||||||
#include "styles.h"
|
#include "styles.h"
|
||||||
|
|
||||||
|
#ifndef __WXMSW__
|
||||||
|
#include "../../sample.xpm"
|
||||||
|
#endif
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// MyFrame
|
// MyFrame
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
@@ -31,6 +35,8 @@ MyFrame::MyFrame( wxWindow *parent, wxWindowID id, const wxString &title,
|
|||||||
const wxPoint &position, const wxSize& size, long style ) :
|
const wxPoint &position, const wxSize& size, long style ) :
|
||||||
wxFrame( parent, id, title, position, size, style )
|
wxFrame( parent, id, title, position, size, style )
|
||||||
{
|
{
|
||||||
|
SetIcon(wxICON(sample));
|
||||||
|
|
||||||
// Create menu and status bar.
|
// Create menu and status bar.
|
||||||
CreateMyMenuBar();
|
CreateMyMenuBar();
|
||||||
#if wxUSE_STATUSBAR
|
#if wxUSE_STATUSBAR
|
||||||
|
@@ -18,6 +18,10 @@
|
|||||||
// Include private headers
|
// Include private headers
|
||||||
#include "wxedit.h"
|
#include "wxedit.h"
|
||||||
|
|
||||||
|
#ifndef __WXMSW__
|
||||||
|
#include "../../sample.xpm"
|
||||||
|
#endif
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// constants
|
// constants
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
@@ -52,6 +56,8 @@ MyFrame::MyFrame( wxWindow *parent, wxWindowID id, const wxString &title,
|
|||||||
const wxPoint &position, const wxSize& size, long style ) :
|
const wxPoint &position, const wxSize& size, long style ) :
|
||||||
wxFrame( parent, id, title, position, size, style )
|
wxFrame( parent, id, title, position, size, style )
|
||||||
{
|
{
|
||||||
|
SetIcon(wxICON(sample));
|
||||||
|
|
||||||
// Create menu and status bar.
|
// Create menu and status bar.
|
||||||
CreateMyMenuBar();
|
CreateMyMenuBar();
|
||||||
#if wxUSE_STATUSBAR
|
#if wxUSE_STATUSBAR
|
||||||
|
Reference in New Issue
Block a user