| 132 | } |
| 133 | |
| 134 | CControlUI* CMainFrameWnd::CreateControl(LPCTSTR pstrClassName) |
| 135 | { |
| 136 | CDuiString strXML; |
| 137 | CDialogBuilder builder; |
| 138 | AbstraceUI* p = NULL; |
| 139 | |
| 140 | if (_tcsicmp(pstrClassName, _T("ConnInfo")) == 0) |
| 141 | { |
| 142 | strXML = _T("ConnInfo.xml"); |
| 143 | p = new ConnInfoUI(strXML, &m_PaintManager, &m_pEnv); |
| 144 | } |
| 145 | else if (_tcsicmp(pstrClassName, _T("RedisInfo")) == 0) |
| 146 | { |
| 147 | strXML = _T("RedisInfo.xml"); |
| 148 | p = new RedisInfoUI(strXML, &m_PaintManager, &m_pEnv); |
| 149 | } |
| 150 | else if (_tcsicmp(pstrClassName, _T("RedisData")) == 0) |
| 151 | { |
| 152 | strXML = _T("RedisData.xml"); |
| 153 | p = new RedisDataUI(strXML, &m_PaintManager, &m_pEnv); |
| 154 | } |
| 155 | else if (_tcsicmp(pstrClassName, _T("RedisConfig")) == 0) |
| 156 | { |
| 157 | strXML = _T("RedisConfig.xml"); |
| 158 | p = new RedisConfigUI(strXML, &m_PaintManager, &m_pEnv); |
| 159 | } |
| 160 | else if (_tcsicmp(pstrClassName, _T("RedisMgr")) == 0) |
| 161 | { |
| 162 | strXML = _T("RedisMgr.xml"); |
| 163 | p = new RedisMgrUI(strXML, &m_PaintManager, &m_pEnv); |
| 164 | } |
| 165 | else if (_tcsicmp(pstrClassName, _T("RedisHelp")) == 0) |
| 166 | { |
| 167 | strXML = _T("RedisHelp.xml"); |
| 168 | p = new RedisHelpUI(strXML, &m_PaintManager, &m_pEnv); |
| 169 | } |
| 170 | //if (! strXML.IsEmpty()) |
| 171 | //{ |
| 172 | // CControlUI* pUI = builder.Create(strXML.GetData(), NULL, NULL, &m_PaintManager, NULL); // 这里必须传入m_PaintManager,不然子XML不能使用默认滚动条等信息。 |
| 173 | // return pUI; |
| 174 | //} |
| 175 | |
| 176 | if (p) |
| 177 | { |
| 178 | AddVirtualWnd(p->GetVirtualwndName(), p); |
| 179 | p->SetHWND(GetHWND()); |
| 180 | m_oTabContainer.Set(p->GetVirtualwndName(), p); |
| 181 | return p; |
| 182 | } |
| 183 | return NULL; |
| 184 | } |
| 185 | |
| 186 | void CMainFrameWnd::Notify(TNotifyUI& msg) |
| 187 | { |
nothing calls this directly
no test coverage detected