]> git.saurik.com Git - wxWidgets.git/commitdiff
Add longtool tip for a button in wxToolBar test
authorJulian Smart <julian@anthemion.co.uk>
Thu, 11 Sep 2003 12:52:20 +0000 (12:52 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Thu, 11 Sep 2003 12:52:20 +0000 (12:52 +0000)
Various warning suppressions

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23509 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

distrib/msw/generic.rsp
docs/toback24.txt
docs/todo30.txt
samples/menu/menu.cpp
samples/mobile/styles/styles.cpp
samples/scroll/scroll.cpp
samples/scrollsub/scrollsub.cpp
samples/shaped/shaped.cpp
samples/taskbar/tbtest.cpp
samples/toolbar/toolbar.cpp
samples/treectrl/treetest.cpp

index 28660683d2043fc33a30a40da8eceb6cd6db78dd..fa3bf33a7e77b13c1e53b77a89e6aec114ef0486 100644 (file)
@@ -15,8 +15,10 @@ setup.h_vms
 regen
 
 build/bakefiles/*.bkl
-build/bakefiles/Makefile
+build/bakefiles/Bakefiles.bkgen
+build/bakefiles/README
 build/bakefiles/*.py
+build/bakefiles/*.mk
 build/bakefiles/compat/FORMATS.bkmanifest
 build/bakefiles/compat/README
 build/bakefiles/compat/wx24dsp.bkl
index 0a83c4b0b13ac86b06ca9a2972e612e1fa122955..a0f075865026219040089436fe95e9d2e20cae8b 100644 (file)
@@ -271,6 +271,40 @@ Checking in sizer.cpp;
 new revision: 1.71; previous revision: 1.70
 
 
+28. patch [ 771772 ] Crashes when setting icon tooltip longer than 63 characters
+
+Checking in window.cpp;
+/pack/cvsroots/wxwindows/wxWindows/src/msw/window.cpp,v  <--  window.cpp
+new revision: 1.431; previous revision: 1.430
+done
+
+#if wxUSE_UNICODE
+        // in Unicode mode this is just what we need
+        ttText->lpszText = (wxChar *)ttip.c_str();
+#else // !Unicode
+        // Fix by dimitrishortcut: see patch 771772
+
+        // FIXME: szText has a max of 80 bytes, so limit the tooltip string
+        // length accordingly. Ideally lpszText should be used, but who
+        // would be responsible for freeing the buffer?
+
+        // Maximum length of a tip is 39 characters. 39 is 80/2 minus 1 byte
+        // needed for NULL character.
+        size_t tipLength = wxMin(ttip.Len(), 39);
+
+        // Convert to WideChar without adding the NULL character. The NULL
+        // character is added afterwards (Could have used ttip.Left(tipLength)
+        // and a cchMultiByte parameter of tipLength+1, but this is more
+        //efficient.
+        ::MultiByteToWideChar(CP_ACP, 0, ttip, tipLength,
+                             (wchar_t *)ttText->szText,
+                             sizeof(ttText->szText) / sizeof(wchar_t));
+
+        // Add the NULL character.
+        ttText->szText[tipLength*2+0] = '\0';
+        ttText->szText[tipLength*2+1] = '\0';
+#endif // Unicode/!Unicode
+
 
 TODO for 2.4 (items that are not backports)
 ===========================================
index 9c80803e08500d7fcc173b780c6da4a34b637747..f6c46d24ba876c7c955735512fe5f1361d0f343f 100644 (file)
@@ -80,9 +80,8 @@ Core
     we definitely need it for the users makefiles.
 
 - Properties/Member-Metadata, 2-Step Init with virtual create
-    TODO: still unclear what do we need exactly
 
-- Tidy code and add comments to headers (preferably in
+- Tidy code and add comments to headers (possibly in
   Doxygen/Javadoc style)
 
 
@@ -152,12 +151,8 @@ Removal of old code
 
 In addition to wxCOMPATIBILITY code:
 
-- wxProperty classes.
-- All wxCOMPATIBILITY (1.X) code.
-- contrib/src/canvas?
 - contrib/src/mmedia
 - contrib/src/applet?
-- Old wxODBC code
 - Dialog Editor
 
 wxMiscellaneous
index 4d02ddac3830e2cc4d1dc8874b6bfa69d2d6d3c0..8e23b49843a4ab85652f468bad91511727f6c66c 100644 (file)
@@ -876,7 +876,7 @@ void MyFrame::ShowContextMenu(const wxPoint& pos)
 #endif // 0
 }
 
-void MyFrame::OnTestNormal(wxCommandEvent& event)
+void MyFrame::OnTestNormal(wxCommandEvent& WXUNUSED(event))
 {
     wxLogMessage(_T("Normal item selected"));
 }
@@ -919,7 +919,7 @@ void MyFrame::OnUpdateSubMenuRadio(wxUpdateUIEvent& event)
         event.Check(FALSE);
 }
 
-void MyFrame::OnSize(wxSizeEvent& event)
+void MyFrame::OnSize(wxSizeEvent& WXUNUSED(event))
 {
     if ( !m_textctrl )
         return;
index 9593096ed5c17c721f125eedc430e2187a949904..cd92e50fe57e1b5939880e826fd613f054e742b8 100644 (file)
@@ -66,16 +66,16 @@ void MyFrame::CreateMyMenuBar()
     SetMenuBar( menu_bar );
 }
 
-void MyFrame::OnAbout( wxCommandEvent &event )
+void MyFrame::OnAbout( wxCommandEvent &WXUNUSED(event) )
 {
 }
 
-void MyFrame::OnQuit( wxCommandEvent &event )
+void MyFrame::OnQuit( wxCommandEvent &WXUNUSED(event) )
 {
      Close( TRUE );
 }
 
-void MyFrame::OnCloseWindow( wxCloseEvent &event )
+void MyFrame::OnCloseWindow( wxCloseEvent &WXUNUSED(event) )
 {
     Destroy();
 }
index 790c8eaa4a94803f3e47e23b371f99cec60304f6..0d439109626fc9449c37184174009c7fabc5ab76 100644 (file)
@@ -318,7 +318,7 @@ void MyCanvas::OnAddButton( wxCommandEvent &WXUNUSED(event) )
     wxLogMessage( wxT("-> Position after inserting %d %d"), pt.x, pt.y );
 }
 
-void MyCanvas::OnDeleteButton( wxCommandEvent &event )
+void MyCanvas::OnDeleteButton( wxCommandEvent &WXUNUSED(event) )
 {
     wxLogMessage( wxT("Deleting button inserted with \"Add button\"...") );
     wxWindow *win = FindWindow( ID_NEWBUTTON );
index 371c4f97a575c7c4dde81fded599a930cd2ee9e9..1f09dc1962dfc0431eb69a0d6eb231b1eebc4313 100644 (file)
@@ -207,7 +207,7 @@ MyTopLabels::MyTopLabels( wxScrolledWindow *parent, wxWindowID id, const wxPoint
     m_owner = parent;
 }
 
-void MyTopLabels::OnPaint( wxPaintEvent &event )
+void MyTopLabels::OnPaint( wxPaintEvent &WXUNUSED(event) )
 {
     wxPaintDC dc(this);
 
@@ -241,7 +241,7 @@ MyRightLabels::MyRightLabels( wxScrolledWindow *parent, wxWindowID id, const wxP
     m_owner = parent;
 }
 
-void MyRightLabels::OnPaint( wxPaintEvent &event )
+void MyRightLabels::OnPaint( wxPaintEvent &WXUNUSED(event) )
 {
     wxPaintDC dc(this);
 
index eefa2639db9ca6a40c7bbfbe069ea0a16b1d2dc0..a79b97abbfc1d2ff8bcdf1498e701b2d3869e483 100644 (file)
@@ -182,7 +182,7 @@ void ShapedFrame::SetWindowShape()
     m_hasShape = SetShape(region);
 }
 
-void ShapedFrame::OnDoubleClick(wxMouseEvent& evt)
+void ShapedFrame::OnDoubleClick(wxMouseEvent& WXUNUSED(evt))
 {
     if (m_hasShape)
     {
@@ -205,13 +205,13 @@ void ShapedFrame::OnLeftDown(wxMouseEvent& evt)
     m_delta = wxPoint(dx, dy);
 }
 
-void ShapedFrame::OnLeftUp(wxMouseEvent& evt)
+void ShapedFrame::OnLeftUp(wxMouseEvent& WXUNUSED(evt))
 {
     if (HasCapture())
     {
         ReleaseMouse();
         //printf("Mouse released\n");
-}
+    }
 }
 
 void ShapedFrame::OnMouseMove(wxMouseEvent& evt)
@@ -225,18 +225,18 @@ void ShapedFrame::OnMouseMove(wxMouseEvent& evt)
     }
 }
 
-void ShapedFrame::OnExit(wxMouseEvent& evt)
+void ShapedFrame::OnExit(wxMouseEvent& WXUNUSED(evt))
 {
     Close();
 }
 
-void ShapedFrame::OnPaint(wxPaintEvent& evt)
+void ShapedFrame::OnPaint(wxPaintEvent& WXUNUSED(evt))
 {
     wxPaintDC dc(this);
     dc.DrawBitmap(m_bmp, 0, 0, TRUE);
 }
 
-void ShapedFrame::OnWindowCreate(wxWindowCreateEvent& evt)
+void ShapedFrame::OnWindowCreate(wxWindowCreateEvent& WXUNUSED(evt))
 {
     SetWindowShape();
 }
index 21ce1733860ff8b22febc6e95d2200dbb2f9581d..c989143edc84cdb593bae2c594cace138a0fc576 100644 (file)
@@ -62,17 +62,17 @@ MyDialog::MyDialog(wxWindow* parent, const wxWindowID id, const wxString& title,
     Init();
 }
 
-void MyDialog::OnOK(wxCommandEvent& event)
+void MyDialog::OnOK(wxCommandEvent& WXUNUSED(event))
 {
     Show(FALSE);
 }
 
-void MyDialog::OnExit(wxCommandEvent& event)
+void MyDialog::OnExit(wxCommandEvent& WXUNUSED(event))
 {
     Close(TRUE);
 }
 
-void MyDialog::OnCloseWindow(wxCloseEvent& event)
+void MyDialog::OnCloseWindow(wxCloseEvent& WXUNUSED(event))
 {
     Destroy();
 }
index 407143684782e8cf1562085eb7f0f2ee94dc2c2e..d43dd1d3f2fe63937e25c18b8131b63c294f84ab 100644 (file)
@@ -330,7 +330,7 @@ void MyFrame::RecreateToolbar()
     toolBar->AddTool(wxID_COPY, _T("Copy"), toolBarBitmaps[3], _T("Toggle button 2"), wxITEM_CHECK);
     toolBar->AddTool(wxID_CUT, _T("Cut"), toolBarBitmaps[4], _T("Toggle/Untoggle help button"));
     toolBar->AddTool(wxID_PASTE, _T("Paste"), toolBarBitmaps[5], _T("Paste"));
-    toolBar->AddTool(wxID_PRINT, _T("Print"), toolBarBitmaps[6], _T("Delete this tool"));
+    toolBar->AddTool(wxID_PRINT, _T("Print"), toolBarBitmaps[6], _T("Delete this tool. This is a very long tooltip to test whether it does the right thing when the tooltip is more than Windows can cope with."));
     toolBar->AddSeparator();
     toolBar->AddTool(wxID_HELP, _T("Help"), toolBarBitmaps[7], _T("Help button"), wxITEM_CHECK);
 
index 034ef14ae73f2cceecd591a987554851d5370cf7..897c30382dd876fe325609b96c27dbb7a0d66b43 100644 (file)
@@ -435,12 +435,12 @@ void MyFrame::OnDumpSelected(wxCommandEvent& WXUNUSED(event))
     }
 }
 
-void MyFrame::OnSelect(wxCommandEvent& event)
+void MyFrame::OnSelect(wxCommandEvent& WXUNUSED(event))
 {
     m_treeCtrl->SelectItem(m_treeCtrl->GetSelection());
 }
 
-void MyFrame::OnUnselect(wxCommandEvent& event)
+void MyFrame::OnUnselect(wxCommandEvent& WXUNUSED(event))
 {
     m_treeCtrl->UnselectAll();
 }
@@ -485,7 +485,7 @@ void MyFrame::OnRecreate(wxCommandEvent& event)
     m_treeCtrl->AddTestItemsToTree(5, 2);
 }
 
-void MyFrame::OnSetImageSize(wxCommandEvent& event)
+void MyFrame::OnSetImageSize(wxCommandEvent& WXUNUSED(event))
 {
     int size = wxGetNumberFromUser(wxT("Enter the size for the images to use"),
                                     wxT("Size: "),
@@ -498,7 +498,7 @@ void MyFrame::OnSetImageSize(wxCommandEvent& event)
     wxGetApp().SetShowImages(TRUE);
 }
 
-void MyFrame::OnToggleImages(wxCommandEvent& event)
+void MyFrame::OnToggleImages(wxCommandEvent& WXUNUSED(event))
 {
     if ( wxGetApp().ShowImages() )
     {
@@ -512,7 +512,7 @@ void MyFrame::OnToggleImages(wxCommandEvent& event)
     }
 }
 
-void MyFrame::OnToggleButtons(wxCommandEvent& event)
+void MyFrame::OnToggleButtons(wxCommandEvent& WXUNUSED(event))
 {
 #if USE_GENERIC_TREECTRL || !defined(__WXMSW__)
     if ( wxGetApp().ShowButtons() )
@@ -528,12 +528,12 @@ void MyFrame::OnToggleButtons(wxCommandEvent& event)
 #endif
 }
 
-void MyFrame::OnCollapseAndReset(wxCommandEvent& event)
+void MyFrame::OnCollapseAndReset(wxCommandEvent& WXUNUSED(event))
 {
     m_treeCtrl->CollapseAndReset(m_treeCtrl->GetRootItem());
 }
 
-void MyFrame::OnEnsureVisible(wxCommandEvent& event)
+void MyFrame::OnEnsureVisible(wxCommandEvent& WXUNUSED(event))
 {
     m_treeCtrl->DoEnsureVisible();
 }
@@ -667,9 +667,9 @@ void MyTreeCtrl::CreateImageList(int size)
     AssignImageList(images);
 }
 
+#if USE_GENERIC_TREECTRL || !defined(__WXMSW__)
 void MyTreeCtrl::CreateButtonsImageList(int size)
 {
-#if USE_GENERIC_TREECTRL || !defined(__WXMSW__)
     if ( size == -1 )
     {
         SetButtonsImageList(NULL);
@@ -701,6 +701,9 @@ void MyTreeCtrl::CreateButtonsImageList(int size)
     }
 
     AssignButtonsImageList(images);
+#else
+void MyTreeCtrl::CreateButtonsImageList(int WXUNUSED(size))
+{
 #endif
 }