104 m_extPort = lpszName;
124 int f = _super::GetCurSel();
127 f = _super::GetItemData(f);
141 loop ( i, _super::GetCount() )
143 if (
ToInt(_super::GetItemData(i)) == port )
145 bool r = (_super::SetCurSel(i) != CB_ERR);
148 m_toolTip.UpdateTipText(m_descList[_super::GetItemData(_super::GetCurSel())],
this);
164 int r = _super::SetCurSel(nSelect);
165 int f = _super::GetCurSel();
168 f = _super::GetItemData(f);
169 m_toolTip.UpdateTipText(m_descList[f],
this);
193 m_isFullText = isFullText;
194 _super::SetRedraw(FALSE);
198 _super::SetRedraw(TRUE);
199 _super::RedrawWindow();
212 if ( ::IsWindow(m_toolTip) )
214 m_toolTip.RelayEvent(pMsg);
216 return _super::PreTranslateMessage(pMsg);
228 virtual LRESULT
WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
230 if ( message == WM_DESTROY )
232 m_descList.RemoveAll();
233 m_toolTip.DestroyWindow();
235 return _super::WindowProc(message, wParam, lParam);
245 DWORD style = _super::GetStyle();
246 ASSERT0( (style & 3) == CBS_DROPDOWNLIST,
"CPortComboBox",
"DropDownListになっていません" );
247 _super::PreSubclassWindow();
262 virtual BOOL
OnChildNotify(UINT message, WPARAM wParam, LPARAM lParam, LRESULT* _pResult)
264 if ( message == WM_COMMAND )
266 if ( lParam ==
reinterpret_cast<LPARAM
>(_super::GetSafeHwnd()) && HIWORD(wParam) == CBN_SELCHANGE )
268 ASSERT ( LOWORD(wParam) == _super::GetDlgCtrlID() );
269 int f = _super::GetCurSel();
272 f = _super::GetItemData(f);
273 m_toolTip.UpdateTipText(m_descList[f],
this);
277 return _super::OnChildNotify(message, wParam, lParam, _pResult);
295 _super::ResetContent();
296 m_descList.RemoveAll();
297 m_toolTip.DestroyWindow();
298 m_toolTip.Create(
this, TTS_ALWAYSTIP);
299 bool hasExtPort = ! m_extPort.
IsEmpty();
311 s += _T(
": ") + vd[i].ToString();
313 int f = _super::AddString(s);
314 _super::SetItemData(f, p);
315 m_descList[p] = vd[i].ToString();
318 _super::SetCurSel(0);
319 m_toolTip.AddTool(
this, m_descList[_super::GetItemData(0)]);
321 else if ( ! hasExtPort )
323 m_toolTip.AddTool(
this, _T(
"一つも見つかりません"));
328 int f = _super::AddString(m_extPort);
329 _super::SetItemData(f, 0);
330 m_descList[0] = m_extPort;
332 m_toolTip.Activate(TRUE);
336 CToolTipCtrl m_toolTip;
#define loop(VAR, CNT)
loop構文.
static TDeviceVector EnumExistPortDeviceNames(void)
[取得] 存在するPort一覧
bool IsEmpty(void) const
[確認] 空チェック
void Format(const TYP *lpszFormat,...)
[代入] 書式付き文字列代入.
void ResetDevice(bool isFullText=false)
[設定] デバイス設定.
void ResetDevice(const CRs232c::TDeviceVector &vd, bool isFullText=false)
[設定] デバイス設定.
virtual BOOL OnChildNotify(UINT message, WPARAM wParam, LPARAM lParam, LRESULT *_pResult)
[通知] for notifications from parent
void AddExtendPort(LPCTSTR lpszName)
[設定] 拡張ポート名設定.
virtual void PreSubclassWindow(void)
[通知] subclassing/unsubclassing functions.
int GetCurPort(void) const
[取得] ポート情報取得.
virtual bool IsEffectiveness(int port)
[選択] 有効ポートチェック
virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
[通知] for processing Windows messages.
virtual BOOL PreTranslateMessage(MSG *pMsg)
[通知] for translating Windows messages in main message pump
bool SetCurPort(int port)
[選択] ポート選択.
CPortComboBox(bool isFullText=false)
コンストラクタ.
int SetCurSel(int nSelect)
[選択] 選択.
int ToInt(LPCSTR lpsz, int iBase=10)
[変換] INT変換(ASCII/SJIS用).
bool IsEmpty(void) const
[確認] 要素の有無確認.