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

@@ -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,11 +638,9 @@ 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;
m_items.DeleteContents( TRUE );
@@ -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,11 +638,9 @@ 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;
m_items.DeleteContents( TRUE );
@@ -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,15 +345,14 @@ 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)
bool recursively)
: wxTreeTraversal(tree)
{
m_count = 0;
@@ -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();
}