[ 1357527 ] Cast to void to silence GCC's warnings.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36324 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1214,7 +1214,7 @@ void wxListCtrl::SetImageList(wxImageList *imageList, int which)
|
|||||||
m_imageListState = imageList;
|
m_imageListState = imageList;
|
||||||
m_ownsImageListState = false;
|
m_ownsImageListState = false;
|
||||||
}
|
}
|
||||||
ListView_SetImageList(GetHwnd(), (HIMAGELIST) imageList ? imageList->GetHIMAGELIST() : 0, flags);
|
(void) ListView_SetImageList(GetHwnd(), (HIMAGELIST) imageList ? imageList->GetHIMAGELIST() : 0, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxListCtrl::AssignImageList(wxImageList *imageList, int which)
|
void wxListCtrl::AssignImageList(wxImageList *imageList, int which)
|
||||||
@@ -2766,7 +2766,7 @@ static void wxConvertToMSWListItem(const wxListCtrl *ctrl,
|
|||||||
// pszText is not const, hence the cast
|
// pszText is not const, hence the cast
|
||||||
lvItem.pszText = (wxChar *)info.m_text.c_str();
|
lvItem.pszText = (wxChar *)info.m_text.c_str();
|
||||||
if ( lvItem.pszText )
|
if ( lvItem.pszText )
|
||||||
lvItem.cchTextMax = info.m_text.Length();
|
lvItem.cchTextMax = info.m_text.length();
|
||||||
else
|
else
|
||||||
lvItem.cchTextMax = 0;
|
lvItem.cchTextMax = 0;
|
||||||
}
|
}
|
||||||
@@ -2835,4 +2835,3 @@ static void wxConvertToMSWListCol(int WXUNUSED(col), const wxListItem& item,
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endif // wxUSE_LISTCTRL
|
#endif // wxUSE_LISTCTRL
|
||||||
|
|
||||||
|
@@ -408,97 +408,97 @@ wxNotebook::~wxNotebook()
|
|||||||
|
|
||||||
size_t wxNotebook::GetPageCount() const
|
size_t wxNotebook::GetPageCount() const
|
||||||
{
|
{
|
||||||
// consistency check
|
// consistency check
|
||||||
wxASSERT( (int)m_pages.Count() == TabCtrl_GetItemCount(GetHwnd()) );
|
wxASSERT( (int)m_pages.Count() == TabCtrl_GetItemCount(GetHwnd()) );
|
||||||
|
|
||||||
return m_pages.Count();
|
return m_pages.Count();
|
||||||
}
|
}
|
||||||
|
|
||||||
int wxNotebook::GetRowCount() const
|
int wxNotebook::GetRowCount() const
|
||||||
{
|
{
|
||||||
return TabCtrl_GetRowCount(GetHwnd());
|
return TabCtrl_GetRowCount(GetHwnd());
|
||||||
}
|
}
|
||||||
|
|
||||||
int wxNotebook::SetSelection(size_t nPage)
|
int wxNotebook::SetSelection(size_t nPage)
|
||||||
{
|
{
|
||||||
wxCHECK_MSG( IS_VALID_PAGE(nPage), wxNOT_FOUND, wxT("notebook page out of range") );
|
wxCHECK_MSG( IS_VALID_PAGE(nPage), wxNOT_FOUND, wxT("notebook page out of range") );
|
||||||
|
|
||||||
if ( int(nPage) != m_nSelection )
|
if ( int(nPage) != m_nSelection )
|
||||||
{
|
|
||||||
wxNotebookEvent event(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, m_windowId);
|
|
||||||
event.SetSelection(nPage);
|
|
||||||
event.SetOldSelection(m_nSelection);
|
|
||||||
event.SetEventObject(this);
|
|
||||||
if ( !GetEventHandler()->ProcessEvent(event) || event.IsAllowed() )
|
|
||||||
{
|
{
|
||||||
// program allows the page change
|
wxNotebookEvent event(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, m_windowId);
|
||||||
event.SetEventType(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED);
|
event.SetSelection(nPage);
|
||||||
(void)GetEventHandler()->ProcessEvent(event);
|
event.SetOldSelection(m_nSelection);
|
||||||
|
event.SetEventObject(this);
|
||||||
|
if ( !GetEventHandler()->ProcessEvent(event) || event.IsAllowed() )
|
||||||
|
{
|
||||||
|
// program allows the page change
|
||||||
|
event.SetEventType(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED);
|
||||||
|
(void)GetEventHandler()->ProcessEvent(event);
|
||||||
|
|
||||||
TabCtrl_SetCurSel(GetHwnd(), nPage);
|
TabCtrl_SetCurSel(GetHwnd(), nPage);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return m_nSelection;
|
return m_nSelection;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxNotebook::SetPageText(size_t nPage, const wxString& strText)
|
bool wxNotebook::SetPageText(size_t nPage, const wxString& strText)
|
||||||
{
|
{
|
||||||
wxCHECK_MSG( IS_VALID_PAGE(nPage), false, wxT("notebook page out of range") );
|
wxCHECK_MSG( IS_VALID_PAGE(nPage), false, wxT("notebook page out of range") );
|
||||||
|
|
||||||
TC_ITEM tcItem;
|
TC_ITEM tcItem;
|
||||||
tcItem.mask = TCIF_TEXT;
|
tcItem.mask = TCIF_TEXT;
|
||||||
tcItem.pszText = (wxChar *)strText.c_str();
|
tcItem.pszText = (wxChar *)strText.c_str();
|
||||||
|
|
||||||
return TabCtrl_SetItem(GetHwnd(), nPage, &tcItem) != 0;
|
return TabCtrl_SetItem(GetHwnd(), nPage, &tcItem) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString wxNotebook::GetPageText(size_t nPage) const
|
wxString wxNotebook::GetPageText(size_t nPage) const
|
||||||
{
|
{
|
||||||
wxCHECK_MSG( IS_VALID_PAGE(nPage), wxEmptyString, wxT("notebook page out of range") );
|
wxCHECK_MSG( IS_VALID_PAGE(nPage), wxEmptyString, wxT("notebook page out of range") );
|
||||||
|
|
||||||
wxChar buf[256];
|
wxChar buf[256];
|
||||||
TC_ITEM tcItem;
|
TC_ITEM tcItem;
|
||||||
tcItem.mask = TCIF_TEXT;
|
tcItem.mask = TCIF_TEXT;
|
||||||
tcItem.pszText = buf;
|
tcItem.pszText = buf;
|
||||||
tcItem.cchTextMax = WXSIZEOF(buf);
|
tcItem.cchTextMax = WXSIZEOF(buf);
|
||||||
|
|
||||||
wxString str;
|
wxString str;
|
||||||
if ( TabCtrl_GetItem(GetHwnd(), nPage, &tcItem) )
|
if ( TabCtrl_GetItem(GetHwnd(), nPage, &tcItem) )
|
||||||
str = tcItem.pszText;
|
str = tcItem.pszText;
|
||||||
|
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
int wxNotebook::GetPageImage(size_t nPage) const
|
int wxNotebook::GetPageImage(size_t nPage) const
|
||||||
{
|
{
|
||||||
wxCHECK_MSG( IS_VALID_PAGE(nPage), wxNOT_FOUND, wxT("notebook page out of range") );
|
wxCHECK_MSG( IS_VALID_PAGE(nPage), wxNOT_FOUND, wxT("notebook page out of range") );
|
||||||
|
|
||||||
TC_ITEM tcItem;
|
TC_ITEM tcItem;
|
||||||
tcItem.mask = TCIF_IMAGE;
|
tcItem.mask = TCIF_IMAGE;
|
||||||
|
|
||||||
return TabCtrl_GetItem(GetHwnd(), nPage, &tcItem) ? tcItem.iImage : wxNOT_FOUND;
|
return TabCtrl_GetItem(GetHwnd(), nPage, &tcItem) ? tcItem.iImage : wxNOT_FOUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxNotebook::SetPageImage(size_t nPage, int nImage)
|
bool wxNotebook::SetPageImage(size_t nPage, int nImage)
|
||||||
{
|
{
|
||||||
wxCHECK_MSG( IS_VALID_PAGE(nPage), false, wxT("notebook page out of range") );
|
wxCHECK_MSG( IS_VALID_PAGE(nPage), false, wxT("notebook page out of range") );
|
||||||
|
|
||||||
TC_ITEM tcItem;
|
TC_ITEM tcItem;
|
||||||
tcItem.mask = TCIF_IMAGE;
|
tcItem.mask = TCIF_IMAGE;
|
||||||
tcItem.iImage = nImage;
|
tcItem.iImage = nImage;
|
||||||
|
|
||||||
return TabCtrl_SetItem(GetHwnd(), nPage, &tcItem) != 0;
|
return TabCtrl_SetItem(GetHwnd(), nPage, &tcItem) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxNotebook::SetImageList(wxImageList* imageList)
|
void wxNotebook::SetImageList(wxImageList* imageList)
|
||||||
{
|
{
|
||||||
wxNotebookBase::SetImageList(imageList);
|
wxNotebookBase::SetImageList(imageList);
|
||||||
|
|
||||||
if ( imageList )
|
if ( imageList )
|
||||||
{
|
{
|
||||||
TabCtrl_SetImageList(GetHwnd(), (HIMAGELIST)imageList->GetHIMAGELIST());
|
(void) TabCtrl_SetImageList(GetHwnd(), (HIMAGELIST)imageList->GetHIMAGELIST());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: tabctrl.cpp
|
// Name: src/msw/tabctrl.cpp
|
||||||
// Purpose: wxTabCtrl
|
// Purpose: wxTabCtrl
|
||||||
// Author: Julian Smart
|
// Author: Julian Smart
|
||||||
// Modified by:
|
// Modified by:
|
||||||
@@ -315,7 +315,7 @@ int wxTabCtrl::SetSelection(int item)
|
|||||||
void wxTabCtrl::SetImageList(wxImageList* imageList)
|
void wxTabCtrl::SetImageList(wxImageList* imageList)
|
||||||
{
|
{
|
||||||
m_imageList = imageList;
|
m_imageList = imageList;
|
||||||
TabCtrl_SetImageList( (HWND) GetHWND(), (HIMAGELIST) imageList->GetHIMAGELIST() );
|
(void) TabCtrl_SetImageList( (HWND) GetHWND(), (HIMAGELIST) imageList->GetHIMAGELIST() );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the text for an item
|
// Set the text for an item
|
||||||
@@ -430,5 +430,4 @@ void wxMapBitmap(HBITMAP hBitmap, int width, int height)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif // __WIN95__
|
||||||
// __WIN95__
|
|
||||||
|
@@ -835,9 +835,9 @@ void wxTreeCtrl::SetIndent(unsigned int indent)
|
|||||||
void wxTreeCtrl::SetAnyImageList(wxImageList *imageList, int which)
|
void wxTreeCtrl::SetAnyImageList(wxImageList *imageList, int which)
|
||||||
{
|
{
|
||||||
// no error return
|
// no error return
|
||||||
TreeView_SetImageList(GetHwnd(),
|
(void) TreeView_SetImageList(GetHwnd(),
|
||||||
imageList ? imageList->GetHIMAGELIST() : 0,
|
imageList ? imageList->GetHIMAGELIST() : 0,
|
||||||
which);
|
which);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxTreeCtrl::SetImageList(wxImageList *imageList)
|
void wxTreeCtrl::SetImageList(wxImageList *imageList)
|
||||||
@@ -2020,7 +2020,7 @@ wxTreeItemId wxTreeCtrl::DoTreeHitTest(const wxPoint& point, int& flags)
|
|||||||
hitTestInfo.pt.x = (int)point.x;
|
hitTestInfo.pt.x = (int)point.x;
|
||||||
hitTestInfo.pt.y = (int)point.y;
|
hitTestInfo.pt.y = (int)point.y;
|
||||||
|
|
||||||
TreeView_HitTest(GetHwnd(), &hitTestInfo);
|
(void) TreeView_HitTest(GetHwnd(), &hitTestInfo);
|
||||||
|
|
||||||
flags = 0;
|
flags = 0;
|
||||||
|
|
||||||
@@ -2210,12 +2210,12 @@ WXLRESULT wxTreeCtrl::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lPara
|
|||||||
int x = GET_X_LPARAM(lParam),
|
int x = GET_X_LPARAM(lParam),
|
||||||
y = GET_Y_LPARAM(lParam);
|
y = GET_Y_LPARAM(lParam);
|
||||||
HTREEITEM htItem = GetItemFromPoint(GetHwnd(), x, y);
|
HTREEITEM htItem = GetItemFromPoint(GetHwnd(), x, y);
|
||||||
|
|
||||||
TV_HITTESTINFO tvht;
|
TV_HITTESTINFO tvht;
|
||||||
tvht.pt.x = x;
|
tvht.pt.x = x;
|
||||||
tvht.pt.y = y;
|
tvht.pt.y = y;
|
||||||
|
|
||||||
TreeView_HitTest(GetHwnd(), &tvht);
|
(void) TreeView_HitTest(GetHwnd(), &tvht);
|
||||||
|
|
||||||
switch ( nMsg )
|
switch ( nMsg )
|
||||||
{
|
{
|
||||||
@@ -2240,7 +2240,7 @@ WXLRESULT wxTreeCtrl::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lPara
|
|||||||
{
|
{
|
||||||
m_htClickedItem = (WXHTREEITEM) htItem;
|
m_htClickedItem = (WXHTREEITEM) htItem;
|
||||||
m_ptClick = wxPoint(x, y);
|
m_ptClick = wxPoint(x, y);
|
||||||
|
|
||||||
if ( wParam & MK_CONTROL )
|
if ( wParam & MK_CONTROL )
|
||||||
{
|
{
|
||||||
SetFocus();
|
SetFocus();
|
||||||
@@ -2280,7 +2280,7 @@ WXLRESULT wxTreeCtrl::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lPara
|
|||||||
{
|
{
|
||||||
// avoid doing anything if we click on the only
|
// avoid doing anything if we click on the only
|
||||||
// currently selected item
|
// currently selected item
|
||||||
|
|
||||||
SetFocus();
|
SetFocus();
|
||||||
|
|
||||||
wxArrayTreeItemIds selections;
|
wxArrayTreeItemIds selections;
|
||||||
@@ -2334,29 +2334,29 @@ WXLRESULT wxTreeCtrl::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lPara
|
|||||||
tv.hdr.hwndFrom = GetHwnd();
|
tv.hdr.hwndFrom = GetHwnd();
|
||||||
tv.hdr.idFrom = ::GetWindowLong( GetHwnd(), GWL_ID );
|
tv.hdr.idFrom = ::GetWindowLong( GetHwnd(), GWL_ID );
|
||||||
tv.hdr.code = TVN_BEGINDRAG;
|
tv.hdr.code = TVN_BEGINDRAG;
|
||||||
|
|
||||||
tv.itemNew.hItem = HITEM(m_htClickedItem);
|
tv.itemNew.hItem = HITEM(m_htClickedItem);
|
||||||
|
|
||||||
TVITEM tviAux;
|
TVITEM tviAux;
|
||||||
ZeroMemory(&tviAux, sizeof(tviAux));
|
ZeroMemory(&tviAux, sizeof(tviAux));
|
||||||
tviAux.hItem = HITEM(m_htClickedItem);
|
tviAux.hItem = HITEM(m_htClickedItem);
|
||||||
tviAux.mask = TVIF_STATE | TVIF_PARAM;
|
tviAux.mask = TVIF_STATE | TVIF_PARAM;
|
||||||
tviAux.stateMask = 0xffffffff;
|
tviAux.stateMask = 0xffffffff;
|
||||||
TreeView_GetItem( GetHwnd(), &tviAux );
|
TreeView_GetItem( GetHwnd(), &tviAux );
|
||||||
|
|
||||||
tv.itemNew.state = tviAux.state;
|
tv.itemNew.state = tviAux.state;
|
||||||
tv.itemNew.lParam = tviAux.lParam;
|
tv.itemNew.lParam = tviAux.lParam;
|
||||||
|
|
||||||
tv.ptDrag.x = x;
|
tv.ptDrag.x = x;
|
||||||
tv.ptDrag.y = y;
|
tv.ptDrag.y = y;
|
||||||
|
|
||||||
::SendMessage( pWnd, WM_NOTIFY, tv.hdr.idFrom, (LPARAM)&tv );
|
::SendMessage( pWnd, WM_NOTIFY, tv.hdr.idFrom, (LPARAM)&tv );
|
||||||
}
|
}
|
||||||
m_htClickedItem.Unset();
|
m_htClickedItem.Unset();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif // __WXWINCE__
|
#endif // __WXWINCE__
|
||||||
|
|
||||||
if ( m_dragImage )
|
if ( m_dragImage )
|
||||||
{
|
{
|
||||||
m_dragImage->Move(wxPoint(x, y));
|
m_dragImage->Move(wxPoint(x, y));
|
||||||
@@ -3152,4 +3152,3 @@ int wxTreeCtrl::GetState(const wxTreeItemId& node)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endif // wxUSE_TREECTRL
|
#endif // wxUSE_TREECTRL
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user