-1->wxID_ANY, TRUE->true, FALSE->false and tabs replacements.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27693 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2004-06-08 19:27:42 +00:00
parent fda5e7a16e
commit a2d49353d4
17 changed files with 755 additions and 755 deletions

View File

@@ -12,7 +12,7 @@
#define __WX_EDITLBOX_H__ #define __WX_EDITLBOX_H__
#if defined(__GNUG__) && !defined(__APPLE__) #if defined(__GNUG__) && !defined(__APPLE__)
#pragma interface "editlbox.h" #pragma interface "editlbox.h"
#endif #endif
#include "wx/panel.h" #include "wx/panel.h"
@@ -31,7 +31,7 @@ class WXDLLEXPORT wxListEvent;
class WXDLLIMPEXP_GIZMOS wxEditableListBox : public wxPanel class WXDLLIMPEXP_GIZMOS wxEditableListBox : public wxPanel
{ {
DECLARE_CLASS(wxEditableListBox); DECLARE_CLASS(wxEditableListBox);
public: public:
wxEditableListBox(wxWindow *parent, wxWindowID id, wxEditableListBox(wxWindow *parent, wxWindowID id,

View File

@@ -33,18 +33,18 @@ enum wxLEDValueAlign
// wxLEDNumberCtrl // wxLEDNumberCtrl
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
class WXDLLIMPEXP_GIZMOS wxLEDNumberCtrl : public wxControl class WXDLLIMPEXP_GIZMOS wxLEDNumberCtrl : public wxControl
{ {
public: public:
// Constructors. // Constructors.
wxLEDNumberCtrl(); wxLEDNumberCtrl();
wxLEDNumberCtrl(wxWindow *parent, wxWindowID id = -1, wxLEDNumberCtrl(wxWindow *parent, wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
long style = wxLED_ALIGN_LEFT | wxLED_DRAW_FADED); long style = wxLED_ALIGN_LEFT | wxLED_DRAW_FADED);
// Create functions. // Create functions.
bool Create(wxWindow *parent, wxWindowID id = -1, bool Create(wxWindow *parent, wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
long style = 0); long style = 0);
@@ -53,9 +53,9 @@ public:
bool GetDrawFaded() const { return m_DrawFaded; } bool GetDrawFaded() const { return m_DrawFaded; }
const wxString &GetValue() const { return m_Value; } const wxString &GetValue() const { return m_Value; }
void SetAlignment(wxLEDValueAlign Alignment, bool Redraw = TRUE); void SetAlignment(wxLEDValueAlign Alignment, bool Redraw = true);
void SetDrawFaded(bool DrawFaded, bool Redraw = TRUE); void SetDrawFaded(bool DrawFaded, bool Redraw = true);
void SetValue(const wxString &Value, bool Redraw = TRUE); void SetValue(const wxString &Value, bool Redraw = true);
private: private:
// Members. // Members.

View File

@@ -16,7 +16,7 @@
#define __WX_MULTICELL_H__ #define __WX_MULTICELL_H__
#if defined(__GNUG__) && !defined(__APPLE__) #if defined(__GNUG__) && !defined(__APPLE__)
#pragma interface "multicell.h" #pragma interface "multicell.h"
#endif #endif
#include "wx/gizmos/gizmos.h" #include "wx/gizmos/gizmos.h"
@@ -33,10 +33,10 @@
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
enum wxResizable enum wxResizable
{ {
wxNOT_RESIZABLE = 0x00, wxNOT_RESIZABLE = 0x00,
wxHORIZONTAL_RESIZABLE = 0x01, wxHORIZONTAL_RESIZABLE = 0x01,
wxVERTICAL_RESIZABLE = 0x10, wxVERTICAL_RESIZABLE = 0x10,
wxRESIZABLE = 0x11 wxRESIZABLE = 0x11
}; };
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
@@ -49,33 +49,33 @@ enum wxResizable
class WXDLLIMPEXP_GIZMOS wxMultiCellItemHandle: public wxObject class WXDLLIMPEXP_GIZMOS wxMultiCellItemHandle: public wxObject
{ {
DECLARE_CLASS(wxMultiCellItemHandle); DECLARE_CLASS(wxMultiCellItemHandle);
protected: protected:
int m_column; int m_column;
int m_row; int m_row;
int m_width; int m_width;
int m_height; int m_height;
wxResizable m_style; wxResizable m_style;
wxSize m_fixedSize; wxSize m_fixedSize;
int m_alignment; int m_alignment;
wxSize m_weight; wxSize m_weight;
public: public:
wxMultiCellItemHandle( int row, int column, int height = 1, int width = 1, wxSize size = wxDefaultSize, wxResizable style = wxNOT_RESIZABLE, wxSize weight = wxSize(1,1), int align = wxALIGN_NOT); wxMultiCellItemHandle( int row, int column, int height = 1, int width = 1, wxSize size = wxDefaultSize, wxResizable style = wxNOT_RESIZABLE, wxSize weight = wxSize(1,1), int align = wxALIGN_NOT);
wxMultiCellItemHandle( int row, int column, wxSize size, wxResizable style = wxNOT_RESIZABLE, wxSize weight = wxSize(1,1), int align = wxALIGN_NOT); wxMultiCellItemHandle( int row, int column, wxSize size, wxResizable style = wxNOT_RESIZABLE, wxSize weight = wxSize(1,1), int align = wxALIGN_NOT);
wxMultiCellItemHandle( int row, int column, wxResizable style, wxSize weight = wxSize(1,1), int align = wxALIGN_NOT); wxMultiCellItemHandle( int row, int column, wxResizable style, wxSize weight = wxSize(1,1), int align = wxALIGN_NOT);
wxMultiCellItemHandle( int row, int column, int align); wxMultiCellItemHandle( int row, int column, int align);
int GetColumn(); int GetColumn();
int GetRow(); int GetRow();
int GetWidth(); int GetWidth();
int GetHeight(); int GetHeight();
wxResizable GetStyle(); wxResizable GetStyle();
wxSize GetLocalSize(); wxSize GetLocalSize();
int GetAlignment(); int GetAlignment();
wxSize GetWeight(); wxSize GetWeight();
private: private:
void Initialize( int row, int column, int height = 1, int width = 1, wxSize size = wxDefaultSize, wxResizable style = wxNOT_RESIZABLE, wxSize weight = wxSize(1,1), int align = wxALIGN_NOT); void Initialize( int row, int column, int height = 1, int width = 1, wxSize size = wxDefaultSize, wxResizable style = wxNOT_RESIZABLE, wxSize weight = wxSize(1,1), int align = wxALIGN_NOT);
}; };
@@ -85,43 +85,43 @@ private:
class WXDLLIMPEXP_GIZMOS wxMultiCellSizer : virtual public wxSizer class WXDLLIMPEXP_GIZMOS wxMultiCellSizer : virtual public wxSizer
{ {
DECLARE_CLASS(wxMultiCellSizer); DECLARE_CLASS(wxMultiCellSizer);
protected: protected:
wxSize m_cell_count; wxSize m_cell_count;
public: public:
wxMultiCellSizer(wxSize & size); wxMultiCellSizer(wxSize & size);
wxMultiCellSizer(int rows, int cols); wxMultiCellSizer(int rows, int cols);
~wxMultiCellSizer(); ~wxMultiCellSizer();
virtual void RecalcSizes(); virtual void RecalcSizes();
virtual wxSize CalcMin(); virtual wxSize CalcMin();
bool SetDefaultCellSize(wxSize size); bool SetDefaultCellSize(wxSize size);
bool SetColumnWidth(int column, int colSize = 5, bool expandable = FALSE); bool SetColumnWidth(int column, int colSize = 5, bool expandable = false);
bool SetRowHeight(int row, int rowSize = 5, bool expandable = FALSE); bool SetRowHeight(int row, int rowSize = 5, bool expandable = false);
bool EnableGridLines(wxWindow *win); bool EnableGridLines(wxWindow *win);
bool SetGridPen(wxPen *pen); bool SetGridPen(wxPen *pen);
void OnPaint(wxDC& dc); void OnPaint(wxDC& dc);
private: private:
void GetMinimums(); void GetMinimums();
int Sum(int *array, int x); int Sum(int *array, int x);
private: private:
int *m_maxHeight; int *m_maxHeight;
int *m_maxWidth; int *m_maxWidth;
int *m_rowStretch; int *m_rowStretch;
int *m_colStretch; int *m_colStretch;
wxSize **m_weights; wxSize **m_weights;
wxSize **m_minSizes; wxSize **m_minSizes;
int m_maxWeights; int m_maxWeights;
wxSize m_defaultCellSize; wxSize m_defaultCellSize;
wxWindow *m_win; // usually used for debugging wxWindow *m_win; // usually used for debugging
wxPen *m_pen; wxPen *m_pen;
void DrawGridLines(wxDC& dc); void DrawGridLines(wxDC& dc);
void Initialize(wxSize size); void Initialize(wxSize size);
}; };
@@ -136,23 +136,23 @@ class wxCell;
class WXDLLIMPEXP_GIZMOS wxMultiCellCanvas : public wxFlexGridSizer class WXDLLIMPEXP_GIZMOS wxMultiCellCanvas : public wxFlexGridSizer
{ {
public: public:
wxMultiCellCanvas(wxWindow *parent, int numRows = 2, int numCols = 2); wxMultiCellCanvas(wxWindow *parent, int numRows = 2, int numCols = 2);
void Add(wxWindow *win, unsigned int row, unsigned int col); void Add(wxWindow *win, unsigned int row, unsigned int col);
void Resize(int numRows, int numCols); void Resize(int numRows, int numCols);
int MaxRows() int MaxRows()
{ {
return m_maxRows; return m_maxRows;
}; };
int MaxCols() int MaxCols()
{ {
return m_maxCols; return m_maxCols;
}; };
void CalculateConstraints(); void CalculateConstraints();
void SetMinCellSize(const wxSize size) void SetMinCellSize(const wxSize size)
{ {
m_minCellSize = size; m_minCellSize = size;
}; };
/* These are to hide Add() method of parents and to avoid Borland warning about hiding virtual functions */ /* These are to hide Add() method of parents and to avoid Borland warning about hiding virtual functions */
void Add( wxWindow *window, int proportion = 0, int flag = 0, int border = 0, wxObject* userData = NULL ) void Add( wxWindow *window, int proportion = 0, int flag = 0, int border = 0, wxObject* userData = NULL )
@@ -165,11 +165,11 @@ public:
{ wxFlexGridSizer::Add( item); } { wxFlexGridSizer::Add( item); }
private: private:
wxWindow *m_parent; wxWindow *m_parent;
unsigned int m_maxRows, m_maxCols; unsigned int m_maxRows, m_maxCols;
wxSize m_minCellSize; wxSize m_minCellSize;
wxCell **m_cells; wxCell **m_cells;
}; };
#endif #endif

View File

@@ -72,7 +72,7 @@ public:
virtual void SetScrollbars(int pixelsPerUnitX, int pixelsPerUnitY, virtual void SetScrollbars(int pixelsPerUnitX, int pixelsPerUnitY,
int noUnitsX, int noUnitsY, int noUnitsX, int noUnitsY,
int xPos = 0, int yPos = 0, int xPos = 0, int yPos = 0,
bool noRefresh = FALSE ); bool noRefresh = false );
// In case we're using the generic tree control. // In case we're using the generic tree control.
// Get the view start // Get the view start
@@ -127,7 +127,7 @@ class WXDLLIMPEXP_GIZMOS wxTreeCompanionWindow: public wxWindow
public: public:
DECLARE_CLASS(wxTreeCompanionWindow) DECLARE_CLASS(wxTreeCompanionWindow)
wxTreeCompanionWindow(wxWindow* parent, wxWindowID id = -1, wxTreeCompanionWindow(wxWindow* parent, wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& sz = wxDefaultSize, const wxSize& sz = wxDefaultSize,
long style = 0); long style = 0);
@@ -166,7 +166,7 @@ class WXDLLIMPEXP_GIZMOS wxThinSplitterWindow: public wxSplitterWindow
public: public:
DECLARE_DYNAMIC_CLASS(wxThinSplitterWindow) DECLARE_DYNAMIC_CLASS(wxThinSplitterWindow)
wxThinSplitterWindow(wxWindow* parent, wxWindowID id = -1, wxThinSplitterWindow(wxWindow* parent, wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& sz = wxDefaultSize, const wxSize& sz = wxDefaultSize,
long style = wxSP_3D | wxCLIP_CHILDREN); long style = wxSP_3D | wxCLIP_CHILDREN);
@@ -210,7 +210,7 @@ class WXDLLIMPEXP_GIZMOS wxSplitterScrolledWindow: public wxScrolledWindow
public: public:
DECLARE_DYNAMIC_CLASS(wxSplitterScrolledWindow) DECLARE_DYNAMIC_CLASS(wxSplitterScrolledWindow)
wxSplitterScrolledWindow(wxWindow* parent, wxWindowID id = -1, wxSplitterScrolledWindow(wxWindow* parent, wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& sz = wxDefaultSize, const wxSize& sz = wxDefaultSize,
long style = 0); long style = 0);

View File

@@ -37,7 +37,7 @@ public:
class SashHtmlWindow : public wxHtmlWindow { class SashHtmlWindow : public wxHtmlWindow {
public: public:
SashHtmlWindow(wxWindow *parent, wxWindowID id = -1, SashHtmlWindow(wxWindow *parent, wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
long style = wxHW_SCROLLBAR_NEVER, const wxString& name = wxT("sashHtmlWindow")); long style = wxHW_SCROLLBAR_NEVER, const wxString& name = wxT("sashHtmlWindow"));
@@ -62,23 +62,23 @@ wxT("manages the scrollbars provided by <TT>wxDynamicSashWindow</TT> itself.");
bool Demo::OnInit() { bool Demo::OnInit() {
wxInitAllImageHandlers(); wxInitAllImageHandlers();
wxFrame *frame = new wxFrame(NULL, -1, wxT("Dynamic Sash Demo")); wxFrame *frame = new wxFrame(NULL, wxID_ANY, wxT("Dynamic Sash Demo"));
frame->SetSize(480, 480); frame->SetSize(480, 480);
wxDynamicSashWindow *sash = new wxDynamicSashWindow(frame, -1); wxDynamicSashWindow *sash = new wxDynamicSashWindow(frame, wxID_ANY);
wxHtmlWindow *html = new SashHtmlWindow(sash, -1); wxHtmlWindow *html = new SashHtmlWindow(sash, wxID_ANY);
html->SetPage(HTML_content); html->SetPage(HTML_content);
frame->Show(); frame->Show();
return TRUE; return true;
} }
SashHtmlWindow::SashHtmlWindow(wxWindow *parent, wxWindowID id, SashHtmlWindow::SashHtmlWindow(wxWindow *parent, wxWindowID id,
const wxPoint& pos, const wxSize& size, long style, const wxString& name) : const wxPoint& pos, const wxSize& size, long style, const wxString& name) :
wxHtmlWindow(parent, id, pos, size, style, name) { wxHtmlWindow(parent, id, pos, size, style, name) {
Connect(-1, wxEVT_DYNAMIC_SASH_SPLIT, (wxObjectEventFunction) Connect(wxID_ANY, wxEVT_DYNAMIC_SASH_SPLIT, (wxObjectEventFunction)
(wxEventFunction) (wxEventFunction)
(wxDynamicSashSplitEventFunction)&SashHtmlWindow::OnSplit); (wxDynamicSashSplitEventFunction)&SashHtmlWindow::OnSplit);
@@ -97,6 +97,6 @@ wxSize SashHtmlWindow::DoGetBestSize() const {
} }
void SashHtmlWindow::OnSplit(wxDynamicSashSplitEvent& WXUNUSED(event)) { void SashHtmlWindow::OnSplit(wxDynamicSashSplitEvent& WXUNUSED(event)) {
wxHtmlWindow *html = new SashHtmlWindow(m_dyn_sash, -1); wxHtmlWindow *html = new SashHtmlWindow(m_dyn_sash, wxID_ANY);
html->SetPage(HTML_content); html->SetPage(HTML_content);
} }

View File

@@ -65,14 +65,14 @@ IMPLEMENT_APP(SwitchDemo)
SwitchView::SwitchView(wxDynamicSashWindow *win) { SwitchView::SwitchView(wxDynamicSashWindow *win) {
Create(win, -1); Create(win, wxID_ANY);
m_dyn_sash = win; m_dyn_sash = win;
m_bar = new wxWindow(this, -1, wxDefaultPosition, wxDefaultSize, wxRAISED_BORDER, wxT("bar")); m_bar = new wxWindow(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxRAISED_BORDER, wxT("bar"));
m_choice = new wxChoice(m_bar, -1); m_choice = new wxChoice(m_bar, wxID_ANY);
m_choice->SetEventHandler(this); m_choice->SetEventHandler(this);
m_view = new wxWindow(this, -1, wxDefaultPosition, wxDefaultSize, 0, wxT("view")); m_view = new wxWindow(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, wxT("view"));
m_view->SetBackgroundColour(*wxWHITE); m_view->SetBackgroundColour(*wxWHITE);
m_view->SetEventHandler(this); m_view->SetEventHandler(this);
@@ -119,41 +119,41 @@ SwitchView::SwitchView(wxDynamicSashWindow *win) {
(wxEventFunction) (wxEventFunction)
(wxPaintEventFunction)&SwitchView::OnPaint); (wxPaintEventFunction)&SwitchView::OnPaint);
Connect(-1, wxEVT_SET_FOCUS, (wxObjectEventFunction) Connect(wxID_ANY, wxEVT_SET_FOCUS, (wxObjectEventFunction)
(wxEventFunction) (wxEventFunction)
(wxFocusEventFunction)&SwitchView::OnFocus); (wxFocusEventFunction)&SwitchView::OnFocus);
Connect(-1, wxEVT_SCROLL_TOP, (wxObjectEventFunction) Connect(wxID_ANY, wxEVT_SCROLL_TOP, (wxObjectEventFunction)
(wxEventFunction) (wxEventFunction)
(wxScrollEventFunction)&SwitchView::OnScroll); (wxScrollEventFunction)&SwitchView::OnScroll);
Connect(-1, wxEVT_SCROLL_BOTTOM, (wxObjectEventFunction) Connect(wxID_ANY, wxEVT_SCROLL_BOTTOM, (wxObjectEventFunction)
(wxEventFunction) (wxEventFunction)
(wxScrollEventFunction)&SwitchView::OnScroll); (wxScrollEventFunction)&SwitchView::OnScroll);
Connect(-1, wxEVT_SCROLL_LINEUP, (wxObjectEventFunction) Connect(wxID_ANY, wxEVT_SCROLL_LINEUP, (wxObjectEventFunction)
(wxEventFunction) (wxEventFunction)
(wxScrollEventFunction)&SwitchView::OnScroll); (wxScrollEventFunction)&SwitchView::OnScroll);
Connect(-1, wxEVT_SCROLL_LINEDOWN, (wxObjectEventFunction) Connect(wxID_ANY, wxEVT_SCROLL_LINEDOWN, (wxObjectEventFunction)
(wxEventFunction) (wxEventFunction)
(wxScrollEventFunction)&SwitchView::OnScroll); (wxScrollEventFunction)&SwitchView::OnScroll);
Connect(-1, wxEVT_SCROLL_PAGEUP, (wxObjectEventFunction) Connect(wxID_ANY, wxEVT_SCROLL_PAGEUP, (wxObjectEventFunction)
(wxEventFunction) (wxEventFunction)
(wxScrollEventFunction)&SwitchView::OnScroll); (wxScrollEventFunction)&SwitchView::OnScroll);
Connect(-1, wxEVT_SCROLL_PAGEDOWN, (wxObjectEventFunction) Connect(wxID_ANY, wxEVT_SCROLL_PAGEDOWN, (wxObjectEventFunction)
(wxEventFunction) (wxEventFunction)
(wxScrollEventFunction)&SwitchView::OnScroll); (wxScrollEventFunction)&SwitchView::OnScroll);
Connect(-1, wxEVT_SCROLL_THUMBTRACK, (wxObjectEventFunction) Connect(wxID_ANY, wxEVT_SCROLL_THUMBTRACK, (wxObjectEventFunction)
(wxEventFunction) (wxEventFunction)
(wxScrollEventFunction)&SwitchView::OnScroll); (wxScrollEventFunction)&SwitchView::OnScroll);
Connect(-1, wxEVT_SCROLL_THUMBRELEASE, (wxObjectEventFunction) Connect(wxID_ANY, wxEVT_SCROLL_THUMBRELEASE, (wxObjectEventFunction)
(wxEventFunction) (wxEventFunction)
(wxScrollEventFunction)&SwitchView::OnScroll); (wxScrollEventFunction)&SwitchView::OnScroll);
Connect(-1, wxEVT_ERASE_BACKGROUND, (wxObjectEventFunction) Connect(wxID_ANY, wxEVT_ERASE_BACKGROUND, (wxObjectEventFunction)
(wxEventFunction) (wxEventFunction)
(wxEraseEventFunction)&SwitchView::OnErase); (wxEraseEventFunction)&SwitchView::OnErase);
Connect(-1, wxEVT_DYNAMIC_SASH_SPLIT, (wxObjectEventFunction) Connect(wxID_ANY, wxEVT_DYNAMIC_SASH_SPLIT, (wxObjectEventFunction)
(wxEventFunction) (wxEventFunction)
(wxDynamicSashSplitEventFunction)&SwitchView::OnSplit); (wxDynamicSashSplitEventFunction)&SwitchView::OnSplit);
Connect(-1, wxEVT_DYNAMIC_SASH_UNIFY, (wxObjectEventFunction) Connect(wxID_ANY, wxEVT_DYNAMIC_SASH_UNIFY, (wxObjectEventFunction)
(wxEventFunction) (wxEventFunction)
(wxDynamicSashUnifyEventFunction)&SwitchView::OnUnify); (wxDynamicSashUnifyEventFunction)&SwitchView::OnUnify);
} }
@@ -252,12 +252,12 @@ bool SwitchDemo::OnInit() {
wxFrame *frame; wxFrame *frame;
wxDynamicSashWindow *dyn; wxDynamicSashWindow *dyn;
frame = new wxFrame(NULL, -1, wxT("Dynamic Sash Window Switch Demo")); frame = new wxFrame(NULL, wxID_ANY, wxT("Dynamic Sash Window Switch Demo"));
dyn = new wxDynamicSashWindow(frame, -1, wxDefaultPosition, wxDefaultSize, wxCLIP_CHILDREN); dyn = new wxDynamicSashWindow(frame, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxCLIP_CHILDREN);
new SwitchView(dyn); new SwitchView(dyn);
frame->SetSize(480, 480); frame->SetSize(480, 480);
frame->Show(); frame->Show();
return TRUE; return true;
} }

View File

@@ -25,17 +25,17 @@ IMPLEMENT_APP(MyApp)
bool MyApp::OnInit() bool MyApp::OnInit()
{ {
wxDialog dlg(NULL, -1, _("Test dialog"), wxDefaultPosition, wxDefaultSize, wxDialog dlg(NULL, wxID_ANY, _("Test dialog"), wxDefaultPosition, wxDefaultSize,
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER); wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER);
wxSizer *sizer = new wxBoxSizer(wxVERTICAL); wxSizer *sizer = new wxBoxSizer(wxVERTICAL);
sizer->Add(new wxEditableListBox(&dlg, -1, _("Match these wildcards:"), sizer->Add(new wxEditableListBox(&dlg, wxID_ANY, _("Match these wildcards:"),
wxDefaultPosition,wxSize(300,200)), wxDefaultPosition,wxSize(300,200)),
1, wxEXPAND|wxALL, 10); 1, wxEXPAND|wxALL, 10);
sizer->Add(5,5); sizer->Add(5,5);
wxEditableListBox *lb = new wxEditableListBox(&dlg, -1, _("Except:"), wxEditableListBox *lb = new wxEditableListBox(&dlg, wxID_ANY, _("Except:"),
wxDefaultPosition,wxSize(300,200)); wxDefaultPosition,wxSize(300,200));
wxArrayString ar; wxArrayString ar;
ar.Add(_T("*.cpp")); ar.Add(_T("*.cpp"));
@@ -48,10 +48,10 @@ bool MyApp::OnInit()
sizer->Add(5,5); sizer->Add(5,5);
sizer->Add(new wxButton(&dlg, wxID_OK, _("OK")), 0, wxALIGN_RIGHT | wxALL, 10); sizer->Add(new wxButton(&dlg, wxID_OK, _("OK")), 0, wxALIGN_RIGHT | wxALL, 10);
dlg.SetAutoLayout(TRUE); dlg.SetAutoLayout(true);
dlg.SetSizer(sizer); dlg.SetSizer(sizer);
sizer->Fit(&dlg); sizer->Fit(&dlg);
dlg.Centre(); dlg.Centre();
dlg.ShowModal(); dlg.ShowModal();
@@ -61,5 +61,5 @@ bool MyApp::OnInit()
res << ar[i] << _T("\n"); res << ar[i] << _T("\n");
wxMessageBox(res); wxMessageBox(res);
return FALSE; return false;
} }

View File

@@ -165,12 +165,12 @@ bool MyApp::OnInit()
// and show it (the frames, unlike simple controls, are not shown when // and show it (the frames, unlike simple controls, are not shown when
// created initially) // created initially)
frame->Show(TRUE); frame->Show(true);
// success: wxApp::OnRun() will be called which will enter the main message // success: wxApp::OnRun() will be called which will enter the main message
// loop and the application will run. If we returned FALSE here, the // loop and the application will run. If we returned false here, the
// application would exit immediately. // application would exit immediately.
return TRUE; return true;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -179,7 +179,7 @@ bool MyApp::OnInit()
// frame constructor // frame constructor
MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size, long style) MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size, long style)
: wxFrame(NULL, -1, title, pos, size, style) : wxFrame(NULL, wxID_ANY, title, pos, size, style)
{ {
#if wxUSE_MENUS #if wxUSE_MENUS
// create a menu bar // create a menu bar
@@ -202,7 +202,7 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size,
editMenu->AppendSeparator(); editMenu->AppendSeparator();
editMenu->AppendCheckItem(LED_Edit_DrawFaded, _T("Draw &Faded\tCtrl-F")); editMenu->AppendCheckItem(LED_Edit_DrawFaded, _T("Draw &Faded\tCtrl-F"));
editMenu->Check(LED_Edit_DrawFaded, TRUE); editMenu->Check(LED_Edit_DrawFaded, true);
// now append the freshly created menu to the menu bar... // now append the freshly created menu to the menu bar...
wxMenuBar *menuBar = new wxMenuBar(); wxMenuBar *menuBar = new wxMenuBar();
@@ -222,8 +222,8 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size,
void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
{ {
// TRUE is to force the frame to close // true is to force the frame to close
Close(TRUE); Close(true);
} }
void MyFrame::OnIncrement(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnIncrement(wxCommandEvent& WXUNUSED(event))

View File

@@ -1,8 +1,8 @@
/* /*
* File: mtest.cpp * File: mtest.cpp
* Purpose: wxMultiCellSizer and wxMultiCellCanvas test * Purpose: wxMultiCellSizer and wxMultiCellCanvas test
* Author: Alex Andruschak * Author: Alex Andruschak
* Created: 2000 * Created: 2000
* Updated: * Updated:
* Copyright: * Copyright:
*/ */
@@ -10,185 +10,185 @@
static const char sccsid[] = "%W% %G%"; static const char sccsid[] = "%W% %G%";
#if defined(__GNUG__) && !defined(__APPLE__) #if defined(__GNUG__) && !defined(__APPLE__)
#pragma implementation #pragma implementation
#pragma interface #pragma interface
#endif #endif
#include "wx/wxprec.h" #include "wx/wxprec.h"
#ifdef __BORLANDC__ #ifdef __BORLANDC__
#pragma hdrstop #pragma hdrstop
#endif #endif
#ifndef WX_PRECOMP #ifndef WX_PRECOMP
#include "wx/wx.h" #include "wx/wx.h"
#endif #endif
#include "wx/gizmos/multicell.h" #include "wx/gizmos/multicell.h"
class MyApp: public wxApp class MyApp: public wxApp
{public: {public:
bool OnInit(void); bool OnInit(void);
}; };
class MyFrame: public wxFrame class MyFrame: public wxFrame
{ {
public: public:
MyFrame(int type, wxFrame *frame, const wxString& title, const wxPoint& pos, const wxSize& size); MyFrame(int type, wxFrame *frame, const wxString& title, const wxPoint& pos, const wxSize& size);
void OnCloseWindow(wxCloseEvent& event); void OnCloseWindow(wxCloseEvent& event);
void OnPaint(wxPaintEvent& event); void OnPaint(wxPaintEvent& event);
wxMultiCellSizer *sizer; wxMultiCellSizer *sizer;
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };
IMPLEMENT_APP(MyApp) IMPLEMENT_APP(MyApp)
bool MyApp::OnInit(void) bool MyApp::OnInit(void)
{ {
MyFrame *frame = new MyFrame(1, (wxFrame *) NULL, wxT("wxMultiCellSizer Sample"), wxPoint(50, 50), wxDefaultSize); //, wxSize(600, 500)); MyFrame *frame = new MyFrame(1, (wxFrame *) NULL, wxT("wxMultiCellSizer Sample"), wxPoint(50, 50), wxDefaultSize); //, wxSize(600, 500));
frame->Show(TRUE); frame->Show(true);
SetTopWindow(frame); SetTopWindow(frame);
frame = new MyFrame(2, (wxFrame *) NULL, wxT("wxMultiCellCanvas Sample"), wxPoint(100, 100), wxSize(600, 500)); frame = new MyFrame(2, (wxFrame *) NULL, wxT("wxMultiCellCanvas Sample"), wxPoint(100, 100), wxSize(600, 500));
frame->Show(TRUE); frame->Show(true);
SetTopWindow(frame); SetTopWindow(frame);
return TRUE; return true;
} }
MyFrame::MyFrame(int type, wxFrame *frame, const wxString& title, const wxPoint& pos, const wxSize& size): MyFrame::MyFrame(int type, wxFrame *frame, const wxString& title, const wxPoint& pos, const wxSize& size):
wxFrame(frame, -1, title, pos, size, wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL) wxFrame(frame, wxID_ANY, title, pos, size, wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL)
{ {
CreateStatusBar(1); CreateStatusBar(1);
sizer = NULL; sizer = NULL;
if (type == 1) if (type == 1)
{ {
// create sizer 4 columns 5 rows // create sizer 4 columns 5 rows
wxSize aa(4,9); wxSize aa(4,9);
sizer = new wxMultiCellSizer(aa); sizer = new wxMultiCellSizer(aa);
sizer->SetDefaultCellSize(wxSize(15,15)); sizer->SetDefaultCellSize(wxSize(15,15));
sizer->SetRowHeight(7,5,TRUE); sizer->SetRowHeight(7,5,true);
sizer->SetRowHeight(8,5,FALSE); sizer->SetRowHeight(8,5,false);
// add first row // add first row
sizer->Add( sizer->Add(
new wxButton( this, -1,wxT( "B1 - 0,0, horizontal resizable")), new wxButton( this, wxID_ANY, wxT( "B1 - 0,0, horizontal resizable")),
0, 0, 0, new wxMultiCellItemHandle(0,0,1,1, wxDefaultSize, wxHORIZONTAL_RESIZABLE, wxSize(2,2))); 0, 0, 0, new wxMultiCellItemHandle(0,0,1,1, wxDefaultSize, wxHORIZONTAL_RESIZABLE, wxSize(2,2)));
sizer->Add( sizer->Add(
new wxButton( this, -1, wxT("B2 - 0,1, vertical resizable")), new wxButton( this, wxID_ANY, wxT("B2 - 0,1, vertical resizable")),
0, 0, 0, new wxMultiCellItemHandle(0,1,1,1, wxDefaultSize, wxVERTICAL_RESIZABLE, wxSize(2, 2))); 0, 0, 0, new wxMultiCellItemHandle(0,1,1,1, wxDefaultSize, wxVERTICAL_RESIZABLE, wxSize(2, 2)));
sizer->Add( sizer->Add(
new wxButton( this, -1, wxT("B3 - 0,2")), new wxButton( this, wxID_ANY, wxT("B3 - 0,2")),
0, 0, 0, new wxMultiCellItemHandle(0,2,1,1, wxDefaultSize, wxNOT_RESIZABLE, wxSize(1,1), wxALIGN_CENTER_HORIZONTAL)); //, wxALIGN_CENTER)); 0, 0, 0, new wxMultiCellItemHandle(0,2,1,1, wxDefaultSize, wxNOT_RESIZABLE, wxSize(1,1), wxALIGN_CENTER_HORIZONTAL)); //, wxALIGN_CENTER));
sizer->Add( sizer->Add(
new wxStaticText(this, -1, wxT("jbb 0,3, lower-right")), new wxStaticText(this, wxID_ANY, wxT("jbb 0,3, lower-right")),
0, 0, 0, new wxMultiCellItemHandle(0,3,1,1, wxDefaultSize, wxNOT_RESIZABLE, wxSize(1,1), wxALIGN_BOTTOM | wxALIGN_RIGHT)); 0, 0, 0, new wxMultiCellItemHandle(0,3,1,1, wxDefaultSize, wxNOT_RESIZABLE, wxSize(1,1), wxALIGN_BOTTOM | wxALIGN_RIGHT));
// add button for secord row // add button for secord row
sizer->Add( sizer->Add(
new wxTextCtrl(this, -1, wxT("Text control - 1,0, 4 cols wide")), new wxTextCtrl(this, wxID_ANY, wxT("Text control - 1,0, 4 cols wide")),
0, 0, 0, new wxMultiCellItemHandle(1,0,1,4)); 0, 0, 0, new wxMultiCellItemHandle(1,0,1,4));
// add buttons for next row // add buttons for next row
sizer->Add( sizer->Add(
new wxButton( this, -1, wxT("B6 - 2,0, 2 cols wide")), new wxButton( this, wxID_ANY, wxT("B6 - 2,0, 2 cols wide")),
0, 0, 0, new wxMultiCellItemHandle(2,0,1,2)); 0, 0, 0, new wxMultiCellItemHandle(2,0,1,2));
sizer->Add( sizer->Add(
new wxButton( this, -1, wxT("B7 - 2,3")), new wxButton( this, wxID_ANY, wxT("B7 - 2,3")),
0, 0, 0, new wxMultiCellItemHandle(2,3,1,1)); 0, 0, 0, new wxMultiCellItemHandle(2,3,1,1));
// and last additions // and last additions
sizer->Add( sizer->Add(
new wxButton( this, -1, wxT("B8 - 3,0, 4 rows high, vert resizable")), new wxButton( this, wxID_ANY, wxT("B8 - 3,0, 4 rows high, vert resizable")),
0, 0, 0, new wxMultiCellItemHandle(3,0,4,1,wxDefaultSize, wxVERTICAL_RESIZABLE)); 0, 0, 0, new wxMultiCellItemHandle(3,0,4,1,wxDefaultSize, wxVERTICAL_RESIZABLE));
sizer->Add( sizer->Add(
new wxButton( this, -1, wxT("B9 - 3,2, 2 cols wide, vert resizable")), new wxButton( this, wxID_ANY, wxT("B9 - 3,2, 2 cols wide, vert resizable")),
0, 0, 0, new wxMultiCellItemHandle(3,2,1,2,wxDefaultSize, wxVERTICAL_RESIZABLE)); 0, 0, 0, new wxMultiCellItemHandle(3,2,1,2,wxDefaultSize, wxVERTICAL_RESIZABLE));
sizer->Add( sizer->Add(
new wxButton( this, -1, wxT("B10 - 4,1, 3 cols wide, vert resizable")), new wxButton( this, wxID_ANY, wxT("B10 - 4,1, 3 cols wide, vert resizable")),
0, 0, 0, new wxMultiCellItemHandle(4,1,1,3,wxDefaultSize, wxVERTICAL_RESIZABLE)); 0, 0, 0, new wxMultiCellItemHandle(4,1,1,3,wxDefaultSize, wxVERTICAL_RESIZABLE));
sizer->Add( sizer->Add(
new wxButton( this, -1, wxT("B11 - 5,1, 3 cols wide")), new wxButton( this, wxID_ANY, wxT("B11 - 5,1, 3 cols wide")),
0, 0, 0, new wxMultiCellItemHandle(5,1,1,3)); 0, 0, 0, new wxMultiCellItemHandle(5,1,1,3));
sizer->Add( sizer->Add(
new wxButton( this, -1, wxT("B12 - 6,1, 3 cols wide")), new wxButton( this, wxID_ANY, wxT("B12 - 6,1, 3 cols wide")),
0, 0, 0, new wxMultiCellItemHandle(6,1,1,3)); 0, 0, 0, new wxMultiCellItemHandle(6,1,1,3));
sizer->Add( sizer->Add(
new wxButton( this, -1, wxT("B13 - 7,1, 2 cols wide")), new wxButton( this, wxID_ANY, wxT("B13 - 7,1, 2 cols wide")),
0, 0, 0, new wxMultiCellItemHandle(7,1,1,2)); 0, 0, 0, new wxMultiCellItemHandle(7,1,1,2));
sizer->Add( sizer->Add(
new wxButton( this, -1, wxT("B14 - 8,1, 3 cols wide")), new wxButton( this, wxID_ANY, wxT("B14 - 8,1, 3 cols wide")),
0, 0, 0, new wxMultiCellItemHandle(8,1,1,3)); 0, 0, 0, new wxMultiCellItemHandle(8,1,1,3));
SetAutoLayout( TRUE ); SetAutoLayout( true );
// sizer->SetMinSize(sizer->CalcMin()); // sizer->SetMinSize(sizer->CalcMin());
SetSizer( sizer ); SetSizer( sizer );
wxSize s = sizer->CalcMin(); wxSize s = sizer->CalcMin();
wxSize c = GetSize() - GetClientSize(); wxSize c = GetSize() - GetClientSize();
SetSizeHints(s.GetWidth() + c.GetWidth() , s.GetHeight() + c.GetHeight()); SetSizeHints(s.GetWidth() + c.GetWidth() , s.GetHeight() + c.GetHeight());
sizer->EnableGridLines(this); sizer->EnableGridLines(this);
} }
else else
{ {
// create sizer 4 columns 5 rows // create sizer 4 columns 5 rows
wxMultiCellCanvas *sizer = new wxMultiCellCanvas(this, 5,5); wxMultiCellCanvas *sizer = new wxMultiCellCanvas(this, 5,5);
// add first row // add first row
sizer->Add( sizer->Add(
new wxButton( this, -1, wxT("Button 1")), new wxButton( this, wxID_ANY, wxT("Button 1")),
0, 0); 0, 0);
sizer->Add( sizer->Add(
new wxButton( this, -1, wxT("Button 2")), new wxButton( this, wxID_ANY, wxT("Button 2")),
0, 1); 0, 1);
sizer->Add( sizer->Add(
new wxButton( this, -1, wxT("Button 3")), new wxButton( this, wxID_ANY, wxT("Button 3")),
0, 2); 0, 2);
sizer->Add( sizer->Add(
new wxStaticText(this, -1, wxT("jbb test")), new wxStaticText(this, wxID_ANY, wxT("jbb test")),
0, 3); 0, 3);
sizer->Add( sizer->Add(
new wxStaticText(this, -1, wxT("jbb test 2")), new wxStaticText(this, wxID_ANY, wxT("jbb test 2")),
0, 4); 0, 4);
// add button for secord row // add button for secord row
sizer->Add( sizer->Add(
new wxTextCtrl(this, -1, wxT("Text control")), new wxTextCtrl(this, wxID_ANY, wxT("Text control")),
1, 0); 1, 0);
// add buttons for next row // add buttons for next row
sizer->Add( sizer->Add(
new wxButton( this, -1, wxT("Button 6")), new wxButton( this, wxID_ANY, wxT("Button 6")),
2, 0); 2, 0);
sizer->Add( sizer->Add(
new wxButton( this, -1, wxT("Button 7")), new wxButton( this, wxID_ANY, wxT("Button 7")),
2, 3); 2, 3);
// and last additions // and last additions
sizer->Add( sizer->Add(
new wxButton( this, -1, wxT("Button 8")), new wxButton( this, wxID_ANY, wxT("Button 8")),
3, 0); 3, 0);
sizer->Add( sizer->Add(
new wxButton( this, -1, wxT("Button 9")), new wxButton( this, wxID_ANY, wxT("Button 9")),
3, 1); 3, 1);
sizer->Add( sizer->Add(
new wxButton( this, -1, wxT("Button 10")), new wxButton( this, wxID_ANY, wxT("Button 10")),
4, 1); 4, 1);
sizer->CalculateConstraints(); sizer->CalculateConstraints();
SetSizer( sizer ); SetSizer( sizer );
SetAutoLayout( TRUE ); SetAutoLayout( true );
} }
} }
// Define the repainting behaviour // Define the repainting behaviour
@@ -200,16 +200,16 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame)
void MyFrame::OnPaint(wxPaintEvent& WXUNUSED(event) ) void MyFrame::OnPaint(wxPaintEvent& WXUNUSED(event) )
{ {
wxPaintDC dc(this); wxPaintDC dc(this);
if (sizer) if (sizer)
{ {
sizer->OnPaint(dc); sizer->OnPaint(dc);
} }
} }
void MyFrame::OnCloseWindow(wxCloseEvent& WXUNUSED(event)) void MyFrame::OnCloseWindow(wxCloseEvent& WXUNUSED(event))
{ {
Destroy(); Destroy();
} }

View File

@@ -138,12 +138,12 @@ bool MyApp::OnInit()
// and show it (the frames, unlike simple controls, are not shown when // and show it (the frames, unlike simple controls, are not shown when
// created initially) // created initially)
frame->Show(TRUE); frame->Show(true);
// success: wxApp::OnRun() will be called which will enter the main message // success: wxApp::OnRun() will be called which will enter the main message
// loop and the application will run. If we returned FALSE here, the // loop and the application will run. If we returned false here, the
// application would exit immediately. // application would exit immediately.
return TRUE; return true;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -155,7 +155,7 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
: wxFrame((wxFrame *)NULL, idMAIN_FRAME, title, pos, size) : wxFrame((wxFrame *)NULL, idMAIN_FRAME, title, pos, size)
{ {
m_splitter = NULL; m_splitter = NULL;
m_scrolledWindow = NULL; m_scrolledWindow = NULL;
m_tree = NULL; m_tree = NULL;
m_valueWindow = NULL; m_valueWindow = NULL;
#ifdef __WXMAC__ #ifdef __WXMAC__
@@ -165,26 +165,26 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
#endif #endif
m_scrolledWindow = new wxSplitterScrolledWindow(this, idSCROLLED_WINDOW, wxDefaultPosition, m_scrolledWindow = new wxSplitterScrolledWindow(this, idSCROLLED_WINDOW, wxDefaultPosition,
wxSize(300, 400), wxNO_BORDER | wxCLIP_CHILDREN | wxVSCROLL); wxSize(300, 400), wxNO_BORDER | wxCLIP_CHILDREN | wxVSCROLL);
m_splitter = new wxThinSplitterWindow(m_scrolledWindow, idSPLITTER_WINDOW, wxDefaultPosition, m_splitter = new wxThinSplitterWindow(m_scrolledWindow, idSPLITTER_WINDOW, wxDefaultPosition,
wxDefaultSize, wxSP_3DBORDER | wxCLIP_CHILDREN /* | wxSP_LIVE_UPDATE */); wxDefaultSize, wxSP_3DBORDER | wxCLIP_CHILDREN /* | wxSP_LIVE_UPDATE */);
m_splitter->SetSashSize(2); m_splitter->SetSashSize(2);
/* Note the wxTR_ROW_LINES style: draws horizontal lines between items */ /* Note the wxTR_ROW_LINES style: draws horizontal lines between items */
m_tree = new TestTree(m_splitter , idTREE_CTRL, wxDefaultPosition, m_tree = new TestTree(m_splitter , idTREE_CTRL, wxDefaultPosition,
wxDefaultSize, wxTR_HAS_BUTTONS | wxTR_NO_LINES | wxNO_BORDER | wxTR_ROW_LINES ); wxDefaultSize, wxTR_HAS_BUTTONS | wxTR_NO_LINES | wxNO_BORDER | wxTR_ROW_LINES );
m_valueWindow = new TestValueWindow(m_splitter, idVALUE_WINDOW, wxDefaultPosition, m_valueWindow = new TestValueWindow(m_splitter, idVALUE_WINDOW, wxDefaultPosition,
wxDefaultSize, wxNO_BORDER); wxDefaultSize, wxNO_BORDER);
m_splitter->SplitVertically(m_tree, m_valueWindow); m_splitter->SplitVertically(m_tree, m_valueWindow);
//m_splitter->AdjustScrollbars(); //m_splitter->AdjustScrollbars();
m_splitter->SetSashPosition(200); m_splitter->SetSashPosition(200);
m_scrolledWindow->SetTargetWindow(m_tree); m_scrolledWindow->SetTargetWindow(m_tree);
m_scrolledWindow->EnableScrolling(FALSE, FALSE); m_scrolledWindow->EnableScrolling(false, false);
// Let the two controls know about each other // Let the two controls know about each other
m_valueWindow->SetTreeCtrl(m_tree); m_valueWindow->SetTreeCtrl(m_tree);
m_tree->SetCompanionWindow(m_valueWindow); m_tree->SetCompanionWindow(m_valueWindow);
// set the frame icon // set the frame icon
SetIcon(wxICON(mondrian)); SetIcon(wxICON(mondrian));
@@ -212,8 +212,8 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
{ {
// TRUE is to force the frame to close // true is to force the frame to close
Close(TRUE); Close(true);
} }
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
@@ -238,7 +238,7 @@ TestTree::TestTree(wxWindow* parent, wxWindowID id, const wxPoint& pt,
const wxSize& sz, long style): const wxSize& sz, long style):
wxRemotelyScrolledTreeCtrl(parent, id, pt, sz, style) wxRemotelyScrolledTreeCtrl(parent, id, pt, sz, style)
{ {
m_imageList = new wxImageList(16, 16, TRUE); m_imageList = new wxImageList(16, 16, true);
#if !defined(__WXMSW__) // || wxUSE_XPM_IN_MSW #if !defined(__WXMSW__) // || wxUSE_XPM_IN_MSW
m_imageList->Add(wxIcon(icon1_xpm)); m_imageList->Add(wxIcon(icon1_xpm));
m_imageList->Add(wxIcon(icon2_xpm)); m_imageList->Add(wxIcon(icon2_xpm));
@@ -251,27 +251,27 @@ TestTree::TestTree(wxWindow* parent, wxWindowID id, const wxPoint& pt,
SetImageList(m_imageList); SetImageList(m_imageList);
// Add some dummy items // Add some dummy items
wxTreeItemId rootId = AddRoot(_("Root"), -1, -1); wxTreeItemId rootId = AddRoot(_("Root"), -1, -1);
int i; int i;
for (i = 1; i <= 20; i++) for (i = 1; i <= 20; i++)
{ {
wxString label; wxString label;
label.Printf(wxT("Item %d"), i); label.Printf(wxT("Item %d"), i);
wxTreeItemId id = AppendItem(rootId, label, 0); wxTreeItemId id = AppendItem(rootId, label, 0);
//SetItemImage( id, 1, wxTreeItemIcon_Expanded ); //SetItemImage( id, 1, wxTreeItemIcon_Expanded );
int j; int j;
for (j = 0; j < 10; j++) for (j = 0; j < 10; j++)
AppendItem(id, _("Child"), 1); AppendItem(id, _("Child"), 1);
} }
Expand(rootId); Expand(rootId);
} }
TestTree::~TestTree() TestTree::~TestTree()
{ {
SetImageList(NULL); SetImageList(NULL);
delete m_imageList; delete m_imageList;
} }
/* /*
@@ -289,5 +289,5 @@ TestValueWindow::TestValueWindow(wxWindow* parent, wxWindowID id,
long style): long style):
wxTreeCompanionWindow(parent, id, pos, sz, style) wxTreeCompanionWindow(parent, id, pos, sz, style)
{ {
SetBackgroundColour(* wxWHITE); SetBackgroundColour(* wxWHITE);
} }

View File

@@ -87,7 +87,7 @@ protected:
class TestValueWindow: public wxTreeCompanionWindow class TestValueWindow: public wxTreeCompanionWindow
{ {
public: public:
TestValueWindow(wxWindow* parent, wxWindowID id = -1, TestValueWindow(wxWindow* parent, wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& sz = wxDefaultSize, const wxSize& sz = wxDefaultSize,
long style = 0); long style = 0);

View File

@@ -230,22 +230,22 @@ bool wxDynamicSashWindow::Create(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) {
if (m_impl) if (m_impl)
return FALSE; return false;
if (!wxWindow::Create(parent, id, pos, size, style, name)) if (!wxWindow::Create(parent, id, pos, size, style, name))
return FALSE; return false;
m_impl = new wxDynamicSashWindowImpl(this); m_impl = new wxDynamicSashWindowImpl(this);
if (!m_impl) if (!m_impl)
return FALSE; return false;
if (!m_impl->Create()) { if (!m_impl->Create()) {
delete m_impl; delete m_impl;
m_impl = NULL; m_impl = NULL;
return FALSE; return false;
} }
return TRUE; return true;
} }
void wxDynamicSashWindow::AddChild(wxWindowBase *child) { void wxDynamicSashWindow::AddChild(wxWindowBase *child) {
@@ -303,39 +303,39 @@ bool wxDynamicSashWindowImpl::Create() {
m_leaf = new wxDynamicSashWindowLeaf(this); m_leaf = new wxDynamicSashWindowLeaf(this);
if (!m_leaf) if (!m_leaf)
return FALSE; return false;
if (!m_leaf->Create()) { if (!m_leaf->Create()) {
delete m_leaf; delete m_leaf;
m_leaf = NULL; m_leaf = NULL;
return FALSE; return false;
} }
m_container->SetEventHandler(this); m_container->SetEventHandler(this);
Connect(-1, wxEVT_SIZE, (wxObjectEventFunction) Connect(wxID_ANY, wxEVT_SIZE, (wxObjectEventFunction)
(wxEventFunction) (wxEventFunction)
(wxSizeEventFunction)&wxDynamicSashWindowImpl::OnSize); (wxSizeEventFunction)&wxDynamicSashWindowImpl::OnSize);
Connect(-1, wxEVT_PAINT, (wxObjectEventFunction) Connect(wxID_ANY, wxEVT_PAINT, (wxObjectEventFunction)
(wxEventFunction) (wxEventFunction)
(wxPaintEventFunction)&wxDynamicSashWindowImpl::OnPaint); (wxPaintEventFunction)&wxDynamicSashWindowImpl::OnPaint);
Connect(-1, wxEVT_MOTION, (wxObjectEventFunction) Connect(wxID_ANY, wxEVT_MOTION, (wxObjectEventFunction)
(wxEventFunction) (wxEventFunction)
(wxMouseEventFunction)&wxDynamicSashWindowImpl::OnMouseMove); (wxMouseEventFunction)&wxDynamicSashWindowImpl::OnMouseMove);
Connect(-1, wxEVT_ENTER_WINDOW, (wxObjectEventFunction) Connect(wxID_ANY, wxEVT_ENTER_WINDOW, (wxObjectEventFunction)
(wxEventFunction) (wxEventFunction)
(wxMouseEventFunction)&wxDynamicSashWindowImpl::OnMouseMove); (wxMouseEventFunction)&wxDynamicSashWindowImpl::OnMouseMove);
Connect(-1, wxEVT_LEAVE_WINDOW, (wxObjectEventFunction) Connect(wxID_ANY, wxEVT_LEAVE_WINDOW, (wxObjectEventFunction)
(wxEventFunction) (wxEventFunction)
(wxMouseEventFunction)&wxDynamicSashWindowImpl::OnLeave); (wxMouseEventFunction)&wxDynamicSashWindowImpl::OnLeave);
Connect(-1, wxEVT_LEFT_DOWN, (wxObjectEventFunction) Connect(wxID_ANY, wxEVT_LEFT_DOWN, (wxObjectEventFunction)
(wxEventFunction) (wxEventFunction)
(wxMouseEventFunction)&wxDynamicSashWindowImpl::OnPress); (wxMouseEventFunction)&wxDynamicSashWindowImpl::OnPress);
Connect(-1, wxEVT_LEFT_UP, (wxObjectEventFunction) Connect(wxID_ANY, wxEVT_LEFT_UP, (wxObjectEventFunction)
(wxEventFunction) (wxEventFunction)
(wxMouseEventFunction)&wxDynamicSashWindowImpl::OnRelease); (wxMouseEventFunction)&wxDynamicSashWindowImpl::OnRelease);
return TRUE; return true;
} }
void wxDynamicSashWindowImpl::AddChild(wxWindow *window) { void wxDynamicSashWindowImpl::AddChild(wxWindow *window) {
@@ -573,7 +573,7 @@ void wxDynamicSashWindowImpl::Split(int px, int py) {
m_add_child_target = NULL; m_add_child_target = NULL;
m_child[0] = new wxDynamicSashWindowImpl(m_window); m_child[0] = new wxDynamicSashWindowImpl(m_window);
m_child[0]->m_container = new wxWindow(m_container, -1); m_child[0]->m_container = new wxWindow(m_container, wxID_ANY);
m_child[0]->m_parent = this; m_child[0]->m_parent = this;
m_child[0]->m_top = m_top; m_child[0]->m_top = m_top;
m_child[0]->Create(); m_child[0]->Create();
@@ -583,7 +583,7 @@ void wxDynamicSashWindowImpl::Split(int px, int py) {
} }
m_child[1] = new wxDynamicSashWindowImpl(m_window); m_child[1] = new wxDynamicSashWindowImpl(m_window);
m_child[1]->m_container = new wxWindow(m_container, -1); m_child[1]->m_container = new wxWindow(m_container, wxID_ANY);
m_child[1]->m_parent = this; m_child[1]->m_parent = this;
m_child[1]->m_top = m_top; m_child[1]->m_top = m_top;
m_child[1]->Create(); m_child[1]->Create();
@@ -892,16 +892,16 @@ bool wxDynamicSashWindowLeaf::Create() {
m_viewport = new wxWindow(); m_viewport = new wxWindow();
if (!m_hscroll || !m_vscroll || !m_viewport) { if (!m_hscroll || !m_vscroll || !m_viewport) {
return FALSE; return false;
} }
wxDynamicSashWindowImpl *add_child_target = m_impl->m_add_child_target; wxDynamicSashWindowImpl *add_child_target = m_impl->m_add_child_target;
m_impl->m_add_child_target = NULL; m_impl->m_add_child_target = NULL;
success = m_hscroll->Create(m_impl->m_container, -1, wxDefaultPosition, wxDefaultSize, success = m_hscroll->Create(m_impl->m_container, wxID_ANY, wxDefaultPosition, wxDefaultSize,
wxSB_HORIZONTAL); wxSB_HORIZONTAL);
success = success && m_vscroll->Create(m_impl->m_container, -1, wxDefaultPosition, wxDefaultSize, success = success && m_vscroll->Create(m_impl->m_container, wxID_ANY, wxDefaultPosition, wxDefaultSize,
wxSB_VERTICAL); wxSB_VERTICAL);
success = success && m_viewport->Create(m_impl->m_container, -1); success = success && m_viewport->Create(m_impl->m_container, wxID_ANY);
m_impl->m_add_child_target = add_child_target; m_impl->m_add_child_target = add_child_target;
wxCursor cursor(wxCURSOR_ARROW); wxCursor cursor(wxCURSOR_ARROW);
@@ -910,44 +910,44 @@ bool wxDynamicSashWindowLeaf::Create() {
m_viewport->SetCursor(cursor); m_viewport->SetCursor(cursor);
m_viewport->SetEventHandler(this); m_viewport->SetEventHandler(this);
Connect(-1, wxEVT_DYNAMIC_SASH_REPARENT, (wxObjectEventFunction)&wxDynamicSashWindowLeaf::OnReparent); Connect(wxID_ANY, wxEVT_DYNAMIC_SASH_REPARENT, (wxObjectEventFunction)&wxDynamicSashWindowLeaf::OnReparent);
if (m_impl->m_window->GetWindowStyle() & wxDS_MANAGE_SCROLLBARS) { if (m_impl->m_window->GetWindowStyle() & wxDS_MANAGE_SCROLLBARS) {
m_hscroll->SetEventHandler(this); m_hscroll->SetEventHandler(this);
m_vscroll->SetEventHandler(this); m_vscroll->SetEventHandler(this);
Connect(-1, wxEVT_SET_FOCUS, (wxObjectEventFunction) Connect(wxID_ANY, wxEVT_SET_FOCUS, (wxObjectEventFunction)
(wxEventFunction) (wxEventFunction)
(wxFocusEventFunction)&wxDynamicSashWindowLeaf::OnFocus); (wxFocusEventFunction)&wxDynamicSashWindowLeaf::OnFocus);
Connect(-1, wxEVT_SCROLL_TOP, (wxObjectEventFunction) Connect(wxID_ANY, wxEVT_SCROLL_TOP, (wxObjectEventFunction)
(wxEventFunction) (wxEventFunction)
(wxScrollEventFunction)&wxDynamicSashWindowLeaf::OnScroll); (wxScrollEventFunction)&wxDynamicSashWindowLeaf::OnScroll);
Connect(-1, wxEVT_SCROLL_BOTTOM, (wxObjectEventFunction) Connect(wxID_ANY, wxEVT_SCROLL_BOTTOM, (wxObjectEventFunction)
(wxEventFunction) (wxEventFunction)
(wxScrollEventFunction)&wxDynamicSashWindowLeaf::OnScroll); (wxScrollEventFunction)&wxDynamicSashWindowLeaf::OnScroll);
Connect(-1, wxEVT_SCROLL_LINEUP, (wxObjectEventFunction) Connect(wxID_ANY, wxEVT_SCROLL_LINEUP, (wxObjectEventFunction)
(wxEventFunction) (wxEventFunction)
(wxScrollEventFunction)&wxDynamicSashWindowLeaf::OnScroll); (wxScrollEventFunction)&wxDynamicSashWindowLeaf::OnScroll);
Connect(-1, wxEVT_SCROLL_LINEDOWN, (wxObjectEventFunction) Connect(wxID_ANY, wxEVT_SCROLL_LINEDOWN, (wxObjectEventFunction)
(wxEventFunction) (wxEventFunction)
(wxScrollEventFunction)&wxDynamicSashWindowLeaf::OnScroll); (wxScrollEventFunction)&wxDynamicSashWindowLeaf::OnScroll);
Connect(-1, wxEVT_SCROLL_PAGEUP, (wxObjectEventFunction) Connect(wxID_ANY, wxEVT_SCROLL_PAGEUP, (wxObjectEventFunction)
(wxEventFunction) (wxEventFunction)
(wxScrollEventFunction)&wxDynamicSashWindowLeaf::OnScroll); (wxScrollEventFunction)&wxDynamicSashWindowLeaf::OnScroll);
Connect(-1, wxEVT_SCROLL_PAGEDOWN, (wxObjectEventFunction) Connect(wxID_ANY, wxEVT_SCROLL_PAGEDOWN, (wxObjectEventFunction)
(wxEventFunction) (wxEventFunction)
(wxScrollEventFunction)&wxDynamicSashWindowLeaf::OnScroll); (wxScrollEventFunction)&wxDynamicSashWindowLeaf::OnScroll);
Connect(-1, wxEVT_SCROLL_THUMBTRACK, (wxObjectEventFunction) Connect(wxID_ANY, wxEVT_SCROLL_THUMBTRACK, (wxObjectEventFunction)
(wxEventFunction) (wxEventFunction)
(wxScrollEventFunction)&wxDynamicSashWindowLeaf::OnScroll); (wxScrollEventFunction)&wxDynamicSashWindowLeaf::OnScroll);
Connect(-1, wxEVT_SCROLL_THUMBRELEASE, (wxObjectEventFunction) Connect(wxID_ANY, wxEVT_SCROLL_THUMBRELEASE, (wxObjectEventFunction)
(wxEventFunction) (wxEventFunction)
(wxScrollEventFunction)&wxDynamicSashWindowLeaf::OnScroll); (wxScrollEventFunction)&wxDynamicSashWindowLeaf::OnScroll);
} }
wxLayoutConstraints *layout = new wxLayoutConstraints(); wxLayoutConstraints *layout = new wxLayoutConstraints();
if (!layout) if (!layout)
return FALSE; return false;
wxSize size = m_hscroll->GetBestSize(); wxSize size = m_hscroll->GetBestSize();
#ifdef __WXMSW__ #ifdef __WXMSW__
size = m_hscroll->GetSize(); size = m_hscroll->GetSize();
@@ -961,7 +961,7 @@ bool wxDynamicSashWindowLeaf::Create() {
layout = new wxLayoutConstraints(); layout = new wxLayoutConstraints();
if (!layout) if (!layout)
return FALSE; return false;
size = size = m_vscroll->GetBestSize(); size = size = m_vscroll->GetBestSize();
#ifdef __WXMSW__ #ifdef __WXMSW__
size = m_vscroll->GetSize(); size = m_vscroll->GetSize();
@@ -975,7 +975,7 @@ bool wxDynamicSashWindowLeaf::Create() {
layout = new wxLayoutConstraints(); layout = new wxLayoutConstraints();
if (!layout) if (!layout)
return FALSE; return false;
layout->left.SameAs(m_impl->m_container, wxLeft, 3); layout->left.SameAs(m_impl->m_container, wxLeft, 3);
layout->right.LeftOf(m_vscroll); layout->right.LeftOf(m_vscroll);
layout->top.SameAs(m_impl->m_container, wxTop, 3); layout->top.SameAs(m_impl->m_container, wxTop, 3);

View File

@@ -36,7 +36,7 @@ class CleverListCtrl : public wxListCtrl
{ {
public: public:
CleverListCtrl(wxWindow *parent, CleverListCtrl(wxWindow *parent,
wxWindowID id = -1, wxWindowID id = wxID_ANY,
const wxPoint &pos = wxDefaultPosition, const wxPoint &pos = wxDefaultPosition,
const wxSize &size = wxDefaultSize, const wxSize &size = wxDefaultSize,
long style = wxLC_ICON, long style = wxLC_ICON,
@@ -119,10 +119,10 @@ wxEditableListBox::wxEditableListBox(wxWindow *parent, wxWindowID id,
wxSizer *sizer = new wxBoxSizer(wxVERTICAL); wxSizer *sizer = new wxBoxSizer(wxVERTICAL);
wxPanel *subp = new wxPanel(this, -1, wxDefaultPosition, wxDefaultSize, wxPanel *subp = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxDefaultSize,
wxSUNKEN_BORDER | wxTAB_TRAVERSAL); wxSUNKEN_BORDER | wxTAB_TRAVERSAL);
wxSizer *subsizer = new wxBoxSizer(wxHORIZONTAL); wxSizer *subsizer = new wxBoxSizer(wxHORIZONTAL);
subsizer->Add(new wxStaticText(subp, -1, label), 1, wxALIGN_CENTRE_VERTICAL | wxLEFT, 4); subsizer->Add(new wxStaticText(subp, wxID_ANY, label), 1, wxALIGN_CENTRE_VERTICAL | wxLEFT, 4);
#ifdef __WXMSW__ #ifdef __WXMSW__
#define BTN_BORDER 4 #define BTN_BORDER 4
@@ -165,7 +165,7 @@ wxEditableListBox::wxEditableListBox(wxWindow *parent, wxWindowID id,
m_bDown->SetToolTip(_("Move down")); m_bDown->SetToolTip(_("Move down"));
#endif #endif
subp->SetAutoLayout(TRUE); subp->SetAutoLayout(true);
subp->SetSizer(subsizer); subp->SetSizer(subsizer);
subsizer->Fit(subp); subsizer->Fit(subp);
@@ -181,7 +181,7 @@ wxEditableListBox::wxEditableListBox(wxWindow *parent, wxWindowID id,
sizer->Add(m_listCtrl, 1, wxEXPAND); sizer->Add(m_listCtrl, 1, wxEXPAND);
SetAutoLayout(TRUE); SetAutoLayout(true);
SetSizer(sizer); SetSizer(sizer);
Layout(); Layout();
} }

View File

@@ -66,7 +66,7 @@ wxLEDNumberCtrl::wxLEDNumberCtrl()
m_DigitMargin(-1), m_DigitMargin(-1),
m_LineLength(-1), m_LineLength(-1),
m_LineWidth(-1), m_LineWidth(-1),
m_DrawFaded(FALSE), m_DrawFaded(false),
m_LeftStartPos(-1) m_LeftStartPos(-1)
{ {
} }
@@ -80,7 +80,7 @@ wxLEDNumberCtrl::wxLEDNumberCtrl(wxWindow *parent, wxWindowID id,
m_DigitMargin(-1), m_DigitMargin(-1),
m_LineLength(-1), m_LineLength(-1),
m_LineWidth(-1), m_LineWidth(-1),
m_DrawFaded(FALSE), m_DrawFaded(false),
m_LeftStartPos(-1) m_LeftStartPos(-1)
{ {
Create(parent, id, pos, size, style); Create(parent, id, pos, size, style);
@@ -94,7 +94,7 @@ bool wxLEDNumberCtrl::Create(wxWindow *parent, wxWindowID id,
bool RetVal = wxControl::Create(parent, id, pos, size, style); bool RetVal = wxControl::Create(parent, id, pos, size, style);
if ((style & wxLED_DRAW_FADED) != 0) if ((style & wxLED_DRAW_FADED) != 0)
SetDrawFaded(TRUE); SetDrawFaded(true);
if ((style & wxLED_ALIGN_MASK) != 0) if ((style & wxLED_ALIGN_MASK) != 0)
SetAlignment((wxLEDValueAlign)(style & wxLED_ALIGN_MASK)); SetAlignment((wxLEDValueAlign)(style & wxLED_ALIGN_MASK));
@@ -113,7 +113,7 @@ void wxLEDNumberCtrl::SetAlignment(wxLEDValueAlign Alignment, bool Redraw)
RecalcInternals(GetClientSize()); RecalcInternals(GetClientSize());
if (Redraw) if (Redraw)
Refresh(FALSE); Refresh(false);
} }
} }
@@ -125,7 +125,7 @@ void wxLEDNumberCtrl::SetDrawFaded(bool DrawFaded, bool Redraw)
m_DrawFaded = DrawFaded; m_DrawFaded = DrawFaded;
if (Redraw) if (Redraw)
Refresh(FALSE); Refresh(false);
} }
} }
@@ -149,7 +149,7 @@ void wxLEDNumberCtrl::SetValue(wxString const &Value, bool Redraw)
RecalcInternals(GetClientSize()); RecalcInternals(GetClientSize());
if (Redraw) if (Redraw)
Refresh(FALSE); Refresh(false);
} }
} }
@@ -271,7 +271,7 @@ void wxLEDNumberCtrl::DrawDigit(wxDC &Dc, int Digit, int Column)
{ {
Dc.DrawLine(XPos + m_LineMargin*2, m_LineMargin, Dc.DrawLine(XPos + m_LineMargin*2, m_LineMargin,
XPos + m_LineLength, m_LineMargin); XPos + m_LineLength, m_LineMargin);
} }
if (Digit & LINE2) if (Digit & LINE2)
{ {

File diff suppressed because it is too large Load Diff

View File

@@ -60,8 +60,8 @@ BEGIN_EVENT_TABLE(wxRemotelyScrolledTreeCtrl, wxTreeCtrl)
#endif #endif
EVT_SIZE(wxRemotelyScrolledTreeCtrl::OnSize) EVT_SIZE(wxRemotelyScrolledTreeCtrl::OnSize)
EVT_PAINT(wxRemotelyScrolledTreeCtrl::OnPaint) EVT_PAINT(wxRemotelyScrolledTreeCtrl::OnPaint)
EVT_TREE_ITEM_EXPANDED(-1, wxRemotelyScrolledTreeCtrl::OnExpand) EVT_TREE_ITEM_EXPANDED(wxID_ANY, wxRemotelyScrolledTreeCtrl::OnExpand)
EVT_TREE_ITEM_COLLAPSED(-1, wxRemotelyScrolledTreeCtrl::OnExpand) EVT_TREE_ITEM_COLLAPSED(wxID_ANY, wxRemotelyScrolledTreeCtrl::OnExpand)
EVT_SCROLLWIN(wxRemotelyScrolledTreeCtrl::OnScroll) EVT_SCROLLWIN(wxRemotelyScrolledTreeCtrl::OnScroll)
END_EVENT_TABLE() END_EVENT_TABLE()
@@ -90,7 +90,7 @@ void wxRemotelyScrolledTreeCtrl::HideVScrollbar()
if (!IsKindOf(CLASSINFO(wxGenericTreeCtrl))) if (!IsKindOf(CLASSINFO(wxGenericTreeCtrl)))
#endif #endif
{ {
::ShowScrollBar((HWND) GetHWND(), SB_VERT, FALSE); ::ShowScrollBar((HWND) GetHWND(), SB_VERT, false);
} }
#if USE_GENERIC_TREECTRL #if USE_GENERIC_TREECTRL
else else
@@ -122,7 +122,7 @@ void wxRemotelyScrolledTreeCtrl::SetScrollbars(
if (IsKindOf(CLASSINFO(wxGenericTreeCtrl))) if (IsKindOf(CLASSINFO(wxGenericTreeCtrl)))
{ {
wxGenericTreeCtrl* win = (wxGenericTreeCtrl*) this; wxGenericTreeCtrl* win = (wxGenericTreeCtrl*) this;
win->wxGenericTreeCtrl::SetScrollbars(pixelsPerUnitX, pixelsPerUnitY, noUnitsX, 0, xPos, 0, /* noRefresh */ TRUE); win->wxGenericTreeCtrl::SetScrollbars(pixelsPerUnitX, pixelsPerUnitY, noUnitsX, 0, xPos, 0, /* noRefresh */ true);
wxScrolledWindow* scrolledWindow = GetScrolledWindow(); wxScrolledWindow* scrolledWindow = GetScrolledWindow();
if (scrolledWindow) if (scrolledWindow)
@@ -541,7 +541,7 @@ void wxTreeCompanionWindow::OnScroll(wxScrollWinEvent& event)
return; return;
// TODO: scroll the window physically instead of just refreshing. // TODO: scroll the window physically instead of just refreshing.
Refresh(TRUE); Refresh(true);
} }
void wxTreeCompanionWindow::OnExpand(wxTreeEvent& WXUNUSED(event)) void wxTreeCompanionWindow::OnExpand(wxTreeEvent& WXUNUSED(event))
@@ -674,37 +674,37 @@ void wxSplitterScrolledWindow::OnScroll(wxScrollWinEvent& event)
{ {
// Ensure that events being propagated back up the window hierarchy // Ensure that events being propagated back up the window hierarchy
// don't cause an infinite loop // don't cause an infinite loop
static bool inOnScroll = FALSE; static bool inOnScroll = false;
if (inOnScroll) if (inOnScroll)
{ {
event.Skip(); event.Skip();
return; return;
} }
inOnScroll = TRUE; inOnScroll = true;
int orient = event.GetOrientation(); int orient = event.GetOrientation();
int nScrollInc = CalcScrollInc(event); int nScrollInc = CalcScrollInc(event);
if (nScrollInc == 0) if (nScrollInc == 0)
{ {
inOnScroll = FALSE; inOnScroll = false;
return; return;
} }
if (orient == wxHORIZONTAL) if (orient == wxHORIZONTAL)
{ {
inOnScroll = FALSE; inOnScroll = false;
event.Skip(); event.Skip();
return; return;
#if 0 #if 0
int newPos = m_xScrollPosition + nScrollInc; int newPos = m_xScrollPosition + nScrollInc;
SetScrollPos(wxHORIZONTAL, newPos, TRUE ); SetScrollPos(wxHORIZONTAL, newPos, true );
#endif #endif
} }
else else
{ {
int newPos = m_yScrollPosition + nScrollInc; int newPos = m_yScrollPosition + nScrollInc;
SetScrollPos(wxVERTICAL, newPos, TRUE ); SetScrollPos(wxVERTICAL, newPos, true );
} }
if (orient == wxHORIZONTAL) if (orient == wxHORIZONTAL)
@@ -735,6 +735,6 @@ void wxSplitterScrolledWindow::OnScroll(wxScrollWinEvent& event)
m_targetWindow->Update() ; m_targetWindow->Update() ;
inOnScroll = FALSE; inOnScroll = false;
} }

View File

@@ -43,9 +43,9 @@ bool wxStaticPicture::Create(wxWindow *parent, wxWindowID id,
wxSize size = s ; wxSize size = s ;
if ( bitmap.Ok() ) if ( bitmap.Ok() )
{ {
if ( size.x == -1 ) if ( size.x == wxDefaultSize.x )
size.x = bitmap.GetWidth() ; size.x = bitmap.GetWidth() ;
if ( size.y == -1 ) if ( size.y == wxDefaultSize.y )
size.y = bitmap.GetHeight() ; size.y = bitmap.GetHeight() ;
} }
@@ -63,7 +63,7 @@ bool wxStaticPicture::Create(wxWindow *parent, wxWindowID id,
OriginalImage = Bitmap.ConvertToImage(); OriginalImage = Bitmap.ConvertToImage();
#endif #endif
if ( id == -1 ) if ( id == wxID_ANY )
m_windowId = (int)NewControlId(); m_windowId = (int)NewControlId();
else else
m_windowId = id; m_windowId = id;