- dmalloc shows duplicate deletion after merging two lines and
deleting the second half
-- printout page calculation still a bit wrong
- word wrap for objects with lots of non-space needs to search in positive
-direction if begin of first object is reached
+ direction if begin of first object is reached
+
+ - delete in empty line doesn't always work
+ - fix initial scrollbar sizes
+ - fix horiz scrollbar size
+ - occasionally wraps lines wongly (twice) ??
TODO
=====================================================================
- replacement of llist in window
- undo
-- Selections
-- More optimisations
+- Selections!!!
+
+- More optimisations:
+
+- let each line have a pointer to the last layoutcommand and let that
+ one only store the settings that changed, then we no longer need to
+ recalculate all the lines
+
+ - update rectangle (needs support in wxllist and wxWindows)
+
+- fix(simplify) cursor size calculation: don't use icon cursor if there
+ is no cursor object
+
+ - copy/cut/selections
+ - UNDO
+
+- cut&paste (paste is there but broken in wxGTK)
+ The current paste in wxGTK is broken, support is there.
+ Once selections are there, add copy (trivial).
+
+- DragNDrop (waiting for wxGTK/gtk1.2 & GNOME 1.0 / Debian Slink)
#pragma implementation "wxLayout.h"
#endif
+#include "wx/wxprec.h"
+#ifdef __BORLANDC__
+# pragma hdrstop
+#endif
+
#include "wxLayout.h"
#include "wx/textfile.h"
#include "Micon.xpm"
-// for testing only:
-#include <stdio.h>
//-----------------------------------------------------------------------------
// main program
END_EVENT_TABLE()
- int orientation = wxPORTRAIT;
-
MyFrame::MyFrame(void) :
wxFrame( (wxFrame *) NULL, -1, (char *) "wxLayout", wxPoint(20,20), wxSize(600,360) )
{
wxGetApp().SetPrintMode(wxPRINT_POSTSCRIPT);
#endif
wxPrintData printData;
- printData.SetOrientation(orientation);
// Pass two printout objects: for preview, and possible printing.
wxPrintPreview *preview = new wxPrintPreview(new
wxGetApp().SetPrintMode(wxPRINT_POSTSCRIPT);
wxPrintData printData;
- printData.SetOrientation(orientation);
// Pass two printout objects: for preview, and possible printing.
wxPrintPreview *preview = new wxPrintPreview(new wxLayoutPrintout( m_lwin->GetLayoutList()), new wxLayoutPrintout( m_lwin->GetLayoutList()), & printData);
void MyFrame::OnPrintSetup(wxCommandEvent& WXUNUSED(event))
{
-#ifdef __WXMSW__
+#ifdef OS_WIN
wxGetApp().SetPrintMode(wxPRINT_WINDOWS);
#else
wxGetApp().SetPrintMode(wxPRINT_POSTSCRIPT);
#endif
- wxPrintData data;
- data.SetOrientation(orientation);
-
-#ifdef __WXMSW__
- wxPrintDialog printerDialog(this, & data);
-#else
- wxGenericPrintDialog printerDialog(this, & data);
-#endif
- printerDialog.GetPrintData().SetSetupDialog(TRUE);
+ wxPrintDialog printerDialog(this, & m_PrintData);
printerDialog.ShowModal();
-
- orientation = printerDialog.GetPrintData().GetOrientation();
}
void MyFrame::OnPageSetup(wxCommandEvent& WXUNUSED(event))
wxGetApp().SetPrintMode(wxPRINT_POSTSCRIPT);
#endif
wxPageSetupData data;
- data.SetOrientation(orientation);
#ifdef __WXMSW__
wxPageSetupDialog pageSetupDialog(this, & data);
pageSetupDialog.ShowModal();
data = pageSetupDialog.GetPageSetupData();
- orientation = data.GetOrientation();
}
void MyFrame::OnPrintSetupPS(wxCommandEvent& WXUNUSED(event))
wxGetApp().SetPrintMode(wxPRINT_POSTSCRIPT);
wxPrintData data;
- data.SetOrientation(orientation);
#ifdef __WXMSW__
wxPrintDialog printerDialog(this, & data);
#else
wxGenericPrintDialog printerDialog(this, & data);
#endif
- printerDialog.GetPrintData().SetSetupDialog(TRUE);
printerDialog.ShowModal();
-
- orientation = printerDialog.GetPrintData().GetOrientation();
}
void MyFrame::OnPageSetupPS(wxCommandEvent& WXUNUSED(event))
wxGetApp().SetPrintMode(wxPRINT_POSTSCRIPT);
wxPageSetupData data;
- data.SetOrientation(orientation);
-
#ifdef __WXMSW__
wxPageSetupDialog pageSetupDialog(this, & data);
#else
wxGenericPageSetupDialog pageSetupDialog(this, & data);
#endif
pageSetupDialog.ShowModal();
-
- orientation = pageSetupDialog.GetPageSetupData().GetOrientation();
}
private:
wxLayoutWindow *m_lwin;
-
+ wxPrintData m_PrintData;
};
//-----------------------------------------------------------------------------
#pragma implementation "wxllist.h"
#endif
+#include "wx/wxprec.h"
+#ifdef __BORLANDC__
+# pragma hdrstop
+#endif
+
+
//#include "Mpch.h"
#ifdef M_PREFIX
# include "gui/wxllist.h"
#else
# include "wxllist.h"
#endif
-
#ifndef USE_PCH
# include "iostream.h"
# include <wx/dc.h>
void
wxLayoutObjectIcon::Draw(wxDC &dc, wxPoint const &coords)
{
- dc.DrawBitmap(*m_Icon, coords.x, coords.y-m_Icon->GetHeight());
+ dc.DrawBitmap(*m_Icon, coords.x, coords.y-m_Icon->GetHeight(),
+ (m_Icon->GetMask() == NULL) ? FALSE : TRUE);
}
void
float scale = ScaleDC(&psdc);
psdc.GetSize(&m_PageWidth, &m_PageHeight);
- // This sets a left/top origin of 10% and 20%:
+ // This sets a left/top origin of 10% and 5%:
m_Offset = wxPoint(m_PageWidth/10, m_PageHeight/20);
// This is the length of the printable area.
- m_PrintoutHeight = m_PageHeight - (int) (m_PageHeight * 0.1);
+ m_PrintoutHeight = m_PageHeight - (int) (m_PageHeight * 0.15);
m_PrintoutHeight = (int)( m_PrintoutHeight / scale); // we want to use the real paper height
void wxLayoutImportText(wxLayoutList *list, wxString const &str, int withflag)
{
+ if(str.Length() == 0)
+ return;
char * cptr = (char *)str.c_str(); // string gets changed only temporarily
const char * begin = cptr;
char backup;
# pragma implementation "wxlwindow.h"
#endif
-//#include "Mpch.h"
+#include "wx/wxprec.h"
+#ifdef __BORLANDC__
+# pragma hdrstop
+#endif
+
+//#include "Mpch.h"
#ifdef M_BASEDIR
# ifndef USE_PCH
# include "Mcommon.h"
#endif
#include <wx/clipbrd.h>
+#include <wx/textctrl.h>
#include <wx/dataobj.h>
#include <ctype.h>
void
wxLayoutWindow::Paste(void)
{
+ wxString text;
// Read some text
if (wxTheClipboard->Open())
{
if (wxTheClipboard->IsSupported(wxDF_TEXT))
{
wxTheClipboard->GetData(&data);
- wxLayoutImportText( m_llist, data.GetText());
+ text += data.GetText();
}
wxTheClipboard->Close();
}
+#ifdef __WXGTK__
+ /* wxGTK's sophisticated multi-format copy/paste is not supported
+ by 99% of the X11 clients available. If there was no selection,
+ do the dumb thing, too:
+ */
+#if 0
+ /* Unfortunately, this little hack doesn't work. So I'll go back to
+ pure X11. */
+ if(text.Length() == 0)
+ {
+ wxTextCtrl tmp_tctrl(this,-1);
+ tmp_tctrl.Paste();
+ text += tmp_tctrl.GetValue();
+ }
+#endif
+
+#endif
+ wxLayoutImportText( m_llist, text);
}