From: boca4711 <boc...@us...> - 2004-10-11 20:32:07
|
Update of /cvsroot/anyedit/AnyEditToolkit/Samples/ButtonsDlg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23803/Samples/ButtonsDlg Added Files: ButtonsDlg.cpp ButtonsDlg.dsp ButtonsDlg.h ButtonsDlg.rc ButtonsDlgDlg.cpp ButtonsDlgDlg.h StdAfx.cpp StdAfx.h resource.h Log Message: New sample with styles of CGuiButtons. --- NEW FILE: ButtonsDlgDlg.h --- // ButtonsDlgDlg.h : Header-Datei // #if !defined(AFX_BUTTONSDLGDLG_H__8C25CF66_EBED_49F2_BE93_B20B4790FF45__INCLUDED_) #define AFX_BUTTONSDLGDLG_H__8C25CF66_EBED_49F2_BE93_B20B4790FF45__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 ///////////////////////////////////////////////////////////////////////////// // CButtonsDlgDlg Dialogfeld class CButtonsDlgDlg : public CDialog { // Konstruktion public: CButtonsDlgDlg(CWnd* pParent = NULL); // Standard-Konstruktor // Dialogfelddaten //{{AFX_DATA(CButtonsDlgDlg) enum { IDD = IDD_BUTTONSDLG_DIALOG }; CGuiButton m_btXPInactive; CGuiButton m_btXPImageTextInactive; CGuiButton m_btXPImageText; CGuiButton m_btXPImageInactive; CGuiButton m_btXPImage; CGuiButton m_btXP; CButton m_btStandardInactive; CButton m_btStandard; CGuiButton m_btSemiflatInactive; CGuiButton m_btSemiflatImageTextInactive; CGuiButton m_btSemiflatImageText; CGuiButton m_btSemiflatImageInactive; CGuiButton m_btSemiflatImage; CGuiButton m_btSemiflat; CGuiButton m_btFlatInactive; CGuiButton m_btFlatImageTextInactive; CGuiButton m_btFlatImageText; CGuiButton m_btFlatImageInactive; CGuiButton m_btFlatImage; CGuiButton m_btFlat; //}}AFX_DATA // Vom Klassenassistenten generierte Überladungen virtueller Funktionen //{{AFX_VIRTUAL(CButtonsDlgDlg) protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV-Unterstützung //}}AFX_VIRTUAL // Implementierung protected: HICON m_hIcon; // Generierte Message-Map-Funktionen //{{AFX_MSG(CButtonsDlgDlg) virtual BOOL OnInitDialog(); afx_msg void OnSysCommand(UINT nID, LPARAM lParam); afx_msg void OnPaint(); afx_msg HCURSOR OnQueryDragIcon(); //}}AFX_MSG DECLARE_MESSAGE_MAP() }; //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ fügt unmittelbar vor der vorhergehenden Zeile zusätzliche Deklarationen ein. #endif // !defined(AFX_BUTTONSDLGDLG_H__8C25CF66_EBED_49F2_BE93_B20B4790FF45__INCLUDED_) --- NEW FILE: ButtonsDlg.rc --- //Microsoft Developer Studio generated resource script. // #include "resource.h" #define APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// // // Generated from the TEXTINCLUDE 2 resource. // #include "afxres.h" ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// // Deutsch (Deutschland) resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEU) #ifdef _WIN32 LANGUAGE LANG_GERMAN, SUBLANG_GERMAN #pragma code_page(1252) #endif //_WIN32 #ifdef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // TEXTINCLUDE // 1 TEXTINCLUDE DISCARDABLE BEGIN "resource.h\0" END 2 TEXTINCLUDE DISCARDABLE BEGIN "#include ""afxres.h""\r\n" "\0" END 3 TEXTINCLUDE DISCARDABLE BEGIN "#define _AFX_NO_SPLITTER_RESOURCES\r\n" "#define _AFX_NO_OLE_RESOURCES\r\n" "#define _AFX_NO_TRACKER_RESOURCES\r\n" "#define _AFX_NO_PROPERTY_RESOURCES\r\n" "\r\n" "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n" "#ifdef _WIN32\r\n" "LANGUAGE 9, 1\r\n" "#pragma code_page(1252)\r\n" "#endif //_WIN32\r\n" "#include ""res\\ButtonsDlg.rc2"" // Nicht mit Microsoft Visual C++ bearbeitete Ressourcen\r\n" "#include ""afxres.rc"" // Standardkomponenten\r\n" "#endif\r\n" "\0" END #endif // APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // Icon // // Icon with lowest ID value placed first to ensure application icon // remains consistent on all systems. IDR_MAINFRAME ICON DISCARDABLE "res\\ButtonsDlg.ico" #endif // Deutsch (Deutschland) resources ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// // Englisch (USA) resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) #ifdef _WIN32 LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US #pragma code_page(1252) #endif //_WIN32 ///////////////////////////////////////////////////////////////////////////// // // Dialog // IDD_ABOUTBOX DIALOG DISCARDABLE 0, 0, 235, 55 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "About ButtonsDlg" FONT 8, "MS Sans Serif" BEGIN ICON IDR_MAINFRAME,IDC_STATIC,11,17,20,20 LTEXT "ButtonsDlg Version 1.0",IDC_STATIC,40,10,119,8, SS_NOPREFIX LTEXT "Copyright (C) 2004",IDC_STATIC,40,25,119,8 DEFPUSHBUTTON "OK",IDOK,178,7,50,14,WS_GROUP END IDD_BUTTONSDLG_DIALOG DIALOGEX 0, 0, 320, 200 STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU EXSTYLE WS_EX_APPWINDOW CAPTION "ButtonsDlg" FONT 8, "MS Sans Serif", 0, 0, 0x1 BEGIN DEFPUSHBUTTON "OK",IDOK,260,7,50,14 PUSHBUTTON "Cancel",IDCANCEL,260,23,50,14 GROUPBOX "Standard",IDC_STATIC,15,36,67,60 PUSHBUTTON "Button1",IDC_STANDARD,23,55,50,14 PUSHBUTTON "Button2",IDC_STANDARD_INACTIVE,23,76,50,14,WS_DISABLED GROUPBOX "Flat",IDC_STATIC,162,36,65,140 PUSHBUTTON "Button3",IDC_SEMIFLAT,99,55,50,14 PUSHBUTTON "Button4",IDC_SEMIFLAT_INACTIVE,99,76,50,14,WS_DISABLED PUSHBUTTON "Button5",IDC_SEMIFLAT_IMAGE,99,95,50,14 PUSHBUTTON "Button6",IDC_FLAT_IMAGE_INACTIVE,171,118,50,14, WS_DISABLED PUSHBUTTON "Button7",IDC_SEMIFLAT_IMAGE_TEXT,99,138,50,14 PUSHBUTTON "Button8",IDC_SEMIFLAT_IMAGE_TEXT_INACTIVE,99,156,50,14, WS_DISABLED GROUPBOX "SemiFlat",IDC_STATIC,91,36,65,140 PUSHBUTTON "Button3",IDC_FLAT,171,55,50,14 PUSHBUTTON "Button4",IDC_FLAT_INACTIVE,171,76,50,14,WS_DISABLED PUSHBUTTON "Button5",IDC_FLAT_IMAGE,171,95,50,14 PUSHBUTTON "Button6",IDC_SEMIFLAT_IMAGE_INACTIVE,99,118,50,14, WS_DISABLED PUSHBUTTON "Button7",IDC_FLAT_IMAGE_TEXT,171,138,50,14 PUSHBUTTON "Button8",IDC_FLAT_IMAGE_TEXT_INACTIVE,171,156,50,14, WS_DISABLED GROUPBOX "XP",IDC_STATIC,239,36,65,140 PUSHBUTTON "Button6",IDC_XP_IMAGE_INACTIVE,248,118,50,14, WS_DISABLED PUSHBUTTON "Button3",IDC_XP,248,55,50,14 PUSHBUTTON "Button4",IDC_XP_INACTIVE,248,76,50,14,WS_DISABLED PUSHBUTTON "Button5",IDC_XP_IMAGE,248,95,50,14 PUSHBUTTON "Button7",IDC_XP_IMAGE_TEXT,248,138,50,14 PUSHBUTTON "Button8",IDC_XP_IMAGE_TEXT_INACTIVE,248,156,50,14, WS_DISABLED END #ifndef _MAC ///////////////////////////////////////////////////////////////////////////// // // Version // VS_VERSION_INFO VERSIONINFO FILEVERSION 1,0,0,1 PRODUCTVERSION 1,0,0,1 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L #else FILEFLAGS 0x0L #endif FILEOS 0x4L FILETYPE 0x1L FILESUBTYPE 0x0L BEGIN BLOCK "StringFileInfo" BEGIN BLOCK "040904B0" BEGIN VALUE "CompanyName", "\0" VALUE "FileDescription", "ButtonsDlg MFC Application\0" VALUE "FileVersion", "1, 0, 0, 1\0" VALUE "InternalName", "ButtonsDlg\0" VALUE "LegalCopyright", "Copyright (C) 2004\0" VALUE "LegalTrademarks", "\0" VALUE "OriginalFilename", "ButtonsDlg.EXE\0" VALUE "ProductName", "ButtonsDlg Application\0" VALUE "ProductVersion", "1, 0, 0, 1\0" END END BLOCK "VarFileInfo" BEGIN VALUE "Translation", 0x409, 1200 END END #endif // !_MAC ///////////////////////////////////////////////////////////////////////////// // // DESIGNINFO // #ifdef APSTUDIO_INVOKED GUIDELINES DESIGNINFO DISCARDABLE BEGIN IDD_ABOUTBOX, DIALOG BEGIN LEFTMARGIN, 7 RIGHTMARGIN, 228 TOPMARGIN, 7 BOTTOMMARGIN, 48 END IDD_BUTTONSDLG_DIALOG, DIALOG BEGIN LEFTMARGIN, 7 RIGHTMARGIN, 313 TOPMARGIN, 7 BOTTOMMARGIN, 193 END END #endif // APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // String Table // STRINGTABLE DISCARDABLE BEGIN IDS_ABOUTBOX "&About ButtonsDlg..." END #endif // Englisch (USA) resources ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// // Spanisch (Kastilisch) (unknown sub-lang: 0x9) resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ESO) #ifdef _WIN32 LANGUAGE LANG_SPANISH, 0x9 #pragma code_page(1252) #endif //_WIN32 ///////////////////////////////////////////////////////////////////////////// // // Bitmap // IDB_BOTON BITMAP MOVEABLE PURE "res\\bmp00001.bmp" #endif // Spanisch (Kastilisch) (unknown sub-lang: 0x9) resources ///////////////////////////////////////////////////////////////////////////// #ifndef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // Generated from the TEXTINCLUDE 3 resource. // #define _AFX_NO_SPLITTER_RESOURCES #define _AFX_NO_OLE_RESOURCES #define _AFX_NO_TRACKER_RESOURCES #define _AFX_NO_PROPERTY_RESOURCES #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) #ifdef _WIN32 LANGUAGE 9, 1 #pragma code_page(1252) #endif //_WIN32 #include "res\ButtonsDlg.rc2" // Nicht mit Microsoft Visual C++ bearbeitete Ressourcen #include "afxres.rc" // Standardkomponenten #endif ///////////////////////////////////////////////////////////////////////////// #endif // not APSTUDIO_INVOKED --- NEW FILE: ButtonsDlg.dsp --- # Microsoft Developer Studio Project File - Name="ButtonsDlg" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** NICHT BEARBEITEN ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=ButtonsDlg - Win32 Debug !MESSAGE Dies ist kein gültiges Makefile. Zum Erstellen dieses Projekts mit NMAKE !MESSAGE verwenden Sie den Befehl "Makefile exportieren" und führen Sie den Befehl !MESSAGE !MESSAGE NMAKE /f "ButtonsDlg.mak". !MESSAGE !MESSAGE Sie können beim Ausführen von NMAKE eine Konfiguration angeben !MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel: !MESSAGE !MESSAGE NMAKE /f "ButtonsDlg.mak" CFG="ButtonsDlg - Win32 Debug" !MESSAGE !MESSAGE Für die Konfiguration stehen zur Auswahl: !MESSAGE !MESSAGE "ButtonsDlg - Win32 Release" (basierend auf "Win32 (x86) Application") !MESSAGE "ButtonsDlg - Win32 Debug" (basierend auf "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "ButtonsDlg - Win32 Release" # PROP BASE Use_MFC 6 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 6 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c # ADD CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Yu"stdafx.h" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x407 /d "NDEBUG" /d "_AFXDLL" # ADD RSC /l 0x407 /d "NDEBUG" /d "_AFXDLL" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 /nologo /subsystem:windows /machine:I386 # ADD LINK32 /nologo /subsystem:windows /machine:I386 /out:"..\..\bin/ButtonsDlg.exe" !ELSEIF "$(CFG)" == "ButtonsDlg - Win32 Debug" # PROP BASE Use_MFC 6 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 6 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /GZ /c # ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x407 /d "_DEBUG" /d "_AFXDLL" # ADD RSC /l 0x407 /d "_DEBUG" /d "_AFXDLL" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 /nologo /subsystem:windows /debug /machine:I386 /out:"..\..\bin/ButtonsDlgD.exe" /pdbtype:sept !ENDIF # Begin Target # Name "ButtonsDlg - Win32 Release" # Name "ButtonsDlg - Win32 Debug" # Begin Group "Quellcodedateien" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=.\ButtonsDlg.cpp # End Source File # Begin Source File SOURCE=.\ButtonsDlg.rc # End Source File # Begin Source File SOURCE=.\ButtonsDlgDlg.cpp # End Source File # Begin Source File SOURCE=.\StdAfx.cpp # ADD CPP /Yc"stdafx.h" # End Source File # End Group # Begin Group "Header-Dateien" # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File SOURCE=.\ButtonsDlg.h # End Source File # Begin Source File SOURCE=.\ButtonsDlgDlg.h # End Source File # Begin Source File SOURCE=.\Resource.h # End Source File # Begin Source File SOURCE=.\StdAfx.h # End Source File # End Group # Begin Group "Ressourcendateien" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # Begin Source File SOURCE=.\res\bmp00001.bmp # End Source File # Begin Source File SOURCE=.\res\ButtonsDlg.ico # End Source File # Begin Source File SOURCE=.\res\ButtonsDlg.rc2 # End Source File # End Group # Begin Source File SOURCE=.\ReadMe.txt # End Source File # End Target # End Project --- NEW FILE: ButtonsDlg.h --- (This appears to be a binary file; contents omitted.) --- NEW FILE: ButtonsDlgDlg.cpp --- // ButtonsDlgDlg.cpp : Implementierungsdatei // #include "stdafx.h" #include "ButtonsDlg.h" #include "ButtonsDlgDlg.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CAboutDlg-Dialogfeld für Anwendungsbefehl "Info" class CAboutDlg : public CDialog { public: CAboutDlg(); // Dialogfelddaten //{{AFX_DATA(CAboutDlg) enum { IDD = IDD_ABOUTBOX }; //}}AFX_DATA // Vom Klassenassistenten generierte Überladungen virtueller Funktionen //{{AFX_VIRTUAL(CAboutDlg) protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV-Unterstützung //}}AFX_VIRTUAL // Implementierung protected: //{{AFX_MSG(CAboutDlg) //}}AFX_MSG DECLARE_MESSAGE_MAP() }; CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD) { //{{AFX_DATA_INIT(CAboutDlg) //}}AFX_DATA_INIT } void CAboutDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CAboutDlg) //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CAboutDlg, CDialog) //{{AFX_MSG_MAP(CAboutDlg) // Keine Nachrichten-Handler //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CButtonsDlgDlg Dialogfeld CButtonsDlgDlg::CButtonsDlgDlg(CWnd* pParent /*=NULL*/) : CDialog(CButtonsDlgDlg::IDD, pParent) { //{{AFX_DATA_INIT(CButtonsDlgDlg) // HINWEIS: Der Klassenassistent fügt hier Member-Initialisierung ein //}}AFX_DATA_INIT // Beachten Sie, dass LoadIcon unter Win32 keinen nachfolgenden DestroyIcon-Aufruf benötigt m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); } void CButtonsDlgDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CButtonsDlgDlg) DDX_Control(pDX, IDC_XP_INACTIVE, m_btXPInactive); DDX_Control(pDX, IDC_XP_IMAGE_TEXT_INACTIVE, m_btXPImageTextInactive); DDX_Control(pDX, IDC_XP_IMAGE_TEXT, m_btXPImageText); DDX_Control(pDX, IDC_XP_IMAGE_INACTIVE, m_btXPImageInactive); DDX_Control(pDX, IDC_XP_IMAGE, m_btXPImage); DDX_Control(pDX, IDC_XP, m_btXP); DDX_Control(pDX, IDC_STANDARD_INACTIVE, m_btStandardInactive); DDX_Control(pDX, IDC_STANDARD, m_btStandard); DDX_Control(pDX, IDC_SEMIFLAT_INACTIVE, m_btSemiflatInactive); DDX_Control(pDX, IDC_SEMIFLAT_IMAGE_TEXT_INACTIVE, m_btSemiflatImageTextInactive); DDX_Control(pDX, IDC_SEMIFLAT_IMAGE_TEXT, m_btSemiflatImageText); DDX_Control(pDX, IDC_SEMIFLAT_IMAGE_INACTIVE, m_btSemiflatImageInactive); DDX_Control(pDX, IDC_SEMIFLAT_IMAGE, m_btSemiflatImage); DDX_Control(pDX, IDC_SEMIFLAT, m_btSemiflat); DDX_Control(pDX, IDC_FLAT_INACTIVE, m_btFlatInactive); DDX_Control(pDX, IDC_FLAT_IMAGE_TEXT_INACTIVE, m_btFlatImageTextInactive); DDX_Control(pDX, IDC_FLAT_IMAGE_TEXT, m_btFlatImageText); DDX_Control(pDX, IDC_FLAT_IMAGE_INACTIVE, m_btFlatImageInactive); DDX_Control(pDX, IDC_FLAT_IMAGE, m_btFlatImage); DDX_Control(pDX, IDC_FLAT, m_btFlat); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CButtonsDlgDlg, CDialog) //{{AFX_MSG_MAP(CButtonsDlgDlg) ON_WM_SYSCOMMAND() ON_WM_PAINT() ON_WM_QUERYDRAGICON() //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CButtonsDlgDlg Nachrichten-Handler BOOL CButtonsDlgDlg::OnInitDialog() { CDialog::OnInitDialog(); // Hinzufügen des Menübefehls "Info..." zum Systemmenü. // IDM_ABOUTBOX muss sich im Bereich der Systembefehle befinden. ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX); ASSERT(IDM_ABOUTBOX < 0xF000); CMenu* pSysMenu = GetSystemMenu(FALSE); if (pSysMenu != NULL) { CString strAboutMenu; strAboutMenu.LoadString(IDS_ABOUTBOX); if (!strAboutMenu.IsEmpty()) { pSysMenu->AppendMenu(MF_SEPARATOR); pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu); } } // Symbol für dieses Dialogfeld festlegen. Wird automatisch erledigt // wenn das Hauptfenster der Anwendung kein Dialogfeld ist SetIcon(m_hIcon, TRUE); // Großes Symbol verwenden SetIcon(m_hIcon, FALSE); // Kleines Symbol verwenden m_btFlat.SetStyleBorder(CGuiButton::STYLE_FLAT); m_btFlatImage.SetStyleBorder(CGuiButton::STYLE_FLAT); m_btFlatImageInactive.SetStyleBorder(CGuiButton::STYLE_FLAT); m_btFlatImageText.SetStyleBorder(CGuiButton::STYLE_FLAT); m_btFlatImageTextInactive.SetStyleBorder(CGuiButton::STYLE_FLAT); m_btFlatInactive.SetStyleBorder(CGuiButton::STYLE_FLAT); m_btSemiflat.SetStyleBorder(CGuiButton::STYLE_SEMIFLAT); m_btSemiflatImage.SetStyleBorder(CGuiButton::STYLE_SEMIFLAT); m_btSemiflatImageInactive.SetStyleBorder(CGuiButton::STYLE_SEMIFLAT); m_btSemiflatImageText.SetStyleBorder(CGuiButton::STYLE_SEMIFLAT); m_btSemiflatImageTextInactive.SetStyleBorder(CGuiButton::STYLE_SEMIFLAT); m_btSemiflatInactive.SetStyleBorder(CGuiButton::STYLE_SEMIFLAT); m_btXP.SetStyleBorder(CGuiButton::STYLEXP); m_btXPImage.SetStyleBorder(CGuiButton::STYLEXP); m_btXPImageInactive.SetStyleBorder(CGuiButton::STYLEXP); m_btXPImageText.SetStyleBorder(CGuiButton::STYLEXP); m_btXPImageTextInactive.SetStyleBorder(CGuiButton::STYLEXP); m_btXPInactive.SetStyleBorder(CGuiButton::STYLEXP); m_btFlatImage.SetImageBitmap(IDB_BOTON); m_btFlatImageInactive.SetImageBitmap(IDB_BOTON); m_btFlatImageText.SetImageBitmap(IDB_BOTON); m_btFlatImageTextInactive.SetImageBitmap(IDB_BOTON); m_btSemiflatImage.SetImageBitmap(IDB_BOTON); m_btSemiflatImageInactive.SetImageBitmap(IDB_BOTON); m_btSemiflatImageText.SetImageBitmap(IDB_BOTON); m_btSemiflatImageTextInactive.SetImageBitmap(IDB_BOTON); m_btXPImage.SetImageBitmap(IDB_BOTON); m_btXPImageInactive.SetImageBitmap(IDB_BOTON); m_btXPImageText.SetImageBitmap(IDB_BOTON); m_btXPImageTextInactive.SetImageBitmap(IDB_BOTON); m_btFlatImage.ShowText(FALSE); m_btFlatImageInactive.ShowText(FALSE); m_btSemiflatImage.ShowText(FALSE); m_btSemiflatImageInactive.ShowText(FALSE); m_btXPImage.ShowText(FALSE); m_btXPImageInactive.ShowText(FALSE); return TRUE; // Geben Sie TRUE zurück, außer ein Steuerelement soll den Fokus erhalten } void CButtonsDlgDlg::OnSysCommand(UINT nID, LPARAM lParam) { if ((nID & 0xFFF0) == IDM_ABOUTBOX) { CAboutDlg dlgAbout; dlgAbout.DoModal(); } else { CDialog::OnSysCommand(nID, lParam); } } // Wollen Sie Ihrem Dialogfeld eine Schaltfläche "Minimieren" hinzufügen, benötigen Sie // den nachstehenden Code, um das Symbol zu zeichnen. Für MFC-Anwendungen, die das // Dokument/Ansicht-Modell verwenden, wird dies automatisch für Sie erledigt. void CButtonsDlgDlg::OnPaint() { if (IsIconic()) { CPaintDC dc(this); // Gerätekontext für Zeichnen SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0); // Symbol in Client-Rechteck zentrieren int cxIcon = GetSystemMetrics(SM_CXICON); int cyIcon = GetSystemMetrics(SM_CYICON); CRect rect; GetClientRect(&rect); int x = (rect.Width() - cxIcon + 1) / 2; int y = (rect.Height() - cyIcon + 1) / 2; // Symbol zeichnen dc.DrawIcon(x, y, m_hIcon); } else { CDialog::OnPaint(); } } // Die Systemaufrufe fragen den Cursorform ab, die angezeigt werden soll, während der Benutzer // das zum Symbol verkleinerte Fenster mit der Maus zieht. HCURSOR CButtonsDlgDlg::OnQueryDragIcon() { return (HCURSOR) m_hIcon; } --- NEW FILE: StdAfx.h --- (This appears to be a binary file; contents omitted.) --- NEW FILE: StdAfx.cpp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: resource.h --- //{{NO_DEPENDENCIES}} // Microsoft Developer Studio generated include file. // Used by ButtonsDlg.rc // #define IDM_ABOUTBOX 0x0010 #define IDD_ABOUTBOX 100 #define IDS_ABOUTBOX 101 #define IDD_BUTTONSDLG_DIALOG 102 #define IDR_MAINFRAME 128 #define IDB_BOTON 133 #define IDC_STANDARD 1000 #define IDC_STANDARD_INACTIVE 1001 #define IDC_SEMIFLAT 1002 #define IDC_SEMIFLAT_INACTIVE 1003 #define IDC_SEMIFLAT_IMAGE 1004 #define IDC_FLAT_IMAGE_INACTIVE 1005 #define IDC_SEMIFLAT_IMAGE_TEXT 1006 #define IDC_SEMIFLAT_IMAGE_TEXT_INACTIVE 1007 #define IDC_FLAT 1008 #define IDC_FLAT_INACTIVE 1009 #define IDC_FLAT_IMAGE 1010 #define IDC_SEMIFLAT_IMAGE_INACTIVE 1011 #define IDC_FLAT_IMAGE_TEXT 1012 #define IDC_FLAT_IMAGE_TEXT_INACTIVE 1013 #define IDC_XP_IMAGE_INACTIVE 1014 #define IDC_XP 1015 #define IDC_XP_INACTIVE 1016 #define IDC_XP_IMAGE 1017 #define IDC_XP_IMAGE_TEXT 1018 #define IDC_XP_IMAGE_TEXT_INACTIVE 1019 // Next default values for new objects // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 129 #define _APS_NEXT_COMMAND_VALUE 40001 #define _APS_NEXT_CONTROL_VALUE 1008 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif --- NEW FILE: ButtonsDlg.cpp --- (This appears to be a binary file; contents omitted.) |