-1->wxID_ANY, TRUE->true, FALSE->false and tabs replacements.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27693 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2004-06-08 19:27:42 +00:00
parent fda5e7a16e
commit a2d49353d4
17 changed files with 755 additions and 755 deletions

View File

@@ -230,22 +230,22 @@ bool wxDynamicSashWindow::Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos, const wxSize& size,
long style, const wxString& name) {
if (m_impl)
return FALSE;
return false;
if (!wxWindow::Create(parent, id, pos, size, style, name))
return FALSE;
return false;
m_impl = new wxDynamicSashWindowImpl(this);
if (!m_impl)
return FALSE;
return false;
if (!m_impl->Create()) {
delete m_impl;
m_impl = NULL;
return FALSE;
return false;
}
return TRUE;
return true;
}
void wxDynamicSashWindow::AddChild(wxWindowBase *child) {
@@ -303,39 +303,39 @@ bool wxDynamicSashWindowImpl::Create() {
m_leaf = new wxDynamicSashWindowLeaf(this);
if (!m_leaf)
return FALSE;
return false;
if (!m_leaf->Create()) {
delete m_leaf;
m_leaf = NULL;
return FALSE;
return false;
}
m_container->SetEventHandler(this);
Connect(-1, wxEVT_SIZE, (wxObjectEventFunction)
Connect(wxID_ANY, wxEVT_SIZE, (wxObjectEventFunction)
(wxEventFunction)
(wxSizeEventFunction)&wxDynamicSashWindowImpl::OnSize);
Connect(-1, wxEVT_PAINT, (wxObjectEventFunction)
Connect(wxID_ANY, wxEVT_PAINT, (wxObjectEventFunction)
(wxEventFunction)
(wxPaintEventFunction)&wxDynamicSashWindowImpl::OnPaint);
Connect(-1, wxEVT_MOTION, (wxObjectEventFunction)
Connect(wxID_ANY, wxEVT_MOTION, (wxObjectEventFunction)
(wxEventFunction)
(wxMouseEventFunction)&wxDynamicSashWindowImpl::OnMouseMove);
Connect(-1, wxEVT_ENTER_WINDOW, (wxObjectEventFunction)
Connect(wxID_ANY, wxEVT_ENTER_WINDOW, (wxObjectEventFunction)
(wxEventFunction)
(wxMouseEventFunction)&wxDynamicSashWindowImpl::OnMouseMove);
Connect(-1, wxEVT_LEAVE_WINDOW, (wxObjectEventFunction)
Connect(wxID_ANY, wxEVT_LEAVE_WINDOW, (wxObjectEventFunction)
(wxEventFunction)
(wxMouseEventFunction)&wxDynamicSashWindowImpl::OnLeave);
Connect(-1, wxEVT_LEFT_DOWN, (wxObjectEventFunction)
Connect(wxID_ANY, wxEVT_LEFT_DOWN, (wxObjectEventFunction)
(wxEventFunction)
(wxMouseEventFunction)&wxDynamicSashWindowImpl::OnPress);
Connect(-1, wxEVT_LEFT_UP, (wxObjectEventFunction)
Connect(wxID_ANY, wxEVT_LEFT_UP, (wxObjectEventFunction)
(wxEventFunction)
(wxMouseEventFunction)&wxDynamicSashWindowImpl::OnRelease);
return TRUE;
return true;
}
void wxDynamicSashWindowImpl::AddChild(wxWindow *window) {
@@ -573,7 +573,7 @@ void wxDynamicSashWindowImpl::Split(int px, int py) {
m_add_child_target = NULL;
m_child[0] = new wxDynamicSashWindowImpl(m_window);
m_child[0]->m_container = new wxWindow(m_container, -1);
m_child[0]->m_container = new wxWindow(m_container, wxID_ANY);
m_child[0]->m_parent = this;
m_child[0]->m_top = m_top;
m_child[0]->Create();
@@ -583,7 +583,7 @@ void wxDynamicSashWindowImpl::Split(int px, int py) {
}
m_child[1] = new wxDynamicSashWindowImpl(m_window);
m_child[1]->m_container = new wxWindow(m_container, -1);
m_child[1]->m_container = new wxWindow(m_container, wxID_ANY);
m_child[1]->m_parent = this;
m_child[1]->m_top = m_top;
m_child[1]->Create();
@@ -892,16 +892,16 @@ bool wxDynamicSashWindowLeaf::Create() {
m_viewport = new wxWindow();
if (!m_hscroll || !m_vscroll || !m_viewport) {
return FALSE;
return false;
}
wxDynamicSashWindowImpl *add_child_target = m_impl->m_add_child_target;
m_impl->m_add_child_target = NULL;
success = m_hscroll->Create(m_impl->m_container, -1, wxDefaultPosition, wxDefaultSize,
success = m_hscroll->Create(m_impl->m_container, wxID_ANY, wxDefaultPosition, wxDefaultSize,
wxSB_HORIZONTAL);
success = success && m_vscroll->Create(m_impl->m_container, -1, wxDefaultPosition, wxDefaultSize,
success = success && m_vscroll->Create(m_impl->m_container, wxID_ANY, wxDefaultPosition, wxDefaultSize,
wxSB_VERTICAL);
success = success && m_viewport->Create(m_impl->m_container, -1);
success = success && m_viewport->Create(m_impl->m_container, wxID_ANY);
m_impl->m_add_child_target = add_child_target;
wxCursor cursor(wxCURSOR_ARROW);
@@ -910,44 +910,44 @@ bool wxDynamicSashWindowLeaf::Create() {
m_viewport->SetCursor(cursor);
m_viewport->SetEventHandler(this);
Connect(-1, wxEVT_DYNAMIC_SASH_REPARENT, (wxObjectEventFunction)&wxDynamicSashWindowLeaf::OnReparent);
Connect(wxID_ANY, wxEVT_DYNAMIC_SASH_REPARENT, (wxObjectEventFunction)&wxDynamicSashWindowLeaf::OnReparent);
if (m_impl->m_window->GetWindowStyle() & wxDS_MANAGE_SCROLLBARS) {
m_hscroll->SetEventHandler(this);
m_vscroll->SetEventHandler(this);
Connect(-1, wxEVT_SET_FOCUS, (wxObjectEventFunction)
Connect(wxID_ANY, wxEVT_SET_FOCUS, (wxObjectEventFunction)
(wxEventFunction)
(wxFocusEventFunction)&wxDynamicSashWindowLeaf::OnFocus);
Connect(-1, wxEVT_SCROLL_TOP, (wxObjectEventFunction)
Connect(wxID_ANY, wxEVT_SCROLL_TOP, (wxObjectEventFunction)
(wxEventFunction)
(wxScrollEventFunction)&wxDynamicSashWindowLeaf::OnScroll);
Connect(-1, wxEVT_SCROLL_BOTTOM, (wxObjectEventFunction)
Connect(wxID_ANY, wxEVT_SCROLL_BOTTOM, (wxObjectEventFunction)
(wxEventFunction)
(wxScrollEventFunction)&wxDynamicSashWindowLeaf::OnScroll);
Connect(-1, wxEVT_SCROLL_LINEUP, (wxObjectEventFunction)
Connect(wxID_ANY, wxEVT_SCROLL_LINEUP, (wxObjectEventFunction)
(wxEventFunction)
(wxScrollEventFunction)&wxDynamicSashWindowLeaf::OnScroll);
Connect(-1, wxEVT_SCROLL_LINEDOWN, (wxObjectEventFunction)
Connect(wxID_ANY, wxEVT_SCROLL_LINEDOWN, (wxObjectEventFunction)
(wxEventFunction)
(wxScrollEventFunction)&wxDynamicSashWindowLeaf::OnScroll);
Connect(-1, wxEVT_SCROLL_PAGEUP, (wxObjectEventFunction)
Connect(wxID_ANY, wxEVT_SCROLL_PAGEUP, (wxObjectEventFunction)
(wxEventFunction)
(wxScrollEventFunction)&wxDynamicSashWindowLeaf::OnScroll);
Connect(-1, wxEVT_SCROLL_PAGEDOWN, (wxObjectEventFunction)
Connect(wxID_ANY, wxEVT_SCROLL_PAGEDOWN, (wxObjectEventFunction)
(wxEventFunction)
(wxScrollEventFunction)&wxDynamicSashWindowLeaf::OnScroll);
Connect(-1, wxEVT_SCROLL_THUMBTRACK, (wxObjectEventFunction)
Connect(wxID_ANY, wxEVT_SCROLL_THUMBTRACK, (wxObjectEventFunction)
(wxEventFunction)
(wxScrollEventFunction)&wxDynamicSashWindowLeaf::OnScroll);
Connect(-1, wxEVT_SCROLL_THUMBRELEASE, (wxObjectEventFunction)
Connect(wxID_ANY, wxEVT_SCROLL_THUMBRELEASE, (wxObjectEventFunction)
(wxEventFunction)
(wxScrollEventFunction)&wxDynamicSashWindowLeaf::OnScroll);
}
wxLayoutConstraints *layout = new wxLayoutConstraints();
if (!layout)
return FALSE;
return false;
wxSize size = m_hscroll->GetBestSize();
#ifdef __WXMSW__
size = m_hscroll->GetSize();
@@ -961,7 +961,7 @@ bool wxDynamicSashWindowLeaf::Create() {
layout = new wxLayoutConstraints();
if (!layout)
return FALSE;
return false;
size = size = m_vscroll->GetBestSize();
#ifdef __WXMSW__
size = m_vscroll->GetSize();
@@ -975,7 +975,7 @@ bool wxDynamicSashWindowLeaf::Create() {
layout = new wxLayoutConstraints();
if (!layout)
return FALSE;
return false;
layout->left.SameAs(m_impl->m_container, wxLeft, 3);
layout->right.LeftOf(m_vscroll);
layout->top.SameAs(m_impl->m_container, wxTop, 3);

View File

@@ -36,7 +36,7 @@ class CleverListCtrl : public wxListCtrl
{
public:
CleverListCtrl(wxWindow *parent,
wxWindowID id = -1,
wxWindowID id = wxID_ANY,
const wxPoint &pos = wxDefaultPosition,
const wxSize &size = wxDefaultSize,
long style = wxLC_ICON,
@@ -119,10 +119,10 @@ wxEditableListBox::wxEditableListBox(wxWindow *parent, wxWindowID id,
wxSizer *sizer = new wxBoxSizer(wxVERTICAL);
wxPanel *subp = new wxPanel(this, -1, wxDefaultPosition, wxDefaultSize,
wxPanel *subp = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxDefaultSize,
wxSUNKEN_BORDER | wxTAB_TRAVERSAL);
wxSizer *subsizer = new wxBoxSizer(wxHORIZONTAL);
subsizer->Add(new wxStaticText(subp, -1, label), 1, wxALIGN_CENTRE_VERTICAL | wxLEFT, 4);
subsizer->Add(new wxStaticText(subp, wxID_ANY, label), 1, wxALIGN_CENTRE_VERTICAL | wxLEFT, 4);
#ifdef __WXMSW__
#define BTN_BORDER 4
@@ -165,7 +165,7 @@ wxEditableListBox::wxEditableListBox(wxWindow *parent, wxWindowID id,
m_bDown->SetToolTip(_("Move down"));
#endif
subp->SetAutoLayout(TRUE);
subp->SetAutoLayout(true);
subp->SetSizer(subsizer);
subsizer->Fit(subp);
@@ -181,7 +181,7 @@ wxEditableListBox::wxEditableListBox(wxWindow *parent, wxWindowID id,
sizer->Add(m_listCtrl, 1, wxEXPAND);
SetAutoLayout(TRUE);
SetAutoLayout(true);
SetSizer(sizer);
Layout();
}

View File

@@ -66,7 +66,7 @@ wxLEDNumberCtrl::wxLEDNumberCtrl()
m_DigitMargin(-1),
m_LineLength(-1),
m_LineWidth(-1),
m_DrawFaded(FALSE),
m_DrawFaded(false),
m_LeftStartPos(-1)
{
}
@@ -80,7 +80,7 @@ wxLEDNumberCtrl::wxLEDNumberCtrl(wxWindow *parent, wxWindowID id,
m_DigitMargin(-1),
m_LineLength(-1),
m_LineWidth(-1),
m_DrawFaded(FALSE),
m_DrawFaded(false),
m_LeftStartPos(-1)
{
Create(parent, id, pos, size, style);
@@ -94,7 +94,7 @@ bool wxLEDNumberCtrl::Create(wxWindow *parent, wxWindowID id,
bool RetVal = wxControl::Create(parent, id, pos, size, style);
if ((style & wxLED_DRAW_FADED) != 0)
SetDrawFaded(TRUE);
SetDrawFaded(true);
if ((style & wxLED_ALIGN_MASK) != 0)
SetAlignment((wxLEDValueAlign)(style & wxLED_ALIGN_MASK));
@@ -113,7 +113,7 @@ void wxLEDNumberCtrl::SetAlignment(wxLEDValueAlign Alignment, bool Redraw)
RecalcInternals(GetClientSize());
if (Redraw)
Refresh(FALSE);
Refresh(false);
}
}
@@ -125,7 +125,7 @@ void wxLEDNumberCtrl::SetDrawFaded(bool DrawFaded, bool Redraw)
m_DrawFaded = DrawFaded;
if (Redraw)
Refresh(FALSE);
Refresh(false);
}
}
@@ -149,7 +149,7 @@ void wxLEDNumberCtrl::SetValue(wxString const &Value, bool Redraw)
RecalcInternals(GetClientSize());
if (Redraw)
Refresh(FALSE);
Refresh(false);
}
}
@@ -271,7 +271,7 @@ void wxLEDNumberCtrl::DrawDigit(wxDC &Dc, int Digit, int Column)
{
Dc.DrawLine(XPos + m_LineMargin*2, m_LineMargin,
XPos + m_LineLength, m_LineMargin);
}
}
if (Digit & LINE2)
{

File diff suppressed because it is too large Load Diff

View File

@@ -60,8 +60,8 @@ BEGIN_EVENT_TABLE(wxRemotelyScrolledTreeCtrl, wxTreeCtrl)
#endif
EVT_SIZE(wxRemotelyScrolledTreeCtrl::OnSize)
EVT_PAINT(wxRemotelyScrolledTreeCtrl::OnPaint)
EVT_TREE_ITEM_EXPANDED(-1, wxRemotelyScrolledTreeCtrl::OnExpand)
EVT_TREE_ITEM_COLLAPSED(-1, wxRemotelyScrolledTreeCtrl::OnExpand)
EVT_TREE_ITEM_EXPANDED(wxID_ANY, wxRemotelyScrolledTreeCtrl::OnExpand)
EVT_TREE_ITEM_COLLAPSED(wxID_ANY, wxRemotelyScrolledTreeCtrl::OnExpand)
EVT_SCROLLWIN(wxRemotelyScrolledTreeCtrl::OnScroll)
END_EVENT_TABLE()
@@ -90,7 +90,7 @@ void wxRemotelyScrolledTreeCtrl::HideVScrollbar()
if (!IsKindOf(CLASSINFO(wxGenericTreeCtrl)))
#endif
{
::ShowScrollBar((HWND) GetHWND(), SB_VERT, FALSE);
::ShowScrollBar((HWND) GetHWND(), SB_VERT, false);
}
#if USE_GENERIC_TREECTRL
else
@@ -122,7 +122,7 @@ void wxRemotelyScrolledTreeCtrl::SetScrollbars(
if (IsKindOf(CLASSINFO(wxGenericTreeCtrl)))
{
wxGenericTreeCtrl* win = (wxGenericTreeCtrl*) this;
win->wxGenericTreeCtrl::SetScrollbars(pixelsPerUnitX, pixelsPerUnitY, noUnitsX, 0, xPos, 0, /* noRefresh */ TRUE);
win->wxGenericTreeCtrl::SetScrollbars(pixelsPerUnitX, pixelsPerUnitY, noUnitsX, 0, xPos, 0, /* noRefresh */ true);
wxScrolledWindow* scrolledWindow = GetScrolledWindow();
if (scrolledWindow)
@@ -541,7 +541,7 @@ void wxTreeCompanionWindow::OnScroll(wxScrollWinEvent& event)
return;
// TODO: scroll the window physically instead of just refreshing.
Refresh(TRUE);
Refresh(true);
}
void wxTreeCompanionWindow::OnExpand(wxTreeEvent& WXUNUSED(event))
@@ -674,37 +674,37 @@ void wxSplitterScrolledWindow::OnScroll(wxScrollWinEvent& event)
{
// Ensure that events being propagated back up the window hierarchy
// don't cause an infinite loop
static bool inOnScroll = FALSE;
static bool inOnScroll = false;
if (inOnScroll)
{
event.Skip();
return;
}
inOnScroll = TRUE;
inOnScroll = true;
int orient = event.GetOrientation();
int nScrollInc = CalcScrollInc(event);
if (nScrollInc == 0)
{
inOnScroll = FALSE;
inOnScroll = false;
return;
}
if (orient == wxHORIZONTAL)
{
inOnScroll = FALSE;
inOnScroll = false;
event.Skip();
return;
#if 0
int newPos = m_xScrollPosition + nScrollInc;
SetScrollPos(wxHORIZONTAL, newPos, TRUE );
SetScrollPos(wxHORIZONTAL, newPos, true );
#endif
}
else
{
int newPos = m_yScrollPosition + nScrollInc;
SetScrollPos(wxVERTICAL, newPos, TRUE );
SetScrollPos(wxVERTICAL, newPos, true );
}
if (orient == wxHORIZONTAL)
@@ -735,6 +735,6 @@ void wxSplitterScrolledWindow::OnScroll(wxScrollWinEvent& event)
m_targetWindow->Update() ;
inOnScroll = FALSE;
inOnScroll = false;
}

View File

@@ -43,9 +43,9 @@ bool wxStaticPicture::Create(wxWindow *parent, wxWindowID id,
wxSize size = s ;
if ( bitmap.Ok() )
{
if ( size.x == -1 )
if ( size.x == wxDefaultSize.x )
size.x = bitmap.GetWidth() ;
if ( size.y == -1 )
if ( size.y == wxDefaultSize.y )
size.y = bitmap.GetHeight() ;
}
@@ -63,7 +63,7 @@ bool wxStaticPicture::Create(wxWindow *parent, wxWindowID id,
OriginalImage = Bitmap.ConvertToImage();
#endif
if ( id == -1 )
if ( id == wxID_ANY )
m_windowId = (int)NewControlId();
else
m_windowId = id;