Compile fixes for samples and dialoged,
small optical improvements, distrib changes, link fix for treectrl git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3262 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -116,13 +116,10 @@ copy *.cpp \wxmsw_dist\wxMSW\src\common
|
|||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
cd html
|
cd html
|
||||||
md \wxgtk_dist\wxGTK\src\html
|
md \wxmsw_dist\wxMSW\src\html
|
||||||
copy *.cpp \wxgtk_dist\wxGTK\src\html
|
copy *.cpp \wxmsw_dist\wxMSW\src\html
|
||||||
copy *.h \wxgtk_dist\wxGTK\src\html
|
copy *.h \wxmsw_dist\wxMSW\src\html
|
||||||
cd bitmaps
|
cd ..
|
||||||
md \wxgtk_dist\wxGTK\src\html\bitmaps
|
|
||||||
copy *.xpm \wxgtk_dist\wxGTK\src\html\bitmaps
|
|
||||||
cd ..\..
|
|
||||||
|
|
||||||
cd generic
|
cd generic
|
||||||
md \wxmsw_dist\wxMSW\src\generic
|
md \wxmsw_dist\wxMSW\src\generic
|
||||||
|
@@ -112,12 +112,10 @@ class wxMenu : public wxEvtHandler
|
|||||||
DECLARE_DYNAMIC_CLASS(wxMenu)
|
DECLARE_DYNAMIC_CLASS(wxMenu)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
#ifdef WXWIN_COMPATIBILITY
|
|
||||||
wxMenu( const wxString& title, const wxFunction func)
|
wxMenu( const wxString& title, const wxFunction func)
|
||||||
{
|
{
|
||||||
Init(title, 0, func);
|
Init(title, 0, func);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
wxMenu( long style )
|
wxMenu( long style )
|
||||||
{
|
{
|
||||||
Init( wxEmptyString, style );
|
Init( wxEmptyString, style );
|
||||||
@@ -176,15 +174,16 @@ public:
|
|||||||
|
|
||||||
wxMenuItem *FindItemForId( int id ) const { return FindItem( id ); }
|
wxMenuItem *FindItemForId( int id ) const { return FindItem( id ); }
|
||||||
|
|
||||||
#ifdef WXWIN_COMPATIBILITY
|
|
||||||
wxFunction GetCallback() const { return m_callback; }
|
wxFunction GetCallback() const { return m_callback; }
|
||||||
void Callback(const wxFunction func) { m_callback = func; }
|
void Callback(const wxFunction func) { m_callback = func; }
|
||||||
|
wxFunction m_callback;
|
||||||
|
|
||||||
|
#ifdef WXWIN_COMPATIBILITY
|
||||||
|
|
||||||
// compatibility: these functions are deprecated
|
// compatibility: these functions are deprecated
|
||||||
bool Enabled(int id) const { return IsEnabled(id); }
|
bool Enabled(int id) const { return IsEnabled(id); }
|
||||||
bool Checked(int id) const { return IsChecked(id); }
|
bool Checked(int id) const { return IsChecked(id); }
|
||||||
|
|
||||||
wxFunction m_callback;
|
|
||||||
#endif // WXWIN_COMPATIBILITY
|
#endif // WXWIN_COMPATIBILITY
|
||||||
|
|
||||||
// implementation
|
// implementation
|
||||||
@@ -204,11 +203,8 @@ public:
|
|||||||
private:
|
private:
|
||||||
// common code for both constructors:
|
// common code for both constructors:
|
||||||
void Init( const wxString& title,
|
void Init( const wxString& title,
|
||||||
long style
|
long style,
|
||||||
#ifdef WXWIN_COMPATIBILITY
|
const wxFunction func = (wxFunction) NULL );
|
||||||
, const wxFunction func = (wxFunction) NULL
|
|
||||||
#endif
|
|
||||||
);
|
|
||||||
|
|
||||||
wxString m_title;
|
wxString m_title;
|
||||||
wxList m_items;
|
wxList m_items;
|
||||||
|
@@ -112,12 +112,10 @@ class wxMenu : public wxEvtHandler
|
|||||||
DECLARE_DYNAMIC_CLASS(wxMenu)
|
DECLARE_DYNAMIC_CLASS(wxMenu)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
#ifdef WXWIN_COMPATIBILITY
|
|
||||||
wxMenu( const wxString& title, const wxFunction func)
|
wxMenu( const wxString& title, const wxFunction func)
|
||||||
{
|
{
|
||||||
Init(title, 0, func);
|
Init(title, 0, func);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
wxMenu( long style )
|
wxMenu( long style )
|
||||||
{
|
{
|
||||||
Init( wxEmptyString, style );
|
Init( wxEmptyString, style );
|
||||||
@@ -176,15 +174,16 @@ public:
|
|||||||
|
|
||||||
wxMenuItem *FindItemForId( int id ) const { return FindItem( id ); }
|
wxMenuItem *FindItemForId( int id ) const { return FindItem( id ); }
|
||||||
|
|
||||||
#ifdef WXWIN_COMPATIBILITY
|
|
||||||
wxFunction GetCallback() const { return m_callback; }
|
wxFunction GetCallback() const { return m_callback; }
|
||||||
void Callback(const wxFunction func) { m_callback = func; }
|
void Callback(const wxFunction func) { m_callback = func; }
|
||||||
|
wxFunction m_callback;
|
||||||
|
|
||||||
|
#ifdef WXWIN_COMPATIBILITY
|
||||||
|
|
||||||
// compatibility: these functions are deprecated
|
// compatibility: these functions are deprecated
|
||||||
bool Enabled(int id) const { return IsEnabled(id); }
|
bool Enabled(int id) const { return IsEnabled(id); }
|
||||||
bool Checked(int id) const { return IsChecked(id); }
|
bool Checked(int id) const { return IsChecked(id); }
|
||||||
|
|
||||||
wxFunction m_callback;
|
|
||||||
#endif // WXWIN_COMPATIBILITY
|
#endif // WXWIN_COMPATIBILITY
|
||||||
|
|
||||||
// implementation
|
// implementation
|
||||||
@@ -204,11 +203,8 @@ public:
|
|||||||
private:
|
private:
|
||||||
// common code for both constructors:
|
// common code for both constructors:
|
||||||
void Init( const wxString& title,
|
void Init( const wxString& title,
|
||||||
long style
|
long style,
|
||||||
#ifdef WXWIN_COMPATIBILITY
|
const wxFunction func = (wxFunction) NULL );
|
||||||
, const wxFunction func = (wxFunction) NULL
|
|
||||||
#endif
|
|
||||||
);
|
|
||||||
|
|
||||||
wxString m_title;
|
wxString m_title;
|
||||||
wxList m_items;
|
wxList m_items;
|
||||||
|
@@ -37,13 +37,16 @@ class WXDLLEXPORT wxMenu : public wxEvtHandler
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
// ctors & dtor
|
// ctors & dtor
|
||||||
#ifdef WXWIN_COMPATIBILITY
|
|
||||||
wxMenu(const wxString& title,
|
wxMenu(const wxString& title,
|
||||||
const wxFunction func)
|
const wxFunction func)
|
||||||
{
|
{
|
||||||
Init(title, func);
|
Init(title, func);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
wxMenu( long WXUNUSED(style) )
|
||||||
|
{
|
||||||
|
Init( wxEmptyString );
|
||||||
|
}
|
||||||
|
|
||||||
wxMenu(const wxString& title = wxEmptyString, long WXUNUSED(style) = 0)
|
wxMenu(const wxString& title = wxEmptyString, long WXUNUSED(style) = 0)
|
||||||
{
|
{
|
||||||
@@ -143,24 +146,20 @@ public:
|
|||||||
size_t CopyAccels(wxAcceleratorEntry *accels) const;
|
size_t CopyAccels(wxAcceleratorEntry *accels) const;
|
||||||
#endif // wxUSE_ACCEL
|
#endif // wxUSE_ACCEL
|
||||||
|
|
||||||
#ifdef WXWIN_COMPATIBILITY
|
wxFunction GetCallback() const { return m_callback; }
|
||||||
void Callback(const wxFunction func) { m_callback = func; }
|
void Callback(const wxFunction func) { m_callback = func; }
|
||||||
|
wxFunction m_callback;
|
||||||
|
|
||||||
|
#ifdef WXWIN_COMPATIBILITY
|
||||||
// compatibility: these functions are deprecated
|
// compatibility: these functions are deprecated
|
||||||
bool Enabled(int id) const { return IsEnabled(id); }
|
bool Enabled(int id) const { return IsEnabled(id); }
|
||||||
bool Checked(int id) const { return IsChecked(id); }
|
bool Checked(int id) const { return IsChecked(id); }
|
||||||
|
|
||||||
private:
|
|
||||||
wxFunction m_callback;
|
|
||||||
#endif // WXWIN_COMPATIBILITY
|
#endif // WXWIN_COMPATIBILITY
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// common part of all ctors
|
// common part of all ctors
|
||||||
void Init(const wxString& title
|
void Init(const wxString& title, const wxFunction func = NULL );
|
||||||
#ifdef WXWIN_COMPATIBILITY
|
|
||||||
, const wxFunction func = NULL
|
|
||||||
#endif
|
|
||||||
);
|
|
||||||
|
|
||||||
bool m_doBreak;
|
bool m_doBreak;
|
||||||
|
|
||||||
|
@@ -433,16 +433,16 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h )
|
|||||||
m_notebook->AddPage(panel, "wxRadioBox", FALSE, Image_Radio);
|
m_notebook->AddPage(panel, "wxRadioBox", FALSE, Image_Radio);
|
||||||
|
|
||||||
panel = new wxPanel(m_notebook);
|
panel = new wxPanel(m_notebook);
|
||||||
(void)new wxStaticBox( panel, -1, "wxGauge and wxSlider", wxPoint(10,10), wxSize(180,130) );
|
(void)new wxStaticBox( panel, -1, "wxGauge and wxSlider", wxPoint(10,10), wxSize(200,130) );
|
||||||
m_gauge = new wxGauge( panel, -1, 200, wxPoint(18,50), wxSize(155, 30) );
|
m_gauge = new wxGauge( panel, -1, 200, wxPoint(18,50), wxSize(155, 30) );
|
||||||
m_slider = new wxSlider( panel, ID_SLIDER, 0, 0, 200, wxPoint(18,90), wxSize(155,-1), wxSL_LABELS );
|
m_slider = new wxSlider( panel, ID_SLIDER, 0, 0, 200, wxPoint(18,90), wxSize(155,-1), wxSL_LABELS );
|
||||||
(void)new wxStaticBox( panel, -1, "Explanation", wxPoint(200,10), wxSize(290,130) );
|
(void)new wxStaticBox( panel, -1, "Explanation", wxPoint(220,10), wxSize(270,130) );
|
||||||
#ifdef __WXMOTIF__
|
#ifdef __WXMOTIF__
|
||||||
// No wrapping text in wxStaticText yet :-(
|
// No wrapping text in wxStaticText yet :-(
|
||||||
(void)new wxStaticText( panel, -1,
|
(void)new wxStaticText( panel, -1,
|
||||||
"Drag the slider!",
|
"Drag the slider!",
|
||||||
wxPoint(208,30),
|
wxPoint(228,30),
|
||||||
wxSize(210, -1)
|
wxSize(230, -1)
|
||||||
);
|
);
|
||||||
#else
|
#else
|
||||||
(void)new wxStaticText( panel, -1,
|
(void)new wxStaticText( panel, -1,
|
||||||
@@ -452,8 +452,8 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h )
|
|||||||
"\n"
|
"\n"
|
||||||
"This is also supposed to demonstrate how\n"
|
"This is also supposed to demonstrate how\n"
|
||||||
"to use static controls.\n",
|
"to use static controls.\n",
|
||||||
wxPoint(208,25),
|
wxPoint(228,25),
|
||||||
wxSize(250, 110)
|
wxSize(230, 110)
|
||||||
);
|
);
|
||||||
#endif
|
#endif
|
||||||
m_spintext = new wxTextCtrl( panel, -1, "0", wxPoint(20,160), wxSize(80,-1) );
|
m_spintext = new wxTextCtrl( panel, -1, "0", wxPoint(20,160), wxSize(80,-1) );
|
||||||
|
@@ -106,7 +106,7 @@ wxProgressDialog::wxProgressDialog(wxString const &title,
|
|||||||
// VA cannot resolve this so:
|
// VA cannot resolve this so:
|
||||||
dc.GetTextExtent(message, &widthText, NULL, NULL, NULL, NULL, FALSE);
|
dc.GetTextExtent(message, &widthText, NULL, NULL, NULL, NULL, FALSE);
|
||||||
#else
|
#else
|
||||||
dc.GetTextExtent(message, &widthText, NULL);
|
dc.GetTextExtent(message, &widthText, (long*)NULL);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
m_msg = new wxStaticText(this, -1, message);
|
m_msg = new wxStaticText(this, -1, message);
|
||||||
@@ -143,7 +143,7 @@ wxProgressDialog::wxProgressDialog(wxString const &title,
|
|||||||
m_gauge = (wxGauge *)NULL;
|
m_gauge = (wxGauge *)NULL;
|
||||||
|
|
||||||
// create the estimated/remaining/total time zones if requested
|
// create the estimated/remaining/total time zones if requested
|
||||||
m_elapsed = m_estimated = m_remaining = NULL;
|
m_elapsed = m_estimated = m_remaining = (wxStaticText*)NULL;
|
||||||
|
|
||||||
int nTimeLabels = 0;
|
int nTimeLabels = 0;
|
||||||
if ( style & wxPD_ELAPSED_TIME )
|
if ( style & wxPD_ELAPSED_TIME )
|
||||||
@@ -224,6 +224,9 @@ wxProgressDialog::wxProgressDialog(wxString const &title,
|
|||||||
|
|
||||||
Show(TRUE);
|
Show(TRUE);
|
||||||
Enable(TRUE); // enable this window
|
Enable(TRUE); // enable this window
|
||||||
|
|
||||||
|
// Update the display (especially on X, GTK)
|
||||||
|
wxYield();
|
||||||
}
|
}
|
||||||
|
|
||||||
wxStaticText *wxProgressDialog::CreateLabel(const wxString& text,
|
wxStaticText *wxProgressDialog::CreateLabel(const wxString& text,
|
||||||
|
@@ -638,10 +638,8 @@ IMPLEMENT_DYNAMIC_CLASS(wxMenu,wxEvtHandler)
|
|||||||
|
|
||||||
void
|
void
|
||||||
wxMenu::Init( const wxString& title,
|
wxMenu::Init( const wxString& title,
|
||||||
long style
|
long style,
|
||||||
#ifdef WXWIN_COMPATIBILITY
|
const wxFunction func
|
||||||
, const wxFunction func
|
|
||||||
#endif
|
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
m_title = title;
|
m_title = title;
|
||||||
@@ -657,9 +655,7 @@ wxMenu::Init( const wxString& title,
|
|||||||
m_menu = gtk_menu_new(); // Do not show!
|
m_menu = gtk_menu_new(); // Do not show!
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef WXWIN_COMPATIBILITY
|
|
||||||
m_callback = func;
|
m_callback = func;
|
||||||
#endif
|
|
||||||
|
|
||||||
m_eventHandler = this;
|
m_eventHandler = this;
|
||||||
m_clientData = (void*) NULL;
|
m_clientData = (void*) NULL;
|
||||||
|
@@ -638,10 +638,8 @@ IMPLEMENT_DYNAMIC_CLASS(wxMenu,wxEvtHandler)
|
|||||||
|
|
||||||
void
|
void
|
||||||
wxMenu::Init( const wxString& title,
|
wxMenu::Init( const wxString& title,
|
||||||
long style
|
long style,
|
||||||
#ifdef WXWIN_COMPATIBILITY
|
const wxFunction func
|
||||||
, const wxFunction func
|
|
||||||
#endif
|
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
m_title = title;
|
m_title = title;
|
||||||
@@ -657,9 +655,7 @@ wxMenu::Init( const wxString& title,
|
|||||||
m_menu = gtk_menu_new(); // Do not show!
|
m_menu = gtk_menu_new(); // Do not show!
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef WXWIN_COMPATIBILITY
|
|
||||||
m_callback = func;
|
m_callback = func;
|
||||||
#endif
|
|
||||||
|
|
||||||
m_eventHandler = this;
|
m_eventHandler = this;
|
||||||
m_clientData = (void*) NULL;
|
m_clientData = (void*) NULL;
|
||||||
|
@@ -78,11 +78,7 @@ static const int idMenuTitle = -2;
|
|||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
// Construct a menu with optional title (then use append)
|
// Construct a menu with optional title (then use append)
|
||||||
void wxMenu::Init(const wxString& title
|
void wxMenu::Init(const wxString& title, const wxFunction func )
|
||||||
#ifdef WXWIN_COMPATIBILITY
|
|
||||||
, const wxFunction func
|
|
||||||
#endif
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
m_title = title;
|
m_title = title;
|
||||||
m_parent = NULL;
|
m_parent = NULL;
|
||||||
@@ -102,9 +98,7 @@ void wxMenu::Init(const wxString& title
|
|||||||
AppendSeparator() ;
|
AppendSeparator() ;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if WXWIN_COMPATIBILITY
|
|
||||||
Callback(func);
|
Callback(func);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// The wxWindow destructor will take care of deleting the submenus.
|
// The wxWindow destructor will take care of deleting the submenus.
|
||||||
@@ -537,14 +531,12 @@ bool wxMenu::ProcessCommand(wxCommandEvent & event)
|
|||||||
{
|
{
|
||||||
bool processed = FALSE;
|
bool processed = FALSE;
|
||||||
|
|
||||||
#if WXWIN_COMPATIBILITY
|
|
||||||
// Try a callback
|
// Try a callback
|
||||||
if (m_callback)
|
if (m_callback)
|
||||||
{
|
{
|
||||||
(void)(*(m_callback))(*this, event);
|
(void)(*(m_callback))(*this, event);
|
||||||
processed = TRUE;
|
processed = TRUE;
|
||||||
}
|
}
|
||||||
#endif // WXWIN_COMPATIBILITY
|
|
||||||
|
|
||||||
// Try the menu's event handler
|
// Try the menu's event handler
|
||||||
if ( !processed && GetEventHandler())
|
if ( !processed && GetEventHandler())
|
||||||
|
@@ -345,9 +345,8 @@ void wxTreeCtrl::SetStateImageList(wxImageList *imageList)
|
|||||||
SetAnyImageList(m_imageListState = imageList, TVSIL_STATE);
|
SetAnyImageList(m_imageListState = imageList, TVSIL_STATE);
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t wxTreeCtrl::GetChildrenCount(const wxTreeItemId& item,
|
// internal class for counting tree items
|
||||||
bool recursively) const
|
|
||||||
{
|
|
||||||
class TraverseCounter : public wxTreeTraversal
|
class TraverseCounter : public wxTreeTraversal
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -372,7 +371,13 @@ size_t wxTreeCtrl::GetChildrenCount(const wxTreeItemId& item,
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
size_t m_count;
|
size_t m_count;
|
||||||
} counter(this, item, recursively);
|
};
|
||||||
|
|
||||||
|
|
||||||
|
size_t wxTreeCtrl::GetChildrenCount(const wxTreeItemId& item,
|
||||||
|
bool recursively) const
|
||||||
|
{
|
||||||
|
TraverseCounter counter(this, item, recursively);
|
||||||
|
|
||||||
return counter.GetCount();
|
return counter.GetCount();
|
||||||
}
|
}
|
||||||
@@ -645,8 +650,8 @@ void wxTreeCtrl::SetItemCheck(const wxTreeItemId& item, bool check)
|
|||||||
DoSetItem(&tvItem);
|
DoSetItem(&tvItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t wxTreeCtrl::GetSelections(wxArrayTreeItemIds& selections) const
|
// internal class for getting the selected
|
||||||
{
|
|
||||||
class TraverseSelections : public wxTreeTraversal
|
class TraverseSelections : public wxTreeTraversal
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -671,7 +676,11 @@ size_t wxTreeCtrl::GetSelections(wxArrayTreeItemIds& selections) const
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
wxArrayTreeItemIds& m_selections;
|
wxArrayTreeItemIds& m_selections;
|
||||||
} selector(this, selections);
|
};
|
||||||
|
|
||||||
|
size_t wxTreeCtrl::GetSelections(wxArrayTreeItemIds& selections) const
|
||||||
|
{
|
||||||
|
TraverseSelections selector(this, selections);
|
||||||
|
|
||||||
return selections.GetCount();
|
return selections.GetCount();
|
||||||
}
|
}
|
||||||
|
@@ -2268,19 +2268,10 @@ void ObjectMenuProc(wxMenu& menu, wxCommandEvent& event)
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if defined(__WXGTK__) || defined(__WXMOTIF__) // I don't dare to delete it...
|
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(EditorToolBar, wxToolBar)
|
BEGIN_EVENT_TABLE(EditorToolBar, wxToolBar)
|
||||||
|
// EVT_PAINT(EditorToolBar::OnPaint)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(EditorToolBar, wxToolBar)
|
|
||||||
EVT_PAINT(EditorToolBar::OnPaint)
|
|
||||||
END_EVENT_TABLE()
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
EditorToolBar::EditorToolBar(wxFrame *frame, const wxPoint& pos, const wxSize& size,
|
EditorToolBar::EditorToolBar(wxFrame *frame, const wxPoint& pos, const wxSize& size,
|
||||||
long style):
|
long style):
|
||||||
wxToolBar(frame, -1, pos, size, style)
|
wxToolBar(frame, -1, pos, size, style)
|
||||||
|
Reference in New Issue
Block a user