DataViewListCtrlWrapper::DataViewListCtrlWrapper() : wxcWidget(ID_WXDATAVIEWLISTCTRL) { PREPEND_STYLE(wxDV_SINGLE, true); PREPEND_STYLE(wxDV_MULTIPLE, false); PREPEND_STYLE(wxDV_ROW_LINES, true); PREPEND_STYLE(wxDV_HORIZ_RULES, false); PREPEND_STYLE(wxDV_VERT_RULES, false); PREPEND_STYLE(wxDV_VARIABLE_LINE_HEIGHT, false); PREPEND_STYLE(wxDV_NO_HEADER, false); RegisterEvent("wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED", "wxDataViewEvent", _("Process a wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED event")); RegisterEvent("wxEVT_COMMAND_DATAVIEW_ITEM_ACTIVATED", "wxDataViewEvent", _("Process a wxEVT_COMMAND_DATAVIEW_ITEM_ACTIVATED event.\nThis event is triggered by double " "clicking an item or pressing some special key (usually \"Enter\") when it is focused")); RegisterEvent("wxEVT_COMMAND_DATAVIEW_ITEM_START_EDITING", "wxDataViewEvent", _("Process a wxEVT_COMMAND_DATAVIEW_ITEM_START_EDITING event.\nThis event can be vetoed in order to " "prevent editing on an item by item basis")); RegisterEvent("wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_STARTED", "wxDataViewEvent", _("Process a wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_STARTED event")); RegisterEvent("wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_DONE", "wxDataViewEvent", _("Process a wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_DONE event")); RegisterEvent("wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSING", "wxDataViewEvent", _("Process a wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSING event")); RegisterEvent("wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSED", "wxDataViewEvent", _("Process a wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSED event")); RegisterEvent("wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDING", "wxDataViewEvent", _("Process a wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDING event")); RegisterEvent("wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDED", "wxDataViewEvent", _("Process a wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDED event")); RegisterEvent("wxEVT_COMMAND_DATAVIEW_ITEM_VALUE_CHANGED", "wxDataViewEvent", _("Process a wxEVT_COMMAND_DATAVIEW_ITEM_VALUE_CHANGED event")); RegisterEvent("wxEVT_COMMAND_DATAVIEW_ITEM_CONTEXT_MENU", "wxDataViewEvent", _("Process a wxEVT_COMMAND_DATAVIEW_ITEM_CONTEXT_MENU event generated when the user right clicks " "inside the control.\nNotice that this menu is generated even if the click didn't occur on any " "valid item, in this case wxDataViewEvent::GetItem() simply returns an invalid item.")); RegisterEvent("wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_CLICK", "wxDataViewEvent", _("Process a wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_CLICK event")); RegisterEvent("wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_RIGHT_CLICK", "wxDataViewEvent", _("Process a wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_RIGHT_CLICK event")); RegisterEvent("wxEVT_COMMAND_DATAVIEW_COLUMN_SORTED", "wxDataViewEvent", _("Process a wxEVT_COMMAND_DATAVIEW_COLUMN_SORTED event")); RegisterEvent("wxEVT_COMMAND_DATAVIEW_COLUMN_REORDERED", "wxDataViewEvent", _("Process a wxEVT_COMMAND_DATAVIEW_COLUMN_REORDERED event")); RegisterEvent("wxEVT_COMMAND_DATAVIEW_ITEM_BEGIN_DRAG", "wxDataViewEvent", _("Process a wxEVT_COMMAND_DATAVIEW_ITEM_BEGIN_DRAG event")); RegisterEvent("wxEVT_COMMAND_DATAVIEW_ITEM_DROP_POSSIBLE", "wxDataViewEvent", _("Process a wxEVT_COMMAND_DATAVIEW_ITEM_DROP_POSSIBLE event")); RegisterEvent("wxEVT_COMMAND_DATAVIEW_ITEM_DROP", "wxDataViewEvent", _("Process a wxEVT_COMMAND_DATAVIEW_ITEM_DROP event")); SetPropertyString(_("Common Settings"), "wxDataViewListCtrl"); m_namePattern = "m_dvListCtrl"; DelProperty(_("Control Specific Settings")); SetName(GenerateName()); }
FX_BOOL global_alternate::DoProperty(IFXJS_Context* cc, FX_LPCWSTR propname, CJS_PropValue& vp, CFX_WideString& sError) { if (vp.IsSetting()) { CFX_ByteString sPropName = CFX_ByteString::FromUnicode(propname); switch (vp.GetType()) { case VT_number: { double dData; vp >> dData; return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_NUMBER, dData, false, "", v8::Handle<v8::Object>(), FALSE); } case VT_boolean: { bool bData; vp >> bData; return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_BOOLEAN, 0, (bool)vp, "", v8::Handle<v8::Object>(), FALSE); } case VT_string: { CFX_ByteString sData; vp >> sData; return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_STRING, 0, false, sData, v8::Handle<v8::Object>(), FALSE); } case VT_object: { JSObject pData = (JSObject)vp; return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_OBJECT, 0, false, "", pData, FALSE); // else // { // if (vp.IsArrayObject()) // { // CJS_Array array; // vp.ConvertToArray(array); // return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_OBJECT, 0, false, "", // (Dobject*)(Darray*)array, FALSE); // } // else // return FALSE; // } } case VT_null: { return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_NULL, 0, false, "", v8::Handle<v8::Object>(), FALSE); } case VT_undefined: { DelProperty(cc, propname, sError); return TRUE; } default: return FALSE; } }
FX_BOOL global_alternate::DoProperty(IFXJS_Context* cc, FX_LPCWSTR propname, CJS_PropValue& vp, CFX_WideString& sError) { if (vp.IsSetting()) { CFX_ByteString sPropName = CFX_ByteString::FromUnicode(propname); switch (vp.GetType()) { case VT_number: { double dData; vp >> dData; return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_NUMBER, dData, false, "", v8::Local<v8::Object>(), FALSE); } case VT_boolean: { bool bData; vp >> bData; return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_BOOLEAN, 0, bData, "", v8::Local<v8::Object>(), FALSE); } case VT_string: { CFX_ByteString sData; vp >> sData; return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_STRING, 0, false, sData, v8::Local<v8::Object>(), FALSE); } case VT_object: { JSObject pData; vp >> pData; return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_OBJECT, 0, false, "", pData, FALSE); } case VT_null: { return SetGlobalVariables(sPropName, JS_GLOBALDATA_TYPE_NULL, 0, false, "", v8::Local<v8::Object>(), FALSE); } case VT_undefined: { DelProperty(cc, propname, sError); return TRUE; } default: return FALSE; } }
FX_BOOL JSGlobalAlternate::DoProperty(IJS_Context* cc, const FX_WCHAR* propname, CJS_PropValue& vp, CFX_WideString& sError) { CJS_Runtime* pRuntime = CJS_Runtime::FromContext(cc); if (vp.IsSetting()) { CFX_ByteString sPropName = CFX_ByteString::FromUnicode(propname); switch (vp.GetJSValue()->GetType()) { case CJS_Value::VT_number: { double dData; vp >> dData; return SetGlobalVariables(sPropName, JS_GlobalDataType::NUMBER, dData, false, "", v8::Local<v8::Object>(), FALSE); } case CJS_Value::VT_boolean: { bool bData; vp >> bData; return SetGlobalVariables(sPropName, JS_GlobalDataType::BOOLEAN, 0, bData, "", v8::Local<v8::Object>(), FALSE); } case CJS_Value::VT_string: { CFX_ByteString sData; vp >> sData; return SetGlobalVariables(sPropName, JS_GlobalDataType::STRING, 0, false, sData, v8::Local<v8::Object>(), FALSE); } case CJS_Value::VT_object: { v8::Local<v8::Object> pData; vp >> pData; return SetGlobalVariables(sPropName, JS_GlobalDataType::OBJECT, 0, false, "", pData, FALSE); } case CJS_Value::VT_null: { return SetGlobalVariables(sPropName, JS_GlobalDataType::NULLOBJ, 0, false, "", v8::Local<v8::Object>(), FALSE); } case CJS_Value::VT_undefined: { DelProperty(cc, propname, sError); return TRUE; } default: break; } } else {
GLCanvasWrapper::GLCanvasWrapper() : wxcWidget(ID_WXGLCANVAS) { m_namePattern = "m_glCanvas"; SetPropertyString(_("Common Settings"), "wxGLCanvas"); DelProperty(PROP_CONTROL_SPECIFIC_SETTINGS); AddCategory("wxGLCanvas Attribute List"); AddProperty(new StringProperty("WX_GL_RGBA", _("Use true color palette (on if no attrs specified)"))); m_attrs.Add("WX_GL_RGBA"); AddProperty(new StringProperty("WX_GL_BUFFER_SIZE", _("bits for buffer if not WX_GL_RGBA"))); m_attrs.Add("WX_GL_BUFFER_SIZE"); AddProperty(new StringProperty("WX_GL_LEVEL", _("0 for main buffer, >0 for overlay, <0 for underlay"))); m_attrs.Add("WX_GL_LEVEL"); AddProperty(new StringProperty("WX_GL_DOUBLEBUFFER", _("use double buffering (on if no attrs specified)"))); m_attrs.Add("WX_GL_DOUBLEBUFFER"); AddProperty(new StringProperty("WX_GL_STEREO", _("use stereoscopic display"))); m_attrs.Add("WX_GL_STEREO"); AddProperty(new StringProperty("WX_GL_AUX_BUFFERS", _("number of auxiliary buffers"))); m_attrs.Add("WX_GL_AUX_BUFFERS"); AddProperty(new StringProperty("WX_GL_MIN_RED", _("use red buffer with most bits (> MIN_RED bits)"))); m_attrs.Add("WX_GL_MIN_RED"); AddProperty(new StringProperty("WX_GL_MIN_GREEN", _("use green buffer with most bits (> MIN_GREEN bits)"))); m_attrs.Add("WX_GL_MIN_GREEN"); AddProperty(new StringProperty("WX_GL_MIN_BLUE", _("use blue buffer with most bits (> MIN_BLUE bits)"))); m_attrs.Add("WX_GL_MIN_BLUE"); AddProperty(new StringProperty("WX_GL_MIN_ALPHA", _("use alpha buffer with most bits (> MIN_ALPHA bits)"))); m_attrs.Add("WX_GL_MIN_ALPHA"); AddProperty(new StringProperty("WX_GL_DEPTH_SIZE", _("bits for Z-buffer (0,16,32)"))); m_attrs.Add("WX_GL_DEPTH_SIZE"); AddProperty(new StringProperty("WX_GL_STENCIL_SIZE", _("bits for stencil buffer"))); m_attrs.Add("WX_GL_STENCIL_SIZE"); AddProperty( new StringProperty("WX_GL_MIN_ACCUM_RED", _("use red accum buffer with most bits (> MIN_ACCUM_RED bits)"))); m_attrs.Add("WX_GL_MIN_ACCUM_RED"); AddProperty( new StringProperty("WX_GL_MIN_ACCUM_GREEN", _("use green buffer with most bits (> MIN_ACCUM_GREEN bits)"))); m_attrs.Add("WX_GL_MIN_ACCUM_GREEN"); AddProperty( new StringProperty("WX_GL_MIN_ACCUM_BLUE", _("use blue buffer with most bits (> MIN_ACCUM_BLUE bits)"))); m_attrs.Add("WX_GL_MIN_ACCUM_BLUE"); AddProperty( new StringProperty("WX_GL_MIN_ACCUM_ALPHA", _("use alpha buffer with most bits (> MIN_ACCUM_ALPHA bits)"))); m_attrs.Add("WX_GL_MIN_ACCUM_ALPHA"); AddProperty(new StringProperty("WX_GL_SAMPLE_BUFFERS", _("1 for multisampling support (antialiasing)"))); m_attrs.Add("WX_GL_SAMPLE_BUFFERS"); AddProperty(new StringProperty("WX_GL_SAMPLES", _("4 for 2x2 antialiasing supersampling on most graphics cards"))); m_attrs.Add("WX_GL_SAMPLES"); SetName(GenerateName()); }
TopLevelWinWrapper::TopLevelWinWrapper(int type) : wxcWidget(type) , m_auiDropDownMenuHelperRegistered(false) { PREPEND_STYLE(wxSTAY_ON_TOP, false); PREPEND_STYLE(wxCLOSE_BOX, false); PREPEND_STYLE(wxSYSTEM_MENU, false); PREPEND_STYLE(wxMINIMIZE_BOX, false); PREPEND_STYLE(wxMAXIMIZE_BOX, false); PREPEND_STYLE(wxRESIZE_BORDER, false); PREPEND_STYLE(wxCAPTION, false); if(type == ID_WXFRAME || type == ID_WXDIALOG) { // a real top level windows // add support for wxTopLevelWindow events RegisterEvent(wxT("wxEVT_MAXIMIZE"), wxT("wxMaximizeEvent"), wxT("Process a wxEVT_MAXIMIZE event")); RegisterEvent(wxT("wxEVT_MOVE"), wxT("wxMoveEvent"), wxT("Process a wxEVT_MOVE event, which is generated when a window is moved")); RegisterEvent(wxT("wxEVT_MOVE_START"), wxT("wxMoveEvent"), wxT("Process a wxEVT_MOVE_START event, which is generated when the " "user starts to move or size a window. Windows only")); RegisterEvent(wxT("wxEVT_MOVE_END"), wxT("wxMoveEvent"), wxT("Process a wxEVT_MOVE_END event, which is generated when " "the user stops moving or sizing a window. Windows only")); RegisterEvent(wxT("wxEVT_SHOW"), wxT("wxShowEvent"), wxT("Process a wxEVT_SHOW event")); } // Default size for top level windows DoSetPropertyStringValue(PROP_SIZE, wxT("500,300")); if(IsWxTopLevelWindow()) { // Add a persistency object support AddBool(PROP_PERSISTENT, _("When enabled, the generated code will add support for wxPersistenceManager (i.e. the Window will " "remember its size, position and any child wxBookCtrlBase control will remember its selection)"), true); } wxArrayString arr; arr.Add(wxT("")); arr.Add(wxT("wxBOTH")); arr.Add(wxT("wxVERTICAL")); arr.Add(wxT("wxHORIZONTAL")); AddProperty(new StringProperty(PROP_TITLE, "", _("The title, if any"))); AddProperty( new VirtualFolderProperty(PROP_VIRTUAL_FOLDER, "", _("CodeLite's virtual folder for the generated files"))); AddProperty(new ChoiceProperty(PROP_CENTRE_ON_SCREEN, arr, 1, _("Centre on parent. This may be in both dimensions (the default); only " "vertically or horizontally; or not at all."))); AddProperty(new CategoryProperty(_("Inherited C++ Class Properties"))); AddProperty(new StringProperty(PROP_INHERITED_CLASS, "", _("Inherited class name\nFill this field to generate a class that inherits from the " "base class,\nwhere you should place all your application logic.\ne.g. for a " "generated class 'FooDialogBase', you might enter 'FooDialog' here."))); AddProperty(new StringProperty(PROP_FILE, "", _("The name for the inherited class's files (without any file " "extension).\nwxCrafter will generate a $(FILE).cpp and $(FILE).h\ne.g. " "for an inherited class 'FooDialog', you might enter 'foodialog' here."))); AddProperty(new StringProperty(PROP_CLASS_DECORATOR, "", _("MSW Only\nC++ macro decorator - allows exporting this class from a DLL"))); if(m_properties.Contains(PROP_NAME)) { m_properties.Item(PROP_NAME)->SetTooltip(_("The generated C++ class name")); } DelProperty(PROP_WINDOW_ID); }
SizerWrapperBase::SizerWrapperBase() : wxcWidget(-1) { DelProperty(PROP_WINDOW_ID); DelProperty(PROP_SIZE); DelProperty(PROP_BG); DelProperty(PROP_FG); DelProperty(PROP_FONT); DelProperty(PROP_TOOLTIP); DelProperty(_("Initial State")); DelProperty(PROP_STATE_HIDDEN); DelProperty(PROP_STATE_DISABLED); DelProperty(PROP_HAS_FOCUS); DelProperty(_("Subclass")); DelProperty(PROP_SUBCLASS_NAME); DelProperty(PROP_SUBCLASS_INCLUDE); EnableSizerFlag("wxEXPAND", true); m_sizerItem.SetProportion(1); }