From: Julian Smart Date: Sat, 12 Dec 1998 18:50:16 +0000 (+0000) Subject: Added wxPoem sample; fixed some Dialog Editor problems; wxStaticBitmap and wxBitmapButton X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/3013b6f46099b8cf0d2f9f656e883e4606ca833d Added wxPoem sample; fixed some Dialog Editor problems; wxStaticBitmap and wxBitmapButton now recognised by resource.cpp. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1181 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/object.h b/include/wx/object.h index df3a08ca97..ca3ade770a 100644 --- a/include/wx/object.h +++ b/include/wx/object.h @@ -160,7 +160,10 @@ wxObject* WXDLLEXPORT_CTORFN wxConstructorFor##name(void) \ #endif -#define IS_KIND_OF(obj, className) obj->IsKindOf(&className::sm_class##className) +#define wxIS_KIND_OF(obj, className) obj->IsKindOf(&className::sm_class##className) + +// Just seems a bit nicer-looking (pretend it's not a macro) +#define wxIsKindOf(obj, className) obj->IsKindOf(&className::sm_class##className) // Unfortunately Borland seems to need this include. #ifdef __BORLANDC__ diff --git a/samples/wxpoem/Makefile b/samples/wxpoem/Makefile new file mode 100644 index 0000000000..bccce53f76 --- /dev/null +++ b/samples/wxpoem/Makefile @@ -0,0 +1 @@ +include ../../setup/general/makeapp diff --git a/samples/wxpoem/Makefile.in b/samples/wxpoem/Makefile.in new file mode 100644 index 0000000000..1385e5590e --- /dev/null +++ b/samples/wxpoem/Makefile.in @@ -0,0 +1,26 @@ +# WXXT base directory +WXBASEDIR=@WXBASEDIR@ + +# set the OS type for compilation +OS=@OS@ +# compile a library only +RULE=bin + +# define library name +BIN_TARGET=wxpoem +# define library sources +BIN_SRC=\ +wxpoem.cpp + +#define library objects +BIN_OBJ=\ +wxpoem.o + +# additional things needed to link +BIN_LINK= + +# additional things needed to compile +ADD_COMPILE= + +# include the definitions now +include ../../../template.mak diff --git a/samples/wxpoem/corner1.ico b/samples/wxpoem/corner1.ico new file mode 100644 index 0000000000..35de002ce5 Binary files /dev/null and b/samples/wxpoem/corner1.ico differ diff --git a/samples/wxpoem/corner2.ico b/samples/wxpoem/corner2.ico new file mode 100644 index 0000000000..a1d58d884d Binary files /dev/null and b/samples/wxpoem/corner2.ico differ diff --git a/samples/wxpoem/corner3.ico b/samples/wxpoem/corner3.ico new file mode 100644 index 0000000000..201fb98952 Binary files /dev/null and b/samples/wxpoem/corner3.ico differ diff --git a/samples/wxpoem/corner4.ico b/samples/wxpoem/corner4.ico new file mode 100644 index 0000000000..4af67536e9 Binary files /dev/null and b/samples/wxpoem/corner4.ico differ diff --git a/samples/wxpoem/makefile.b32 b/samples/wxpoem/makefile.b32 new file mode 100644 index 0000000000..835099e886 --- /dev/null +++ b/samples/wxpoem/makefile.b32 @@ -0,0 +1,64 @@ +# +# File: makefile.b32 +# Author: Julian Smart +# Created: 1993 +# Updated: +# Copyright: +# +# "%W% %G%" +# +# Makefile : Builds wxpoem example + +# WXWIN and BCCDIR are set by parent make + +WXDIR = $(WXWIN) +!include $(WXDIR)\src\makeb32.env + +WXLIBDIR = $(WXDIR)\lib +WXINC = $(WXDIR)\include\msw +WXLIB = $(WXLIBDIR)\wx32.lib +LIBS=$(WXLIB) cw32 import32 ole2w32 + +TARGET=wxpoem + +!if "$(FINAL)" == "0" +LINKFLAGS=/v /Tpe /L$(WXLIBDIR);$(BCCDIR)\lib +OPT = -Od +DEBUG_FLAGS= -v +!else +LINKFLAGS=/Tpe /L$(WXLIBDIR);$(BCCDIR)\lib +OPT = -Od +DEBUG_FLAGS = +!endif +CPPFLAGS=$(DEBUG_FLAGS) $(OPT) @$(CFG) + +OBJECTS = wxpoem.obj + +$(TARGET).exe: $(OBJECTS) $(TARGET).res + tlink32 $(LINKFLAGS) @&&! +c0w32.obj $(OBJECTS) +$(TARGET) +nul +$(LIBS) +$(TARGET).def +$(TARGET).res +! + +.$(SRCSUFF).obj: + bcc32 $(CPPFLAGS) -c {$< } + +.c.obj: + bcc32 $(CPPFLAGS) -P- -c {$< } + +wxpoem.obj: wxpoem.$(SRCSUFF) + +$(TARGET).res : $(TARGET).rc $(WXDIR)\include\wx\msw\wx.rc + brc32 -r /i$(BCCDIR)\include /i$(WXDIR)\include $(TARGET) + +clean: + -erase *.obj + -erase *.exe + -erase *.res + -erase *.map + -erase *.rws + diff --git a/samples/wxpoem/makefile.g95 b/samples/wxpoem/makefile.g95 new file mode 100644 index 0000000000..7a408acde4 --- /dev/null +++ b/samples/wxpoem/makefile.g95 @@ -0,0 +1,37 @@ +# +# File: makefile.unx +# Author: Julian Smart +# Created: 1993 +# Updated: +# Copyright: (c) 1993, AIAI, University of Edinburgh +# +# "%W% %G%" +# +# Makefile for wxpoem example (UNIX). + +WXDIR = ../.. + +# All common UNIX compiler flags and options are now in +# this central makefile. +include $(WXDIR)/src/makeg95.env + +OBJECTS = $(OBJDIR)/wxpoem.$(OBJSUFF) $(OBJDIR)/wxpoem_resources.$(OBJSUFF) + +all: $(OBJDIR) wxpoem$(GUISUFFIX)$(EXESUFF) + +wx: + +$(OBJDIR): + mkdir $(OBJDIR) + +wxpoem$(GUISUFFIX)$(EXESUFF): $(OBJECTS) $(WXLIB) + $(CC) $(LDFLAGS) -o wxpoem$(GUISUFFIX)$(EXESUFF) $(OBJECTS) $(LDLIBS) + +$(OBJDIR)/wxpoem.$(OBJSUFF): wxpoem.$(SRCSUFF) + $(CC) -c $(CPPFLAGS) -o $@ wxpoem.$(SRCSUFF) + +$(OBJDIR)/wxpoem_resources.o: wxpoem.rc + $(RESCOMP) -i wxpoem.rc -o $(OBJDIR)/wxpoem_resources.o $(RESFLAGS) + +clean: + rm -f $(OBJECTS) wxpoem$(GUISUFFIX).exe core *.rsc *.res diff --git a/samples/wxpoem/makefile.nt b/samples/wxpoem/makefile.nt new file mode 100644 index 0000000000..1b48fb3c7b --- /dev/null +++ b/samples/wxpoem/makefile.nt @@ -0,0 +1,64 @@ +# +# File: makefile.nt +# Author: Julian Smart +# Created: 1993 +# Updated: +# Copyright: (c) 1993, AIAI, University of Edinburgh +# +# "%W% %G%" +# +# Makefile : Builds wxpoem example (MS VC++). +# Use FINAL=1 argument to nmake to build final version with no debugging +# info + +# Set WXDIR for your system +WXDIR = $(WXWIN) + +WXUSINGDLL=0 + +!include $(WXDIR)\src\ntwxwin.mak + +THISDIR = $(WXDIR)\samples\wxpoem +PROGRAM=wxpoem + +OBJECTS = $(PROGRAM).obj + +$(PROGRAM): $(PROGRAM).exe + +all: wx $(PROGRAM).exe + +wx: + cd $(WXDIR)\src\msw + nmake -f makefile.nt FINAL=$(FINAL) + cd $(THISDIR) + +wxclean: + cd $(WXDIR)\src\msw + nmake -f makefile.nt clean + cd $(THISDIR) + +$(PROGRAM).exe: $(DUMMYOBJ) $(WXLIB) $(OBJECTS) $(PROGRAM).res + $(link) @<< +-out:$(PROGRAM).exe +$(LINKFLAGS) +$(DUMMYOBJ) $(OBJECTS) $(PROGRAM).res +$(LIBS) +<< + + +$(PROGRAM).obj: $(PROGRAM).$(SRCSUFF) $(DUMMYOBJ) + $(cc) @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) +<< + +$(PROGRAM).res : $(PROGRAM).rc $(WXDIR)\include\wx\msw\wx.rc + $(rc) -r /i$(WXDIR)\include -fo$@ $(PROGRAM).rc + + +clean: + -erase *.obj + -erase *.exe + -erase *.res + -erase *.map + -erase *.sbr + -erase *.pdb diff --git a/samples/wxpoem/makefile.unx b/samples/wxpoem/makefile.unx new file mode 100644 index 0000000000..6135be9a86 --- /dev/null +++ b/samples/wxpoem/makefile.unx @@ -0,0 +1,17 @@ +# +# File: makefile.unx +# Author: Julian Smart +# Created: 1998 +# Updated: +# Copyright: (c) 1998 Julian Smart +# +# "%W% %G%" +# +# Makefile for wxPoem example (UNIX). + +PROGRAM=wxpoem + +OBJECTS=$(PROGRAM).o + +include ../../src/makeprog.env + diff --git a/samples/wxpoem/wxpoem.cpp b/samples/wxpoem/wxpoem.cpp new file mode 100644 index 0000000000..86c292b9f9 --- /dev/null +++ b/samples/wxpoem/wxpoem.cpp @@ -0,0 +1,1126 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: wxpoem.cpp +// Purpose: A small C++ program which displays a random poem on +// execution. It also allows search for poems containing a +// string. +// It requires winpoem.dat and creates winpoem.idx. +// Original version (WinPoem) written in 1994. +// This has not been rewritten in a long time so +// beware, inelegant code! +// Author: Julian Smart +// Created: 12/12/98 +// RCS-ID: $Id$ +// Copyright: (c) 1998 Julian Smart +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +#ifdef __GNUG__ +#pragma implementation "wxpoem.h" +#endif + +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ +#pragma hdrstop +#endif + +#ifndef WX_PRECOMP +#include "wx/defs.h" +#include "wx/list.h" +#include "wx/utils.h" +#endif + +#include "wx/help.h" + +#include "wxpoem.h" + +#include +#include +#include +#include + +#define buf_size 10000 +#define DEFAULT_POETRY_DAT "wxpoem" +#define DEFAULT_POETRY_IND "wxpoem" +#define DEFAULT_CHAR_HEIGHT 18 +#define DEFAULT_FONT "Swiss" +#define DEFAULT_X_POS 0 +#define DEFAULT_Y_POS 0 +#define BORDER_SIZE 30 +#define THIN_LINE_BORDER 10 +#define THICK_LINE_BORDER 16 +#define THICK_LINE_WIDTH 2 +#define SHADOW_OFFSET 1 +#define X_SIZE 30 +#define Y_SIZE 20 + +static char *poem_buffer; // Storage for each poem +static char line[150]; // Storage for a line +static char title[150]; // Remember the title +static char *search_string = NULL; // The search string +static int pages[30]; // For multipage poems - + // store the start of each page +static long last_poem_start = 0; // Start of last found poem +static long last_find = -1; // Point in file of last found + // search string +static bool search_ok = FALSE; // Search was successful +static bool same_search = FALSE; // Searching on same string + +static long poem_index[600]; // Index of poem starts +static long nitems = 0; // Number of poems +static int desired_char_height = DEFAULT_CHAR_HEIGHT; // Desired height +static char DesiredFont[64]; // Chosen font +static int char_height = DEFAULT_CHAR_HEIGHT; // Actual height +static int index_ptr = -1; // Pointer into index +static int poem_height, poem_width; // Size of poem +static int XPos; // Startup X position +static int YPos; // Startup Y position +static int pointSize = 12; // Font size + +static char *index_filename = NULL; // Index filename +static char *data_filename = NULL; // Data filename +static char error_buf[300]; // Error message buffer +static bool loaded_ok = FALSE; // Poem loaded ok +static bool index_ok = FALSE; // Index loaded ok + +static bool paging = FALSE; // Are we paging? +static int current_page = 0; // Currently viewed page + +wxIcon *Corner1 = NULL; +wxIcon *Corner2 = NULL; +wxIcon *Corner3 = NULL; +wxIcon *Corner4 = NULL; + +// Fonts +wxFont *NormalFont = NULL; +wxFont *BoldFont = NULL; +wxFont *ItalicFont = NULL; + +// Pens +wxPen *GreyPen = NULL; +wxPen *DarkGreyPen = NULL; +wxPen *WhitePen = NULL; + +// Backing bitmap +wxBitmap *backingBitmap = NULL; + +void PoetryError(char *, char *caption="wxPoem Error"); +void PoetryNotify(char *Msg, char *caption="wxPoem"); +void TryLoadIndex(); +bool LoadPoem(char *, long); +int GetIndex(); +int LoadIndex(char *); +bool Compile(void); +void WritePreferences(); +void ReadPreferences(); +void FindMax(int *max_thing, int thing); +void CreateFonts(); +#ifdef __WXMSW__ +void CopyToClipboard(HWND, char *); +#endif + +wxMenu *popupMenu = NULL; +void PopupFunction(wxMenu& menu, wxCommandEvent& event); + +wxHelpController *HelpController = NULL; + +// A macro needed for some compilers (AIX) that need 'main' to be defined +// in the application itself. +IMPLEMENT_WXWIN_MAIN + +IMPLEMENT_APP(MyApp) + +MainWindow *TheMainWindow = NULL; + +// Create the fonts +void CreateFonts() +{ + NormalFont = wxTheFontList->FindOrCreateFont(pointSize, wxSWISS, wxNORMAL, wxNORMAL); + BoldFont = wxTheFontList->FindOrCreateFont(pointSize, wxSWISS, wxNORMAL, wxBOLD); + ItalicFont = wxTheFontList->FindOrCreateFont(pointSize, wxSWISS, wxITALIC, wxNORMAL); +} + +BEGIN_EVENT_TABLE(MainWindow, wxFrame) + EVT_CLOSE(MainWindow::OnCloseWindow) + EVT_CHAR(MainWindow::OnChar) +END_EVENT_TABLE() + +MainWindow::MainWindow(wxFrame *frame, wxWindowID id, const wxString& title, + const wxPoint& pos, const wxSize& size, long style): + wxFrame(frame, id, title, pos, size, style) +{ +} + +// Read the poetry buffer, either for finding the size +// or for writing to a bitmap (not to the window directly, +// since that displays messily) +// If DrawIt is true, we draw, otherwise we just determine the +// size the window should be. +void MainWindow::ScanBuffer(wxDC *dc, bool DrawIt, int *max_x, int *max_y) +{ + int i = pages[current_page]; + int ch = -1; + int x = 10; + int y = 0; + int j; + char *line_ptr; + int curr_width = 0; + bool page_break = FALSE; + + int width = 0; + int height = 0; + + if (DrawIt) + { + y = (*max_y - poem_height)/2; + width = *max_x; + height = *max_y; + } + + if (DrawIt && wxColourDisplay()) + { + dc->SetBrush(*wxLIGHT_GREY_BRUSH); + dc->SetPen(*GreyPen); + dc->DrawRectangle(0, 0, width, height); + dc->SetBackgroundMode(wxTRANSPARENT); + } + + // See what ACTUAL char height is + dc->SetFont(* NormalFont); + long xx; + long yy; + dc->GetTextExtent("X", &xx, &yy); + char_height = (int)yy; + + if (current_page == 0) + title[0] = 0; + else if (title[0] != 0) + { + dc->SetFont(* BoldFont); + dc->GetTextExtent(title, &xx, &yy); + FindMax(&curr_width, (int)xx); + + if (DrawIt) + { + x = (width - xx)/2; + dc->SetFont(* BoldFont); + + // Change text to BLACK! + dc->SetTextForeground(* wxBLACK); + dc->DrawText(title, x, y); + // Change text to WHITE! + dc->SetTextForeground(* wxWHITE); + dc->DrawText(title, x-SHADOW_OFFSET, y-SHADOW_OFFSET); + } + y += char_height; + y += char_height; + } + + while (ch != 0 && !page_break) + { + j = 0; +#ifdef __WXMSW__ + while (((ch = poem_buffer[i]) != 13) && (ch != 0)) +#else + while (((ch = poem_buffer[i]) != 10) && (ch != 0)) +#endif + { + line[j] = ch; + j ++; + i ++; + } + +#ifdef __WXMSW__ + if (ch == 13) +#else + if (ch == 10) +#endif + { + ch = -1; + i ++; +#ifdef __WXMSW__ + // Add another to skip the linefeed + i ++; +#endif + // If a single newline on its own, put a space in + if (j == 0) + { + line[j] = ' '; + j ++; + line[j] = 0; + } + } + + if (j > 0) + { + line[j] = 0; + if (line[0] == '@') + { + switch (line[1]) + { + case 'P': + paging = TRUE; + page_break = TRUE; + break; + + case 'T': + dc->SetFont(* BoldFont); + line_ptr = line+3; + + strcpy(title, line_ptr); + strcat(title, " (cont'd)"); + + dc->GetTextExtent(line_ptr, &xx, &yy); + FindMax(&curr_width, (int)xx); + + if (DrawIt) + { + x = (width - xx)/2; + dc->SetFont(* BoldFont); + + // Change text to BLACK! + dc->SetTextForeground(* wxBLACK); + dc->DrawText(line_ptr, x, y); + + // Change text to WHITE! + dc->SetTextForeground(* wxWHITE); + dc->DrawText(line_ptr, x-SHADOW_OFFSET, y-SHADOW_OFFSET); + dc->SetTextForeground(* wxWHITE); + } + break; + + case 'A': + line_ptr = line+3; + dc->SetFont(* ItalicFont); + + dc->GetTextExtent(line_ptr, &xx, &yy); + FindMax(&curr_width, (int)xx); + + if (DrawIt) + { + x = (width - xx)/2; + dc->SetTextForeground(* wxBLACK); + dc->DrawText(line_ptr, x, y); + } + break; + + // Default: just ignore this line + default: + y -= char_height; + } + } + else + { + dc->SetFont(* NormalFont); + + dc->GetTextExtent(line, &xx, &yy); + FindMax(&curr_width, (int)xx); + + if (DrawIt) + { + int x = (int)((width - xx)/2.0); + dc->SetFont(* NormalFont); + dc->SetTextForeground(* wxBLACK); + dc->DrawText(line, (float)x, (float)y); + } + } + } + y += char_height; + } + + // Write (cont'd) + if (page_break) + { + char *cont = "(cont'd)"; + + dc->SetFont(* NormalFont); + + dc->GetTextExtent(cont, &xx, &yy); + FindMax(&curr_width, (int)xx); + if (DrawIt) + { + int x = (int)((width - xx)/2.0); + dc->SetFont(* NormalFont); + dc->SetTextForeground(* wxBLACK); + dc->DrawText(cont, (float)x, (float)y); + } + y += 2*char_height; + } + + *max_x = (int)curr_width; + *max_y = (int)(y-char_height); + + if (page_break) + pages[current_page+1] = i; + else + paging = FALSE; + + if (DrawIt) + { + // Draw dark grey thick border + if (wxColourDisplay()) + { + dc->SetBrush(*wxGREY_BRUSH); + dc->SetPen(*wxGREY_PEN); + + // Left side + dc->DrawRectangle(0, 0, THIN_LINE_BORDER, height); + // Top side + dc->DrawRectangle(THIN_LINE_BORDER, 0, width-THIN_LINE_BORDER, THIN_LINE_BORDER); + // Right side + dc->DrawRectangle(width-THIN_LINE_BORDER, THIN_LINE_BORDER, width, height-THIN_LINE_BORDER); + // Bottom side + dc->DrawRectangle(THIN_LINE_BORDER, height-THIN_LINE_BORDER, width-THIN_LINE_BORDER, height); + } + // Draw border + // Have grey background, plus 3-d border - + // One black rectangle. + // Inside this, left and top sides - dark grey. Bottom and right - + // white. + + // Change pen to black + dc->SetPen(*wxBLACK_PEN); + dc->DrawLine(THIN_LINE_BORDER, THIN_LINE_BORDER, width-THIN_LINE_BORDER, THIN_LINE_BORDER); + dc->DrawLine(width-THIN_LINE_BORDER, THIN_LINE_BORDER, width-THIN_LINE_BORDER, height-THIN_LINE_BORDER); + dc->DrawLine(width-THIN_LINE_BORDER, height-THIN_LINE_BORDER, THIN_LINE_BORDER, height-THIN_LINE_BORDER); + dc->DrawLine(THIN_LINE_BORDER, height-THIN_LINE_BORDER, THIN_LINE_BORDER, THIN_LINE_BORDER); + + // Right and bottom white lines - 'grey' (black!) if + // we're running on a mono display. + if (wxColourDisplay()) + dc->SetPen(*WhitePen); + else + dc->SetPen(*DarkGreyPen); + + dc->DrawLine(width-THICK_LINE_BORDER, THICK_LINE_BORDER, + width-THICK_LINE_BORDER, height-THICK_LINE_BORDER); + dc->DrawLine(width-THICK_LINE_BORDER, height-THICK_LINE_BORDER, + THICK_LINE_BORDER, height-THICK_LINE_BORDER); + + // Left and top grey lines + dc->SetPen(*DarkGreyPen); + dc->DrawLine(THICK_LINE_BORDER, height-THICK_LINE_BORDER, + THICK_LINE_BORDER, THICK_LINE_BORDER); + dc->DrawLine(THICK_LINE_BORDER, THICK_LINE_BORDER, + width-THICK_LINE_BORDER, THICK_LINE_BORDER); + +#ifdef __WXMSW__ + // Draw icons + dc->DrawIcon(* Corner1, 0.0, 0.0); + dc->DrawIcon(* Corner2, (float)(width-32.0), 0.0); + + int y2 = height - 32; + int x2 = (width-32); + dc->DrawIcon(* Corner3, 0.0, (float)y2); + dc->DrawIcon(* Corner4, (float)x2, (float)y2); +#endif + } +} + +// Get an index (randomly generated) and load the poem +void MainWindow::GetIndexLoadPoem(void) +{ + if (index_ok) + index_ptr = GetIndex(); + + if (index_ptr > -1) + loaded_ok = LoadPoem(data_filename, -1); +} + +// Find the size of the poem and resize the window accordingly +void MainWindow::Resize(void) +{ + wxClientDC dc(canvas); + + // Get the poem size + ScanBuffer(& dc, FALSE, &poem_width, &poem_height); + int x = poem_width + (2*BORDER_SIZE); + int y = poem_height + (2*BORDER_SIZE); + + SetClientSize(x, y); + + // In case client size isn't what we set it to... + int xx, yy; + GetClientSize(&xx, &yy); + + wxMemoryDC memDC; + if (backingBitmap) delete backingBitmap; + backingBitmap = new wxBitmap(x, yy); + memDC.SelectObject(* backingBitmap); + + memDC.Clear(); + TheMainWindow->ScanBuffer(&memDC, TRUE, &xx, &yy); +} + +// Which is more? +void FindMax(int *max_thing, int thing) +{ + if (thing > *max_thing) + *max_thing = thing; +} + +// Next page/poem +void MainWindow::NextPage(void) +{ + if (paging) + current_page ++; + else + { + current_page = 0; + GetIndexLoadPoem(); + } + Resize(); +} + +// Previous page +void MainWindow::PreviousPage(void) +{ + if (current_page > 0) + { + current_page --; + Resize(); + } +} + +// Search for a string +void MainWindow::Search(bool ask) +{ + long position; + + if (ask || !search_string) + { + wxString s = wxGetTextFromUser("Enter search string", "Search", (const char*) search_string); + if (s != "") + { + if (search_string) delete[] search_string; + search_string = copystring(s); + search_ok = TRUE; + } else search_ok = FALSE; + } + else + { + same_search = TRUE; + search_ok = TRUE; + } + + if (search_string && search_ok) + { + position = DoSearch(); + if (position > -1) + { + loaded_ok = LoadPoem(data_filename, position); + Resize(); + } + else + { + last_poem_start = 0; + PoetryNotify("Search string not found."); + } + } +} + +// Copy a string to the clipboard +#ifdef __WXMSW__ +void CopyToClipboard(HWND handle, char *s) +{ + int length = strlen(s); + HANDLE hGlobalMemory = GlobalAlloc(GHND, (DWORD) length + 1); + if (hGlobalMemory) + { +#ifdef __WINDOWS_386__ + LPSTR lpGlobalMemory = MK_FP32(GlobalLock(hGlobalMemory)); +#else + LPSTR lpGlobalMemory = (LPSTR)GlobalLock(hGlobalMemory); +#endif + int i, j = 0; + for (i = 0; i < length; i ++) + { + if (s[i] == '@') + { + i++; + switch (s[i]) + { + case 'P': + break; + case 'T': + case 'A': + default: + i ++; + break; + } + } + else + { + lpGlobalMemory[j] = s[i]; + j ++; + } + } + + GlobalUnlock(hGlobalMemory); + OpenClipboard(handle); + EmptyClipboard(); + SetClipboardData(CF_TEXT, hGlobalMemory); + CloseClipboard(); + } +} +#endif + +bool MyApp::OnInit() +{ + poem_buffer = new char[buf_size]; + + GreyPen = new wxPen("LIGHT GREY", THICK_LINE_WIDTH, wxSOLID); + DarkGreyPen = new wxPen("GREY", THICK_LINE_WIDTH, wxSOLID); + WhitePen = new wxPen("WHITE", THICK_LINE_WIDTH, wxSOLID); + + HelpController = new wxHelpController(); + HelpController->Initialize("wxpoem"); + + CreateFonts(); + + ReadPreferences(); + + // Seed the random number generator + time_t current_time; + + (void)time(¤t_time); + srand((unsigned int)current_time); + +// randomize(); + pages[0] = 0; + + TheMainWindow = new MainWindow(NULL, -1, "wxPoem", wxPoint(XPos, YPos), wxSize(100, 100), wxCAPTION|wxMINIMIZE_BOX|wxSYSTEM_MENU); + +#ifdef wx_x + TheMainWindow->SetIcon(Icon("wxpoem")); +#endif + + TheMainWindow->canvas = new MyCanvas(TheMainWindow, -1, wxDefaultPosition, wxDefaultSize); + + popupMenu = new wxMenu("", (wxFunction)PopupFunction); + popupMenu->Append(POEM_NEXT, "Next poem/page"); + popupMenu->Append(POEM_PREVIOUS, "Previous page"); + popupMenu->AppendSeparator(); + popupMenu->Append(POEM_SEARCH, "Search"); + popupMenu->Append(POEM_NEXT_MATCH, "Next match"); + popupMenu->Append(POEM_COPY, "Copy to clipboard"); + popupMenu->Append(POEM_MINIMIZE, "Minimize"); + popupMenu->AppendSeparator(); + popupMenu->Append(POEM_BIGGER_TEXT, "Bigger text"); + popupMenu->Append(POEM_SMALLER_TEXT, "Smaller text"); + popupMenu->AppendSeparator(); + popupMenu->Append(POEM_ABOUT, "About wxPoem"); + popupMenu->AppendSeparator(); + popupMenu->Append(POEM_EXIT, "Exit"); + + if (argc > 1) + { + index_filename = copystring(argv[1]); + data_filename = copystring(argv[1]); + } + else + { + index_filename = DEFAULT_POETRY_IND; + data_filename = DEFAULT_POETRY_DAT; + } + TryLoadIndex(); + +#ifdef __WXMSW__ + Corner1 = new wxIcon("icon_1"); + Corner2 = new wxIcon("icon_2"); + Corner3 = new wxIcon("icon_3"); + Corner4 = new wxIcon("icon_4"); +#endif + + TheMainWindow->GetIndexLoadPoem(); + TheMainWindow->Resize(); + TheMainWindow->Show(TRUE); + + return TRUE; +} + +int MyApp::OnExit() +{ + if (backingBitmap) + delete backingBitmap; + delete HelpController; + delete popupMenu; + delete GreyPen; + delete DarkGreyPen; + delete WhitePen; + +#ifdef __WXMSW__ + delete Corner1; + delete Corner2; + delete Corner3; + delete Corner4; +#endif + delete NormalFont; + delete BoldFont; + delete ItalicFont; + delete poem_buffer; + + return 0; +} + +void MainWindow::OnCloseWindow(wxCloseEvent& event) +{ + WritePreferences(); + this->Destroy(); +} + +void MainWindow::OnChar(wxKeyEvent& event) +{ + canvas->OnChar(event); +} + +BEGIN_EVENT_TABLE(MyCanvas, wxPanel) + EVT_MOUSE_EVENTS(MyCanvas::OnMouseEvent) + EVT_CHAR(MyCanvas::OnChar) + EVT_PAINT(MyCanvas::OnPaint) +END_EVENT_TABLE() + +// Define a constructor for my canvas +MyCanvas::MyCanvas(wxFrame *frame, wxWindowID id, const wxPoint& pos, const wxSize& size): + wxPanel(frame, id, pos, size) +{ +} + +// Define the repainting behaviour +void MyCanvas::OnPaint(wxPaintEvent& event) +{ + wxPaintDC dc(this); + + if (backingBitmap) + { + int xx, yy; + TheMainWindow->GetClientSize(&xx, &yy); + + wxMemoryDC memDC; + memDC.SelectObject(* backingBitmap); + dc.Blit(0, 0, backingBitmap->GetWidth(), backingBitmap->GetHeight(), &memDC, 0, 0); + } +} + +void MyCanvas::OnMouseEvent(wxMouseEvent& event) +{ + float x, y; + event.Position(&x, &y); + static int startPosX, startPosY, startFrameX, startFrameY; + + event.Position(&x, &y); + + if (event.RightDown()) + { + // Versions from wxWin 1.67 are probably OK +#if 0 // wx_motif + FakePopupMenu(popupMenu, x, y); +#else + PopupMenu(popupMenu, x, y); +#endif + } + else if (event.LeftDown()) + { + this->CaptureMouse(); + int x1 = (int)x; + int y1 = (int)y; + ClientToScreen(&x1, &y1); + startPosX = x1; + startPosY = y1; + GetParent()->GetPosition(&startFrameX, &startFrameY); + } + else if (event.LeftUp()) + this->ReleaseMouse(); + else if (event.Dragging() && event.LeftIsDown()) + { + int x1 = (int)x; + int y1 = (int)y; + ClientToScreen(&x1, &y1); + + int dX = x1 - startPosX; + int dY = y1 - startPosY; + GetParent()->Move(startFrameX + dX, startFrameY + dY); + } +} + +// Process characters +void MyCanvas::OnChar(wxKeyEvent& event) +{ + switch (event.KeyCode()) + { + case 'n': + case 'N': + // Next match + TheMainWindow->Search(FALSE); + break; + case 's': + case 'S': + // New search + TheMainWindow->Search(TRUE); + break; + case WXK_SPACE: + // Another poem + TheMainWindow->NextPage(); + break; + case 27: + TheMainWindow->Close(TRUE); + default: + break; + } + } + +// Load index file +int LoadIndex(char *file_name) +{ + long data; + FILE *index_file; + + int i = 0; + char buf[100]; + + if (file_name) + sprintf(buf, "%s.idx", file_name); + if (! (file_name && (index_file = fopen(buf, "r")))) + return 0; + else + { + fscanf(index_file, "%ld", &nitems); + + for (i = 0; i < nitems; i++) + { + fscanf(index_file, "%ld", &data); + poem_index[i] = data; + } + fclose(index_file); + + return 1; + } +} + +// Get index +int GetIndex() +{ + int indexn = 0; + + indexn = (int)(rand() % nitems); + + if ((indexn < 0) || (indexn > nitems)) + { PoetryError("No such poem!"); + return -1; + } + else + return indexn; +} + +// Read preferences +void ReadPreferences() +{ + wxGetResource("wxPoem", "FontSize", &pointSize); + wxGetResource("wxPoem", "X", &XPos); + wxGetResource("wxPoem", "Y", &YPos); +} + +// Write preferences to disk +void WritePreferences() +{ +#ifdef __WXMSW__ + TheMainWindow->GetPosition(&XPos, &YPos); + wxWriteResource("wxPoem", "FontSize", pointSize); + wxWriteResource("wxPoem", "X", XPos); + wxWriteResource("wxPoem", "Y", YPos); +#endif +} + +// Load a poem from given file, at given point in file. +// If position is > -1, use this for the position in the +// file, otherwise use index[index_ptr] to find the correct position. +bool LoadPoem(char *file_name, long position) +{ + int ch = 0; + int i = 0; + int j = 0; + int indexn = 0; + char buf[100]; + long data; + FILE *data_file; + + paging = FALSE; + current_page = 0; + + if (file_name) + sprintf(buf, "%s.dat", file_name); + + if (! (file_name && (data_file = fopen(buf, "r")))) + { + sprintf(error_buf, "Data file %s not found.", buf); + PoetryError(error_buf); + return FALSE; + } + else + { + if (position > -1) + data = position; + else + data = poem_index[index_ptr]; + + fseek(data_file, data, SEEK_SET); + + ch = 0; + i = 0; + while ((ch != EOF) && (ch != '#')) + { + ch = getc(data_file); + // Add a linefeed so it will copy to the clipboard ok + if (ch == 10) + { + poem_buffer[i] = 13; + i++; + } + + poem_buffer[i] = ch; + i ++; + + if (i == buf_size) + { + sprintf(error_buf, "%s", "Poetry buffer exceeded."); + PoetryError(error_buf); + return FALSE; + } + } + fclose(data_file); + poem_buffer[i-1] = 0; + return TRUE; + } +} + +// Do the search +long MainWindow::DoSearch(void) +{ + if (!search_string) + return FALSE; + + FILE *file; + long i = 0; + int ch = 0; + char buf[100]; + long find_start; + long previous_poem_start; + + bool found = FALSE; + int search_length = strlen(search_string); + + if (same_search) + { + find_start = last_find + 1; + previous_poem_start = last_poem_start; + } + else + { + find_start = 0; + last_poem_start = 0; + previous_poem_start = -1; + } + + if (data_filename) + sprintf(buf, "%s.dat", data_filename); + + if (! (data_filename && (file = fopen(buf, "r")))) + { + sprintf(error_buf, "Poetry data file %s not found\n", buf); + PoetryError(error_buf); + return FALSE; + } + + fseek(file, find_start, SEEK_SET); + + while ((ch != EOF) && !found) + { + ch = getc(file); + ch |= 0x0020; // Make lower case + + // Only match if we're looking at a different poem + // (no point in displaying the same poem again) + if ((ch == search_string[i]) && (last_poem_start != previous_poem_start)) + { + if (i == 0) + last_find = ftell(file); + if (i == search_length-1) + found = TRUE; + i ++; + } + else + i = 0; + + if (ch == '#') + { + ch = getc(file); + last_poem_start = ftell(file); + } + } + fclose(file); + if (ch == EOF) + last_find = -1; + + if (found) + { + return last_poem_start; + } + else + return -1; +} + +// Set up poetry filenames, preferences, load the index +// Load index (or compile it if none found) +void TryLoadIndex() +{ + index_ok = LoadIndex(index_filename); + if (!index_ok || (nitems == 0)) + { + PoetryError("Index file not found; will compile new one", "wxPoem"); + index_ok = Compile(); + } +} + +// Error message +void PoetryError(char *msg, char *caption) +{ + wxMessageBox(msg, caption, wxOK|wxICON_EXCLAMATION); +} + +// Notification (change icon to something appropriate!) +void PoetryNotify(char *Msg, char *caption) +{ + wxMessageBox(Msg, caption, wxOK | wxICON_INFORMATION); +} + +// Build up and save an index into the poetry data file, for +// rapid random access +bool Compile(void) +{ + FILE *file; + long i = 0; + int j; + int ch = 0; + char buf[100]; + + if (data_filename) + sprintf(buf, "%s.dat", data_filename); + + if (! (data_filename && (file = fopen(buf, "r")))) + { + sprintf(error_buf, "Poetry data file %s not found\n", buf); + PoetryError(error_buf); + return FALSE; + } + + nitems = 0; + + // Do first one (?) + poem_index[nitems] = 0; + nitems ++; + + // Do rest + while (ch != EOF) + { + ch = getc(file); + i ++; + if (ch == '#') + { + ch = getc(file); + long data; + data = ftell(file); + poem_index[nitems] = data; + nitems ++; + } + } + fclose(file); + + if (index_filename) + sprintf(buf, "%s.idx", index_filename); + if (! (data_filename && (file = fopen(buf, "w")))) + { + sprintf(error_buf, "Poetry index file %s cannot be created\n", buf); + PoetryError(error_buf); + return FALSE; + } + + fprintf(file, "%ld\n\n", nitems); + for (j = 0; j < nitems; j++) + fprintf(file, "%ld\n", poem_index[j]); + + fclose(file); + PoetryNotify("Poetry index compiled."); + return TRUE; +} + +void PopupFunction(wxMenu& menu, wxCommandEvent& event) +{ + switch (event.m_commandInt) + { + case POEM_NEXT: + // Another poem/page + TheMainWindow->NextPage(); + break; + case POEM_PREVIOUS: + // Previous page + TheMainWindow->PreviousPage(); + break; + case POEM_SEARCH: + // Search - with dialog + TheMainWindow->Search(TRUE); + break; + case POEM_NEXT_MATCH: + // Search - without dialog (next match) + TheMainWindow->Search(FALSE); + break; + case POEM_MINIMIZE: + TheMainWindow->Iconize(TRUE); + break; +#ifdef __WXMSW__ + case POEM_COPY: + // Copy current poem to the clipboard + CopyToClipboard((HWND) TheMainWindow->GetHWND(), poem_buffer); + break; +#endif + case POEM_COMPILE: + // Compile index + Compile(); + break; + case POEM_BIGGER_TEXT: + { + pointSize ++; + CreateFonts(); + TheMainWindow->Resize(); + break; + } + case POEM_SMALLER_TEXT: + { + if (pointSize > 2) + { + pointSize --; + CreateFonts(); + TheMainWindow->Resize(); + } + break; + } + case POEM_HELP_CONTENTS: + { + HelpController->LoadFile("wxpoem"); + HelpController->DisplayContents(); + break; + } + case POEM_ABOUT: + { + (void)wxMessageBox("wxPoem Version 1.1\nJulian Smart (c) 1995", + "About wxPoem", wxOK, TheMainWindow); + break; + } + case POEM_EXIT: + // Exit + TheMainWindow->Close(TRUE); + break; + default: + break; + } +} diff --git a/samples/wxpoem/wxpoem.dat b/samples/wxpoem/wxpoem.dat new file mode 100644 index 0000000000..c03e49465d --- /dev/null +++ b/samples/wxpoem/wxpoem.dat @@ -0,0 +1,2532 @@ +@T A Thunderstorm in Town + +She wore a new "terra-cotta" dress, +And we stayed, because of the pelting storm, +Within the hansom's dry recess, +Though the horse had stopped; yea, motionless +We sat on, snug and warm. + +Then the downpour ceased, to my sharp sad pain +And the glass that had screened our forms before +Flew up, and out she sprang to her door: +I should have kissed her if the rain +Had lasted a minute more. + +@A Thomas Hardy +# +They say my verse is sad: no wonder; +Its narrow measure spans +Tears of eternity, and sorrow, +Not mine, but man's. + +This is for all ill-treated fellows +Unborn and unbegot, +For them to read when they're in trouble +And I am not. + +@A A. E. Housman +# +@T On a Day's Stint + +And long ere dinner-time I have +Full eight close pages wrote. +What, Duty, hast thou now to crave? +Well done, Sir Walter Scott! + +@A Sir Walter Scott +# +@T The Choir Boy + +And when he sang in choruses +His voice o'ertopped the rest, +Which is very inartistic, +But the public like that best. + +@A Anonymous +# +@T For Johnny + +Do not despair +For Johnny-head-air; +He sleeps as sound +As Johnny underground. + +Fetch out no shroud +For Johnny-in-the-cloud; +And keep your tears +For him in after years. + +Better by far +For Johnny-the-bright-star, +To keep your head, +And see his children fed. + +@A John Pudney +# +@T Cock-Crow + +Out of the wood of thoughts that grows by night +To be cut down by the sharp axe of light, - +Out of the night, two cocks together crow, +Cleaving the darkness with a silver blow: +And bright before my eyes twin trumpeters stand, +Heralds of splendour, one at either hand, +Each facing each as in a coat of arms: +The milkers lace their boots up at the farms. + +@A Edward Thomas +# +@T After Long Silence + +Speech after long silence; it is right, +All other lovers being estranged or dead, +Unfriendly lamplight hid under its shade, +The curtains drawn upon unfriendly night, +That we descant and yet again descant +Upon the supreme theme of Art and Song: +Bodily decrepitude is wisdom; young +We loved each other and were ignorant. + +@A W. B. Yeats +# +@T Clouds + +Down the blue night the unending columns press +In noiseless tumult, break and wave and flow, +Now tread the far South, or lift rounds of snow +Up to the white moon's hidden loveliness. +Some pause in their grave wandering comradeless, +And turn with profound gesture vague and slow, +As who would pray good for the world, but know +Their benediction empty as they bless. + +They say that the Dead die not, but remain +Near to the rich heirs of their grief and mirth. +I think they ride the calm mid-heaven, as these, +In wise majestic melancholy train, +And watch the moon, and the still-raging seas, +And men coming and going on the earth. + +@A Rupert Brooke +# +@T If I should ever by Chance + +If I should ever by chance grow rich +I'll buy Codham, Cockridden, and Childerditch, +Roses, Pyrgo, and Lapwater, +And let them all to my elder daughter. +The rent I shall ask of her will be only +Each year's violets, white and lonely, +The first primroses and orchises - +She must find them before I do, that is. +But if she finds a blossom on furze +Without rent they shall all for ever be hers, +Codham, Cockridden, and Childerditch, +Roses, Pyrgo, and Lapwater, - +I shall give them all to my elder daughter. + +@A Edward Thomas +# +@T Adlestrop + +Yes, I remember Adlestrop - +The name, because one afternoon +Of heat the express-train drew up there +Unwontedly. It was late June. + +The steam hissed. Someone cleared his throat. +No one left and no one came +On the bare platform. What I saw +Was Adlestrop - only the name + +And willows, willow-herb, and grass, +And meadowsweet, and haycocks dry, +No whit less still and lonely fair +Than the high cloudlets in the sky. + +And for that minute a blackbird sang +Close by, and round him, mistier, +Farther and farther, all the birds +Of Oxfordshire and Gloucestershire. + +@A Edward Thomas +# +@T Tall Nettles + +Tall nettles cover up, as they have done +These many springs, the rusty harrow, the plough +Long worn out, and the roller made of stone: +Only the elm butt tops the nettles now. + +This corner of the farmyard I like most: +As well as any bloom upon a flower +I like the dust on the nettles, never lost +Except to prove the sweetness of a shower. + +@A Edward Thomas +# +@T The Cherry Trees + +The cherry trees bend over and are shedding +On the old road where all that passed are dead, +Their petals, strewing the grass as for a wedding +This early May morn when there is none to wed. + +@A Edward Thomas +# +@T What will they do? + +What will they do when I am gone? It is plain +That they will do without me as the rain +Can do without the flowers and the grass +That profit by it and must perish without. +I have but seen them in the loud street pass; +And I was naught to them. I turned about +To see them disappearing carelessly. +But what if I in them as they in me +Nourished what has great value and no price? +Almost I thought that rain thirsts for a draught +Which only in the blossom's chalice lies, +Until that one turned back and lightly laughed. + +@A Edward Thomas +# +@T The Lane + +Some day, I think, there will be people enough +In Froxfield to pick all the blackberries +Out of the hedges of Green Lane, the straight +Broad lane where now September hides herself +In bracken and blackberry, harebell and dwarf gorse. +Today, where yesterday a hundred sheep +Were nibbling, halcyon bells shake to the sway +Of waters that no vessel ever sailed... +It is a kind of spring: the chaffinch tries +His song. For heat it is like summer too. +This might be winter's quiet. While the glint +Of hollies dark in the swollen hedges lasts - +One mile - and those bells ring, little I know +Or heed if time be still the same, until +The lane ends and once more all is the same. + +@A Edward Thomas +# +@T In Memoriam (Easter, 1915) + +The flowers left thick at nightfall in the wood +This Eastertide call into mind the men, +Now far from home, who, with their sweethearts, should +Have gathered them and will do never again. + +@A Edward Thomas +# +@T Failure + +Because God put His adamantine fate +Between my sullen heart and its desire, +I swore that I would burst the Iron Gate, +Rise up, and curse Him on His throne of fire. +Earth shuddered at my crown of blasphemy, +But Love was as a flame about my feet; +Proud up the Golden Stair I strode; and beat +Thrice on the Gate, and entered with a cry - + +All the great courts were quiet in the sun, +And full of vacant echoes: moss had grown +Over the glassy pavement, and begun +To creep within the dusty council-halls. +An idle wind blew round an empty throne +And stirred the heavy curtains on the walls. + +@A Rupert Brooke +# +@T Sonnet + +I said I splendidly loved you; it's not true. +Such long swift tides stir not a land-locked sea. +On gods or fools the high risk falls - on you - +The clean clear bitter-sweet that's not for me. +Love soars from earth to ecstasies unwist. +Love is flung Lucifer-like from Heaven to Hell. +But - there are wanderers in the middle mist, +Who cry for shadows, clutch, and cannot tell +Whether they love at all, or, loving, whom: +An old song's lady, a fool in fancy dress, +Or phantoms, or their own face on the gloom; +For love of Love, or from heart's loneliness. +Pleasure's not theirs, nor pain. They doubt, and sigh, +And do not love at all. Of these am I. + +@A Rupert Brooke +# +@T The Hill + +Breathless, we flung us on the windy hill, +Laughed in the sun, and kissed the lovely grass. +You said, `Through glory and ecstasy we pass; +Wind, sun, and earth remain, the birds sing still, +When we are old, are old...' `And when we die +All's over that is ours; and life burns on +Through other lovers, other lips,' said I, +`Heart of my heart, our heaven is now, is won!' + +`We are Earth's best, that learnt her lesson here. +Life is our cry. We have kept the faith!' we said; +`We shall go down with unreluctant tread +Rose-crowned into the darkness!' ...Proud we were, +And laughed, that had such brave true things to say, +- And then you suddenly cried, and turned away. + +@A Rupert Brooke +# +@T Song + +All suddenly the wind comes soft, +And Spring is here again; +And the hawthorn quickens with buds of green, +And my heart with buds of pain. + +My heart all Winter lay so numb, +The earth so dead and frore, +That I never thought the Spring would come, +Or my heart wake any more. + +But Winter's broken and earth has woken. +And the small birds cry again; +And the hawthorn hedge puts forth its buds, +And my heart puts forth its pain. + +@A Rupert Brooke +# +@T The Way that Lovers Use + +The way that lovers use is this: +They bow, catch hands, with never a word, +And their lips meet, and they do kiss, +- So I have heard. + +They queerly find some healing so, +And strange attainment in the touch; +There is a secret lovers know, +- I have read as much. + +And theirs is no longer joy nor smart, +Changing or ending, night or day; +But mouth to mouth, and heart on heart, +- So lovers say. + +@A Rupert Brooke +# +@T Song + +The way of love was thus. +He was born one winter's morn +With hands delicious, +And it was well with us. + +Love came our quiet way, +Lit pride in us, and died in us, +All in a winter's day. +There is no more to say. + +@A Rupert Brooke +# +@T Sonnet Reversed + +Hand trembling towards hand; the amazing lights +Of heart and eye. They stood on supreme heights. + +Ah, the delirious weeks of honeymoon! +Soon they returned, and after strange adventures, +Settled at Balham by the end of June. +Their money was in Can. Pasc. B. Debentures, +And in Antofagastas. Still he went +Cityward daily; still she did abide +At home. And both were really quite content +With work and social pleasures. Then they died. +They left three children (besides George, who drank): +The eldest Jane, who married Mr Bell, +William, the head-clerk in the County Bank, +And Henry, a stock-broker, doing well. + +@A Rupert Brooke +# +@T A White Rose + +The red rose whispers of passion, +And the white rose breathes of love; +O, the red rose is a falcon, +And the white rose is a dove. + +But I send you a cream-white rosebud +With a flush on its petal tips; +For the love that is purest and sweetest +Has a kiss of desire on the lips. + +@A John Boyle O'Reilly +# +@T Urceus Exit + +I intended an Ode, +And it turn'd to a Sonnet. +It began 'a la mode', +I intended an Ode; +But Rose cross'd the road +In her latest new bonnet; +I intended an Ode; +And it turn'd to a Sonnet. + +@A Austin Dobson +# +@T Pippa's Song + +The year's at the spring, +And day's at the morn; +Morning's at seven; +The hill-side's dew-pearl'd; +The lark's on the wing; +The snail's on the thorn; +God's in His heaven - +All's right with the world! + +@A Robert Browning +# +@T Song + +She is not fair to outward view +As many maidens be, +Her loveliness I never knew +Until she smiled on me; +O, then I saw her eye was bright, +A well of love, a spring of light! + +But now her looks are coy and cold, +To mine they ne'er reply, +And yet I cease not to behold +The love-light in her eye: +Her very frowns are fairer far +Than smiles of other maidens are. + +@A Hartley Coleridge +# +@T Rondeau + +Jenny kiss'd me when we met, +Jumping from the chair she sat in; +Time, you thief, who love to get +Sweets into your list, put that in! +Say I'm weary, say I'm sad, +Say that health and wealth have miss'd me, +Say I'm growing old, but add, +Jenny kiss'd me. + +@A J. H. Leigh Hunt +# +@T A Drinking Song + +Bacchus must now his power resign - +I am the only God of Wine! +It is not fit the wretch should be +In competition set with me, +Who can drink ten times more than he. + +Make a new world, ye powers divine! +Stock'd with nothing else but Wine: +Let Wine its only product be, +Let Wine be earth, and air, and sea - +And let that Wine be all for me! + +@A Henry Carey +# +I never had a piece of toast +Particularly long and wide, +But fell upon the sanded floor +And always on the buttered side. + +@A James Payn +# +@T Summer Evening + +The frog, half fearful, jumps across the path, +And little mouse that leaves its hole at eve +Nimbles with timid dread beneath the swath; +My rustling steps awhile their joys deceive, +Till past - and then the cricket sings more strong, +And grasshoppers in merry mood still wear +The short night weary with their fretting song. +Up from behind the mole-hill jumps the hare, +Cheat of his chosen bed, and from the bank +The yellowhammer flutters in short fears +From off its nest hid in the grasses rank, +And drops again when no more noise it hears. +Thus nature's human link and endless thrall, +Proud man, still seems the enemy of all. + +@A John Clare +# +@T Diamond Cut Diamond + +Two cats +One up a tree +One under the tree +The cat up a tree is he +The cat under the tree is she +The tree is witch elm, just incidentally. +He takes no notice of she, she takes no notice of he. +He stares at the woolly clouds passing, she stares at the tree. +There's been a lot written about cats, by Old Possum, Yeats and +Company +But not Alfred de Musset or Lord Tennyson or Poe or anybody +Wrote about one cat under, and one cat up, a tree. +God knows why this should be left for me +Except I like cats as cats be +Especially one cat up +And one cat under +A witch elm +Tree. + +@A Ewart Milne +# +@T Time and Love + +When I have seen by Time's fell hand defaced +The rich proud cost of out-worn buried age; +When sometime lofty towers I see down-razed, +And brass eternal slave to mortal rage; + +When I have seen the hungry ocean gain +Advantage on the kingdom of the shore, +And the firm soil win of the watery main, +Increasing store with loss, and loss with store; + +When I have seen such interchange of state, +Or state itself confounded to decay, +Ruin hath taught me thus to ruminate - +That Time will come and take my Love away: + +- This thought is as a death, which cannot choose +But weep to have that which it fears to lose. + +@A William Shakespeare +# +Under the greenwood tree +Who loves to lie with me, +And turn his merry note +Unto the sweet bird's throat - +Come hither, come hither, come hither ! +Here shall he see +No enemy +But winter and rough weather. + +Who doth ambition shun +And loves to live i' the sun, +Seeking the food he eats +And pleased with what he gets - +Come hither, come hither, come hither! +Here shall he see +No enemy +But winter and rough weather. + +@A William Shakespeare +# +@T Absence + +Being your slave, what should I do but tend +Upon the hours and times of your desire? +I have no precious time at all to spend +Nor services to do, till you require: + +Nor dare I chide the world-without-end hour +Whilst I, my sovereign, watch the clock for you, +Nor think the bitterness of absence sour +When you have bid your servant once adieu: + +Nor dare I question with my jealous thought +Where you may be, or your affairs suppose, +But like a sad slave, stay and think of nought +Save, where you are, how happy you make those;- + +So true a fool is love, that in your will, +Though you do anything, he thinks no ill. + +@A William Shakespeare +# +To me, fair Friend, you never can be old, +For as you were when first your eye I eyed +Such seems your beauty still. Three winters cold +Have from the forests shook three summers' pride; +Three beauteous springs to yellow autumn turn'd +In process of the seasons have I seen, +Three April perfumes in three hot Junes burn'd, +Since first I saw you fresh, which yet are green. + +Ah! yet doth beauty, like a dial-hand, +Steal from his figure, and no pace perceived; +So your sweet hue, which methinks still doth stand, +Hath motion, and mine eye may be deceived: + +For fear of which, hear this, thou age unbred,- +Ere you were born, was beauty's summer dead. + +@A William Shakespeare +# +@T To His Love + +Shall I compare thee to a summer's day? +Thou art more lovely and more temperate: +Rough winds do shake the darling buds of May, +And summer's lease hath all too short a date: + +Sometime too hot the eye of heaven shines, +And often is his gold complexion dimm'd: +And every fair from fair sometime declines, +By chance, or nature's changing course, untrimm'd. + +But thy eternal summer shall not fade +Nor lose possession of that fair thou owest; +Nor shall death brag thou wanderest in his shade, +When in eternal lines to time thou growest: + +So long as men can breathe, or eyes can see, +So long lives this, and this gives life to thee. + +@A William Shakespeare +# +@T Carpe Diem + +O Mistress, where are you roaming? +O stay and hear! your true-love's coming +That can sing both high and low; +Trip no further, pretty sweeting, +Journey's end in lovers' meeting - +Every wise man's son doth know. + +What is love? 'tis not hereafter; +Present mirth hath present laughter; +What's to come is still unsure; +In delay there lies no plenty,- +Then come kiss me, Sweet-and-twenty, +Youth's a stuff will not endure. + +@A William Shakespeare +# +@T A Sea Dirge + +Full fathom five thy father lies: +Of his bones are coral made; +Those are peals that were his eyes; +Nothing of him that doth fade +But doth suffer a sea-change +Into something rich and strange. +Sea-nymphs hourly ring his knell; +Hark! now I hear them,- +Ding, dong, bell. + +@A William Shakespeare +# +@T On the Tombs in Westminster Abbey + +Mortality, behold and fear, +What a change of flesh is here! +Think how many royal bones +Sleep within these heaps of stones; +Here they lie, had realms and lands, +Who now want strength to stir their hands, +Where from their pulpits seal'd with dust +They preach, `In greatness is no trust.' +Here's an acre sown indeed +With the richest royallest seed +That the earth did e'er suck in +Since the first man died for sin: +Here the bones of birth have cried +`Though gods they were, as men they died!' +Here are sands, ignoble things, +Dropt from the ruin'd sides of kings: +Here's a world of pomp and state +Buried in dust, once dead by fate. + +@A F. Beaumont +# +@T The Terror of Death + +When I have fears that I may cease to be +Before my pen has glean'd my teeming brain, +Before high-piled books, in charact'ry +Hold like rich garners the full-ripen'd grain; + +When I behold, upon the night's starr'd face, +Huge cloudy symbols of a high romance, +And think that I may never live to trace +Their shadows, with the magic hand of chance; + +And when I feel, fair creature of an hour! +That I shall never look upon thee more, +Never have relish in the fairy power +Of unreflecting love - then on the shore + +Of the wide world I stand alone, and think +Till love and fame to nothingness do sink. + +@A J. Keats +# +@T Young and Old + +When all the world is young, lad, +And all the trees are green; +And every goose a swan, lad, +And every lass a queen; +Then hey for boot and horse, lad, +And round the world away; +Young blood must have its course, lad, +And every dog his day. + +When all the world is old, lad, +And all the trees are brown; +And all the sport is stale, lad, +And all the wheels run down; +Creep home, and take your place there, +The spent and maimed among: +God grant you find one face there, +You loved when all was young. + +@A C. Kingsley +# +@T Pied Beauty + +Glory be to God for dappled things- +For skies of couple-colour as a brindled cow; +For rose-moles all in stipple upon trout that swim; +Fresh-firecoal chestnut-falls; finches' wings; +Landscape plotted and pieced - fold, fallow, and plough; +And all trades, their gear and tackle and trim. + +All things counter, original, spare, strange; +Whatever is fickle, freckled (who knows how?) +With swift, slow; sweet, sour; adazzle, dim; +He fathers-forth whose beauty is past change: +Praise Him. + +@A Gerard Manley-Hopkins +# +@T The Lake Isle of Innisfree + +I will arise, and go to Innisfree, +And a small cabin build there, of clay and wattles made; +Nine bean rows will I have there, a hive for the hiney bee, +And live alone in the bee-loud glade. + +And I shall have some peace there, for peace comes dropping slow, +Dropping from the veils of the morning to where the cricket sings; +There midnight's all a-glimmer, and noon a purple glow, +And evening full of the linnet's wings. + +I will arise and go now, for always night and day +I hear lake water lapping with low sounds by the shores; +While I stand on the roadway, or on the pavements gray, +I hear it in the deep heart's core. + +@A W.B. Yeats +# +@T The Soldier + +If I should die, think only this of me: +That there's some corner of a foreign field +That is for ever England. There shall be +In that rich earth a richer dust concealed; +A dust whom England bore, shaped, made aware, +Gave, once, her flowers to love, her ways to roam, +Washed by the rivers, blest by suns of home. + +And think, this heart, all evil shed away, +A pulse in the eternal mind, no less +Gives somewhere back the thoughts by England given; +Her sights and sounds; dreams happy as her day; +And laughter, learnt of friends; and gentleness, +In hearts at peace, under an English heaven. + +@A Rupert Brooke +# +@T Towers + +Protected from the gales, we, +By the line of trees along the bank +From storms that batter Fife +And life here through the changing seasons - +Unchanging, a lonely beauty, +No reason to look to the rush +Beyond the rustle of the bushes. +But through the curtain of our trees, +The distant towers like castle turrets +Gleam by day and shine by night, +Holding, choking +Invisible souls within the shearing concrete height. + +@A Julian Smart +# +@T Break of Day + +Tis true, 'tis day; what though it be? +O wilt thou therefore rise from me? +Why should we rise, because 'tis light? +Did we lie down, because 'twas night? +Love which in spite of darkness brought us hither, +Should in despite of light keep us together. + +Light hath no tongue, but is all eye; +If it could speak as well as spy, +This were the worst, that it could say, +That being well, I fain would stay, +And that I loved my heart and honour so, +That I would not from him, that had them, go. + +Must business thee from hence remove? +Oh, that's the worst disease of love, +The poor, the foul, the false, love can +Admit. but not the busied man. +He which hath business, and makes love, doth do +Such wrong, as when a married man doth woo. + +@A John Donne +# +@T The Computation + +For the first twenty years, since yesterday, +I scarce believed, thou could'st be gone away, +For forty more, I fed on favours past, +And forty on hopes, that thou would'st, they might last. +Tears drowned one hundred, and sighs blew out two, +A thousand, I did neither think, nor do, +Or not divide, all being one thought of you; +Or in a thousand more, forget that too. +Yet call not this long life; but think that I +Am, by being dead, immortal; can ghosts die? + +@A John Dunne +# +@T A Red, Red Rose + +O, my love's like a red, red rose, +That's newly sprung in June. +O, my love's like the melodie, +That's sweetly play'd in tune. + +As fair art thou, my bonnie lass, +So deep in love am I, +And I will love thee still, my Dear, +Till a' the seas gang dry. + +Till a' the seas gang dry, my Dear, +And the rocks melt wi' the sun! +O, I will love thee still, my Dear, +While the sands o' life shall run. + +And fare thee weel, my only Love, +And fare thee weel a while! +And I will come again, my Love, +Tho' it were ten thousand mile! + +@A Robert Burns +# +@T On Charles II + +Here lies our sovereign Lord the King, +Whose word no man relies on, +Who never said a foolish thing +Nor ever did a wise one. + +@A Earl of Rochester +# +@T The Four Georges + +George the First was always reckoned +Vile - but viler George the Second; +And what mortal ever heard +Any good of George the Third? +When from earth the Fourth descended, +God be praised, the Georges ended! + +@A W.S. Landor +# +@T Frederick, Prince of Wales + +Here lies Fred, +Who was alive, and is dead, +Had it been his father, +I had much rather. +Had it been his brother, +Still better than another. +Had it been his sister, +No one would have missed her. +Had it been the whole generation, +Still better for the nation. +But since 'tis only Fred, +Who was alive, and is dead, +There's no more to be said. + +@A W.M. Thackeray +# +@T On an Old Woman + +Mycilla dyes her locks, 'tis said, +But 'tis a foul aspersion; +She buys them black, they therefore need +No subsequent immersion. + +@A W. Cowper +# +@T An Epitaph on Sir John Vanbrugh (Architect) + +Under this stone, reader, survey +Dead Sir John Vanbrugh's house of clay. +Lie heavy on him, earth! for he +Laid many heavy loads on thee. + +@A A. Evans +# +@T True Joy in Possession + +To have a thing is little, +If you're not allowed to show it, +And to know a thing is nothing +Unless others know you know it. + +@A Lord Neaves +# +@T To His Mistress Going To Bed + +Come, Madam, come, all rest my powers defy, +Until I labour, I in labour lie. +The foe oft-times having the foe in sight, +Is tired with standing though he never fight. +Off with that girdle, like heaven's zone glistering, +But a far fairer world encompassing. +Unpin that spangled breastplate which you wear, +That th'eyes of busy fools may be stopt there. +Unlace yourself, for that harmonious chime +Tells me from you, that now it is bed time. +Off with that happy busk, which I envy, +That still can be, and still can stand so nigh. +Your gown going off, such beauteous state reveals, +As when from flowry meads the hill's shadow steals. +@P +Off with that wiry coronet and show +The hairy diadem which on you doth grow: +Now off with those shoes, and then safely tread +In this love's hallowed temple, this soft bed. +In such white robes, heaven's angels used to be +Received by men; thou angel bring'st with thee +A heaven like Mahomet's Paradise; and though +Ill spirits walk in white, we easily know, +By this these angels from an evil sprite, +Those set our hairs, but these our flesh upright. + +Licence my roving hands, and let them go, +Before, behind, between, above, below. +O my America! my new-found-land, +My kingdom, safeliest when with one man manned, +My mine of precious stones, My empery, +How blest am I in this discovering thee! +To enter in these bonds, is to be free; +Then where my hand is set, my seal shall be. +@P +Full nakedness! All joys are due to thee, +As souls unbodied, bodies unclothed must be, +To taste whole joys. Gems which you women use +Are like Atlanta's balls, cast in men's views, +That when a fool's eye lighteth on a gem, +His earthly soul may covet theirs, not them. +Like pictures, or like books' gay coverings made +For lay-men, are all women this arrayed; +Themselves are mystic books, which only we +(Whom their imputed grace will dignify) +Must see revealed. Then since that I may know, +As liberally, as to a midwife, show +Thyself: cast all, yea, this white linen hence, +There is no penance due to innocence. + +To teach thee, I am naked first; why then +What needst thou have more covering than a man. + +@A John Donne +# +@T Cheltenham Waters + +Here lie I and my four daughters, +Killed by drinking Cheltenham waters. +Had we but stuck to Epsom salts, +We wouldn't have been in these here vaults. + +@A Anonymous +# +@T Hypocrisy + +Hypocrisy will serve as well +To propagate a church as zeal; +As persecution and promotion +Do equally advance devotion: +So round white stones will serve, they say, +As well as eggs to make hens lay. + +@A Samuel Butler +# +@T The Microbe + +The Microbe is so very small +You cannot make him out at all, +But many sanguine people hope +To see him through a microscope. +His jointed tongue that lies beneath +A hundred curious rows of teeth; +His seven tufted tails with lots +Of lovely pink and purple spots, +On each of which a pattern stands, +Composed of forty separate bands; +His eyebrows of a tender green; +All of these have never yet been seen - +But Scientists, who ought to know, +Assures us that they must be so... +Oh! let us never, never doubt +What nobody is sure about! + +@A Hilaire Belloc +# +@T Slug + +Slugs, soft upon damp carpets of rich food, +Make sullen love with bubbles and with sighs, +Silvery flaccid. They consider lewd +The use of eyes. + +@A John Pudney +# +@T The Doctor Prescribes + +A lady lately, that was fully sped +Of all the pleasures of the marriage-bed +Ask'd a physician, whether were more fit +For Venus' sports, the morning or the night? +The good old man made answer, as 'twas meet, +The morn more wholesome, but the night more sweet. +Nay then, i'faith, quoth she, since we have leisure, +We'll to't each morn for health, each night for pleasure. + +@A Anonymous +# +@T On Mary Ann + +Mary Ann has gone to rest, +Safe at last on Abraham's breast, +Which may be nuts for Mary Ann, +But is certainly rough on Abraham. + +@A Anonymous +# +@T Misfortunes never come Singly + +Making toast at the fireside, +Nurse fell in the grate and died; +And what makes it ten times worse, +All the toast was burnt with nurse. + +@A Harry Graham +# +@T Tender Heartedness + +Billy, in one of his nice new sashes, +Fell in the fire and was burnt to ashes; +Now, although the room grows chilly, +I haven't the heart to poke poor Billy. + +@A Harry Graham +# +@T Miss Twye + +Miss Twye was soaping her breasts in her bath +When she heard behind her a meaning laugh +And to her amazement she discovered +A wicked man in the bathroom cupboard. + +@A Gavin Ewart +# +@T The Old Loony of Lyme + +There was an old loony of Lyme, +Whose candour was simply sublime; +When they asked, 'Are you there?' +'Yes,' he said, 'but take care, +For I'm never "all there" at a time.' + +@A Anonymous +# +@T The Young Lady from Wantage + +There was a young lady from Wantage +Of whom the town clerk took advantage. +Said the borough surveyor: +'Indeed you must pay `er. +You've totally altered her frontage.' + +@A Anonymous +# +@T The Modern Hiawatha + +When he killed the Mudjokivis +Of the skin he made him mittens, +Made them with the fur side inside, +Made them with the skin side outside, +He, to get the warm side inside, +Put the inside skin side outside; +He, to get the cold side outside, +Put the warm side fur side inside. +That's why he put fur side inside, +Why he put the skin side outside, +Why he turned them inside outside. + +@A Anonymous +# +@T Is it a Month + +Is it a month since I and you +In the starlight of Glen Dubh +Stretched beneath a hazel bough +Kissed from ear and throat to brow, +Since your fingers, neck, and chin +Made the bars that fence me in, +Till Paradise seemed but a wreck +Near your bosom, brow and neck +And stars grew wilder, growing wise, +In the splendour of your eyes! +Since the weasel wandered near +Whilst we kissed from ear to ear +And the wet and withered leaves +Blew about your cap and sleeves, +Till the moon sank tired through the ledge +Of the wet and windy hedge? +And we took the starry lane +Back to Dublin town again. + +@A J. M. Synge +@A (1871-1909) +# +@T The Lark in the Clear Air + +Dear thoughts are in my mind, +And my soul soars enchanted, +As I hear the sweet lark sing +In the clear air of the day. +For a tender beaming smile +To my hope has been granted, +And tomorrow she shall hear +All my fond heart would say. + +I shall tell her all my love, +All my soul's adoration; +And I think she will hear me +And will not say me nay. +It is this that fills my soul +With its joyous elation, +As I hear the sweet lark sing +In the clear air of the day. + +@A Samuel Ferguson +@A (1810-1886) +# +@T The Self-Unseeing + +Here is the ancient floor, +Footworn and hollowed and thin, +Here was the former door +Where the dead feet walked in. + +She sat here in her chair, +Smiling into the fire; +He who played stood there, +Bowing it higher and higher. + +Childlike, I danced in a dream; +Blessings emblazoned that day; +Everything glowed with a gleam; +Yet we were looking away! + +@A Thomas Hardy +# +@T Cean Dubh Deelish (Darling Black Head) + +Put your head, darling, darling, darling, +Your darling black head my heart above; +O mouth of honey, with thyme for fragrance, +Who, with heart in breast, could deny you love? + +O many and many a young girl for me is pining, +Letting her locks of gold to the cold wind free, +For me, the foremost of our gay young fellows; +But I'd leave a hundred, pure love, for thee! + +Put your head, darling, darling, darling, +Your darling black head my heart above; +O mouth of honey, with thyme for fragrance, +Who, with heart in breast, could deny you love? + +@A Samuel Ferguson +@A (1810-1886) +# +@T From 'The Amores' + +Ring of mine, made to encircle my pretty mistress's finger, +Valuable only in terms of the giver's love, +Go, and good welcome! May she receive you with pleasure, +Slip you over her knuckle there and then. +May you fit her as well as she fits me, rub snugly +Around her finger, precisely the right size! +Lucky ring to be handled by my mistress! I'm developing +A miserable jealousy of my own gift. +But suppose I could be the ring, transformed in an instant +By some famous magician's art - +Then, when I felt like running my hand down Corinna's +Dress, and exploring her breasts, I'd work +Myself off her finger (tight squeeze or not) and by crafty +Cunning drop into her cleavage. Let's say +She was writing a private letter - I'd have to seal it, +@P +And a dry stone sticks on wax: +She's moisten me with her tongue. Pure bliss - provided +I didn't have to endorse any hostile remarks +Against myself. If she wanted to put me away in her +Jewel-box, I'd cling tighter, refuse to budge. +(Don't worry, my sweet, I'd never cause you discomfort, +or burden +Your slender finger with an unwelcome weight.) +Wear me whenever you take a hot shower, don't worry +If water runs under your gem - +Though I fancy the sight of you naked would arise my +passions, leave me +A ring of visibly virile parts... +Pure wishful thinking! On your way, then, little present, +And show her you come with all my love. + +@A Ovid +@A (BC 43-AD 17) +# +@T After an Interval + +After an interval, reading, here in the midnight, +With the great stars looking on -- all the starts of Orion looking, +And the silent Pleiades -- and the duo looking of Saturn and ruddy Mars; +Pondering, reading my own songs, after a long interval, +(sorrow and death familiar now) +Ere Closing the book, what pride! what joy! to find them +Standing so well the test of death and night, +And the duo of Saturn and Mars! + +@A Walt Whitman +# +@T A Last Poem + +A last poem, and a last, and yet another -- +O, when can I give over? +Must I drive the pen until the blood bursts from my nails +And my breath fails and I shake with fever? +Shall I never hear her whisper softly, +"But this is one written by you only, +And for me only; therefore, love, have done"? + +@A Robert Graves +# +I have no pain, dear Mother, now, +But, oh, I am so dry; +So connect me to a brewery, +And leave me there to die. + +@A Anonymous +# +@T Found Poem (from the Hound of the Baskervilles) + +I stooped, panting, and pressed my pistol +To the dreaful, shimmering head, +But it was useless to press the trigger, +The giant hound was dead. + +@A A. Conan Doyle +# +@T Passing through the Carron Iron Works + +We cam na here to view your warks, +In hopes to be mair wise, +But only, lest we gang to Hell, +It may be nae surprise. + +@A Robert Burns +# +@T Imitation of Pope: A Compliment to the Ladies + +Wondrous the Gods, more wondrous are the Men, +More Wondrous Wondrous still the Cock & Hen, +More Wondrous still the Table, Stool & Chair; +But Ah! More wondrous still the Charming Fair. + +@A William Blake +# +@T Upon the Nipples of Julia's Breast + +Have ye beheld (with much delight) +A red rose peeping through a white? +Or else a cherry (double grac'd) +Within a lily? Centre plac'd? +Or ever mark'd the pretty beam, +A strawberry shows half drown'd in cream? +Or seen rich rubies blushing through +A pure smooth pearl, and orient too? +So like to this, nay all the rest, +Is each neat niplet of her breast. + +@A Robert Herrick +# +@T Life + +When I consider life, 'tis all a cheat; +Yet, fooled with hope, men favour the deceit; +Trust on, and think tomorrow will repay: +Tomorrow's falser than the former day; +Lies worse; and while it says, we shall be blessed +With some new joys, cut off what we possessed. +Strange cozenage! None would live past years again, +Yet all hope pleasure in what yet remain; +And from the dregs of life think to receive +What the first sprightly running could not give. + +@A John Dryden +# +@T To a Yellow Hammer + +Poor yellow-breasted little thing, +I would thou had'st been on the wing, +'Ere 'twas my fate on thee to bring +Thy death so soon; +Thou'lt never more be heard to sing +In joyful tune. + +Too late I saw thee 'mongst the dust, +Gambling so gay in simple trust, +I knew that with my wheel I must +Thy life destroy; +How cruel quick my rubber crushed +Thee in thy joy. + +@A Anonymous +# +@T Wrecked + +A girl, a wheel, +A shock, a squeal, +A header, a thump, +A girl in a lump, +A bloomer all torn, +A maiden forlorn. + +@A Annymous +# +@T Gather ye Rosebuds + +Gather ye rosebuds while ye may, +Old Time is still a-flying; +And this same flower that smiles today +Tomorrow will be dying. + +The glorious lamp of heaven, the Sun, +The higher he's a-getting, +The sooner will his race be run, +And nearer he's to setting. + +That age is best, which is the first, +When youth and blood are warmer +But being spent, the worse, and worst +Times still succeed the former. + +Then be not coy, but use your time, +And while you may, go marry; +For having lost but once your prime, +You may for ever tarry. + +@A Robert Herrick +# +@T My Love's a Match + +My love's a match in beauty +For every flower that blows, +Her little ear's a lily, +Her velvet cheek a rose; +Her locks like gilly gowans +Hang golden to her knww. +If I were King of Ireland, +My Queen she'd surely be. + +Her eyes are fond forget-me-nots, +And no such snow is seen +Upon the heaving hawthorn bush +As crests her bodice green. +The thrushes when she's talking +Sit listening on the tree. +If I were King of Ireland, +My Queen she'd surely be. + +@A Alfred P. Graves +# +@T In a Gondola + +The moth's kiss, first! +Kiss me as if you made believe +You were not sure, this eve, +How my face, your flower, had pursed +Its petals up; so, here and there +You brush it, till I grow aware +Who wants me, and wide ope I burst. + +The bee's kiss, now! +Kiss me as if you enter'd gay +My heart at some noonday, +A bud that dares not disallow +The claim, so all is render'd up, +And passively its shatter'd cup +Over your head to sleep I bow. + +@A Robert Browning +# +@T To his Coy Mistress + +Had we but worlds enough, and time, +This coyness, Lady, were no crime. +We would sit down and think which way +To walk and pass our long love's day. +Thou by the Indian Ganges' side +Shouldst rubies find: I by the tide +Of Humber would complain. I would +Love you ten years before the Flood, +And you should, if you please, refuse +Till the conversion of the Jews. +My vegetable love should grow +Vaster than empires, and more slow; +An hundred years should go to praise +Thine eyes and on thy forehead gaze; +Two hundred to adore each breast, +But thirty thousand to the rest; +An age at least to every part, +And the last age should show your heart. +For, Lady, you deserve this state, +Nor would I love at a lower rate. +@P +But at my back I always hear +Time's winged chariot hurrying near; +And yonder all before us lie +Deserts of vast eternity. +Thy beauty shall no more be found, +Nor, in thy marble vault, shall sound +My echoing song: then worms shall try +That long preserved virginity, +And your quaint honour turn to dust, +And into ashes all my lust: +The grave's a fine and private place, +But none, I think, do there embrace. +@P +Now therefore, while the youthful hue +Sits on thy skin like morning dew, +And while thy willing soul transpires +At every port with instant fires, +Now let us sport us while we may, +And now, like amorous birds of prey, +Rather at once our time devour +Than languish in his slow-chapt power. +Let us roll all our strength and all +Our sweetness up into one ball, +And tear our pleasures with rough strife +Through the iron gates of life: +Thus, though we cannot make our sun +Stand still, yet we will make him run. + +@A Andrew Marvell +# +@T Destiny + +Somewhere there waiteth in this world of ours +For one lone soul another lonely soul, +Each choosing each through all the weary hours +And meeting strangely at one sudden goal. +Then blend they, like green leaves with golden flowers, +Into one beautiful and perfect whole; +And life's long night is ended, and the way +Lies open onward to eternal day. + +@A Edwin Arnold +# +@T A Stolen Kiss + +Now gentle sleep hath closed up those eyes +Which, waking, kept my boldest thoughts in awe; +And free access unto that sweet lip lies, +From whence I long the rosy breath to draw. + +Methinks no wrong it were, if I should steal +From those two melting rubies one poor kiss; +None sees the theft that would the theft reveal, +Nor rob I her of aught that she can miss; + +Nay, should I twenty kisses take away, +There would be little sign I would do so; +Why then should I this robbery delay? +O, she may wake, and therewith angry grow! + +Well, if she do, I'll back restore that one, +And twenty hundred thousand more for loan. + +@A George Wither +# +@T How do I love thee? + +How do I love thee? Let me count the ways. +I love thee to the depth and breadth and height +My soul can reach, when feeling out of sight +For the ends of Being and ideal Grace. +I love thee to the level of every day's +Most quiet need, by sun and candlelight. +I love thee freely, as men strive for Right; +I love thee purely, as they turn from Praise. +I love thee with the passion put to use +In my old griefs, and with my childhood's faith. +I love thee with a love I seemed to lose +With my lost saints, -- I love thee with the breath, +Smiles, tears, of all my life! -- and, if God choose, +I shall but love thee better after death. + +@A Elizabeth Barrett Browning +# +@T Old Man + +Old Man, or Lad's-love, -- in the name there's nothing +To one that knows not Lad's-love, or Old Man, +The hoar-green feathery herb, almost a tree, +Growing with rosemary and lavendar. +Even to one that knows it well, the names +Hald decorate, half perplex, the thing it is: +At least, what that is clings not to the names +In spite of time. And yet I like the names. + +The herb itself I like not, but for certain +I love it, as some day the child will love it +Who plucks a feather from the door-side bush +Whenever she goes in or out of the house. +Often she waits there, snipping the tips and shrivelling +The shreds at last on to the path, perhaps +@P +Thinking, perhaps of nothing, till she sniffs +Her finger and runs off. The bush is still +But half as tall as she, though it is as old; +So well she clips it. Not a word she says; +And I can only wonder hwo much hereafter +She will remember, with that bitter scent, +Of garden rows, and ancient damson-trees +Topping a hedge, a bent path to a door, +A low thick bush beside the door, and me +Forbidding her to pick. + +As for myself, +Where first I met the bitter scent is lost. +I, too, often shrivel the grey shreds, +Sniff them and think and sniff again and try +Once more to think what it is I am remembering, +Always in vain. I cannot like the scent, +Yet I would rather give up others more sweet, +With no meaning, that this bitter one. +@P +I have mislaid the key. I sniff the spray +And think of nothing; I see and I hear nothing; +Yet seem, too, to be listening, lying in wait +For what I should, yet never can, remember: +No garden appears, no path, no hoar-green bush +Of Lad's-love, or Old Man, no child beside, +Neither father nor mother, nor any playmate; +Only an avenue, dark and nameless, without end. + +@A Edward Thomas +# +@T The Manor Farm + +The rock-like mud unfroze a little and rills +Ran and sparkled down each side of the road +Under the catkins wagging in the hedge. +But earth would have her sleep out, spite of the sun; +Nor did I value that thin gilding beam +More than a pretty February thing +Till I came down to the old Manor Farm, +And church and yet-tree opposite, in age +Its equal and in size. Small church, great yew, +And farmhouse slept in a Sunday silentness. +The air raised not a straw. The steep farm roof, +With tiles duskily glowing, entertained +The midday sun; and up and down the roof +White pigeons nestled. There was no sound but one. +Three cart-horses were looking over a gate +Drowsily through their forelocks, swiching their tails +Against a fly, a solitary fly. +@P +The Winter's cheek flushed as if he had drained +Spring, Summer, and Autumn at a draught +And smiled quietly. But 'twas not Winter -- +Rather a season of bliss unchangeable +Awakened from farm and church where it had lain +Safe under tile and thatch for ages since +This England, Old already, was called Merry. + +@A Edward Thomas +# +@T The Unknown Bird + +Three lovely notes he whistled, too soft to be heard +If others sang; but others never sang +In the great beech-wood all that May and June. +No one saw him: I alone could hear him +Though many listened. Was it but four years +Ago? or five? He never came again. +Oftenest when I heard him I was alone, +Nor could I ever make another hear. +La-la-la! he called, seeming far-off -- +As if a cock crowed past the edge of the world, +As if the bird or I were in a dream. +Yet that he travelled through the trees and soometimes +Neared me, was plain, though somehow distant still +He sounded. All the proof is -- I told men +What I had heard. +@P +I never knew a voice, +Man, beast, or bird, better than this. I told +The naturalists; but neither had they heard +Anything like the notes that did so haunt me +I had them clear by heart and have them still. +Four years, or five, have made no difference. Then +As now that La-la-la! was bodiless sweet: +Sad more than joyful it was, if I must say +'Twas sad only with joy too, too far off +For me to taste it. But I cannot tell +If truly never anything but fair +The days were when he sang, as now they seem. +This surely I know, that I who listened then, +Happy sometimes, sometimes suffering +A heavy body and a heavy heart, +Now straightaway, if I think of it, become +Light as that bird wandering beyond my shore. + +@A Edward Thomas +# +@T First known when lost + +I never had noticed it until +'Twas gone, -- the narrow copse +Where now the woodman lops +The last of the willows with his bill. + +It was not more than a hedge o'ergrown. +One meadow's breadth away +I passed it day by day. +Now the soil is bare as a bone, + +And black betwixt two meadows green, +Though fresh-cut faggot ends +Of hazel make some amends +With a gleam as if flowers they had been. + +Strange it could have hidden so near! +And now I see as I look +That the small winding brook, +A tributary's tributary rises there. + +@A Edward Thomas +# +@T The Owl + +Downhill I came, hungry, and yet not starved; +Cold, yet had heat within me that was proof +Against the North wind: tired, yet so that rest +Had seemed the sweetest thing under a roof. + +Then at the inn I had food, fire, and rest, +Knowing how hungry, cold and tired was I. +All of the night was quite barred out except +An owl's cry, a most melancholy cry + +Shaken out long and clear upon the hill, +No merry note, nor cause of merriment, +But one telling me plain what I escaped +And others could not, that night, as in I went. + +And salted was my food, and my repose, +Salted and sobered, too, by the bird's voice +Speaking for all who lay under the stars, +Soldiers and poor, unable to rejoice. + +@A Edward Thomas +# +@T But these things also + +But these things also are Spring's -- +On banks by the roadside the grass +Long-dead that is greyer now +Than all the Winter it was; + +The shell of a little snail bleached +In the grass; chip of flint, and mite +Of chalk; and the small bird's dung +In splashes of purest white: + +All the white things a man mistakes +For earliest violets +Who seeks through Winter's ruins +Something to pay Winter's debts, + +While the North blows, and starling flocks +By chattering on and on +Keeep their spirits up in the mist, +And Spring's here, Winter's not gone. + +@A Edward Thomas +# +@T The New House + +Now first, as I shut the door, +I was alone +In the new house; and the wind +Began to moan. + +Old at once was the house, +And I was old; +My ears were teased with the dread +Of what was foretold, + +Nights of storm, days of mist, without end; +Sad days when the sun +Shone in vain: old griefs, and griefs +Not yet begun. + +All was foretold me; naught +Could I foresee; +But I learnt how the wind would sound +After these things should be. + +@A Edward Thomas +# +@T Lovers + +The two men in the road were taken aback. +The lovers came out shading their eyes from the sun, +And never was white so white, or black so black, +As her cheeks and hair. 'There are more things than one +A man might turn into a wood for, Jack,' +Said George; Jack whispered: 'He has not got a gun. +It's a bit too much of a good thing, I say. +They are going the other road, look. And see her run.' -- +She ran -- 'What a thing it is, this picking may.' + +@A Edward Thomas +# +@T Melancholy + +The rain and wind, the rain and wind, raved endlessly. +On me the Summer storm, and fever, and melancholy +Wrought magic, so that if I feared the solitude +Far more I feared all company: too sharp, too rude, +Had been the wisest or the dearest human voice. +What I desired I knew not, but whate'er my choice +Vain it must be, I knew. Yet naught did my despair +But sweeten the strange sweetness, while through the wild air +All day long I heard a distant cuckoo calling +And, soft as dulcimers, sounds of near water falling, +And, softer, and remote as if in history, +Rumours of what had touched my friends, my foes, or me. + +@A Edward Thomas +# +@T The Glory + +The glory of the beauty of the morning, -- +The cuckoo crying over the untouched dew; +The blackbird that has found it, and the dove +That tempts me on to something sweeter than love; +White clouds ranged even and fair as new-mown hay; +The heat, the stir, the sublime vancancy +Of sky meadow and forest and my own heart: -- +The glory invites me, yet it leaves me scorning +All I can ever do, all I can be, +Beside the lovely of motion, shape, and hue, +The happiness I fancy fit to dwell +In beauty's presence. Shall I now this day +@P +Begin to seek as far as heaven, as hell, +Wisdom or strength to match this beauty, start +And tread the pale dust pitted with small dark drops, +In hope to find whatever it is I seek, +Hearkening to short-lived happy-seeming things +That we know naught of, in the hazel copse? +Or must I be content with discontent +As larks and swallows are perhaps with wings? +And shall I ask at the day's end once more +What beauty is, and what I can have meant +By happiness? And shall I let all go, +Glad, weary, or both? Or shall I perhaps know +That I was happy oft and oft before, +Awhile forgetting how I am fast pent, +How dreary-swift, with naught to travel to, +Is Time? I cannot bite the day to the core. + +@A Edward Thomas +# +@T The Brook + +Seated by a brook, watching a child +Chiefly that paddled, I was this beguiled. +Mellow the blackbird sang and sharp the thrush +Not far off in the oak and hazel brush, +Unseen. There was a scent like honeycomb +From mugwort dull. And down upon the dome +Of the stone the card-horse kicks against so oft +A butterfly alighted. From aloft +He took the heat of the sun, and from below, +On the hot stone he perched contented so, +As if never a cart would pass again +That way; as if I were the last of men +And he the first of insects to have earth +And sun together and to know their worth. +@P +I was divided between him and the gleam, +The motion, and the voices, of the stream, +The waters running frizzled over gravel, +Thaat never vanish and for ever travel. +A grey flycatcher silent on a fence +And I sat as if we had been there since +The horseman and the horse lying beneath +The fir-tree-covered barrow on the heath, +The horseman and the horse with silver shoes, +Galloped the downs last. All that I could lose +I lost. And then the child's voice raised the dead. +'No one's been here before' was what she said +And what I felt, yet never should have found +A word for, while I gathered sight and sound. + +@A Edward Thomas +# +@T This is no case of petty right or wrong + +This is no case of petty right or wrong +That politicians or philosphers +Can judge. I hate not Germans, nor grow hot +With love of Englishmen, to please newspapers. +Beside my hate for one fat patriot +My hatred of the Kaiser is love true :-- +A kind of god he is, banging a gong. +But I have not to choose between the two, +Or between justice and injustice. Dinned +With war and argument I read no more +Than in the storm smoking along the wind +Athwart the wood. Two witches' cauldrons roar. +@P +From one the weather shall rise clear and gay; +Out of the other an England beautiful +And like her mother that died yesterday. +Little I know or care if, being dull, +I shall miss something that historians +Can rake out of the ashes when perchance +The phoenix broods serene above their ken. +But with the best and meanest Englishmen +I am one in crying, God save England, lest +We lose what never slaves and cattle blessed. +The ages made here that made us from the dust: +She is all we know and live by, and we trust +She is good and must endure, loving her so: +And as we love ourselves we hate her foe. + +@A Edward Thomas +# +@T Helen + +And you, Helen, what should I give you? +So many things I would give you +Had I an infinite great store +Offered me and I stood before +To choose. I would give you youth, +All kinds of lovelines and truth, +A clear eye as good as mine, +Lands, waters, flowers, wine, +As many children as your heart +Might wish for, a far better art +Than mine can be, all you have lost +Upon the travelling waters tossed, +Or given to me. If I could choose +Freely in that great treasure-house +Anything from any shelf, +I would give you back yourself, +And power to discriminate +What you want and want it not too late, +Many fair days free from care +And heart to enjoy both foul and fair, +And myself, too, if I could find +Where it lay hidden and it proved kind. + +@A Edward Thomas +# +@T Bob's Lane + +Women he liked, did shovel-bearded Bob, +Old Farmer Hayward of the Heath, but he +Loved horses. He himself was like a cob, +And leather-coloured. Also he loved a tree. + +For the life in them he loved most living things, +But a tree chiefly. All along the lane +He planted elms where now the stormcock sings +That travellers hear from the slow-climbing train. + +Till then the track had never had a name +For all its thicket and the nightingales +That should have earned it. No one was to blame. +To name a thing beloved man sometimes fails. + +Many years since, Bob Hayward died, and now +None passes there because the mist and the rain +Out of the elms have turned the lane to slough +And gloom, the name alone survives, Bob's Lane. + +@A Edward Thomas +# +@T The Poetry of Dress + +A sweet disorder in the dress +Kindles in clothes a wantonness :-- +A lawn about the shoulders thrown +Into a fine distraction, -- +An erring lace, which here and there +Enthrals the crimson stomacher -- +A cuff neglectful, and thereby +Ribbands to flow confusedly, -- +A winning wave, deserving note, +In the tempestuous petticoat, -- +A careless shoe-string, in whose tie +I see a wild civility, -- +Do more bewitch me, than when art +Is too precise in evry part. + +@A R. Herrick +# +@T The Poetry of Dress + +When as in silks my Julia goes +Then, then (methinks) how sweetly flows +That liquefaction of her clothes. + +Next, when I cast mine eyes and see +That brave vibration each way free; +O how that glittering taketh me! + +@A R. Herrick +# +My Love in her attire doth show her wit, +It doth so well become her: +For every season she hath dressings fit, +For Winter, Spring and Summer. +No beauty she doth miss +When all her robes are on: +But Beauty's self she is +When all her robes are gone. + +@A Anonymous +# +@T On a Girdle + +That which her slender waist confined +Shall now my joyful temples bind: +No monarch but would give his crown +His arms might do what this has done. + +It was my Heaven's extremest sphere, +The pale which held that lovely deer: +My joy, my grief, my hope, my love +Did all within this circle move. + +A narrow compass! and yet there +Dwelt all that's good, and all that's fair: +Give me but what this ribband bound, +Take all the rest the Sun goes round. + +@A E. Waller +# +@T The Lost Love + +She dwelt among the untrodden ways +Beside the springs of Dove; +A maid whom there were none to praise, +And very few to love: + +A violet by a mossy stone +Half hidden from the eye! +-- Fair as a star, when only one +Is shining in the sky. + +She lived unknown, and few could know +When Lucy ceased to be; +But she is in her grave, and oh, +The difference to me! + +@A W. Wordsworth +# +I strove with none, for none was worth my strife; +Nature I loved, and next to Nature, Art; +I warmed both hands before the fire of life +It sinks, and I am ready to depart. + +@A W. S. Landor +# +@T The Miller's Daughter + +It is the miller's daughter, +And she is grown so dear, so dear, +That I would be the jewel +That trembles in her ear: +For his in ringlets day and night, +I'd touch her neck so warm and white. + +And I would be the girdle +About her dainty waist, +And her heart would beat against me +In sorrow and in rest: +And I should know if it beat right, +I'd clasp it round so close and tight. + +And I would be the necklace, +And all day long to fall and rise +Upon her balmy bosom, +With her laughter or her sighs, +And I would lie so light, so light, +I scarce should be unclasp'd at night. + +@A Lord Tennyson +# +@T Sea-fever + +I must down to the seas again, to the lonely sea and the sky, +And all I ask is a tall ship and a star to steer her by, +And the wheel's kick and the wind's song and the white sail's shaking, +And a grey mist on the sea's face and a grey dawn breaking. + +I must down to the seas again, for the call of the running tide +Is a wild call and a clear call that may not be denied; +And all I ask is a windy day with the white clouds flying, +And the flung spray and the blown spume, and the sea-gulls crying. + +I must down to the seas again, to the vagrant gypsy life, +To the gull's way and the whale's way where the wind's like a whetted knife; +And all I ask is a merry yarn from a laughing fellow-rover, +And a quiet sleep and a sweet dream when the long trick's over. + +@A John Masefield +# +@T The Drum + +I hate that drum's discordant sound, +Parading round, and round, and round: +To thoughtless youth it pleasure yields, +And lures from cities and from fields, +To sell their liberty for charms +Of tawdry lace, and glittering arms; +And when Ambition's voice commands, +To march, and fight, and fall, in foreign lands. + +I hate that drum's discordant sound, +Parading round, and round, and round: +To me it talks of ravag'd plains, +And burning towns, and ruin'd swains, +And mangled limbs, and dying groans, +And widows' tears, and orphans' moans; +And all that Misery's hand bestows, +To fill the catalogue of human woes. + +@A John Scott +@A (1730-83) +# +@T Everlasting Mercy + +Near Bullen Bank, on Gloucester road +Thy everlasting mercy showed +The ploughman patient on the hill, forever there, +Forever still +Ploughing the hill with steady yoke, +The pine trees lightning-struck and broke. + +I've marked the May Hill ploughman stay +There on his hill day after day +Driving his team against the sky +While men and women live and die +And now and then he seems to stoop +To clear the coulter with the scoop +Or touch an ox, to haw or gee, +While Severn's stream goes out to sea. +@P +Near Bullen Bank, on Gloucester road +Thy everlasting mercy showed +The ploughman patient on the hill, forever there, +Forever still +The sea with all her ships and sails, +And that great smokey port in Wales, +And Gloucester tower bright in the sun, +All know that patient wandering one. + +@A John Masefield + +Johnny Coppin's haunting arrangement of this available from +Red Sky Records, 'English Morning' RSKC 107 +# +@T Dawn +(From the train between Bologna and Milan, Second Class) + +Opposite me two Germans snore and sweat. +Through sullen swirling gloom we jolt and roar. +We have been here for ever: even yet +A dim watch tells two hours, two aeons, more. +The windows are tight-shut and slimy-wet +With a night's foetor. There are two hours more; +Two hours to dawn and Milan; two hours yet. +Opposite me two Germans sweat and snore... + +One of them wakes, and spits, and sleeps again. +The darkness shivers. A wan light through the rain +Strikes on our faces, drawn and white. Somewhere +A new day sprawls; and, inside, the foul air +Is chill, and damp, and fouler than before... +Opposite me two Germans sweat and snore. + +@A Rupert Brooke +# +@T The Voice + +Safe in the magic of my woods +I lay, and watched the dying light. +Faint in the pale high solitudes, +And washed with rain and veiled by night, + +Silver and blue and green were showing. +And the dark woods grew darker still; +And birds were hushed; and peace was growing; +And quietness crept up the hill; + +And no wind was blowing... + +And I knew +That this was the hour of knowing, +And the night and the woods and you +Were one together, and I should find +Soon in the silence the hidden key +Of all that had hurt and puzzled me -- +Why you were you, and the night was kind, +And the woods were part of the heart of me. +@P +And there I waited breathlessly, +Alone; and slowly the holy three, +The three that I loved, together grew +One, in the hour of knowing, +Night, and the woods, and you -- + +And suddenly +There was an uproar in my woods, +The noise of a fool in mock distress, +Crashing and laughing and blindly going, +Of ignorant feet and a swishing dress, +And a Voice profaning the solitudes. +@P +The spell was broken, the key denied me, +And at length your flat clear voice beside me +Mouthed cheerful clear flat platitudes. + +You came and quacked beside me in the wood. +You said, 'The view from here is very good!' +You said, 'It's nice to be alone a bit!' +And, 'How the days are drawing out!' you said. +You said, 'The sunset's pretty, isn't it?' + +* * * + +By God! I wish -- I wish that you were dead! + +@A Rupert Brooke +# +@T On a Tired Housewife + +Here lies a poor woman who was always tired, +She lived in a house where help wasn't hired; +Her last words on earth were: 'Dear friends, I am going +To where there's no cooking, or washing, or sewing, +For everything there is exact to my wishes, +For where they don't eat there's no washing of dishes. +I'll be where loud anthems will always be ringing, +But having no voice I'll be quit of the singing. +Don't mourn for me now, don't mourn for me never, +I am going to do nothing for ever and ever.' + +@A Anonymous +# +@T On Johnny Cole + +Here lies Johnny Cole +Who died, on my soul, +After eating a plentiful dinner; +While chewing his crust, +He was turned into dust, +With his crimes undigested - poor sinner. + +@A Anonymous +# +@T On a Wag in Mauchline + +Lament him, Mauchline husbands a', +He often did assist ye; +For had ye staid whole weeks awa', +Your wives they ne'er had missed ye. + +Ye Mauchline bairns, as on ye pass, +To schools in bands thegither, +Oh, tread ye lightly on his grass, +Perhaps he was your father. + +@A Robert Burns +# +@T Willie's Epitaph + +Little Willie from his mirror +Licked the mercury right off, +Thinking, in his childish error, +It would cure the whooping cough. +At the funeral his mother +Smartly turned to Mrs Brown: +''Twas a chilly day for Willie +When the mercury went down.' + +@A Anonymous +# +@T On Mary Ann Lowder + +Here lies the body of Mary Ann Lowder, +She burst while drinking a seidlitz powder. +Called from this world to her heavenly rest, +She should have waited till it effervesced. + +@A Anonymous +# +@T On Miss Arabella Young + +Here lies, returned to clay, +Miss Arabella Young, +Who on the first day of May +Began to hold her tongue. + +@A Anonymous +# +@T From The Westminster Drollery, 1671 + +I saw a peacock with a fiery tail +I saw a blazing comet drop down hail +I saw a cloud wrapped with ivy round +I saw an oak creep upon the ground +I saw a pismire swallow up a whale +I saw the sea brimful of ale +I saw a Venice glass full fifteen feet deep +I saw a well full of men's tears that weep +I saw red eyes all of a flaming fire +I saw a house bigger than the moon and higher +I saw the sun at twelve o'clock at night +I saw the man that saw this wondrous sight. + +@A Anonymous +# +@T Epigram + +Engraved on the collar which I gave to his +Royal Highness Frederick Prince of Wales: + +I am his Highness' dog at Kew +Pray tell me, sir, whose dog are you? + +@A Alexander Pope +# +@T A Man of Words + +A man of words and not of deeds, +Is like a garden full of weeds; +And when the weeds begin to grow, +It's like a garden full of snow; +And when the snow begins to fall, +It's like a bird upon the wall; +And when the bird away does fly, +It's like an eagle in the sky; +And when the skye begins to roar, +It's like a lion at the door; +And when the door begins to crack, +It's like a stick across your back; +And when your back begins to smart, +It's like a penknife in your heart; +And when your heart begins to bleed, +You're dead, and dead, and dead indeed. + +@A Anonymous +# +@T The Voice of the Lobster + +''Tis the voice of the Lobster; I heard him declare, +"You have baked me too brown, I must sugar my hair." +As a duck with its eyelids, so he with his nose +Trims his belt and his buttons, and turns out his toes. +When the sands are all dry, he is gay as a lark, +And will talk in contemptuous tones of the Shark: +But, when the tide rises and sharks are around, +His voice has a timid and tremuous sound. + +'I passed by his garden, and marked, with one eye, +How the Owl and the Panther were sharing a pie: +The Panther took pie-crust, and gravy, and meat, +While the Owl had the dish as its share of the treat. +When the pie was all finished, the Owl, as a boon, +Was kindly permitted to pocket the spoon: +While the Panther received knife and fork with a growl, +And concluded the banquet by --' + +@A Lewis Carroll +# +@T Lines by a Humanitarian + +Be lenient with lobsters, and ever kind to crabs, +And be not disrespectful to cuttle-fish or dabs; +Chase not the Cochin-China, chaff not the ox obese, +And babble not of feather-beds in company with geese. +Be tender with the tadpole, and let the limpet thrive, +Be merciful to mussels, don't skin your eels alive; +When talking to a turtle don't mention calipee -- +Be always kind to animals wherever you may be. + +@A Anonymous +# +@T The Common Cormorant + +The common cormorant or shag +Lays eggs inside a paper bag. +The reason you will see no doubt +It is to keep the lightning out. +But what these unobservant birds +Have never noticed is that herds +Of wandering bears may come with buns +And steal the bags to hold the crumbs. + +@A Anonymous +# +@T Imitation of Chaucer + +Women ben full of Ragerie, +Yet swinken not sans secresie +Thilke Moral shall ye understand, +From Schoole-boy's Tale of fayre Irelond: +Which to the Fennes hath him betake, +To filch the gray Ducke fro the Lake. +Right then, there passen by the Way +His Aunt, and eke her Daughters tway. +Ducke in his Trowses hath he hent, +Not to be spied of Ladies gent. +'But ho! our Nephew,' (crieth one) +'Ho,' quoth another, 'Cozen John'; +And stoppen, and laugh, and callen out, -- +This sely Clerk full low doth lout: +@P +They asken that, and talken this, +'Lo here is Coz, and here is Miss.' +But, as he glozeth with Speeches soote, +The Ducke sore tickleth his Erse-root: +Fore-piece and buttons all-to-brest, +Forth thrust a white neck, and red crest. +'Te-he,' cry'd Ladies; Clerke nought spake: +Miss star'd; and gray Ducke crieth Quake. +'O Moder, Moder' (quoth the daughter) +'Be thilke same thing Maids longen a'ter? +'Better is to pyne on coals and chalke, +'Then trust on Mon, whose yerde can talke.' + +@A Alexander Pope +# +@T Sonnet + +Live with me, and be my love, +And we will all the pleasures prove +That hills and valleys, dales and fields, +And all the craggy mountains yields. + +There will we sit upon the rocks, +And see the shepherds feed their flocks, +By shallow rivers, by whose falls +Melodious birds sing madrigals. + +There will I make thee a bed of roses, +With a thousand fragrant posies, +A cap of flowers, and a kirtle +Embroider'd all with leaves of myrtle. +@P +A belt of straw and ivy buds, +With coral clasps and amber studs; +And if these pleasures may thee move, +Then live with me and be my love. + +LOVE'S ANSWER + +If that the world and love were young, +And truth in every shepherd's tongue, +These pretty pleasures might me move +To live with thee and be thy love. + +@A William Shakespeare +# +@T O No, John! + +On yonder hill there stands a creature; +Who she is I do not know. +I'll go and court her for her beauty, +She must answer yes or no. +O no, John! No, John! No, John! No! + +On her bosom are bunches of posies, +On her breast where flowers grow; +If I should chance to touch that posy, +She must answer yes or no. +O no, John! No, John! No, John! No! + +Madam I am come for to court you, +If your favour I can gain; +If you will but entertain me, +Perhaps then I might come again. +O no, John! No, John! No, John! No! + +My husband was a Spanish captain, +Went to sea a month ago; +The very last time we kissed and parted, +Bid me always answer no. +O no, John! No, John! No, John! No! +@P +Madam in your face is beauty, +In your bosom flowers grow; +In your bedroom there is pleasure, +Shall I view it, yes or no? +O no, John! No, John! No, John! No! + +Madam shall I tie your garter, +Tie it a little above your knee; +If my hands should slip a little farther, +Would you think it amiss of me? +O no, John! No, John! No, John! No! + +My love and I went to bed together, +There we lay till cocks did crow; +Unclose your arms my dearest jewel, +Unclose your arms and let me go. +O no, John! No, John! No, John! No! + +@A Old English Folk Song +# +@T Unfortunate + +Heart, you are as restless as a paper scrap +That's tossed down dusty pavements by the wind; +Saying, 'She is most wise, patient and kind. +Between the small hands folded in her lap +Surely a shamed head may bow down at length, +And find forgiveness where the shadows stir +About her lips, and wisdom in her strength, +Peace in her peace. Come to her, come to her!' . . . + +She will not care. She'll smile to see me come, +So that I think all Heaven in flower to fold me. +She'll give me all I ask, kiss me and hold me, +And open wide upon that holy air +The gates of peace, and take my tiredness home, +Kinder than God. But, heart, she will not care. + +@A Rupert Brooke +# +@T The Busy Heart + +Now that we've done our best and worst, and parted, +I would fill my mind with thoughts that will not rend. +(O heart, I do not dare go empty-hearted) +I'll think of Love in books, Love without end; +Women with child, content; and old men sleeping; +And wet strong ploughlands, scarred for certain grain; +And babes that weep, and so forget their weeping; +And the young heavens, forgetful after rain; +And evening hush, broken by homing wings; +And Song's nobility, and Wisdom holy, +That live, we dead. I would think of a thousand things, +Lovely and durable, and taste them slowly, +One after one, like tasting a sweet food. +I have need to busy my heart with quietude. + +@A Rupert Brooke +# +@T Love + +Love is a breach in the walls, a broken gate, +Where that comes in that shall not go again; +Love sells the proud heart's citadel to Fate. +They have known shame, who love unloved. Even then +When two mouths, thirsty each for each, find slaking, +And agony's forgot, and hushed the crying +Of credulous hearts, in heaven -- such are but taking +Their own poor dreams within their arms, and lying +Each in his lonely night, each with a ghost. +Some share that night. But they know, love grows colder, +Grows false and dull, that was sweet lies at most. +Astonishment is no more in hand or shoulder, +But darkens, and dies out from kiss to kiss. +All this love; and all love is but this. + +@A Rupert Brooke +# +@T One Day + +Today I have been happy. All the day +I held the memory of you, and wove +Its laughter with the dancing light o' the spray, +And sowed the sky with tiny clouds of love, +And sent you following the white waves of sea, +And crowned your head with fancies, nothing worth, +Stray buds from that old dust of misery, +Being glad with a new foolish quiet mirth. + +So lightly I played with those dark memories, +Just as a child, beneath the summer skies, +Plays hour by hour with a strange shining stone, +For which (he knows not) towns were fire of old, +And love has been betrayed, and murder done, +And great kings turned to a little bitter mould. + +@A Rupert Brooke +# +@T Doubts + +When she sleeps, her soul, I know, +Goes a wanderer on the air, +Wings where I may never go, +Leaves her lying, still and fair, +Waiting, empty, laid aside, +Like a dress upon a chair... +This I know, and yet I know +Doubts that will not be denied. + +For if the soul be not in place, +What has laid trouble in her face? +And, sits there nothing ware and wise +Behind the curtains of her eyes, +What is it, in the self's eclipse, +Shadows, soft and passingly, +About the corners of her lips, +The smile that is essential she? + +And if the spirit be not there, +Why is fragrance in the hair? + +@A Rupert Brooke diff --git a/samples/wxpoem/wxpoem.def b/samples/wxpoem/wxpoem.def new file mode 100644 index 0000000000..4cdca34c68 --- /dev/null +++ b/samples/wxpoem/wxpoem.def @@ -0,0 +1,9 @@ +NAME WXPOEM +DESCRIPTION 'WXPOEM' +EXETYPE WINDOWS +STUB 'WINSTUB.EXE' +CODE PRELOAD MOVEABLE DISCARDABLE +DATA PRELOAD MOVEABLE MULTIPLE +HEAPSIZE 1024 +STACKSIZE 8192 + diff --git a/samples/wxpoem/wxpoem.h b/samples/wxpoem/wxpoem.h new file mode 100644 index 0000000000..6be433bff4 --- /dev/null +++ b/samples/wxpoem/wxpoem.h @@ -0,0 +1,90 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: wxpoem.h +// Purpose: A small C++ program which displays a random poem on +// execution. It also allows search for poems containing a +// string. +// It requires winpoem.dat and creates winpoem.idx. +// Original version (WinPoem) written in 1994. +// This has not been rewritten in a long time so +// beware, inelegant code! +// Author: Julian Smart +// Created: 12/12/98 +// RCS-ID: $Id$ +// Copyright: (c) 1998 Julian Smart +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +#ifdef __GNUG__ +#pragma interface "wxpoem.h" +#endif + +// Define a new application +class MyApp: public wxApp +{ + public: + bool OnInit(); + int OnExit(); +}; + +DECLARE_APP(MyApp) + +// Define a new canvas which can receive some events +class MyCanvas: public wxPanel +{ + public: + MyCanvas(wxFrame *frame, wxWindowID id, const wxPoint& pos, const wxSize& size); + + void OnPaint(wxPaintEvent& event); + void OnMouseEvent(wxMouseEvent& event); + void OnChar(wxKeyEvent& event); + + DECLARE_EVENT_TABLE() +}; + +// Define a new frame +class MainWindow: public wxFrame +{ + public: + MyCanvas *canvas; + MainWindow(wxFrame *frame, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style); + + void OnCloseWindow(wxCloseEvent& event); + void OnChar(wxKeyEvent& event); + + // Display next page or poem + void NextPage(void); + + // Display previous page + void PreviousPage(void); + + // User search + void Search(bool); + + // Look in file for string + long DoSearch(void); + + // Do the actual drawing of text (or just calculate size needed) + void ScanBuffer(wxDC *dc, bool DrawIt, int *max_x, int *max_y); + + // Load the poem + void GetIndexLoadPoem(void); + void Resize(void); + +DECLARE_EVENT_TABLE() +}; + +// Menu items +#define POEM_NEXT 100 +#define POEM_PREVIOUS 101 +#define POEM_COPY 102 +#define POEM_SEARCH 103 +#define POEM_NEXT_MATCH 104 +#define POEM_ABOUT 105 +#define POEM_EXIT 106 +#define POEM_COMPILE 107 +#define POEM_HELP_CONTENTS 108 +#define POEM_BIGGER_TEXT 109 +#define POEM_SMALLER_TEXT 110 +#define POEM_MINIMIZE 111 + + diff --git a/samples/wxpoem/wxpoem.ico b/samples/wxpoem/wxpoem.ico new file mode 100644 index 0000000000..f3b425d1fb Binary files /dev/null and b/samples/wxpoem/wxpoem.ico differ diff --git a/samples/wxpoem/wxpoem.rc b/samples/wxpoem/wxpoem.rc new file mode 100644 index 0000000000..8fdb7de3ee --- /dev/null +++ b/samples/wxpoem/wxpoem.rc @@ -0,0 +1,11 @@ +aaaa ICON "wxpoem.ico" +wxpoem ICON "wxpoem.ico" +wxSTD_FRAME ICON "wxpoem.ico" + +icon_1 ICON "corner1.ico" +icon_2 ICON "corner2.ico" +icon_3 ICON "corner3.ico" +icon_4 ICON "corner4.ico" + +#include "wx/msw/wx.rc" + diff --git a/samples/wxpoem/wxpoem.txt b/samples/wxpoem/wxpoem.txt new file mode 100644 index 0000000000..4f17b5d15b --- /dev/null +++ b/samples/wxpoem/wxpoem.txt @@ -0,0 +1,121 @@ +wxPoem 1.0 +---------- + +by Julian Smart +--------------- + +Fancy a little intellectual stimulation after long hours spent staring +at spreadsheets or reports? Does your brain long for something a little +more fulfilling than Tetris or fiddling with the WIN.INI file? Then you +could go out and buy a poetry book... or alternatively, if you just +can't drag yourself away from the screen, click on the wxPoem icon. + +wxPoem is a simple Windows application which picks poems from a file at +random, or finds poems according to a string criterion, and formats them +nicely in a window. A displayed poem can be copied to the Windows clipboard +ready for inclusion in that more imaginative report... + +It's small, it's free and it's totally harmless, so far as I know. +No responsibility accepted, though, for any problems it might cause with +your setup. + +wxPoem was converted to use the wxWindows toolkit, from the original +WinPoem which received a favourable review from Windows Shareware 500. + +Since it now uses wxWindows, wxPoem may be compiled on a variety +of platforms such as X (XView or Motif), Windows and NT. + +Files +----- + +The main data file is winpoem.dat, and an index file winpoem.idx is +supplied or can be (re)built by deleting winpoem.idx and rerunning +wxPoem. Source code is also provided in source.zip, but wxWindows is +required to build it. The original WinPoem is much leaner (40K +instead of 400K!) and can be compiled under Windows without wxWindows. + +Installation +------------ + + Windows + ======= + + Copy ctl3dv2.dll to windows\system, and delete the original + ctl3dv2.dll or wxPoem will not run. + + wxPoem can be put in the Startup folder in the Program Manager, so that + a random poem will pop up every time Windows is run. + + UNIX + ==== + + wxPoem comes in Open Look and Motif versions for the Sun, and a + Linux Open Look version. For other platforms, you will need to + recompile the source. + + +Use +--- + +Simply run the program, and a random poem will be displayed. +You can optionally give a filename on the command line, without a suffix +(e.g. winpoem). + +The simplest way of operating wxPoem is to keep pressing the space bar +for new poems (or pages for multi-page poems). + +Clicking the right mouse button (or selecting the wxPoem Options menu +item from the system menu) gives a choice of the following facilities: +Next poem/page (Page down) Display next poem (or next page) +Previous page (Page up) Display previous page (multi-line poems only) +Search (S) Allows user to enter a search string +Next match (N) Gives next search match +Copy to clipboard Allows poems to be pasted into other applications +Bigger text Increases text size +Smaller text Decreases text size +About wxPoem About wxPoem +Exit (Esc) Quit wxPoem + +When wxPoem is closed, the font, text height and window position are +remembered (stored in WIN.INI) for next time. Under X, the values +are not written (since they are stored in .Xdefaults), so you may +want to edit the following resources by hand: + +wxPoem.X ; X position +wxPoem.Y ; Y position +wxPoem.FontSize ; Font size in points (default 12) + +The data file +------------- + +The winpoem.dat file contains poems separated by a #, with optional +@ codes denoting title (@T) author (@A) and page break (@P). Any +unrecognized codes will cause the rest of the line to be ignored, so +the user can add lines (e.g. @S for subject) which will be searched on but +not displayed. + +The data file contains a mixture of 20th century and earlier poetry, +subject to copyright constraints. Apologies if any copyrights have +inadvertently been infringed, though I have tried to avoid it. + +Implementation +-------------- + +The original WinPoem program was my `Windows learning application', i.e. +a vehicle for getting stuck into Windows programming, whilst (possibly) +affording others a modicum of amusement. Therefore the code is pretty +ugly. So don't look if you're squeamish! + +License +------- + +Copyright Julian Smart, released into the public domain, October 1994. + +Julian Smart +Artificial Intelligence Applications Institute +University of Edinburgh +80 South Bridge +Einburgh +EH1 1HN + +J.Smart@ed.ac.uk diff --git a/src/common/list.cpp b/src/common/list.cpp index 041d609db3..4eaf11949e 100644 --- a/src/common/list.cpp +++ b/src/common/list.cpp @@ -38,12 +38,15 @@ #endif // Sun CC compatibility (interference with xview/pkg.h, apparently...) -#if defined(SUN_CC) && defined(__XVIEW__) +// But XView is no longer supported. +/* +#if defined (SUN_CC) || defined(__SUNCC__) && defined(__XVIEW__) #undef va_start #undef va_end #undef va_arg #undef va_list #endif +*/ // ============================================================================= // implementation diff --git a/src/common/resource.cpp b/src/common/resource.cpp index f31d3ae392..63cfce31b3 100644 --- a/src/common/resource.cpp +++ b/src/common/resource.cpp @@ -797,6 +797,19 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, wxExpr *expr) controlItem->SetId(id); if (controlType == "wxButton") + { + // Check for bitmap resource name (in case loading old-style resource file) + if (expr->Nth(count) && ((expr->Nth(count)->Type() == PrologString) || (expr->Nth(count)->Type() == PrologWord))) + { + wxString str(expr->Nth(count)->StringValue()); + controlItem->SetValue4(str); + count ++; + controlItem->SetType("wxBitmapButton"); + } + if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList) + controlItem->SetFont(wxResourceInterpretFontSpec(expr->Nth(count))); + } + else if (controlType == "wxBitmapButton") { // Check for bitmap resource name if (expr->Nth(count) && ((expr->Nth(count)->Type() == PrologString) || (expr->Nth(count)->Type() == PrologWord))) @@ -852,6 +865,19 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, wxExpr *expr) } } else if (controlType == "wxMessage" || controlType == "wxStaticText") + { + // Check for bitmap resource name (in case it's an old-style .wxr file) + if (expr->Nth(count) && ((expr->Nth(count)->Type() == PrologString) || (expr->Nth(count)->Type() == PrologWord))) + { + wxString str(expr->Nth(count)->StringValue()); + controlItem->SetValue4(str); + count ++; + controlItem->SetType("wxStaticText"); + } + if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList) + controlItem->SetFont(wxResourceInterpretFontSpec(expr->Nth(count))); + } + else if (controlType == "wxStaticBitmap") { // Check for bitmap resource name if (expr->Nth(count) && ((expr->Nth(count)->Type() == PrologString) || (expr->Nth(count)->Type() == PrologWord))) @@ -859,9 +885,9 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, wxExpr *expr) wxString str(expr->Nth(count)->StringValue()); controlItem->SetValue4(str); count ++; - if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList) - controlItem->SetFont(wxResourceInterpretFontSpec(expr->Nth(count))); } + if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList) + controlItem->SetFont(wxResourceInterpretFontSpec(expr->Nth(count))); } else if (controlType == "wxGroupBox" || controlType == "wxStaticBox") { diff --git a/utils/dialoged/src/reseditr.cpp b/utils/dialoged/src/reseditr.cpp index c9bdf84076..e6c91ac886 100644 --- a/utils/dialoged/src/reseditr.cpp +++ b/utils/dialoged/src/reseditr.cpp @@ -1318,7 +1318,22 @@ void wxResourceManager::AlignItems(int flag) break; } + wxItemResource* resource = wxResourceManager::GetCurrentResourceManager()->FindResourceForWindow(item); + wxItemResource* parentResource = wxResourceManager::GetCurrentResourceManager()->FindResourceForWindow(item->GetParent()); + item->SetSize(newX, newY, w, h); + + // Also update the associated resource + // We need to convert to dialog units if this is not a dialog or panel, but + // the parent resource specifies dialog units. + if (parentResource->GetResourceStyle() & wxRESOURCE_DIALOG_UNITS) + { + wxPoint pt = item->GetParent()->ConvertPixelsToDialog(wxPoint(newX, newY)); + newX = pt.x; newY = pt.y; + wxSize sz = item->GetParent()->ConvertPixelsToDialog(wxSize(w, h)); + w = sz.x; h = sz.y; + } + resource->SetSize(newX, newY, w, h); } } win->Refresh(); @@ -1348,7 +1363,23 @@ void wxResourceManager::CopySize() { wxControl *item = (wxControl *)node->Data(); if (item->GetParent() == win) + { item->SetSize(-1, -1, firstW, firstH); + + wxItemResource* resource = wxResourceManager::GetCurrentResourceManager()->FindResourceForWindow(item); + wxItemResource* parentResource = wxResourceManager::GetCurrentResourceManager()->FindResourceForWindow(item->GetParent()); + + // Also update the associated resource + // We need to convert to dialog units if this is not a dialog or panel, but + // the parent resource specifies dialog units. + if (parentResource->GetResourceStyle() & wxRESOURCE_DIALOG_UNITS) + { + wxSize sz = item->GetParent()->ConvertPixelsToDialog(wxSize(firstW, firstH)); + firstW = sz.x; firstH = sz.y; + } + resource->SetSize(resource->GetX(), resource->GetY(), firstW, firstH); + + } } win->Refresh(); } @@ -1931,30 +1962,30 @@ wxWindowPropertyInfo *wxResourceManager::CreatePropertyInfoForWindow(wxWindow *w { info = new wxRadioButtonPropertyInfo(win); } - else if (win->IsKindOf(CLASSINFO(wxChoice))) - { - info = new wxChoicePropertyInfo(win); - } else if (win->IsKindOf(CLASSINFO(wxComboBox))) { info = new wxComboBoxPropertyInfo(win); } - else if (win->IsKindOf(CLASSINFO(wxButton))) + else if (win->IsKindOf(CLASSINFO(wxChoice))) { - info = new wxButtonPropertyInfo(win); + info = new wxChoicePropertyInfo(win); } else if (win->IsKindOf(CLASSINFO(wxBitmapButton))) { info = new wxBitmapButtonPropertyInfo(win); } - else if (win->IsKindOf(CLASSINFO(wxStaticText))) + else if (win->IsKindOf(CLASSINFO(wxButton))) { - info = new wxStaticTextPropertyInfo(win); + info = new wxButtonPropertyInfo(win); } else if (win->IsKindOf(CLASSINFO(wxStaticBitmap))) { info = new wxStaticBitmapPropertyInfo(win); } + else if (win->IsKindOf(CLASSINFO(wxStaticText))) + { + info = new wxStaticTextPropertyInfo(win); + } else if (win->IsKindOf(CLASSINFO(wxTextCtrl))) { info = new wxTextPropertyInfo(win); diff --git a/utils/dialoged/src/winprop.cpp b/utils/dialoged/src/winprop.cpp index 055d64b22a..246ea5ab31 100644 --- a/utils/dialoged/src/winprop.cpp +++ b/utils/dialoged/src/winprop.cpp @@ -810,7 +810,7 @@ bool wxButtonPropertyInfo::InstantiateResource(wxItemResource *resource) wxProperty *wxBitmapButtonPropertyInfo::GetProperty(wxString& name) { wxBitmapButton *button = (wxBitmapButton *)m_propertyWindow; - if (name == "label") + if (name == "bitmapFilename") { wxItemResource *resource = wxResourceManager::GetCurrentResourceManager()->FindResourceForWindow(button); wxString str("none.bmp"); @@ -819,7 +819,7 @@ wxProperty *wxBitmapButtonPropertyInfo::GetProperty(wxString& name) { str = wxResourceManager::GetCurrentResourceManager()->FindBitmapFilenameForResource(resource); } - return new wxProperty("label", str.GetData(), "string", new wxFilenameListValidator("Select a bitmap file", "*.bmp")); + return new wxProperty("bitmapFilename", str.GetData(), "string", new wxFilenameListValidator("Select a bitmap file", "*.bmp")); } else return wxButtonPropertyInfo::GetProperty(name); @@ -828,7 +828,7 @@ wxProperty *wxBitmapButtonPropertyInfo::GetProperty(wxString& name) bool wxBitmapButtonPropertyInfo::SetProperty(wxString& name, wxProperty *property) { wxBitmapButton *button = (wxBitmapButton *)m_propertyWindow; - if (name == "label") + if (name == "bitmapFilename") { char *s = property->GetValue().StringValue(); if (s && wxFileExists(s)) @@ -867,8 +867,9 @@ bool wxBitmapButtonPropertyInfo::SetProperty(wxString& name, wxProperty *propert void wxBitmapButtonPropertyInfo::GetPropertyNames(wxStringList& names) { -// names.Add("label"); wxButtonPropertyInfo::GetPropertyNames(names); + names.Delete("label"); + names.Add("bitmapFilename"); } bool wxBitmapButtonPropertyInfo::InstantiateResource(wxItemResource *resource) @@ -908,7 +909,7 @@ bool wxStaticTextPropertyInfo::InstantiateResource(wxItemResource *resource) wxProperty *wxStaticBitmapPropertyInfo::GetProperty(wxString& name) { wxStaticBitmap *message = (wxStaticBitmap *)m_propertyWindow; - if (name == "label") + if (name == "bitmapFilename") { wxItemResource *resource = wxResourceManager::GetCurrentResourceManager()->FindResourceForWindow(message); wxString str("none.bmp"); @@ -917,7 +918,7 @@ wxProperty *wxStaticBitmapPropertyInfo::GetProperty(wxString& name) { str = wxResourceManager::GetCurrentResourceManager()->FindBitmapFilenameForResource(resource); } - return new wxProperty("label", str.GetData(), "string", new wxFilenameListValidator("Select a bitmap file", "*.bmp")); + return new wxProperty("bitmapFilename", str.GetData(), "string", new wxFilenameListValidator("Select a bitmap file", "*.bmp")); } else return wxItemPropertyInfo::GetProperty(name); @@ -926,7 +927,7 @@ wxProperty *wxStaticBitmapPropertyInfo::GetProperty(wxString& name) bool wxStaticBitmapPropertyInfo::SetProperty(wxString& name, wxProperty *property) { wxStaticBitmap *message = (wxStaticBitmap *)m_propertyWindow; - if (name == "label") + if (name == "bitmapFilename") { char *s = property->GetValue().StringValue(); if (s && wxFileExists(s)) @@ -967,7 +968,7 @@ bool wxStaticBitmapPropertyInfo::SetProperty(wxString& name, wxProperty *propert void wxStaticBitmapPropertyInfo::GetPropertyNames(wxStringList& names) { wxItemPropertyInfo::GetPropertyNames(names); - names.Add("label"); + names.Add("bitmapFilename"); } bool wxStaticBitmapPropertyInfo::InstantiateResource(wxItemResource *resource) diff --git a/utils/wxprop/src/prop.cpp b/utils/wxprop/src/prop.cpp index fee7fa74d4..c4fe282348 100644 --- a/utils/wxprop/src/prop.cpp +++ b/utils/wxprop/src/prop.cpp @@ -208,7 +208,7 @@ wxPropertyValue::~wxPropertyValue(void) } case wxPropertyValueString: { - delete m_value.string; + delete[] m_value.string; break; } case wxPropertyValueList: