// Name: wx/generic/srchctlg.h
// Purpose: generic wxSearchCtrl class
// Author: Vince Harron
-// Modified by:
// Created: 2006-02-19
-// RCS-ID:
+// RCS-ID: $Id$
// Copyright: Vince Harron
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxSearchCtrlNameStr);
- ~wxSearchCtrl();
+ virtual ~wxSearchCtrl();
bool Create(wxWindow *parent, wxWindowID id,
const wxString& value = wxEmptyString,
// --------------------------
virtual void SetMenu( wxMenu* menu );
virtual wxMenu* GetMenu();
-
+
// get/set search options
// ----------------------
virtual void ShowSearchButton( bool show );
// Name: wx/mac/carbon/srchctrl.h
// Purpose: mac carbon wxSearchCtrl class
// Author: Vince Harron
-// Modified by:
// Created: 2006-02-19
-// RCS-ID:
+// RCS-ID: $Id$
// Copyright: Vince Harron
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxSearchCtrlNameStr);
- ~wxSearchCtrl();
+ virtual ~wxSearchCtrl();
bool Create(wxWindow *parent, wxWindowID id,
const wxString& value = wxEmptyString,
// --------------------------
virtual void SetMenu( wxMenu* menu );
virtual wxMenu* GetMenu();
-
+
// get/set search options
// ----------------------
virtual void ShowSearchButton( bool show );
wxMacSearchFieldControl * GetPeer() const
{ return (wxMacSearchFieldControl*) m_peer; }
-
+
virtual void SetFocus();
-
+
protected:
wxSize DoGetBestSize() const;
-
+
void Init();
virtual void CreatePeer(
// Name: srchctrl.h
// Purpose: wxSearchCtrlBase class
// Author: Vince Harron
-// Modified by:
// Created: 2006-02-18
-// RCS-ID:
+// RCS-ID: $Id$
// Copyright: (c) Vince Harron
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// Name: src/generic/srchctlg.cpp
// Purpose: implements wxSearchCtrl as a composite control
// Author: Vince Harron
-// Modified by:
// Created: 2006-02-19
-// RCS-ID:
+// RCS-ID: $Id$
// Copyright: Vince Harron
// License: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
style | wxNO_BORDER)
{
m_search = search;
-
+
// remove the default minsize, the searchctrl will have one instead
SetSizeHints(wxDefaultCoord,wxDefaultCoord);
}
// copy constructor is disabled for some reason?
//wxTextUrlEvent event(eventText);
wxTextUrlEvent event(
- m_search->GetId(),
+ m_search->GetId(),
eventText.GetMouseEvent(),
eventText.GetURLStart(),
eventText.GetURLEnd()
void SetBitmapLabel(const wxBitmap& label) { m_bmp = label; }
-
+
protected:
wxSize DoGetBestSize() const
{
return wxSize(m_bmp.GetWidth(), m_bmp.GetHeight());
}
-
+
void OnLeftUp(wxMouseEvent&)
{
wxCommandEvent event(m_eventType, m_search->GetId());
dc.DrawBitmap(m_bmp, 0,0, true);
}
-
+
private:
wxSearchCtrl *m_search;
wxEventType m_eventType;
// --------
wxSearchCtrl::wxSearchCtrl()
-{
+{
Init();
}
if ( !m_searchBitmapUser )
{
- if (
+ if (
!m_searchBitmap.Ok() ||
- m_searchBitmap.GetHeight() != bitmapHeight ||
+ m_searchBitmap.GetHeight() != bitmapHeight ||
m_searchBitmap.GetWidth() != bitmapWidth
)
{
if ( !m_searchMenuBitmapUser )
{
- if (
+ if (
!m_searchMenuBitmap.Ok() ||
- m_searchMenuBitmap.GetHeight() != bitmapHeight ||
+ m_searchMenuBitmap.GetHeight() != bitmapHeight ||
m_searchMenuBitmap.GetWidth() != bitmapWidth
)
{
if ( !m_cancelBitmapUser )
{
- if (
+ if (
!m_cancelBitmap.Ok() ||
- m_cancelBitmap.GetHeight() != bitmapHeight ||
+ m_cancelBitmap.GetHeight() != bitmapHeight ||
m_cancelBitmap.GetWidth() != bitmapHeight
)
{
// Name: src/mac/carbon/srchctrl.cpp
// Purpose: implements mac carbon wxSearchCtrl
// Author: Vince Harron
-// Modified by:
// Created: 2006-02-19
-// RCS-ID:
+// RCS-ID: $Id$
// Copyright: Vince Harron
// License: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
attributes = kHISearchFieldAttributesSearchIcon;
}
HIRect hibounds = { { bounds->left, bounds->top }, { bounds->right-bounds->left, bounds->bottom-bounds->top } };
- verify_noerr( HISearchFieldCreate(
+ verify_noerr( HISearchFieldCreate(
&hibounds,
attributes,
0, // MenuRef
CFSTR("Search"),
&m_controlRef
) );
- HIViewSetVisible (m_controlRef, true);
+ HIViewSetVisible (m_controlRef, true);
}
// search field options
}
bool wxMacSearchFieldControl::GetSearchButtonVisible() const
-{
+{
OptionBits attributes = 0;
verify_noerr( HISearchFieldGetAttributes( m_controlRef, &attributes ) );
return ( attributes & kHISearchFieldAttributesSearchIcon ) != 0;
}
bool wxMacSearchFieldControl::GetCancelButtonVisible() const
-{
+{
OptionBits attributes = 0;
verify_noerr( HISearchFieldGetAttributes( m_controlRef, &attributes ) );
return ( attributes & kHISearchFieldAttributesCancel ) != 0;
// --------
wxSearchCtrl::wxSearchCtrl()
-{
+{
Init();
}
// it seems to return a default width of about 16, which is way too small here.
if (size.GetWidth() < 100)
size.SetWidth(100);
-
+
return size;
}