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

@@ -174,6 +174,7 @@
\input sashwin.tex \input sashwin.tex
\input screendc.tex \input screendc.tex
\input scrolbar.tex \input scrolbar.tex
\input scrlwevt.tex
\input scrolevt.tex \input scrolevt.tex
\input scrolwin.tex \input scrolwin.tex
\input sngchdlg.tex \input sngchdlg.tex

View File

@@ -1393,9 +1393,9 @@ void MyWindow::OnPaint(wxPaintEvent& event)
\membersection{wxWindow::OnScroll}\label{wxwindowonscroll} \membersection{wxWindow::OnScroll}\label{wxwindowonscroll}
\func{void}{OnScroll}{\param{wxScrollEvent\& }{event}} \func{void}{OnScroll}{\param{wxScrollWinEvent\& }{event}}
Called when a scroll event is received from one of the window's built-in scrollbars. Called when a scroll window event is received from one of the window's built-in scrollbars.
\wxheading{Parameters} \wxheading{Parameters}
@@ -1411,7 +1411,7 @@ for horizontal events).
\wxheading{See also} \wxheading{See also}
\helpref{wxScrollEvent}{wxscrollevent},\rtfsp \helpref{wxScrollWinEvent}{wxscrollwinevent},\rtfsp
\helpref{Event handling overview}{eventhandlingoverview} \helpref{Event handling overview}{eventhandlingoverview}
\membersection{wxWindow::OnSetFocus}\label{wxwindowonsetfocus} \membersection{wxWindow::OnSetFocus}\label{wxwindowonsetfocus}

View File

@@ -371,6 +371,7 @@ class WXDLLEXPORT wxListTextCtrl: public wxTextCtrl
bool *m_accept; bool *m_accept;
wxString *m_res; wxString *m_res;
wxListMainWindow *m_owner; wxListMainWindow *m_owner;
wxString m_startValue;
public: public:
wxListTextCtrl(void) {}; wxListTextCtrl(void) {};
@@ -434,8 +435,8 @@ class WXDLLEXPORT wxListMainWindow: public wxScrolledWindow
void DeselectLine( wxListLineData *line ); void DeselectLine( wxListLineData *line );
void DeleteLine( wxListLineData *line ); void DeleteLine( wxListLineData *line );
wxTextCtrl *EditLabel( long item ); void EditLabel( long item );
void Edit( long item ) { (void)EditLabel(item); } // deprecated void Edit( long item ) { EditLabel(item); } // deprecated
void OnRenameTimer(); void OnRenameTimer();
void OnRenameAccept(); void OnRenameAccept();

View File

@@ -172,7 +172,8 @@ class WXDLLEXPORT wxTreeTextCtrl: public wxTextCtrl
private: private:
bool *m_accept; bool *m_accept;
wxString *m_res; wxString *m_res;
wxTreeCtrl *m_owner; wxTreeCtrl *m_owner;
wxString m_startValue;
public: public:
wxTreeTextCtrl(void) {}; wxTreeTextCtrl(void) {};

View File

@@ -20,6 +20,7 @@
#include "wx/object.h" #include "wx/object.h"
#include "wx/string.h" #include "wx/string.h"
#include "wx/gdicmn.h" #include "wx/gdicmn.h"
#include "wx/frame.h"
#if wxUSE_HELP #if wxUSE_HELP

View File

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

View File

@@ -192,6 +192,9 @@ wxTreeTextCtrl::wxTreeTextCtrl( wxWindow *parent, const wxWindowID id,
m_res = res; m_res = res;
m_accept = accept; m_accept = accept;
m_owner = owner; m_owner = owner;
(*m_accept) = FALSE;
(*m_res) = "";
m_startValue = value;
} }
void wxTreeTextCtrl::OnChar( wxKeyEvent &event ) void wxTreeTextCtrl::OnChar( wxKeyEvent &event )
@@ -200,15 +203,14 @@ void wxTreeTextCtrl::OnChar( wxKeyEvent &event )
{ {
(*m_accept) = TRUE; (*m_accept) = TRUE;
(*m_res) = GetValue(); (*m_res) = GetValue();
m_owner->OnRenameAccept(); m_owner->SetFocus();
if (!wxPendingDelete.Member(this)) wxPendingDelete.Append(this);
return; return;
} }
if (event.m_keyCode == WXK_ESCAPE) if (event.m_keyCode == WXK_ESCAPE)
{ {
(*m_accept) = FALSE; (*m_accept) = FALSE;
(*m_res) = ""; (*m_res) = "";
if (!wxPendingDelete.Member(this)) wxPendingDelete.Append(this); m_owner->SetFocus();
return; return;
} }
event.Skip(); event.Skip();
@@ -216,9 +218,12 @@ void wxTreeTextCtrl::OnChar( wxKeyEvent &event )
void wxTreeTextCtrl::OnKillFocus( wxFocusEvent &WXUNUSED(event) ) void wxTreeTextCtrl::OnKillFocus( wxFocusEvent &WXUNUSED(event) )
{ {
(*m_accept) = FALSE; if (wxPendingDelete.Member(this)) return;
(*m_res) = "";
if (!wxPendingDelete.Member(this)) wxPendingDelete.Append(this); wxPendingDelete.Append(this);
if ((*m_accept) && ((*m_res) != m_startValue))
m_owner->OnRenameAccept();
} }
#define PIXELS_PER_UNIT 10 #define PIXELS_PER_UNIT 10
@@ -1801,6 +1806,21 @@ void wxTreeCtrl::Edit( const wxTreeItemId& item )
int y = m_currentEdit->GetY(); int y = m_currentEdit->GetY();
int w = m_currentEdit->GetWidth(); int w = m_currentEdit->GetWidth();
int h = m_currentEdit->GetHeight(); 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); wxClientDC dc(this);
PrepareDC( dc ); PrepareDC( dc );
@@ -1827,7 +1847,7 @@ void wxTreeCtrl::OnRenameAccept()
if (!le.IsAllowed()) return; if (!le.IsAllowed()) return;
/* DO CHANGE LABEL */ SetItemText( m_currentEdit, m_renameRes );
} }
void wxTreeCtrl::OnMouse( wxMouseEvent &event ) void wxTreeCtrl::OnMouse( wxMouseEvent &event )

View File

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