IMPLEMENT_ABSTRACT_CLASS(wxWindowMSW, wxWindowBase)
#else // __WXMSW__
#if wxUSE_EXTENDED_RTTI
+
IMPLEMENT_DYNAMIC_CLASS_XTI(wxWindow, wxWindowBase,"wx/window.h")
+// make wxWindowList known before the property is used
+
+template<> const wxTypeInfo* wxGetTypeInfo( wxWindowList * )
+{
+ static wxCollectionTypeInfo s_typeInfo( (wxTypeInfo*) wxGetTypeInfo( (wxWindow **) NULL) ) ;
+ return &s_typeInfo ;
+}
+
+template<> void wxCollectionToVariantArray( wxWindowList const &theList, wxxVariantArray &value)
+{
+ wxListCollectionToVariantArray( theList , value ) ;
+}
+
WX_BEGIN_PROPERTIES_TABLE(wxWindow)
- // WX_DEFAULT_CHILD_PARENT_RELATION( Parent , Children ) ;
- WX_READONLY_PROPERTY( Parent,wxWindow*, GetParent, )
+ // Always constructor Properties first
+
+ WX_READONLY_PROPERTY( Parent,wxWindow*, GetParent, )
WX_PROPERTY( Id,wxWindowID, SetId, GetId, -1 )
+ WX_PROPERTY( Position,wxPoint, SetPosition , GetPosition, wxPoint(-1,-1) ) // pos
+ WX_PROPERTY( Size,wxSize, SetSize, GetSize, wxSize(-1,-1) ) // size
+ WX_PROPERTY( WindowStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , ) // style
+
+ // Then all relations of the object graph
+
+ WX_READONLY_PROPERTY_COLLECTION( Children , wxWindowList , wxWindowBase* , GetWindowChildren )
+
+ // and finally all other properties
+
+ WX_PROPERTY( ExtraStyle , long , SetExtraStyle , GetExtraStyle , ) // extstyle
+ WX_PROPERTY( BackgroundColour , wxColour , SetBackgroundColour , GetBackgroundColour , ) // bg
+ WX_PROPERTY( ForegroundColour , wxColour , SetForegroundColour , GetForegroundColour , ) // fg
+ WX_PROPERTY( Enabled , bool , Enable , IsEnabled , wxxVariant((bool)true) )
+ WX_PROPERTY( Shown , bool , Show , IsShown , wxxVariant((bool)true) )
+#if 0
+ // possible property candidates (not in xrc) or not valid in all subclasses
+ WX_PROPERTY( Title,wxString, SetTitle, GetTitle, wxT("") )
+ WX_PROPERTY( Font , wxFont , SetFont , GetWindowFont , )
+ WX_PROPERTY( Label,wxString, SetLabel, GetLabel, wxT("") )
// MaxHeight, Width , MinHeight , Width
// TODO switch label to control and title to toplevels
- WX_PROPERTY_SET_BY_REF( Title,wxString, SetTitle, GetTitle, wxT("") )
- WX_PROPERTY_SET_BY_REF( Label,wxString, SetLabel, GetLabel, wxT("") )
- WX_PROPERTY_SET_BY_REF( Position,wxPoint, SetPosition , GetPosition, wxPoint(-1,-1) ) // pos
- WX_PROPERTY_SET_BY_REF( Size,wxSize, SetSize, GetSize, wxSize(-1,-1) ) // size
- WX_PROPERTY( WindowStyle , long , SetWindowStyle , GetWindowStyle , ) // style
- WX_PROPERTY( ExtraStyle , long , SetExtraStyle , GetExtraStyle , ) // extstyle
+
WX_PROPERTY( ThemeEnabled , bool , SetThemeEnabled , GetThemeEnabled , )
- WX_PROPERTY_SET_BY_REF_RET_BOOL( BackgroundColour , wxColour , SetBackgroundColour , GetBackgroundColour , ) // bg
- WX_PROPERTY_SET_BY_REF_RET_BOOL( ForegroundColour , wxColour , SetForegroundColour , GetForegroundColour , ) // fg
- //WX_PROPERTY_SET_BY_REF( Cursor , wxCursor , SetCursor , GetCursor , )
- WX_PROPERTY_SET_AND_GET_BY_REF_RET_BOOL( Font , wxFont , SetFont , GetFont , )
+ //WX_PROPERTY( Cursor , wxCursor , SetCursor , GetCursor , )
// WX_PROPERTY( ToolTip , wxString , SetToolTip , GetToolTipText , )
WX_PROPERTY( AutoLayout , bool , SetAutoLayout , GetAutoLayout , )
- WX_PROPERTY_SET_RET_BOOL( Enabled , bool , Enable , IsEnabled , wxxVariant((bool)true) )
- WX_PROPERTY_SET_RET_BOOL( Shown , bool , Show , IsShown , wxxVariant((bool)true) )
+
+
+
+#endif
WX_END_PROPERTIES_TABLE()
WX_BEGIN_HANDLERS_TABLE(wxWindow)
WX_END_HANDLERS_TABLE()
WX_CONSTRUCTOR_DUMMY(wxWindow)
+
#else
IMPLEMENT_DYNAMIC_CLASS(wxWindow, wxWindowBase)
#endif
}
}
-#if WXWIN_COMPATIBILITY
-void wxWindowMSW::MSWDeviceToLogical (float *x, float *y) const
-{
-}
-#endif // WXWIN_COMPATIBILITY
-
// ---------------------------------------------------------------------------
// scrolling stuff
// ---------------------------------------------------------------------------
return orient == wxHORIZONTAL ? SB_HORZ : SB_VERT;
}
-#if WXWIN_COMPATIBILITY
-void wxWindowMSW::SetScrollRange(int orient, int range, bool refresh)
-{
- int range1 = range;
-
- // Try to adjust the range to cope with page size > 1
- // - a Windows API quirk
- int pageSize = GetScrollPage(orient);
- if ( pageSize > 1 && range > 0)
- {
- range1 += (pageSize - 1);
- }
-
- WinStruct<SCROLLINFO> info;
- info.nPage = pageSize; // Have to set this, or scrollbar goes awry
- info.nMin = 0;
- info.nMax = range1;
- info.fMask = SIF_RANGE | SIF_PAGE;
-
- HWND hWnd = GetHwnd();
- if ( hWnd )
- ::SetScrollInfo(hWnd, wxDirToWinStyle(orient), &info, refresh);
-}
-
-void wxWindowMSW::SetScrollPage(int orient, int page, bool refresh)
-{
- WinStruct<SCROLLINFO> info;
- info.nPage = page;
- info.fMask = SIF_PAGE;
-
- HWND hWnd = GetHwnd();
- if ( hWnd )
- ::SetScrollInfo(hWnd, wxDirToWinStyle(orient), &info, refresh);
-}
-
-int wxWindowMSW::GetScrollPage(int orient) const
-{
- return orient == wxHORIZONTAL ? m_xThumbSize : m_yThumbSize;
-}
-
-#endif // WXWIN_COMPATIBILITY
-
inline int GetScrollPosition(HWND hWnd, int wOrient)
{
#ifdef __WXMICROWIN__
return style;
}
-#if WXWIN_COMPATIBILITY
-// If nothing defined for this, try the parent.
-// E.g. we may be a button loaded from a resource, with no callback function
-// defined.
-void wxWindowMSW::OnCommand(wxWindow& win, wxCommandEvent& event)
-{
- if ( GetEventHandler()->ProcessEvent(event) )
- return;
- if ( m_parent )
- m_parent->GetEventHandler()->OnCommand(win, event);
-}
-#endif // WXWIN_COMPATIBILITY_2
-
-#if WXWIN_COMPATIBILITY
-wxObject* wxWindowMSW::GetChild(int number) const
-{
- // Return a pointer to the Nth object in the Panel
- wxNode *node = GetChildren().First();
- int n = number;
- while (node && n--)
- node = node->Next();
- if ( node )
- {
- wxObject *obj = (wxObject *)node->Data();
- return(obj);
- }
- else
- return NULL;
-}
-#endif // WXWIN_COMPATIBILITY
-
// Setup background and foreground colours correctly
void wxWindowMSW::SetupColours()
{
return TRUE;
}
-void wxWindowMSW::Clear()
-{
- wxClientDC dc((wxWindow *)this);
- wxBrush brush(GetBackgroundColour(), wxSOLID);
- dc.SetBackground(brush);
- dc.Clear();
-}
-
static inline void SendSetRedraw(HWND hwnd, bool on)
{
#ifndef __WXMICROWIN__
*externalLeading = tm.tmExternalLeading;
}
-#if wxUSE_CARET && WXWIN_COMPATIBILITY
-// ---------------------------------------------------------------------------
-// Caret manipulation
-// ---------------------------------------------------------------------------
-
-void wxWindowMSW::CreateCaret(int w, int h)
-{
- SetCaret(new wxCaret(this, w, h));
-}
-
-void wxWindowMSW::CreateCaret(const wxBitmap *WXUNUSED(bitmap))
-{
- wxFAIL_MSG("not implemented");
-}
-
-void wxWindowMSW::ShowCaret(bool show)
-{
- wxCHECK_RET( m_caret, "no caret to show" );
-
- m_caret->Show(show);
-}
-
-void wxWindowMSW::DestroyCaret()
-{
- SetCaret(NULL);
-}
-
-void wxWindowMSW::SetCaretPos(int x, int y)
-{
- wxCHECK_RET( m_caret, "no caret to move" );
-
- m_caret->Move(x, y);
-}
-
-void wxWindowMSW::GetCaretPos(int *x, int *y) const
-{
- wxCHECK_RET( m_caret, "no caret to get position of" );
-
- m_caret->GetPosition(x, y);
-}
-#endif // wxUSE_CARET
-
// ---------------------------------------------------------------------------
// popup menu
// ---------------------------------------------------------------------------
#endif // USE_OWNER_DRAWN
-#if wxUSE_CONTROLS && !defined(__WXUNIVERSAL__)
+#if wxUSE_CONTROLS && !defined(__WXUNIVERSAL__)
#if wxUSE_OWNER_DRAWN
wxControl *item = wxDynamicCast(FindItem(id), wxControl);
// WM_KEYDOWN one
bool wxWindowMSW::HandleChar(WXWPARAM wParam, WXLPARAM lParam, bool isASCII)
{
- bool ctrlDown = FALSE;
-
int id;
if ( isASCII )
{
break;
default:
- ctrlDown = TRUE;
+ //ctrlDown = TRUE;
break;
}
}