diff --git a/source/tools/atlas/wxJS/gui/control/window.cpp b/source/tools/atlas/wxJS/gui/control/window.cpp index 8a7419de07..fc2ed3b72d 100644 --- a/source/tools/atlas/wxJS/gui/control/window.cpp +++ b/source/tools/atlas/wxJS/gui/control/window.cpp @@ -27,6 +27,7 @@ // window.cpp #include +#include #include "../../common/main.h" #include "../../ext/wxjs_ext.h" @@ -196,6 +197,7 @@ WXJS_BEGIN_PROPERTY_MAP(Window) WXJS_PROPERTY(P_BACKGROUND_COLOUR, "backgroundColour") WXJS_PROPERTY(P_FOREGROUND_COLOUR, "foregroundColour") WXJS_PROPERTY(P_FONT, "font") + WXJS_PROPERTY(P_TOOL_TIP, "toolTip") WXJS_END_PROPERTY_MAP() bool Window::GetProperty(wxWindow *p, JSContext *cx, JSObject *obj, int id, jsval *vp) @@ -342,6 +344,12 @@ bool Window::GetProperty(wxWindow *p, JSContext *cx, JSObject *obj, int id, jsva case P_FONT: *vp = Font::CreateObject(cx, new wxFont(p->GetFont()), obj); break; + case P_TOOL_TIP: + if ( p->GetToolTip() == NULL ) + *vp = JSVAL_VOID; + else + *vp = ToJS(cx, p->GetToolTip()->GetTip()); + break; } return true; } @@ -523,6 +531,18 @@ bool Window::SetProperty(wxWindow *p, JSContext *cx, JSObject *obj, int id, jsva p->SetFont(*font); break; } + case P_TOOL_TIP: + { + if ( JSVAL_IS_VOID(*vp) ) + p->SetToolTip(NULL); + else + { + wxString toolTip; + if ( FromJS(cx, *vp, toolTip) ) + p->SetToolTip(toolTip); + } + break; + } } return true; } diff --git a/source/tools/atlas/wxJS/gui/control/window.h b/source/tools/atlas/wxJS/gui/control/window.h index 86e96eeb48..624cc07997 100644 --- a/source/tools/atlas/wxJS/gui/control/window.h +++ b/source/tools/atlas/wxJS/gui/control/window.h @@ -129,6 +129,7 @@ namespace wxjs , P_BACKGROUND_COLOUR , P_FOREGROUND_COLOUR , P_FONT + , P_TOOL_TIP }; };