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:
Robert Roebling
1999-08-04 13:01:20 +00:00
parent 2356708db3
commit 33961d59b0
11 changed files with 65 additions and 90 deletions

View File

@@ -116,13 +116,10 @@ copy *.cpp \wxmsw_dist\wxMSW\src\common
cd ..
cd html
md \wxgtk_dist\wxGTK\src\html
copy *.cpp \wxgtk_dist\wxGTK\src\html
copy *.h \wxgtk_dist\wxGTK\src\html
cd bitmaps
md \wxgtk_dist\wxGTK\src\html\bitmaps
copy *.xpm \wxgtk_dist\wxGTK\src\html\bitmaps
cd ..\..
md \wxmsw_dist\wxMSW\src\html
copy *.cpp \wxmsw_dist\wxMSW\src\html
copy *.h \wxmsw_dist\wxMSW\src\html
cd ..
cd generic
md \wxmsw_dist\wxMSW\src\generic

View File

@@ -112,12 +112,10 @@ class wxMenu : public wxEvtHandler
DECLARE_DYNAMIC_CLASS(wxMenu)
public:
#ifdef WXWIN_COMPATIBILITY
wxMenu( const wxString& title, const wxFunction func)
{
Init(title, 0, func);
}
#endif
wxMenu( long style )
{
Init( wxEmptyString, style );
@@ -176,15 +174,16 @@ public:
wxMenuItem *FindItemForId( int id ) const { return FindItem( id ); }
#ifdef WXWIN_COMPATIBILITY
wxFunction GetCallback() const { return m_callback; }
void Callback(const wxFunction func) { m_callback = func; }
wxFunction m_callback;
#ifdef WXWIN_COMPATIBILITY
// compatibility: these functions are deprecated
bool Enabled(int id) const { return IsEnabled(id); }
bool Checked(int id) const { return IsChecked(id); }
wxFunction m_callback;
#endif // WXWIN_COMPATIBILITY
// implementation
@@ -204,11 +203,8 @@ public:
private:
// common code for both constructors:
void Init( const wxString& title,
long style
#ifdef WXWIN_COMPATIBILITY
, const wxFunction func = (wxFunction) NULL
#endif
);
long style,
const wxFunction func = (wxFunction) NULL );
wxString m_title;
wxList m_items;

View File

@@ -112,12 +112,10 @@ class wxMenu : public wxEvtHandler
DECLARE_DYNAMIC_CLASS(wxMenu)
public:
#ifdef WXWIN_COMPATIBILITY
wxMenu( const wxString& title, const wxFunction func)
{
Init(title, 0, func);
}
#endif
wxMenu( long style )
{
Init( wxEmptyString, style );
@@ -176,15 +174,16 @@ public:
wxMenuItem *FindItemForId( int id ) const { return FindItem( id ); }
#ifdef WXWIN_COMPATIBILITY
wxFunction GetCallback() const { return m_callback; }
void Callback(const wxFunction func) { m_callback = func; }
wxFunction m_callback;
#ifdef WXWIN_COMPATIBILITY
// compatibility: these functions are deprecated
bool Enabled(int id) const { return IsEnabled(id); }
bool Checked(int id) const { return IsChecked(id); }
wxFunction m_callback;
#endif // WXWIN_COMPATIBILITY
// implementation
@@ -204,11 +203,8 @@ public:
private:
// common code for both constructors:
void Init( const wxString& title,
long style
#ifdef WXWIN_COMPATIBILITY
, const wxFunction func = (wxFunction) NULL
#endif
);
long style,
const wxFunction func = (wxFunction) NULL );
wxString m_title;
wxList m_items;

View File

@@ -37,13 +37,16 @@ class WXDLLEXPORT wxMenu : public wxEvtHandler
public:
// ctors & dtor
#ifdef WXWIN_COMPATIBILITY
wxMenu(const wxString& title,
const wxFunction func)
{
Init(title, func);
}
#endif
wxMenu( long WXUNUSED(style) )
{
Init( wxEmptyString );
}
wxMenu(const wxString& title = wxEmptyString, long WXUNUSED(style) = 0)
{
@@ -143,24 +146,20 @@ public:
size_t CopyAccels(wxAcceleratorEntry *accels) const;
#endif // wxUSE_ACCEL
#ifdef WXWIN_COMPATIBILITY
wxFunction GetCallback() const { return m_callback; }
void Callback(const wxFunction func) { m_callback = func; }
wxFunction m_callback;
#ifdef WXWIN_COMPATIBILITY
// compatibility: these functions are deprecated
bool Enabled(int id) const { return IsEnabled(id); }
bool Checked(int id) const { return IsChecked(id); }
private:
wxFunction m_callback;
#endif // WXWIN_COMPATIBILITY
private:
// common part of all ctors
void Init(const wxString& title
#ifdef WXWIN_COMPATIBILITY
, const wxFunction func = NULL
#endif
);
void Init(const wxString& title, const wxFunction func = NULL );
bool m_doBreak;

View File

@@ -433,16 +433,16 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h )
m_notebook->AddPage(panel, "wxRadioBox", FALSE, Image_Radio);
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_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__
// No wrapping text in wxStaticText yet :-(
(void)new wxStaticText( panel, -1,
"Drag the slider!",
wxPoint(208,30),
wxSize(210, -1)
wxPoint(228,30),
wxSize(230, -1)
);
#else
(void)new wxStaticText( panel, -1,
@@ -452,8 +452,8 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h )
"\n"
"This is also supposed to demonstrate how\n"
"to use static controls.\n",
wxPoint(208,25),
wxSize(250, 110)
wxPoint(228,25),
wxSize(230, 110)
);
#endif
m_spintext = new wxTextCtrl( panel, -1, "0", wxPoint(20,160), wxSize(80,-1) );

View File

@@ -106,7 +106,7 @@ wxProgressDialog::wxProgressDialog(wxString const &title,
// VA cannot resolve this so:
dc.GetTextExtent(message, &widthText, NULL, NULL, NULL, NULL, FALSE);
#else
dc.GetTextExtent(message, &widthText, NULL);
dc.GetTextExtent(message, &widthText, (long*)NULL);
#endif
m_msg = new wxStaticText(this, -1, message);
@@ -143,7 +143,7 @@ wxProgressDialog::wxProgressDialog(wxString const &title,
m_gauge = (wxGauge *)NULL;
// 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;
if ( style & wxPD_ELAPSED_TIME )
@@ -224,6 +224,9 @@ wxProgressDialog::wxProgressDialog(wxString const &title,
Show(TRUE);
Enable(TRUE); // enable this window
// Update the display (especially on X, GTK)
wxYield();
}
wxStaticText *wxProgressDialog::CreateLabel(const wxString& text,

View File

@@ -638,10 +638,8 @@ IMPLEMENT_DYNAMIC_CLASS(wxMenu,wxEvtHandler)
void
wxMenu::Init( const wxString& title,
long style
#ifdef WXWIN_COMPATIBILITY
, const wxFunction func
#endif
long style,
const wxFunction func
)
{
m_title = title;
@@ -657,9 +655,7 @@ wxMenu::Init( const wxString& title,
m_menu = gtk_menu_new(); // Do not show!
#endif
#ifdef WXWIN_COMPATIBILITY
m_callback = func;
#endif
m_eventHandler = this;
m_clientData = (void*) NULL;

View File

@@ -638,10 +638,8 @@ IMPLEMENT_DYNAMIC_CLASS(wxMenu,wxEvtHandler)
void
wxMenu::Init( const wxString& title,
long style
#ifdef WXWIN_COMPATIBILITY
, const wxFunction func
#endif
long style,
const wxFunction func
)
{
m_title = title;
@@ -657,9 +655,7 @@ wxMenu::Init( const wxString& title,
m_menu = gtk_menu_new(); // Do not show!
#endif
#ifdef WXWIN_COMPATIBILITY
m_callback = func;
#endif
m_eventHandler = this;
m_clientData = (void*) NULL;

View File

@@ -78,11 +78,7 @@ static const int idMenuTitle = -2;
// ---------------------------------------------------------------------------
// Construct a menu with optional title (then use append)
void wxMenu::Init(const wxString& title
#ifdef WXWIN_COMPATIBILITY
, const wxFunction func
#endif
)
void wxMenu::Init(const wxString& title, const wxFunction func )
{
m_title = title;
m_parent = NULL;
@@ -102,9 +98,7 @@ void wxMenu::Init(const wxString& title
AppendSeparator() ;
}
#if WXWIN_COMPATIBILITY
Callback(func);
#endif
}
// The wxWindow destructor will take care of deleting the submenus.
@@ -537,14 +531,12 @@ bool wxMenu::ProcessCommand(wxCommandEvent & event)
{
bool processed = FALSE;
#if WXWIN_COMPATIBILITY
// Try a callback
if (m_callback)
{
(void)(*(m_callback))(*this, event);
processed = TRUE;
}
#endif // WXWIN_COMPATIBILITY
// Try the menu's event handler
if ( !processed && GetEventHandler())

View File

@@ -345,12 +345,11 @@ void wxTreeCtrl::SetStateImageList(wxImageList *imageList)
SetAnyImageList(m_imageListState = imageList, TVSIL_STATE);
}
size_t wxTreeCtrl::GetChildrenCount(const wxTreeItemId& item,
bool recursively) const
// internal class for counting tree items
class TraverseCounter : public wxTreeTraversal
{
class TraverseCounter : public wxTreeTraversal
{
public:
public:
TraverseCounter(const wxTreeCtrl *tree,
const wxTreeItemId& root,
bool recursively)
@@ -370,9 +369,15 @@ size_t wxTreeCtrl::GetChildrenCount(const wxTreeItemId& item,
size_t GetCount() const { return m_count; }
private:
private:
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();
}
@@ -645,11 +650,11 @@ void wxTreeCtrl::SetItemCheck(const wxTreeItemId& item, bool check)
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:
TraverseSelections(const wxTreeCtrl *tree,
wxArrayTreeItemIds& selections)
: wxTreeTraversal(tree), m_selections(selections)
@@ -669,9 +674,13 @@ size_t wxTreeCtrl::GetSelections(wxArrayTreeItemIds& selections) const
return TRUE;
}
private:
private:
wxArrayTreeItemIds& m_selections;
} selector(this, selections);
};
size_t wxTreeCtrl::GetSelections(wxArrayTreeItemIds& selections) const
{
TraverseSelections selector(this, selections);
return selections.GetCount();
}

View File

@@ -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)
// EVT_PAINT(EditorToolBar::OnPaint)
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,
long style):
wxToolBar(frame, -1, pos, size, style)