More progress on wxMotif, incl. wxTreeCtrl/wxListCtrl beginning to work
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1107 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -25,6 +25,8 @@ zip32 -@ %dest\wx200hlp.zip < %src\distrib\msw\wx_hlp.rsp
|
|||||||
zip32 -@ %dest\wx200htm.zip < %src\distrib\msw\wx_html.rsp
|
zip32 -@ %dest\wx200htm.zip < %src\distrib\msw\wx_html.rsp
|
||||||
zip32 -@ %dest\wx200pdf.zip < %src\distrib\msw\wx_pdf.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
|
zip32 -@ %dest\ogl3.zip < %src\utils\ogl\distrib\ogl.rsp
|
||||||
|
|
||||||
cd %dest
|
cd %dest
|
||||||
|
@@ -60,4 +60,18 @@ More recently:
|
|||||||
- Debugged DrawEllipticArc (a ! in the wrong place).
|
- Debugged DrawEllipticArc (a ! in the wrong place).
|
||||||
- Added SetClippingRegion( const wxRegion& region ).
|
- Added SetClippingRegion( const wxRegion& region ).
|
||||||
- Added wxPoint, wxSize, wxRect versions of SetSize etc.
|
- Added wxPoint, wxSize, wxRect versions of SetSize etc.
|
||||||
- Diagnosed but not yet cured a wxTreeCtrl bug (see todo.txt).
|
- 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.
|
@@ -42,9 +42,7 @@ High Priority
|
|||||||
- Tidy dialogs such as the colour and font selectors.
|
- Tidy dialogs such as the colour and font selectors.
|
||||||
|
|
||||||
- Use generic wxTreeCtrl, wxListCtrl: debug and enhance these.
|
- Use generic wxTreeCtrl, wxListCtrl: debug and enhance these.
|
||||||
wxTreeCtrl: crashes in wxImageList::Draw because it assumes
|
We're close to having these working: mostly scrolling to work out.
|
||||||
that wxBitmap == wxIcon, which is only true in wxGTK.
|
|
||||||
So add wxDC::DrawBitmap and use this instead.
|
|
||||||
|
|
||||||
- Find out why modal dialogs give a grab warning.
|
- Find out why modal dialogs give a grab warning.
|
||||||
|
|
||||||
@@ -146,3 +144,5 @@ Low Priority
|
|||||||
|
|
||||||
- Get ODBC classes and sample working.
|
- Get ODBC classes and sample working.
|
||||||
|
|
||||||
|
- Work out why wxTextCtrl doesn't work as a stream buffer under
|
||||||
|
gcc
|
@@ -18,6 +18,7 @@ wx200doc.zip Documentation source code (not required)
|
|||||||
wx200hlp.zip WinHelp documentation
|
wx200hlp.zip WinHelp documentation
|
||||||
wx200pdf.zip Acrobat PDF documentation
|
wx200pdf.zip Acrobat PDF documentation
|
||||||
wx200htm.zip HTML documentation
|
wx200htm.zip HTML documentation
|
||||||
|
wx200vc.zip MS VC++ 5.0 project files
|
||||||
|
|
||||||
Unarchive the required files plus any optional documentation
|
Unarchive the required files plus any optional documentation
|
||||||
files into a suitable directory such as c:\wx. Alter your
|
files into a suitable directory such as c:\wx. Alter your
|
||||||
@@ -34,6 +35,19 @@ been tested lately.
|
|||||||
Visual C++ 4.0/5.0/6.0 compilation
|
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
|
1. Change directory to wx\src\msw. Type 'nmake -f makefile.nt' to
|
||||||
make the wxWindows core library.
|
make the wxWindows core library.
|
||||||
2. Change directory to wx\samples and type 'nmake -f makefile.nt'
|
2. Change directory to wx\samples and type 'nmake -f makefile.nt'
|
||||||
|
@@ -366,6 +366,7 @@ class wxListHeaderWindow : public wxWindow
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
wxListHeaderWindow( void );
|
wxListHeaderWindow( void );
|
||||||
|
~wxListHeaderWindow( void );
|
||||||
wxListHeaderWindow( wxWindow *win, wxWindowID id, wxListMainWindow *owner,
|
wxListHeaderWindow( wxWindow *win, wxWindowID id, wxListMainWindow *owner,
|
||||||
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
|
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
|
||||||
long style = 0, const wxString &name = "columntitles" );
|
long style = 0, const wxString &name = "columntitles" );
|
||||||
@@ -614,11 +615,13 @@ class wxListCtrl: public wxControl
|
|||||||
wxDropTarget *GetDropTarget() const
|
wxDropTarget *GetDropTarget() const
|
||||||
{ return m_mainWin->GetDropTarget(); }
|
{ return m_mainWin->GetDropTarget(); }
|
||||||
void SetCursor( const wxCursor &cursor )
|
void SetCursor( const wxCursor &cursor )
|
||||||
{ m_mainWin->SetCursor( cursor); }
|
{ if (m_mainWin) m_mainWin->wxWindow::SetCursor( cursor); }
|
||||||
wxColour GetBackgroundColour() const
|
wxColour GetBackgroundColour() const
|
||||||
{ return m_mainWin->GetBackgroundColour(); }
|
{ if (m_mainWin) return m_mainWin->GetBackgroundColour();
|
||||||
|
else return wxColour(); }
|
||||||
wxColour GetForegroundColour() const
|
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 )
|
bool PopupMenu( wxMenu *menu, int x, int y )
|
||||||
{ return m_mainWin->PopupMenu( menu, x, y ); }
|
{ return m_mainWin->PopupMenu( menu, x, y ); }
|
||||||
|
|
||||||
|
@@ -61,10 +61,10 @@ class WXDLLEXPORT wxDC: public wxObject
|
|||||||
|
|
||||||
virtual bool Ok(void) const { return m_ok; };
|
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)
|
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;
|
virtual bool GetPixel( long x1, long y1, wxColour *col ) const = 0;
|
||||||
@@ -148,10 +148,9 @@ class WXDLLEXPORT wxDC: public wxObject
|
|||||||
DrawIcon(icon, pt.x, pt.y);
|
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.
|
// icons are implemented differently.
|
||||||
void DrawBitmap( const wxBitmap &bmp, long x, long y, bool useMask=FALSE )
|
virtual void DrawBitmap( const wxBitmap &bmp, long x, long y, bool useMask=FALSE ) ;
|
||||||
{ DrawIcon( *((wxIcon*)(&bmp)), x, y, useMask ); }
|
|
||||||
|
|
||||||
virtual bool Blit( long xdest, long ydest, long width, long height,
|
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;
|
wxDC *source, long xsrc, long ysrc, int logical_func = wxCOPY, bool useMask=FALSE ) = 0;
|
||||||
|
@@ -43,7 +43,7 @@ class WXDLLEXPORT wxWindowDC: public wxDC
|
|||||||
|
|
||||||
~wxWindowDC(void);
|
~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 bool GetPixel( long x1, long y1, wxColour *col ) const;
|
||||||
|
|
||||||
virtual void DrawLine( long x1, long y1, long x2, long y2 );
|
virtual void DrawLine( long x1, long y1, long x2, long y2 );
|
||||||
@@ -77,6 +77,7 @@ class WXDLLEXPORT wxWindowDC: public wxDC
|
|||||||
virtual long GetCharHeight(void);
|
virtual long GetCharHeight(void);
|
||||||
|
|
||||||
virtual void Clear(void);
|
virtual void Clear(void);
|
||||||
|
virtual void Clear(const wxRect& rect);
|
||||||
|
|
||||||
virtual void SetFont( const wxFont &font );
|
virtual void SetFont( const wxFont &font );
|
||||||
virtual void SetPen( const wxPen &pen );
|
virtual void SetPen( const wxPen &pen );
|
||||||
|
@@ -61,10 +61,10 @@ class WXDLLEXPORT wxDC: public wxObject
|
|||||||
|
|
||||||
virtual bool Ok(void) const { return m_ok; };
|
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)
|
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;
|
virtual bool GetPixel( long x1, long y1, wxColour *col ) const = 0;
|
||||||
|
@@ -39,7 +39,7 @@ class WXDLLEXPORT wxWindowDC: public wxDC
|
|||||||
|
|
||||||
~wxWindowDC(void);
|
~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 bool GetPixel( long x1, long y1, wxColour *col ) const;
|
||||||
|
|
||||||
virtual void DrawLine( long x1, long y1, long x2, long y2 );
|
virtual void DrawLine( long x1, long y1, long x2, long y2 );
|
||||||
|
@@ -325,12 +325,7 @@ void MyListCtrl::OnBeginDrag(wxListEvent& WXUNUSED(event))
|
|||||||
if ( !text )
|
if ( !text )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#ifndef __GNUWIN32__
|
text->WriteText("OnBeginDrag\n");
|
||||||
ostream str(text);
|
|
||||||
|
|
||||||
str << "OnBeginDrag\n";
|
|
||||||
str.flush();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyListCtrl::OnBeginRDrag(wxListEvent& WXUNUSED(event))
|
void MyListCtrl::OnBeginRDrag(wxListEvent& WXUNUSED(event))
|
||||||
@@ -341,12 +336,7 @@ void MyListCtrl::OnBeginRDrag(wxListEvent& WXUNUSED(event))
|
|||||||
wxTextCtrl *text = ((MyFrame *)wxGetApp().GetTopWindow())->m_logWindow;
|
wxTextCtrl *text = ((MyFrame *)wxGetApp().GetTopWindow())->m_logWindow;
|
||||||
if ( !text )
|
if ( !text )
|
||||||
return;
|
return;
|
||||||
#ifndef __GNUWIN32__
|
text->WriteText("OnBeginRDrag\n");
|
||||||
ostream str(text);
|
|
||||||
|
|
||||||
str << "OnBeginRDrag\n";
|
|
||||||
str.flush();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyListCtrl::OnBeginLabelEdit(wxListEvent& WXUNUSED(event))
|
void MyListCtrl::OnBeginLabelEdit(wxListEvent& WXUNUSED(event))
|
||||||
@@ -358,12 +348,7 @@ void MyListCtrl::OnBeginLabelEdit(wxListEvent& WXUNUSED(event))
|
|||||||
if ( !text )
|
if ( !text )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#ifndef __GNUWIN32__
|
text->WriteText("OnBeginLabelEdit\n");
|
||||||
ostream str(text);
|
|
||||||
|
|
||||||
str << "OnBeginLabelEdit\n";
|
|
||||||
str.flush();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyListCtrl::OnEndLabelEdit(wxListEvent& WXUNUSED(event))
|
void MyListCtrl::OnEndLabelEdit(wxListEvent& WXUNUSED(event))
|
||||||
@@ -375,12 +360,7 @@ void MyListCtrl::OnEndLabelEdit(wxListEvent& WXUNUSED(event))
|
|||||||
if ( !text )
|
if ( !text )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#ifndef __GNUWIN32__
|
text->WriteText("OnEndLabelEdit\n");
|
||||||
ostream str(text);
|
|
||||||
|
|
||||||
str << "OnEndLabelEdit\n";
|
|
||||||
str.flush();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyListCtrl::OnDeleteItem(wxListEvent& WXUNUSED(event))
|
void MyListCtrl::OnDeleteItem(wxListEvent& WXUNUSED(event))
|
||||||
@@ -392,12 +372,7 @@ void MyListCtrl::OnDeleteItem(wxListEvent& WXUNUSED(event))
|
|||||||
if ( !text )
|
if ( !text )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#ifndef __GNUWIN32__
|
text->WriteText("OnDeleteItem\n");
|
||||||
ostream str(text);
|
|
||||||
|
|
||||||
str << "OnDeleteItem\n";
|
|
||||||
str.flush();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyListCtrl::OnGetInfo(wxListEvent& event)
|
void MyListCtrl::OnGetInfo(wxListEvent& event)
|
||||||
@@ -409,7 +384,9 @@ void MyListCtrl::OnGetInfo(wxListEvent& event)
|
|||||||
if ( !text )
|
if ( !text )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#ifndef __GNUWIN32__
|
text->WriteText("OnGetInfo\n");
|
||||||
|
|
||||||
|
/*
|
||||||
ostream str(text);
|
ostream str(text);
|
||||||
|
|
||||||
str << "OnGetInfo (" << event.m_item.m_itemId << ", " << event.m_item.m_col << ")";
|
str << "OnGetInfo (" << event.m_item.m_itemId << ", " << event.m_item.m_col << ")";
|
||||||
@@ -434,7 +411,7 @@ void MyListCtrl::OnGetInfo(wxListEvent& event)
|
|||||||
}
|
}
|
||||||
str << "\n";
|
str << "\n";
|
||||||
str.flush();
|
str.flush();
|
||||||
#endif
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyListCtrl::OnSetInfo(wxListEvent& WXUNUSED(event))
|
void MyListCtrl::OnSetInfo(wxListEvent& WXUNUSED(event))
|
||||||
@@ -446,12 +423,7 @@ void MyListCtrl::OnSetInfo(wxListEvent& WXUNUSED(event))
|
|||||||
if ( !text )
|
if ( !text )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#ifndef __GNUWIN32__
|
text->WriteText("OnSetInfo\n");
|
||||||
ostream str(text);
|
|
||||||
|
|
||||||
str << "OnSetInfo\n";
|
|
||||||
str.flush();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyListCtrl::OnSelected(wxListEvent& WXUNUSED(event))
|
void MyListCtrl::OnSelected(wxListEvent& WXUNUSED(event))
|
||||||
@@ -463,12 +435,7 @@ void MyListCtrl::OnSelected(wxListEvent& WXUNUSED(event))
|
|||||||
if ( !text )
|
if ( !text )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#ifndef __GNUWIN32__
|
text->WriteText("OnSelected\n");
|
||||||
ostream str(text);
|
|
||||||
|
|
||||||
str << "OnSelected\n";
|
|
||||||
str.flush();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyListCtrl::OnDeselected(wxListEvent& WXUNUSED(event))
|
void MyListCtrl::OnDeselected(wxListEvent& WXUNUSED(event))
|
||||||
@@ -480,12 +447,7 @@ void MyListCtrl::OnDeselected(wxListEvent& WXUNUSED(event))
|
|||||||
if ( !text )
|
if ( !text )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#ifndef __GNUWIN32__
|
text->WriteText("OnDeselected\n");
|
||||||
ostream str(text);
|
|
||||||
|
|
||||||
str << "OnDeselected\n";
|
|
||||||
str.flush();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyListCtrl::OnKeyDown(wxListEvent& WXUNUSED(event))
|
void MyListCtrl::OnKeyDown(wxListEvent& WXUNUSED(event))
|
||||||
@@ -497,11 +459,6 @@ void MyListCtrl::OnKeyDown(wxListEvent& WXUNUSED(event))
|
|||||||
if ( !text )
|
if ( !text )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#ifndef __GNUWIN32__
|
text->WriteText("OnKeyDown\n");
|
||||||
ostream str(text);
|
|
||||||
|
|
||||||
str << "OnKeyDown\n";
|
|
||||||
str.flush();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -141,9 +141,15 @@ MyFrame::MyFrame(const wxString& title, int x, int y, int w, int h)
|
|||||||
CreateStatusBar(3);
|
CreateStatusBar(3);
|
||||||
SetStatusText("", 0);
|
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
|
// set our text control as the log target
|
||||||
wxLogTextCtrl *logWindow = new wxLogTextCtrl(textCtrl);
|
wxLogTextCtrl *logWindow = new wxLogTextCtrl(textCtrl);
|
||||||
delete wxLog::SetActiveTarget(logWindow);
|
delete wxLog::SetActiveTarget(logWindow);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
MyFrame::~MyFrame()
|
MyFrame::~MyFrame()
|
||||||
|
@@ -209,7 +209,11 @@ YYSTYPE yyvs[YYSTACKSIZE];
|
|||||||
#define yystacksize YYSTACKSIZE
|
#define yystacksize YYSTACKSIZE
|
||||||
#line 118 "parser.y"
|
#line 118 "parser.y"
|
||||||
|
|
||||||
|
#ifdef IDE_INVOKED
|
||||||
|
#include "../common/doslex.c"
|
||||||
|
#else
|
||||||
#include "../common/lex_yy.c"
|
#include "../common/lex_yy.c"
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
void yyerror(s)
|
void yyerror(s)
|
||||||
|
@@ -685,6 +685,11 @@ wxListHeaderWindow::wxListHeaderWindow( wxWindow *win, wxWindowID id, wxListMain
|
|||||||
m_isDraging = FALSE;
|
m_isDraging = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wxListHeaderWindow::~wxListHeaderWindow( void )
|
||||||
|
{
|
||||||
|
delete m_resizeCursor;
|
||||||
|
}
|
||||||
|
|
||||||
void wxListHeaderWindow::DoDrawRect( wxPaintDC *dc, int x, int y, int w, int h )
|
void wxListHeaderWindow::DoDrawRect( wxPaintDC *dc, int x, int y, int w, int h )
|
||||||
{
|
{
|
||||||
const int m_corner = 1;
|
const int m_corner = 1;
|
||||||
@@ -751,7 +756,8 @@ void wxListHeaderWindow::DrawCurrent()
|
|||||||
int y1 = 0;
|
int y1 = 0;
|
||||||
int x2 = m_currentX-1;
|
int x2 = m_currentX-1;
|
||||||
int y2 = 0;
|
int y2 = 0;
|
||||||
m_owner->GetClientSize( (int*)NULL, &y2 );
|
int dummy;
|
||||||
|
m_owner->GetClientSize( &dummy, &y2 );
|
||||||
ClientToScreen( &x1, &y1 );
|
ClientToScreen( &x1, &y1 );
|
||||||
m_owner->ClientToScreen( &x2, &y2 );
|
m_owner->ClientToScreen( &x2, &y2 );
|
||||||
|
|
||||||
@@ -784,7 +790,8 @@ void wxListHeaderWindow::OnMouse( wxMouseEvent &event )
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
int size_x = 0;
|
int size_x = 0;
|
||||||
GetClientSize( &size_x, (int*) NULL );
|
int dummy;
|
||||||
|
GetClientSize( &size_x, & dummy );
|
||||||
if (x > m_minX+7)
|
if (x > m_minX+7)
|
||||||
m_currentX = x;
|
m_currentX = x;
|
||||||
else
|
else
|
||||||
@@ -947,7 +954,7 @@ wxListMainWindow::wxListMainWindow( void )
|
|||||||
wxListMainWindow::wxListMainWindow( wxWindow *parent, wxWindowID id,
|
wxListMainWindow::wxListMainWindow( wxWindow *parent, wxWindowID id,
|
||||||
const wxPoint &pos, const wxSize &size,
|
const wxPoint &pos, const wxSize &size,
|
||||||
long style, const wxString &name ) :
|
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_mode = style;
|
||||||
m_lines.DeleteContents( TRUE );
|
m_lines.DeleteContents( TRUE );
|
||||||
@@ -2227,6 +2234,8 @@ wxListCtrl::wxListCtrl(void)
|
|||||||
m_imageListNormal = (wxImageList *) NULL;
|
m_imageListNormal = (wxImageList *) NULL;
|
||||||
m_imageListSmall = (wxImageList *) NULL;
|
m_imageListSmall = (wxImageList *) NULL;
|
||||||
m_imageListState = (wxImageList *) NULL;
|
m_imageListState = (wxImageList *) NULL;
|
||||||
|
m_mainWin = (wxListMainWindow*) NULL;
|
||||||
|
m_headerWin = (wxListHeaderWindow*) NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxListCtrl::~wxListCtrl(void)
|
wxListCtrl::~wxListCtrl(void)
|
||||||
@@ -2241,6 +2250,8 @@ bool wxListCtrl::Create( wxWindow *parent, wxWindowID id,
|
|||||||
m_imageListNormal = (wxImageList *) NULL;
|
m_imageListNormal = (wxImageList *) NULL;
|
||||||
m_imageListSmall = (wxImageList *) NULL;
|
m_imageListSmall = (wxImageList *) NULL;
|
||||||
m_imageListState = (wxImageList *) NULL;
|
m_imageListState = (wxImageList *) NULL;
|
||||||
|
m_mainWin = (wxListMainWindow*) NULL;
|
||||||
|
m_headerWin = (wxListHeaderWindow*) NULL;
|
||||||
|
|
||||||
long s = style;
|
long s = style;
|
||||||
|
|
||||||
@@ -2710,22 +2721,34 @@ void wxListCtrl::OnIdle( wxIdleEvent &WXUNUSED(event) )
|
|||||||
|
|
||||||
void wxListCtrl::SetBackgroundColour( const wxColour &colour )
|
void wxListCtrl::SetBackgroundColour( const wxColour &colour )
|
||||||
{
|
{
|
||||||
m_mainWin->SetBackgroundColour( colour );
|
if (m_mainWin)
|
||||||
m_headerWin->SetBackgroundColour( colour );
|
{
|
||||||
m_mainWin->m_dirty = TRUE;
|
m_mainWin->SetBackgroundColour( colour );
|
||||||
|
m_mainWin->m_dirty = TRUE;
|
||||||
|
}
|
||||||
|
if (m_headerWin)
|
||||||
|
m_headerWin->SetBackgroundColour( colour );
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxListCtrl::SetForegroundColour( const wxColour &colour )
|
void wxListCtrl::SetForegroundColour( const wxColour &colour )
|
||||||
{
|
{
|
||||||
m_mainWin->SetForegroundColour( colour );
|
if (m_mainWin)
|
||||||
m_headerWin->SetForegroundColour( colour );
|
{
|
||||||
m_mainWin->m_dirty = TRUE;
|
m_mainWin->SetForegroundColour( colour );
|
||||||
|
m_mainWin->m_dirty = TRUE;
|
||||||
|
}
|
||||||
|
if (m_headerWin)
|
||||||
|
m_headerWin->SetForegroundColour( colour );
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxListCtrl::SetFont( const wxFont &font )
|
void wxListCtrl::SetFont( const wxFont &font )
|
||||||
{
|
{
|
||||||
m_mainWin->SetFont( font );
|
if (m_mainWin)
|
||||||
m_headerWin->SetFont( font );
|
{
|
||||||
m_mainWin->m_dirty = TRUE;
|
m_mainWin->SetFont( font );
|
||||||
|
m_mainWin->m_dirty = TRUE;
|
||||||
|
}
|
||||||
|
if (m_headerWin)
|
||||||
|
m_headerWin->SetFont( font );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -328,7 +328,7 @@ bool wxTreeCtrl::Create(wxWindow *parent, wxWindowID id,
|
|||||||
{
|
{
|
||||||
Init();
|
Init();
|
||||||
|
|
||||||
wxScrolledWindow::Create( parent, id, pos, size, style, name );
|
wxScrolledWindow::Create( parent, id, pos, size, style|wxHSCROLL|wxVSCROLL, name );
|
||||||
|
|
||||||
SetBackgroundColour( *wxWHITE );
|
SetBackgroundColour( *wxWHITE );
|
||||||
m_dottedPen = wxPen( *wxBLACK, 0, 0 );
|
m_dottedPen = wxPen( *wxBLACK, 0, 0 );
|
||||||
@@ -913,6 +913,7 @@ void wxTreeCtrl::PaintLevel( wxGenericTreeItem *item, wxDC &dc, int level, int &
|
|||||||
if (item->HasHilight())
|
if (item->HasHilight())
|
||||||
{
|
{
|
||||||
dc.SetTextForeground( wxSystemSettings::GetSystemColour( wxSYS_COLOUR_HIGHLIGHTTEXT ) );
|
dc.SetTextForeground( wxSystemSettings::GetSystemColour( wxSYS_COLOUR_HIGHLIGHTTEXT ) );
|
||||||
|
|
||||||
dc.SetBrush( *m_hilightBrush );
|
dc.SetBrush( *m_hilightBrush );
|
||||||
|
|
||||||
long text_w = 0;
|
long text_w = 0;
|
||||||
@@ -1154,7 +1155,6 @@ void wxTreeCtrl::RefreshLine( wxGenericTreeItem *item )
|
|||||||
rect.y = dc.LogicalToDeviceY( item->GetY() - 2 );
|
rect.y = dc.LogicalToDeviceY( item->GetY() - 2 );
|
||||||
rect.width = 1000;
|
rect.width = 1000;
|
||||||
rect.height = dc.GetCharHeight() + 6;
|
rect.height = dc.GetCharHeight() + 6;
|
||||||
|
|
||||||
Refresh( TRUE, &rect );
|
Refresh( TRUE, &rect );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -14,6 +14,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/dc.h"
|
#include "wx/dc.h"
|
||||||
|
#include "wx/dcmemory.h"
|
||||||
|
|
||||||
#if !USE_SHARED_LIBRARY
|
#if !USE_SHARED_LIBRARY
|
||||||
IMPLEMENT_ABSTRACT_CLASS(wxDC, wxObject)
|
IMPLEMENT_ABSTRACT_CLASS(wxDC, wxObject)
|
||||||
@@ -94,6 +95,31 @@ void wxDC::DrawIcon( const wxIcon &WXUNUSED(icon), long WXUNUSED(x), long WXUNUS
|
|||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
|
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 )
|
void wxDC::DrawPoint( wxPoint& point )
|
||||||
{
|
{
|
||||||
DrawPoint( point.x, point.y );
|
DrawPoint( point.x, point.y );
|
||||||
|
@@ -172,7 +172,7 @@ wxWindowDC::~wxWindowDC(void)
|
|||||||
};
|
};
|
||||||
|
|
||||||
void wxWindowDC::FloodFill( long WXUNUSED(x1), long WXUNUSED(y1),
|
void wxWindowDC::FloodFill( long WXUNUSED(x1), long WXUNUSED(y1),
|
||||||
wxColour* WXUNUSED(col), int WXUNUSED(style) )
|
const wxColour& WXUNUSED(col), int WXUNUSED(style) )
|
||||||
{
|
{
|
||||||
// TODO
|
// TODO
|
||||||
};
|
};
|
||||||
@@ -1229,7 +1229,8 @@ void wxWindowDC::GetTextExtent( const wxString &string, long *width, long *heigh
|
|||||||
if (!theFont->Ok())
|
if (!theFont->Ok())
|
||||||
{
|
{
|
||||||
// TODO: this should be an error log function
|
// 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;
|
*width = -1;
|
||||||
*height = -1;
|
*height = -1;
|
||||||
return;
|
return;
|
||||||
@@ -1298,7 +1299,6 @@ void wxWindowDC::Clear(void)
|
|||||||
int w, h;
|
int w, h;
|
||||||
if (m_window)
|
if (m_window)
|
||||||
{
|
{
|
||||||
// TODO: should we get the virtual size?
|
|
||||||
m_window->GetSize(&w, &h);
|
m_window->GetSize(&w, &h);
|
||||||
|
|
||||||
if (m_window && m_window->GetBackingPixmap())
|
if (m_window && m_window->GetBackingPixmap())
|
||||||
@@ -1330,6 +1330,24 @@ void wxWindowDC::Clear(void)
|
|||||||
m_brush = saveBrush;
|
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 )
|
void wxWindowDC::SetFont( const wxFont &font )
|
||||||
{
|
{
|
||||||
if (!Ok()) return;
|
if (!Ok()) return;
|
||||||
|
@@ -69,7 +69,7 @@ wxColour wxSystemSettings::GetSystemColour(int index)
|
|||||||
}
|
}
|
||||||
case wxSYS_COLOUR_HIGHLIGHTTEXT:
|
case wxSYS_COLOUR_HIGHLIGHTTEXT:
|
||||||
{
|
{
|
||||||
return *wxWHITE;
|
return *wxBLUE;
|
||||||
}
|
}
|
||||||
case wxSYS_COLOUR_INFOBK:
|
case wxSYS_COLOUR_INFOBK:
|
||||||
case wxSYS_COLOUR_APPWORKSPACE:
|
case wxSYS_COLOUR_APPWORKSPACE:
|
||||||
|
@@ -488,7 +488,7 @@ int wxTextCtrl::overflow(int c)
|
|||||||
// Verify that there are no characters in get area
|
// Verify that there are no characters in get area
|
||||||
if ( gptr() && gptr() < egptr() )
|
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;
|
return EOF;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -478,6 +478,7 @@ bool wxWindow::Create(wxWindow *parent, wxWindowID id,
|
|||||||
// Without this, the cursor may not be restored properly
|
// Without this, the cursor may not be restored properly
|
||||||
// (e.g. in splitter sample).
|
// (e.g. in splitter sample).
|
||||||
SetCursor(*wxSTANDARD_CURSOR);
|
SetCursor(*wxSTANDARD_CURSOR);
|
||||||
|
SetFont(wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT));
|
||||||
SetSize(pos.x, pos.y, size.x, size.y);
|
SetSize(pos.x, pos.y, size.x, size.y);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@@ -929,7 +930,10 @@ void wxWindow::Refresh(bool eraseBack, const wxRect *rect)
|
|||||||
wxClientDC dc(this);
|
wxClientDC dc(this);
|
||||||
wxBrush backgroundBrush(GetBackgroundColour(), wxSOLID);
|
wxBrush backgroundBrush(GetBackgroundColour(), wxSOLID);
|
||||||
dc.SetBackground(backgroundBrush);
|
dc.SetBackground(backgroundBrush);
|
||||||
dc.Clear();
|
if (rect)
|
||||||
|
dc.Clear(*rect);
|
||||||
|
else
|
||||||
|
dc.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
XSendEvent(display, thisWindow, False, ExposureMask, (XEvent *)&dummyEvent);
|
XSendEvent(display, thisWindow, False, ExposureMask, (XEvent *)&dummyEvent);
|
||||||
|
@@ -394,6 +394,7 @@ wxBitmap wxBitmap::GetBitmapForDC(wxDC& dc) const
|
|||||||
LPBITMAPINFO lpDib;
|
LPBITMAPINFO lpDib;
|
||||||
void *lpBits = NULL;
|
void *lpBits = NULL;
|
||||||
|
|
||||||
|
/*
|
||||||
wxASSERT( this->GetPalette() && this->GetPalette()->Ok() && (this->GetPalette()->GetHPALETTE() != 0) );
|
wxASSERT( this->GetPalette() && this->GetPalette()->Ok() && (this->GetPalette()->GetHPALETTE() != 0) );
|
||||||
|
|
||||||
tmpBitmap.SetPalette(this->GetPalette());
|
tmpBitmap.SetPalette(this->GetPalette());
|
||||||
@@ -401,6 +402,23 @@ wxBitmap wxBitmap::GetBitmapForDC(wxDC& dc) const
|
|||||||
memDC.SetPalette(this->GetPalette());
|
memDC.SetPalette(this->GetPalette());
|
||||||
|
|
||||||
hPal = (HPALETTE) this->GetPalette()->GetHPALETTE();
|
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
|
// set the height negative because in a DIB the order of the lines is reversed
|
||||||
createDIB(this->GetWidth(), -this->GetHeight(), this->GetDepth(), hPal, &lpDib);
|
createDIB(this->GetWidth(), -this->GetHeight(), this->GetDepth(), hPal, &lpDib);
|
||||||
|
@@ -50,7 +50,7 @@ wxWindowDC::~wxWindowDC(void)
|
|||||||
};
|
};
|
||||||
|
|
||||||
void wxWindowDC::FloodFill( long WXUNUSED(x1), long WXUNUSED(y1),
|
void wxWindowDC::FloodFill( long WXUNUSED(x1), long WXUNUSED(y1),
|
||||||
wxColour* WXUNUSED(col), int WXUNUSED(style) )
|
const wxColour& WXUNUSED(col), int WXUNUSED(style) )
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user