Added new icons

Made menus more Mac-friendly


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26303 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2004-03-23 08:57:45 +00:00
parent 83cbb9e995
commit 0aff9d91ae
4 changed files with 2797 additions and 26 deletions

2742
demos/forty/forty-icons.r Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -39,8 +39,9 @@
BEGIN_EVENT_TABLE(FortyFrame, wxFrame)
EVT_MENU(NEW_GAME, FortyFrame::NewGame)
EVT_MENU(EXIT, FortyFrame::Exit)
EVT_MENU(ABOUT, FortyFrame::About)
EVT_MENU(wxID_EXIT, FortyFrame::Exit)
EVT_MENU(wxID_ABOUT, FortyFrame::About)
EVT_MENU(wxID_HELP_CONTENTS, FortyFrame::Help)
EVT_MENU(UNDO, FortyFrame::Undo)
EVT_MENU(REDO, FortyFrame::Redo)
EVT_MENU(SCORES, FortyFrame::Scores)
@@ -131,8 +132,7 @@ FortyFrame::FortyFrame(wxFrame* frame, const wxString& title, int x, int y, int
wxFrame(frame, -1, title, wxPoint(x, y), wxSize(w, h))
{
#ifdef __WXMAC__
// we need this in order to allow the about menu relocation, since ABOUT is not the default id of the about menu
wxApp::s_macAboutMenuItemId = ABOUT ;
wxApp::s_macAboutMenuItemId = wxID_ABOUT ;
#endif
// set the icon
#ifdef __WXMSW__
@@ -147,7 +147,7 @@ FortyFrame::FortyFrame(wxFrame* frame, const wxString& title, int x, int y, int
wxMenu* gameMenu = new wxMenu;
gameMenu->Append(NEW_GAME, _T("&New"), _T("Start a new game"));
gameMenu->Append(SCORES, _T("&Scores..."), _T("Displays scores"));
gameMenu->Append(EXIT, _T("E&xit"), _T("Exits Forty Thieves"));
gameMenu->Append(wxID_EXIT, _T("E&xit"), _T("Exits Forty Thieves"));
wxMenu* editMenu = new wxMenu;
editMenu->Append(UNDO, _T("&Undo"), _T("Undo the last move"));
@@ -174,7 +174,8 @@ FortyFrame::FortyFrame(wxFrame* frame, const wxString& title, int x, int y, int
optionsMenu->Check(LARGE_CARDS, largecards ? TRUE : FALSE);
wxMenu* helpMenu = new wxMenu;
helpMenu->Append(ABOUT, _T("&About..."), _T("Displays information about the game"));
helpMenu->Append(wxID_HELP_CONTENTS, _T("&Help Contents"), _T("Displays information about playing the game"));
helpMenu->Append(wxID_ABOUT, _T("&About..."), _T("About Forty Thieves"));
m_menuBar = new wxMenuBar;
m_menuBar->Append(gameMenu, _T("&Game"));
@@ -221,20 +222,16 @@ FortyFrame::NewGame(wxCommandEvent&)
void
FortyFrame::Exit(wxCommandEvent&)
{
#ifdef __WXGTK__
// wxGTK doesn't call OnClose() so we do it here
// if (OnClose())
#endif
Close(TRUE);
}
void
FortyFrame::About(wxCommandEvent&)
FortyFrame::Help(wxCommandEvent& event)
{
#if wxUSE_HTML
if (wxFileExists(wxT("about.htm")))
{
FortyAboutDialog dialog(this, -1, wxT("About Forty Thieves"));
FortyAboutDialog dialog(this, -1, wxT("Forty Thieves Instructions"));
if (dialog.ShowModal() == wxID_OK)
{
}
@@ -242,20 +239,24 @@ FortyFrame::About(wxCommandEvent&)
else
#endif
{
wxMessageBox(
_T("Forty Thieves\n\n")
_T("A freeware program using the wxWindows\n")
_T("portable C++ GUI toolkit.\n")
_T("http://www.wxwindows.org\n")
_T("http://www.freiburg.linux.de/~wxxt\n\n")
_T("Author: Chris Breeze (c) 1992-1998\n")
_T("email: chris.breeze@iname.com"),
_T("About Forty Thieves"),
wxOK, this
);
About(event);
}
}
void
FortyFrame::About(wxCommandEvent&)
{
wxMessageBox(
_T("Forty Thieves\n\n")
_T("A free card game written with the wxWidgets toolkit\n")
_T("Author: Chris Breeze (c) 1992-2004\n")
_T("email: chris@breezesys.com"),
_T("About Forty Thieves"),
wxOK|wxICON_INFORMATION, this
);
}
void
FortyFrame::Undo(wxCommandEvent&)
{

View File

@@ -43,6 +43,7 @@ public:
void NewGame(wxCommandEvent& event);
void Exit(wxCommandEvent& event);
void About(wxCommandEvent& event);
void Help(wxCommandEvent& event);
void Undo(wxCommandEvent& event);
void Redo(wxCommandEvent& event);
void Scores(wxCommandEvent& event);
@@ -55,10 +56,10 @@ public:
DECLARE_EVENT_TABLE()
private:
enum MenuCommands { NEW_GAME = 10, SCORES, EXIT,
enum MenuCommands { NEW_GAME = 10, SCORES,
UNDO, REDO,
RIGHT_BUTTON_UNDO, HELPING_HAND, LARGE_CARDS,
ABOUT };
RIGHT_BUTTON_UNDO, HELPING_HAND, LARGE_CARDS
};
wxMenuBar* m_menuBar;
FortyCanvas* m_canvas;

27
demos/forty/forty.r Normal file
View File

@@ -0,0 +1,27 @@
#include "Types.r"
resource 'BNDL' (128) {
'FTHA',
0,
{ /* array TypeArray: 2 elements */
/* [1] */
'ICN#',
{ /* array IDArray: 1 element */
/* [1] */
0, 128
},
/* [2] */
'FREF',
{ /* array IDArray: 1 element */
/* [1] */
0, 128
}
}
};
resource 'FREF' (128) {
'APPL',
0,
""
};