4.44 beta

This commit is contained in:
Igor Pavlov
2007-01-20 00:00:00 +00:00
committed by Kornel Lesiński
parent 804edc5756
commit d9666cf046
1331 changed files with 10535 additions and 13791 deletions

View File

@@ -0,0 +1,53 @@
// ComboDialog.cpp
#include "StdAfx.h"
#include "ComboDialog.h"
#include "Windows/Control/Static.h"
#ifdef LANG
#include "../../LangUtils.h"
#endif
using namespace NWindows;
#ifdef LANG
static CIDLangPair kIDLangPairs[] =
{
{ IDOK, 0x02000702 },
{ IDCANCEL, 0x02000710 }
};
#endif
bool CComboDialog::OnInit()
{
#ifdef LANG
LangSetDlgItemsText(HWND(*this), kIDLangPairs, sizeof(kIDLangPairs) / sizeof(kIDLangPairs[0]));
#endif
_comboBox.Attach(GetItem(IDC_COMBO_COMBO));
/*
// why it doesn't work ?
DWORD style = _comboBox.GetStyle();
if (Sorted)
style |= CBS_SORT;
else
style &= ~CBS_SORT;
_comboBox.SetStyle(style);
*/
SetText(Title);
NControl::CStatic staticContol;
staticContol.Attach(GetItem(IDC_COMBO_STATIC));
staticContol.SetText(Static);
_comboBox.SetText(Value);
for(int i = 0; i < Strings.Size(); i++)
_comboBox.AddString(Strings[i]);
return CModalDialog::OnInit();
}
void CComboDialog::OnOK()
{
_comboBox.GetText(Value);
CModalDialog::OnOK();
}

View File

@@ -0,0 +1,25 @@
// ComboDialog.h
#ifndef __COMBODIALOG_H
#define __COMBODIALOG_H
#include "Windows/Control/Dialog.h"
#include "Windows/Control/ComboBox.h"
#include "resource.h"
class CComboDialog: public NWindows::NControl::CModalDialog
{
NWindows::NControl::CComboBox _comboBox;
virtual void OnOK();
virtual bool OnInit();
public:
// bool Sorted;
UString Title;
UString Static;
UString Value;
UStringVector Strings;
// CComboDialog(): Sorted(false) {};
INT_PTR Create(HWND parentWindow = 0) { return CModalDialog::Create(IDD_DIALOG_COMBO, parentWindow); }
};
#endif

View File

@@ -0,0 +1,16 @@
// stdafx.h
#ifndef __STDAFX_H
#define __STDAFX_H
#define _WIN32_WINNT 0x0400
// it's for Windows NT supporting (MENUITEMINFOW)
#define WINVER 0x0400
#include <windows.h>
#include <commctrl.h>
#include "Common/NewHandler.h"
#endif

View File

@@ -0,0 +1,4 @@
#define IDD_DIALOG_COMBO 200
#define IDC_COMBO_STATIC 1000
#define IDC_COMBO_COMBO 1001

View File

@@ -0,0 +1,24 @@
#include "resource.h"
#include "../../../GuiCommon.rc"
#define xSize2 233
#define ySize2 57
#define xSize (xSize2 + marg + marg)
#define ySize (ySize2 + marg + marg)
#define bYPos (ySize - marg - bYSize)
#define b1XPos (xSize - marg - bXSize)
#define b2XPos (b1XPos - 10 - bXSize)
IDD_DIALOG_COMBO DIALOG 0, 0, xSize, ySize MY_MODAL_DIALOG_STYLE
CAPTION "Combo"
MY_FONT
BEGIN
LTEXT "", IDC_COMBO_STATIC, marg, marg, xSize2, 8
COMBOBOX IDC_COMBO_COMBO, marg, 20, xSize2, 65, CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
DEFPUSHBUTTON "OK", IDOK, b2XPos, bYPos, bXSize, bYSize
PUSHBUTTON "Cancel", IDCANCEL, b1XPos, bYPos, bXSize, bYSize
END