zip32 -@ %dest\wx200htm.zip < %src\distrib\msw\wx_html.rsp
zip32 -@ %dest\wx200pdf.zip < %src\distrib\msw\wx_pdf.rsp
+zip32 -@ %dest\wx200vc.zip < %src\distrib\msw\vc.rsp
+
zip32 -@ %dest\ogl3.zip < %src\utils\ogl\distrib\ogl.rsp
cd %dest
- Debugged DrawEllipticArc (a ! in the wrong place).
- Added SetClippingRegion( const wxRegion& region ).
- Added wxPoint, wxSize, wxRect versions of SetSize etc.
-- Diagnosed but not yet cured a wxTreeCtrl bug (see todo.txt).
\ No newline at end of file
+- Diagnosed but not yet cured a wxTreeCtrl bug (see todo.txt).
+
+4/12/98
+-------
+
+- Got further with wxTreeCtrl, fixing wxWindow::Refresh on the way,
+ and adding Clear(const wxRect&). Mainly the scrolling to sort out now,
+ and inter-line spacing.
+- Fixed some problems with wxListCtrl espec. trying to call m_mainWin
+ functions when it wasn't initialised. As with the wxTreeCtrl sample,
+ removed usage of wxTextCtrl as a stream (doesn't seem to agree
+ with gcc) and the sample is now partially working. Some work
+ on the scrollbars is required.
+- wxListCtrl assumed that one of the args to GetClientSize can be NULL:
+ corrected.
\ No newline at end of file
- Tidy dialogs such as the colour and font selectors.
- Use generic wxTreeCtrl, wxListCtrl: debug and enhance these.
- wxTreeCtrl: crashes in wxImageList::Draw because it assumes
- that wxBitmap == wxIcon, which is only true in wxGTK.
- So add wxDC::DrawBitmap and use this instead.
+ We're close to having these working: mostly scrolling to work out.
- Find out why modal dialogs give a grab warning.
- Get ODBC classes and sample working.
+- Work out why wxTextCtrl doesn't work as a stream buffer under
+ gcc
\ No newline at end of file
wx200hlp.zip WinHelp documentation
wx200pdf.zip Acrobat PDF documentation
wx200htm.zip HTML documentation
+wx200vc.zip MS VC++ 5.0 project files
Unarchive the required files plus any optional documentation
files into a suitable directory such as c:\wx. Alter your
Visual C++ 4.0/5.0/6.0 compilation
----------------------------------
+Using project files:
+
+1. Unarchive wx200vc.zip, the VC++ 5 project makefiles.
+2. Open src/wxvc.dsp, set Debug or Release configuration, and
+ compile. This will produce lib/wxvc.lib or lib/wxvc_debug.lib.
+3. Open a sample project file, choose a configuration, and compile.
+ Currently only the minimal and mdi samples have project files.
+ To create others, copy the .dsp/.dsw files from the minimal
+ sample and globally replace 'MinimalVC' and 'minimal' with
+ suitable names. Add any other required source files.
+
+Using makefiles:
+
1. Change directory to wx\src\msw. Type 'nmake -f makefile.nt' to
make the wxWindows core library.
2. Change directory to wx\samples and type 'nmake -f makefile.nt'
public:
wxListHeaderWindow( void );
+ ~wxListHeaderWindow( void );
wxListHeaderWindow( wxWindow *win, wxWindowID id, wxListMainWindow *owner,
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
long style = 0, const wxString &name = "columntitles" );
wxDropTarget *GetDropTarget() const
{ return m_mainWin->GetDropTarget(); }
void SetCursor( const wxCursor &cursor )
- { m_mainWin->SetCursor( cursor); }
+ { if (m_mainWin) m_mainWin->wxWindow::SetCursor( cursor); }
wxColour GetBackgroundColour() const
- { return m_mainWin->GetBackgroundColour(); }
+ { if (m_mainWin) return m_mainWin->GetBackgroundColour();
+ else return wxColour(); }
wxColour GetForegroundColour() const
- { return m_mainWin->GetForegroundColour(); }
+ { if (m_mainWin) return m_mainWin->GetForegroundColour();
+ else return wxColour(); }
bool PopupMenu( wxMenu *menu, int x, int y )
{ return m_mainWin->PopupMenu( menu, x, y ); }
virtual bool Ok(void) const { return m_ok; };
- virtual void FloodFill( long x1, long y1, wxColour* col, int style=wxFLOOD_SURFACE ) = 0;
+ virtual void FloodFill( long x1, long y1, const wxColour& col, int style=wxFLOOD_SURFACE ) = 0;
inline void FloodFill(const wxPoint& pt, const wxColour& col, int style=wxFLOOD_SURFACE)
{
- FloodFill(pt.x, pt.y, (wxColour*) & col, style);
+ FloodFill(pt.x, pt.y, col, style);
}
virtual bool GetPixel( long x1, long y1, wxColour *col ) const = 0;
DrawIcon(icon, pt.x, pt.y);
}
- // TODO DrawBitmap is not always the same as DrawIcon, especially if bitmaps and
+ // DrawBitmap is not always the same as DrawIcon, especially if bitmaps and
// icons are implemented differently.
- void DrawBitmap( const wxBitmap &bmp, long x, long y, bool useMask=FALSE )
- { DrawIcon( *((wxIcon*)(&bmp)), x, y, useMask ); }
+ virtual void DrawBitmap( const wxBitmap &bmp, long x, long y, bool useMask=FALSE ) ;
virtual bool Blit( long xdest, long ydest, long width, long height,
wxDC *source, long xsrc, long ysrc, int logical_func = wxCOPY, bool useMask=FALSE ) = 0;
~wxWindowDC(void);
- virtual void FloodFill( long x1, long y1, wxColour* col, int style=wxFLOOD_SURFACE );
+ virtual void FloodFill( long x1, long y1, const wxColour& col, int style=wxFLOOD_SURFACE );
virtual bool GetPixel( long x1, long y1, wxColour *col ) const;
virtual void DrawLine( long x1, long y1, long x2, long y2 );
virtual long GetCharHeight(void);
virtual void Clear(void);
+ virtual void Clear(const wxRect& rect);
virtual void SetFont( const wxFont &font );
virtual void SetPen( const wxPen &pen );
virtual bool Ok(void) const { return m_ok; };
- virtual void FloodFill( long x1, long y1, wxColour* col, int style=wxFLOOD_SURFACE ) = 0;
+ virtual void FloodFill( long x1, long y1, const wxColour& col, int style=wxFLOOD_SURFACE ) = 0;
inline void FloodFill(const wxPoint& pt, const wxColour& col, int style=wxFLOOD_SURFACE)
{
- FloodFill(pt.x, pt.y, (wxColour*) & col, style);
+ FloodFill(pt.x, pt.y, col, style);
}
virtual bool GetPixel( long x1, long y1, wxColour *col ) const = 0;
~wxWindowDC(void);
- virtual void FloodFill( long x1, long y1, wxColour* col, int style=wxFLOOD_SURFACE );
+ virtual void FloodFill( long x1, long y1, const wxColour& col, int style=wxFLOOD_SURFACE );
virtual bool GetPixel( long x1, long y1, wxColour *col ) const;
virtual void DrawLine( long x1, long y1, long x2, long y2 );
if ( !text )
return;
-#ifndef __GNUWIN32__
- ostream str(text);
-
- str << "OnBeginDrag\n";
- str.flush();
-#endif
+ text->WriteText("OnBeginDrag\n");
}
void MyListCtrl::OnBeginRDrag(wxListEvent& WXUNUSED(event))
wxTextCtrl *text = ((MyFrame *)wxGetApp().GetTopWindow())->m_logWindow;
if ( !text )
return;
-#ifndef __GNUWIN32__
- ostream str(text);
-
- str << "OnBeginRDrag\n";
- str.flush();
-#endif
+ text->WriteText("OnBeginRDrag\n");
}
void MyListCtrl::OnBeginLabelEdit(wxListEvent& WXUNUSED(event))
if ( !text )
return;
-#ifndef __GNUWIN32__
- ostream str(text);
-
- str << "OnBeginLabelEdit\n";
- str.flush();
-#endif
+ text->WriteText("OnBeginLabelEdit\n");
}
void MyListCtrl::OnEndLabelEdit(wxListEvent& WXUNUSED(event))
if ( !text )
return;
-#ifndef __GNUWIN32__
- ostream str(text);
-
- str << "OnEndLabelEdit\n";
- str.flush();
-#endif
+ text->WriteText("OnEndLabelEdit\n");
}
void MyListCtrl::OnDeleteItem(wxListEvent& WXUNUSED(event))
if ( !text )
return;
-#ifndef __GNUWIN32__
- ostream str(text);
-
- str << "OnDeleteItem\n";
- str.flush();
-#endif
+ text->WriteText("OnDeleteItem\n");
}
void MyListCtrl::OnGetInfo(wxListEvent& event)
if ( !text )
return;
-#ifndef __GNUWIN32__
+ text->WriteText("OnGetInfo\n");
+
+/*
ostream str(text);
str << "OnGetInfo (" << event.m_item.m_itemId << ", " << event.m_item.m_col << ")";
}
str << "\n";
str.flush();
-#endif
+*/
}
void MyListCtrl::OnSetInfo(wxListEvent& WXUNUSED(event))
if ( !text )
return;
-#ifndef __GNUWIN32__
- ostream str(text);
-
- str << "OnSetInfo\n";
- str.flush();
-#endif
+ text->WriteText("OnSetInfo\n");
}
void MyListCtrl::OnSelected(wxListEvent& WXUNUSED(event))
if ( !text )
return;
-#ifndef __GNUWIN32__
- ostream str(text);
-
- str << "OnSelected\n";
- str.flush();
-#endif
+ text->WriteText("OnSelected\n");
}
void MyListCtrl::OnDeselected(wxListEvent& WXUNUSED(event))
if ( !text )
return;
-#ifndef __GNUWIN32__
- ostream str(text);
-
- str << "OnDeselected\n";
- str.flush();
-#endif
+ text->WriteText("OnDeselected\n");
}
void MyListCtrl::OnKeyDown(wxListEvent& WXUNUSED(event))
if ( !text )
return;
-#ifndef __GNUWIN32__
- ostream str(text);
-
- str << "OnKeyDown\n";
- str.flush();
-#endif
+ text->WriteText("OnKeyDown\n");
}
CreateStatusBar(3);
SetStatusText("", 0);
+#ifdef __WXMOTIF__
+ // For some reason, we get a memcpy crash in wxLogStream::DoLogStream
+ // on gcc/wxMotif, if we use wxLogTextCtl. Maybe it's just gcc?
+ delete wxLog::SetActiveTarget(new wxLogStderr);
+#else
// set our text control as the log target
wxLogTextCtrl *logWindow = new wxLogTextCtrl(textCtrl);
delete wxLog::SetActiveTarget(logWindow);
+#endif
}
MyFrame::~MyFrame()
#define yystacksize YYSTACKSIZE
#line 118 "parser.y"
+#ifdef IDE_INVOKED
+#include "../common/doslex.c"
+#else
#include "../common/lex_yy.c"
+#endif
/*
void yyerror(s)
m_isDraging = FALSE;
}
+wxListHeaderWindow::~wxListHeaderWindow( void )
+{
+ delete m_resizeCursor;
+}
+
void wxListHeaderWindow::DoDrawRect( wxPaintDC *dc, int x, int y, int w, int h )
{
const int m_corner = 1;
int y1 = 0;
int x2 = m_currentX-1;
int y2 = 0;
- m_owner->GetClientSize( (int*)NULL, &y2 );
+ int dummy;
+ m_owner->GetClientSize( &dummy, &y2 );
ClientToScreen( &x1, &y1 );
m_owner->ClientToScreen( &x2, &y2 );
else
{
int size_x = 0;
- GetClientSize( &size_x, (int*) NULL );
+ int dummy;
+ GetClientSize( &size_x, & dummy );
if (x > m_minX+7)
m_currentX = x;
else
wxListMainWindow::wxListMainWindow( wxWindow *parent, wxWindowID id,
const wxPoint &pos, const wxSize &size,
long style, const wxString &name ) :
- wxScrolledWindow( parent, id, pos, size, style, name )
+ wxScrolledWindow( parent, id, pos, size, style|wxHSCROLL|wxVSCROLL, name )
{
m_mode = style;
m_lines.DeleteContents( TRUE );
m_imageListNormal = (wxImageList *) NULL;
m_imageListSmall = (wxImageList *) NULL;
m_imageListState = (wxImageList *) NULL;
+ m_mainWin = (wxListMainWindow*) NULL;
+ m_headerWin = (wxListHeaderWindow*) NULL;
}
wxListCtrl::~wxListCtrl(void)
m_imageListNormal = (wxImageList *) NULL;
m_imageListSmall = (wxImageList *) NULL;
m_imageListState = (wxImageList *) NULL;
+ m_mainWin = (wxListMainWindow*) NULL;
+ m_headerWin = (wxListHeaderWindow*) NULL;
long s = style;
void wxListCtrl::SetBackgroundColour( const wxColour &colour )
{
- m_mainWin->SetBackgroundColour( colour );
- m_headerWin->SetBackgroundColour( colour );
- m_mainWin->m_dirty = TRUE;
+ if (m_mainWin)
+ {
+ m_mainWin->SetBackgroundColour( colour );
+ m_mainWin->m_dirty = TRUE;
+ }
+ if (m_headerWin)
+ m_headerWin->SetBackgroundColour( colour );
}
void wxListCtrl::SetForegroundColour( const wxColour &colour )
{
- m_mainWin->SetForegroundColour( colour );
- m_headerWin->SetForegroundColour( colour );
- m_mainWin->m_dirty = TRUE;
+ if (m_mainWin)
+ {
+ m_mainWin->SetForegroundColour( colour );
+ m_mainWin->m_dirty = TRUE;
+ }
+ if (m_headerWin)
+ m_headerWin->SetForegroundColour( colour );
}
void wxListCtrl::SetFont( const wxFont &font )
{
- m_mainWin->SetFont( font );
- m_headerWin->SetFont( font );
- m_mainWin->m_dirty = TRUE;
+ if (m_mainWin)
+ {
+ m_mainWin->SetFont( font );
+ m_mainWin->m_dirty = TRUE;
+ }
+ if (m_headerWin)
+ m_headerWin->SetFont( font );
}
{
Init();
- wxScrolledWindow::Create( parent, id, pos, size, style, name );
+ wxScrolledWindow::Create( parent, id, pos, size, style|wxHSCROLL|wxVSCROLL, name );
SetBackgroundColour( *wxWHITE );
m_dottedPen = wxPen( *wxBLACK, 0, 0 );
if (item->HasHilight())
{
dc.SetTextForeground( wxSystemSettings::GetSystemColour( wxSYS_COLOUR_HIGHLIGHTTEXT ) );
+
dc.SetBrush( *m_hilightBrush );
long text_w = 0;
rect.y = dc.LogicalToDeviceY( item->GetY() - 2 );
rect.width = 1000;
rect.height = dc.GetCharHeight() + 6;
-
Refresh( TRUE, &rect );
}
#endif
#include "wx/dc.h"
+#include "wx/dcmemory.h"
#if !USE_SHARED_LIBRARY
IMPLEMENT_ABSTRACT_CLASS(wxDC, wxObject)
{
};
+void wxDC::DrawBitmap( const wxBitmap& bitmap, long x, long y, bool useMask )
+{
+ if (!bitmap.Ok())
+ return;
+
+ wxMemoryDC memDC;
+ memDC.SelectObject(bitmap);
+
+/* Not sure if we need this. The mask should leave the
+ * masked areas as per the original background of this DC.
+ if (useMask)
+ {
+ // There might be transparent areas, so make these
+ // the same colour as this DC
+ memDC.SetBackground(* GetBackground());
+ memDC.Clear();
+ }
+*/
+
+ Blit(x, y, bitmap.GetWidth(), bitmap.GetHeight(), & memDC, 0, 0, wxCOPY, useMask);
+
+ memDC.SelectObject(wxNullBitmap);
+};
+
+
void wxDC::DrawPoint( wxPoint& point )
{
DrawPoint( point.x, point.y );
};
void wxWindowDC::FloodFill( long WXUNUSED(x1), long WXUNUSED(y1),
- wxColour* WXUNUSED(col), int WXUNUSED(style) )
+ const wxColour& WXUNUSED(col), int WXUNUSED(style) )
{
// TODO
};
if (!theFont->Ok())
{
// TODO: this should be an error log function
- cerr << "wxWindows warning - set a valid font before calling GetTextExtent!\n";
+ wxFAIL_MSG("set a valid font before calling GetTextExtent!");
+
*width = -1;
*height = -1;
return;
int w, h;
if (m_window)
{
- // TODO: should we get the virtual size?
m_window->GetSize(&w, &h);
if (m_window && m_window->GetBackingPixmap())
m_brush = saveBrush;
};
+void wxWindowDC::Clear(const wxRect& rect)
+{
+ if (!Ok()) return;
+
+ int x = rect.x; int y = rect.y;
+ int w = rect.width; int h = rect.height;
+
+ wxBrush saveBrush = m_brush;
+ SetBrush (m_backgroundBrush);
+
+ XFillRectangle ((Display*) m_display, (Pixmap) m_pixmap, (GC) m_gc, x, y, w, h);
+
+ if (m_window && m_window->GetBackingPixmap())
+ XFillRectangle ((Display*) m_display, (Pixmap) m_window->GetBackingPixmap(),(GC) m_gcBacking, x, y, w, h);
+
+ m_brush = saveBrush;
+};
+
void wxWindowDC::SetFont( const wxFont &font )
{
if (!Ok()) return;
}
case wxSYS_COLOUR_HIGHLIGHTTEXT:
{
- return *wxWHITE;
+ return *wxBLUE;
}
case wxSYS_COLOUR_INFOBK:
case wxSYS_COLOUR_APPWORKSPACE:
// Verify that there are no characters in get area
if ( gptr() && gptr() < egptr() )
{
- wxError("Who's trespassing my get area?","Internal error");
+ wxError("wxTextCtrl::overflow: Who's trespassing my get area?","Internal error");
return EOF;
}
// Without this, the cursor may not be restored properly
// (e.g. in splitter sample).
SetCursor(*wxSTANDARD_CURSOR);
+ SetFont(wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT));
SetSize(pos.x, pos.y, size.x, size.y);
return TRUE;
wxClientDC dc(this);
wxBrush backgroundBrush(GetBackgroundColour(), wxSOLID);
dc.SetBackground(backgroundBrush);
- dc.Clear();
+ if (rect)
+ dc.Clear(*rect);
+ else
+ dc.Clear();
}
XSendEvent(display, thisWindow, False, ExposureMask, (XEvent *)&dummyEvent);
LPBITMAPINFO lpDib;
void *lpBits = NULL;
+/*
wxASSERT( this->GetPalette() && this->GetPalette()->Ok() && (this->GetPalette()->GetHPALETTE() != 0) );
tmpBitmap.SetPalette(this->GetPalette());
memDC.SetPalette(this->GetPalette());
hPal = (HPALETTE) this->GetPalette()->GetHPALETTE();
+*/
+ if( this->GetPalette() && this->GetPalette()->Ok() && (this->GetPalette()->GetHPALETTE() != 0) )
+ {
+ tmpBitmap.SetPalette(this->GetPalette());
+ memDC.SelectObject(tmpBitmap);
+ memDC.SetPalette(this->GetPalette());
+ hPal = (HPALETTE) this->GetPalette()->GetHPALETTE();
+ }
+ else
+ {
+ hPal = (HPALETTE) ::GetStockObject(DEFAULT_PALETTE);
+ wxPalette palette;
+ palette.SetHPALETTE( (WXHPALETTE)hPal );
+ tmpBitmap.SetPalette( palette );
+ memDC.SelectObject(tmpBitmap);
+ memDC.SetPalette( palette );
+ }
// set the height negative because in a DIB the order of the lines is reversed
createDIB(this->GetWidth(), -this->GetHeight(), this->GetDepth(), hPal, &lpDib);
};
void wxWindowDC::FloodFill( long WXUNUSED(x1), long WXUNUSED(y1),
- wxColour* WXUNUSED(col), int WXUNUSED(style) )
+ const wxColour& WXUNUSED(col), int WXUNUSED(style) )
{
};