Source cleaning: whitespaces, -1/wxDefaultCoord, TRUE/true, FALSE/false.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28839 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2004-08-20 12:03:08 +00:00
parent e567515efd
commit 02b7b6b072
13 changed files with 120 additions and 120 deletions

View File

@@ -45,7 +45,7 @@ protected:
{ {
wxCaretBase::Init(); wxCaretBase::Init();
m_hasCaret = FALSE; m_hasCaret = false;
} }
// override base class virtuals // override base class virtuals

View File

@@ -66,7 +66,7 @@ public:
// items may be checked // items may be checked
virtual bool IsChecked(size_t uiIndex) const; virtual bool IsChecked(size_t uiIndex) const;
virtual void Check(size_t uiIndex, bool bCheck = TRUE); virtual void Check(size_t uiIndex, bool bCheck = true);
// return the index of the item at this position or wxNOT_FOUND // return the index of the item at this position or wxNOT_FOUND
int HitTest(const wxPoint& pt) const { return DoHitTestItem(pt.x, pt.y); } int HitTest(const wxPoint& pt) const { return DoHitTestItem(pt.x, pt.y); }

View File

@@ -90,7 +90,7 @@ public:
virtual bool Flush(); virtual bool Flush();
// X11 has two clipboards which get selected by this call. Empty on MSW. // X11 has two clipboards which get selected by this call. Empty on MSW.
void UsePrimarySelection( bool WXUNUSED(primary) = FALSE ) { } void UsePrimarySelection( bool WXUNUSED(primary) = false ) { }
private: private:
bool m_clearOnExit; bool m_clearOnExit;

View File

@@ -87,7 +87,7 @@ bool wxCaret::MSWCreateCaret()
CALL_CARET_API(CreateCaret, (GetWinHwnd(GetWindow()), 0, CALL_CARET_API(CreateCaret, (GetWinHwnd(GetWindow()), 0,
m_width, m_height)); m_width, m_height));
m_hasCaret = TRUE; m_hasCaret = true;
} }
return m_hasCaret; return m_hasCaret;
@@ -113,7 +113,7 @@ void wxCaret::OnKillFocus()
{ {
if ( m_hasCaret ) if ( m_hasCaret )
{ {
m_hasCaret = FALSE; m_hasCaret = false;
CALL_CARET_API(DestroyCaret, ()); CALL_CARET_API(DestroyCaret, ());
} }
@@ -182,7 +182,7 @@ void wxCaret::DoSize()
{ {
if ( m_hasCaret ) if ( m_hasCaret )
{ {
m_hasCaret = FALSE; m_hasCaret = false;
CALL_CARET_API(DestroyCaret, ()); CALL_CARET_API(DestroyCaret, ());
MSWCreateCaret(); MSWCreateCaret();
OnSetFocus(); OnSetFocus();

View File

@@ -67,7 +67,7 @@ wxBEGIN_FLAGS( wxCheckBoxStyle )
wxFLAGS_MEMBER(wxBORDER_RAISED) wxFLAGS_MEMBER(wxBORDER_RAISED)
wxFLAGS_MEMBER(wxBORDER_STATIC) wxFLAGS_MEMBER(wxBORDER_STATIC)
wxFLAGS_MEMBER(wxBORDER_NONE) wxFLAGS_MEMBER(wxBORDER_NONE)
// old style border flags // old style border flags
wxFLAGS_MEMBER(wxSIMPLE_BORDER) wxFLAGS_MEMBER(wxSIMPLE_BORDER)
wxFLAGS_MEMBER(wxSUNKEN_BORDER) wxFLAGS_MEMBER(wxSUNKEN_BORDER)
@@ -102,7 +102,7 @@ wxEND_PROPERTIES_TABLE()
wxBEGIN_HANDLERS_TABLE(wxCheckBox) wxBEGIN_HANDLERS_TABLE(wxCheckBox)
wxEND_HANDLERS_TABLE() wxEND_HANDLERS_TABLE()
wxCONSTRUCTOR_6( wxCheckBox , wxWindow* , Parent , wxWindowID , Id , wxString , Label , wxPoint , Position , wxSize , Size , long , WindowStyle ) wxCONSTRUCTOR_6( wxCheckBox , wxWindow* , Parent , wxWindowID , Id , wxString , Label , wxPoint , Position , wxSize , Size , long , WindowStyle )
#else #else
IMPLEMENT_DYNAMIC_CLASS(wxCheckBox, wxControl) IMPLEMENT_DYNAMIC_CLASS(wxCheckBox, wxControl)
#endif #endif
@@ -129,7 +129,7 @@ bool wxCheckBox::MSWCommand(WXUINT WXUNUSED(param), WXWORD WXUNUSED(id))
event.SetEventObject(this); event.SetEventObject(this);
ProcessCommand(event); ProcessCommand(event);
return TRUE; return true;
} }
bool wxCheckBox::Create(wxWindow *parent, bool wxCheckBox::Create(wxWindow *parent,
@@ -141,7 +141,7 @@ bool wxCheckBox::Create(wxWindow *parent,
const wxString& name) const wxString& name)
{ {
if ( !CreateControl(parent, id, pos, size, style, validator, name) ) if ( !CreateControl(parent, id, pos, size, style, validator, name) )
return FALSE; return false;
long msStyle = WS_TABSTOP; long msStyle = WS_TABSTOP;

View File

@@ -80,7 +80,7 @@ wxBEGIN_FLAGS( wxCheckListBoxStyle )
wxFLAGS_MEMBER(wxBORDER_RAISED) wxFLAGS_MEMBER(wxBORDER_RAISED)
wxFLAGS_MEMBER(wxBORDER_STATIC) wxFLAGS_MEMBER(wxBORDER_STATIC)
wxFLAGS_MEMBER(wxBORDER_NONE) wxFLAGS_MEMBER(wxBORDER_NONE)
// old style border flags // old style border flags
wxFLAGS_MEMBER(wxSIMPLE_BORDER) wxFLAGS_MEMBER(wxSIMPLE_BORDER)
wxFLAGS_MEMBER(wxSUNKEN_BORDER) wxFLAGS_MEMBER(wxSUNKEN_BORDER)
@@ -113,14 +113,14 @@ wxEND_FLAGS( wxCheckListBoxStyle )
IMPLEMENT_DYNAMIC_CLASS_XTI(wxCheckListBox, wxListBox,"wx/checklst.h") IMPLEMENT_DYNAMIC_CLASS_XTI(wxCheckListBox, wxListBox,"wx/checklst.h")
wxBEGIN_PROPERTIES_TABLE(wxCheckListBox) wxBEGIN_PROPERTIES_TABLE(wxCheckListBox)
wxEVENT_PROPERTY( Toggle , wxEVT_COMMAND_CHECKLISTBOX_TOGGLED , wxCommandEvent ) wxEVENT_PROPERTY( Toggle , wxEVT_COMMAND_CHECKLISTBOX_TOGGLED , wxCommandEvent )
wxPROPERTY_FLAGS( WindowStyle , wxCheckListBoxStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , EMPTY_MACROVALUE , wxLB_OWNERDRAW /*flags*/ , wxT("Helpstring") , wxT("group")) // style wxPROPERTY_FLAGS( WindowStyle , wxCheckListBoxStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , EMPTY_MACROVALUE , wxLB_OWNERDRAW /*flags*/ , wxT("Helpstring") , wxT("group")) // style
wxEND_PROPERTIES_TABLE() wxEND_PROPERTIES_TABLE()
wxBEGIN_HANDLERS_TABLE(wxCheckListBox) wxBEGIN_HANDLERS_TABLE(wxCheckListBox)
wxEND_HANDLERS_TABLE() wxEND_HANDLERS_TABLE()
wxCONSTRUCTOR_4( wxCheckListBox , wxWindow* , Parent , wxWindowID , Id , wxPoint , Position , wxSize , Size ) wxCONSTRUCTOR_4( wxCheckListBox , wxWindow* , Parent , wxWindowID , Id , wxPoint , Position , wxSize , Size )
#else #else
IMPLEMENT_DYNAMIC_CLASS(wxCheckListBox, wxListBox) IMPLEMENT_DYNAMIC_CLASS(wxCheckListBox, wxListBox)
@@ -157,9 +157,9 @@ private:
}; };
wxCheckListBoxItem::wxCheckListBoxItem(wxCheckListBox *pParent, size_t nIndex) wxCheckListBoxItem::wxCheckListBoxItem(wxCheckListBox *pParent, size_t nIndex)
: wxOwnerDrawn(wxEmptyString, TRUE) // checkable : wxOwnerDrawn(wxEmptyString, true) // checkable
{ {
m_bChecked = FALSE; m_bChecked = false;
m_pParent = pParent; m_pParent = pParent;
m_nIndex = nIndex; m_nIndex = nIndex;
@@ -253,10 +253,10 @@ bool wxCheckListBoxItem::OnDrawItem(wxDC& dc, const wxRect& rc,
} }
*/ */
return TRUE; return true;
} }
return FALSE; return false;
} }
// change the state of the item and redraw it // change the state of the item and redraw it
@@ -277,15 +277,15 @@ void wxCheckListBoxItem::Check(bool check)
HWND hwndListbox = (HWND)m_pParent->GetHWND(); HWND hwndListbox = (HWND)m_pParent->GetHWND();
RECT rcUpdate; RECT rcUpdate;
if ( ::SendMessage(hwndListbox, LB_GETITEMRECT, if ( ::SendMessage(hwndListbox, LB_GETITEMRECT,
m_nIndex, (LPARAM)&rcUpdate) == LB_ERR ) m_nIndex, (LPARAM)&rcUpdate) == LB_ERR )
{ {
wxLogDebug(wxT("LB_GETITEMRECT failed")); wxLogDebug(wxT("LB_GETITEMRECT failed"));
} }
InvalidateRect(hwndListbox, &rcUpdate, FALSE); ::InvalidateRect(hwndListbox, &rcUpdate, FALSE);
} }
// send an "item checked" event // send an "item checked" event
@@ -379,7 +379,7 @@ bool wxCheckListBox::SetFont( const wxFont &font )
wxListBox::SetFont(font); wxListBox::SetFont(font);
return TRUE; return true;
} }
// create/retrieve item // create/retrieve item
@@ -405,10 +405,10 @@ bool wxCheckListBox::MSWOnMeasure(WXMEASUREITEMSTRUCT *item)
// add place for the check mark // add place for the check mark
pStruct->itemWidth += wxOwnerDrawn::GetDefaultMarginWidth(); pStruct->itemWidth += wxOwnerDrawn::GetDefaultMarginWidth();
return TRUE; return true;
} }
return FALSE; return false;
} }
// check items // check items
@@ -416,7 +416,7 @@ bool wxCheckListBox::MSWOnMeasure(WXMEASUREITEMSTRUCT *item)
bool wxCheckListBox::IsChecked(size_t uiIndex) const bool wxCheckListBox::IsChecked(size_t uiIndex) const
{ {
wxCHECK_MSG( uiIndex < (size_t)GetCount(), FALSE, _T("bad wxCheckListBox index") ); wxCHECK_MSG( uiIndex < (size_t)GetCount(), false, _T("bad wxCheckListBox index") );
return GetItem(uiIndex)->IsChecked(); return GetItem(uiIndex)->IsChecked();
} }

View File

@@ -138,11 +138,11 @@ bool wxChoice::CreateAndInit(wxWindow *parent,
{ {
// initialize wxControl // initialize wxControl
if ( !CreateControl(parent, id, pos, size, style, validator, name) ) if ( !CreateControl(parent, id, pos, size, style, validator, name) )
return FALSE; return false;
// now create the real HWND // now create the real HWND
if ( !MSWCreateControl(wxT("COMBOBOX"), _T(""), pos, size) ) if ( !MSWCreateControl(wxT("COMBOBOX"), _T(""), pos, size) )
return FALSE; return false;
// choice/combobox normally has "white" (depends on colour scheme, of // choice/combobox normally has "white" (depends on colour scheme, of
@@ -158,7 +158,7 @@ bool wxChoice::CreateAndInit(wxWindow *parent,
// and now we may finally size the control properly (if needed) // and now we may finally size the control properly (if needed)
SetBestSize(size); SetBestSize(size);
return TRUE; return true;
} }
bool wxChoice::Create(wxWindow *parent, bool wxChoice::Create(wxWindow *parent,
@@ -327,7 +327,7 @@ int wxChoice::FindString(const wxString& s) const
for ( int i = 0; i < count; i++ ) for ( int i = 0; i < count; i++ )
{ {
// as CB_FINDSTRINGEXACT is case insensitive, be case insensitive too // as CB_FINDSTRINGEXACT is case insensitive, be case insensitive too
if ( GetString(i).IsSameAs(s, FALSE) ) if ( GetString(i).IsSameAs(s, false) )
return i; return i;
} }
@@ -435,7 +435,7 @@ wxClientData* wxChoice::DoGetItemClientObject( int n ) const
void wxChoice::UpdateVisibleHeight() void wxChoice::UpdateVisibleHeight()
{ {
// be careful to not change the width here // be careful to not change the width here
DoSetSize(-1, -1, -1, GetSize().y, wxSIZE_USE_EXISTING); DoSetSize(wxDefaultCoord, wxDefaultCoord, wxDefaultCoord, GetSize().y, wxSIZE_USE_EXISTING);
} }
void wxChoice::DoMoveWindow(int x, int y, int width, int height) void wxChoice::DoMoveWindow(int x, int y, int width, int height)
@@ -462,7 +462,7 @@ void wxChoice::DoGetSize(int *w, int *h) const
// total height of the control including the drop down list -- but only // total height of the control including the drop down list -- but only
// sometimes, and normally it isn't... I have no idea about what to do with // sometimes, and normally it isn't... I have no idea about what to do with
// this // this
wxControl::DoGetSize(w, h); wxControl::DoGetSize(w, h);
} }
void wxChoice::DoSetSize(int x, int y, void wxChoice::DoSetSize(int x, int y,
@@ -474,7 +474,7 @@ void wxChoice::DoSetSize(int x, int y,
// the height which we must pass to Windows should be the total height of // the height which we must pass to Windows should be the total height of
// the control including the drop down list while the height given to us // the control including the drop down list while the height given to us
// is, of course, just the height of the permanently visible part of it // is, of course, just the height of the permanently visible part of it
if ( height != -1 ) if ( height != wxDefaultCoord )
{ {
// don't make the drop down list too tall, arbitrarily limit it to 40 // don't make the drop down list too tall, arbitrarily limit it to 40
// items max and also don't leave it empty // items max and also don't leave it empty
@@ -499,7 +499,7 @@ void wxChoice::DoSetSize(int x, int y,
// if the height specified for the visible part of the control is // if the height specified for the visible part of the control is
// different from the current one, we need to change it separately // different from the current one, we need to change it separately
// as it is not affected by normal WM_SETSIZE // as it is not affected by normal WM_SETSIZE
if ( height != -1 ) if ( height != wxDefaultCoord )
{ {
const int delta = heightOrig - GetSize().y; const int delta = heightOrig - GetSize().y;
if ( delta ) if ( delta )
@@ -561,7 +561,7 @@ bool wxChoice::MSWCommand(WXUINT param, WXWORD WXUNUSED(id))
if ( param != CBN_SELCHANGE) if ( param != CBN_SELCHANGE)
{ {
// "selection changed" is the only event we're after // "selection changed" is the only event we're after
return FALSE; return false;
} }
int n = GetSelection(); int n = GetSelection();
@@ -578,7 +578,7 @@ bool wxChoice::MSWCommand(WXUINT param, WXWORD WXUNUSED(id))
ProcessCommand(event); ProcessCommand(event);
} }
return TRUE; return true;
} }
WXHBRUSH wxChoice::OnCtlColor(WXHDC pDC, WXHWND WXUNUSED(pWnd), WXUINT WXUNUSED(nCtlColor), WXHBRUSH wxChoice::OnCtlColor(WXHDC pDC, WXHWND WXUNUSED(pWnd), WXUINT WXUNUSED(nCtlColor),

View File

@@ -87,11 +87,11 @@
// old-style clipboard functions using Windows API // old-style clipboard functions using Windows API
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
static bool gs_wxClipboardIsOpen = FALSE; static bool gs_wxClipboardIsOpen = false;
bool wxOpenClipboard() bool wxOpenClipboard()
{ {
wxCHECK_MSG( !gs_wxClipboardIsOpen, TRUE, wxT("clipboard already opened.") ); wxCHECK_MSG( !gs_wxClipboardIsOpen, true, wxT("clipboard already opened.") );
wxWindow *win = wxTheApp->GetTopWindow(); wxWindow *win = wxTheApp->GetTopWindow();
if ( win ) if ( win )
@@ -107,24 +107,24 @@ bool wxOpenClipboard()
{ {
wxLogDebug(wxT("Can not open clipboard without a main window.")); wxLogDebug(wxT("Can not open clipboard without a main window."));
return FALSE; return false;
} }
} }
bool wxCloseClipboard() bool wxCloseClipboard()
{ {
wxCHECK_MSG( gs_wxClipboardIsOpen, FALSE, wxT("clipboard is not opened") ); wxCHECK_MSG( gs_wxClipboardIsOpen, false, wxT("clipboard is not opened") );
gs_wxClipboardIsOpen = FALSE; gs_wxClipboardIsOpen = false;
if ( ::CloseClipboard() == 0 ) if ( ::CloseClipboard() == 0 )
{ {
wxLogSysError(_("Failed to close the clipboard.")); wxLogSysError(_("Failed to close the clipboard."));
return FALSE; return false;
} }
return TRUE; return true;
} }
bool wxEmptyClipboard() bool wxEmptyClipboard()
@@ -133,10 +133,10 @@ bool wxEmptyClipboard()
{ {
wxLogSysError(_("Failed to empty the clipboard.")); wxLogSysError(_("Failed to empty the clipboard."));
return FALSE; return false;
} }
return TRUE; return true;
} }
bool wxIsClipboardOpened() bool wxIsClipboardOpened()
@@ -151,7 +151,7 @@ bool wxIsClipboardFormatAvailable(wxDataFormat dataFormat)
if ( ::IsClipboardFormatAvailable(cf) ) if ( ::IsClipboardFormatAvailable(cf) )
{ {
// ok from the first try // ok from the first try
return TRUE; return true;
} }
// for several standard formats, we can convert from some other ones too // for several standard formats, we can convert from some other ones too
@@ -167,7 +167,7 @@ bool wxIsClipboardFormatAvailable(wxDataFormat dataFormat)
#endif // wxUSE_ENH_METAFILE #endif // wxUSE_ENH_METAFILE
default: default:
return FALSE; return false;
} }
} }
@@ -196,7 +196,7 @@ bool wxSetClipboardData(wxDataFormat dataFormat,
SelectObject(hdcSrc, old); SelectObject(hdcSrc, old);
DeleteDC(hdcMem); DeleteDC(hdcMem);
DeleteDC(hdcSrc); DeleteDC(hdcSrc);
return FALSE; return false;
} }
HBITMAP old1 = (HBITMAP) SelectObject(hdcMem, hBitmap); HBITMAP old1 = (HBITMAP) SelectObject(hdcMem, hBitmap);
@@ -274,7 +274,7 @@ bool wxSetClipboardData(wxDataFormat dataFormat,
default: default:
{ {
wxLogError(_("Unsupported clipboard format.")); wxLogError(_("Unsupported clipboard format."));
return FALSE; return false;
} }
case wxDF_OEMTEXT: case wxDF_OEMTEXT:
@@ -306,15 +306,15 @@ bool wxSetClipboardData(wxDataFormat dataFormat,
case wxDF_HTML: case wxDF_HTML:
{ {
char* html = (char *)data; char* html = (char *)data;
// Create temporary buffer for HTML header... // Create temporary buffer for HTML header...
char *buf = new char [400 + strlen(html)]; char *buf = new char [400 + strlen(html)];
if(!buf) return FALSE; if(!buf) return false;
// Get clipboard id for HTML format... // Get clipboard id for HTML format...
static int cfid = 0; static int cfid = 0;
if(!cfid) cfid = RegisterClipboardFormat(wxT("HTML Format")); if(!cfid) cfid = RegisterClipboardFormat(wxT("HTML Format"));
// Create a template string for the HTML header... // Create a template string for the HTML header...
strcpy(buf, strcpy(buf,
"Version:0.9\r\n" "Version:0.9\r\n"
@@ -324,7 +324,7 @@ bool wxSetClipboardData(wxDataFormat dataFormat,
"EndFragment:00000000\r\n" "EndFragment:00000000\r\n"
"<html><body>\r\n" "<html><body>\r\n"
"<!--StartFragment -->\r\n"); "<!--StartFragment -->\r\n");
// Append the HTML... // Append the HTML...
strcat(buf, html); strcat(buf, html);
strcat(buf, "\r\n"); strcat(buf, "\r\n");
@@ -333,7 +333,7 @@ bool wxSetClipboardData(wxDataFormat dataFormat,
"<!--EndFragment-->\r\n" "<!--EndFragment-->\r\n"
"</body>\r\n" "</body>\r\n"
"</html>"); "</html>");
// Now go back, calculate all the lengths, and write out the // Now go back, calculate all the lengths, and write out the
// necessary header information. Note, wsprintf() truncates the // necessary header information. Note, wsprintf() truncates the
// string when you overwrite it so you follow up with code to replace // string when you overwrite it so you follow up with code to replace
@@ -341,35 +341,35 @@ bool wxSetClipboardData(wxDataFormat dataFormat,
char *ptr = strstr(buf, "StartHTML"); char *ptr = strstr(buf, "StartHTML");
wsprintf(ptr+10, "%08u", strstr(buf, "<html>") - buf); wsprintf(ptr+10, "%08u", strstr(buf, "<html>") - buf);
*(ptr+10+8) = '\r'; *(ptr+10+8) = '\r';
ptr = strstr(buf, "EndHTML"); ptr = strstr(buf, "EndHTML");
wsprintf(ptr+8, "%08u", strlen(buf)); wsprintf(ptr+8, "%08u", strlen(buf));
*(ptr+8+8) = '\r'; *(ptr+8+8) = '\r';
ptr = strstr(buf, "StartFragment"); ptr = strstr(buf, "StartFragment");
wsprintf(ptr+14, "%08u", strstr(buf, "<!--StartFrag") - buf); wsprintf(ptr+14, "%08u", strstr(buf, "<!--StartFrag") - buf);
*(ptr+14+8) = '\r'; *(ptr+14+8) = '\r';
ptr = strstr(buf, "EndFragment"); ptr = strstr(buf, "EndFragment");
wsprintf(ptr+12, "%08u", strstr(buf, "<!--EndFrag") - buf); wsprintf(ptr+12, "%08u", strstr(buf, "<!--EndFrag") - buf);
*(ptr+12+8) = '\r'; *(ptr+12+8) = '\r';
// Now you have everything in place ready to put on the // Now you have everything in place ready to put on the
// clipboard. // clipboard.
// Allocate global memory for transfer... // Allocate global memory for transfer...
HGLOBAL hText = GlobalAlloc(GMEM_MOVEABLE |GMEM_DDESHARE, strlen(buf)+4); HGLOBAL hText = GlobalAlloc(GMEM_MOVEABLE |GMEM_DDESHARE, strlen(buf)+4);
// Put your string in the global memory... // Put your string in the global memory...
ptr = (char *)GlobalLock(hText); ptr = (char *)GlobalLock(hText);
strcpy(ptr, buf); strcpy(ptr, buf);
GlobalUnlock(hText); GlobalUnlock(hText);
handle = ::SetClipboardData(cfid, hText); handle = ::SetClipboardData(cfid, hText);
// Free memory... // Free memory...
GlobalFree(hText); GlobalFree(hText);
// Clean up... // Clean up...
delete [] buf; delete [] buf;
break; break;
@@ -381,10 +381,10 @@ bool wxSetClipboardData(wxDataFormat dataFormat,
{ {
wxLogSysError(_("Failed to set clipboard data.")); wxLogSysError(_("Failed to set clipboard data."));
return FALSE; return false;
} }
return TRUE; return true;
} }
void *wxGetClipboardData(wxDataFormat dataFormat, long *len) void *wxGetClipboardData(wxDataFormat dataFormat, long *len)
@@ -534,8 +534,8 @@ IMPLEMENT_DYNAMIC_CLASS(wxClipboard, wxObject)
wxClipboard::wxClipboard() wxClipboard::wxClipboard()
{ {
m_clearOnExit = FALSE; m_clearOnExit = false;
m_isOpened = FALSE; m_isOpened = false;
} }
wxClipboard::~wxClipboard() wxClipboard::~wxClipboard()
@@ -563,25 +563,25 @@ bool wxClipboard::Flush()
{ {
wxLogLastError(wxT("OleFlushClipboard")); wxLogLastError(wxT("OleFlushClipboard"));
return FALSE; return false;
} }
else else
{ {
m_clearOnExit = FALSE; m_clearOnExit = false;
return TRUE; return true;
} }
#else // !wxUSE_OLE_CLIPBOARD #else // !wxUSE_OLE_CLIPBOARD
return FALSE; return false;
#endif // wxUSE_OLE_CLIPBOARD/!wxUSE_OLE_CLIPBOARD #endif // wxUSE_OLE_CLIPBOARD/!wxUSE_OLE_CLIPBOARD
} }
bool wxClipboard::Open() bool wxClipboard::Open()
{ {
// OLE opens clipboard for us // OLE opens clipboard for us
m_isOpened = TRUE; m_isOpened = true;
#if wxUSE_OLE_CLIPBOARD #if wxUSE_OLE_CLIPBOARD
return TRUE; return true;
#else #else
return wxOpenClipboard(); return wxOpenClipboard();
#endif #endif
@@ -605,12 +605,12 @@ bool wxClipboard::SetData( wxDataObject *data )
if ( data ) if ( data )
return AddData(data); return AddData(data);
else else
return TRUE; return true;
} }
bool wxClipboard::AddData( wxDataObject *data ) bool wxClipboard::AddData( wxDataObject *data )
{ {
wxCHECK_MSG( data, FALSE, wxT("data is invalid") ); wxCHECK_MSG( data, false, wxT("data is invalid") );
#if wxUSE_OLE_CLIPBOARD #if wxUSE_OLE_CLIPBOARD
HRESULT hr = OleSetClipboard(data->GetInterface()); HRESULT hr = OleSetClipboard(data->GetInterface());
@@ -620,7 +620,7 @@ bool wxClipboard::AddData( wxDataObject *data )
// don't free anything in this case // don't free anything in this case
return FALSE; return false;
} }
// we have a problem here because we should delete wxDataObject, but we // we have a problem here because we should delete wxDataObject, but we
@@ -634,11 +634,11 @@ bool wxClipboard::AddData( wxDataObject *data )
// using OLE clipboard when the app terminates - by default, we call // using OLE clipboard when the app terminates - by default, we call
// OleSetClipboard(NULL) which won't waste RAM, but the app can call // OleSetClipboard(NULL) which won't waste RAM, but the app can call
// wxClipboard::Flush() to chaneg this // wxClipboard::Flush() to chaneg this
m_clearOnExit = TRUE; m_clearOnExit = true;
return TRUE; return true;
#elif wxUSE_DATAOBJ #elif wxUSE_DATAOBJ
wxCHECK_MSG( wxIsClipboardOpened(), FALSE, wxT("clipboard not open") ); wxCHECK_MSG( wxIsClipboardOpened(), false, wxT("clipboard not open") );
wxDataFormat format = data->GetPreferredFormat(); wxDataFormat format = data->GetPreferredFormat();
@@ -666,7 +666,7 @@ bool wxClipboard::AddData( wxDataObject *data )
#if 1 #if 1
// TODO // TODO
wxLogError(wxT("Not implemented because wxMetafileDataObject does not contain width and height values.")); wxLogError(wxT("Not implemented because wxMetafileDataObject does not contain width and height values."));
return FALSE; return false;
#else #else
wxMetafileDataObject* metaFileDataObject = wxMetafileDataObject* metaFileDataObject =
(wxMetafileDataObject*) data; (wxMetafileDataObject*) data;
@@ -684,17 +684,17 @@ bool wxClipboard::AddData( wxDataObject *data )
// return wxSetClipboardData(data); // return wxSetClipboardData(data);
// TODO // TODO
wxLogError(wxT("Not implemented.")); wxLogError(wxT("Not implemented."));
return FALSE; return false;
} }
} }
#else // !wxUSE_DATAOBJ #else // !wxUSE_DATAOBJ
return FALSE; return false;
#endif // wxUSE_DATAOBJ/!wxUSE_DATAOBJ #endif // wxUSE_DATAOBJ/!wxUSE_DATAOBJ
} }
void wxClipboard::Close() void wxClipboard::Close()
{ {
m_isOpened = FALSE; m_isOpened = false;
// OLE closes clipboard for us // OLE closes clipboard for us
#if !wxUSE_OLE_CLIPBOARD #if !wxUSE_OLE_CLIPBOARD
wxCloseClipboard(); wxCloseClipboard();
@@ -715,7 +715,7 @@ bool wxClipboard::GetData( wxDataObject& data )
{ {
wxLogSysError(hr, _("Failed to get data from the clipboard")); wxLogSysError(hr, _("Failed to get data from the clipboard"));
return FALSE; return false;
} }
// build the list of supported formats // build the list of supported formats
@@ -738,7 +738,7 @@ bool wxClipboard::GetData( wxDataObject& data )
// get the data for the given formats // get the data for the given formats
FORMATETC formatEtc; FORMATETC formatEtc;
CLIPFORMAT cf; CLIPFORMAT cf;
bool result = FALSE; bool result = false;
// enumerate all explicit formats on the clipboard. // enumerate all explicit formats on the clipboard.
// note that this does not include implicit / synthetic (automatically // note that this does not include implicit / synthetic (automatically
@@ -784,12 +784,12 @@ bool wxClipboard::GetData( wxDataObject& data )
{ {
// convert to NativeFormat Id // convert to NativeFormat Id
cf = formats[n].GetFormatId(); cf = formats[n].GetFormatId();
// if the format is not available, try the next one // if the format is not available, try the next one
// this test includes implicit / sythetic formats // this test includes implicit / sythetic formats
if ( !::IsClipboardFormatAvailable(cf) ) if ( !::IsClipboardFormatAvailable(cf) )
continue; continue;
formatEtc.cfFormat = cf; formatEtc.cfFormat = cf;
formatEtc.ptd = NULL; formatEtc.ptd = NULL;
formatEtc.dwAspect = DVASPECT_CONTENT; formatEtc.dwAspect = DVASPECT_CONTENT;
@@ -831,7 +831,7 @@ bool wxClipboard::GetData( wxDataObject& data )
if ( SUCCEEDED(hr) ) if ( SUCCEEDED(hr) )
{ {
// pass the data to the data object // pass the data to the data object
hr = data.GetInterface()->SetData(&formatEtc, &medium, TRUE); hr = data.GetInterface()->SetData(&formatEtc, &medium, true);
if ( FAILED(hr) ) if ( FAILED(hr) )
{ {
wxLogDebug(wxT("Failed to set data in wxIDataObject")); wxLogDebug(wxT("Failed to set data in wxIDataObject"));
@@ -842,7 +842,7 @@ bool wxClipboard::GetData( wxDataObject& data )
} }
else else
{ {
result = TRUE; result = true;
} }
} }
//else: unsupported tymed? //else: unsupported tymed?
@@ -859,7 +859,7 @@ bool wxClipboard::GetData( wxDataObject& data )
return result; return result;
#elif wxUSE_DATAOBJ #elif wxUSE_DATAOBJ
wxCHECK_MSG( wxIsClipboardOpened(), FALSE, wxT("clipboard not open") ); wxCHECK_MSG( wxIsClipboardOpened(), false, wxT("clipboard not open") );
wxDataFormat format = data.GetPreferredFormat(); wxDataFormat format = data.GetPreferredFormat();
switch ( format ) switch ( format )
@@ -870,12 +870,12 @@ bool wxClipboard::GetData( wxDataObject& data )
wxTextDataObject& textDataObject = (wxTextDataObject &)data; wxTextDataObject& textDataObject = (wxTextDataObject &)data;
char* s = (char*)wxGetClipboardData(format); char* s = (char*)wxGetClipboardData(format);
if ( !s ) if ( !s )
return FALSE; return false;
textDataObject.SetText(wxString::FromAscii(s)); textDataObject.SetText(wxString::FromAscii(s));
delete [] s; delete [] s;
return TRUE; return true;
} }
case wxDF_BITMAP: case wxDF_BITMAP:
@@ -884,12 +884,12 @@ bool wxClipboard::GetData( wxDataObject& data )
wxBitmapDataObject& bitmapDataObject = (wxBitmapDataObject &)data; wxBitmapDataObject& bitmapDataObject = (wxBitmapDataObject &)data;
wxBitmap* bitmap = (wxBitmap *)wxGetClipboardData(data.GetPreferredFormat()); wxBitmap* bitmap = (wxBitmap *)wxGetClipboardData(data.GetPreferredFormat());
if ( !bitmap ) if ( !bitmap )
return FALSE; return false;
bitmapDataObject.SetBitmap(*bitmap); bitmapDataObject.SetBitmap(*bitmap);
delete bitmap; delete bitmap;
return TRUE; return true;
} }
#if wxUSE_METAFILE #if wxUSE_METAFILE
case wxDF_METAFILE: case wxDF_METAFILE:
@@ -897,19 +897,19 @@ bool wxClipboard::GetData( wxDataObject& data )
wxMetafileDataObject& metaFileDataObject = (wxMetafileDataObject &)data; wxMetafileDataObject& metaFileDataObject = (wxMetafileDataObject &)data;
wxMetafile* metaFile = (wxMetafile *)wxGetClipboardData(wxDF_METAFILE); wxMetafile* metaFile = (wxMetafile *)wxGetClipboardData(wxDF_METAFILE);
if ( !metaFile ) if ( !metaFile )
return FALSE; return false;
metaFileDataObject.SetMetafile(*metaFile); metaFileDataObject.SetMetafile(*metaFile);
delete metaFile; delete metaFile;
return TRUE; return true;
} }
#endif // wxUSE_METAFILE #endif // wxUSE_METAFILE
} }
return FALSE; return false;
#else // !wxUSE_DATAOBJ #else // !wxUSE_DATAOBJ
wxFAIL_MSG( wxT("no clipboard implementation") ); wxFAIL_MSG( wxT("no clipboard implementation") );
return FALSE; return false;
#endif // wxUSE_OLE_CLIPBOARD/wxUSE_DATAOBJ #endif // wxUSE_OLE_CLIPBOARD/wxUSE_DATAOBJ
} }

View File

@@ -117,7 +117,7 @@ bool wxColourDialog::Create(wxWindow *parent, wxColourData *data)
if (data) if (data)
m_colourData = *data; m_colourData = *data;
return TRUE; return true;
} }
int wxColourDialog::ShowModal() int wxColourDialog::ShowModal()
@@ -201,10 +201,10 @@ void wxColourDialog::DoSetSize(int x, int y,
int WXUNUSED(width), int WXUNUSED(height), int WXUNUSED(width), int WXUNUSED(height),
int WXUNUSED(sizeFlags)) int WXUNUSED(sizeFlags))
{ {
if ( x != -1 ) if ( x != wxDefaultCoord )
m_pos.x = x; m_pos.x = x;
if ( y != -1 ) if ( y != wxDefaultCoord )
m_pos.y = y; m_pos.y = y;
// ignore the size params - we can't change the size of a standard dialog // ignore the size params - we can't change the size of a standard dialog

View File

@@ -55,7 +55,7 @@ template<> void wxStringWriteValue(wxString &s , const wxColour &data )
wxTO_STRING_IMP( wxColour ) wxTO_STRING_IMP( wxColour )
wxFROM_STRING_IMP( wxColour ) wxFROM_STRING_IMP( wxColour )
IMPLEMENT_DYNAMIC_CLASS_WITH_COPY_AND_STREAMERS_XTI( wxColour , wxObject , "wx/colour.h" , &wxTO_STRING( wxColour ) , &wxFROM_STRING( wxColour )) IMPLEMENT_DYNAMIC_CLASS_WITH_COPY_AND_STREAMERS_XTI( wxColour , wxObject , "wx/colour.h" , &wxTO_STRING( wxColour ) , &wxFROM_STRING( wxColour ))
wxBEGIN_PROPERTIES_TABLE(wxColour) wxBEGIN_PROPERTIES_TABLE(wxColour)

View File

@@ -65,7 +65,7 @@ wxBEGIN_FLAGS( wxComboBoxStyle )
wxFLAGS_MEMBER(wxBORDER_RAISED) wxFLAGS_MEMBER(wxBORDER_RAISED)
wxFLAGS_MEMBER(wxBORDER_STATIC) wxFLAGS_MEMBER(wxBORDER_STATIC)
wxFLAGS_MEMBER(wxBORDER_NONE) wxFLAGS_MEMBER(wxBORDER_NONE)
// old style border flags // old style border flags
wxFLAGS_MEMBER(wxSIMPLE_BORDER) wxFLAGS_MEMBER(wxSIMPLE_BORDER)
wxFLAGS_MEMBER(wxSUNKEN_BORDER) wxFLAGS_MEMBER(wxSUNKEN_BORDER)
@@ -94,14 +94,14 @@ wxEND_FLAGS( wxComboBoxStyle )
IMPLEMENT_DYNAMIC_CLASS_XTI(wxComboBox, wxControl,"wx/combobox.h") IMPLEMENT_DYNAMIC_CLASS_XTI(wxComboBox, wxControl,"wx/combobox.h")
wxBEGIN_PROPERTIES_TABLE(wxComboBox) wxBEGIN_PROPERTIES_TABLE(wxComboBox)
wxEVENT_PROPERTY( Select , wxEVT_COMMAND_COMBOBOX_SELECTED , wxCommandEvent ) wxEVENT_PROPERTY( Select , wxEVT_COMMAND_COMBOBOX_SELECTED , wxCommandEvent )
wxEVENT_PROPERTY( TextEnter , wxEVT_COMMAND_TEXT_ENTER , wxCommandEvent ) wxEVENT_PROPERTY( TextEnter , wxEVT_COMMAND_TEXT_ENTER , wxCommandEvent )
// TODO DELEGATES // TODO DELEGATES
wxPROPERTY( Font , wxFont , SetFont , GetFont , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) wxPROPERTY( Font , wxFont , SetFont , GetFont , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
wxPROPERTY_COLLECTION( Choices , wxArrayString , wxString , AppendString , GetStrings , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) wxPROPERTY_COLLECTION( Choices , wxArrayString , wxString , AppendString , GetStrings , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
wxPROPERTY( Value ,wxString, SetValue, GetValue, EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) wxPROPERTY( Value ,wxString, SetValue, GetValue, EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
wxPROPERTY( Selection ,int, SetSelection, GetSelection, EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) wxPROPERTY( Selection ,int, SetSelection, GetSelection, EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
wxPROPERTY_FLAGS( WindowStyle , wxComboBoxStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style wxPROPERTY_FLAGS( WindowStyle , wxComboBoxStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style
wxEND_PROPERTIES_TABLE() wxEND_PROPERTIES_TABLE()
@@ -275,7 +275,7 @@ bool wxComboBox::MSWProcessEditMsg(WXUINT msg, WXWPARAM wParam, WXLPARAM lParam)
ProcessCommand(event); ProcessCommand(event);
} }
return HandleChar(wParam, lParam, TRUE /* isASCII */); return HandleChar(wParam, lParam, true /* isASCII */);
case WM_KEYDOWN: case WM_KEYDOWN:
return HandleKeyDown(wParam, lParam); return HandleKeyDown(wParam, lParam);
@@ -290,7 +290,7 @@ bool wxComboBox::MSWProcessEditMsg(WXUINT msg, WXWPARAM wParam, WXLPARAM lParam)
return HandleKillFocus((WXHWND)wParam); return HandleKillFocus((WXHWND)wParam);
} }
return FALSE; return false;
} }
bool wxComboBox::MSWCommand(WXUINT param, WXWORD WXUNUSED(id)) bool wxComboBox::MSWCommand(WXUINT param, WXWORD WXUNUSED(id))
@@ -355,8 +355,8 @@ bool wxComboBox::MSWCommand(WXUINT param, WXWORD WXUNUSED(id))
} }
// there is no return value for the CBN_ notifications, so always return // there is no return value for the CBN_ notifications, so always return
// FALSE from here to pass the message to DefWindowProc() // false from here to pass the message to DefWindowProc()
return FALSE; return false;
} }
WXHWND wxComboBox::GetEditHWND() const WXHWND wxComboBox::GetEditHWND() const
@@ -393,11 +393,11 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id,
// pretend that wxComboBox is hidden while it is positioned and resized and // pretend that wxComboBox is hidden while it is positioned and resized and
// show it only right before leaving this method because otherwise there is // show it only right before leaving this method because otherwise there is
// some noticeable flicker while the control rearranges itself // some noticeable flicker while the control rearranges itself
m_isShown = FALSE; m_isShown = false;
if ( !CreateAndInit(parent, id, pos, size, n, choices, style, if ( !CreateAndInit(parent, id, pos, size, n, choices, style,
validator, name) ) validator, name) )
return FALSE; return false;
// we shouldn't call SetValue() for an empty string because this would // we shouldn't call SetValue() for an empty string because this would
// (correctly) result in an assert with a read only combobox and is useless // (correctly) result in an assert with a read only combobox and is useless
@@ -415,9 +415,9 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id,
} }
// and finally, show the control // and finally, show the control
Show(TRUE); Show(true);
return TRUE; return true;
} }
bool wxComboBox::Create(wxWindow *parent, wxWindowID id, bool wxComboBox::Create(wxWindow *parent, wxWindowID id,

View File

@@ -1188,7 +1188,7 @@ bool wxCrashReportImpl::Generate(
SymSetOptions(SYMOPT_DEFERRED_LOADS | SYMOPT_UNDNAME); SymSetOptions(SYMOPT_DEFERRED_LOADS | SYMOPT_UNDNAME);
// Initialize DbgHelp // Initialize DbgHelp
if ( SymInitialize(GetCurrentProcess(), NULL, TRUE /* invade */) ) if ( ::SymInitialize(GetCurrentProcess(), NULL, TRUE /* invade */) )
{ {
OutputStack(pCtx, flags); OutputStack(pCtx, flags);

View File

@@ -102,7 +102,7 @@ public:
{ {
gs_globalCursor = new wxCursor; gs_globalCursor = new wxCursor;
return TRUE; return true;
} }
virtual void OnExit() virtual void OnExit()