#include <xh_odcombo.h>
Public Member Functions | |
wxOwnerDrawnComboBoxXmlHandler () | |
virtual wxObject * | DoCreateResource () |
virtual bool | CanHandle (wxXmlNode *node) |
Private Attributes | |
bool | m_insideBox |
wxArrayString | strList |
Definition at line 24 of file xh_odcombo.h.
|
Definition at line 20 of file xh_odcombo.cpp. 00021 :wxXmlResourceHandler() 00022 ,m_insideBox(false) 00023 { 00024 XRC_ADD_STYLE(wxCB_SIMPLE); 00025 XRC_ADD_STYLE(wxCB_SORT); 00026 XRC_ADD_STYLE(wxCB_READONLY); 00027 XRC_ADD_STYLE(wxCB_DROPDOWN); 00028 XRC_ADD_STYLE(wxODCB_STD_CONTROL_PAINT); 00029 XRC_ADD_STYLE(wxODCB_DCLICK_CYCLES); 00030 XRC_ADD_STYLE(wxTE_PROCESS_ENTER); 00031 AddWindowStyles(); 00032 }
|
|
Definition at line 96 of file xh_odcombo.cpp. 00097 { 00098 #if wxABI_VERSION >= 20700 00099 00100 return (IsOfClass(node, wxT("wxOwnerDrawnComboBox")) || 00101 (m_insideBox && node->GetName() == wxT("item"))); 00102 00103 #else 00104 00105 // Avoid GCC bug - this fails on certain GCC 3.3 and 3.4 builds for an unknown reason 00106 // it is believed to be related to the fact IsOfClass is inline, and node->GetPropVal 00107 // gets passed an invalid "this" pointer. On 2.7, the function is out of line, so the 00108 // above should work fine. This code is left in here so this file can easily be used 00109 // in a version backported to 2.6. All we are doing here is expanding the macro 00110 00111 bool fOurClass = node->GetPropVal(wxT("class"), wxEmptyString) == wxT("wxOwnerDrawnComboBox"); 00112 return (fOurClass || 00113 (m_insideBox && node->GetName() == wxT("item"))); 00114 #endif 00115 }
|
|
Definition at line 34 of file xh_odcombo.cpp. 00035 { 00036 if( m_class == wxT("wxOwnerDrawnComboBox")) 00037 { 00038 // find the selection 00039 long selection = GetLong( wxT("selection"), -1 ); 00040 00041 // need to build the list of strings from children 00042 m_insideBox = true; 00043 CreateChildrenPrivately(NULL, GetParamNode(wxT("content"))); 00044 wxString *strings = (wxString *) NULL; 00045 if (strList.GetCount() > 0) 00046 { 00047 strings = new wxString[strList.GetCount()]; 00048 int count = strList.GetCount(); 00049 for (int i = 0; i < count; i++) 00050 strings[i]=strList[i]; 00051 } 00052 00053 XRC_MAKE_INSTANCE(control, wxOwnerDrawnComboBox) 00054 00055 control->Create(m_parentAsWindow, 00056 GetID(), 00057 GetText(wxT("value")), 00058 GetPosition(), GetSize(), 00059 strList.GetCount(), 00060 strings, 00061 GetStyle(), 00062 wxDefaultValidator, 00063 GetName()); 00064 00065 wxSize ButtonSize=GetSize(wxT("buttonsize")); 00066 00067 if (ButtonSize != wxDefaultSize) 00068 control->SetButtonPosition(ButtonSize.GetWidth(), ButtonSize.GetHeight()); 00069 00070 if (selection != -1) 00071 control->SetSelection(selection); 00072 00073 SetupWindow(control); 00074 00075 if (strings != NULL) 00076 delete[] strings; 00077 strList.Clear(); // dump the strings 00078 00079 return control; 00080 } 00081 else 00082 { 00083 // on the inside now. 00084 // handle <item>Label</item> 00085 00086 // add to the list 00087 wxString str = GetNodeContent(m_node); 00088 if (m_resource->GetFlags() & wxXRC_USE_LOCALE) 00089 str = wxGetTranslation(str); 00090 strList.Add(str); 00091 00092 return NULL; 00093 } 00094 }
|
|
Definition at line 32 of file xh_odcombo.h. |
|
Definition at line 33 of file xh_odcombo.h. |