projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Optimize alpha handling in wxImage::Rotate90() too.
[wxWidgets.git]
/
src
/
osx
/
tglbtn_osx.cpp
diff --git
a/src/osx/tglbtn_osx.cpp
b/src/osx/tglbtn_osx.cpp
index 4aff7506b6886aaa4f6678091b8f3be3d232852a..c381cd4edafa0f5c51c35d9f78a07a0acc7bc369 100644
(file)
--- a/
src/osx/tglbtn_osx.cpp
+++ b/
src/osx/tglbtn_osx.cpp
@@
-5,9
+5,9
@@
// Author: Stefan Csomor
// Modified by:
// Created: 08.02.01
// Author: Stefan Csomor
// Modified by:
// Created: 08.02.01
-// RCS-ID: $Id
: tglbtn.cpp 54129 2008-06-11 19:30:52Z SC
$
+// RCS-ID: $Id$
// Copyright: (c) Stefan Csomor
// Copyright: (c) Stefan Csomor
-// Licen
se: wxWindows licens
e
+// Licen
ce: wxWindows licenc
e
/////////////////////////////////////////////////////////////////////////////
// ============================================================================
/////////////////////////////////////////////////////////////////////////////
// ============================================================================
@@
-24,14
+24,14
@@
#include "wx/tglbtn.h"
#include "wx/osx/private.h"
#include "wx/tglbtn.h"
#include "wx/osx/private.h"
-#include "wx/bmpbuttn.h"
// for wxDEFAULT_BUTTON_MARGIN
+#include "wx/bmpbuttn.h" // for wxDEFAULT_BUTTON_MARGIN
// ----------------------------------------------------------------------------
// macros
// ----------------------------------------------------------------------------
IMPLEMENT_DYNAMIC_CLASS(wxToggleButton, wxControl)
// ----------------------------------------------------------------------------
// macros
// ----------------------------------------------------------------------------
IMPLEMENT_DYNAMIC_CLASS(wxToggleButton, wxControl)
-wxDEFINE_EVENT( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEvent )
+wxDEFINE_EVENT( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEvent )
;
// ============================================================================
// implementation
// ============================================================================
// implementation
@@
-47,27
+47,27
@@
bool wxToggleButton::Create(wxWindow *parent, wxWindowID id,
const wxValidator& validator,
const wxString& name)
{
const wxValidator& validator,
const wxString& name)
{
-
m_macIsUserPane = FALSE
;
+
DontCreatePeer()
;
if ( !wxControl::Create(parent, id, pos, size, style, validator, name) )
return false;
if ( !wxControl::Create(parent, id, pos, size, style, validator, name) )
return false;
-
+
m_labelOrig = m_label = label ;
m_labelOrig = m_label = label ;
-
m_peer = wxWidgetImpl::CreateToggleButton( this, parent, id, label, pos, size, style, GetExtraStyle()
) ;
+
SetPeer(wxWidgetImpl::CreateToggleButton( this, parent, id, label, pos, size, style, GetExtraStyle() )
) ;
MacPostControlCreate(pos,size) ;
MacPostControlCreate(pos,size) ;
-
+
return TRUE;
}
wxSize wxToggleButton::DoGetBestSize() const
{
return TRUE;
}
wxSize wxToggleButton::DoGetBestSize() const
{
- int wBtn = 70 ;
+ int wBtn = 70 ;
int hBtn = 20 ;
int lBtn = m_label.Length() * 8 + 12 ;
int hBtn = 20 ;
int lBtn = m_label.Length() * 8 + 12 ;
- if (lBtn > wBtn)
+ if (lBtn > wBtn)
wBtn = lBtn;
return wxSize ( wBtn , hBtn ) ;
wBtn = lBtn;
return wxSize ( wBtn , hBtn ) ;
@@
-75,12
+75,12
@@
wxSize wxToggleButton::DoGetBestSize() const
void wxToggleButton::SetValue(bool val)
{
void wxToggleButton::SetValue(bool val)
{
-
m_peer
->SetValue( val ) ;
+
GetPeer()
->SetValue( val ) ;
}
bool wxToggleButton::GetValue() const
{
}
bool wxToggleButton::GetValue() const
{
- return
m_peer
->GetValue() ;
+ return
GetPeer()
->GetValue() ;
}
void wxToggleButton::Command(wxCommandEvent & event)
}
void wxToggleButton::Command(wxCommandEvent & event)
@@
-89,7
+89,7
@@
void wxToggleButton::Command(wxCommandEvent & event)
ProcessCommand(event);
}
ProcessCommand(event);
}
-bool wxToggleButton::
HandleClicked( double timestampsec )
+bool wxToggleButton::
OSXHandleClicked( double WXUNUSED(timestampsec) )
{
wxCommandEvent event(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, m_windowId);
event.SetInt(GetValue());
{
wxCommandEvent event(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, m_windowId);
event.SetInt(GetValue());
@@
-111,20
+111,20
@@
bool wxBitmapToggleButton::Create(wxWindow *parent, wxWindowID id,
const wxValidator& validator,
const wxString& name)
{
const wxValidator& validator,
const wxString& name)
{
-
m_macIsUserPane = FALSE
;
+
DontCreatePeer()
;
m_bitmap = label;
m_bitmap = label;
-
+
m_marginX =
m_marginY = wxDEFAULT_BUTTON_MARGIN;
m_marginX =
m_marginY = wxDEFAULT_BUTTON_MARGIN;
-
+
if ( !wxControl::Create(parent, id, pos, size, style, validator, name) )
return false;
if ( !wxControl::Create(parent, id, pos, size, style, validator, name) )
return false;
-
-
m_peer = wxWidgetImpl::CreateBitmapToggleButton( this, parent, id, label, pos, size, style, GetExtraStyle() )
;
+
+
SetPeer(wxWidgetImpl::CreateBitmapToggleButton( this, parent, id, label, pos, size, style, GetExtraStyle() ))
;
MacPostControlCreate(pos,size) ;
MacPostControlCreate(pos,size) ;
-
+
return TRUE;
}
return TRUE;
}
@@
-142,12
+142,12
@@
wxSize wxBitmapToggleButton::DoGetBestSize() const
void wxBitmapToggleButton::SetValue(bool val)
{
void wxBitmapToggleButton::SetValue(bool val)
{
-
m_peer
->SetValue( val ) ;
+
GetPeer()
->SetValue( val ) ;
}
bool wxBitmapToggleButton::GetValue() const
{
}
bool wxBitmapToggleButton::GetValue() const
{
- return
m_peer
->GetValue() ;
+ return
GetPeer()
->GetValue() ;
}
void wxBitmapToggleButton::Command(wxCommandEvent & event)
}
void wxBitmapToggleButton::Command(wxCommandEvent & event)
@@
-156,7
+156,7
@@
void wxBitmapToggleButton::Command(wxCommandEvent & event)
ProcessCommand(event);
}
ProcessCommand(event);
}
-bool wxBitmapToggleButton::
HandleClicked( double timestampsec )
+bool wxBitmapToggleButton::
OSXHandleClicked( double WXUNUSED(timestampsec) )
{
wxCommandEvent event(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, m_windowId);
event.SetInt(GetValue());
{
wxCommandEvent event(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, m_windowId);
event.SetInt(GetValue());