mirror of
https://github.com/wxWidgets/wxWidgets.git
synced 2026-09-22 06:05:36 +08:00
Source cleaning: -1/wxID_ANY/wxDefaultCoord, ::, TRUE/true. FALSE/false, tabs, whitespaces.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29036 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_TABCTRL_H_
|
||||
@@ -156,9 +156,9 @@ private:
|
||||
typedef void (wxEvtHandler::*wxTabEventFunction)(wxTabEvent&);
|
||||
|
||||
#define EVT_TAB_SEL_CHANGED(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_COMMAND_TAB_SEL_CHANGED, \
|
||||
id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTabEventFunction, & fn ), NULL),
|
||||
id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTabEventFunction, & fn ), NULL),
|
||||
#define EVT_TAB_SEL_CHANGING(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_COMMAND_TAB_SEL_CHANGING, \
|
||||
id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTabEventFunction, & fn ), NULL),
|
||||
id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxTabEventFunction, & fn ), NULL),
|
||||
|
||||
#endif
|
||||
// _WX_TABCTRL_H_
|
||||
|
||||
@@ -78,7 +78,7 @@ protected:
|
||||
#endif
|
||||
};
|
||||
|
||||
#if WXWIN_COMPATIBILITY_2_4
|
||||
#if WXWIN_COMPATIBILITY_2_4
|
||||
inline bool wxTaskBarIcon::IsOK() const { return IsOk(); }
|
||||
#endif
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ public:
|
||||
const wxBitmap& pushedBitmap,
|
||||
bool toggle,
|
||||
wxCoord xPos,
|
||||
wxCoord yPos = -1,
|
||||
wxCoord yPos = wxDefaultCoord,
|
||||
wxObject *clientData = NULL,
|
||||
const wxString& helpString1 = wxEmptyString,
|
||||
const wxString& helpString2 = wxEmptyString);
|
||||
|
||||
@@ -220,10 +220,10 @@ protected:
|
||||
|
||||
// replace the contents of the selection or of the entire control with the
|
||||
// given text
|
||||
void DoWriteText(const wxString& text, bool selectionOnly = TRUE);
|
||||
void DoWriteText(const wxString& text, bool selectionOnly = true);
|
||||
|
||||
// set the selection possibly without scrolling the caret into view
|
||||
void DoSetSelection(long from, long to, bool scrollCaret = TRUE);
|
||||
void DoSetSelection(long from, long to, bool scrollCaret = true);
|
||||
|
||||
// return true if there is a non empty selection in the control
|
||||
bool HasSelection() const;
|
||||
@@ -232,7 +232,7 @@ protected:
|
||||
// position
|
||||
long GetLengthOfLineContainingPos(long pos) const;
|
||||
|
||||
// send TEXT_UPDATED event, return TRUE if it was handled, FALSE otherwise
|
||||
// send TEXT_UPDATED event, return true if it was handled, false otherwise
|
||||
bool SendUpdateEvent();
|
||||
|
||||
// override some base class virtuals
|
||||
@@ -248,7 +248,7 @@ protected:
|
||||
int m_verRichEdit;
|
||||
#endif // wxUSE_RICHEDIT
|
||||
|
||||
// if TRUE, SendUpdateEvent() will eat the next event (see comments in the
|
||||
// if true, SendUpdateEvent() will eat the next event (see comments in the
|
||||
// code as to why this is needed)
|
||||
bool m_suppressNextUpdate;
|
||||
|
||||
|
||||
@@ -22,11 +22,11 @@ friend void wxProcessTimer(wxTimer& timer);
|
||||
|
||||
public:
|
||||
wxTimer() { Init(); }
|
||||
wxTimer(wxEvtHandler *owner, int id = -1) : wxTimerBase(owner, id)
|
||||
wxTimer(wxEvtHandler *owner, int id = wxID_ANY) : wxTimerBase(owner, id)
|
||||
{ Init(); }
|
||||
~wxTimer();
|
||||
|
||||
virtual bool Start(int milliseconds = -1, bool oneShot = FALSE);
|
||||
virtual bool Start(int milliseconds = -1, bool oneShot = false);
|
||||
virtual void Stop();
|
||||
|
||||
virtual bool IsRunning() const { return m_id != 0; }
|
||||
|
||||
@@ -50,9 +50,9 @@ public:
|
||||
virtual ~wxTopLevelWindowMSW();
|
||||
|
||||
// implement base class pure virtuals
|
||||
virtual void Maximize(bool maximize = TRUE);
|
||||
virtual void Maximize(bool maximize = true);
|
||||
virtual bool IsMaximized() const;
|
||||
virtual void Iconize(bool iconize = TRUE);
|
||||
virtual void Iconize(bool iconize = true);
|
||||
virtual bool IsIconized() const;
|
||||
virtual void SetIcon(const wxIcon& icon);
|
||||
virtual void SetIcons(const wxIconBundle& icons );
|
||||
@@ -62,14 +62,14 @@ public:
|
||||
virtual bool SetShape(const wxRegion& region);
|
||||
#endif // __WXWINCE__
|
||||
|
||||
virtual bool Show(bool show = TRUE);
|
||||
virtual bool Show(bool show = true);
|
||||
|
||||
virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL);
|
||||
virtual bool IsFullScreen() const { return m_fsIsShowing; }
|
||||
|
||||
// wxMSW only: EnableCloseButton(FALSE) may be used to remove the "Close"
|
||||
// wxMSW only: EnableCloseButton(false) may be used to remove the "Close"
|
||||
// button from the title bar
|
||||
bool EnableCloseButton(bool enable = TRUE);
|
||||
bool EnableCloseButton(bool enable = true);
|
||||
|
||||
// implementation from now on
|
||||
// --------------------------
|
||||
@@ -91,13 +91,13 @@ protected:
|
||||
// common part of all ctors
|
||||
void Init();
|
||||
|
||||
// create a new frame, return FALSE if it couldn't be created
|
||||
// create a new frame, return false if it couldn't be created
|
||||
bool CreateFrame(const wxString& title,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size);
|
||||
|
||||
// create a new dialog using the given dialog template from resources,
|
||||
// return FALSE if it couldn't be created
|
||||
// return false if it couldn't be created
|
||||
bool CreateDialog(const void *dlgTemplate,
|
||||
const wxString& title,
|
||||
const wxPoint& pos,
|
||||
@@ -136,8 +136,8 @@ protected:
|
||||
ButtonMenu();
|
||||
~ButtonMenu();
|
||||
|
||||
void SetButton(int id = wxID_ANY,
|
||||
const wxString& label = wxEmptyString,
|
||||
void SetButton(int id = wxID_ANY,
|
||||
const wxString& label = wxEmptyString,
|
||||
wxMenu *subMenu = NULL);
|
||||
|
||||
bool IsAssigned() const {return m_assigned;}
|
||||
|
||||
+4
-4
@@ -113,12 +113,12 @@ bool wxTabCtrl::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, cons
|
||||
|
||||
m_hWnd = (WXHWND) hWndTabCtrl;
|
||||
if (parent) parent->AddChild(this);
|
||||
|
||||
|
||||
SubclassWin((WXHWND) hWndTabCtrl);
|
||||
|
||||
SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT));
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
wxTabCtrl::~wxTabCtrl()
|
||||
@@ -215,13 +215,13 @@ bool wxTabCtrl::GetItemRect(int item, wxRect& wxrect) const
|
||||
{
|
||||
RECT rect;
|
||||
if ( !TabCtrl_GetItemRect( (HWND) GetHWND(), item, & rect) )
|
||||
return FALSE;
|
||||
return false;
|
||||
else
|
||||
{
|
||||
wxrect.x = rect.left; wxrect.y = rect.top;
|
||||
wxrect.width = rect.right - rect.left;
|
||||
wxrect.height = rect.bottom - rect.top;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+5
-5
@@ -81,11 +81,11 @@ class wxTaskBarIconWindow : public wxFrame
|
||||
{
|
||||
public:
|
||||
wxTaskBarIconWindow(wxTaskBarIcon *icon)
|
||||
: wxFrame(NULL, -1, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0),
|
||||
: wxFrame(NULL, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0),
|
||||
m_icon(icon)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
WXLRESULT MSWWindowProc(WXUINT msg,
|
||||
WXWPARAM wParam, WXLPARAM lParam)
|
||||
{
|
||||
@@ -103,7 +103,7 @@ private:
|
||||
wxTaskBarIcon *m_icon;
|
||||
};
|
||||
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// NotifyIconData: wrapper around NOTIFYICONDATA
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -209,7 +209,7 @@ bool wxTaskBarIcon::PopupMenu(wxMenu *menu)
|
||||
wxGetMousePosition(&x, &y);
|
||||
|
||||
m_win->Move(x, y);
|
||||
|
||||
|
||||
m_win->PushEventHandler(this);
|
||||
|
||||
menu->UpdateUI();
|
||||
@@ -260,7 +260,7 @@ void wxTaskBarIcon::RegisterWindowMessages()
|
||||
static bool s_registered = false;
|
||||
|
||||
if ( !s_registered )
|
||||
{
|
||||
{
|
||||
// Taskbar restart msg will be sent to us if the icon needs to be redrawn
|
||||
gs_msgRestartTaskbar = RegisterWindowMessage(wxT("TaskbarCreated"));
|
||||
|
||||
|
||||
+65
-65
@@ -111,22 +111,22 @@
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxToolBar, wxControl)
|
||||
|
||||
/*
|
||||
TOOLBAR PROPERTIES
|
||||
tool
|
||||
bitmap
|
||||
bitmap2
|
||||
tooltip
|
||||
longhelp
|
||||
radio (bool)
|
||||
toggle (bool)
|
||||
separator
|
||||
style ( wxNO_BORDER | wxTB_HORIZONTAL)
|
||||
bitmapsize
|
||||
margins
|
||||
packing
|
||||
separation
|
||||
TOOLBAR PROPERTIES
|
||||
tool
|
||||
bitmap
|
||||
bitmap2
|
||||
tooltip
|
||||
longhelp
|
||||
radio (bool)
|
||||
toggle (bool)
|
||||
separator
|
||||
style ( wxNO_BORDER | wxTB_HORIZONTAL)
|
||||
bitmapsize
|
||||
margins
|
||||
packing
|
||||
separation
|
||||
|
||||
dontattachtoframe
|
||||
dontattachtoframe
|
||||
*/
|
||||
|
||||
BEGIN_EVENT_TABLE(wxToolBar, wxToolBarBase)
|
||||
@@ -238,11 +238,11 @@ bool wxToolBar::Create(wxWindow *parent,
|
||||
{
|
||||
// common initialisation
|
||||
if ( !CreateControl(parent, id, pos, size, style, wxDefaultValidator, name) )
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
// MSW-specific initialisation
|
||||
if ( !MSWCreateToolbar(pos, size) )
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
wxSetCCUnicodeFormat(GetHwnd());
|
||||
|
||||
@@ -260,7 +260,7 @@ bool wxToolBar::Create(wxWindow *parent,
|
||||
DWORD dwToolbarStyle;
|
||||
|
||||
dwToolbarStyle = (DWORD)::SendMessage(GetHwnd(), TB_GETSTYLE, 0, 0L );
|
||||
|
||||
|
||||
if ((dwToolbarStyle & TBSTYLE_FLAT) == 0)
|
||||
{
|
||||
dwToolbarStyle |= TBSTYLE_FLAT;
|
||||
@@ -269,19 +269,19 @@ bool wxToolBar::Create(wxWindow *parent,
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return TRUE;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxToolBar::MSWCreateToolbar(const wxPoint& pos, const wxSize& size)
|
||||
{
|
||||
if ( !MSWCreateControl(TOOLBARCLASSNAME, wxEmptyString, pos, size) )
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
// toolbar-specific post initialisation
|
||||
::SendMessage(GetHwnd(), TB_BUTTONSTRUCTSIZE, sizeof(TBBUTTON), 0);
|
||||
|
||||
return TRUE;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxToolBar::Recreate()
|
||||
@@ -413,7 +413,7 @@ bool wxToolBar::DoInsertTool(size_t WXUNUSED(pos), wxToolBarToolBase *tool)
|
||||
tool->Attach(this);
|
||||
|
||||
InvalidateBestSize();
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxToolBar::DoDeleteTool(size_t pos, wxToolBarToolBase *tool)
|
||||
@@ -470,7 +470,7 @@ bool wxToolBar::DoDeleteTool(size_t pos, wxToolBarToolBase *tool)
|
||||
{
|
||||
wxLogLastError(wxT("TB_DELETEBUTTON"));
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -486,12 +486,12 @@ bool wxToolBar::DoDeleteTool(size_t pos, wxToolBarToolBase *tool)
|
||||
int x;
|
||||
wxControl *control = tool2->GetControl();
|
||||
control->GetPosition(&x, NULL);
|
||||
control->Move(x - width, -1);
|
||||
control->Move(x - width, wxDefaultCoord);
|
||||
}
|
||||
}
|
||||
|
||||
InvalidateBestSize();
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxToolBar::Realize()
|
||||
@@ -500,7 +500,7 @@ bool wxToolBar::Realize()
|
||||
if ( nTools == 0 )
|
||||
{
|
||||
// nothing to do
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
const bool isVertical = HasFlag(wxTB_VERTICAL);
|
||||
@@ -509,7 +509,7 @@ bool wxToolBar::Realize()
|
||||
if (wxSystemOptions::GetOptionInt(wxT("msw.remap")) == 2)
|
||||
{
|
||||
doRemapBg = doRemap = false;
|
||||
doTransparent = true;
|
||||
doTransparent = true;
|
||||
}
|
||||
else
|
||||
{ doRemap = !wxSystemOptions::HasOption(wxT("msw.remap"))
|
||||
@@ -573,7 +573,7 @@ bool wxToolBar::Realize()
|
||||
{
|
||||
wxLogLastError(_T("CreateCompatibleBitmap"));
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
m_hBitmap = (WXHBITMAP)hBitmap;
|
||||
@@ -618,7 +618,7 @@ bool wxToolBar::Realize()
|
||||
int yOffset = wxMax(0, (m_defaultHeight - bmp.GetHeight())/2);
|
||||
#if USE_BITMAP_MASKS
|
||||
// notice the last parameter: do use mask
|
||||
dcAllButtons.DrawBitmap(bmp, x+xOffset, yOffset, TRUE);
|
||||
dcAllButtons.DrawBitmap(bmp, x+xOffset, yOffset, true);
|
||||
#else // !USE_BITMAP_MASKS
|
||||
SelectInHDC hdcSelector2(memoryDC2, GetHbitmapOf(bmp));
|
||||
if ( !BitBlt(memoryDC,
|
||||
@@ -657,7 +657,7 @@ bool wxToolBar::Realize()
|
||||
totalBitmapWidth, totalBitmapHeight);
|
||||
}
|
||||
|
||||
bool addBitmap = TRUE;
|
||||
bool addBitmap = true;
|
||||
|
||||
if ( oldToolBarBitmap )
|
||||
{
|
||||
@@ -679,7 +679,7 @@ bool wxToolBar::Realize()
|
||||
::DeleteObject(oldToolBarBitmap);
|
||||
|
||||
// already done
|
||||
addBitmap = FALSE;
|
||||
addBitmap = false;
|
||||
}
|
||||
else
|
||||
#endif // TB_REPLACEBITMAP
|
||||
@@ -687,7 +687,7 @@ bool wxToolBar::Realize()
|
||||
// we can't replace the old bitmap, so we will add another one
|
||||
// (awfully inefficient, but what else to do?) and shift the bitmap
|
||||
// indices accordingly
|
||||
addBitmap = TRUE;
|
||||
addBitmap = true;
|
||||
|
||||
bitmapId = m_nButtons;
|
||||
}
|
||||
@@ -722,7 +722,7 @@ bool wxToolBar::Realize()
|
||||
// this array will hold the indices of all controls in the toolbar
|
||||
wxArrayInt controlIds;
|
||||
|
||||
bool lastWasRadio = FALSE;
|
||||
bool lastWasRadio = false;
|
||||
int i = 0;
|
||||
for ( node = m_tools.GetFirst(); node; node = node->GetNext() )
|
||||
{
|
||||
@@ -741,7 +741,7 @@ bool wxToolBar::Realize()
|
||||
|
||||
wxZeroMemory(button);
|
||||
|
||||
bool isRadio = FALSE;
|
||||
bool isRadio = false;
|
||||
switch ( tool->GetStyle() )
|
||||
{
|
||||
case wxTOOL_STYLE_CONTROL:
|
||||
@@ -785,10 +785,10 @@ bool wxToolBar::Realize()
|
||||
// radio items
|
||||
button.fsState |= TBSTATE_CHECKED;
|
||||
|
||||
tool->Toggle(TRUE);
|
||||
tool->Toggle(true);
|
||||
}
|
||||
|
||||
isRadio = TRUE;
|
||||
isRadio = true;
|
||||
break;
|
||||
|
||||
case wxITEM_CHECK:
|
||||
@@ -839,8 +839,8 @@ bool wxToolBar::Realize()
|
||||
// note that we use TB_GETITEMRECT and not TB_GETRECT because the
|
||||
// latter only appeared in v4.70 of comctl32.dll
|
||||
RECT r;
|
||||
if ( !SendMessage(GetHwnd(), TB_GETITEMRECT,
|
||||
index, (LPARAM)(LPRECT)&r) )
|
||||
if ( !::SendMessage(GetHwnd(), TB_GETITEMRECT,
|
||||
index, (LPARAM)(LPRECT)&r) )
|
||||
{
|
||||
wxLogLastError(wxT("TB_GETITEMRECT"));
|
||||
}
|
||||
@@ -858,7 +858,7 @@ bool wxToolBar::Realize()
|
||||
wxSize size = control->GetSize();
|
||||
|
||||
// the position of the leftmost controls corner
|
||||
int left = -1;
|
||||
int left = wxDefaultCoord;
|
||||
|
||||
// TB_SETBUTTONINFO message is only supported by comctl32.dll 4.71+
|
||||
#ifdef TB_SETBUTTONINFO
|
||||
@@ -872,8 +872,8 @@ bool wxToolBar::Realize()
|
||||
tbbi.cbSize = sizeof(tbbi);
|
||||
tbbi.dwMask = TBIF_SIZE;
|
||||
tbbi.cx = size.x;
|
||||
if ( !SendMessage(GetHwnd(), TB_SETBUTTONINFO,
|
||||
tool->GetId(), (LPARAM)&tbbi) )
|
||||
if ( !::SendMessage(GetHwnd(), TB_SETBUTTONINFO,
|
||||
tool->GetId(), (LPARAM)&tbbi) )
|
||||
{
|
||||
// the id is probably invalid?
|
||||
wxLogLastError(wxT("TB_SETBUTTONINFO"));
|
||||
@@ -896,8 +896,8 @@ bool wxToolBar::Realize()
|
||||
size_t nSeparators = size.x / widthSep;
|
||||
for ( size_t nSep = 0; nSep < nSeparators; nSep++ )
|
||||
{
|
||||
if ( !SendMessage(GetHwnd(), TB_INSERTBUTTON,
|
||||
index, (LPARAM)&tbb) )
|
||||
if ( !::SendMessage(GetHwnd(), TB_INSERTBUTTON,
|
||||
index, (LPARAM)&tbb) )
|
||||
{
|
||||
wxLogLastError(wxT("TB_INSERTBUTTON"));
|
||||
}
|
||||
@@ -910,7 +910,7 @@ bool wxToolBar::Realize()
|
||||
((wxToolBarTool *)tool)->SetSeparatorsCount(nSeparators);
|
||||
|
||||
// adjust the controls width to exactly cover the separators
|
||||
control->SetSize((nSeparators + 1)*widthSep, -1);
|
||||
control->SetSize((nSeparators + 1)*widthSep, wxDefaultCoord);
|
||||
}
|
||||
|
||||
// position the control itself correctly vertically
|
||||
@@ -919,7 +919,7 @@ bool wxToolBar::Realize()
|
||||
if ( diff < 0 )
|
||||
{
|
||||
// the control is too high, resize to fit
|
||||
control->SetSize(-1, height - 2);
|
||||
control->SetSize(wxDefaultCoord, height - 2);
|
||||
|
||||
diff = 2;
|
||||
}
|
||||
@@ -934,7 +934,7 @@ bool wxToolBar::Realize()
|
||||
}
|
||||
else // horizontal toolbar
|
||||
{
|
||||
if ( left == -1 )
|
||||
if ( left == wxDefaultCoord )
|
||||
left = r.left;
|
||||
|
||||
top = r.top;
|
||||
@@ -965,7 +965,7 @@ bool wxToolBar::Realize()
|
||||
}
|
||||
|
||||
InvalidateBestSize();
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -976,7 +976,7 @@ bool wxToolBar::MSWCommand(WXUINT WXUNUSED(cmd), WXWORD id)
|
||||
{
|
||||
wxToolBarToolBase *tool = FindById((int)id);
|
||||
if ( !tool )
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
bool toggled = false; // just to suppress warnings
|
||||
|
||||
@@ -988,7 +988,7 @@ bool wxToolBar::MSWCommand(WXUINT WXUNUSED(cmd), WXWORD id)
|
||||
// ignore the event when a radio button is released, as this doesn't seem to
|
||||
// happen at all, and is handled otherwise
|
||||
if ( tool->GetKind() == wxITEM_RADIO && !toggled )
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
tool->Toggle(toggled);
|
||||
UnToggleRadioGroup(tool);
|
||||
@@ -1004,7 +1004,7 @@ bool wxToolBar::MSWCommand(WXUINT WXUNUSED(cmd), WXWORD id)
|
||||
::SendMessage(GetHwnd(), TB_CHECKBUTTON, id, MAKELONG(toggled, 0));
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxToolBar::MSWOnNotify(int WXUNUSED(idCtrl),
|
||||
@@ -1019,22 +1019,22 @@ bool wxToolBar::MSWOnNotify(int WXUNUSED(idCtrl),
|
||||
// in an ANSI application - this seems to be a bug in comctl32.dll v5
|
||||
UINT code = hdr->code;
|
||||
if ( (code != (UINT) TTN_NEEDTEXTA) && (code != (UINT) TTN_NEEDTEXTW) )
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
HWND toolTipWnd = (HWND)::SendMessage((HWND)GetHWND(), TB_GETTOOLTIPS, 0, 0);
|
||||
if ( toolTipWnd != hdr->hwndFrom )
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
LPTOOLTIPTEXT ttText = (LPTOOLTIPTEXT)lParam;
|
||||
int id = (int)ttText->hdr.idFrom;
|
||||
|
||||
wxToolBarToolBase *tool = FindById(id);
|
||||
if ( !tool )
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
return HandleTooltipNotify(code, lParam, tool->GetShortHelp());
|
||||
#else
|
||||
return FALSE;
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1143,7 +1143,7 @@ wxToolBarToolBase *wxToolBar::FindToolForPosition(wxCoord x, wxCoord y) const
|
||||
void wxToolBar::UpdateSize()
|
||||
{
|
||||
// the toolbar size changed
|
||||
SendMessage(GetHwnd(), TB_AUTOSIZE, 0, 0);
|
||||
::SendMessage(GetHwnd(), TB_AUTOSIZE, 0, 0);
|
||||
|
||||
// we must also refresh the frame after the toolbar size (possibly) changed
|
||||
wxFrame *frame = wxDynamicCast(GetParent(), wxFrame);
|
||||
@@ -1286,10 +1286,10 @@ bool wxToolBar::HandleSize(WXWPARAM WXUNUSED(wParam), WXLPARAM lParam)
|
||||
}
|
||||
|
||||
// message processed
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxToolBar::HandlePaint(WXWPARAM wParam, WXLPARAM lParam)
|
||||
@@ -1308,7 +1308,7 @@ bool wxToolBar::HandlePaint(WXWPARAM wParam, WXLPARAM lParam)
|
||||
if ( !node )
|
||||
{
|
||||
// no controls, nothing to erase
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
// prepare the DC on which we'll be drawing
|
||||
@@ -1317,10 +1317,10 @@ bool wxToolBar::HandlePaint(WXWPARAM wParam, WXLPARAM lParam)
|
||||
dc.SetPen(*wxTRANSPARENT_PEN);
|
||||
|
||||
RECT r;
|
||||
if ( !GetUpdateRect(GetHwnd(), &r, FALSE) )
|
||||
if ( !::GetUpdateRect(GetHwnd(), &r, FALSE) )
|
||||
{
|
||||
// nothing to redraw anyhow
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
wxRect rectUpdate;
|
||||
@@ -1380,16 +1380,16 @@ bool wxToolBar::HandlePaint(WXWPARAM wParam, WXLPARAM lParam)
|
||||
{
|
||||
// yes, do erase it!
|
||||
dc.DrawRectangle(rectItem);
|
||||
|
||||
|
||||
// Necessary in case we use a no-paint-on-size
|
||||
// style in the parent: the controls can disappear
|
||||
control->Refresh(FALSE);
|
||||
control->Refresh(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxToolBar::HandleMouseMove(WXWPARAM WXUNUSED(wParam), WXLPARAM lParam)
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
// Created: 04/01/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ============================================================================
|
||||
|
||||
+83
-83
File diff suppressed because it is too large
Load Diff
+9
-9
@@ -63,7 +63,7 @@ bool wxToggleButton::MSWCommand(WXUINT WXUNUSED(param), WXWORD WXUNUSED(id))
|
||||
event.SetInt(GetValue());
|
||||
event.SetEventObject(this);
|
||||
ProcessCommand(event);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Single check box item
|
||||
@@ -75,12 +75,12 @@ bool wxToggleButton::Create(wxWindow *parent, wxWindowID id,
|
||||
const wxString& name)
|
||||
{
|
||||
if ( !CreateControl(parent, id, pos, size, style, validator, name) )
|
||||
return FALSE;
|
||||
|
||||
return false;
|
||||
|
||||
if ( !MSWCreateControl(wxT("BUTTON"), label, pos, size) )
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
wxBorder wxToggleButton::GetDefaultBorder() const
|
||||
@@ -140,7 +140,7 @@ wxSize wxToggleButton::DoGetBestSize() const
|
||||
|
||||
void wxToggleButton::SetValue(bool val)
|
||||
{
|
||||
SendMessage(GetHwnd(), BM_SETCHECK, val, 0);
|
||||
::SendMessage(GetHwnd(), BM_SETCHECK, val, 0);
|
||||
}
|
||||
|
||||
#ifndef BST_CHECKED
|
||||
@@ -150,9 +150,9 @@ void wxToggleButton::SetValue(bool val)
|
||||
bool wxToggleButton::GetValue() const
|
||||
{
|
||||
#ifdef __WIN32__
|
||||
return (SendMessage(GetHwnd(), BM_GETCHECK, 0, 0) == BST_CHECKED);
|
||||
return (::SendMessage(GetHwnd(), BM_GETCHECK, 0, 0) == BST_CHECKED);
|
||||
#else
|
||||
return ((0x001 & SendMessage(GetHwnd(), BM_GETCHECK, 0, 0)) == 0x001);
|
||||
return ((0x001 & ::SendMessage(GetHwnd(), BM_GETCHECK, 0, 0)) == 0x001);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
+26
-26
@@ -71,8 +71,8 @@
|
||||
|
||||
#ifdef __WXMICROWIN__
|
||||
|
||||
// static inline bool IsIconic(HWND WXUNUSED(hwnd)) { return FALSE; }
|
||||
static inline bool IsZoomed(HWND WXUNUSED(hwnd)) { return FALSE; }
|
||||
// static inline bool IsIconic(HWND WXUNUSED(hwnd)) { return false; }
|
||||
static inline bool IsZoomed(HWND WXUNUSED(hwnd)) { return false; }
|
||||
|
||||
#endif // __WXMICROWIN__
|
||||
|
||||
@@ -134,13 +134,13 @@ END_EVENT_TABLE()
|
||||
void wxTopLevelWindowMSW::Init()
|
||||
{
|
||||
m_iconized =
|
||||
m_maximizeOnShow = FALSE;
|
||||
m_maximizeOnShow = false;
|
||||
|
||||
// Data to save/restore when calling ShowFullScreen
|
||||
m_fsStyle = 0;
|
||||
m_fsOldWindowStyle = 0;
|
||||
m_fsIsMaximized = FALSE;
|
||||
m_fsIsShowing = FALSE;
|
||||
m_fsIsMaximized = false;
|
||||
m_fsIsShowing = false;
|
||||
|
||||
m_winLastFocused = (wxWindow *)NULL;
|
||||
|
||||
@@ -342,7 +342,7 @@ bool wxTopLevelWindowMSW::CreateDialog(const void *dlgTemplate,
|
||||
|
||||
wxLogSysError(wxT("Can't create dialog using memory template"));
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
WXDWORD exflags;
|
||||
@@ -406,7 +406,7 @@ bool wxTopLevelWindowMSW::CreateDialog(const void *dlgTemplate,
|
||||
|
||||
SubclassWin(m_hWnd);
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
#endif // __WXMICROWIN__/!__WXMICROWIN__
|
||||
}
|
||||
|
||||
@@ -453,7 +453,7 @@ bool wxTopLevelWindowMSW::Create(wxWindow *parent,
|
||||
|
||||
SetName(name);
|
||||
|
||||
m_windowId = id == -1 ? NewControlId() : id;
|
||||
m_windowId = id == wxID_ANY ? NewControlId() : id;
|
||||
|
||||
wxTopLevelWindows.Append(this);
|
||||
|
||||
@@ -511,7 +511,7 @@ bool wxTopLevelWindowMSW::Create(wxWindow *parent,
|
||||
// fix we have
|
||||
if ( ret )
|
||||
{
|
||||
SendMessage
|
||||
::SendMessage
|
||||
(
|
||||
GetHwnd(),
|
||||
WM_UPDATEUISTATE,
|
||||
@@ -566,7 +566,7 @@ bool wxTopLevelWindowMSW::Show(bool show)
|
||||
{
|
||||
// don't use wxWindow version as we want to call DoShowWindow() ourselves
|
||||
if ( !wxWindowBase::Show(show) )
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
int nShowCmd;
|
||||
if ( show )
|
||||
@@ -581,7 +581,7 @@ bool wxTopLevelWindowMSW::Show(bool show)
|
||||
DoShowWindow(SW_SHOW);
|
||||
#endif
|
||||
|
||||
m_maximizeOnShow = FALSE;
|
||||
m_maximizeOnShow = false;
|
||||
}
|
||||
else // just show
|
||||
{
|
||||
@@ -609,7 +609,7 @@ bool wxTopLevelWindowMSW::Show(bool show)
|
||||
{
|
||||
::BringWindowToTop(GetHwnd());
|
||||
|
||||
wxActivateEvent event(wxEVT_ACTIVATE, TRUE, m_windowId);
|
||||
wxActivateEvent event(wxEVT_ACTIVATE, true, m_windowId);
|
||||
event.SetEventObject( this );
|
||||
GetEventHandler()->ProcessEvent(event);
|
||||
}
|
||||
@@ -624,7 +624,7 @@ bool wxTopLevelWindowMSW::Show(bool show)
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -649,7 +649,7 @@ void wxTopLevelWindowMSW::Maximize(bool maximize)
|
||||
bool wxTopLevelWindowMSW::IsMaximized() const
|
||||
{
|
||||
#ifdef __WXWINCE__
|
||||
return FALSE;
|
||||
return false;
|
||||
#else
|
||||
return ::IsZoomed(GetHwnd()) != 0;
|
||||
#endif
|
||||
@@ -663,7 +663,7 @@ void wxTopLevelWindowMSW::Iconize(bool iconize)
|
||||
bool wxTopLevelWindowMSW::IsIconized() const
|
||||
{
|
||||
#ifdef __WXWINCE__
|
||||
return FALSE;
|
||||
return false;
|
||||
#else
|
||||
// also update the current state
|
||||
((wxTopLevelWindowMSW *)this)->m_iconized = ::IsIconic(GetHwnd()) != 0;
|
||||
@@ -686,7 +686,7 @@ bool wxTopLevelWindowMSW::ShowFullScreen(bool show, long style)
|
||||
if ( show == IsFullScreen() )
|
||||
{
|
||||
// nothing to do
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
m_fsIsShowing = show;
|
||||
@@ -786,7 +786,7 @@ bool wxTopLevelWindowMSW::ShowFullScreen(bool show, long style)
|
||||
m_fsOldSize.width, m_fsOldSize.height, SWP_FRAMECHANGED);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -823,7 +823,7 @@ bool wxTopLevelWindowMSW::EnableCloseButton(bool enable)
|
||||
{
|
||||
#if !defined(__WXMICROWIN__)
|
||||
// get system (a.k.a. window) menu
|
||||
HMENU hmenu = GetSystemMenu(GetHwnd(), FALSE /* get it */);
|
||||
HMENU hmenu = ::GetSystemMenu(GetHwnd(), FALSE /* get it */);
|
||||
if ( !hmenu )
|
||||
{
|
||||
// no system menu at all -- ok if we want to remove the close button
|
||||
@@ -839,7 +839,7 @@ bool wxTopLevelWindowMSW::EnableCloseButton(bool enable)
|
||||
{
|
||||
wxLogLastError(_T("EnableMenuItem(SC_CLOSE)"));
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
#ifndef __WXWINCE__
|
||||
// update appearance immediately
|
||||
@@ -850,14 +850,14 @@ bool wxTopLevelWindowMSW::EnableCloseButton(bool enable)
|
||||
#endif
|
||||
#endif // !__WXMICROWIN__
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifndef __WXWINCE__
|
||||
|
||||
bool wxTopLevelWindowMSW::SetShape(const wxRegion& region)
|
||||
{
|
||||
wxCHECK_MSG( HasFlag(wxFRAME_SHAPED), FALSE,
|
||||
wxCHECK_MSG( HasFlag(wxFRAME_SHAPED), false,
|
||||
_T("Shaped windows must be created with the wxFRAME_SHAPED style."));
|
||||
|
||||
// The empty region signifies that the shape should be removed from the
|
||||
@@ -867,9 +867,9 @@ bool wxTopLevelWindowMSW::SetShape(const wxRegion& region)
|
||||
if (::SetWindowRgn(GetHwnd(), NULL, TRUE) == 0)
|
||||
{
|
||||
wxLogLastError(_T("SetWindowRgn"));
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Windows takes ownership of the region, so
|
||||
@@ -894,9 +894,9 @@ bool wxTopLevelWindowMSW::SetShape(const wxRegion& region)
|
||||
if (::SetWindowRgn(GetHwnd(), hrgn, TRUE) == 0)
|
||||
{
|
||||
wxLogLastError(_T("SetWindowRgn"));
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif // !__WXWINCE__
|
||||
@@ -1010,7 +1010,7 @@ bool wxTLWHiddenParentModule::OnInit()
|
||||
ms_hwnd = NULL;
|
||||
ms_className = NULL;
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxTLWHiddenParentModule::OnExit()
|
||||
|
||||
@@ -902,7 +902,7 @@ bool wxTreeCtrl::SetBackgroundColour(const wxColour &colour)
|
||||
if ( !wxWindowBase::SetBackgroundColour(colour) )
|
||||
return false;
|
||||
|
||||
SendMessage(GetHwnd(), TVM_SETBKCOLOR, 0, colour.GetPixel());
|
||||
::SendMessage(GetHwnd(), TVM_SETBKCOLOR, 0, colour.GetPixel());
|
||||
#endif
|
||||
|
||||
return true;
|
||||
@@ -914,7 +914,7 @@ bool wxTreeCtrl::SetForegroundColour(const wxColour &colour)
|
||||
if ( !wxWindowBase::SetForegroundColour(colour) )
|
||||
return false;
|
||||
|
||||
SendMessage(GetHwnd(), TVM_SETTEXTCOLOR, 0, colour.GetPixel());
|
||||
::SendMessage(GetHwnd(), TVM_SETTEXTCOLOR, 0, colour.GetPixel());
|
||||
#endif
|
||||
|
||||
return true;
|
||||
@@ -1369,7 +1369,7 @@ void wxTreeCtrl::SetItemFont(const wxTreeItemId& item, const wxFont& font)
|
||||
|
||||
bool wxTreeCtrl::IsVisible(const wxTreeItemId& item) const
|
||||
{
|
||||
wxCHECK_MSG( item.IsOk(), FALSE, wxT("invalid tree item") );
|
||||
wxCHECK_MSG( item.IsOk(), false, wxT("invalid tree item") );
|
||||
|
||||
if ( item == wxTreeItemId(TVI_ROOT) )
|
||||
{
|
||||
@@ -1400,7 +1400,7 @@ bool wxTreeCtrl::IsVisible(const wxTreeItemId& item) const
|
||||
|
||||
bool wxTreeCtrl::ItemHasChildren(const wxTreeItemId& item) const
|
||||
{
|
||||
wxCHECK_MSG( item.IsOk(), FALSE, wxT("invalid tree item") );
|
||||
wxCHECK_MSG( item.IsOk(), false, wxT("invalid tree item") );
|
||||
|
||||
wxTreeViewItem tvItem(item, TVIF_CHILDREN);
|
||||
DoGetItem(&tvItem);
|
||||
@@ -1410,7 +1410,7 @@ bool wxTreeCtrl::ItemHasChildren(const wxTreeItemId& item) const
|
||||
|
||||
bool wxTreeCtrl::IsExpanded(const wxTreeItemId& item) const
|
||||
{
|
||||
wxCHECK_MSG( item.IsOk(), FALSE, wxT("invalid tree item") );
|
||||
wxCHECK_MSG( item.IsOk(), false, wxT("invalid tree item") );
|
||||
|
||||
wxTreeViewItem tvItem(item, TVIF_STATE, TVIS_EXPANDED);
|
||||
DoGetItem(&tvItem);
|
||||
@@ -1420,7 +1420,7 @@ bool wxTreeCtrl::IsExpanded(const wxTreeItemId& item) const
|
||||
|
||||
bool wxTreeCtrl::IsSelected(const wxTreeItemId& item) const
|
||||
{
|
||||
wxCHECK_MSG( item.IsOk(), FALSE, wxT("invalid tree item") );
|
||||
wxCHECK_MSG( item.IsOk(), false, wxT("invalid tree item") );
|
||||
|
||||
wxTreeViewItem tvItem(item, TVIF_STATE, TVIS_SELECTED);
|
||||
DoGetItem(&tvItem);
|
||||
@@ -1430,7 +1430,7 @@ bool wxTreeCtrl::IsSelected(const wxTreeItemId& item) const
|
||||
|
||||
bool wxTreeCtrl::IsBold(const wxTreeItemId& item) const
|
||||
{
|
||||
wxCHECK_MSG( item.IsOk(), FALSE, wxT("invalid tree item") );
|
||||
wxCHECK_MSG( item.IsOk(), false, wxT("invalid tree item") );
|
||||
|
||||
wxTreeViewItem tvItem(item, TVIF_STATE, TVIS_BOLD);
|
||||
DoGetItem(&tvItem);
|
||||
@@ -1588,7 +1588,7 @@ wxTreeItemId wxTreeCtrl::GetPrevVisible(const wxTreeItemId& item) const
|
||||
|
||||
bool wxTreeCtrl::IsItemChecked(const wxTreeItemId& item) const
|
||||
{
|
||||
wxCHECK_MSG( item.IsOk(), FALSE, wxT("invalid tree item") );
|
||||
wxCHECK_MSG( item.IsOk(), false, wxT("invalid tree item") );
|
||||
|
||||
// receive the desired information.
|
||||
wxTreeViewItem tvItem(item, TVIF_STATE, TVIS_STATEIMAGEMASK);
|
||||
|
||||
Reference in New Issue
Block a user