]> git.saurik.com Git - wxWidgets.git/commitdiff
Typos in documentation
authorRobert Roebling <robert@roebling.de>
Mon, 26 Jul 1999 16:06:20 +0000 (16:06 +0000)
committerRobert Roebling <robert@roebling.de>
Mon, 26 Jul 1999 16:06:20 +0000 (16:06 +0000)
  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

docs/latex/wx/classes.tex
docs/latex/wx/window.tex
include/wx/generic/listctrl.h
include/wx/generic/treectrl.h
include/wx/helpbase.h
src/generic/listctrl.cpp
src/generic/treectrl.cpp
src/unix/gsocket.c

index 8f2b027969f560991d0367caa6f078ab2a94a1b9..1964b23df7ace612716e73174602dc4ad0f28745 100644 (file)
 \input sashwin.tex
 \input screendc.tex
 \input scrolbar.tex
+\input scrlwevt.tex
 \input scrolevt.tex
 \input scrolwin.tex
 \input sngchdlg.tex
index 8cb18c85940007e1dd42318a6e31601da8e9638a..77a4e88110b7f83fbc10893c46ed479c4a493b2b 100644 (file)
@@ -1393,9 +1393,9 @@ void MyWindow::OnPaint(wxPaintEvent& event)
 
 \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}
 
@@ -1411,7 +1411,7 @@ for horizontal events).
 
 \wxheading{See also}
 
-\helpref{wxScrollEvent}{wxscrollevent},\rtfsp
+\helpref{wxScrollWinEvent}{wxscrollwinevent},\rtfsp
 \helpref{Event handling overview}{eventhandlingoverview}
 
 \membersection{wxWindow::OnSetFocus}\label{wxwindowonsetfocus}
index 15a2c57b0312d4744f1164882ccbea1cbbb28b45..4b14eb011c88e1941a1084a7cd31ebd615896022 100644 (file)
@@ -371,6 +371,7 @@ class WXDLLEXPORT wxListTextCtrl: public wxTextCtrl
     bool               *m_accept;
     wxString           *m_res;
     wxListMainWindow   *m_owner;
+    wxString            m_startValue;
 
   public:
     wxListTextCtrl(void) {};
@@ -434,8 +435,8 @@ class WXDLLEXPORT wxListMainWindow: public wxScrolledWindow
     void DeselectLine( wxListLineData *line );
     void DeleteLine( wxListLineData *line );
     
-    wxTextCtrl *EditLabel( long item );
-    void Edit( long item ) { (void)EditLabel(item); }         // deprecated
+    void EditLabel( long item );
+    void Edit( long item ) { EditLabel(item); }         // deprecated
     void OnRenameTimer();
     void OnRenameAccept();
     
index 6c332b0b6fb7c5463e5691b5ae8bece2f6197f4f..7720cddc91923bb519d74e5ef2a071f5f7180110 100644 (file)
@@ -172,7 +172,8 @@ class WXDLLEXPORT wxTreeTextCtrl: public wxTextCtrl
   private:
     bool               *m_accept;
     wxString           *m_res;
-    wxTreeCtrl        *m_owner;
+    wxTreeCtrl         *m_owner;
+    wxString            m_startValue;
 
   public:
     wxTreeTextCtrl(void) {};
index d6a9b0d989d5462922ae1af678cd79eda7411414..32ed2987b0883e234c7629246b550ca9f61f7356 100644 (file)
@@ -20,6 +20,7 @@
 #include "wx/object.h"
 #include "wx/string.h"
 #include "wx/gdicmn.h"
+#include "wx/frame.h"
 
 #if wxUSE_HELP
 
index 56e6b6c1ace9001af8701a59878a5ee84d371bc6..7dc0dd3c52f9836eea60718d01c1d8aecbddfb03 100644 (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 )
index bb316835d7a859f96094de2aa32719d1ee2de513..70bb1c58b3814ee99a5ee62c152440d4636c20ed 100644 (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 )
index fa01cea28059a67d7e711f534934c3f5cbab634f..594c772a26018bb6696699735e1c48e26e9ecb56 100644 (file)
@@ -62,6 +62,10 @@ void GSocket_Cleanup()
 {
 }
 
+void GSocket_Done()
+{
+}
+
 /* Constructors / Destructors */
 
 GSocket *GSocket_new()