always call SetIcon() on the main frame of the sample; some small cleanup

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58744 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Francesco Montorsi
2009-02-08 01:01:00 +00:00
parent 27721528c4
commit 41f02b9acc
21 changed files with 435 additions and 304 deletions

View File

@@ -44,6 +44,10 @@
#include "wx/fontpicker.h"
#include "wx/aboutdlg.h"
#ifndef __WXMSW__
#include "../sample.xpm"
#endif
// ----------------------------------------------------------------------------
// constants
// ----------------------------------------------------------------------------
@@ -166,6 +170,8 @@ MyFrame::MyFrame()
wxDefaultPosition, wxSize(420, 300),
wxDEFAULT_FRAME_STYLE | wxNO_FULL_REPAINT_ON_RESIZE)
{
SetIcon(wxICON(sample));
#if wxUSE_STATUSBAR
CreateStatusBar(2);
#endif // wxUSE_STATUSBAR

View File

@@ -25,6 +25,10 @@
#include "wx/log.h"
#include "wx/config.h"
#ifndef __WXMSW__
#include "../sample.xpm"
#endif
// ----------------------------------------------------------------------------
// classes
// ----------------------------------------------------------------------------
@@ -150,6 +154,8 @@ int MyApp::OnExit()
MyFrame::MyFrame()
: wxFrame((wxFrame *) NULL, wxID_ANY, _T("wxConfig Demo"))
{
SetIcon(wxICON(sample));
// menu
wxMenu *file_menu = new wxMenu;

View File

@@ -36,6 +36,10 @@
#include "wx/dialup.h"
#ifndef __WXMSW__
#include "../sample.xpm"
#endif
// ----------------------------------------------------------------------------
// private classes
// ----------------------------------------------------------------------------
@@ -220,6 +224,8 @@ void MyApp::OnConnected(wxDialUpEvent& event)
MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
: wxFrame((wxFrame *)NULL, wxID_ANY, title, pos, size)
{
SetIcon(wxICON(sample));
// create a menu bar
wxMenu *menuFile = new wxMenu;

View File

@@ -30,6 +30,10 @@
#include "wx/wx.h"
#endif
#ifndef __WXMSW__
#include "../sample.xpm"
#endif
// ----------------------------------------------------------------------------
// event constants
// ----------------------------------------------------------------------------
@@ -214,6 +218,8 @@ bool MyApp::OnInit()
MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
: wxFrame((wxFrame *)NULL, wxID_ANY, title, pos, size)
{
SetIcon(wxICON(sample));
// init members
m_nPush = 0;

View File

@@ -39,6 +39,10 @@
#include "griddemo.h"
#ifndef __WXMSW__
#include "../sample.xpm"
#endif
// ----------------------------------------------------------------------------
// wxWin macros
// ----------------------------------------------------------------------------
@@ -148,6 +152,8 @@ GridFrame::GridFrame()
wxDefaultPosition,
wxDefaultSize )
{
SetIcon(wxICON(sample));
wxMenu *fileMenu = new wxMenu;
fileMenu->Append( ID_VTABLE, _T("&Virtual table test\tCtrl-V"));
fileMenu->Append( ID_BUGS_TABLE, _T("&Bugs table test\tCtrl-B"));

View File

@@ -46,6 +46,9 @@
#include "canvas.h"
#ifndef __WXMSW__
#include "../sample.xpm"
#endif
// ============================================================================
// declarations
@@ -575,6 +578,8 @@ MyFrame::MyFrame()
: wxFrame( (wxFrame *)NULL, wxID_ANY, _T("wxImage sample"),
wxPoint(20, 20), wxSize(950, 700) )
{
SetIcon(wxICON(sample));
wxMenuBar *menu_bar = new wxMenuBar();
wxMenu *menuImage = new wxMenu;

View File

@@ -18,6 +18,9 @@
#include "wx/wx.h"
#endif
#ifndef __WXMSW__
#include "../sample.xpm"
#endif
// Define a new frame type: this is going to be our main frame
class MyFrame : public wxFrame
@@ -77,6 +80,8 @@ MyFrame::MyFrame(const wxString& title)
m_inputWin(NULL),
m_skip(true)
{
SetIcon(wxICON(sample));
// IDs for menu items
enum
{

View File

@@ -34,6 +34,11 @@
#include "layout.h"
#ifndef __WXMSW__
#include "../sample.xpm"
#endif
// ----------------------------------------------------------------------------
// MyApp
// ----------------------------------------------------------------------------
@@ -76,6 +81,8 @@ MyFrame::MyFrame()
wxPoint(30,30), wxDefaultSize,
wxDEFAULT_FRAME_STYLE | wxNO_FULL_REPAINT_ON_RESIZE)
{
SetIcon(wxICON(sample));
// Make a menubar
wxMenu *file_menu = new wxMenu;

View File

@@ -67,6 +67,10 @@
#include "wx/filename.h" //For wxFileName::GetName()
#include "wx/config.h" //for native wxConfig
#ifndef __WXMSW__
#include "../sample.xpm"
#endif
// ----------------------------------------------------------------------------
// Bail out if the user doesn't want one of the
// things we need
@@ -481,6 +485,8 @@ void wxMediaPlayerApp::MacOpenFile(const wxString & fileName )
wxMediaPlayerFrame::wxMediaPlayerFrame(const wxString& title)
: wxFrame(NULL, wxID_ANY, title, wxDefaultPosition, wxSize(600,600))
{
SetIcon(wxICON(sample));
//
// Create Menus
//

View File

@@ -59,6 +59,10 @@
#include "copy.xpm"
#endif
#ifndef __WXMSW__
#include "../sample.xpm"
#endif
// ----------------------------------------------------------------------------
// classes
// ----------------------------------------------------------------------------
@@ -371,6 +375,8 @@ bool MyApp::OnInit()
MyFrame::MyFrame()
: wxFrame((wxFrame *)NULL, wxID_ANY, _T("wxWidgets menu sample"))
{
SetIcon(wxICON(sample));
#if USE_LOG_WINDOW
m_textctrl = NULL;
#endif

View File

@@ -24,10 +24,17 @@
#error Sorry, this sample is only appropriate under Windows.
#endif
#ifndef __WXMSW__
#include "../sample.xpm"
#endif
#include <ctype.h>
#include "nativdlg.h"
#include "resource.h"
IMPLEMENT_APP(MyApp)
bool MyApp::OnInit(void)
@@ -75,6 +82,8 @@ END_EVENT_TABLE()
MyFrame::MyFrame(wxWindow *parent, const wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size):
wxFrame(parent, id, title, pos, size)
{
SetIcon(wxICON(sample));
panel = NULL;
}

View File

@@ -68,6 +68,9 @@
#include <wx/artprov.h>
#ifndef __WXMSW__
#include "../sample.xpm"
#endif
// -----------------------------------------------------------------------
// wxSampleMultiButtonEditor
@@ -2062,6 +2065,8 @@ FormMain::FormMain(const wxString& title, const wxPoint& pos, const wxSize& size
(wxMINIMIZE_BOX|wxMAXIMIZE_BOX|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCAPTION|
wxTAB_TRAVERSAL|wxCLOSE_BOX|wxNO_FULL_REPAINT_ON_RESIZE) )
{
SetIcon(wxICON(sample));
m_propGrid = NULL;
m_panel = NULL;

View File

@@ -22,6 +22,10 @@
#include "wx/log.h"
#include "wx/tglbtn.h"
#ifndef __WXMSW__
#include "../sample.xpm"
#endif
// ----------------------------------------------------------------------------
// a trivial example
// ----------------------------------------------------------------------------
@@ -854,6 +858,8 @@ END_EVENT_TABLE()
MyFrame::MyFrame()
: wxFrame(NULL, wxID_ANY, "wxWidgets scroll sample")
{
SetIcon(wxICON(sample));
wxMenu *menuFile = new wxMenu;
menuFile->Append(wxID_ABOUT, "&About..");
menuFile->AppendSeparator();

View File

@@ -40,6 +40,9 @@
#include "wx/dcclient.h"
#include "wx/image.h"
#ifndef __WXMSW__
#include "../sample.xpm"
#endif
// ----------------------------------------------------------------------------
// constants
@@ -246,6 +249,8 @@ MainFrame::MainFrame()
: wxFrame(NULL, wxID_ANY, "wxWidgets Shaped Sample",
wxDefaultPosition, wxSize(200, 100))
{
SetIcon(wxICON(sample));
wxMenuBar * const mbar = new wxMenuBar;
wxMenu * const menuFrames = new wxMenu;
menuFrames->Append(Show_Shaped, "Show &shaped window\tCtrl-S");

View File

@@ -39,6 +39,10 @@
#include "wx/splitter.h"
#include "wx/dcmirror.h"
#ifndef __WXMSW__
#include "../sample.xpm"
#endif
// ----------------------------------------------------------------------------
// constants
// ----------------------------------------------------------------------------
@@ -197,6 +201,8 @@ MyFrame::MyFrame()
wxDefaultPosition, wxSize(420, 300),
wxDEFAULT_FRAME_STYLE | wxNO_FULL_REPAINT_ON_RESIZE)
{
SetIcon(wxICON(sample));
#if wxUSE_STATUSBAR
CreateStatusBar(2);
#endif // wxUSE_STATUSBAR

View File

@@ -49,6 +49,10 @@
#include "wx/datetime.h"
#include "wx/numdlg.h"
#ifndef __WXMSW__
#include "../sample.xpm"
#endif
// define this for the platforms which don't support wxBitmapButton (such as
// Motif), else a wxBitmapButton will be used
@@ -312,6 +316,8 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
: wxFrame((wxWindow *)NULL, wxID_ANY, title, pos, size)
#endif
{
SetIcon(wxICON(sample));
m_statbarDefault = NULL;
m_statbarCustom = NULL;

View File

@@ -39,6 +39,9 @@
#include "edit.h" // Edit module
#include "prefs.h" // Prefs
#ifndef __WXMSW__
#include "../sample.xpm"
#endif
//----------------------------------------------------------------------------
// resources
@@ -300,7 +303,9 @@ END_EVENT_TABLE ()
AppFrame::AppFrame (const wxString &title)
: wxFrame ((wxFrame *)NULL, wxID_ANY, title, wxDefaultPosition, wxSize(750,550),
wxDEFAULT_FRAME_STYLE | wxNO_FULL_REPAINT_ON_RESIZE) {
wxDEFAULT_FRAME_STYLE | wxNO_FULL_REPAINT_ON_RESIZE)
{
SetIcon(wxICON(sample));
// intitialize important variables
m_edit = NULL;

View File

@@ -39,6 +39,11 @@
#include "wx/notebook.h"
#ifndef __WXMSW__
#include "../sample.xpm"
#endif
// ----------------------------------------------------------------------------
// constants
// ----------------------------------------------------------------------------
@@ -189,6 +194,8 @@ MyFrame::MyFrame()
: wxFrame(NULL, wxID_ANY, _T("TabOrder wxWidgets Sample"),
wxDefaultPosition, wxSize(700, 450))
{
SetIcon(wxICON(sample));
wxMenu *menuFile = new wxMenu;
menuFile->Append(TabOrder_About);
menuFile->AppendSeparator();

View File

@@ -45,6 +45,10 @@
#include "wx/numdlg.h"
#include "wx/tokenzr.h"
#ifndef __WXMSW__
#include "../sample.xpm"
#endif
//----------------------------------------------------------------------
// class definitions
//----------------------------------------------------------------------
@@ -1369,6 +1373,8 @@ END_EVENT_TABLE()
MyFrame::MyFrame(wxFrame *frame, const wxChar *title, int x, int y, int w, int h)
: wxFrame(frame, wxID_ANY, title, wxPoint(x, y), wxSize(w, h) )
{
SetIcon(wxICON(sample));
#if wxUSE_STATUSBAR
CreateStatusBar(2);
#endif // wxUSE_STATUSBAR

View File

@@ -3,7 +3,7 @@
// Purpose: wxWidgets sample demonstrating wxWrapSizer use
// Author: Arne Steinarson
// Created: 21.01.2008
// RCS-ID: $Id:$
// RCS-ID: $Id$
// Copyright: (c) Arne Steinarson
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@@ -21,12 +21,76 @@
#include "wx/wrapsizer.h"
#include "wx/artprov.h"
#ifndef __WXMSW__
#include "../sample.xpm"
#endif
// ----------------------------------------------------------------------------
// definitions
// ----------------------------------------------------------------------------
class WrapSizerFrame : public wxFrame
{
public:
WrapSizerFrame()
: wxFrame(NULL, wxID_ANY, "wxWrapSizer Sample")
WrapSizerFrame();
private:
void OnButton(wxCommandEvent& WXUNUSED(event))
{
Close();
}
void AddToolBarButton(wxToolBar *tb,
const wxString& label,
const wxString& artid)
{
wxBitmap
bm = wxArtProvider::GetBitmap(artid, wxART_TOOLBAR, wxSize(16, 16));
tb->AddTool(wxID_ANY, label, bm);
}
wxToolBar *MakeToolBar()
{
wxToolBar *tb = new wxToolBar(this, wxID_ANY,
wxDefaultPosition, wxDefaultSize,
wxTB_NODIVIDER);
AddToolBarButton(tb, "Help", wxART_HELP_BOOK);
tb->AddSeparator( );
AddToolBarButton(tb, "Open", wxART_FILE_OPEN);
tb->AddSeparator( );
AddToolBarButton(tb, "Up", wxART_GO_DIR_UP);
AddToolBarButton(tb, "Execute", wxART_EXECUTABLE_FILE);
tb->Realize( );
return tb;
}
};
class WrapSizerApp : public wxApp
{
public:
WrapSizerApp() {}
virtual bool OnInit()
{
new WrapSizerFrame;
return true;
}
};
IMPLEMENT_APP(WrapSizerApp);
// ----------------------------------------------------------------------------
// WrapSizerFrame
// ----------------------------------------------------------------------------
WrapSizerFrame::WrapSizerFrame()
: wxFrame(NULL, wxID_ANY, "wxWrapSizer Sample")
{
SetIcon(wxICON(sample));
// Root sizer, vertical
wxSizer * const sizerRoot = new wxBoxSizer(wxVERTICAL);
@@ -84,52 +148,5 @@ public:
SetSizerAndFit(sizerRoot);
Show();
}
}
private:
void OnButton(wxCommandEvent& WXUNUSED(event))
{
Close();
}
void AddToolBarButton(wxToolBar *tb,
const wxString& label,
const wxString& artid)
{
wxBitmap
bm = wxArtProvider::GetBitmap(artid, wxART_TOOLBAR, wxSize(16, 16));
tb->AddTool(wxID_ANY, label, bm);
}
wxToolBar *MakeToolBar()
{
wxToolBar *tb = new wxToolBar(this, wxID_ANY,
wxDefaultPosition, wxDefaultSize,
wxTB_NODIVIDER);
AddToolBarButton(tb, "Help", wxART_HELP_BOOK);
tb->AddSeparator( );
AddToolBarButton(tb, "Open", wxART_FILE_OPEN);
tb->AddSeparator( );
AddToolBarButton(tb, "Up", wxART_GO_DIR_UP);
AddToolBarButton(tb, "Execute", wxART_EXECUTABLE_FILE);
tb->Realize( );
return tb;
}
};
class WrapSizerApp : public wxApp
{
public:
WrapSizerApp() {}
virtual bool OnInit()
{
new WrapSizerFrame;
return true;
}
};
IMPLEMENT_APP(WrapSizerApp);