some wxUSE_* macros not used consistently (patch #992456) with source cleaning (blind changes).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28975 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2004-08-31 13:59:07 +00:00
parent 118322a3df
commit 312ebad4cd
12 changed files with 263 additions and 207 deletions

View File

@@ -14,6 +14,9 @@
#endif
#include "wx/defs.h"
#if wxUSE_CHOICE
#include "wx/choice.h"
#include "wx/menu.h"
#include "wx/mac/uma.h"
@@ -60,7 +63,7 @@ bool wxChoice::Create(wxWindow *parent, wxWindowID id,
const wxValidator& validator,
const wxString& name)
{
m_macIsUserPane = FALSE ;
m_macIsUserPane = false ;
if ( !wxChoiceBase::Create(parent, id, pos, size, style, validator, name) )
return false;
@@ -82,7 +85,7 @@ bool wxChoice::Create(wxWindow *parent, wxWindowID id,
Append(choices[i]);
}
SetBestSize(size); // Needed because it is a wxControlWithItems
return TRUE;
return true;
}
// ----------------------------------------------------------------------------
@@ -178,7 +181,7 @@ int wxChoice::FindString(const wxString& s) const
{
for( int i = 0 ; i < GetCount() ; i++ )
{
if ( GetString( i ).IsSameAs(s, FALSE) )
if ( GetString( i ).IsSameAs(s, false) )
return i ;
}
return wxNOT_FOUND ;
@@ -299,3 +302,5 @@ wxSize wxChoice::DoGetBestSize() const
}
return wxSize(lbWidth, lbHeight);
}
#endif // wxUSE_CHOICE

View File

@@ -13,6 +13,10 @@
#pragma implementation "slider.h"
#endif
#include "wx/defs.h"
#if wxUSE_SLIDER
#include "wx/slider.h"
#include "wx/mac/uma.h"
@@ -57,7 +61,7 @@ bool wxSlider::Create(wxWindow *parent, wxWindowID id,
const wxValidator& validator,
const wxString& name)
{
m_macIsUserPane = FALSE ;
m_macIsUserPane = false ;
if ( !wxControl::Create(parent, id, pos, size, style, validator, name) )
return false;
@@ -102,9 +106,9 @@ bool wxSlider::Create(wxWindow *parent, wxWindowID id,
if(style & wxSL_LABELS)
{
m_macMinimumStatic = new wxStaticText( parent, -1, wxEmptyString );
m_macMaximumStatic = new wxStaticText( parent, -1, wxEmptyString );
m_macValueStatic = new wxStaticText( parent, -1, wxEmptyString );
m_macMinimumStatic = new wxStaticText( parent, wxID_ANY, wxEmptyString );
m_macMaximumStatic = new wxStaticText( parent, wxID_ANY, wxEmptyString );
m_macValueStatic = new wxStaticText( parent, wxID_ANY, wxEmptyString );
SetRange(minValue, maxValue);
SetValue(value);
}
@@ -424,3 +428,5 @@ void wxSlider::DoMoveWindow(int x, int y, int width, int height)
{
wxControl::DoMoveWindow(x,y,width,height) ;
}
#endif // wxUSE_SLIDER

View File

@@ -14,6 +14,10 @@
#pragma implementation "spinbuttbase.h"
#endif
#include "wx/defs.h"
#if wxUSE_SPINBTN
#include "wx/spinbutt.h"
#include "wx/mac/uma.h"
@@ -40,7 +44,7 @@ wxSpinButton::wxSpinButton()
bool wxSpinButton::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size,
long style, const wxString& name)
{
m_macIsUserPane = FALSE ;
m_macIsUserPane = false ;
if ( !wxSpinButtonBase::Create(parent, id, pos, size,
style, wxDefaultValidator, name) )
@@ -50,7 +54,7 @@ bool wxSpinButton::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, c
m_max = 100;
if (!parent)
return FALSE;
return false;
Rect bounds = wxMacGetBoundsForControl( this , pos , size ) ;
@@ -61,7 +65,7 @@ bool wxSpinButton::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, c
m_peer->SetActionProc( wxMacLiveScrollbarActionUPP ) ;
MacPostControlCreate(pos,size) ;
return TRUE;
return true;
}
wxSpinButton::~wxSpinButton()
@@ -198,3 +202,4 @@ wxSize wxSpinButton::DoGetBestSize() const
return wxSize(16,24);
}
#endif // wxUSE_SPINBTN

View File

@@ -14,6 +14,9 @@
#endif
#include "wx/defs.h"
#if wxUSE_CHOICE
#include "wx/choice.h"
#include "wx/menu.h"
#include "wx/mac/uma.h"
@@ -82,7 +85,7 @@ bool wxChoice::Create(wxWindow *parent, wxWindowID id,
{
Append(choices[i]);
}
return TRUE;
return true;
}
// ----------------------------------------------------------------------------
@@ -178,7 +181,7 @@ int wxChoice::FindString(const wxString& s) const
{
for( int i = 0 ; i < GetCount() ; i++ )
{
if ( GetString( i ).IsSameAs(s, FALSE) )
if ( GetString( i ).IsSameAs(s, false) )
return i ;
}
return wxNOT_FOUND ;
@@ -298,3 +301,5 @@ wxSize wxChoice::DoGetBestSize() const
}
return wxSize(lbWidth, lbHeight);
}
#endif // wxUSE_CHOICE

View File

@@ -13,6 +13,10 @@
#pragma implementation "slider.h"
#endif
#include "wx/defs.h"
#if wxUSE_SLIDER
#include "wx/slider.h"
#include "wx/mac/uma.h"
@@ -95,9 +99,9 @@ bool wxSlider::Create(wxWindow *parent, wxWindowID id,
if(style & wxSL_LABELS)
{
m_macMinimumStatic = new wxStaticText( this, -1, wxEmptyString );
m_macMaximumStatic = new wxStaticText( this, -1, wxEmptyString );
m_macValueStatic = new wxStaticText( this, -1, wxEmptyString );
m_macMinimumStatic = new wxStaticText( this, wxID_ANY, wxEmptyString );
m_macMaximumStatic = new wxStaticText( this, wxID_ANY, wxEmptyString );
m_macValueStatic = new wxStaticText( this, wxID_ANY, wxEmptyString );
SetRange(minValue, maxValue);
SetValue(value);
}
@@ -431,3 +435,5 @@ void wxSlider::DoMoveWindow(int x, int y, int width, int height)
{
wxControl::DoMoveWindow(x,y,width,height) ;
}
#endif // wxUSE_SLIDER

View File

@@ -14,6 +14,10 @@
#pragma implementation "spinbuttbase.h"
#endif
#include "wx/defs.h"
#if wxUSE_SPINBTN
#include "wx/spinbutt.h"
#include "wx/mac/uma.h"
@@ -46,7 +50,7 @@ bool wxSpinButton::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, c
m_max = 100;
if (!parent)
return FALSE;
return false;
Rect bounds ;
Str255 title ;
@@ -60,7 +64,7 @@ bool wxSpinButton::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, c
MacPostControlCreate() ;
return TRUE;
return true;
}
wxSpinButton::~wxSpinButton()
@@ -180,3 +184,4 @@ wxSize wxSpinButton::DoGetBestSize() const
return wxSize(16,24);
}
#endif // wxUSE_SPINBTN

View File

@@ -23,6 +23,8 @@
#include "wx/defs.h"
#if wxUSE_CHOICE
#include "wx/choice.h"
#include "wx/utils.h"
#include "wx/arrstr.h"
@@ -71,7 +73,7 @@ bool wxChoice::Create(wxWindow *parent, wxWindowID id,
const wxString& name)
{
if ( !CreateControl(parent, id, pos, size, style, validator, name) )
return FALSE;
return false;
Widget parentWidget = (Widget) parent->GetClientWidget();
@@ -138,13 +140,13 @@ bool wxChoice::Create(wxWindow *parent, wxWindowID id,
XtVaSetValues((Widget) m_formWidget, XmNresizePolicy, XmRESIZE_NONE, NULL);
ChangeFont(FALSE);
ChangeFont(false);
ChangeBackgroundColour();
AttachWidget (parent, m_buttonWidget, m_formWidget,
pos.x, pos.y, bestSize.x, bestSize.y);
return TRUE;
return true;
}
bool wxChoice::Create(wxWindow *parent, wxWindowID id,
@@ -226,7 +228,7 @@ int wxChoice::DoAppend(const wxString& item)
int wxChoice::DoInsert(const wxString& item, int pos)
{
wxCHECK_MSG(FALSE, -1, wxT("insert not implemented"));
wxCHECK_MSG(false, -1, wxT("insert not implemented"));
// wxCHECK_MSG((pos>=0) && (pos<=GetCount()), -1, wxT("invalid index"));
// if (pos == GetCount()) return DoAppend(item);
@@ -300,7 +302,7 @@ int wxChoice::GetSelection() const
void wxChoice::SetSelection(int n)
{
m_inSetValue = TRUE;
m_inSetValue = true;
wxStringList::compatibility_iterator node = m_stringList.Item(n);
if (node)
@@ -327,7 +329,7 @@ void wxChoice::SetSelection(int n)
XmNmenuHistory, (Widget) m_widgetArray[n], NULL);
#endif
}
m_inSetValue = FALSE;
m_inSetValue = false;
}
int wxChoice::FindString(const wxString& s) const
@@ -342,7 +344,7 @@ int wxChoice::FindString(const wxString& s) const
i++;
}
return -1;
return wxNOT_FOUND;
}
wxString wxChoice::GetString(int n) const
@@ -475,7 +477,7 @@ void wxChoice::ChangeFont(bool keepOriginalSize)
GetSize(& width1, & height1);
if (keepOriginalSize && (width != width1 || height != height1))
{
SetSize(-1, -1, width, height);
SetSize(wxDefaultCoord, wxDefaultCoord, width, height);
}
}
}
@@ -507,7 +509,7 @@ int wxChoice::GetCount() const
void wxChoice::DoSetItemClientData(int n, void* clientData)
{
m_clientDataDict.Set(n, (wxClientData*)clientData, FALSE);
m_clientDataDict.Set(n, (wxClientData*)clientData, false);
}
void* wxChoice::DoGetItemClientData(int n) const
@@ -518,7 +520,7 @@ void* wxChoice::DoGetItemClientData(int n) const
void wxChoice::DoSetItemClientObject(int n, wxClientData* clientData)
{
// don't delete, wxItemContainer does that for us
m_clientDataDict.Set(n, clientData, FALSE);
m_clientDataDict.Set(n, clientData, false);
}
wxClientData* wxChoice::DoGetItemClientObject(int n) const
@@ -557,3 +559,5 @@ wxSize wxChoice::DoGetBestSize() const
return wxSize( ( items.x ? items.x + WIDTH_OVERHEAD : 120 ),
items.y + HEIGHT_OVERHEAD );
}
#endif // wxUSE_CHOICE

View File

@@ -16,6 +16,10 @@
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
#include "wx/defs.h"
#if wxUSE_SLIDER
#include "wx/slider.h"
#include "wx/utils.h"
@@ -106,12 +110,12 @@ bool wxSlider::Create(wxWindow *parent, wxWindowID id,
XtAddCallback (sliderWidget, XmNdragCallback, (XtCallbackProc) wxSliderCallback, (XtPointer) this);
ChangeFont(FALSE);
ChangeFont(false);
AttachWidget (parent, m_mainWidget, (WXWidget) NULL, pos.x, pos.y, size.x, size.y);
ChangeBackgroundColour();
return TRUE;
return true;
}
wxSlider::~wxSlider()
@@ -242,3 +246,4 @@ void wxSliderCallback (Widget widget, XtPointer clientData,
slider->GetEventHandler()->ProcessEvent(event2);
}
#endif // wxUSE_SLIDER

View File

@@ -16,6 +16,10 @@
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
#include "wx/defs.h"
#if wxUSE_SPINBTN
#include "wx/spinbutt.h"
#include "wx/spinctrl.h"
#include "wx/timer.h"
@@ -230,7 +234,7 @@ bool wxArrowButton::Create( wxSpinButton* parent, wxWindowID id,
SetForegroundColour( parent->GetBackgroundColour() );
return TRUE;
return true;
}
// ----------------------------------------------------------------------------
@@ -272,12 +276,12 @@ bool wxSpinButton::Create( wxWindow *parent, wxWindowID id,
if( !wxControl::Create( parent, id, pos, newSize, style ) )
{
return FALSE;
return false;
}
SetName(name);
m_windowId = ( id == -1 ) ? NewControlId() : id;
m_windowId = ( id == wxID_ANY ) ? NewControlId() : id;
bool isVert = IsVertical();
wxPoint pt1, pt2;
@@ -289,7 +293,7 @@ bool wxSpinButton::Create( wxWindow *parent, wxWindowID id,
isVert ? wxARROW_DOWN : wxARROW_LEFT,
pt2, sz2, -1 );
return TRUE;
return true;
}
wxSpinButton::~wxSpinButton()
@@ -403,3 +407,5 @@ void wxSpinButton::ChangeForegroundColour()
{
// TODO
}
#endif // wxUSE_SPINBTN

View File

@@ -12,6 +12,10 @@
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
#include "wx/defs.h"
#if wxUSE_CHOICE
#ifndef WX_PRECOMP
#include "wx/choice.h"
#include "wx/utils.h"
@@ -62,7 +66,7 @@ bool wxChoice::Create(
,rValidator
,rsName
))
return FALSE;
return false;
lSstyle = CBS_DROPDOWNLIST |
WS_TABSTOP |
WS_VISIBLE;
@@ -79,7 +83,7 @@ bool wxChoice::Create(
if (!OS2CreateControl( wxT("COMBOBOX")
,lSstyle
))
return FALSE;
return false;
//
// A choice/combobox normally has a white background (or other, depending
@@ -102,7 +106,7 @@ bool wxChoice::Create(
,rSize.y
);
delete pTextFont;
return TRUE;
return true;
} // end of wxChoice::Create
// ----------------------------------------------------------------------------
@@ -419,7 +423,7 @@ bool wxChoice::OS2Command(
//
// "selection changed" is the only event we're after
//
return FALSE;
return false;
}
int n = GetSelection();
@@ -438,7 +442,7 @@ bool wxChoice::OS2Command(
vEvent.SetClientData(GetClientData(n));
ProcessCommand(vEvent);
}
return TRUE;
return true;
} // end of wxChoice::OS2Command
void wxChoice::Free()
@@ -452,4 +456,6 @@ void wxChoice::Free()
delete GetClientObject(n);
}
}
} // end of wxhoice::Free
} // end of wxChoice::Free
#endif // wxUSE_CHOICE

View File

@@ -23,6 +23,8 @@
#include <wx/scrolwin.h>
#endif
#if wxUSE_SLIDER
#include "wx/slider.h"
#include "wx/os2/private.h"
@@ -460,7 +462,7 @@ bool wxSlider::Create(
,(PVOID)&lColor
);
SetValue(nValue);
return TRUE;
return true;
} // end of wxSlider::Create
void wxSlider::DoSetSize(
@@ -941,7 +943,7 @@ bool wxSlider::OS2OnScroll(
break;
default:
return FALSE;
return false;
}
int nPixelRange = SHORT1FROMMR(::WinSendMsg( GetHwnd()
@@ -970,7 +972,7 @@ bool wxSlider::OS2OnScroll(
//
// Out of range - but we did process it
//
return TRUE;
return true;
}
SetValue(nNewPos);
@@ -1168,6 +1170,7 @@ bool wxSlider::Show(
::WinShowWindow((HWND)m_hStaticMin, bShow);
if(m_hStaticMax)
::WinShowWindow((HWND)m_hStaticMax, bShow);
return TRUE;
return true;
} // end of wxSlider::Show
#endif // wxUSE_SLIDER

View File

@@ -31,7 +31,7 @@
#include "wx/wx.h"
#endif
#if wxUSE_SPINBTN
#if wxUSE_SPINCTRL
#include "wx/spinctrl.h"
#include "wx/os2/private.h"
@@ -50,7 +50,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxSpinCtrl, wxControl)
BEGIN_EVENT_TABLE(wxSpinCtrl, wxSpinButton)
EVT_CHAR(wxSpinCtrl::OnChar)
EVT_SPIN(-1, wxSpinCtrl::OnSpinChange)
EVT_SPIN(wxID_ANY, wxSpinCtrl::OnSpinChange)
EVT_SET_FOCUS(wxSpinCtrl::OnSetFocus)
END_EVENT_TABLE()
// ----------------------------------------------------------------------------
@@ -132,7 +132,7 @@ bool wxSpinCtrl::Create(
{
SWP vSwp;
if (vId == -1)
if (vId == wxID_ANY)
m_windowId = NewControlId();
else
m_windowId = vId;
@@ -174,7 +174,7 @@ bool wxSpinCtrl::Create(
);
if (m_hWnd == 0)
{
return FALSE;
return false;
}
m_hWndBuddy = m_hWnd; // One in the same for OS/2
if(pParent)
@@ -207,7 +207,7 @@ bool wxSpinCtrl::Create(
fnWndProcSpinCtrl = (WXFARPROC)::WinSubclassWindow(m_hWnd, (PFNWP)wxSpinCtrlWndProc);
m_svAllSpins.Add(this);
delete pTextFont;
return TRUE;
return true;
} // end of wxSpinCtrl::Create
wxSize wxSpinCtrl::DoGetBestSize() const
@@ -301,10 +301,10 @@ bool wxSpinCtrl::Enable(
{
if (!wxControl::Enable(bEnable))
{
return FALSE;
return false;
}
::WinEnableWindow(GetHwnd(), bEnable);
return TRUE;
return true;
} // end of wxSpinCtrl::Enable
wxSpinCtrl* wxSpinCtrl::GetSpinForTextCtrl(
@@ -455,7 +455,7 @@ bool wxSpinCtrl::ProcessTextCommand(
//
// Not processed
//
return FALSE;
return false;
} // end of wxSpinCtrl::ProcessTextCommand
void wxSpinCtrl::SetFocus()
@@ -470,13 +470,13 @@ bool wxSpinCtrl::SetFont(
if (!wxWindowBase::SetFont(rFont))
{
// nothing to do
return FALSE;
return false;
}
wxOS2SetFont( m_hWnd
,rFont
);
return TRUE;
return true;
} // end of wxSpinCtrl::SetFont
void wxSpinCtrl::SetValue(
@@ -495,9 +495,9 @@ bool wxSpinCtrl::Show(
{
if (!wxControl::Show(bShow))
{
return FALSE;
return false;
}
return TRUE;
return true;
} // end of wxSpinCtrl::Show
void wxSpinCtrl::SetSelection (
@@ -516,4 +516,4 @@ void wxSpinCtrl::SetSelection (
::WinSendMsg(m_hWnd, EM_SETSEL, MPFROM2SHORT((USHORT)lFrom, (USHORT)lTo), (MPARAM)0);
} // end of wxSpinCtrl::SetSelection
#endif //wxUSE_SPINBTN
#endif //wxUSE_SPINCTRL