4 #include "ComboDialog.h"
\r
6 #include "Windows/Control/Static.h"
\r
9 #include "LangUtils.h"
\r
12 using namespace NWindows;
\r
15 static CIDLangPair kIDLangPairs[] =
\r
17 { IDOK, 0x02000702 },
\r
18 { IDCANCEL, 0x02000710 }
\r
22 bool CComboDialog::OnInit()
\r
25 LangSetDlgItemsText(HWND(*this), kIDLangPairs, sizeof(kIDLangPairs) / sizeof(kIDLangPairs[0]));
\r
27 _comboBox.Attach(GetItem(IDC_COMBO_COMBO));
\r
30 // why it doesn't work ?
\r
31 DWORD style = _comboBox.GetStyle();
\r
36 _comboBox.SetStyle(style);
\r
40 NControl::CStatic staticContol;
\r
41 staticContol.Attach(GetItem(IDC_COMBO_STATIC));
\r
42 staticContol.SetText(Static);
\r
43 _comboBox.SetText(Value);
\r
44 for(int i = 0; i < Strings.Size(); i++)
\r
45 _comboBox.AddString(Strings[i]);
\r
47 return CModalDialog::OnInit();
\r
50 bool CComboDialog::OnSize(WPARAM /* wParam */, int xSize, int ySize)
\r
53 GetMargins(8, mx, my);
\r
55 GetItemSizes(IDCANCEL, bx1, by);
\r
56 GetItemSizes(IDOK, bx2, by);
\r
57 int y = ySize - my - by;
\r
58 int x = xSize - mx - bx1;
\r
60 InvalidateRect(NULL);
\r
62 MoveItem(IDCANCEL, x, y, bx1, by);
\r
63 MoveItem(IDOK, x - mx - bx2, y, bx2, by);
\r
64 ChangeSubWindowSizeX(_comboBox, xSize - mx * 2);
\r
68 void CComboDialog::OnOK()
\r
70 _comboBox.GetText(Value);
\r
71 CModalDialog::OnOK();
\r