Skip to content

Commit

Permalink
more test options
Browse files Browse the repository at this point in the history
  • Loading branch information
ppescher committed Feb 23, 2002
1 parent b21b326 commit 8d39aaf
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 10 deletions.
13 changes: 8 additions & 5 deletions ResizableComboBox/Demo.rc
Original file line number Diff line number Diff line change
Expand Up @@ -73,19 +73,21 @@ IDR_MAINFRAME ICON DISCARDABLE "res\\Demo.ico"
// Dialog
//

IDD_TESTCOMBOBOX_DIALOG DIALOGEX 0, 0, 164, 108
IDD_TESTCOMBOBOX_DIALOG DIALOGEX 0, 0, 164, 100
STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
EXSTYLE WS_EX_APPWINDOW
CAPTION "Demo"
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "OK",IDOK,107,7,50,14
PUSHBUTTON "Annulla",IDCANCEL,107,23,50,14
COMBOBOX IDC_COMBO1,7,7,74,45,CBS_DROPDOWN | CBS_AUTOHSCROLL |
CBS_SORT | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP
EDITTEXT IDC_EDIT1,7,42,74,59,ES_AUTOHSCROLL
LISTBOX IDC_LIST1,87,42,70,59,LBS_SORT | LBS_NOINTEGRALHEIGHT |
EDITTEXT IDC_EDIT1,7,26,74,13,ES_AUTOHSCROLL
LISTBOX IDC_LIST1,87,26,70,67,LBS_SORT | LBS_NOINTEGRALHEIGHT |
WS_VSCROLL | WS_HSCROLL | WS_TABSTOP
PUSHBUTTON "Add string",IDC_BUTTON1,7,43,74,14
PUSHBUTTON "Reset content",IDC_BUTTON2,7,61,74,14
PUSHBUTTON "Directory listing",IDC_BUTTON3,7,79,74,14
END


Expand Down Expand Up @@ -145,7 +147,8 @@ BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 157
TOPMARGIN, 7
BOTTOMMARGIN, 101
BOTTOMMARGIN, 93
HORZGUIDE, 26
END
END
#endif // APSTUDIO_INVOKED
Expand Down
27 changes: 24 additions & 3 deletions ResizableComboBox/DemoDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ void CDemoDlg::DoDataExchange(CDataExchange* pDX)
BEGIN_MESSAGE_MAP(CDemoDlg, CResizableDialog)
//{{AFX_MSG_MAP(CDemoDlg)
ON_WM_CREATE()
ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
ON_BN_CLICKED(IDC_BUTTON2, OnButton2)
ON_BN_CLICKED(IDC_BUTTON3, OnButton3)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()

Expand All @@ -50,9 +53,8 @@ BOOL CDemoDlg::OnInitDialog()

// TODO: Add extra initialization here
AddAnchor(IDOK, TOP_RIGHT);
AddAnchor(IDCANCEL, TOP_RIGHT);
AddAnchor(IDC_COMBO1, TOP_LEFT, TOP_RIGHT);
AddAnchor(IDC_EDIT1, TOP_LEFT, BOTTOM_RIGHT);
AddAnchor(IDC_EDIT1, TOP_LEFT, TOP_RIGHT);
AddAnchor(IDC_LIST1, TOP_RIGHT, BOTTOM_RIGHT);

m_ctrlList1.AddString("a very very very loooong item text");
Expand All @@ -64,10 +66,29 @@ BOOL CDemoDlg::OnInitDialog()

int CDemoDlg::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
// ModifyStyleEx(0, WS_EX_LAYOUTRTL);
ModifyStyleEx(0, WS_EX_LAYOUTRTL);

if (CResizableDialog::OnCreate(lpCreateStruct) == -1)
return -1;

return 0;
}

void CDemoDlg::OnButton1()
{
CString str;
GetDlgItemText(IDC_EDIT1, str);
m_ctrlCombo1.AddString(str);
}

void CDemoDlg::OnButton2()
{
m_ctrlCombo1.ResetContent();
}

void CDemoDlg::OnButton3()
{
CString str;
GetDlgItemText(IDC_EDIT1, str);
m_ctrlCombo1.Dir(0, str);
}
5 changes: 4 additions & 1 deletion ResizableComboBox/DemoDlg.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class CDemoDlg : public CResizableDialog
//{{AFX_DATA(CDemoDlg)
enum { IDD = IDD_TESTCOMBOBOX_DIALOG };
CListBox m_ctrlList1;
CResizableComboBox /*CComboBox*/ m_ctrlCombo1;
CResizableComboBox m_ctrlCombo1;
//}}AFX_DATA

// ClassWizard generated virtual function overrides
Expand All @@ -41,6 +41,9 @@ class CDemoDlg : public CResizableDialog
//{{AFX_MSG(CDemoDlg)
virtual BOOL OnInitDialog();
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnButton1();
afx_msg void OnButton2();
afx_msg void OnButton3();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
Expand Down
5 changes: 4 additions & 1 deletion ResizableComboBox/Resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,17 @@
#define IDC_EDIT1 1001
#define IDC_EDIT2 1002
#define IDC_LIST1 1003
#define IDC_BUTTON1 1004
#define IDC_BUTTON2 1005
#define IDC_BUTTON3 1006

// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 129
#define _APS_NEXT_COMMAND_VALUE 32771
#define _APS_NEXT_CONTROL_VALUE 1004
#define _APS_NEXT_CONTROL_VALUE 1005
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

0 comments on commit 8d39aaf

Please sign in to comment.