summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
020eeaa)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52762
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
#include "corner4.xpm"
#include "wxpoem.xpm"
#include "corner4.xpm"
#include "wxpoem.xpm"
+#define BUFFER_SIZE 10000
#define DEFAULT_POETRY_DAT "wxpoem"
#define DEFAULT_POETRY_IND "wxpoem"
#define DEFAULT_CHAR_HEIGHT 18
#define DEFAULT_POETRY_DAT "wxpoem"
#define DEFAULT_POETRY_IND "wxpoem"
#define DEFAULT_CHAR_HEIGHT 18
#define X_SIZE 30
#define Y_SIZE 20
#define X_SIZE 30
#define Y_SIZE 20
-static wxChar *poem_buffer; // Storage for each poem
+static wxChar *poem_buffer; // Storage for each poem
static wxChar line[150]; // Storage for a line
static int pages[30]; // For multipage poems -
// store the start of each page
static wxChar line[150]; // Storage for a line
static int pages[30]; // For multipage poems -
// store the start of each page
// Backing bitmap
wxBitmap *backingBitmap = NULL;
// Backing bitmap
wxBitmap *backingBitmap = NULL;
-void PoetryError(wxChar *, wxChar *caption=_T("wxPoem Error"));
-void PoetryNotify(wxChar *Msg, wxChar *caption=_T("wxPoem"));
+void PoetryError(const wxChar *, const wxChar *caption=_T("wxPoem Error"));
+void PoetryNotify(const wxChar *Msg, const wxChar *caption=_T("wxPoem"));
void TryLoadIndex();
bool LoadPoem(wxChar *, long);
int GetIndex();
void TryLoadIndex();
bool LoadPoem(wxChar *, long);
int GetIndex();
// Write (cont'd)
if (page_break)
{
// Write (cont'd)
if (page_break)
{
- wxChar *cont = _T("(cont'd)");
+ const wxChar *cont = _T("(cont'd)");
dc->SetFont(* m_normalFont);
dc->SetFont(* m_normalFont);
- poem_buffer = new wxChar[buf_size];
+ poem_buffer = new wxChar[BUFFER_SIZE];
// Seed the random number generator
#ifdef __WXWINCE__
// Seed the random number generator
#ifdef __WXWINCE__
poem_buffer[i] = (wxChar)ch;
i ++;
poem_buffer[i] = (wxChar)ch;
i ++;
{
wxSprintf(error_buf, _T("%s"), _T("Poetry buffer exceeded."));
PoetryError(error_buf);
{
wxSprintf(error_buf, _T("%s"), _T("Poetry buffer exceeded."));
PoetryError(error_buf);
-void PoetryError(wxChar *msg, wxChar *caption)
+void PoetryError(const wxChar *msg, const wxChar *caption)
{
wxMessageBox(msg, caption, wxOK|wxICON_EXCLAMATION);
}
// Notification (change icon to something appropriate!)
{
wxMessageBox(msg, caption, wxOK|wxICON_EXCLAMATION);
}
// Notification (change icon to something appropriate!)
-void PoetryNotify(wxChar *Msg, wxChar *caption)
+void PoetryNotify(const wxChar *Msg, const wxChar *caption)
{
wxMessageBox(Msg, caption, wxOK | wxICON_INFORMATION);
}
{
wxMessageBox(Msg, caption, wxOK | wxICON_INFORMATION);
}
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
+#ifndef _WXPOEM_H_
+#define _WXPOEM_H_
+
+
// Define a new application
class MyApp: public wxApp
{
// Define a new application
class MyApp: public wxApp
{
{
public:
MyCanvas *canvas;
{
public:
MyCanvas *canvas;
- MainWindow(wxFrame *frame, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style);
+ MainWindow(wxFrame *frame, wxWindowID id, const wxString& title,
+ const wxPoint& pos, const wxSize& size, long style);
virtual ~MainWindow();
void OnCloseWindow(wxCloseEvent& event);
virtual ~MainWindow();
void OnCloseWindow(wxCloseEvent& event);
POEM_SEARCH = wxID_FIND,
POEM_MINIMIZE = wxID_ICONIZE_FRAME
};
POEM_SEARCH = wxID_FIND,
POEM_MINIMIZE = wxID_ICONIZE_FRAME
};