Typos in documentation

list and tree ctrl now actually set the text themselves
    and no longer crash
  various compile fixes


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3152 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
1999-07-26 16:06:20 +00:00
parent 15a2076a46
commit 5f1ea0eeda
8 changed files with 59 additions and 25 deletions

View File

@@ -899,6 +899,9 @@ wxListTextCtrl::wxListTextCtrl( wxWindow *parent, const wxWindowID id,
m_res = res;
m_accept = accept;
m_owner = owner;
(*m_accept) = FALSE;
(*m_res) = "";
m_startValue = value;
}
void wxListTextCtrl::OnChar( wxKeyEvent &event )
@@ -907,15 +910,14 @@ void wxListTextCtrl::OnChar( wxKeyEvent &event )
{
(*m_accept) = TRUE;
(*m_res) = GetValue();
m_owner->OnRenameAccept();
if (!wxPendingDelete.Member(this)) wxPendingDelete.Append(this);
m_owner->SetFocus();
return;
}
if (event.m_keyCode == WXK_ESCAPE)
{
(*m_accept) = FALSE;
(*m_res) = "";
if (!wxPendingDelete.Member(this)) wxPendingDelete.Append(this);
m_owner->SetFocus();
return;
}
event.Skip();
@@ -923,10 +925,12 @@ void wxListTextCtrl::OnChar( wxKeyEvent &event )
void wxListTextCtrl::OnKillFocus( wxFocusEvent &WXUNUSED(event) )
{
(*m_accept) = FALSE;
(*m_res) = "";
if (!wxPendingDelete.Member(this)) wxPendingDelete.Append(this);
return;
if (wxPendingDelete.Member(this)) return;
wxPendingDelete.Append(this);
if ((*m_accept) && ((*m_res) != m_startValue))
m_owner->OnRenameAccept();
}
//-----------------------------------------------------------------------------
@@ -1139,7 +1143,7 @@ void wxListMainWindow::DeleteLine( wxListLineData *line )
/* *** */
wxTextCtrl *wxListMainWindow::EditLabel( long item )
void wxListMainWindow::EditLabel( long item )
{
wxNode *node = m_lines.Nth( item );
wxCHECK_MSG( node, (wxTextCtrl *)NULL, _T("wrong index in wxListCtrl::Edit()") );
@@ -1153,7 +1157,7 @@ wxTextCtrl *wxListMainWindow::EditLabel( long item )
GetParent()->GetEventHandler()->ProcessEvent( le );
if (!le.IsAllowed())
return (wxTextCtrl *)NULL;
return;
wxString s;
m_currentEdit->GetText( 0, s );
@@ -1171,8 +1175,6 @@ wxTextCtrl *wxListMainWindow::EditLabel( long item )
wxListTextCtrl *text = new wxListTextCtrl(
this, -1, &m_renameAccept, &m_renameRes, this, s, wxPoint(x-4,y-4), wxSize(w+11,h+8) );
text->SetFocus();
return text;
}
void wxListMainWindow::OnRenameTimer()
@@ -1193,7 +1195,11 @@ void wxListMainWindow::OnRenameAccept()
if (!le.IsAllowed()) return;
/* DO CHANGE LABEL */
wxListItem info;
info.m_mask = wxLIST_MASK_TEXT;
info.m_itemId = le.m_itemIndex;
info.m_text = m_renameRes;
SetItem( info );
}
void wxListMainWindow::OnMouse( wxMouseEvent &event )

View File

@@ -192,6 +192,9 @@ wxTreeTextCtrl::wxTreeTextCtrl( wxWindow *parent, const wxWindowID id,
m_res = res;
m_accept = accept;
m_owner = owner;
(*m_accept) = FALSE;
(*m_res) = "";
m_startValue = value;
}
void wxTreeTextCtrl::OnChar( wxKeyEvent &event )
@@ -200,15 +203,14 @@ void wxTreeTextCtrl::OnChar( wxKeyEvent &event )
{
(*m_accept) = TRUE;
(*m_res) = GetValue();
m_owner->OnRenameAccept();
if (!wxPendingDelete.Member(this)) wxPendingDelete.Append(this);
m_owner->SetFocus();
return;
}
if (event.m_keyCode == WXK_ESCAPE)
{
(*m_accept) = FALSE;
(*m_res) = "";
if (!wxPendingDelete.Member(this)) wxPendingDelete.Append(this);
m_owner->SetFocus();
return;
}
event.Skip();
@@ -216,9 +218,12 @@ void wxTreeTextCtrl::OnChar( wxKeyEvent &event )
void wxTreeTextCtrl::OnKillFocus( wxFocusEvent &WXUNUSED(event) )
{
(*m_accept) = FALSE;
(*m_res) = "";
if (!wxPendingDelete.Member(this)) wxPendingDelete.Append(this);
if (wxPendingDelete.Member(this)) return;
wxPendingDelete.Append(this);
if ((*m_accept) && ((*m_res) != m_startValue))
m_owner->OnRenameAccept();
}
#define PIXELS_PER_UNIT 10
@@ -1801,6 +1806,21 @@ void wxTreeCtrl::Edit( const wxTreeItemId& item )
int y = m_currentEdit->GetY();
int w = m_currentEdit->GetWidth();
int h = m_currentEdit->GetHeight();
int image_h = 0;
int image_w = 0;
if ((m_currentEdit->IsExpanded()) && (m_currentEdit->GetSelectedImage() != -1))
{
m_imageListNormal->GetSize( m_currentEdit->GetSelectedImage(), image_w, image_h );
image_w += 4;
}
else if (m_currentEdit->GetImage() != -1)
{
m_imageListNormal->GetSize( m_currentEdit->GetImage(), image_w, image_h );
image_w += 4;
}
x += image_w;
w -= image_w + 4; // I don't know why +4 is needed
wxClientDC dc(this);
PrepareDC( dc );
@@ -1827,7 +1847,7 @@ void wxTreeCtrl::OnRenameAccept()
if (!le.IsAllowed()) return;
/* DO CHANGE LABEL */
SetItemText( m_currentEdit, m_renameRes );
}
void wxTreeCtrl::OnMouse( wxMouseEvent &event )

View File

@@ -62,6 +62,10 @@ void GSocket_Cleanup()
{
}
void GSocket_Done()
{
}
/* Constructors / Destructors */
GSocket *GSocket_new()