// Author: Jaakko Salli
// Modified by:
// Created: 2007-04-14
-// RCS-ID: $Id:
+// RCS-ID: $Id$
// Copyright: (c) Jaakko Salli
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
// This define is necessary to prevent macro clearing
#define __wxPG_SOURCE_FILE__
-#include <wx/propgrid/propgrid.h>
-#include <wx/propgrid/editors.h>
-#include <wx/propgrid/props.h>
+#include "wx/propgrid/propgrid.h"
+#include "wx/propgrid/editors.h"
+#include "wx/propgrid/props.h"
#if wxPG_USE_RENDERER_NATIVE
- #include <wx/renderer.h>
+ #include "wx/renderer.h"
#endif
// How many pixels between textctrl and button
#define wxPG_BUTTON_SIZEDEC 0
-#include <wx/odcombo.h>
+#include "wx/odcombo.h"
#ifdef __WXMSW__
- #include <wx/msw/private.h>
+ #include "wx/msw/private.h"
#endif
// -----------------------------------------------------------------------
{
}
+wxString wxPGEditor::GetName() const
+{
+ return GetClassInfo()->GetClassName();
+}
+
void wxPGEditor::DrawValue( wxDC& dc, const wxRect& rect, wxPGProperty* property, const wxString& text ) const
{
if ( !property->IsValueUnspecified() )
// wxPGTextCtrlEditor
// -----------------------------------------------------------------------
-WX_PG_IMPLEMENT_EDITOR_CLASS(TextCtrl,wxPGTextCtrlEditor,wxPGEditor)
+WX_PG_IMPLEMENT_INTERNAL_EDITOR_CLASS(TextCtrl,wxPGTextCtrlEditor,wxPGEditor)
wxPGWindowList wxPGTextCtrlEditor::CreateControls( wxPropertyGrid* propGrid,
// -----------------------------------------------------------------------
-WX_PG_IMPLEMENT_EDITOR_CLASS(Choice,wxPGChoiceEditor,wxPGEditor)
+WX_PG_IMPLEMENT_INTERNAL_EDITOR_CLASS(Choice,wxPGChoiceEditor,wxPGEditor)
// This is a special enhanced double-click processor class.
// -----------------------------------------------------------------------
-WX_PG_IMPLEMENT_EDITOR_CLASS(ComboBox,wxPGComboBoxEditor,wxPGChoiceEditor)
+WX_PG_IMPLEMENT_INTERNAL_EDITOR_CLASS(ComboBox,
+ wxPGComboBoxEditor,
+ wxPGChoiceEditor)
void wxPGComboBoxEditor::UpdateControl( wxPGProperty* property, wxWindow* ctrl ) const
// -----------------------------------------------------------------------
-// This simpler implement_editor macro doesn't define class body.
-WX_PG_IMPLEMENT_EDITOR_CLASS(ChoiceAndButton,wxPGChoiceAndButtonEditor,wxPGChoiceEditor)
+WX_PG_IMPLEMENT_INTERNAL_EDITOR_CLASS(ChoiceAndButton,
+ wxPGChoiceAndButtonEditor,
+ wxPGChoiceEditor)
wxPGWindowList wxPGChoiceAndButtonEditor::CreateControls( wxPropertyGrid* propGrid,
ch_sz.x -= wxPG_TEXTCTRL_AND_BUTTON_SPACING;
#endif
- wxWindow* ch = wxPG_EDITOR(Choice)->CreateControls(propGrid,property,
+ wxWindow* ch = wxPGEditor_Choice->CreateControls(propGrid,property,
pos,ch_sz).m_primary;
#ifdef __WXMSW__
// wxPGTextCtrlAndButtonEditor
// -----------------------------------------------------------------------
-
-// This simpler implement_editor macro doesn't define class body.
-WX_PG_IMPLEMENT_EDITOR_CLASS(TextCtrlAndButton,wxPGTextCtrlAndButtonEditor,wxPGTextCtrlEditor)
+WX_PG_IMPLEMENT_INTERNAL_EDITOR_CLASS(TextCtrlAndButton,
+ wxPGTextCtrlAndButtonEditor,
+ wxPGTextCtrlEditor)
wxPGWindowList wxPGTextCtrlAndButtonEditor::CreateControls( wxPropertyGrid* propGrid,
#if wxPG_INCLUDE_CHECKBOX
-WX_PG_IMPLEMENT_EDITOR_CLASS(CheckBox,wxPGCheckBoxEditor,wxPGEditor)
+WX_PG_IMPLEMENT_INTERNAL_EDITOR_CLASS(CheckBox,
+ wxPGCheckBoxEditor,
+ wxPGEditor)
// state argument: 0x01 = set if checked
wxPropertyGrid* propGrid = (wxPropertyGrid*) GetParent()->GetParent();
wxASSERT( propGrid->IsKindOf(CLASSINFO(wxPropertyGrid)) );
- if ( event.GetEventType() == wxEVT_NAVIGATION_KEY )
- {
- //wxLogDebug(wxT("wxEVT_NAVIGATION_KEY"));
- //SetFocusFromKbd();
- //event.Skip();
- //return wxControl::ProcessEvent(event);
- }
- else
if ( ( (event.GetEventType() == wxEVT_LEFT_DOWN || event.GetEventType() == wxEVT_LEFT_DCLICK)
&& ((wxMouseEvent&)event).m_x > (wxPG_XBEFORETEXT-2)
&& ((wxMouseEvent&)event).m_x <= (wxPG_XBEFORETEXT-2+m_boxHeight) )
{
wxKeyEvent& keyEv = (wxKeyEvent&) event;
- if ( keyEv.GetKeyCode() == WXK_TAB )
- {
- propGrid->SendNavigationKeyEvent( keyEv.ShiftDown()?0:1 );
- return true;
- }
- else
if ( keyEv.GetKeyCode() == WXK_SPACE )
{
SetValue(2);