Add longtool tip for a button in wxToolBar test

Various warning suppressions


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23509 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2003-09-11 12:52:20 +00:00
parent 037767538e
commit 256b8649ff
11 changed files with 67 additions and 33 deletions

View File

@@ -15,8 +15,10 @@ setup.h_vms
regen regen
build/bakefiles/*.bkl build/bakefiles/*.bkl
build/bakefiles/Makefile build/bakefiles/Bakefiles.bkgen
build/bakefiles/README
build/bakefiles/*.py build/bakefiles/*.py
build/bakefiles/*.mk
build/bakefiles/compat/FORMATS.bkmanifest build/bakefiles/compat/FORMATS.bkmanifest
build/bakefiles/compat/README build/bakefiles/compat/README
build/bakefiles/compat/wx24dsp.bkl build/bakefiles/compat/wx24dsp.bkl

View File

@@ -271,6 +271,40 @@ Checking in sizer.cpp;
new revision: 1.71; previous revision: 1.70 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) TODO for 2.4 (items that are not backports)
=========================================== ===========================================

View File

@@ -80,9 +80,8 @@ Core
we definitely need it for the users makefiles. we definitely need it for the users makefiles.
- Properties/Member-Metadata, 2-Step Init with virtual create - 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) Doxygen/Javadoc style)
@@ -152,12 +151,8 @@ Removal of old code
In addition to wxCOMPATIBILITY code: In addition to wxCOMPATIBILITY code:
- wxProperty classes.
- All wxCOMPATIBILITY (1.X) code.
- contrib/src/canvas?
- contrib/src/mmedia - contrib/src/mmedia
- contrib/src/applet? - contrib/src/applet?
- Old wxODBC code
- Dialog Editor - Dialog Editor
wxMiscellaneous wxMiscellaneous

View File

@@ -876,7 +876,7 @@ void MyFrame::ShowContextMenu(const wxPoint& pos)
#endif // 0 #endif // 0
} }
void MyFrame::OnTestNormal(wxCommandEvent& event) void MyFrame::OnTestNormal(wxCommandEvent& WXUNUSED(event))
{ {
wxLogMessage(_T("Normal item selected")); wxLogMessage(_T("Normal item selected"));
} }
@@ -919,7 +919,7 @@ void MyFrame::OnUpdateSubMenuRadio(wxUpdateUIEvent& event)
event.Check(FALSE); event.Check(FALSE);
} }
void MyFrame::OnSize(wxSizeEvent& event) void MyFrame::OnSize(wxSizeEvent& WXUNUSED(event))
{ {
if ( !m_textctrl ) if ( !m_textctrl )
return; return;

View File

@@ -66,16 +66,16 @@ void MyFrame::CreateMyMenuBar()
SetMenuBar( menu_bar ); 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 ); Close( TRUE );
} }
void MyFrame::OnCloseWindow( wxCloseEvent &event ) void MyFrame::OnCloseWindow( wxCloseEvent &WXUNUSED(event) )
{ {
Destroy(); Destroy();
} }

View File

@@ -318,7 +318,7 @@ void MyCanvas::OnAddButton( wxCommandEvent &WXUNUSED(event) )
wxLogMessage( wxT("-> Position after inserting %d %d"), pt.x, pt.y ); 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\"...") ); wxLogMessage( wxT("Deleting button inserted with \"Add button\"...") );
wxWindow *win = FindWindow( ID_NEWBUTTON ); wxWindow *win = FindWindow( ID_NEWBUTTON );

View File

@@ -207,7 +207,7 @@ MyTopLabels::MyTopLabels( wxScrolledWindow *parent, wxWindowID id, const wxPoint
m_owner = parent; m_owner = parent;
} }
void MyTopLabels::OnPaint( wxPaintEvent &event ) void MyTopLabels::OnPaint( wxPaintEvent &WXUNUSED(event) )
{ {
wxPaintDC dc(this); wxPaintDC dc(this);
@@ -241,7 +241,7 @@ MyRightLabels::MyRightLabels( wxScrolledWindow *parent, wxWindowID id, const wxP
m_owner = parent; m_owner = parent;
} }
void MyRightLabels::OnPaint( wxPaintEvent &event ) void MyRightLabels::OnPaint( wxPaintEvent &WXUNUSED(event) )
{ {
wxPaintDC dc(this); wxPaintDC dc(this);

View File

@@ -182,7 +182,7 @@ void ShapedFrame::SetWindowShape()
m_hasShape = SetShape(region); m_hasShape = SetShape(region);
} }
void ShapedFrame::OnDoubleClick(wxMouseEvent& evt) void ShapedFrame::OnDoubleClick(wxMouseEvent& WXUNUSED(evt))
{ {
if (m_hasShape) if (m_hasShape)
{ {
@@ -205,13 +205,13 @@ void ShapedFrame::OnLeftDown(wxMouseEvent& evt)
m_delta = wxPoint(dx, dy); m_delta = wxPoint(dx, dy);
} }
void ShapedFrame::OnLeftUp(wxMouseEvent& evt) void ShapedFrame::OnLeftUp(wxMouseEvent& WXUNUSED(evt))
{ {
if (HasCapture()) if (HasCapture())
{ {
ReleaseMouse(); ReleaseMouse();
//printf("Mouse released\n"); //printf("Mouse released\n");
} }
} }
void ShapedFrame::OnMouseMove(wxMouseEvent& evt) 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(); Close();
} }
void ShapedFrame::OnPaint(wxPaintEvent& evt) void ShapedFrame::OnPaint(wxPaintEvent& WXUNUSED(evt))
{ {
wxPaintDC dc(this); wxPaintDC dc(this);
dc.DrawBitmap(m_bmp, 0, 0, TRUE); dc.DrawBitmap(m_bmp, 0, 0, TRUE);
} }
void ShapedFrame::OnWindowCreate(wxWindowCreateEvent& evt) void ShapedFrame::OnWindowCreate(wxWindowCreateEvent& WXUNUSED(evt))
{ {
SetWindowShape(); SetWindowShape();
} }

View File

@@ -62,17 +62,17 @@ MyDialog::MyDialog(wxWindow* parent, const wxWindowID id, const wxString& title,
Init(); Init();
} }
void MyDialog::OnOK(wxCommandEvent& event) void MyDialog::OnOK(wxCommandEvent& WXUNUSED(event))
{ {
Show(FALSE); Show(FALSE);
} }
void MyDialog::OnExit(wxCommandEvent& event) void MyDialog::OnExit(wxCommandEvent& WXUNUSED(event))
{ {
Close(TRUE); Close(TRUE);
} }
void MyDialog::OnCloseWindow(wxCloseEvent& event) void MyDialog::OnCloseWindow(wxCloseEvent& WXUNUSED(event))
{ {
Destroy(); Destroy();
} }

View 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_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_CUT, _T("Cut"), toolBarBitmaps[4], _T("Toggle/Untoggle help button"));
toolBar->AddTool(wxID_PASTE, _T("Paste"), toolBarBitmaps[5], _T("Paste")); 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->AddSeparator();
toolBar->AddTool(wxID_HELP, _T("Help"), toolBarBitmaps[7], _T("Help button"), wxITEM_CHECK); toolBar->AddTool(wxID_HELP, _T("Help"), toolBarBitmaps[7], _T("Help button"), wxITEM_CHECK);

View 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()); m_treeCtrl->SelectItem(m_treeCtrl->GetSelection());
} }
void MyFrame::OnUnselect(wxCommandEvent& event) void MyFrame::OnUnselect(wxCommandEvent& WXUNUSED(event))
{ {
m_treeCtrl->UnselectAll(); m_treeCtrl->UnselectAll();
} }
@@ -485,7 +485,7 @@ void MyFrame::OnRecreate(wxCommandEvent& event)
m_treeCtrl->AddTestItemsToTree(5, 2); 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"), int size = wxGetNumberFromUser(wxT("Enter the size for the images to use"),
wxT("Size: "), wxT("Size: "),
@@ -498,7 +498,7 @@ void MyFrame::OnSetImageSize(wxCommandEvent& event)
wxGetApp().SetShowImages(TRUE); wxGetApp().SetShowImages(TRUE);
} }
void MyFrame::OnToggleImages(wxCommandEvent& event) void MyFrame::OnToggleImages(wxCommandEvent& WXUNUSED(event))
{ {
if ( wxGetApp().ShowImages() ) 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 USE_GENERIC_TREECTRL || !defined(__WXMSW__)
if ( wxGetApp().ShowButtons() ) if ( wxGetApp().ShowButtons() )
@@ -528,12 +528,12 @@ void MyFrame::OnToggleButtons(wxCommandEvent& event)
#endif #endif
} }
void MyFrame::OnCollapseAndReset(wxCommandEvent& event) void MyFrame::OnCollapseAndReset(wxCommandEvent& WXUNUSED(event))
{ {
m_treeCtrl->CollapseAndReset(m_treeCtrl->GetRootItem()); m_treeCtrl->CollapseAndReset(m_treeCtrl->GetRootItem());
} }
void MyFrame::OnEnsureVisible(wxCommandEvent& event) void MyFrame::OnEnsureVisible(wxCommandEvent& WXUNUSED(event))
{ {
m_treeCtrl->DoEnsureVisible(); m_treeCtrl->DoEnsureVisible();
} }
@@ -667,9 +667,9 @@ void MyTreeCtrl::CreateImageList(int size)
AssignImageList(images); AssignImageList(images);
} }
#if USE_GENERIC_TREECTRL || !defined(__WXMSW__)
void MyTreeCtrl::CreateButtonsImageList(int size) void MyTreeCtrl::CreateButtonsImageList(int size)
{ {
#if USE_GENERIC_TREECTRL || !defined(__WXMSW__)
if ( size == -1 ) if ( size == -1 )
{ {
SetButtonsImageList(NULL); SetButtonsImageList(NULL);
@@ -701,6 +701,9 @@ void MyTreeCtrl::CreateButtonsImageList(int size)
} }
AssignButtonsImageList(images); AssignButtonsImageList(images);
#else
void MyTreeCtrl::CreateButtonsImageList(int WXUNUSED(size))
{
#endif #endif
} }